diff --git a/CHANGELOG.md b/CHANGELOG.md index 66d9c2c1a8..a51f4884e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [Unreleased] +### Added +- Bundled client-side SPARQL engine (Comunica) for in-browser CONSTRUCT execution, lazily loaded on first use + ### Changed +- **BREAKING**: "Import ontology" transform orchestrated client-side — the browser runs the CONSTRUCT in-browser (bundled SPARQL engine), the CLI (`import-ontology.sh`) runs it via Jena `sparql`; replaces the `/transform` endpoint - Application ontologies resolved as a native ontapi `owl:imports` union graph (cached per ontology URI), no RDFS inference — replaces the manually flattened, RDFS-materialized model - `Namespace` no-query GET serves the raw ontology graph from the shared repository instead of rebuilding one per request - **BREAKING**: "Add data" and "Generate containers" orchestrated client-side over the Graph Store Protocol (POST-append via `?uri=` proxy; per-class container PUT fan-out embedding the view as `ldh:Object` → `rdf:value` → `ldh:View`), replacing the `/add` and `/generate` endpoints @@ -9,7 +13,7 @@ ### Removed - Linked Data proxy no longer serves ontology terms (now dumb transport: bundled-vocab file cache + SSRF-checked external fetch); ontology terms served by `/ns` -- **BREAKING**: `/add` and `/generate` server-side endpoints (`Add`/`Generate` JAX-RS resources), superseded by the client-orchestrated writes; removes their server-side fetch/SSRF surface (LNK-002); `/transform` retained until a client-side SPARQL engine lands +- **BREAKING**: `/add`, `/generate` and `/transform` server-side endpoints (`Add`/`Generate`/`Transform` JAX-RS resources), superseded by the client-orchestrated writes; removes their server-side fetch/SSRF surface (LNK-002) ## [5.7.1] - 2026-08-06 ### Changed diff --git a/bin/admin/ontologies/import-ontology.sh b/bin/admin/ontologies/import-ontology.sh index 4aa33fdd71..7e9e031538 100755 --- a/bin/admin/ontologies/import-ontology.sh +++ b/bin/admin/ontologies/import-ontology.sh @@ -2,20 +2,26 @@ print_usage() { - printf "Imports external ontology into the model.\n" + printf "Imports an external ontology into a document.\n" + printf "\n" + printf "Fetches the source ontology, runs the construct-constructors CONSTRUCT query over it locally\n" + printf "(Jena sparql), and appends the result to the target graph over the Graph Store Protocol.\n" printf "\n" printf "Usage: %s options\n" "$0" printf "\n" printf "Options:\n" printf " -f, --cert-pem-file CERT_FILE .pem file with the WebID certificate of the agent\n" printf " -p, --cert-password CERT_PASSWORD Password of the WebID certificate\n" - printf " --proxy PROXY_URL The host this request will be proxied through (optional)\n" + printf " -b, --base BASE_URI Base URI of the application\n" + printf " --proxy PROXY_URL The host requests to the application are proxied through (optional)\n" printf "\n" printf " --source SOURCE_URI URI of the imported ontology\n" + printf " --graph GRAPH_URI URI of the target document the result is appended to\n" } -hash turtle 2>/dev/null || { echo >&2 "turtle not on \$PATH. Aborting."; exit 1; } +hash sparql 2>/dev/null || { echo >&2 "sparql (Jena) not on \$PATH. Aborting."; exit 1; } hash curl 2>/dev/null || { echo >&2 "curl not on \$PATH. Aborting."; exit 1; } +hash xmllint 2>/dev/null || { echo >&2 "xmllint not on \$PATH. Aborting."; exit 1; } args=() while [[ $# -gt 0 ]] @@ -82,20 +88,54 @@ if [ -z "$graph" ] ; then exit 1 fi -target="${base}transform" +# rewrite an application URL's host to the proxy host, when a proxy is given +rewrite_proxy() +{ + local url="$1" + + if [ -n "$proxy" ]; then + local url_host proxy_host + url_host=$(echo "$url" | cut -d '/' -f 1,2,3) + proxy_host=$(echo "$proxy" | cut -d '/' -f 1,2,3) + echo "${url/$url_host/$proxy_host}" + else + echo "$url" + fi +} + +query_doc="${base}queries/construct-constructors/" +query_url=$(rewrite_proxy "$query_doc") +graph_url=$(rewrite_proxy "$graph") + +tmp_dir=$(mktemp -d) +trap 'rm -rf "$tmp_dir"' EXIT -if [ -n "$proxy" ]; then - # rewrite target hostname to proxy hostname - target_host=$(echo "$target" | cut -d '/' -f 1,2,3) - proxy_host=$(echo "$proxy" | cut -d '/' -f 1,2,3) - target="${target/$target_host/$proxy_host}" +# 1. fetch the construct-constructors query document, then extract its exact sp:text via a SPARQL SELECT + +curl -s -k -E "$cert_pem_file":"$cert_password" -H "Accept: text/turtle" "$query_url" > "$tmp_dir/query.ttl" + +cat > "$tmp_dir/extract-text.rq" < +SELECT ?text WHERE { <${base}queries/construct-constructors/#this> sp:text ?text } +RQ + +sparql --data "$tmp_dir/query.ttl" --query "$tmp_dir/extract-text.rq" --results=XML \ + | xmllint --xpath 'string(//*[local-name()="literal"])' - \ + > "$tmp_dir/construct.rq" + +if [ ! -s "$tmp_dir/construct.rq" ]; then + echo >&2 "Could not extract the CONSTRUCT query (sp:text) from ${query_doc}. Aborting." + exit 1 fi -content_type="text/turtle" +# 2. run the CONSTRUCT over the source ontology locally, producing Turtle + +sparql --data "$source" --query "$tmp_dir/construct.rq" --results=Turtle > "$tmp_dir/result.ttl" -turtle+="_:arg <${source}> .\n" -turtle+="_:arg <${graph}> .\n" -turtle+="_:arg <${base}queries/construct-constructors/#this> .\n" +# 3. append the transformed triples to the target graph (Graph Store Protocol POST) -# submit Turtle doc to the server -echo -e "$turtle" | turtle --base="$target" | curl -s -k -E "$cert_pem_file":"$cert_password" -d @- -H "Content-Type: $content_type" -H "Accept: text/turtle" "$target" -s -D - \ No newline at end of file +curl -s -k -E "$cert_pem_file":"$cert_password" \ + --data-binary @"$tmp_dir/result.ttl" \ + -H "Content-Type: text/turtle" \ + -H "Accept: text/turtle" \ + "$graph_url" -D - diff --git a/http-tests/admin/model/POST-transform.sh b/http-tests/admin/model/POST-transform.sh deleted file mode 100755 index 690987cbd2..0000000000 --- a/http-tests/admin/model/POST-transform.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -initialize_dataset "$END_USER_BASE_URL" "$TMP_END_USER_DATASET" "$END_USER_ENDPOINT_URL" -initialize_dataset "$ADMIN_BASE_URL" "$TMP_ADMIN_DATASET" "$ADMIN_ENDPOINT_URL" -purge_cache "$END_USER_VARNISH_SERVICE" -purge_cache "$ADMIN_VARNISH_SERVICE" - -namespace_doc="${END_USER_BASE_URL}ns" -namespace="${namespace_doc}#" -ontology_doc="${ADMIN_BASE_URL}ontologies/namespace/" -import_uri="http://www.w3.org/2004/02/skos/core" - -# create item - -slug="test" - -item=$(create-item.sh \ - -f "$OWNER_CERT_FILE" \ - -p "$OWNER_CERT_PWD" \ - -b "$ADMIN_BASE_URL" \ - --title "Test" \ - --slug "$slug" \ - --container "${ADMIN_BASE_URL}ontologies/") - -# load the ontology, transform it and append it to the item document - -curl -w "%{http_code}\n" -o /dev/null -k -s \ - -E "$OWNER_CERT_FILE":"$OWNER_CERT_PWD" \ - -H "Accept: text/turtle" \ - -H "Content-Type: application/x-www-form-urlencoded" \ - --data-urlencode "rdf=" \ - --data-urlencode "sb=transform" \ - --data-urlencode "pu=http://spinrdf.org/spin#query" \ - --data-urlencode "ou=${ADMIN_BASE_URL}queries/construct-constructors/#this" \ - --data-urlencode "pu=http://purl.org/dc/terms/source" \ - --data-urlencode "ou=${import_uri}" \ - --data-urlencode "pu=http://www.w3.org/ns/sparql-service-description#name" \ - --data-urlencode "ou=${item}" \ - "${ADMIN_BASE_URL}transform" \ -| grep -q "$STATUS_NO_CONTENT" - -# add ontology import - -add-ontology-import.sh \ - -f "$OWNER_CERT_FILE" \ - -p "$OWNER_CERT_PWD" \ - --import "$import_uri" \ - "$ontology_doc" - -# clear the namespace ontology from memory - -clear-ontology.sh \ - -f "$OWNER_CERT_FILE" \ - -p "$OWNER_CERT_PWD" \ - -b "$ADMIN_BASE_URL" \ - --ontology "$namespace" - -# check that the imported ontology is present in the ontology model TO-DO: replace with an ASK query when #118 is fixed - -curl -k -f -s \ - -G \ - -E "$OWNER_CERT_FILE":"$OWNER_CERT_PWD" \ - -H 'Accept: application/sparql-results+xml' \ - --data-urlencode "query=SELECT * { <${import_uri}> ?p ?o }" \ - "$namespace_doc" \ -| grep 'SKOS Vocabulary' > /dev/null diff --git a/http-tests/system/admin/POST-transform-401.sh b/http-tests/system/admin/POST-transform-401.sh deleted file mode 100755 index 998591f944..0000000000 --- a/http-tests/system/admin/POST-transform-401.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -initialize_dataset "$END_USER_BASE_URL" "$TMP_END_USER_DATASET" "$END_USER_ENDPOINT_URL" -initialize_dataset "$ADMIN_BASE_URL" "$TMP_ADMIN_DATASET" "$ADMIN_ENDPOINT_URL" -purge_cache "$END_USER_VARNISH_SERVICE" -purge_cache "$ADMIN_VARNISH_SERVICE" -purge_cache "$FRONTEND_VARNISH_SERVICE" - -# POST /transform without a certificate should return 401 -# Only owners have access to /transform via full-control authorization in admin.trig - -curl -k -w "%{http_code}\n" -o /dev/null -s \ - -X POST \ - -H "Content-Type: application/x-www-form-urlencoded" \ - --data-urlencode "rdf=" \ - "${ADMIN_BASE_URL}transform" \ -| grep -q "$STATUS_UNAUTHORIZED" diff --git a/http-tests/system/admin/POST-transform-403.sh b/http-tests/system/admin/POST-transform-403.sh deleted file mode 100755 index da7015cffe..0000000000 --- a/http-tests/system/admin/POST-transform-403.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -initialize_dataset "$END_USER_BASE_URL" "$TMP_END_USER_DATASET" "$END_USER_ENDPOINT_URL" -initialize_dataset "$ADMIN_BASE_URL" "$TMP_ADMIN_DATASET" "$ADMIN_ENDPOINT_URL" -purge_cache "$END_USER_VARNISH_SERVICE" -purge_cache "$ADMIN_VARNISH_SERVICE" -purge_cache "$FRONTEND_VARNISH_SERVICE" - -# POST /transform with a writer (not owner) should return 403 -# /transform is only in the full-control authorization which is restricted to owners - -add-agent-to-group.sh \ - -f "$OWNER_CERT_FILE" \ - -p "$OWNER_CERT_PWD" \ - --agent "$AGENT_URI" \ - "${ADMIN_BASE_URL}acl/groups/writers/" - -curl -k -w "%{http_code}\n" -o /dev/null -s \ - -E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \ - -X POST \ - -H "Content-Type: application/x-www-form-urlencoded" \ - --data-urlencode "rdf=" \ - "${ADMIN_BASE_URL}transform" \ -| grep -q "$STATUS_FORBIDDEN" diff --git a/http-tests/system/admin/POST-transform-readers-403.sh b/http-tests/system/admin/POST-transform-readers-403.sh deleted file mode 100755 index 0093116bcb..0000000000 --- a/http-tests/system/admin/POST-transform-readers-403.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -initialize_dataset "$END_USER_BASE_URL" "$TMP_END_USER_DATASET" "$END_USER_ENDPOINT_URL" -initialize_dataset "$ADMIN_BASE_URL" "$TMP_ADMIN_DATASET" "$ADMIN_ENDPOINT_URL" -purge_cache "$END_USER_VARNISH_SERVICE" -purge_cache "$ADMIN_VARNISH_SERVICE" -purge_cache "$FRONTEND_VARNISH_SERVICE" - -# POST /transform with a reader should return 403 -# /transform is only in the full-control authorization which is restricted to owners - -add-agent-to-group.sh \ - -f "$OWNER_CERT_FILE" \ - -p "$OWNER_CERT_PWD" \ - --agent "$AGENT_URI" \ - "${ADMIN_BASE_URL}acl/groups/readers/" - -curl -k -w "%{http_code}\n" -o /dev/null -s \ - -E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \ - -X POST \ - -H "Content-Type: application/x-www-form-urlencoded" \ - --data-urlencode "rdf=" \ - "${ADMIN_BASE_URL}transform" \ -| grep -q "$STATUS_FORBIDDEN" diff --git a/src/main/java/com/atomgraph/linkeddatahub/resource/Transform.java b/src/main/java/com/atomgraph/linkeddatahub/resource/Transform.java deleted file mode 100644 index 1f84d3a779..0000000000 --- a/src/main/java/com/atomgraph/linkeddatahub/resource/Transform.java +++ /dev/null @@ -1,349 +0,0 @@ -/** - * Copyright 2022 Martynas Jusevičius - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.atomgraph.linkeddatahub.resource; - -import com.atomgraph.core.MediaTypes; -import com.atomgraph.core.vocabulary.SD; -import com.atomgraph.linkeddatahub.client.GraphStoreClient; -import com.atomgraph.linkeddatahub.imports.QueryLoader; -import com.atomgraph.linkeddatahub.server.io.ValidatingModelProvider; -import com.atomgraph.linkeddatahub.server.model.impl.DocumentHierarchyGraphStoreImpl; -import com.atomgraph.linkeddatahub.server.security.AgentContext; -import com.atomgraph.linkeddatahub.vocabulary.NFO; -import com.atomgraph.spinrdf.vocabulary.SPIN; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Map; -import java.util.Optional; -import jakarta.inject.Inject; -import jakarta.ws.rs.BadRequestException; -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.NotAllowedException; -import jakarta.ws.rs.POST; -import jakarta.ws.rs.client.Entity; -import jakarta.ws.rs.container.ResourceContext; -import jakarta.ws.rs.core.Context; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Request; -import jakarta.ws.rs.core.Response; -import jakarta.ws.rs.core.UriInfo; -import jakarta.ws.rs.ext.MessageBodyReader; -import jakarta.ws.rs.ext.Providers; -import org.apache.jena.atlas.RuntimeIOException; -import org.apache.jena.query.Query; -import org.apache.jena.query.QueryExecution; -import org.apache.jena.query.Syntax; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ResIterator; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.vocabulary.DCTerms; -import org.glassfish.jersey.media.multipart.FormDataBodyPart; -import org.glassfish.jersey.media.multipart.FormDataMultiPart; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * JAX-RS resource that transforms uploaded RDF and then adds it. - * - * @author {@literal Martynas Jusevičius } - */ -public class Transform -{ - - private static final Logger log = LoggerFactory.getLogger(Transform.class); - - private final UriInfo uriInfo; - private final MediaTypes mediaTypes; - private final com.atomgraph.linkeddatahub.apps.model.Application application; - private final Optional agentContext; - private final Providers providers; - private final com.atomgraph.linkeddatahub.Application system; - private final ResourceContext resourceContext; - - /** - * Constructs endpoint for synchronous RDF data imports. - * - * @param request current request - * @param uriInfo current URI info - * @param mediaTypes supported media types - * @param application current application - * @param providers JAX-RS providers - * @param system system application - * @param agentContext authenticated agent's context - * @param resourceContext resource context - */ - @Inject - public Transform(@Context Request request, @Context UriInfo uriInfo, MediaTypes mediaTypes, - com.atomgraph.linkeddatahub.apps.model.Application application, - Optional agentContext, - @Context Providers providers, com.atomgraph.linkeddatahub.Application system, - @Context ResourceContext resourceContext) - { - this.uriInfo = uriInfo; - this.mediaTypes = mediaTypes; - this.application = application; - this.agentContext = agentContext; - this.providers = providers; - this.system = system; - this.resourceContext = resourceContext; - } - - /** - * Rejects GET requests on this endpoint. - * - * @return never returns normally - * @throws NotAllowedException always thrown to indicate GET is not supported - */ - @GET - public Response get() - { - throw new NotAllowedException("GET is not allowed on this endpoint"); - } - - /** - * Transforms RDF data from a remote source using a SPARQL CONSTRUCT query and adds it to a target graph. - * Validates URIs to prevent SSRF attacks before processing. - * - * @param model RDF model containing transformation parameters (dct:source, sd:name, spin:query) - * @return HTTP response from forwarding the transformed data to the target graph - * @throws BadRequestException if required parameters are missing or invalid - */ - @POST - public Response post(Model model) - { - ResIterator it = model.listSubjectsWithProperty(DCTerms.source); - try - { - if (!it.hasNext()) throw new BadRequestException("Argument resource not provided"); - - Resource arg = it.next(); - Resource source = arg.getPropertyResourceValue(DCTerms.source); - if (source == null) throw new BadRequestException("RDF source URI (dct:source) not provided"); - - Resource graph = arg.getPropertyResourceValue(SD.name); - if (graph == null || !graph.isURIResource()) throw new BadRequestException("Graph URI (sd:name) not provided"); - - Resource queryRes = arg.getPropertyResourceValue(SPIN.query); - if (queryRes == null) throw new BadRequestException("Transformation query string (spin:query) not provided"); - - // LNK-002: Validate URIs to prevent SSRF attacks - getSystem().getURLValidator().validate(URI.create(queryRes.getURI())); - getSystem().getURLValidator().validate(URI.create(source.getURI())); - - GraphStoreClient gsc = GraphStoreClient.create(getSystem().getClient(), getSystem().getMediaTypes()). - delegation(getUriInfo().getBaseUri(), getAgentContext().orElse(null)); - QueryLoader queryLoader = new QueryLoader(URI.create(queryRes.getURI()), getApplication().getBase().getURI(), Syntax.syntaxARQ, gsc); - Query query = queryLoader.get(); - if (!query.isConstructType()) throw new BadRequestException("Transformation query is not of CONSTRUCT type"); - - Model importModel = gsc.getModel(source.getURI()); - try (QueryExecution qex = QueryExecution.create(query, importModel)) - { - Model transformModel = qex.execConstruct(); - importModel.add(transformModel); // append transform results - // forward the stream to the named graph document -- do not directly append triples to graph because the agent might not have access to it - return forwardPost(Entity.entity(importModel, com.atomgraph.core.MediaType.APPLICATION_NTRIPLES_TYPE), graph.getURI()); - } - } - finally - { - it.close(); - } - } - - /** - * Handles multipart requests with RDF files. - * - * @param multiPart multipart request object - * @return response - */ - @POST - @Consumes(MediaType.MULTIPART_FORM_DATA) - public Response postMultipart(FormDataMultiPart multiPart) - { - if (log.isDebugEnabled()) log.debug("MultiPart fields: {} body parts: {}", multiPart.getFields(), multiPart.getBodyParts()); - - try - { - DocumentHierarchyGraphStoreImpl graphStore = getResourceContext().getResource(DocumentHierarchyGraphStoreImpl.class); - - Model model = graphStore.parseModel(multiPart); // do not skolemize because we don't know the graphUri yet - MessageBodyReader reader = getProviders().getMessageBodyReader(Model.class, null, null, com.atomgraph.core.MediaType.APPLICATION_NTRIPLES_TYPE); - if (reader instanceof ValidatingModelProvider validatingModelProvider) model = validatingModelProvider.processRead(model); - if (log.isDebugEnabled()) log.debug("POSTed Model size: {}", model.size()); - - return postFileBodyPart(model, graphStore.getFileNameBodyPartMap(multiPart)); // do not write the uploaded file -- instead append its triples/quads - } - catch (URISyntaxException ex) - { - if (log.isErrorEnabled()) log.error("URI '{}' has syntax error in request with media type: {}", ex.getInput(), multiPart.getMediaType()); - throw new BadRequestException(ex); - } - catch (RuntimeIOException ex) - { - if (log.isErrorEnabled()) log.error("Could not read uploaded file as media type: {}", multiPart.getMediaType()); - throw new BadRequestException(ex); - } - } - - /** - * Handles uploaded RDF file. - * - * @param model RDF graph - * @param fileNameBodyPartMap parts of the multipart request - * @return response response - */ - public Response postFileBodyPart(Model model, Map fileNameBodyPartMap) - { - if (model == null) throw new IllegalArgumentException("Model cannot be null"); - if (fileNameBodyPartMap == null) throw new IllegalArgumentException("Map cannot be null"); - - ResIterator resIt = model.listResourcesWithProperty(NFO.fileName); - try - { - if (!resIt.hasNext()) throw new BadRequestException("File body part not found in the multipart request"); - - Resource file = resIt.next(); - String fileName = file.getProperty(NFO.fileName).getString(); - FormDataBodyPart bodyPart = fileNameBodyPartMap.get(fileName); - - Resource graph = file.getPropertyResourceValue(SD.name); - if (graph == null || !graph.isURIResource()) throw new BadRequestException("Graph URI (sd:name) not provided"); - if (!file.hasProperty(DCTerms.format)) throw new BadRequestException("RDF format (dct:format) not provided"); - - MediaType mediaType = com.atomgraph.linkeddatahub.MediaType.valueOf(file.getPropertyResourceValue(DCTerms.format)); - bodyPart.setMediaType(mediaType); - Model bodyPartModel = bodyPart.getValueAs(Model.class); - - Resource queryRes = file.getPropertyResourceValue(SPIN.query); - if (queryRes == null) throw new BadRequestException("Transformation query string (spin:query) not provided"); - - // LNK-002: Validate query URI to prevent SSRF attacks - getSystem().getURLValidator().validate(URI.create(queryRes.getURI())); - - GraphStoreClient gsc = GraphStoreClient.create(getSystem().getClient(), getSystem().getMediaTypes()). - delegation(getUriInfo().getBaseUri(), getAgentContext().orElse(null)); - QueryLoader queryLoader = new QueryLoader(URI.create(queryRes.getURI()), getApplication().getBase().getURI(), Syntax.syntaxARQ, gsc); - Query query = queryLoader.get(); - if (!query.isConstructType()) throw new BadRequestException("Transformation query is not of CONSTRUCT type"); - - try (QueryExecution qex = QueryExecution.create(query, bodyPartModel)) - { - Model transformModel = qex.execConstruct(); - bodyPartModel.add(transformModel); // append transform results - // forward the model to the named graph document - return forwardPost(Entity.entity(bodyPartModel, com.atomgraph.core.MediaType.APPLICATION_NTRIPLES_TYPE), graph.getURI()); - } - } - finally - { - resIt.close(); - } - } - - /** - * Forwards POST request to a graph. - * - * @param entity request entity - * @param graphURI the graph URI - * @return JAX-RS response - */ - protected Response forwardPost(Entity entity, String graphURI) - { - GraphStoreClient gsc = GraphStoreClient.create(getSystem().getClient(), getSystem().getMediaTypes()). - delegation(getUriInfo().getBaseUri(), getAgentContext().orElse(null)); - // forward the stream to the named graph document. Buffer the entity first so that the server response is not returned before the client response completes - try (Response response = gsc.post(URI.create(graphURI), entity, gsc.getReadableMediaTypes(Model.class))) - { - return Response.status(response.getStatus()). - entity(response.readEntity(Model.class)). - build(); - } - } - - /** - * Returns the supported media types. - * - * @return media types - */ - public MediaTypes getMediaTypes() - { - return mediaTypes; - } - - /** - * Returns the current application. - * - * @return application resource - */ - public com.atomgraph.linkeddatahub.apps.model.Application getApplication() - { - return application; - } - - /** - * Returns the current URI info. - * - * @return URI info - */ - public UriInfo getUriInfo() - { - return uriInfo; - } - - /** - * Returns the authenticated agent's context. - * - * @return optional agent context - */ - public Optional getAgentContext() - { - return agentContext; - } - - /** - * Returns the registry of JAX-RS providers. - * - * @return JAX-RS providers registry - */ - public Providers getProviders() - { - return providers; - } - - /** - * Returns the system application. - * - * @return system application - */ - public com.atomgraph.linkeddatahub.Application getSystem() - { - return system; - } - - /** - * Returns the JAX-RS resource context. - * - * @return resource context - */ - public ResourceContext getResourceContext() - { - return resourceContext; - } - -} diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/model/impl/Dispatcher.java b/src/main/java/com/atomgraph/linkeddatahub/server/model/impl/Dispatcher.java index bfbc2562bb..c2bba34d18 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/model/impl/Dispatcher.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/model/impl/Dispatcher.java @@ -17,7 +17,6 @@ package com.atomgraph.linkeddatahub.server.model.impl; import com.atomgraph.linkeddatahub.resource.Namespace; -import com.atomgraph.linkeddatahub.resource.Transform; import com.atomgraph.linkeddatahub.resource.admin.ClearOntology; import com.atomgraph.linkeddatahub.resource.admin.pkg.InstallPackage; import com.atomgraph.linkeddatahub.resource.admin.pkg.UninstallPackage; @@ -132,17 +131,6 @@ public Class getFileItem() return com.atomgraph.linkeddatahub.resource.upload.Item.class; } - /** - * Returns the endpoint for synchronous RDF imports with a CONSTRUCT query transformation. - * - * @return endpoint resource - */ - @Path("transform") - public Class getTransformEndpoint() - { - return Transform.class; - } - /** * Returns the endpoint that allows clearing ontologies from cache by URI. * diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/js/SPARQLTransform.js b/src/main/webapp/static/com/atomgraph/linkeddatahub/js/SPARQLTransform.js new file mode 100644 index 0000000000..918f17dd14 --- /dev/null +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/js/SPARQLTransform.js @@ -0,0 +1,101 @@ +/** + * Copyright 2026 Martynas Jusevičius + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Client-side SPARQL CONSTRUCT execution, replacing the former server-side /transform endpoint. + * Runs a CONSTRUCT query over a Linked Data source entirely in the browser and returns the result + * serialized as Turtle, ready to be appended to the target document over the Graph Store Protocol. + * + * The (large) SPARQL engine bundle is loaded lazily on first use, so it is fetched only when an + * agent actually runs a transform, never on ordinary page loads. + */ +"use strict"; + +window.LinkedDataHub = window.LinkedDataHub || {}; + +(function(ldh) +{ + var enginePromise = null; + + // inject the engine bundle once and resolve with a query engine when its global is ready + function loadEngine(engineSrc) + { + if (enginePromise) return enginePromise; + + enginePromise = new Promise(function(resolve, reject) + { + if (window.Comunica && window.Comunica.QueryEngine) + { + resolve(new window.Comunica.QueryEngine()); + return; + } + + var script = document.createElement("script"); + script.src = engineSrc; + script.onload = function() + { + if (window.Comunica && window.Comunica.QueryEngine) resolve(new window.Comunica.QueryEngine()); + else reject(new Error("SPARQL engine loaded but Comunica.QueryEngine is undefined")); + }; + script.onerror = function() { reject(new Error("Failed to load SPARQL engine bundle: " + engineSrc)); }; + document.head.appendChild(script); + }); + + return enginePromise; + } + + // read the serializer's output (a Node-style readable stream, or an async iterable) into a string + function readToString(data) + { + if (data && typeof data.on === "function") + { + return new Promise(function(resolve, reject) + { + var text = ""; + data.on("data", function(chunk) { text += chunk; }); + data.on("end", function() { resolve(text); }); + data.on("error", reject); + }); + } + + return (async function() + { + var text = ""; + for await (var chunk of data) text += chunk; + return text; + })(); + } + + /* + * Run a CONSTRUCT query over the RDF source at sourceURL and resolve with the result as Turtle. + * sourceURL must be same-origin (route external sources through the ?uri= proxy) to avoid CORS; + * the engine fetches, content-negotiates and parses it, so any Jena-serializable format works. + */ + ldh.construct = function(engineSrc, sourceURL, queryString) + { + return loadEngine(engineSrc).then(function(engine) + { + return engine.query(queryString, { sources: [ sourceURL ] }).then(function(result) + { + return engine.resultToString(result, "text/turtle").then(function(serialized) + { + return readToString(serialized.data); + }); + }); + }); + }; + +})(window.LinkedDataHub); diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/js/comunica-browser.js b/src/main/webapp/static/com/atomgraph/linkeddatahub/js/comunica-browser.js new file mode 100644 index 0000000000..fc3fe55ea1 --- /dev/null +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/js/comunica-browser.js @@ -0,0 +1,3 @@ +/*! For license information please see comunica-browser.js.LICENSE.txt */ +var Comunica;(()=>{var e={21019:(e,t,r)=>{e.exports=function(e){const t=new(r(43192).LoggerVoid),n=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-init/^5.0.0/components/ActorInit.jsonld#ActorInit_default_bus"}),i=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-context-preprocess/^5.0.0/components/ActorContextPreprocess.jsonld#ActorContextPreprocess_default_bus"}),a=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-hash-bindings/^5.0.0/components/ActorHashBindings.jsonld#ActorHashBindings_default_bus"}),o=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-hash-quads/^5.0.0/components/ActorHashQuads.jsonld#ActorHashQuads_default_bus"}),s=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-optimize-query-operation/^5.0.0/components/ActorOptimizeQueryOperation.jsonld#ActorOptimizeQueryOperation_default_bus"}),c=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-parse/^5.0.0/components/ActorQueryParse.jsonld#ActorQueryParse_default_bus"}),u=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-result-serialize/^5.0.0/components/ActorQueryResultSerialize.jsonld#ActorQueryResultSerialize_default_bus"}),l=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-serialize/^5.0.0/components/ActorQuerySerialize.jsonld#ActorQuerySerialize_default_bus"}),d=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-source-dereference-link/^5.0.0/components/ActorQuerySourceDereferenceLink.jsonld#ActorQuerySourceDereferenceLink_default_bus"}),p=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-source-identify-hypermedia/^5.0.0/components/ActorQuerySourceIdentifyHypermedia.jsonld#ActorQuerySourceIdentifyHypermedia_default_bus"}),h=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-dereference/^5.0.0/components/ActorDereference.jsonld#ActorDereference_default_bus"}),f=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-dereference-rdf/^5.0.0/components/ActorDereferenceRdf.jsonld#ActorDereferenceRdf_default_bus"}),y=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-join-entries-sort/^5.0.0/components/ActorRdfJoinEntriesSort.jsonld#ActorRdfJoinEntriesSort_default_bus"}),m=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-join-selectivity/^5.0.0/components/ActorRdfJoinSelectivity.jsonld#ActorRdfJoinSelectivity_default_bus"}),g=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-metadata/^5.0.0/components/ActorRdfMetadata.jsonld#ActorRdfMetadata_default_bus"}),b=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-metadata-accumulate/^5.0.0/components/ActorRdfMetadataAccumulate.jsonld#ActorRdfMetadataAccumulate_default_bus"}),v=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-metadata-extract/^5.0.0/components/ActorRdfMetadataExtract.jsonld#ActorRdfMetadataExtract_default_bus"}),_=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-parse/^5.0.0/components/ActorRdfParse.jsonld#ActorRdfParse_default_bus"}),T=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-parse-html/^5.0.0/components/ActorRdfParseHtml.jsonld#ActorRdfParseHtml_default_bus"}),O=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-resolve-hypermedia-links/^5.0.0/components/ActorRdfResolveHypermediaLinks.jsonld#ActorRdfResolveHypermediaLinks_default_bus"}),w=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-resolve-hypermedia-links-queue/^5.0.0/components/ActorRdfResolveHypermediaLinksQueue.jsonld#ActorRdfResolveHypermediaLinksQueue_default_bus"}),S=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-serialize/^5.0.0/components/ActorRdfSerialize.jsonld#ActorRdfSerialize_default_bus"}),E=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-update-hypermedia/^5.0.0/components/ActorRdfUpdateHypermedia.jsonld#ActorRdfUpdateHypermedia_default_bus"}),A=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-update-quads/^5.0.0/components/ActorRdfUpdateQuads.jsonld#ActorRdfUpdateQuads_default_bus"}),x=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-bindings-aggregator-factory/^5.0.0/components/ActorBindingsAggregatorFactory.jsonld#ActorBindingsAggregatorFactory_default_bus"}),I=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-expression-evaluator-factory/^5.0.0/components/ActorExpressionEvaluatorFactory.jsonld#ActorExpressionEvaluatorFactory_default_bus"}),P=new(r(79345).BusFunctionFactory)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-function-factory/^5.0.0/components/ActorFunctionFactory.jsonld#ActorFunctionFactory_default_bus"}),R=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-http/^5.0.0/components/ActorHttp.jsonld#ActorHttp_default_bus"}),N=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-http/^5.0.0/components/ActorHttp.jsonld#ActorHttp_fallback_bus"}),j=new(r(23034).BusQueryOperation)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-operation/^5.0.0/components/ActorQueryOperation.jsonld#ActorQueryOperation_default_bus"}),L=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-process/^5.0.0/components/ActorQueryProcess.jsonld#ActorQueryProcess_default_bus"}),D=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-source-identify/^5.0.0/components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify_default_bus"}),F=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-join/^5.0.0/components/ActorRdfJoin.jsonld#ActorRdfJoin_default_bus"}),M=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-term-comparator-factory/^5.0.0/components/ActorTermComparatorFactory.jsonld#ActorTermComparatorFactory_default_bus"}),C=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-http-invalidate/^5.0.0/components/ActorHttpInvalidate.jsonld#ActorHttpInvalidate_default_bus"}),k=new(r(97356).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-merge-bindings-context/^5.0.0/components/ActorMergeBindingsContext.jsonld#ActorMergeBindingsContext_default_bus"}),U=(new(r(80223).ActorContextPreprocessConvertShortcuts)({contextKeyShortcuts:{baseIRI:"@comunica/actor-init-query:baseIRI",dataFactory:"@comunica/actor-init-query:dataFactory",datetime:"@comunica/actor-http-memento:datetime",destination:"@comunica/bus-rdf-update-quads:destination",distinctConstruct:"@comunica/actor-init-query:distinctConstruct",explain:"@comunica/actor-init-query:explain",extensionFunctionCreator:"@comunica/actor-init-query:extensionFunctionCreator",extensionFunctions:"@comunica/actor-init-query:extensionFunctions",extensionFunctionsAlwaysPushdown:"@comunica/actor-init-query:extensionFunctionsAlwaysPushdown",fetch:"@comunica/bus-http:fetch",fileBaseIRI:"@comunica/actor-init-query:fileBaseIRI",functionArgumentsCache:"@comunica/actor-init-query:functionArgumentsCache",httpAbortSignal:"@comunica/bus-http:http-abort-controller",httpAuth:"@comunica/bus-http:auth",httpBodyTimeout:"@comunica/bus-http:http-body-timeout",httpCache:"@comunica/bus-http:httpCache",httpIncludeCredentials:"@comunica/bus-http:include-credentials",httpProxyHandler:"@comunica/actor-http-proxy:httpProxyHandler",httpRetryBodyAllowUnsafe:"@comunica/bus-http:http-retry-body-allow-unsafe",httpRetryBodyCount:"@comunica/bus-http:http-retry-body-count",httpRetryBodyDelayFallback:"@comunica/bus-http:http-retry-body-delay-fallback",httpRetryBodyMaxBytes:"@comunica/bus-http:http-retry-body-max-bytes",httpRetryCount:"@comunica/bus-http:http-retry-count",httpRetryDelayFallback:"@comunica/bus-http:http-retry-delay-fallback",httpRetryDelayLimit:"@comunica/bus-http:http-retry-delay-limit",httpRetryStatusCodes:"@comunica/bus-http:http-retry-status-codes",httpTimeout:"@comunica/bus-http:http-timeout",initialBindings:"@comunica/actor-init-query:initialBindings",invalidateCache:"@comunica/actor-init-query:invalidateCache",lenient:"@comunica/actor-init-query:lenient",log:"@comunica/core:log",parseUnsupportedVersions:"@comunica/actor-init-query:parseUnsupportedVersions",queryFormat:"@comunica/actor-init-query:queryFormat",queryTimestamp:"@comunica/actor-init-query:queryTimestamp",queryTimestampHighResolution:"@comunica/actor-init-query:queryTimestampHighResolution",rdfSerializationPrefixes:"@comunica/bus-rdf-serialize:rdfSerializationPrefixes",readOnly:"@comunica/bus-query-operation:readOnly",recoverBrokenLinks:"@comunica/bus-http-wayback:recover-broken-links",sources:"@comunica/actor-init-query:querySourcesUnidentified",traverse:"@comunica/bus-query-source-identify:traverse",unionDefaultGraph:"@comunica/bus-query-operation:unionDefaultGraph"},name:"urn:comunica:default:context-preprocess/actors#convert-shortcuts",bus:i,busFailMessage:"Context preprocessing failed"}),new(r(18959).ActorContextPreprocessSetDefaults)({logger:t,name:"urn:comunica:default:context-preprocess/actors#set-defaults",bus:i,busFailMessage:"Context preprocessing failed"}),new(r(46154).ActorContextPreprocessSourceToDestination)({name:"urn:comunica:default:context-preprocess/actors#source-to-destination",bus:i,busFailMessage:"Context preprocessing failed"}),new(r(56503).MediatorCombinePipeline)({name:"urn:comunica:default:context-preprocess/mediators#main",bus:i})),B=(new(r(2503).ActorHashBindingsMurmur)({name:"urn:comunica:default:hash-bindings/actors#murmur",bus:a,busFailMessage:"Failed to obtaining hash functions for bindings"}),new(r(42308).MediatorRace)({name:"urn:comunica:default:hash-bindings/mediators#main",bus:a})),q=(new(r(2233).ActorHashQuadsMurmur)({name:"urn:comunica:default:hash-quads/actors#murmur",bus:o,busFailMessage:"Failed to obtaining hash functions for quads"}),new(r(92834).ActorOptimizeQueryOperationRewriteCopy)({name:"urn:comunica:default:optimize-query-operation/actors#rewrite-copy",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize"}),new(r(20666).ActorOptimizeQueryOperationRewriteMove)({name:"urn:comunica:default:optimize-query-operation/actors#rewrite-move",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize"}),new(r(49222).ActorOptimizeQueryOperationRewriteAdd)({name:"urn:comunica:default:optimize-query-operation/actors#rewrite-add",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize"}),new(r(58092).ActorOptimizeQueryOperationGroupSources)({name:"urn:comunica:default:optimize-query-operation/actors#group-sources",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize"})),V=(new(r(64432).ActorOptimizeQueryOperationConstructDistinct)({name:"urn:comunica:default:optimize-query-operation/actors#construct-distinct",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize"}),new(r(56503).MediatorCombinePipeline)({filterFailures:!0,name:"urn:comunica:default:optimize-query-operation/mediators#main",bus:s})),$=(new(r(18531).ActorQueryParseSparql)({prefixes:{dbpedia:"http://dbpedia.org/resource/","dbpedia-owl":"http://dbpedia.org/ontology/",dbpprop:"http://dbpedia.org/property/",dc:"http://purl.org/dc/terms/",dc11:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",foaf:"http://xmlns.com/foaf/0.1/",geo:"http://www.w3.org/2003/01/geo/wgs84_pos#",owl:"http://www.w3.org/2002/07/owl#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",schema:"http://schema.org/",skos:"http://www.w3.org/2008/05/skos#",xsd:"http://www.w3.org/2001/XMLSchema#"},minimalErrorMessages:!1,name:"urn:comunica:default:query-parse/actors#sparql",bus:c,busFailMessage:'Query parsing failed: none of the configured parsers were able to the query "${action.query}"'}),new(r(17807).ActorQueryParseGraphql)({name:"urn:comunica:default:query-parse/actors#graphql",bus:c,busFailMessage:'Query parsing failed: none of the configured parsers were able to the query "${action.query}"'}),new(r(42308).MediatorRace)({name:"urn:comunica:default:query-parse/mediators#main",bus:c})),G=(new(r(96111).ActorQueryResultSerializeJson)({mediaTypePriorities:{"application/json":1},mediaTypeFormats:{"application/json":"https://comunica.linkeddatafragments.org/#results_JSON"},name:"urn:comunica:default:query-result-serialize/actors#json",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(6651).ActorQueryResultSerializeSimple)({mediaTypePriorities:{simple:.9},mediaTypeFormats:{simple:"https://comunica.linkeddatafragments.org/#results_simple"},name:"urn:comunica:default:query-result-serialize/actors#simple",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(10569).ActorQueryResultSerializeSparqlCsv)({mediaTypePriorities:{"text/csv":.75},mediaTypeFormats:{"text/csv":"http://www.w3.org/ns/formats/SPARQL_Results_CSV"},name:"urn:comunica:default:query-result-serialize/actors#csv",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(53724).ActorQueryResultSerializeSparqlTsv)({mediaTypePriorities:{"text/tab-separated-values":.75},mediaTypeFormats:{"text/tab-separated-values":"http://www.w3.org/ns/formats/SPARQL_Results_TSV"},name:"urn:comunica:default:query-result-serialize/actors#sparql-tsv",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(72512).ActorQueryResultSerializeSparqlXml)({mediaTypePriorities:{"application/sparql-results+xml":.8},mediaTypeFormats:{"application/sparql-results+xml":"http://www.w3.org/ns/formats/SPARQL_Results_XML"},name:"urn:comunica:default:query-result-serialize/actors#sparql-xml",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(79171).ActorQueryResultSerializeTable)({columnWidth:50,mediaTypePriorities:{table:.6},mediaTypeFormats:{table:"https://comunica.linkeddatafragments.org/#results_table"},name:"urn:comunica:default:query-result-serialize/actors#table",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(74213).ActorQueryResultSerializeTree)({mediaTypePriorities:{tree:.5},mediaTypeFormats:{tree:"https://comunica.linkeddatafragments.org/#results_tree"},name:"urn:comunica:default:query-result-serialize/actors#tree",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(42308).MediatorRace)({name:"urn:comunica:default:query-result-serialize/mediators#serialize",bus:u})),Q=new(r(62784).MediatorCombineUnion)({field:"mediaTypes",name:"urn:comunica:default:query-result-serialize/mediators#mediaType",bus:u}),H=new(r(62784).MediatorCombineUnion)({field:"mediaTypeFormats",name:"urn:comunica:default:query-result-serialize/mediators#mediaTypeFormat",bus:u}),z=(new(r(7072).ActorQuerySerializeSparql)({name:"urn:comunica:default:query-serialize/actors#sparql",bus:l,busFailMessage:'Query serializing failed: none of the configured parsers were able to serialize for the query language "${action.queryFormat.language}" at version "${action.queryFormat.version}"'}),new(r(42308).MediatorRace)({name:"urn:comunica:default:query-serialize/mediators#main",bus:l})),K=new(r(42308).MediatorRace)({name:"urn:comunica:default:query-source-dereference-link/mediators#main",bus:d}),X=new(r(83460).MediatorNumber)({field:"filterFactor",type:"max",ignoreFailures:!0,name:"urn:comunica:default:query-source-identify-hypermedia/mediators#main",bus:p}),W=new(r(68490).ActorDereferenceFallback)({name:"urn:comunica:default:dereference/actors#fallback",bus:h,busFailMessage:"Dereferencing failed: none of the configured actors were able to handle ${action.url}"}),J=new(r(42308).MediatorRace)({name:"urn:comunica:default:dereference/mediators#main",bus:h}),Y=new(r(42308).MediatorRace)({name:"urn:comunica:default:dereference-rdf/mediators#main",bus:f}),Z=(new(r(57277).ActorRdfJoinEntriesSortCardinality)({name:"urn:comunica:default:rdf-join-entries-sort/actors#cardinality",bus:y,busFailMessage:"Sorting join entries failed: none of the configured actors were able to sort"}),new(r(83460).MediatorNumber)({field:"accuracy",type:"max",ignoreFailures:!0,name:"urn:comunica:default:rdf-join-entries-sort/mediators#main",bus:y})),ee=(new(r(11755).ActorRdfJoinSelectivityVariableCounting)({name:"urn:comunica:default:rdf-join-selectivity/actors#variable-counting",bus:m,busFailMessage:"Determining join selectivity failed: none of the configured actors were able to calculate selectivities"}),new(r(83460).MediatorNumber)({field:"accuracy",type:"max",ignoreFailures:!0,name:"urn:comunica:default:rdf-join-selectivity/mediators#main",bus:m})),te=(new(r(42380).ActorRdfMetadataPrimaryTopic)({metadataToData:!1,dataToMetadataOnInvalidMetadataGraph:!0,name:"urn:comunica:default:rdf-metadata/actors#primary-topic",bus:g,busFailMessage:"Metadata splicing failed: none of the configured actors were able to splice metadata from ${action.url}"}),new(r(69143).ActorRdfMetadataAll)({name:"urn:comunica:default:rdf-metadata/actors#all",bus:g,busFailMessage:"Metadata splicing failed: none of the configured actors were able to splice metadata from ${action.url}"}),new(r(42308).MediatorRace)({name:"urn:comunica:default:rdf-metadata/mediators#main",bus:g})),re=(new(r(60631).ActorRdfMetadataAccumulateCardinality)({name:"urn:comunica:default:rdf-metadata-accumulate/actors#cardinality",bus:b,busFailMessage:"Metadata accumulation failed: none of the configured actors were able to accumulate metadata in mode ${action.mode}"}),new(r(72639).ActorRdfMetadataAccumulatePageSize)({name:"urn:comunica:default:rdf-metadata-accumulate/actors#pagesize",bus:b,busFailMessage:"Metadata accumulation failed: none of the configured actors were able to accumulate metadata in mode ${action.mode}"}),new(r(36323).ActorRdfMetadataAccumulateRequestTime)({name:"urn:comunica:default:rdf-metadata-accumulate/actors#requesttime",bus:b,busFailMessage:"Metadata accumulation failed: none of the configured actors were able to accumulate metadata in mode ${action.mode}"}),new(r(62784).MediatorCombineUnion)({field:"metadata",name:"urn:comunica:default:rdf-metadata-accumulate/mediators#main",bus:b})),ne=(new(r(21113).ActorRdfMetadataExtractHydraControls)({name:"urn:comunica:default:rdf-metadata-extract/actors#hydra-controls",bus:v,busFailMessage:"Metadata extraction failed: none of the configured actors were able to extract metadata from ${action.url}"}),new(r(93134).ActorRdfMetadataExtractHydraCount)({predicates:["http://www.w3.org/ns/hydra/core#totalItems","http://rdfs.org/ns/void#triples"],name:"urn:comunica:default:rdf-metadata-extract/actors#hydra-count",bus:v,busFailMessage:"Metadata extraction failed: none of the configured actors were able to extract metadata from ${action.url}"}),new(r(92389).ActorRdfMetadataExtractHydraPagesize)({predicates:["http://www.w3.org/ns/hydra/core#itemsPerPage"],name:"urn:comunica:default:rdf-metadata-extract/actors#hydra-pagesize",bus:v,busFailMessage:"Metadata extraction failed: none of the configured actors were able to extract metadata from ${action.url}"}),new(r(27161).ActorRdfMetadataExtractRequestTime)({name:"urn:comunica:default:rdf-metadata-extract/actors#request-time",bus:v,busFailMessage:"Metadata extraction failed: none of the configured actors were able to extract metadata from ${action.url}"}),new(r(98123).ActorRdfMetadataExtractAllowHttpMethods)({name:"urn:comunica:default:rdf-metadata-extract/actors#allow-http-methods",bus:v,busFailMessage:"Metadata extraction failed: none of the configured actors were able to extract metadata from ${action.url}"}),new(r(83696).ActorRdfMetadataExtractPostAccepted)({name:"urn:comunica:default:rdf-metadata-extract/actors#post-accepted",bus:v,busFailMessage:"Metadata extraction failed: none of the configured actors were able to extract metadata from ${action.url}"}),new(r(68545).ActorRdfMetadataExtractPutAccepted)({name:"urn:comunica:default:rdf-metadata-extract/actors#put-accepted",bus:v,busFailMessage:"Metadata extraction failed: none of the configured actors were able to extract metadata from ${action.url}"}),new(r(398).ActorRdfMetadataExtractPatchSparqlUpdate)({name:"urn:comunica:default:rdf-metadata-extract/actors#patch-sparql-update",bus:v,busFailMessage:"Metadata extraction failed: none of the configured actors were able to extract metadata from ${action.url}"}),new(r(21007).ActorRdfMetadataExtractSparqlService)({inferHttpsEndpoint:!0,name:"urn:comunica:default:rdf-metadata-extract/actors#sparql-service",bus:v,busFailMessage:"Metadata extraction failed: none of the configured actors were able to extract metadata from ${action.url}"}),new(r(2438).ActorRdfMetadataExtractVoid)({name:"urn:comunica:default:rdf-metadata-extract/actors#void",bus:v,busFailMessage:"Metadata extraction failed: none of the configured actors were able to extract metadata from ${action.url}"}),new(r(52675).ActorRdfMetadataExtractServerSoftware)({name:"urn:comunica:default:rdf-metadata-extract/actors#server-software",bus:v,busFailMessage:"Metadata extraction failed: none of the configured actors were able to extract metadata from ${action.url}"}),new(r(62784).MediatorCombineUnion)({filterFailures:!0,field:"metadata",name:"urn:comunica:default:rdf-metadata-extract/mediators#main",bus:v})),ie=(new(r(57225).ActorRdfParseN3)({mediaTypePriorities:{"application/n-quads":1,"application/n-triples":.8,"application/trig":.95,"text/n3":.35,"text/turtle":.6},mediaTypeFormats:{"application/n-quads":"http://www.w3.org/ns/formats/N-Quads","application/n-triples":"http://www.w3.org/ns/formats/N-Triples","application/trig":"http://www.w3.org/ns/formats/TriG","text/n3":"http://www.w3.org/ns/formats/N3","text/turtle":"http://www.w3.org/ns/formats/Turtle"},priorityScale:1,name:"urn:comunica:default:rdf-parse/actors#n3",bus:_,busFailMessage:"RDF parsing failed: none of the configured parsers were able to handle the media type ${action.handle.mediaType} for ${action.handle.url}"}),new(r(19387).ActorRdfParseRdfXml)({mediaTypePriorities:{"application/rdf+xml":1},mediaTypeFormats:{"application/rdf+xml":"http://www.w3.org/ns/formats/RDF_XML"},priorityScale:.5,name:"urn:comunica:default:rdf-parse/actors#rdfxml",bus:_,busFailMessage:"RDF parsing failed: none of the configured parsers were able to handle the media type ${action.handle.mediaType} for ${action.handle.url}"}),new(r(12237).ActorRdfParseXmlRdfa)({mediaTypePriorities:{"application/xml":1,"image/svg+xml":1,"text/xml":1},mediaTypeFormats:{"application/xml":"http://www.w3.org/ns/formats/RDFa","image/svg+xml":"http://www.w3.org/ns/formats/RDFa","text/xml":"http://www.w3.org/ns/formats/RDFa"},priorityScale:.3,name:"urn:comunica:default:rdf-parse/actors#xmlrdfa",bus:_,busFailMessage:"RDF parsing failed: none of the configured parsers were able to handle the media type ${action.handle.mediaType} for ${action.handle.url}"}),new(r(79964).ActorRdfParseShaclc)({mediaTypePriorities:{"text/shaclc":1,"text/shaclc-ext":.5},mediaTypeFormats:{"text/shaclc":"http://www.w3.org/ns/formats/Shaclc","text/shaclc-ext":"http://www.w3.org/ns/formats/ShaclcExtended"},priorityScale:.1,name:"urn:comunica:default:rdf-parse/actors#shaclc",bus:_,busFailMessage:"RDF parsing failed: none of the configured parsers were able to handle the media type ${action.handle.mediaType} for ${action.handle.url}"}),new(r(42308).MediatorRace)({name:"urn:comunica:default:rdf-parse/mediators#parse",bus:_})),ae=new(r(62784).MediatorCombineUnion)({field:"mediaTypes",name:"urn:comunica:default:rdf-parse/mediators#mediaType",bus:_}),oe=(new(r(83983).ActorRdfParseHtml)({busRdfParseHtml:T,mediaTypePriorities:{"application/xhtml+xml":.9,"text/html":1},mediaTypeFormats:{"application/xhtml+xml":"http://www.w3.org/ns/formats/HTML","text/html":"http://www.w3.org/ns/formats/HTML"},priorityScale:.2,name:"urn:comunica:default:rdf-parse/actors#html",bus:_,busFailMessage:"RDF parsing failed: none of the configured parsers were able to handle the media type ${action.handle.mediaType} for ${action.handle.url}"}),new(r(6161).ActorRdfParseHtmlMicrodata)({name:"urn:comunica:default:rdf-parse-html/actors#microdata",bus:T,busFailMessage:"RDF HTML parsing failed: none of the configured parsers were able to parse RDF in HTML"}),new(r(37085).ActorRdfParseHtmlRdfa)({name:"urn:comunica:default:rdf-parse-html/actors#rdfa",bus:T,busFailMessage:"RDF HTML parsing failed: none of the configured parsers were able to parse RDF in HTML"}),new(r(18409).ActorRdfResolveHypermediaLinksNext)({name:"urn:comunica:default:rdf-resolve-hypermedia-links/actors#next",bus:O,busFailMessage:"Hypermedia link resolution failed: none of the configured actors were able to resolve links from metadata"}),new(r(42308).MediatorRace)({name:"urn:comunica:default:rdf-resolve-hypermedia-links/mediators#main",bus:O})),se=(new(r(24092).ActorRdfResolveHypermediaLinksQueueFifo)({name:"urn:comunica:default:rdf-resolve-hypermedia-links-queue/actors#fifo",bus:w,busFailMessage:"Link queue creation failed: none of the configured actors were able to create a link queue"}),new(r(42308).MediatorRace)({name:"urn:comunica:default:rdf-resolve-hypermedia-links-queue/mediators#main",bus:w})),ce=(new(r(20738).ActorRdfSerializeN3)({mediaTypePriorities:{"application/n-quads":1,"application/n-triples":.8,"application/trig":.95,"text/n3":.35,"text/turtle":.6},mediaTypeFormats:{"application/n-quads":"http://www.w3.org/ns/formats/N-Quads","application/n-triples":"http://www.w3.org/ns/formats/N-Triples","application/trig":"http://www.w3.org/ns/formats/TriG","text/n3":"http://www.w3.org/ns/formats/N3","text/turtle":"http://www.w3.org/ns/formats/Turtle"},name:"urn:comunica:default:rdf-serialize/actors#n3",bus:S,busFailMessage:"RDF serialization failed: none of the configured serializers were able to handle media type ${action.handleMediaType}"}),new(r(82123).ActorRdfSerializeJsonLd)({jsonStringifyIndentSpaces:2,mediaTypePriorities:{"application/ld+json":1},mediaTypeFormats:{"application/ld+json":"http://www.w3.org/ns/formats/JSON-LD"},priorityScale:.9,name:"urn:comunica:default:rdf-serialize/actors#jsonld",bus:S,busFailMessage:"RDF serialization failed: none of the configured serializers were able to handle media type ${action.handleMediaType}"}),new(r(47459).ActorRdfSerializeShaclc)({mediaTypePriorities:{"text/shaclc":1,"text/shaclc-ext":.5},mediaTypeFormats:{"text/shaclc":"http://www.w3.org/ns/formats/Shaclc","text/shaclc-ext":"http://www.w3.org/ns/formats/ShaclcExtended"},priorityScale:.1,name:"urn:comunica:default:rdf-serialize/actors#shaclc",bus:S,busFailMessage:"RDF serialization failed: none of the configured serializers were able to handle media type ${action.handleMediaType}"}),new(r(42308).MediatorRace)({name:"urn:comunica:default:rdf-serialize/mediators#serialize",bus:S})),ue=new(r(62784).MediatorCombineUnion)({field:"mediaTypes",name:"urn:comunica:default:rdf-serialize/mediators#mediaType",bus:S}),le=new(r(62784).MediatorCombineUnion)({field:"mediaTypeFormats",name:"urn:comunica:default:rdf-serialize/mediators#mediaTypeFormat",bus:S}),de=new(r(42308).MediatorRace)({name:"urn:comunica:default:rdf-update-hypermedia/mediators#main",bus:E}),pe=(new(r(29870).ActorRdfUpdateQuadsRdfJsStore)({name:"urn:comunica:default:rdf-update-quads/actors#rdfjs-store",bus:A,busFailMessage:"RDF updating failed: none of the configured actors were able to handle an update"}),new(r(42308).MediatorRace)({name:"urn:comunica:default:rdf-update-quads/mediators#main",bus:A})),he=new(r(42308).MediatorRace)({name:"urn:comunica:default:bindings-aggregator-factory/mediators#main",bus:x}),fe=new(r(42308).MediatorRace)({name:"urn:comunica:default:expression-evaluator-factory/mediators#main",bus:I}),ye=(new(r(35670).ActorFunctionFactoryExpressionBnode)({name:"urn:comunica:default:function-factory/actors#expression-function-bnode",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(42096).ActorFunctionFactoryExpressionBound)({name:"urn:comunica:default:function-factory/actors#expression-function-bound",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(33243).ActorFunctionFactoryExpressionCoalesce)({name:"urn:comunica:default:function-factory/actors#expression-function-coalesce",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(56608).ActorFunctionFactoryExpressionConcat)({name:"urn:comunica:default:function-factory/actors#expression-function-concat",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(9070).ActorFunctionFactoryExpressionExtensions)({name:"urn:comunica:default:function-factory/actors#expression-function-extensions",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(17055).ActorFunctionFactoryExpressionIf)({name:"urn:comunica:default:function-factory/actors#expression-function-if",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(15907).ActorFunctionFactoryExpressionLogicalAnd)({name:"urn:comunica:default:function-factory/actors#expression-function-logical-and",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(30119).ActorFunctionFactoryExpressionLogicalOr)({name:"urn:comunica:default:function-factory/actors#expression-function-logical-or",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(64915).ActorFunctionFactoryExpressionSameTerm)({name:"urn:comunica:default:function-factory/actors#expression-function-same-term",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(95108).ActorFunctionFactoryTermAbs)({name:"urn:comunica:default:function-factory/actors#term-function-abs",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(30564).ActorFunctionFactoryTermAddition)({name:"urn:comunica:default:function-factory/actors#term-function-addition",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(2345).ActorFunctionFactoryTermCeil)({name:"urn:comunica:default:function-factory/actors#term-function-ceil",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(13969).ActorFunctionFactoryTermContains)({name:"urn:comunica:default:function-factory/actors#term-function-contains",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(69532).ActorFunctionFactoryTermDatatype)({name:"urn:comunica:default:function-factory/actors#term-function-datatype",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(84706).ActorFunctionFactoryTermDay)({name:"urn:comunica:default:function-factory/actors#term-function-day",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(45743).ActorFunctionFactoryTermDivision)({name:"urn:comunica:default:function-factory/actors#term-function-division",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(443).ActorFunctionFactoryTermEncodeForUri)({name:"urn:comunica:default:function-factory/actors#term-function-encode-for-uri",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(78392).ActorFunctionFactoryTermEquality)({name:"urn:comunica:default:function-factory/actors#term-function-equality",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(1198).ActorFunctionFactoryTermFloor)({name:"urn:comunica:default:function-factory/actors#term-function-floor",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(42875).ActorFunctionFactoryTermHasLang)({name:"urn:comunica:default:function-factory/actors#term-function-has-lang",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(47998).ActorFunctionFactoryTermHasLangdir)({name:"urn:comunica:default:function-factory/actors#term-function-has-langdir",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(60707).ActorFunctionFactoryTermHours)({name:"urn:comunica:default:function-factory/actors#term-function-hours",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(19982).ActorFunctionFactoryTermIri)({name:"urn:comunica:default:function-factory/actors#term-function-iri",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(17215).ActorFunctionFactoryTermIsBlank)({name:"urn:comunica:default:function-factory/actors#term-function-is-blank",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(3639).ActorFunctionFactoryTermIsIri)({name:"urn:comunica:default:function-factory/actors#term-function-is-iri",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(41774).ActorFunctionFactoryTermIsLiteral)({name:"urn:comunica:default:function-factory/actors#term-function-is-literal",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(34146).ActorFunctionFactoryTermIsNumeric)({name:"urn:comunica:default:function-factory/actors#term-function-is-numeric",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(36748).ActorFunctionFactoryTermIsTriple)({name:"urn:comunica:default:function-factory/actors#term-function-is-triple",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(85576).ActorFunctionFactoryTermLang)({name:"urn:comunica:default:function-factory/actors#term-function-lang",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(75055).ActorFunctionFactoryTermLangdir)({name:"urn:comunica:default:function-factory/actors#term-function-langdir",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(95161).ActorFunctionFactoryTermLangmatches)({name:"urn:comunica:default:function-factory/actors#term-function-langmatches",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(90972).ActorFunctionFactoryTermLcase)({name:"urn:comunica:default:function-factory/actors#term-function-lcase",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(93896).ActorFunctionFactoryTermMd5)({name:"urn:comunica:default:function-factory/actors#term-function-md5",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(71561).ActorFunctionFactoryTermMinutes)({name:"urn:comunica:default:function-factory/actors#term-function-minutes",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(15158).ActorFunctionFactoryTermMonth)({name:"urn:comunica:default:function-factory/actors#term-function-month",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(68250).ActorFunctionFactoryTermMultiplication)({name:"urn:comunica:default:function-factory/actors#term-function-multiplication",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(32345).ActorFunctionFactoryTermNot)({name:"urn:comunica:default:function-factory/actors#term-function-not",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(41956).ActorFunctionFactoryTermNow)({name:"urn:comunica:default:function-factory/actors#term-function-now",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(87291).ActorFunctionFactoryTermObject)({name:"urn:comunica:default:function-factory/actors#term-function-object",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(41761).ActorFunctionFactoryTermPredicate)({name:"urn:comunica:default:function-factory/actors#term-function-predicate",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(2091).ActorFunctionFactoryTermRand)({name:"urn:comunica:default:function-factory/actors#term-function-rand",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(77595).ActorFunctionFactoryTermRegex)({name:"urn:comunica:default:function-factory/actors#term-function-regex",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(41316).ActorFunctionFactoryTermReplace)({name:"urn:comunica:default:function-factory/actors#term-function-replace",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(41324).ActorFunctionFactoryTermRound)({name:"urn:comunica:default:function-factory/actors#term-function-round",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(38005).ActorFunctionFactoryTermSeconds)({name:"urn:comunica:default:function-factory/actors#term-function-seconds",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(30773).ActorFunctionFactoryTermSha1)({name:"urn:comunica:default:function-factory/actors#term-function-sha1",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(52275).ActorFunctionFactoryTermSha256)({name:"urn:comunica:default:function-factory/actors#term-function-sha256",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(10111).ActorFunctionFactoryTermSha384)({name:"urn:comunica:default:function-factory/actors#term-function-sha384",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(78790).ActorFunctionFactoryTermSha512)({name:"urn:comunica:default:function-factory/actors#term-function-sha512",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(55552).ActorFunctionFactoryTermStrAfter)({name:"urn:comunica:default:function-factory/actors#term-function-str-after",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(64329).ActorFunctionFactoryTermStrBefore)({name:"urn:comunica:default:function-factory/actors#term-function-str-before",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(69894).ActorFunctionFactoryTermStrDt)({name:"urn:comunica:default:function-factory/actors#term-function-str-dt",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(70244).ActorFunctionFactoryTermStrEnds)({name:"urn:comunica:default:function-factory/actors#term-function-str-ends",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(46122).ActorFunctionFactoryTermStrLang)({name:"urn:comunica:default:function-factory/actors#term-function-str-lang",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(88961).ActorFunctionFactoryTermStrLangdir)({name:"urn:comunica:default:function-factory/actors#term-function-str-langdir",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(10269).ActorFunctionFactoryTermStrLen)({name:"urn:comunica:default:function-factory/actors#term-function-str-len",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(2443).ActorFunctionFactoryTermStrStarts)({name:"urn:comunica:default:function-factory/actors#term-function-str-starts",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(12937).ActorFunctionFactoryTermStrUuid)({name:"urn:comunica:default:function-factory/actors#term-function-str-uuid",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(19675).ActorFunctionFactoryTermStr)({name:"urn:comunica:default:function-factory/actors#term-function-str",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(53524).ActorFunctionFactoryTermSubStr)({name:"urn:comunica:default:function-factory/actors#term-function-sub-str",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(7348).ActorFunctionFactoryTermSubject)({name:"urn:comunica:default:function-factory/actors#term-function-subject",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(20706).ActorFunctionFactoryTermSubtraction)({name:"urn:comunica:default:function-factory/actors#term-function-subtraction",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(97527).ActorFunctionFactoryTermTimezone)({name:"urn:comunica:default:function-factory/actors#term-function-timezone",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(49012).ActorFunctionFactoryTermTriple)({name:"urn:comunica:default:function-factory/actors#term-function-triple",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(49474).ActorFunctionFactoryTermTz)({name:"urn:comunica:default:function-factory/actors#term-function-tz",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(49823).ActorFunctionFactoryTermUcase)({name:"urn:comunica:default:function-factory/actors#term-function-ucase",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(74770).ActorFunctionFactoryTermUnaryMinus)({name:"urn:comunica:default:function-factory/actors#term-function-unary-minus",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(83002).ActorFunctionFactoryTermUnaryPlus)({name:"urn:comunica:default:function-factory/actors#term-function-unary-plus",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(4975).ActorFunctionFactoryTermUuid)({name:"urn:comunica:default:function-factory/actors#term-function-uuid",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(63170).ActorFunctionFactoryTermXsdToBoolean)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-boolean",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(60046).ActorFunctionFactoryTermXsdToDate)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-date",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(11435).ActorFunctionFactoryTermXsdToDatetime)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-datetime",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(50937).ActorFunctionFactoryTermXsdToDayTimeDuration)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-day-time-duration",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(54665).ActorFunctionFactoryTermXsdToDecimal)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-decimal",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(71379).ActorFunctionFactoryTermXsdToDouble)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-double",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(75894).ActorFunctionFactoryTermXsdToDuration)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-duration",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(71396).ActorFunctionFactoryTermXsdToFloat)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-float",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(23104).ActorFunctionFactoryTermXsdToInteger)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-integer",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(40055).ActorFunctionFactoryTermXsdToString)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-string",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(96751).ActorFunctionFactoryTermXsdToTime)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-time",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(26847).ActorFunctionFactoryTermXsdToYearMonthDuration)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-year-month-duration",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(68537).ActorFunctionFactoryTermYear)({name:"urn:comunica:default:function-factory/actors#term-function-year",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(42308).MediatorRace)({name:"urn:comunica:default:function-factory/mediators#main",bus:P})),me=new(r(83460).MediatorNumber)({field:"time",type:"min",ignoreFailures:!0,name:"urn:comunica:default:http/mediators#no-fallback",bus:R}),ge=new(r(83460).MediatorNumber)({field:"time",type:"min",ignoreFailures:!0,name:"urn:comunica:default:http/mediators#main",bus:N}),be=(new(r(83241).ActorQueryOperationSource)({name:"urn:comunica:default:query-operation/actors#source",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(83460).MediatorNumber)({field:"httpRequests",type:"min",ignoreFailures:!0,name:"urn:comunica:default:query-operation/mediators#main",bus:j})),ve=new(r(42308).MediatorRace)({name:"urn:comunica:default:query-process/mediators#main",bus:L}),_e=new(r(42308).MediatorRace)({name:"urn:comunica:default:query-source-identify/mediators#main",bus:D}),Te=new(r(97841).MediatorJoinCoefficientsFixed)({cpuWeight:10,memoryWeight:1,timeWeight:2,ioWeight:10,name:"urn:comunica:default:rdf-join/mediators#main",bus:F}),Oe=new(r(42308).MediatorRace)({name:"urn:comunica:default:term-comparator-factory/mediators#main",bus:M}),we=new(r(53592).MediatorAll)({name:"urn:comunica:default:http-invalidate/mediators#main",bus:C}),Se=new(r(92940).ActorHttpInvalidateListenable)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-optimize-query-operation-query-source-identify/^5.0.0/components/ActorOptimizeQueryOperationQuerySourceIdentify.jsonld#IActorOptimizeQueryOperationQuerySourceIdentifyArgs_default_invalidator",bus:C,busFailMessage:"HTTP invalidation failed: none of the configured actors were able to invalidate ${action.url}"}),Ee=new(r(92940).ActorHttpInvalidateListenable)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-parse-jsonld/^5.0.0/components/ActorRdfParseJsonLd.jsonld#IActorRdfParseJsonLdArgs_default_invalidator",bus:C,busFailMessage:"HTTP invalidation failed: none of the configured actors were able to invalidate ${action.url}"}),Ae=new(r(92940).ActorHttpInvalidateListenable)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-update-quads-hypermedia/^5.0.0/components/ActorRdfUpdateQuadsHypermedia.jsonld#IActorRdfUpdateQuadsHypermediaArgs_default_invalidator",bus:C,busFailMessage:"HTTP invalidation failed: none of the configured actors were able to invalidate ${action.url}"}),xe=new(r(92940).ActorHttpInvalidateListenable)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-http-retry/^5.0.0/components/ActorHttpRetry.jsonld#IActorHttpQueueArgs_default_invalidator",bus:C,busFailMessage:"HTTP invalidation failed: none of the configured actors were able to invalidate ${action.url}"}),Ie=new(r(92940).ActorHttpInvalidateListenable)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-http-fetch/^5.0.0/components/ActorHttpFetch.jsonld#IActorHttpFetchArgs_default_invalidator",bus:C,busFailMessage:"HTTP invalidation failed: none of the configured actors were able to invalidate ${action.url}"}),Pe=new(r(92940).ActorHttpInvalidateListenable)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-http-limit-rate/^5.0.0/components/ActorHttpLimitRate.jsonld#IActorHttpLimitRateArgs_default_invalidator",bus:C,busFailMessage:"HTTP invalidation failed: none of the configured actors were able to invalidate ${action.url}"}),Re=new(r(92940).ActorHttpInvalidateListenable)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-result-serialize-sparql-json/^5.0.0/components/ActionObserverHttp.jsonld#IActionObserverHttpArgs_default_invalidator",bus:C,busFailMessage:"HTTP invalidation failed: none of the configured actors were able to invalidate ${action.url}"}),Ne=new(r(92940).ActorHttpInvalidateListenable)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-result-serialize-stats/^5.0.0/components/ActionObserverHttp.jsonld#IActionObserverHttpArgs_default_invalidator",bus:C,busFailMessage:"HTTP invalidation failed: none of the configured actors were able to invalidate ${action.url}"}),je=new(r(62784).MediatorCombineUnion)({field:"mergeHandlers",name:"urn:comunica:default:merge-bindings-context/mediators#main",bus:k}),Le=(new(r(45456).ActorRdfJoinEntriesSortSelectivity)({mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join-entries-sort/actors#selectivity",bus:y,busFailMessage:"Sorting join entries failed: none of the configured actors were able to sort"}),new(r(38676).ActorRdfJoinSingle)({mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#inner-single",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(20517).ActorRdfJoinMultiEmpty)({mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#inner-multi-empty",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(80).ActorRdfJoinHash)({mediatorHashBindings:B,canHandleUndefs:!1,mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#inner-hash-def",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"})),De=new(r(80).ActorRdfJoinHash)({mediatorHashBindings:B,canHandleUndefs:!0,mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#inner-hash-undef",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),Fe=new(r(31523).ActorRdfJoinSymmetricHash)({mediatorHashBindings:B,mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#inner-symmetric-hash",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),Me=new(r(84229).ActorRdfJoinNestedLoop)({mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#inner-nested-loop",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),Ce=(new(r(41844).ActorRdfJoinMinusHash)({canHandleUndefs:!1,mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#minus-hash-def",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(41844).ActorRdfJoinMinusHash)({canHandleUndefs:!0,mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#minus-hash-undef",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(60434).ActorRdfJoinOptionalHash)({canHandleUndefs:!1,blocking:!1,mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#optional-hash-def-nonblocking",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(60434).ActorRdfJoinOptionalHash)({canHandleUndefs:!1,blocking:!0,mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#optional-hash-def-blocking",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(60434).ActorRdfJoinOptionalHash)({canHandleUndefs:!0,blocking:!1,mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#optional-hash-undef-nonblocking",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(60434).ActorRdfJoinOptionalHash)({canHandleUndefs:!0,blocking:!0,mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#optional-hash-undef-blocking",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(69715).ActorRdfJoinOptionalNestedLoop)({mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#optional-nested-loop",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(78652).ActorQuerySourceDereferenceLinkHypermedia)({mediatorDereferenceRdf:Y,mediatorMetadata:te,mediatorMetadataExtract:ne,mediatorMetadataAccumulate:re,mediatorQuerySourceIdentifyHypermedia:X,sparqlServiceDescriptionTimeout:3e3,name:"urn:comunica:default:query-source-dereference-link/actors#dereference",bus:d,busFailMessage:"Query source dereference link failed: none of the configured actors were able to resolve ${action.link.url}"})),ke=(new(r(32934).ActorDereferenceRdfParse)({mediatorDereference:J,mediatorParse:ie,mediatorParseMediatypes:ae,mediaMappings:{htm:"text/html",html:"text/html",json:"application/json",jsonld:"application/ld+json",n3:"text/n3",nq:"application/n-quads",nquads:"application/n-quads",nt:"application/n-triples",ntriples:"application/n-triples",owl:"application/rdf+xml",rdf:"application/rdf+xml",rdfxml:"application/rdf+xml",shaclc:"text/shaclc",shaclce:"text/shaclc-ext",shc:"text/shaclc",shce:"text/shaclc-ext",svg:"image/svg+xml",svgz:"image/svg+xml",trig:"application/trig",ttl:"text/turtle",turtle:"text/turtle",xht:"application/xhtml+xml",xhtml:"application/xhtml+xml",xml:"application/xml"},name:"urn:comunica:default:dereference-rdf/actors#parse",bus:f,busFailMessage:"RDF dereferencing failed: none of the configured parsers were able to handle the media type ${action.handle.mediaType} for ${action.handle.url}"}),new(r(54454).ActorRdfParseHtmlScript)({mediatorRdfParseMediatypes:ae,mediatorRdfParseHandle:ie,name:"urn:comunica:default:rdf-parse-html/actors#script",bus:T,busFailMessage:"RDF HTML parsing failed: none of the configured parsers were able to parse RDF in HTML"}),new(r(92571).ActorQueryResultSerializeRdf)({mediatorRdfSerialize:ce,mediatorMediaTypeCombiner:ue,mediatorMediaTypeFormatCombiner:le,name:"urn:comunica:default:query-result-serialize/actors#rdf",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(8476).ActorBindingsAggregatorFactoryCount)({mediatorExpressionEvaluatorFactory:fe,name:"urn:comunica:default:bindings-aggregator-factory/actors#count",bus:x,busFailMessage:"Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}"}),new(r(91987).ActorBindingsAggregatorFactoryGroupConcat)({mediatorExpressionEvaluatorFactory:fe,name:"urn:comunica:default:bindings-aggregator-factory/actors#group-concat",bus:x,busFailMessage:"Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}"}),new(r(38887).ActorBindingsAggregatorFactorySample)({mediatorExpressionEvaluatorFactory:fe,name:"urn:comunica:default:bindings-aggregator-factory/actors#sample",bus:x,busFailMessage:"Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}"}),new(r(45897).ActorBindingsAggregatorFactoryWildcardCount)({mediatorExpressionEvaluatorFactory:fe,name:"urn:comunica:default:bindings-aggregator-factory/actors#wildcard-count",bus:x,busFailMessage:"Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}"}),new(r(85736).ActorBindingsAggregatorFactoryAverage)({mediatorFunctionFactory:ye,mediatorExpressionEvaluatorFactory:fe,name:"urn:comunica:default:bindings-aggregator-factory/actors#average",bus:x,busFailMessage:"Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}"}),new(r(12456).ActorBindingsAggregatorFactorySum)({mediatorFunctionFactory:ye,mediatorExpressionEvaluatorFactory:fe,name:"urn:comunica:default:bindings-aggregator-factory/actors#sum",bus:x,busFailMessage:"Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}"}),new(r(35303).ActorFunctionFactoryExpressionIn)({mediatorFunctionFactory:ye,name:"urn:comunica:default:function-factory/actors#expression-function-in",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(76923).ActorFunctionFactoryExpressionNotIn)({mediatorFunctionFactory:ye,name:"urn:comunica:default:function-factory/actors#expression-function-not-in",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(61127).ActorFunctionFactoryTermGreaterThanEqual)({mediatorFunctionFactory:ye,name:"urn:comunica:default:function-factory/actors#term-function-greater-than-equal",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(63582).ActorFunctionFactoryTermGreaterThan)({mediatorFunctionFactory:ye,name:"urn:comunica:default:function-factory/actors#term-function-greater-than",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(22775).ActorFunctionFactoryTermInequality)({mediatorFunctionFactory:ye,name:"urn:comunica:default:function-factory/actors#term-function-inequality",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(15307).ActorFunctionFactoryTermLesserThanEqual)({mediatorFunctionFactory:ye,name:"urn:comunica:default:function-factory/actors#term-function-lesser-than-equal",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(57314).ActorFunctionFactoryTermLesserThan)({mediatorFunctionFactory:ye,name:"urn:comunica:default:function-factory/actors#term-function-lesser-than",bus:P,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(59378).ActorHttpWayback)({mediatorHttp:me,name:"urn:comunica:default:http/actors#wayback",bus:N,busFailMessage:"HTTP request failed: none of the configured actors were able to handle ${action.input}"}),new(r(51797).ActorRdfUpdateHypermediaPatchSparqlUpdate)({mediatorHttp:ge,name:"urn:comunica:default:rdf-update-hypermedia/actors#patch-sparql-update",bus:E,busFailMessage:"RDF hypermedia updating failed: none of the configured actors were able to handle an update for ${action.url}"}),new(r(48019).ActorRdfUpdateHypermediaPutLdp)({mediatorHttp:ge,mediatorRdfSerializeMediatypes:ue,mediatorRdfSerialize:ce,name:"urn:comunica:default:rdf-update-hypermedia/actors#put-ldp",bus:E,busFailMessage:"RDF hypermedia updating failed: none of the configured actors were able to handle an update for ${action.url}"}),new(r(76904).ActorRdfUpdateHypermediaSparql)({mediatorHttp:ge,checkUrlSuffixSparql:!0,checkUrlSuffixUpdate:!0,name:"urn:comunica:default:rdf-update-hypermedia/actors#sparql",bus:E,busFailMessage:"RDF hypermedia updating failed: none of the configured actors were able to handle an update for ${action.url}"}),new(r(28349).ActorQueryOperationAsk)({mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#ask",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(82340).ActorQueryOperationBgpJoin)({mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#bgp",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(31289).ActorQueryOperationConstruct)({mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#construct",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(72437).ActorQueryOperationDistinctIdentity)({mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#distinct",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(32976).ActorQueryOperationExtend)({mediatorExpressionEvaluatorFactory:fe,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#extend",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(44414).ActorQueryOperationFilter)({mediatorExpressionEvaluatorFactory:fe,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#filter",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(42136).ActorQueryOperationFromQuad)({mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#from",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(43329).ActorQueryOperationNodes)({mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#nodes",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(44521).ActorQueryOperationProject)({mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#project",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(11545).ActorQueryOperationReducedHash)({mediatorHashBindings:B,cacheSize:100,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#reduced",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(69006).ActorQueryOperationSlice)({mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#slice",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(64151).ActorQueryOperationUnion)({mediatorRdfMetadataAccumulate:re,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#union",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(96713).ActorQueryOperationPathAlt)({mediatorRdfMetadataAccumulate:re,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#path-alt",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(30201).ActorQueryOperationPathInv)({mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#path-inv",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(68522).ActorQueryOperationPathLink)({mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#path-link",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(77637).ActorQueryOperationPathNps)({mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#path-nps",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(17397).ActorQueryOperationClear)({mediatorUpdateQuads:pe,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#update-clear",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(47114).ActorQueryOperationUpdateCompositeUpdate)({mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#update-composite",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(26032).ActorQueryOperationCreate)({mediatorUpdateQuads:pe,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#update-create",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(86301).ActorQueryOperationDrop)({mediatorUpdateQuads:pe,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#update-drop",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(16920).ActorQueryOperationLoad)({mediatorUpdateQuads:pe,mediatorQuerySourceIdentify:_e,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#update-load",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(11952).ActorQueryOperationJoin)({mediatorJoin:Te,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#join",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(85065).ActorQueryOperationLeftJoin)({mediatorJoin:Te,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#leftjoin",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(44408).ActorQueryOperationMinus)({mediatorJoin:Te,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#minus",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(7177).ActorQueryOperationPathSeq)({mediatorJoin:Te,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#path-seq",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(58405).ActorRdfJoinMultiSmallest)({mediatorJoinEntriesSort:Z,mediatorJoin:Te,mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#inner-multi-smallest",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"})),Ue=(new(r(21861).ActorBindingsAggregatorFactoryMax)({mediatorTermComparatorFactory:Oe,mediatorExpressionEvaluatorFactory:fe,name:"urn:comunica:default:bindings-aggregator-factory/actors#max",bus:x,busFailMessage:"Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}"}),new(r(30372).ActorBindingsAggregatorFactoryMin)({mediatorTermComparatorFactory:Oe,mediatorExpressionEvaluatorFactory:fe,name:"urn:comunica:default:bindings-aggregator-factory/actors#min",bus:x,busFailMessage:"Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}"}),new(r(9721).ActorQueryOperationOrderBy)({mediatorExpressionEvaluatorFactory:fe,mediatorTermComparatorFactory:Oe,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#orderby",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(77937).ActorOptimizeQueryOperationFilterPushdown)({aggressivePushdown:!1,maxIterations:10,splitConjunctive:!0,mergeConjunctive:!0,pushIntoLeftJoins:!0,pushEqualityIntoPatterns:!0,name:"urn:comunica:default:optimize-query-operation/actors#filter-pushdown",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[q]})),Be=new(r(39174).ActorOptimizeQueryOperationDistinctTermsPushdown)({name:"urn:comunica:default:optimize-query-operation/actors#distinct-terms-pushdown",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[q]}),qe=(new(r(43888).ActorDereferenceHttp)({mediatorHttp:ge,maxAcceptHeaderLength:1024,maxAcceptHeaderLengthBrowser:128,name:"urn:comunica:default:dereference/actors#http",bus:h,busFailMessage:"Dereferencing failed: none of the configured actors were able to handle ${action.url}",beforeActors:[W]}),new(r(1549).ActorInitQuery)({mediatorQueryProcess:ve,mediatorQueryResultSerialize:G,mediatorQueryResultSerializeMediaTypeCombiner:Q,mediatorQueryResultSerializeMediaTypeFormatCombiner:H,mediatorHttpInvalidate:we,defaultQueryInputFormat:"sparql",allowNoSources:!1,name:"urn:comunica:default:init/actors#query",bus:n,busFailMessage:"Initialization failed: none of the configured actors were to initialize"})),Ve=(new(r(21972).ActorRdfParseJsonLd)({cacheSize:128,httpInvalidator:Ee,mediatorHttp:ge,mediaTypePriorities:{"application/json":.15,"application/ld+json":1},mediaTypeFormats:{"application/json":"http://www.w3.org/ns/formats/JSON-LD","application/ld+json":"http://www.w3.org/ns/formats/JSON-LD"},priorityScale:.9,name:"urn:comunica:default:rdf-parse/actors#jsonld",bus:_,busFailMessage:"RDF parsing failed: none of the configured parsers were able to handle the media type ${action.handle.mediaType} for ${action.handle.url}"}),new(r(91437).ActorRdfUpdateQuadsHypermedia)({cacheSize:100,httpInvalidator:Ae,mediatorDereferenceRdf:Y,mediatorMetadata:te,mediatorMetadataExtract:ne,mediatorRdfUpdateHypermedia:de,name:"urn:comunica:default:rdf-update-quads/actors#hypermedia",bus:A,busFailMessage:"RDF updating failed: none of the configured actors were able to handle an update"}),new(r(37794).ActorHttpFetch)({cacheMaxSize:104857600,cacheMaxCount:1e3,cacheMaxEntrySize:5242880,httpInvalidator:Ie,agentOptions:{keepAlive:!0,maxSockets:5},name:"urn:comunica:default:http/actors#fetch",bus:R,busFailMessage:"HTTP request failed: none of the configured actors were able to handle ${action.input}"})),$e=new(r(89157).ActionObserverHttp)({httpInvalidator:Re,observedActors:["urn:comunica:default:http/actors#fetch"],name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-result-serialize-sparql-json/^5.0.0/components/ActorQueryResultSerializeSparqlJson.jsonld#ActorQueryResultSerializeSparqlJson_default_observer",bus:R}),Ge=new(r(35712).ActionObserverHttp)({httpInvalidator:Ne,observedActors:["urn:comunica:default:http/actors#fetch"],name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-result-serialize-stats/^5.0.0/components/ActorQueryResultSerializeStats.jsonld#ActorQueryResultSerializeStats_default_observer",bus:R}),Qe=(new(r(35945).ActorQuerySourceIdentifyHypermediaQpf)({mediatorMetadata:te,mediatorMetadataExtract:ne,mediatorDereferenceRdf:Y,mediatorMergeBindingsContext:je,subjectUri:"http://www.w3.org/1999/02/22-rdf-syntax-ns#subject",predicateUri:"http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate",objectUri:"http://www.w3.org/1999/02/22-rdf-syntax-ns#object",graphUri:"http://www.w3.org/ns/sparql-service-description#graph",name:"urn:comunica:default:query-source-identify-hypermedia/actors#qpf",bus:p,busFailMessage:"Query source hypermedia identification failed: none of the configured actors were able to identify ${action.url}"}),new(r(54333).ActorQuerySourceIdentifyHypermediaSparql)({mediatorHttp:ge,mediatorMergeBindingsContext:je,mediatorQuerySerialize:z,checkUrlSuffix:!0,forceHttpGet:!1,cacheSize:1024,forceSourceType:!1,bindMethod:"values",countTimeout:3e3,cardinalityCountQueries:!0,cardinalityEstimateConstruction:!1,forceGetIfUrlLengthBelow:600,sparqlServerSoftwarePatterns:["Virtuoso","Fuseki"],name:"urn:comunica:default:query-source-identify-hypermedia/actors#sparql",bus:p,busFailMessage:"Query source hypermedia identification failed: none of the configured actors were able to identify ${action.url}"}),new(r(20278).ActorQuerySourceIdentifyHypermediaNone)({mediatorMergeBindingsContext:je,name:"urn:comunica:default:query-source-identify-hypermedia/actors#none",bus:p,busFailMessage:"Query source hypermedia identification failed: none of the configured actors were able to identify ${action.url}"}),new(r(21226).ActorExpressionEvaluatorFactoryDefault)({mediatorQueryOperation:be,mediatorFunctionFactory:ye,mediatorMergeBindingsContext:je,name:"urn:comunica:default:expression-evaluator-factory/actors#default",bus:I,busFailMessage:"Creation of Expression Evaluator failed"}),new(r(80715).ActorQueryOperationGroup)({mediatorMergeBindingsContext:je,mediatorBindingsAggregatorFactory:he,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#group",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(57041).ActorQueryOperationNop)({mediatorMergeBindingsContext:je,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#nop",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(56122).ActorQueryOperationValues)({mediatorMergeBindingsContext:je,name:"urn:comunica:default:query-operation/actors#values",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(230).ActorQueryOperationPathOneOrMore)({mediatorMergeBindingsContext:je,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#path-one-or-more",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(16411).ActorQueryOperationPathZeroOrMore)({mediatorMergeBindingsContext:je,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#path-zero-or-more",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(59975).ActorQueryOperationPathZeroOrOne)({mediatorMergeBindingsContext:je,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#path-zero-or-one",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(17338).ActorQueryOperationUpdateDeleteInsert)({mediatorUpdateQuads:pe,mediatorMergeBindingsContext:je,mediatorQueryOperation:be,name:"urn:comunica:default:query-operation/actors#update-delete-insert",bus:j,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(60295).ActorQueryProcessSequential)({mediatorContextPreprocess:U,mediatorQueryParse:$,mediatorOptimizeQueryOperation:V,mediatorQueryOperation:be,mediatorMergeBindingsContext:je,name:"urn:comunica:default:query-process/actors#sequential",bus:L,busFailMessage:'Query processing failed: none of the configured actor were process to the query "${action.query}"'})),He=new(r(7241).ActorQuerySourceIdentifyHypermedia)({cacheSize:100,maxIterators:64,mediatorMetadataAccumulate:re,mediatorQuerySourceDereferenceLink:K,mediatorRdfResolveHypermediaLinks:oe,mediatorRdfResolveHypermediaLinksQueue:se,mediatorMergeBindingsContext:je,name:"urn:comunica:default:query-source-identify/actors#hypermedia",bus:D,busFailMessage:"Query source identification failed: none of the configured actors were able to identify ${action.querySourceUnidentified.value}"}),ze=(new(r(17374).ActorRdfJoinNone)({mediatorMergeBindingsContext:je,mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#inner-none",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(29429).ActorRdfJoinOptionalBind)({bindOrder:"depth-first",selectivityModifier:1e-6,mediatorQueryOperation:be,mediatorMergeBindingsContext:je,mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#optional-bind",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(49972).ActorTermComparatorFactoryExpressionEvaluator)({mediatorQueryOperation:be,mediatorFunctionFactory:ye,mediatorMergeBindingsContext:je,name:"urn:comunica:default:term-comparator-factory/actors#expression-evaluator",bus:M,busFailMessage:"Creation of term comparator failed"}),new(r(61245).ActorQuerySourceDereferenceLinkForceSparql)({mediatorMetadataAccumulate:re,mediatorQuerySourceIdentifyHypermedia:X,name:"urn:comunica:default:query-source-dereference-link/actors#force-sparql",bus:d,busFailMessage:"Query source dereference link failed: none of the configured actors were able to resolve ${action.link.url}",beforeActors:[Ce]}),new(r(4735).ActorRdfJoinMultiBind)({bindOrder:"depth-first",selectivityModifier:1e-4,minMaxCardinalityRatio:60,mediatorJoinEntriesSort:Z,mediatorQueryOperation:be,mediatorMergeBindingsContext:je,mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#inner-multi-bind",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}",beforeActors:[ke,Le,De,Fe,Me]})),Ke=(new(r(38807).ActorRdfJoinMultiSmallestFilterBindings)({selectivityModifier:1e-4,blockSize:64,mediatorJoinEntriesSort:Z,mediatorJoin:Te,mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#inner-multi-smallest-filter-bindings",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}",beforeActors:[ke,Le,De,Fe,Me]}),new(r(89157).ActorQueryResultSerializeSparqlJson)({emitMetadata:!0,httpObserver:$e,mediaTypePriorities:{"application/sparql-results+json":.8},mediaTypeFormats:{"application/sparql-results+json":"http://www.w3.org/ns/formats/SPARQL_Results_JSON"},name:"urn:comunica:default:query-result-serialize/actors#sparql-json",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(35712).ActorQueryResultSerializeStats)({httpObserver:Ge,mediaTypePriorities:{stats:.5},mediaTypeFormats:{stats:"https://comunica.linkeddatafragments.org/#results_stats"},name:"urn:comunica:default:query-result-serialize/actors#stats",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(94915).ActorQueryProcessExplainParsed)({queryProcessor:Qe,name:"urn:comunica:default:query-process/actors#explain-parsed",bus:L,busFailMessage:'Query processing failed: none of the configured actor were process to the query "${action.query}"'}),new(r(78377).ActorQueryProcessExplainLogical)({queryProcessor:Qe,name:"urn:comunica:default:query-process/actors#explain-logical",bus:L,busFailMessage:'Query processing failed: none of the configured actor were process to the query "${action.query}"'}),new(r(70842).ActorQueryProcessExplainQuery)({queryProcessor:Qe,mediatorQuerySerialize:z,name:"urn:comunica:default:query-process/actors#explain-query",bus:L,busFailMessage:'Query processing failed: none of the configured actor were process to the query "${action.query}"'}),new(r(29175).ActorQueryProcessExplainPhysical)({queryProcessor:Qe,name:"urn:comunica:default:query-process/actors#explain-physical",bus:L,busFailMessage:'Query processing failed: none of the configured actor were process to the query "${action.query}"'}),new(r(23627).ActorOptimizeQueryOperationPruneEmptySourceOperations)({useAskIfSupported:!1,name:"urn:comunica:default:optimize-query-operation/actors#prune-empty-source-operations",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[Ue]})),Xe=(new(r(26121).ActorOptimizeQueryOperationLeftjoinExpressionPushdown)({name:"urn:comunica:default:optimize-query-operation/actors#leftjoin-expression-pushdown",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[Ue]}),new(r(99754).ActorHttpProxy)({mediatorHttp:ge,name:"urn:comunica:default:http/actors#proxy",bus:R,busFailMessage:"HTTP request failed: none of the configured actors were able to handle ${action.input}",beforeActors:[Ve]})),We=(new(r(54598).ActorQuerySourceIdentifyRdfJs)({mediatorMergeBindingsContext:je,name:"urn:comunica:default:query-source-identify/actors#rdfjs",bus:D,busFailMessage:"Query source identification failed: none of the configured actors were able to identify ${action.querySourceUnidentified.value}",beforeActors:[He]}),new(r(10777).ActorQuerySourceIdentifySerialized)({mediatorRdfParse:ie,mediatorQuerySourceIdentify:_e,name:"urn:comunica:default:query-source-identify/actors#serialized",bus:D,busFailMessage:"Query source identification failed: none of the configured actors were able to identify ${action.querySourceUnidentified.value}",beforeActors:[He]}),new(r(21188).ActorQuerySourceIdentifyCompositeFile)({mediatorQuerySourceIdentify:_e,mediatorMergeBindingsContext:je,name:"urn:comunica:default:query-source-identify/actors#compositefile",bus:D,busFailMessage:"Query source identification failed: none of the configured actors were able to identify ${action.querySourceUnidentified.value}",beforeActors:[He]}),new(r(25875).ActorRdfJoinMultiBindSource)({selectivityModifier:1e-4,blockSize:16,mediatorJoinEntriesSort:Z,mediatorJoinSelectivity:ee,name:"urn:comunica:default:rdf-join/actors#inner-multi-bind-source",bus:F,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}",beforeActors:[ke,ze,Le,De,Fe,Me]}),new(r(25982).ActorOptimizeQueryOperationJoinConnected)({name:"urn:comunica:default:optimize-query-operation/actors#join-connected",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[Ke]})),Je=new(r(39704).ActorHttpRetry)({mediatorHttp:ge,httpInvalidator:xe,name:"urn:comunica:default:http/actors#retry",bus:R,busFailMessage:"HTTP request failed: none of the configured actors were able to handle ${action.input}",beforeActors:[Xe]}),Ye=(new(r(73922).ActorHttpLimitRate)({mediatorHttp:ge,httpInvalidator:Pe,correctionMultiplier:.1,failureMultiplier:10,limitByDefault:!1,allowOverlap:!1,name:"urn:comunica:default:http/actors#limit-rate",bus:R,busFailMessage:"HTTP request failed: none of the configured actors were able to handle ${action.input}",beforeActors:[Xe]}),new(r(2944).ActorOptimizeQueryOperationBgpToJoin)({name:"urn:comunica:default:optimize-query-operation/actors#bgp-to-join",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[We]})),Ze=(new(r(28071).ActorHttpRetryBody)({mediatorHttp:ge,name:"urn:comunica:default:http/actors#retry-body",bus:R,busFailMessage:"HTTP request failed: none of the configured actors were able to handle ${action.input}",beforeActors:[Je]}),new(r(77760).ActorOptimizeQueryOperationJoinBgp)({name:"urn:comunica:default:optimize-query-operation/actors#join-bgp",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[Ye]})),et=new(r(42969).ActorOptimizeQueryOperationAssignSourcesExhaustive)({name:"urn:comunica:default:optimize-query-operation/actors#assign-sources-exhaustive",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[Ze,Be]}),tt=new(r(87092).ActorOptimizeQueryOperationQuerySourceSkolemize)({name:"urn:comunica:default:optimize-query-operation/actors#query-source-skolemize",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[et]}),rt=new(r(75751).ActorOptimizeQueryOperationGroupFileSources)({mediatorQuerySourceIdentify:_e,name:"urn:comunica:default:optimize-query-operation/actors#group-file-sources",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[tt]}),nt=new(r(54941).ActorOptimizeQueryOperationQuerySourceIdentify)({serviceForceSparqlEndpoint:!1,cacheSize:100,httpInvalidator:Se,mediatorQuerySourceIdentify:_e,mediatorContextPreprocess:U,name:"urn:comunica:default:optimize-query-operation/actors#query-source-identify",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[rt]});return new(r(81831).ActorOptimizeQueryOperationDescribeToConstructsSubject)({name:"urn:comunica:default:optimize-query-operation/actors#describe-to-constructs-subject",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[nt]}),qe}},80879:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QueryEngine=void 0;const n=r(1549),i=r(21019);class a extends n.QueryEngineBase{constructor(e=i()){super(e)}}t.QueryEngine=a},36885:(e,t,r)=>{var{Buffer:n}=r(1048),i={},a=i.LEFT_BRACE=1,o=i.RIGHT_BRACE=2,s=i.LEFT_BRACKET=3,c=i.RIGHT_BRACKET=4,u=i.COLON=5,l=i.COMMA=6,d=i.TRUE=7,p=i.FALSE=8,h=i.NULL=9,f=i.STRING=10,y=i.NUMBER=11,m=i.START=17,g=i.STOP=18,b=i.TRUE1=33,v=i.TRUE2=34,_=i.TRUE3=35,T=i.FALSE1=49,O=i.FALSE2=50,w=i.FALSE3=51,S=i.FALSE4=52,E=i.NULL1=65,A=i.NULL2=66,x=i.NULL3=67,I=i.NUMBER1=81,P=i.NUMBER3=83,R=i.STRING1=97,N=i.STRING2=98,j=i.STRING3=99,L=i.STRING4=100,D=i.STRING5=101,F=i.STRING6=102,M=i.VALUE=113,C=i.KEY=114,k=i.OBJECT=129,U=i.ARRAY=130,B="\\".charCodeAt(0),q="/".charCodeAt(0),V="\b".charCodeAt(0),$="\f".charCodeAt(0),G="\n".charCodeAt(0),Q="\r".charCodeAt(0),H="\t".charCodeAt(0),z=65536;function K(e){return n.alloc?n.alloc(e):new n(e)}function X(){this.tState=m,this.value=void 0,this.string=void 0,this.stringBuffer=K(z),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=M,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:K(2),3:K(3),4:K(4)},this.offset=-1}X.toknam=function(e){for(var t=Object.keys(i),r=0,n=t.length;r=z&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=e},W.appendStringBuf=function(e,t,r){var n=e.length;"number"==typeof t&&(n="number"==typeof r?r<0?e.length-t+r:r-t:e.length-t),n<0&&(n=0),this.stringBufferOffset+n>z&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),e.copy(this.stringBuffer,this.stringBufferOffset,t,r),this.stringBufferOffset+=n},W.write=function(e){var t;"string"==typeof e&&(e=new n(e));for(var r=0,i=e.length;r=48&&t<64)this.string=String.fromCharCode(t),this.tState=P;else if(32!==t&&9!==t&&10!==t&&13!==t)return this.charError(e,r)}else if(this.tState===R)if(t=e[r],this.bytes_remaining>0){for(var y=0;y=128){if(t<=193||t>244)return this.onError(new Error("Invalid UTF-8 character at position "+r+" in state "+X.toknam(this.tState)));if(t>=194&&t<=223&&(this.bytes_in_sequence=2),t>=224&&t<=239&&(this.bytes_in_sequence=3),t>=240&&t<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+r>e.length){for(var g=0;g<=e.length-1-r;g++)this.temp_buffs[this.bytes_in_sequence][g]=e[r+g];this.bytes_remaining=r+this.bytes_in_sequence-e.length,r=e.length-1}else this.appendStringBuf(e,r,r+this.bytes_in_sequence),r=r+this.bytes_in_sequence-1}else if(34===t)this.tState=m,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(f,this.string),this.offset+=n.byteLength(this.string,"utf8")+1,this.string=void 0;else if(92===t)this.tState=N;else{if(!(t>=32))return this.charError(e,r);this.appendStringChar(t)}else if(this.tState===N)if(34===(t=e[r]))this.appendStringChar(t),this.tState=R;else if(92===t)this.appendStringChar(B),this.tState=R;else if(47===t)this.appendStringChar(q),this.tState=R;else if(98===t)this.appendStringChar(V),this.tState=R;else if(102===t)this.appendStringChar($),this.tState=R;else if(110===t)this.appendStringChar(G),this.tState=R;else if(114===t)this.appendStringChar(Q),this.tState=R;else if(116===t)this.appendStringChar(H),this.tState=R;else{if(117!==t)return this.charError(e,r);this.unicode="",this.tState=j}else if(this.tState===j||this.tState===L||this.tState===D||this.tState===F){if(!((t=e[r])>=48&&t<64||t>64&&t<=70||t>96&&t<=102))return this.charError(e,r);if(this.unicode+=String.fromCharCode(t),this.tState++===F){var M=parseInt(this.unicode,16);this.unicode=void 0,void 0!==this.highSurrogate&&M>=56320&&M<57344?(this.appendStringBuf(new n(String.fromCharCode(this.highSurrogate,M))),this.highSurrogate=void 0):void 0===this.highSurrogate&&M>=55296&&M<56320?this.highSurrogate=M:(void 0!==this.highSurrogate&&(this.appendStringBuf(new n(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new n(String.fromCharCode(M)))),this.tState=R}}else if(this.tState===I||this.tState===P)switch(t=e[r]){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(t),this.tState=P;break;default:this.tState=m;var C=this.numberReviver(this.string,e,r);if(C)return C;this.offset+=this.string.length-1,this.string=void 0,r--}else if(this.tState===b){if(114!==e[r])return this.charError(e,r);this.tState=v}else if(this.tState===v){if(117!==e[r])return this.charError(e,r);this.tState=_}else if(this.tState===_){if(101!==e[r])return this.charError(e,r);this.tState=m,this.onToken(d,!0),this.offset+=3}else if(this.tState===T){if(97!==e[r])return this.charError(e,r);this.tState=O}else if(this.tState===O){if(108!==e[r])return this.charError(e,r);this.tState=w}else if(this.tState===w){if(115!==e[r])return this.charError(e,r);this.tState=S}else if(this.tState===S){if(101!==e[r])return this.charError(e,r);this.tState=m,this.onToken(p,!1),this.offset+=4}else if(this.tState===E){if(117!==e[r])return this.charError(e,r);this.tState=A}else if(this.tState===A){if(108!==e[r])return this.charError(e,r);this.tState=x}else if(this.tState===x){if(108!==e[r])return this.charError(e,r);this.tState=m,this.onToken(h,null),this.offset+=3}},W.onToken=function(e,t){},W.parseError=function(e,t){this.tState=g,this.onError(new Error("Unexpected "+X.toknam(e)+(t?"("+JSON.stringify(t)+")":"")+" in state "+X.toknam(this.state)))},W.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},W.pop=function(){var e=this.value,t=this.stack.pop();this.value=t.value,this.key=t.key,this.mode=t.mode,this.emit(e),this.mode||(this.state=M)},W.emit=function(e){this.mode&&(this.state=l),this.onValue(e)},W.onValue=function(e){},W.onToken=function(e,t){if(this.state===M)if(e===f||e===y||e===d||e===p||e===h)this.value&&(this.value[this.key]=t),this.emit(t);else if(e===a)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=C,this.mode=k;else if(e===s)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=U,this.state=M;else if(e===o){if(this.mode!==k)return this.parseError(e,t);this.pop()}else{if(e!==c)return this.parseError(e,t);if(this.mode!==U)return this.parseError(e,t);this.pop()}else if(this.state===C)if(e===f)this.key=t,this.state=u;else{if(e!==o)return this.parseError(e,t);this.pop()}else if(this.state===u){if(e!==u)return this.parseError(e,t);this.state=M}else{if(this.state!==l)return this.parseError(e,t);if(e===l)this.mode===U?(this.key++,this.state=M):this.mode===k&&(this.state=C);else{if(!(e===c&&this.mode===U||e===o&&this.mode===k))return this.parseError(e,t);this.pop()}}},W.numberReviver=function(e,t,r){var n=Number(e);if(isNaN(n))return this.charError(t,r);e.match(/[0-9]+/)==e&&n.toString()!=e?this.onToken(f,e):this.onToken(y,n)},X.C=i,e.exports=X},64265:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fragment=void 0,t.fragment=function(e){let t=function(e){let t=e;(t.endsWith("/")||t.endsWith("#"))&&(t=t.slice(0,t.length-1));const r=[];t.lastIndexOf("/")>0&&r.push(t.lastIndexOf("/")),t.lastIndexOf("#")>0&&r.push(t.lastIndexOf("#"));const n=Math.max(...r);return t.slice(n+1)}(e);return t=t?function(e){var t;const r=null===(t=e.split(/[^a-z0-9]+/gi).filter((e=>""!==e)).map((e=>e[0].toUpperCase()+e.slice(1))).join("").match(/[a-z][a-z0-9]+/gi))||void 0===t?void 0:t[0];return void 0===r?void 0:r[0].toLowerCase()+r.slice(1)}(t):void 0,t||"v"}},37669:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.lookupAllPrefixes=t.prefixToUri=t.uriToPrefix=void 0;const i=r(64265),a=r(30376);t.uriToPrefix=function(e,t){return n(this,void 0,void 0,(function*(){let r;try{r=yield(0,a.lookupPrefix)(e,t)}catch(n){(null==t?void 0:t.mintOnUnknown)&&(r=(0,i.fragment)(e).slice(0,4))}if(void 0!==r&&"object"==typeof(null==t?void 0:t.existingPrefixes)&&r in t.existingPrefixes){let e=0;for(;`${r}${e}`in t.existingPrefixes;)e+=1;r=`${r}${e}`}return r}))},t.prefixToUri=function(e,t){return n(this,void 0,void 0,(function*(){try{return yield(0,a.lookupUri)(e,t)}catch(e){return}}))};var o=r(30376);Object.defineProperty(t,"lookupAllPrefixes",{enumerable:!0,get:function(){return o.lookupAllPrefixes}})},87173:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchContext=t.fetchJson=void 0;const i=r(99766);function a(e,t){var r;return n(this,void 0,void 0,(function*(){const n=null!==(r=null==t?void 0:t.fetch)&&void 0!==r?r:i.fetch;return(yield n(e)).json()}))}t.fetchJson=a,t.fetchContext=function(e,t){return n(this,void 0,void 0,(function*(){return(yield a(e,t))["@context"]}))}},30376:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(12257),t),i(r(39268),t),i(r(91661),t)},91661:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.lookupAllPrefixes=void 0;const i=r(87173);t.lookupAllPrefixes=function(e){return n(this,void 0,void 0,(function*(){return(0,i.fetchContext)("https://prefix.cc/context",e)}))}},12257:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.lookupUri=void 0;const i=r(87173);t.lookupUri=function(e,t){return n(this,void 0,void 0,(function*(){const r=(yield(0,i.fetchContext)(`https://prefix.cc/${e}.file.jsonld`,t))[e];if("string"!=typeof r)throw new Error(`Expected uri to be a string, received: ${r} of type ${typeof r}`);return r}))}},39268:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.lookupPrefix=void 0;const i=r(87173);t.lookupPrefix=function(e,t){return n(this,void 0,void 0,(function*(){const r=new URL("https://prefix.cc/reverse");r.searchParams.append("uri",e),r.searchParams.append("format","jsonld");const n=Object.keys(yield(0,i.fetchContext)(r,t));if(0===n.length)throw new Error("No prefixes returned");return n[0]}))}},99766:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in e,o="ArrayBuffer"in e;if(o)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function y(e){var t=new FileReader,r=f(t);return t.readAsArrayBuffer(e),r}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var e,t,r,n=h(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=f(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function _(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function T(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},g.call(v.prototype),g.call(T.prototype),T.prototype.clone=function(){return new T(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},T.error=function(){var e=new T(null,{status:0,statusText:""});return e.type="error",e};var O=[301,302,303,307,308];T.redirect=function(e,t){if(-1===O.indexOf(t))throw new RangeError("Invalid status code");return new T(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function w(e,r){return new Promise((function(n,a){var o=new v(e,r);if(o.signal&&o.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new T(i,r))},s.onerror=function(){a(new TypeError("Network request failed"))},s.ontimeout=function(){a(new TypeError("Network request failed"))},s.onabort=function(){a(new t.DOMException("Aborted","AbortError"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),o.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",c)}),s.send(void 0===o._bodyInit?null:o._bodyInit)}))}w.polyfill=!0,e.fetch||(e.fetch=w,e.Headers=p,e.Request=v,e.Response=T),t.Headers=p,t.Request=v,t.Response=T,t.fetch=w,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},31759:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.stringify=function(e){return n(this,void 0,void 0,(function*(){let t="";return e.on("data",(e=>{t+=e})),yield(0,i.promisifyEventEmitter)(e),t}))};const i=r(35033)},49126:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SaxesParser=t.EVENTS=void 0;const n=r(94824),i=r(30718),a=r(26457);var o=n.isS,s=n.isChar,c=n.isNameStartChar,u=n.isNameChar,l=n.S_LIST,d=n.NAME_RE,p=i.isChar,h=a.isNCNameStartChar,f=a.isNCNameChar,y=a.NC_NAME_RE;const m="http://www.w3.org/XML/1998/namespace",g="http://www.w3.org/2000/xmlns/",b={__proto__:null,xml:m,xmlns:g},v={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},_=-1,T=-2,O=13,w=33,S=10,E=60,A=61,x=62,I=63,P=93,R=e=>34===e||39===e,N=[34,39],j=[...N,91,x],L=[...N,E,P],D=[A,I,...l],F=[...l,x,38,E];function M(e,t,r){switch(t){case"xml":r!==m&&e.fail(`xml prefix must be bound to ${m}.`);break;case"xmlns":r!==g&&e.fail(`xmlns prefix must be bound to ${g}.`)}switch(r){case g:e.fail(""===t?`the default namespace may not be set to ${r}.`:`may not assign a prefix (even "xmlns") to the URI ${g}.`);break;case m:switch(t){case"xml":break;case"":e.fail(`the default namespace may not be set to ${r}.`);break;default:e.fail("may not assign the xml namespace to another prefix.")}}}const C=e=>y.test(e),k=e=>d.test(e);t.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];const U={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};t.SaxesParser=class{get closed(){return this._closed}constructor(e){this.opt=null!=e?e:{},this.fragmentOpt=!!this.opt.fragment;const t=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=!1!==this.opt.position,this.fileName=this.opt.fileName,t){this.nameStartCheck=h,this.nameCheck=f,this.isName=C,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},b);const e=this.opt.additionalNamespaces;null!=e&&(function(e,t){for(const r of Object.keys(t))M(e,r,t[r])}(this,e),Object.assign(this.ns,e))}else this.nameStartCheck=c,this.nameCheck=u,this.isName=k,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}_init(){var e;this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=0,this.attribList=[];const{fragmentOpt:t}=this;this.state=t?O:0,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=t,this.xmlDeclPossible=!t,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:r}=this.opt;if(void 0===r){if(!0===this.opt.forceXMLVersion)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");r="1.0"}this.setXMLVersion(r),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(v),null===(e=this.readyHandler)||void 0===e||e.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(e,t){this[U[e]]=t}off(e){this[U[e]]=void 0}makeError(e){var t;let r=null!==(t=this.fileName)&&void 0!==t?t:"";return this.trackPosition&&(r.length>0&&(r+=":"),r+=`${this.line}:${this.column}`),r.length>0&&(r+=": "),new Error(r+e)}fail(e){const t=this.makeError(e),r=this.errorHandler;if(void 0===r)throw t;return r(t),this}write(e){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let t=!1;null===e?(t=!0,e=""):"object"==typeof e&&(e=e.toString()),void 0!==this.carriedFromPrevious&&(e=`${this.carriedFromPrevious}${e}`,this.carriedFromPrevious=void 0);let r=e.length;const n=e.charCodeAt(r-1);!t&&(13===n||n>=55296&&n<=56319)&&(this.carriedFromPrevious=e[r-1],r--,e=e.slice(0,r));const{stateTable:i}=this;for(this.chunk=e,this.i=0;this.i=e.length)return _;const r=e.charCodeAt(t);if(this.column++,r<55296){if(r>=32||9===r)return r;switch(r){case S:return this.line++,this.column=0,this.positionAtNewLine=this.position,S;case 13:return e.charCodeAt(t+1)===S&&(this.i=t+2),this.line++,this.column=0,this.positionAtNewLine=this.position,T;default:return this.fail("disallowed character."),r}}if(r>56319)return r>=57344&&r<=65533||this.fail("disallowed character."),r;const n=65536+1024*(r-55296)+(e.charCodeAt(t+1)-56320);return this.i=t+2,n>1114111&&this.fail("disallowed character."),n}getCode11(){const{chunk:e,i:t}=this;if(this.prevI=t,this.i=t+1,t>=e.length)return _;const r=e.charCodeAt(t);if(this.column++,r<55296){if(r>31&&r<127||r>159&&8232!==r||9===r)return r;switch(r){case S:return this.line++,this.column=0,this.positionAtNewLine=this.position,S;case 13:{const r=e.charCodeAt(t+1);r!==S&&133!==r||(this.i=t+2)}case 133:case 8232:return this.line++,this.column=0,this.positionAtNewLine=this.position,T;default:return this.fail("disallowed character."),r}}if(r>56319)return r>=57344&&r<=65533||this.fail("disallowed character."),r;const n=65536+1024*(r-55296)+(e.charCodeAt(t+1)-56320);return this.i=t+2,n>1114111&&this.fail("disallowed character."),n}getCodeNorm(){const e=this.getCode();return e===T?S:e}unget(){this.i=this.prevI,this.column--}captureTo(e){let{i:t}=this;const{chunk:r}=this;for(;;){const n=this.getCode(),i=n===T,a=i?S:n;if(a===_||e.includes(a))return this.text+=r.slice(t,this.prevI),a;i&&(this.text+=`${r.slice(t,this.prevI)}\n`,t=this.i)}}captureToChar(e){let{i:t}=this;const{chunk:r}=this;for(;;){let n=this.getCode();switch(n){case T:this.text+=`${r.slice(t,this.prevI)}\n`,t=this.i,n=S;break;case _:return this.text+=r.slice(t),!1}if(n===e)return this.text+=r.slice(t,this.prevI),!0}}captureNameChars(){const{chunk:e,i:t}=this;for(;;){const r=this.getCode();if(r===_)return this.name+=e.slice(t),_;if(!u(r))return this.name+=e.slice(t,this.prevI),r===T?S:r}}skipSpaces(){for(;;){const e=this.getCodeNorm();if(e===_||!o(e))return e}}setXMLVersion(e){this.currentXMLVersion=e,"1.0"===e?(this.isChar=s,this.getCode=this.getCode10):(this.isChar=p,this.getCode=this.getCode11)}sBegin(){65279===this.chunk.charCodeAt(0)&&(this.i++,this.column++),this.state=1}sBeginWhitespace(){const e=this.i,t=this.skipSpaces();switch(this.prevI!==e&&(this.xmlDeclPossible=!1),t){case E:if(this.state=15,0!==this.text.length)throw new Error("no-empty text at start");break;case _:break;default:this.unget(),this.state=O,this.xmlDeclPossible=!1}}sDoctype(){var e;const t=this.captureTo(j);switch(t){case x:null===(e=this.doctypeHandler)||void 0===e||e.call(this,this.text),this.text="",this.state=O,this.doctype=!0;break;case _:break;default:this.text+=String.fromCodePoint(t),91===t?this.state=4:R(t)&&(this.state=3,this.q=t)}}sDoctypeQuote(){const e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.q=null,this.state=2)}sDTD(){const e=this.captureTo(L);e!==_&&(this.text+=String.fromCodePoint(e),e===P?this.state=2:e===E?this.state=6:R(e)&&(this.state=5,this.q=e))}sDTDQuoted(){const e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.state=4,this.q=null)}sDTDOpenWaka(){const e=this.getCodeNorm();switch(this.text+=String.fromCodePoint(e),e){case 33:this.state=7,this.openWakaBang="";break;case I:this.state=11;break;default:this.state=4}}sDTDOpenWakaBang(){const e=String.fromCodePoint(this.getCodeNorm()),t=this.openWakaBang+=e;this.text+=e,"-"!==t&&(this.state="--"===t?8:4,this.openWakaBang="")}sDTDComment(){this.captureToChar(45)&&(this.text+="-",this.state=9)}sDTDCommentEnding(){const e=this.getCodeNorm();this.text+=String.fromCodePoint(e),this.state=45===e?10:8}sDTDCommentEnded(){const e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===x?this.state=4:(this.fail("malformed comment."),this.state=8)}sDTDPI(){this.captureToChar(I)&&(this.text+="?",this.state=12)}sDTDPIEnding(){const e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===x&&(this.state=4)}sText(){0!==this.tags.length?this.handleTextInRoot():this.handleTextOutsideRoot()}sEntity(){let{i:e}=this;const{chunk:t}=this;e:for(;;)switch(this.getCode()){case T:this.entity+=`${t.slice(e,this.prevI)}\n`,e=this.i;break;case 59:{const{entityReturnState:r}=this,n=this.entity+t.slice(e,this.prevI);let i;this.state=r,""===n?(this.fail("empty entity name."),i="&;"):(i=this.parseEntity(n),this.entity=""),r===O&&void 0===this.textHandler||(this.text+=i);break e}case _:this.entity+=t.slice(e);break e}}sOpenWaka(){const e=this.getCode();if(c(e))this.state=34,this.unget(),this.xmlDeclPossible=!1;else switch(e){case 47:this.state=43,this.xmlDeclPossible=!1;break;case 33:this.state=16,this.openWakaBang="",this.xmlDeclPossible=!1;break;case I:this.state=23;break;default:this.fail("disallowed character in tag name"),this.state=O,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":this.sawRoot||this.reportedTextBeforeRoot||(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0),this.state=20,this.openWakaBang="";break;case"--":this.state=17,this.openWakaBang="";break;case"DOCTYPE":this.state=2,(this.doctype||this.sawRoot)&&this.fail("inappropriately located doctype declaration."),this.openWakaBang="";break;default:this.openWakaBang.length>=7&&this.fail("incorrect syntax.")}}sComment(){this.captureToChar(45)&&(this.state=18)}sCommentEnding(){var e;const t=this.getCodeNorm();45===t?(this.state=19,null===(e=this.commentHandler)||void 0===e||e.call(this,this.text),this.text=""):(this.text+=`-${String.fromCodePoint(t)}`,this.state=17)}sCommentEnded(){const e=this.getCodeNorm();e!==x?(this.fail("malformed comment."),this.text+=`--${String.fromCodePoint(e)}`,this.state=17):this.state=O}sCData(){this.captureToChar(P)&&(this.state=21)}sCDataEnding(){const e=this.getCodeNorm();e===P?this.state=22:(this.text+=`]${String.fromCodePoint(e)}`,this.state=20)}sCDataEnding2(){var e;const t=this.getCodeNorm();switch(t){case x:null===(e=this.cdataHandler)||void 0===e||e.call(this,this.text),this.text="",this.state=O;break;case P:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(t)}`,this.state=20}}sPIFirstChar(){const e=this.getCodeNorm();this.nameStartCheck(e)?(this.piTarget+=String.fromCodePoint(e),this.state=24):e===I||o(e)?(this.fail("processing instruction without a target."),this.state=e===I?26:25):(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(e),this.state=24)}sPIRest(){const{chunk:e,i:t}=this;for(;;){const r=this.getCodeNorm();if(r===_)return void(this.piTarget+=e.slice(t));if(!this.nameCheck(r)){this.piTarget+=e.slice(t,this.prevI);const n=r===I;n||o(r)?"xml"===this.piTarget?(this.xmlDeclPossible||this.fail("an XML declaration must be at the start of the document."),this.state=n?w:27):this.state=n?26:25:(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(r));break}}}sPIBody(){if(0===this.text.length){const e=this.getCodeNorm();e===I?this.state=26:o(e)||(this.text=String.fromCodePoint(e))}else this.captureToChar(I)&&(this.state=26)}sPIEnding(){var e;const t=this.getCodeNorm();if(t===x){const{piTarget:t}=this;"xml"===t.toLowerCase()&&this.fail("the XML declaration must appear at the start of the document."),null===(e=this.piHandler)||void 0===e||e.call(this,{target:t,body:this.text}),this.piTarget=this.text="",this.state=O}else t===I?this.text+="?":(this.text+=`?${String.fromCodePoint(t)}`,this.state=25);this.xmlDeclPossible=!1}sXMLDeclNameStart(){const e=this.skipSpaces();e!==I?e!==_&&(this.state=28,this.name=String.fromCodePoint(e)):this.state=w}sXMLDeclName(){const e=this.captureTo(D);if(e===I)return this.state=w,this.name+=this.text,this.text="",void this.fail("XML declaration is incomplete.");if(o(e)||e===A){if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=e===A?30:29}}sXMLDeclEq(){const e=this.getCodeNorm();if(e===I)return this.state=w,void this.fail("XML declaration is incomplete.");o(e)||(e!==A&&this.fail("value required."),this.state=30)}sXMLDeclValueStart(){const e=this.getCodeNorm();if(e===I)return this.state=w,void this.fail("XML declaration is incomplete.");o(e)||(R(e)?this.q=e:(this.fail("value must be quoted."),this.q=32),this.state=31)}sXMLDeclValue(){const e=this.captureTo([this.q,I]);if(e===I)return this.state=w,this.text="",void this.fail("XML declaration is incomplete.");if(e===_)return;const t=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];const e=t;this.xmlDecl.version=e,/^1\.[0-9]+$/.test(e)?this.opt.forceXMLVersion||this.setXMLVersion(e):this.fail("version number must match /^1\\.[0-9]+$/.");break}case"encoding":/^[A-Za-z][A-Za-z0-9._-]*$/.test(t)||this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."),this.xmlDeclExpects=["standalone"],this.xmlDecl.encoding=t;break;case"standalone":"yes"!==t&&"no"!==t&&this.fail('standalone value must match "yes" or "no".'),this.xmlDeclExpects=[],this.xmlDecl.standalone=t}this.name="",this.state=32}sXMLDeclSeparator(){const e=this.getCodeNorm();e!==I?(o(e)||(this.fail("whitespace required."),this.unget()),this.state=27):this.state=w}sXMLDeclEnding(){var e;this.getCodeNorm()===x?("xml"!==this.piTarget?this.fail("processing instructions are not allowed before root."):"version"!==this.name&&this.xmlDeclExpects.includes("version")&&this.fail("XML declaration must contain a version."),null===(e=this.xmldeclHandler)||void 0===e||e.call(this,this.xmlDecl),this.name="",this.piTarget=this.text="",this.state=O):this.fail("The character ? is disallowed anywhere in XML declarations."),this.xmlDeclPossible=!1}sOpenTag(){var e;const t=this.captureNameChars();if(t===_)return;const r=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name="",this.xmlnsOpt&&(this.topNS=r.ns=Object.create(null)),null===(e=this.openTagStartHandler)||void 0===e||e.call(this,r),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail("documents may contain only one root."),t){case x:this.openTag();break;case 47:this.state=35;break;default:o(t)||this.fail("disallowed character in tag name."),this.state=36}}sOpenTagSlash(){this.getCode()===x?this.openSelfClosingTag():(this.fail("forward-slash in opening tag not followed by >."),this.state=36)}sAttrib(){const e=this.skipSpaces();e!==_&&(c(e)?(this.unget(),this.state=37):e===x?this.openTag():47===e?this.state=35:this.fail("disallowed character in attribute name."))}sAttribName(){const e=this.captureNameChars();e===A?this.state=39:o(e)?this.state=38:e===x?(this.fail("attribute without value."),this.pushAttrib(this.name,this.name),this.name=this.text="",this.openTag()):e!==_&&this.fail("disallowed character in attribute name.")}sAttribNameSawWhite(){const e=this.skipSpaces();switch(e){case _:return;case A:this.state=39;break;default:this.fail("attribute without value."),this.text="",this.name="",e===x?this.openTag():c(e)?(this.unget(),this.state=37):(this.fail("disallowed character in attribute name."),this.state=36)}}sAttribValue(){const e=this.getCodeNorm();R(e)?(this.q=e,this.state=40):o(e)||(this.fail("unquoted attribute value."),this.state=42,this.unget())}sAttribValueQuoted(){const{q:e,chunk:t}=this;let{i:r}=this;for(;;)switch(this.getCode()){case e:return this.pushAttrib(this.name,this.text+t.slice(r,this.prevI)),this.name=this.text="",this.q=null,void(this.state=41);case 38:return this.text+=t.slice(r,this.prevI),this.state=14,void(this.entityReturnState=40);case S:case T:case 9:this.text+=`${t.slice(r,this.prevI)} `,r=this.i;break;case E:return this.text+=t.slice(r,this.prevI),void this.fail("disallowed character.");case _:return void(this.text+=t.slice(r))}}sAttribValueClosed(){const e=this.getCodeNorm();o(e)?this.state=36:e===x?this.openTag():47===e?this.state=35:c(e)?(this.fail("no whitespace between attributes."),this.unget(),this.state=37):this.fail("disallowed character in attribute name.")}sAttribValueUnquoted(){const e=this.captureTo(F);switch(e){case 38:this.state=14,this.entityReturnState=42;break;case E:this.fail("disallowed character.");break;case _:break;default:this.text.includes("]]>")&&this.fail('the string "]]>" is disallowed in char data.'),this.pushAttrib(this.name,this.text),this.name=this.text="",e===x?this.openTag():this.state=36}}sCloseTag(){const e=this.captureNameChars();e===x?this.closeTag():o(e)?this.state=44:e!==_&&this.fail("disallowed character in closing tag.")}sCloseTagSawWhite(){switch(this.skipSpaces()){case x:this.closeTag();break;case _:break;default:this.fail("disallowed character in closing tag.")}}handleTextInRoot(){let{i:e,forbiddenState:t}=this;const{chunk:r,textHandler:n}=this;e:for(;;)switch(this.getCode()){case E:if(this.state=15,void 0!==n){const{text:t}=this,i=r.slice(e,this.prevI);0!==t.length?(n(t+i),this.text=""):0!==i.length&&n(i)}t=0;break e;case 38:this.state=14,this.entityReturnState=O,void 0!==n&&(this.text+=r.slice(e,this.prevI)),t=0;break e;case P:switch(t){case 0:t=1;break;case 1:t=2;break;case 2:break;default:throw new Error("impossible state")}break;case x:2===t&&this.fail('the string "]]>" is disallowed in char data.'),t=0;break;case T:void 0!==n&&(this.text+=`${r.slice(e,this.prevI)}\n`),e=this.i,t=0;break;case _:void 0!==n&&(this.text+=r.slice(e));break e;default:t=0}this.forbiddenState=t}handleTextOutsideRoot(){let{i:e}=this;const{chunk:t,textHandler:r}=this;let n=!1;e:for(;;){const i=this.getCode();switch(i){case E:if(this.state=15,void 0!==r){const{text:n}=this,i=t.slice(e,this.prevI);0!==n.length?(r(n+i),this.text=""):0!==i.length&&r(i)}break e;case 38:this.state=14,this.entityReturnState=O,void 0!==r&&(this.text+=t.slice(e,this.prevI)),n=!0;break e;case T:void 0!==r&&(this.text+=`${t.slice(e,this.prevI)}\n`),e=this.i;break;case _:void 0!==r&&(this.text+=t.slice(e));break e;default:o(i)||(n=!0)}}n&&(this.sawRoot||this.reportedTextBeforeRoot||(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(e,t){var r;const{prefix:n,local:i}=this.qname(e),a={name:e,prefix:n,local:i,value:t};if(this.attribList.push(a),null===(r=this.attributeHandler)||void 0===r||r.call(this,a),"xmlns"===n){const e=t.trim();"1.0"===this.currentXMLVersion&&""===e&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[i]=e,M(this,i,e)}else if("xmlns"===e){const e=t.trim();this.topNS[""]=e,M(this,"",e)}}pushAttribPlain(e,t){var r;const n={name:e,value:t};this.attribList.push(n),null===(r=this.attributeHandler)||void 0===r||r.call(this,n)}end(){var e,t;this.sawRoot||this.fail("document must contain a root element.");const{tags:r}=this;for(;r.length>0;){const e=r.pop();this.fail(`unclosed tag: ${e.name}`)}0!==this.state&&this.state!==O&&this.fail("unexpected end.");const{text:n}=this;return 0!==n.length&&(null===(e=this.textHandler)||void 0===e||e.call(this,n),this.text=""),this._closed=!0,null===(t=this.endHandler)||void 0===t||t.call(this),this._init(),this}resolve(e){var t,r;let n=this.topNS[e];if(void 0!==n)return n;const{tags:i}=this;for(let t=i.length-1;t>=0;t--)if(n=i[t].ns[e],void 0!==n)return n;return n=this.ns[e],void 0!==n?n:null===(r=(t=this.opt).resolvePrefix)||void 0===r?void 0:r.call(t,e)}qname(e){const t=e.indexOf(":");if(-1===t)return{prefix:"",local:e};const r=e.slice(t+1),n=e.slice(0,t);return(""===n||""===r||r.includes(":"))&&this.fail(`malformed name: ${e}.`),{prefix:n,local:r}}processAttribsNS(){var e;const{attribList:t}=this,r=this.tag;{const{prefix:t,local:n}=this.qname(r.name);r.prefix=t,r.local=n;const i=r.uri=null!==(e=this.resolve(t))&&void 0!==e?e:"";""!==t&&("xmlns"===t&&this.fail('tags may not have "xmlns" as prefix.'),""===i&&(this.fail(`unbound namespace prefix: ${JSON.stringify(t)}.`),r.uri=t))}if(0===t.length)return;const{attributes:n}=r,i=new Set;for(const e of t){const{name:t,prefix:r,local:a}=e;let o,s;""===r?(o="xmlns"===t?g:"",s=t):(o=this.resolve(r),void 0===o&&(this.fail(`unbound namespace prefix: ${JSON.stringify(r)}.`),o=r),s=`{${o}}${a}`),i.has(s)&&this.fail(`duplicate attribute: ${s}.`),i.add(s),e.uri=o,n[t]=e}this.attribList=[]}processAttribsPlain(){const{attribList:e}=this,t=this.tag.attributes;for(const{name:r,value:n}of e)void 0!==t[r]&&this.fail(`duplicate attribute: ${r}.`),t[r]=n;this.attribList=[]}openTag(){var e;this.processAttribs();const{tags:t}=this,r=this.tag;r.isSelfClosing=!1,null===(e=this.openTagHandler)||void 0===e||e.call(this,r),t.push(r),this.state=O,this.name=""}openSelfClosingTag(){var e,t,r;this.processAttribs();const{tags:n}=this,i=this.tag;i.isSelfClosing=!0,null===(e=this.openTagHandler)||void 0===e||e.call(this,i),null===(t=this.closeTagHandler)||void 0===t||t.call(this,i),null===(this.tag=null!==(r=n[n.length-1])&&void 0!==r?r:null)&&(this.closedRoot=!0),this.state=O,this.name=""}closeTag(){const{tags:e,name:t}=this;if(this.state=O,this.name="",""===t)return this.fail("weird empty close tag."),void(this.text+="");const r=this.closeTagHandler;let n=e.length;for(;n-- >0;){const n=this.tag=e.pop();if(this.topNS=n.ns,null==r||r(n),n.name===t)break;this.fail("unexpected close tag.")}0===n?this.closedRoot=!0:n<0&&(this.fail(`unmatched closing tag: ${t}.`),this.text+=``)}parseEntity(e){if("#"!==e[0]){const t=this.ENTITIES[e];return void 0!==t?t:(this.fail(this.isName(e)?"undefined entity.":"disallowed character in entity name."),`&${e};`)}let t=NaN;return"x"===e[1]&&/^#x[0-9a-f]+$/i.test(e)?t=parseInt(e.slice(2),16):/^#[0-9]+$/.test(e)&&(t=parseInt(e.slice(1),10)),this.isChar(t)?String.fromCodePoint(t):(this.fail("malformed character entity."),`&${e};`)}}},67083:e=>{"use strict";const{AbortController:t,AbortSignal:r}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=r,e.exports.default=t},37754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=[];return r=e.on("data",(e=>t.push(e))),n=t,new Promise(((e,t)=>{r.on("end",(()=>e(n))),r.on("error",t)}));var r,n}},2922:(e,t,r)=>{const n=r(82815),i=r(30979),a=r(67458),o=r(21156),s=r(37841);e.exports={DynamicNestedLoopJoin:n,HashJoin:i,NestedLoopJoin:a,SymmetricHashJoin:o,MergeStream:s}},82815:(e,t,r)=>{let n=r(76664),i=n.MultiTransformIterator,a=n.SimpleTransformIterator;e.exports=class extends i{constructor(e,t,r,n){super(e,n),this.funRight=t,this.funJoin=r}_createTransformer(e){return new a(this.funRight(e),{transform:(t,r,n)=>{let i=this.funJoin(e,t);null!==i&&n(i),r()}})}}},30979:(e,t,r)=>{let n=r(76664).AsyncIterator;e.exports=class extends n{constructor(e,t,r,n){super(),this.addedDataListener=!1,this.left=e,this.right=t,this.funHash=r,this.funJoin=n,this.leftMap=new Map,this.match=null,this.matches=[],this.matchIdx=0,this.left.on("error",(e=>this.destroy(e))),this.right.on("error",(e=>this.destroy(e))),this.readable=!1,this.left.on("end",function(){this.readable=!0,this.right.on("readable",(()=>this.readable=!0)),this.right.on("end",(()=>{this.hasResults()||this._end()}))}.bind(this)),this.on("newListener",(e=>{"data"===e&&this._addDataListenerIfNeeded()})),this.left.readable&&this._addDataListenerIfNeeded(),this.left.on("readable",(()=>this._addDataListenerIfNeeded()))}hasResults(){return!this.right.ended||this.matchIdx{const{MultiTransformIterator:n,SimpleTransformIterator:i,scheduleTask:a}=r(76664);e.exports=class extends n{constructor(e,t,r,n){super(e,n),this.right=t,this.funJoin=r,this.on("end",(()=>this.right.close()))}_end(){super._end(),a((()=>this.right.destroy()))}_createTransformer(e){return new i(this.right.clone(),{transform:(t,r,n)=>{let i=this.funJoin(e,t);null!==i&&n(i),r()}})}}},21156:(e,t,r)=>{let n=r(76664).AsyncIterator;e.exports=class extends n{constructor(e,t,r,n){super(),this.left=e,this.right=t,this.funHash=r,this.funJoin=n,this.usedLeft=!1,this.leftMap=new Map,this.rightMap=new Map,this.on("end",(()=>this._cleanup())),this.match=null,this.matches=[],this.matchIdx=0,(this.left.readable||this.right.readable)&&(this.readable=!0),this.left.on("error",(e=>this.destroy(e))),this.right.on("error",(e=>this.destroy(e))),this.left.on("readable",(()=>this.readable=!0)),this.right.on("readable",(()=>this.readable=!0)),this.left.on("end",(()=>{this.hasResults()||this._end()})),this.right.on("end",(()=>{this.hasResults()||this._end()}))}hasResults(){return!this.left.ended||!this.right.ended||!!this.matches&&this.matchIdx{let n=r(76664).AsyncIterator;e.exports=class extends n{constructor(e){super(),Array.isArray(e)||(e=Array.prototype.slice.call(arguments)),this.streams=e;for(let t of e)t.on("readable",(()=>this.emit("readable"))),t.on("end",(()=>this._removeStream(t)));0===this.streams.length&&this.close(),this.idx=this.streams.length-1}_removeStream(e){let t=this.streams.indexOf(e);t<0||(this.streams.splice(t,1),this.idx>=this.streams.length&&--this.idx,0===this.streams.length&&this._end())}close(){super.close();for(let e of this.streams)e.close()}read(){for(let e=0;e{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=s(e),o=a[0],c=a[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,c)),l=0,d=c>0?o-4:o;for(r=0;r>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[l++]=255&t),1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,u=n-i;su?u:s+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},1048:(e,t,r)=>{"use strict";const n=r(7991),i=r(39318),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function s(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=s(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(X(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|f(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||W(e.length)?s(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),s(e<0?0:0|f(e))}function p(e){const t=e.length<0?0:0|f(e.length),r=s(t);for(let n=0;n=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return n?-1:H(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),W(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let a,o=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let n=-1;for(a=r;as&&(r=s-c),a=r;a>=0;a--){let r=!0;for(let n=0;ni&&(n=i):n=i;const a=t.length;let o;for(n>a/2&&(n=a/2),o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(a=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,c>65535&&c<1114112&&(a=c))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=o}return function(e){const t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(X(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0);const s=Math.min(a,o),u=this.slice(n,i),l=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return T(this,e,t,r);case"ascii":case"latin1":case"binary":return O(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;in)&&(r=n);let i="";for(let n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function D(e,t,r,n,i){V(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function F(e,t,r,n,i){V(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function M(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(e,t,r,n,a){return t=+t,r>>>=0,a||M(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function k(e,t,r,n,a){return t=+t,r>>>=0,a||M(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e],i=1,a=0;for(;++a>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Y((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e],i=1,a=0;for(;++a=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=t,i=1,a=this[e+--n];for(;n>0&&(i*=256);)a+=this[e+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||j(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||j(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Y((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||j(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||j(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||j(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||j(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||L(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||L(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=Y((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Y((function(e,t=0){return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let i=0,a=1,o=0;for(this[t]=255&e;++i>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let i=r-1,a=1,o=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=Y((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Y((function(e,t=0){return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return C(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return C(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function V(e,t,r,n,i,a){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(a+1)}${n}`:`>= -(2${n} ** ${8*(a+1)-1}${n}) and < 2 ** ${8*(a+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){$(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||G(t,e.length-(r+1))}(n,i,a)}function $(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,r){if(Math.floor(e)!==e)throw $(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=q(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const Q=/[^+/0-9A-Za-z-_]/g;function H(e,t){let r;t=t||1/0;const n=e.length;let i=null;const a=[];for(let o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function z(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function W(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Y(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},62168:e=>{"use strict";e.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,r,n)=>t+(0===n?"":",")+e(void 0===r||"symbol"==typeof r?null:r)),"")+"]":"{"+Object.keys(t).sort().reduce(((r,n,i)=>void 0===t[n]||"symbol"==typeof t[n]?r:r+(0===r.length?"":",")+e(n)+":"+e(t[n])),"")+"}"}},36593:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.attributeNames=t.elementNames=void 0,t.elementNames=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((function(e){return[e.toLowerCase(),e]}))),t.attributeNames=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((function(e){return[e.toLowerCase(),e]})))},5193:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r");case s.Comment:return"\x3c!--".concat(e.data,"--\x3e");case s.CDATA:return function(e){return"")}(e);case s.Script:case s.Style:case s.Tag:return function(e,t){var r;"foreign"===t.xmlMode&&(e.name=null!==(r=u.elementNames.get(e.name))&&void 0!==r?r:e.name,e.parent&&y.has(e.parent.name)&&(t=n(n({},t),{xmlMode:!1}))),!t.xmlMode&&m.has(e.name)&&(t=n(n({},t),{xmlMode:"foreign"}));var i="<".concat(e.name),a=function(e,t){var r;if(e){var n=!1===(null!==(r=t.encodeEntities)&&void 0!==r?r:t.decodeEntities)?d:t.xmlMode||"utf8"!==t.encodeEntities?c.encodeXML:c.escapeAttribute;return Object.keys(e).map((function(r){var i,a,o=null!==(i=e[r])&&void 0!==i?i:"";return"foreign"===t.xmlMode&&(r=null!==(a=u.attributeNames.get(r))&&void 0!==a?a:r),t.emptyAttrs||t.xmlMode||""!==o?"".concat(r,'="').concat(n(o),'"'):r})).join(" ")}}(e.attribs,t);return a&&(i+=" ".concat(a)),0===e.children.length&&(t.xmlMode?!1!==t.selfClosingTags:t.selfClosingTags&&p.has(e.name))?(t.xmlMode||(i+=" "),i+="/>"):(i+=">",e.children.length>0&&(i+=h(e.children,t)),!t.xmlMode&&p.has(e.name)||(i+=""))),i}(e,t);case s.Text:return function(e,t){var r,n=e.data||"";return!1===(null!==(r=t.encodeEntities)&&void 0!==r?r:t.decodeEntities)||!t.xmlMode&&e.parent&&l.has(e.parent.name)||(n=t.xmlMode||"utf8"!==t.encodeEntities?(0,c.encodeXML)(n):(0,c.escapeText)(n)),n}(e,t)}}t.render=h,t.default=h;var y=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),m=new Set(["svg","math"])},93338:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(r=t.ElementType||(t.ElementType={})),t.isTag=function(e){return e.type===r.Tag||e.type===r.Script||e.type===r.Style},t.Root=r.Root,t.Text=r.Text,t.Directive=r.Directive,t.Comment=r.Comment,t.Script=r.Script,t.Style=r.Style,t.Tag=r.Tag,t.CDATA=r.CDATA,t.Doctype=r.Doctype},21138:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var a=r(93338),o=r(62888);i(r(62888),t);var s={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},c=function(){function e(e,t,r){this.dom=[],this.root=new o.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(r=t,t=s),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:s,this.elementCB=null!=r?r:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new o.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var r=this.options.xmlMode?a.ElementType.Tag:void 0,n=new o.Element(e,t,void 0,r);this.addNode(n),this.tagStack.push(n)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===a.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var r=new o.Text(e);this.addNode(r),this.lastNode=r}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===a.ElementType.Comment)this.lastNode.data+=e;else{var t=new o.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new o.Text(""),t=new o.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var r=new o.ProcessingInstruction(e,t);this.addNode(r)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],r=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),r&&(e.prev=r,r.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=c,t.default=c},62888:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(s);t.NodeWithChildren=p;var h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=o.ElementType.CDATA,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(p);t.CDATA=h;var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=o.ElementType.Root,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(p);t.Document=f;var y=function(e){function t(t,r,n,i){void 0===n&&(n=[]),void 0===i&&(i="script"===t?o.ElementType.Script:"style"===t?o.ElementType.Style:o.ElementType.Tag);var a=e.call(this,n)||this;return a.name=t,a.attribs=r,a.type=i,a}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var r,n;return{name:t,value:e.attribs[t],namespace:null===(r=e["x-attribsNamespace"])||void 0===r?void 0:r[t],prefix:null===(n=e["x-attribsPrefix"])||void 0===n?void 0:n[t]}}))},enumerable:!1,configurable:!0}),t}(p);function m(e){return(0,o.isTag)(e)}function g(e){return e.type===o.ElementType.CDATA}function b(e){return e.type===o.ElementType.Text}function v(e){return e.type===o.ElementType.Comment}function _(e){return e.type===o.ElementType.Directive}function T(e){return e.type===o.ElementType.Root}function O(e,t){var r;if(void 0===t&&(t=!1),b(e))r=new u(e.data);else if(v(e))r=new l(e.data);else if(m(e)){var n=t?w(e.children):[],i=new y(e.name,a({},e.attribs),n);n.forEach((function(e){return e.parent=i})),null!=e.namespace&&(i.namespace=e.namespace),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]=a({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]=a({},e["x-attribsPrefix"])),r=i}else if(g(e)){n=t?w(e.children):[];var o=new h(n);n.forEach((function(e){return e.parent=o})),r=o}else if(T(e)){n=t?w(e.children):[];var s=new f(n);n.forEach((function(e){return e.parent=s})),e["x-mode"]&&(s["x-mode"]=e["x-mode"]),r=s}else{if(!_(e))throw new Error("Not implemented yet: ".concat(e.type));var c=new d(e.name,e.data);null!=e["x-name"]&&(c["x-name"]=e["x-name"],c["x-publicId"]=e["x-publicId"],c["x-systemId"]=e["x-systemId"]),r=c}return r.startIndex=e.startIndex,r.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(r.sourceCodeLocation=e.sourceCodeLocation),r}function w(e){for(var t=e.map((function(e){return O(e,!0)})),r=1;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFeed=void 0;var n=r(68642),i=r(78052);t.getFeed=function(e){var t=c(d,e);return t?"feed"===t.name?function(e){var t,r=e.children,n={type:"atom",items:(0,i.getElementsByTagName)("entry",r).map((function(e){var t,r=e.children,n={media:s(r)};l(n,"id","id",r),l(n,"title","title",r);var i=null===(t=c("link",r))||void 0===t?void 0:t.attribs.href;i&&(n.link=i);var a=u("summary",r)||u("content",r);a&&(n.description=a);var o=u("updated",r);return o&&(n.pubDate=new Date(o)),n}))};l(n,"id","id",r),l(n,"title","title",r);var a=null===(t=c("link",r))||void 0===t?void 0:t.attribs.href;a&&(n.link=a),l(n,"description","subtitle",r);var o=u("updated",r);return o&&(n.updated=new Date(o)),l(n,"author","email",r,!0),n}(t):function(e){var t,r,n=null!==(r=null===(t=c("channel",e.children))||void 0===t?void 0:t.children)&&void 0!==r?r:[],a={type:e.name.substr(0,3),id:"",items:(0,i.getElementsByTagName)("item",e.children).map((function(e){var t=e.children,r={media:s(t)};l(r,"id","guid",t),l(r,"title","title",t),l(r,"link","link",t),l(r,"description","description",t);var n=u("pubDate",t)||u("dc:date",t);return n&&(r.pubDate=new Date(n)),r}))};l(a,"title","title",n),l(a,"link","link",n),l(a,"description","description",n);var o=u("lastBuildDate",n);return o&&(a.updated=new Date(o)),l(a,"author","managingEditor",n,!0),a}(t):null};var a=["url","type","lang"],o=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function s(e){return(0,i.getElementsByTagName)("media:content",e).map((function(e){for(var t=e.attribs,r={medium:t.medium,isDefault:!!t.isDefault},n=0,i=a;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uniqueSort=t.compareDocumentPosition=t.DocumentPosition=t.removeSubsets=void 0;var n,i=r(21138);function a(e,t){var r=[],a=[];if(e===t)return 0;for(var o=(0,i.hasChildren)(e)?e:e.parent;o;)r.unshift(o),o=o.parent;for(o=(0,i.hasChildren)(t)?t:t.parent;o;)a.unshift(o),o=o.parent;for(var s=Math.min(r.length,a.length),c=0;cl.indexOf(p)?u===t?n.FOLLOWING|n.CONTAINED_BY:n.FOLLOWING:u===e?n.PRECEDING|n.CONTAINS:n.PRECEDING}t.removeSubsets=function(e){for(var t=e.length;--t>=0;){var r=e[t];if(t>0&&e.lastIndexOf(r,t-1)>=0)e.splice(t,1);else for(var n=r.parent;n;n=n.parent)if(e.includes(n)){e.splice(t,1);break}}return e},function(e){e[e.DISCONNECTED=1]="DISCONNECTED",e[e.PRECEDING=2]="PRECEDING",e[e.FOLLOWING=4]="FOLLOWING",e[e.CONTAINS=8]="CONTAINS",e[e.CONTAINED_BY=16]="CONTAINED_BY"}(n=t.DocumentPosition||(t.DocumentPosition={})),t.compareDocumentPosition=a,t.uniqueSort=function(e){return(e=e.filter((function(e,t,r){return!r.includes(e,t+1)}))).sort((function(e,t){var r=a(e,t);return r&n.PRECEDING?-1:r&n.FOLLOWING?1:0})),e}},76403:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.hasChildren=t.isDocument=t.isComment=t.isText=t.isCDATA=t.isTag=void 0,i(r(68642),t),i(r(45517),t),i(r(46178),t),i(r(51467),t),i(r(78052),t),i(r(83698),t),i(r(91206),t);var a=r(21138);Object.defineProperty(t,"isTag",{enumerable:!0,get:function(){return a.isTag}}),Object.defineProperty(t,"isCDATA",{enumerable:!0,get:function(){return a.isCDATA}}),Object.defineProperty(t,"isText",{enumerable:!0,get:function(){return a.isText}}),Object.defineProperty(t,"isComment",{enumerable:!0,get:function(){return a.isComment}}),Object.defineProperty(t,"isDocument",{enumerable:!0,get:function(){return a.isDocument}}),Object.defineProperty(t,"hasChildren",{enumerable:!0,get:function(){return a.hasChildren}})},78052:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getElementsByTagType=t.getElementsByTagName=t.getElementById=t.getElements=t.testElement=void 0;var n=r(21138),i=r(51467),a={tag_name:function(e){return"function"==typeof e?function(t){return(0,n.isTag)(t)&&e(t.name)}:"*"===e?n.isTag:function(t){return(0,n.isTag)(t)&&t.name===e}},tag_type:function(e){return"function"==typeof e?function(t){return e(t.type)}:function(t){return t.type===e}},tag_contains:function(e){return"function"==typeof e?function(t){return(0,n.isText)(t)&&e(t.data)}:function(t){return(0,n.isText)(t)&&t.data===e}}};function o(e,t){return"function"==typeof t?function(r){return(0,n.isTag)(r)&&t(r.attribs[e])}:function(r){return(0,n.isTag)(r)&&r.attribs[e]===t}}function s(e,t){return function(r){return e(r)||t(r)}}function c(e){var t=Object.keys(e).map((function(t){var r=e[t];return Object.prototype.hasOwnProperty.call(a,t)?a[t](r):o(t,r)}));return 0===t.length?null:t.reduce(s)}t.testElement=function(e,t){var r=c(e);return!r||r(t)},t.getElements=function(e,t,r,n){void 0===n&&(n=1/0);var a=c(e);return a?(0,i.filter)(a,t,r,n):[]},t.getElementById=function(e,t,r){return void 0===r&&(r=!0),Array.isArray(t)||(t=[t]),(0,i.findOne)(o("id",e),t,r)},t.getElementsByTagName=function(e,t,r,n){return void 0===r&&(r=!0),void 0===n&&(n=1/0),(0,i.filter)(a.tag_name(e),t,r,n)},t.getElementsByTagType=function(e,t,r,n){return void 0===r&&(r=!0),void 0===n&&(n=1/0),(0,i.filter)(a.tag_type(e),t,r,n)}},46178:(e,t)=>{"use strict";function r(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){var t=e.parent.children,r=t.lastIndexOf(e);r>=0&&t.splice(r,1)}e.next=null,e.prev=null,e.parent=null}Object.defineProperty(t,"__esModule",{value:!0}),t.prepend=t.prependChild=t.append=t.appendChild=t.replaceElement=t.removeElement=void 0,t.removeElement=r,t.replaceElement=function(e,t){var r=t.prev=e.prev;r&&(r.next=t);var n=t.next=e.next;n&&(n.prev=t);var i=t.parent=e.parent;if(i){var a=i.children;a[a.lastIndexOf(e)]=t,e.parent=null}},t.appendChild=function(e,t){if(r(t),t.next=null,t.parent=e,e.children.push(t)>1){var n=e.children[e.children.length-2];n.next=t,t.prev=n}else t.prev=null},t.append=function(e,t){r(t);var n=e.parent,i=e.next;if(t.next=i,t.prev=e,e.next=t,t.parent=n,i){if(i.prev=t,n){var a=n.children;a.splice(a.lastIndexOf(i),0,t)}}else n&&n.children.push(t)},t.prependChild=function(e,t){if(r(t),t.parent=e,t.prev=null,1!==e.children.unshift(t)){var n=e.children[1];n.prev=t,t.next=n}else t.next=null},t.prepend=function(e,t){r(t);var n=e.parent;if(n){var i=n.children;i.splice(i.indexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=n,t.prev=e.prev,t.next=e,e.prev=t}},51467:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findAll=t.existsOne=t.findOne=t.findOneChild=t.find=t.filter=void 0;var n=r(21138);function i(e,t,r,i){for(var a=[],o=[t],s=[0];;)if(s[0]>=o[0].length){if(1===s.length)return a;o.shift(),s.shift()}else{var c=o[0][s[0]++];if(e(c)&&(a.push(c),--i<=0))return a;r&&(0,n.hasChildren)(c)&&c.children.length>0&&(s.unshift(0),o.unshift(c.children))}}t.filter=function(e,t,r,n){return void 0===r&&(r=!0),void 0===n&&(n=1/0),i(e,Array.isArray(t)?t:[t],r,n)},t.find=i,t.findOneChild=function(e,t){return t.find(e)},t.findOne=function e(t,r,i){void 0===i&&(i=!0);for(var a=null,o=0;o0&&(a=e(t,s.children,!0)))}return a},t.existsOne=function e(t,r){return r.some((function(r){return(0,n.isTag)(r)&&(t(r)||e(t,r.children))}))},t.findAll=function(e,t){for(var r=[],i=[t],a=[0];;)if(a[0]>=i[0].length){if(1===i.length)return r;i.shift(),a.shift()}else{var o=i[0][a[0]++];(0,n.isTag)(o)&&(e(o)&&r.push(o),o.children.length>0&&(a.unshift(0),i.unshift(o.children)))}}},68642:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.innerText=t.textContent=t.getText=t.getInnerHTML=t.getOuterHTML=void 0;var i=r(21138),a=n(r(5193)),o=r(93338);function s(e,t){return(0,a.default)(e,t)}t.getOuterHTML=s,t.getInnerHTML=function(e,t){return(0,i.hasChildren)(e)?e.children.map((function(e){return s(e,t)})).join(""):""},t.getText=function e(t){return Array.isArray(t)?t.map(e).join(""):(0,i.isTag)(t)?"br"===t.name?"\n":e(t.children):(0,i.isCDATA)(t)?e(t.children):(0,i.isText)(t)?t.data:""},t.textContent=function e(t){return Array.isArray(t)?t.map(e).join(""):(0,i.hasChildren)(t)&&!(0,i.isComment)(t)?e(t.children):(0,i.isText)(t)?t.data:""},t.innerText=function e(t){return Array.isArray(t)?t.map(e).join(""):(0,i.hasChildren)(t)&&(t.type===o.ElementType.Tag||(0,i.isCDATA)(t))?e(t.children):(0,i.isText)(t)?t.data:""}},45517:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prevElementSibling=t.nextElementSibling=t.getName=t.hasAttrib=t.getAttributeValue=t.getSiblings=t.getParent=t.getChildren=void 0;var n=r(21138);function i(e){return(0,n.hasChildren)(e)?e.children:[]}function a(e){return e.parent||null}t.getChildren=i,t.getParent=a,t.getSiblings=function(e){var t=a(e);if(null!=t)return i(t);for(var r=[e],n=e.prev,o=e.next;null!=n;)r.unshift(n),n=n.prev;for(;null!=o;)r.push(o),o=o.next;return r},t.getAttributeValue=function(e,t){var r;return null===(r=e.attribs)||void 0===r?void 0:r[t]},t.hasAttrib=function(e,t){return null!=e.attribs&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&null!=e.attribs[t]},t.getName=function(e){return e.name},t.nextElementSibling=function(e){for(var t=e.next;null!==t&&!(0,n.isTag)(t);)t=t.next;return t},t.prevElementSibling=function(e){for(var t=e.prev;null!==t&&!(0,n.isTag)(t);)t=t.prev;return t}},3379:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeXML=t.decodeHTMLStrict=t.decodeHTMLAttribute=t.decodeHTML=t.determineBranch=t.EntityDecoder=t.DecodingMode=t.BinTrieFlags=t.fromCodePoint=t.replaceCodePoint=t.decodeCodePoint=t.xmlDecodeTree=t.htmlDecodeTree=void 0;var s=o(r(57346));t.htmlDecodeTree=s.default;var c=o(r(18622));t.xmlDecodeTree=c.default;var u=a(r(22809));t.decodeCodePoint=u.default;var l,d,p,h,f=r(22809);function y(e){return e>=l.ZERO&&e<=l.NINE}Object.defineProperty(t,"replaceCodePoint",{enumerable:!0,get:function(){return f.replaceCodePoint}}),Object.defineProperty(t,"fromCodePoint",{enumerable:!0,get:function(){return f.fromCodePoint}}),function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"}(l||(l={})),function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"}(d=t.BinTrieFlags||(t.BinTrieFlags={})),function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"}(p||(p={})),function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"}(h=t.DecodingMode||(t.DecodingMode={}));var m=function(){function e(e,t,r){this.decodeTree=e,this.emitCodePoint=t,this.errors=r,this.state=p.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=h.Strict}return e.prototype.startEntity=function(e){this.decodeMode=e,this.state=p.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1},e.prototype.write=function(e,t){switch(this.state){case p.EntityStart:return e.charCodeAt(t)===l.NUM?(this.state=p.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=p.NamedEntity,this.stateNamedEntity(e,t));case p.NumericStart:return this.stateNumericStart(e,t);case p.NumericDecimal:return this.stateNumericDecimal(e,t);case p.NumericHex:return this.stateNumericHex(e,t);case p.NamedEntity:return this.stateNamedEntity(e,t)}},e.prototype.stateNumericStart=function(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===l.LOWER_X?(this.state=p.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=p.NumericDecimal,this.stateNumericDecimal(e,t))},e.prototype.addToNumericResult=function(e,t,r,n){if(t!==r){var i=r-t;this.result=this.result*Math.pow(n,i)+parseInt(e.substr(t,i),n),this.consumed+=i}},e.prototype.stateNumericHex=function(e,t){for(var r,n=t;t=l.UPPER_A&&r<=l.UPPER_F||r>=l.LOWER_A&&r<=l.LOWER_F)))return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(i,3);t+=1}return this.addToNumericResult(e,n,t,16),-1},e.prototype.stateNumericDecimal=function(e,t){for(var r=t;t>14;t=l.UPPER_A&&e<=l.UPPER_Z||e>=l.LOWER_A&&e<=l.LOWER_Z||y(e)}(o)))?0:this.emitNotTerminatedNamedEntity();if(0!=(i=((n=r[this.treeIndex])&d.VALUE_LENGTH)>>14)){if(a===l.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==h.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}var o;return-1},e.prototype.emitNotTerminatedNamedEntity=function(){var e,t=this.result,r=(this.decodeTree[t]&d.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),null===(e=this.errors)||void 0===e||e.missingSemicolonAfterCharacterReference(),this.consumed},e.prototype.emitNamedEntityData=function(e,t,r){var n=this.decodeTree;return this.emitCodePoint(1===t?n[e]&~d.VALUE_LENGTH:n[e+1],r),3===t&&this.emitCodePoint(n[e+2],r),r},e.prototype.end=function(){var e;switch(this.state){case p.NamedEntity:return 0===this.result||this.decodeMode===h.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case p.NumericDecimal:return this.emitNumericEntity(0,2);case p.NumericHex:return this.emitNumericEntity(0,3);case p.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case p.EntityStart:return 0}},e}();function g(e){var t="",r=new m(e,(function(e){return t+=(0,u.fromCodePoint)(e)}));return function(e,n){for(var i=0,a=0;(a=e.indexOf("&",a))>=0;){t+=e.slice(i,a),r.startEntity(n);var o=r.write(e,a+1);if(o<0){i=a+r.end();break}i=a+o,a=0===o?i+1:i}var s=t+e.slice(i);return t="",s}}function b(e,t,r,n){var i=(t&d.BRANCH_LENGTH)>>7,a=t&d.JUMP_TABLE;if(0===i)return 0!==a&&n===a?r:-1;if(a){var o=n-a;return o<0||o>=i?-1:e[r+o]-1}for(var s=r,c=s+i-1;s<=c;){var u=s+c>>>1,l=e[u];if(ln))return e[u+i];c=u-1}}return-1}t.EntityDecoder=m,t.determineBranch=b;var v=g(s.default),_=g(c.default);t.decodeHTML=function(e,t){return void 0===t&&(t=h.Legacy),v(e,t)},t.decodeHTMLAttribute=function(e){return v(e,h.Attribute)},t.decodeHTMLStrict=function(e){return v(e,h.Strict)},t.decodeXML=function(e){return _(e,h.Strict)}},22809:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.replaceCodePoint=t.fromCodePoint=void 0;var n=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function i(e){var t;return e>=55296&&e<=57343||e>1114111?65533:null!==(t=n.get(e))&&void 0!==t?t:e}t.fromCodePoint=null!==(r=String.fromCodePoint)&&void 0!==r?r:function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+String.fromCharCode(e)},t.replaceCodePoint=i,t.default=function(e){return(0,t.fromCodePoint)(i(e))}},33231:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.encodeNonAsciiHTML=t.encodeHTML=void 0;var i=n(r(58635)),a=r(57078),o=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function s(e,t){for(var r,n="",o=0;null!==(r=e.exec(t));){var s=r.index;n+=t.substring(o,s);var c=t.charCodeAt(s),u=i.default.get(c);if("object"==typeof u){if(s+1{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.escapeText=t.escapeAttribute=t.escapeUTF8=t.escape=t.encodeXML=t.getCodePoint=t.xmlReplacer=void 0,t.xmlReplacer=/["&'<>$\x80-\uFFFF]/g;var r=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]);function n(e){for(var n,i="",a=0;null!==(n=t.xmlReplacer.exec(e));){var o=n.index,s=e.charCodeAt(o),c=r.get(s);void 0!==c?(i+=e.substring(a,o)+c,a=o+1):(i+="".concat(e.substring(a,o),"&#x").concat((0,t.getCodePoint)(e,o).toString(16),";"),a=t.xmlReplacer.lastIndex+=Number(55296==(64512&s)))}return i+e.substr(a)}function i(e,t){return function(r){for(var n,i=0,a="";n=e.exec(r);)i!==n.index&&(a+=r.substring(i,n.index)),a+=t.get(n[0].charCodeAt(0)),i=n.index+1;return a+r.substring(i)}}t.getCodePoint=null!=String.prototype.codePointAt?function(e,t){return e.codePointAt(t)}:function(e,t){return 55296==(64512&e.charCodeAt(t))?1024*(e.charCodeAt(t)-55296)+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t)},t.encodeXML=n,t.escape=n,t.escapeUTF8=i(/[&<>'"]/g,r),t.escapeAttribute=i(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),t.escapeText=i(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]))},57346:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((function(e){return e.charCodeAt(0)})))},18622:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((function(e){return e.charCodeAt(0)})))},58635:(e,t)=>{"use strict";function r(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeXMLStrict=t.decodeHTML5Strict=t.decodeHTML4Strict=t.decodeHTML5=t.decodeHTML4=t.decodeHTMLAttribute=t.decodeHTMLStrict=t.decodeHTML=t.decodeXML=t.DecodingMode=t.EntityDecoder=t.encodeHTML5=t.encodeHTML4=t.encodeNonAsciiHTML=t.encodeHTML=t.escapeText=t.escapeAttribute=t.escapeUTF8=t.escape=t.encodeXML=t.encode=t.decodeStrict=t.decode=t.EncodingMode=t.EntityLevel=void 0;var n,i,a=r(3379),o=r(33231),s=r(57078);function c(e,t){if(void 0===t&&(t=n.XML),("number"==typeof t?t:t.level)===n.HTML){var r="object"==typeof t?t.mode:void 0;return(0,a.decodeHTML)(e,r)}return(0,a.decodeXML)(e)}!function(e){e[e.XML=0]="XML",e[e.HTML=1]="HTML"}(n=t.EntityLevel||(t.EntityLevel={})),function(e){e[e.UTF8=0]="UTF8",e[e.ASCII=1]="ASCII",e[e.Extensive=2]="Extensive",e[e.Attribute=3]="Attribute",e[e.Text=4]="Text"}(i=t.EncodingMode||(t.EncodingMode={})),t.decode=c,t.decodeStrict=function(e,t){var r;void 0===t&&(t=n.XML);var i="number"==typeof t?{level:t}:t;return null!==(r=i.mode)&&void 0!==r||(i.mode=a.DecodingMode.Strict),c(e,i)},t.encode=function(e,t){void 0===t&&(t=n.XML);var r="number"==typeof t?{level:t}:t;return r.mode===i.UTF8?(0,s.escapeUTF8)(e):r.mode===i.Attribute?(0,s.escapeAttribute)(e):r.mode===i.Text?(0,s.escapeText)(e):r.level===n.HTML?r.mode===i.ASCII?(0,o.encodeNonAsciiHTML)(e):(0,o.encodeHTML)(e):(0,s.encodeXML)(e)};var u=r(57078);Object.defineProperty(t,"encodeXML",{enumerable:!0,get:function(){return u.encodeXML}}),Object.defineProperty(t,"escape",{enumerable:!0,get:function(){return u.escape}}),Object.defineProperty(t,"escapeUTF8",{enumerable:!0,get:function(){return u.escapeUTF8}}),Object.defineProperty(t,"escapeAttribute",{enumerable:!0,get:function(){return u.escapeAttribute}}),Object.defineProperty(t,"escapeText",{enumerable:!0,get:function(){return u.escapeText}});var l=r(33231);Object.defineProperty(t,"encodeHTML",{enumerable:!0,get:function(){return l.encodeHTML}}),Object.defineProperty(t,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return l.encodeNonAsciiHTML}}),Object.defineProperty(t,"encodeHTML4",{enumerable:!0,get:function(){return l.encodeHTML}}),Object.defineProperty(t,"encodeHTML5",{enumerable:!0,get:function(){return l.encodeHTML}});var d=r(3379);Object.defineProperty(t,"EntityDecoder",{enumerable:!0,get:function(){return d.EntityDecoder}}),Object.defineProperty(t,"DecodingMode",{enumerable:!0,get:function(){return d.DecodingMode}}),Object.defineProperty(t,"decodeXML",{enumerable:!0,get:function(){return d.decodeXML}}),Object.defineProperty(t,"decodeHTML",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(t,"decodeHTMLStrict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(t,"decodeHTMLAttribute",{enumerable:!0,get:function(){return d.decodeHTMLAttribute}}),Object.defineProperty(t,"decodeHTML4",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(t,"decodeHTML5",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(t,"decodeHTML4Strict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(t,"decodeHTML5Strict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(t,"decodeXMLStrict",{enumerable:!0,get:function(){return d.decodeXML}})},35033:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promisifyEventEmitter=void 0,t.promisifyEventEmitter=function(e,t){return new Promise(((r,n)=>{e.on("end",(()=>r(t))),e.on("error",n)}))}},50046:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}y(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,a,o,u;if(s(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]),void 0===o)o=a[t]=r,++e._eventsCount;else if("function"==typeof o?o=a[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var c=a[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var u=c.length,l=f(c,u);for(r=0;r=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},a.prototype.listenerCount=h,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},38792:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,a[i]))return!1;for(i=n;0!=i--;){var o=a[i];if(!e(t[o],r[o]))return!1}return!0}return t!=t&&r!=r}},74190:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(92681),t)},92681:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SparqlEndpointFetcher=void 0;const i=r(43216),a=r(76605),o=r(54957),s=r(33523),c=r(21451),u=r(52666),l=r(76574);class d{constructor(e){var t,r,n,a,o,s;this.method=null!==(t=null==e?void 0:e.method)&&void 0!==t?t:"POST",this.timeout=null==e?void 0:e.timeout,this.forceGetIfUrlLengthBelow=null!==(r=null==e?void 0:e.forceGetIfUrlLengthBelow)&&void 0!==r?r:0,this.directPost=null!==(n=null==e?void 0:e.directPost)&&void 0!==n&&n,this.additionalUrlParams=null!==(a=null==e?void 0:e.additionalUrlParams)&&void 0!==a?a:new URLSearchParams,this.defaultHeaders=null!==(o=null==e?void 0:e.defaultHeaders)&&void 0!==o?o:new Headers,this.fetchCb=null==e?void 0:e.fetch,this.parseUnsupportedVersions=Boolean(null==e?void 0:e.parseUnsupportedVersions),this.sparqlQueryParser=null!==(s=null==e?void 0:e.sparqlQueryParser)&&void 0!==s?s:new i.Parser({lexerConfig:{positionTracking:"onlyOffset"}}),this.sparqlJsonParser=new c.SparqlJsonParser(e),this.sparqlXmlParser=new u.SparqlXmlParser(e),this.sparqlParsers={[d.CONTENTTYPE_SPARQL_JSON]:{parseBooleanStream:(e,t)=>this.sparqlJsonParser.parseJsonBooleanStream(e,t),parseResultsStream:(e,t)=>this.sparqlJsonParser.parseJsonResultsStream(e,t)},[d.CONTENTTYPE_SPARQL_XML]:{parseBooleanStream:(e,t)=>this.sparqlXmlParser.parseXmlBooleanStream(e,t),parseResultsStream:(e,t)=>this.sparqlXmlParser.parseXmlResultsStream(e,t)}}}getQueryType(e){const t=this.sparqlQueryParser.parse(e);return"query"===t.type?"describe"===t.subType?"CONSTRUCT":t.subType.toUpperCase():"UNKNOWN"}getUpdateTypes(e){const t=this.sparqlQueryParser.parse(e);if("update"===t.type){const e={};for(const r of t.updates)r.operation&&(e[r.operation.subType]=!0);return e}return"UNKNOWN"}fetchBindings(e,t){return n(this,void 0,void 0,(function*(){const[r,n,i]=yield this.fetchRawStream(e,t,d.CONTENTTYPE_SPARQL),a=this.sparqlParsers[r];if(!a)throw new Error(`Unknown SPARQL results content type: ${r}`);return a.parseResultsStream(i,n)}))}fetchAsk(e,t){return n(this,void 0,void 0,(function*(){const[r,n,i]=yield this.fetchRawStream(e,t,d.CONTENTTYPE_SPARQL),a=this.sparqlParsers[r];if(!a)throw new Error(`Unknown SPARQL results content type: ${r}`);return a.parseBooleanStream(i,n)}))}fetchTriples(e,t){return n(this,void 0,void 0,(function*(){const[r,n,i]=yield this.fetchRawStream(e,t,d.CONTENTTYPE_TURTLE);return i.pipe(new o.StreamParser({format:r,version:n,parseUnsupportedVersions:this.parseUnsupportedVersions}))}))}fetchUpdate(e,t){return n(this,void 0,void 0,(function*(){const r=new AbortController,n={};this.defaultHeaders.forEach(((e,t)=>{n[t]=e}));const i={method:"POST",headers:Object.assign(Object.assign({},n),{"content-type":"application/sparql-update"}),body:t,signal:r.signal};yield this.handleFetchCall(e,i,{ignoreBody:!0}),r.abort()}))}fetchRawStream(e,t,r){return n(this,void 0,void 0,(function*(){let n,i,a;if("POST"===this.method&&this.forceGetIfUrlLengthBelow<=e.length)n=this.method,i=e;else{const r=`${e}?query=${encodeURIComponent(t)}`;n="GET"===this.method||r.length0&&(i+=`?${this.additionalUrlParams.toString()}`);else{o.append("Content-Type","application/x-www-form-urlencoded"),a=new URLSearchParams,a.set("query",t);for(const[e,t]of this.additionalUrlParams.entries())a.set(e,t)}o.append("Content-Length",a.toString().length.toString())}else this.additionalUrlParams.toString().length>0&&(i+=`&${this.additionalUrlParams.toString()}`);return this.handleFetchCall(i,{headers:o,method:n,body:a})}))}handleFetchCall(e,t,r){return n(this,void 0,void 0,(function*(){var n,i;let o,c;if(this.timeout){const e=new AbortController;t.signal=e.signal,o=setTimeout((()=>e.abort()),this.timeout)}const u=yield(null!==(n=this.fetchCb)&&void 0!==n?n:fetch)(e,t);if(clearTimeout(o),!(null==r?void 0:r.ignoreBody)&&u.body&&(c=a(u.body)?u.body:(0,s.readableFromWeb)(u.body)),!u.ok||!c&&!(null==r?void 0:r.ignoreBody)){const t=e.split("?").at(0),r=c?yield l(c):"empty response";throw new Error(`Invalid SPARQL endpoint response from ${t} (HTTP status ${u.status}):\n${r}`)}const p=u.headers.get("Content-Type"),h=null!==(i=null==p?void 0:p.split(";").at(0))&&void 0!==i?i:"";let f;if(p){const e=d.REGEX_VERSION_HEADER.exec(p);e&&(f=e[1])}return[h,f,c]}))}}t.SparqlEndpointFetcher=d,d.CONTENTTYPE_SPARQL_JSON="application/sparql-results+json",d.CONTENTTYPE_SPARQL_XML="application/sparql-results+xml",d.CONTENTTYPE_TURTLE="text/turtle",d.CONTENTTYPE_SPARQL=`${d.CONTENTTYPE_SPARQL_JSON};q=1.0,${d.CONTENTTYPE_SPARQL_XML};q=0.7`,d.REGEX_VERSION_HEADER=/version=([^ ;]*)/u},1427:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(51812),t),i(r(26339),t),i(r(17762),t),i(r(12856),t),i(r(45147),t)},26339:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Converter=void 0;const i=r(44330),a=r(51812),o=r(96414),s=r(17762),c=r(45147);class u{constructor(e){(e=e||{}).variableDelimiter=e.variableDelimiter||"_",e.expressionVariableCounter=e.expressionVariableCounter||0,this.util=new c.Util(e),this.initializeNodeHandlers(e)}static registerNodeHandlers(e,t){e.registerNodeHandler(new a.NodeHandlerDocument(e,t)),e.registerNodeHandler(new a.NodeHandlerDefinitionOperation(e,t)),e.registerNodeHandler(new a.NodeHandlerDefinitionFragment(e,t)),e.registerNodeHandler(new a.NodeHandlerSelectionFragmentSpread(e,t)),e.registerNodeHandler(new a.NodeHandlerSelectionInlineFragment(e,t)),e.registerNodeHandler(new a.NodeHandlerSelectionField(e,t))}static registerNodeValueHandlers(e,t){e.registerNodeValueHandler(new a.NodeValueHandlerVariable(e,t)),e.registerNodeValueHandler(new a.NodeValueHandlerInt(e,t)),e.registerNodeValueHandler(new a.NodeValueHandlerFloat(e,t)),e.registerNodeValueHandler(new a.NodeValueHandlerString(e,t)),e.registerNodeValueHandler(new a.NodeValueHandlerBoolean(e,t)),e.registerNodeValueHandler(new a.NodeValueHandlerNull(e,t)),e.registerNodeValueHandler(new a.NodeValueHandlerEnum(e,t)),e.registerNodeValueHandler(new a.NodeValueHandlerList(e,t)),e.registerNodeValueHandler(new a.NodeValueHandlerObject(e,t))}static registerDirectiveNodeHandlers(e,t){e.registerDirectiveNodeHandler(new o.DirectiveNodeHandlerInclude(e,t)),e.registerDirectiveNodeHandler(new o.DirectiveNodeHandlerOptional(e,t)),e.registerDirectiveNodeHandler(new o.DirectiveNodeHandlerPlural(e,t)),e.registerDirectiveNodeHandler(new o.DirectiveNodeHandlerSingle(e,t)),e.registerDirectiveNodeHandler(new o.DirectiveNodeHandlerSkip(e,t))}graphqlToSparqlAlgebra(e,t,r){return n(this,void 0,void 0,(function*(){return this.graphqlToSparqlAlgebraRawContext(e,yield this.util.contextParser.parse(t),r)}))}graphqlToSparqlAlgebraRawContext(e,t,r){r=r||{};const n="string"==typeof e?(0,i.parse)(e):e,a={context:t,fragmentDefinitions:this.indexFragments(n),graph:this.util.dataFactory.defaultGraph(),path:[],singularizeState:s.SingularizeState.PLURAL,singularizeVariables:r.singularizeVariables||{},subject:null,terminalVariables:[],variablesDict:r.variablesDict||{},variablesMetaDict:{}};return this.util.handleNode(n,a)}indexFragments(e){const t={},r=[];for(const n of e.definitions)"FragmentDefinition"===n.kind?t[n.name.value]=n:r.push(n);return e.definitions=r,t}initializeNodeHandlers(e){u.registerNodeHandlers(this.util,e),u.registerNodeValueHandlers(this.util,e),u.registerDirectiveNodeHandlers(this.util,e)}}t.Converter=u},17762:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SingularizeState=void 0,function(e){e[e.SINGLE=0]="SINGLE",e[e.PLURAL=1]="PLURAL"}(r||(t.SingularizeState=r={}))},12856:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},45147:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=void 0;const n=r(18050),i=r(27202),a=r(85240);t.Util=class{constructor(e){this.nodeHandlers={},this.nodeValueHandlers={},this.directiveNodeHandlers={},this.settings=e,this.dataFactory=e.dataFactory||new n.DataFactory,this.operationFactory=new a.AlgebraFactory(this.dataFactory),this.contextParser=new i.ContextParser}registerNodeHandler(e){this.nodeHandlers[e.targetKind]=e}registerNodeValueHandler(e){this.nodeValueHandlers[e.targetKind]=e}registerDirectiveNodeHandler(e){this.directiveNodeHandlers[e.targetKind]=e}handleNode(e,t){const r=this.nodeHandlers[e.kind];if(!r)throw new Error(`Unsupported GraphQL node '${e.kind}'`);return r.handle(e,t)}handleNodeValue(e,t,r){const n=this.nodeValueHandlers[e.kind];if(!n)throw new Error(`Unsupported GraphQL value node '${e.kind}'`);return n.handle(e,t,r)}handleDirectiveNode(e,t){const r=this.directiveNodeHandlers[e.directive.name.value];return r?r.handle(e,t):null}joinOperations(e){if(1===e.length)return e[0];const t=[],r=[];for(const n of e)"bgp"===n.type?t.push(n):r.push(n);if(t.length===e.length)return this.joinOperationsAsBgp(t);if(t.length===e.length-1&&"leftjoin"===r[0].type&&"bgp"===r[0].input[0].type){const e=r[0];return t.push(e.input[0]),this.operationFactory.createLeftJoin(this.joinOperationsAsBgp(t),e.input[1])}return r.length===e.length?this.joinOperationsAsNestedJoin(r):this.joinOperationsAsNestedJoin([this.joinOperationsAsBgp(t),this.joinOperationsAsNestedJoin(r)])}joinOperationsAsBgp(e){return this.operationFactory.createBgp([].concat.apply([],e.map((e=>e.patterns))))}joinOperationsAsNestedJoin(e){return this.operationFactory.createJoin(e)}appendFieldToPath(e,t){return e.concat([t])}getFieldLabel(e){return(e.alias?e.alias:e.name).value}nameToVariable(e,t){return this.dataFactory.variable((t.path.length?t.path.join(this.settings.variableDelimiter)+this.settings.variableDelimiter:"")+e)}valueToNamedNode(e,t){const r=t.expandTerm(e,!0);if(this.settings.requireContext&&!r)throw new Error("No context entry was found for "+e);return this.dataFactory.namedNode(r||e)}getArgument(e,t){if(e)for(const r of e)if(r.name.value===t)return r}newTypePattern(e,t,r){return this.operationFactory.createPattern(e,this.dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.valueToNamedNode(t.name.value,r.context),r.graph)}createQuadPattern(e,t,r,n,i){const a=this.valueToNamedNode(t.value,i);return i&&i.getContextRaw()[t.value]&&i.getContextRaw()[t.value]["@reverse"]?this.operationFactory.createPattern(r,a,e,n):this.operationFactory.createPattern(e,a,r,n)}createQuadPath(e,t,r,n,i,a){const o=this.valueToNamedNode(t.value,a);let s=this.operationFactory.createLink(o);for(const e of r.values){if("EnumValue"!==e.kind)throw new Error("Invalid value type for 'alt' argument, must be EnumValue, but got "+e.kind);s=this.operationFactory.createAlt([s,this.operationFactory.createLink(this.valueToNamedNode(e.value,a))])}return a&&a.getContextRaw()[t.value]&&a.getContextRaw()[t.value]["@reverse"]?this.operationFactory.createPath(n,s,e,i):this.operationFactory.createPath(e,s,n,i)}}},14009:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerAdapter=void 0,t.NodeHandlerAdapter=class{constructor(e,t,r){this.targetKind=e,this.util=t,this.settings=r}getNodeQuadContextSelectionSet(e,t,r){const n={};if(e)for(const t of e.selections)if("Field"===t.kind){const e=t;this.handleNodeQuadContextField(e,r,n,"id","subject"),this.handleNodeQuadContextField(e,r,n,"graph","graph")}return n}handleNodeQuadContextField(e,t,r,n,i){if(!r[i]&&e.name.value===n){if(!r[i]){const a=this.util.getArgument(e.arguments,"_");if(a){const o=this.util.handleNodeValue(a.value,e.name.value,t);if(1!==o.terms.length)throw new Error(`Only single values can be set as ${n}, but got ${o.terms.length} at ${e.name.value}`);r[i]=o.terms[0],o.auxiliaryPatterns&&(r.auxiliaryPatterns||(r.auxiliaryPatterns=[]),r.auxiliaryPatterns.concat(o.auxiliaryPatterns))}}if(!r[i]){const n=this.util.nameToVariable(this.util.getFieldLabel(e),t);t.terminalVariables.push(n),r[i]=n}}}getDirectiveOutputs(e,t,r){const n=[];if(e)for(const i of e){const e=this.util.handleDirectiveNode({directive:i,fieldLabel:t},r);if(e){if(e.ignore)return null;n.push(e)}}return n}handleDirectiveOutputs(e,t){for(const r of e){if(r.ignore)return this.util.operationFactory.createBgp([]);r.operationOverrider&&(t=r.operationOverrider(t))}return t}}},94058:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerDefinitionAdapter=void 0;const n=r(14009);class i extends n.NodeHandlerAdapter{constructor(e,t,r){super(e,t,r)}}t.NodeHandlerDefinitionAdapter=i},73045:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerDefinitionFragment=void 0;const n=r(94058);class i extends n.NodeHandlerDefinitionAdapter{constructor(e,t){super("FragmentDefinition",e,t)}handle(e,t){throw new Error("Illegal state: fragment definitions must be indexed and removed before processing")}}t.NodeHandlerDefinitionFragment=i},9540:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerDefinitionOperation=void 0;const n=r(94058);class i extends n.NodeHandlerDefinitionAdapter{constructor(e,t){super("OperationDefinition",e,t)}handle(e,t){if("query"!==e.operation)throw new Error("Unsupported definition operation: "+e.operation);if(e.variableDefinitions)for(const r of e.variableDefinitions){const e=r.variable.name.value;r.defaultValue&&(t.variablesDict[e]||(t.variablesDict[e]=r.defaultValue));let n=r.type;const i="NonNullType"===n.kind;i&&(n=n.type);const a="ListType"===n.kind;a&&(n=n.type);const o=n.name.value;t.variablesMetaDict[e]={mandatory:i,list:a,type:o}}const r=this.getDirectiveOutputs(e.directives,e.name?e.name.value:"",t);if(!r)return this.util.operationFactory.createBgp([]);const n=this.util.joinOperations(e.selectionSet.selections.map((e=>this.util.handleNode(e,t))));return this.handleDirectiveOutputs(r,n)}}t.NodeHandlerDefinitionOperation=i},9373:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerDocument=void 0;const n=r(85240),i=r(85240),a=r(14009);class o extends a.NodeHandlerAdapter{constructor(e,t){super("Document",e,t)}handle(e,t){const r=e.definitions.map((e=>{const r=this.getNodeQuadContextDefinitionNode(e,Object.assign(Object.assign({},t),{ignoreUnknownVariables:!0})),n=Object.assign(Object.assign({},t),{graph:r.graph||t.graph,subject:r.subject||this.util.dataFactory.blankNode()});let i=this.util.handleNode(e,n);return r&&r.auxiliaryPatterns&&(i=this.util.joinOperations([i,this.util.operationFactory.createBgp(r.auxiliaryPatterns)])),i})),n=this.util.operationFactory.createProject(1===r.length?r[0]:this.util.operationFactory.createUnion(r),t.terminalVariables);return this.translateBlankNodesToVariables(n)}getNodeQuadContextDefinitionNode(e,t){if("OperationDefinition"===e.kind)return this.getNodeQuadContextSelectionSet(e.selectionSet,e.name?e.name.value:"",t);throw new Error(`Unsupported definition: ${e.kind}`)}translateBlankNodesToVariables(e){const t={},r=new Set(e.variables.map((e=>e.value))),a=(e,t)=>{let n=0,i=e;for(;r.has(i);)i=`${e}${n++}`;return this.util.dataFactory.variable(i)},o=e=>{if("BlankNode"===e.termType){let n=t[e.value];return n||(n=a(e.value),r.add(n.value),t[e.value]=n),n}return e};return i.algebraUtils.mapOperation(e,{[n.Algebra.Types.PATH]:{preVisitor:()=>({continue:!1}),transform:e=>this.util.operationFactory.createPath(o(e.subject),e.predicate,o(e.object),o(e.graph))},[n.Algebra.Types.PATTERN]:{preVisitor:()=>({continue:!1}),transform:e=>this.util.operationFactory.createPattern(o(e.subject),o(e.predicate),o(e.object),o(e.graph))}})}}t.NodeHandlerDocument=o},97285:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerSelectionAdapter=void 0;const n=r(85240),i=r(17762),a=r(14009);class o extends a.NodeHandlerAdapter{constructor(e,t,r){super(e,t,r)}getNodeQuadContextFieldNode(e,t,r){return this.getNodeQuadContextSelectionSet(e.selectionSet,t,Object.assign(Object.assign({},r),{path:this.util.appendFieldToPath(r.path,t)}))}fieldToOperation(e,t,r,a){const o=r;let s,c=0;if(("id"===t.name.value||"graph"===t.name.value)&&(r=!1,t.arguments))for(const r of t.arguments)"_"===r.name.value&&this.util.handleNodeValue(r.value,t.name.value,e);const u=this.util.getFieldLabel(t);if(e.singularizeState===i.SingularizeState.SINGLE&&(e.singularizeVariables[this.util.nameToVariable(u,e).value]=!0),r){const t=this.handleMetaField(e,u,a);if(t)return t}const l=a?[this.util.operationFactory.createBgp(a)]:[],d=this.getNodeQuadContextFieldNode(t,u,e);let p=d.subject||this.util.nameToVariable(u,e),h=d.graph||e.graph;d.auxiliaryPatterns&&l.push(this.util.operationFactory.createBgp(d.auxiliaryPatterns));let f=!0,y=null;if(r&&t.arguments&&t.arguments.length)for(const n of t.arguments){if("_"===n.name.value){const i=this.util.handleNodeValue(n.value,t.name.value,e);y=i.terms,l.push(this.util.operationFactory.createBgp(i.terms.map((r=>this.util.createQuadPattern(e.subject,t.name,r,e.graph,e.context))))),i.auxiliaryPatterns&&l.push(this.util.operationFactory.createBgp(i.auxiliaryPatterns)),r=!1;break}if("graph"===n.name.value){const r=this.util.handleNodeValue(n.value,t.name.value,e);if(1!==r.terms.length)throw new Error(`Only single values can be set as graph, but got ${r.terms.length} at ${t.name.value}`);h=r.terms[0],e=Object.assign(Object.assign({},e),{graph:h}),r.auxiliaryPatterns&&l.push(this.util.operationFactory.createBgp(r.auxiliaryPatterns));break}if("alt"===n.name.value){let r=n.value;"ListValue"!==r.kind&&(r={kind:"ListValue",values:[r]}),l.push(this.util.createQuadPath(e.subject,t.name,r,p,e.graph,e.context)),f=!1;break}}if(r&&f&&l.push(this.util.operationFactory.createBgp([this.util.createQuadPattern(e.subject,t.name,p,e.graph,e.context)])),t.arguments&&t.arguments.length)for(const r of t.arguments)if("_"===r.name.value||"graph"===r.name.value||"alt"===r.name.value);else if("first"===r.name.value){if("IntValue"!==r.value.kind)throw new Error("Invalid value type for 'first' argument: "+r.value.kind);s=parseInt(r.value.value,10)}else if("offset"===r.name.value){if("IntValue"!==r.value.kind)throw new Error("Invalid value type for 'offset' argument: "+r.value.kind);c=parseInt(r.value.value,10)}else{const t=this.util.handleNodeValue(r.value,r.name.value,e);l.push(this.util.operationFactory.createBgp(t.terms.map((t=>this.util.createQuadPattern(p,r.name,t,e.graph,e.context))))),t.auxiliaryPatterns&&l.push(this.util.operationFactory.createBgp(t.auxiliaryPatterns))}const m=this.getDirectiveOutputs(t.directives,u,e);if(!m)return this.util.operationFactory.createBgp([]);let g=this.util.joinOperations(l);if(t.selectionSet&&t.selectionSet.selections.length){if(y){if(1!==y.length)throw new Error(`Only single values can be set as id, but got ${y.length} at ${t.name.value}`);p=y[0]}const r=Object.assign(Object.assign(Object.assign({},e),o?{path:this.util.appendFieldToPath(e.path,u)}:{}),{graph:h,subject:o?p:e.subject});let n=!1;const i=t.selectionSet.selections.filter((e=>"Field"!==e.kind||"totalCount"!==e.name.value||(n=!0,!1)));let a=this.util.joinOperations(l.concat(i.map((e=>this.util.handleNode(e,r)))));if(n){const t=this.util.dataFactory.variable("var"+this.settings.expressionVariableCounter++),r=this.util.dataFactory.variable(p.value+this.settings.variableDelimiter+"totalCount"),n=this.util.operationFactory.createBoundAggregate(t,"count",this.util.operationFactory.createTermExpression(p),!1),o=this.util.operationFactory.createProject(this.util.operationFactory.createExtend(this.util.operationFactory.createGroup(g,[],[n]),r,this.util.operationFactory.createTermExpression(t)),[r]);e.terminalVariables.push(r),a=i.length?this.util.operationFactory.createJoin([this.util.operationFactory.createProject(a,[]),o]):o}g=a}else r&&"Variable"===p.termType&&e.terminalVariables.push(p);return(c||s)&&(g=this.util.operationFactory.createSlice(this.util.operationFactory.createProject(g,n.algebraUtils.inScopeVariables(g)),c,s)),this.handleDirectiveOutputs(m,g)}handleMetaField(e,t,r){if("__typename"===t){const n=this.util.nameToVariable(t,e);return e.terminalVariables.push(n),this.util.operationFactory.createBgp([this.util.operationFactory.createPattern(e.subject,this.util.dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.util.nameToVariable(t,e),e.graph)].concat(r||[]))}}}t.NodeHandlerSelectionAdapter=o},15790:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerSelectionField=void 0;const n=r(97285);class i extends n.NodeHandlerSelectionAdapter{constructor(e,t){super("Field",e,t)}handle(e,t){return this.fieldToOperation(t,e,!0)}}t.NodeHandlerSelectionField=i},39555:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerSelectionFragmentSpread=void 0;const n=r(97285);class i extends n.NodeHandlerSelectionAdapter{constructor(e,t){super("FragmentSpread",e,t)}handle(e,t){const r=t.fragmentDefinitions[e.name.value];if(!r)throw new Error("Undefined fragment definition: "+e.name.value);const n={alias:void 0,arguments:void 0,directives:r.directives,kind:"Field",name:e.name,selectionSet:r.selectionSet},i=[this.util.newTypePattern(t.subject,r.typeCondition,t)];return this.util.operationFactory.createLeftJoin(this.util.operationFactory.createBgp([]),this.fieldToOperation(t,n,!1,i))}}t.NodeHandlerSelectionFragmentSpread=i},89509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerSelectionInlineFragment=void 0;const n=r(97285);class i extends n.NodeHandlerSelectionAdapter{constructor(e,t){super("InlineFragment",e,t)}handle(e,t){const r={alias:void 0,arguments:void 0,directives:e.directives,kind:"Field",name:{kind:"Name",value:t.subject.value},selectionSet:e.selectionSet},n=e.typeCondition?[this.util.newTypePattern(t.subject,e.typeCondition,t)]:[];return this.util.operationFactory.createLeftJoin(this.util.operationFactory.createBgp([]),this.fieldToOperation(t,r,!1,n))}}t.NodeHandlerSelectionInlineFragment=i},62096:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveNodeHandlerAdapter=void 0,t.DirectiveNodeHandlerAdapter=class{constructor(e,t,r){this.targetKind=e,this.util=t,this.settings=r}getDirectiveConditionalValue(e,t){const r=this.util.getArgument(e.arguments,"if");if(!r)throw new Error(`The directive ${e.name.value} is missing an if-argument.`);const n=this.util.handleNodeValue(r.value,r.name.value,t);if(1!==n.terms.length)throw new Error(`Can not apply the directive ${e.name.value} with a list.`);return n.terms[0]}isDirectiveScopeAll(e){const t=this.util.getArgument(e.arguments,"scope");return t&&"EnumValue"===t.value.kind&&"all"===t.value.value}}},5095:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveNodeHandlerInclude=void 0;const n=r(62096);class i extends n.DirectiveNodeHandlerAdapter{constructor(e,t){super("include",e,t)}handle(e,t){const r=this.getDirectiveConditionalValue(e.directive,t);return"Literal"===r.termType&&"false"===r.value?{ignore:!0}:{}}}t.DirectiveNodeHandlerInclude=i},61151:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveNodeHandlerOptional=void 0;const n=r(62096);class i extends n.DirectiveNodeHandlerAdapter{constructor(e,t){super("optional",e,t)}handle(e,t){return{operationOverrider:e=>this.util.operationFactory.createLeftJoin(this.util.operationFactory.createBgp([]),e)}}}t.DirectiveNodeHandlerOptional=i},11013:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveNodeHandlerPlural=void 0;const n=r(17762),i=r(62096);class a extends i.DirectiveNodeHandlerAdapter{constructor(e,t){super("plural",e,t)}handle(e,t){return this.isDirectiveScopeAll(e.directive)&&(t.singularizeState=n.SingularizeState.PLURAL),delete t.singularizeVariables[this.util.nameToVariable(e.fieldLabel,t).value],{}}}t.DirectiveNodeHandlerPlural=a},60479:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveNodeHandlerSingle=void 0;const n=r(17762),i=r(62096);class a extends i.DirectiveNodeHandlerAdapter{constructor(e,t){super("single",e,t)}handle(e,t){return this.isDirectiveScopeAll(e.directive)&&(t.singularizeState=n.SingularizeState.SINGLE),t.singularizeVariables[this.util.nameToVariable(e.fieldLabel,t).value]=!0,{}}}t.DirectiveNodeHandlerSingle=a},88320:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveNodeHandlerSkip=void 0;const n=r(62096);class i extends n.DirectiveNodeHandlerAdapter{constructor(e,t){super("skip",e,t)}handle(e,t){const r=this.getDirectiveConditionalValue(e.directive,t);return"Literal"===r.termType&&"true"===r.value?{ignore:!0}:{}}}t.DirectiveNodeHandlerSkip=i},96414:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(62096),t),i(r(5095),t),i(r(61151),t),i(r(11013),t),i(r(60479),t),i(r(88320),t)},51812:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(96414),t),i(r(31998),t),i(r(14009),t),i(r(94058),t),i(r(73045),t),i(r(9540),t),i(r(9373),t),i(r(97285),t),i(r(15790),t),i(r(39555),t),i(r(89509),t)},81652:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerAdapter=void 0,t.NodeValueHandlerAdapter=class{constructor(e,t,r){this.targetKind=e,this.util=t,this.settings=r}}},95347:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerBoolean=void 0;const n=r(81652);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("BooleanValue",e,t),this.datatype=this.util.dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean")}handle(e,t,r){return{terms:[this.util.dataFactory.literal(e.value?"true":"false",this.datatype)]}}}t.NodeValueHandlerBoolean=i},87822:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerEnum=void 0;const n=r(81652);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("EnumValue",e,t)}handle(e,t,r){return{terms:[this.util.valueToNamedNode(e.value,r.context)]}}}t.NodeValueHandlerEnum=i},5797:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerFloat=void 0;const n=r(81652);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("FloatValue",e,t),this.datatype=this.util.dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#float")}handle(e,t,r){return{terms:[this.util.dataFactory.literal(e.value,this.datatype)]}}}t.NodeValueHandlerFloat=i},18338:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerInt=void 0;const n=r(81652);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("IntValue",e,t),this.datatype=this.util.dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#integer")}handle(e,t,r){return{terms:[this.util.dataFactory.literal(e.value,this.datatype)]}}}t.NodeValueHandlerInt=i},70727:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerList=void 0;const n=r(81652);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("ListValue",e,t),this.nodeFirst=this.util.dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),this.nodeRest=this.util.dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"),this.nodeNil=this.util.dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil")}handle(e,t,r){const n=[];let i=[];for(const a of e.values){const e=this.util.handleNodeValue(a,t,r);for(const t of e.terms)n.push(t);e.auxiliaryPatterns&&(i=i.concat(e.auxiliaryPatterns))}if(this.settings.arraysToRdfLists){const e=this.util.dataFactory.blankNode();let t=e,a=n.length;for(const e of n){i.push(this.util.operationFactory.createPattern(t,this.nodeFirst,e,r.graph));const n=0==--a?this.nodeNil:this.util.dataFactory.blankNode();i.push(this.util.operationFactory.createPattern(t,this.nodeRest,n,r.graph)),t=n}return{terms:[e],auxiliaryPatterns:i}}return{terms:n,auxiliaryPatterns:i}}}t.NodeValueHandlerList=i},13294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerNull=void 0;const n=r(81652);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("NullValue",e,t),this.nil=this.util.dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil")}handle(e,t,r){return{terms:[this.nil]}}}t.NodeValueHandlerNull=i},41756:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerObject=void 0;const n=r(81652);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("ObjectValue",e,t)}handle(e,t,r){const n=this.util.dataFactory.blankNode();let i=[];for(const a of e.fields){const e=this.util.handleNodeValue(a.value,t,r);for(const t of e.terms)i.push(this.util.createQuadPattern(n,a.name,t,r.graph,r.context));e.auxiliaryPatterns&&(i=i.concat(e.auxiliaryPatterns))}return{terms:[n],auxiliaryPatterns:i}}}t.NodeValueHandlerObject=i},26906:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerString=void 0;const n=r(81652);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("StringValue",e,t)}handle(e,t,r){const n=r.context.getContextRaw()[t];let i,a;return n&&"string"!=typeof n&&(n["@language"]?i=n["@language"]:n["@type"]&&(a=this.util.dataFactory.namedNode(n["@type"]))),{terms:[this.util.dataFactory.literal(e.value,i||a)]}}}t.NodeValueHandlerString=i},47959:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerVariable=void 0;const n=r(81652);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("Variable",e,t)}handle(e,t,r){const n=e.name.value,i=r.variablesDict[n],a=r.variablesMetaDict[n];if(!i){if(r.ignoreUnknownVariables||a&&!a.mandatory){const e=this.util.dataFactory.variable(n);return r.terminalVariables.map((e=>e.value)).indexOf(n)<0&&r.terminalVariables.push(e),{terms:[e]}}throw new Error(`Undefined variable: ${n}`)}if("Variable"===i.kind)throw new Error(`Variable refers to another variable: ${n}`);if(a)if(a.list){if("ListValue"!==i.kind)throw new Error(`Expected a list, but got ${i.kind} for ${n}`);if(a.type){const e=i;for(const t of e.values)if(t.kind!==a.type)throw new Error(`Expected ${a.type}, but got ${t.kind} for ${n}`)}}else a.type;return this.util.handleNodeValue(i,t,r)}}t.NodeValueHandlerVariable=i},31998:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(81652),t),i(r(95347),t),i(r(87822),t),i(r(5797),t),i(r(18338),t),i(r(70727),t),i(r(13294),t),i(r(41756),t),i(r(26906),t),i(r(47959),t)},44897:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.printError=T,t.GraphQLError=void 0;var i,a=(i=r(78582))&&i.__esModule?i:{default:i},o=r(28189),s=r(4251),c=r(90354);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e,t){for(var r=0;r0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=o&&o.stack?(Object.defineProperty(h(b),"stack",{value:o.stack,writable:!0,configurable:!0}),p(b)):(Error.captureStackTrace?Error.captureStackTrace(h(b),f):Object.defineProperty(h(b),"stack",{value:Error().stack,writable:!0,configurable:!0}),b)}return n=f,(i=[{key:"toString",value:function(){return T(this)}},{key:o.SYMBOL_TO_STRING_TAG,get:function(){return"Object"}}])&&d(n.prototype,i),f}(f(Error));function _(e){return void 0===e||0===e.length?void 0:e}function T(e){var t=e.message;if(e.nodes)for(var r=0,n=e.nodes;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.syntaxError=function(e,t,r){return new n.GraphQLError("Syntax Error: ".concat(r),void 0,e,[t])};var n=r(44897)},44077:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.prototype.toJSON;"function"==typeof t||(0,n.default)(0),e.prototype.inspect=t,i.default&&(e.prototype[i.default]=t)};var n=a(r(81880)),i=a(r(37020));function a(e){return e&&e.__esModule?e:{default:e}}},65269:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(t)}},23216:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return c(e,[])};var n,i=(n=r(37020))&&n.__esModule?n:{default:n};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}var o=10,s=2;function c(e,t){switch(a(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(i.default)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}(e);if(void 0!==n){var a=n.call(e);if(a!==e)return"string"==typeof a?a:c(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>s)return"[Array]";for(var r=Math.min(o,e.length),n=e.length-r,i=[],a=0;a1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);return 0===r.length?"{}":t.length>s?"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]":"{ "+r.map((function(r){return r+": "+c(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},83588:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,(n=r(23216))&&n.__esModule;t.default=function(e,t){return e instanceof t}},81880:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},78582:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"object"==r(e)&&null!==e}},37020:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.default=r},93378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=function(e){return null!=e&&"string"==typeof e.kind},t.Token=t.Location=void 0;var n,i=(n=r(44077))&&n.__esModule?n:{default:n},a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();t.Location=a,(0,i.default)(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();t.Token=o,(0,i.default)(o)},4758:(e,t)=>{"use strict";function r(e){for(var t=0;to&&r(t[s-1]);)--s;return t.slice(o,s).join("\n")},t.getBlockStringIndentation=n,t.printBlockString=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],a='"'===e[e.length-1],o="\\"===e[e.length-1],s=!n||a||o||r,c="";return!s||n&&i||(c+="\n"+t),c+=t?e.replace(/\n/g,"\n"+t):e,s&&(c+="\n"),'"""'+c.replace(/"""/g,'\\"""')+'"""'}},23684:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveLocation=void 0;var r=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});t.DirectiveLocation=r},44330:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Source",{enumerable:!0,get:function(){return n.Source}}),Object.defineProperty(t,"getLocation",{enumerable:!0,get:function(){return i.getLocation}}),Object.defineProperty(t,"printLocation",{enumerable:!0,get:function(){return a.printLocation}}),Object.defineProperty(t,"printSourceLocation",{enumerable:!0,get:function(){return a.printSourceLocation}}),Object.defineProperty(t,"Kind",{enumerable:!0,get:function(){return o.Kind}}),Object.defineProperty(t,"TokenKind",{enumerable:!0,get:function(){return s.TokenKind}}),Object.defineProperty(t,"Lexer",{enumerable:!0,get:function(){return c.Lexer}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return u.parse}}),Object.defineProperty(t,"parseValue",{enumerable:!0,get:function(){return u.parseValue}}),Object.defineProperty(t,"parseType",{enumerable:!0,get:function(){return u.parseType}}),Object.defineProperty(t,"print",{enumerable:!0,get:function(){return l.print}}),Object.defineProperty(t,"visit",{enumerable:!0,get:function(){return d.visit}}),Object.defineProperty(t,"visitInParallel",{enumerable:!0,get:function(){return d.visitInParallel}}),Object.defineProperty(t,"getVisitFn",{enumerable:!0,get:function(){return d.getVisitFn}}),Object.defineProperty(t,"BREAK",{enumerable:!0,get:function(){return d.BREAK}}),Object.defineProperty(t,"Location",{enumerable:!0,get:function(){return p.Location}}),Object.defineProperty(t,"Token",{enumerable:!0,get:function(){return p.Token}}),Object.defineProperty(t,"isDefinitionNode",{enumerable:!0,get:function(){return h.isDefinitionNode}}),Object.defineProperty(t,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return h.isExecutableDefinitionNode}}),Object.defineProperty(t,"isSelectionNode",{enumerable:!0,get:function(){return h.isSelectionNode}}),Object.defineProperty(t,"isValueNode",{enumerable:!0,get:function(){return h.isValueNode}}),Object.defineProperty(t,"isTypeNode",{enumerable:!0,get:function(){return h.isTypeNode}}),Object.defineProperty(t,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return h.isTypeSystemDefinitionNode}}),Object.defineProperty(t,"isTypeDefinitionNode",{enumerable:!0,get:function(){return h.isTypeDefinitionNode}}),Object.defineProperty(t,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return h.isTypeSystemExtensionNode}}),Object.defineProperty(t,"isTypeExtensionNode",{enumerable:!0,get:function(){return h.isTypeExtensionNode}}),Object.defineProperty(t,"DirectiveLocation",{enumerable:!0,get:function(){return f.DirectiveLocation}});var n=r(76241),i=r(4251),a=r(90354),o=r(12057),s=r(58053),c=r(4524),u=r(42275),l=r(43230),d=r(48048),p=r(93378),h=r(49674),f=r(23684)},12057:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Kind=void 0;var r=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});t.Kind=r},4524:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPunctuatorTokenKind=function(e){return e===a.TokenKind.BANG||e===a.TokenKind.DOLLAR||e===a.TokenKind.AMP||e===a.TokenKind.PAREN_L||e===a.TokenKind.PAREN_R||e===a.TokenKind.SPREAD||e===a.TokenKind.COLON||e===a.TokenKind.EQUALS||e===a.TokenKind.AT||e===a.TokenKind.BRACKET_L||e===a.TokenKind.BRACKET_R||e===a.TokenKind.BRACE_L||e===a.TokenKind.PIPE||e===a.TokenKind.BRACE_R},t.Lexer=void 0;var n=r(40629),i=r(93378),a=r(58053),o=r(4758),s=function(){function e(e){var t=new i.Token(a.TokenKind.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==a.TokenKind.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=u(this,e)}while(e.kind===a.TokenKind.COMMENT);return e},e}();function c(e){return isNaN(e)?a.TokenKind.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function u(e,t){for(var r=e.source,o=r.body,s=o.length,c=t.end;c31||9===s));return new i.Token(a.TokenKind.COMMENT,t,u,r,n,o,c.slice(t+1,u))}function p(e,t,r,o,s,u){var l=e.body,d=r,p=t,f=!1;if(45===d&&(d=l.charCodeAt(++p)),48===d){if((d=l.charCodeAt(++p))>=48&&d<=57)throw(0,n.syntaxError)(e,p,"Invalid number, unexpected digit after 0: ".concat(c(d),"."))}else p=h(e,p,d),d=l.charCodeAt(p);if(46===d&&(f=!0,d=l.charCodeAt(++p),p=h(e,p,d),d=l.charCodeAt(p)),69!==d&&101!==d||(f=!0,43!==(d=l.charCodeAt(++p))&&45!==d||(d=l.charCodeAt(++p)),p=h(e,p,d),d=l.charCodeAt(p)),46===d||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(d))throw(0,n.syntaxError)(e,p,"Invalid number, expected digit but got: ".concat(c(d),"."));return new i.Token(f?a.TokenKind.FLOAT:a.TokenKind.INT,t,p,o,s,u,l.slice(t,p))}function h(e,t,r){var i=e.body,a=t,o=r;if(o>=48&&o<=57){do{o=i.charCodeAt(++a)}while(o>=48&&o<=57);return a}throw(0,n.syntaxError)(e,a,"Invalid number, expected digit but got: ".concat(c(o),"."))}function f(e,t,r,o,s){for(var u,l,d,p,h=e.body,f=t+1,y=f,g=0,b="";f=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function g(e,t,r,n,o){for(var s=e.body,c=s.length,u=t+1,l=0;u!==c&&!isNaN(l=s.charCodeAt(u))&&(95===l||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122);)++u;return new i.Token(a.TokenKind.NAME,t,u,r,n,o,s.slice(t,u))}t.Lexer=s},4251:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLocation=function(e,t){for(var r,n=/\r\n|[\n\r]/g,i=1,a=t+1;(r=n.exec(e.body))&&r.index{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parse=function(e,t){return new l(e,t).parseDocument()},t.parseValue=function(e,t){var r=new l(e,t);r.expectToken(o.TokenKind.SOF);var n=r.parseValueLiteral(!1);return r.expectToken(o.TokenKind.EOF),n},t.parseType=function(e,t){var r=new l(e,t);r.expectToken(o.TokenKind.SOF);var n=r.parseTypeReference();return r.expectToken(o.TokenKind.EOF),n},t.Parser=void 0;var n=r(40629),i=r(12057),a=r(93378),o=r(58053),s=r(76241),c=r(23684),u=r(4524),l=function(){function e(e,t){var r=(0,s.isSource)(e)?e:new s.Source(e);this._lexer=new u.Lexer(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(o.TokenKind.NAME);return{kind:i.Kind.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:i.Kind.DOCUMENT,definitions:this.many(o.TokenKind.SOF,this.parseDefinition,o.TokenKind.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(o.TokenKind.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(o.TokenKind.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(o.TokenKind.BRACE_L))return{kind:i.Kind.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(o.TokenKind.NAME)&&(t=this.parseName()),{kind:i.Kind.OPERATION_DEFINITION,operation:r,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(o.TokenKind.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(o.TokenKind.PAREN_L,this.parseVariableDefinition,o.TokenKind.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:i.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(o.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(o.TokenKind.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(o.TokenKind.DOLLAR),{kind:i.Kind.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:i.Kind.SELECTION_SET,selections:this.many(o.TokenKind.BRACE_L,this.parseSelection,o.TokenKind.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(o.TokenKind.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(o.TokenKind.COLON)?(e=n,t=this.parseName()):t=n,{kind:i.Kind.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(o.TokenKind.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(o.TokenKind.PAREN_L,t,o.TokenKind.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(o.TokenKind.COLON),{kind:i.Kind.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:i.Kind.ARGUMENT,name:this.parseName(),value:(this.expectToken(o.TokenKind.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(o.TokenKind.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(o.TokenKind.NAME)?{kind:i.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:i.Kind.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:i.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:i.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case o.TokenKind.BRACKET_L:return this.parseList(e);case o.TokenKind.BRACE_L:return this.parseObject(e);case o.TokenKind.INT:return this._lexer.advance(),{kind:i.Kind.INT,value:t.value,loc:this.loc(t)};case o.TokenKind.FLOAT:return this._lexer.advance(),{kind:i.Kind.FLOAT,value:t.value,loc:this.loc(t)};case o.TokenKind.STRING:case o.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case o.TokenKind.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:i.Kind.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:i.Kind.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:i.Kind.NULL,loc:this.loc(t)};default:return{kind:i.Kind.ENUM,value:t.value,loc:this.loc(t)}}case o.TokenKind.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:i.Kind.STRING,value:e.value,block:e.kind===o.TokenKind.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:i.Kind.LIST,values:this.any(o.TokenKind.BRACKET_L,(function(){return t.parseValueLiteral(e)}),o.TokenKind.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:i.Kind.OBJECT,fields:this.any(o.TokenKind.BRACE_L,(function(){return t.parseObjectField(e)}),o.TokenKind.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(o.TokenKind.COLON),{kind:i.Kind.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(o.TokenKind.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(o.TokenKind.AT),{kind:i.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(o.TokenKind.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(o.TokenKind.BRACKET_R),e={kind:i.Kind.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(o.TokenKind.BANG)?{kind:i.Kind.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:i.Kind.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===o.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(o.TokenKind.STRING)||this.peek(o.TokenKind.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(o.TokenKind.BRACE_L,this.parseOperationTypeDefinition,o.TokenKind.BRACE_R);return{kind:i.Kind.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(o.TokenKind.COLON);var r=this.parseNamedType();return{kind:i.Kind.OPERATION_TYPE_DEFINITION,operation:t,type:r,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:i.Kind.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),a=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:i.Kind.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:a,fields:o,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(o.TokenKind.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(o.TokenKind.AMP)||this.peek(o.TokenKind.NAME));return t}return this.delimitedMany(o.TokenKind.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(o.TokenKind.BRACE_L)&&this._lexer.lookahead().kind===o.TokenKind.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(o.TokenKind.BRACE_L,this.parseFieldDefinition,o.TokenKind.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(o.TokenKind.COLON);var a=this.parseTypeReference(),s=this.parseDirectives(!0);return{kind:i.Kind.FIELD_DEFINITION,description:t,name:r,arguments:n,type:a,directives:s,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(o.TokenKind.PAREN_L,this.parseInputValueDef,o.TokenKind.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(o.TokenKind.COLON);var n,a=this.parseTypeReference();this.expectOptionalToken(o.TokenKind.EQUALS)&&(n=this.parseValueLiteral(!0));var s=this.parseDirectives(!0);return{kind:i.Kind.INPUT_VALUE_DEFINITION,description:t,name:r,type:a,defaultValue:n,directives:s,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),a=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:i.Kind.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:a,fields:o,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),a=this.parseUnionMemberTypes();return{kind:i.Kind.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:a,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(o.TokenKind.EQUALS)?this.delimitedMany(o.TokenKind.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),a=this.parseEnumValuesDefinition();return{kind:i.Kind.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:a,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(o.TokenKind.BRACE_L,this.parseEnumValueDefinition,o.TokenKind.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:i.Kind.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),a=this.parseInputFieldsDefinition();return{kind:i.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:a,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(o.TokenKind.BRACE_L,this.parseInputValueDef,o.TokenKind.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===o.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),r=this.optionalMany(o.TokenKind.BRACE_L,this.parseOperationTypeDefinition,o.TokenKind.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:i.Kind.SCHEMA_EXTENSION,directives:t,operationTypes:r,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:i.Kind.SCALAR_TYPE_EXTENSION,name:t,directives:r,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),a=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===a.length)throw this.unexpected();return{kind:i.Kind.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:a,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),a=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===a.length)throw this.unexpected();return{kind:i.Kind.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:a,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:i.Kind.UNION_TYPE_EXTENSION,name:t,directives:r,types:n,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:i.Kind.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:i.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(o.TokenKind.AT);var r=this.parseName(),n=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var s=this.parseDirectiveLocations();return{kind:i.Kind.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:a,locations:s,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(o.TokenKind.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==c.DirectiveLocation[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new a.Location(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw(0,n.syntaxError)(this._lexer.source,t.start,"Expected ".concat(p(e),", found ").concat(d(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==o.TokenKind.NAME||t.value!==e)throw(0,n.syntaxError)(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(d(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===o.TokenKind.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return(0,n.syntaxError)(this._lexer.source,t.start,"Unexpected ".concat(d(t),"."))},t.any=function(e,t,r){this.expectToken(e);for(var n=[];!this.expectOptionalToken(r);)n.push(t.call(this));return n},t.optionalMany=function(e,t,r){if(this.expectOptionalToken(e)){var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}return[]},t.many=function(e,t,r){this.expectToken(e);var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r},e}();function d(e){var t=e.value;return p(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function p(e){return(0,u.isPunctuatorTokenKind)(e)?'"'.concat(e,'"'):e}t.Parser=l},49674:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDefinitionNode=function(e){return i(e)||a(e)||s(e)},t.isExecutableDefinitionNode=i,t.isSelectionNode=function(e){return e.kind===n.Kind.FIELD||e.kind===n.Kind.FRAGMENT_SPREAD||e.kind===n.Kind.INLINE_FRAGMENT},t.isValueNode=function(e){return e.kind===n.Kind.VARIABLE||e.kind===n.Kind.INT||e.kind===n.Kind.FLOAT||e.kind===n.Kind.STRING||e.kind===n.Kind.BOOLEAN||e.kind===n.Kind.NULL||e.kind===n.Kind.ENUM||e.kind===n.Kind.LIST||e.kind===n.Kind.OBJECT},t.isTypeNode=function(e){return e.kind===n.Kind.NAMED_TYPE||e.kind===n.Kind.LIST_TYPE||e.kind===n.Kind.NON_NULL_TYPE},t.isTypeSystemDefinitionNode=a,t.isTypeDefinitionNode=o,t.isTypeSystemExtensionNode=s,t.isTypeExtensionNode=c;var n=r(12057);function i(e){return e.kind===n.Kind.OPERATION_DEFINITION||e.kind===n.Kind.FRAGMENT_DEFINITION}function a(e){return e.kind===n.Kind.SCHEMA_DEFINITION||o(e)||e.kind===n.Kind.DIRECTIVE_DEFINITION}function o(e){return e.kind===n.Kind.SCALAR_TYPE_DEFINITION||e.kind===n.Kind.OBJECT_TYPE_DEFINITION||e.kind===n.Kind.INTERFACE_TYPE_DEFINITION||e.kind===n.Kind.UNION_TYPE_DEFINITION||e.kind===n.Kind.ENUM_TYPE_DEFINITION||e.kind===n.Kind.INPUT_OBJECT_TYPE_DEFINITION}function s(e){return e.kind===n.Kind.SCHEMA_EXTENSION||c(e)}function c(e){return e.kind===n.Kind.SCALAR_TYPE_EXTENSION||e.kind===n.Kind.OBJECT_TYPE_EXTENSION||e.kind===n.Kind.INTERFACE_TYPE_EXTENSION||e.kind===n.Kind.UNION_TYPE_EXTENSION||e.kind===n.Kind.ENUM_TYPE_EXTENSION||e.kind===n.Kind.INPUT_OBJECT_TYPE_EXTENSION}},90354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printLocation=function(e){return i(e.source,(0,n.getLocation)(e.source,e.start))},t.printSourceLocation=i;var n=r(4251);function i(e,t){var r=e.locationOffset.column-1,n=o(r)+e.body,i=t.line-1,s=e.locationOffset.line-1,c=t.line+s,u=1===t.line?r:0,l=t.column+u,d="".concat(e.name,":").concat(c,":").concat(l,"\n"),p=n.split(/\r\n|[\n\r]/g),h=p[i];if(h.length>120){for(var f=Math.floor(l/80),y=l%80,m=[],g=0;g{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.print=function(e){return(0,n.visit)(e,{leave:a})};var n=r(48048),i=r(4758),a={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return s(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=u("(",s(e.variableDefinitions,", "),")"),i=s(e.directives," "),a=e.selectionSet;return r||i||n||"query"!==t?s([t,s([r,n]),i,a]," "):a},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,i=e.directives;return t+": "+r+u(" = ",n)+u(" ",s(i," "))},SelectionSet:function(e){return c(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,i=e.directives,a=e.selectionSet,o=u("",t,": ")+r,c=o+u("(",s(n,", "),")");return c.length>80&&(c=o+u("(\n",l(s(n,"\n")),"\n)")),s([c,s(i," "),a]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+u(" ",s(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return s(["...",u("on ",t),s(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,i=e.directives,a=e.selectionSet;return"fragment ".concat(t).concat(u("(",s(n,", "),")")," ")+"on ".concat(r," ").concat(u("",s(i," ")," "))+a},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?(0,i.printBlockString)(r,"description"===t?"":" "):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+s(e.values,", ")+"]"},ObjectValue:function(e){return"{"+s(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+u("(",s(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:o((function(e){var t=e.directives,r=e.operationTypes;return s(["schema",s(t," "),c(r)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:o((function(e){return s(["scalar",e.name,s(e.directives," ")]," ")})),ObjectTypeDefinition:o((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["type",t,u("implements ",s(r," & ")),s(n," "),c(i)]," ")})),FieldDefinition:o((function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(p(r)?u("(\n",l(s(r,"\n")),"\n)"):u("(",s(r,", "),")"))+": "+n+u(" ",s(i," "))})),InputValueDefinition:o((function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return s([t+": "+r,u("= ",n),s(i," ")]," ")})),InterfaceTypeDefinition:o((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["interface",t,u("implements ",s(r," & ")),s(n," "),c(i)]," ")})),UnionTypeDefinition:o((function(e){var t=e.name,r=e.directives,n=e.types;return s(["union",t,s(r," "),n&&0!==n.length?"= "+s(n," | "):""]," ")})),EnumTypeDefinition:o((function(e){var t=e.name,r=e.directives,n=e.values;return s(["enum",t,s(r," "),c(n)]," ")})),EnumValueDefinition:o((function(e){return s([e.name,s(e.directives," ")]," ")})),InputObjectTypeDefinition:o((function(e){var t=e.name,r=e.directives,n=e.fields;return s(["input",t,s(r," "),c(n)]," ")})),DirectiveDefinition:o((function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(p(r)?u("(\n",l(s(r,"\n")),"\n)"):u("(",s(r,", "),")"))+(n?" repeatable":"")+" on "+s(i," | ")})),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return s(["extend schema",s(t," "),c(r)]," ")},ScalarTypeExtension:function(e){return s(["extend scalar",e.name,s(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["extend type",t,u("implements ",s(r," & ")),s(n," "),c(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["extend interface",t,u("implements ",s(r," & ")),s(n," "),c(i)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return s(["extend union",t,s(r," "),n&&0!==n.length?"= "+s(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return s(["extend enum",t,s(r," "),c(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return s(["extend input",t,s(r," "),c(n)]," ")}};function o(e){return function(t){return s([t.description,e(t)],"\n")}}function s(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(r))&&void 0!==t?t:""}function c(e){return u("{\n",l(s(e,"\n")),"\n}")}function u(e,t){return null!=t&&""!==t?e+t+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:""):""}function l(e){return u(" ",e.replace(/\n/g,"\n "))}function d(e){return-1!==e.indexOf("\n")}function p(e){return null!=e&&e.some(d)}},76241:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSource=function(e){return(0,o.default)(e,u)},t.Source=void 0;var n=r(28189),i=s(r(23216)),a=s(r(65269)),o=s(r(83588));function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||(0,a.default)(0,"Body must be a string. Received: ".concat((0,i.default)(e),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||(0,a.default)(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,a.default)(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r;return t=e,(r=[{key:n.SYMBOL_TO_STRING_TAG,get:function(){return"Source"}}])&&c(t.prototype,r),e}();t.Source=u},58053:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenKind=void 0;var r=Object.freeze({SOF:"",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});t.TokenKind=r},48048:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.visit=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=void 0,u=Array.isArray(e),l=[e],d=-1,p=[],h=void 0,f=void 0,y=void 0,m=[],g=[],b=e;do{var v=++d===l.length,_=v&&0!==p.length;if(v){if(f=0===g.length?void 0:m[m.length-1],h=y,y=g.pop(),_){if(u)h=h.slice();else{for(var T={},O=0,w=Object.keys(h);O{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SYMBOL_TO_STRING_TAG=t.SYMBOL_ASYNC_ITERATOR=t.SYMBOL_ITERATOR=void 0;var r="function"==typeof Symbol&&null!=Symbol.iterator?Symbol.iterator:"@@iterator";t.SYMBOL_ITERATOR=r;var n="function"==typeof Symbol&&null!=Symbol.asyncIterator?Symbol.asyncIterator:"@@asyncIterator";t.SYMBOL_ASYNC_ITERATOR=n;var i="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";t.SYMBOL_TO_STRING_TAG=i},99499:(e,t,r)=>{var n=t;n.utils=r(70461),n.common=r(32191),n.sha=r(75746),n.ripemd=r(74169),n.hmac=r(11825),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},32191:(e,t,r)=>{"use strict";var n=r(70461),i=r(7784);function a(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=a,a.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a{"use strict";var n=r(70461),i=r(7784);function a(e,t,r){if(!(this instanceof a))return new a(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=a,a.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t{"use strict";var n=r(70461),i=r(32191),a=n.rotl32,o=n.sum32,s=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function l(){if(!(this instanceof l))return new l;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function d(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function p(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(l,u),t.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],l=this.h[4],b=r,v=n,_=i,T=u,O=l,w=0;w<80;w++){var S=o(a(c(r,d(w,n,i,u),e[f[w]+t],p(w)),m[w]),l);r=l,l=u,u=a(i,10),i=n,n=S,S=o(a(c(b,d(79-w,v,_,T),e[y[w]+t],h(w)),g[w]),O),b=O,O=T,T=a(_,10),_=v,v=S}S=s(this.h[1],i,T),this.h[1]=s(this.h[2],u,O),this.h[2]=s(this.h[3],l,b),this.h[3]=s(this.h[4],r,v),this.h[4]=s(this.h[0],n,_),this.h[0]=S},l.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var f=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],y=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},75746:(e,t,r)=>{"use strict";t.sha1=r(12986),t.sha224=r(75393),t.sha256=r(50536),t.sha384=r(52348),t.sha512=r(92157)},12986:(e,t,r)=>{"use strict";var n=r(70461),i=r(32191),a=r(600),o=n.rotl32,s=n.sum32,c=n.sum32_5,u=a.ft_1,l=i.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];function p(){if(!(this instanceof p))return new p;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(p,l),e.exports=p,p.blockSize=512,p.outSize=160,p.hmacStrength=80,p.padLength=64,p.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n{"use strict";var n=r(70461),i=r(50536);function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(a,i),e.exports=a,a.blockSize=512,a.outSize=224,a.hmacStrength=192,a.padLength=64,a.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},50536:(e,t,r)=>{"use strict";var n=r(70461),i=r(32191),a=r(600),o=r(7784),s=n.sum32,c=n.sum32_4,u=n.sum32_5,l=a.ch32,d=a.maj32,p=a.s0_256,h=a.s1_256,f=a.g0_256,y=a.g1_256,m=i.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(b,m),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n{"use strict";var n=r(70461),i=r(92157);function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(a,i),e.exports=a,a.blockSize=1024,a.outSize=384,a.hmacStrength=192,a.padLength=128,a.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},92157:(e,t,r)=>{"use strict";var n=r(70461),i=r(32191),a=r(7784),o=n.rotr64_hi,s=n.rotr64_lo,c=n.shr64_hi,u=n.shr64_lo,l=n.sum64,d=n.sum64_hi,p=n.sum64_lo,h=n.sum64_4_hi,f=n.sum64_4_lo,y=n.sum64_5_hi,m=n.sum64_5_lo,g=i.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function _(e,t,r,n,i){var a=e&r^~e&i;return a<0&&(a+=4294967296),a}function T(e,t,r,n,i,a){var o=t&n^~t&a;return o<0&&(o+=4294967296),o}function O(e,t,r,n,i){var a=e&r^e&i^r&i;return a<0&&(a+=4294967296),a}function w(e,t,r,n,i,a){var o=t&n^t&a^n&a;return o<0&&(o+=4294967296),o}function S(e,t){var r=o(e,t,28)^o(t,e,2)^o(t,e,7);return r<0&&(r+=4294967296),r}function E(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function x(e,t){var r=o(e,t,1)^o(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=s(e,t,1)^s(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function P(e,t){var r=s(e,t,19)^s(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,g),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n{"use strict";var n=r(70461).rotr32;function i(e,t,r){return e&t^~e&r}function a(e,t,r){return e&t^e&r^t&r}function o(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?o(t,r,n):2===e?a(t,r,n):void 0},t.ch32=i,t.maj32=a,t.p32=o,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},70461:(e,t,r)=>{"use strict";var n=r(7784),i=r(35615);function a(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&o|128):a(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i>>0}return o},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],a=n+e[t+1]>>>0,o=(a>>0,e[t+1]=a},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,a,o,s){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,a,o,s){return t+n+a+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,a,o,s,c,u){var l=0,d=t;return l+=(d=d+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,a,o,s,c,u){return t+n+a+s+u>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},14291:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Parser=void 0;var o=a(r(36439)),s=r(3379),c=new Set(["input","option","optgroup","select","button","datalist","textarea"]),u=new Set(["p"]),l=new Set(["thead","tbody"]),d=new Set(["dd","dt"]),p=new Set(["rt","rp"]),h=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",u],["h1",u],["h2",u],["h3",u],["h4",u],["h5",u],["h6",u],["select",c],["input",c],["output",c],["button",c],["datalist",c],["textarea",c],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",d],["dt",d],["address",u],["article",u],["aside",u],["blockquote",u],["details",u],["div",u],["dl",u],["fieldset",u],["figcaption",u],["figure",u],["footer",u],["form",u],["header",u],["hr",u],["main",u],["nav",u],["ol",u],["pre",u],["section",u],["table",u],["ul",u],["rt",p],["rp",p],["tbody",l],["tfoot",l]]),f=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),y=new Set(["math","svg"]),m=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),g=/\s|\//,b=function(){function e(e,t){var r,n,i,a,s,c;void 0===t&&(t={}),this.options=t,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=null!=e?e:{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=null!==(r=t.lowerCaseTags)&&void 0!==r?r:this.htmlMode,this.lowerCaseAttributeNames=null!==(n=t.lowerCaseAttributeNames)&&void 0!==n?n:this.htmlMode,this.recognizeSelfClosing=null!==(i=t.recognizeSelfClosing)&&void 0!==i?i:!this.htmlMode,this.tokenizer=new(null!==(a=t.Tokenizer)&&void 0!==a?a:o.default)(this.options,this),this.foreignContext=[!this.htmlMode],null===(c=(s=this.cbs).onparserinit)||void 0===c||c.call(s,this)}return e.prototype.ontext=function(e,t){var r,n,i=this.getSlice(e,t);this.endIndex=t-1,null===(n=(r=this.cbs).ontext)||void 0===n||n.call(r,i),this.startIndex=t},e.prototype.ontextentity=function(e,t){var r,n;this.endIndex=t-1,null===(n=(r=this.cbs).ontext)||void 0===n||n.call(r,(0,s.fromCodePoint)(e)),this.startIndex=t},e.prototype.isVoidElement=function(e){return this.htmlMode&&f.has(e)},e.prototype.onopentagname=function(e,t){this.endIndex=t;var r=this.getSlice(e,t);this.lowerCaseTagNames&&(r=r.toLowerCase()),this.emitOpenTag(r)},e.prototype.emitOpenTag=function(e){var t,r,n,i;this.openTagStart=this.startIndex,this.tagname=e;var a=this.htmlMode&&h.get(e);if(a)for(;this.stack.length>0&&a.has(this.stack[0]);){var o=this.stack.shift();null===(r=(t=this.cbs).onclosetag)||void 0===r||r.call(t,o,!0)}this.isVoidElement(e)||(this.stack.unshift(e),this.htmlMode&&(y.has(e)?this.foreignContext.unshift(!0):m.has(e)&&this.foreignContext.unshift(!1))),null===(i=(n=this.cbs).onopentagname)||void 0===i||i.call(n,e),this.cbs.onopentag&&(this.attribs={})},e.prototype.endOpenTag=function(e){var t,r;this.startIndex=this.openTagStart,this.attribs&&(null===(r=(t=this.cbs).onopentag)||void 0===r||r.call(t,this.tagname,this.attribs,e),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""},e.prototype.onopentagend=function(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1},e.prototype.onclosetag=function(e,t){var r,n,i,a,o,s,c,u;this.endIndex=t;var l=this.getSlice(e,t);if(this.lowerCaseTagNames&&(l=l.toLowerCase()),this.htmlMode&&(y.has(l)||m.has(l))&&this.foreignContext.shift(),this.isVoidElement(l))this.htmlMode&&"br"===l&&(null===(a=(i=this.cbs).onopentagname)||void 0===a||a.call(i,"br"),null===(s=(o=this.cbs).onopentag)||void 0===s||s.call(o,"br",{},!0),null===(u=(c=this.cbs).onclosetag)||void 0===u||u.call(c,"br",!1));else{var d=this.stack.indexOf(l);if(-1!==d)for(var p=0;p<=d;p++){var h=this.stack.shift();null===(n=(r=this.cbs).onclosetag)||void 0===n||n.call(r,h,p!==d)}else this.htmlMode&&"p"===l&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=t+1},e.prototype.onselfclosingtag=function(e){this.endIndex=e,this.recognizeSelfClosing||this.foreignContext[0]?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)},e.prototype.closeCurrentTag=function(e){var t,r,n=this.tagname;this.endOpenTag(e),this.stack[0]===n&&(null===(r=(t=this.cbs).onclosetag)||void 0===r||r.call(t,n,!e),this.stack.shift())},e.prototype.onattribname=function(e,t){this.startIndex=e;var r=this.getSlice(e,t);this.attribname=this.lowerCaseAttributeNames?r.toLowerCase():r},e.prototype.onattribdata=function(e,t){this.attribvalue+=this.getSlice(e,t)},e.prototype.onattribentity=function(e){this.attribvalue+=(0,s.fromCodePoint)(e)},e.prototype.onattribend=function(e,t){var r,n;this.endIndex=t,null===(n=(r=this.cbs).onattribute)||void 0===n||n.call(r,this.attribname,this.attribvalue,e===o.QuoteType.Double?'"':e===o.QuoteType.Single?"'":e===o.QuoteType.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""},e.prototype.getInstructionName=function(e){var t=e.search(g),r=t<0?e:e.substr(0,t);return this.lowerCaseTagNames&&(r=r.toLowerCase()),r},e.prototype.ondeclaration=function(e,t){this.endIndex=t;var r=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){var n=this.getInstructionName(r);this.cbs.onprocessinginstruction("!".concat(n),"!".concat(r))}this.startIndex=t+1},e.prototype.onprocessinginstruction=function(e,t){this.endIndex=t;var r=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){var n=this.getInstructionName(r);this.cbs.onprocessinginstruction("?".concat(n),"?".concat(r))}this.startIndex=t+1},e.prototype.oncomment=function(e,t,r){var n,i,a,o;this.endIndex=t,null===(i=(n=this.cbs).oncomment)||void 0===i||i.call(n,this.getSlice(e,t-r)),null===(o=(a=this.cbs).oncommentend)||void 0===o||o.call(a),this.startIndex=t+1},e.prototype.oncdata=function(e,t,r){var n,i,a,o,s,c,u,l,d,p;this.endIndex=t;var h=this.getSlice(e,t-r);!this.htmlMode||this.options.recognizeCDATA?(null===(i=(n=this.cbs).oncdatastart)||void 0===i||i.call(n),null===(o=(a=this.cbs).ontext)||void 0===o||o.call(a,h),null===(c=(s=this.cbs).oncdataend)||void 0===c||c.call(s)):(null===(l=(u=this.cbs).oncomment)||void 0===l||l.call(u,"[CDATA[".concat(h,"]]")),null===(p=(d=this.cbs).oncommentend)||void 0===p||p.call(d)),this.startIndex=t+1},e.prototype.onend=function(){var e,t;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(var r=0;r=this.buffers[0].length;)this.shiftBuffer();for(var r=this.buffers[0].slice(e-this.bufferOffset,t-this.bufferOffset);t-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),r+=this.buffers[0].slice(0,t-this.bufferOffset);return r},e.prototype.shiftBuffer=function(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()},e.prototype.write=function(e){var t,r;this.ended?null===(r=(t=this.cbs).onerror)||void 0===r||r.call(t,new Error(".write() after done!")):(this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++))},e.prototype.end=function(e){var t,r;this.ended?null===(r=(t=this.cbs).onerror)||void 0===r||r.call(t,new Error(".end() after done!")):(e&&this.write(e),this.ended=!0,this.tokenizer.end())},e.prototype.pause=function(){this.tokenizer.pause()},e.prototype.resume=function(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuoteType=void 0;var n,i,a,o=r(3379);function s(e){return e===n.Space||e===n.NewLine||e===n.Tab||e===n.FormFeed||e===n.CarriageReturn}function c(e){return e===n.Slash||e===n.Gt||s(e)}!function(e){e[e.Tab=9]="Tab",e[e.NewLine=10]="NewLine",e[e.FormFeed=12]="FormFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.Number=35]="Number",e[e.Amp=38]="Amp",e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote",e[e.Dash=45]="Dash",e[e.Slash=47]="Slash",e[e.Zero=48]="Zero",e[e.Nine=57]="Nine",e[e.Semi=59]="Semi",e[e.Lt=60]="Lt",e[e.Eq=61]="Eq",e[e.Gt=62]="Gt",e[e.Questionmark=63]="Questionmark",e[e.UpperA=65]="UpperA",e[e.LowerA=97]="LowerA",e[e.UpperF=70]="UpperF",e[e.LowerF=102]="LowerF",e[e.UpperZ=90]="UpperZ",e[e.LowerZ=122]="LowerZ",e[e.LowerX=120]="LowerX",e[e.OpeningSquareBracket=91]="OpeningSquareBracket"}(n||(n={})),function(e){e[e.Text=1]="Text",e[e.BeforeTagName=2]="BeforeTagName",e[e.InTagName=3]="InTagName",e[e.InSelfClosingTag=4]="InSelfClosingTag",e[e.BeforeClosingTagName=5]="BeforeClosingTagName",e[e.InClosingTagName=6]="InClosingTagName",e[e.AfterClosingTagName=7]="AfterClosingTagName",e[e.BeforeAttributeName=8]="BeforeAttributeName",e[e.InAttributeName=9]="InAttributeName",e[e.AfterAttributeName=10]="AfterAttributeName",e[e.BeforeAttributeValue=11]="BeforeAttributeValue",e[e.InAttributeValueDq=12]="InAttributeValueDq",e[e.InAttributeValueSq=13]="InAttributeValueSq",e[e.InAttributeValueNq=14]="InAttributeValueNq",e[e.BeforeDeclaration=15]="BeforeDeclaration",e[e.InDeclaration=16]="InDeclaration",e[e.InProcessingInstruction=17]="InProcessingInstruction",e[e.BeforeComment=18]="BeforeComment",e[e.CDATASequence=19]="CDATASequence",e[e.InSpecialComment=20]="InSpecialComment",e[e.InCommentLike=21]="InCommentLike",e[e.BeforeSpecialS=22]="BeforeSpecialS",e[e.BeforeSpecialT=23]="BeforeSpecialT",e[e.SpecialStartSequence=24]="SpecialStartSequence",e[e.InSpecialTag=25]="InSpecialTag",e[e.InEntity=26]="InEntity"}(i||(i={})),function(e){e[e.NoValue=0]="NoValue",e[e.Unquoted=1]="Unquoted",e[e.Single=2]="Single",e[e.Double=3]="Double"}(a||(t.QuoteType=a={}));var u={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])},l=function(){function e(e,t){var r=e.xmlMode,n=void 0!==r&&r,a=e.decodeEntities,s=void 0===a||a,c=this;this.cbs=t,this.state=i.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=i.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=n,this.decodeEntities=s,this.entityDecoder=new o.EntityDecoder(n?o.xmlDecodeTree:o.htmlDecodeTree,(function(e,t){return c.emitCodePoint(e,t)}))}return e.prototype.reset=function(){this.state=i.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=i.Text,this.currentSequence=void 0,this.running=!0,this.offset=0},e.prototype.write=function(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()},e.prototype.end=function(){this.running&&this.finish()},e.prototype.pause=function(){this.running=!1},e.prototype.resume=function(){this.running=!0,this.indexthis.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=i.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===n.Amp&&this.startEntity()},e.prototype.stateSpecialStartSequence=function(e){var t=this.sequenceIndex===this.currentSequence.length;if(t?c(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t)return void this.sequenceIndex++}else this.isSpecial=!1;this.sequenceIndex=0,this.state=i.InTagName,this.stateInTagName(e)},e.prototype.stateInSpecialTag=function(e){if(this.sequenceIndex===this.currentSequence.length){if(e===n.Gt||s(e)){var t=this.index-this.currentSequence.length;if(this.sectionStart=n.LowerA&&e<=n.LowerZ||e>=n.UpperA&&e<=n.UpperZ}(e)},e.prototype.startSpecial=function(e,t){this.isSpecial=!0,this.currentSequence=e,this.sequenceIndex=t,this.state=i.SpecialStartSequence},e.prototype.stateBeforeTagName=function(e){if(e===n.ExclamationMark)this.state=i.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===n.Questionmark)this.state=i.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(e)){var t=32|e;this.sectionStart=this.index,this.xmlMode?this.state=i.InTagName:t===u.ScriptEnd[2]?this.state=i.BeforeSpecialS:t===u.TitleEnd[2]?this.state=i.BeforeSpecialT:this.state=i.InTagName}else e===n.Slash?this.state=i.BeforeClosingTagName:(this.state=i.Text,this.stateText(e))},e.prototype.stateInTagName=function(e){c(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=i.BeforeAttributeName,this.stateBeforeAttributeName(e))},e.prototype.stateBeforeClosingTagName=function(e){s(e)||(e===n.Gt?this.state=i.Text:(this.state=this.isTagStartChar(e)?i.InClosingTagName:i.InSpecialComment,this.sectionStart=this.index))},e.prototype.stateInClosingTagName=function(e){(e===n.Gt||s(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=i.AfterClosingTagName,this.stateAfterClosingTagName(e))},e.prototype.stateAfterClosingTagName=function(e){(e===n.Gt||this.fastForwardTo(n.Gt))&&(this.state=i.Text,this.sectionStart=this.index+1)},e.prototype.stateBeforeAttributeName=function(e){e===n.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=i.InSpecialTag,this.sequenceIndex=0):this.state=i.Text,this.sectionStart=this.index+1):e===n.Slash?this.state=i.InSelfClosingTag:s(e)||(this.state=i.InAttributeName,this.sectionStart=this.index)},e.prototype.stateInSelfClosingTag=function(e){e===n.Gt?(this.cbs.onselfclosingtag(this.index),this.state=i.Text,this.sectionStart=this.index+1,this.isSpecial=!1):s(e)||(this.state=i.BeforeAttributeName,this.stateBeforeAttributeName(e))},e.prototype.stateInAttributeName=function(e){(e===n.Eq||c(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=i.AfterAttributeName,this.stateAfterAttributeName(e))},e.prototype.stateAfterAttributeName=function(e){e===n.Eq?this.state=i.BeforeAttributeValue:e===n.Slash||e===n.Gt?(this.cbs.onattribend(a.NoValue,this.sectionStart),this.sectionStart=-1,this.state=i.BeforeAttributeName,this.stateBeforeAttributeName(e)):s(e)||(this.cbs.onattribend(a.NoValue,this.sectionStart),this.state=i.InAttributeName,this.sectionStart=this.index)},e.prototype.stateBeforeAttributeValue=function(e){e===n.DoubleQuote?(this.state=i.InAttributeValueDq,this.sectionStart=this.index+1):e===n.SingleQuote?(this.state=i.InAttributeValueSq,this.sectionStart=this.index+1):s(e)||(this.sectionStart=this.index,this.state=i.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))},e.prototype.handleInAttributeValue=function(e,t){e===t||!this.decodeEntities&&this.fastForwardTo(t)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(t===n.DoubleQuote?a.Double:a.Single,this.index+1),this.state=i.BeforeAttributeName):this.decodeEntities&&e===n.Amp&&this.startEntity()},e.prototype.stateInAttributeValueDoubleQuotes=function(e){this.handleInAttributeValue(e,n.DoubleQuote)},e.prototype.stateInAttributeValueSingleQuotes=function(e){this.handleInAttributeValue(e,n.SingleQuote)},e.prototype.stateInAttributeValueNoQuotes=function(e){s(e)||e===n.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(a.Unquoted,this.index),this.state=i.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===n.Amp&&this.startEntity()},e.prototype.stateBeforeDeclaration=function(e){e===n.OpeningSquareBracket?(this.state=i.CDATASequence,this.sequenceIndex=0):this.state=e===n.Dash?i.BeforeComment:i.InDeclaration},e.prototype.stateInDeclaration=function(e){(e===n.Gt||this.fastForwardTo(n.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=i.Text,this.sectionStart=this.index+1)},e.prototype.stateInProcessingInstruction=function(e){(e===n.Gt||this.fastForwardTo(n.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=i.Text,this.sectionStart=this.index+1)},e.prototype.stateBeforeComment=function(e){e===n.Dash?(this.state=i.InCommentLike,this.currentSequence=u.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=i.InDeclaration},e.prototype.stateInSpecialComment=function(e){(e===n.Gt||this.fastForwardTo(n.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=i.Text,this.sectionStart=this.index+1)},e.prototype.stateBeforeSpecialS=function(e){var t=32|e;t===u.ScriptEnd[3]?this.startSpecial(u.ScriptEnd,4):t===u.StyleEnd[3]?this.startSpecial(u.StyleEnd,4):(this.state=i.InTagName,this.stateInTagName(e))},e.prototype.stateBeforeSpecialT=function(e){var t=32|e;t===u.TitleEnd[3]?this.startSpecial(u.TitleEnd,4):t===u.TextareaEnd[3]?this.startSpecial(u.TextareaEnd,4):(this.state=i.InTagName,this.stateInTagName(e))},e.prototype.startEntity=function(){this.baseState=this.state,this.state=i.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?o.DecodingMode.Strict:this.baseState===i.Text||this.baseState===i.InSpecialTag?o.DecodingMode.Legacy:o.DecodingMode.Attribute)},e.prototype.stateInEntity=function(){var e=this.entityDecoder.write(this.buffer,this.index-this.offset);e>=0?(this.state=this.baseState,0===e&&(this.index=this.entityStart)):this.index=this.offset+this.buffer.length-1},e.prototype.cleanup=function(){this.running&&this.sectionStart!==this.index&&(this.state===i.Text||this.state===i.InSpecialTag&&0===this.sequenceIndex?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):this.state!==i.InAttributeValueDq&&this.state!==i.InAttributeValueSq&&this.state!==i.InAttributeValueNq||(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))},e.prototype.shouldContinue=function(){return this.index=e||(this.state===i.InCommentLike?this.currentSequence===u.CdataEnd?this.cbs.oncdata(this.sectionStart,e,0):this.cbs.oncomment(this.sectionStart,e,0):this.state===i.InTagName||this.state===i.BeforeAttributeName||this.state===i.BeforeAttributeValue||this.state===i.AfterAttributeName||this.state===i.InAttributeName||this.state===i.InAttributeValueSq||this.state===i.InAttributeValueDq||this.state===i.InAttributeValueNq||this.state===i.InClosingTagName||this.cbs.ontext(this.sectionStart,e))},e.prototype.emitCodePoint=function(e,t){this.baseState!==i.Text&&this.baseState!==i.InSpecialTag?(this.sectionStart{"use strict";const t=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),r=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),n=new Set([500,502,503,504]),i={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},a={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function o(e){const t=parseInt(e,10);return isFinite(t)?t:0}function s(e){const t={};if(!e)return t;const r=e.trim().split(/,/);for(const e of r){const[r,n]=e.split(/=/,2);t[r.trim()]=void 0===n||n.trim().replace(/^"|"$/g,"")}return t}function c(e){let t=[];for(const r in e){const n=e[r];t.push(!0===n?r:r+"="+n)}if(t.length)return t.join(", ")}e.exports=class{constructor(e,t,{shared:r,cacheHeuristic:n,immutableMinTimeToLive:i,ignoreCargoCult:a,_fromObject:o}={}){if(o)this._fromObject(o);else{if(!t||!t.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=!1!==r,this._ignoreCargoCult=!!a,this._cacheHeuristic=void 0!==n?n:.1,this._immutableMinTtl=void 0!==i?i:864e5,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=s(t.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=t.headers.vary?e.headers:null,this._reqcc=s(e.headers["cache-control"]),this._ignoreCargoCult&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":c(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),null==t.headers["cache-control"]&&/no-cache/.test(t.headers.pragma)&&(this._rescc["no-cache"]=!0)}}now(){return Date.now()}storable(){return!(this._reqcc["no-store"]||!("GET"===this._method||"HEAD"===this._method||"POST"===this._method&&this._hasExplicitExpiration())||!r.has(this._status)||this._rescc["no-store"]||this._isShared&&this._rescc.private||this._isShared&&!this._noAuthorization&&!this._allowsStoringAuthenticated()||!(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||t.has(this._status)))}_hasExplicitExpiration(){return!!(this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires)}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){return!this.evaluateRequest(e).revalidation}_evaluateRequestHitResult(e){return{response:{headers:this.responseHeaders()},revalidation:e}}_evaluateRequestRevalidation(e,t){return{synchronous:t,headers:this.revalidationHeaders(e)}}_evaluateRequestMissResult(e){return{response:void 0,revalidation:this._evaluateRequestRevalidation(e,!0)}}evaluateRequest(e){if(this._assertRequestHasHeaders(e),this._rescc["must-revalidate"])return this._evaluateRequestMissResult(e);if(!this._requestMatches(e,!1))return this._evaluateRequestMissResult(e);const t=s(e.headers["cache-control"]);return t["no-cache"]||/no-cache/.test(e.headers.pragma)||t["max-age"]&&this.age()>o(t["max-age"])||t["min-fresh"]&&this.maxAge()-this.age()this.age()-this.maxAge())?this._evaluateRequestHitResult(void 0):this.useStaleWhileRevalidate()?this._evaluateRequestHitResult(this._evaluateRequestRevalidation(e,!1)):this._evaluateRequestMissResult(e):this._evaluateRequestHitResult(void 0)}_requestMatches(e,t){return!(this._url&&this._url!==e.url||this._host!==e.headers.host||e.method&&this._method!==e.method&&(!t||"HEAD"!==e.method)||!this._varyMatches(e))}_allowsStoringAuthenticated(){return!!(this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"])}_varyMatches(e){if(!this._resHeaders.vary)return!0;if("*"===this._resHeaders.vary)return!1;const t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(const r of t)if(e.headers[r]!==this._reqHeaders[r])return!1;return!0}_copyWithoutHopByHopHeaders(e){const t={};for(const r in e)i[r]||(t[r]=e[r]);if(e.connection){const r=e.connection.trim().split(/\s*,\s*/);for(const e of r)delete t[e]}if(t.warning){const e=t.warning.split(/,/).filter((e=>!/^\s*1[0-9][0-9]/.test(e)));e.length?t.warning=e.join(",").trim():delete t.warning}return t}responseHeaders(){const e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>86400&&!this._hasExplicitExpiration()&&this.maxAge()>86400&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,e.date=new Date(this.now()).toUTCString(),e}date(){const e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){return this._ageValue()+(this.now()-this._responseTime)/1e3}_ageValue(){return o(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"])return 0;if(this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable)return 0;if("*"===this._resHeaders.vary)return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return o(this._rescc["s-maxage"])}if(this._rescc["max-age"])return o(this._rescc["max-age"]);const e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){const r=Date.parse(this._resHeaders.expires);return Number.isNaN(r)||rr)return Math.max(e,(t-r)/1e3*this._cacheHeuristic)}return e}timeToLive(){const e=this.maxAge()-this.age(),t=e+o(this._rescc["stale-if-error"]),r=e+o(this._rescc["stale-while-revalidate"]);return Math.round(1e3*Math.max(0,e,t,r))}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+o(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){const e=o(this._rescc["stale-while-revalidate"]);return e>0&&this.maxAge()+e>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||1!==e.v)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=void 0!==e.imm?e.imm:864e5,this._ignoreCargoCult=!!e.icc,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,icc:this._ignoreCargoCult,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);const t=this._copyWithoutHopByHopHeaders(e.headers);if(delete t["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete t["if-none-match"],delete t["if-modified-since"],t;if(this._resHeaders.etag&&(t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&"GET"!=this._method){if(delete t["if-modified-since"],t["if-none-match"]){const e=t["if-none-match"].split(/,/).filter((e=>!/^\s*W\//.test(e)));e.length?t["if-none-match"]=e.join(",").trim():delete t["if-none-match"]}}else this._resHeaders["last-modified"]&&!t["if-modified-since"]&&(t["if-modified-since"]=this._resHeaders["last-modified"]);return t}revalidatedPolicy(e,t){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&function(e){return!e||n.has(e.status)}(t))return{policy:this,modified:!1,matches:!0};if(!t||!t.headers)throw Error("Response headers missing");let r=!1;void 0!==t.status&&304!=t.status?r=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?r=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?r=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?r=this._resHeaders["last-modified"]===t.headers["last-modified"]:this._resHeaders.etag||this._resHeaders["last-modified"]||t.headers.etag||t.headers["last-modified"]||(r=!0);const i={shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl,ignoreCargoCult:this._ignoreCargoCult};if(!r)return{policy:new this.constructor(e,t,i),modified:304!=t.status,matches:!1};const o={};for(const e in this._resHeaders)o[e]=e in t.headers&&!a[e]?t.headers[e]:this._resHeaders[e];const s=Object.assign({},t,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(e,s,i),modified:!1,matches:!0}}}},75441:e=>{"use strict";var t=/^utf-?8|ascii|utf-?16-?le|ucs-?2|base-?64|latin-?1$/i,r=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,n=/\s|\uFEFF|\xA0/,i=/\r?\n[\x20\x09]+/g,a=/[;,"]/,o=/[;,"]|\s/,s=/^[!#$%&'*+\-\.^_`|~\da-zA-Z]+$/;function c(e){return e.replace(r,"")}function u(e){return n.test(e)}function l(e,t){for(;u(e[t]);)t++;return t}function d(e){return o.test(e)||!s.test(e)}class p{constructor(e){this.refs=[],e&&this.parse(e)}rel(e){for(var t=[],r=e.toLowerCase(),n=0;n{return r=t,n=e,Object.keys(r).length===Object.keys(n).length&&Object.keys(r).every((e=>e in n&&r[e]===n[e]));var r,n}))||this.refs.push(e),this}has(e,t){e=e.toLowerCase(),t=t.toLowerCase();for(var r=0;r",t)))throw new Error("Expected end of URI delimiter at offset "+t);o={uri:e.slice(t+1,h)},t=h,r=2,t++}else if(2===r){if(u(e[t])){t++;continue}if(";"===e[t])r=4,t++;else{if(","!==e[t])throw new Error('Unexpected character "'+e[t]+'" at offset '+t);r=1,t++}}else{if(4!==r)throw new Error('Unknown parser state "'+r+'"');if(";"===e[t]||u(e[t])){t++;continue}-1===(h=e.indexOf("=",t))&&(h=e.indexOf(";",t)),-1===h&&(h=e.length);var s=c(e.slice(t,h)).toLowerCase(),d="";if('"'===e[t=l(e,t=h+1)])for(t++;t"),e.push(t);return e.join(", ")}}p.isCompatibleEncoding=function(e){return t.test(e)},p.parse=function(e,t){return(new p).parse(e,t)},p.isSingleOccurenceAttr=function(e){return"rel"===e||"type"===e||"media"===e||"title"===e||"title*"===e},p.isTokenAttr=function(e){return"rel"===e||"type"===e||"anchor"===e},p.escapeQuotes=function(e){return e.replace(/"/g,'\\"')},p.expandRelations=function(e){return e.rel.split(" ").map((function(t){var r=Object.assign({},e);return r.rel=t,r}))},p.parseExtendedValue=function(e){var t=/([^']+)?(?:'([^']*)')?(.+)/.exec(e);return{language:t[2].toLowerCase(),encoding:p.isCompatibleEncoding(t[1])?null:t[1].toLowerCase(),value:p.isCompatibleEncoding(t[1])?decodeURIComponent(t[3]):t[3]}},p.formatExtendedAttribute=function(e,t){var r=(t.encoding||"utf-8").toUpperCase();return e+"="+r+"'"+(t.language||"en")+"'"+(Buffer.isBuffer(t.value)&&p.isCompatibleEncoding(r)?t.value.toString(r):Buffer.isBuffer(t.value)?t.value.toString("hex").replace(/[0-9a-f]{2}/gi,"%$1"):encodeURIComponent(t.value))},p.formatAttribute=function(e,t){return Array.isArray(t)?t.map((t=>p.formatAttribute(e,t))).join("; "):"*"===e[e.length-1]||"string"!=typeof t?p.formatExtendedAttribute(e,t):(p.isTokenAttr(e)?t=d(t)?'"'+p.escapeQuotes(t)+'"':p.escapeQuotes(t):d(t)&&(t='"'+(t=(t=encodeURIComponent(t)).replace(/%20/g," ").replace(/%2C/g,",").replace(/%3B/g,";"))+'"'),e+"="+t)},e.exports=p},39318:(e,t)=>{t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,c=(1<>1,l=-7,d=r?i-1:0,p=r?-1:1,h=e[t+d];for(d+=p,a=h&(1<<-l)-1,h>>=-l,l+=s;l>0;a=256*a+e[t+d],d+=p,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+d],d+=p,l-=8);if(0===a)a=1-u;else{if(a===c)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),a-=u}return(h?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,c,u=8*a-i-1,l=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,f=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?p/c:p*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=l?(s=0,o=l):o+d>=1?(s=(t*c-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[r+h]=255&s,h+=f,s/=256,i-=8);for(o=o<0;e[r+h]=255&o,h+=f,o/=256,u-=8);e[r+h-f]|=128*y}},6081:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Collection:()=>l,Iterable:()=>In,List:()=>cr,Map:()=>It,OrderedMap:()=>Or,OrderedSet:()=>ln,PairSorting:()=>yn,Range:()=>qr,Record:()=>mn,Repeat:()=>wn,Seq:()=>J,Set:()=>Gr,Stack:()=>Ir,fromJS:()=>Sn,get:()=>Zt,getIn:()=>Wr,has:()=>Yt,hasIn:()=>Yr,hash:()=>fe,is:()=>Ye,isAssociative:()=>s,isCollection:()=>u,isImmutable:()=>G,isIndexed:()=>i,isKeyed:()=>o,isList:()=>sr,isMap:()=>Et,isOrdered:()=>H,isOrderedMap:()=>_r,isOrderedSet:()=>un,isPlainObject:()=>it,isRecord:()=>$,isSeq:()=>K,isSet:()=>$r,isStack:()=>xr,isValueObject:()=>Je,merge:()=>ct,mergeDeep:()=>lt,mergeDeepWith:()=>dt,mergeWith:()=>ut,remove:()=>er,removeIn:()=>ir,set:()=>tr,setIn:()=>bt,update:()=>Ze,updateIn:()=>rr,version:()=>xn});var n="@@__IMMUTABLE_INDEXED__@@";function i(e){return Boolean(e&&e[n])}var a="@@__IMMUTABLE_KEYED__@@";function o(e){return Boolean(e&&e[a])}function s(e){return o(e)||i(e)}var c="@@__IMMUTABLE_ITERABLE__@@";function u(e){return Boolean(e&&e[c])}var l=function(e){return u(e)?e:J(e)},d=function(e){function t(e){return o(e)?e:Y(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(l),p=function(e){function t(e){return i(e)?e:Z(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(l),h=function(e){function t(e){return u(e)&&!s(e)?e:ee(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(l);l.Keyed=d,l.Indexed=p,l.Set=h;var f=0,y=1,m=2,g="function"==typeof Symbol&&Symbol.iterator,b="@@iterator",v=g||b,_=function(e){this.next=e};function T(e,t,r,n){var i=e===f?t:e===y?r:[t,r];return n?n.value=i:n={value:i,done:!1},n}function O(){return{value:void 0,done:!0}}function w(e){return!!Array.isArray(e)||!!A(e)}function S(e){return!(!e||"function"!=typeof e.next)}function E(e){var t=A(e);return t&&t.call(e)}function A(e){var t=e&&(g&&e[g]||e[b]);if("function"==typeof t)return t}_.prototype.toString=function(){return"[Iterator]"},_.KEYS=f,_.VALUES=y,_.ENTRIES=m,_.prototype.inspect=_.prototype.toSource=function(){return this.toString()},_.prototype[v]=function(){return this};var x="delete",I=5,P=1<>>0;if(""+r!==t||4294967295===r)return NaN;t=r}return t<0?D(e)+t:t}function M(){return!0}function C(e,t,r){return(0===e&&!q(e)||void 0!==r&&e<=-r)&&(void 0===t||void 0!==r&&t>=r)}function k(e,t){return B(e,t,0)}function U(e,t){return B(e,t,t)}function B(e,t,r){return void 0===e?r:q(e)?t===1/0?t:0|Math.max(0,t+e):void 0===t||t===e?e:0|Math.min(t,e)}function q(e){return e<0||0===e&&1/e==-1/0}var V="@@__IMMUTABLE_RECORD__@@";function $(e){return Boolean(e&&e[V])}function G(e){return u(e)||$(e)}var Q="@@__IMMUTABLE_ORDERED__@@";function H(e){return Boolean(e&&e[Q])}var z="@@__IMMUTABLE_SEQ__@@";function K(e){return Boolean(e&&e[z])}var X=Object.prototype.hasOwnProperty;function W(e){return!(!Array.isArray(e)&&"string"!=typeof e)||e&&"object"==typeof e&&Number.isInteger(e.length)&&e.length>=0&&(0===e.length?1===Object.keys(e).length:e.hasOwnProperty(e.length-1))}var J=function(e){function t(e){return null==e?ae():G(e)?e.toSeq():function(e){var t,r,n=ce(e);if(n)return(r=A(t=e))&&r===t.entries?n.fromEntrySeq():function(e){var t=A(e);return t&&t===e.keys}(e)?n.toSetSeq():n;if("object"==typeof e)return new re(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(e,t){var r=this._cache;if(r){for(var n=r.length,i=0;i!==n;){var a=r[t?n-++i:i++];if(!1===e(a[1],a[0],this))break}return i}return this.__iterateUncached(e,t)},t.prototype.__iterator=function(e,t){var r=this._cache;if(r){var n=r.length,i=0;return new _((function(){if(i===n)return{value:void 0,done:!0};var a=r[t?n-++i:i++];return T(e,a[0],a[1])}))}return this.__iteratorUncached(e,t)},t}(l),Y=function(e){function t(e){return null==e?ae().toKeyedSeq():u(e)?o(e)?e.toSeq():e.fromEntrySeq():$(e)?e.toSeq():oe(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(J),Z=function(e){function t(e){return null==e?ae():u(e)?o(e)?e.entrySeq():e.toIndexedSeq():$(e)?e.toSeq().entrySeq():se(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(J),ee=function(e){function t(e){return(u(e)&&!s(e)?e:Z(e)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(J);J.isSeq=K,J.Keyed=Y,J.Set=ee,J.Indexed=Z,J.prototype[z]=!0;var te=function(e){function t(e){this._array=e,this.size=e.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this.has(e)?this._array[F(this,e)]:t},t.prototype.__iterate=function(e,t){for(var r=this._array,n=r.length,i=0;i!==n;){var a=t?n-++i:i++;if(!1===e(r[a],a,this))break}return i},t.prototype.__iterator=function(e,t){var r=this._array,n=r.length,i=0;return new _((function(){if(i===n)return{value:void 0,done:!0};var a=t?n-++i:i++;return T(e,a,r[a])}))},t}(Z),re=function(e){function t(e){var t=Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]);this._object=e,this._keys=t,this.size=t.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},t.prototype.has=function(e){return X.call(this._object,e)},t.prototype.__iterate=function(e,t){for(var r=this._object,n=this._keys,i=n.length,a=0;a!==i;){var o=n[t?i-++a:a++];if(!1===e(r[o],o,this))break}return a},t.prototype.__iterator=function(e,t){var r=this._object,n=this._keys,i=n.length,a=0;return new _((function(){if(a===i)return{value:void 0,done:!0};var o=n[t?i-++a:a++];return T(e,o,r[o])}))},t}(Y);re.prototype[Q]=!0;var ne,ie=function(e){function t(e){this._collection=e,this.size=e.length||e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var r=E(this._collection),n=0;if(S(r))for(var i;!(i=r.next()).done&&!1!==e(i.value,n++,this););return n},t.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=E(this._collection);if(!S(r))return new _(O);var n=0;return new _((function(){var t=r.next();return t.done?t:T(e,n++,t.value)}))},t}(Z);function ae(){return ne||(ne=new te([]))}function oe(e){var t=ce(e);if(t)return t.fromEntrySeq();if("object"==typeof e)return new re(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function se(e){var t=ce(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function ce(e){return W(e)?new te(e):w(e)?new ie(e):void 0}function ue(){return this.__ensureOwner()}function le(){return this.__ownerID?this:this.__ensureOwner(new L)}var de="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var r=65535&(e|=0),n=65535&(t|=0);return r*n+((e>>>16)*n+r*(t>>>16)<<16>>>0)|0};function pe(e){return e>>>1&1073741824|3221225471&e}var he=Object.prototype.valueOf;function fe(e){if(null==e)return ye(e);if("function"==typeof e.hashCode)return pe(e.hashCode(e));var t,r,n,i=(t=e).valueOf!==he&&"function"==typeof t.valueOf?t.valueOf(t):t;if(null==i)return ye(i);switch(typeof i){case"boolean":return i?1108378657:1108378656;case"number":return function(e){if(e!=e||e===1/0)return 0;var t=0|e;for(t!==e&&(t^=4294967295*e);e>4294967295;)t^=e/=4294967295;return pe(t)}(i);case"string":return i.length>Ee?(void 0===(n=Ie[r=i])&&(n=me(r),xe===Ae&&(xe=0,Ie={}),xe++,Ie[r]=n),n):me(i);case"object":case"function":return function(e){var t;if(Te&&void 0!==(t=_e.get(e)))return t;if(void 0!==(t=e[Se]))return t;if(!be){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Se]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=ve(),Te)_e.set(e,t);else{if(void 0!==ge&&!1===ge(e))throw new Error("Non-extensible objects are not allowed as keys.");if(be)Object.defineProperty(e,Se,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Se]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Se]=t}}return t}(i);case"symbol":return function(e){var t=Oe[e];return void 0!==t||(t=ve(),Oe[e]=t),t}(i);default:if("function"==typeof i.toString)return me(i.toString());throw new Error("Value type "+typeof i+" cannot be hashed.")}}function ye(e){return null===e?1108378658:1108378659}function me(e){for(var t=0,r=0;r=0&&(c.get=function(t,r){return(t=F(this,t))>=0&&ta)return{value:void 0,done:!0};var e=i.next();return n||t===y||e.done?e:T(t,c-1,t===f?void 0:e.value[1],e)}))},c}function ke(e,t,r,n){var i=Ke(e);return i.__iterateUncached=function(i,a){var o=this;if(a)return this.cacheResult().__iterate(i,a);var s=!0,c=0;return e.__iterate((function(e,a,u){if(!s||!(s=t.call(r,e,a,u)))return c++,i(e,n?a:c-1,o)})),c},i.__iteratorUncached=function(i,a){var o=this;if(a)return this.cacheResult().__iterator(i,a);var s=e.__iterator(m,a),c=!0,u=0;return new _((function(){var e,a,l;do{if((e=s.next()).done)return n||i===y?e:T(i,u++,i===f?void 0:e.value[1],e);var d=e.value;a=d[0],l=d[1],c&&(c=t.call(r,l,a,o))}while(c);return i===m?e:T(i,a,l,e)}))},i}Re.prototype.cacheResult=Pe.prototype.cacheResult=Ne.prototype.cacheResult=je.prototype.cacheResult=Xe;var Ue=function(e){function t(e){this._wrappedIterables=e.flatMap((function(e){return e._wrappedIterables?e._wrappedIterables:[e]})),this.size=this._wrappedIterables.reduce((function(e,t){if(void 0!==e){var r=t.size;if(void 0!==r)return e+r}}),0),this[a]=this._wrappedIterables[0][a],this[n]=this._wrappedIterables[0][n],this[Q]=this._wrappedIterables[0][Q]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(e,t){if(0!==this._wrappedIterables.length){if(t)return this.cacheResult().__iterate(e,t);for(var r=0,n=o(this),i=n?m:y,a=this._wrappedIterables[r].__iterator(i,t),s=!0,c=0;s;){for(var u=a.next();u.done;){if(++r===this._wrappedIterables.length)return c;u=(a=this._wrappedIterables[r].__iterator(i,t)).next()}s=!1!==(n?e(u.value[1],u.value[0],this):e(u.value,c,this)),c++}return c}},t.prototype.__iteratorUncached=function(e,t){var r=this;if(0===this._wrappedIterables.length)return new _(O);if(t)return this.cacheResult().__iterator(e,t);var n=0,i=this._wrappedIterables[n].__iterator(e,t);return new _((function(){for(var a=i.next();a.done;){if(++n===r._wrappedIterables.length)return a;a=(i=r._wrappedIterables[n].__iterator(e,t)).next()}return a}))},t}(J);function Be(e,t,r){var n=Ke(e);return n.__iterateUncached=function(i,a){if(a)return this.cacheResult().__iterate(i,a);var o=0,s=!1;return function e(c,l){c.__iterate((function(a,c){return(!t||l0}function Ge(e,t,r,n){var i=Ke(e),a=new te(r).map((function(e){return e.size}));return i.size=n?a.max():a.min(),i.__iterate=function(e,t){for(var r,n=this.__iterator(y,t),i=0;!(r=n.next()).done&&!1!==e(r.value,i++,this););return i},i.__iteratorUncached=function(e,i){var a=r.map((function(e){return e=l(e),E(i?e.reverse():e)})),o=0,s=!1;return new _((function(){var r;return s||(r=a.map((function(e){return e.next()})),s=n?r.every((function(e){return e.done})):r.some((function(e){return e.done}))),s?{value:void 0,done:!0}:T(e,o++,t.apply(null,r.map((function(e){return e.value}))))}))},i}function Qe(e,t){return e===t?e:K(e)?t:e.constructor(t)}function He(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function ze(e){return o(e)?d:i(e)?p:h}function Ke(e){return Object.create((o(e)?Y:i(e)?Z:ee).prototype)}function Xe(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):J.prototype.cacheResult.call(this)}function We(e,t){return void 0===e&&void 0===t?0:void 0===e?1:void 0===t?-1:e>t?1:e0;)t[r]=arguments[r+1];if("function"!=typeof e)throw new TypeError("Invalid merger function: "+e);return rt(this,t,e)}function rt(e,t,r){for(var n=[],i=0;i0;)t[r]=arguments[r+1];return ht(e,t)}function ut(e,t){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return ht(t,r,e)}function lt(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return pt(e,t)}function dt(e,t){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return pt(t,r,e)}function pt(e,t,r){return ht(e,t,function(e){return function t(r,n,a){return at(r)&&at(n)&&(s=n,c=J(r),u=J(s),i(c)===i(u)&&o(c)===o(u))?ht(r,[n],t):e?e(r,n,a):n;var s,c,u}}(r))}function ht(e,t,r){if(!at(e))throw new TypeError("Cannot merge into non-data-structure value: "+e);if(G(e))return"function"==typeof r&&e.mergeWith?e.mergeWith.apply(e,[r].concat(t)):e.merge?e.merge.apply(e,t):e.concat.apply(e,t);for(var n=Array.isArray(e),i=e,a=n?p:d,o=n?function(t){i===e&&(i=st(i)),i.push(t)}:function(t,n){var a=X.call(i,n),o=a&&r?r(i[n],t,n):t;a&&o===i[n]||(i===e&&(i=st(i)),i[n]=o)},s=0;s0;)t[r]=arguments[r+1];return pt(this,t,e)}function mt(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return rr(this,e,Bt(),(function(e){return pt(e,t)}))}function gt(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return rr(this,e,Bt(),(function(e){return ht(e,t)}))}function bt(e,t,r){return rr(e,t,N,(function(){return r}))}function vt(e,t){return bt(this,e,t)}function _t(e,t,r){return 1===arguments.length?e(this):Ze(this,e,t,r)}function Tt(e,t,r){return rr(this,e,t,r)}function Ot(){return this.__altered}function wt(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}var St="@@__IMMUTABLE_MAP__@@";function Et(e){return Boolean(e&&e[St])}function At(e,t){if(!e)throw new Error(t)}function xt(e){At(e!==1/0,"Cannot perform this action with an infinite size.")}var It=function(e){function t(t){return null==t?Bt():Et(t)&&!H(t)?t:Bt().withMutations((function(r){var n=e(t);xt(n.size),n.forEach((function(e,t){return r.set(t,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},t.prototype.set=function(e,t){return qt(this,e,t)},t.prototype.remove=function(e){return qt(this,e,N)},t.prototype.deleteAll=function(e){var t=l(e);return 0===t.size?this:this.withMutations((function(e){t.forEach((function(t){return e.remove(t)}))}))},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Bt()},t.prototype.sort=function(e){return Or(qe(this,e))},t.prototype.sortBy=function(e,t){return Or(qe(this,t,e))},t.prototype.map=function(e,t){var r=this;return this.withMutations((function(n){n.forEach((function(i,a){n.set(a,e.call(t,i,a,r))}))}))},t.prototype.__iterator=function(e,t){return new Mt(this,e,t)},t.prototype.__iterate=function(e,t){var r=this,n=0;return this._root&&this._root.iterate((function(t){return n++,e(t[1],t[0],r)}),t),n},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ut(this.size,this._root,e,this.__hash):0===this.size?Bt():(this.__ownerID=e,this.__altered=!1,this)},t}(d);It.isMap=Et;var Pt=It.prototype;Pt[St]=!0,Pt[x]=Pt.remove,Pt.removeAll=Pt.deleteAll,Pt.setIn=vt,Pt.removeIn=Pt.deleteIn=ar,Pt.update=_t,Pt.updateIn=Tt,Pt.merge=Pt.concat=et,Pt.mergeWith=tt,Pt.mergeDeep=ft,Pt.mergeDeepWith=yt,Pt.mergeIn=gt,Pt.mergeDeepIn=mt,Pt.withMutations=wt,Pt.wasAltered=Ot,Pt.asImmutable=ue,Pt["@@transducer/init"]=Pt.asMutable=le,Pt["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])},Pt["@@transducer/result"]=function(e){return e.asImmutable()};var Rt=function(e,t){this.ownerID=e,this.entries=t};Rt.prototype.get=function(e,t,r,n){for(var i=this.entries,a=0,o=i.length;a=zt)return function(e,t,r,n){e||(e=new L);for(var i=new Dt(e,fe(r),[r,n]),a=0;a>>e)&R),a=this.bitmap;return a&i?this.nodes[Qt(a&i-1)].get(e+I,t,r,n):n},Nt.prototype.update=function(e,t,r,n,i,a,o){void 0===r&&(r=fe(n));var s=(0===t?r:r>>>t)&R,c=1<=Kt)return function(e,t,r,n,i){for(var a=0,o=new Array(P),s=0;0!==r;s++,r>>>=1)o[s]=1&r?t[a++]:void 0;return o[n]=i,new jt(e,a+1,o)}(e,p,u,s,f);if(l&&!f&&2===p.length&&$t(p[1^d]))return p[1^d];if(l&&f&&1===p.length&&$t(f))return f;var y=e&&e===this.ownerID,m=l?f?u:u^c:u|c,g=l?f?Ht(p,d,f,y):function(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var i=new Array(n),a=0,o=0;o>>e)&R,a=this.nodes[i];return a?a.get(e+I,t,r,n):n},jt.prototype.update=function(e,t,r,n,i,a,o){void 0===r&&(r=fe(n));var s=(0===t?r:r>>>t)&R,c=i===N,u=this.nodes,l=u[s];if(c&&!l)return this;var d=Vt(l,e,t+I,r,n,i,a,o);if(d===l)return this;var p=this.count;if(l){if(!d&&--p>>r)&R,s=(0===r?n:n>>>r)&R,c=o===s?[Gt(e,t,r+I,n,i)]:(a=new Dt(t,n,i),o>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,127&(e+=e>>8)+(e>>16)}function Ht(e,t,r,n){var i=n?e:ot(e);return i[t]=r,i}var zt=P/4,Kt=P/2,Xt=P/4;function Wt(e){if(W(e)&&"string"!=typeof e)return e;if(H(e))return e.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+e)}function Jt(e){try{return"string"==typeof e?JSON.stringify(e):String(e)}catch(t){return JSON.stringify(e)}}function Yt(e,t){return G(e)?e.has(t):at(e)&&X.call(e,t)}function Zt(e,t,r){return G(e)?e.get(t,r):Yt(e,t)?"function"==typeof e.get?e.get(t):e[t]:r}function er(e,t){if(!at(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(G(e)){if(!e.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+e);return e.remove(t)}if(!X.call(e,t))return e;var r=st(e);return Array.isArray(r)?r.splice(t,1):delete r[t],r}function tr(e,t,r){if(!at(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(G(e)){if(!e.set)throw new TypeError("Cannot update immutable value without .set() method: "+e);return e.set(t,r)}if(X.call(e,t)&&r===e[t])return e;var n=st(e);return n[t]=r,n}function rr(e,t,r,n){n||(n=r,r=void 0);var i=nr(G(e),e,Wt(t),0,r,n);return i===N?r:i}function nr(e,t,r,n,i,a){var o=t===N;if(n===r.length){var s=o?i:t,c=a(s);return c===s?t:c}if(!o&&!at(t))throw new TypeError("Cannot update within non-data-structure value in path ["+Array.from(r).slice(0,n).map(Jt)+"]: "+t);var u=r[n],l=o?N:Zt(t,u,N),d=nr(l===N?e:G(l),l,r,n+1,i,a);return d===l?t:d===N?er(t,u):tr(o?e?Bt():{}:t,u,d)}function ir(e,t){return rr(e,t,(function(){return N}))}function ar(e){return ir(this,e)}var or="@@__IMMUTABLE_LIST__@@";function sr(e){return Boolean(e&&e[or])}var cr=function(e){function t(t){var r=fr();if(null==t)return r;if(sr(t))return t;var n=e(t),i=n.size;return 0===i?r:(xt(i),i>0&&i=0&&e=e.size||t<0)return e.withMutations((function(e){t<0?br(e,t).set(0,r):br(e,0,t+1).set(t,r)}));t+=e._origin;var n=e._tail,i=e._root,a={value:!1};return t>=vr(e._capacity)?n=yr(n,e.__ownerID,0,t,r,a):i=yr(i,e.__ownerID,e._level,t,r,a),a.value?e.__ownerID?(e._root=i,e._tail=n,e.__hash=void 0,e.__altered=!0,e):hr(e._origin,e._capacity,e._level,i,n):e}(this,e,t)},t.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},t.prototype.insert=function(e,t){return this.splice(e,0,t)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=I,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):fr()},t.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(r){br(r,0,t+e.length);for(var n=0;n>>t&R;if(n>=this.array.length)return new lr([],e);var i,a=0===n;if(t>0){var o=this.array[n];if((i=o&&o.removeBefore(e,t-I,r))===o&&a)return this}if(a&&!i)return this;var s=mr(this,e);if(!a)for(var c=0;c>>t&R;if(i>=this.array.length)return this;if(t>0){var a=this.array[i];if((n=a&&a.removeAfter(e,t-I,r))===a&&i===this.array.length-1)return this}var o=mr(this,e);return o.array.splice(i+1),n&&(o.array[i]=n),o};var dr={};function pr(e,t){var r=e._origin,n=e._capacity,i=vr(n),a=e._tail;return function e(o,s,c){return 0===s?function(e,o){var s=o===i?a&&a.array:e&&e.array,c=o>r?0:r-o,u=n-o;return u>P&&(u=P),function(){if(c===u)return dr;var e=t?--u:c++;return s&&s[e]}}(o,c):function(i,a,o){var s,c=i&&i.array,u=o>r?0:r-o>>a,l=1+(n-o>>a);return l>P&&(l=P),function(){for(;;){if(s){var r=s();if(r!==dr)return r;s=null}if(u===l)return dr;var n=t?--l:u++;s=e(c&&c[n],a-I,o+(n<>>r&R,c=e&&s0){var u=e&&e.array[s],l=yr(u,t,r-I,n,i,a);return l===u?e:((o=mr(e,t)).array[s]=l,o)}return c&&e.array[s]===i?e:(a&&j(a),o=mr(e,t),void 0===i&&s===o.array.length-1?o.array.pop():o.array[s]=i,o)}function mr(e,t){return t&&e&&t===e.ownerID?e:new lr(e?e.array.slice():[],t)}function gr(e,t){if(t>=vr(e._capacity))return e._tail;if(t<1<0;)r=r.array[t>>>n&R],n-=I;return r}}function br(e,t,r){void 0!==t&&(t|=0),void 0!==r&&(r|=0);var n=e.__ownerID||new L,i=e._origin,a=e._capacity,o=i+t,s=void 0===r?a:r<0?a+r:i+r;if(o===i&&s===a)return e;if(o>=s)return e.clear();for(var c=e._level,u=e._root,l=0;o+l<0;)u=new lr(u&&u.array.length?[void 0,u]:[],n),l+=1<<(c+=I);l&&(o+=l,i+=l,s+=l,a+=l);for(var d=vr(a),p=vr(s);p>=1<d?new lr([],n):h;if(h&&p>d&&oI;m-=I){var g=d>>>m&R;y=y.array[g]=mr(y.array[g],n)}y.array[d>>>I&R]=h}if(s=p)o-=p,s-=p,c=I,u=null,f=f&&f.removeBefore(n,0,o);else if(o>i||p>>c&R;if(b!==p>>>c&R)break;b&&(l+=(1<i&&(u=u.removeBefore(n,c,o-l)),u&&p>>I<=P&&o.size>=2*a.size?(n=(i=o.filter((function(e,t){return void 0!==e&&s!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(n.__ownerID=i.__ownerID=e.__ownerID)):(n=a.remove(t),i=s===o.size-1?o.pop():o.set(s,void 0))}else if(c){if(r===o.get(s)[1])return e;n=a,i=o.set(s,[t,r])}else n=a.set(t,o.size),i=o.set(o.size,[t,r]);return e.__ownerID?(e.size=n.size,e._map=n,e._list=i,e.__hash=void 0,e.__altered=!0,e):wr(n,i)}Or.isOrderedMap=_r,Or.prototype[Q]=!0,Or.prototype[x]=Or.prototype.remove;var Ar="@@__IMMUTABLE_STACK__@@";function xr(e){return Boolean(e&&e[Ar])}var Ir=function(e){function t(e){return null==e?jr():xr(e)?e:jr().pushAll(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(e,t){var r=this._head;for(e=F(this,e);r&&e--;)r=r.next;return r?r.value:t},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var e=arguments;if(0===arguments.length)return this;for(var t=this.size+arguments.length,r=this._head,n=arguments.length-1;n>=0;n--)r={value:e[n],next:r};return this.__ownerID?(this.size=t,this._head=r,this.__hash=void 0,this.__altered=!0,this):Nr(t,r)},t.prototype.pushAll=function(t){if(0===(t=e(t)).size)return this;if(0===this.size&&xr(t))return t;xt(t.size);var r=this.size,n=this._head;return t.__iterate((function(e){r++,n={value:e,next:n}}),!0),this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):Nr(r,n)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):jr()},t.prototype.slice=function(t,r){if(C(t,r,this.size))return this;var n=k(t,this.size);if(U(r,this.size)!==this.size)return e.prototype.slice.call(this,t,r);for(var i=this.size-n,a=this._head;n--;)a=a.next;return this.__ownerID?(this.size=i,this._head=a,this.__hash=void 0,this.__altered=!0,this):Nr(i,a)},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Nr(this.size,this._head,e,this.__hash):0===this.size?jr():(this.__ownerID=e,this.__altered=!1,this)},t.prototype.__iterate=function(e,t){var r=this;if(t)return new te(this.toArray()).__iterate((function(t,n){return e(t,n,r)}),t);for(var n=0,i=this._head;i&&!1!==e(i.value,n++,this);)i=i.next;return n},t.prototype.__iterator=function(e,t){if(t)return new te(this.toArray()).__iterator(e,t);var r=0,n=this._head;return new _((function(){if(n){var t=n.value;return n=n.next,T(e,r++,t)}return{value:void 0,done:!0}}))},t}(p);Ir.isStack=xr;var Pr,Rr=Ir.prototype;function Nr(e,t,r,n){var i=Object.create(Rr);return i.size=e,i._head=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function jr(){return Pr||(Pr=Nr(0))}function Lr(e,t,r,n,i,a){return xt(e.size),e.__iterate((function(e,a,o){i?(i=!1,r=e):r=t.call(n,r,e,a,o)}),a),r}function Dr(e,t){return t}function Fr(e,t){return[t,e]}function Mr(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return!e.apply(this,t)}}function Cr(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return-e.apply(this,t)}}function kr(e,t){return et?-1:0}function Ur(e,t){if(e===t)return!0;if(!u(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||o(e)!==o(t)||i(e)!==i(t)||H(e)!==H(t))return!1;if(0===e.size&&0===t.size)return!0;var r=!s(e);if(H(e)){var n=e.entries();return t.every((function(e,t){var i=n.next().value;return i&&Ye(i[1],e)&&(r||Ye(i[0],t))}))&&n.next().done}var a=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{a=!0;var c=e;e=t,t=c}var l=!0,d=t.__iterate((function(t,n){if(r?!e.has(t):a?!Ye(t,e.get(n,N)):!Ye(e.get(n,N),t))return l=!1,!1}));return l&&e.size===d}Rr[Ar]=!0,Rr.shift=Rr.pop,Rr.unshift=Rr.push,Rr.unshiftAll=Rr.pushAll,Rr.withMutations=wt,Rr.wasAltered=Ot,Rr.asImmutable=ue,Rr["@@transducer/init"]=Rr.asMutable=le,Rr["@@transducer/step"]=function(e,t){return e.unshift(t)},Rr["@@transducer/result"]=function(e){return e.asImmutable()};var Br,qr=function(e){function t(e,r,n){if(void 0===n&&(n=1),!(this instanceof t))return new t(e,r,n);if(At(0!==n,"Cannot step a Range by 0"),At(void 0!==e,"You must define a start value when using Range"),At(void 0!==r,"You must define an end value when using Range"),n=Math.abs(n),r=0&&t=0&&r>2)}function rn(e,t){var r=function(r){e.prototype[r]=t[r]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}Hr[Vr]=!0,Hr[x]=Hr.remove,Hr.merge=Hr.concat=Hr.union,Hr.withMutations=wt,Hr.asImmutable=ue,Hr["@@transducer/init"]=Hr.asMutable=le,Hr["@@transducer/step"]=function(e,t){return e.add(t)},Hr["@@transducer/result"]=function(e){return e.asImmutable()},Hr.__empty=Xr,Hr.__make=Kr,l.Iterator=_,rn(l,{toArray:function(){xt(this.size);var e=new Array(this.size||0),t=o(this),r=0;return this.__iterate((function(n,i){e[r++]=t?[i,n]:n})),e},toIndexedSeq:function(){return new Re(this)},toJS:function(){return en(this)},toKeyedSeq:function(){return new Pe(this,!0)},toMap:function(){return It(this.toKeyedSeq())},toObject:Zr,toOrderedMap:function(){return Or(this.toKeyedSeq())},toOrderedSet:function(){return ln(o(this)?this.valueSeq():this)},toSet:function(){return Gr(o(this)?this.valueSeq():this)},toSetSeq:function(){return new Ne(this)},toSeq:function(){return i(this)?this.toIndexedSeq():o(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Ir(o(this)?this.valueSeq():this)},toList:function(){return cr(o(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Qe(this,function(e,t){var r=o(e),n=[e].concat(t).map((function(e){return u(e)?r&&(e=d(e)):e=r?oe(e):se(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===n.length)return e;if(1===n.length){var a=n[0];if(a===e||r&&o(a)||i(e)&&i(a))return a}return new Ue(n)}(this,e))},includes:function(e){return this.some((function(t){return Ye(t,e)}))},entries:function(){return this.__iterator(m)},every:function(e,t){xt(this.size);var r=!0;return this.__iterate((function(n,i,a){if(!e.call(t,n,i,a))return r=!1,!1})),r},filter:function(e,t){return Qe(this,Me(this,e,t,!0))},partition:function(e,t){return function(e,t,r){var n=o(e),i=[[],[]];e.__iterate((function(a,o){i[t.call(r,a,o,e)?1:0].push(n?[o,a]:a)}));var a=ze(e);return i.map((function(t){return Qe(e,a(t))}))}(this,e,t)},find:function(e,t,r){var n=this.findEntry(e,t);return n?n[1]:r},forEach:function(e,t){return xt(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){xt(this.size),e=void 0!==e?""+e:",";var t="",r=!0;return this.__iterate((function(n){r?r=!1:t+=e,t+=null!=n?n.toString():""})),t},keys:function(){return this.__iterator(f)},map:function(e,t){return Qe(this,De(this,e,t))},reduce:function(e,t,r){return Lr(this,e,t,r,arguments.length<2,!1)},reduceRight:function(e,t,r){return Lr(this,e,t,r,arguments.length<2,!0)},reverse:function(){return Qe(this,Fe(this,!0))},slice:function(e,t){return Qe(this,Ce(this,e,t,!0))},some:function(e,t){xt(this.size);var r=!1;return this.__iterate((function(n,i,a){if(e.call(t,n,i,a))return r=!0,!1})),r},sort:function(e){return Qe(this,qe(this,e))},values:function(){return this.__iterator(y)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return D(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,r){var n=It().asMutable();return e.__iterate((function(i,a){n.update(t.call(r,i,a,e),0,(function(e){return e+1}))})),n.asImmutable()}(this,e,t)},equals:function(e){return Ur(this,e)},entrySeq:function(){var e=this;if(e._cache)return new te(e._cache);var t=e.toSeq().map(Fr).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Mr(e),t)},findEntry:function(e,t,r){var n=r;return this.__iterate((function(r,i,a){if(e.call(t,r,i,a))return n=[i,r],!1})),n},findKey:function(e,t){var r=this.findEntry(e,t);return r&&r[0]},findLast:function(e,t,r){return this.toKeyedSeq().reverse().find(e,t,r)},findLastEntry:function(e,t,r){return this.toKeyedSeq().reverse().findEntry(e,t,r)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(e){return this.find(M,null,e)},flatMap:function(e,t){return Qe(this,function(e,t,r){var n=ze(e);return e.toSeq().map((function(i,a){return n(t.call(r,i,a,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return Qe(this,Be(this,e,!0))},fromEntrySeq:function(){return new je(this)},get:function(e,t){return this.find((function(t,r){return Ye(r,e)}),void 0,t)},getIn:Jr,groupBy:function(e,t){return function(e,t,r){var n=o(e),i=(H(e)?Or():It()).asMutable();e.__iterate((function(a,o){i.update(t.call(r,a,o,e),(function(e){return(e=e||[]).push(n?[o,a]:a),e}))}));var a=ze(e);return i.map((function(t){return Qe(e,a(t))})).asImmutable()}(this,e,t)},has:function(e){return this.get(e,N)!==N},hasIn:function(e){return Yr(this,e)},isSubset:function(e){return e="function"==typeof e.includes?e:l(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:l(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return Ye(t,e)}))},keySeq:function(){return this.toSeq().map(Dr).toIndexedSeq()},last:function(e){return this.toSeq().reverse().first(e)},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Ve(this,e)},maxBy:function(e,t){return Ve(this,t,e)},min:function(e){return Ve(this,e?Cr(e):kr)},minBy:function(e,t){return Ve(this,t?Cr(t):kr,e)},rest:function(){return this.slice(1)},skip:function(e){return 0===e?this:this.slice(Math.max(0,e))},skipLast:function(e){return 0===e?this:this.slice(0,-Math.max(0,e))},skipWhile:function(e,t){return Qe(this,ke(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Mr(e),t)},sortBy:function(e,t){return Qe(this,qe(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return this.slice(-Math.max(0,e))},takeWhile:function(e,t){return Qe(this,function(e,t,r){var n=Ke(e);return n.__iterateUncached=function(n,i){var a=this;if(i)return this.cacheResult().__iterate(n,i);var o=0;return e.__iterate((function(e,i,s){return t.call(r,e,i,s)&&++o&&n(e,i,a)})),o},n.__iteratorUncached=function(n,i){var a=this;if(i)return this.cacheResult().__iterator(n,i);var o=e.__iterator(m,i),s=!0;return new _((function(){if(!s)return{value:void 0,done:!0};var e=o.next();if(e.done)return e;var i=e.value,c=i[0],u=i[1];return t.call(r,u,c,a)?n===m?e:T(n,c,u,e):(s=!1,{value:void 0,done:!0})}))},n}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Mr(e),t)},update:function(e){return e(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=H(e),r=o(e),n=t?1:0;return e.__iterate(r?t?function(e,t){n=31*n+tn(fe(e),fe(t))|0}:function(e,t){n=n+tn(fe(e),fe(t))|0}:t?function(e){n=31*n+fe(e)|0}:function(e){n=n+fe(e)|0}),function(e,t){return t=de(t,3432918353),t=de(t<<15|t>>>-15,461845907),t=de(t<<13|t>>>-13,5),t=de((t=t+3864292196^e)^t>>>16,2246822507),pe((t=de(t^t>>>13,3266489909))^t>>>16)}(e.size,n)}(this))}});var nn=l.prototype;nn[c]=!0,nn[v]=nn.values,nn.toJSON=nn.toArray,nn.__toStringMapper=Jt,nn.inspect=nn.toSource=function(){return this.toString()},nn.chain=nn.flatMap,nn.contains=nn.includes,rn(d,{flip:function(){return Qe(this,Le(this))},mapEntries:function(e,t){var r=this,n=0;return Qe(this,this.toSeq().map((function(i,a){return e.call(t,[a,i],n++,r)})).fromEntrySeq())},mapKeys:function(e,t){var r=this;return Qe(this,this.toSeq().flip().map((function(n,i){return e.call(t,n,i,r)})).flip())}});var an=d.prototype;an[a]=!0,an[v]=nn.entries,an.toJSON=Zr,an.__toStringMapper=function(e,t){return Jt(t)+": "+Jt(e)},rn(p,{toKeyedSeq:function(){return new Pe(this,!1)},filter:function(e,t){return Qe(this,Me(this,e,t,!1))},findIndex:function(e,t){var r=this.findEntry(e,t);return r?r[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Qe(this,Fe(this,!1))},slice:function(e,t){return Qe(this,Ce(this,e,t,!1))},splice:function(e,t){var r=arguments.length;if(t=Math.max(t||0,0),0===r||2===r&&!t)return this;e=k(e,e<0?this.count():this.size);var n=this.slice(0,e);return Qe(this,1===r?n:n.concat(ot(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var r=this.findLastEntry(e,t);return r?r[0]:-1},first:function(e){return this.get(0,e)},flatten:function(e){return Qe(this,Be(this,e,!1))},get:function(e,t){return(e=F(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,r){return r===e}),void 0,t)},has:function(e){return(e=F(this,e))>=0&&(void 0!==this.size?this.size===1/0||e2?[]:void 0,{"":e})}function En(e,t,r,n,i,a){if("string"!=typeof r&&!G(r)&&(W(r)||w(r)||it(r))){if(~e.indexOf(r))throw new TypeError("Cannot convert circular structure to Immutable");e.push(r),i&&""!==n&&i.push(n);var o=t.call(a,n,J(r).map((function(n,a){return En(e,t,n,a,i,r)})),i&&i.slice());return e.pop(),i&&i.pop(),o}return r}function An(e,t){return i(t)?t.toList():o(t)?t.toMap():t.toSet()}var xn="5.1.4",In=l},33918:e=>{!function(){var t;function r(e,n){var i=this instanceof r?this:t;if(i.reset(n),"string"==typeof e&&e.length>0&&i.hash(e),i!==this)return i}r.prototype.hash=function(e){var t,r,n,i,a;switch(a=e.length,this.len+=a,r=this.k1,n=0,this.rem){case 0:r^=a>n?65535&e.charCodeAt(n++):0;case 1:r^=a>n?(65535&e.charCodeAt(n++))<<8:0;case 2:r^=a>n?(65535&e.charCodeAt(n++))<<16:0;case 3:r^=a>n?(255&e.charCodeAt(n))<<24:0,r^=a>n?(65280&e.charCodeAt(n++))>>8:0}if(this.rem=a+this.rem&3,(a-=this.rem)>0){for(t=this.h1;t=5*(t=(t^=r=13715*(r=(r=11601*r+3432906752*(65535&r)&4294967295)<<15|r>>>17)+461832192*(65535&r)&4294967295)<<13|t>>>19)+3864292196&4294967295,!(n>=a);)r=65535&e.charCodeAt(n++)^(65535&e.charCodeAt(n++))<<8^(65535&e.charCodeAt(n++))<<16,r^=(255&(i=e.charCodeAt(n++)))<<24^(65280&i)>>8;switch(r=0,this.rem){case 3:r^=(65535&e.charCodeAt(n+2))<<16;case 2:r^=(65535&e.charCodeAt(n+1))<<8;case 1:r^=65535&e.charCodeAt(n)}this.h1=t}return this.k1=r,this},r.prototype.result=function(){var e,t;return e=this.k1,t=this.h1,e>0&&(t^=e=13715*(e=(e=11601*e+3432906752*(65535&e)&4294967295)<<15|e>>>17)+461832192*(65535&e)&4294967295),t^=this.len,t=51819*(t^=t>>>16)+2246770688*(65535&t)&4294967295,t=44597*(t^=t>>>13)+3266445312*(65535&t)&4294967295,(t^=t>>>16)>>>0},r.prototype.reset=function(e){return this.h1="number"==typeof e?e:0,this.rem=this.k1=this.len=0,this},t=new r,e.exports=r}()},35615:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},76605:e=>{"use strict";const t=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;t.writable=e=>t(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState,t.readable=e=>t(e)&&!1!==e.readable&&"function"==typeof e._read&&"object"==typeof e._readableState,t.duplex=e=>t.writable(e)&&t.readable(e),t.transform=e=>t.duplex(e)&&"function"==typeof e._transform,e.exports=t},27202:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(85346),t),i(r(40905),t),i(r(76920),t),i(r(11971),t),i(r(89715),t),i(r(39426),t),i(r(45512),t)},85346:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextParser=void 0;const n=r(9929),i=r(40905),a=r(76920),o=r(39426),s=r(45512);class c{constructor(e){e=e||{},this.documentLoader=e.documentLoader||new a.FetchDocumentLoader,this.documentCache={},this.validateContext=!e.skipValidation,this.expandContentTypeToBase=!!e.expandContentTypeToBase,this.remoteContextsDepthLimit=e.remoteContextsDepthLimit||32,this.redirectSchemaOrgHttps=!("redirectSchemaOrgHttps"in e)||!!e.redirectSchemaOrgHttps}static validateLanguage(e,t,r){if("string"!=typeof e)throw new i.ErrorCoded(`The value of an '@language' must be a string, got '${JSON.stringify(e)}'`,r);if(!s.Util.REGEX_LANGUAGE_TAG.test(e)){if(t)throw new i.ErrorCoded(`The value of an '@language' must be a valid language tag, got '${JSON.stringify(e)}'`,r);return!1}return!0}static validateDirection(e,t){if("string"!=typeof e)throw new i.ErrorCoded(`The value of an '@direction' must be a string, got '${JSON.stringify(e)}'`,i.ERROR_CODES.INVALID_BASE_DIRECTION);if(!s.Util.REGEX_DIRECTION_TAG.test(e)){if(t)throw new i.ErrorCoded(`The value of an '@direction' must be 'ltr' or 'rtl', got '${JSON.stringify(e)}'`,i.ERROR_CODES.INVALID_BASE_DIRECTION);return!1}return!0}idifyReverseTerms(e){for(const t of Object.keys(e)){let r=e[t];if(r&&"object"==typeof r&&r["@reverse"]&&!r["@id"]){if("string"!=typeof r["@reverse"]||s.Util.isValidKeyword(r["@reverse"]))throw new i.ErrorCoded(`Invalid @reverse value, must be absolute IRI or blank node: '${r["@reverse"]}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);r=e[t]=Object.assign(Object.assign({},r),{"@id":r["@reverse"]}),r["@id"]=r["@reverse"],s.Util.isPotentialKeyword(r["@reverse"])?delete r["@reverse"]:r["@reverse"]=!0}}return e}expandPrefixedTerms(e,t,r){const n=e.getContextRaw();for(const a of r||Object.keys(n))if(s.Util.EXPAND_KEYS_BLACKLIST.indexOf(a)<0&&!s.Util.isReservedInternalKeyword(a)){const r=n[a];if(s.Util.isPotentialKeyword(a)&&s.Util.ALIAS_DOMAIN_BLACKLIST.indexOf(a)>=0&&("@type"!==a||"object"==typeof n[a]&&!n[a]["@protected"]&&"@set"!==n[a]["@container"]))throw new i.ErrorCoded(`Keywords can not be aliased to something else.\nTried mapping ${a} to ${JSON.stringify(r)}`,i.ERROR_CODES.KEYWORD_REDEFINITION);if(s.Util.ALIAS_RANGE_BLACKLIST.indexOf(s.Util.getContextValueId(r))>=0)throw new i.ErrorCoded(`Aliasing to certain keywords is not allowed.\nTried mapping ${a} to ${JSON.stringify(r)}`,i.ERROR_CODES.INVALID_KEYWORD_ALIAS);if(r&&s.Util.isPotentialKeyword(s.Util.getContextValueId(r))&&!0===r["@prefix"])throw new i.ErrorCoded(`Tried to use keyword aliases as prefix: '${a}': '${JSON.stringify(r)}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);for(;s.Util.isPrefixValue(n[a]);){const r=n[a];let i=!1;if("string"==typeof r)n[a]=e.expandTerm(r,!0),i=i||r!==n[a];else{const o=r["@id"],c=r["@type"],u=!("@prefix"in r)||s.Util.isValidIri(a);if("@id"in r)null!=o&&"string"==typeof o&&(n[a]=Object.assign(Object.assign({},n[a]),{"@id":e.expandTerm(o,!0)}),i=i||o!==n[a]["@id"]);else if(!s.Util.isPotentialKeyword(a)&&u){const t=e.expandTerm(a,!0);t!==a&&(n[a]=Object.assign(Object.assign({},n[a]),{"@id":t}),i=!0)}if(c&&"string"==typeof c&&"@vocab"!==c&&(!r["@container"]||!r["@container"]["@type"])&&u){let r=e.expandTerm(c,!0);t&&c===r&&(r=e.expandTerm(c,!1)),r!==c&&(i=!0,n[a]=Object.assign(Object.assign({},n[a]),{"@type":r}))}}if(!i)break}}}normalize(e,{processingMode:t,normalizeLanguageTags:r}){if(r||1===t)for(const t of Object.keys(e))if("@language"===t&&"string"==typeof e[t])e[t]=e[t].toLowerCase();else{const r=e[t];if(r&&"object"==typeof r&&"string"==typeof r["@language"]){const n=r["@language"].toLowerCase();n!==r["@language"]&&(e[t]=Object.assign(Object.assign({},r),{"@language":n}))}}}containersToHash(e){for(const t of Object.keys(e)){const r=e[t];if(r&&"object"==typeof r)if("string"==typeof r["@container"])e[t]=Object.assign(Object.assign({},r),{"@container":{[r["@container"]]:!0}});else if(Array.isArray(r["@container"])){const n={};for(const e of r["@container"])n[e]=!0;e[t]=Object.assign(Object.assign({},r),{"@container":n})}}}applyScopedProtected(e,{processingMode:t},r){if(t&&t>=1.1&&e["@protected"]){for(const t of Object.keys(e))if(!s.Util.isReservedInternalKeyword(t)&&!s.Util.isPotentialKeyword(t)&&!s.Util.isTermProtected(e,t)){const n=e[t];n&&"object"==typeof n?"@protected"in e[t]||(e[t]=Object.assign(Object.assign({},e[t]),{"@protected":!0})):(e[t]={"@id":n,"@protected":!0},s.Util.isSimpleTermDefinitionPrefix(n,r)&&(e[t]=Object.assign(Object.assign({},e[t]),{"@prefix":!0})))}delete e["@protected"]}}validateKeywordRedefinitions(e,t,r,n){for(const r of null!=n?n:Object.keys(t))if(s.Util.isTermProtected(e,r)&&("string"==typeof t[r]?t[r]={"@id":t[r],"@protected":!0}:t[r]=Object.assign(Object.assign({},t[r]),{"@protected":!0}),!s.Util.deepEqual(e[r],t[r])))throw new i.ErrorCoded(`Attempted to override the protected keyword ${r} from ${JSON.stringify(s.Util.getContextValueId(e[r]))} to ${JSON.stringify(s.Util.getContextValueId(t[r]))}`,i.ERROR_CODES.PROTECTED_TERM_REDEFINITION)}validate(e,{processingMode:t}){for(const r of Object.keys(e)){if(s.Util.isReservedInternalKeyword(r))continue;if(""===r)throw new i.ErrorCoded(`The empty term is not allowed, got: '${r}': '${JSON.stringify(e[r])}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);const n=e[r],a=typeof n;if(s.Util.isPotentialKeyword(r)){switch(r.substr(1)){case"vocab":if(null!==n&&"string"!==a)throw new i.ErrorCoded(`Found an invalid @vocab IRI: ${n}`,i.ERROR_CODES.INVALID_VOCAB_MAPPING);break;case"base":if(null!==n&&"string"!==a)throw new i.ErrorCoded(`Found an invalid @base IRI: ${e[r]}`,i.ERROR_CODES.INVALID_BASE_IRI);break;case"language":null!==n&&c.validateLanguage(n,!0,i.ERROR_CODES.INVALID_DEFAULT_LANGUAGE);break;case"version":if(null!==n&&"number"!==a)throw new i.ErrorCoded(`Found an invalid @version number: ${n}`,i.ERROR_CODES.INVALID_VERSION_VALUE);break;case"direction":null!==n&&c.validateDirection(n,!0);break;case"propagate":if(1===t)throw new i.ErrorCoded(`Found an illegal @propagate keyword: ${n}`,i.ERROR_CODES.INVALID_CONTEXT_ENTRY);if(null!==n&&"boolean"!==a)throw new i.ErrorCoded(`Found an invalid @propagate value: ${n}`,i.ERROR_CODES.INVALID_PROPAGATE_VALUE)}if(s.Util.isValidKeyword(r)&&s.Util.isValidKeyword(s.Util.getContextValueId(n)))throw new i.ErrorCoded(`Illegal keyword alias in term value, found: '${r}': '${s.Util.getContextValueId(n)}'`,i.ERROR_CODES.KEYWORD_REDEFINITION)}else if(null!==n)switch(a){case"string":if(s.Util.getPrefix(n,e)===r)throw new i.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.CYCLIC_IRI_MAPPING);if(s.Util.isValidIriWeak(r)){if("@type"===n)throw new i.ErrorCoded(`IRIs can not be mapped to @type, found: '${r}': '${n}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIri(n)&&n!==new o.JsonLdContextNormalized(e).expandTerm(r))throw new i.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${r}': '${n}'`,i.ERROR_CODES.INVALID_IRI_MAPPING)}break;case"object":if(!(s.Util.isCompactIri(r)||"@id"in n||("@id"===n["@type"]?e["@base"]:e["@vocab"])))throw new i.ErrorCoded(`Missing @id in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);for(const u of Object.keys(n)){const l=n[u];if(l)switch(u){case"@id":if(s.Util.isValidKeyword(l)&&"@type"!==l&&"@id"!==l&&"@graph"!==l&&"@nest"!==l)throw new i.ErrorCoded(`Illegal keyword alias in term value, found: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIriWeak(r)){if("@type"===l)throw new i.ErrorCoded(`IRIs can not be mapped to @type, found: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIri(l)&&l!==new o.JsonLdContextNormalized(e).expandTerm(r))throw new i.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING)}if("string"!=typeof l)throw new i.ErrorCoded(`Detected non-string @id in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.getPrefix(l,e)===r)throw new i.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.CYCLIC_IRI_MAPPING);break;case"@type":if("@type"===n["@container"]&&"@id"!==l&&"@vocab"!==l)throw new i.ErrorCoded(`@container: @type only allows @type: @id or @vocab, but got: '${r}': '${l}'`,i.ERROR_CODES.INVALID_TYPE_MAPPING);if("string"!=typeof l)throw new i.ErrorCoded(`The value of an '@type' must be a string, got '${JSON.stringify(a)}'`,i.ERROR_CODES.INVALID_TYPE_MAPPING);if(!("@id"===l||"@vocab"===l||1!==t&&"@json"===l||1!==t&&"@none"===l||"_"!==l[0]&&s.Util.isValidIri(l)))throw new i.ErrorCoded(`A context @type must be an absolute IRI, found: '${r}': '${l}'`,i.ERROR_CODES.INVALID_TYPE_MAPPING);break;case"@reverse":if("string"==typeof l&&n["@id"]&&n["@id"]!==l)throw new i.ErrorCoded(`Found non-matching @id and @reverse term values in '${r}':'${l}' and '${n["@id"]}'`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY);if("@nest"in n)throw new i.ErrorCoded(`@nest is not allowed in the reverse property '${r}'`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY);break;case"@container":if(1===t&&(Object.keys(l).length>1||s.Util.CONTAINERS_1_0.indexOf(Object.keys(l)[0])<0))throw new i.ErrorCoded(`Invalid term @container for '${r}' ('${Object.keys(l)}') in 1.0, must be only one of ${s.Util.CONTAINERS_1_0.join(", ")}`,i.ERROR_CODES.INVALID_CONTAINER_MAPPING);for(const e of Object.keys(l)){if("@list"===e&&n["@reverse"])throw new i.ErrorCoded(`Term value can not be @container: @list and @reverse at the same time on '${r}'`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY);if(s.Util.CONTAINERS.indexOf(e)<0)throw new i.ErrorCoded(`Invalid term @container for '${r}' ('${e}'), must be one of ${s.Util.CONTAINERS.join(", ")}`,i.ERROR_CODES.INVALID_CONTAINER_MAPPING)}break;case"@language":c.validateLanguage(l,!0,i.ERROR_CODES.INVALID_LANGUAGE_MAPPING);break;case"@direction":c.validateDirection(l,!0);break;case"@prefix":if(null!==l&&"boolean"!=typeof l)throw new i.ErrorCoded(`Found an invalid term @prefix boolean in: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_PREFIX_VALUE);if(!("@id"in n)&&!s.Util.isValidIri(r))throw new i.ErrorCoded(`Invalid @prefix definition for '${r}' ('${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);break;case"@index":if(1===t||!n["@container"]||!n["@container"]["@index"])throw new i.ErrorCoded(`Attempt to add illegal key to value object: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);break;case"@nest":if(s.Util.isPotentialKeyword(l)&&"@nest"!==l)throw new i.ErrorCoded(`Found an invalid term @nest value in: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_NEST_VALUE)}}break;default:throw new i.ErrorCoded(`Found an invalid term value: '${r}': '${n}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION)}}}applyBaseEntry(e,t,r){return"string"==typeof e||(r&&!("@base"in e)&&t.parentContext&&"object"==typeof t.parentContext&&"@base"in t.parentContext&&(e["@base"]=t.parentContext["@base"],t.parentContext["@__baseDocument"]&&(e["@__baseDocument"]=!0)),t.baseIRI&&!t.external&&("@base"in e?null===e["@base"]||"string"!=typeof e["@base"]||s.Util.isValidIri(e["@base"])||(e["@base"]=(0,n.resolve)(e["@base"],t.parentContext&&t.parentContext["@base"]||t.baseIRI)):(e["@base"]=t.baseIRI,e["@__baseDocument"]=!0))),e}normalizeContextIri(e,t){if(!s.Util.isValidIri(e))try{e=(0,n.resolve)(e,t)}catch(t){throw new Error(`Invalid context IRI: ${e}`)}return this.redirectSchemaOrgHttps&&e.startsWith("http://schema.org")&&(e="https://schema.org/"),e}async parseInnerContexts(e,t,r){for(const n of null!=r?r:Object.keys(e)){const r=e[n];if(r&&"object"==typeof r&&"@context"in r&&null!==r["@context"]&&!t.ignoreScopedContexts){if(this.validateContext)try{const i=Object.assign(Object.assign({},e),{[n]:Object.assign({},e[n])});delete i[n]["@context"],await this.parse(r["@context"],Object.assign(Object.assign({},t),{external:!1,parentContext:i,ignoreProtection:!0,ignoreRemoteScopedContexts:!0,ignoreScopedContexts:!0}))}catch(e){throw new i.ErrorCoded(e.message,i.ERROR_CODES.INVALID_SCOPED_CONTEXT)}e[n]=Object.assign(Object.assign({},r),{"@context":(await this.parse(r["@context"],Object.assign(Object.assign({},t),{external:!1,minimalProcessing:!0,ignoreRemoteScopedContexts:!0,parentContext:e}))).getContextRaw()})}}return e}async parse(e,t={},r={}){const{baseIRI:n,parentContext:a,external:u,processingMode:l=c.DEFAULT_PROCESSING_MODE,normalizeLanguageTags:d,ignoreProtection:p,minimalProcessing:h}=t,f=t.remoteContexts||{};if(Object.keys(f).length>=this.remoteContextsDepthLimit)throw new i.ErrorCoded("Detected an overflow in remote context inclusions: "+Object.keys(f),i.ERROR_CODES.CONTEXT_OVERFLOW);if(null==e){if(!p&&a&&s.Util.hasProtectedTerms(a))throw new i.ErrorCoded("Illegal context nullification when terms are protected",i.ERROR_CODES.INVALID_CONTEXT_NULLIFICATION);return new o.JsonLdContextNormalized(this.applyBaseEntry({},t,!1))}if("string"==typeof e){const r=this.normalizeContextIri(e,n),i=this.getOverriddenLoad(r,t);if(i)return new o.JsonLdContextNormalized(i);const a=await this.parse(await this.load(r),Object.assign(Object.assign({},t),{baseIRI:r,external:!0,remoteContexts:Object.assign(Object.assign({},f),{[r]:!0})}));return this.applyBaseEntry(a.getContextRaw(),t,!0),a}if(Array.isArray(e)){const r=[],i=await Promise.all(e.map(((e,i)=>{if("string"==typeof e){const a=this.normalizeContextIri(e,n);r[i]=a;return this.getOverriddenLoad(a,t)||this.load(a)}return e})));if(h)return new o.JsonLdContextNormalized(i);const s=await i.reduce(((e,n,a)=>e.then((e=>this.parse(n,Object.assign(Object.assign({},t),{baseIRI:r[a]||t.baseIRI,external:!!r[a]||t.external,parentContext:e.getContextRaw(),remoteContexts:r[a]?Object.assign(Object.assign({},f),{[r[a]]:!0}):f}),{skipValidation:a=1.1))throw new i.ErrorCoded("Context importing is not supported in JSON-LD 1.0",i.ERROR_CODES.INVALID_CONTEXT_ENTRY);if("string"!=typeof e["@import"])throw new i.ErrorCoded("An @import value must be a string, but got "+typeof e["@import"],i.ERROR_CODES.INVALID_IMPORT_VALUE);f=await this.loadImportContext(this.normalizeContextIri(e["@import"],n)),delete e["@import"]}this.applyScopedProtected(f,{processingMode:l},o.defaultExpandOptions);const y=Object.assign(f,e);this.idifyReverseTerms(y),this.normalize(y,{processingMode:l,normalizeLanguageTags:d}),this.applyScopedProtected(y,{processingMode:l},o.defaultExpandOptions);const m=Object.keys(y),g=[];if("object"==typeof a)for(const e in a)e in y?g.push(e):y[e]=a[e];await this.parseInnerContexts(y,t,m);const b=new o.JsonLdContextNormalized(y);return(y&&y["@version"]||c.DEFAULT_PROCESSING_MODE)>=1.1&&(e["@vocab"]&&"string"==typeof e["@vocab"]||""===e["@vocab"])&&(a&&"@vocab"in a&&e["@vocab"].indexOf(":")<0?y["@vocab"]=a["@vocab"]+e["@vocab"]:(s.Util.isCompactIri(e["@vocab"])||e["@vocab"]in y)&&(y["@vocab"]=b.expandTerm(e["@vocab"],!0))),this.expandPrefixedTerms(b,this.expandContentTypeToBase,m),!p&&a&&l>=1.1&&this.validateKeywordRedefinitions(a,y,o.defaultExpandOptions,g),this.validateContext&&!r.skipValidation&&this.validate(y,{processingMode:l}),b}throw new i.ErrorCoded(`Tried parsing a context that is not a string, array or object, but got ${e}`,i.ERROR_CODES.INVALID_LOCAL_CONTEXT)}async load(e){const t=this.documentCache[e];if(t)return t;let r;try{r=await this.documentLoader.load(e)}catch(t){throw new i.ErrorCoded(`Failed to load remote context ${e}: ${t.message}`,i.ERROR_CODES.LOADING_REMOTE_CONTEXT_FAILED)}if(!("@context"in r))throw new i.ErrorCoded(`Missing @context in remote context at ${e}`,i.ERROR_CODES.INVALID_REMOTE_CONTEXT);return this.documentCache[e]=r["@context"]}getOverriddenLoad(e,t){if(e in(t.remoteContexts||{})){if(t.ignoreRemoteScopedContexts)return e;throw new i.ErrorCoded("Detected a cyclic context inclusion of "+e,i.ERROR_CODES.RECURSIVE_CONTEXT_INCLUSION)}return null}async loadImportContext(e){let t=await this.load(e);if("object"!=typeof t||Array.isArray(t))throw new i.ErrorCoded("An imported context must be a single object: "+e,i.ERROR_CODES.INVALID_REMOTE_CONTEXT);if("@import"in t)throw new i.ErrorCoded("An imported context can not import another context: "+e,i.ERROR_CODES.INVALID_CONTEXT_ENTRY);return t=Object.assign({},t),this.containersToHash(t),t}}c.DEFAULT_PROCESSING_MODE=1.1,t.ContextParser=c},40905:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_CODES=t.ErrorCoded=void 0;class r extends Error{constructor(e,t){super(e),this.code=t}}var n;t.ErrorCoded=r,(n=t.ERROR_CODES||(t.ERROR_CODES={})).COLLIDING_KEYWORDS="colliding keywords",n.CONFLICTING_INDEXES="conflicting indexes",n.CYCLIC_IRI_MAPPING="cyclic IRI mapping",n.INVALID_ID_VALUE="invalid @id value",n.INVALID_INDEX_VALUE="invalid @index value",n.INVALID_NEST_VALUE="invalid @nest value",n.INVALID_PREFIX_VALUE="invalid @prefix value",n.INVALID_PROPAGATE_VALUE="invalid @propagate value",n.INVALID_REVERSE_VALUE="invalid @reverse value",n.INVALID_IMPORT_VALUE="invalid @import value",n.INVALID_VERSION_VALUE="invalid @version value",n.INVALID_BASE_IRI="invalid base IRI",n.INVALID_CONTAINER_MAPPING="invalid container mapping",n.INVALID_CONTEXT_ENTRY="invalid context entry",n.INVALID_CONTEXT_NULLIFICATION="invalid context nullification",n.INVALID_DEFAULT_LANGUAGE="invalid default language",n.INVALID_INCLUDED_VALUE="invalid @included value",n.INVALID_IRI_MAPPING="invalid IRI mapping",n.INVALID_JSON_LITERAL="invalid JSON literal",n.INVALID_KEYWORD_ALIAS="invalid keyword alias",n.INVALID_LANGUAGE_MAP_VALUE="invalid language map value",n.INVALID_LANGUAGE_MAPPING="invalid language mapping",n.INVALID_LANGUAGE_TAGGED_STRING="invalid language-tagged string",n.INVALID_LANGUAGE_TAGGED_VALUE="invalid language-tagged value",n.INVALID_LOCAL_CONTEXT="invalid local context",n.INVALID_REMOTE_CONTEXT="invalid remote context",n.INVALID_REVERSE_PROPERTY="invalid reverse property",n.INVALID_REVERSE_PROPERTY_MAP="invalid reverse property map",n.INVALID_REVERSE_PROPERTY_VALUE="invalid reverse property value",n.INVALID_SCOPED_CONTEXT="invalid scoped context",n.INVALID_SCRIPT_ELEMENT="invalid script element",n.INVALID_SET_OR_LIST_OBJECT="invalid set or list object",n.INVALID_TERM_DEFINITION="invalid term definition",n.INVALID_TYPE_MAPPING="invalid type mapping",n.INVALID_TYPE_VALUE="invalid type value",n.INVALID_TYPED_VALUE="invalid typed value",n.INVALID_VALUE_OBJECT="invalid value object",n.INVALID_VALUE_OBJECT_VALUE="invalid value object value",n.INVALID_VOCAB_MAPPING="invalid vocab mapping",n.IRI_CONFUSED_WITH_PREFIX="IRI confused with prefix",n.KEYWORD_REDEFINITION="keyword redefinition",n.LOADING_DOCUMENT_FAILED="loading document failed",n.LOADING_REMOTE_CONTEXT_FAILED="loading remote context failed",n.MULTIPLE_CONTEXT_LINK_HEADERS="multiple context link headers",n.PROCESSING_MODE_CONFLICT="processing mode conflict",n.PROTECTED_TERM_REDEFINITION="protected term redefinition",n.CONTEXT_OVERFLOW="context overflow",n.INVALID_BASE_DIRECTION="invalid base direction",n.RECURSIVE_CONTEXT_INCLUSION="recursive context inclusion",n.INVALID_STREAMING_KEY_ORDER="invalid streaming key order",n.INVALID_EMBEDDED_NODE="invalid embedded node",n.INVALID_ANNOTATION="invalid annotation"},76920:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FetchDocumentLoader=void 0;const n=r(40905),i=r(75441),a=r(9929);t.FetchDocumentLoader=class{constructor(e){this.fetcher=e}async load(e){const t=await(this.fetcher||fetch)(e,{headers:new Headers({accept:"application/ld+json"})});if(t.ok&&t.headers){let r=t.headers.get("Content-Type");if(r){const e=r.indexOf(";");e>0&&(r=r.substr(0,e))}if("application/ld+json"===r)return await t.json();if(t.headers.has("Link")){let r;if(t.headers.forEach(((t,n)=>{if("link"===n){const n=(0,i.parse)(t);for(const t of n.get("type","application/ld+json"))if("alternate"===t.rel){if(r)throw new Error("Multiple JSON-LD alternate links were found on "+e);r=(0,a.resolve)(t.uri,e)}}})),r)return this.load(r)}throw new n.ErrorCoded(`Unsupported JSON-LD media type ${r}`,n.ERROR_CODES.LOADING_DOCUMENT_FAILED)}throw new Error(t.statusText||`Status code: ${t.status}`)}}},11971:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},89715:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},39426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultExpandOptions=t.JsonLdContextNormalized=void 0;const n=r(9929),i=r(40905),a=r(45512);t.JsonLdContextNormalized=class{constructor(e){this.contextRaw=e}getContextRaw(){return this.contextRaw}expandTerm(e,r,o=t.defaultExpandOptions){const s=this.contextRaw[e];if(null===s||s&&null===s["@id"])return null;let c=!0;if(s&&r){const t=a.Util.getContextValueId(s);if(t&&t!==e){if("string"==typeof t&&(a.Util.isValidIri(t)||a.Util.isValidKeyword(t)))return t;a.Util.isPotentialKeyword(t)||(c=!1)}}const u=a.Util.getPrefix(e,this.contextRaw),l=this.contextRaw["@vocab"],d=(!!l||""===l)&&l.indexOf(":")<0,p=this.contextRaw["@base"],h=a.Util.isPotentialKeyword(e);if(u){const t=this.contextRaw[u],r=a.Util.getContextValueId(t);if(r){if("string"!=typeof t&&o.allowPrefixForcing){if("_"!==r[0]&&!h&&!t["@prefix"]&&!(e in this.contextRaw))return e}else if(!a.Util.isSimpleTermDefinitionPrefix(r,o))return e;return r+e.substr(u.length+1)}}else{if(r&&(l||""===l||o.allowVocabRelativeToBase&&p&&d)&&!h&&!a.Util.isCompactIri(e)){if(d){if(o.allowVocabRelativeToBase)return(l||p?(0,n.resolve)(l,p):"")+e;throw new i.ErrorCoded(`Relative vocab expansion for term '${e}' with vocab '${l}' is not allowed.`,i.ERROR_CODES.INVALID_VOCAB_MAPPING)}return l+e}if(!r&&p&&!h&&!a.Util.isCompactIri(e))return(0,n.resolve)(e,p)}if(c)return e;throw new i.ErrorCoded(`Invalid IRI mapping found for context entry '${e}': '${JSON.stringify(s)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING)}compactIri(e,t){if(t&&this.contextRaw["@vocab"]&&e.startsWith(this.contextRaw["@vocab"]))return e.substr(this.contextRaw["@vocab"].length);if(!t&&this.contextRaw["@base"]&&e.startsWith(this.contextRaw["@base"]))return e.substr(this.contextRaw["@base"].length);const r={prefix:"",suffix:e};for(const n in this.contextRaw){const i=this.contextRaw[n];if(i&&!a.Util.isPotentialKeyword(n)){const o=a.Util.getContextValueId(i);if(e.startsWith(o)){const i=e.substr(o.length);if(i)i.length{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=void 0;class r{static isCompactIri(e){return e.indexOf(":")>0&&!(e&&"#"===e[0])}static getPrefix(e,t){if(e&&"#"===e[0])return null;const r=e.indexOf(":");if(r>=0){if(e.length>r+1&&"/"===e.charAt(r+1)&&"/"===e.charAt(r+2))return null;const n=e.substr(0,r);if("_"===n)return null;if(t[n])return n}return null}static getContextValueId(e){if(null===e||"string"==typeof e)return e;return e["@id"]||null}static isSimpleTermDefinitionPrefix(e,t){return!r.isPotentialKeyword(e)&&(t.allowPrefixNonGenDelims||"string"==typeof e&&("_"===e[0]||r.isPrefixIriEndingWithGenDelim(e)))}static isPotentialKeyword(e){return"string"==typeof e&&r.KEYWORD_REGEX.test(e)}static isPrefixIriEndingWithGenDelim(e){return r.ENDS_WITH_GEN_DELIM.test(e)}static isPrefixValue(e){return e&&("string"==typeof e||e&&"object"==typeof e)}static isValidIri(e){return Boolean(e&&r.IRI_REGEX.test(e))}static isValidIriWeak(e){return!!e&&":"!==e[0]&&r.IRI_REGEX_WEAK.test(e)}static isValidKeyword(e){return r.VALID_KEYWORDS[e]}static isTermProtected(e,t){const r=e[t];return!("string"==typeof r)&&r&&r["@protected"]}static hasProtectedTerms(e){for(const t of Object.keys(e))if(r.isTermProtected(e,t))return!0;return!1}static isReservedInternalKeyword(e){return e.startsWith("@__")}static deepEqual(e,t){const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every((r=>{const n=e[r],i=t[r];return n===i||null!==n&&null!==i&&"object"==typeof n&&"object"==typeof i&&this.deepEqual(n,i)}))}}r.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^ "<>{}|\\\[\]`#]*(#[^#]*)?$/,r.IRI_REGEX_WEAK=/(?::[^:])|\//,r.KEYWORD_REGEX=/^@[a-z]+$/i,r.ENDS_WITH_GEN_DELIM=/[:/?#\[\]@]$/,r.REGEX_LANGUAGE_TAG=/^[a-zA-Z]+(-[a-zA-Z0-9]+)*$/,r.REGEX_DIRECTION_TAG=/^(ltr)|(rtl)$/,r.VALID_KEYWORDS={"@annotation":!0,"@base":!0,"@container":!0,"@context":!0,"@direction":!0,"@graph":!0,"@id":!0,"@import":!0,"@included":!0,"@index":!0,"@json":!0,"@language":!0,"@list":!0,"@nest":!0,"@none":!0,"@prefix":!0,"@propagate":!0,"@protected":!0,"@reverse":!0,"@set":!0,"@type":!0,"@value":!0,"@version":!0,"@vocab":!0},r.EXPAND_KEYS_BLACKLIST=["@base","@vocab","@language","@version","@direction"],r.ALIAS_DOMAIN_BLACKLIST=["@container","@graph","@id","@index","@list","@nest","@none","@prefix","@reverse","@set","@type","@value","@version"],r.ALIAS_RANGE_BLACKLIST=["@context","@preserve"],r.CONTAINERS=["@list","@set","@index","@language","@graph","@id","@type"],r.CONTAINERS_1_0=["@list","@set","@index"],t.Util=r},50631:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(90114),t)},46240:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextTree=void 0;class r{constructor(){this.subTrees={}}getContext(e){if(e.length>0){const[t,...r]=e,n=this.subTrees[t];if(n){const e=n.getContext(r);if(e)return e.then((({context:e,depth:t})=>({context:e,depth:t+1})))}}return this.context?this.context.then((e=>({context:e,depth:0}))):null}setContext(e,t){if(0===e.length)this.context=t;else{const[n,...i]=e;let a=this.subTrees[n];a||(a=this.subTrees[n]=new r),a.setContext(i,t)}}removeContext(e){this.setContext(e,null)}}t.ContextTree=r},90114:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonLdParser=void 0;const n=r(36885),i=r(27202),a=r(58521),o=r(11272),s=r(45947),c=r(62885),u=r(29997),l=r(66700),d=r(37071),p=r(48978),h=r(30643),f=r(58865),y=r(23787),m=r(30635),g=r(94382),b=r(24292),v=r(22135),_=r(75441),T=r(6042);class O extends a.Transform{constructor(e){super({readableObjectMode:!0}),e=e||{},this.options=e,this.parsingContext=new b.ParsingContext(Object.assign({parser:this},e)),this.util=new v.Util({dataFactory:e.dataFactory,parsingContext:this.parsingContext}),this.jsonParser=new n,this.contextJobs=[],this.typeJobs=[],this.contextAwaitingJobs=[],this.lastDepth=0,this.lastKeys=[],this.lastOnValueJob=Promise.resolve(),this.attachJsonParserListeners(),this.on("end",(()=>{void 0!==this.jsonParser.mode&&this.emit("error",new Error("Unclosed document"))}))}static fromHttpResponse(e,t,r,n){let a,o,s=["application/activity+json"];if(n&&n.wellKnownMediaTypes&&(s=n.wellKnownMediaTypes),"application/ld+json"!==t&&!s.includes(t)){if("application/json"!==t&&!t.endsWith("+json"))throw new i.ErrorCoded(`Unsupported JSON-LD media type ${t}`,i.ERROR_CODES.LOADING_DOCUMENT_FAILED);if(r&&r.has("Link")&&r.forEach(((t,r)=>{if("link"===r){const r=(0,_.parse)(t);for(const t of r.get("rel","http://www.w3.org/ns/json-ld#context")){if(a)throw new i.ErrorCoded("Multiple JSON-LD context link headers were found on "+e,i.ERROR_CODES.MULTIPLE_CONTEXT_LINK_HEADERS);a=t.uri}}})),!a&&!(null==n?void 0:n.ignoreMissingContextLinkHeader))throw new i.ErrorCoded(`Missing context link header for media type ${t} on ${e}`,i.ERROR_CODES.LOADING_DOCUMENT_FAILED)}if(r&&r.has("Content-Type")){const e=r.get("Content-Type"),t=/; *profile=([^"]*)/.exec(e);t&&"http://www.w3.org/ns/json-ld#streaming"===t[1]&&(o=!0)}return new O(Object.assign({baseIRI:e,context:a,streamingProfile:o},n||{}))}import(e){if("pipe"in e){e.on("error",(e=>t.emit("error",e)));const t=e.pipe(new O(this.options));return t}{const t=new a.PassThrough({readableObjectMode:!0});e.on("error",(e=>r.emit("error",e))),e.on("data",(e=>t.push(e))),e.on("end",(()=>t.push(null)));const r=t.pipe(new O(this.options));return r}}_transform(e,t,r){this.jsonParser.write(e),this.lastOnValueJob.then((()=>r()),(e=>r(e)))}async newOnValueJob(e,t,r,n){let a=!0;if(n&&r1&&(l=this.parsingContext.validationStack[this.parsingContext.validationStack.length-1].property);for(let t=Math.max(1,this.parsingContext.validationStack.length-1);t=0?this.parsingContext.idStack[e-r-1]:[await this.util.getGraphContainerValue(t,e)];if(a)for(const t of a){this.parsingContext.emittedStack[e]=!0;for(const r of n)this.util.emitQuadChecked(e,i,r.predicate,r.object,t,r.reverse,r.isEmbedded)}else{const r=this.parsingContext.getUnidentifiedGraphBufferSafe(e-await this.util.getDepthOffsetGraph(e,t)-1);for(const e of n)e.reverse?r.push({object:i,predicate:e.predicate,subject:e.object,isEmbedded:e.isEmbedded}):r.push({object:e.object,predicate:e.predicate,subject:i,isEmbedded:e.isEmbedded})}}this.parsingContext.unidentifiedValuesBuffer.splice(e,1),this.parsingContext.literalStack.splice(e,1),this.parsingContext.jsonLiteralStack.splice(e,1)}const a=this.parsingContext.unidentifiedGraphsBuffer[e];if(a){for(const t of r){const r=1!==e||"BlankNode"!==t.termType||this.parsingContext.topLevelProperties?t:this.util.getDefaultGraph();this.parsingContext.emittedStack[e]=!0;for(const t of a)this.parsingContext.emitQuad(e,this.util.dataFactory.quad(t.subject,t.predicate,t.object,r))}this.parsingContext.unidentifiedGraphsBuffer.splice(e,1)}const o=this.parsingContext.annotationsBuffer[e];if(o){o.length>0&&1===e&&this.parsingContext.emitError(new i.ErrorCoded("Annotations can not be made on top-level nodes",i.ERROR_CODES.INVALID_ANNOTATION));const t=this.parsingContext.getAnnotationsBufferSafe(e-1);for(const e of o)t.push(e);delete this.parsingContext.annotationsBuffer[e]}}async validateKey(e,t,r){for(const n of O.ENTRY_HANDLERS)if(await n.validate(this.parsingContext,this.util,e,t,r))return{valid:!0,property:r||n.isPropertyHandler()};return{valid:!1,property:!1}}attachJsonParserListeners(){this.jsonParser.onValue=e=>{const t=this.jsonParser.stack.length,r=new Array(t+1).fill(0).map(((e,r)=>r===t?this.jsonParser.key:this.jsonParser.stack[r].key));if(!this.isParsingContextInner(t)){const n=()=>this.newOnValueJob(r,e,t,!0);if(this.parsingContext.streamingProfile||this.parsingContext.contextTree.getContext(r.slice(0,-1)))this.lastOnValueJob=this.lastOnValueJob.then(n);else if("@context"===r[t]){let e=this.contextJobs[t];e||(e=this.contextJobs[t]=[]),e.push(n)}else this.contextAwaitingJobs.push({job:n,keys:r,depth:t});this.parsingContext.streamingProfile||0!==t||(this.lastOnValueJob=this.lastOnValueJob.then((()=>this.executeBufferedJobs())))}},this.jsonParser.onError=e=>{this.emit("error",e)}}isParsingContextInner(e){for(let t=e;t>0;t--)if("@context"===this.jsonParser.stack[t-1].key)return!0;return!1}async executeBufferedJobs(){for(const e of this.contextJobs)if(e)for(const t of e)await t();this.parsingContext.unaliasedKeywordCacheStack.splice(0);const e=[];for(const t of this.contextAwaitingJobs)"@type"===await this.util.unaliasKeyword(t.keys[t.depth],t.keys,t.depth,!0)||"number"==typeof t.keys[t.depth]&&"@type"===await this.util.unaliasKeyword(t.keys[t.depth-1],t.keys,t.depth-1,!0)?this.typeJobs.push({job:t.job,keys:t.keys.slice(0,t.keys.length-1)}):e.push(t);for(const t of e){if(this.typeJobs.length>0){const e=[],r=[];for(let n=0;ne.keys.length-t.keys.length));for(const e of n)await e.job();const i=r.sort().reverse();for(const e of i)this.typeJobs.splice(e,1)}await t.job()}}}t.JsonLdParser=O,O.DEFAULT_PROCESSING_MODE="1.1",O.ENTRY_HANDLERS=[new o.EntryHandlerArrayValue,new l.EntryHandlerKeywordContext,new p.EntryHandlerKeywordId,new h.EntryHandlerKeywordIncluded,new d.EntryHandlerKeywordGraph,new f.EntryHandlerKeywordNest,new y.EntryHandlerKeywordType,new g.EntryHandlerKeywordValue,new T.EntryHandlerKeywordAnnotation,new s.EntryHandlerContainer,new m.EntryHandlerKeywordUnknownFallback,new u.EntryHandlerPredicate,new c.EntryHandlerInvalidFallback]},24292:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParsingContext=void 0;const n=r(27202),i=r(40905),a=r(46240),o=r(90114);class s{constructor(e){this.contextParser=new n.ContextParser({documentLoader:e.documentLoader,skipValidation:e.skipContextValidation}),this.streamingProfile=!!e.streamingProfile,this.baseIRI=e.baseIRI,this.produceGeneralizedRdf=!!e.produceGeneralizedRdf,this.allowSubjectList=!!e.allowSubjectList,this.processingMode=e.processingMode||o.JsonLdParser.DEFAULT_PROCESSING_MODE,this.strictValues=!!e.strictValues,this.validateValueIndexes=!!e.validateValueIndexes,this.defaultGraph=e.defaultGraph,this.rdfDirection=e.rdfDirection,this.normalizeLanguageTags=e.normalizeLanguageTags,this.streamingProfileAllowOutOfOrderPlainType=e.streamingProfileAllowOutOfOrderPlainType,this.rdfstar=!1!==e.rdfstar,this.rdfstarReverseInEmbedded=e.rdfstarReverseInEmbedded,this.topLevelProperties=!1,this.activeProcessingMode=parseFloat(this.processingMode),this.processingStack=[],this.processingType=[],this.emittedStack=[],this.idStack=[],this.graphStack=[],this.graphContainerTermStack=[],this.listPointerStack=[],this.contextTree=new a.ContextTree,this.literalStack=[],this.validationStack=[],this.unaliasedKeywordCacheStack=[],this.jsonLiteralStack=[],this.unidentifiedValuesBuffer=[],this.unidentifiedGraphsBuffer=[],this.annotationsBuffer=[],this.pendingContainerFlushBuffers=[],this.parser=e.parser,e.context?(this.rootContext=this.parseContext(e.context),this.rootContext.then((e=>this.validateContext(e)))):this.rootContext=Promise.resolve(new n.JsonLdContextNormalized(this.baseIRI?{"@base":this.baseIRI,"@__baseDocument":!0}:{}))}async parseContext(e,t,r){return this.contextParser.parse(e,{baseIRI:this.baseIRI,ignoreProtection:r,normalizeLanguageTags:this.normalizeLanguageTags,parentContext:t,processingMode:this.activeProcessingMode})}validateContext(e){const t=e.getContextRaw()["@version"];if(t){if(this.activeProcessingMode&&t>this.activeProcessingMode)throw new i.ErrorCoded(`Unsupported JSON-LD version '${t}' under active processing mode ${this.activeProcessingMode}.`,i.ERROR_CODES.PROCESSING_MODE_CONFLICT);if(this.activeProcessingMode&&t0&&!1===i.context.getContextRaw()["@propagate"]&&i.depth!==t&&!r);return 0===i.depth&&!1===i.context.getContextRaw()["@propagate"]&&i.depth!==t&&(i.context=new n.JsonLdContextNormalized({})),i}async newOnValueJob(e,t,r,n){await this.parser.newOnValueJob(e,t,r,n)}async handlePendingContainerFlushBuffers(){if(this.pendingContainerFlushBuffers.length>0){for(const e of this.pendingContainerFlushBuffers)await this.parser.flushBuffer(e.depth,e.keys),this.parser.flushStacks(e.depth);return this.pendingContainerFlushBuffers.splice(0,this.pendingContainerFlushBuffers.length),!0}return!1}emitQuad(e,t){1===e&&(this.topLevelProperties=!0),this.parser.push(t)}emitError(e){this.parser.emit("error",e)}emitContext(e){this.parser.emit("context",e)}getUnidentifiedValueBufferSafe(e){let t=this.unidentifiedValuesBuffer[e];return t||(t=[],this.unidentifiedValuesBuffer[e]=t),t}getUnidentifiedGraphBufferSafe(e){let t=this.unidentifiedGraphsBuffer[e];return t||(t=[],this.unidentifiedGraphsBuffer[e]=t),t}getAnnotationsBufferSafe(e){let t=this.annotationsBuffer[e];return t||(t=[],this.annotationsBuffer[e]=t),t}getExpandOptions(){return s.EXPAND_OPTIONS[this.activeProcessingMode]}shiftStack(e,t){const r=this.idStack[e+t];if(r&&(this.idStack[e]=r,this.emittedStack[e]=!0,delete this.idStack[e+t]),this.pendingContainerFlushBuffers.length)for(const r of this.pendingContainerFlushBuffers)r.depth>=e+t&&(r.depth-=t,r.keys.splice(e,t));this.unidentifiedValuesBuffer[e+t]&&(this.unidentifiedValuesBuffer[e]=this.unidentifiedValuesBuffer[e+t],delete this.unidentifiedValuesBuffer[e+t]),this.annotationsBuffer[e+t-1]&&(this.annotationsBuffer[e-1]||(this.annotationsBuffer[e-1]=[]),this.annotationsBuffer[e-1]=[...this.annotationsBuffer[e-1],...this.annotationsBuffer[e+t-1]],delete this.annotationsBuffer[e+t-1])}}t.ParsingContext=s,s.EXPAND_OPTIONS={1:{allowPrefixForcing:!1,allowPrefixNonGenDelims:!1,allowVocabRelativeToBase:!1},1.1:{allowPrefixForcing:!0,allowPrefixNonGenDelims:!1,allowVocabRelativeToBase:!0}}},22135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=void 0;const n=r(27202),i=r(18050),a=r(45947),o=r(62168);class s{constructor(e){this.parsingContext=e.parsingContext,this.dataFactory=e.dataFactory||new i.DataFactory,this.rdfFirst=this.dataFactory.namedNode(s.RDF+"first"),this.rdfRest=this.dataFactory.namedNode(s.RDF+"rest"),this.rdfNil=this.dataFactory.namedNode(s.RDF+"nil"),this.rdfType=this.dataFactory.namedNode(s.RDF+"type"),this.rdfJson=this.dataFactory.namedNode(s.RDF+"JSON")}static getContextValue(e,t,r,n){const i=e.getContextRaw()[r];if(!i)return n;const a=i[t];return void 0===a?n:a}static getContextValueContainer(e,t){return s.getContextValue(e,"@container",t,{"@set":!0})}static getContextValueType(e,t){const r=s.getContextValue(e,"@type",t,null);return"@none"===r?null:r}static getContextValueLanguage(e,t){return s.getContextValue(e,"@language",t,e.getContextRaw()["@language"]||null)}static getContextValueDirection(e,t){return s.getContextValue(e,"@direction",t,e.getContextRaw()["@direction"]||null)}static isContextValueReverse(e,t){return!!s.getContextValue(e,"@reverse",t,null)}static getContextValueIndex(e,t){return s.getContextValue(e,"@index",t,e.getContextRaw()["@index"]||null)}static isPropertyReverse(e,t,r){return"@reverse"===r!==s.isContextValueReverse(e,t)}static isPropertyInEmbeddedNode(e){return"@id"===e}static isPropertyInAnnotationObject(e){return"@annotation"===e}static isValidIri(e){return null!==e&&n.Util.isValidIri(e)}static isPrefixArray(e,t){if(e.length>t.length)return!1;for(let r=0;r1)throw new n.ErrorCoded(`Found illegal neighbouring entries next to @set for key: '${t}'`,n.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT);return[]}if("@list"in r){if(Object.keys(r).length>1)throw new n.ErrorCoded(`Found illegal neighbouring entries next to @list for key: '${t}'`,n.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT);const e=r["@list"];return Array.isArray(e)?0===e.length?[this.rdfNil]:this.parsingContext.idStack[i+1]||[]:await this.valueToTerm(await this.parsingContext.getContext(a),t,e,i-1,a.slice(0,-1))}if("@reverse"in r&&"boolean"==typeof r["@reverse"])return[];if("@graph"in s.getContextValueContainer(await this.parsingContext.getContext(a),t)){const e=this.parsingContext.graphContainerTermStack[i+1];return e?Object.values(e):[this.dataFactory.blankNode()]}if("@id"in r){if(Object.keys(r).length>1&&(e=await this.parsingContext.getContext(a,0)),"@context"in r&&(e=await this.parsingContext.parseContext(r["@context"],e.getContextRaw())),"@vocab"===r["@type"])return this.nullableTermToArray(this.createVocabOrBaseTerm(e,r["@id"]));{const t=r["@id"];let a;if("object"==typeof t){if(!this.parsingContext.rdfstar)throw new n.ErrorCoded(`Found illegal @id '${r}'`,n.ERROR_CODES.INVALID_ID_VALUE);a=this.parsingContext.idStack[i+1][0]}else a=this.resourceToTerm(e,t);return this.nullableTermToArray(a)}}return this.parsingContext.emittedStack[i+1]||r&&"object"==typeof r&&0===Object.keys(r).length?this.parsingContext.idStack[i+1]||(this.parsingContext.idStack[i+1]=[this.dataFactory.blankNode()]):[];case"string":return this.nullableTermToArray(this.stringValueToTerm(i,await this.getContextSelfOrPropertyScoped(e,t),t,r,null));case"boolean":return this.nullableTermToArray(this.stringValueToTerm(i,await this.getContextSelfOrPropertyScoped(e,t),t,Boolean(r).toString(),this.dataFactory.namedNode(s.XSD_BOOLEAN)));case"number":return this.nullableTermToArray(this.stringValueToTerm(i,await this.getContextSelfOrPropertyScoped(e,t),t,r,this.dataFactory.namedNode(r%1==0&&r<1e21?s.XSD_INTEGER:s.XSD_DOUBLE)));default:return this.parsingContext.emitError(new Error(`Could not determine the RDF type of a ${o}`)),[]}}async getContextSelfOrPropertyScoped(e,t){const r=e.getContextRaw()[t];return r&&"object"==typeof r&&"@context"in r&&(e=await this.parsingContext.parseContext(r,e.getContextRaw(),!0)),e}nullableTermToArray(e){return e?[e]:[]}predicateToTerm(e,t){const r=e.expandTerm(t,!0,this.parsingContext.getExpandOptions());return r?"_"===r[0]&&":"===r[1]?this.parsingContext.produceGeneralizedRdf?this.dataFactory.blankNode(r.substr(2)):null:s.isValidIri(r)?this.dataFactory.namedNode(r):r&&this.parsingContext.strictValues?(this.parsingContext.emitError(new n.ErrorCoded(`Invalid predicate IRI: ${r}`,n.ERROR_CODES.INVALID_IRI_MAPPING)),null):null:null}resourceToTerm(e,t){if(t.startsWith("_:"))return this.dataFactory.blankNode(t.substr(2));const r=e.expandTerm(t,!1,this.parsingContext.getExpandOptions());if(!s.isValidIri(r)){if(!r||!this.parsingContext.strictValues)return null;this.parsingContext.emitError(new Error(`Invalid resource IRI: ${r}`))}return this.dataFactory.namedNode(r)}createVocabOrBaseTerm(e,t){if(t.startsWith("_:"))return this.dataFactory.blankNode(t.substr(2));const r=this.parsingContext.getExpandOptions();let n=e.expandTerm(t,!0,r);if(n===t&&(n=e.expandTerm(t,!1,r)),!s.isValidIri(n)){if(!n||!this.parsingContext.strictValues||n.startsWith("@"))return null;this.parsingContext.emitError(new Error(`Invalid term IRI: ${n}`))}return this.dataFactory.namedNode(n)}intToString(e,t){return"number"==typeof e?Number.isFinite(e)?e%1!=0||t&&t.value===s.XSD_DOUBLE?e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"):Number(e).toString():e>0?"INF":"-INF":e}stringValueToTerm(e,t,r,n,i){const a=s.getContextValueType(t,r);if(a)if("@id"===a){if(!i)return this.resourceToTerm(t,this.intToString(n,i))}else if("@vocab"===a){if(!i)return this.createVocabOrBaseTerm(t,this.intToString(n,i))}else i=this.dataFactory.namedNode(a);if(!i){const a=s.getContextValueLanguage(t,r),o=s.getContextValueDirection(t,r);return o?this.createLanguageDirectionLiteral(e,this.intToString(n,i),a,o):this.dataFactory.literal(this.intToString(n,i),a)}return this.dataFactory.literal(this.intToString(n,i),i)}createLanguageDirectionLiteral(e,t,r,n){if("i18n-datatype"===this.parsingContext.rdfDirection)return r||(r=""),this.dataFactory.literal(t,this.dataFactory.namedNode(`https://www.w3.org/ns/i18n#${r}_${n}`));if("compound-literal"===this.parsingContext.rdfDirection){const i=this.dataFactory.blankNode(),a=this.getDefaultGraph();return this.parsingContext.emitQuad(e,this.dataFactory.quad(i,this.dataFactory.namedNode(s.RDF+"value"),this.dataFactory.literal(t),a)),r&&this.parsingContext.emitQuad(e,this.dataFactory.quad(i,this.dataFactory.namedNode(s.RDF+"language"),this.dataFactory.literal(r),a)),this.parsingContext.emitQuad(e,this.dataFactory.quad(i,this.dataFactory.namedNode(s.RDF+"direction"),this.dataFactory.literal(n),a)),i}return this.dataFactory.literal(t,{language:r||"",direction:n})}valueToJsonString(e){return o(e)}async unaliasKeyword(e,t,r,i,a){if(Number.isInteger(e))return e;if(!i){const e=this.parsingContext.unaliasedKeywordCacheStack[r];if(e)return e}if(!n.Util.isPotentialKeyword(e)){let r=(a=a||await this.parsingContext.getContext(t)).getContextRaw()[e];r&&"object"==typeof r&&(r=r["@id"]),n.Util.isValidKeyword(r)&&(e=r)}return i?e:this.parsingContext.unaliasedKeywordCacheStack[r]=e}async unaliasKeywordParent(e,t){return await this.unaliasKeyword(t>0&&e[t-1],e,t-1)}async unaliasKeywords(e,t,r,n){const i={};for(const a in e)i[await this.unaliasKeyword(a,t,r+1,!0,n)]=e[a];return i}async isLiteral(e,t){for(let r=t;r>=0;r--){if("@annotation"===await this.unaliasKeyword(e[r],e,r))return!1;if(this.parsingContext.literalStack[r]||this.parsingContext.jsonLiteralStack[r])return!0}return!1}async getDepthOffsetGraph(e,t){for(let r=e-1;r>0;r--)if("@graph"===await this.unaliasKeyword(t[r],t,r)){const n=(await a.EntryHandlerContainer.getContainerHandler(this.parsingContext,t,r)).containers;return a.EntryHandlerContainer.isComplexGraphContainer(n)?-1:e-r-1}return-1}validateReverseSubject(e){if("Literal"===e.termType)throw new n.ErrorCoded(`Found illegal literal in subject position: ${e.value}`,n.ERROR_CODES.INVALID_REVERSE_PROPERTY_VALUE)}getDefaultGraph(){return this.parsingContext.defaultGraph||this.dataFactory.defaultGraph()}async getGraphContainerValue(e,t){let r=this.getDefaultGraph();const{containers:n,depth:i}=await a.EntryHandlerContainer.getContainerHandler(this.parsingContext,e,t);if("@graph"in n){const t=a.EntryHandlerContainer.getContainerGraphIndex(n,i,e),o=this.parsingContext.graphContainerTermStack[i];if(r=o?o[t]:null,!r){let a=null;if("@id"in n){const t=await this.getContainerKey(e[i],e,i);null!==t&&(a=await this.resourceToTerm(await this.parsingContext.getContext(e),t))}a||(a=this.dataFactory.blankNode()),this.parsingContext.graphContainerTermStack[i]||(this.parsingContext.graphContainerTermStack[i]={}),r=this.parsingContext.graphContainerTermStack[i][t]=a}}return r}async getPropertiesDepth(e,t){let r=t;for(let n=t-1;n>0;n--)if("number"!=typeof e[n]){const t=await this.unaliasKeyword(e[n],e,n);if("@reverse"===t)return n;if("@nest"!==t)return r;r=n}return r}async getContainerKey(e,t,r){const n=await this.unaliasKeyword(e,t,r);return"@none"===n?null:n}validateReverseInEmbeddedNode(e,t,r){if(r&&t&&!this.parsingContext.rdfstarReverseInEmbedded)throw new n.ErrorCoded(`Illegal reverse property in embedded node in ${e}`,n.ERROR_CODES.INVALID_EMBEDDED_NODE)}emitQuadChecked(e,t,r,i,a,o,s){let c;if(o?(this.validateReverseSubject(i),c=this.dataFactory.quad(i,r,t,a)):c=this.dataFactory.quad(t,r,i,a),s){if("DefaultGraph"!==c.graph.termType&&(c=this.dataFactory.quad(c.subject,c.predicate,c.object)),this.parsingContext.idStack[e-1])throw new n.ErrorCoded("Illegal multiple properties in an embedded node",n.ERROR_CODES.INVALID_EMBEDDED_NODE);this.parsingContext.idStack[e-1]=[c]}else this.parsingContext.emitQuad(e,c);const u=this.parsingContext.annotationsBuffer[e];if(u){for(const t of u)this.emitAnnotation(e,c,t);delete this.parsingContext.annotationsBuffer[e]}}emitAnnotation(e,t,r){let n;r.reverse?(this.validateReverseSubject(r.object),n=this.dataFactory.quad(r.object,r.predicate,t)):n=this.dataFactory.quad(t,r.predicate,r.object),this.parsingContext.emitQuad(e,n);for(const t of r.nestedAnnotations)this.emitAnnotation(e,n,t)}}t.Util=s,s.XSD="http://www.w3.org/2001/XMLSchema#",s.XSD_BOOLEAN=s.XSD+"boolean",s.XSD_INTEGER=s.XSD+"integer",s.XSD_DOUBLE=s.XSD+"double",s.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"},14079:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContainerHandlerIdentifier=void 0,t.ContainerHandlerIdentifier=class{canCombineWithGraph(){return!0}async handle(e,t,r,n,i,a){let o;if(t.emittedStack[a+1]&&t.idStack[a+1])o=t.idStack[a+1][0];else{const e=null!==await r.getContainerKey(n[a],n,a)?await r.resourceToTerm(await t.getContext(n),n[a]):r.dataFactory.blankNode();if(!e)return void(t.emittedStack[a]=!1);o=e,t.idStack[a+1]=[o]}let s=t.idStack[a];s||(s=t.idStack[a]=[]),s.some((e=>e.equals(o)))||s.push(o),await t.handlePendingContainerFlushBuffers()||(t.emittedStack[a]=!1)}}},43354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContainerHandlerIndex=void 0;const n=r(27202),i=r(29997),a=r(22135);t.ContainerHandlerIndex=class{canCombineWithGraph(){return!0}async handle(e,t,r,o,s,c){if(!Array.isArray(s)){const u="@graph"in e,l=await t.getContext(o),d=o[c-1],p=a.Util.getContextValueIndex(l,d);if(p){if(n.Util.isPotentialKeyword(p))throw new n.ErrorCoded(`Keywords can not be used as @index value, got: ${p}`,n.ERROR_CODES.INVALID_TERM_DEFINITION);if("string"!=typeof p)throw new n.ErrorCoded(`@index values must be strings, got: ${p}`,n.ERROR_CODES.INVALID_TERM_DEFINITION);if("object"!=typeof s){if("@id"!==a.Util.getContextValueType(l,d))throw new n.ErrorCoded(`Property-based index containers require nodes as values or strings with @type: @id, but got: ${s}`,n.ERROR_CODES.INVALID_VALUE_OBJECT);const e=r.resourceToTerm(l,s);e&&(t.idStack[c+1]=[e])}const e=r.createVocabOrBaseTerm(l,p);if(e){const n=await r.valueToTerm(l,p,await r.getContainerKey(o[c],o,c),c,o);if(u){const i=await r.getGraphContainerValue(o,c+1);for(const a of n)t.emitQuad(c,r.dataFactory.quad(i,e,a,r.getDefaultGraph()))}else for(const a of n)await i.EntryHandlerPredicate.handlePredicateObject(t,r,o,c+1,e,a,!1,!1,!1)}}const h=u?2:1;await t.newOnValueJob(o.slice(0,o.length-h),s,c-h,!0),await t.handlePendingContainerFlushBuffers()}t.emittedStack[c]=!1}}},68526:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContainerHandlerLanguage=void 0;const n=r(27202);t.ContainerHandlerLanguage=class{canCombineWithGraph(){return!1}async handle(e,t,r,i,a,o){const s=await r.getContainerKey(i[o],i,o);if(Array.isArray(a))a=a.map((e=>({"@value":e,"@language":s})));else{if("string"!=typeof a)throw new n.ErrorCoded(`Got invalid language map value, got '${JSON.stringify(a)}', but expected string`,n.ERROR_CODES.INVALID_LANGUAGE_MAP_VALUE);a={"@value":a,"@language":s}}await t.newOnValueJob(i.slice(0,i.length-1),a,o-1,!0),t.emittedStack[o]=!1}}},84936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContainerHandlerType=void 0;const n=r(29997),i=r(22135);t.ContainerHandlerType=class{canCombineWithGraph(){return!1}async handle(e,t,r,a,o,s){if(!Array.isArray(o)){if("string"==typeof o){const e=await t.getContext(a),n="@vocab"===i.Util.getContextValueType(e,a[s-1])?await r.createVocabOrBaseTerm(e,o):await r.resourceToTerm(e,o);if(n){const e={"@id":"NamedNode"===n.termType?n.value:o};await t.newOnValueJob(a.slice(0,a.length-1),e,s-1,!0),t.idStack[s+1]=[n]}}else{const e=!!t.idStack[s+1];e||delete t.idStack[s],await t.newOnValueJob(a.slice(0,a.length-1),o,s-1,!0),e||(t.idStack[s+1]=t.idStack[s])}const e=await r.getContainerKey(a[s],a,s),c=null!==e?r.createVocabOrBaseTerm(await t.getContext(a),e):null;c&&await n.EntryHandlerPredicate.handlePredicateObject(t,r,a,s+1,r.rdfType,c,!1,!1,!1),await t.handlePendingContainerFlushBuffers()}t.emittedStack[s]=!1}}},11272:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerArrayValue=void 0;const n=r(22135),i=r(27202);t.EntryHandlerArrayValue=class{isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(e,t,r,n,i){return this.test(e,t,null,r,n)}async test(e,t,r,n,i){return"number"==typeof n[i]}async handle(e,t,r,i,a,o){let s=await t.unaliasKeywordParent(i,o);if("@list"===s){let r=null,n=0;for(let e=o-2;e>0;e--){const t=i[e];if("string"==typeof t||"number"==typeof t){n=e,r=t;break}}if(null!==r){const s=await t.valueToTerm(await e.getContext(i),r,a,o,i);for(const r of s)await this.handleListElement(e,t,r,a,o,i.slice(0,n),n);0===s.length&&await this.handleListElement(e,t,null,a,o,i.slice(0,n),n)}}else if("@set"===s)await e.newOnValueJob(i.slice(0,-2),a,o-2,!1);else if(void 0!==s&&"@type"!==s){for(let e=o-1;e>0;e--)if("number"!=typeof i[e]){s=await t.unaliasKeyword(i[e],i,e);break}const r=await e.getContext(i.slice(0,-1));if("@list"in n.Util.getContextValueContainer(r,s)){e.emittedStack[o+1]=!0;const r=await t.valueToTerm(await e.getContext(i),s,a,o,i);for(const n of r)await this.handleListElement(e,t,n,a,o,i.slice(0,-1),o-1);0===r.length&&await this.handleListElement(e,t,null,a,o,i.slice(0,-1),o-1)}else e.shiftStack(o,1),await e.newOnValueJob(i.slice(0,-1),a,o-1,!1),e.contextTree.removeContext(i.slice(0,-1))}}async handleListElement(e,t,r,n,a,o,s){let c=e.listPointerStack[a];if(null!==n&&null!==(await t.unaliasKeywords(n,o,a))["@value"]){if(c&&c.value){const r=t.dataFactory.blankNode();e.emitQuad(a,t.dataFactory.quad(c.value,t.rdfRest,r,t.getDefaultGraph())),c.value=r}else{const e=t.dataFactory.blankNode();c={value:e,listRootDepth:s,listId:e}}r&&e.emitQuad(a,t.dataFactory.quad(c.value,t.rdfFirst,r,t.getDefaultGraph()))}else c||(c={listRootDepth:s,listId:t.rdfNil});e.listPointerStack[a]=c,e.rdfstar&&e.annotationsBuffer[a]&&e.emitError(new i.ErrorCoded("Found an illegal annotation inside a list",i.ERROR_CODES.INVALID_ANNOTATION))}}},45947:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerContainer=void 0;const n=r(14079),i=r(43354),a=r(68526),o=r(84936),s=r(22135);class c{static isSimpleGraphContainer(e){return"@graph"in e&&("@set"in e&&2===Object.keys(e).length||1===Object.keys(e).length)}static isComplexGraphContainer(e){return"@graph"in e&&("@set"in e&&Object.keys(e).length>2||!("@set"in e)&&Object.keys(e).length>1)}static getContainerGraphIndex(e,t,r){let n=c.isSimpleGraphContainer(e),i="";for(let e=t;e=0;e--)if("number"!=typeof t[e]){const r=s.Util.getContextValue(a,"@container",t[e],!1);if(r&&c.isSimpleGraphContainer(r))return{containers:r,depth:e+1,fallback:!1};const o=s.Util.getContextValue(a,"@container",t[e-1],!1);if(o){const t="@graph"in o;for(const r in c.CONTAINER_HANDLERS)if(o[r])return t?c.CONTAINER_HANDLERS[r].canCombineWithGraph()?{containers:o,depth:e,fallback:!1}:n:i?n:{containers:o,depth:e,fallback:!1};return n}if(i)return n;i=!0}return n}static async isBufferableContainerHandler(e,t,r){const n=await c.getContainerHandler(e,t,r);return!n.fallback&&!("@graph"in n.containers)}isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(e,t,r,n,i){return!!await this.test(e,t,null,r,n)}async test(e,t,r,n,i){const a=s.Util.getContextValueContainer(await e.getContext(n,2),n[i-1]);for(const e in c.CONTAINER_HANDLERS)if(a[e])return{containers:a,handler:c.CONTAINER_HANDLERS[e]};return null}async handle(e,t,r,n,i,a,o){return o.handler.handle(o.containers,e,t,n,i,a)}}t.EntryHandlerContainer=c,c.CONTAINER_HANDLERS={"@id":new n.ContainerHandlerIdentifier,"@index":new i.ContainerHandlerIndex,"@language":new a.ContainerHandlerLanguage,"@type":new o.ContainerHandlerType}},62885:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerInvalidFallback=void 0,t.EntryHandlerInvalidFallback=class{isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(e,t,r,n,i){return!1}async test(e,t,r,n,i){return!0}async handle(e,t,r,n,i,a){e.emittedStack[a]=!1}}},29997:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerPredicate=void 0;const n=r(27202),i=r(22135);class a{static async handlePredicateObject(e,t,r,i,a,o,s,c,u){const l=await t.getPropertiesDepth(r,i),d=await t.getDepthOffsetGraph(i,r),p=i-d,h=e.idStack[l];if(h&&!u)for(const n of h)if(d>=0){const r=e.idStack[p-1];if(r)for(const e of r)t.emitQuadChecked(i,n,a,o,e,s,c);else s?(t.validateReverseSubject(o),e.getUnidentifiedGraphBufferSafe(p-1).push({subject:o,predicate:a,object:n,isEmbedded:c})):e.getUnidentifiedGraphBufferSafe(p-1).push({subject:n,predicate:a,object:o,isEmbedded:c})}else{const e=await t.getGraphContainerValue(r,l);t.emitQuadChecked(i,n,a,o,e,s,c)}else if(s&&t.validateReverseSubject(o),u){if(e.rdfstar){e.idStack[i]&&e.emitError(new n.ErrorCoded(`Found an illegal @id inside an annotation: ${e.idStack[i][0].value}`,n.ERROR_CODES.INVALID_ANNOTATION));for(let a=0;a=0;e--){const t=c[e];t.depth>l&&(u.nestedAnnotations.push(t),c.splice(e,1))}}}else e.getUnidentifiedValueBufferSafe(l).push({predicate:a,object:o,reverse:s,isEmbedded:c})}isPropertyHandler(){return!0}isStackProcessor(){return!0}async validate(e,t,r,n,a){const o=r[n];if(o){const a=await e.getContext(r);if(!e.jsonLiteralStack[n]&&await t.predicateToTerm(a,r[n]))return"@json"===i.Util.getContextValueType(a,o)&&(e.jsonLiteralStack[n+1]=!0),!0}return!1}async test(e,t,r,n,i){return n[i]}async handle(e,t,r,o,s,c,u){const l=o[c],d=await e.getContext(o),p=await t.predicateToTerm(d,r);if(p){const u=await t.valueToTerm(d,r,s,c,o);if(u.length)for(let h of u){let u=await t.unaliasKeywordParent(o,c);const f=i.Util.isPropertyReverse(d,l,u);let y=0;for(;"@reverse"===u||"number"==typeof u;)"number"==typeof u?y++:c--,u=await t.unaliasKeywordParent(o,c-y);const m=i.Util.isPropertyInEmbeddedNode(u);t.validateReverseInEmbeddedNode(r,f,m);const g=i.Util.isPropertyInAnnotationObject(u);if(s){const a="@list"in i.Util.getContextValueContainer(d,r);if(a||s["@list"]){if((a&&!Array.isArray(s)&&!s["@list"]||s["@list"]&&!Array.isArray(s["@list"]))&&h!==t.rdfNil){const r=t.dataFactory.blankNode();e.emitQuad(c,t.dataFactory.quad(r,t.rdfRest,t.rdfNil,t.getDefaultGraph())),e.emitQuad(c,t.dataFactory.quad(r,t.rdfFirst,h,t.getDefaultGraph())),h=r}if(f&&!e.allowSubjectList)throw new n.ErrorCoded(`Found illegal list value in subject position at ${r}`,n.ERROR_CODES.INVALID_REVERSE_PROPERTY_VALUE)}}await a.handlePredicateObject(e,t,o,c,p,h,f,m,g)}}}}t.EntryHandlerPredicate=a},49203:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeyword=void 0,t.EntryHandlerKeyword=class{constructor(e){this.keyword=e}isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(e,t,r,n,i){return!1}async test(e,t,r,n,i){return r===this.keyword}}},6042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordAnnotation=void 0;const n=r(49203),i=r(27202);class a extends n.EntryHandlerKeyword{constructor(){super("@annotation")}async handle(e,t,r,n,a,o){("string"==typeof a||"object"==typeof a&&a["@value"])&&e.emitError(new i.ErrorCoded(`Found illegal annotation value: ${JSON.stringify(a)}`,i.ERROR_CODES.INVALID_ANNOTATION))}}t.EntryHandlerKeywordAnnotation=a},66700:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordContext=void 0;const n=r(27202),i=r(49203);class a extends i.EntryHandlerKeyword{constructor(){super("@context")}isStackProcessor(){return!1}async handle(e,t,r,i,a,o){e.streamingProfile&&(e.processingStack[o]||e.processingType[o]||void 0!==e.idStack[o])&&e.emitError(new n.ErrorCoded("Found an out-of-order context, while streaming is enabled.(disable `streamingProfile`)",n.ERROR_CODES.INVALID_STREAMING_KEY_ORDER));const s=e.getContext(i),c=e.parseContext(a,(await s).getContextRaw());e.contextTree.setContext(i.slice(0,-1),c),e.emitContext(a),await e.validateContext(await c)}}t.EntryHandlerKeywordContext=a},37071:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordGraph=void 0;const n=r(49203);class i extends n.EntryHandlerKeyword{constructor(){super("@graph")}async handle(e,t,r,n,i,a){e.graphStack[a+1]=!0}}t.EntryHandlerKeywordGraph=i},48978:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordId=void 0;const n=r(27202),i=r(49203);class a extends i.EntryHandlerKeyword{constructor(){super("@id")}isStackProcessor(){return!1}async handle(e,t,r,i,a,o){if("string"!=typeof a){if(e.rdfstar&&"object"==typeof a){const t=Object.keys(a);1===t.length&&"@id"===t[0]&&e.emitError(new n.ErrorCoded(`Invalid embedded node without property with @id ${a["@id"]}`,n.ERROR_CODES.INVALID_EMBEDDED_NODE))}else e.emitError(new n.ErrorCoded(`Found illegal @id '${a}'`,n.ERROR_CODES.INVALID_ID_VALUE));return}const s=await t.getPropertiesDepth(i,o);if(void 0!==e.idStack[s]&&(e.idStack[s][0].listHead?e.emitError(new n.ErrorCoded(`Found illegal neighbouring entries next to @list for key: '${i[o-1]}'`,n.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT)):e.emitError(new n.ErrorCoded(`Found duplicate @ids '${e.idStack[s][0].value}' and '${a}'`,n.ERROR_CODES.COLLIDING_KEYWORDS))),e.rdfstar&&e.annotationsBuffer[o])for(const t of e.annotationsBuffer[o])t.depth===o&&e.emitError(new n.ErrorCoded(`Found an illegal @id inside an annotation: ${a}`,n.ERROR_CODES.INVALID_ANNOTATION));e.idStack[s]=t.nullableTermToArray(await t.resourceToTerm(await e.getContext(i),a))}}t.EntryHandlerKeywordId=a},30643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordIncluded=void 0;const n=r(27202),i=r(49203);class a extends i.EntryHandlerKeyword{constructor(){super("@included")}async handle(e,t,r,i,a,o){"object"!=typeof a&&e.emitError(new n.ErrorCoded(`Found illegal @included '${a}'`,n.ERROR_CODES.INVALID_INCLUDED_VALUE));const s=await t.unaliasKeywords(a,i,o,await e.getContext(i));"@value"in s&&e.emitError(new n.ErrorCoded(`Found an illegal @included @value node '${JSON.stringify(a)}'`,n.ERROR_CODES.INVALID_INCLUDED_VALUE)),"@list"in s&&e.emitError(new n.ErrorCoded(`Found an illegal @included @list node '${JSON.stringify(a)}'`,n.ERROR_CODES.INVALID_INCLUDED_VALUE)),e.emittedStack[o]=!1}}t.EntryHandlerKeywordIncluded=a},58865:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordNest=void 0;const n=r(27202),i=r(49203);class a extends i.EntryHandlerKeyword{constructor(){super("@nest")}async handle(e,t,r,i,a,o){"object"!=typeof a&&e.emitError(new n.ErrorCoded(`Found invalid @nest entry for '${r}': '${a}'`,n.ERROR_CODES.INVALID_NEST_VALUE)),"@value"in await t.unaliasKeywords(a,i,o,await e.getContext(i))&&e.emitError(new n.ErrorCoded(`Found an invalid @value node for '${r}'`,n.ERROR_CODES.INVALID_NEST_VALUE)),e.emittedStack[o]=!1}}t.EntryHandlerKeywordNest=a},23787:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordType=void 0;const n=r(27202),i=r(22135),a=r(29997),o=r(49203);class s extends o.EntryHandlerKeyword{constructor(){super("@type")}isStackProcessor(){return!1}async handle(e,t,r,o,s,c){const u=o[c],l=await e.getContext(o),d=t.rdfType,p=await t.unaliasKeywordParent(o,c),h=i.Util.isPropertyReverse(l,u,p),f=i.Util.isPropertyInEmbeddedNode(p);t.validateReverseInEmbeddedNode(r,h,f);const y=i.Util.isPropertyInAnnotationObject(p),m=Array.isArray(s)?s:[s];for(const r of m){"string"!=typeof r&&e.emitError(new n.ErrorCoded(`Found illegal @type '${r}'`,n.ERROR_CODES.INVALID_TYPE_VALUE));const i=t.createVocabOrBaseTerm(l,r);i&&await a.EntryHandlerPredicate.handlePredicateObject(e,t,o,c,d,i,h,f,y)}let g=Promise.resolve(l),b=!1;for(const t of m.sort()){const r=i.Util.getContextValue(l,"@context",t,null);r&&(b=!0,g=g.then((t=>e.parseContext(r,t.getContextRaw()))))}!e.streamingProfile||!b&&e.streamingProfileAllowOutOfOrderPlainType||!e.processingStack[c]&&!e.idStack[c]||e.emitError(new n.ErrorCoded("Found an out-of-order type-scoped context, while streaming is enabled.(disable `streamingProfile`)",n.ERROR_CODES.INVALID_STREAMING_KEY_ORDER)),b&&(g=g.then((e=>!0!==e.getContextRaw()["@propagate"]?new n.JsonLdContextNormalized(Object.assign(Object.assign({},e.getContextRaw()),{"@propagate":!1,"@__propagateFallback":l.getContextRaw()})):e)),e.contextTree.setContext(o.slice(0,o.length-1),g)),e.processingType[c]=!0}}t.EntryHandlerKeywordType=s},30635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordUnknownFallback=void 0;const n=r(27202);class i{isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(e,t,r,i,a){const o=await t.unaliasKeyword(r[i],r,i);return!(!n.Util.isPotentialKeyword(o)||!a&&"@list"===o)}async test(e,t,r,i,a){return n.Util.isPotentialKeyword(r)}async handle(e,t,r,a,o,s){const c=i.VALID_KEYWORDS_TYPES[r];void 0!==c?c&&typeof o!==c.type&&e.emitError(new n.ErrorCoded(`Invalid value type for '${r}' with value '${o}'`,c.errorCode)):e.strictValues&&e.emitError(new Error(`Unknown keyword '${r}' with value '${o}'`)),e.emittedStack[s]=!1}}t.EntryHandlerKeywordUnknownFallback=i,i.VALID_KEYWORDS_TYPES={"@index":{type:"string",errorCode:n.ERROR_CODES.INVALID_INDEX_VALUE},"@list":null,"@reverse":{type:"object",errorCode:n.ERROR_CODES.INVALID_REVERSE_VALUE},"@set":null,"@value":null}},94382:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordValue=void 0;const n=r(49203);class i extends n.EntryHandlerKeyword{constructor(){super("@value")}async validate(e,t,r,n,i){const a=r[n];return a&&!e.literalStack[n]&&await this.test(e,t,a,r,n)&&(e.literalStack[n]=!0),super.validate(e,t,r,n,i)}async test(e,t,r,n,i){return"@value"===await t.unaliasKeyword(n[i],n.slice(0,n.length-1),i-1,!0)}async handle(e,t,r,n,i,a){e.literalStack[a]=!0,delete e.unidentifiedValuesBuffer[a],delete e.unidentifiedGraphsBuffer[a],e.emittedStack[a]=!1}}t.EntryHandlerKeywordValue=i},85832:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(45920),t),i(r(7814),t)},45920:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonLdSerializer=void 0;const n=r(27202),i=r(85071),a=r(7814),o=r(58521);class s extends o.Transform{constructor(e={}){super({objectMode:!0}),this.indentation=0,this.options=e,this.options.baseIRI&&!this.options.context&&(this.options.context={"@base":this.options.baseIRI}),this.options.context?(this.originalContext=this.options.context,this.context=(new n.ContextParser).parse(this.options.context,{baseIRI:this.options.baseIRI})):this.context=Promise.resolve(new n.JsonLdContextNormalized({}))}import(e){const t=new o.PassThrough({objectMode:!0});e.on("error",(e=>r.emit("error",e))),e.on("data",(e=>t.push(e))),e.on("end",(()=>t.push(null)));const r=t.pipe(new s(this.options));return r}_transform(e,t,r){this.context.then((t=>{this.transformQuad(e,t),r()})).catch(r)}async list(e){const t=await this.context;return{"@list":e.map((e=>a.Util.termToValue(e,t,this.options)))}}_flush(e){return this.opened||this.pushDocumentStart(),this.lastPredicate&&this.endPredicate(),this.lastSubject&&this.endSubject(),this.lastGraph&&"DefaultGraph"!==this.lastGraph.termType&&this.endGraph(),this.endDocument(),e(null,null)}transformQuad(e,t){this.opened||this.pushDocumentStart();const r=this.lastGraph&&"DefaultGraph"!==this.lastGraph.termType&&this.lastGraph.equals(e.subject);if(!(r||this.lastGraph&&e.graph.equals(this.lastGraph))){let r="DefaultGraph"!==e.graph.termType&&this.lastSubject&&this.lastSubject.equals(e.graph);this.lastGraph&&("DefaultGraph"!==this.lastGraph.termType?(this.endPredicate(),this.endSubject(),this.endGraph(!0),r=!1):r?(this.endPredicate(!0),this.lastSubject=null):(this.endPredicate(),this.endSubject(!0))),"DefaultGraph"!==e.graph.termType&&(r||this.pushId(e.graph,!0,t),this.pushSeparator(this.options.space?i.SeparatorType.GRAPH_FIELD_NONCOMPACT:i.SeparatorType.GRAPH_FIELD_COMPACT),this.indentation++),this.lastGraph=e.graph}this.lastSubject&&e.subject.equals(this.lastSubject)||(r?(this.endPredicate(),this.endSubject(),this.indentation--,this.pushSeparator(i.SeparatorType.ARRAY_END_COMMA),this.lastGraph=e.graph):(this.lastSubject&&(this.endPredicate(),this.endSubject(!0)),this.pushId(e.subject,!0,t)),this.lastSubject=e.subject),this.lastPredicate&&e.predicate.equals(this.lastPredicate)||(this.lastPredicate&&this.endPredicate(!0),this.pushPredicate(e.predicate,t)),this.pushObject(e.object,t)}pushDocumentStart(){this.opened=!0,this.originalContext&&!this.options.excludeContext?(this.pushSeparator(i.SeparatorType.OBJECT_START),this.indentation++,this.pushSeparator(i.SeparatorType.CONTEXT_FIELD),this.pushIndented(JSON.stringify(this.originalContext,null,this.options.space)+","),this.pushSeparator(this.options.space?i.SeparatorType.GRAPH_FIELD_NONCOMPACT:i.SeparatorType.GRAPH_FIELD_COMPACT),this.indentation++):(this.pushSeparator(i.SeparatorType.ARRAY_START),this.indentation++)}pushId(e,t,r){if("Quad"===e.termType)this.pushNestedQuad(e,!0,r);else{const n="BlankNode"===e.termType?"_:"+e.value:r.compactIri(e.value,!1);t?this.pushSeparator(i.SeparatorType.OBJECT_START):(this.push(i.SeparatorType.OBJECT_START.label),this.options.space&&this.push("\n")),this.indentation++,this.pushIndented(this.options.space?`"@id": "${n}",`:`"@id":"${n}",`)}}pushPredicate(e,t){let r=e.value;this.options.useRdfType||r!==a.Util.RDF_TYPE||(r="@type",this.objectOptions=Object.assign(Object.assign({},this.options),{compactIds:!0,vocab:!0}));const n=t.compactIri(r,!0);this.pushIndented(this.options.space?`"${n}": [`:`"${n}":[`),this.indentation++,this.lastPredicate=e}pushObject(e,t){if(this.hadObjectForPredicate?this.pushSeparator(i.SeparatorType.COMMA):this.hadObjectForPredicate=!0,"Quad"===e.termType){const r=this.lastSubject,n=this.lastPredicate;return this.hadObjectForPredicate=!1,this.pushNestedQuad(e,!1,t),this.endSubject(!1),this.hadObjectForPredicate=!0,this.lastPredicate=n,void(this.lastSubject=r)}let r;try{r=e["@list"]?e:a.Util.termToValue(e,t,this.objectOptions||this.options)}catch(e){return this.emit("error",e)}this.pushIndented(JSON.stringify(r,null,this.options.space))}pushNestedQuad(e,t,r){this.pushSeparator(i.SeparatorType.OBJECT_START),this.indentation++,this.pushIndented(this.options.space?'"@id": ':'"@id":',!1),"DefaultGraph"!==e.graph.termType&&this.emit("error",new Error(`Found a nested quad with the non-default graph: ${e.graph.value}`)),this.pushId(e.subject,!1,r),this.pushPredicate(e.predicate,r),this.pushObject(e.object,r),this.endPredicate(!1),this.endSubject(t)}endDocument(){this.opened=!1,this.originalContext&&!this.options.excludeContext?(this.indentation--,this.pushSeparator(i.SeparatorType.ARRAY_END),this.indentation--,this.pushSeparator(i.SeparatorType.OBJECT_END)):(this.indentation--,this.pushSeparator(i.SeparatorType.ARRAY_END))}endPredicate(e){this.indentation--,this.pushSeparator(e?i.SeparatorType.ARRAY_END_COMMA:i.SeparatorType.ARRAY_END),this.hadObjectForPredicate=!1,this.objectOptions=null,this.lastPredicate=null}endSubject(e){this.indentation--,this.pushSeparator(e?i.SeparatorType.OBJECT_END_COMMA:i.SeparatorType.OBJECT_END),this.lastSubject=null}endGraph(e){this.indentation--,this.pushSeparator(i.SeparatorType.ARRAY_END),this.indentation--,this.pushSeparator(e?i.SeparatorType.OBJECT_END_COMMA:i.SeparatorType.OBJECT_END),this.lastGraph=null}pushSeparator(e){this.pushIndented(e.label)}pushIndented(e,t=!0){const r=this.getIndentPrefix(),n=e.split("\n").map((e=>r+e)).join("\n");this.push(n),this.options.space&&t&&this.push("\n")}getIndentPrefix(){return this.options.space?this.options.space.repeat(this.indentation):""}}t.JsonLdSerializer=s},85071:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SeparatorType=void 0;class r{constructor(e){this.label=e}}t.SeparatorType=r,r.COMMA=new r(","),r.OBJECT_START=new r("{"),r.OBJECT_END=new r("}"),r.OBJECT_END_COMMA=new r("},"),r.ARRAY_START=new r("["),r.ARRAY_END=new r("]"),r.ARRAY_END_COMMA=new r("],"),r.GRAPH_FIELD_NONCOMPACT=new r('"@graph": ['),r.GRAPH_FIELD_COMPACT=new r('"@graph":['),r.CONTEXT_FIELD=new r('"@context":')},7814:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=void 0;const n=r(27202);class i{static termToValue(e,t,r={compactIds:!1,useNativeTypes:!1}){switch(e.termType){case"NamedNode":const a=t.compactIri(e.value,r.vocab);return r.compactIds?a:{"@id":a};case"DefaultGraph":return r.compactIds?e.value:{"@id":e.value};case"BlankNode":const o=`_:${e.value}`;return r.compactIds?o:{"@id":o};case"Literal":if(e.datatype.value===i.RDF_JSON){let t;try{t=JSON.parse(e.value)}catch(e){throw new n.ErrorCoded("Invalid JSON literal: "+e.message,n.ERROR_CODES.INVALID_JSON_LITERAL)}return{"@value":t,"@type":"@json"}}if("i18n-datatype"===r.rdfDirection&&e.datatype.value.startsWith(i.I18N)){const[t,r]=e.datatype.value.substr(i.I18N.length,e.datatype.value.length).split("_");return Object.assign(Object.assign({"@value":e.value},t?{"@language":t}:{}),r?{"@direction":r}:{})}const s=e.datatype.value===i.XSD_STRING,c={"@value":!s&&r.useNativeTypes?i.stringToNativeType(e.value,e.datatype.value):e.value};return e.language?e.direction&&!r.rdfDirection?Object.assign(Object.assign({},c),{"@language":e.language,"@direction":e.direction}):Object.assign(Object.assign({},c),{"@language":e.language}):s||"string"!=typeof c["@value"]?c:Object.assign(Object.assign({},c),{"@type":e.datatype.value})}}static stringToNativeType(e,t){if(t.startsWith(i.XSD))switch(t.substr(i.XSD.length)){case"boolean":if("true"===e)return!0;if("false"===e)return!1;throw new Error(`Invalid xsd:boolean value '${e}'`);case"integer":case"number":case"int":case"byte":case"long":const t=parseInt(e,10);if(isNaN(t))throw new Error(`Invalid xsd:integer value '${e}'`);return t;case"float":case"double":const r=parseFloat(e);if(isNaN(r))throw new Error(`Invalid xsd:float value '${e}'`);return r}return e}}t.Util=i,i.XSD="http://www.w3.org/2001/XMLSchema#",i.XSD_STRING=i.XSD+"string",i.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i.RDF_TYPE=i.RDF+"type",i.RDF_JSON=i.RDF+"JSON",i.I18N="https://www.w3.org/ns/i18n#"},7784:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},54957:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BaseIRI:()=>ee,BlankNode:()=>E,DataFactory:()=>T,DefaultGraph:()=>x,EntityIndex:()=>ye,Lexer:()=>y,Literal:()=>S,NamedNode:()=>w,Parser:()=>U,Quad:()=>R,Reasoner:()=>Te,Store:()=>me,StoreFactory:()=>ve,StreamParser:()=>Se,StreamWriter:()=>Ee,Term:()=>O,Triple:()=>R,Util:()=>n,Variable:()=>A,Writer:()=>ce,default:()=>Ae,getRulesFromDataset:()=>_e,termFromId:()=>I,termToId:()=>P});var n={};r.r(n),r.d(n,{inDefaultGraph:()=>K,isBlankNode:()=>$,isDefaultGraph:()=>z,isLiteral:()=>G,isNamedNode:()=>V,isQuad:()=>H,isVariable:()=>Q,prefix:()=>X,prefixes:()=>W});var i=r(1048);const a="http://www.w3.org/1999/02/22-rdf-syntax-ns#",o="http://www.w3.org/2001/XMLSchema#",s="http://www.w3.org/2000/10/swap/",c={xsd:{decimal:`${o}decimal`,boolean:`${o}boolean`,double:`${o}double`,integer:`${o}integer`,string:`${o}string`},rdf:{type:`${a}type`,nil:`${a}nil`,first:`${a}first`,rest:`${a}rest`,langString:`${a}langString`,dirLangString:`${a}dirLangString`,reifies:`${a}reifies`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${s}reify#forSome`,forAll:`${s}reify#forAll`},log:{implies:`${s}log#implies`,isImpliedBy:`${s}log#isImpliedBy`}},{xsd:u}=c,l=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,d={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},p=/[\x00-\x20<>\\"\{\}\|\^\`]/,h={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_dircode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},f=/$0^/;class y{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9])/i,this._dircode=/^--(ltr)|(rtl)/,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._atKeyword=/^@[a-z]+(?=[\s#<:])/i,this._keyword=/^(?:PREFIX|BASE|VERSION|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const e in this)!(e in h)&&this[e]instanceof RegExp&&(this[e]=f)}else this._n3Mode=!1!==e.n3;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let r=this._input,n=r.length;for(;;){let e,o;for(;e=this._newline.exec(r);)this.comments&&(o=this._comment.exec(e[0]))&&i("comment",o[1],"",this._line,e[0].length),r=r.substr(e[0].length,r.length),n=r.length,this._line++;if(!e&&(e=this._whitespace.exec(r))&&(r=r.substr(e[0].length,r.length)),this._endOfFile.test(r))return t&&(this.comments&&(o=this._comment.exec(r))&&i("comment",o[1],"",this._line,r.length),r=null,i("eof","","",this._line,0)),this._input=r;const s=this._line,c=r[0];let l="",d="",h="",f=null,y=0,m=!1;switch(c){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(y=1,l="^");break}if(this._previousMarker="^^",r=r.substr(2),"<"!==r[0]){m=!0;break}case"<":if(f=this._unescapedIri.exec(r))l="IRI",d=f[1];else if(f=this._iri.exec(r)){if(d=this._unescape(f[1]),null===d||p.test(d))return a(this);l="IRI"}else r.length>2&&"<"===r[1]&&"("===r[2]?(l="<<(",y=3):!this._lineMode&&r.length>(t?1:2)&&"<"===r[1]?(l="<<",y=2):this._n3Mode&&r.length>1&&"="===r[1]&&(y=2,this._isImpliedBy?(l="abbreviation",d="<"):(l="inverse",d=">"));break;case">":r.length>1&&">"===r[1]&&(l=">>",y=2);break;case"_":((f=this._blank.exec(r))||t&&(f=this._blank.exec(`${r} `)))&&(l="blank",h="_",d=f[1]);break;case'"':if(f=this._simpleQuotedString.exec(r))d=f[1];else if(({value:d,matchLength:y}=this._parseLiteral(r)),null===d)return a(this);null===f&&0===y||(l="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(f=this._simpleApostropheString.exec(r))d=f[1];else if(({value:d,matchLength:y}=this._parseLiteral(r)),null===d)return a(this);null===f&&0===y||(l="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(f=this._variable.exec(r))&&(l="var",d=f[0]);break;case"@":"literal"===this._previousMarker&&(f=this._langcode.exec(r))&&"version"!==f[1]?(l="langcode",d=f[1]):(f=this._atKeyword.exec(r))&&(l=f[0]);break;case".":if(1===r.length?t:r[1]<"0"||r[1]>"9"){l=".",y=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":if("-"===r[1]){"langcode"===this._previousMarker&&(f=this._dircode.exec(r))&&(l="dircode",y=2,d=f[1]||f[2],y=d.length+2);break}(f=this._number.exec(r)||t&&(f=this._number.exec(`${r} `)))&&(l="literal",d=f[0],h="string"==typeof f[1]?u.double:"string"==typeof f[2]?u.decimal:u.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":case"V":case"v":(f=this._keyword.exec(r))?l=f[0].toUpperCase():m=!0;break;case"f":case"t":(f=this._boolean.exec(r))?(l="literal",d=f[0],h=u.boolean):m=!0;break;case"a":(f=this._shortPredicates.exec(r))?(l="abbreviation",d="a"):m=!0;break;case"=":this._n3Mode&&r.length>1&&(l="abbreviation",">"!==r[1]?(y=1,d="="):(y=2,d=">"));break;case"!":if(!this._n3Mode)break;case")":if(!t&&(1===r.length||2===r.length&&">"===r[1]))break;if(r.length>2&&">"===r[1]&&">"===r[2]){l=")>>",y=3;break}case",":case";":case"[":case"]":case"(":case"}":case"~":this._lineMode||(y=1,l=c);break;case"{":!this._lineMode&&r.length>=2&&("|"===r[1]?(l="{|",y=2):(l=c,y=1));break;case"|":r.length>=2&&"}"===r[1]&&(l="|}",y=2);break;default:m=!0}if(m&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(f=this._prefix.exec(r))?((f=this._prefixed.exec(r))||t&&(f=this._prefixed.exec(`${r} `)))&&(l="prefixed",h=f[1]||"",d=this._unescape(f[2])):(l="prefix",d=f[1]||"")),"^^"===this._previousMarker)switch(l){case"prefixed":l="type";break;case"IRI":l="typeIRI";break;default:l=""}if(!l)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?a(this):this._input=r;const g=y||f[0].length,b=i(l,d,h,s,g);this.previousToken=b,this._previousMarker=l,r=r.substr(g,r.length)}function i(t,i,a,o,s){const c=r?n-r.length:n,u={type:t,value:i,prefix:a,line:o,start:c,end:c+s};return e(null,u),u}function a(t){e(t._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(l,((e,r,n,i)=>{if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){let e=Number.parseInt(n,16);return e<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in d?d[i]:(t=!0,"")}));return t?null:r}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length;let n=Math.max(this._literalClosingPos,r);for(;(n=e.indexOf(t,n))>0;){let t=0;for(;"\\"===e[n-t-1];)t++;if(t%2==0){const t=e.substring(r,n),i=t.split(/\r\n|\r|\n/).length-1,a=n+r;if(1===r&&0!==i||3===r&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:a}}n++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,t){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof t){const e=[];let t;if(this._tokenizeToEnd(((r,n)=>r?t=r:e.push(n)),!0),t)throw t;return e}queueMicrotask((()=>this._tokenizeToEnd(t,!0)))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=i.Buffer.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))})),e.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(t,!0)})),e.on("error",t)}}const{rdf:m,xsd:g}=c;let b,v=0;const _={namedNode:N,blankNode:j,variable:D,literal:L,defaultGraph:function(){return b},quad:F,triple:F,fromTerm:M,fromQuad:C},T=_;class O{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof O?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class w extends O{get termType(){return"NamedNode"}}class S extends O{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;const r=e.lastIndexOf("--");return tt?e.substr(0,r):e).substr(t).toLowerCase():""}get direction(){const e=this.id,t=e.lastIndexOf('"'),r=e.lastIndexOf("--");return r>t&&r+20?m.dirLangString:m.langString}equals(e){return e instanceof S?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(this.direction===e.direction||""===this.direction&&!e.direction)&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,direction:this.direction,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class E extends O{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class A extends O{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}class x extends O{constructor(){return super(""),b||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}}function I(e,t,r){if(t=t||_,!e)return t.defaultGraph();switch(e[0]){case"?":return t.variable(e.substr(1));case"_":return t.blankNode(e.substr(2));case'"':if(t===_)return new S(e);if('"'===e[e.length-1])return t.literal(e.substr(1,e.length-2));const n=e.lastIndexOf('"',e.length-1);let i;if("@"===e[n+1]){i=e.substr(n+2);const t=i.lastIndexOf("--");t>0&&t0?"INF":"-INF")))),""===r||r===g.string?new S(`"${e}"`):new S(`"${e}"^^${r}`)}function D(e){return new A(e)}function F(e,t,r,n){return new R(e,t,r,n)}function M(e){if(e instanceof O)return e;switch(e.termType){case"NamedNode":return N(e.value);case"BlankNode":return j(e.value);case"Variable":return D(e.value);case"DefaultGraph":return b;case"Literal":return L(e.value,e.language||e.datatype);case"Quad":return C(e);default:throw new Error(`Unexpected termType: ${e.termType}`)}}function C(e){if(e instanceof R)return e;if("Quad"!==e.termType)throw new Error(`Unexpected termType: ${e.termType}`);return F(M(e.subject),M(e.predicate),M(e.object),M(e.graph))}let k=0;class U{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&q(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(t),n=/trig/.test(t),i=/triple/.test(t),a=/quad/.test(t),o=this._n3Mode=/n3/.test(t),s=i||a;(this._supportsNamedGraphs=!(r||o))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||i||o),this._isImpliedBy=e.isImpliedBy,s&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new y({lineMode:s,n3:o,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers,this._parseUnsupportedVersions=!!e.parseUnsupportedVersions,this._version=e.version}static _resetBlankNodePrefix(){k=0}_setBase(e){if(e){const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,r,n,i){const a=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:n,object:i,graph:t,inverse:!!a&&this._inversePredicate,blankPrefix:a?this._prefixes._:"",quantified:a?this._quantified:null}),a&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.quantified)}_readBeforeTopContext(e){return this._version&&!this._isValidVersion(this._version)?this._error(`Detected unsupported version as media type parameter: "${this._version}"`,e):this._readInTopContext(e)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"VERSION":this._sparqlStyle=!0;case"@version":return this._readVersion;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let r;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);r=this._factory.namedNode(t);break;case"type":case"prefixed":const n=this._prefixes[e.prefix];if(void 0===n)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._factory.namedNode(n+e.value);break;case"blank":r=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":const t=this._contextStack;return"<<"===(t.length&&t[t.length-1]).type?this._error("Unexpected list in reified triple",e):(this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"<<(":return this._n3Mode?(this._saveContext("<<(",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Disallowed triple term as subject",e);case"<<":return this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject;default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":case"|}":return null===this._predicate?this._error(`Unexpected ${t}`,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._validAnnotation=!0,this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":const t=this._contextStack;return"<<"===(t.length&&t[t.length-1]).type?this._error("Unexpected list in reified triple",e):(this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<(":return this._saveContext("<<(",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject;case"<<":return this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject;default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){if("]"===e.type)return this._subject=null,this._readBlankNodeTail(e);{const t=this._contextStack;return"<<"===(t.length>1&&t[t.length-2]).type?this._error("Unexpected compound blank node expression in reified triple",e):(this._predicate=null,this._readPredicate(e))}}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=null===this._predicate;return this._restoreContext("blank",e),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,r=null,n=this._readListItem;const i=this._subject,a=this._contextStack,o=a[a.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this._subject=t=this._factory.blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),0!==a.length&&"list"===a[a.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(t=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),n=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":this._saveContext("<<",this._graph,null,null,null),this._graph=null,n=this._readSubject;break;default:if(void 0===(t=this._readEntity(e)))return}if(null===r&&(this._subject=r=this._factory.blankNode()),"<<"===e.type&&(a[a.length-1].subject=this._subject),null===i?null===o.predicate?o.subject=r:o.object=r:this._emit(i,this.RDF_REST,r,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e,t){let r,n=this._factory.literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const i=this._readEntity(e);if(void 0===i)return;if(i.value===c.rdf.langString||i.value===c.rdf.dirLangString)return this._error("Detected illegal (directional) languaged-tagged string with explicit datatype",e);n=this._factory.literal(this._literalValue,i),e=null;break;case"langcode":if(e.value.split("-").some((e=>e.length>8)))return this._error("Detected language tag with subtag longer than 8 characters",e);n=this._factory.literal(this._literalValue,e.value),this._literalLanguage=e.value,e=null,r=this._readDirCode.bind(this,t)}return{token:e,literal:n,readCb:r}}_readDirCode(e,t,r){if("dircode"===r.type){const t=this._factory.literal(this._literalValue,{language:this._literalLanguage,direction:r.value});"subject"===e?this._subject=t:this._object=t,this._literalLanguage=void 0,r=null}return"subject"===e?null===r?this._readPredicateOrNamedGraph:this._readPredicateOrNamedGraph(r):this._completeObjectLiteralPost(r,t)}_completeSubjectLiteral(e){const t=this._completeLiteral(e,"subject");return this._subject=t.literal,t.readCb?t.readCb.bind(this,!1):this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const r=this._completeLiteral(e,"object");if(r)return this._object=r.literal,r.readCb?r.readCb.bind(this,t):this._completeObjectLiteralPost(r.token,t)}_completeObjectLiteralPost(e,t){return t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===e?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(e))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph,n=!1;const i=this._subject,a=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,this._tripleTerm=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,a&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"~":t=this._readReifierInAnnotation,n=!0;break;case"{|":this._subject=this._readTripleTerm(),this._validAnnotation=!1,n=!0,t=this._readPredicate;break;case"|}":if(!this._annotation)return this._error("Unexpected annotation syntax closing",e);if(!this._validAnnotation)return this._error("Annotation block can not be empty",e);this._subject=null,this._annotation=!1,t=this._readPunctuation;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(null!==i&&(!n||n&&!this._annotation)){const e=this._predicate,t=this._object;a?this._emit(t,e,i,r):this._emit(i,e,t,r)}return n&&(this._annotation=!0),t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_isValidVersion(e){return this._parseUnsupportedVersions||U.SUPPORTED_VERSIONS.includes(e)}_readVersion(e){return"literal"!==e.type?this._error("Expected literal to follow version declaration",e):e.end-e.start!==e.value.length+2?this._error("Version declarations must use single quotes",e):(this._versionCallback(e.value),this._isValidVersion(e.value)?this._readDeclarationPunctuation:this._error(`Detected unsupported version: "${e.value}"`,e))}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,r=t.length&&t[t.length-1];if(r&&"item"===r.type){const t=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const n=this._factory.blankNode();if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=n):(t=this._object,this._object=n),this._emit(t,r,n,this._graph),this._readPath}_readBackwardPath(e){const t=this._factory.blankNode();let r,n;if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(n=this._subject,this._subject=t):(n=this._object,this._object=t),this._emit(t,r,n,this._graph),this._readPath}_readTripleTermTail(e){if(")>>"!==e.type)return this._error(`Expected )>> but got ${e.type}`,e);const t=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<(",e),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_readReifiedTripleTailOrReifier(e){return"~"===e.type?this._readReifier:this._readReifiedTripleTail(e)}_readReifiedTripleTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);this._tripleTerm=null;const t=this._readTripleTerm();this._restoreContext("<<",e);const r=this._contextStack,n=r.length&&r[r.length-1];return n&&"list"===n.type?(this._emit(this._subject,this.RDF_FIRST,t,this._graph),this._getContextEndReader()):null===this._subject?(this._subject=t,this._readPredicateOrReifierTripleEnd):(this._object=t,this._getContextEndReader())}_readPredicateOrReifierTripleEnd(e){return"."===e.type?(this._subject=null,this._readPunctuation(e)):this._readPredicate(e)}_readReifier(e){return this._reifier=this._readEntity(e),this._readReifiedTripleTail}_readReifierInAnnotation(e){return"IRI"===e.type||"typeIRI"===e.type||"type"===e.type||"prefixed"===e.type||"blank"===e.type||"var"===e.type?(this._reifier=this._readEntity(e),this._readPunctuation):(this._readTripleTerm(),this._subject=null,this._readPunctuation(e))}_readTripleTerm(){const e=this._contextStack,t=e.length&&e[e.length-1],r=t?t.graph:void 0,n=this._reifier||this._factory.blankNode();return this._reifier=null,this._tripleTerm=this._tripleTerm||this._factory.quad(this._subject,this._predicate,this._object),this._emit(n,this.RDF_REIFIES,this._tripleTerm,r||this.DEFAULTGRAPH),n}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<(":return this._readTripleTermTail;case"<<":return this._readReifiedTripleTailOrReifier}}_emit(e,t,r,n){this._callback(null,this._factory.quad(e,t,r,n||this.DEFAULTGRAPH))}_error(e,t){const r=new Error(`${e} on line ${t.line}.`);r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=B}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let r="",n=-1,i=-1,a=0,o="/";for(;n=i&&(r=r.substr(0,a)),"/"!==o)return`${r}/${e.substr(n+1)}`;a=n+1}}}o=e[++n]}return r+e.substring(a)}parse(e,t,r,n){let i,a,o,s;if(t&&(t.onQuad||t.onPrefix||t.onComment||t.onVersion)?(i=t.onQuad,a=t.onPrefix,o=t.onComment,s=t.onVersion):(i=t,a=r,s=n),this._readCallback=this._readBeforeTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${k++}_`,this._prefixCallback=a||B,this._versionCallback=s||B,this._inversePredicate=!1,this._quantified=Object.create(null),!i){const t=[];let r;if(this._callback=(e,n)=>{e?r=e:n&&t.push(n)},this._lexer.tokenize(e).every((e=>this._readCallback=this._readCallback(e))),r)throw r;return t}let c=(e,t)=>{null!==e?(this._callback(e),this._callback=B):this._readCallback&&(this._readCallback=this._readCallback(t))};o&&(this._lexer.comments=!0,c=(e,t)=>{null!==e?(this._callback(e),this._callback=B):this._readCallback&&("comment"===t.type?o(t.value):this._readCallback=this._readCallback(t))}),this._callback=i,this._lexer.tokenize(e,c)}}function B(){}function q(e,t){e._factory=t,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=t.namedNode(c.rdf.first),e.RDF_REST=t.namedNode(c.rdf.rest),e.RDF_NIL=t.namedNode(c.rdf.nil),e.RDF_REIFIES=t.namedNode(c.rdf.reifies),e.N3_FORALL=t.namedNode(c.r.forAll),e.N3_FORSOME=t.namedNode(c.r.forSome),e.ABBREVIATIONS={a:t.namedNode(c.rdf.type),"=":t.namedNode(c.owl.sameAs),">":t.namedNode(c.log.implies),"<":t.namedNode(c.log.isImpliedBy)},e.QUANTIFIERS_GRAPH=t.namedNode("urn:n3:quantifiers")}function V(e){return!!e&&"NamedNode"===e.termType}function $(e){return!!e&&"BlankNode"===e.termType}function G(e){return!!e&&"Literal"===e.termType}function Q(e){return!!e&&"Variable"===e.termType}function H(e){return!!e&&"Quad"===e.termType}function z(e){return!!e&&"DefaultGraph"===e.termType}function K(e){return z(e.graph)}function X(e,t){return W({"":e.value||e},t)("")}function W(e,t){const r=Object.create(null);for(const t in e)n(t,e[t]);function n(e,n){if("string"==typeof n){const i=Object.create(null);r[e]=e=>i[e]||(i[e]=t.namedNode(n+e))}else if(!(e in r))throw new Error(`Unknown prefix: ${e}`);return r[e]}return t=t||T,n}function J(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}U.SUPPORTED_VERSIONS=["1.2","1.2-basic","1.1"],q(U.prototype,T);const Y=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,Z=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/;class ee{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!Y.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!ee.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],t=["^",J(e)],r=[],n=[],i=/[^/?#]*([/?#])/y;let a,o=0,s=0,c=i.lastIndex=e.length;for(;!o&&!s&&(a=i.exec(this.base));)"#"===a[1]?s=i.lastIndex-1:(t.push(J(a[0]),"(?:"),r.push(")?"),"?"!==a[1]?n.push(c=i.lastIndex):(o=c=i.lastIndex,s=this.base.indexOf("#",o),this._pathReplacements[o]="?"));for(let e=0;e0?s:this.base.length,t.push(J(this.base.substring(c,this._baseLength)),o?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...t,...r].join(""))}toRelative(e){const t=this._getBaseMatcher().exec(e);if(!t)return e;const r=t[0].length;if(r===this._baseLength&&r===e.length)return"";const n=this._pathReplacements[r];if(n){const t=e.substring(r);return"?"===n||Z.test(t)?"./"===n&&/^[^?#]/.test(t)?t:n+t:e}return e.substring(r-1)}}const te=T.defaultGraph(),{rdf:re,xsd:ne}=c,ie=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,ae=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,oe={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class se extends O{equals(e){return e===this}}class ce{constructor(e,t){if(this._prefixRegex=/$0^/,e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write(t,r,n){e+=t,n&&n()},end:t=>{t&&t(null,e)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=te,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseIri=new ee(t.baseIRI)))}get _inDefaultGraph(){return te.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,r,n,i){try{n.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(te.equals(n)?"":`${this._encodeIriOrBlank(n)} {\n`)),this._graph=n,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(r)}`,i):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,i):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,i)}catch(e){i&&i(e)}}_writeQuadLine(e,t,r,n,i){delete this._prefixMatch,this._write(this.quadToString(e,t,r,n),i)}quadToString(e,t,r,n){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(r)}${n&&n.value?` ${this._encodeIriOrBlank(n)} .\n`:" .\n"}`}quadsToString(e){let t="";for(const r of e)t+=this.quadToString(r.subject,r.predicate,r.object,r.graph);return t}_encodeSubject(e){return"Quad"===e.termType?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if("NamedNode"!==e.termType)return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let t=e.value;this._baseIri&&(t=this._baseIri.toRelative(t)),ie.test(t)&&(t=t.replace(ae,ue));const r=this._prefixRegex.exec(t);return r?r[1]?this._prefixIRIs[r[1]]+r[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;ie.test(t)&&(t=t.replace(ae,ue));const r=e.direction?`--${e.direction}`:"";if(e.language)return`"${t}"@${e.language}${r}`;if(this._lineMode){if(e.datatype.value===ne.string)return`"${t}"`}else switch(e.datatype.value){case ne.string:return`"${t}"`;case ne.boolean:if("true"===t||"false"===t)return t;break;case ne.integer:if(/^[+-]?\d+$/.test(t))return t;break;case ne.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case ne.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===re.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:r,graph:n}){return`<<(${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(r)}${z(n)?"":` ${this._encodeIriOrBlank(n)}`})>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,r,n,i){void 0===r?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof n?this._writeQuad(e,t,r,te,n):this._writeQuad(e,t,r,n||te,i)}addQuads(e){for(let t=0;t.\n`)}if(r){let e="",t="";for(const r in this._prefixIRIs)e+=e?`|${r}`:r,t+=(t?"|":"")+this._prefixIRIs[r];e=J(e),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([_a-zA-Z0-9][\\-_a-zA-Z0-9]*)$`)}this._write(r?"\n":"",t)}blank(e,t){let r,n,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),n=i.length){case 0:return new se("[]");case 1:if(r=i[0],!(r.object instanceof se))return new se(`[ ${this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)} ]`);default:let t="[";for(let a=0;a{t=null,e(r,n)});if(this._endStream)try{return this._outputStream.end(t)}catch(e){}t&&t()}}function ue(e){let t=oe[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}var le=r(58521);const de=Symbol("iter");function pe(e,t,r=4){if(0===r)return Object.assign(e,t);for(const n in t)e[n]=pe(e[n]||Object.create(null),t[n],r-1);return e}function he(e,t,r=4){let n=!1;for(const i in e)if(i in t){const a=0===r?null:he(e[i],t[i],r-1);if(!1!==a)n=n||Object.create(null),n[i]=a;else if(3===r)return!1}return n}function fe(e,t,r=4){let n=!1;for(const i in e)if(i in t){if(0!==r){const a=fe(e[i],t[i],r-1);if(!1!==a)n=n||Object.create(null),n[i]=a;else if(3===r)return!1}}else n=n||Object.create(null),n[i]=0===r?null:pe({},e[i],r-1);return n}class ye{constructor(e={}){this._id=1,this._ids=Object.create(null),this._ids[""]=1,this._entities=Object.create(null),this._entities[1]="",this._blankNodeIndex=0,this._factory=e.factory||T}_termFromId(e){if("."===e[0]){const t=this._entities,r=e.split(".");return this._factory.quad(this._termFromId(t[r[1]]),this._termFromId(t[r[2]]),this._termFromId(t[r[3]]),r[4]&&this._termFromId(t[r[4]]))}return I(e,this._factory)}_termToNumericId(e){if("Quad"===e.termType){const t=this._termToNumericId(e.subject),r=this._termToNumericId(e.predicate),n=this._termToNumericId(e.object);let i;return t&&r&&n&&(z(e.graph)||(i=this._termToNumericId(e.graph)))&&this._ids[i?`.${t}.${r}.${n}.${i}`:`.${t}.${r}.${n}`]}return this._ids[P(e)]}_termToNewNumericId(e){const t=e&&"Quad"===e.termType?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${z(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:P(e);return this._ids[t]||(this._ids[this._entities[++this._id]=t]=this._id)}createBlankNode(e){let t,r;if(e)for(t=e=`_:${e}`,r=1;this._ids[t];)t=e+r++;else do{t="_:b"+this._blankNodeIndex++}while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}}class me{constructor(e,t){this._size=0,this._graphs=Object.create(null),t||!e||e[0]||"function"==typeof e.match||(t=e,e=null),t=t||{},this._factory=t.factory||T,this._entityIndex=t.entityIndex||new ye({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),e&&this.addAll(e)}get size(){let e=this._size;if(null!==e)return e;e=0;const t=this._graphs;let r,n;for(const i in t)for(const a in r=t[i].subjects)for(const t in n=r[a])e+=Object.keys(n[t]).length;return this._size=e}_addToIndex(e,t,r,n){const i=e[t]||(e[t]={}),a=i[r]||(i[r]={}),o=n in a;return o||(a[n]=null),!o}_removeFromIndex(e,t,r,n){const i=e[t],a=i[r];delete a[n];for(const e in a)return;delete i[r];for(const e in i)return;delete e[t]}*_findInIndex(e,t,r,n,i,a,o,s){let c,u,l;const d=this._entities,p=this._termFromId(d[s]),h={subject:null,predicate:null,object:null};t&&((c=e,e={})[t]=c[t]);for(const t in e)if(u=e[t]){h[i]=this._termFromId(d[t]),r&&((c=u,u={})[r]=c[r]);for(const e in u)if(l=u[e]){h[a]=this._termFromId(d[e]);const t=n?n in l?[n]:[]:Object.keys(l);for(let e=0;e{r in t||(t[r]=!0,e(this._termFromId(this._entities[r],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,r,n){t||(n=e.graph,r=e.object,t=e.predicate,e=e.subject),n=n?this._termToNewNumericId(n):1;let i=this._graphs[n];return i||(i=this._graphs[n]={subjects:{},predicates:{},objects:{}},Object.freeze(i)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),r=this._termToNewNumericId(r),!!this._addToIndex(i.subjects,e,t,r)&&(this._addToIndex(i.predicates,t,r,e),this._addToIndex(i.objects,r,e,t),this._size=null,!0)}addQuads(e){for(let t=0;t{this.addQuad(e)})),e}removeQuad(e,t,r,n){t||({subject:e,predicate:t,object:r,graph:n}=e),n=n?this._termToNumericId(n):1;const i=this._graphs;let a,o,s;if(!((e=e&&this._termToNumericId(e))&&(t=t&&this._termToNumericId(t))&&(r=r&&this._termToNumericId(r))&&(a=i[n])&&(o=a.subjects[e])&&(s=o[t])&&r in s))return!1;for(e in this._removeFromIndex(a.subjects,e,t,r),this._removeFromIndex(a.predicates,t,r,e),this._removeFromIndex(a.objects,r,e,t),null!==this._size&&this._size--,a.subjects)return!0;return delete i[n],!0}removeQuads(e){for(let t=0;t{this.removeQuad(e)})),e}removeMatches(e,t,r,n){const i=new le.Readable({objectMode:!0}),a=this.readQuads(e,t,r,n);return i._read=e=>{for(;--e>=0;){const{done:e,value:t}=a.next();if(e)return void i.push(null);i.push(t)}},this.remove(i)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,r,n){return[...this.readQuads(e,t,r,n)]}*readQuads(e,t,r,n){const i=this._getGraphs(n);let a,o,s,c;if(!(e&&!(o=this._termToNumericId(e))||t&&!(s=this._termToNumericId(t))||r&&!(c=this._termToNumericId(r))))for(const e in i)(a=i[e])&&(o?c?yield*this._findInIndex(a.objects,c,o,s,"object","subject","predicate",e):yield*this._findInIndex(a.subjects,o,s,null,"subject","predicate","object",e):s?yield*this._findInIndex(a.predicates,s,c,null,"predicate","object","subject",e):c?yield*this._findInIndex(a.objects,c,null,null,"object","subject","predicate",e):yield*this._findInIndex(a.subjects,null,null,null,"subject","predicate","object",e))}match(e,t,r,n){return new be(this,e,t,r,n,{entityIndex:this._entityIndex})}countQuads(e,t,r,n){const i=this._getGraphs(n);let a,o,s,c,u=0;if(e&&!(o=this._termToNumericId(e))||t&&!(s=this._termToNumericId(t))||r&&!(c=this._termToNumericId(r)))return 0;for(const n in i)(a=i[n])&&(u+=e?r?this._countInIndex(a.objects,c,o,s):this._countInIndex(a.subjects,o,s,c):t?this._countInIndex(a.predicates,s,c,o):this._countInIndex(a.objects,c,o,s));return u}forEach(e,t,r,n,i){this.some((t=>(e(t,this),!1)),t,r,n,i)}every(e,t,r,n,i){return!this.some((t=>!e(t,this)),t,r,n,i)}some(e,t,r,n,i){for(const a of this.readQuads(t,r,n,i))if(e(a,this))return!0;return!1}getSubjects(e,t,r){const n=[];return this.forSubjects((e=>{n.push(e)}),e,t,r),n}forSubjects(e,t,r,n){const i=this._getGraphs(n);let a,o,s;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||r&&!(s=this._termToNumericId(r))))for(n in i)(a=i[n])&&(o?s?this._loopBy2Keys(a.predicates,o,s,e):this._loopByKey1(a.subjects,o,e):s?this._loopByKey0(a.objects,s,e):this._loop(a.subjects,e))}getPredicates(e,t,r){const n=[];return this.forPredicates((e=>{n.push(e)}),e,t,r),n}forPredicates(e,t,r,n){const i=this._getGraphs(n);let a,o,s;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||r&&!(s=this._termToNumericId(r))))for(n in i)(a=i[n])&&(o?s?this._loopBy2Keys(a.objects,s,o,e):this._loopByKey0(a.subjects,o,e):s?this._loopByKey1(a.predicates,s,e):this._loop(a.predicates,e))}getObjects(e,t,r){const n=[];return this.forObjects((e=>{n.push(e)}),e,t,r),n}forObjects(e,t,r,n){const i=this._getGraphs(n);let a,o,s;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||r&&!(s=this._termToNumericId(r))))for(n in i)(a=i[n])&&(o?s?this._loopBy2Keys(a.subjects,o,s,e):this._loopByKey1(a.objects,o,e):s?this._loopByKey0(a.predicates,s,e):this._loop(a.objects,e))}getGraphs(e,t,r){const n=[];return this.forGraphs((e=>{n.push(e)}),e,t,r),n}forGraphs(e,t,r,n){for(const i in this._graphs)this.some((t=>(e(t.graph),!0)),t,r,n,this._termFromId(this._entities[i]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const r={},n=t?()=>!0:(e,t)=>{throw new Error(`${e.value} ${t}`)},i=this.getQuads(null,c.rdf.rest,c.rdf.nil,null),a=e?[...i]:[];return i.forEach((t=>{const i=[];let o,s,u=!1;const l=t.graph;let d=t.subject;for(;d&&!u;){const e=this.getQuads(null,null,d,null),t=this.getQuads(d,null,null,null);let r,p=null,h=null,f=null;for(let i=0;ithis.has(e)));const t=this._graphs,r=e._graphs;let n,i,a,o,s;for(const e in r){if(!(n=t[e]))return!1;n=n.subjects;for(const t in i=r[e].subjects){if(!(a=n[t]))return!1;for(const e in o=i[t]){if(!(s=a[e]))return!1;for(const t in o[e])if(!(t in s))return!1}}}return!0}deleteMatches(e,t,r,n){for(const i of this.match(e,t,r,n))this.removeQuad(i);return this}difference(e){if(e&&e instanceof be&&(e=e.filtered),e===this)return new me({entityIndex:this._entityIndex});if(e instanceof me&&e._entityIndex===this._entityIndex){const t=new me({entityIndex:this._entityIndex}),r=fe(this._graphs,e._graphs);return r&&(t._graphs=r,t._size=null),t}return this.filter((t=>!e.has(t)))}equals(e){return e instanceof be&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new me({entityIndex:this._entityIndex});for(const r of this)e(r,this)&&t.add(r);return t}intersection(e){if(e instanceof be&&(e=e.filtered),e===this){const e=new me({entityIndex:this._entityIndex});return e._graphs=pe(Object.create(null),this._graphs),e._size=this._size,e}if(e instanceof me&&this._entityIndex===e._entityIndex){const t=new me({entityIndex:this._entityIndex}),r=he(e._graphs,this._graphs);return r&&(t._graphs=r,t._size=null),t}return this.filter((t=>e.has(t)))}map(e){const t=new me({entityIndex:this._entityIndex});for(const r of this)t.add(e(r,this));return t}reduce(e,t){const r=this.readQuads();let n=void 0===t?r.next().value:t;for(const t of r)n=e(n,t,this);return n}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return(new ce).quadsToString(this)}union(e){const t=new me({entityIndex:this._entityIndex});return t._graphs=pe(Object.create(null),this._graphs),t._size=this._size,t.addAll(e),t}*[Symbol.iterator](){yield*this.readQuads()}}function ge(e,t,r=0){const n=t[r];if(n&&!(n in e))return!1;let i=!1;for(const a in n?{[n]:e[n]}:e){const n=2===r?null:ge(e[a],t,r+1);!1!==n&&(i=i||Object.create(null),i[a]=n)}return i}class be extends le.Readable{constructor(e,t,r,n,i,a){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:r,object:n,graph:i,options:a})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:r,predicate:n,subject:i}=this,a=this._filtered=new me({factory:e._factory,entityIndex:this.options.entityIndex});let o,s,c;if(i&&!(o=a._termToNumericId(i))||n&&!(s=a._termToNumericId(n))||r&&!(c=a._termToNumericId(r)))return a;const u=e._getGraphs(t);for(const e in u){let t,r,n,i;(i=u[e])&&(!o&&s?(r=ge(i.predicates,[s,c,o]))&&(t=ge(i.subjects,[o,s,c]),n=ge(i.objects,[c,o,s])):c?(n=ge(i.objects,[c,o,s]))&&(t=ge(i.subjects,[o,s,c]),r=ge(i.predicates,[s,c,o])):(t=ge(i.subjects,[o,s,c]))&&(r=ge(i.predicates,[s,c,o]),n=ge(i.objects,[c,o,s])),t&&(a._graphs[e]={subjects:t,predicates:r,objects:n}))}a._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[de]&&(this[de]=this[Symbol.iterator]());const t=this[de];for(;--e>=0;){const{done:e,value:r}=t.next();if(e)return void this.push(null);this.push(r)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,t,r,n){return this.filtered.deleteMatches(e,t,r,n)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,t,r,n,i){return this.filtered.every(e,t,r,n,i)}filter(e){return this.filtered.filter(e)}forEach(e,t,r,n,i){return this.filtered.forEach(e,t,r,n,i)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,t,r,n,i){return this.filtered.some(e,t,r,n,i)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(e)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,t){return this.filtered.reduce(e,t)}toString(){return(new ce).quadsToString(this)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,t,r,n){return new be(this.filtered,e,t,r,n,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}class ve{dataset(e){return new me(e)}}function _e(e){const t=[];for(const{subject:r,object:n}of e.match(null,T.namedNode("http://www.w3.org/2000/10/swap/log#implies"),null,T.defaultGraph())){const i=[...e.match(null,null,null,r)],a=[...e.match(null,null,null,n)];t.push({premise:i,conclusion:a})}return t}class Te{constructor(e){this._store=e}_add(e,t,r,n,i){this._store._addToIndex(n.subjects,e,t,r)&&(this._store._addToIndex(n.predicates,t,r,e),this._store._addToIndex(n.objects,r,e,t),i())}_evaluatePremise(e,t,r,n=0){let i,a,o,s,c;const[u,l,d]=e.premise[n].value,p=t[e.premise[n].content],h=!(o=u.value);for(o in h?p:{[o]:p[o]})if(s=p[o]){for(o in h&&(u.value=Number(o)),i=!(o=l.value),i?s:{[o]:s[o]})if(c=s[o]){for(o in i&&(l.value=Number(o)),a=!(o=d.value),a?c:{[o]:c[o]})a&&(d.value=Number(o)),n===e.premise.length-1?e.conclusion.forEach((e=>{this._add(e.subject.value,e.predicate.value,e.object.value,t,(()=>{r(e)}))})):this._evaluatePremise(e,t,r,n+1);a&&(d.value=null)}i&&(l.value=null)}h&&(u.value=null)}_evaluateRules(e,t,r){for(let n=0;n{r.push([e.subject.value,e.predicate.value,e.object.value,t])}))}const i=e=>{e.forEach((e=>{this._add(e.subject.value,e.predicate.value,e.object.value,t,(()=>{n(e)}))}))};let a;for(this._evaluateRules(e,t,n);void 0!==(a=r.pop());){const[e,r,o,s]=a,c=s.basePremise.subject.value;c||(s.basePremise.subject.value=e);const u=s.basePremise.predicate.value;u||(s.basePremise.predicate.value=r);const l=s.basePremise.object.value;l||(s.basePremise.object.value=o),0===s.premise.length?i(s.conclusion):this._evaluatePremise(s,t,n),c||(s.basePremise.subject.value=null),u||(s.basePremise.predicate.value=null),l||(s.basePremise.object.value=null)}}_createRule({premise:e,conclusion:t}){const r={},n=e=>"Variable"===e.termType?r[e.value]=r[e.value]||{}:{value:this._store._termToNewNumericId(e)},i=e=>({subject:n(e.subject),predicate:n(e.predicate),object:n(e.object)});return{premise:e.map((e=>i(e))),conclusion:t.map((e=>i(e))),variables:Object.values(r)}}reason(e){Array.isArray(e)||(e=_e(e)),e=e.map((e=>this._createRule(e)));for(const t of e)for(const r of e)for(let e=0;e{e.value=null}))}}for(const t of e){const e=new Set;t.premise=t.premise.map((t=>Oe(t,e)))}const t=this._store._getGraphs();for(const r in t)this._reasonGraphNaive(e,t[r]);this._store._size=null}}function Oe({subject:e,predicate:t,object:r},n){const i=e.value||n.has(e)||(n.add(e),!1),a=t.value||n.has(t)||(n.add(t),!1),o=r.value||n.has(r)||(n.add(r),!1);return!i&&a?{content:"predicates",value:[t,r,e]}:o?{content:"objects",value:[r,e,t]}:{content:"subjects",value:[e,t,r]}}function we(e,t){return null===e.value&&(e.value=t.value),e.value===t.value}class Se extends le.Transform{constructor(e){super({decodeStrings:!0}),this._readableState.objectMode=!0;const t=new U(e);let r,n;const i={onQuad:(e,t)=>{e&&this.emit("error",e)||t&&this.push(t)},onPrefix:(e,t)=>{this.emit("prefix",e,t)}};e&&e.comments&&(i.onComment=e=>{this.emit("comment",e)}),t.parse({on:(e,t)=>{switch(e){case"data":r=t;break;case"end":n=t}}},i),this._transform=(e,t,n)=>{r(e),n()},this._flush=e=>{n(),e()}}import(e){return e.on("data",(e=>{this.write(e)})),e.on("end",(()=>{this.end()})),e.on("error",(e=>{this.emit("error",e)})),this}}class Ee extends le.Transform{constructor(e){super({encoding:"utf8",writableObjectMode:!0});const t=this._writer=new ce({write:(e,t,r)=>{this.push(e),r&&r()},end:e=>{this.push(null),e&&e()}},e);this._transform=(e,r,n)=>{t.addQuad(e,n)},this._flush=e=>{t.end(e)}}import(e){return e.on("data",(e=>{this.write(e)})),e.on("end",(()=>{this.end()})),e.on("error",(e=>{this.emit("error",e)})),e.on("prefix",((e,t)=>{this._writer.addPrefix(e,t)})),this}}const Ae={Lexer:y,Parser:U,Writer:ce,Store:me,StoreFactory:ve,EntityIndex:ye,StreamParser:Se,StreamWriter:Ee,Util:n,Reasoner:Te,BaseIRI:ee,DataFactory:T,Term:O,NamedNode:w,Literal:S,BlankNode:E,Variable:A,DefaultGraph:x,Quad:R,Triple:R,termFromId:I,termToId:P}},39907:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,c=[],u=!1,l=-1;function d(){u&&s&&(u=!1,s.length?c=s.concat(c):l=-1,c.length&&p())}function p(){if(!u){var e=o(d);u=!0;for(var t=c.length;t;){for(s=c,c=[];++l1)for(var r=1;r{!function(){var t;t="object"==typeof window&&window?window:r.g,e.exports?e.exports=t.Promise?t.Promise:o:t.Promise||(t.Promise=o);var n=t.setImmediate||function(e){setTimeout(e,1)};function i(e,t){return function(){e.apply(t,arguments)}}var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],p(e,i(c,this),i(u,this))}function s(e){var t=this;null!==this._state?n((function(){var r=t._state?e.onFulfilled:e.onRejected;if(null!==r){var n;try{n=r(t._value)}catch(t){return void e.reject(t)}e.resolve(n)}else(t._state?e.resolve:e.reject)(t._value)})):this._deferreds.push(e)}function c(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void p(i(t,e),i(c,this),i(u,this))}this._state=!0,this._value=e,l.call(this)}catch(e){u.call(this,e)}}function u(e){this._state=!1,this._value=e,l.call(this)}function l(){for(var e=0,t=this._deferreds.length;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNode=void 0,t.BlankNode=class{constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}},31352:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataFactory=void 0;const n=r(73968),i=r(81947),a=r(91417),o=r(88963),s=r(89135),c=r(22e3);let u=0;t.DataFactory=class{constructor(e){this.blankNodeCounter=0,e=e||{},this.blankNodePrefix=e.blankNodePrefix||`df_${u++}_`}namedNode(e){return new o.NamedNode(e)}blankNode(e){return new n.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new a.Literal(e,t)}variable(e){return new c.Variable(e)}defaultGraph(){return i.DefaultGraph.INSTANCE}quad(e,t,r,n){return new s.Quad(e,t,r,n||this.defaultGraph())}fromTerm(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(a.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},81947:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGraph=void 0;class r{constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&"DefaultGraph"===e.termType}}t.DefaultGraph=r,r.INSTANCE=new r},91417:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Literal=void 0;const n=r(88963);class i{constructor(e,t){this.termType="Literal",this.value=e,"string"==typeof t?(this.language=t,this.datatype=i.RDF_LANGUAGE_STRING,this.direction=""):t?"termType"in t?(this.language="",this.datatype=t,this.direction=""):(this.language=t.language,this.datatype=t.direction?i.RDF_DIRECTIONAL_LANGUAGE_STRING:i.RDF_LANGUAGE_STRING,this.direction=t.direction||""):(this.language="",this.datatype=i.XSD_STRING,this.direction="")}equals(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&(e.direction===this.direction||!e.direction&&""===this.direction)&&this.datatype.equals(e.datatype)}}t.Literal=i,i.RDF_LANGUAGE_STRING=new n.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.RDF_DIRECTIONAL_LANGUAGE_STRING=new n.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),i.XSD_STRING=new n.NamedNode("http://www.w3.org/2001/XMLSchema#string")},88963:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NamedNode=void 0,t.NamedNode=class{constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}},89135:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Quad=void 0,t.Quad=class{constructor(e,t,r,n){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=r,this.graph=n}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}},22e3:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Variable=void 0,t.Variable=class{constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}},91032:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(9157),t)},9157:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isomorphic=function(e,t){return!!o(e,t)},t.getBijection=o,t.getBijectionInner=s,t.hashValues=u,t.hasValue=l,t.getQuadsWithBlankNodes=d,t.getQuadsWithoutBlankNodes=p,t.indexGraph=h,t.deindexGraph=f,t.uniqGraph=y,t.getGraphBlankNodes=m,t.hashTerms=g,t.hashTerm=b,t.hashNumber=v,t.quadToSignature=_,t.termToSignature=T,t.isTermGrounded=O;const n=r(22112),i=r(13252),a=r(33918);function o(e,t){const r=h(p(e)),n=h(p(t));if(Object.keys(r).length!==Object.keys(n).length)return null;for(const e in r)if(r[e]!==n[e])return null;return s(y(d(e)),y(d(t)),m(e),m(t))}function s(e,t,r,i,a,o){a||(a={}),o||(o={});const[d,p]=g(e,r,a),[h,f]=g(t,i,o);if(Object.keys(d).length!==Object.keys(h).length)return null;for(const e in d)if(!l(h,d[e]))return null;let y={};for(const e of r){const t=(0,n.termToString)(e),r=p[t];for(const e in f)if(f[e]===r){y[t]=e,delete f[e];break}}if(!c(Object.keys(y).sort(),r.map(n.termToString).sort())||!c(u(y).sort(),i.map(n.termToString).sort())){y=null;for(const a of r){const o=(0,n.termToString)(a);if(!d[o])for(const a of i){const c=(0,n.termToString)(a);if(!h[c]&&p[o]===f[c]){const n=v(o);y=s(e,t,r,i,Object.assign(Object.assign({},d),{[o]:n}),Object.assign(Object.assign({},h),{[c]:n}))}}}}return y}function c(e,t){if(e.length!==t.length)return!1;for(let r=e.length;r--;)if(e[r]!==t[r])return!1;return!0}function u(e){const t=[];for(const r in e)t.push(e[r]);return t}function l(e,t){for(const r in e)if(e[r]===t)return!0;return!1}function d(e){return e.filter((e=>(0,i.someTerms)(e,(e=>"BlankNode"===e.termType||"Quad"===e.termType&&(0,i.getTermsNested)(e).some((e=>"BlankNode"===e.termType))))))}function p(e){return e.filter((e=>(0,i.everyTerms)(e,(e=>"BlankNode"!==e.termType&&!("Quad"===e.termType&&(0,i.getTermsNested)(e).some((e=>"BlankNode"===e.termType)))))))}function h(e){const t={};for(const r of e)t[JSON.stringify((0,n.quadToStringQuad)(r))]=!0;return t}function f(e){return Object.keys(e).map((e=>(0,n.stringQuadToQuad)(JSON.parse(e))))}function y(e){return f(h(e))}function m(e){return(0,i.uniqTerms)(e.map((e=>(0,i.getBlankNodes)((0,i.getTermsNested)(e)))).reduce(((e,t)=>e.concat(t)),[]))}function g(e,t,r){const i=Object.assign({},r),a={};let o=!0;for(;o;){const r=Object.keys(i).length;for(const r of t){const t=(0,n.termToString)(r);if(!i[t]){const[n,o]=b(r,e,i);n&&(i[t]=o),a[t]=o}}const s=new Map;for(const e in a){const t=a[e];void 0===s.get(t)?s.set(t,e):s.set(t,!1)}for(const[e,t]of s.entries())t&&(i[t]=e);o=r!==Object.keys(i).length}return[i,a]}function b(e,t,r){const n=[];let a=!0;for(const o of t){const t=(0,i.getTermsNested)(o);if(t.some((t=>t.equals(e)))){n.push(_(o,r,e));for(const n of t)O(n,r)||n.equals(e)||(a=!1)}}return[a,v(n.sort().join(""))]}function v(e){return a().hash(e).result()}function _(e,t,r){return(0,i.getTerms)(e).map((e=>T(e,t,r))).join("|")}function T(e,t,r){var i;return e.equals(r)?"@self":"BlankNode"===e.termType?(null===(i=t[(0,n.termToString)(e)])||void 0===i?void 0:i.toString())||"@blank":"Quad"===e.termType?`<${_(e,t,r)}>`:(0,n.termToString)(e)}function O(e,t){return"BlankNode"!==e.termType&&!("Quad"===e.termType&&(0,i.getTermsNested)(e).some((e=>!O(e,t))))||!!t[(0,n.termToString)(e)]}},10953:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeStream=function(e){const t=n.RdfStore.createDefault();return new Promise(((r,n)=>t.import(e).on("error",n).once("end",(()=>r(t)))))};const n=r(92427)},92427:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(51368),t),i(r(2369),t),i(r(62947),t),i(r(12924),t),i(r(76386),t),i(r(94992),t),i(r(26503),t),i(r(86721),t),i(r(93616),t),i(r(55100),t),i(r(95832),t),i(r(68752),t),i(r(38654),t),i(r(15698),t),i(r(53277),t),i(r(86937),t),i(r(15291),t),i(r(29390),t),i(r(25383),t),i(r(39034),t)},15291:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},29390:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QUAD_TERM_NAMES_INVERSE=void 0,t.getBestIndex=function(e,t){if(1===e.length||t.every((e=>void 0!==e)))return 0;const r=[];for(let e=0;e({score:i(e,r),index:t}))).sort(((e,t)=>t.score-e.score))[0].index},t.getBestIndexTerms=function(e,t){return 1===e.length?0:e.map(((e,r)=>({score:i(e,t),index:r}))).sort(((e,t)=>t.score-e.score))[0].index},t.getIndexMatchTermsPath=function(e,t){const r=[];let n=0;for(let i=0;i{const n=t.QUAD_TERM_NAMES_INVERSE[e];return r[n]}))},t.encodeOptionalTerms=function(e,t){const r=e.map((e=>{if(e){if("Quad"===e.termType&&a(e))return;const r=t.encodeOptional(e);return void 0===r?"none":r}return e}));if(!r.includes("none"))return r},t.quadToPattern=function(e,t,r,n,i){let a=!1;return[[e||void 0,t||void 0,r||void 0,n||void 0].map((e=>{if(e){if("Variable"===e.termType)return;if("Quad"===e.termType)return i?e:void(a=!0)}return e})),a]},t.quadHasVariables=a,t.arePatternsQuoted=function(e){return e.map((e=>"Quad"===e?.termType&&a(e)))};const n=r(13252);function i(e,t){return e.map(((r,n)=>t.includes(r)?e.length-n:0)).reduce(((e,t)=>e+t),0)}function a(e){for(const t of n.QUAD_TERM_NAMES){const r=e[t];if("Variable"===r.termType||"Quad"===r.termType&&a(r))return!0}return!1}t.QUAD_TERM_NAMES_INVERSE=Object.fromEntries(n.QUAD_TERM_NAMES.map(((e,t)=>[e,t])))},25383:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},39034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RdfStore=void 0;const n=r(76664),i=r(18050),a=r(22112),o=r(13252),s=r(51368),c=r(76386),u=r(26503),l=r(68752),d=r(29390);class p{constructor(e){this.features={quotedTripleFiltering:!0,indexNodes:!1,indexDistinctTerms:!0},this._size=0,this.options=e,this.dataFactory=e.dataFactory,this.dictionary=e.dictionary,this.indexesWrapped=p.constructIndexesWrapped(e),this.indexesWrappedComponentOrders=this.indexesWrapped.map((e=>e.componentOrder)),this.indexNodes=e.indexNodes?new Map:void 0,this.features.indexNodes=Boolean(e.indexNodes)}static createDefault(e){return new p({indexCombinations:p.DEFAULT_INDEX_COMBINATIONS,indexConstructor:e=>new l.RdfStoreIndexNestedMapQuoted(e),indexNodes:e,dictionary:new u.TermDictionaryQuotedIndexed(new c.TermDictionaryNumberRecordFullTerms),dataFactory:new i.DataFactory})}static constructIndexesWrapped(e){const t=[];if(0===e.indexCombinations.length)throw new Error("At least one index combination is required");for(const r of e.indexCombinations){if(!p.isCombinationValid(r))throw new Error(`Invalid index combination: ${r}`);t.push({index:e.indexConstructor(e),componentOrder:r,componentOrderInverse:Object.fromEntries(r.map(((e,t)=>[e,t])))})}return t}static isCombinationValid(e){for(const t of o.QUAD_TERM_NAMES)if(!e.includes(t))return!1;return 4===e.length}get size(){return this._size}addQuad(e){const t=[this.dictionary.encode(e.subject),this.dictionary.encode(e.predicate),this.dictionary.encode(e.object),this.dictionary.encode(e.graph)];let r=!1;for(const e of this.indexesWrapped)r=e.index.set((0,d.orderQuadComponents)(e.componentOrder,t),!0);if(r){if(this._size++,this.indexNodes){let e=this.indexNodes.get(t[3]);e||(e=new Set,this.indexNodes.set(t[3],e)),e.add(t[0]),e.add(t[2])}return!0}return!1}removeQuad(e){const t=[this.dictionary.encodeOptional(e.subject),this.dictionary.encodeOptional(e.predicate),this.dictionary.encodeOptional(e.object),this.dictionary.encodeOptional(e.graph)];if(t.includes(void 0))return!1;let r=!1;for(const e of this.indexesWrapped)if(r=e.index.remove((0,d.orderQuadComponents)(e.componentOrder,t)),!r)break;if(r){if(this._size--,this.indexNodes){const r=this.indexNodes.get(t[3]);this.readQuads(e.subject,void 0,void 0,e.graph).next().value||r.delete(t[0]),this.readQuads(void 0,void 0,e.object,e.graph).next().value||r.delete(t[2]),0===r.size&&this.indexNodes.delete(t[3])}return!0}return!1}remove(e){return e.on("data",(e=>this.removeQuad(e))),e}removeMatches(e,t,r,n){return this.remove(this.match(e,t,r,n))}deleteGraph(e){return"string"==typeof e&&(e=this.dataFactory.namedNode(e)),this.removeMatches(void 0,void 0,void 0,e)}import(e){return e.on("data",(e=>this.addQuad(e))),e}*readQuads(e,t,r,n){const i=Boolean(this.dictionary.features.quotedTriples)&&Object.values(this.indexesWrapped).every((e=>e.index.features.quotedTripleFiltering)),[a,s]=(0,d.quadToPattern)(e,t,r,n,i),c=this.indexesWrapped[(0,d.getBestIndex)(this.indexesWrappedComponentOrders,a)],u=(0,d.orderQuadComponents)(c.componentOrder,a);for(const i of c.index.find(u)){const a=this.dataFactory.quad(i[c.componentOrderInverse.subject],i[c.componentOrderInverse.predicate],i[c.componentOrderInverse.object],i[c.componentOrderInverse.graph]);s?(0,o.matchPattern)(a,e,t,r,n)&&(yield a):yield a}}getQuads(e,t,r,n){return[...this.readQuads(e,t,r,n)]}match(e,t,r,i){return(0,n.wrap)(this.readQuads(e,t,r,i))}*readBindings(e,t,r,n,i){const a=Boolean(this.dictionary.features.quotedTriples)&&Object.values(this.indexesWrapped).every((e=>e.index.features.quotedTripleFiltering)),[s,c]=(0,d.quadToPattern)(t,r,n,i,a),u=this.indexesWrapped[(0,d.getBestIndex)(this.indexesWrappedComponentOrders,s)],l=(0,d.orderQuadComponents)(u.componentOrder,s),p=(0,d.encodeOptionalTerms)(l,this.dictionary);if(!p)return;const h=(0,d.orderQuadComponents)(u.componentOrder,[t,r,n,i]),f=[];for(let e=0;e{const r=[];for(let n=t+1;ne[0].equals(t)&&!e[1].equals(n)))){r=!0;break}i.push([t,n])}continue}r=!0;break}if(n&&i.some((t=>t[0].equals(h[e])&&!t[1].equals(a)))){r=!0;break}i.push([h[e],a])}r||(yield e.bindings(i))}}getBindings(e,t,r,n,i){return[...this.readBindings(e,t,r,n,i)]}matchBindings(e,t,r,i,a){return(0,n.wrap)(this.readBindings(e,t,r,i,a))}countDistinctTerms(e){const t=(0,d.getBestIndexTerms)(this.indexesWrappedComponentOrders,e),r=this.indexesWrapped[t],n=[];for(let t=0;tvoid 0!==e)),o=(0,d.getIndexMatchTermsPath)(r.componentOrder,a);return o.includes(!1)?this.getDistinctTerms(e).length:r.index.countTerms(o)}*readDistinctTerms(e){const t=(0,d.getBestIndexTerms)(this.indexesWrappedComponentOrders,e),r=this.indexesWrapped[t],n=[];for(let t=0;tvoid 0!==e)),s=[];for(let t=0;tthis.dictionary.decode(e)));if(u){const e=r.map((e=>(0,a.termToString)(e))).join(",");if(u.has(e))continue;u.add(e)}yield r}}getDistinctTerms(e){return[...this.readDistinctTerms(e)]}matchDistinctTerms(e){return(0,n.wrap)(this.readDistinctTerms(e))}countNodes(e){if(!this.indexNodes)throw new Error("Nodes can only be read when the store was constructed with 'indexNodes: true'");if("Variable"===e.termType){let e=0;for(const t of this.indexNodes.values())e+=t.size;return e}const t=this.dictionary.encodeOptional(e);return void 0!==t?this.indexNodes.get(t).size:0}*readNodes(e){if(!this.indexNodes)throw new Error("Nodes can only be read when the store was constructed with 'indexNodes: true'");if("Variable"===e.termType)for(const e of this.indexNodes.entries()){const t=this.dictionary.decode(e[0]);for(const r of e[1])yield[t,this.dictionary.decode(r)]}else{const t=this.dictionary.encodeOptional(e);if(void 0!==t){const r=this.indexNodes.get(t);for(const t of r)yield[e,this.dictionary.decode(t)]}}}getNodes(e){return[...this.readNodes(e)]}matchNodes(e){if(!this.indexNodes)throw new Error("Nodes can only be read when the store was constructed with 'indexNodes: true'");return(0,n.wrap)(this.readNodes(e))}countQuads(e,t,r,n){const i=Boolean(this.dictionary.features.quotedTriples)&&Object.values(this.indexesWrapped).every((e=>e.index.features.quotedTripleFiltering)),[a]=(0,d.quadToPattern)(e,t,r,n,i);if(a.every((e=>void 0===e)))return this.size;const o=this.indexesWrapped[(0,d.getBestIndex)(this.indexesWrappedComponentOrders,a)],s=(0,d.orderQuadComponents)(o.componentOrder,a);return o.index.count(s)}asDataset(){return new s.DatasetCoreWrapper(this)}}t.RdfStore=p,p.DEFAULT_INDEX_COMBINATIONS=[["graph","subject","predicate","object"],["graph","predicate","object","subject"],["graph","object","subject","predicate"]]},51368:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DatasetCoreWrapper=void 0;const n=r(39034);class i{constructor(e){this.store=e}get size(){return this.store.size}add(e){return this.store.addQuad(e),this}delete(e){return this.store.removeQuad(e),this}has(e){for(const t of this.store.readQuads(e.subject,e.predicate,e.object,e.graph))return!0;return!1}match(e,t,r,a){const o=new n.RdfStore(this.store.options);for(const n of this.store.readQuads(e,t,r,a))o.addQuad(n);return new i(o)}[Symbol.iterator](){return this.store.readQuads()}}t.DatasetCoreWrapper=i},2369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},62947:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermDictionaryNumberMap=void 0;const n=r(18050),i=r(22112);t.TermDictionaryNumberMap=class{constructor(e=new n.DataFactory){this.lastId=0,this.dictionary=new Map,this.reverseDictionary=new Map,this.features={quotedTriples:!1},this.dataFactory=e}encode(e){const t=(0,i.termToString)(e);let r=this.dictionary.get(t);return void 0===r&&(r=this.lastId++,this.dictionary.set(t,r),this.reverseDictionary.set(r,t)),r}encodeOptional(e){const t=(0,i.termToString)(e);return this.dictionary.get(t)}decode(e){const t=this.reverseDictionary.get(e);if(void 0===t)throw new Error(`The value ${e} is not present in this dictionary`);return(0,i.stringToTerm)(t,this.dataFactory)}encodings(){return this.reverseDictionary.keys()}findQuotedTriples(e){throw new Error("findQuotedTriples is not supported")}findQuotedTriplesEncoded(e){throw new Error("findQuotedTriplesEncoded is not supported")}}},12924:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermDictionaryNumberRecord=void 0;const n=r(18050),i=r(22112);t.TermDictionaryNumberRecord=class{constructor(e=new n.DataFactory){this.lastId=0,this.dictionary={},this.reverseDictionary={},this.features={quotedTriples:!1},this.dataFactory=e}encode(e){const t=(0,i.termToString)(e);let r=this.dictionary[t];return void 0===r&&(r=this.lastId++,this.dictionary[t]=r,this.reverseDictionary[r]=t),r}encodeOptional(e){const t=(0,i.termToString)(e);return this.dictionary[t]}decode(e){const t=this.reverseDictionary[e];if(void 0===t)throw new Error(`The value ${e} is not present in this dictionary`);return(0,i.stringToTerm)(t,this.dataFactory)}*encodings(){for(const e of Object.keys(this.reverseDictionary))yield Number.parseInt(e,10)}findQuotedTriples(e){throw new Error("findQuotedTriples is not supported")}findQuotedTriplesEncoded(e){throw new Error("findQuotedTriplesEncoded is not supported")}}},76386:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermDictionaryNumberRecordFullTerms=void 0;const n=r(18050),i=r(22112);t.TermDictionaryNumberRecordFullTerms=class{constructor(e=new n.DataFactory){this.lastId=0,this.dictionary={},this.reverseDictionary={},this.features={quotedTriples:!1},this.dataFactory=e}encode(e){const t=(0,i.termToString)(e);let r=this.dictionary[t];return void 0===r&&(r=this.lastId++,this.dictionary[t]=r,this.reverseDictionary[r]=e),r}encodeOptional(e){const t=(0,i.termToString)(e);return this.dictionary[t]}decode(e){const t=this.reverseDictionary[e];if(void 0===t)throw new Error(`The value ${e} is not present in this dictionary`);return t}*encodings(){for(const e of Object.keys(this.reverseDictionary))yield Number.parseInt(e,10)}findQuotedTriples(e){throw new Error("findQuotedTriples is not supported")}findQuotedTriplesEncoded(e){throw new Error("findQuotedTriplesEncoded is not supported")}}},94992:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermDictionaryQuoted=void 0;const n=r(18050),i=r(13252);class a{constructor(e,t,r=new n.DataFactory){this.features={quotedTriples:!0},this.plainTermDictionary=e,this.quotedTriplesDictionary=t,this.dataFactory=r}encode(e){return"Quad"===e.termType?a.BITMASK|1+this.quotedTriplesDictionary.encode(e):this.plainTermDictionary.encode(e)}encodeOptional(e){if("Quad"===e.termType){const t=this.quotedTriplesDictionary.encodeOptional(e);return void 0===t?t:a.BITMASK|1+t}return this.plainTermDictionary.encodeOptional(e)}decode(e){if(a.BITMASK&e){const t=(~a.BITMASK&e)-1;return this.quotedTriplesDictionary.decode(t)}return this.plainTermDictionary.decode(e)}*encodings(){for(const e of this.plainTermDictionary.encodings())yield e;for(const e of this.quotedTriplesDictionary.encodings())yield a.BITMASK|1+e}*findQuotedTriples(e){for(const t of this.findQuotedTriplesEncoded(e))yield this.decode(t)}*findQuotedTriplesEncoded(e){for(let t of this.quotedTriplesDictionary.encodings()){t=a.BITMASK|1+t;const r=this.decode(t);(0,i.matchPattern)(r,e.subject,e.predicate,e.object,e.graph)&&(yield t)}}}t.TermDictionaryQuoted=a,a.BITMASK=1<<31},26503:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermDictionaryQuotedIndexed=void 0;const n=r(18050),i=r(95832),a=r(29390);class o{constructor(e,t=new n.DataFactory){this.quotedTriplesDictionary=[],this.features={quotedTriples:!0},this.plainTermDictionary=e;const r={indexCombinations:[],indexConstructor:void 0,dictionary:this,dataFactory:t};this.quotedTriplesReverseDictionaries=[new i.RdfStoreIndexNestedMap(r),new i.RdfStoreIndexNestedMap(r),new i.RdfStoreIndexNestedMap(r)],this.dataFactory=t}encode(e){return"Quad"===e.termType?this.encodeQuotedTriple(e,!1):this.plainTermDictionary.encode(e)}encodeQuotedTriple(e,t){if("DefaultGraph"!==e.graph.termType)throw new Error("Encoding of quoted quads outside of the default graph is not allowed");const r=(0,a.encodeOptionalTerms)([e.subject,e.predicate,e.object,e.graph],this),n=r&&r.every((e=>void 0!==e))?this.quotedTriplesReverseDictionaries[0].getEncoded(r):void 0;if(void 0!==n||t)return void 0===n?void 0:o.BITMASK|n;const i=[this.encode(e.subject),this.encode(e.predicate),this.encode(e.object)],s=this.quotedTriplesDictionary.length+1;this.quotedTriplesDictionary.push(i);const c=this.encode(this.dataFactory.defaultGraph());return this.quotedTriplesReverseDictionaries[0].set([i[0],i[1],i[2],c],s),this.quotedTriplesReverseDictionaries[1].set([i[1],i[2],i[0],c],s),this.quotedTriplesReverseDictionaries[2].set([i[2],i[0],i[1],c],s),o.BITMASK|s}encodeOptional(e){return"Quad"===e.termType?this.encodeQuotedTriple(e,!0):this.plainTermDictionary.encodeOptional(e)}decode(e){if(o.BITMASK&e){const t=(~o.BITMASK&e)-1;if(t>=this.quotedTriplesDictionary.length)throw new Error(`The value ${e} is not present in the quoted triples range of the dictionary`);const r=this.quotedTriplesDictionary[t];return this.dataFactory.quad(this.decode(r[0]),this.decode(r[1]),this.decode(r[2]))}return this.plainTermDictionary.decode(e)}*encodings(){for(const e of this.plainTermDictionary.encodings())yield e;for(const e of this.quotedTriplesDictionary.keys())yield o.BITMASK|1+e}*findQuotedTriples(e){for(const t of this.findQuotedTriplesEncoded(e))yield this.decode(t)}*findQuotedTriplesEncoded(e){const[t,r]=(0,a.quadToPattern)(e.subject,e.predicate,e.object,e.graph,!0);for(const e of this.patternToIterable(t[0]))for(const r of this.patternToIterable(t[1]))for(const n of this.patternToIterable(t[2]))for(const i of this.patternToIterable(t[3]))if(e&&r||!r&&!n){const a=[e,r,n,i];for(const e of this.quotedTriplesReverseDictionaries[0].findEncoded(a,t))yield o.BITMASK|this.quotedTriplesReverseDictionaries[0].getEncoded(e)}else if(!e&&r){const a=[r,n,e,i];for(const e of this.quotedTriplesReverseDictionaries[1].findEncoded(a,t))yield o.BITMASK|this.quotedTriplesReverseDictionaries[1].getEncoded(e)}else{const a=[n,e,r,i];for(const e of this.quotedTriplesReverseDictionaries[2].findEncoded(a,t))yield o.BITMASK|this.quotedTriplesReverseDictionaries[2].getEncoded(e)}}*patternToIterable(e){if("Quad"===e?.termType)return void(yield*this.findQuotedTriplesEncoded(e));if(void 0===e)return void(yield);const t=this.encodeOptional(e);void 0!==t&&(yield t)}}t.TermDictionaryQuotedIndexed=o,o.BITMASK=1<<31},86721:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermDictionaryQuotedReferential=void 0;const n=r(18050),i=r(13252),a=r(29390);class o{constructor(e,t=new n.DataFactory){this.quotedTriplesDictionary=[],this.quotedTriplesReverseDictionary={},this.features={quotedTriples:!0},this.plainTermDictionary=e,this.dataFactory=t}encode(e){return"Quad"===e.termType?this.encodeQuotedTriple(e,!1):this.plainTermDictionary.encode(e)}encodeQuotedTriple(e,t){if("DefaultGraph"!==e.graph.termType)throw new Error("Encoding of quoted quads outside of the default graph is not allowed");const r=(0,a.encodeOptionalTerms)([e.subject,e.predicate,e.object,void 0],this)?.slice(0,3),n=r&&r.every((e=>void 0!==e))?this.quotedTriplesReverseDictionary[r.join(o.SEPARATOR)]:void 0;if(void 0!==n||t)return void 0===n?void 0:o.BITMASK|n;const i=[this.encode(e.subject),this.encode(e.predicate),this.encode(e.object)],s=this.quotedTriplesDictionary.length+1;return this.quotedTriplesDictionary.push(i),this.quotedTriplesReverseDictionary[i.join(o.SEPARATOR)]=s,o.BITMASK|s}encodeOptional(e){return"Quad"===e.termType?this.encodeQuotedTriple(e,!0):this.plainTermDictionary.encodeOptional(e)}decode(e){if(o.BITMASK&e){const t=(~o.BITMASK&e)-1;if(t>=this.quotedTriplesDictionary.length)throw new Error(`The value ${e} is not present in the quoted triples range of the dictionary`);const r=this.quotedTriplesDictionary[t];return this.dataFactory.quad(this.decode(r[0]),this.decode(r[1]),this.decode(r[2]))}return this.plainTermDictionary.decode(e)}*encodings(){for(const e of this.plainTermDictionary.encodings())yield e;for(const e of this.quotedTriplesDictionary.keys())yield o.BITMASK|1+e}*findQuotedTriples(e){for(const t of this.findQuotedTriplesEncoded(e))yield this.decode(t)}*findQuotedTriplesEncoded(e){for(let t of this.quotedTriplesDictionary.keys()){t=o.BITMASK|1+t;const r=this.decode(t);(0,i.matchPattern)(r,e.subject,e.predicate,e.object,e.graph)&&(yield t)}}}t.TermDictionaryQuotedReferential=o,o.BITMASK=1<<31,o.SEPARATOR="_"},93616:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermDictionarySymbol=void 0;const n=r(18050),i=r(22112);t.TermDictionarySymbol=class{constructor(e=new n.DataFactory){this.features={quotedTriples:!1},this.dataFactory=e}encode(e){return Symbol.for(`rdf::${(0,i.termToString)(e)}`)}encodeOptional(e){return this.encode(e)}decode(e){const t=Symbol.keyFor(e);if(void 0===t)throw new Error(`The value ${String(e)} is not present in this dictionary`);return(0,i.stringToTerm)(t.slice(5),this.dataFactory)}encodings(){throw new Error("encodings is not supported")}findQuotedTriples(e){throw new Error("findQuotedTriples is not supported")}findQuotedTriplesEncoded(e){throw new Error("findQuotedTriplesEncoded is not supported")}}},55100:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},95832:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RdfStoreIndexNestedMap=void 0;const n=r(29390);t.RdfStoreIndexNestedMap=class{constructor(e){this.features={quotedTripleFiltering:!1},this.dictionary=e.dictionary,this.nestedMap=new Map}set(e,t){const r=this.nestedMap;let n=r.get(e[0]);n||(n=new Map,r.set(e[0],n));let i=n.get(e[1]);i||(i=new Map,n.set(e[1],i));let a=i.get(e[2]);a||(a=new Map,i.set(e[2],a));const o=a.has(e[3]);return o||a.set(e[3],t),!o}remove(e){const t=this.nestedMap,r=t.get(e[0]);if(!r)return!1;const n=r.get(e[1]);if(!n)return!1;const i=n.get(e[2]);if(!i)return!1;const a=i.delete(e[3]);return a&&0===i.size&&(n.delete(e[2]),0===n.size&&(r.delete(e[1]),0===r.size&&t.delete(e[0]))),a}get(e){const t=(0,n.encodeOptionalTerms)(e,this.dictionary);if(t&&!t.includes(void 0))return this.getEncoded(t)}getEncoded(e){const t=this.nestedMap.get(e[0]);if(!t)return;const r=t.get(e[1]);if(!r)return;const n=r.get(e[2]);return n?n.get(e[3]):void 0}*find(e){const t=(0,n.encodeOptionalTerms)(e,this.dictionary);if(!t)return;const[r,i,a,o]=t,[s,c,u,l]=e;let d,p,h,f,y,m,g;const b=this.nestedMap,v=void 0!==r?b.has(r)?[r]:[]:b.keys();for(const e of v){y=b.get(e),d=s||this.dictionary.decode(e);const t=void 0!==i?y.has(i)?[i]:[]:y.keys();for(const e of t){m=y.get(e),p=c||this.dictionary.decode(e);const t=void 0!==a?m.has(a)?[a]:[]:m.keys();for(const e of t){g=m.get(e),h=u||this.dictionary.decode(e);const t=void 0!==o?g.has(o)?[o]:[]:g.keys();for(const e of t)f=l||this.dictionary.decode(e),yield[d,p,h,f]}}}}*findEncoded(e,t){const[r,n,i,a]=e;let o,s,c;const u=this.nestedMap,l=void 0!==r?u.has(r)?[r]:[]:u.keys();for(const e of l){o=u.get(e);const t=void 0!==n?o.has(n)?[n]:[]:o.keys();for(const r of t){s=o.get(r);const t=void 0!==i?s.has(i)?[i]:[]:s.keys();for(const n of t){c=s.get(n);const t=void 0!==a?c.has(a)?[a]:[]:c.keys();for(const i of t)yield[e,r,n,i]}}}}*findTermsInner(e,t,r,n){if(r[e])for(const i of t){const t=[...n,i[0]];yield*this.findTermsInner(e+1,i[1],r,t)}else if(e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RdfStoreIndexNestedMapQuoted=void 0;const n=r(29390),i=r(95832);class a extends i.RdfStoreIndexNestedMap{constructor(e){super(e),this.features={quotedTripleFiltering:!0}}*getQuotedPatternKeys(e,t){for(const r of this.dictionary.findQuotedTriplesEncoded(t))e.has(r)&&(yield r)}*find(e){const t=(0,n.encodeOptionalTerms)(e,this.dictionary);if(!t)return;const[r,i,a,o]=t,[s,c,u,l]=e,[d,p,h,f]=(0,n.arePatternsQuoted)(e);let y,m,g,b,v,_,T;const O=this.nestedMap,w=void 0!==s?d?this.getQuotedPatternKeys(O,s):O.has(r)?[r]:[]:O.keys();for(const e of w){v=O.get(e),y=!d&&s?s:this.dictionary.decode(e);const t=void 0!==c?p?this.getQuotedPatternKeys(v,c):v.has(i)?[i]:[]:v.keys();for(const e of t){_=v.get(e),m=!p&&c?c:this.dictionary.decode(e);const t=void 0!==u?h?this.getQuotedPatternKeys(_,u):_.has(a)?[a]:[]:_.keys();for(const e of t){T=_.get(e),g=!h&&u?u:this.dictionary.decode(e);const t=void 0!==l?f?this.getQuotedPatternKeys(T,l):T.has(o)?[o]:[]:T.keys();for(const e of t)b=!f&&l?l:this.dictionary.decode(e),yield[y,m,g,b]}}}}*findEncoded(e,t){const[r,i,a,o]=e,[s,c,u,l]=t,[d,p,h,f]=(0,n.arePatternsQuoted)(t);let y,m,g;const b=this.nestedMap,v=void 0!==s?d?this.getQuotedPatternKeys(b,s):b.has(r)?[r]:[]:b.keys();for(const e of v){y=b.get(e);const t=void 0!==c?p?this.getQuotedPatternKeys(y,c):y.has(i)?[i]:[]:y.keys();for(const r of t){m=y.get(r);const t=void 0!==u?h?this.getQuotedPatternKeys(m,u):m.has(a)?[a]:[]:m.keys();for(const n of t){g=m.get(n);const t=void 0!==l?f?this.getQuotedPatternKeys(g,l):g.has(o)?[o]:[]:g.keys();for(const i of t)yield[Number.parseInt(e,10),Number.parseInt(r,10),Number.parseInt(n,10),Number.parseInt(i,10)]}}}}count(e){let t=0;const r=(0,n.encodeOptionalTerms)(e,this.dictionary);if(!r)return 0;const[i,a,o,s]=r,[c,u,l,d]=e,[p,h,f,y]=(0,n.arePatternsQuoted)(e);let m,g,b;const v=this.nestedMap,_=void 0!==c?p?this.getQuotedPatternKeys(v,c):v.has(i)?[i]:[]:v.keys();for(const e of _){m=v.get(e);const r=void 0!==u?h?this.getQuotedPatternKeys(m,u):m.has(a)?[a]:[]:m.keys();for(const e of r){g=m.get(e);const r=void 0!==l?f?this.getQuotedPatternKeys(g,l):g.has(o)?[o]:[]:g.keys();for(const e of r)b=g.get(e),void 0!==d?y?t+=[...this.getQuotedPatternKeys(b,d)].length:b.has(s)&&t++:t+=b.size}}return t}}t.RdfStoreIndexNestedMapQuoted=a},38654:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RdfStoreIndexNestedMapRecursive=void 0;const n=r(29390);t.RdfStoreIndexNestedMapRecursive=class{constructor(e){this.features={quotedTripleFiltering:!1},this.dictionary=e.dictionary,this.nestedMap=new Map}set(e,t){let r=this.nestedMap,n=!1;for(const[i,a]of e.entries()){const o=r;let s=o.get(a);s?i===e.length-1&&(n=!0):(s=i===e.length-1?t:new Map,o.set(a,s)),r=s}return!n}remove(e){const t=this.nestedMap,r=t.get(e[0]);if(!r)return!1;const n=r.get(e[1]);if(!n)return!1;const i=n.get(e[2]);if(!i)return!1;const a=i.delete(e[3]);return a&&0===i.size&&(n.delete(e[2]),0===n.size&&(r.delete(e[1]),0===r.size&&t.delete(e[0]))),a}get(e){const t=(0,n.encodeOptionalTerms)(e,this.dictionary);if(t&&!t.includes(void 0))return this.getEncoded(t)}getEncoded(e){const t=this.nestedMap.get(e[0]);if(!t)return;const r=t.get(e[1]);if(!r)return;const n=r.get(e[2]);return n?n.get(e[3]):void 0}*find(e){const t=(0,n.encodeOptionalTerms)(e,this.dictionary);if(t)for(const r of this.findEncoded(t,e))yield[void 0!==t[0]?e[0]:this.dictionary.decode(r[0]),void 0!==t[1]?e[1]:this.dictionary.decode(r[1]),void 0!==t[2]?e[2]:this.dictionary.decode(r[2]),void 0!==t[3]?e[3]:this.dictionary.decode(r[3])]}*findEncoded(e,t){return yield*this.findEncodedInner(0,e,t,this.nestedMap,[])}*findEncodedInner(e,t,r,n,i){if(e===t.length)yield[...i];else{const a=t[e];if(r[e]){const o=a,s=n.get(o);s&&(i[e]=a,yield*this.findEncodedInner(e+1,t,r,s,i))}else for(const[a,o]of n.entries())i[e]=a,yield*this.findEncodedInner(e+1,t,r,o,i)}}*findTermsInner(e,t,r,n){if(r[e])for(const[i,a]of t.entries()){const t=[...n,i];yield*this.findTermsInner(e+1,a,r,t)}else if(e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RdfStoreIndexNestedMapRecursiveQuoted=void 0;const n=r(29390),i=r(38654);class a extends i.RdfStoreIndexNestedMapRecursive{constructor(e){super(e),this.features={quotedTripleFiltering:!0}}*findEncoded(e,t){return yield*this.findEncodedInnerQuoted(0,e,t,(0,n.arePatternsQuoted)(t),this.nestedMap,[])}*findEncodedInnerQuoted(e,t,r,n,i,a){if(e===t.length)yield[...a];else{const o=t[e],s=r[e];if(s)if(n[e]){const o=this.dictionary.findQuotedTriplesEncoded(s);for(const s of o){const o=i.get(s);o&&(a[e]=s,yield*this.findEncodedInnerQuoted(e+1,t,r,n,o,a))}}else{const s=o,c=i.get(s);c&&(a[e]=o,yield*this.findEncodedInnerQuoted(e+1,t,r,n,c,a))}else for(const[o,s]of i.entries())a[e]=o,yield*this.findEncodedInnerQuoted(e+1,t,r,n,s,a)}}countInner(e,t,r){const i=t[e];let a=0;if(i)if("Quad"===i.termType&&(0,n.quadHasVariables)(i)){const n=this.dictionary.findQuotedTriplesEncoded(i);for(const i of n)if(e===t.length-1)r.has(i)&&a++;else{const n=r.get(i);n&&(a+=this.countInner(e+1,t,n))}}else{const n=this.dictionary.encodeOptional(i);if(void 0!==n){if(e===t.length-1)return r.has(n)?1:0;const i=r.get(n);i&&(a+=this.countInner(e+1,t,i))}}else{if(e===t.length-1)return r.size;for(const n of r.values())a+=this.countInner(e+1,t,n)}return a}}t.RdfStoreIndexNestedMapRecursiveQuoted=a},53277:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RdfStoreIndexNestedRecord=void 0;const n=r(29390);t.RdfStoreIndexNestedRecord=class{constructor(e){this.features={quotedTripleFiltering:!1},this.dictionary=e.dictionary,this.nestedRecords={}}set(e,t){const r=this.nestedRecords,n=r[e[0]]||(r[e[0]]={}),i=n[e[1]]||(n[e[1]]={}),a=i[e[2]]||(i[e[2]]={});return!a[e[3]]&&(a[e[3]]=t,!0)}remove(e){const t=this.nestedRecords,r=t[e[0]];if(!r)return!1;const n=r[e[1]];if(!n)return!1;const i=n[e[2]];return!!i&&!!i[e[3]]&&(delete i[e[3]],0===Object.keys(i).length&&(delete n[e[2]],0===Object.keys(n).length&&(delete r[e[1]],0===Object.keys(r).length&&delete t[e[0]])),!0)}get(e){const t=(0,n.encodeOptionalTerms)(e,this.dictionary);if(t&&!t.includes(void 0))return this.getEncoded(t)}getEncoded(e){return this.nestedRecords[e[0]]?.[e[1]]?.[e[2]]?.[e[3]]}*find(e){const t=(0,n.encodeOptionalTerms)(e,this.dictionary);if(!t)return;const[r,i,a,o]=t,[s,c,u,l]=e;let d,p,h,f,y,m,g;const b=this.nestedRecords,v=void 0!==r?r in b?[r]:[]:Object.keys(b);for(const e of v){y=b[e],d=s||this.dictionary.decode(Number.parseInt(e,10));const t=void 0!==i?i in y?[i]:[]:Object.keys(y);for(const e of t){m=y[e],p=c||this.dictionary.decode(Number.parseInt(e,10));const t=void 0!==a?a in m?[a]:[]:Object.keys(m);for(const e of t){g=m[e],h=u||this.dictionary.decode(Number.parseInt(e,10));const t=void 0!==o?o in g?[o]:[]:Object.keys(g);for(const e of t)f=l||this.dictionary.decode(Number.parseInt(e,10)),yield[d,p,h,f]}}}}*findEncoded(e,t){const[r,n,i,a]=e;let o,s,c;const u=this.nestedRecords,l=void 0!==r?r in u?[r]:[]:Object.keys(u);for(const e of l){o=u[e];const t=void 0!==n?n in o?[n]:[]:Object.keys(o);for(const r of t){s=o[r];const t=void 0!==i?i in s?[i]:[]:Object.keys(s);for(const n of t){c=s[n];const t=void 0!==a?a in c?[a]:[]:Object.keys(c);for(const i of t)yield[Number.parseInt(e,10),Number.parseInt(r,10),Number.parseInt(n,10),Number.parseInt(i,10)]}}}}*findTermsInner(e,t,r,n){if(r[e])for(const[i,a]of Object.entries(t)){const t=[...n,Number.parseInt(i,10)];yield*this.findTermsInner(e+1,a,r,t)}else if(e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RdfStoreIndexNestedRecordQuoted=void 0;const n=r(29390),i=r(53277);class a extends i.RdfStoreIndexNestedRecord{constructor(e){super(e),this.features={quotedTripleFiltering:!0}}*getQuotedPatternKeys(e,t){for(const r of this.dictionary.findQuotedTriplesEncoded(t))r in e&&(yield r)}*find(e){const t=(0,n.encodeOptionalTerms)(e,this.dictionary);if(!t)return;const[r,i,a,o]=t,[s,c,u,l]=e,[d,p,h,f]=(0,n.arePatternsQuoted)(e);let y,m,g,b,v,_,T;const O=this.nestedRecords,w=void 0!==s?d?this.getQuotedPatternKeys(O,s):r in O?[r]:[]:Object.keys(O);for(const e of w){v=O[e],y=!d&&s?s:this.dictionary.decode(Number.parseInt(e,10));const t=void 0!==c?p?this.getQuotedPatternKeys(v,c):i in v?[i]:[]:Object.keys(v);for(const e of t){_=v[e],m=!p&&c?c:this.dictionary.decode(Number.parseInt(e,10));const t=void 0!==u?h?this.getQuotedPatternKeys(_,u):a in _?[a]:[]:Object.keys(_);for(const e of t){T=_[e],g=!h&&u?u:this.dictionary.decode(Number.parseInt(e,10));const t=void 0!==l?f?this.getQuotedPatternKeys(T,l):o in T?[o]:[]:Object.keys(T);for(const e of t)b=!f&&l?l:this.dictionary.decode(Number.parseInt(e,10)),yield[y,m,g,b]}}}}*findEncoded(e,t){const[r,i,a,o]=e,[s,c,u,l]=t,[d,p,h,f]=(0,n.arePatternsQuoted)(t);let y,m,g;const b=this.nestedRecords,v=void 0!==s?d?this.getQuotedPatternKeys(b,s):r in b?[r]:[]:Object.keys(b);for(const e of v){y=b[e];const t=void 0!==c?p?this.getQuotedPatternKeys(y,c):i in y?[i]:[]:Object.keys(y);for(const r of t){m=y[r];const t=void 0!==u?h?this.getQuotedPatternKeys(m,u):a in m?[a]:[]:Object.keys(m);for(const n of t){g=m[n];const t=void 0!==l?f?this.getQuotedPatternKeys(g,l):o in g?[o]:[]:Object.keys(g);for(const i of t)yield[Number.parseInt(e,10),Number.parseInt(r,10),Number.parseInt(n,10),Number.parseInt(i,10)]}}}}count(e){let t=0;const r=(0,n.encodeOptionalTerms)(e,this.dictionary);if(!r)return 0;const[i,a,o,s]=r,[c,u,l,d]=e,[p,h,f,y]=(0,n.arePatternsQuoted)(e);let m,g,b;const v=this.nestedRecords,_=void 0!==c?p?this.getQuotedPatternKeys(v,c):i in v?[i]:[]:Object.keys(v);for(const e of _){m=v[e];const r=void 0!==u?h?this.getQuotedPatternKeys(m,u):a in m?[a]:[]:Object.keys(m);for(const e of r){g=m[e];const r=void 0!==l?f?this.getQuotedPatternKeys(g,l):o in g?[o]:[]:Object.keys(g);for(const e of r)b=g[e],void 0!==d?y?t+=[...this.getQuotedPatternKeys(b,d)].length:s in b&&t++:t+=Object.keys(b).length}}return t}}t.RdfStoreIndexNestedRecordQuoted=a},64817:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.termToString=t.stringToTerm=t.stringQuadToQuad=t.quadToStringQuad=t.getLiteralValue=t.getLiteralType=t.getLiteralDirection=t.getLiteralLanguage=void 0;const n=r(91379);Object.defineProperty(t,"getLiteralLanguage",{enumerable:!0,get:function(){return n.getLiteralLanguage}}),Object.defineProperty(t,"getLiteralDirection",{enumerable:!0,get:function(){return n.getLiteralDirection}}),Object.defineProperty(t,"getLiteralType",{enumerable:!0,get:function(){return n.getLiteralType}}),Object.defineProperty(t,"getLiteralValue",{enumerable:!0,get:function(){return n.getLiteralValue}}),Object.defineProperty(t,"quadToStringQuad",{enumerable:!0,get:function(){return n.quadToStringQuad}}),Object.defineProperty(t,"stringQuadToQuad",{enumerable:!0,get:function(){return n.stringQuadToQuad}}),Object.defineProperty(t,"stringToTerm",{enumerable:!0,get:function(){return n.stringToTerm}}),Object.defineProperty(t,"termToString",{enumerable:!0,get:function(){return n.termToString}})},91379:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.termToString=i,t.getLiteralValue=a,t.getLiteralType=o,t.getLiteralLanguage=s,t.getLiteralDirection=c,t.stringToTerm=u,t.quadToStringQuad=function(e){return{subject:i(e.subject),predicate:i(e.predicate),object:i(e.object),graph:i(e.graph)}},t.stringQuadToQuad=function(e,t){return(t=t||n).quad(u(e.subject,t),u(e.predicate,t),u(e.object,t),u(e.graph,t))};const n=new(r(18050).DataFactory);function i(e){var t,r;if(e)switch(e.termType){case"NamedNode":return`<${t=e.value,t.replace(l,p)}>`;case"BlankNode":return`_:${e.value}`;case"Literal":{const t=e;return`"${r=t.value,l.test(r)&&(r=r.replace(l,p)),r}"${t.datatype&&"http://www.w3.org/2001/XMLSchema#string"!==t.datatype.value&&"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"!==t.datatype.value&&"http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"!==t.datatype.value?`^^<${t.datatype.value}>`:""}${t.language?`@${t.language}`:""}${t.direction?`--${t.direction}`:""}`}case"Quad":return`<<${i(e.subject)} ${i(e.predicate)} ${i(e.object)}${"DefaultGraph"===e.graph.termType?"":` ${i(e.graph)}`}>>`;case"Variable":return`?${e.value}`;case"DefaultGraph":return e.value}}function a(e){const t=/^"([^]*)"((\^\^.*)|(@.*))?$/u.exec(e);if(!t)throw new Error(`${e} is not a literal`);return t[1].replace(/\\"/gu,'"')}function o(e){const t=/^"[^]*"(?:\^\^<([^"]+)>|(@)[^@"]+)?$/u.exec(e);if(!t)throw new Error(`${e} is not a literal`);return t[1]||(t[2]?"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString":"http://www.w3.org/2001/XMLSchema#string")}function s(e){const t=/^"[^]*"(?:@([^@"]+)|\^\^[^"]+)?$/u.exec(e);if(!t)throw new Error(`${e} is not a literal`);if(t[1]){let e=t[1].toLowerCase();const r=e.indexOf("--");return r>=0&&(e=e.slice(0,r)),e}return""}function c(e){const t=e.indexOf("--",e.lastIndexOf('"'));if(t>=0){const r=e.slice(t+2,e.length);if("ltr"===r||"rtl"===r)return r;throw new Error(`${e} is not a literal with a valid direction`)}return""}function u(e,t){if(t=t||n,!e||0===e.length)return t.defaultGraph();switch(e[0]){case"_":return t.blankNode(e.slice(2));case"?":if(!t.variable)throw new Error("Missing 'variable()' method on the given DataFactory");return t.variable(e.slice(1));case'"':{const r=s(e),n=c(e),i=t.namedNode(o(e));return t.literal(a(e),r?{language:r,direction:n}:i)}default:if(e.startsWith("<<")&&e.endsWith(">>")){const r=e.slice(2,-2),n=[];let i=0,a=0;for(let t=0;t"===o){if(0===i)throw new Error(`Found closing tag without opening tag in ${e}`);i--}" "===o&&0===i&&(n.push(r.slice(a,t)),a=t+1)}if(0!==i)throw new Error(`Found opening tag without closing tag in ${e}`);if(n.push(r.slice(a,r.length)),3!==n.length&&4!==n.length)throw new Error(`Nested quad syntax error ${e}`);return t.quad(u(n[0]),u(n[1]),u(n[2]),n[3]?u(n[3]):void 0)}if(!e.startsWith("<")||!e.endsWith(">"))throw new Error(`Detected invalid iri for named node (must be wrapped in <>): ${e}`);return t.namedNode(e.slice(1,-1))}}const l=/["\\\t\n\r\b\f\u0000-\u0019]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d=new Map([["\\","\\\\"],['"','\\"'],["\t","\\t"],["\n","\\n"],["\r","\\r"],["\b","\\b"],["\f","\\f"]]);function p(e){const t=d.get(e);if(!t){if(1===e.length){const t=e.charCodeAt(0).toString(16);return`${"\\u0000".slice(0,-t.length)}${t}`}const t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16);return`${"\\U00000000".slice(0,-t.length)}${t}`}return t}},22112:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.termToString=t.stringToTerm=t.stringQuadToQuad=t.quadToStringQuad=t.getLiteralValue=t.getLiteralType=t.getLiteralDirection=t.getLiteralLanguage=void 0;const n=r(48244);Object.defineProperty(t,"getLiteralLanguage",{enumerable:!0,get:function(){return n.getLiteralLanguage}}),Object.defineProperty(t,"getLiteralDirection",{enumerable:!0,get:function(){return n.getLiteralDirection}}),Object.defineProperty(t,"getLiteralType",{enumerable:!0,get:function(){return n.getLiteralType}}),Object.defineProperty(t,"getLiteralValue",{enumerable:!0,get:function(){return n.getLiteralValue}}),Object.defineProperty(t,"quadToStringQuad",{enumerable:!0,get:function(){return n.quadToStringQuad}}),Object.defineProperty(t,"stringQuadToQuad",{enumerable:!0,get:function(){return n.stringQuadToQuad}}),Object.defineProperty(t,"stringToTerm",{enumerable:!0,get:function(){return n.stringToTerm}}),Object.defineProperty(t,"termToString",{enumerable:!0,get:function(){return n.termToString}})},48244:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.termToString=i,t.getLiteralValue=a,t.getLiteralType=o,t.getLiteralLanguage=s,t.getLiteralDirection=c,t.stringToTerm=u,t.quadToStringQuad=function(e){return{subject:i(e.subject),predicate:i(e.predicate),object:i(e.object),graph:i(e.graph)}},t.stringQuadToQuad=function(e,t){return(t=t||n).quad(u(e.subject,t),u(e.predicate,t),u(e.object,t),u(e.graph,t))};const n=new(r(18050).DataFactory);function i(e){if(e)switch(e.termType){case"NamedNode":case"DefaultGraph":return e.value;case"BlankNode":return"_:"+e.value;case"Literal":const t=e;return'"'+t.value+'"'+(t.datatype&&"http://www.w3.org/2001/XMLSchema#string"!==t.datatype.value&&"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"!==t.datatype.value&&"http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"!==t.datatype.value?"^^"+t.datatype.value:"")+(t.language?"@"+t.language:"")+(t.direction?"--"+t.direction:"");case"Quad":return`<<${i(e.subject)} ${i(e.predicate)} ${i(e.object)}${"DefaultGraph"===e.graph.termType?"":" "+i(e.graph)}>>`;case"Variable":return"?"+e.value}}function a(e){const t=/^"([^]*)"/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]}function o(e){const t=/^"[^]*"(?:\^\^([^"]+)|(@)[^@"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]||(t[2]?"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString":"http://www.w3.org/2001/XMLSchema#string")}function s(e){const t=/^"[^]*"(?:@([^@"]+)|\^\^[^"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");if(t[1]){let e=t[1].toLowerCase();const r=e.indexOf("--");return r>=0&&(e=e.slice(0,r)),e}return""}function c(e){const t=e.indexOf("--",e.lastIndexOf('"'));if(t>=0){const r=e.slice(t+2,e.length);if("ltr"===r||"rtl"===r)return r;throw new Error(e+" is not a literal with a valid direction")}return""}function u(e,t){if(t=t||n,!e||!e.length)return t.defaultGraph();switch(e[0]){case"_":return t.blankNode(e.substr(2));case"?":if(!t.variable)throw new Error("Missing 'variable()' method on the given DataFactory");return t.variable(e.substr(1));case'"':const r=s(e),n=c(e),i=t.namedNode(o(e));return t.literal(a(e),r?{language:r,direction:n}:i);default:if("<"===e[0]&&e.length>4&&"<"===e[1]&&">"===e[e.length-1]&&">"===e[e.length-2]){const r=e.slice(2,-2).trim();let n=[],i=0,a=0,o=!1;for(let t=0;t"===s){if(0===i)throw new Error("Found closing tag without opening tag in "+e);i--}if('"'===s){let e=!1,n=t;for(;n-- >0&&"\\"===r[n];)e=!e;e||(o=!o)}if(" "===s&&!o&&0===i){for(n.push(r.slice(a,t));" "===r[t+1];)t+=1;a=t+1}}if(0!==i)throw new Error("Found opening tag without closing tag in "+e);if(n.push(r.slice(a,r.length)),3!==n.length&&4!==n.length)throw new Error("Nested quad syntax error "+e);return n=n.map((e=>e.startsWith("<")&&!e.includes(" ")?e.slice(1,-1):e)),t.quad(u(n[0]),u(n[1]),u(n[2]),n[3]?u(n[3]):void 0)}return t.namedNode(e)}}},13252:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(10175),t),i(r(86552),t)},10175:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TRIPLE_TERM_NAMES=t.QUAD_TERM_NAMES=void 0,t.getTerms=i,t.getTermsNested=function e(t,r){const n=[];for(const a of i(t,r))"Quad"===a.termType?e(a,r).forEach((e=>n.push(e))):n.push(a);return n},t.getNamedTerms=function(e){return[{key:"subject",value:e.subject},{key:"predicate",value:e.predicate},{key:"object",value:e.object},{key:"graph",value:e.graph}]},t.collectNamedTerms=function(e,t,r){const i={};return e.forEach((e=>i[e.key]=e.value)),t&&(i.subject=i.subject||t("subject"),i.predicate=i.predicate||t("predicate"),i.object=i.object||t("object"),i.graph=i.graph||t("graph")),(r||n).quad(i.subject,i.predicate,i.object,i.graph)},t.forEachTerms=function(e,t){t(e.subject,"subject"),t(e.predicate,"predicate"),t(e.object,"object"),t(e.graph,"graph")},t.forEachTermsNested=function e(t,r,n=[]){"Quad"===t.subject.termType?e(t.subject,r,[...n,"subject"]):r(t.subject,[...n,"subject"]),"Quad"===t.predicate.termType?e(t.predicate,r,[...n,"predicate"]):r(t.predicate,[...n,"predicate"]),"Quad"===t.object.termType?e(t.object,r,[...n,"object"]):r(t.object,[...n,"object"]),"Quad"===t.graph.termType?e(t.graph,r,[...n,"graph"]):r(t.graph,[...n,"graph"])},t.filterTerms=function(e,t){const r=[];return t(e.subject,"subject")&&r.push(e.subject),t(e.predicate,"predicate")&&r.push(e.predicate),t(e.object,"object")&&r.push(e.object),t(e.graph,"graph")&&r.push(e.graph),r},t.filterTermsNested=function e(t,r,n=[]){let i=[];return"Quad"===t.subject.termType?i=[...i,...e(t.subject,r,[...n,"subject"])]:r(t.subject,[...n,"subject"])&&i.push(t.subject),"Quad"===t.predicate.termType?i=[...i,...e(t.predicate,r,[...n,"predicate"])]:r(t.predicate,[...n,"predicate"])&&i.push(t.predicate),"Quad"===t.object.termType?i=[...i,...e(t.object,r,[...n,"object"])]:r(t.object,[...n,"object"])&&i.push(t.object),"Quad"===t.graph.termType?i=[...i,...e(t.graph,r,[...n,"graph"])]:r(t.graph,[...n,"graph"])&&i.push(t.graph),i},t.filterQuadTermNames=function(e,t){const r=[];return t(e.subject,"subject")&&r.push("subject"),t(e.predicate,"predicate")&&r.push("predicate"),t(e.object,"object")&&r.push("object"),t(e.graph,"graph")&&r.push("graph"),r},t.filterQuadTermNamesNested=function e(t,r,n=[]){let i=[];const a=[...n,"subject"];"Quad"===t.subject.termType?i=[...i,...e(t.subject,r,a)]:r(t.subject,a)&&i.push(a);const o=[...n,"predicate"];"Quad"===t.predicate.termType?i=[...i,...e(t.predicate,r,o)]:r(t.predicate,o)&&i.push(o);const s=[...n,"object"];"Quad"===t.object.termType?i=[...i,...e(t.object,r,s)]:r(t.object,s)&&i.push(s);const c=[...n,"graph"];return"Quad"===t.graph.termType?i=[...i,...e(t.graph,r,c)]:r(t.graph,c)&&i.push(c),i},t.mapTerms=function(e,t,r){return(r||n).quad(t(e.subject,"subject"),t(e.predicate,"predicate"),t(e.object,"object"),t(e.graph,"graph"))},t.mapTermsNested=function e(t,r,i,a=[]){return(i||n).quad("Quad"===t.subject.termType?e(t.subject,r,i,[...a,"subject"]):r(t.subject,[...a,"subject"]),"Quad"===t.predicate.termType?e(t.predicate,r,i,[...a,"predicate"]):r(t.predicate,[...a,"predicate"]),"Quad"===t.object.termType?e(t.object,r,i,[...a,"object"]):r(t.object,[...a,"object"]),"Quad"===t.graph.termType?e(t.graph,r,i,[...a,"graph"]):r(t.graph,[...a,"graph"]))},t.reduceTerms=function(e,t,r){let n=r;return n=t(n,e.subject,"subject"),n=t(n,e.predicate,"predicate"),n=t(n,e.object,"object"),t(n,e.graph,"graph")},t.reduceTermsNested=function e(t,r,n,i=[]){let a=n;return a="Quad"===t.subject.termType?e(t.subject,r,a,[...i,"subject"]):r(a,t.subject,[...i,"subject"]),a="Quad"===t.predicate.termType?e(t.predicate,r,a,[...i,"predicate"]):r(a,t.predicate,[...i,"predicate"]),a="Quad"===t.object.termType?e(t.object,r,a,[...i,"object"]):r(a,t.object,[...i,"object"]),a="Quad"===t.graph.termType?e(t.graph,r,a,[...i,"graph"]):r(a,t.graph,[...i,"graph"]),a},t.everyTerms=a,t.everyTermsNested=function e(t,r,n=[]){return("Quad"===t.subject.termType?e(t.subject,r,[...n,"subject"]):r(t.subject,[...n,"subject"]))&&("Quad"===t.predicate.termType?e(t.predicate,r,[...n,"predicate"]):r(t.predicate,[...n,"predicate"]))&&("Quad"===t.object.termType?e(t.object,r,[...n,"object"]):r(t.object,[...n,"object"]))&&("Quad"===t.graph.termType?e(t.graph,r,[...n,"graph"]):r(t.graph,[...n,"graph"]))},t.someTerms=function(e,t){return t(e.subject,"subject")||t(e.predicate,"predicate")||t(e.object,"object")||t(e.graph,"graph")},t.someTermsNested=function e(t,r,n=[]){return("Quad"===t.subject.termType?e(t.subject,r,[...n,"subject"]):r(t.subject,[...n,"subject"]))||("Quad"===t.predicate.termType?e(t.predicate,r,[...n,"predicate"]):r(t.predicate,[...n,"predicate"]))||("Quad"===t.object.termType?e(t.object,r,[...n,"object"]):r(t.object,[...n,"object"]))||("Quad"===t.graph.termType?e(t.graph,r,[...n,"graph"]):r(t.graph,[...n,"graph"]))},t.getValueNestedPath=function e(t,r){if(0===r.length)return t;if("Quad"===t.termType)return e(t[r[0]],r.slice(1));throw new Error(`Tried to get ${r[0]} from term of type ${t.termType}`)},t.matchTerm=o,t.matchPattern=s,t.matchPatternComplete=c,t.matchPatternMappings=function(e,t,r={}){const n={};return function e(t,i){return a(t,((t,a)=>{var o,s;const c=i[a];switch(t.termType){case"Variable":return r.skipVarMapping&&"Variable"===c.termType||(null!==(s=null===(o=n[t.value])||void 0===o?void 0:o.equals(c))&&void 0!==s?s:(n[t.value]=c,!0));case"Quad":return"Quad"===c.termType&&e(t,c);default:return t.equals(c)}}))}(t,e)&&(!r.returnMappings||n)};const n=new(r(18050).DataFactory);function i(e,t){return t&&"DefaultGraph"===e.graph.termType?[e.subject,e.predicate,e.object]:[e.subject,e.predicate,e.object,e.graph]}function a(e,t){return t(e.subject,"subject")&&t(e.predicate,"predicate")&&t(e.object,"object")&&t(e.graph,"graph")}function o(e,t){return!t||"Variable"===t.termType||"Quad"===t.termType&&"Quad"===e.termType&&c(e,t)||t.equals(e)}function s(e,t,r,n,i){return o(e.subject,t)&&o(e.predicate,r)&&o(e.object,n)&&o(e.graph,i)}function c(e,t){return s(e,t.subject,t.predicate,t.object,t.graph)}t.QUAD_TERM_NAMES=["subject","predicate","object","graph"],t.TRIPLE_TERM_NAMES=["subject","predicate","object"]},86552:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TERM_TYPES=void 0,t.uniqTerms=function(e){const t={};return e.filter((e=>{const r=(0,n.termToString)(e);return!(r in t)&&(t[r]=!0)}))},t.getTermsOfType=i,t.getNamedNodes=function(e){return i(e,"NamedNode")},t.getBlankNodes=function(e){return i(e,"BlankNode")},t.getLiterals=function(e){return i(e,"Literal")},t.getVariables=function(e){return i(e,"Variable")},t.getDefaultGraphs=function(e){return i(e,"DefaultGraph")},t.getQuads=function(e){return i(e,"Quad")};const n=r(22112);function i(e,t){return e.filter((e=>e.termType===t))}t.TERM_TYPES=["NamedNode","BlankNode","Literal","Variable","DefaultGraph","Quad"]},97990:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(70326),t)},35695:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParseError=void 0;class r extends Error{constructor(e,t){const r=e.saxParser;super(e.trackPosition?`Line ${r.line} column ${r.column+1}: ${t}`:t)}}t.ParseError=r},70326:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParseType=t.RdfXmlParser=void 0;const n=r(9929),i=r(49126),a=r(58521),o=r(35695),s=r(18050),c=r(29815);class u extends a.Transform{constructor(e){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},e&&(Object.assign(this,e),this.options=e),this.dataFactory||(this.dataFactory=new s.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),!1!==this.validateUri&&(this.validateUri=!0),this.iriValidationStrategy||(this.iriValidationStrategy=this.validateUri?c.IriValidationStrategy.Pragmatic:c.IriValidationStrategy.None),this.parseUnsupportedVersions=!!(null==e?void 0:e.parseUnsupportedVersions),this.version=null==e?void 0:e.version,this.saxParser=new i.SaxesParser({xmlns:!0,position:this.trackPosition}),this.attachSaxListeners()}import(e){const t=new a.PassThrough({readableObjectMode:!0});e.on("error",(e=>r.emit("error",e))),e.on("data",(e=>t.push(e))),e.on("end",(()=>t.push(null)));const r=t.pipe(new u(this.options));return r}_transform(e,t,r){if(this.version){const e=this.version;if(this.version=void 0,!this.isValidVersion(e))return r(this.newParseError(`Detected unsupported version as media type parameter: ${e}`))}try{this.saxParser.write(e)}catch(e){return r(e)}r()}newParseError(e){return new o.ParseError(this,e)}valueToUri(e,t){return this.uriToNamedNode((0,n.resolve)(e,t.baseIRI))}uriToNamedNode(e){const t=(0,c.validateIri)(e,this.iriValidationStrategy);if(t instanceof Error)throw this.newParseError(t.message);return this.dataFactory.namedNode(e)}validateNcname(e){if(!u.NCNAME_MATCHER.test(e))throw this.newParseError(`Not a valid NCName: ${e}`)}createLiteral(e,t){return this.dataFactory.literal(e,t.datatype?t.datatype:t.language?{language:t.language,direction:t.rdfVersion?t.direction:void 0}:void 0)}isValidVersion(e){return this.parseUnsupportedVersions||u.SUPPORTED_VERSIONS.includes(e)}attachSaxListeners(){this.saxParser.on("error",(e=>this.emit("error",e))),this.saxParser.on("opentag",this.onTag.bind(this)),this.saxParser.on("text",this.onText.bind(this)),this.saxParser.on("cdata",this.onText.bind(this)),this.saxParser.on("closetag",this.onCloseTag.bind(this)),this.saxParser.on("doctype",this.onDoctype.bind(this))}onTag(e){const t=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let r=l.RESOURCE;if(t&&(t.hadChildren=!0,r=t.childrenParseType),t&&t.childrenStringTags){const r=e.name;let n="";for(const{key:e,value:r}of t.namespaces||[])n+=` ${e}="${r}"`;for(const t in e.attributes)n+=` ${t}="${e.attributes[t].value}"`;const i=`<${r}${n}>`;t.childrenStringTags.push(i);const a={childrenStringTags:t.childrenStringTags};return a.childrenStringEmitClosingTag=``,void this.activeTagStack.push(a)}const n={};t?(n.language=t.language,n.direction=t.direction,n.baseIRI=t.baseIRI,n.childrenTripleTerms=t.childrenTripleTerms,n.rdfVersion=t.rdfVersion):n.baseIRI=this.baseIRI,this.activeTagStack.push(n),r===l.RESOURCE?this.onTagResource(e,n,t,!t):this.onTagProperty(e,n,t);for(const t in e.attributes){const r=e.attributes[t];"xmlns"===r.prefix&&(n.namespaces||(n.namespaces=[]),n.namespaces.push({key:`${r.prefix}:${r.local}`,value:r.value}))}t&&t.namespaces&&(n.namespaces=[...n.namespaces||[],...t.namespaces])}onTagResource(e,t,r,i){t.childrenParseType=l.PROPERTY;let a=!0;if(e.uri===u.RDF){if(!i&&u.FORBIDDEN_NODE_ELEMENTS.indexOf(e.local)>=0)throw this.newParseError(`Illegal node element name: ${e.local}`);switch(e.local){case"RDF":t.childrenParseType=l.RESOURCE;case"Description":a=!1}}const o=[],s=[];let c=null,d=!1,p=!1,h=null;for(const i in e.attributes){const a=e.attributes[i];if(a.uri!==u.RDF||"version"!==a.local){if(r&&a.uri===u.RDF)switch(a.local){case"about":if(c)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${a.value} and ${c} where found.`);c=a.value;continue;case"ID":if(c)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${a.value} and ${c} where found.`);this.validateNcname(a.value),c="#"+a.value,d=!0;continue;case"nodeID":if(c)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${a.value} and ${c} where found.`);this.validateNcname(a.value),c=a.value,p=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":h=a.value;continue;case"aboutEach":throw this.newParseError("rdf:aboutEach is not supported.");case"aboutEachPrefix":throw this.newParseError("rdf:aboutEachPrefix is not supported.");case"li":throw this.newParseError("rdf:li on node elements are not supported.")}else if(a.uri===u.XML){if("lang"===a.local){t.language=""===a.value?null:a.value.toLowerCase();continue}if("base"===a.local){t.baseIRI=(0,n.resolve)(a.value,t.baseIRI);continue}}else if(a.uri===u.ITS&&"dir"===a.local){this.setDirection(t,a.value);continue}"xml"===a.prefix||"xmlns"===a.prefix||""===a.prefix&&"xmlns"===a.local||!a.uri||(o.push(this.uriToNamedNode(a.uri+a.local)),s.push(a.value))}else this.setVersion(t,a.value)}if(null!==c&&(t.subject=p?this.dataFactory.blankNode(c):this.valueToUri(c,t),d&&this.claimNodeId(t.subject)),t.subject||(t.subject=this.dataFactory.blankNode()),a){const n=this.uriToNamedNode(e.uri+e.local);this.emitTriple(t.subject,this.dataFactory.namedNode(u.RDF+"type"),n,r?r.reifiedStatementId:null,t.childrenTripleTerms,t.reifier)}if(r){if(r.predicate)if(r.childrenCollectionSubject){const e=this.dataFactory.blankNode(),n=this.dataFactory.namedNode(u.RDF+"rest"),i=r.childrenCollectionPredicate.equals(n);this.emitTriple(r.childrenCollectionSubject,r.childrenCollectionPredicate,e,i?null:r.reifiedStatementId,r.childrenTripleTerms,i?null:r.reifier),this.emitTriple(e,this.dataFactory.namedNode(u.RDF+"first"),t.subject,null,t.childrenTripleTerms),r.childrenCollectionSubject=e,r.childrenCollectionPredicate=n}else{r.childrenTagsToTripleTerms||(this.emitTriple(r.subject,r.predicate,t.subject,r.reifiedStatementId,r.childrenTripleTerms,r.reifier),r.predicateEmitted=!0);for(let e=0;e=0)throw this.newParseError(`Illegal property element name: ${e.local}`);t.predicateSubPredicates=[],t.predicateSubObjects=[];let n=!1,i=!1,a=null,o=!0;const s=[],c=[];for(const r in e.attributes){const d=e.attributes[r];if(d.uri!==u.RDF||"version"!==d.local){if(d.uri===u.RDF)switch(d.local){case"resource":if(a)throw this.newParseError(`Found both rdf:resource (${d.value}) and rdf:nodeID (${a}).`);if(n)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${d.value})`);t.hadChildren=!0,a=d.value,o=!1;continue;case"datatype":if(i)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${d.value}).`);if(n)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${d.value})`);t.datatype=this.valueToUri(d.value,t);continue;case"nodeID":if(i)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${d.value}).`);if(t.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${d.value}).`);if(n)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${d.value})`);this.validateNcname(d.value),t.hadChildren=!0,a=d.value,o=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(i)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(t.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${t.datatype.value})`);if(a)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${a})`);if("Resource"===d.value){n=!0,t.childrenParseType=l.PROPERTY;const e=this.dataFactory.blankNode();this.emitTriple(t.subject,t.predicate,e,t.reifiedStatementId,t.childrenTripleTerms,t.reifier),t.subject=e,t.predicate=null}else"Collection"===d.value?(n=!0,t.hadChildren=!0,t.childrenCollectionSubject=t.subject,t.childrenCollectionPredicate=t.predicate,o=!1):"Literal"===d.value?(n=!0,t.childrenTagsToString=!0,t.childrenStringTags=[]):"Triple"===d.value&&(n=!0,t.childrenTagsToTripleTerms=!0,t.childrenTripleTerms=[]);continue;case"ID":this.validateNcname(d.value),t.reifiedStatementId=this.valueToUri("#"+d.value,t),this.claimNodeId(t.reifiedStatementId);continue;case"annotation":t.reifier=this.dataFactory.namedNode(d.value);continue;case"annotationNodeID":t.reifier=this.dataFactory.blankNode(d.value);continue}else{if(d.uri===u.XML&&"lang"===d.local){t.language=""===d.value?null:d.value.toLowerCase();continue}if(d.uri===u.ITS&&"dir"===d.local){this.setDirection(t,d.value);continue}if(d.uri===u.ITS&&"version"===d.local)continue}if("xml"!==d.prefix&&"xmlns"!==d.prefix&&(""!==d.prefix||"xmlns"!==d.local)&&d.uri){if(n||t.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${d.value}`);t.hadChildren=!0,i=!0,s.push(this.uriToNamedNode(d.uri+d.local)),c.push(this.createLiteral(d.value,t))}}else this.setVersion(t,d.value)}if(null!==a){const e=t.subject;t.subject=o?this.dataFactory.blankNode(a):this.valueToUri(a,t),this.emitTriple(e,t.predicate,t.subject,t.reifiedStatementId,t.childrenTripleTerms,t.reifier);for(let e=0;e/g,((e,t,r)=>(this.saxParser.ENTITIES[t]=r,"")))}setDirection(e,t){if(t){if("ltr"!==t&&"rtl"!==t)throw this.newParseError(`Base directions must either be 'ltr' or 'rtl', while '${t}' was found.`);e.direction=t}else delete e.direction}setVersion(e,t){if(e.rdfVersion=t,this.emit("version",t),!this.isValidVersion(t))throw this.newParseError(`Detected unsupported version: ${t}`)}}var l;t.RdfXmlParser=u,u.MIME_TYPE="application/rdf+xml",u.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",u.XML="http://www.w3.org/XML/1998/namespace",u.ITS="http://www.w3.org/2005/11/its",u.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],u.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],u.NCNAME_MATCHER=/^([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_])([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_\-.0-9#xB7\u{0300}-\u{036F}\u{203F}-\u{2040}])*$/u,u.SUPPORTED_VERSIONS=["1.2","1.2-basic","1.1"],function(e){e[e.RESOURCE=0]="RESOURCE",e[e.PROPERTY=1]="PROPERTY"}(l||(t.ParseType=l={}))},84077:e=>{e.exports=function(t){if(!e.exports.WEBSTREAM_SUPPORT)throw new Error("No web ReadableStream support");var r=!1,n={};return new ReadableStream({start:function(e){for(var i in n.data=a,n.end=a,n.end=o,n.close=o,n.error=o,n)t.on(i,n[i]);function a(n){r||(e.enqueue(n),t.pause())}function o(i){if(!r){for(var a in r=!0,n)t.removeListener(a,n[a]);i?e.error(i):e.close()}}t.pause()},pull:function(){r||t.resume()},cancel:function(){for(var e in r=!0,n)t.removeListener(e,n[e]);t.push(null),t.pause(),t.destroy?t.destroy():t.close&&t.close()}})},e.exports.WEBSTREAM_SUPPORT="undefined"!=typeof ReadableStream},21434:(e,t,r)=>{"use strict";const{SymbolDispose:n}=r(51473),{AbortError:i,codes:a}=r(52590),{isNodeStream:o,isWebStream:s,kControllerErrorFunction:c}=r(92520),u=r(94869),{ERR_INVALID_ARG_TYPE:l}=a;let d;e.exports.addAbortSignal=function(t,r){if(((e,t)=>{if("object"!=typeof e||!("aborted"in e))throw new l("signal","AbortSignal",e)})(t),!o(r)&&!s(r))throw new l("stream",["ReadableStream","WritableStream","Stream"],r);return e.exports.addAbortSignalNoValidate(t,r)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;const a=o(t)?()=>{t.destroy(new i(void 0,{cause:e.reason}))}:()=>{t[c](new i(void 0,{cause:e.reason}))};if(e.aborted)a();else{d=d||r(46609).addAbortListener;const i=d(e,a);u(t,i[n])}return t}},82:(e,t,r)=>{"use strict";const{StringPrototypeSlice:n,SymbolIterator:i,TypedArrayPrototypeSet:a,Uint8Array:o}=r(51473),{Buffer:s}=r(1048),{inspect:c}=r(46609);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,r=""+t.data;for(;null!==(t=t.next);)r+=e+t.data;return r}concat(e){if(0===this.length)return s.alloc(0);const t=s.allocUnsafe(e>>>0);let r=this.head,n=0;for(;r;)a(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(ea.length)){e===a.length?(t+=a,++i,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(a,0,e),this.head=r,r.data=n(a,e));break}t+=a,e-=a.length,++i}while(null!==(r=r.next));return this.length-=i,t}_getBuffer(e){const t=s.allocUnsafe(e),r=e;let n=this.head,i=0;do{const s=n.data;if(!(e>s.length)){e===s.length?(a(t,s,r-e),++i,n.next?this.head=n.next:this.head=this.tail=null):(a(t,new o(s.buffer,s.byteOffset,e),r-e),this.head=n,n.data=s.slice(e));break}a(t,s,r-e),e-=s.length,++i}while(null!==(n=n.next));return this.length-=i,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return c(this,{...t,depth:0,customInspect:!1})}}},67369:(e,t,r)=>{"use strict";const{pipeline:n}=r(16815),i=r(86279),{destroyer:a}=r(16527),{isNodeStream:o,isReadable:s,isWritable:c,isWebStream:u,isTransformStream:l,isWritableStream:d,isReadableStream:p}=r(92520),{AbortError:h,codes:{ERR_INVALID_ARG_VALUE:f,ERR_MISSING_ARGS:y}}=r(52590),m=r(94869);e.exports=function(...e){if(0===e.length)throw new y("streams");if(1===e.length)return i.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=i.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=i.from(e[t])}for(let r=0;r0&&!(c(e[r])||d(e[r])||l(e[r])))throw new f(`streams[${r}]`,t[r],"must be writable")}let r,g,b,v,_;const T=e[0],O=n(e,(function(e){const t=v;v=null,t?t(e):e?_.destroy(e):S||w||_.destroy()})),w=!!(c(T)||d(T)||l(T)),S=!!(s(O)||p(O)||l(O));if(_=new i({writableObjectMode:!(null==T||!T.writableObjectMode),readableObjectMode:!(null==O||!O.readableObjectMode),writable:w,readable:S}),w){if(o(T))_._write=function(e,t,n){T.write(e,t)?n():r=n},_._final=function(e){T.end(),g=e},T.on("drain",(function(){if(r){const e=r;r=null,e()}}));else if(u(T)){const e=(l(T)?T.writable:T).getWriter();_._write=async function(t,r,n){try{await e.ready,e.write(t).catch((()=>{})),n()}catch(e){n(e)}},_._final=async function(t){try{await e.ready,e.close().catch((()=>{})),g=t}catch(e){t(e)}}}const e=l(O)?O.readable:O;m(e,(()=>{if(g){const e=g;g=null,e()}}))}if(S)if(o(O))O.on("readable",(function(){if(b){const e=b;b=null,e()}})),O.on("end",(function(){_.push(null)})),_._read=function(){for(;;){const e=O.read();if(null===e)return void(b=_._read);if(!_.push(e))return}};else if(u(O)){const e=(l(O)?O.readable:O).getReader();_._read=async function(){for(;;)try{const{value:t,done:r}=await e.read();if(!_.push(t))return;if(r)return void _.push(null)}catch{return}}}return _._destroy=function(e,t){e||null===v||(e=new h),b=null,r=null,g=null,null===v?t(e):(v=t,o(O)&&a(O,e))},_}},16527:(e,t,r)=>{"use strict";const n=r(39907),{aggregateTwoErrors:i,codes:{ERR_MULTIPLE_CALLBACK:a},AbortError:o}=r(52590),{Symbol:s}=r(51473),{kIsDestroyed:c,isDestroyed:u,isFinished:l,isServerRequest:d}=r(92520),p=s("kDestroy"),h=s("kConstruct");function f(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function y(e,t,r){let i=!1;function a(t){if(i)return;i=!0;const a=e._readableState,o=e._writableState;f(t,o,a),o&&(o.closed=!0),a&&(a.closed=!0),"function"==typeof r&&r(t),t?n.nextTick(m,e,t):n.nextTick(g,e)}try{e._destroy(t||null,a)}catch(t){a(t)}}function m(e,t){b(e,t),g(e)}function g(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=r&&r.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function b(e,t){const r=e._readableState,n=e._writableState;null!=n&&n.errorEmitted||null!=r&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function v(e,t,r){const i=e._readableState,a=e._writableState;if(null!=a&&a.destroyed||null!=i&&i.destroyed)return this;null!=i&&i.autoDestroy||null!=a&&a.autoDestroy?e.destroy(t):t&&(t.stack,a&&!a.errored&&(a.errored=t),i&&!i.errored&&(i.errored=t),r?n.nextTick(b,e,t):b(e,t))}function _(e){let t=!1;function r(r){if(t)return void v(e,null!=r?r:new a);t=!0;const i=e._readableState,o=e._writableState,s=o||i;i&&(i.constructed=!0),o&&(o.constructed=!0),s.destroyed?e.emit(p,r):r?v(e,r,!0):n.nextTick(T,e)}try{e._construct((e=>{n.nextTick(r,e)}))}catch(e){n.nextTick(r,e)}}function T(e){e.emit(h)}function O(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function w(e){e.emit("close")}function S(e,t){e.emit("error",t),n.nextTick(w,e)}e.exports={construct:function(e,t){if("function"!=typeof e._construct)return;const r=e._readableState,i=e._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),e.once(h,t),e.listenerCount(h)>1||n.nextTick(_,e)},destroyer:function(e,t){e&&!u(e)&&(t||l(e)||(t=new o),d(e)?(e.socket=null,e.destroy(t)):O(e)?e.abort():O(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?n.nextTick(S,e,t):n.nextTick(w,e),e.destroyed||(e[c]=!0))},destroy:function(e,t){const r=this._readableState,n=this._writableState,a=n||r;return null!=n&&n.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(f(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),a.constructed?y(this,e,t):this.once(p,(function(r){y(this,i(r,e),t)})),this)},undestroy:function(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:v}},86279:(e,t,r)=>{"use strict";const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:i,ObjectKeys:a,ObjectSetPrototypeOf:o}=r(51473);e.exports=u;const s=r(11509),c=r(65605);o(u.prototype,s.prototype),o(u,s);{const e=a(c.prototype);for(let t=0;t{const n=r(39907),i=r(1048),{isReadable:a,isWritable:o,isIterable:s,isNodeStream:c,isReadableNodeStream:u,isWritableNodeStream:l,isDuplexNodeStream:d,isReadableStream:p,isWritableStream:h}=r(92520),f=r(94869),{AbortError:y,codes:{ERR_INVALID_ARG_TYPE:m,ERR_INVALID_RETURN_VALUE:g}}=r(52590),{destroyer:b}=r(16527),v=r(86279),_=r(11509),T=r(65605),{createDeferredPromise:O}=r(46609),w=r(81613),S=globalThis.Blob||i.Blob,E=void 0!==S?function(e){return e instanceof S}:function(e){return!1},A=globalThis.AbortController||r(67083).AbortController,{FunctionPrototypeCall:x}=r(51473);class I extends v{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function P(e){const t=e.readable&&"function"!=typeof e.readable.read?_.wrap(e.readable):e.readable,r=e.writable;let n,i,s,c,u,l=!!a(t),d=!!o(r);function p(e){const t=c;c=null,t?t(e):e&&u.destroy(e)}return u=new I({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==r||!r.writableObjectMode),readable:l,writable:d}),d&&(f(r,(e=>{d=!1,e&&b(t,e),p(e)})),u._write=function(e,t,i){r.write(e,t)?i():n=i},u._final=function(e){r.end(),i=e},r.on("drain",(function(){if(n){const e=n;n=null,e()}})),r.on("finish",(function(){if(i){const e=i;i=null,e()}}))),l&&(f(t,(e=>{l=!1,e&&b(t,e),p(e)})),t.on("readable",(function(){if(s){const e=s;s=null,e()}})),t.on("end",(function(){u.push(null)})),u._read=function(){for(;;){const e=t.read();if(null===e)return void(s=u._read);if(!u.push(e))return}}),u._destroy=function(e,a){e||null===c||(e=new y),s=null,n=null,i=null,null===c?a(e):(c=a,b(r,e),b(t,e))},u}e.exports=function e(t,r){if(d(t))return t;if(u(t))return P({readable:t});if(l(t))return P({writable:t});if(c(t))return P({writable:!1,readable:!1});if(p(t))return P({readable:_.fromWeb(t)});if(h(t))return P({writable:T.fromWeb(t)});if("function"==typeof t){const{value:e,write:i,final:a,destroy:o}=function(e){let{promise:t,resolve:r}=O();const i=new A,a=i.signal;return{value:e(async function*(){for(;;){const e=t;t=null;const{chunk:i,done:o,cb:s}=await e;if(n.nextTick(s),o)return;if(a.aborted)throw new y(void 0,{cause:a.reason});({promise:t,resolve:r}=O()),yield i}}(),{signal:a}),write(e,t,n){const i=r;r=null,i({chunk:e,done:!1,cb:n})},final(e){const t=r;r=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(s(e))return w(I,e,{objectMode:!0,write:i,final:a,destroy:o});const c=null==e?void 0:e.then;if("function"==typeof c){let t;const r=x(c,e,(e=>{if(null!=e)throw new g("nully","body",e)}),(e=>{b(t,e)}));return t=new I({objectMode:!0,readable:!1,write:i,final(e){a((async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}}))},destroy:o})}throw new g("Iterable, AsyncIterable or AsyncFunction",r,e)}if(E(t))return e(t.arrayBuffer());if(s(t))return w(I,t,{objectMode:!0,writable:!1});if(p(null==t?void 0:t.readable)&&h(null==t?void 0:t.writable))return I.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return P({readable:null!=t&&t.readable?u(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?l(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});const i=null==t?void 0:t.then;if("function"==typeof i){let e;return x(i,t,(t=>{null!=t&&e.push(t),e.push(null)}),(t=>{b(e,t)})),e=new I({objectMode:!0,writable:!1,read(){}})}throw new m(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},94869:(e,t,r)=>{"use strict";const n=r(39907),{AbortError:i,codes:a}=r(52590),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_PREMATURE_CLOSE:s}=a,{kEmptyObject:c,once:u}=r(46609),{validateAbortSignal:l,validateFunction:d,validateObject:p,validateBoolean:h}=r(77840),{Promise:f,PromisePrototypeThen:y,SymbolDispose:m}=r(51473),{isClosed:g,isReadable:b,isReadableNodeStream:v,isReadableStream:_,isReadableFinished:T,isReadableErrored:O,isWritable:w,isWritableNodeStream:S,isWritableStream:E,isWritableFinished:A,isWritableErrored:x,isNodeStream:I,willEmitClose:P,kIsClosedPromise:R}=r(92520);let N;const j=()=>{};function L(e,t,a){var h,f;if(2===arguments.length?(a=t,t=c):null==t?t=c:p(t,"options"),d(a,"callback"),l(t.signal,"options.signal"),a=u(a),_(e)||E(e))return function(e,t,a){let o=!1,s=j;if(t.signal)if(s=()=>{o=!0,a.call(e,new i(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(s);else{N=N||r(46609).addAbortListener;const n=N(t.signal,s),i=a;a=u(((...t)=>{n[m](),i.apply(e,t)}))}const c=(...t)=>{o||n.nextTick((()=>a.apply(e,t)))};return y(e[R].promise,c,c),j}(e,t,a);if(!I(e))throw new o("stream",["ReadableStream","WritableStream","Stream"],e);const L=null!==(h=t.readable)&&void 0!==h?h:v(e),D=null!==(f=t.writable)&&void 0!==f?f:S(e),F=e._writableState,M=e._readableState,C=()=>{e.writable||B()};let k=P(e)&&v(e)===L&&S(e)===D,U=A(e,!1);const B=()=>{U=!0,e.destroyed&&(k=!1),(!k||e.readable&&!L)&&(L&&!q||a.call(e))};let q=T(e,!1);const V=()=>{q=!0,e.destroyed&&(k=!1),(!k||e.writable&&!D)&&(D&&!U||a.call(e))},$=t=>{a.call(e,t)};let G=g(e);const Q=()=>{G=!0;const t=x(e)||O(e);return t&&"boolean"!=typeof t?a.call(e,t):L&&!q&&v(e,!0)&&!T(e,!1)?a.call(e,new s):!D||U||A(e,!1)?void a.call(e):a.call(e,new s)},H=()=>{G=!0;const t=x(e)||O(e);if(t&&"boolean"!=typeof t)return a.call(e,t);a.call(e)},z=()=>{e.req.on("finish",B)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?D&&!F&&(e.on("end",C),e.on("close",C)):(e.on("complete",B),k||e.on("abort",Q),e.req?z():e.on("request",z)),k||"boolean"!=typeof e.aborted||e.on("aborted",Q),e.on("end",V),e.on("finish",B),!1!==t.error&&e.on("error",$),e.on("close",Q),G?n.nextTick(Q):null!=F&&F.errorEmitted||null!=M&&M.errorEmitted?k||n.nextTick(H):(L||k&&!b(e)||!U&&!1!==w(e))&&(D||k&&!w(e)||!q&&!1!==b(e))?M&&e.req&&e.aborted&&n.nextTick(H):n.nextTick(H);const K=()=>{a=j,e.removeListener("aborted",Q),e.removeListener("complete",B),e.removeListener("abort",Q),e.removeListener("request",z),e.req&&e.req.removeListener("finish",B),e.removeListener("end",C),e.removeListener("close",C),e.removeListener("finish",B),e.removeListener("end",V),e.removeListener("error",$),e.removeListener("close",Q)};if(t.signal&&!G){const o=()=>{const r=a;K(),r.call(e,new i(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(o);else{N=N||r(46609).addAbortListener;const n=N(t.signal,o),i=a;a=u(((...t)=>{n[m](),i.apply(e,t)}))}}return K}e.exports=L,e.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=c),null!==(r=t)&&void 0!==r&&r.cleanup&&(h(t.cleanup,"cleanup"),n=t.cleanup),new f(((r,i)=>{const a=L(e,t,(e=>{n&&a(),e?i(e):r()}))}))}},81613:(e,t,r)=>{"use strict";const n=r(39907),{PromisePrototypeThen:i,SymbolAsyncIterator:a,SymbolIterator:o}=r(51473),{Buffer:s}=r(1048),{ERR_INVALID_ARG_TYPE:c,ERR_STREAM_NULL_VALUES:u}=r(52590).codes;e.exports=function(e,t,r){let l,d;if("string"==typeof t||t instanceof s)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});if(t&&t[a])d=!0,l=t[a]();else{if(!t||!t[o])throw new c("iterable",["Iterable"],t);d=!1,l=t[o]()}const p=new e({objectMode:!0,highWaterMark:1,...r});let h=!1;return p._read=function(){h||(h=!0,async function(){for(;;){try{const{value:e,done:t}=d?await l.next():l.next();if(t)p.push(null);else{const t=e&&"function"==typeof e.then?await e:e;if(null===t)throw h=!1,new u;if(p.push(t))continue;h=!1}}catch(e){p.destroy(e)}break}}())},p._destroy=function(e,t){i(async function(e){const t=null!=e,r="function"==typeof l.throw;if(t&&r){const{value:t,done:r}=await l.throw(e);if(await t,r)return}if("function"==typeof l.return){const{value:e}=await l.return();await e}}(e),(()=>n.nextTick(t,e)),(r=>n.nextTick(t,r||e)))},p}},23054:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ObjectSetPrototypeOf:i}=r(51473),{EventEmitter:a}=r(50046);function o(e){a.call(this,e)}function s(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}i(o.prototype,a.prototype),i(o,a),o.prototype.pipe=function(e,t){const r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",c),r.on("close",u));let o=!1;function c(){o||(o=!0,e.end())}function u(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){d(),0===a.listenerCount(this,"error")&&this.emit("error",e)}function d(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",c),r.removeListener("close",u),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",d),r.removeListener("close",d),e.removeListener("close",d)}return s(r,"error",l),s(e,"error",l),r.on("end",d),r.on("close",d),e.on("close",d),e.emit("pipe",r),e},e.exports={Stream:o,prependListener:s}},64708:(e,t,r)=>{"use strict";const n=globalThis.AbortController||r(67083).AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:a,ERR_MISSING_ARGS:o,ERR_OUT_OF_RANGE:s},AbortError:c}=r(52590),{validateAbortSignal:u,validateInteger:l,validateObject:d}=r(77840),p=r(51473).Symbol("kWeak"),h=r(51473).Symbol("kResistStopPropagation"),{finished:f}=r(94869),y=r(67369),{addAbortSignalNoValidate:m}=r(21434),{isWritable:g,isNodeStream:b}=r(92520),{deprecate:v}=r(46609),{ArrayPrototypePush:_,Boolean:T,MathFloor:O,Number:w,NumberIsNaN:S,Promise:E,PromiseReject:A,PromiseResolve:x,PromisePrototypeThen:I,Symbol:P}=r(51473),R=P("kEmpty"),N=P("kEof");function j(e,t){if("function"!=typeof e)throw new a("fn",["Function","AsyncFunction"],e);null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal");let n=1;null!=(null==t?void 0:t.concurrency)&&(n=O(t.concurrency));let i=n-1;return null!=(null==t?void 0:t.highWaterMark)&&(i=O(t.highWaterMark)),l(n,"options.concurrency",1),l(i,"options.highWaterMark",0),i+=n,async function*(){const a=r(46609).AbortSignalAny([null==t?void 0:t.signal].filter(T)),o=this,s=[],u={signal:a};let l,d,p=!1,h=0;function f(){p=!0,y()}function y(){h-=1,m()}function m(){d&&!p&&h=i||h>=n)&&await new E((e=>{d=e}))}s.push(N)}catch(e){const t=A(e);I(t,y,f),s.push(t)}finally{p=!0,l&&(l(),l=null)}}();try{for(;;){for(;s.length>0;){const e=await s[0];if(e===N)return;if(a.aborted)throw new c;e!==R&&(yield e),s.shift(),m()}await new E((e=>{l=e}))}}finally{p=!0,d&&(d(),d=null)}}.call(this)}async function L(e,t=void 0){for await(const r of D.call(this,e,t))return!0;return!1}function D(e,t){if("function"!=typeof e)throw new a("fn",["Function","AsyncFunction"],e);return j.call(this,(async function(t,r){return await e(t,r)?t:R}),t)}class F extends o{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function M(e){if(e=w(e),S(e))return 0;if(e<0)throw new s("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:v((function(e=void 0){return null!=e&&d(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal"),async function*(){let t=0;for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new c({cause:e.signal.reason});yield[t++,n]}}.call(this)}),"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t=void 0){return null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new c;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new c;e--<=0&&(yield r)}}.call(this)},filter:D,flatMap:function(e,t){const r=j.call(this,e,t);return async function*(){for await(const e of r)yield*e}.call(this)},map:j,take:function(e,t=void 0){return null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new c;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new c;if(e-- >0&&(yield r),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),b(e)&&!g(e))throw new i("stream",e,"must be writable");const r=y(this,e);return null!=t&&t.signal&&m(t.signal,r),r}},e.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new a("fn",["Function","AsyncFunction"],e);return!await L.call(this,(async(...t)=>!await e(...t)),t)},forEach:async function(e,t){if("function"!=typeof e)throw new a("fn",["Function","AsyncFunction"],e);for await(const r of j.call(this,(async function(t,r){return await e(t,r),R}),t));},reduce:async function(e,t,r){var i;if("function"!=typeof e)throw new a("reducer",["Function","AsyncFunction"],e);null!=r&&d(r,"options"),null!=(null==r?void 0:r.signal)&&u(r.signal,"options.signal");let o=arguments.length>1;if(null!=r&&null!==(i=r.signal)&&void 0!==i&&i.aborted){const e=new c(void 0,{cause:r.signal.reason});throw this.once("error",(()=>{})),await f(this.destroy(e)),e}const s=new n,l=s.signal;if(null!=r&&r.signal){const e={once:!0,[p]:this,[h]:!0};r.signal.addEventListener("abort",(()=>s.abort()),e)}let y=!1;try{for await(const n of this){var m;if(y=!0,null!=r&&null!==(m=r.signal)&&void 0!==m&&m.aborted)throw new c;o?t=await e(t,n,{signal:l}):(t=n,o=!0)}if(!y&&!o)throw new F}finally{s.abort()}return t},toArray:async function(e){null!=e&&d(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal");const t=[];for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new c(void 0,{cause:e.signal.reason});_(t,n)}return t},some:L,find:async function(e,t){for await(const r of D.call(this,e,t))return r}}},76587:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n}=r(51473);e.exports=a;const i=r(32073);function a(e){if(!(this instanceof a))return new a(e);i.call(this,e)}n(a.prototype,i.prototype),n(a,i),a.prototype._transform=function(e,t,r){r(null,e)}},16815:(e,t,r)=>{const n=r(39907),{ArrayIsArray:i,Promise:a,SymbolAsyncIterator:o,SymbolDispose:s}=r(51473),c=r(94869),{once:u}=r(46609),l=r(16527),d=r(86279),{aggregateTwoErrors:p,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:f,ERR_MISSING_ARGS:y,ERR_STREAM_DESTROYED:m,ERR_STREAM_PREMATURE_CLOSE:g},AbortError:b}=r(52590),{validateFunction:v,validateAbortSignal:_}=r(77840),{isIterable:T,isReadable:O,isReadableNodeStream:w,isNodeStream:S,isTransformStream:E,isWebStream:A,isReadableStream:x,isReadableFinished:I}=r(92520),P=globalThis.AbortController||r(67083).AbortController;let R,N,j;function L(e,t,r){let n=!1;return e.on("close",(()=>{n=!0})),{destroy:t=>{n||(n=!0,l.destroyer(e,t||new m("pipe")))},cleanup:c(e,{readable:t,writable:r},(e=>{n=!e}))}}function D(e){if(T(e))return e;if(w(e))return async function*(e){N||(N=r(11509)),yield*N.prototype[o].call(e)}(e);throw new h("val",["Readable","Iterable","AsyncIterable"],e)}async function F(e,t,r,{end:n}){let i,o=null;const s=e=>{if(e&&(i=e),o){const e=o;o=null,e()}},u=()=>new a(((e,t)=>{i?t(i):o=()=>{i?t(i):e()}}));t.on("drain",s);const l=c(t,{readable:!1},s);try{t.writableNeedDrain&&await u();for await(const r of e)t.write(r)||await u();n&&(t.end(),await u()),r()}catch(e){r(i!==e?p(i,e):e)}finally{l(),t.off("drain",s)}}async function M(e,t,r,{end:n}){E(t)&&(t=t.writable);const i=t.getWriter();try{for await(const t of e)await i.ready,i.write(t).catch((()=>{}));await i.ready,n&&await i.close(),r()}catch(e){try{await i.abort(e),r(e)}catch(e){r(e)}}}function C(e,t,a){if(1===e.length&&i(e[0])&&(e=e[0]),e.length<2)throw new y("streams");const o=new P,c=o.signal,u=null==a?void 0:a.signal,l=[];function p(){B(new b)}let m,g,v;_(u,"options.signal"),j=j||r(46609).addAbortListener,u&&(m=j(u,p));const I=[];let N,C=0;function U(e){B(e,0==--C)}function B(e,r){var i;if(!e||g&&"ERR_STREAM_PREMATURE_CLOSE"!==g.code||(g=e),g||r){for(;I.length;)I.shift()(g);null===(i=m)||void 0===i||i[s](),o.abort(),r&&(g||l.forEach((e=>e())),n.nextTick(t,g,v))}}for(let G=0;G0,K=H||!1!==(null==a?void 0:a.end),X=G===e.length-1;if(S(Q)){if(K){const{destroy:W,cleanup:J}=L(Q,H,z);I.push(W),O(Q)&&X&&l.push(J)}function q(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&U(e)}Q.on("error",q),O(Q)&&X&&l.push((()=>{Q.removeListener("error",q)}))}if(0===G)if("function"==typeof Q){if(N=Q({signal:c}),!T(N))throw new f("Iterable, AsyncIterable or Stream","source",N)}else N=T(Q)||w(Q)||E(Q)?Q:d.from(Q);else if("function"==typeof Q){var V;if(N=E(N)?D(null===(V=N)||void 0===V?void 0:V.readable):D(N),N=Q(N,{signal:c}),H){if(!T(N,!0))throw new f("AsyncIterable",`transform[${G-1}]`,N)}else{var $;R||(R=r(76587));const Y=new R({objectMode:!0}),Z=null===($=N)||void 0===$?void 0:$.then;if("function"==typeof Z)C++,Z.call(N,(e=>{v=e,null!=e&&Y.write(e),K&&Y.end(),n.nextTick(U)}),(e=>{Y.destroy(e),n.nextTick(U,e)}));else if(T(N,!0))C++,F(N,Y,U,{end:K});else{if(!x(N)&&!E(N))throw new f("AsyncIterable or Promise","destination",N);{const re=N.readable||N;C++,F(re,Y,U,{end:K})}}N=Y;const{destroy:ee,cleanup:te}=L(N,!1,!0);I.push(ee),X&&l.push(te)}}else if(S(Q)){if(w(N)){C+=2;const ne=k(N,Q,U,{end:K});O(Q)&&X&&l.push(ne)}else if(E(N)||x(N)){const ie=N.readable||N;C++,F(ie,Q,U,{end:K})}else{if(!T(N))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],N);C++,F(N,Q,U,{end:K})}N=Q}else if(A(Q)){if(w(N))C++,M(D(N),Q,U,{end:K});else if(x(N)||T(N))C++,M(N,Q,U,{end:K});else{if(!E(N))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],N);C++,M(N.readable,Q,U,{end:K})}N=Q}else N=d.from(Q)}return(null!=c&&c.aborted||null!=u&&u.aborted)&&n.nextTick(p),N}function k(e,t,r,{end:i}){let a=!1;if(t.on("close",(()=>{a||r(new g)})),e.pipe(t,{end:!1}),i){function o(){a=!0,t.end()}I(e)?n.nextTick(o):e.once("end",o)}else r();return c(e,{readable:!0,writable:!1},(t=>{const n=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once("end",r).once("error",r):r(t)})),c(t,{readable:!1,writable:!0},r)}e.exports={pipelineImpl:C,pipeline:function(...e){return C(e,u(function(e){return v(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},11509:(e,t,r)=>{"use strict";const n=r(39907),{ArrayPrototypeIndexOf:i,NumberIsInteger:a,NumberIsNaN:o,NumberParseInt:s,ObjectDefineProperties:c,ObjectKeys:u,ObjectSetPrototypeOf:l,Promise:d,SafeSet:p,SymbolAsyncDispose:h,SymbolAsyncIterator:f,Symbol:y}=r(51473);e.exports=X,X.ReadableState=K;const{EventEmitter:m}=r(50046),{Stream:g,prependListener:b}=r(23054),{Buffer:v}=r(1048),{addAbortSignal:_}=r(21434),T=r(94869);let O=r(46609).debuglog("stream",(e=>{O=e}));const w=r(82),S=r(16527),{getHighWaterMark:E,getDefaultHighWaterMark:A}=r(89952),{aggregateTwoErrors:x,codes:{ERR_INVALID_ARG_TYPE:I,ERR_METHOD_NOT_IMPLEMENTED:P,ERR_OUT_OF_RANGE:R,ERR_STREAM_PUSH_AFTER_EOF:N,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:j},AbortError:L}=r(52590),{validateObject:D}=r(77840),F=y("kPaused"),{StringDecoder:M}=r(18888),C=r(81613);l(X.prototype,g.prototype),l(X,g);const k=()=>{},{errorOrDestroy:U}=S,B=1,q=16,V=32,$=64,G=2048,Q=4096,H=65536;function z(e){return{enumerable:!1,get(){return!!(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function K(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(86279)),this.state=G|Q|q|V,e&&e.objectMode&&(this.state|=B),n&&e&&e.readableObjectMode&&(this.state|=B),this.highWaterMark=e?E(this,e,"readableHighWaterMark",n):A(!1),this.buffer=new w,this.length=0,this.pipes=[],this.flowing=null,this[F]=null,e&&!1===e.emitClose&&(this.state&=~G),e&&!1===e.autoDestroy&&(this.state&=~Q),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new M(e.encoding),this.encoding=e.encoding)}function X(e){if(!(this instanceof X))return new X(e);const t=this instanceof r(86279);this._readableState=new K(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&_(e.signal,this)),g.call(this,e),S.construct(this,(()=>{this._readableState.needReadable&&te(this,this._readableState)}))}function W(e,t,r,n){O("readableAddChunk",t);const i=e._readableState;let a;if(i.state&B||("string"==typeof t?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?t=v.from(t,r).toString(i.encoding):(t=v.from(t,r),r=""))):t instanceof v?r="":g._isUint8Array(t)?(t=g._uint8ArrayToBuffer(t),r=""):null!=t&&(a=new I("chunk",["string","Buffer","Uint8Array"],t))),a)U(e,a);else if(null===t)i.state&=-9,function(e,t){if(O("onEofChunk"),!t.ended){if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?Z(e):(t.needReadable=!1,t.emittedReadable=!0,ee(e))}}(e,i);else if(i.state&B||t&&t.length>0)if(n)if(4&i.state)U(e,new j);else{if(i.destroyed||i.errored)return!1;J(e,i,t,!0)}else if(i.ended)U(e,new N);else{if(i.destroyed||i.errored)return!1;i.state&=-9,i.decoder&&!r?(t=i.decoder.write(t),i.objectMode||0!==t.length?J(e,i,t,!1):te(e,i)):J(e,i,t,!1)}else n||(i.state&=-9,te(e,i));return!i.ended&&(i.length0?(t.state&H?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.state&$&&Z(e)),te(e,t)}function Y(e,t){return e<=0||0===t.length&&t.ended?0:t.state&B?1:o(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function Z(e){const t=e._readableState;O("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(O("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(ee,e))}function ee(e){const t=e._readableState;O("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||t.errored||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,oe(e)}function te(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(re,e,t))}function re(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!1===t[F]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function ie(e){O("readable nexttick read 0"),e.read(0)}function ae(e,t){O("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),oe(e),t.flowing&&!t.reading&&e.read(0)}function oe(e){const t=e._readableState;for(O("flow",t.flowing);t.flowing&&null!==e.read(););}function se(e,t){"function"!=typeof e.read&&(e=X.wrap(e,{objectMode:!0}));const r=async function*(e,t){let r,n=k;function i(t){this===e?(n(),n=k):n=t}e.on("readable",i);const a=T(e,{writable:!1},(e=>{r=e?x(r,e):null,n(),n=k}));try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(r)throw r;if(null===r)return;await new d(i)}}}catch(e){throw r=x(r,e),r}finally{!r&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==r&&!e._readableState.autoDestroy?(e.off("readable",i),a()):S.destroyer(e,null)}}(e,t);return r.stream=e,r}function ce(e,t){if(0===t.length)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function ue(e){const t=e._readableState;O("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(le,t,e))}function le(e,t){if(O("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)n.nextTick(de,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function de(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let pe;function he(){return void 0===pe&&(pe={}),pe}c(K.prototype,{objectMode:z(B),ended:z(2),endEmitted:z(4),reading:z(8),constructed:z(q),sync:z(V),needReadable:z($),emittedReadable:z(128),readableListening:z(256),resumeScheduled:z(512),errorEmitted:z(1024),emitClose:z(G),autoDestroy:z(Q),destroyed:z(8192),closed:z(16384),closeEmitted:z(32768),multiAwaitDrain:z(H),readingMore:z(1<<17),dataEmitted:z(1<<18)}),X.prototype.destroy=S.destroy,X.prototype._undestroy=S.undestroy,X.prototype._destroy=function(e,t){t(e)},X.prototype[m.captureRejectionSymbol]=function(e){this.destroy(e)},X.prototype[h]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new L,this.destroy(e)),new d(((t,r)=>T(this,(n=>n&&n!==e?r(n):t(null)))))},X.prototype.push=function(e,t){return W(this,e,t,!1)},X.prototype.unshift=function(e,t){return W(this,e,t,!0)},X.prototype.isPaused=function(){const e=this._readableState;return!0===e[F]||!1===e.flowing},X.prototype.setEncoding=function(e){const t=new M(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const r=this._readableState.buffer;let n="";for(const e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this},X.prototype.read=function(e){O("read",e),void 0===e?e=NaN:a(e)||(e=s(e,10));const t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new R("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.state&=-129),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return O("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ue(this):Z(this),null;if(0===(e=Y(e,t))&&t.ended)return 0===t.length&&ue(this),null;let n,i=!!(t.state&$);if(O("need readable",i),(0===t.length||t.length-e0?ce(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&ue(this)),null===n||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",n)),n},X.prototype._read=function(e){throw new P("_read()")},X.prototype.pipe=function(e,t){const r=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new p(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),O("pipe count=%d opts=%j",i.pipes.length,t);const a=t&&!1===t.end||e===n.stdout||e===n.stderr?y:o;function o(){O("onend"),e.end()}let s;i.endEmitted?n.nextTick(a):r.once("end",a),e.on("unpipe",(function t(n,a){O("onunpipe"),n===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,O("cleanup"),e.removeListener("close",h),e.removeListener("finish",f),s&&e.removeListener("drain",s),e.removeListener("error",d),e.removeListener("unpipe",t),r.removeListener("end",o),r.removeListener("end",y),r.removeListener("data",l),c=!0,s&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&s())}));let c=!1;function u(){c||(1===i.pipes.length&&i.pipes[0]===e?(O("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(O("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),r.pause()),s||(s=function(e,t){return function(){const r=e._readableState;r.awaitDrainWriters===t?(O("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(O("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),r.awaitDrainWriters&&0!==r.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(r,e),e.on("drain",s))}function l(t){O("ondata");const r=e.write(t);O("dest.write",r),!1===r&&u()}function d(t){if(O("onerror",t),y(),e.removeListener("error",d),0===e.listenerCount("error")){const r=e._writableState||e._readableState;r&&!r.errorEmitted?U(e,t):e.emit("error",t)}}function h(){e.removeListener("finish",f),y()}function f(){O("onfinish"),e.removeListener("close",h),y()}function y(){O("unpipe"),r.unpipe(e)}return r.on("data",l),b(e,"error",d),e.once("close",h),e.once("finish",f),e.emit("pipe",r),!0===e.writableNeedDrain?u():i.flowing||(O("pipe resume"),r.resume()),e},X.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,O("on readable",i.length,i.reading),i.length?Z(this):i.reading||n.nextTick(ie,this))),r},X.prototype.addListener=X.prototype.on,X.prototype.removeListener=function(e,t){const r=g.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(ne,this),r},X.prototype.off=X.prototype.removeListener,X.prototype.removeAllListeners=function(e){const t=g.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(ne,this),t},X.prototype.resume=function(){const e=this._readableState;return e.flowing||(O("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(ae,e,t))}(this,e)),e[F]=!1,this},X.prototype.pause=function(){return O("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(O("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[F]=!0,this},X.prototype.wrap=function(e){let t=!1;e.on("data",(r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())})),e.on("end",(()=>{this.push(null)})),e.on("error",(e=>{U(this,e)})),e.on("close",(()=>{this.destroy()})),e.on("destroy",(()=>{this.destroy()})),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};const r=u(e);for(let t=1;t{"use strict";const{MathFloor:n,NumberIsInteger:i}=r(51473),{validateInteger:a}=r(77840),{ERR_INVALID_ARG_VALUE:o}=r(52590).codes;let s=16384,c=16;function u(e){return e?c:s}e.exports={getHighWaterMark:function(e,t,r,a){const s=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,a,r);if(null!=s){if(!i(s)||s<0)throw new o(a?`options.${r}`:"options.highWaterMark",s);return n(s)}return u(e.objectMode)},getDefaultHighWaterMark:u,setDefaultHighWaterMark:function(e,t){a(t,"value",0),e?c=t:s=t}}},32073:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n,Symbol:i}=r(51473);e.exports=u;const{ERR_METHOD_NOT_IMPLEMENTED:a}=r(52590).codes,o=r(86279),{getHighWaterMark:s}=r(89952);n(u.prototype,o.prototype),n(u,o);const c=i("kCallback");function u(e){if(!(this instanceof u))return new u(e);const t=e?s(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),o.call(this,e),this._readableState.sync=!1,this[c]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function l(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush(((t,r)=>{t?e?e(t):this.destroy(t):(null!=r&&this.push(r),this.push(null),e&&e())}))}function d(){this._final!==l&&l.call(this)}u.prototype._final=l,u.prototype._transform=function(e,t,r){throw new a("_transform()")},u.prototype._write=function(e,t,r){const n=this._readableState,i=this._writableState,a=n.length;this._transform(e,t,((e,t)=>{e?r(e):(null!=t&&this.push(t),i.ended||a===n.length||n.length{"use strict";const{SymbolAsyncIterator:n,SymbolIterator:i,SymbolFor:a}=r(51473),o=a("nodejs.stream.destroyed"),s=a("nodejs.stream.errored"),c=a("nodejs.stream.readable"),u=a("nodejs.stream.writable"),l=a("nodejs.stream.disturbed"),d=a("nodejs.webstream.isClosedPromise"),p=a("nodejs.webstream.controllerErrorFunction");function h(e,t=!1){var r;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(r=e._readableState)||void 0===r?void 0:r.readable)||e._writableState&&!e._readableState)}function f(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function y(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function m(e){return!(!e||y(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function g(e){return!(!e||y(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function b(e){return!(!e||y(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function v(e){if(!y(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[o]||null!=n&&n.destroyed)}function _(e){if(!f(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function T(e,t){if(!h(e))return null;const r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.endEmitted)?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function O(e){return e&&null!=e[c]?e[c]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!v(e)&&h(e)&&e.readable&&!T(e)}function w(e){return e&&null!=e[u]?e[u]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!v(e)&&f(e)&&e.writable&&!_(e)}function S(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function E(e){return"boolean"==typeof e._sent100&&S(e)}e.exports={isDestroyed:v,kIsDestroyed:o,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[l])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:l,isErrored:function(e){var t,r,n,i,a,o,c,u,l,d;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(i=null!==(a=null!==(o=e[s])&&void 0!==o?o:e.readableErrored)&&void 0!==a?a:e.writableErrored)&&void 0!==i?i:null===(c=e._readableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==n?n:null===(u=e._writableState)||void 0===u?void 0:u.errorEmitted)&&void 0!==r?r:null===(l=e._readableState)||void 0===l?void 0:l.errored)&&void 0!==t?t:null===(d=e._writableState)||void 0===d?void 0:d.errored))},kIsErrored:s,isReadable:O,kIsReadable:c,kIsClosedPromise:d,kControllerErrorFunction:p,kIsWritable:u,isClosed:function(e){if(!y(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,r=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==r?void 0:r.closed)?(null==t?void 0:t.closed)||(null==r?void 0:r.closed):"boolean"==typeof e._closed&&S(e)?e._closed:null},isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return y(e)?!(!v(e)&&(!1!==(null==t?void 0:t.readable)&&O(e)||!1!==(null==t?void 0:t.writable)&&w(e))):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[n]:!1===t?"function"==typeof e[i]:"function"==typeof e[n]||"function"==typeof e[i])},isReadableNodeStream:h,isReadableStream:m,isReadableEnded:function(e){if(!h(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:T,isReadableErrored:function(e){var t,r;return y(e)?e.readableErrored?e.readableErrored:null!==(t=null===(r=e._readableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isNodeStream:y,isWebStream:function(e){return m(e)||g(e)||b(e)},isWritable:w,isWritableNodeStream:f,isWritableStream:g,isWritableEnded:_,isWritableFinished:function(e,t){if(!f(e))return null;if(!0===e.writableFinished)return!0;const r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.finished)?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return y(e)?e.writableErrored?e.writableErrored:null!==(t=null===(r=e._writableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:E,willEmitClose:function(e){if(!y(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!n&&E(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:b}},65605:(e,t,r)=>{"use strict";const n=r(39907),{ArrayPrototypeSlice:i,Error:a,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:s,ObjectDefineProperties:c,ObjectSetPrototypeOf:u,StringPrototypeToLowerCase:l,Symbol:d,SymbolHasInstance:p}=r(51473);e.exports=D,D.WritableState=j;const{EventEmitter:h}=r(50046),f=r(23054).Stream,{Buffer:y}=r(1048),m=r(16527),{addAbortSignal:g}=r(21434),{getHighWaterMark:b,getDefaultHighWaterMark:v}=r(89952),{ERR_INVALID_ARG_TYPE:_,ERR_METHOD_NOT_IMPLEMENTED:T,ERR_MULTIPLE_CALLBACK:O,ERR_STREAM_CANNOT_PIPE:w,ERR_STREAM_DESTROYED:S,ERR_STREAM_ALREADY_FINISHED:E,ERR_STREAM_NULL_VALUES:A,ERR_STREAM_WRITE_AFTER_END:x,ERR_UNKNOWN_ENCODING:I}=r(52590).codes,{errorOrDestroy:P}=m;function R(){}u(D.prototype,f.prototype),u(D,f);const N=d("kOnFinished");function j(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(86279)),this.objectMode=!(!e||!e.objectMode),n&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?b(this,e,"writableHighWaterMark",n):v(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const i=!(!e||!1!==e.decodeStrings);this.decodeStrings=!i,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=k.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,L(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[N]=[]}function L(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function D(e){const t=this instanceof r(86279);if(!t&&!o(D,this))return new D(e);this._writableState=new j(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&g(e.signal,this)),f.call(this,e),m.construct(this,(()=>{const e=this._writableState;e.writing||V(this,e),G(this,e)}))}function F(e,t,r,i){const a=e._writableState;if("function"==typeof r)i=r,r=a.defaultEncoding;else{if(r){if("buffer"!==r&&!y.isEncoding(r))throw new I(r)}else r=a.defaultEncoding;"function"!=typeof i&&(i=R)}if(null===t)throw new A;if(!a.objectMode)if("string"==typeof t)!1!==a.decodeStrings&&(t=y.from(t,r),r="buffer");else if(t instanceof y)r="buffer";else{if(!f._isUint8Array(t))throw new _("chunk",["string","Buffer","Uint8Array"],t);t=f._uint8ArrayToBuffer(t),r="buffer"}let o;return a.ending?o=new x:a.destroyed&&(o=new S("write")),o?(n.nextTick(i,o),P(e,o,!0),o):(a.pendingcb++,function(e,t,r,n,i){const a=t.objectMode?1:r.length;t.length+=a;const o=t.lengthr.bufferedIndex&&V(e,r),i?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===a?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:a,stream:e,state:r},n.nextTick(U,r.afterWriteTickInfo)):B(e,r,1,a))):P(e,new O)}function U({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,B(e,t,r,n)}function B(e,t,r,n){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&q(t),G(e,t)}function q(e){if(e.writing)return;for(let r=e.bufferedIndex;r1&&e._writev){t.pendingcb-=o-1;const n=t.allNoop?R:e=>{for(let t=s;t256?(r.splice(0,s),t.bufferedIndex=0):t.bufferedIndex=s}t.bufferProcessing=!1}function $(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function G(e,t,r){$(t)&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let r=!1;function i(i){if(r)P(e,null!=i?i:O());else if(r=!0,t.pendingcb--,i){const r=t[N].splice(0);for(let e=0;e{$(t)?Q(e,t):t.pendingcb--}),e,t)):$(t)&&(t.pendingcb++,Q(e,t))))}function Q(e,t){t.pendingcb--,t.finished=!0;const r=t[N].splice(0);for(let e=0;e{"use strict";const{ArrayIsArray:n,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:a,ArrayPrototypeMap:o,NumberIsInteger:s,NumberIsNaN:c,NumberMAX_SAFE_INTEGER:u,NumberMIN_SAFE_INTEGER:l,NumberParseInt:d,ObjectPrototypeHasOwnProperty:p,RegExpPrototypeExec:h,String:f,StringPrototypeToUpperCase:y,StringPrototypeTrim:m}=r(51473),{hideStackFrames:g,codes:{ERR_SOCKET_BAD_PORT:b,ERR_INVALID_ARG_TYPE:v,ERR_INVALID_ARG_VALUE:_,ERR_OUT_OF_RANGE:T,ERR_UNKNOWN_SIGNAL:O}}=r(52590),{normalizeEncoding:w}=r(46609),{isAsyncFunction:S,isArrayBufferView:E}=r(46609).types,A={},x=/^[0-7]+$/,I=g(((e,t,r=l,n=u)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!s(e))throw new T(t,"an integer",e);if(en)throw new T(t,`>= ${r} && <= ${n}`,e)})),P=g(((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!s(e))throw new T(t,"an integer",e);if(en)throw new T(t,`>= ${r} && <= ${n}`,e)})),R=g(((e,t,r=!1)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!s(e))throw new T(t,"an integer",e);const n=r?1:0,i=4294967295;if(ei)throw new T(t,`>= ${n} && <= ${i}`,e)}));function N(e,t){if("string"!=typeof e)throw new v(t,"string",e)}const j=g(((e,t,r)=>{if(!i(r,e)){const n=a(o(r,(e=>"string"==typeof e?`'${e}'`:f(e))),", ");throw new _(t,e,"must be one of: "+n)}}));function L(e,t){if("boolean"!=typeof e)throw new v(t,"boolean",e)}function D(e,t,r){return null!=e&&p(e,t)?e[t]:r}const F=g(((e,t,r=null)=>{const i=D(r,"allowArray",!1),a=D(r,"allowFunction",!1);if(!D(r,"nullable",!1)&&null===e||!i&&n(e)||"object"!=typeof e&&(!a||"function"!=typeof e))throw new v(t,"Object",e)})),M=g(((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new v(t,"a dictionary",e)})),C=g(((e,t,r=0)=>{if(!n(e))throw new v(t,"Array",e);if(e.length{if(!E(e))throw new v(t,["Buffer","TypedArray","DataView"],e)})),U=g(((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new v(t,"AbortSignal",e)})),B=g(((e,t)=>{if("function"!=typeof e)throw new v(t,"Function",e)})),q=g(((e,t)=>{if("function"!=typeof e||S(e))throw new v(t,"Function",e)})),V=g(((e,t)=>{if(void 0!==e)throw new v(t,"undefined",e)})),$=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function G(e,t){if(void 0===e||!h($,e))throw new _(t,e,'must be an array or string of format "; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(void 0===e&&(e=r),"string"==typeof e){if(null===h(x,e))throw new _(t,e,"must be a 32-bit unsigned integer or an octal string");e=d(e,8)}return R(e,t),e},validateArray:C,validateStringArray:function(e,t){C(e,t);for(let r=0;rn||(null!=r||null!=n)&&c(e))throw new T(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:F,validateOneOf:j,validatePlainFunction:q,validatePort:function(e,t="Port",r=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===m(e).length||+e!=+e>>>0||e>65535||0===e&&!r)throw new b(t,e,r);return 0|e},validateSignalName:function(e,t="signal"){if(N(e,t),void 0===A[e]){if(void 0!==A[y(e)])throw new O(e+" (signals must use all capital letters)");throw new O(e)}},validateString:N,validateUint32:R,validateUndefined:V,validateUnion:function(e,t,r){if(!i(r,e))throw new v(t,`('${a(r,"|")}')`,e)},validateAbortSignal:U,validateLinkHeaderValue:function(e){if("string"==typeof e)return G(e,"hints"),e;if(n(e)){const t=e.length;let r="";if(0===t)return r;for(let n=0;n; rel=preload; as=style"')}}},58521:(e,t,r)=>{"use strict";const n=r(50601),i=r(2010),a=n.Readable.destroy;e.exports=n.Readable,e.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,e.exports._isUint8Array=n._isUint8Array,e.exports.isDisturbed=n.isDisturbed,e.exports.isErrored=n.isErrored,e.exports.isReadable=n.isReadable,e.exports.Readable=n.Readable,e.exports.Writable=n.Writable,e.exports.Duplex=n.Duplex,e.exports.Transform=n.Transform,e.exports.PassThrough=n.PassThrough,e.exports.addAbortSignal=n.addAbortSignal,e.exports.finished=n.finished,e.exports.destroy=n.destroy,e.exports.destroy=a,e.exports.pipeline=n.pipeline,e.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get:()=>i}),e.exports.Stream=n.Stream,e.exports.default=e.exports},52590:(e,t,r)=>{"use strict";const{format:n,inspect:i}=r(8998),{AggregateError:a}=r(51473),o=globalThis.AggregateError||a,s=Symbol("kIsNodeError"),c=["string","function","number","object","Function","Object","boolean","bigint","symbol"],u=/^([A-Z][a-z0-9]*)+$/,l={};function d(e,t){if(!e)throw new l.ERR_INTERNAL_ASSERTION(t)}function p(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function h(e,t,r){r||(r=Error);class i extends r{constructor(...r){super(function(e,t,r){if("function"==typeof t)return d(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const i=(t.match(/%[dfijoOs]/g)||[]).length;return d(i===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),0===r.length?t:n(t,...r)}(e,t,r))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[s]=!0,l[e]=i}function f(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class y extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new l.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}h("ERR_ASSERTION","%s",Error),h("ERR_INVALID_ARG_TYPE",((e,t,r)=>{d("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";const a=[],o=[],s=[];for(const e of t)d("string"==typeof e,"All expected entries have to be of type string"),c.includes(e)?a.push(e.toLowerCase()):u.test(e)?o.push(e):(d("object"!==e,'The value "object" should be written as "Object"'),s.push(e));if(o.length>0){const e=a.indexOf("object");-1!==e&&(a.splice(a,e,1),o.push("Object"))}if(a.length>0){switch(a.length){case 1:n+=`of type ${a[0]}`;break;case 2:n+=`one of type ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();n+=`one of type ${a.join(", ")}, or ${e}`}}(o.length>0||s.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{const e=o.pop();n+=`an instance of ${o.join(", ")}, or ${e}`}}s.length>0&&(n+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(n+="an "),n+=`${s[0]}`;break;case 2:n+=`one of ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();n+=`one of ${s.join(", ")}, or ${e}`}}if(null==r)n+=`. Received ${r}`;else if("function"==typeof r&&r.name)n+=`. Received function ${r.name}`;else if("object"==typeof r){var l;null!==(l=r.constructor)&&void 0!==l&&l.name?n+=`. Received an instance of ${r.constructor.name}`:n+=`. Received ${i(r,{depth:-1})}`}else{let e=i(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),n+=`. Received type ${typeof r} (${e})`}return n}),TypeError),h("ERR_INVALID_ARG_VALUE",((e,t,r="is invalid")=>{let n=i(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`}),TypeError),h("ERR_INVALID_RETURN_VALUE",((e,t,r)=>{var n;return`Expected ${e} to be returned from the "${t}" function but got ${null!=r&&null!==(n=r.constructor)&&void 0!==n&&n.name?`instance of ${r.constructor.name}`:"type "+typeof r}.`}),TypeError),h("ERR_MISSING_ARGS",((...e)=>{let t;d(e.length>0,"At least one arg needs to be specified");const r=e.length;switch(e=(Array.isArray(e)?e:[e]).map((e=>`"${e}"`)).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`}),TypeError),h("ERR_OUT_OF_RANGE",((e,t,r)=>{let n;if(d(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32)n=p(String(r));else if("bigint"==typeof r){n=String(r);const e=BigInt(2)**BigInt(32);(r>e||r<-e)&&(n=p(n)),n+="n"}else n=i(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${n}`}),RangeError),h("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),h("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),h("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),h("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),h("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),h("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),h("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),h("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),h("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),h("ERR_STREAM_WRITE_AFTER_END","write after end",Error),h("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:y,aggregateTwoErrors:f((function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new o([t,e],t.message);return r.code=t.code,r}return e||t})),hideStackFrames:f,codes:l}},51473:e=>{"use strict";class t extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let r=0;rArray.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,r)=>e.slice(t,r),Error,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,r)=>Object.defineProperty(e,t,r),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,r)=>e.then(t,r),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Boolean,Uint8Array}},46609:(e,t,r)=>{"use strict";const n=r(1048),{format:i,inspect:a}=r(8998),{codes:{ERR_INVALID_ARG_TYPE:o}}=r(52590),{kResistStopPropagation:s,AggregateError:c,SymbolDispose:u}=r(51473),l=globalThis.AbortSignal||r(67083).AbortSignal,d=globalThis.AbortController||r(67083).AbortController,p=Object.getPrototypeOf((async function(){})).constructor,h=globalThis.Blob||n.Blob,f=void 0!==h?function(e){return e instanceof h}:function(e){return!1},y=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new o(t,"AbortSignal",e)};e.exports={AggregateError:c,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise(((r,n)=>{e=r,t=n})),resolve:e,reject:t}},promisify:e=>new Promise(((t,r)=>{e(((e,...n)=>e?r(e):t(...n)))})),debuglog:()=>function(){},format:i,inspect:a,types:{isAsyncFunction:e=>e instanceof p,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:f,deprecate:(e,t)=>e,addAbortListener:r(50046).addAbortListener||function(e,t){if(void 0===e)throw new o("signal","AbortSignal",e);let r;return y(e,"signal"),((e,t)=>{if("function"!=typeof e)throw new o("listener","Function",e)})(t),e.aborted?queueMicrotask((()=>t())):(e.addEventListener("abort",t,{__proto__:null,once:!0,[s]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[u](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:l.any||function(e){if(1===e.length)return e[0];const t=new d,r=()=>t.abort();return e.forEach((e=>{y(e,"signals"),e.addEventListener("abort",r,{once:!0})})),t.signal.addEventListener("abort",(()=>{e.forEach((e=>e.removeEventListener("abort",r)))}),{once:!0}),t.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},8998:e=>{"use strict";e.exports={format:(e,...t)=>e.replace(/%([sdifj])/g,(function(...[e,r]){const n=t.shift();return"f"===r?n.toFixed(6):"j"===r?JSON.stringify(n):"s"===r&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}},50601:(e,t,r)=>{"use strict";const{Buffer:n}=r(1048),{ObjectDefineProperty:i,ObjectKeys:a,ReflectApply:o}=r(51473),{promisify:{custom:s}}=r(46609),{streamReturningOperators:c,promiseReturningOperators:u}=r(64708),{codes:{ERR_ILLEGAL_CONSTRUCTOR:l}}=r(52590),d=r(67369),{setDefaultHighWaterMark:p,getDefaultHighWaterMark:h}=r(89952),{pipeline:f}=r(16815),{destroyer:y}=r(16527),m=r(94869),g=r(2010),b=r(92520),v=e.exports=r(23054).Stream;v.isDestroyed=b.isDestroyed,v.isDisturbed=b.isDisturbed,v.isErrored=b.isErrored,v.isReadable=b.isReadable,v.isWritable=b.isWritable,v.Readable=r(11509);for(const T of a(c)){const O=c[T];function w(...e){if(new.target)throw l();return v.Readable.from(o(O,this,e))}i(w,"name",{__proto__:null,value:O.name}),i(w,"length",{__proto__:null,value:O.length}),i(v.Readable.prototype,T,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}for(const S of a(u)){const E=u[S];function A(...e){if(new.target)throw l();return o(E,this,e)}i(A,"name",{__proto__:null,value:E.name}),i(A,"length",{__proto__:null,value:E.length}),i(v.Readable.prototype,S,{__proto__:null,value:A,enumerable:!1,configurable:!0,writable:!0})}v.Writable=r(65605),v.Duplex=r(86279),v.Transform=r(32073),v.PassThrough=r(76587),v.pipeline=f;const{addAbortSignal:_}=r(21434);v.addAbortSignal=_,v.finished=m,v.destroy=y,v.compose=d,v.setDefaultHighWaterMark=p,v.getDefaultHighWaterMark=h,i(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>g}),i(f,s,{__proto__:null,enumerable:!0,get:()=>g.pipeline}),i(m,s,{__proto__:null,enumerable:!0,get:()=>g.finished}),v.Stream=v,v._isUint8Array=function(e){return e instanceof Uint8Array},v._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}},2010:(e,t,r)=>{"use strict";const{ArrayPrototypePop:n,Promise:i}=r(51473),{isIterable:a,isNodeStream:o,isWebStream:s}=r(92520),{pipelineImpl:c}=r(16815),{finished:u}=r(94869);r(50601),e.exports={finished:u,pipeline:function(...e){return new i(((t,r)=>{let i,u;const l=e[e.length-1];if(l&&"object"==typeof l&&!o(l)&&!a(l)&&!s(l)){const t=n(e);i=t.signal,u=t.end}c(e,((e,n)=>{e?r(e):t(n)}),{signal:i,end:u})}))}}},9929:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(29365),t)},29365:(e,t)=>{"use strict";function r(e){const t=[];let r=0;for(;re.join(""))).join("/")}function n(e,t){let n=t+1;t>=0?"/"===e[t+1]&&"/"===e[t+2]&&(n=t+3):"/"===e[0]&&"/"===e[1]&&(n=2);const i=e.indexOf("/",n);return i<0?e:e.substr(0,i)+r(e.substr(i))}function i(e){return!e||"#"===e||"?"===e||"/"===e}Object.defineProperty(t,"__esModule",{value:!0}),t.removeDotSegmentsOfPath=t.removeDotSegments=t.resolve=void 0,t.resolve=function(e,t){const i=(t=t||"").indexOf("#");if(i>0&&(t=t.substr(0,i)),!e.length){if(t.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);return t}if(e.startsWith("?")){const r=t.indexOf("?");return r>0&&(t=t.substr(0,r)),t+e}if(e.startsWith("#"))return t+e;if(!t.length){const t=e.indexOf(":");if(t<0)throw new Error(`Found invalid relative IRI '${e}' for a missing baseIRI`);return n(e,t)}const a=e.indexOf(":");if(a>=0){const t=e.indexOf("/");if(t<0||ao+3?t+"/"+n(e,a):s+n(e,a)}else if(c=t.indexOf("/",o+1),c<0)return s+n(e,a);if(0===e.indexOf("/"))return t.substr(0,c)+r(e);let u=t.substr(c);const l=u.lastIndexOf("/");return l>=0&&l{var n=r(1048),i=n.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(a(n,t),t.Buffer=o),o.prototype=Object.create(i.prototype),a(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},23344:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=r(54957),o=r(37669),s=r(64817),c=r(98118),u=i(r(57756)),l=i(r(14791)),d=i(r(58007));function p(e){var t;return null===(t=/^[^]*[#/]/.exec(e))||void 0===t?void 0:t[0]}const h={"http://www.w3.org/1999/02/22-rdf-syntax-ns#":"rdf","http://www.w3.org/2000/01/rdf-schema#":"rdfs","http://www.w3.org/ns/shacl#":"sh","http://www.w3.org/2001/XMLSchema#":"xsd"},f={rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",sh:"http://www.w3.org/ns/shacl#",xsd:"http://www.w3.org/2001/XMLSchema#"};t.default=class{constructor(e,t,r={},n=void 0,i=!0,a=!1,o,s=!1,c=!0){this.store=e,this.base=n,this.errorOnExtraQuads=i,this.mintUnspecifiedPrefixes=a,this.fetch=o,this.extendedSyntax=s,this.requireBase=c,this.prefixes={},this.prefixRev={};for(const e of Object.keys(r)){const t=r[e],n="string"==typeof t?t:t.value;n in h||e in f||(this.prefixRev[n]=e,this.prefixes[e]=n)}this.writer=t,this.requireBase=c}write(){return n(this,void 0,void 0,(function*(){const e=this.store.getQuads(null,"http://www.w3.org/1999/02/22-rdf-syntax-ns#type","http://www.w3.org/2002/07/owl#Ontology",null);if(1===e.length&&"NamedNode"===e[0].subject.termType){const t=e[0].subject;this.store.removeQuads(e),t.equals(a.DataFactory.namedNode("urn:x-base:default"))||this.writer.add(`BASE ${(0,s.termToString)(t)}`),yield this.writeImports(t)}else if(this.requireBase)throw new Error("Base expected");if(this.mintUnspecifiedPrefixes){const e=new Set;for(const t of[...this.store.getSubjects(null,null,null),...this.store.getPredicates(null,null,null),...this.store.getObjects(null,null,null)])if("NamedNode"===t.termType){const r=p(t.value);!r||r in this.prefixRev||r in h||e.add(r)}const t=Object.assign(Object.assign({},this.prefixes),f);yield Promise.all([...e].map((e=>(0,o.uriToPrefix)(e,{fetch:this.fetch,mintOnUnknown:!0,existingPrefixes:t}).then((r=>{this.prefixes[r]=e,t[r]=e,this.prefixRev[e]=r})))))}const t=new Set([...this.store.getSubjects(null,null,null),...this.store.getPredicates(null,null,null),...this.store.getObjects(null,null,null)].filter((e=>"NamedNode"===e.termType)).map((e=>p(e.value))).filter((e=>"string"==typeof e)));for(const e in this.prefixRev)t.has(e)||(delete this.prefixes[this.prefixRev[e]],delete this.prefixRev[e]);if(yield this.writePrefixes(),this.prefixes=Object.assign(Object.assign({},this.prefixes),f),this.prefixRev=Object.assign(Object.assign({},this.prefixRev),h),this.writer.newLine(),yield this.writeShapes(),this.extendedSyntax){const e=this.store.getSubjects(null,null,null);e.length>0&&this.writer.newLine(1);for(const t of e)this.writer.add(yield this.termToString(t,!0,!0)),this.writer.add(" "),this.writer.indent(),yield this.writeTurtlePredicates(t),this.writer.deindent();e.length>0&&(this.writer.add(" ."),this.writer.newLine())}if(this.errorOnExtraQuads&&this.store.size>0)throw new Error(`Dataset contains quads that cannot be written in SHACLC [\n${new a.Writer({prefixes:this.prefixes}).quadsToString(this.store.getQuads(null,null,null,null))}]`);this.writer.end()}))}writeImports(e){return n(this,void 0,void 0,(function*(){const t=this.store.getObjectsOnce(e,a.DataFactory.namedNode("http://www.w3.org/2002/07/owl#imports"),null);if(t.length>0)for(const e of t)this.writer.add(`IMPORTS <${e.value}>`,!0)}))}writePrefixes(){return n(this,void 0,void 0,(function*(){const e=Object.keys(this.prefixes).filter((e=>!(e in l.default))).sort();if(e.length>0)for(const t of e)this.writer.add(`PREFIX ${t}: <${this.prefixes[t]}>`,!0)}))}termToString(e){return n(this,arguments,void 0,(function*(e,t=!1,r=!1){try{if(t)throw new Error("Shacl name disabled");return(0,c.getShaclName)(e)}catch(e){}if("NamedNode"===e.termType){const t=p(e.value);return t&&t in this.prefixRev&&t in this.prefixRev?`${this.prefixRev[t]}:${e.value.slice(t.length)}`:(0,s.termToString)(e)}if("Literal"===e.termType)return"http://www.w3.org/2001/XMLSchema#integer"===e.datatypeString||"http://www.w3.org/2001/XMLSchema#boolean"===e.datatypeString?e.value:(0,s.termToString)(e);throw"BlankNode"===e.termType&&r&&(0,s.termToString)(e),new Error(`Invalid term type for extra statement ${e.value} (${e.termType})`)}))}writeShapes(){return n(this,void 0,void 0,(function*(){for(const e of this.store.getSubjectsOnce(a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),a.DataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape"),null)){this.store.getQuadsOnce(e,a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),a.DataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#Class"),null).length>0?this.writer.add("shapeClass "):this.writer.add("shape "),this.writer.add(yield this.termToString(e)),this.writer.add(" ");const t=this.store.getObjectsOnce(e,a.DataFactory.namedNode("http://www.w3.org/ns/shacl#targetClass"),null);if(t.length>0){this.writer.add("-> ");for(const e of t)"NamedNode"===e.termType?this.writer.add(yield this.termToString(e)):(this.writer.add("!"),this.writer.add(yield this.termToString(this.singleObject(e,a.DataFactory.namedNode("http://www.w3.org/ns/shacl#not"),!0)))),this.writer.add(" ")}const r=this.store.getPredicates(e,null,null).filter((e=>[a.DataFactory.namedNode("http://www.w3.org/ns/shacl#targetClass"),a.DataFactory.namedNode("http://www.w3.org/ns/shacl#property"),a.DataFactory.namedNode("http://www.w3.org/ns/shacl#or"),...Object.keys(d.default).map((e=>a.DataFactory.namedNode("http://www.w3.org/ns/shacl#"+e)))].every((t=>!e.equals(t)))));r.length>0&&(this.writer.add(";"),this.writer.indent(),this.writer.newLine(1)),this.extendedSyntax&&(yield this.writeGivenTurtlePredicates(e,r)),r.length>0&&(this.writer.add(" "),this.writer.deindent()),yield this.writeShapeBody(e,!1)}}))}getSingleProperty(e,t){let r=[e];try{let n=(0,c.getShaclName)(e.predicate),i="pred";if("not"===n){const t=this.store.getQuadsOnce(e.object,null,null,null);if(r=r.concat(t),1!==t.length)throw new Error("Can only handle having one predicate of 'not'");[e]=t,n=(0,c.getShaclName)(e.predicate),i="not"}if(!(n in t))throw new Error(`${n} is not allowed`);return{name:n,type:i,object:e.object}}catch(e){this.store.addQuads(r)}}singleLayerPropertiesList(e,t){const r=[];for(const n of this.store.getQuadsOnce(e,null,null,null)){const e=this.getSingleProperty(n,t);e&&r.push(e)}return r}expectOneProperty(e,t){const r=this.store.getQuadsOnce(e,null,null,null);if(1===r.length){const e=this.getSingleProperty(r[0],t);if(e)return e}this.store.addQuads(r)}orProperties(e,t){const r=[];for(const n of this.store.getQuadsOnce(e,new a.NamedNode("http://www.w3.org/ns/shacl#or"),null,null)){const e=[];for(const r of this.getList(n.object)){const i=this.expectOneProperty(r,t);if(!i)throw this.store.addQuad(n),new Error("Each entry of the 'or' statement must declare exactly one property");e.push(i)}r.push(e)}return r}getList(e){let t=e;const r=[];for(;!t.equals(a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"));)r.push(this.singleObject(t,a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),!0)),t=this.singleObject(t,a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"),!0);return r}writeIriLiteralOrArray(e){return n(this,void 0,void 0,(function*(){if("BlankNode"===e.termType){this.writer.add("[");let t=!0;for(const r of this.getList(e))t?t=!1:this.writer.add(" "),this.writer.add(yield this.termToString(r));this.writer.add("]")}else this.writer.add(yield this.termToString(e))}))}singleObject(e,t,r){var n;return null===(n=this.singleQuad(e,t,r))||void 0===n?void 0:n.object}singleQuad(e,t,r=!1){const n=this.store.getQuadsOnce(e,t,null,null);if(r&&1!==n.length)throw this.store.addQuads(n),new Error(`The subject and predicate ${null==e?void 0:e.value} ${null==t?void 0:t.value} must have exactly one object. Instead has ${n.length}`);if(n.length>1)throw this.store.addQuads(n),new Error(`The subject and predicate ${null==e?void 0:e.value} ${null==t?void 0:t.value} can have at most one object. Instead has ${n.length}`);return 1===n.length?n[0]:void 0}writeAssigment(e){return n(this,arguments,void 0,(function*({name:e,type:t,object:r}){"not"===t&&this.writer.add("!"),this.writer.add(e),this.writer.add("="),yield this.writeIriLiteralOrArray(r)}))}writeAtom(e){return n(this,arguments,void 0,(function*({name:e,type:t,object:r}){switch("not"===t&&this.writer.add("!"),e){case"node":if("NamedNode"===r.termType)this.writer.add(`@${yield this.termToString(r)}`);else{if("BlankNode"!==r.termType)throw new Error("Invalid nested shape, must be blank node or IRI");yield this.writeShapeBody(r)}return;case"nodeKind":return void this.writer.add((0,c.getShaclName)(r));case"class":case"datatype":return void this.writer.add(yield this.termToString(r));default:this.writer.add(e),this.writer.add("="),yield this.writeIriLiteralOrArray(r)}}))}writeAssigments(e){return n(this,arguments,void 0,(function*(e,t=" ",r=!0,n){for(const i of e)r?r=!1:this.writer.add(t),n?yield this.writeAtom(i):yield this.writeAssigment(i)}))}writeParams(e){return n(this,arguments,void 0,(function*(e,t=!0,r,n=!1,i=!1){const a=this.orProperties(e,r),o=this.singleLayerPropertiesList(e,r);i&&(a.length>0||o.length>0)&&this.writer.newLine(1);for(const e of a)t?t=!1:this.writer.add(" "),yield this.writeAssigments(e,"|",!0,n);yield this.writeAssigments(o," ",t,n),i&&(a.length>0||o.length>0)&&this.writer.add(" .")}))}writeShapeBody(e){return n(this,arguments,void 0,(function*(e,t=!0){this.writer.add("{").indent();const r=this.store.getObjectsOnce(e,a.DataFactory.namedNode("http://www.w3.org/ns/shacl#property"),null);yield this.writeParams(e,!0,d.default,!1,!0);for(const e of r)this.writer.newLine(1),yield this.writeProperty(e);this.writer.deindent().newLine(1),t?this.writer.add("} ."):this.writer.add("}").newLine(1)}))}writeProperty(e){return n(this,void 0,void 0,(function*(){yield this.writePath(this.singleObject(e,a.DataFactory.namedNode("http://www.w3.org/ns/shacl#path"),!0));const t=this.singleObject(e,a.DataFactory.namedNode("http://www.w3.org/ns/shacl#minCount")),r=this.singleObject(e,a.DataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount")),n=this.singleObject(e,a.DataFactory.namedNode("http://www.w3.org/ns/shacl#nodeKind")),i=this.singleObject(e,a.DataFactory.namedNode("http://www.w3.org/ns/shacl#class")),o=this.singleObject(e,a.DataFactory.namedNode("http://www.w3.org/ns/shacl#datatype")),s=this.store.getObjectsOnce(e,a.DataFactory.namedNode("http://www.w3.org/ns/shacl#node"),null);if(n&&(this.writer.add(" "),this.writer.add((0,c.getShaclName)(n))),i&&(this.writer.add(" "),this.writer.add(yield this.termToString(i))),o&&(this.writer.add(" "),this.writer.add(yield this.termToString(o))),void 0!==t||void 0!==r){if(this.writer.add(" ["),t){if("Literal"!==t.termType||"http://www.w3.org/2001/XMLSchema#integer"!==t.datatypeString)throw new Error("Invalid min value, must me an integer literal");this.writer.add(t.value)}else this.writer.add("0");if(this.writer.add(".."),r){if("Literal"!==r.termType||"http://www.w3.org/2001/XMLSchema#integer"!==r.datatypeString)throw new Error("Invalid max value, must me an integer literal");this.store.removeMatches(e,a.DataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),void 0,void 0),this.writer.add(r.value)}else this.writer.add("*");this.writer.add("]")}yield this.writeParams(e,!1,u.default,!0);const l=[];for(const e of s)if("NamedNode"===e.termType)this.writer.add(" "),this.writer.add(`@${yield this.termToString(e)}`);else{if("BlankNode"!==e.termType)throw new Error("Invalid nested shape, must be blank node or IRI");l.push(e)}for(const e of l)this.writer.add(" "),yield this.writeShapeBody(e);this.extendedSyntax&&this.store.getQuads(e,null,null,null).length>0&&(this.writer.add(" %"),this.writer.indent(),this.writer.newLine(1),yield this.writeTurtlePredicates(e),this.writer.deindent(),this.writer.newLine(1),this.writer.add("%")),0===l.length&&this.writer.add(" .")}))}writeTurtlePredicates(e){return n(this,void 0,void 0,(function*(){return this.writeGivenTurtlePredicates(e,this.store.getPredicates(e,null,null))}))}writeGivenTurtlePredicates(e,t){return n(this,void 0,void 0,(function*(){let r=!1;if(t.some((e=>e.equals(a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))))){const t=this.store.getObjectsOnce(e,a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),null);t.length>0&&(r=!0,this.writer.add("a "),yield this.writeTurtleObjects(t))}for(const n of t)n.equals(a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))||(r?(this.writer.add(" ;"),this.writer.newLine(1)):r=!0,this.writer.add(yield this.termToString(n,!0)),this.writer.add(" "),yield this.writeTurtleObjects(this.store.getObjectsOnce(e,n,null)))}))}writeTurtleObjects(e){return n(this,void 0,void 0,(function*(){const t=[],r=[];for(const n of e)"BlankNode"===n.termType&&0===[...this.store.match(null,null,n),...this.store.match(null,n,null)].length?t.push(n):r.push(n);this.writer.add((yield Promise.all(r.map((e=>this.termToString(e,!0,!0))))).join(", "));let n=r.length>0;if(t.length>0)for(const e of t)n?this.writer.add(", "):n=!0,(yield this.writeList(e))||(this.writer.add("["),this.writer.indent(),this.writer.newLine(1),yield this.writeTurtlePredicates(e),this.writer.deindent(),this.writer.newLine(1),this.writer.add("]"))}))}writeList(e){return n(this,void 0,void 0,(function*(){let t=e;const r=[],n=[];for(;!t.equals(a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"));){const e=this.store.getQuadsOnce(t,a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),null,null),i=this.store.getQuadsOnce(t,a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"),null,null);if(n.push(...e,...i),1!==e.length||1!==i.length||0!==this.store.getQuads(t,null,null,null).length)return this.store.addQuads(n),!1;r.push(e[0].object),t=i[0].object}let i=!1;this.writer.add("(");for(const e of r)i?this.writer.add(" "):i=!0,yield this.writeTurtleObjects([e]);return this.writer.add(")"),!0}))}writePath(e){return n(this,arguments,void 0,(function*(e,t=!1){if("NamedNode"===e.termType)this.writer.add(yield this.termToString(e));else{if("BlankNode"!==e.termType)throw new Error("Path should be named node or blank node");{const r=this.store.getQuadsOnce(e,null,null,null);if(1===r.length){const{predicate:n,object:i}=r[0];switch(n.value){case"http://www.w3.org/ns/shacl#inversePath":return this.writer.add("^"),void(yield this.writePath(i,!0));case"http://www.w3.org/ns/shacl#alternativePath":{const e=this.getList(i);if(0===e.length)throw new Error("Invalid Alternative Path - no options");if(1===e.length)yield this.writePath(e[0]);else{t&&this.writer.add("(");let r=!0;for(const t of e)r?r=!1:this.writer.add("|"),yield this.writePath(t,!0);t&&this.writer.add(")")}return}case"http://www.w3.org/ns/shacl#zeroOrMorePath":return yield this.writePath(i,!0),void this.writer.add("*");case"http://www.w3.org/ns/shacl#oneOrMorePath":return yield this.writePath(i,!0),void this.writer.add("+");case"http://www.w3.org/ns/shacl#zeroOrOnePath":return yield this.writePath(i,!0),void this.writer.add("?");default:throw new Error(`Invalid path type ${e.value}`)}}else{this.store.addQuads(r);const n=this.getList(e);if(0===n.length)throw new Error("Invalid Path");{t&&this.writer.add("(");let e=!0;for(const t of n)e?e=!1:this.writer.add("/"),yield this.writePath(t,!0);t&&this.writer.add(")")}}}}}))}}},14791:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={owl:"http://www.w3.org/2002/07/owl#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",sh:"http://www.w3.org/ns/shacl#",xsd:"http://www.w3.org/2001/XMLSchema#"}},22939:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.write=function(e,t){return n(this,void 0,void 0,(function*(){return new Promise(((r,i)=>n(this,void 0,void 0,(function*(){try{let n="";const i=new c.default(e),u=i.getGraphs(null,null,null);if(u.length>1)throw new Error("More than one graph found - can serialize in the default graph");if(1===u.length&&!u[0].equals(a.DataFactory.defaultGraph()))throw new Error(`Expected all triples to be in the default graph, instead triples were in ${u[0].value}`);const l=new s.default({write:e=>{n+=e},end:()=>{let e=i.getQuads(null,null,null,null);0===e.length&&(e=void 0),r({text:n,extraQuads:e})}}),d=new o.default(i,l,null==t?void 0:t.prefixes,void 0,!1!==(null==t?void 0:t.errorOnUnused),null==t?void 0:t.mintPrefixes,null==t?void 0:t.fetch,null==t?void 0:t.extendedSyntax,!1!==(null==t?void 0:t.requireBase));yield d.write()}catch(e){i(e)}}))))}))};const a=r(54957),o=i(r(23344)),s=i(r(29908)),c=i(r(23187))},58007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={targetNode:!0,targetObjectsOf:!0,targetSubjectsOf:!0,deactivated:!0,severity:!0,message:!0,class:!0,datatype:!0,nodeKind:!0,minExclusive:!0,minInclusive:!0,maxExclusive:!0,maxInclusive:!0,minLength:!0,maxLength:!0,pattern:!0,flags:!0,languageIn:!0,equals:!0,disjoint:!0,closed:!0,ignoredProperties:!0,hasValue:!0,in:!0}},57756:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={deactivated:!0,severity:!0,message:!0,class:!0,datatype:!0,nodeKind:!0,minExclusive:!0,minInclusive:!0,maxExclusive:!0,maxInclusive:!0,minLength:!0,maxLength:!0,pattern:!0,flags:!0,languageIn:!0,uniqueLang:!0,equals:!0,disjoint:!0,lessThan:!0,lessThanOrEquals:!0,qualifiedValueShape:!0,qualifiedMinCount:!0,qualifiedMaxCount:!0,qualifiedValueShapesDisjoint:!0,closed:!0,ignoredProperties:!0,hasValue:!0,in:!0,node:!0}},98118:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getShaclName=function(e){if("NamedNode"!==e.termType||!e.value.startsWith("http://www.w3.org/ns/shacl#"))throw new Error(`Term ${e.value} is not part of the SHACL namespace`);return e.value.slice(27)}},23187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(54957);class i extends n.Store{getQuadsOnce(e,t,r,n){const i=this.getQuads(e,t,r,n);return this.removeQuads(i),i}getSubjectsOnce(e,t,r){return this.getQuadsOnce(null,e,t,r).map((e=>e.subject))}getObjectsOnce(e,t,r){return this.getQuadsOnce(e,t,null,r).map((e=>e.object))}}t.default=i},29908:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e){this.indents=0,this.write=e.write,this.end=e.end}indent(){return this.indents+=1,this}deindent(){if(this.indents<1)throw new Error(`Trying to deindent when indent is only ${this.indents}`);return this.indents-=1,this}add(e,t=!1){return this.write(t?`\n${"\t".repeat(this.indents)}${e}`:e,"utf-8"),this}newLine(e=2){return this.write("\n".repeat(e)+"\t".repeat(this.indents),"utf-8"),this}}},88110:e=>{e.exports=function(e){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function r(e,t){var r=e[0],n=e[1],i=e[2],a=e[3];n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&i|~n&a)+t[0]-680876936|0)<<7|r>>>25)+n|0)&n|~r&i)+t[1]-389564586|0)<<12|a>>>20)+r|0)&r|~a&n)+t[2]+606105819|0)<<17|i>>>15)+a|0)&a|~i&r)+t[3]-1044525330|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&i|~n&a)+t[4]-176418897|0)<<7|r>>>25)+n|0)&n|~r&i)+t[5]+1200080426|0)<<12|a>>>20)+r|0)&r|~a&n)+t[6]-1473231341|0)<<17|i>>>15)+a|0)&a|~i&r)+t[7]-45705983|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&i|~n&a)+t[8]+1770035416|0)<<7|r>>>25)+n|0)&n|~r&i)+t[9]-1958414417|0)<<12|a>>>20)+r|0)&r|~a&n)+t[10]-42063|0)<<17|i>>>15)+a|0)&a|~i&r)+t[11]-1990404162|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&i|~n&a)+t[12]+1804603682|0)<<7|r>>>25)+n|0)&n|~r&i)+t[13]-40341101|0)<<12|a>>>20)+r|0)&r|~a&n)+t[14]-1502002290|0)<<17|i>>>15)+a|0)&a|~i&r)+t[15]+1236535329|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&a|i&~a)+t[1]-165796510|0)<<5|r>>>27)+n|0)&i|n&~i)+t[6]-1069501632|0)<<9|a>>>23)+r|0)&n|r&~n)+t[11]+643717713|0)<<14|i>>>18)+a|0)&r|a&~r)+t[0]-373897302|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&a|i&~a)+t[5]-701558691|0)<<5|r>>>27)+n|0)&i|n&~i)+t[10]+38016083|0)<<9|a>>>23)+r|0)&n|r&~n)+t[15]-660478335|0)<<14|i>>>18)+a|0)&r|a&~r)+t[4]-405537848|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&a|i&~a)+t[9]+568446438|0)<<5|r>>>27)+n|0)&i|n&~i)+t[14]-1019803690|0)<<9|a>>>23)+r|0)&n|r&~n)+t[3]-187363961|0)<<14|i>>>18)+a|0)&r|a&~r)+t[8]+1163531501|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&a|i&~a)+t[13]-1444681467|0)<<5|r>>>27)+n|0)&i|n&~i)+t[2]-51403784|0)<<9|a>>>23)+r|0)&n|r&~n)+t[7]+1735328473|0)<<14|i>>>18)+a|0)&r|a&~r)+t[12]-1926607734|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n^i^a)+t[5]-378558|0)<<4|r>>>28)+n|0)^n^i)+t[8]-2022574463|0)<<11|a>>>21)+r|0)^r^n)+t[11]+1839030562|0)<<16|i>>>16)+a|0)^a^r)+t[14]-35309556|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n^i^a)+t[1]-1530992060|0)<<4|r>>>28)+n|0)^n^i)+t[4]+1272893353|0)<<11|a>>>21)+r|0)^r^n)+t[7]-155497632|0)<<16|i>>>16)+a|0)^a^r)+t[10]-1094730640|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n^i^a)+t[13]+681279174|0)<<4|r>>>28)+n|0)^n^i)+t[0]-358537222|0)<<11|a>>>21)+r|0)^r^n)+t[3]-722521979|0)<<16|i>>>16)+a|0)^a^r)+t[6]+76029189|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n^i^a)+t[9]-640364487|0)<<4|r>>>28)+n|0)^n^i)+t[12]-421815835|0)<<11|a>>>21)+r|0)^r^n)+t[15]+530742520|0)<<16|i>>>16)+a|0)^a^r)+t[2]-995338651|0)<<23|n>>>9)+i|0,n=((n+=((a=((a+=(n^((r=((r+=(i^(n|~a))+t[0]-198630844|0)<<6|r>>>26)+n|0)|~i))+t[7]+1126891415|0)<<10|a>>>22)+r|0)^((i=((i+=(r^(a|~n))+t[14]-1416354905|0)<<15|i>>>17)+a|0)|~r))+t[5]-57434055|0)<<21|n>>>11)+i|0,n=((n+=((a=((a+=(n^((r=((r+=(i^(n|~a))+t[12]+1700485571|0)<<6|r>>>26)+n|0)|~i))+t[3]-1894986606|0)<<10|a>>>22)+r|0)^((i=((i+=(r^(a|~n))+t[10]-1051523|0)<<15|i>>>17)+a|0)|~r))+t[1]-2054922799|0)<<21|n>>>11)+i|0,n=((n+=((a=((a+=(n^((r=((r+=(i^(n|~a))+t[8]+1873313359|0)<<6|r>>>26)+n|0)|~i))+t[15]-30611744|0)<<10|a>>>22)+r|0)^((i=((i+=(r^(a|~n))+t[6]-1560198380|0)<<15|i>>>17)+a|0)|~r))+t[13]+1309151649|0)<<21|n>>>11)+i|0,n=((n+=((a=((a+=(n^((r=((r+=(i^(n|~a))+t[4]-145523070|0)<<6|r>>>26)+n|0)|~i))+t[11]-1120210379|0)<<10|a>>>22)+r|0)^((i=((i+=(r^(a|~n))+t[2]+718787259|0)<<15|i>>>17)+a|0)|~r))+t[9]-343485551|0)<<21|n>>>11)+i|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=i+e[2]|0,e[3]=a+e[3]|0}function n(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function i(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return r}function a(e){var t,i,a,o,s,c,u=e.length,l=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=u;t+=64)r(l,n(e.substring(t-64,t)));for(i=(e=e.substring(t-64)).length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t>2]|=e.charCodeAt(t)<<(t%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55)for(r(l,a),t=0;t<16;t+=1)a[t]=0;return o=(o=8*u).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(o[2],16),c=parseInt(o[1],16)||0,a[14]=s,a[15]=c,r(l,a),l}function o(e){var r,n="";for(r=0;r<4;r+=1)n+=t[e>>8*r+4&15]+t[e>>8*r&15];return n}function s(e){var t;for(t=0;tu?new ArrayBuffer(0):(n=u-c,i=new ArrayBuffer(n),a=new Uint8Array(i),o=new Uint8Array(this,c,n),a.set(o),i)}}(),l.prototype.append=function(e){return this.appendBinary(c(e)),this},l.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,i=this._buff.length;for(t=64;t<=i;t+=64)r(this._hash,n(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},l.prototype.end=function(e){var t,r,n=this._buff,i=n.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t>2]|=n.charCodeAt(t)<<(t%4<<3);return this._finish(a,i),r=s(this._hash),e&&(r=u(r)),this.reset(),r},l.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},l.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},l.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},l.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},l.prototype._finish=function(e,t){var n,i,a,o=t;if(e[o>>2]|=128<<(o%4<<3),o>55)for(r(this._hash,e),o=0;o<16;o+=1)e[o]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(n[2],16),a=parseInt(n[1],16)||0,e[14]=i,e[15]=a,r(this._hash,e)},l.hash=function(e,t){return l.hashBinary(c(e),t)},l.hashBinary=function(e,t){var r=s(a(e));return t?u(r):r},l.ArrayBuffer=function(){this.reset()},l.ArrayBuffer.prototype.append=function(e){var t,n,a,o,s,c=(n=this._buff.buffer,a=e,o=!0,(s=new Uint8Array(n.byteLength+a.byteLength)).set(new Uint8Array(n)),s.set(new Uint8Array(a),n.byteLength),o?s:s.buffer),u=c.length;for(this._length+=e.byteLength,t=64;t<=u;t+=64)r(this._hash,i(c.subarray(t-64,t)));return this._buff=t-64>2]|=n[t]<<(t%4<<3);return this._finish(a,i),r=s(this._hash),e&&(r=u(r)),this.reset(),r},l.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},l.ArrayBuffer.prototype.getState=function(){var e,t=l.prototype.getState.call(this);return t.buff=(e=t.buff,String.fromCharCode.apply(null,new Uint8Array(e))),t},l.ArrayBuffer.prototype.setState=function(e){return e.buff=function(e,t){var r,n=e.length,i=new ArrayBuffer(n),a=new Uint8Array(i);for(r=0;r>2]|=e[t]<<(t%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55)for(r(l,a),t=0;t<16;t+=1)a[t]=0;return o=(o=8*u).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(o[2],16),c=parseInt(o[1],16)||0,a[14]=s,a[15]=c,r(l,a),l}(new Uint8Array(e)));return t?u(n):n},l}()},21451:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(71839),t)},71839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SparqlJsonParser=void 0;const n=r(18050),i=r(58521),a=r(36885);class o{constructor(e){var t;e=e||{},this.dataFactory=e.dataFactory||new n.DataFactory,this.prefixVariableQuestionMark=!!e.prefixVariableQuestionMark,this.suppressMissingStreamResultsError=null===(t=e.suppressMissingStreamResultsError)||void 0===t||t,this.parseUnsupportedVersions=!!e.parseUnsupportedVersions}isValidVersion(e){return this.parseUnsupportedVersions||o.SUPPORTED_VERSIONS.includes(e)}parseJsonResults(e,t){if(t&&!this.isValidVersion(t))throw new Error(`Detected unsupported version as media type parameter: ${t}`);return e.results.bindings.map((e=>this.parseJsonBindings(e)))}parseJsonResultsStream(e,t){const r=e=>c.emit("error",e);e.on("error",r);const n=new a;n.onError=r;let o=!1,s=!1;n.onValue=e=>{if("vars"===n.key&&2===n.stack.length&&"head"===n.stack[1].key)c.emit("variables",e.map((e=>this.dataFactory.variable(e)))),o=!0;else if("link"===n.key&&2===n.stack.length&&"head"===n.stack[1].key)c.emit("link",e);else if("version"===n.key&&2===n.stack.length&&"head"===n.stack[1].key)this.isValidVersion(e)||c.emit("error",new Error(`Detected unsupported version: ${e}`)),c.emit("version",e);else if("results"===n.key&&1===n.stack.length)s=!0;else if("number"==typeof n.key&&3===n.stack.length&&"results"===n.stack[1].key&&"bindings"===n.stack[2].key)try{c.push(this.parseJsonBindings(e))}catch(e){c.emit("error",e)}else"metadata"===n.key&&1===n.stack.length&&c.emit("metadata",e)};const c=e.on("end",(e=>{s||this.suppressMissingStreamResultsError?o||c.emit("variables",[]):c.emit("error",new Error("No valid SPARQL query results were found."))})).pipe(new i.Transform({objectMode:!0,transform(e,t,r){n.write(e),r()}}));return t&&!this.isValidVersion(t)&&c.destroy(new Error(`Detected unsupported version as media type parameter: ${t}`)),c}parseJsonBindings(e){const t={};for(const r in e){const n=e[r];t[this.prefixVariableQuestionMark?"?"+r:r]=this.parseJsonValue(n)}return t}parseJsonValue(e){let t;switch(e.type){case"bnode":t=this.dataFactory.blankNode(e.value);break;case"literal":if(e["xml:lang"]){const r=e["xml:lang"],n=e["its:dir"];t=this.dataFactory.literal(e.value,{language:r,direction:n})}else t=e.datatype?this.dataFactory.literal(e.value,this.dataFactory.namedNode(e.datatype)):this.dataFactory.literal(e.value);break;case"typed-literal":t=this.dataFactory.literal(e.value,this.dataFactory.namedNode(e.datatype));break;case"triple":const r=e.value;if(!(r&&r.subject&&r.predicate&&r.object))throw new Error("Invalid quoted triple: "+JSON.stringify(e));t=this.dataFactory.quad(this.parseJsonValue(r.subject),this.parseJsonValue(r.predicate),this.parseJsonValue(r.object));break;default:t=this.dataFactory.namedNode(e.value)}return t}parseJsonBoolean(e,t){if(t&&!this.isValidVersion(t))throw new Error(`Detected unsupported version as media type parameter: ${t}`);if("boolean"in e)return e.boolean;throw new Error("No valid ASK response was found.")}parseJsonBooleanStream(e,t){return t&&!this.isValidVersion(t)?Promise.reject(new Error(`Detected unsupported version as media type parameter: ${t}`)):new Promise(((t,r)=>{const n=new a;n.onError=r,n.onValue=e=>{"boolean"===n.key&&"boolean"==typeof e&&1===n.stack.length&&t(e)},e.on("error",r).on("data",(e=>n.write(e))).on("end",(()=>r(new Error("No valid ASK response was found."))))}))}}t.SparqlJsonParser=o,o.SUPPORTED_VERSIONS=["1.2","1.2-basic","1.1"]},43004:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(78780),t)},78780:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Converter=void 0;const n=r(83722),i=r(25113);class a{constructor(e){(e=e||{delimiter:"_"}).prefixVariableQuestionMark=!1,this.delimiter=e.delimiter||"_",this.parser=new i.SparqlJsonParser(e),this.materializeRdfJsTerms=e.materializeRdfJsTerms}static addValueToTree(e,t,r,n,i,o){const s=t[0],c=n?n+o+s:s,u=i.singularizeVariables[c];if(1===t.length)u?e[s]||(e[s]=r):(e[s]||(e[s]=[]),e[s].push(r));else{let n;u?(e[s]||(e[s]={}),n=e[s]):(e[s]||(e[s]=[{}]),n=e[s][0]),a.addValueToTree(n,t.slice(1),r,c,i,o)}}static mergeTrees(e,t){if(typeof e!=typeof t)throw new Error(`Two incompatible tree nodes were found: ${typeof e} and ${typeof t}`);if(Array.isArray(e)!==Array.isArray(t))throw new Error(`Two incompatible tree nodes were found: Array?${Array.isArray(e)} and Array?${Array.isArray(t)}`);if("object"==typeof e&&"object"==typeof t){if(e.termType&&t.termType)return e.equals(t)?{valid:!0,result:e}:{valid:!1,result:e};if(Array.isArray(e)&&Array.isArray(t)){if(e.length>0){const r=[];let n=!1;for(const i of e){const e=a.mergeTrees(i,t[0]);e.valid?(n=!0,r.push(e.result)):r.push(i)}if(n)return{valid:!0,result:r}}return{valid:!0,result:e.concat(t)}}{const r={};for(const e in t)r[e]=t[e];for(const t in e)if(r[t]){const n=a.mergeTrees(e[t],r[t]);if(!n.valid)return{valid:!1,result:e};r[t]=n.result}else r[t]=e[t];return{valid:!0,result:r}}}throw new Error(`Unmergable tree types: ${typeof e} and ${typeof t}`)}static materializeTree(e){if(e.termType)return(0,n.getTermRaw)(e);if(Array.isArray(e))return e.map(a.materializeTree);{const t={};for(const r in e)t[r]=a.materializeTree(e[r]);return t}}sparqlJsonResultsToTree(e,t){return this.bindingsToTree(this.parser.parseJsonResults(e),t||{singularizeVariables:{}})}bindingsToTree(e,t){const r=t&&t.singularizeVariables[""];let n=r?{}:[];for(const i of e){const e=r?{}:[{}];for(const n in i){const o=n.split(this.delimiter),s=i[n];a.addValueToTree(r?e:e[0],o,s,"",t,this.delimiter)}n=a.mergeTrees(n,e).result}return this.materializeRdfJsTerms&&(n=a.materializeTree(n)),n}}t.Converter=a},94784:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(58574),t),i(r(69626),t),i(r(86621),t),i(r(78743),t),i(r(23745),t),i(r(78501),t),i(r(45170),t)},58574:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNode=void 0,t.BlankNode=class{constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}},69626:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataFactory=void 0;const n=r(58574),i=r(86621),a=r(78743),o=r(23745),s=r(78501),c=r(45170);let u=0;t.DataFactory=class{constructor(e){this.blankNodeCounter=0,e=e||{},this.blankNodePrefix=e.blankNodePrefix||`df_${u++}_`}namedNode(e){return new o.NamedNode(e)}blankNode(e){return new n.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new a.Literal(e,t)}variable(e){return new c.Variable(e)}defaultGraph(){return i.DefaultGraph.INSTANCE}quad(e,t,r,n){return new s.Quad(e,t,r,n||this.defaultGraph())}fromTerm(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(a.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},86621:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGraph=void 0;class r{constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&"DefaultGraph"===e.termType}}t.DefaultGraph=r,r.INSTANCE=new r},78743:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Literal=void 0;const n=r(23745);class i{constructor(e,t){this.termType="Literal",this.value=e,"string"==typeof t?(this.language=t,this.datatype=i.RDF_LANGUAGE_STRING):t?(this.language="",this.datatype=t):(this.language="",this.datatype=i.XSD_STRING)}equals(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&this.datatype.equals(e.datatype)}}t.Literal=i,i.RDF_LANGUAGE_STRING=new n.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.XSD_STRING=new n.NamedNode("http://www.w3.org/2001/XMLSchema#string")},23745:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NamedNode=void 0,t.NamedNode=class{constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}},78501:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Quad=void 0,t.Quad=class{constructor(e,t,r,n){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=r,this.graph=n}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}},45170:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Variable=void 0,t.Variable=class{constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}},83722:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.getSupportedJavaScriptPrimitives=t.getSupportedRdfDatatypes=t.getTermRaw=t.toRdf=t.fromRdf=void 0;const a=r(94784),o=r(29681),s=r(28638);i(r(29681),t),i(r(56181),t),i(r(28638),t);const c=new a.DataFactory,u=new s.Translator;function l(e,t){return u.fromRdf(e,t)}u.registerHandler(new o.TypeHandlerString,o.TypeHandlerString.TYPES.map((e=>c.namedNode(e))),["string"]),u.registerHandler(new o.TypeHandlerBoolean,[o.TypeHandlerBoolean.TYPE].map((e=>c.namedNode(e))),["boolean"]),u.registerHandler(new o.TypeHandlerNumberDouble,o.TypeHandlerNumberDouble.TYPES.map((e=>c.namedNode(e))),["number"]),u.registerHandler(new o.TypeHandlerNumberInteger,o.TypeHandlerNumberInteger.TYPES.map((e=>c.namedNode(e))),["number"]),u.registerHandler(new o.TypeHandlerDate,o.TypeHandlerDate.TYPES.map((e=>c.namedNode(e))),["object"]),t.fromRdf=l,t.toRdf=function(e,t){return t&&"namedNode"in t&&(t={dataFactory:t}),(t=t||{})&&!t.dataFactory&&(t.dataFactory=c),u.toRdf(e,t)},t.getTermRaw=function(e,t){return"Literal"===e.termType?l(e,t):e.value},t.getSupportedRdfDatatypes=function(){return u.getSupportedRdfDatatypes()},t.getSupportedJavaScriptPrimitives=function(){return u.getSupportedJavaScriptPrimitives()}},56181:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},28638:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Translator=void 0,t.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(e){throw new Error(`Invalid RDF ${e.datatype.value} value: '${e.value}'`)}registerHandler(e,t,r){for(const r of t)this.supportedRdfDatatypes.push(r),this.fromRdfHandlers[r.value]=e;for(const t of r){let r=this.toRdfHandlers[t];r||(this.toRdfHandlers[t]=r=[]),r.push(e)}}fromRdf(e,t){const r=this.fromRdfHandlers[e.datatype.value];return r?r.fromRdf(e,t):e.value}toRdf(e,t){const r=this.toRdfHandlers[typeof e];if(r)for(const n of r){const r=n.toRdf(e,t);if(r)return r}throw new Error(`Invalid JavaScript value: '${e}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},43005:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerBoolean=void 0;const n=r(28638);class i{fromRdf(e,t){switch(e.value){case"true":case"1":return!0;case"false":case"0":return!1}return t&&n.Translator.incorrectRdfDataType(e),!1}toRdf(e,{datatype:t,dataFactory:r}){return r.literal(e?"true":"false",t||r.namedNode(i.TYPE))}}i.TYPE="http://www.w3.org/2001/XMLSchema#boolean",t.TypeHandlerBoolean=i},68617:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerDate=void 0;const n=r(28638);class i{fromRdf(e,t){switch(t&&!e.value.match(i.VALIDATORS[e.datatype.value.substr(33,e.datatype.value.length)])&&n.Translator.incorrectRdfDataType(e),e.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(e.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const t=e.value.split("-");return new Date(0,parseInt(t[0],10)-1,parseInt(t[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(e.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(e.value+"-01");default:return new Date(e.value)}}toRdf(e,{datatype:t,dataFactory:r}){if(t=t||r.namedNode(i.TYPES[0]),!(e instanceof Date))return null;const n=e;let a;switch(t.value){case"http://www.w3.org/2001/XMLSchema#gDay":a=String(n.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":a=n.getUTCMonth()+1+"-"+n.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":a=String(n.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":a=n.getUTCFullYear()+"-"+(n.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":a=n.toISOString().replace(/T.*$/,"");break;default:a=n.toISOString()}return r.literal(a,t)}}i.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],i.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/},t.TypeHandlerDate=i},52797:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberDouble=void 0;const n=r(28638);class i{fromRdf(e,t){const r=parseFloat(e.value);return t&&isNaN(r)&&n.Translator.incorrectRdfDataType(e),r}toRdf(e,{datatype:t,dataFactory:r}){return t=t||r.namedNode(i.TYPES[0]),isNaN(e)?r.literal("NaN",t):isFinite(e)?e%1==0?null:r.literal(e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),t):r.literal(e>0?"INF":"-INF",t)}}i.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"],t.TypeHandlerNumberDouble=i},19260:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberInteger=void 0;const n=r(28638);class i{fromRdf(e,t){const r=parseInt(e.value,10);return t&&(isNaN(r)||e.value.indexOf(".")>=0)&&n.Translator.incorrectRdfDataType(e),r}toRdf(e,{datatype:t,dataFactory:r}){return r.literal(String(e),t||(e<=i.MAX_INT&&e>=i.MIN_INT?r.namedNode(i.TYPES[0]):r.namedNode(i.TYPES[1])))}}i.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],i.MAX_INT=2147483647,i.MIN_INT=-2147483648,t.TypeHandlerNumberInteger=i},50920:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerString=void 0;class r{fromRdf(e){return e.value}toRdf(e,{datatype:t,dataFactory:r}){return r.literal(e,t)}}r.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"],t.TypeHandlerString=r},29681:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(43005),t),i(r(68617),t),i(r(52797),t),i(r(19260),t),i(r(50920),t)},25113:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(76425),t)},76425:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SparqlJsonParser=void 0;const n=r(94784),i=r(58521),a=r(36885);t.SparqlJsonParser=class{constructor(e){var t;e=e||{},this.dataFactory=e.dataFactory||new n.DataFactory,this.prefixVariableQuestionMark=!!e.prefixVariableQuestionMark,this.suppressMissingStreamResultsError=null===(t=e.suppressMissingStreamResultsError)||void 0===t||t}parseJsonResults(e){return e.results.bindings.map((e=>this.parseJsonBindings(e)))}parseJsonResultsStream(e){const t=e=>s.emit("error",e);e.on("error",t);const r=new a;r.onError=t;let n=!1,o=!1;r.onValue=e=>{if("vars"===r.key&&2===r.stack.length&&"head"===r.stack[1].key)s.emit("variables",e.map((e=>this.dataFactory.variable(e)))),n=!0;else if("results"===r.key&&1===r.stack.length)o=!0;else if("number"==typeof r.key&&3===r.stack.length&&"results"===r.stack[1].key&&"bindings"===r.stack[2].key)try{s.push(this.parseJsonBindings(e))}catch(e){s.emit("error",e)}else"metadata"===r.key&&1===r.stack.length&&s.emit("metadata",e)};const s=e.on("end",(e=>{o||this.suppressMissingStreamResultsError?n||s.emit("variables",[]):s.emit("error",new Error("No valid SPARQL query results were found."))})).pipe(new i.Transform({objectMode:!0,transform(e,t,n){r.write(e),n()}}));return s}parseJsonBindings(e){const t={};for(const r in e){const n=e[r];t[this.prefixVariableQuestionMark?"?"+r:r]=this.parseJsonValue(n)}return t}parseJsonValue(e){let t;switch(e.type){case"bnode":t=this.dataFactory.blankNode(e.value);break;case"literal":t=e["xml:lang"]?this.dataFactory.literal(e.value,e["xml:lang"]):e.datatype?this.dataFactory.literal(e.value,this.dataFactory.namedNode(e.datatype)):this.dataFactory.literal(e.value);break;case"typed-literal":t=this.dataFactory.literal(e.value,this.dataFactory.namedNode(e.datatype));break;case"triple":const r=e.value;if(!(r&&r.subject&&r.predicate&&r.object))throw new Error("Invalid quoted triple: "+JSON.stringify(e));t=this.dataFactory.quad(this.parseJsonValue(r.subject),this.parseJsonValue(r.predicate),this.parseJsonValue(r.object));break;default:t=this.dataFactory.namedNode(e.value)}return t}parseJsonBoolean(e){if("boolean"in e)return e.boolean;throw new Error("No valid ASK response was found.")}parseJsonBooleanStream(e){return new Promise(((t,r)=>{const n=new a;n.onError=r,n.onValue=e=>{"boolean"===n.key&&"boolean"==typeof e&&1===n.stack.length&&t(e)},e.on("error",r).on("data",(e=>n.write(e))).on("end",(()=>r(new Error("No valid ASK response was found."))))}))}}},52666:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(49679),t)},49679:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SparqlXmlParser=void 0;const n=r(18050),i=r(49126),a=r(58521);class o{constructor(e){e=e||{},this.dataFactory=e.dataFactory||new n.DataFactory,this.prefixVariableQuestionMark=!!e.prefixVariableQuestionMark,this.parseUnsupportedVersions=!!e.parseUnsupportedVersions}isValidVersion(e){return this.parseUnsupportedVersions||o.SUPPORTED_VERSIONS.includes(e)}parseXmlResultsStream(e,t){const r=e=>m.emit("error",e);e.on("error",r);const n=new i.SaxesParser,o=[];let s=!1,c=!1;const u=[];let l,d={},p="",h="",f="",y=[];n.on("error",r),n.on("opentag",(e=>{"variable"===e.name&&this.stackEquals(o,["sparql","head"])?u.push(this.dataFactory.variable(e.attributes.name)):"results"===e.name&&this.stackEquals(o,["sparql"])?c=!0:"result"===e.name&&this.stackEquals(o,["sparql","results"])?d={}:"binding"===e.name&&this.stackEquals(o,["sparql","results","result"])?(p=e.attributes.name||"",h="",l=void 0,f="",y=[]):"triple"===e.name&&this.stackBeginsWith(o,["sparql","results","result"])?y.push({components:{}}):"triple"===o[o.length-1]&&this.stackBeginsWith(o,["sparql","results","result","binding"])?(h="",l=void 0,f="",["subject","predicate","object"].includes(e.name)?y[y.length-1].currentComponent=e.name:r(new Error(`Illegal quoted triple component '${e.name}' found on line ${n.line+1}`))):this.stackBeginsWith(o,["sparql","results","result","binding"])?(h=e.name,l="xml:lang"in e.attributes?{language:e.attributes["xml:lang"],direction:e.attributes["its:dir"]}:"datatype"in e.attributes?this.dataFactory.namedNode(e.attributes.datatype):void 0):"sparql"===e.name&&e.attributes.version&&(this.isValidVersion(e.attributes.version)||m.emit("error",new Error(`Detected unsupported version: ${e.attributes.version}`)),m.emit("version",e.attributes.version)),o.push(e.name)})),n.on("closetag",(e=>{if(this.stackEquals(o,["sparql","head"])&&(m.emit("variables",u),s=!0),this.stackEquals(o,["sparql","results","result"])&&m.push(d),this.stackBeginsWith(o,["sparql","results","result","binding"])){let e;if(!p&&h)r(new Error(`Terms should have a name on line ${n.line+1}`));else if("uri"===h)e=this.dataFactory.namedNode(f);else if("bnode"===h)e=this.dataFactory.blankNode(f);else if("literal"===h)e=this.dataFactory.literal(f,l);else if("triple"===o[o.length-1]){const t=y.pop();t&&t.components.subject&&t.components.predicate&&t.components.object?e=this.dataFactory.quad(t.components.subject,t.components.predicate,t.components.object):r(new Error(`Incomplete quoted triple on line ${n.line+1}`))}else h&&r(new Error(`Invalid term type '${h}' on line ${n.line+1}`));if(e)if(y.length>0){const t=y[y.length-1];t.components[t.currentComponent]&&r(new Error(`The ${t.currentComponent} in a quoted triple on line ${n.line+1} was already defined before`)),t.components[t.currentComponent]=e}else{const t=this.prefixVariableQuestionMark?"?"+p:p;d[t]=e}h=void 0}o.pop()})),n.on("text",(e=>{this.stackBeginsWith(o,["sparql","results","result","binding"])&&o[o.length-1]===h&&(f=e)}));const m=e.on("end",(e=>{c?s||m.emit("variables",[]):m.emit("error",new Error("No valid SPARQL query results were found."))})).pipe(new a.Transform({objectMode:!0,transform(e,t,r){n.write(e),r()}}));return t&&!this.isValidVersion(t)&&m.destroy(new Error(`Detected unsupported version as media type parameter: ${t}`)),m}parseXmlBooleanStream(e,t){return t&&!this.isValidVersion(t)?Promise.reject(new Error(`Detected unsupported version as media type parameter: ${t}`)):new Promise(((t,r)=>{const n=new i.SaxesParser,a=[];n.on("error",r),n.on("opentag",(e=>{a.push(e.name)})),n.on("closetag",(e=>{a.pop()})),n.on("text",(e=>{this.stackEquals(a,["sparql","boolean"])&&t("true"===e)})),e.on("error",r).on("data",(e=>n.write(e))).on("end",(()=>r(new Error("No valid ASK response was found."))))}))}stackEquals(e,t){return e.length===t.length&&e.every(((e,r)=>t[r]===e))}stackBeginsWith(e,t){return e.length>=t.length&&t.every(((t,r)=>e[r]===t))}}t.SparqlXmlParser=o,o.SUPPORTED_VERSIONS=["1.2","1.2-basic","1.1"]},76574:(e,t,r)=>{var n=r(21848);e.exports=function(e,t,r){"function"==typeof t&&(r=t,t=null);var i="",a=new n((function(r,n){e.on("data",(function(e){i+="string"==typeof t?e.toString(t):e.toString()})),e.on("end",(function(){r(i)})),e.on("error",n)}));return r&&a.then((function(e){r(null,e)}),r),a}},18888:(e,t,r)=>{"use strict";var n=r(25636).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=d,t=3;break;default:return this.write=p,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},38753:(e,t,r)=>{"use strict";r.r(t),r.d(t,{clearImmediate:()=>c,setImmediate:()=>s});let n=1;const i=new Map;let a,o=!1,s=(e,...t)=>(i.set(n,[e,t]),a(n),n++),c=e=>{i.delete(e)};function u(e){if(o)setTimeout(u,0,e);else{const t=i.get(e);if(t){o=!0;try{t[0](...t[1])}finally{c(e),o=!1}}}}const l="undefined"==typeof self?void 0===r.g?void 0:r.g:self;l.setImmediate?(s=l.setImmediate,c=l.clearImmediate):l.importScripts?function(){const e=new MessageChannel;e.port1.onmessage=e=>{u(e.data)},a=t=>{e.port2.postMessage(t)}}():function(){const e=`setImmediate$${Math.random()}$`;window.addEventListener("message",(t=>{"string"==typeof t.data&&t.data.startsWith(e)&&u(+t.data.slice(e.length))})),a=t=>{window.postMessage(e+t,"*")}}()},72729:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(80879),t)},68492:e=>{!function(t){"use strict";var r=function(){function e(e){this.options=e}return e.prototype.toString=function(){return JSON&&JSON.stringify?JSON.stringify(this.options):this.options},e}(),n={isArray:function(e){return"[object Array]"===Object.prototype.toString.apply(e)},isString:function(e){return"[object String]"===Object.prototype.toString.apply(e)},isNumber:function(e){return"[object Number]"===Object.prototype.toString.apply(e)},isBoolean:function(e){return"[object Boolean]"===Object.prototype.toString.apply(e)},join:function(e,t){var r,n="",i=!0;for(r=0;r="0"&&e<="9"}return{isAlpha:function(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"},isDigit:e,isHexDigit:function(t){return e(t)||t>="a"&&t<="f"||t>="A"&&t<="F"}}}(),a=function(){var e=function(e){return e<=127?1:194<=e&&e<=223?2:224<=e&&e<=239?3:240<=e&&e<=244?4:0},t=function(e){return 128<=e&&e<=191};function r(e,t){return"%"===e.charAt(t)&&i.isHexDigit(e.charAt(t+1))&&i.isHexDigit(e.charAt(t+2))}function n(e,t){return parseInt(e.substr(t,2),16)}return{encodeCharacter:function(e){var t,r,n="",i=function(e){return unescape(encodeURIComponent(e))}(e);for(r=0;r1?r+=n:r+=c(n)||s(n)?n:a.encodeCharacter(n);return r},encodeLiteralCharacter:function(e,t){var r=a.pctCharAt(e,t);return r.length>1||c(r)||s(r)?r:a.encodeCharacter(r)}}}(),l=function(){var e={};function t(t){e[t]={symbol:t,separator:"?"===t?"&":""===t||"+"===t||"#"===t?",":t,named:";"===t||"&"===t||"?"===t,ifEmpty:"&"===t||"?"===t?"=":"",first:"+"===t?"":t,encode:"+"===t||"#"===t?u.encodePassReserved:u.encode,toString:function(){return this.symbol}}}return t(""),t("+"),t("#"),t("."),t("/"),t(";"),t("?"),t("&"),{valueOf:function(t){return e[t]?e[t]:"=,!@|".indexOf(t)>=0?null:e[""]}}}();function d(e){var t;if(null==e)return!1;if(n.isArray(e))return e.length>0;if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return!0;for(t in e)if(e.hasOwnProperty(t)&&d(e[t]))return!0;return!1}var p=function(){function e(e){this.literal=u.encodeLiteral(e)}return e.prototype.expand=function(){return this.literal},e.prototype.toString=e.prototype.expand,e}(),h=function(){function e(e){var t,n,s=[],c=null,u=null,d=null,p="";function h(){var t=e.substring(u,n);if(0===t.length)throw new r({expressionText:e,message:"a varname must be specified",position:n});c={varname:t,exploded:!1,maxLength:null},u=null}function y(){if(d===n)throw new r({expressionText:e,message:"after a ':' you have to specify the length",position:n});c.maxLength=parseInt(e.substring(d,n),10),d=null}for(t=function(t){var i=l.valueOf(t);if(null===i)throw new r({expressionText:e,message:"illegal use of reserved operator",position:n,operator:t});return i}(e.charAt(0)),n=t.symbol.length,u=n;n=4)throw new r({expressionText:e,message:"A :prefix must have max 4 digits",position:n});continue}y()}if(":"!==p)if("*"!==p){if(","!==p)throw new r({expressionText:e,message:"illegal character",character:p,position:n});s.push(c),c=null,u=n+1}else{if(null===c)throw new r({expressionText:e,message:"exploded without varspec",position:n});if(c.exploded)throw new r({expressionText:e,message:"exploded twice",position:n});if(c.maxLength)throw new r({expressionText:e,message:"an explode (*) MUST NOT follow to a prefix",position:n});c.exploded=!0}else{if(null!==c.maxLength)throw new r({expressionText:e,message:"only one :maxLength is allowed per varspec",position:n});if(c.exploded)throw new r({expressionText:e,message:"an exploeded varspec MUST NOT be varspeced",position:n});d=n+1}}return null!==u&&h(),null!==d&&y(),s.push(c),new f(e,t,s)}return function(t){var n,i,a=[],o=null,s=0;for(n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateIri=t.IriValidationStrategy=void 0;const r=function(){const e="[!$&'()*+,;=]",t="%[a-fA-F0-9]{2}",r="([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",n=`${r}\\.${r}\\.${r}\\.${r}`,i="[a-fA-F0-9]{1,4}",a=`(${i}:${i}|${n})`,o="[a-zA-Z0-9\\-._~ -퟿豈-﷏ﷰ-￯𐀀-🿽𠀀-𯿽𰀀-𿿽񀀀-񏿽񐀀-񟿽񠀀-񯿽񰀀-񿿽򀀀-򏿽򐀀-򟿽򠀀-򯿽򰀀-򿿽󀀀-󏿽󐀀-󟿽󡀀-󯿽]",s=`(${o}|${t}|${e}|[:@])*`,c=`(${s})+`,u=`(${s})*`;return new RegExp(`^[a-zA-Z][a-zA-Z0-9+\\-.]*:(\\/\\/((${o}|${t}|${e}|:)*@)?(\\[(((${i}:){6}${a}|::(${i}:){5}${a}|(${i})?::(${i}:){4}${a}|((${i}:){0,1}${i})?::(${i}:){3}${a}|((${i}:){0,2}${i})?::(${i}:){2}${a}|((${i}:){0,3}${i})?::${i}:${a}|((${i}:){0,4}${i})?::${a}|((${i}:){0,5}${i})?::${i}|((${i}:){0,6}${i})?::)|v[a-fA-F0-9]+\\.(${e}|${e}|":)+)\\]|${n}|(${o}|${t}|${e})*)(:[0-9]*)?(\\/${u})*|\\/(${c}(\\/${u})*)?|${c}(\\/${u})*|)(\\?(${s}|[-󰀀-󿿽􀀀-􏿽]|[\\/?])*)?(#(${s}|[\\/?])*)?$`,"u")}(),n=/^[A-Za-z][\d+-.A-Za-z]*:[^\u0000-\u0020"<>\\^`{|}]*$/u;var i;!function(e){e.Strict="strict",e.Pragmatic="pragmatic",e.None="none"}(i=t.IriValidationStrategy||(t.IriValidationStrategy={})),t.validateIri=function(e,t=i.Strict){switch(t){case i.Strict:return r.test(e)?void 0:new Error(`Invalid IRI according to RFC 3987: '${e}'`);case i.Pragmatic:return n.test(e)?void 0:new Error(`Invalid IRI according to RDF Turtle: '${e}'`);case i.None:return;default:return new Error(`Not supported validation strategy "${t}"`)}}},94824:(e,t)=>{"use strict";function r(e){return e>=65&&e<=90||e>=97&&e<=122||58===e||95===e||8204===e||8205===e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}Object.defineProperty(t,"__esModule",{value:!0}),t.CHAR="\t\n\r -퟿-�𐀀-􏿿",t.S=" \t\r\n",t.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",t.NAME_CHAR="-"+t.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",t.CHAR_RE=new RegExp("^["+t.CHAR+"]$","u"),t.S_RE=new RegExp("^["+t.S+"]+$","u"),t.NAME_START_CHAR_RE=new RegExp("^["+t.NAME_START_CHAR+"]$","u"),t.NAME_CHAR_RE=new RegExp("^["+t.NAME_CHAR+"]$","u"),t.NAME_RE=new RegExp("^["+t.NAME_START_CHAR+"]["+t.NAME_CHAR+"]*$","u"),t.NMTOKEN_RE=new RegExp("^["+t.NAME_CHAR+"]+$","u"),t.S_LIST=[32,10,13,9],t.isChar=function(e){return e>=32&&e<=55295||10===e||13===e||9===e||e>=57344&&e<=65533||e>=65536&&e<=1114111},t.isS=function(e){return 32===e||10===e||13===e||9===e},t.isNameStartChar=r,t.isNameChar=function(e){return r(e)||e>=48&&e<=57||45===e||46===e||183===e||e>=768&&e<=879||e>=8255&&e<=8256}},30718:(e,t)=>{"use strict";function r(e){return e>=65&&e<=90||e>=97&&e<=122||58===e||95===e||8204===e||8205===e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}Object.defineProperty(t,"__esModule",{value:!0}),t.CHAR="-퟿-�𐀀-􏿿",t.RESTRICTED_CHAR="-\b\v\f--„†-Ÿ",t.S=" \t\r\n",t.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",t.NAME_CHAR="-"+t.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",t.CHAR_RE=new RegExp("^["+t.CHAR+"]$","u"),t.RESTRICTED_CHAR_RE=new RegExp("^["+t.RESTRICTED_CHAR+"]$","u"),t.S_RE=new RegExp("^["+t.S+"]+$","u"),t.NAME_START_CHAR_RE=new RegExp("^["+t.NAME_START_CHAR+"]$","u"),t.NAME_CHAR_RE=new RegExp("^["+t.NAME_CHAR+"]$","u"),t.NAME_RE=new RegExp("^["+t.NAME_START_CHAR+"]["+t.NAME_CHAR+"]*$","u"),t.NMTOKEN_RE=new RegExp("^["+t.NAME_CHAR+"]+$","u"),t.S_LIST=[32,10,13,9],t.isChar=function(e){return e>=1&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111},t.isRestrictedChar=function(e){return e>=1&&e<=8||11===e||12===e||e>=14&&e<=31||e>=127&&e<=132||e>=134&&e<=159},t.isCharAndNotRestricted=function(e){return 9===e||10===e||13===e||e>31&&e<127||133===e||e>159&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111},t.isS=function(e){return 32===e||10===e||13===e||9===e},t.isNameStartChar=r,t.isNameChar=function(e){return r(e)||e>=48&&e<=57||45===e||46===e||183===e||e>=768&&e<=879||e>=8255&&e<=8256}},26457:(e,t)=>{"use strict";function r(e){return e>=65&&e<=90||95===e||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}Object.defineProperty(t,"__esModule",{value:!0}),t.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",t.NC_NAME_CHAR="-"+t.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",t.NC_NAME_START_CHAR_RE=new RegExp("^["+t.NC_NAME_START_CHAR+"]$","u"),t.NC_NAME_CHAR_RE=new RegExp("^["+t.NC_NAME_CHAR+"]$","u"),t.NC_NAME_RE=new RegExp("^["+t.NC_NAME_START_CHAR+"]["+t.NC_NAME_CHAR+"]*$","u"),t.isNCNameStartChar=r,t.isNCNameChar=function(e){return r(e)||45===e||46===e||e>=48&&e<=57||183===e||e>=768&&e<=879||e>=8255&&e<=8256}},17411:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorAbstractMediaTyped=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}async run(e){if("handle"in e){const t=e;return{handle:await this.runHandle(t.handle,t.handleMediaType,e.context)}}if("mediaTypes"in e)return{mediaTypes:await this.getMediaTypes(e.context)};if("mediaTypeFormats"in e)return{mediaTypeFormats:await this.getMediaTypeFormats(e.context)};throw new Error("Either a handle, mediaTypes or mediaTypeFormats action needs to be provided")}async test(e){if("handle"in e){const t=e;return(await this.testHandle(t.handle,t.handleMediaType,e.context)).map((e=>({handle:e})))}return"mediaTypes"in e?(await this.testMediaType(e.context)).map((e=>({mediaTypes:e}))):"mediaTypeFormats"in e?(await this.testMediaTypeFormats(e.context)).map((e=>({mediaTypeFormats:e}))):(0,n.failTest)("Either a handle, mediaTypes or mediaTypeFormats action needs to be provided")}}t.ActorAbstractMediaTyped=i},67233:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorAbstractMediaTypedFixed=void 0;const n=r(97356),i=r(17411);class a extends i.ActorAbstractMediaTyped{mediaTypePriorities;mediaTypeFormats;priorityScale;constructor(e){super(e),this.mediaTypePriorities=e.mediaTypePriorities,this.mediaTypeFormats=e.mediaTypeFormats,this.priorityScale=e.priorityScale;const t=this.priorityScale??1;if(this.mediaTypePriorities)for(const[e,[r,n]]of Object.entries(this.mediaTypePriorities).entries())this.mediaTypePriorities[r]=t*n;this.mediaTypePriorities=Object.freeze(this.mediaTypePriorities),this.mediaTypeFormats=Object.freeze(this.mediaTypeFormats)}async testHandle(e,t,r){return t&&t in this.mediaTypePriorities?await this.testHandleChecked(e,r):(0,n.failTest)(`Unrecognized media type: ${t}`)}async testMediaType(e){return(0,n.passTestVoid)()}async getMediaTypes(e){return this.mediaTypePriorities}async testMediaTypeFormats(e){return(0,n.passTestVoid)()}async getMediaTypeFormats(e){return this.mediaTypeFormats}}t.ActorAbstractMediaTypedFixed=a},14972:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(17411),t),i(r(67233),t)},71975:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorAbstractPath=void 0;const n=r(23034),i=r(72407),a=r(97356),o=r(34005),s=r(98989),c=r(76664),u=r(22112),l=r(25157);class d extends n.ActorQueryOperationTypedMediated{predicateType;constructor(e,t){super(e,"path"),this.predicateType=t}async testOperation(e,t){return e.predicate.type!==this.predicateType?(0,a.failTest)(`This Actor only supports ${this.predicateType} Path operations.`):(0,a.passTestVoid)()}generateVariable(e,t,r){return r?!t||t.subject.value!==r&&t.object.value!==r?e.variable(r):this.generateVariable(e,t,`${r}b`):this.generateVariable(e,t,"b")}async isPathArbitraryLengthDistinct(e,t,r){return t.get(i.KeysQueryOperation.isPathArbitraryLengthDistinctKey)?{context:t=t.set(i.KeysQueryOperation.isPathArbitraryLengthDistinctKey,!1),operation:void 0}:{context:t=t.set(i.KeysQueryOperation.isPathArbitraryLengthDistinctKey,!0),operation:(0,s.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:e.createDistinct(r),context:t}))}}async getNodes(e,t,r,n){const i=(0,s.getSafeBindings)(await this.mediatorQueryOperation.mediate({context:t,operation:this.assignPatternSources(r,r.createNodes(e.graph,e.subject),n)}));return i.bindingsStream=i.bindingsStream.map((t=>t.set(e.object,t.get(e.subject)))),i}async predicateStarGraphVariable(e,t,r,n,i,a,o){const u=this.getPathSources(r),l=this.generateVariable(a.dataFactory,a.createPath(e,r,t,n)),d=a.createUnion([this.assignPatternSources(a,a.createPattern(e,l,t,n),u),this.assignPatternSources(a,a.createPattern(t,l,e,n),u)]),p=(0,s.getSafeBindings)(await this.mediatorQueryOperation.mediate({context:i,operation:d})),h=new Set;return{bindingsStream:new c.MultiTransformIterator(p.bindingsStream,{multiTransform:s=>{const u=s.get(n);return h.has(u.value)?new c.EmptyIterator:(h.add(u.value),new c.TransformIterator((async()=>{const s=new c.BufferedIterator;return await this.getObjectsPredicateStar(a,e,r,u,i,{},s,{count:0}),s.map((e=>o.bindings([[t,e],[n,u]])))}),{maxBufferSize:128,autoStart:!1}))},autoStart:!1}),metadata:p.metadata}}async getObjectsPredicateStarEval(e,t,r,n,i,a,o,s){if("Variable"===n.termType)return this.predicateStarGraphVariable(e,r,t,n,i,o,s);const c=new l.PathVariableObjectIterator(o,e,t,n,i,this.mediatorQueryOperation,a);return{bindingsStream:c.map((e=>s.bindings([[r,e]]))),async metadata(){const e=await new Promise((e=>{c.getProperty("metadata",(t=>e(t())))}));return e.cardinality.value++,e}}}async getObjectsPredicateStar(e,t,r,n,i,a,o,c){const l=(0,u.termToString)(t);if(a[l])return;o._push(t),a[l]=t,c.count++;const d=this.generateVariable(e.dataFactory),p=e.createPath(t,r,d,n),h=(0,s.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:p,context:i}));return h.bindingsStream.on("data",(async t=>{const s=t.get(d);await this.getObjectsPredicateStar(e,s,r,n,i,a,o,c)})),h.bindingsStream.on("end",(()=>{0==--c.count&&o.close()})),h.metadata}async getSubjectAndObjectBindingsPredicateStar(e,t,r,n,i,a,o,c,l,d,p,h,f){const y=(0,u.termToString)(n)+(0,u.termToString)(a);if(l[y])return;if(p.count++,l[y]=!0,d._push(f.bindings([[e,r],[t,n]])),y in c){const n=await c[y];for(const s of n)await this.getSubjectAndObjectBindingsPredicateStar(e,t,r,s,i,a,o,c,l,d,p,h,f);return void(0==--p.count&&d.close())}const m=new Promise((async(u,y)=>{const m=[],g=this.generateVariable(h.dataFactory),b=h.createPath(n,i,g,a),v=(0,s.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:b,context:o}));v.bindingsStream.on("data",(async n=>{const s=n.get(g);m.push(s),await this.getSubjectAndObjectBindingsPredicateStar(e,t,r,s,i,a,o,c,l,d,p,h,f)})),v.bindingsStream.on("error",y),v.bindingsStream.on("end",(()=>{0==--p.count&&d.close(),u(m)}))}));c[y]=m}getPathSources(e){if((0,o.isKnownOperation)(e,o.Algebra.Types.ALT)||(0,o.isKnownOperation)(e,o.Algebra.Types.SEQ))return e.input.flatMap((e=>this.getPathSources(e)));if((0,o.isKnownOperation)(e,o.Algebra.Types.INV)||(0,o.isKnownOperation)(e,o.Algebra.Types.ONE_OR_MORE_PATH)||(0,o.isKnownOperation)(e,o.Algebra.Types.ZERO_OR_MORE_PATH)||(0,o.isKnownOperation)(e,o.Algebra.Types.ZERO_OR_ONE_PATH))return this.getPathSources(e.path);if((0,o.isKnownOperation)(e,o.Algebra.Types.LINK)||(0,o.isKnownOperation)(e,o.Algebra.Types.NPS)){const t=(0,s.getOperationSource)(e);if(!t)throw new Error("Could not find a required source on a link path operation");return[t]}throw new Error(`Can not extract path sources from operation of type ${e.type}`)}assignPatternSources(e,t,r){if(0===r.length)throw new Error("Attempted to assign zero sources to a pattern during property path handling");return 1===r.length?(0,s.assignOperationSource)(t,r[0]):e.createUnion(r.map((e=>(0,s.assignOperationSource)(t,e))),!0)}}t.ActorAbstractPath=d},25157:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PathVariableObjectIterator=void 0;const n=r(98989),i=r(76664),a=r(22112);class o extends i.BufferedIterator{algebraFactory;subject;predicate;graph;context;mediatorQueryOperation;maxRunningOperations;termHashes=new Map;runningOperations=[];pendingOperations=[];started=!1;constructor(e,t,r,n,i,a,o,s=16){super({autoStart:!1}),this.algebraFactory=e,this.subject=t,this.predicate=r,this.graph=n,this.context=i,this.mediatorQueryOperation=a,this.maxRunningOperations=s,this._push(this.subject,o)}getProperty(e,t){return this.started||"metadata"!==e||this.startNextOperation(!1).catch((e=>this.emit("error",e))),super.getProperty(e,t)}_end(e){for(const e of this.runningOperations)e.destroy();super._end(e)}_push(e,t=!0){let r;if(t&&(r=(0,a.termToString)(e),this.termHashes.has(r)))return!1;const n=this.algebraFactory.dataFactory.variable("b");return this.pendingOperations.push({variable:n,operation:this.algebraFactory.createPath(e,this.predicate,n,this.graph)}),r&&(this.termHashes.set(r,e),super._push(e)),!0}async startNextOperation(e){this.started=!0;const t=this.pendingOperations.pop(),r=(0,n.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:t.operation,context:this.context})),i=r.bindingsStream.map((e=>e.get(t.variable)));this.runningOperations.push(i),i.on("error",(e=>this.destroy(e))),i.on("readable",(()=>{e&&this._fillBufferAsync(),this.readable=!0})),i.on("end",(()=>{this.runningOperations.splice(this.runningOperations.indexOf(i),1),e&&this._fillBufferAsync(),this.readable=!0})),this.getProperty("metadata")||this.setProperty("metadata",r.metadata)}_read(e,t){const r=this;(async function(){for(;r.runningOperations.length0;n++)null!==(t=r.runningOperations[n].read())&&(r._push(t)?e--:i=!1)}r.closeIfNeeded()})().then((()=>{t()}),(e=>this.destroy(e)))}closeIfNeeded(){0===this.runningOperations.length&&0===this.pendingOperations.length&&this.close()}}t.PathVariableObjectIterator=o},43971:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(71975),t),i(r(25157),t)},19655:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactoryAverage=void 0;const n=r(74005),i=r(72407),a=r(97356),o=r(12233),s=r(81482);class c extends n.ActorBindingsAggregatorFactory{mediatorFunctionFactory;constructor(e){super(e),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async test(e){return"avg"!==e.expr.aggregator?(0,a.failTest)("This actor only supports the 'avg' aggregator."):(0,a.passTestVoid)()}async run({context:e,expr:t}){return new s.AverageAggregator(await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:t.expression,context:e}),t.distinct,e.getSafe(i.KeysInitQuery.dataFactory),await this.mediatorFunctionFactory.mediate({functionName:o.SparqlOperator.ADDITION,context:e,requireTermExpression:!0}),await this.mediatorFunctionFactory.mediate({functionName:o.SparqlOperator.DIVISION,context:e,requireTermExpression:!0}))}}t.ActorBindingsAggregatorFactoryAverage=c},81482:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactoryCount=void 0;const n=r(74005),i=r(97356),a=r(34005),o=r(27274);class s extends n.ActorBindingsAggregatorFactory{constructor(e){super(e)}async test(e){return"count"!==e.expr.aggregator||e.expr.expression.subType===a.Algebra.ExpressionTypes.WILDCARD?(0,i.failTest)("This actor only supports the 'count' aggregator without wildcard."):(0,i.passTestVoid)()}async run({context:e,expr:t}){return new o.CountAggregator(await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:t.expression,context:e}),t.distinct)}}t.ActorBindingsAggregatorFactoryCount=s},27274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CountAggregator=void 0;const n=r(74005),i=r(12233);class a extends n.AggregateEvaluator{state=void 0;constructor(e,t,r){super(e,t,r)}emptyValueTerm(){return(0,i.typedLiteral)("0",i.TypeURL.XSD_INTEGER)}putTerm(e){void 0===this.state&&(this.state=0),this.state++}termResult(){return void 0===this.state?this.emptyValue():(0,i.typedLiteral)(String(this.state),i.TypeURL.XSD_INTEGER)}}t.CountAggregator=a},8476:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(39823),t),i(r(27274),t)},74104:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactoryGroupConcat=void 0;const n=r(74005),i=r(72407),a=r(97356),o=r(38589);class s extends n.ActorBindingsAggregatorFactory{constructor(e){super(e)}async test(e){return"group_concat"!==e.expr.aggregator?(0,a.failTest)("This actor only supports the 'group_concat' aggregator."):(0,a.passTestVoid)()}async run({context:e,expr:t}){return new o.GroupConcatAggregator(await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:t.expression,context:e}),t.distinct,e.getSafe(i.KeysInitQuery.dataFactory),t.separator)}}t.ActorBindingsAggregatorFactoryGroupConcat=s},38589:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactoryMax=void 0;const n=r(74005),i=r(97356),a=r(14978);class o extends n.ActorBindingsAggregatorFactory{mediatorTermComparatorFactory;constructor(e){super(e),this.mediatorTermComparatorFactory=e.mediatorTermComparatorFactory}async test(e){return"max"!==e.expr.aggregator?(0,i.failTest)("This actor only supports the 'max' aggregator."):(0,i.passTestVoid)()}async run({expr:e,context:t}){return new a.MaxAggregator(await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:e.expression,context:t}),e.distinct,await this.mediatorTermComparatorFactory.mediate({context:t}))}}t.ActorBindingsAggregatorFactoryMax=o},14978:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MaxAggregator=void 0;const n=r(74005);class i extends n.AggregateEvaluator{orderByEvaluator;state=void 0;constructor(e,t,r,n){super(e,t,n),this.orderByEvaluator=r}putTerm(e){if("Literal"!==e.termType)throw new Error(`Term with value ${e.value} has type ${e.termType} and is not a literal`);(void 0===this.state||-1===this.orderByEvaluator.orderTypes(this.state,e))&&(this.state=e)}termResult(){return void 0===this.state?this.emptyValue():this.state}}t.MaxAggregator=i},21861:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(84399),t),i(r(14978),t)},23727:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactoryMin=void 0;const n=r(74005),i=r(97356),a=r(11210);class o extends n.ActorBindingsAggregatorFactory{mediatorTermComparatorFactory;constructor(e){super(e),this.mediatorTermComparatorFactory=e.mediatorTermComparatorFactory}async test(e){return"min"!==e.expr.aggregator?(0,i.failTest)("This actor only supports the 'min' aggregator."):(0,i.passTestVoid)()}async run({context:e,expr:t}){return new a.MinAggregator(await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:t.expression,context:e}),t.distinct,await this.mediatorTermComparatorFactory.mediate({context:e}))}}t.ActorBindingsAggregatorFactoryMin=o},11210:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MinAggregator=void 0;const n=r(74005);class i extends n.AggregateEvaluator{orderByEvaluator;state=void 0;constructor(e,t,r,n){super(e,t,n),this.orderByEvaluator=r}putTerm(e){if("Literal"!==e.termType)throw new Error(`Term with value ${e.value} has type ${e.termType} and is not a literal`);(void 0===this.state||1===this.orderByEvaluator.orderTypes(this.state,e))&&(this.state=e)}termResult(){return void 0===this.state?this.emptyValue():this.state}}t.MinAggregator=i},30372:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(23727),t),i(r(11210),t)},42785:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactorySample=void 0;const n=r(74005),i=r(97356),a=r(98972);class o extends n.ActorBindingsAggregatorFactory{constructor(e){super(e)}async test(e){return"sample"!==e.expr.aggregator?(0,i.failTest)("This actor only supports the 'sample' aggregator."):(0,i.passTestVoid)()}async run({context:e,expr:t}){return new a.SampleAggregator(await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:t.expression,context:e}),t.distinct)}}t.ActorBindingsAggregatorFactorySample=o},98972:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SampleAggregator=void 0;const n=r(74005);class i extends n.AggregateEvaluator{state=void 0;constructor(e,t,r){super(e,t,r)}putTerm(e){void 0===this.state&&(this.state=e)}termResult(){return void 0===this.state?this.emptyValue():this.state}}t.SampleAggregator=i},38887:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(42785),t),i(r(98972),t)},39815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactorySum=void 0;const n=r(74005),i=r(72407),a=r(97356),o=r(12233),s=r(52330);class c extends n.ActorBindingsAggregatorFactory{mediatorFunctionFactory;constructor(e){super(e),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async test(e){return"sum"!==e.expr.aggregator?(0,a.failTest)("This actor only supports the 'sum' aggregator."):(0,a.passTestVoid)()}async run({expr:e,context:t}){return new s.SumAggregator(await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:e.expression,context:t}),e.distinct,t.getSafe(i.KeysInitQuery.dataFactory),await this.mediatorFunctionFactory.mediate({functionName:o.SparqlOperator.ADDITION,context:t,requireTermExpression:!0}))}}t.ActorBindingsAggregatorFactorySum=c},52330:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SumAggregator=void 0;const n=r(74005),i=r(12233);class a extends n.AggregateEvaluator{dataFactory;additionFunction;state=void 0;constructor(e,t,r,n,i){super(e,t,i),this.dataFactory=r,this.additionFunction=n}emptyValueTerm(){return(0,i.typedLiteral)("0",i.TypeURL.XSD_INTEGER)}putTerm(e){if(void 0===this.state)this.state=this.termToNumericOrError(e);else{const t=this.termToNumericOrError(e);this.state=this.additionFunction.applyOnTerms([this.state,t],this.evaluator)}}termResult(){return void 0===this.state?this.emptyValue():this.state.toRDF(this.dataFactory)}}t.SumAggregator=a},12456:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(39815),t),i(r(52330),t)},20740:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactoryWildcardCount=void 0;const n=r(74005),i=r(97356),a=r(64321);class o extends n.ActorBindingsAggregatorFactory{constructor(e){super(e)}async test(e){return"count"!==e.expr.aggregator||"wildcard"!==e.expr.expression.subType?(0,i.failTest)("This actor only supports the 'count' aggregator with wildcard."):(0,i.passTestVoid)()}async run({context:e,expr:t}){return new a.WildcardCountAggregator(await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:t.expression,context:e}),t.distinct)}}t.ActorBindingsAggregatorFactoryWildcardCount=o},64321:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;oe[0].value.localeCompare(t[0].value)));const r=t.map((([e])=>e.value)).join(","),n=t.map((([,e])=>u.termToString(e))).join(","),i=this.bindingValues.get(r),a=void 0!==i&&i.has(n);return i||this.bindingValues.set(r,new Set),this.bindingValues.get(r).add(n),a}return!1}}t.WildcardCountAggregator=l},45897:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(20740),t),i(r(64321),t)},4531:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorContextPreprocessConvertShortcuts=void 0;const n=r(55406),i=r(97356);class a extends n.ActorContextPreprocess{contextKeyShortcuts;constructor(e){super(e),this.contextKeyShortcuts=e.contextKeyShortcuts}async test(e){return(0,i.passTestVoid)()}async run(e){return{context:a.expandShortcuts(e.context,this.contextKeyShortcuts)}}static expandShortcuts(e,t){for(const r of e.keys())t[r.name]&&(e=e.set(new i.ActionContextKey(t[r.name]),e.get(r)).delete(r));return e}}t.ActorContextPreprocessConvertShortcuts=a},80223:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4531),t)},8467:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorContextPreprocessSetDefaults=void 0;const n=r(55406),i=r(72407),a=r(97356),o=r(18050);class s extends n.ActorContextPreprocess{defaultFunctionArgumentsCache;logger;constructor(e){super(e),this.defaultFunctionArgumentsCache={},this.logger=e.logger}async test(e){return(0,a.passTestVoid)()}async run(e){let t=e.context;if(e.initialize){t=t.setDefault(i.KeysInitQuery.queryTimestamp,new Date).setDefault(i.KeysInitQuery.queryTimestampHighResolution,performance.now()).setDefault(i.KeysQuerySourceIdentify.sourceIds,new Map).setDefault(i.KeysCore.log,this.logger).setDefault(i.KeysInitQuery.functionArgumentsCache,this.defaultFunctionArgumentsCache).setDefault(i.KeysInitQuery.dataFactory,new o.DataFactory);let e={language:"sparql",version:"1.1"};t.has(i.KeysInitQuery.queryFormat)?(e=t.get(i.KeysInitQuery.queryFormat),"graphql"===e.language&&(t=t.setDefault(i.KeysInitQuery.graphqlSingularizeVariables,{}))):t=t.set(i.KeysInitQuery.queryFormat,e),t.has(i.KeysInitQuery.extensionFunctionsAlwaysPushdown)||t.has(i.KeysInitQuery.extensionFunctions)||(t=t.set(i.KeysInitQuery.extensionFunctionsAlwaysPushdown,!0))}return{context:t}}}t.ActorContextPreprocessSetDefaults=s},18959:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8467),t)},30020:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorContextPreprocessSourceToDestination=void 0;const n=r(55406),i=r(72407),a=r(97356);class o extends n.ActorContextPreprocess{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){if(e.context.get(i.KeysInitQuery.querySourcesUnidentified)&&!e.context.get(i.KeysRdfUpdateQuads.destination)){const t=e.context.get(i.KeysInitQuery.querySourcesUnidentified);if(1===t.length)return{context:e.context.set(i.KeysRdfUpdateQuads.destination,t[0])}}return e}}t.ActorContextPreprocessSourceToDestination=o},46154:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(30020),t)},30985:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorDereferenceFallback=void 0;const n=r(10698),i=r(97356);class a extends n.ActorDereference{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){return this.handleDereferenceErrors(e,new Error(`Could not dereference '${e.url}'`))}}t.ActorDereferenceFallback=a},68490:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(30985),t)},59404:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorDereferenceHttp=void 0;const n=r(95852);class i extends n.ActorDereferenceHttpBase{getMaxAcceptHeaderLength(){return this.maxAcceptHeaderLengthBrowser}}t.ActorDereferenceHttp=i},95852:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorDereferenceHttpBase=void 0,t.mediaTypesToAcceptString=d;const n=r(10698),i=r(62034),a=r(97356),o=r(31759),s=r(9929),c=r(73587),u=/^[^ ;]*/u,l=/version=([^ ;]*)/u;function d(e,t){const r=[],n=Object.entries(e).map((([e,t])=>({mediaType:e,priority:t}))).sort(((e,t)=>t.priority===e.priority?e.mediaType.localeCompare(t.mediaType):t.priority-e.priority));let i=n.length-1;for(const{mediaType:e,priority:a}of n){const n=e+(1===a?"":`;q=${a.toFixed(3).replace(/0*$/u,"")}`);if(i+n.length>t){for(;i+9>t;)i-=(r.pop()??"").length+1;r.push("*/*;q=0.1");break}r.push(n),i+=n.length}return 0===r.length?"*/*":r.join(",")}class p extends n.ActorDereference{mediatorHttp;maxAcceptHeaderLength;maxAcceptHeaderLengthBrowser;constructor(e){super(e),this.mediatorHttp=e.mediatorHttp,this.maxAcceptHeaderLength=e.maxAcceptHeaderLength,this.maxAcceptHeaderLengthBrowser=e.maxAcceptHeaderLengthBrowser}async test({url:e}){return/^https?:/u.test(e)?(0,a.passTestVoid)():(0,a.failTest)(`Cannot retrieve ${e} because it is not an HTTP(S) URL.`)}async run(e){let t=!0;const r=this.getMaxAcceptHeaderLength(),a=await p.establishAcceptHeader(e,r);let d;const h=Date.now();try{d=await this.mediatorHttp.mediate({context:e.context,init:{headers:a,method:e.method},input:e.url})}catch(t){return this.handleDereferenceErrors(e,t)}const f=(0,s.resolve)(d.url,e.url),y=Date.now()-h;if(200!==d.status){t=!1;const r=d.body?await(0,o.stringify)(i.ActorHttp.toNodeReadable(d.body)):"empty response";if(!e.acceptErrors){const t=new Error(`Could not retrieve ${e.url} (HTTP status ${d.status}):\n${r}`);return this.handleDereferenceErrors(e,t,d.headers,y)}}const m=d.headers.get("content-type")??"",g=u.exec(m)?.[0],b=l.exec(m)?.[1];return{url:f,data:t?i.ActorHttp.toNodeReadable(d.body):(0,n.emptyReadable)(),exists:t,requestTime:y,status:d.status,headers:d.headers,mediaType:"text/plain"===g||"application/octet-stream"===g?void 0:g,version:b,cachePolicy:d.cachePolicy?new c.DereferenceCachePolicyHttpWrapper(d.cachePolicy,r):void 0}}static async establishAcceptHeader(e,t){const r=new Headers(e.headers);return r.append("Accept",d(await(e.mediaTypes?.())??{},t)),r}}t.ActorDereferenceHttpBase=p},73587:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DereferenceCachePolicyHttpWrapper=void 0;const n=r(95852);class i{cachePolicy;maxAcceptHeaderLength;constructor(e,t){this.cachePolicy=e,this.maxAcceptHeaderLength=t}storable(){return this.cachePolicy.storable()}async satisfiesWithoutRevalidation(e){return this.cachePolicy.satisfiesWithoutRevalidation({input:e.url,init:{headers:await n.ActorDereferenceHttpBase.establishAcceptHeader(e,this.maxAcceptHeaderLength),method:e.method},context:e.context})}responseHeaders(){return this.cachePolicy.responseHeaders()}timeToLive(){return this.cachePolicy.timeToLive()}async revalidationHeaders(e){return this.cachePolicy.revalidationHeaders({input:e.url,init:{headers:await n.ActorDereferenceHttpBase.establishAcceptHeader(e,this.maxAcceptHeaderLength),method:e.method},context:e.context})}async revalidatedPolicy(e,t){const r=await this.cachePolicy.revalidatedPolicy({input:e.url,init:{headers:await n.ActorDereferenceHttpBase.establishAcceptHeader(e,this.maxAcceptHeaderLength),method:e.method},context:e.context},t);return{policy:new i(r.policy,this.maxAcceptHeaderLength),modified:r.modified,matches:r.matches}}}t.DereferenceCachePolicyHttpWrapper=i},43888:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(59404),t),i(r(95852),t),i(r(73587),t)},93464:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorDereferenceRdfParse=void 0;const n=r(69227);class i extends n.ActorDereferenceRdf{constructor(e){super(e)}async getMetadata(e){return{baseIRI:e.baseIRI??e.url,version:e.version}}}t.ActorDereferenceRdfParse=i},32934:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(93464),t)},28783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorExpressionEvaluatorFactoryDefault=void 0;const n=r(26867),i=r(72407),a=r(97356),o=r(23814),s=r(12233),c=r(7039),u=r(6413);class l extends n.ActorExpressionEvaluatorFactory{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){const t=(0,s.prepareEvaluatorActionContext)(e.context);return new u.ExpressionEvaluator(t,await new c.AlgebraTransformer(t,this.mediatorFunctionFactory).transformAlgebra(e.algExpr),this.mediatorFunctionFactory,this.mediatorQueryOperation,await o.BindingsFactory.create(this.mediatorMergeBindingsContext,e.context,e.context.getSafe(i.KeysInitQuery.dataFactory)))}}t.ActorExpressionEvaluatorFactoryDefault=l},7039:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;othis.transformAlgebra(e))));if(!r.checkArity(n))throw new u.InvalidArity(n,e);return new u.Operator(e,n,r.apply)}async transformOperator(e){return this.getOperator(e.operator.toLowerCase(),e)}async transformNamed(e){return this.getOperator(e.name.value,e)}static transformAggregate(e){const t=e.aggregator;return new u.Aggregate(t,e)}static transformExistence(e){return new u.Existence(e)}}t.AlgebraTransformer=l},6413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionEvaluator=void 0;const n=r(72407),i=r(720);t.ExpressionEvaluator=class{context;expr;mediatorFunctionFactory;mediatorQueryOperation;bindingsFactory;internalEvaluator;constructor(e,t,r,n,a){this.context=e,this.expr=t,this.mediatorFunctionFactory=r,this.mediatorQueryOperation=n,this.bindingsFactory=a,this.internalEvaluator=new i.InternalEvaluator(e,r,n,a)}async evaluate(e){return(await this.internalEvaluator.evaluatorExpressionEvaluation(this.expr,e)).toRDF(this.context.getSafe(n.KeysInitQuery.dataFactory))}async evaluateAsEBV(e){return(await this.internalEvaluator.evaluatorExpressionEvaluation(this.expr,e)).coerceEBV()}evaluateAsEvaluatorExpression(e){return this.evaluatorExpressionEvaluation(this.expr,e)}evaluatorExpressionEvaluation(e,t){return this.internalEvaluator.evaluatorExpressionEvaluation(e,t)}}},720:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;othis.term(e),[c.ExpressionType.Variable]:(e,t)=>this.variable(e,t),[c.ExpressionType.Operator]:(e,t)=>this.evalFunction(e,t),[c.ExpressionType.Existence]:(e,t)=>this.evalExistence(e,t),[c.ExpressionType.Aggregate]:(e,t)=>this.evalAggregate()};constructor(e,t,r,n){this.context=e,this.mediatorQueryOperation=r,this.bindingsFactory=n,this.transformer=new p.AlgebraTransformer(e,t)}async evaluatorExpressionEvaluation(e,t){return this.subEvaluators[e.expressionType].bind(this)(e,t)}term(e){return e}variable(e,t){const r=t.get(l.expressionToVar(this.context.getSafe(s.KeysInitQuery.dataFactory),e));if(!r)throw new l.UnboundVariableError(e.name,t);return this.transformer.transformRDFTermUnsafe(r)}async evalFunction(e,t){return e.apply({args:e.args,mapping:t,exprEval:this})}async evalExistence(e,t){const r=this.context.getSafe(s.KeysInitQuery.dataFactory),n=new u.AlgebraFactory(r),i=(0,d.materializeOperation)(e.expression.input,t,n,this.bindingsFactory),a=await this.mediatorQueryOperation.mediate({operation:i,context:this.context}),o=(0,d.getSafeBindings)(a);return await new Promise(((e,t)=>{o.bindingsStream.on("end",(()=>{e(!1)})),o.bindingsStream.on("error",t),o.bindingsStream.on("data",(()=>{o.bindingsStream.close(),e(!0)}))})).then((t=>e.expression.not?!t:t)).then((e=>new l.BooleanLiteral(e)))}evalAggregate(){throw new l.NoAggregator}}},21226:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(28783),t)},53205:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionBnode=void 0;const n=r(79345),i=r(12233),a=r(17238);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.BNODE],termFunction:!1})}async run(e){return new a.ExpressionFunctionBnode}}t.ActorFunctionFactoryExpressionBnode=o},17238:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionBnode=void 0;const n=r(79345),i=r(72407),a=r(98080),o=r(12233);class s extends n.ExpressionFunctionBase{static bnodeTree=(0,o.declare)(o.SparqlOperator.BNODE).onString1((()=>e=>e)).collect();static bnodeCounter=0;constructor(){super({arity:Number.POSITIVE_INFINITY,operator:o.SparqlOperator.BNODE,apply:async e=>{const{args:t,mapping:r,exprEval:n}=e,c=1===t.length?await n.evaluatorExpressionEvaluation(t[0],r):void 0;let u;if(c){const e=s.bnodeTree.search([c],n.context.getSafe(i.KeysExpressionEvaluator.superTypeProvider),n.context.getSafe(i.KeysInitQuery.functionArgumentsCache));if(!e)throw new o.InvalidArgumentTypes(t,o.SparqlOperator.BNODE);u=e(n)([c]).str()}const l=new a.BlankNodeBindingsScoped(u??"BNODE_"+s.bnodeCounter++);return new o.BlankNode(l)}})}checkArity(e){return 0===e.length||1===e.length}}t.ExpressionFunctionBnode=s},35670:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(53205),t)},629:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionBound=void 0;const n=r(79345),i=r(12233),a=r(31154);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.BOUND],termFunction:!1})}async run(e){return new a.ExpressionFunctionBound}}t.ActorFunctionFactoryExpressionBound=o},31154:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionBound=void 0;const n=r(79345),i=r(72407),a=r(38548),o=r(12233);class s extends n.ExpressionFunctionBase{constructor(){super({arity:1,operator:o.SparqlOperator.BOUND,apply:async({args:e,mapping:t,exprEval:r})=>{const n=e[0];if(n.expressionType!==a.ExpressionType.Variable)throw new o.InvalidArgumentTypes(e,o.SparqlOperator.BOUND);const s=t.has((0,o.expressionToVar)(r.context.getSafe(i.KeysInitQuery.dataFactory),n));return(0,o.bool)(s)}})}}t.ExpressionFunctionBound=s},42096:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(629),t)},29751:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionCoalesce=void 0;const n=r(79345),i=r(12233),a=r(84650);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.COALESCE],termFunction:!1})}async run(e){return new a.ExpressionFunctionCoalesce}}t.ActorFunctionFactoryExpressionCoalesce=o},84650:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionCoalesce=void 0;const n=r(79345),i=r(12233);class a extends n.ExpressionFunctionBase{constructor(){super({arity:Number.POSITIVE_INFINITY,operator:i.SparqlOperator.COALESCE,apply:async({args:e,mapping:t,exprEval:r})=>{const n=[];for(const i of e)try{return await r.evaluatorExpressionEvaluation(i,t)}catch(e){n.push(e)}throw new i.CoalesceError(n)}})}}t.ExpressionFunctionCoalesce=a},33243:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(29751),t)},13765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionConcat=void 0;const n=r(79345),i=r(12233),a=r(52528);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.CONCAT],termFunction:!1})}async run(e){return new a.ExpressionFunctionConcat}}t.ActorFunctionFactoryExpressionConcat=o},52528:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionConcat=void 0;const n=r(79345),i=r(72407),a=r(12233),o=r(84530);class s extends n.ExpressionFunctionBase{constructor(){super({arity:Number.POSITIVE_INFINITY,operator:a.SparqlOperator.CONCAT,apply:async e=>{const{args:t,mapping:r,exprEval:n}=e,c=t.map((async e=>n.evaluatorExpressionEvaluation(e,r))).map((async e=>{const r=s.concatTree.search([await e],n.context.getSafe(i.KeysExpressionEvaluator.superTypeProvider),n.context.getSafe(i.KeysInitQuery.functionArgumentsCache));if(!r)throw new a.InvalidArgumentTypes(t,a.SparqlOperator.CONCAT);return r(n)([await e])})),u=await Promise.all(c),l=u.map((e=>e.typedValue)).join(""),d=s.langAllEqual(u)?u[0].language:void 0,p=s.dirAllEqual(u)?u[0].direction:void 0;return d?p?(0,o.dirLangString)(l,d,p):(0,a.langString)(l,d):(0,a.string)(l)}})}static concatTree=(0,a.declare)(a.SparqlOperator.CONCAT).onStringly1((()=>e=>e)).collect();static langAllEqual(e){return e.length>0&&e.every((t=>t.language===e[0].language))}static dirAllEqual(e){return e.length>0&&e.every((t=>t.direction===e[0].direction))}}t.ExpressionFunctionConcat=s},56608:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(13765),t)},91309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionExtensions=void 0;const n=r(79345),i=r(72407),a=r(97356),o=r(18050),s=r(2142);class c extends n.ActorFunctionFactory{constructor(e){super(e)}async test({context:e,functionName:t}){const r=e.getSafe(i.KeysExpressionEvaluator.extensionFunctionCreator);return await r((new o.DataFactory).namedNode(t))?(0,a.passTestVoid)():(0,a.failTest)(`Actor ${this.name} can only provide non-termExpression implementations for functions that are provided through config entries like: ${i.KeysInitQuery.extensionFunctionCreator.name} or ${i.KeysInitQuery.extensionFunctions.name}`)}async run({context:e,functionName:t}){const r=e.getSafe(i.KeysExpressionEvaluator.extensionFunctionCreator),n=await r((new o.DataFactory).namedNode(t));return new s.NamedExtension({operator:t,functionDefinition:n})}}t.ActorFunctionFactoryExpressionExtensions=c},2142:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NamedExtension=void 0;const n=r(58537),i=r(72407),a=r(12233);class o extends n.ExpressionFunctionBase{constructor({operator:e,functionDefinition:t}){super({arity:Number.POSITIVE_INFINITY,operator:e,apply:async({args:e,exprEval:r,mapping:n})=>{const o=await Promise.all(e.map((e=>r.evaluatorExpressionEvaluation(e,n))));try{return new a.TermTransformer(r.context.getSafe(i.KeysExpressionEvaluator.superTypeProvider)).transformRDFTermUnsafe(await t(o.map((e=>e.toRDF(r.context.getSafe(i.KeysInitQuery.dataFactory))))))}catch(e){throw new a.ExtensionFunctionError(this.operator,e)}}})}}t.NamedExtension=o},9070:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(91309),t)},18803:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionIf=void 0;const n=r(79345),i=r(12233),a=r(1574);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.IF],termFunction:!1})}async run(e){return new a.ExpressionFunctionIf}}t.ActorFunctionFactoryExpressionIf=o},1574:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionIf=void 0;const n=r(79345),i=r(12233);class a extends n.ExpressionFunctionBase{constructor(){super({arity:3,operator:i.SparqlOperator.IF,apply:async({args:e,mapping:t,exprEval:r})=>(await r.evaluatorExpressionEvaluation(e[0],t)).coerceEBV()?r.evaluatorExpressionEvaluation(e[1],t):r.evaluatorExpressionEvaluation(e[2],t)})}}t.ExpressionFunctionIf=a},17055:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(18803),t)},31155:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionIn=void 0;const n=r(79345),i=r(12233),a=r(64758);class o extends n.ActorFunctionFactoryDedicated{mediatorFunctionFactory;constructor(e){super({...e,functionNames:[i.SparqlOperator.IN],termFunction:!1}),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async run(e){const t=await this.mediatorFunctionFactory.mediate({functionName:i.SparqlOperator.EQUAL,requireTermExpression:!0,context:e.context,arguments:e.arguments});return new a.ExpressionFunctionIn(t)}}t.ActorFunctionFactoryExpressionIn=o},64758:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionIn=void 0;const n=r(79345),i=r(12233);class a extends n.ExpressionFunctionBase{equalityFunction;constructor(e){super({arity:Number.POSITIVE_INFINITY,operator:i.SparqlOperator.IN,apply:async e=>{const{args:t,mapping:r,exprEval:n}=e,[i,...a]=t,o=await n.evaluatorExpressionEvaluation(i,r);return await this.inRecursive(o,{...e,args:a},[])}}),this.equalityFunction=e}checkArity(e){return e.length>0}async inRecursive(e,t,r){const{args:n,mapping:a,exprEval:o}=t;if(0===n.length)return r.every((e=>!e))?(0,i.bool)(!1):Promise.reject(new i.InError(r));try{const s=n.shift(),c=await o.evaluatorExpressionEvaluation(s,a);return this.equalityFunction.applyOnTerms([e,c],o).typedValue?(0,i.bool)(!0):this.inRecursive(e,t,[...r,!1])}catch(n){return this.inRecursive(e,t,[...r,n])}}}t.ExpressionFunctionIn=a},35303:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(31155),t)},66824:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionLogicalAnd=void 0;const n=r(79345),i=r(12233),a=r(9861);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.LOGICAL_AND],termFunction:!1})}async run(e){return new a.ExpressionFunctionLogicalAnd}}t.ActorFunctionFactoryExpressionLogicalAnd=o},9861:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionLogicalAnd=void 0;const n=r(79345),i=r(12233);class a extends n.ExpressionFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.LOGICAL_AND,apply:async({args:e,mapping:t,exprEval:r})=>{const[n,a]=e;try{if(!(await r.evaluatorExpressionEvaluation(n,t)).coerceEBV())return(0,i.bool)(!1);const e=(await r.evaluatorExpressionEvaluation(a,t)).coerceEBV();return(0,i.bool)(e)}catch(e){if((await r.evaluatorExpressionEvaluation(a,t)).coerceEBV())throw e;return(0,i.bool)(!1)}}})}}t.ExpressionFunctionLogicalAnd=a},15907:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(66824),t)},61336:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionLogicalOr=void 0;const n=r(79345),i=r(12233),a=r(65907);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.LOGICAL_OR],termFunction:!1})}async run(e){return new a.ExpressionFunctionLogicalOr}}t.ActorFunctionFactoryExpressionLogicalOr=o},65907:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionLogicalOr=void 0;const n=r(79345),i=r(12233);class a extends n.ExpressionFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.LOGICAL_OR,apply:async({args:e,mapping:t,exprEval:r})=>{const[n,a]=e;try{if((await r.evaluatorExpressionEvaluation(n,t)).coerceEBV())return(0,i.bool)(!0);const e=(await r.evaluatorExpressionEvaluation(a,t)).coerceEBV();return(0,i.bool)(e)}catch(e){if(!(await r.evaluatorExpressionEvaluation(a,t)).coerceEBV())throw e;return(0,i.bool)(!0)}}})}}t.ExpressionFunctionLogicalOr=a},30119:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(61336),t)},98632:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionNotIn=void 0;const n=r(79345),i=r(12233),a=r(70767);class o extends n.ActorFunctionFactoryDedicated{mediatorFunctionFactory;constructor(e){super({...e,functionNames:[i.SparqlOperator.NOT_IN],termFunction:!1}),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async run(e){const t=await this.mediatorFunctionFactory.mediate({functionName:i.SparqlOperator.IN,context:e.context,arguments:e.arguments});return new a.ExpressionFunctionNotIn(t)}}t.ActorFunctionFactoryExpressionNotIn=o},70767:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionNotIn=void 0;const n=r(79345),i=r(12233);class a extends n.ExpressionFunctionBase{inFunction;constructor(e){super({arity:Number.POSITIVE_INFINITY,operator:i.SparqlOperator.NOT_IN,apply:async e=>{const t=await this.inFunction.apply(e);return(0,i.bool)(!t.typedValue)}}),this.inFunction=e}checkArity(e){return e.length>0}}t.ExpressionFunctionNotIn=a},76923:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(98632),t)},2076:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionSameTerm=void 0;const n=r(79345),i=r(12233),a=r(99197);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SAME_TERM],termFunction:!1})}async run(e){return new a.ExpressionFunctionSameTerm}}t.ActorFunctionFactoryExpressionSameTerm=o},99197:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionSameTerm=void 0;const n=r(79345),i=r(72407),a=r(12233);class o extends n.ExpressionFunctionBase{constructor(){super({arity:2,operator:a.SparqlOperator.SAME_TERM,apply:async({args:e,mapping:t,exprEval:r})=>{const n=r.context.getSafe(i.KeysInitQuery.dataFactory),[o,s]=e.map((e=>r.evaluatorExpressionEvaluation(e,t))),[c,u]=await Promise.all([o,s]);return(0,a.bool)(c.toRDF(n).equals(u.toRDF(n)))}})}}t.ExpressionFunctionSameTerm=o},64915:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(2076),t)},80693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermAbs=void 0;const n=r(79345),i=r(12233),a=r(80678);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.ABS],termFunction:!0})}async run(e){return new a.TermFunctionAbs}}t.ActorFunctionFactoryTermAbs=o},80678:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionAbs=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.ABS,overloads:(0,i.declare)(i.SparqlOperator.ABS).numericConverter((()=>e=>Math.abs(e))).collect()})}}t.TermFunctionAbs=a},95108:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(80693),t)},61313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermAddition=void 0;const n=r(79345),i=r(12233),a=r(34564);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.ADDITION],termFunction:!0})}async run(e){return new a.TermFunctionAddition}}t.ActorFunctionFactoryTermAddition=o},34564:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionAddition=void 0;const n=r(79345),i=r(12233),a=r(86382);class o extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.ADDITION,overloads:(0,i.declare)(i.SparqlOperator.ADDITION).arithmetic((()=>(e,t)=>new a.BigNumber(e).plus(t).toNumber())).set([i.TypeURL.XSD_DATE_TIME,i.TypeURL.XSD_DAY_TIME_DURATION],(()=>([e,t])=>new i.DateTimeLiteral((0,i.addDurationToDateTime)(e.typedValue,(0,i.defaultedDurationRepresentation)(t.typedValue))))).copy({from:[i.TypeURL.XSD_DATE_TIME,i.TypeURL.XSD_DAY_TIME_DURATION],to:[i.TypeURL.XSD_DATE_TIME,i.TypeURL.XSD_YEAR_MONTH_DURATION]}).set([i.TypeURL.XSD_DATE,i.TypeURL.XSD_DAY_TIME_DURATION],(()=>([e,t])=>new i.DateLiteral((0,i.addDurationToDateTime)((0,i.defaultedDateTimeRepresentation)(e.typedValue),(0,i.defaultedDurationRepresentation)(t.typedValue))))).copy({from:[i.TypeURL.XSD_DATE,i.TypeURL.XSD_DAY_TIME_DURATION],to:[i.TypeURL.XSD_DATE,i.TypeURL.XSD_YEAR_MONTH_DURATION]}).set([i.TypeURL.XSD_TIME,i.TypeURL.XSD_DAY_TIME_DURATION],(()=>([e,t])=>new i.TimeLiteral((0,i.addDurationToDateTime)((0,i.defaultedDateTimeRepresentation)(e.typedValue),(0,i.defaultedDurationRepresentation)(t.typedValue))))).copy({from:[i.TypeURL.XSD_TIME,i.TypeURL.XSD_DAY_TIME_DURATION],to:[i.TypeURL.XSD_TIME,i.TypeURL.XSD_YEAR_MONTH_DURATION]}).collect()})}}t.TermFunctionAddition=o},30564:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(61313),t)},71823:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermCeil=void 0;const n=r(79345),i=r(12233),a=r(27018);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.CEIL],termFunction:!0})}async run(e){return new a.TermFunctionCeil}}t.ActorFunctionFactoryTermCeil=o},27018:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionCeil=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.CEIL,overloads:(0,i.declare)(i.SparqlOperator.CEIL).numericConverter((()=>e=>Math.ceil(e))).collect()})}}t.TermFunctionCeil=a},2345:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(71823),t)},6359:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermContains=void 0;const n=r(79345),i=r(12233),a=r(63354);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.CONTAINS],termFunction:!0})}async run(e){return new a.TermFunctionContains}}t.ActorFunctionFactoryTermContains=o},63354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionContains=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.CONTAINS,overloads:(0,i.declare)(i.SparqlOperator.CONTAINS).onCompatibleStringly2Typed((()=>(e,t)=>(0,i.bool)(e.includes(t)))).collect()})}}t.TermFunctionContains=a},13969:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6359),t)},13249:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermDatatype=void 0;const n=r(79345),i=r(12233),a=r(52192);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.DATATYPE],termFunction:!0})}async run(e){return new a.TermFunctionDatatype}}t.ActorFunctionFactoryTermDatatype=o},52192:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionDatatype=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.DATATYPE,overloads:(0,i.declare)(i.SparqlOperator.DATATYPE).onLiteral1((()=>e=>new i.NamedNode(e.dataType))).collect()})}}t.TermFunctionDatatype=a},69532:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(13249),t)},76961:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermDay=void 0;const n=r(79345),i=r(12233),a=r(54422);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.DAY],termFunction:!0})}async run(e){return new a.TermFunctionDay}}t.ActorFunctionFactoryTermDay=o},54422:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionDay=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.DAY,overloads:(0,i.declare)(i.SparqlOperator.DAY).onDateTime1((()=>e=>(0,i.integer)(e.typedValue.day))).set([i.TypeURL.XSD_DATE],(()=>([e])=>(0,i.integer)(e.typedValue.day))).collect()})}}t.TermFunctionDay=a},84706:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(76961),t)},16187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermDivision=void 0;const n=r(79345),i=r(12233),a=r(86662);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.DIVISION],termFunction:!0})}async run(e){return new a.TermFunctionDivision}}t.ActorFunctionFactoryTermDivision=o},86662:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionDivision=void 0;const n=r(79345),i=r(12233),a=r(86382);class o extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.DIVISION,overloads:(0,i.declare)(i.SparqlOperator.DIVISION).arithmetic((()=>(e,t)=>new a.BigNumber(e).div(t).toNumber())).onBinaryTyped([i.TypeURL.XSD_INTEGER,i.TypeURL.XSD_INTEGER],(()=>(e,t)=>{if(0===t)throw new i.ExpressionError("Integer division by 0");return(0,i.decimal)(new a.BigNumber(e).div(t).toNumber())})).collect()})}}t.TermFunctionDivision=o},45743:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(16187),t)},57221:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermEncodeForUri=void 0;const n=r(79345),i=r(12233),a=r(66744);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.ENCODE_FOR_URI],termFunction:!0})}async run(e){return new a.TermFunctionEncodeForUri}}t.ActorFunctionFactoryTermEncodeForUri=o},66744:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionEncodeForUri=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.ENCODE_FOR_URI,overloads:(0,i.declare)(i.SparqlOperator.ENCODE_FOR_URI).onStringly1Typed((()=>e=>(0,i.string)(encodeURI(e)))).collect()})}}t.TermFunctionEncodeForUri=a},443:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(57221),t)},55609:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermEquality=void 0;const n=r(79345),i=r(12233),a=r(62072);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.EQUAL],termFunction:!0})}async run(e){return new a.TermFunctionEquality}}t.ActorFunctionFactoryTermEquality=o},62072:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionEquality=void 0;const n=r(79345),i=r(72407),a=r(12233);class o extends n.TermFunctionBase{constructor(){super({arity:2,operator:a.SparqlOperator.EQUAL,overloads:(0,a.declare)(a.SparqlOperator.EQUAL).numberTest((()=>(e,t)=>e===t)).stringTest((()=>(e,t)=>0===e.localeCompare(t))).set([a.TypeURL.RDF_LANG_STRING,a.TypeURL.RDF_LANG_STRING],(()=>([e,t])=>(0,a.bool)(e.str()===t.str()&&e.language===t.language))).set([a.TypeAlias.SPARQL_STRINGLY,a.TypeAlias.SPARQL_STRINGLY],(()=>()=>(0,a.bool)(!1))).booleanTest((()=>(e,t)=>e===t)).dateTimeTest((e=>(t,r)=>(0,a.toUTCDate)(t,e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)).getTime()===(0,a.toUTCDate)(r,e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)).getTime())).copy({from:[a.TypeURL.XSD_DATE_TIME,a.TypeURL.XSD_DATE_TIME],to:[a.TypeURL.XSD_DATE,a.TypeURL.XSD_DATE]}).set(["quad","quad"],(e=>([t,r])=>(0,a.bool)(this.applyOnTerms([t.subject,r.subject],e).coerceEBV()&&this.applyOnTerms([t.predicate,r.predicate],e).coerceEBV()&&this.applyOnTerms([t.object,r.object],e).coerceEBV()&&this.applyOnTerms([t.graph,r.graph],e).coerceEBV())),!1).set(["term","term"],(e=>([t,r])=>{const n=t.toRDF(e.context.getSafe(i.KeysInitQuery.dataFactory)),o=r.toRDF(e.context.getSafe(i.KeysInitQuery.dataFactory)),s=n.equals(o);if(!s&&"Literal"===n.termType&&"Literal"===o.termType)throw new a.RDFEqualTypeError([t,r]);return(0,a.bool)(s)}),!1).set([a.TypeURL.XSD_DURATION,a.TypeURL.XSD_DURATION],(()=>([e,t])=>(0,a.bool)((0,a.yearMonthDurationsToMonths)((0,a.defaultedYearMonthDurationRepresentation)(e.typedValue))===(0,a.yearMonthDurationsToMonths)((0,a.defaultedYearMonthDurationRepresentation)(t.typedValue))&&(0,a.dayTimeDurationsToSeconds)((0,a.defaultedDayTimeDurationRepresentation)(e.typedValue))===(0,a.dayTimeDurationsToSeconds)((0,a.defaultedDayTimeDurationRepresentation)(t.typedValue))))).set([a.TypeURL.XSD_TIME,a.TypeURL.XSD_TIME],(e=>([t,r])=>(0,a.bool)((0,a.toUTCDate)((0,a.defaultedDateTimeRepresentation)(t.typedValue),e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)).getTime()===(0,a.toUTCDate)((0,a.defaultedDateTimeRepresentation)(r.typedValue),e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)).getTime()))).collect()})}}t.TermFunctionEquality=o},78392:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(55609),t)},6425:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermFloor=void 0;const n=r(79345),i=r(12233),a=r(57450);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.FLOOR],termFunction:!0})}async run(e){return new a.TermFunctionFloor}}t.ActorFunctionFactoryTermFloor=o},57450:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionFloor=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.FLOOR,overloads:(0,i.declare)(i.SparqlOperator.FLOOR).numericConverter((()=>e=>Math.floor(e))).collect()})}}t.TermFunctionFloor=a},1198:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6425),t)},14591:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermGreaterThanEqual=void 0;const n=r(79345),i=r(12233),a=r(36946);class o extends n.ActorFunctionFactoryDedicated{mediatorFunctionFactory;constructor(e){super({...e,functionNames:[i.SparqlOperator.GTE],termFunction:!0}),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async run(e){const t=await this.mediatorFunctionFactory.mediate({functionName:i.SparqlOperator.LTE,requireTermExpression:!0,context:e.context,arguments:e.arguments});return new a.TermFunctionGreaterThanEqual(t)}}t.ActorFunctionFactoryTermGreaterThanEqual=o},36946:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionGreaterThanEqual=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{lessThanEqualFunction;constructor(e){super({arity:2,operator:i.SparqlOperator.GTE,overloads:(0,i.declare)(i.SparqlOperator.GTE).set(["term","term"],(e=>([t,r])=>this.lessThanEqualFunction.applyOnTerms([r,t],e))).collect()}),this.lessThanEqualFunction=e}}t.TermFunctionGreaterThanEqual=a},61127:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(14591),t)},39270:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermGreaterThan=void 0;const n=r(79345),i=r(12233),a=r(30501);class o extends n.ActorFunctionFactoryDedicated{mediatorFunctionFactory;constructor(e){super({...e,functionNames:[i.SparqlOperator.GT],termFunction:!0}),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async run(e){const t=await this.mediatorFunctionFactory.mediate({functionName:i.SparqlOperator.LT,requireTermExpression:!0,context:e.context,arguments:e.arguments});return new a.TermFunctionGreaterThan(t)}}t.ActorFunctionFactoryTermGreaterThan=o},30501:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionGreaterThan=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{lessThanFunction;constructor(e){super({arity:2,operator:i.SparqlOperator.GT,overloads:(0,i.declare)(i.SparqlOperator.GT).set(["term","term"],(e=>([t,r])=>this.lessThanFunction.applyOnTerms([r,t],e))).collect()}),this.lessThanFunction=e}}t.TermFunctionGreaterThan=a},63582:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(39270),t)},99526:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermHasLang=void 0;const n=r(79345),i=r(12233),a=r(95229);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.HAS_LANG],termFunction:!0})}async run(e){return new a.TermFunctionHasLang}}t.ActorFunctionFactoryTermHasLang=o},95229:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionHasLang=void 0;const n=r(79345),i=r(12233),a=r(58769);class o extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.HAS_LANG,overloads:(0,i.declare)(i.SparqlOperator.HAS_LANG).onTerm1((()=>e=>(0,i.bool)(e instanceof i.LangStringLiteral||e instanceof a.DirLangStringLiteral))).collect()})}}t.TermFunctionHasLang=o},42875:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(99526),t)},92688:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermHasLangdir=void 0;const n=r(79345),i=r(12233),a=r(94345);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.HAS_LANGDIR],termFunction:!0})}async run(e){return new a.TermFunctionHasLangdir}}t.ActorFunctionFactoryTermHasLangdir=o},94345:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionHasLangdir=void 0;const n=r(79345),i=r(12233),a=r(58769);class o extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.HAS_LANGDIR,overloads:(0,i.declare)(i.SparqlOperator.HAS_LANGDIR).onTerm1((()=>e=>(0,i.bool)(e instanceof a.DirLangStringLiteral))).collect()})}}t.TermFunctionHasLangdir=o},47998:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(92688),t)},65089:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermHours=void 0;const n=r(79345),i=r(12233),a=r(82486);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.HOURS],termFunction:!0})}async run(e){return new a.TermFunctionHours}}t.ActorFunctionFactoryTermHours=o},82486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionHours=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.HOURS,overloads:(0,i.declare)(i.SparqlOperator.HOURS).onDateTime1((()=>e=>(0,i.integer)(e.typedValue.hours))).set([i.TypeURL.XSD_TIME],(()=>([e])=>(0,i.integer)(e.typedValue.hours))).collect()})}}t.TermFunctionHours=a},60707:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(65089),t)},57947:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermInequality=void 0;const n=r(79345),i=r(12233),a=r(93978);class o extends n.ActorFunctionFactoryDedicated{mediatorFunctionFactory;constructor(e){super({...e,functionNames:[i.SparqlOperator.NOT_EQUAL],termFunction:!0}),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async run(e){const t=await this.mediatorFunctionFactory.mediate({functionName:i.SparqlOperator.EQUAL,requireTermExpression:!0,context:e.context,arguments:e.arguments});return new a.TermFunctionInequality(t)}}t.ActorFunctionFactoryTermInequality=o},93978:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionInequality=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{equalityFunction;constructor(e){super({arity:2,operator:i.SparqlOperator.NOT_EQUAL,overloads:(0,i.declare)(i.SparqlOperator.NOT_EQUAL).set(["term","term"],(e=>([t,r])=>(0,i.bool)(!this.equalityFunction.applyOnTerms([t,r],e).typedValue))).collect()}),this.equalityFunction=e}}t.TermFunctionInequality=a},22775:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(57947),t)},37161:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermIri=void 0;const n=r(79345),i=r(12233),a=r(30550);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.IRI,i.SparqlOperator.URI],termFunction:!0})}async run(e){return new a.TermFunctionIri}}t.ActorFunctionFactoryTermIri=o},30550:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionIri=void 0;const n=r(79345),i=r(72407),a=r(12233),o=r(9929);class s extends n.TermFunctionBase{constructor(){super({arity:1,operator:a.SparqlOperator.IRI,overloads:(0,a.declare)(a.SparqlOperator.IRI).set(["namedNode"],(e=>t=>{const r=t[0],n=(0,o.resolve)(r.str(),e.context.get(i.KeysInitQuery.baseIRI)??"");return new a.NamedNode(n)})).onString1((e=>t=>{const r=(0,o.resolve)(t.str(),e.context.get(i.KeysInitQuery.baseIRI)??"");return new a.NamedNode(r)})).collect()})}}t.TermFunctionIri=s},19982:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(37161),t)},61128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermIsBlank=void 0;const n=r(79345),i=r(12233),a=r(73227);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.IS_BLANK],termFunction:!0})}async run(e){return new a.TermFunctionIsBlank}}t.ActorFunctionFactoryTermIsBlank=o},73227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionIsBlank=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.IS_BLANK,overloads:(0,i.declare)(i.SparqlOperator.IS_BLANK).onTerm1((()=>e=>(0,i.bool)("blankNode"===e.termType))).collect()})}}t.TermFunctionIsBlank=a},17215:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(61128),t)},92296:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermIsIri=void 0;const n=r(79345),i=r(12233),a=r(83451);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.IS_IRI,i.SparqlOperator.IS_URI],termFunction:!0})}async run(e){return new a.TermFunctionIsIri}}t.ActorFunctionFactoryTermIsIri=o},83451:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionIsIri=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.IS_IRI,overloads:(0,i.declare)(i.SparqlOperator.IS_IRI).onTerm1((()=>e=>(0,i.bool)("namedNode"===e.termType))).collect()})}}t.TermFunctionIsIri=a},3639:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(92296),t)},22604:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermIsLiteral=void 0;const n=r(79345),i=r(12233),a=r(33639);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.IS_LITERAL],termFunction:!0})}async run(e){return new a.TermFunctionIsLiteral}}t.ActorFunctionFactoryTermIsLiteral=o},33639:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionIsLiteral=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.IS_LITERAL,overloads:(0,i.declare)(i.SparqlOperator.IS_LITERAL).onTerm1((()=>e=>(0,i.bool)("literal"===e.termType))).collect()})}}t.TermFunctionIsLiteral=a},41774:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(22604),t)},69276:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermIsNumeric=void 0;const n=r(79345),i=r(12233),a=r(15303);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.IS_NUMERIC],termFunction:!0})}async run(e){return new a.TermFunctionIsNumeric}}t.ActorFunctionFactoryTermIsNumeric=o},15303:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionIsNumeric=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.IS_NUMERIC,overloads:(0,i.declare)(i.SparqlOperator.IS_NUMERIC).onNumeric1((()=>()=>(0,i.bool)(!0))).onTerm1((()=>()=>(0,i.bool)(!1))).collect()})}}t.TermFunctionIsNumeric=a},34146:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(69276),t)},53672:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermIsTriple=void 0;const n=r(79345),i=r(12233),a=r(65557);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.IS_TRIPLE],termFunction:!0})}async run(e){return new a.TermFunctionIsTriple}}t.ActorFunctionFactoryTermIsTriple=o},65557:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionIsTriple=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.IS_TRIPLE,overloads:(0,i.declare)(i.SparqlOperator.IS_TRIPLE).onTerm1((()=>e=>(0,i.bool)("quad"===e.termType))).collect()})}}t.TermFunctionIsTriple=a},36748:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(53672),t)},39321:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermLang=void 0;const n=r(79345),i=r(12233),a=r(57260);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.LANG],termFunction:!0})}async run(e){return new a.TermFunctionLang}}t.ActorFunctionFactoryTermLang=o},57260:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionLang=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.LANG,overloads:(0,i.declare)(i.SparqlOperator.LANG).onLiteral1((()=>e=>(0,i.string)(e.language??""))).collect()})}}t.TermFunctionLang=a},85576:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(39321),t)},38901:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermLangdir=void 0;const n=r(79345),i=r(12233),a=r(16390);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.LANGDIR],termFunction:!0})}async run(e){return new a.TermFunctionLangdir}}t.ActorFunctionFactoryTermLangdir=o},16390:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionLangdir=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.LANGDIR,overloads:(0,i.declare)(i.SparqlOperator.LANGDIR).onLiteral1((()=>e=>(0,i.string)(e.direction??""))).collect()})}}t.TermFunctionLangdir=a},75055:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(38901),t)},56601:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermLangmatches=void 0;const n=r(79345),i=r(12233),a=r(72538);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.LANG_MATCHES],termFunction:!0})}async run(e){return new a.TermFunctionLangmatches}}t.ActorFunctionFactoryTermLangmatches=o},72538:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionLangmatches=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.LANG_MATCHES,overloads:(0,i.declare)(i.SparqlOperator.LANG_MATCHES).onBinaryTyped([i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING],(()=>(e,t)=>(0,i.bool)(a.langMatches(e,t)))).collect()})}static langMatches(e,t){const r=e.split("-"),n=t.split("-");if(!a.matchLangTag(n[0],r[0])&&!a.isWildCard(r[0]))return!1;let i=1,o=1;for(;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermLcase=void 0;const n=r(79345),i=r(12233),a=r(27426);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.LCASE],termFunction:!0})}async run(e){return new a.TermFunctionLcase}}t.ActorFunctionFactoryTermLcase=o},27426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionLcase=void 0;const n=r(79345),i=r(12233),a=r(84530);class o extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.LCASE,overloads:(0,i.declare)(i.SparqlOperator.LCASE).onString1Typed((()=>e=>(0,i.string)(e.toLowerCase()))).onLangString1((()=>e=>(0,i.langString)(e.typedValue.toLowerCase(),e.language))).onDirLangString1((()=>e=>(0,a.dirLangString)(e.typedValue.toLowerCase(),e.language,e.direction))).collect()})}}t.TermFunctionLcase=o},90972:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(88669),t)},16793:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermLesserThanEqual=void 0;const n=r(79345),i=r(12233),a=r(72782);class o extends n.ActorFunctionFactoryDedicated{mediatorFunctionFactory;constructor(e){super({...e,functionNames:[i.SparqlOperator.LTE],termFunction:!0}),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async run(e){const t=await this.mediatorFunctionFactory.mediate({functionName:i.SparqlOperator.EQUAL,requireTermExpression:!0,context:e.context,arguments:e.arguments}),r=await this.mediatorFunctionFactory.mediate({functionName:i.SparqlOperator.LT,requireTermExpression:!0,context:e.context,arguments:e.arguments});return new a.TermFunctionLesserThanEqual(t,r)}}t.ActorFunctionFactoryTermLesserThanEqual=o},72782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionLesserThanEqual=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{equalityFunction;lessThanFunction;constructor(e,t){super({arity:2,operator:i.SparqlOperator.LTE,overloads:(0,i.declare)(i.SparqlOperator.LTE).set(["term","term"],(e=>([t,r])=>{let n;try{if(this.lessThanFunction.applyOnTerms([t,r],e).typedValue)return(0,i.bool)(!0)}catch(e){n=e}if(this.equalityFunction.applyOnTerms([t,r],e).typedValue)return(0,i.bool)(!0);if(n)throw n;return(0,i.bool)(!1)})).collect()}),this.equalityFunction=e,this.lessThanFunction=t}}t.TermFunctionLesserThanEqual=a},15307:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(16793),t)},61846:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermLesserThan=void 0;const n=r(79345),i=r(12233),a=r(94687);class o extends n.ActorFunctionFactoryDedicated{mediatorFunctionFactory;constructor(e){super({...e,functionNames:[i.SparqlOperator.LT],termFunction:!0}),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async run(e){const t=await this.mediatorFunctionFactory.mediate({functionName:i.SparqlOperator.EQUAL,requireTermExpression:!0,context:e.context,arguments:e.arguments});return new a.TermFunctionLesserThan(t)}}t.ActorFunctionFactoryTermLesserThan=o},94687:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionLesserThan=void 0;const n=r(79345),i=r(72407),a=r(12233);class o extends n.TermFunctionBase{equalityFunction;constructor(e){super({arity:2,operator:a.SparqlOperator.LT,overloads:(0,a.declare)(a.SparqlOperator.LT).numberTest((()=>(e,t)=>e(e,t)=>-1===e.localeCompare(t))).booleanTest((()=>(e,t)=>e(t,r)=>(0,a.toUTCDate)(t,e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)).getTime()<(0,a.toUTCDate)(r,e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)).getTime())).copy({from:[a.TypeURL.XSD_DATE_TIME,a.TypeURL.XSD_DATE_TIME],to:[a.TypeURL.XSD_DATE,a.TypeURL.XSD_DATE]}).set([a.TypeURL.XSD_YEAR_MONTH_DURATION,a.TypeURL.XSD_YEAR_MONTH_DURATION],(()=>([e,t])=>(0,a.bool)((0,a.yearMonthDurationsToMonths)((0,a.defaultedYearMonthDurationRepresentation)(e.typedValue))<(0,a.yearMonthDurationsToMonths)((0,a.defaultedYearMonthDurationRepresentation)(t.typedValue))))).set([a.TypeURL.XSD_DAY_TIME_DURATION,a.TypeURL.XSD_DAY_TIME_DURATION],(()=>([e,t])=>(0,a.bool)((0,a.dayTimeDurationsToSeconds)((0,a.defaultedDayTimeDurationRepresentation)(e.typedValue))<(0,a.dayTimeDurationsToSeconds)((0,a.defaultedDayTimeDurationRepresentation)(t.typedValue))))).set([a.TypeURL.XSD_TIME,a.TypeURL.XSD_TIME],(e=>([t,r])=>(0,a.bool)((0,a.toUTCDate)((0,a.defaultedDateTimeRepresentation)(t.typedValue),e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)).getTime()<(0,a.toUTCDate)((0,a.defaultedDateTimeRepresentation)(r.typedValue),e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)).getTime()))).set(["quad","quad"],(e=>([t,r])=>{const n=this.quadComponentTest(t.subject,r.subject,e);if(void 0!==n)return(0,a.bool)(n);const i=this.quadComponentTest(t.predicate,r.predicate,e);if(void 0!==i)return(0,a.bool)(i);const o=this.quadComponentTest(t.object,r.object,e);return void 0!==o?(0,a.bool)(o):(0,a.bool)(this.quadComponentTest(t.graph,r.graph,e)??!1)}),!1).collect()}),this.equalityFunction=e}quadComponentTest(e,t,r){if(!this.equalityFunction.applyOnTerms([e,t],r).typedValue)return this.applyOnTerms([e,t],r).typedValue}}t.TermFunctionLesserThan=o},57314:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(61846),t)},98069:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermMd5=void 0;const n=r(79345),i=r(12233),a=r(39610);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.MD5],termFunction:!0})}async run(e){return new a.TermFunctionMd5}}t.ActorFunctionFactoryTermMd5=o},39610:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionMd5=void 0;const n=r(79345),i=r(12233),a=r(88110);class o extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.MD5,overloads:(0,i.declare)(i.SparqlOperator.MD5).onString1Typed((()=>e=>(0,i.string)((0,a.hash)(e)))).collect()})}}t.TermFunctionMd5=o},93896:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(98069),t)},70353:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermMinutes=void 0;const n=r(79345),i=r(12233),a=r(25418);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.MINUTES],termFunction:!0})}async run(e){return new a.TermFunctionMinutes}}t.ActorFunctionFactoryTermMinutes=o},25418:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionMinutes=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.MINUTES,overloads:(0,i.declare)(i.SparqlOperator.MINUTES).onDateTime1((()=>e=>(0,i.integer)(e.typedValue.minutes))).set([i.TypeURL.XSD_TIME],(()=>([e])=>(0,i.integer)(e.typedValue.minutes))).collect()})}}t.TermFunctionMinutes=a},71561:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(70353),t)},93561:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermMonth=void 0;const n=r(79345),i=r(12233),a=r(33178);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.MONTH],termFunction:!0})}async run(e){return new a.TermFunctionMonth}}t.ActorFunctionFactoryTermMonth=o},33178:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionMonth=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.MONTH,overloads:(0,i.declare)(i.SparqlOperator.MONTH).onDateTime1((()=>e=>(0,i.integer)(e.typedValue.month))).set([i.TypeURL.XSD_DATE],(()=>([e])=>(0,i.integer)(e.typedValue.month))).collect()})}}t.TermFunctionMonth=a},15158:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(93561),t)},53489:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermMultiplication=void 0;const n=r(79345),i=r(12233),a=r(6344);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.MULTIPLICATION],termFunction:!0})}async run(e){return new a.TermFunctionMultiplication}}t.ActorFunctionFactoryTermMultiplication=o},6344:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionMultiplication=void 0;const n=r(79345),i=r(12233),a=r(86382);class o extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.MULTIPLICATION,overloads:(0,i.declare)(i.SparqlOperator.MULTIPLICATION).arithmetic((()=>(e,t)=>new a.BigNumber(e).times(t).toNumber())).collect()})}}t.TermFunctionMultiplication=o},68250:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(53489),t)},93381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermNot=void 0;const n=r(79345),i=r(12233),a=r(84122);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.NOT],termFunction:!0})}async run(e){return new a.TermFunctionNot}}t.ActorFunctionFactoryTermNot=o},84122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionNot=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.NOT,overloads:(0,i.declare)(i.SparqlOperator.NOT).onTerm1((()=>e=>(0,i.bool)(!e.coerceEBV()))).collect()})}}t.TermFunctionNot=a},32345:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(93381),t)},94153:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermNow=void 0;const n=r(79345),i=r(12233),a=r(17646);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.NOW],termFunction:!0})}async run(e){return new a.TermFunctionNow}}t.ActorFunctionFactoryTermNow=o},17646:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionNow=void 0;const n=r(79345),i=r(72407),a=r(12233);class o extends n.TermFunctionBase{constructor(){super({arity:0,operator:a.SparqlOperator.NOW,overloads:(0,a.declare)(a.SparqlOperator.NOW).set([],(e=>()=>new a.DateTimeLiteral((0,a.toDateTimeRepresentation)({date:e.context.getSafe(i.KeysInitQuery.queryTimestamp),timeZone:e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)})))).collect()})}}t.TermFunctionNow=o},41956:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(94153),t)},54211:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermObject=void 0;const n=r(79345),i=r(12233),a=r(42478);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.OBJECT],termFunction:!0})}async run(e){return new a.TermFunctionObject}}t.ActorFunctionFactoryTermObject=o},42478:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionObject=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.OBJECT,overloads:(0,i.declare)(i.SparqlOperator.OBJECT).onQuad1((()=>e=>e.object)).collect()})}}t.TermFunctionObject=a},87291:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(54211),t)},24625:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermPredicate=void 0;const n=r(79345),i=r(12233),a=r(27610);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.PREDICATE],termFunction:!0})}async run(e){return new a.TermFunctionPredicate}}t.ActorFunctionFactoryTermPredicate=o},27610:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionPredicate=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.PREDICATE,overloads:(0,i.declare)(i.SparqlOperator.PREDICATE).onQuad1((()=>e=>e.predicate)).collect()})}}t.TermFunctionPredicate=a},41761:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(24625),t)},24404:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermRand=void 0;const n=r(79345),i=r(12233),a=r(78126);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.RAND],termFunction:!0})}async run(e){return new a.TermFunctionRand}}t.ActorFunctionFactoryTermRand=o},78126:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionRand=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:0,operator:i.SparqlOperator.RAND,overloads:(0,i.declare)(i.SparqlOperator.RAND).set([],(()=>()=>(0,i.double)(Math.random()))).collect()})}}t.TermFunctionRand=a},2091:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(24404),t)},37937:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermRegex=void 0;const n=r(79345),i=r(12233),a=r(95370);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.REGEX],termFunction:!0})}async run(e){return new a.TermFunctionRegex}}t.ActorFunctionFactoryTermRegex=o},95370:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionRegex=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:[2,3],operator:i.SparqlOperator.REGEX,overloads:(0,i.declare)(i.SparqlOperator.REGEX).onBinaryTyped([i.TypeAlias.SPARQL_STRINGLY,i.TypeURL.XSD_STRING],a.regex2).onTernaryTyped([i.TypeAlias.SPARQL_STRINGLY,i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING],a.regex3).collect()})}static regex2(){return(e,t)=>(0,i.bool)(a.matches(e,t))}static regex3(){return(e,t,r)=>(0,i.bool)(a.matches(e,t,r))}static matches(e,t,r=""){return(r=a.cleanFlags(r)).includes("x")&&(t=a.flagX(t)),r.includes("q")&&(t=a.flagQ(t)),new RegExp(t,r.replaceAll(/[qx]/gu,"")).test(e)}static cleanFlags(e){if(!/^[imsxq]*$/u.test(e))throw new Error("Invalid flags");const t=[...e].find(((e,t,r)=>r.indexOf(e)!==t));if(t)throw new Error(`Duplicate flag: ${t}`);return e?.includes("q")&&(e=e.replaceAll(/[msx]/gu,"")),`${e}u`}static flagX(e){if(!e)return e;let t=e[0];for(;["\t","\n","\r"," "].includes(t);)t=(e=e.slice(1))[0];let r="["===t;for(let n=1;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermReplace=void 0;const n=r(79345),i=r(12233),a=r(53726);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.REPLACE],termFunction:!0})}async run(e){return new a.TermFunctionReplace}}t.ActorFunctionFactoryTermReplace=o},53726:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionReplace=void 0;const n=r(77595),i=r(79345),a=r(12233),o=r(84530);class s extends i.TermFunctionBase{constructor(){super({arity:[3,4],operator:a.SparqlOperator.REPLACE,overloads:(0,a.declare)(a.SparqlOperator.REPLACE).onTernaryTyped([a.TypeURL.XSD_STRING,a.TypeURL.XSD_STRING,a.TypeURL.XSD_STRING],(()=>(e,t,r)=>(0,a.string)(s.replace(e,t,r)))).set([a.TypeURL.RDF_LANG_STRING,a.TypeURL.XSD_STRING,a.TypeURL.XSD_STRING],(()=>([e,t,r])=>{const n=s.replace(e.typedValue,t.typedValue,r.typedValue);return(0,a.langString)(n,e.language)})).set([a.TypeURL.RDF_DIR_LANG_STRING,a.TypeURL.XSD_STRING,a.TypeURL.XSD_STRING],(()=>([e,t,r])=>{const n=s.replace(e.typedValue,t.typedValue,r.typedValue);return(0,o.dirLangString)(n,e.language,e.direction)})).onQuaternaryTyped([a.TypeURL.XSD_STRING,a.TypeURL.XSD_STRING,a.TypeURL.XSD_STRING,a.TypeURL.XSD_STRING],(()=>(e,t,r,n)=>(0,a.string)(s.replace(e,t,r,n)))).set([a.TypeURL.RDF_LANG_STRING,a.TypeURL.XSD_STRING,a.TypeURL.XSD_STRING,a.TypeURL.XSD_STRING],(()=>([e,t,r,n])=>{const i=s.replace(e.typedValue,t.typedValue,r.typedValue,n.typedValue);return(0,a.langString)(i,e.language)})).set([a.TypeURL.RDF_DIR_LANG_STRING,a.TypeURL.XSD_STRING,a.TypeURL.XSD_STRING,a.TypeURL.XSD_STRING],(()=>([e,t,r,n])=>{const i=s.replace(e.typedValue,t.typedValue,r.typedValue,n.typedValue);return(0,o.dirLangString)(i,e.language,e.direction)})).collect()})}static replace(e,t,r,i=""){return(i=n.TermFunctionRegex.cleanFlags(i)).includes("x")&&(t=n.TermFunctionRegex.flagX(t)),i.includes("q")?t=n.TermFunctionRegex.flagQ(t):r=r.replaceAll("$0",(()=>"$&")),i=`${i.replaceAll(/[qx]/gu,"")}g`,e.replaceAll(new RegExp(t,i),r)}}t.TermFunctionReplace=s},41316:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(88301),t)},52497:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermRound=void 0;const n=r(79345),i=r(12233),a=r(1970);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.ROUND],termFunction:!0})}async run(e){return new a.TermFunctionRound}}t.ActorFunctionFactoryTermRound=o},1970:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionRound=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.ROUND,overloads:(0,i.declare)(i.SparqlOperator.ROUND).numericConverter((()=>e=>Math.round(e))).collect()})}}t.TermFunctionRound=a},41324:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(52497),t)},99857:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermSeconds=void 0;const n=r(79345),i=r(12233),a=r(85314);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SECONDS],termFunction:!0})}async run(e){return new a.TermFunctionSeconds}}t.ActorFunctionFactoryTermSeconds=o},85314:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionSeconds=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.SECONDS,overloads:(0,i.declare)(i.SparqlOperator.SECONDS).onDateTime1((()=>e=>(0,i.decimal)(e.typedValue.seconds))).set([i.TypeURL.XSD_TIME],(()=>([e])=>(0,i.integer)(e.typedValue.seconds))).collect()})}}t.TermFunctionSeconds=a},38005:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(99857),t)},14655:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermSha1=void 0;const n=r(79345),i=r(12233),a=r(80618);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SHA1],termFunction:!0})}async run(e){return new a.TermFunctionSha1}}t.ActorFunctionFactoryTermSha1=o},80618:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionSha1=void 0;const n=r(79345),i=r(12233),a=r(99499);class o extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.SHA1,overloads:(0,i.declare)(i.SparqlOperator.SHA1).onString1Typed((()=>e=>(0,i.string)((0,a.sha1)().update(e).digest("hex")))).collect()})}}t.TermFunctionSha1=o},30773:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(14655),t)},72991:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermSha256=void 0;const n=r(79345),i=r(12233),a=r(11906);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SHA256],termFunction:!0})}async run(e){return new a.TermFunctionSha256}}t.ActorFunctionFactoryTermSha256=o},11906:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionSha256=void 0;const n=r(79345),i=r(12233),a=r(99499);class o extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.SHA256,overloads:(0,i.declare)(i.SparqlOperator.SHA256).onString1Typed((()=>e=>(0,i.string)((0,a.sha256)().update(e).digest("hex")))).collect()})}}t.TermFunctionSha256=o},52275:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(72991),t)},81291:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermSha384=void 0;const n=r(79345),i=r(12233),a=r(69270);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SHA384],termFunction:!0})}async run(e){return new a.TermFunctionSha384}}t.ActorFunctionFactoryTermSha384=o},69270:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionSha384=void 0;const n=r(79345),i=r(12233),a=r(99499);class o extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.SHA384,overloads:(0,i.declare)(i.SparqlOperator.SHA384).onString1Typed((()=>e=>(0,i.string)((0,a.sha384)().update(e).digest("hex")))).collect()})}}t.TermFunctionSha384=o},10111:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(81291),t)},92217:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermSha512=void 0;const n=r(79345),i=r(12233),a=r(89124);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SHA512],termFunction:!0})}async run(e){return new a.TermFunctionSha512}}t.ActorFunctionFactoryTermSha512=o},89124:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionSha512=void 0;const n=r(79345),i=r(12233),a=r(99499);class o extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.SHA512,overloads:(0,i.declare)(i.SparqlOperator.SHA512).onString1Typed((()=>e=>(0,i.string)((0,a.sha512)().update(e).digest("hex")))).collect()})}}t.TermFunctionSha512=o},78790:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(92217),t)},14258:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrAfter=void 0;const n=r(79345),i=r(12233),a=r(19075);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRAFTER],termFunction:!0})}async run(e){return new a.TermFunctionStrAfter}}t.ActorFunctionFactoryTermStrAfter=o},19075:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStrAfter=void 0;const n=r(79345),i=r(12233),a=r(84530);class o extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.STRAFTER,overloads:(0,i.declare)(i.SparqlOperator.STRAFTER).onCompatibleStringly2((()=>(e,t)=>{const[r,n]=[e.typedValue,t.typedValue],o=r.slice(r.indexOf(n)).slice(n.length);return o||!n?e.dataType===i.TypeURL.RDF_LANG_STRING?(0,i.langString)(o,e.language):e.dataType===i.TypeURL.RDF_DIR_LANG_STRING?(0,a.dirLangString)(o,e.language,e.direction):(0,i.string)(o,e.dataType):(0,i.string)(o)})).collect()})}}t.TermFunctionStrAfter=o},55552:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(14258),t)},61080:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrBefore=void 0;const n=r(79345),i=r(12233),a=r(94519);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRBEFORE],termFunction:!0})}async run(e){return new a.TermFunctionStrBefore}}t.ActorFunctionFactoryTermStrBefore=o},94519:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStrBefore=void 0;const n=r(79345),i=r(12233),a=r(84530);class o extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.STRBEFORE,overloads:(0,i.declare)(i.SparqlOperator.STRBEFORE).onCompatibleStringly2((()=>(e,t)=>{const[r,n]=[e.typedValue,t.typedValue],o=r.slice(0,Math.max(0,r.indexOf(n)));return o||!n?e.dataType===i.TypeURL.RDF_LANG_STRING?(0,i.langString)(o,e.language):e.dataType===i.TypeURL.RDF_DIR_LANG_STRING?(0,a.dirLangString)(o,e.language,e.direction):(0,i.string)(o,e.dataType):(0,i.string)(o)})).collect()})}}t.TermFunctionStrBefore=o},64329:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(61080),t)},82100:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrDt=void 0;const n=r(79345),i=r(12233),a=r(31435);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRDT],termFunction:!0})}async run(e){return new a.TermFunctionStrDt}}t.ActorFunctionFactoryTermStrDt=o},31435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStrDt=void 0;const n=r(79345),i=r(72407),a=r(12233);class o extends n.TermFunctionBase{constructor(){super({arity:2,operator:a.SparqlOperator.STRDT,overloads:(0,a.declare)(a.SparqlOperator.STRDT).set([a.TypeURL.XSD_STRING,"namedNode"],(e=>([t,r])=>{const n=e.context.getSafe(i.KeysInitQuery.dataFactory),o=n.literal(t.typedValue,n.namedNode(r.value));return new a.TermTransformer(e.context.getSafe(i.KeysExpressionEvaluator.superTypeProvider)).transformLiteral(o)})).collect()})}}t.TermFunctionStrDt=o},69894:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(82100),t)},47412:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrEnds=void 0;const n=r(79345),i=r(12233),a=r(82571);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRENDS],termFunction:!0})}async run(e){return new a.TermFunctionStrEnds}}t.ActorFunctionFactoryTermStrEnds=o},82571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStrEnds=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.STRENDS,overloads:(0,i.declare)(i.SparqlOperator.STRENDS).onCompatibleStringly2Typed((()=>(e,t)=>(0,i.bool)(e.endsWith(t)))).collect()})}}t.TermFunctionStrEnds=a},70244:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(47412),t)},34472:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrLang=void 0;const n=r(79345),i=r(12233),a=r(14715);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRLANG],termFunction:!0})}async run(e){return new a.TermFunctionStrLang}}t.ActorFunctionFactoryTermStrLang=o},14715:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStrLang=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.STRLANG,overloads:(0,i.declare)(i.SparqlOperator.STRLANG).onBinaryTyped([i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING],(()=>(e,t)=>{if(!t)throw new i.ExpressionError("Unable to create language string for empty languages");return new i.LangStringLiteral(e,t.toLowerCase())})).collect()})}}t.TermFunctionStrLang=a},46122:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(34472),t)},8848:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrLangdir=void 0;const n=r(79345),i=r(12233),a=r(63305);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRLANGDIR],termFunction:!0})}async run(e){return new a.TermFunctionStrLangdir}}t.ActorFunctionFactoryTermStrLangdir=o},63305:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStrLangdir=void 0;const n=r(79345),i=r(12233),a=r(58769);class o extends n.TermFunctionBase{constructor(){super({arity:3,operator:i.SparqlOperator.STRLANGDIR,overloads:(0,i.declare)(i.SparqlOperator.STRLANGDIR).onTernaryTyped([i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING],(()=>(e,t,r)=>{if(!t)throw new i.ExpressionError("Unable to create directional language string for empty languages");if("ltr"!==r&&"rtl"!==r)throw new i.ExpressionError(`Unable to create directional language string for direction "${r}"`);return new a.DirLangStringLiteral(e,t.toLowerCase(),r)})).collect()})}}t.TermFunctionStrLangdir=o},88961:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8848),t)},51728:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrLen=void 0;const n=r(79345),i=r(12233),a=r(82757);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRLEN],termFunction:!0})}async run(e){return new a.TermFunctionStrLen}}t.ActorFunctionFactoryTermStrLen=o},82757:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStrLen=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.STRLEN,overloads:(0,i.declare)(i.SparqlOperator.STRLEN).onStringly1((()=>e=>(0,i.integer)([...e.typedValue].length))).collect()})}}t.TermFunctionStrLen=a},10269:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(51728),t)},67652:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrStarts=void 0;const n=r(79345),i=r(12233),a=r(94487);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRSTARTS],termFunction:!0})}async run(e){return new a.TermFunctionStrStarts}}t.ActorFunctionFactoryTermStrStarts=o},94487:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStrStarts=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.STRSTARTS,overloads:(0,i.declare)(i.SparqlOperator.STRSTARTS).onCompatibleStringly2Typed((()=>(e,t)=>(0,i.bool)(e.startsWith(t)))).collect()})}}t.TermFunctionStrStarts=a},2443:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(67652),t)},1064:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrUuid=void 0;const n=r(79345),i=r(12233),a=r(19027);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRUUID],termFunction:!0})}async run(e){return new a.TermFunctionStrUuid}}t.ActorFunctionFactoryTermStrUuid=o},19027:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;o()=>(0,c.string)(u.v4()))).collect()})}}t.TermFunctionStrUuid=l},12937:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1064),t)},34425:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStr=void 0;const n=r(79345),i=r(12233),a=r(27106);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STR],termFunction:!0})}async run(e){return new a.TermFunctionStr}}t.ActorFunctionFactoryTermStr=o},27106:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStr=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.STR,overloads:(0,i.declare)(i.SparqlOperator.STR).onTerm1((()=>e=>(0,i.string)(e.str()))).collect()})}}t.TermFunctionStr=a},19675:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(34425),t)},7616:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermSubStr=void 0;const n=r(79345),i=r(12233),a=r(265);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SUBSTR],termFunction:!0})}async run(e){return new a.TermFunctionSubStr}}t.ActorFunctionFactoryTermSubStr=o},265:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionSubStr=void 0;const n=r(79345),i=r(12233),a=r(84530);class o extends n.TermFunctionBase{constructor(){super({arity:[2,3],operator:i.SparqlOperator.SUBSTR,overloads:(0,i.declare)(i.SparqlOperator.SUBSTR).onBinaryTyped([i.TypeURL.XSD_STRING,i.TypeURL.XSD_INTEGER],(()=>(e,t)=>(0,i.string)([...e].slice(t-1).join("")))).onBinary([i.TypeURL.RDF_LANG_STRING,i.TypeURL.XSD_INTEGER],(()=>(e,t)=>{const r=[...e.typedValue].slice(t.typedValue-1).join("");return(0,i.langString)(r,e.language)})).onBinary([i.TypeURL.RDF_DIR_LANG_STRING,i.TypeURL.XSD_INTEGER],(()=>(e,t)=>{const r=[...e.typedValue].slice(t.typedValue-1).join("");return(0,a.dirLangString)(r,e.language,e.direction)})).onTernaryTyped([i.TypeURL.XSD_STRING,i.TypeURL.XSD_INTEGER,i.TypeURL.XSD_INTEGER],(()=>(e,t,r)=>(0,i.string)([...e].slice(t-1,r+t-1).join("")))).onTernary([i.TypeURL.RDF_LANG_STRING,i.TypeURL.XSD_INTEGER,i.TypeURL.XSD_INTEGER],(()=>(e,t,r)=>{const n=[...e.typedValue].slice(t.typedValue-1,r.typedValue+t.typedValue-1).join("");return(0,i.langString)(n,e.language)})).onTernary([i.TypeURL.RDF_DIR_LANG_STRING,i.TypeURL.XSD_INTEGER,i.TypeURL.XSD_INTEGER],(()=>(e,t,r)=>{const n=[...e.typedValue].slice(t.typedValue-1,r.typedValue+t.typedValue-1).join("");return(0,a.dirLangString)(n,e.language,e.direction)})).collect()})}}t.TermFunctionSubStr=o},53524:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7616),t)},25877:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermSubject=void 0;const n=r(79345),i=r(12233),a=r(7290);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SUBJECT],termFunction:!0})}async run(e){return new a.TermFunctionSubject}}t.ActorFunctionFactoryTermSubject=o},7290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionSubject=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.SUBJECT,overloads:(0,i.declare)(i.SparqlOperator.SUBJECT).onQuad1((()=>e=>e.subject)).collect()})}}t.TermFunctionSubject=a},7348:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(25877),t)},75905:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermSubtraction=void 0;const n=r(79345),i=r(12233),a=r(88450);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SUBTRACTION],termFunction:!0})}async run(e){return new a.TermFunctionSubtraction}}t.ActorFunctionFactoryTermSubtraction=o},88450:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionSubtraction=void 0;const n=r(79345),i=r(72407),a=r(12233),o=r(86382);class s extends n.TermFunctionBase{constructor(){super({arity:2,operator:a.SparqlOperator.SUBTRACTION,overloads:(0,a.declare)(a.SparqlOperator.SUBTRACTION).arithmetic((()=>(e,t)=>new o.BigNumber(e).minus(t).toNumber())).set([a.TypeURL.XSD_DATE_TIME,a.TypeURL.XSD_DATE_TIME],(e=>([t,r])=>new a.DayTimeDurationLiteral((0,a.elapsedDuration)(t.typedValue,r.typedValue,e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone))))).copy({from:[a.TypeURL.XSD_DATE_TIME,a.TypeURL.XSD_DATE_TIME],to:[a.TypeURL.XSD_DATE,a.TypeURL.XSD_DATE]}).copy({from:[a.TypeURL.XSD_DATE_TIME,a.TypeURL.XSD_DATE_TIME],to:[a.TypeURL.XSD_TIME,a.TypeURL.XSD_TIME]}).set([a.TypeURL.XSD_DATE_TIME,a.TypeURL.XSD_DAY_TIME_DURATION],(()=>([e,t])=>new a.DateTimeLiteral((0,a.addDurationToDateTime)(e.typedValue,(0,a.defaultedDurationRepresentation)((0,a.negateDuration)(t.typedValue)))))).copy({from:[a.TypeURL.XSD_DATE_TIME,a.TypeURL.XSD_DAY_TIME_DURATION],to:[a.TypeURL.XSD_DATE_TIME,a.TypeURL.XSD_YEAR_MONTH_DURATION]}).set([a.TypeURL.XSD_DATE,a.TypeURL.XSD_DAY_TIME_DURATION],(()=>([e,t])=>new a.DateLiteral((0,a.addDurationToDateTime)((0,a.defaultedDateTimeRepresentation)(e.typedValue),(0,a.defaultedDurationRepresentation)((0,a.negateDuration)(t.typedValue)))))).copy({from:[a.TypeURL.XSD_DATE,a.TypeURL.XSD_DAY_TIME_DURATION],to:[a.TypeURL.XSD_DATE,a.TypeURL.XSD_YEAR_MONTH_DURATION]}).set([a.TypeURL.XSD_TIME,a.TypeURL.XSD_DAY_TIME_DURATION],(()=>([e,t])=>new a.TimeLiteral((0,a.addDurationToDateTime)((0,a.defaultedDateTimeRepresentation)(e.typedValue),(0,a.defaultedDurationRepresentation)((0,a.negateDuration)(t.typedValue)))))).collect()})}}t.TermFunctionSubtraction=s},20706:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(75905),t)},97459:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermTimezone=void 0;const n=r(79345),i=r(12233),a=r(28034);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.TIMEZONE],termFunction:!0})}async run(e){return new a.TermFunctionTimezone}}t.ActorFunctionFactoryTermTimezone=o},28034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionTimezone=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.TIMEZONE,overloads:(0,i.declare)(i.SparqlOperator.TIMEZONE).onDateTime1((()=>e=>{const t={hours:e.typedValue.zoneHours,minutes:e.typedValue.zoneMinutes};if(void 0===t.hours&&void 0===t.minutes)throw new i.InvalidTimezoneCall(e.str());return new i.DayTimeDurationLiteral(t)})).copy({from:[i.TypeURL.XSD_DATE_TIME],to:[i.TypeURL.XSD_DATE]}).copy({from:[i.TypeURL.XSD_DATE_TIME],to:[i.TypeURL.XSD_TIME]}).collect()})}}t.TermFunctionTimezone=a},97527:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(97459),t)},95813:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermTriple=void 0;const n=r(79345),i=r(12233),a=r(91812);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.TRIPLE],termFunction:!0})}async run(e){return new a.TermFunctionTriple}}t.ActorFunctionFactoryTermTriple=o},91812:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionTriple=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:3,operator:i.SparqlOperator.TRIPLE,overloads:(0,i.declare)(i.SparqlOperator.TRIPLE).onTerm3((e=>(e,t,r)=>{if("namedNode"!==e.termType&&"blankNode"!==e.termType)throw new i.ExpressionError("Subjects in triple terms must either be named nodes or blank nodes");if("namedNode"!==t.termType)throw new i.ExpressionError("Predicates in triple terms must be named nodes");return new i.Quad(e,t,r,new i.DefaultGraph)})).collect()})}}t.TermFunctionTriple=a},49012:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(95813),t)},20633:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermTz=void 0;const n=r(79345),i=r(12233),a=r(73632);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.TZ],termFunction:!0})}async run(e){return new a.TermFunctionTz}}t.ActorFunctionFactoryTermTz=o},73632:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionTz=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.TZ,overloads:(0,i.declare)(i.SparqlOperator.TZ).onDateTime1((()=>e=>(0,i.string)((0,i.extractRawTimeZone)(e.str())))).copy({from:[i.TypeURL.XSD_DATE_TIME],to:[i.TypeURL.XSD_DATE]}).copy({from:[i.TypeURL.XSD_DATE_TIME],to:[i.TypeURL.XSD_TIME]}).collect()})}}t.TermFunctionTz=a},49474:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(20633),t)},50177:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermUcase=void 0;const n=r(79345),i=r(12233),a=r(69514);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.UCASE],termFunction:!0})}async run(e){return new a.TermFunctionUcase}}t.ActorFunctionFactoryTermUcase=o},69514:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionUcase=void 0;const n=r(79345),i=r(12233),a=r(84530);class o extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.UCASE,overloads:(0,i.declare)(i.SparqlOperator.UCASE).onString1Typed((()=>e=>(0,i.string)(e.toUpperCase()))).onLangString1((()=>e=>(0,i.langString)(e.typedValue.toUpperCase(),e.language))).onDirLangString1((()=>e=>(0,a.dirLangString)(e.typedValue.toUpperCase(),e.language,e.direction))).collect()})}}t.TermFunctionUcase=o},49823:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(50177),t)},95386:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermUnaryMinus=void 0;const n=r(79345),i=r(12233),a=r(34023);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.UMINUS],termFunction:!0})}async run(e){return new a.TermFunctionUnaryMinus}}t.ActorFunctionFactoryTermUnaryMinus=o},34023:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionUnaryMinus=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.UMINUS,overloads:(0,i.declare)(i.SparqlOperator.UMINUS).numericConverter((()=>e=>-e)).collect()})}}t.TermFunctionUnaryMinus=a},74770:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(95386),t)},96948:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermUnaryPlus=void 0;const n=r(79345),i=r(12233),a=r(30631);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.UPLUS],termFunction:!0})}async run(e){return new a.TermFunctionUnaryPlus}}t.ActorFunctionFactoryTermUnaryPlus=o},30631:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionUnaryPlus=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.UPLUS,overloads:(0,i.declare)(i.SparqlOperator.UPLUS).numericConverter((()=>e=>e)).collect()})}}t.TermFunctionUnaryPlus=a},83002:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(96948),t)},54231:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermUuid=void 0;const n=r(79345),i=r(12233),a=r(29406);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.UUID],termFunction:!0})}async run(e){return new a.TermFunctionUuid}}t.ActorFunctionFactoryTermUuid=o},29406:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;o()=>new c.NamedNode(`urn:uuid:${u.v4()}`))).collect()})}}t.TermFunctionUuid=l},4975:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(54231),t)},83449:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToBoolean=void 0;const n=r(79345),i=r(12233),a=r(95624);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_BOOLEAN],termFunction:!0})}async run(e){return new a.TermFunctionXsdToBoolean}}t.ActorFunctionFactoryTermXsdToBoolean=o},95624:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToBoolean=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_BOOLEAN,overloads:(0,i.declare)(i.TypeURL.XSD_BOOLEAN).onNumeric1((()=>e=>(0,i.bool)(e.coerceEBV())),!0).onUnary(i.TypeURL.XSD_BOOLEAN,(()=>e=>(0,i.bool)(e.coerceEBV())),!0).onUnary(i.TypeURL.XSD_STRING,(()=>e=>{switch(e.str()){case"true":case"1":return(0,i.bool)(!0);case"false":case"0":return(0,i.bool)(!1);default:throw new i.CastError(e,i.TypeURL.XSD_BOOLEAN)}}),!1).collect()})}}t.TermFunctionXsdToBoolean=a},63170:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(83449),t)},61553:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToDate=void 0;const n=r(79345),i=r(12233),a=r(21450);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_DATE],termFunction:!0})}async run(e){return new a.TermFunctionXsdToDate}}t.ActorFunctionFactoryTermXsdToDate=o},21450:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToDate=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_DATE,overloads:(0,i.declare)(i.TypeURL.XSD_DATE).onUnary(i.TypeURL.XSD_DATE,(()=>e=>new i.DateLiteral(e.typedValue,e.strValue))).onUnary(i.TypeURL.XSD_DATE_TIME,(()=>e=>new i.DateLiteral(e.typedValue))).onStringly1((()=>e=>new i.DateLiteral((0,i.parseDate)(e.str())))).collect()})}}t.TermFunctionXsdToDate=a},60046:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(61553),t)},21445:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToDatetime=void 0;const n=r(79345),i=r(12233),a=r(96522);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_DATE_TIME],termFunction:!0})}async run(e){return new a.TermFunctionXsdToDatetime}}t.ActorFunctionFactoryTermXsdToDatetime=o},96522:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToDatetime=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_DATE_TIME,overloads:(0,i.declare)(i.TypeURL.XSD_DATE_TIME).onUnary(i.TypeURL.XSD_DATE_TIME,(()=>e=>e)).onUnary(i.TypeURL.XSD_STRING,(()=>e=>(0,i.dateTime)((0,i.parseDateTime)(e.str()),e.str())),!1).onUnary(i.TypeURL.XSD_DATE,(()=>e=>new i.DateTimeLiteral({...e.typedValue,hours:0,minutes:0,seconds:0}))).collect()})}}t.TermFunctionXsdToDatetime=a},11435:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(21445),t)},32967:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToDayTimeDuration=void 0;const n=r(79345),i=r(12233),a=r(40986);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_DAY_TIME_DURATION],termFunction:!0})}async run(e){return new a.TermFunctionXsdToDayTimeDuration}}t.ActorFunctionFactoryTermXsdToDayTimeDuration=o},40986:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToDayTimeDuration=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_DAY_TIME_DURATION,overloads:(0,i.declare)(i.TypeURL.XSD_DAY_TIME_DURATION).onUnary(i.TypeURL.XSD_DURATION,(()=>e=>new i.DayTimeDurationLiteral((0,i.trimToDayTimeDuration)(e.typedValue)))).onStringly1((()=>e=>new i.DayTimeDurationLiteral((0,i.parseDayTimeDuration)(e.str())))).collect()})}}t.TermFunctionXsdToDayTimeDuration=a},50937:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(32967),t)},81423:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToDecimal=void 0;const n=r(79345),i=r(12233),a=r(77186);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_DECIMAL],termFunction:!0})}async run(e){return new a.TermFunctionXsdToDecimal}}t.ActorFunctionFactoryTermXsdToDecimal=o},77186:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToDecimal=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_DECIMAL,overloads:(0,i.declare)(i.TypeURL.XSD_DECIMAL).onNumeric1((()=>e=>{const t=(0,i.parseXSDDecimal)(e.str());if(void 0===t)throw new i.CastError(e,i.TypeURL.XSD_DECIMAL);return(0,i.decimal)(t)})).onString1((()=>e=>{const t=e.str(),r=/^([+-])?(\d+(\.\d+)?)$/u.test(t)?(0,i.parseXSDDecimal)(t):void 0;if(void 0===r)throw new i.CastError(e,i.TypeURL.XSD_DECIMAL);return(0,i.decimal)(r)}),!1).onBoolean1Typed((()=>e=>(0,i.decimal)(e?1:0))).collect()})}}t.TermFunctionXsdToDecimal=a},54665:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(81423),t)},97189:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToDouble=void 0;const n=r(79345),i=r(12233),a=r(98538);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_DOUBLE],termFunction:!0})}async run(e){return new a.TermFunctionXsdToDouble}}t.ActorFunctionFactoryTermXsdToDouble=o},98538:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToDouble=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_DOUBLE,overloads:(0,i.declare)(i.TypeURL.XSD_DOUBLE).onNumeric1((()=>e=>(0,i.double)(e.typedValue))).onBoolean1Typed((()=>e=>(0,i.double)(e?1:0))).onUnary(i.TypeURL.XSD_STRING,(()=>e=>{const t=(0,i.parseXSDFloat)(e.str());if(void 0===t)throw new i.CastError(e,i.TypeURL.XSD_DOUBLE);return(0,i.double)(t)}),!1).collect()})}}t.TermFunctionXsdToDouble=a},71379:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(97189),t)},64721:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToDuration=void 0;const n=r(79345),i=r(12233),a=r(77038);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_DURATION],termFunction:!0})}async run(e){return new a.TermFunctionXsdToDuration}}t.ActorFunctionFactoryTermXsdToDuration=o},77038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToDuration=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_DAY_TIME_DURATION,overloads:(0,i.declare)(i.TypeURL.XSD_DURATION).onUnary(i.TypeURL.XSD_DURATION,(()=>e=>new i.DurationLiteral(e.typedValue,e.strValue))).onStringly1((()=>e=>new i.DurationLiteral((0,i.parseDuration)(e.str())))).collect()})}}t.TermFunctionXsdToDuration=a},75894:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(64721),t)},17273:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToFloat=void 0;const n=r(79345),i=r(12233),a=r(9380);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_FLOAT],termFunction:!0})}async run(e){return new a.TermFunctionXsdToFloat}}t.ActorFunctionFactoryTermXsdToFloat=o},9380:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToFloat=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_FLOAT,overloads:(0,i.declare)(i.TypeURL.XSD_FLOAT).onNumeric1((()=>e=>(0,i.float)(e.typedValue))).onBoolean1Typed((()=>e=>(0,i.float)(e?1:0))).onUnary(i.TypeURL.XSD_STRING,(()=>e=>{const t=(0,i.parseXSDFloat)(e.str());if(void 0===t)throw new i.CastError(e,i.TypeURL.XSD_FLOAT);return(0,i.float)(t)}),!1).collect()})}}t.TermFunctionXsdToFloat=a},71396:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(17273),t)},38501:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToInteger=void 0;const n=r(79345),i=r(12233),a=r(25908);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_INTEGER],termFunction:!0})}async run(e){return new a.TermFunctionXsdToInteger}}t.ActorFunctionFactoryTermXsdToInteger=o},25908:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToInteger=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_INTEGER,overloads:(0,i.declare)(i.TypeURL.XSD_INTEGER).onBoolean1Typed((()=>e=>(0,i.integer)(e?1:0))).onNumeric1((()=>e=>{if(!Number.isFinite(e.typedValue))throw new i.CastError(e,i.TypeURL.XSD_INTEGER);return(0,i.integer)(Math.trunc(e.typedValue))})).onString1((()=>e=>{const t=e.str(),r=/^\d+$/u.test(t)?Number.parseInt(t,10):void 0;if(void 0===r)throw new i.CastError(e,i.TypeURL.XSD_INTEGER);return(0,i.integer)(r)})).collect()})}}t.TermFunctionXsdToInteger=a},23104:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(38501),t)},57337:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToString=void 0;const n=r(79345),i=r(12233),a=r(10754);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_STRING],termFunction:!0})}async run(e){return new a.TermFunctionXsdToString}}t.ActorFunctionFactoryTermXsdToString=o},10754:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToString=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_STRING,overloads:(0,i.declare)(i.TypeURL.XSD_STRING).onNumeric1((()=>e=>(0,i.string)((0,i.float)(e.typedValue).str()))).onBoolean1Typed((()=>e=>(0,i.string)((0,i.bool)(e).str()))).onTerm1((()=>e=>(0,i.string)(e.str()))).collect()})}}t.TermFunctionXsdToString=a},40055:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(57337),t)},47117:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToTime=void 0;const n=r(79345),i=r(12233),a=r(89754);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_TIME],termFunction:!0})}async run(e){return new a.TermFunctionXsdToTime}}t.ActorFunctionFactoryTermXsdToTime=o},89754:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToTime=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_TIME,overloads:(0,i.declare)(i.TypeURL.XSD_TIME).onUnary(i.TypeURL.XSD_TIME,(()=>e=>new i.TimeLiteral(e.typedValue,e.strValue))).onUnary(i.TypeURL.XSD_DATE_TIME,(()=>e=>new i.TimeLiteral(e.typedValue))).onStringly1((()=>e=>new i.TimeLiteral((0,i.parseTime)(e.str())))).collect()})}}t.TermFunctionXsdToTime=a},96751:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(47117),t)},35871:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToYearMonthDuration=void 0;const n=r(79345),i=r(12233),a=r(27794);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_YEAR_MONTH_DURATION],termFunction:!0})}async run(e){return new a.TermFunctionXsdToYearMonthDuration}}t.ActorFunctionFactoryTermXsdToYearMonthDuration=o},27794:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToYearMonthDuration=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_YEAR_MONTH_DURATION,overloads:(0,i.declare)(i.TypeURL.XSD_YEAR_MONTH_DURATION).onUnary(i.TypeURL.XSD_DURATION,(()=>e=>new i.YearMonthDurationLiteral((0,i.trimToYearMonthDuration)(e.typedValue)))).onStringly1((()=>e=>new i.YearMonthDurationLiteral((0,i.parseYearMonthDuration)(e.str())))).collect()})}}t.TermFunctionXsdToYearMonthDuration=a},26847:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(35871),t)},66227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermYear=void 0;const n=r(79345),i=r(12233),a=r(57722);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.YEAR],termFunction:!0})}async run(e){return new a.TermFunctionYear}}t.ActorFunctionFactoryTermYear=o},57722:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionYear=void 0;const n=r(79345),i=r(12233);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.YEAR,overloads:(0,i.declare)(i.SparqlOperator.YEAR).onDateTime1((()=>e=>(0,i.integer)(e.typedValue.year))).set([i.TypeURL.XSD_DATE],(()=>([e])=>(0,i.integer)(e.typedValue.year))).collect()})}}t.TermFunctionYear=a},68537:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(66227),t)},59648:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHashBindingsMurmur=void 0;const n=r(83691),i=r(97356),a=r(33918);class o extends n.ActorHashBindings{async test(e){return(0,i.passTestVoid)()}async run(e){return{hashFunction:(e,t)=>{let r=a();for(const n of t)r=r.hash(e.get(n)?.value??"UNDEF");return r.result()}}}}t.ActorHashBindingsMurmur=o},2503:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(59648),t)},78178:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHashQuadsMurmur=void 0;const n=r(61655),i=r(97356),a=r(33918);class o extends n.ActorHashQuads{async test(e){return(0,i.passTestVoid)()}async run(e){return{hashFunction:e=>{const t=a(e.subject.value);return t.hash(e.predicate.value),t.hash(e.object.value),t.hash(e.graph.value),t.result()}}}}t.ActorHashQuadsMurmur=o},2233:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(78178),t)},92807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHttpFetch=void 0;const n=r(62034),i=r(72407),a=r(97356),o=r(11785),s=r(39721),c=r(12182),u=r(70574);class l extends n.ActorHttp{fetchInitPreprocessor;static userAgent=n.ActorHttp.createUserAgent("ActorHttpFetch",s.version);constructor(e){super(e),this.fetchInitPreprocessor=new u.FetchInitPreprocessor(e)}async test(e){return(0,a.passTest)({time:Number.POSITIVE_INFINITY})}async run(e){const t=this.prepareRequestHeaders(e),r={method:"GET",...e.init,headers:t};this.logInfo(e.context,`Requesting ${n.ActorHttp.getInputUrl(e.input).href}`,(()=>({headers:n.ActorHttp.headersToHash(t),method:r.method}))),e.context.has(i.KeysHttp.fetch)&&(r.headers=n.ActorHttp.headersToHash(t)),e.context.get(i.KeysHttp.includeCredentials)&&(r.credentials="include");const a=e.context.get(i.KeysHttp.httpTimeout),s=e.context.get(i.KeysHttp.httpBodyTimeout),u=e.context.get(i.KeysHttp.fetch)??fetch,l=await this.fetchInitPreprocessor.handle(r,e.context);let d,p;const h=e.context.get(i.KeysHttp.httpAbortSignal);if(h&&(l.signal=AbortSignal.any([...l.signal?[l.signal]:[],h])),a){const t=new AbortController;l.signal=AbortSignal.any([...l.signal?[l.signal]:[],t.signal]),d=()=>t.abort(new Error(`Fetch timed out for ${n.ActorHttp.getInputUrl(e.input).href} after ${a} ms`)),p=setTimeout((()=>d()),a)}const f=await u(e.input,l);return f.fromCache="HIT"===f.headers.get("x-comunica-cache"),f.fromCache&&this.logInfo(e.context,`Cache hit for ${n.ActorHttp.getInputUrl(e.input).href}`),f.cachePolicy=new c.CachePolicyHttpCacheSemanticsWrapper(new o(await c.CachePolicyHttpCacheSemanticsWrapper.convertFromFetchRequest(e,this.fetchInitPreprocessor),{status:f.status,headers:n.ActorHttp.headersToHash(f.headers)},{shared:!1}),e.context.get(i.KeysInitQuery.queryTimestampHighResolution),this.fetchInitPreprocessor),!a||s&&f.body||clearTimeout(p),f}prepareRequestHeaders(e){const t=new Headers(e.init?.headers);n.ActorHttp.isBrowser()?t.delete("user-agent"):t.has("user-agent")||t.set("user-agent",l.userAgent);const r=e.context.get(i.KeysHttp.auth);return r&&t.set("Authorization",`Basic ${l.stringToBase64(r)}`),t}static stringToBase64(e){const t=(new TextEncoder).encode(e),r=Array.from(t,(e=>String.fromCodePoint(e))).join("");return btoa(r)}}t.ActorHttpFetch=l},12182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CachePolicyHttpCacheSemanticsWrapper=void 0;const n=r(62034),i=r(72407);class a{cachePolicy;queryTimestamp;fetchInitPreprocessor;constructor(e,t,r){this.cachePolicy=e,this.queryTimestamp=t,this.fetchInitPreprocessor=r}storable(){return this.cachePolicy.storable()}async satisfiesWithoutRevalidation(e){return!(!this.queryTimestamp||e.context.get(i.KeysInitQuery.queryTimestampHighResolution)!==this.queryTimestamp)||this.cachePolicy.satisfiesWithoutRevalidation(await a.convertFromFetchRequest(e,this.fetchInitPreprocessor))}responseHeaders(){return a.convertToFetchHeaders(this.cachePolicy.responseHeaders())}timeToLive(){return this.cachePolicy.timeToLive()}async revalidationHeaders(e){return a.convertToFetchHeaders(this.cachePolicy.revalidationHeaders(await a.convertFromFetchRequest(e,this.fetchInitPreprocessor)))}async revalidatedPolicy(e,t){const r=this.cachePolicy.revalidatedPolicy(await a.convertFromFetchRequest(e,this.fetchInitPreprocessor),{status:t.status,headers:t.headers?n.ActorHttp.headersToHash(t.headers):{}});return{policy:new a(r.policy,this.queryTimestamp,this.fetchInitPreprocessor),modified:r.modified,matches:r.matches}}static async convertFromFetchRequest(e,t){let r="string"==typeof e.input?e.init?.headers:e.input.headers;return r=(await t.handle({headers:r},e.context)).headers,{url:"string"==typeof e.input?e.input:e.input.url,method:e.init?.method??"GET",headers:r?n.ActorHttp.headersToHash(new Headers(r)):{}}}static convertToFetchHeaders(e){const t=new Headers;for(const[r,n]of Object.entries(e))if(Array.isArray(n))for(const e of n)t.append(r,e);else n&&t.append(r,n);return t}}t.CachePolicyHttpCacheSemanticsWrapper=a},70574:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FetchInitPreprocessor=void 0,t.FetchInitPreprocessor=class{async handle(e){if(e.body&&"string"!=typeof e.body&&"getReader"in e.body){const t=e.body.getReader(),r=[];for(;;){const{done:e,value:n}=await t.read();if(e)break;r.push(n)}e.body=r.join("")}return{...e,keepalive:!e.body}}}},37794:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(92807),t),i(r(12182),t)},47922:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHttpLimitRate=void 0;const n=r(62034),i=r(97356);class a extends n.ActorHttp{hostData;correctionMultiplier;failureMultiplier;limitByDefault;allowOverlap;httpInvalidator;mediatorHttp;static keyWrapped=new i.ActionContextKey("urn:comunica:actor-http-limit-rate#wrapped");constructor(e){super(e),this.mediatorHttp=e.mediatorHttp,this.httpInvalidator=e.httpInvalidator,this.httpInvalidator.addInvalidateListener((e=>this.handleHttpInvalidateEvent(e))),this.correctionMultiplier=e.correctionMultiplier,this.failureMultiplier=e.failureMultiplier,this.limitByDefault=e.limitByDefault,this.allowOverlap=e.allowOverlap,this.hostData=new Map}async test(e){return e.context.has(a.keyWrapped)?(0,i.failTest)(`${this.name} can only wrap a request once`):(0,i.passTest)({time:0})}async run(e){const t=n.ActorHttp.getInputUrl(e.input);let r=this.hostData.get(t.host);r||(r={latestRequestTimestamp:0,rateLimited:this.limitByDefault,requestInterval:Number.NEGATIVE_INFINITY},this.hostData.set(t.host,r));const i=Date.now();let o=0;r.rateLimited&&(o=Math.max(0,r.latestRequestTimestamp+r.requestInterval-i)),r.latestRequestTimestamp=i+(this.allowOverlap?0:1)*o,o>0&&(this.logDebug(e.context,"Delaying request",(()=>({url:t.href,requestInterval:r.requestInterval,currentDelay:o}))),await new Promise((e=>setTimeout(e,o))));const s=(n,a)=>{const s=(n?1:this.failureMultiplier)*(Date.now()-i-o);r.requestInterval<0?r.requestInterval=Math.round(s*this.correctionMultiplier):r.requestInterval+=Math.round(this.correctionMultiplier*(s-r.requestInterval)),n||404===a||r.rateLimited||(this.logDebug(e.context,"Marking host as rate-limited",(()=>({host:t.host}))),r.rateLimited=!0)};try{const t=await this.mediatorHttp.mediate({...e,context:e.context.set(a.keyWrapped,!0)});return s(t.ok,t.status),t}catch(e){throw s(!1,-1),e}}handleHttpInvalidateEvent(e){if(e.url){const t=new URL(e.url).host;this.hostData.delete(t)}else this.hostData.clear()}}t.ActorHttpLimitRate=a},73922:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(47922),t)},80759:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHttpProxy=void 0;const n=r(62034),i=r(72407),a=r(97356);class o extends n.ActorHttp{mediatorHttp;constructor(e){super(e),this.mediatorHttp=e.mediatorHttp}async test(e){const t=e.context.get(i.KeysHttpProxy.httpProxyHandler);return t?await t.getProxy(e)?(0,a.passTest)({time:Number.POSITIVE_INFINITY}):(0,a.failTest)(`Actor ${this.name} could not determine a proxy for the given request.`):(0,a.failTest)(`Actor ${this.name} could not find a proxy handler in the context.`)}async run(e){const t="string"==typeof e.input?e.input:e.input.url,r=e.context.get(i.KeysHttpProxy.httpProxyHandler),n=await this.mediatorHttp.mediate({...await r.getProxy(e),context:e.context.delete(i.KeysHttpProxy.httpProxyHandler)});return Object.defineProperty(n,"url",{configurable:!0,enumerable:!0,get:()=>n.headers.get("x-final-url")??t}),n}}t.ActorHttpProxy=o},55034:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyHandlerStatic=void 0,t.ProxyHandlerStatic=class{prefixUrl;constructor(e){this.prefixUrl=e}async getProxy(e){return{init:e.init,input:this.modifyInput(e.input)}}modifyInput(e){return"string"==typeof e?this.prefixUrl+e:new Request(this.prefixUrl+e.url,e)}}},99754:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(80759),t),i(r(55034),t)},79122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHttpRetryBody=void 0;const n=r(62034),i=r(72407),a=r(97356),o=r(58521);class s extends n.ActorHttp{mediatorHttp;static contentLengthRegex=/^[0-9]+$/u;constructor(e){super(e),this.mediatorHttp=e.mediatorHttp}async test(e){const t=e.context.get(i.KeysHttp.httpRetryBodyCount);if(!t||t<1)return(0,a.failTest)(`${this.name} requires a retry count greater than zero to function`);const r=e.context.get(i.KeysHttp.httpRetryBodyAllowUnsafe)??!1,n=s.getRequestMethod(e);return s.isIdempotentMethod(n)||r?s.isReplayableRequestBody(e)||r?(0,a.passTest)({time:0}):(0,a.failTest)(`${this.name} can only retry replayable request bodies by default`):(0,a.failTest)(`${this.name} can only retry idempotent request methods by default`)}async run(e){const t=n.ActorHttp.getInputUrl(e.input),r=e.context.getSafe(i.KeysHttp.httpRetryBodyCount),a=e.context.get(i.KeysHttp.httpRetryBodyDelayFallback)??0,o=e.context.get(i.KeysHttp.httpRetryBodyMaxBytes),c=await this.mediatorHttp.mediate({...e,context:e.context.delete(i.KeysHttp.httpRetryBodyCount)});if(!c.ok||!c.body)return c;const u=r+1;if(void 0!==o){const r=c.headers.get("content-length")?.trim();if(r&&s.contentLengthRegex.test(r)){const n=Number(r);if(n>o)return this.logWarn(e.context,"Skipping body retry due to content-length exceeding max bytes",(()=>({url:t.href,contentLength:n,maxBytes:o}))),c}}const l=this.createRetryingBody(n.ActorHttp.toNodeReadable(c.body),e,u,a,t,o),d=n.ActorHttp.toWebReadableStream(l),p=new Response(d,{headers:c.headers,status:c.status,statusText:c.statusText});return p.cachePolicy=c.cachePolicy,p.fromCache=c.fromCache,p}createRetryingBody(e,t,r,a,c,u){const l=new o.PassThrough;let d,p=1,h=!1,f=!1,y=0;const m=()=>h||l.destroyed,g=()=>{d&&"destroy"in d&&"function"==typeof d.destroy&&d.destroy()},b=e=>{d=e,y=0;const n=[];let i=!1;const a=()=>{e.removeListener("data",o),e.removeListener("error",f),e.removeListener("end",s),e.removeListener("close",g)},o=o=>{const s=Buffer.isBuffer(o)?o:Buffer.from(o);if(y+=s.length,n.push(s),!i&&void 0!==u&&y>u){i=!0,"pause"in e&&"function"==typeof e.pause&&e.pause(),a(),this.logWarn(t.context,"Max bytes exceeded, disabling body retry and switching to streaming",(()=>({url:c.href,maxBytes:u,bufferedBytes:y,currentAttempt:`${p} / ${r}`})));for(const e of n){if(m())return;l.write(e)}n.length=0;let o=!1;e.once("end",(()=>{o=!0})),e.once("error",(e=>{l.destroy(e instanceof Error?e:new Error(String(e)))})),e.once("close",(()=>{o||m()||l.destroy(new Error("Response body closed before end after disabling body retry due to maxBytes"))})),"pipe"in e&&"function"==typeof e.pipe&&e.pipe(l)}},s=()=>{if(a(),m())h=!0;else{for(const e of n)l.write(e);n.length=0,h=!0,l.end()}},f=e=>{a(),m()?h=!0:v(e).catch((e=>{l.destroy(e instanceof Error?e:new Error(String(e)))}))},g=()=>{a(),m()?h=!0:v(new Error("Response body closed before end during body retry")).catch((e=>{l.destroy(e instanceof Error?e:new Error(String(e)))}))};e.on("data",o),e.on("error",f),e.on("end",s),e.on("close",g)},v=async e=>{if(!f&&!m())if([t.init?.signal,t.context.get(i.KeysHttp.httpAbortSignal)].some((e=>e?.aborted)))l.destroy(e instanceof Error?e:new Error(String(e)));else if(p>=r)l.destroy(e instanceof Error?e:new Error(String(e)));else{f=!0,p++,this.logDebug(t.context,"Retrying response body stream after error",(()=>({url:c.href,bufferedBytes:y,currentAttempt:`${p} / ${r}`})));try{if(g(),a>0&&await s.sleep(a),m())return;const e=await this.mediatorHttp.mediate({...t,context:t.context.delete(i.KeysHttp.httpRetryBodyCount)});if(!e.ok||!e.body)return void l.destroy(new Error(`Response body retry failed for ${c.href}`));const r=n.ActorHttp.toNodeReadable(e.body);if(m())return void("destroy"in r&&"function"==typeof r.destroy&&r.destroy());b(r)}catch(e){l.destroy(e instanceof Error?e:new Error(String(e)))}finally{f=!1}}};return l.on("close",(()=>{h=!0,g()})),l.on("error",(()=>{h=!0,g()})),b(e),l}static getRequestMethod(e){return void 0!==e.init?.method?e.init.method:e.input instanceof Request?e.input.method:"GET"}static isIdempotentMethod(e){switch(e.toUpperCase()){case"GET":case"HEAD":case"PUT":case"DELETE":case"OPTIONS":case"TRACE":return!0;default:return!1}}static isReplayableRequestBody(e){return void 0!==e.init?.body?s.isReplayableBody(e.init.body):!(e.input instanceof Request&&e.input.body)||s.isReplayableBody(e.input.body)}static isReplayableBody(e){return!!(null==e||"string"==typeof e||e instanceof URLSearchParams||"undefined"!=typeof FormData&&e instanceof FormData||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||"undefined"!=typeof Blob&&e instanceof Blob)}static async sleep(e){e>0&&await new Promise((t=>setTimeout(t,e)))}}t.ActorHttpRetryBody=s},28071:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(79122),t)},61479:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHttpRetry=void 0;const n=r(62034),i=r(72407),a=r(97356);class o extends n.ActorHttp{activeDelays;httpInvalidator;mediatorHttp;static dateRegex=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-9]{2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2} GMT$/u;static numberRegex=/^[0-9]+$/u;static keyWrapped=new a.ActionContextKey("urn:comunica:actor-http-retry#wrapped");constructor(e){super(e),this.activeDelays={},this.httpInvalidator=e.httpInvalidator,this.httpInvalidator.addInvalidateListener((e=>this.handleHttpInvalidateEvent(e))),this.mediatorHttp=e.mediatorHttp}async test(e){if(e.context.has(o.keyWrapped))return(0,a.failTest)(`${this.name} can only wrap a request once`);const t=e.context.get(i.KeysHttp.httpRetryCount);return!t||t<1?(0,a.failTest)(`${this.name} requires a retry count greater than zero to function`):(0,a.passTest)({time:0})}async run(e){const t=n.ActorHttp.getInputUrl(e.input),r=e.context.getSafe(i.KeysHttp.httpRetryCount)+1,a=e.context.get(i.KeysHttp.httpRetryDelayFallback)??0,s=e.context.get(i.KeysHttp.httpRetryDelayLimit),c=e.context.get(i.KeysHttp.httpRetryStatusCodes);for(let n=1;n<=r;n++){const i=t.host in this.activeDelays?this.activeDelays[t.host].date.getTime()-Date.now():a;if(s&&i>s){this.logWarn(e.context,"Requested delay exceeds the limit",(()=>({url:t.href,delay:i,delayDate:this.activeDelays[t.host].date.toISOString(),delayLimit:s,currentAttempt:`${n} / ${r}`})));break}i>0&&n>1&&(this.logDebug(e.context,"Delaying request",(()=>({url:t.href,delay:i,currentAttempt:`${n} / ${r}`}))),await o.sleep(i));const u=await this.mediatorHttp.mediate({...e,context:e.context.set(o.keyWrapped,!0)});if(u.ok)return u;if(c&&c.includes(u.status))this.logDebug(e.context,"Status code in force retry list, forcing retry",(()=>({url:t.href,status:u.status,statusText:u.statusText,currentAttempt:`${n} / ${r}`})));else if(504!==u.status)if(429===u.status||503===u.status||405===u.status&&u.headers.has("retry-after")){const i=u.headers.get("retry-after");if(i){const a=o.parseRetryAfterHeader(i);a?(t.host in this.activeDelays&&clearTimeout(this.activeDelays[t.host].timeout),this.activeDelays[t.host]={date:a,timeout:setTimeout((()=>delete this.activeDelays[t.host]),a.getTime()-Date.now())}):this.logDebug(e.context,"Invalid Retry-After header value from server",(()=>({url:t.href,status:u.status,statusText:u.statusText,retryAfterHeader:i,currentAttempt:`${n} / ${r}`})))}this.logDebug(e.context,"Server temporarily unavailable",(()=>({url:t.href,status:u.status,statusText:u.statusText,currentAttempt:`${n} / ${r}`})))}else{if(u.status>=400&&u.status<500){this.logDebug(e.context,"Server reported client-side error",(()=>({url:t.href,status:u.status,statusText:u.statusText,currentAttempt:`${n} / ${r}`})));break}if(u.status>=500&&u.status<600){this.logDebug(e.context,"Server-side error encountered, terminating",(()=>({url:t.href,status:u.status,statusText:u.statusText,currentAttempt:`${n} / ${r}`})));break}this.logDebug(e.context,"Request failed",(()=>({url:t.href,status:u.status,statusText:u.statusText,currentAttempt:`${n} / ${r}`})))}else this.logDebug(e.context,"Received proxy timeout",(()=>({url:t.href,status:u.status,statusText:u.statusText,currentAttempt:`${n} / ${r}`})))}throw new Error(`Request failed: ${t.href}`)}static async sleep(e){e>0&&await new Promise((t=>setTimeout(t,e)))}static parseRetryAfterHeader(e){return o.numberRegex.test(e)?new Date(Date.now()+1e3*Number.parseInt(e,10)):o.dateRegex.test(e)?new Date(e):void 0}handleHttpInvalidateEvent(e){const t=e.url?new URL(e.url).host:void 0;for(const e of Object.keys(this.activeDelays))t&&e!==t||(clearTimeout(this.activeDelays[e].timeout),delete this.activeDelays[e])}}t.ActorHttpRetry=o},39704:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(61479),t)},42311:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHttpWayback=void 0;const n=r(62034),i=r(72407),a=r(97356),o=r(31759),s="http://wayback.archive-it.org/";function c(e){const t=new Request(e.input,e.init);return{input:new Request(new URL(`/${t.url}`,s),t)}}function u(e){const t=e.get(i.KeysHttpProxy.httpProxyHandler);return t?e=>t.getProxy(c(e)):e=>Promise.resolve(c(e))}class l extends n.ActorHttp{mediatorHttp;constructor(e){super(e),this.mediatorHttp=e.mediatorHttp}async test(e){return(0,a.passTestVoid)()}async run(e){let t=await this.mediatorHttp.mediate(e);if(404===t.status&&e.context.get(i.KeysHttpWayback.recoverBrokenLinks)){let r=await this.mediatorHttp.mediate({...e,context:e.context.set(i.KeysHttpWayback.recoverBrokenLinks,!1).set(i.KeysHttpProxy.httpProxyHandler,{getProxy:u(e.context)})});200===r.status&&([t,r]=[r,t]);const{body:a}=r;a&&("cancel"in a&&"function"==typeof a.cancel?await a.cancel():"destroy"in a&&"function"==typeof a.destroy?a.destroy():await(0,o.stringify)(n.ActorHttp.toNodeReadable(a)))}return t}}t.ActorHttpWayback=l},59378:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(42311),t)},38758:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorInitQuery=void 0;const n=r(17862);"undefined"==typeof process&&(globalThis.process=r(39907));class i extends n.ActorInitQueryBase{}t.ActorInitQuery=i},17862:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorInitQueryBase=void 0;const n=r(90020),i=r(97356);class a extends n.ActorInit{mediatorQueryResultSerialize;mediatorQueryResultSerializeMediaTypeCombiner;mediatorQueryResultSerializeMediaTypeFormatCombiner;mediatorHttpInvalidate;mediatorQueryProcess;queryString;defaultQueryInputFormat;allowNoSources;context;constructor(e){super(e),this.mediatorQueryResultSerialize=e.mediatorQueryResultSerialize,this.mediatorQueryResultSerializeMediaTypeCombiner=e.mediatorQueryResultSerializeMediaTypeCombiner,this.mediatorQueryResultSerializeMediaTypeFormatCombiner=e.mediatorQueryResultSerializeMediaTypeFormatCombiner,this.mediatorHttpInvalidate=e.mediatorHttpInvalidate,this.mediatorQueryProcess=e.mediatorQueryProcess,this.queryString=e.queryString,this.defaultQueryInputFormat=e.defaultQueryInputFormat,this.allowNoSources=e.allowNoSources,this.context=e.context}async test(e){return(0,i.passTestVoid)()}async run(e){throw new Error("ActorInitSparql#run is not supported in the browser.")}}t.ActorInitQueryBase=a},73131:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QueryEngineBase=void 0;const n=r(72407),i=r(97356);class a{actorInitQuery;constructor(e){this.actorInitQuery=e}async queryBindings(e,t){return this.queryOfType(e,t,"bindings")}async queryQuads(e,t){return this.queryOfType(e,t,"quads")}async queryBoolean(e,t){return this.queryOfType(e,t,"boolean")}async queryVoid(e,t){return this.queryOfType(e,t,"void")}async queryOfType(e,t,r){const n=await this.query(e,t);if(n.resultType===r)return await n.execute();throw new Error(`Query result type '${r}' was expected, while '${n.resultType}' was found.`)}async query(e,t){const r=await this.queryOrExplain(e,t);if("explain"in r)throw new Error("Tried to explain a query when in query-only mode");return r}async explain(e,t,r){return t.explain=r,await this.queryOrExplain(e,t)}async queryOrExplain(e,t){const r=i.ActionContext.ensureActionContext(t);r.get(n.KeysInitQuery.invalidateCache)&&await this.invalidateHttpCache();const{result:o}=await this.actorInitQuery.mediatorQueryProcess.mediate({query:e,context:r});return"explain"in o?o:a.internalToFinalResult(o)}async getResultMediaTypes(e){return e=i.ActionContext.ensureActionContext(e),(await this.actorInitQuery.mediatorQueryResultSerializeMediaTypeCombiner.mediate({context:e,mediaTypes:!0})).mediaTypes}async getResultMediaTypeFormats(e){return e=i.ActionContext.ensureActionContext(e),(await this.actorInitQuery.mediatorQueryResultSerializeMediaTypeFormatCombiner.mediate({context:e,mediaTypeFormats:!0})).mediaTypeFormats}async resultToString(e,t,r){if(r=i.ActionContext.ensureActionContext(r),!t)switch(e.resultType){case"bindings":t="application/json";break;case"quads":t="application/trig";break;default:t="simple"}const n={...await a.finalToInternalResult(e),context:r};return(await this.actorInitQuery.mediatorQueryResultSerialize.mediate({context:r,handle:n,handleMediaType:t})).handle}invalidateHttpCache(e,t){return t=i.ActionContext.ensureActionContext(t),this.actorInitQuery.mediatorHttpInvalidate.mediate({url:e,context:t})}static internalToFinalResult(e){const t=e.context?.get(n.KeysCore.log);switch(e.type){case"bindings":return{resultType:"bindings",execute:async()=>(t&&e.bindingsStream.on?.("end",(()=>t.flush())),e.bindingsStream),metadata:async()=>{const t=await e.metadata();return t.variables=t.variables.map((e=>e.variable)),t},context:e.context};case"quads":return{resultType:"quads",execute:async()=>(t&&e.quadStream.on?.("end",(()=>t.flush())),e.quadStream),metadata:async()=>await e.metadata(),context:e.context};case"boolean":return{resultType:"boolean",execute:async()=>{const r=await e.execute();return t?.flush(),r},context:e.context};case"void":return{resultType:"void",execute:async()=>{const r=await e.execute();return t?.flush(),r},context:e.context}}}static async finalToInternalResult(e){switch(e.resultType){case"bindings":return{type:"bindings",bindingsStream:await e.execute(),metadata:async()=>{const t=await e.metadata();return t.variables=t.variables.map((e=>({variable:e,canBeUndef:!1}))),t}};case"quads":return{type:"quads",quadStream:await e.execute(),metadata:async()=>await e.metadata()};case"boolean":return{type:"boolean",execute:()=>e.execute()};case"void":return{type:"void",execute:()=>e.execute()}}}}t.QueryEngineBase=a},1549:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.QueryEngineBase=void 0,i(r(17862),t),i(r(38758),t);var a=r(73131);Object.defineProperty(t,"QueryEngineBase",{enumerable:!0,get:function(){return a.QueryEngineBase}})},69309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationAssignSourcesExhaustive=void 0;const n=r(37216),i=r(72407),a=r(97356),o=r(34005),s=r(98989);class c extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.AlgebraFactory(t),n=e.context.get(i.KeysQueryOperation.querySources)??[],a=e.context.get(i.KeysQueryOperation.serviceSources)??{};return 0===n.length&&0===Object.keys(a).length?{operation:e.operation,context:e.context}:await(0,s.passFullOperationToSource)(e.operation,n,e.context)?{operation:(0,s.assignOperationSource)(e.operation,n[0]),context:e.context}:{operation:this.assignExhaustive(r,e.operation,n,a),context:e.context.delete(i.KeysInitQuery.queryString)}}assignExhaustive(e,t,r,n){return o.algebraUtils.mapOperation(t,{[o.Algebra.Types.PATTERN]:{preVisitor:()=>({continue:!1}),transform:t=>1===r.length?(0,s.assignOperationSource)(t,r[0]):e.createUnion(r.map((e=>(0,s.assignOperationSource)(t,e))))},[o.Algebra.Types.SERVICE]:{preVisitor:()=>({continue:!1}),transform:t=>{if("NamedNode"===t.name.termType){let r=n[t.name.value];if(r)return t.silent&&(r={...r,context:(r.context??new a.ActionContext).set(i.KeysInitQuery.lenient,!0)}),this.assignExhaustive(e,t.input,[r],{})}return t}},[o.Algebra.Types.CONSTRUCT]:{preVisitor:()=>({continue:!1}),transform:t=>e.createConstruct(this.assignExhaustive(e,t.input,r,n),t.template)},[o.Algebra.Types.LINK]:{preVisitor:()=>({continue:!1}),transform:t=>1===r.length?(0,s.assignOperationSource)(t,r[0]):e.createAlt(r.map((e=>(0,s.assignOperationSource)(t,e))))},[o.Algebra.Types.NPS]:{preVisitor:()=>({continue:!1}),transform:t=>1===r.length?(0,s.assignOperationSource)(t,r[0]):e.createAlt(r.map((e=>(0,s.assignOperationSource)(t,e))))},[o.Algebra.Types.DELETE_INSERT]:{preVisitor:()=>({continue:!1}),transform:t=>e.createDeleteInsert(t.delete,t.insert,t.where?this.assignExhaustive(e,t.where,r,n):void 0)}})}}t.ActorOptimizeQueryOperationAssignSourcesExhaustive=c},42969:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(69309),t)},72123:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationBgpToJoin=void 0;const n=r(37216),i=r(72407),a=r(97356),o=r(34005);class s extends n.ActorOptimizeQueryOperation{async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.AlgebraFactory(t);return{operation:o.algebraUtils.mapOperation(e.operation,{[o.Algebra.Types.BGP]:{preVisitor:()=>({continue:!1}),transform:e=>r.createJoin(e.patterns)}}),context:e.context}}}t.ActorOptimizeQueryOperationBgpToJoin=s},2944:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(72123),t)},35426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationConstructDistinct=void 0;const n=r(37216),i=r(13151),a=r(97356),o=r(34005);class s extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return e.context.has(i.KeysInitQuery.distinctConstruct)?(0,a.passTestVoid)():(0,a.failTest)(`${this.name} was not enabled by the query.`)}async run(e){const t=new o.AlgebraFactory;return{operation:o.algebraUtils.mapOperation(e.operation,{[o.Algebra.Types.CONSTRUCT]:{preVisitor:()=>({continue:!1}),transform:e=>t.createDistinct(t.createConstruct(e.input,e.template))}}),context:e.context.delete(i.KeysInitQuery.distinctConstruct)}}}t.ActorOptimizeQueryOperationConstructDistinct=s},64432:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(35426),t)},63728:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationDescribeToConstructsSubject=void 0;const n=r(37216),i=r(72407),a=r(97356),o=r(34005);class s extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return e.operation.type!==o.Algebra.Types.DESCRIBE?(0,a.failTest)(`Actor ${this.name} only supports describe operations, but got ${e.operation.type}`):(0,a.passTest)(!0)}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.AlgebraFactory(t),n=e.operation,a=n.terms.filter((e=>"Variable"!==e.termType)).map((e=>{const n=[t.quad(e,t.variable("__predicate"),t.variable("__object"))];n.forEach((e=>e.type="pattern"));const i=r.createBgp(n);return r.createConstruct(i,n)}));if(a.length!==n.terms.length){let e=[];n.terms.filter((e=>"Variable"===e.termType)).forEach(((r,n)=>{const i=[t.quad(r,t.variable(`__predicate${n}`),t.variable(`__object${n}`))];i.forEach((e=>e.type="pattern")),e=[...e,...i]})),a.push(r.createConstruct(r.createJoin([n.input,r.createBgp(e)]),e))}return{operation:r.createUnion(a,!1),context:e.context}}}t.ActorOptimizeQueryOperationDescribeToConstructsSubject=s},81831:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(63728),t)},39255:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationDistinctTermsPushdown=void 0;const n=r(37216),i=r(72407),a=r(97356),o=r(34005),s=r(98989);class c extends n.ActorOptimizeQueryOperation{async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.AlgebraFactory(t),n=this.getSources(e.operation),a=new Map(await Promise.all(n.map((async t=>[t,await t.source.getSelectorShape(t.context?e.context.merge(t.context):e.context)]))));return{operation:o.algebraUtils.mapOperation(e.operation,{[o.Algebra.Types.DISTINCT]:{preVisitor:()=>({continue:!1}),transform:e=>{let t;if((0,o.isKnownOperation)(e.input,o.Algebra.Types.PROJECT)&&(0,o.isKnownOperation)(e.input.input,o.Algebra.Types.JOIN)&&1===e.input.input.input.length&&(e.input.input=e.input.input.input[0]),!(0,o.isKnownOperation)(e.input,o.Algebra.Types.PROJECT)||!(0,o.isKnownOperation)(e.input.input,o.Algebra.Types.PATTERN)||!(t=(0,s.getOperationSource)(e.input.input)))return e;const n=this.mapVariablesToTerms(e.input.variables,e.input.input);if(!n)return e;const i=r.createDistinctTerms(e.input.variables,n);return(0,s.doesShapeAcceptOperation)(a.get(t),i)?(0,s.assignOperationSource)(i,t):e}}}),context:e.context}}getSources(e){const t=new Set;return o.algebraUtils.visitOperation(e,{[o.Algebra.Types.PATTERN]:{visitor:e=>{const r=(0,s.getOperationSource)(e);return r&&t.add(r),!1}}}),[...t]}mapVariablesToTerms(e,t){const r={},n=[{term:t.subject,position:"subject"},{term:t.predicate,position:"predicate"},{term:t.object,position:"object"},{term:t.graph,position:"graph"}];for(const t of e){let e=!1;for(const{term:i,position:a}of n)if("Variable"===i.termType&&i.equals(t)){r[t.value]=a,e=!0;break}if(!e)return}return r}}t.ActorOptimizeQueryOperationDistinctTermsPushdown=c},39174:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(39255),t)},33992:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationFilterPushdown=void 0;const n=r(37216),i=r(72407),a=r(97356),o=r(34005),s=r(98989),c=r(13252);class u extends n.ActorOptimizeQueryOperation{aggressivePushdown;maxIterations;splitConjunctive;mergeConjunctive;pushIntoLeftJoins;pushEqualityIntoPatterns;constructor(e){super(e),this.aggressivePushdown=e.aggressivePushdown,this.maxIterations=e.maxIterations,this.splitConjunctive=e.splitConjunctive,this.mergeConjunctive=e.mergeConjunctive,this.pushIntoLeftJoins=e.pushIntoLeftJoins,this.pushEqualityIntoPatterns=e.pushEqualityIntoPatterns}async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.AlgebraFactory(t);let n=e.operation;this.splitConjunctive&&(n=o.algebraUtils.mapOperation(n,{[o.Algebra.Types.FILTER]:{transform:t=>(0,o.isKnownSubType)(t.expression,o.Algebra.ExpressionTypes.OPERATOR)&&"&&"===t.expression.operator?(this.logDebug(e.context,`Split conjunctive filter into ${t.expression.args.length} nested filters`),t.expression.args.reduce(((e,t)=>r.createFilter(e,t)),t.input)):t}}));const a=this.getSources(n),c=new Map(await Promise.all(a.map((async t=>[t,await t.source.getSelectorShape(t.context?e.context.merge(t.context):e.context)]))));let u=!0,l=0;for(;u&&l{const n=e.context.get(i.KeysInitQuery.extensionFunctions),o=e.context.get(i.KeysInitQuery.extensionFunctionsAlwaysPushdown);if(!this.shouldAttemptPushDown(t,a,c,n,o))return t;const l=(0,s.getExpressionVariables)(t.expression),[d,p]=this.filterPushdown(t.expression,l,t.input,r,e.context);return d&&(u=!0),p}}}),l++;return l>1&&this.logDebug(e.context,`Pushed down filters in ${l} iterations`),this.mergeConjunctive&&(n=o.algebraUtils.mapOperation(n,{[o.Algebra.Types.FILTER]:{transform:t=>{if(t.input.type===o.Algebra.Types.FILTER){const{nestedExpressions:n,input:i}=this.getNestedFilterExpressions(t);return this.logDebug(e.context,`Merge ${n.length} nested filters into conjunctive filter`),r.createFilter(i,n.slice(1).reduce(((e,t)=>r.createOperatorExpression("&&",[e,t])),n[0]))}return t}}})),{operation:n,context:e.context}}shouldAttemptPushDown(e,t,r,n,i){if(this.aggressivePushdown)return!0;const a=e.expression;return!(!(0,o.isKnownSubType)(a,o.Algebra.ExpressionTypes.OPERATOR)||"="!==a.operator||!((0,o.isKnownSubType)(a.args[0],o.Algebra.ExpressionTypes.TERM)&&"Variable"!==a.args[0].term.termType&&(0,o.isKnownSubType)(a.args[1],o.Algebra.ExpressionTypes.TERM)&&"Variable"===a.args[1].term.termType||(0,o.isKnownSubType)(a.args[0],o.Algebra.ExpressionTypes.TERM)&&"Variable"===a.args[0].term.termType&&(0,o.isKnownSubType)(a.args[1],o.Algebra.ExpressionTypes.TERM)&&"Variable"!==a.args[1].term.termType))||!(n&&(0,o.isKnownSubType)(a,o.Algebra.ExpressionTypes.NAMED)&&a.name.value in n&&!t.some((e=>(0,s.doesShapeAcceptOperation)(r.get(e),a))))&&!!t.some((t=>(0,s.doesShapeAcceptOperation)(r.get(t),e,{wildcardAcceptAllExtensionFunctions:i})))}getSources(e){const t=new Set,r=e=>{const r=(0,s.getOperationSource)(e);return r&&t.add(r),!1};return o.algebraUtils.visitOperation(e,{[o.Algebra.Types.PATTERN]:{visitor:r},[o.Algebra.Types.SERVICE]:{visitor:r},[o.Algebra.Types.LINK]:{visitor:r},[o.Algebra.Types.NPS]:{visitor:r}}),[...t]}getOverlappingOperations(e,t){const r=[],n=[],i=[];for(const a of e.input){const e=o.algebraUtils.inScopeVariables(a);this.variablesSubSetOf(t,e)?r.push(a):this.variablesIntersect(t,e)?n.push(a):i.push(a)}return{fullyOverlapping:r,partiallyOverlapping:n,notOverlapping:i}}filterPushdown(e,t,r,n,i){if(this.isExpressionFalse(e))return[!0,n.createUnion([])];if((0,o.isKnownOperation)(e,o.Algebra.Types.EXPRESSION,o.Algebra.ExpressionTypes.EXISTENCE))return[!1,n.createFilter(r,e)];if((0,o.isKnownOperation)(r,o.Algebra.Types.EXTEND))return this.variablesIntersect([r.variable],t)?[!1,n.createFilter(r,e)]:[!0,n.createExtend(this.filterPushdown(e,t,r.input,n,i)[1],r.variable,r.expression)];if((0,o.isKnownOperation)(r,o.Algebra.Types.FILTER)){const[a,o]=this.filterPushdown(e,t,r.input,n,i);return[a,n.createFilter(o,r.expression)]}if((0,o.isKnownOperation)(r,o.Algebra.Types.JOIN)){if(0===r.input.length)return[!1,n.createFilter(r,e)];const{fullyOverlapping:a,partiallyOverlapping:o,notOverlapping:s}=this.getOverlappingOperations(r,t),c=[];let u=!1;return a.length>0&&(u=!0,c.push(n.createJoin(a.map((r=>this.filterPushdown(e,t,r,n,i)[1]))))),o.length>0&&c.push(n.createFilter(n.createJoin(o,!1),e)),s.length>0&&c.push(...s),c.length>1&&(u=!0),u&&this.logDebug(i,`Push down filter across join entries with ${a.length} fully overlapping, ${o.length} partially overlapping, and ${s.length} not overlapping`),[u,1===c.length?c[0]:n.createJoin(c)]}if((0,o.isKnownOperation)(r,o.Algebra.Types.NOP))return[!0,r];if((0,o.isKnownOperation)(r,o.Algebra.Types.PROJECT))return this.variablesIntersect(r.variables,t)?[!0,n.createProject(this.filterPushdown(e,t,r.input,n,i)[1],r.variables)]:[!0,r];if((0,o.isKnownOperation)(r,o.Algebra.Types.UNION)){const{fullyOverlapping:a,partiallyOverlapping:o,notOverlapping:s}=this.getOverlappingOperations(r,t),c=[];let u=!1;return a.length>0&&(u=!0,c.push(n.createUnion(a.map((r=>this.filterPushdown(e,t,r,n,i)[1]))))),o.length>0&&c.push(n.createFilter(n.createUnion(o,!1),e)),s.length>0&&c.push(...s),c.length>1&&(u=!0),u&&this.logDebug(i,`Push down filter across union entries with ${a.length} fully overlapping, ${o.length} partially overlapping, and ${s.length} not overlapping`),[u,1===c.length?c[0]:n.createUnion(c)]}if((0,o.isKnownOperation)(r,o.Algebra.Types.VALUES))return this.variablesIntersect(r.variables,t)?[!1,n.createFilter(r,e)]:[!0,r];if((0,o.isKnownOperation)(r,o.Algebra.Types.LEFT_JOIN)){if(this.pushIntoLeftJoins){const a=o.algebraUtils.inScopeVariables(r.input[1]);if(!this.variablesIntersect(t,a))return this.logDebug(i,"Push down filter into left join"),[!0,n.createLeftJoin(this.filterPushdown(e,t,r.input[0],n,i)[1],r.input[1],r.expression)]}return[!1,n.createFilter(r,e)]}if((0,o.isKnownOperation)(r,o.Algebra.Types.PATTERN)){if(this.pushEqualityIntoPatterns){const t=this.getEqualityExpressionPushableIntoPattern(e);if(t){let e=!1;const a=r.metadata;if((r=(0,c.mapTermsNested)(r,(r=>r.equals(t.variable)?(e=!0,t.term):r))).type=o.Algebra.Types.PATTERN,r.metadata=a,e)return this.logDebug(i,`Push down filter into pattern for ?${t.variable.value}`),[!0,n.createJoin([r,n.createValues([t.variable],[{[t.variable.value]:t.term}])])]}}return[!1,n.createFilter(r,e)]}if((0,o.isKnownOperation)(r,o.Algebra.Types.PATH)){if(this.pushEqualityIntoPatterns){const t=this.getEqualityExpressionPushableIntoPattern(e);if(t&&(r.subject.equals(t.variable)||r.object.equals(t.variable))){this.logDebug(i,`Push down filter into path for ?${t.variable.value}`);const e=r.metadata;return(r=n.createPath(r.subject.equals(t.variable)?t.term:r.subject,r.predicate,r.object.equals(t.variable)?t.term:r.object)).metadata=e,[!0,n.createJoin([r,n.createValues([t.variable],[{[t.variable.value]:t.term}])])]}}return[!1,n.createFilter(r,e)]}return[!1,n.createFilter(r,e)]}getEqualityExpressionPushableIntoPattern(e){if((0,o.isKnownSubType)(e,o.Algebra.ExpressionTypes.OPERATOR)&&"="===e.operator){const t=e.args[0],r=e.args[1];if((0,o.isKnownSubType)(t,o.Algebra.ExpressionTypes.TERM)&&"Variable"!==t.term.termType&&("Literal"!==t.term.termType||this.isLiteralWithCanonicalLexicalForm(t.term))&&(0,o.isKnownSubType)(r,o.Algebra.ExpressionTypes.TERM)&&"Variable"===r.term.termType)return{variable:r.term,term:t.term};if((0,o.isKnownSubType)(t,o.Algebra.ExpressionTypes.TERM)&&"Variable"===t.term.termType&&(0,o.isKnownSubType)(r,o.Algebra.ExpressionTypes.TERM)&&"Variable"!==r.term.termType&&("Literal"!==r.term.termType||this.isLiteralWithCanonicalLexicalForm(r.term)))return{variable:t.term,term:r.term}}}isLiteralWithCanonicalLexicalForm(e){switch(e.datatype.value){case"http://www.w3.org/2001/XMLSchema#string":case"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString":case"http://www.w3.org/2001/XMLSchema#normalizedString":case"http://www.w3.org/2001/XMLSchema#anyURI":case"http://www.w3.org/2001/XMLSchema#base64Binary":case"http://www.w3.org/2001/XMLSchema#language":case"http://www.w3.org/2001/XMLSchema#Name":case"http://www.w3.org/2001/XMLSchema#NCName":case"http://www.w3.org/2001/XMLSchema#NMTOKEN":case"http://www.w3.org/2001/XMLSchema#token":case"http://www.w3.org/2001/XMLSchema#hexBinary":return!0}return!1}variablesIntersect(e,t){return e.some((e=>t.some((t=>e.equals(t)))))}variablesSubSetOf(e,t){return e.length<=t.length&&e.every((e=>t.some((t=>e.equals(t)))))}isExpressionFalse(e){const t=e;return t.term&&"Literal"===t.term.termType&&"false"===t.term.value}getNestedFilterExpressions(e){if((0,o.isKnownOperation)(e.input,o.Algebra.Types.FILTER)){const t=this.getNestedFilterExpressions(e.input);return{nestedExpressions:[e.expression,...t.nestedExpressions],input:t.input}}return{nestedExpressions:[e.expression],input:e.input}}}t.ActorOptimizeQueryOperationFilterPushdown=u},77937:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(33992),t)},30965:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationGroupFileSources=void 0;const n=r(37216),i=r(72407),a=r(97356);class o extends n.ActorOptimizeQueryOperation{static updateOperationTypes=new Set(["compositeupdate","deleteinsert","load","clear","create","drop","add","move","copy"]);mediatorQuerySourceIdentify;constructor(e){super(e),this.mediatorQuerySourceIdentify=e.mediatorQuerySourceIdentify}async test(e){return e.context.get(i.KeysQuerySourceIdentify.traverse)?(0,a.failTest)(`Actor ${this.name} does not work in traversal mode.`):o.updateOperationTypes.has(e.operation.type)?(0,a.failTest)(`Actor ${this.name} does not work for SPARQL Update operations.`):(0,a.passTestVoid)()}async run(e){const t=e.context.get(i.KeysQueryOperation.querySources)??[];if(t.length<2)return{operation:e.operation,context:e.context};const r=(await Promise.all(t.map((async t=>({wrapper:t,filterFactor:await this.getFilterFactorSafe(t,e.context)}))))).filter((e=>0===e.filterFactor)).map((e=>e.wrapper));if(r.length<2)return{operation:e.operation,context:e.context};const{querySource:n}=await this.mediatorQuerySourceIdentify.mediate({querySourceUnidentified:{type:"compositefile",value:r},context:e.context}),a=new Set(r),o=[...t.filter((e=>!a.has(e))),n];return{operation:e.operation,context:e.context.set(i.KeysQueryOperation.querySources,o)}}async getFilterFactorSafe(e,t){const r=e.source.firstLink;if(void 0!==r)return"file"===r.forceSourceType?0:e.source.getFilterFactor(t)}}t.ActorOptimizeQueryOperationGroupFileSources=o},75751:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(30965),t)},44044:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationGroupSources=void 0;const n=r(37216),i=r(72407),a=r(97356),o=r(34005),s=r(98989);class c extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return(0,s.getOperationSource)(e.operation)?(0,a.failTest)(`Actor ${this.name} does not work with top-level operation sources.`):(0,a.passTestVoid)()}async run(e){return{operation:await this.groupOperation(e.operation,e.context),context:e.context}}async groupOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new o.AlgebraFactory(r);if((0,s.getOperationSource)(e)??!("input"in e))return e;if(!Array.isArray(e.input)){const r=await this.groupOperation(e.input,t);if(r.metadata?.scopedSource){const n=(0,s.getOperationSource)(r);e=await this.moveSourceAnnotationUpwardsIfPossible(e,[r],n,t)}return{...e,input:r}}const a=await Promise.all(e.input.map((e=>this.groupOperation(e,t)))),c=this.clusterOperationsWithEqualSources(a);if(1===c.length){const r=c[0],n=(0,s.getOperationSource)(c[0][0]);return{...await this.moveSourceAnnotationUpwardsIfPossible(e,r,n,t),input:r}}if(c.length===a.length)return{...e,input:a};let u;if((0,o.isKnownOperation)(e,o.Algebra.Types.JOIN))u=n.createJoin.bind(n);else if((0,o.isKnownOperation)(e,o.Algebra.Types.UNION))u=n.createUnion.bind(n);else if((0,o.isKnownOperation)(e,o.Algebra.Types.ALT))u=n.createAlt.bind(n);else{if(!(0,o.isKnownOperation)(e,o.Algebra.Types.SEQ))throw new Error(`Unsupported operation '${e.type}' detected while grouping sources`);u=n.createSeq.bind(n)}return await this.groupOperationMulti(c,u,t)}async groupOperationMulti(e,t,r){let n=!0;const i=await Promise.all(e.map((async e=>{const i=(0,s.getOperationSource)(e[0]),a=await this.moveSourceAnnotationUpwardsIfPossible(t(e,!0),e,i,r);return(0,s.getOperationSource)(a)&&(n=!1),a})));return t(i,n)}clusterOperationsWithEqualSources(e){const t=new Map,r=[];for(const n of e){const e=(0,s.getOperationSource)(n);e?(t.has(e)||t.set(e,[]),t.get(e).push(n)):r.push(n)}const n=[];r.length>0&&n.push(r);for(const[e,r]of t.entries())n.push(r.map((t=>(0,s.assignOperationSource)(t,e))));return n}async moveSourceAnnotationUpwardsIfPossible(e,t,r,n){if(r&&this.isPossibleToMoveSourceAnnotationUpwards(e,await r.source.getSelectorShape(n),n)){this.logDebug(n,`Hoist ${t.length} source-specific operations into a single ${e.type} operation for ${r.source.toString()}`),e=(0,s.assignOperationSource)(e,r);for(const e of t)(0,s.removeOperationSource)(e)}return e}isPossibleToMoveSourceAnnotationUpwards(e,t,r){const n=r.get(i.KeysInitQuery.extensionFunctionsAlwaysPushdown);if((0,s.doesShapeAcceptOperation)(t,e,{wildcardAcceptAllExtensionFunctions:n})){const a=r.get(i.KeysInitQuery.extensionFunctions),c=e.expression;return!a||!(c&&(0,o.isKnownSubType)(c,o.Algebra.ExpressionTypes.NAMED))||!(c?.name.value in a)||(0,s.doesShapeAcceptOperation)(t,c,{wildcardAcceptAllExtensionFunctions:n})}return!1}}t.ActorOptimizeQueryOperationGroupSources=c},58092:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(44044),t)},84166:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationJoinBgp=void 0;const n=r(37216),i=r(72407),a=r(97356),o=r(34005);class s extends n.ActorOptimizeQueryOperation{async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.AlgebraFactory(t);return{operation:o.algebraUtils.mapOperation(e.operation,{[o.Algebra.Types.JOIN]:{preVisitor:()=>({continue:!1}),transform:e=>e.input.every((e=>"bgp"===e.type))?r.createBgp(e.input.flatMap((e=>e.patterns))):e}}),context:e.context}}}t.ActorOptimizeQueryOperationJoinBgp=s},77760:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(84166),t)},93598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationJoinConnected=void 0;const n=r(37216),i=r(72407),a=r(97356),o=r(34005);class s extends n.ActorOptimizeQueryOperation{async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.AlgebraFactory(t);return{operation:o.algebraUtils.mapOperation(e.operation,{[o.Algebra.Types.JOIN]:{preVisitor:()=>({continue:!1}),transform:e=>s.cluster(e,r)}}),context:e.context}}static cluster(e,t){let r,n=e.input.map((e=>({inScopeVariables:Object.fromEntries(o.algebraUtils.inScopeVariables(e).map((e=>[e.value,!0]))),entries:[e]})));do{r=n,n=s.clusterIteration(r)}while(r.length!==n.length);const i=n.map((e=>1===e.entries.length?e.entries[0]:t.createJoin(e.entries)));return 1===i.length?i[0]:t.createJoin(i,!1)}static clusterIteration(e){const t=[];for(const r of e){let e=!1;for(const n of t)if(s.haveOverlappingVariables(r.inScopeVariables,n.inScopeVariables)){n.entries=[...n.entries,...r.entries],n.inScopeVariables={...n.inScopeVariables,...r.inScopeVariables},e=!0;break}e||t.push({inScopeVariables:r.inScopeVariables,entries:r.entries})}return t}static haveOverlappingVariables(e,t){for(const r of Object.keys(e))if(t[r])return!0;return!1}}t.ActorOptimizeQueryOperationJoinConnected=s},25982:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(93598),t)},88385:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationLeftjoinExpressionPushdown=void 0;const n=r(37216),i=r(72407),a=r(97356),o=r(34005),s=r(98989);class c extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.AlgebraFactory(t);let n=e.operation;const a=this;return n=o.algebraUtils.mapOperation(n,{[o.Algebra.Types.LEFT_JOIN]:{transform:t=>{if(t.expression){const n=(0,s.getExpressionVariables)(t.expression),i=o.algebraUtils.inScopeVariables(t.input[0]),c=o.algebraUtils.inScopeVariables(t.input[1]),u=a.variablesIntersect(n,i),l=a.variablesIntersect(n,c);if(!u&&l)return a.logDebug(e.context,"Pushed down optional expression to right-hand operator"),r.createLeftJoin(t.input[0],r.createFilter(t.input[1],t.expression))}return t}}}),{operation:n,context:e.context}}variablesIntersect(e,t){return e.some((e=>t.some((t=>e.equals(t)))))}}t.ActorOptimizeQueryOperationLeftjoinExpressionPushdown=c},26121:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(88385),t)},82478:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationPruneEmptySourceOperations=void 0;const n=r(37216),i=r(72407),a=r(97356),o=r(34005),s=r(98989);class c extends n.ActorOptimizeQueryOperation{useAskIfSupported;constructor(e){super(e),this.useAskIfSupported=e.useAskIfSupported}async test(e){return(0,s.getOperationSource)(e.operation)?(0,a.failTest)(`Actor ${this.name} does not work with top-level operation sources.`):(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.AlgebraFactory(t);let n=e.operation;const a=[];o.algebraUtils.visitOperation(n,{[o.Algebra.Types.UNION]:{preVisitor:e=>(this.collectMultiOperationInputs(e.input,a,o.Algebra.Types.PATTERN),{})},[o.Algebra.Types.ALT]:{preVisitor:e=>(this.collectMultiOperationInputs(e.input,a,o.Algebra.Types.LINK),{continue:!1})},[o.Algebra.Types.SERVICE]:{preVisitor:()=>({continue:!1})}});const u=new Set;return await Promise.all(a.map((async n=>{const i=n.type===o.Algebra.Types.LINK?r.createPattern(t.variable("s"),n.iri,t.variable("?o")):n;await this.hasSourceResults(r,(0,s.getOperationSource)(n),i,e.context)||u.add(n)}))),u.size>0&&(this.logDebug(e.context,`Pruning ${u.size} source-specific operations`),n=o.algebraUtils.mapOperation(n,{[o.Algebra.Types.UNION]:{transform:(e,t)=>this.mapMultiOperation(e,t,u,(e=>r.createUnion(e)))},[o.Algebra.Types.ALT]:{transform:(e,t)=>this.mapMultiOperation(e,t,u,(e=>r.createAlt(e)))},[o.Algebra.Types.PROJECT]:{transform:e=>c.hasEmptyOperation(e)?r.createUnion([]):e},[o.Algebra.Types.LEFT_JOIN]:{transform:e=>c.hasEmptyOperation(e.input[1])?e.input[0]:e}})),{operation:n,context:e.context}}static hasEmptyOperation(e){let t=!1;return o.algebraUtils.visitOperation(e,{[o.Algebra.Types.UNION]:{preVisitor:e=>e.input.every((e=>c.hasEmptyOperation(e)))?(t=!0,{shortcut:!0}):{continue:!1}},[o.Algebra.Types.LEFT_JOIN]:{preVisitor:e=>c.hasEmptyOperation(e.input[0])?(t=!0,{shortcut:!0}):{continue:!1}},[o.Algebra.Types.ALT]:{preVisitor:e=>0===e.input.length?(t=!0,{shortcut:!0}):{continue:!1}}}),t}collectMultiOperationInputs(e,t,r){for(const n of e)(0,s.getOperationSource)(n)&&(0,o.isKnownOperation)(n,r)&&t.push(n)}mapMultiOperation(e,t,r,n){const i=[];for(const[n,a]of e.input.entries())r.has(t.input[n])||i.push(a);return i.length===e.input.length?e:0===i.length?n([]):1===i.length?i[0]:n(i)}async hasSourceResults(e,t,r,n){const a=t.context?n.merge(t.context):n,o=a.get(i.KeysInitQuery.extensionFunctionsAlwaysPushdown);if(a.get(i.KeysQuerySourceIdentify.traverse))return!0;if(this.useAskIfSupported){const i=e.createAsk(r);if((0,s.doesShapeAcceptOperation)(await t.source.getSelectorShape(n),i,{wildcardAcceptAllExtensionFunctions:o}))return t.source.queryBoolean(i,a)}const c=t.source.queryBindings(r,a),u=await new Promise(((e,t)=>{c.on("error",t),c.getProperty("metadata",(t=>{c.destroy(),e(t.cardinality)}))}));if("estimate"===u.type&&u.value>0){const i=e.createAsk(r);if((0,s.doesShapeAcceptOperation)(await t.source.getSelectorShape(n),i,{wildcardAcceptAllExtensionFunctions:o}))return t.source.queryBoolean(i,a)}return u.value>0}}t.ActorOptimizeQueryOperationPruneEmptySourceOperations=c},23627:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(82478),t)},9525:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationQuerySourceIdentify=void 0;const n=r(37216),i=r(72407),a=r(97356),o=r(34005),s=r(98989),c=r(35069);class u extends n.ActorOptimizeQueryOperation{serviceForceSparqlEndpoint;cacheSize;httpInvalidator;mediatorQuerySourceIdentify;mediatorContextPreprocess;cache;constructor(e){super(e),this.serviceForceSparqlEndpoint=e.serviceForceSparqlEndpoint,this.cacheSize=e.cacheSize,this.httpInvalidator=e.httpInvalidator,this.mediatorQuerySourceIdentify=e.mediatorQuerySourceIdentify,this.mediatorContextPreprocess=e.mediatorContextPreprocess,this.cache=this.cacheSize?new c.LRUCache({max:this.cacheSize}):void 0;const t=this.cache;t&&this.httpInvalidator.addInvalidateListener((({url:e})=>e?t.delete(e):t.clear()))}async test(e){return(0,a.passTestVoid)()}async run(e){let t,r=e.context;if(r.has(i.KeysInitQuery.querySourcesUnidentified)){const n=e.context.get(i.KeysInitQuery.querySourcesUnidentified),a=await Promise.all(n.map((e=>this.expandSource(e))));t=await Promise.all(a.map((async t=>this.identifySource(t,e.context))));const o=e.context.get(i.KeysStatistics.dereferencedLinks);if(o)for(const e of t)o.updateStatistic({url:e.source.referenceValue,metadata:{seed:!0}},e.source);r=r.delete(i.KeysInitQuery.querySourcesUnidentified).set(i.KeysQueryOperation.querySources,t)}if(!await(0,s.passFullOperationToSource)(e.operation,t??[],r)){const t=new Set;o.algebraUtils.visitOperation(e.operation,{[o.Algebra.Types.SERVICE]:{preVisitor:()=>({continue:!1}),visitor:e=>{"NamedNode"===e.name.termType&&t.add(e.name.value)}}});const n=Object.fromEntries(await Promise.all([...t].map((async e=>[e,await this.identifySource({type:this.serviceForceSparqlEndpoint?"sparql":void 0,value:e},r)]))));t.size>0&&(r=r.set(i.KeysQueryOperation.serviceSources,n))}return{context:r,operation:e.operation}}async expandSource(e){return"string"==typeof e||"match"in e?{value:e}:{...e,context:(await this.mediatorContextPreprocess.mediate({context:a.ActionContext.ensureActionContext(e.context??{})})).context}}identifySource(e,t){let r;return"string"==typeof e.value&&this.cache&&(r=this.cache.get(e.value)),r||(r=this.mediatorQuerySourceIdentify.mediate({querySourceUnidentified:e,context:t}).then((({querySource:e})=>e)),"string"==typeof e.value&&this.cache&&this.cache.set(e.value,r)),r}}t.ActorOptimizeQueryOperationQuerySourceIdentify=u},54941:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(9525),t)},22491:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationQuerySourceSkolemize=void 0;const n=r(37216),i=r(72407),a=r(97356),o=r(85632),s=r(31261);class c extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){let t=e.context;t.has(i.KeysQuerySourceIdentify.sourceIds)||(t=t.set(i.KeysQuerySourceIdentify.sourceIds,new Map));const r=t.getSafe(i.KeysQuerySourceIdentify.sourceIds);if(t.has(i.KeysQueryOperation.querySources)){let e=t.getSafe(i.KeysQueryOperation.querySources);e=e.map((e=>({source:new o.QuerySourceSkolemized(e.source,(0,s.getSourceId)(r,e.source)),context:e.context}))),t=t.set(i.KeysQueryOperation.querySources,e)}if(t.has(i.KeysQueryOperation.serviceSources)){let e=t.getSafe(i.KeysQueryOperation.serviceSources);e=Object.fromEntries(Object.entries(e).map((([e,t])=>[e,{source:new o.QuerySourceSkolemized(t.source,(0,s.getSourceId)(r,t.source)),context:t.context}]))),t=t.set(i.KeysQueryOperation.serviceSources,e)}return{context:t,operation:e.operation}}}t.ActorOptimizeQueryOperationQuerySourceSkolemize=c},85632:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuerySourceSkolemized=void 0;const n=r(72407),i=r(49102),a=r(76664),o=r(31261);t.QuerySourceSkolemized=class{innerSource;sourceId;constructor(e,t){this.innerSource=e,this.sourceId=t}async getSelectorShape(e){return this.innerSource.getSelectorShape(e)}async getFilterFactor(e){return await this.innerSource.getFilterFactor(e)}queryBindings(e,t,r){const s=t.getSafe(n.KeysInitQuery.dataFactory),c=(0,o.deskolemizeOperation)(s,e,this.sourceId);if(!c){const e=new a.ArrayIterator([],{autoStart:!1});return e.setProperty("metadata",{state:new i.MetadataValidationState,cardinality:{type:"exact",value:0},variables:[]}),e}return(0,o.skolemizeBindingsStream)(s,this.innerSource.queryBindings(c,t,r),this.sourceId)}queryBoolean(e,t){return this.innerSource.queryBoolean(e,t)}queryQuads(e,t){const r=t.getSafe(n.KeysInitQuery.dataFactory),s=(0,o.deskolemizeOperation)(r,e,this.sourceId);if(!s){const e=new a.ArrayIterator([],{autoStart:!1});return e.setProperty("metadata",{state:new i.MetadataValidationState,cardinality:{type:"exact",value:0}}),e}return(0,o.skolemizeQuadStream)(r,this.innerSource.queryQuads(s,t),this.sourceId)}queryVoid(e,t){return this.innerSource.queryVoid(e,t)}get referenceValue(){return this.innerSource.referenceValue}toString(){return`${this.innerSource.toString()}(SkolemID:${this.sourceId})`}}},87092:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(22491),t),i(r(85632),t),i(r(31261),t)},31261:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SKOLEM_PREFIX=void 0,t.getSourceId=function(e,t){let r=e.get(t.referenceValue);return void 0===r&&(r=`${e.size}`,e.set(t.referenceValue,r)),r},t.skolemizeTerm=o,t.skolemizeQuad=s,t.skolemizeBindings=c,t.skolemizeQuadStream=function(e,t,r){const n=t.map((t=>s(e,t,r)));return function e(){t.getProperty("metadata",(t=>{n.setProperty("metadata",t),t.state.addInvalidateListener(e)}))}(),n},t.skolemizeBindingsStream=function(e,t,r){const n=t.map((t=>c(e,t,r)));return function e(){t.getProperty("metadata",(t=>{n.setProperty("metadata",t),t.state.addInvalidateListener(e)}))}(),n},t.deskolemizeTerm=u,t.deskolemizeTermNestedThrowing=l,t.deskolemizeQuad=function(e,t,r){return(0,a.mapTermsNested)(t,(t=>u(e,t,r)??t))},t.deskolemizeOperation=function(e,t,r){const i=new n.AlgebraFactory;try{return n.algebraUtils.mapOperation(t,{[n.Algebra.Types.PATTERN]:{preVisitor:()=>({continue:!1}),transform:t=>Object.assign(i.createPattern(l(e,t.subject,r),l(e,t.predicate,r),l(e,t.object,r),l(e,t.graph,r)),{metadata:t.metadata})},[n.Algebra.Types.PATH]:{preVisitor:()=>({continue:!1}),transform:t=>Object.assign(i.createPath(l(e,t.subject,r),t.predicate,l(e,t.object,r),l(e,t.graph,r)),{metadata:t.metadata})}})}catch{}};const n=r(34005),i=r(98080),a=r(13252);function o(e,r,n){return"BlankNode"===r.termType?new i.BlankNodeScoped(`bc_${n}_${r.value}`,e.namedNode(`${t.SKOLEM_PREFIX}${n}:${r.value}`)):r}function s(e,t,r){return(0,a.mapTermsNested)(t,(t=>o(e,t,r)))}function c(e,t,r){return t.map((t=>"Quad"===t.termType?s(e,t,r):o(e,t,r)))}function u(e,r,n){if("BlankNode"===r.termType&&"skolemized"in r&&(r=r.skolemized),"NamedNode"===r.termType&&r.value.startsWith(t.SKOLEM_PREFIX)){const i=r.value.indexOf(":",t.SKOLEM_PREFIX.length);if(r.value.slice(t.SKOLEM_PREFIX.length,i)===n){const t=r.value.slice(i+1,r.value.length);return e.blankNode(t)}return null}return r}function l(e,t,r){if("Quad"===t.termType)return(0,a.mapTermsNested)(t,(t=>{const n=u(e,t,r);if(!n)throw new Error("Skolemized term is not in scope for this source");return n}));const n=u(e,t,r);if(null===n)throw new Error("Skolemized term is not in scope for this source");return n}t.SKOLEM_PREFIX="urn:comunica_skolem:source_"},85354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationRewriteAdd=void 0;const n=r(37216),i=r(72407),a=r(97356),o=r(34005),s=new(r(18050).DataFactory);class c extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.AlgebraFactory(t);return{operation:o.algebraUtils.mapOperation(e.operation,{[o.Algebra.Types.ADD]:{preVisitor:()=>({shortcut:!0}),transform:e=>{const t="DEFAULT"===e.destination?s.defaultGraph():e.destination,n="DEFAULT"===e.source?s.defaultGraph():e.source;return r.createDeleteInsert(void 0,[r.createPattern(s.variable("s"),s.variable("p"),s.variable("o"),t)],r.createPattern(s.variable("s"),s.variable("p"),s.variable("o"),n))}}}),context:e.context}}}t.ActorOptimizeQueryOperationRewriteAdd=c},49222:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(85354),t)},21520:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationRewriteCopy=void 0;const n=r(37216),i=r(72407),a=r(97356),o=r(34005);class s extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.AlgebraFactory(t);return{operation:o.algebraUtils.mapOperation(e.operation,{[o.Algebra.Types.COPY]:{preVisitor:()=>({continue:!1}),transform:e=>"string"==typeof e.destination&&"string"==typeof e.source&&e.destination===e.source||"string"!=typeof e.destination&&"string"!=typeof e.source&&e.destination.equals(e.source)?r.createCompositeUpdate([]):r.createCompositeUpdate([r.createDrop(e.destination,!0),r.createAdd(e.source,e.destination,e.silent)])}}),context:e.context}}}t.ActorOptimizeQueryOperationRewriteCopy=s},92834:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(21520),t)},49560:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationRewriteMove=void 0;const n=r(37216),i=r(72407),a=r(97356),o=r(34005);class s extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.AlgebraFactory(t);return{operation:o.algebraUtils.mapOperation(e.operation,{[o.Algebra.Types.MOVE]:{preVisitor:()=>({continue:!1}),transform:e=>{if("string"==typeof e.destination&&"string"==typeof e.source&&e.destination===e.source||"string"!=typeof e.destination&&"string"!=typeof e.source&&e.destination.equals(e.source))return r.createCompositeUpdate([]);const t=[r.createDrop(e.destination,!0),r.createAdd(e.source,e.destination,e.silent),r.createDrop(e.source)];return r.createCompositeUpdate(t)}}}),context:e.context}}}t.ActorOptimizeQueryOperationRewriteMove=s},20666:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(49560),t)},91176:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationAsk=void 0;const n=r(23034),i=r(97356),a=r(34005),o=r(98989);class s extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,a.Algebra.Types.ASK)}async testOperation(e,t){return(0,i.passTestVoid)()}async runOperation(e,t){const r=await this.mediatorQueryOperation.mediate({operation:e.input,context:t}),{bindingsStream:n}=(0,o.getSafeBindings)(r);return{type:"boolean",execute:async()=>1===(await n.take(1).toArray()).length}}}t.ActorQueryOperationAsk=s},28349:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(91176),t)},3303:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationBgpJoin=void 0;const n=r(23034),i=r(72407),a=r(97356),o=r(34005);class s extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,o.Algebra.Types.BGP)}async testOperation(e,t){return(0,a.passTestVoid)()}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new o.AlgebraFactory(r);return this.mediatorQueryOperation.mediate({operation:n.createJoin(e.patterns),context:t})}}t.ActorQueryOperationBgpJoin=s},82340:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(3303),t)},41208:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationConstruct=void 0;const n=r(23034),i=r(72407),a=r(97356),o=r(34005),s=r(98989),c=r(13252),u=r(75158);class l extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,o.Algebra.Types.CONSTRUCT)}static getVariables(e){return(0,c.uniqTerms)([].concat.apply([],e.map((e=>(0,c.getVariables)((0,c.getTermsNested)(e))))))}async testOperation(e,t){return(0,a.passTestVoid)()}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new o.AlgebraFactory(r),a=l.getVariables(e.template),c=n.createProject(e.input,a),d=(0,s.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:c,context:t}));return{metadata:()=>d.metadata().then((t=>({...t,order:void 0,cardinality:{type:t.cardinality.type,value:t.cardinality.value*e.template.length},availableOrders:void 0}))),quadStream:new u.BindingsToQuadsIterator(r,e.template,d.bindingsStream),type:"quads"}}}t.ActorQueryOperationConstruct=l},75158:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingsToQuadsIterator=void 0;const n=r(76664),i=r(13252);class a extends n.MultiTransformIterator{dataFactory;template;blankNodeCounter;constructor(e,t,r){super(r,{autoStart:!1}),this.dataFactory=e,this.template=t,this.blankNodeCounter=0}static bindTerm(e,t){return"Variable"===t.termType?e.get(t):t}static bindQuad(e,t){try{return(0,i.mapTermsNested)(t,(t=>{const r=a.bindTerm(e,t);if(!r)throw new Error("Unbound term");return r}))}catch{}}static localizeBlankNode(e,t,r){return"BlankNode"===r.termType?e.blankNode(`${r.value}${t}`):r}static localizeQuad(e,t,r){return(0,i.mapTermsNested)(r,(r=>a.localizeBlankNode(e,t,r)))}bindTemplate(e,t,r){return t.map(a.localizeQuad.bind(null,this.dataFactory,r)).map((t=>a.bindQuad.bind(null,e)(t))).filter(Boolean)}_createTransformer(e){return new n.ArrayIterator(this.bindTemplate(e,this.template,this.blankNodeCounter++),{autoStart:!1})}}t.BindingsToQuadsIterator=a},31289:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(41208),t),i(r(75158),t)},99159:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;oe.variable));return{type:"bindings",bindingsStream:n.bindingsStream.filter(await this.newIdentityFilter(i)),metadata:n.metadata}}async newIdentityFilter(e){const t={};return r=>{const n=e.map((e=>l.termToString(r.get(e)))).join("-");return!(n in t)&&(t[n]=!0)}}async newIdentityFilterQuads(){const e={};return t=>{const r=Object.values(l.quadToStringQuad(t)).join(" ");return!(r in e)&&(e[r]=!0)}}}t.ActorQueryOperationDistinctIdentity=d},72437:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(99159),t)},42528:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationExtend=void 0;const n=r(23034),i=r(97356),a=r(34005),o=r(23814),s=r(12233),c=r(98989);class u extends n.ActorQueryOperationTypedMediated{mediatorExpressionEvaluatorFactory;constructor(e){super(e,a.Algebra.Types.EXTEND),this.mediatorExpressionEvaluatorFactory=e.mediatorExpressionEvaluatorFactory}async testOperation(){return(0,i.passTestVoid)()}async runOperation(e,t){const{expression:r,input:n,variable:i}=e,a=(0,c.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:n,context:t}));if((await a.metadata()).variables.some((e=>e.variable.equals(i))))throw new Error(`Illegal binding to variable '${i.value}' that has already been bound`);const u=await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:r,context:t}),l=a.bindingsStream.transform({autoStart:!1,transform:async(e,r,n)=>{try{const t=await u.evaluate(e);n(e.set(i,t))}catch(r){(0,s.isExpressionError)(r)?(n(e),this.logWarn(t,`Expression error for extend operation (${r.message})with bindings '${(0,o.bindingsToString)(e)}'`)):l.emit("error",r)}r()}});return{type:"bindings",bindingsStream:l,async metadata(){const e=await a.metadata();return{...e,variables:[...e.variables,{variable:i,canBeUndef:!1}]}}}}}t.ActorQueryOperationExtend=u},32976:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(42528),t)},24704:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationFilter=void 0;const n=r(23034),i=r(97356),a=r(34005),o=r(23814),s=r(12233),c=r(98989);class u extends n.ActorQueryOperationTypedMediated{mediatorExpressionEvaluatorFactory;constructor(e){super(e,a.Algebra.Types.FILTER),this.mediatorExpressionEvaluatorFactory=e.mediatorExpressionEvaluatorFactory}async testOperation(){return(0,i.passTestVoid)()}async runOperation(e,t){const r=await this.mediatorQueryOperation.mediate({operation:e.input,context:t}),n=(0,c.getSafeBindings)(r);(0,c.validateQueryOutput)(n,"bindings");const i=await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:e.expression,context:t}),a=n.bindingsStream.transform({transform:async(e,r,n)=>{try{await i.evaluateAsEBV(e)&&n(e)}catch(r){(0,s.isExpressionError)(r)?this.logWarn(t,"Error occurred while filtering.",(()=>({error:r,bindings:(0,o.bindingsToString)(e)}))):a.emit("error",r)}r()},autoStart:!1});return{type:"bindings",bindingsStream:a,metadata:n.metadata}}}t.ActorQueryOperationFilter=u},44414:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(24704),t)},57575:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationFromQuad=void 0;const n=r(23034),i=r(72407),a=r(97356),o=r(34005);class s extends n.ActorQueryOperationTypedMediated{static ALGEBRA_TYPES=Object.keys(o.Algebra.Types).map((e=>o.Algebra.Types[e]));constructor(e){super(e,o.Algebra.Types.FROM)}static copyOperation(e,t){const r={};for(const[n,i]of Object.entries(e)){const e=n;Array.isArray(i)&&"template"!==n?r[e]="variables"===n?i:i.map(t):s.ALGEBRA_TYPES.includes(i.type)?r[e]=t(i):r[e]=i}return r}static applyOperationDefaultGraph(e,t,r){if((0,o.isKnownOperation)(t,o.Algebra.Types.BGP)&&t.patterns.length>0||(0,o.isKnownOperation)(t,o.Algebra.Types.PATH)||(0,o.isKnownOperation)(t,o.Algebra.Types.PATTERN)){if((0,o.isKnownOperation)(t,o.Algebra.Types.BGP))return s.joinOperations(e,t.patterns.map((t=>{if("DefaultGraph"!==t.graph.termType)return e.createBgp([t]);const n=r.map((r=>e.createBgp([Object.assign(e.createPattern(t.subject,t.predicate,t.object,r),{metadata:t.metadata})])));return s.unionOperations(e,n)})));if("DefaultGraph"!==t.graph.termType)return t;const n=r.map((r=>(0,o.isKnownOperation)(t,o.Algebra.Types.PATH)?e.createPath(t.subject,t.predicate,t.object,r):Object.assign(e.createPattern(t.subject,t.predicate,t.object,r),{metadata:t.metadata})));return s.unionOperations(e,n)}return s.copyOperation(t,(t=>this.applyOperationDefaultGraph(e,t,r)))}static applyOperationNamedGraph(e,t,r,n){if((0,o.isKnownOperation)(t,o.Algebra.Types.BGP)&&t.patterns.length>0||(0,o.isKnownOperation)(t,o.Algebra.Types.PATH)||(0,o.isKnownOperation)(t,o.Algebra.Types.PATTERN)){const i="bgp"===t.type?t.patterns[0].graph:t.graph;if("DefaultGraph"===i.termType)return e.createBgp([]);if("Variable"===i.termType){if(1===r.length){const n=r[0],a={};a[i.value]=n;const o=e.createValues([i],[a]);let s;return s="bgp"===t.type?e.createBgp(t.patterns.map((t=>e.createPattern(t.subject,t.predicate,t.object,n)))):"path"===t.type?e.createPath(t.subject,t.predicate,t.object,n):e.createPattern(t.subject,t.predicate,t.object,n),e.createJoin([o,s])}return s.unionOperations(e,r.map((r=>s.applyOperationNamedGraph(e,t,[r],n))))}return[...r,...n].some((e=>e.equals(i)))?t:e.createBgp([])}return s.copyOperation(t,(t=>this.applyOperationNamedGraph(e,t,r,n)))}static joinOperations(e,t){if(1===t.length)return t[0];if(t.length>1)return e.createJoin(t);throw new Error("A join can only be applied on at least one operation")}static unionOperations(e,t){if(1===t.length)return t[0];if(t.length>1)return e.createUnion(t);throw new Error("A union can only be applied on at least one operation")}static createOperation(e,t){let r=t.input;return t.default.length>0&&(r=s.applyOperationDefaultGraph(e,r,t.default)),(t.named.length>0||t.default.length>0)&&(r=s.applyOperationNamedGraph(e,r,t.named,t.default)),r}async testOperation(e,t){return(0,a.passTestVoid)()}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new o.AlgebraFactory(r),a=s.createOperation(n,e);return this.mediatorQueryOperation.mediate({operation:a,context:t})}}t.ActorQueryOperationFromQuad=s},42136:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(57575),t)},72316:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationGroup=void 0;const n=r(23034),i=r(72407),a=r(97356),o=r(34005),s=r(23814),c=r(98989),u=r(76664),l=r(2054);class d extends n.ActorQueryOperationTypedMediated{mediatorMergeBindingsContext;mediatorBindingsAggregatorFactory;constructor(e){super(e,o.Algebra.Types.GROUP),this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext,this.mediatorBindingsAggregatorFactory=e.mediatorBindingsAggregatorFactory}async testOperation(){return(0,a.passTestVoid)()}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=await s.BindingsFactory.create(this.mediatorMergeBindingsContext,t,r),{input:a,aggregates:o}=e,d=await this.mediatorQueryOperation.mediate({operation:a,context:t}),p=(0,c.getSafeBindings)(d),h=[...e.variables,...o.map((e=>e.variable))].map((e=>({variable:e,canBeUndef:!1}))),f=(await p.metadata()).variables.map((e=>e.variable));return{type:"bindings",bindingsStream:new u.TransformIterator((()=>new Promise(((r,i)=>{const a=new l.GroupsState(e,this.mediatorBindingsAggregatorFactory,t,n,f);p.bindingsStream.on("end",(async()=>{try{const e=new u.ArrayIterator(await a.collectResults(),{autoStart:!1});r(e)}catch(e){i(e)}})),p.bindingsStream.on("error",i),p.bindingsStream.on("data",(e=>{a.consumeBindings(e).catch(i)}))}))),{autoStart:!1}),metadata:async()=>({...await p.metadata(),variables:h})}}}t.ActorQueryOperationGroup=d},2054:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GroupsState=void 0;const n=r(72407),i=r(23814);t.GroupsState=class{pattern;mediatorBindingsAggregatorFactory;context;bindingsFactory;variables;groups;groupsInitializer;groupVariables;waitCounter;waitResolver;resultHasBeenCalled;constructor(e,t,r,n,i){this.pattern=e,this.mediatorBindingsAggregatorFactory=t,this.context=r,this.bindingsFactory=n,this.variables=i,this.groups=new Map,this.groupsInitializer=new Map,this.groupVariables=new Set(this.pattern.variables.map((e=>e.value))),this.waitCounter=1,this.resultHasBeenCalled=!1}consumeBindings(e){const t=this.resultCheck();if(t)return t;this.waitCounter++;const r=e.filter(((e,t)=>this.groupVariables.has(t.value))),n=this.hashBindings(r);let i,a=this.groupsInitializer.get(n);if(a){const t=a;i=(async()=>{const r=await t;await Promise.all(this.pattern.aggregates.map((async t=>{const n=t.variable.value;await r.aggregators[n].putBindings(e)})))})().then((async()=>{await this.subtractWaitCounterAndCollect()}))}else a=(async()=>{const t={};await Promise.all(this.pattern.aggregates.map((async r=>{const n=r.variable.value;t[n]=await this.mediatorBindingsAggregatorFactory.mediate({expr:r,context:this.context}),await t[n].putBindings(e)})));const i={aggregators:t,bindings:r};return this.groups.set(n,i),await this.subtractWaitCounterAndCollect(),i})(),this.groupsInitializer.set(n,a),i=a;return i}async subtractWaitCounterAndCollect(){0==--this.waitCounter&&await this.handleResultCollection()}async handleResultCollection(){const e=this.context.getSafe(n.KeysInitQuery.dataFactory);let t=await Promise.all([...this.groups].map((async([t,r])=>{const{bindings:n,aggregators:i}=r;let a=n;for(const t in i){const r=await i[t].result();r&&(a=a.set(e.variable(t),r))}return a})));if(0===t.length&&0===this.groupVariables.size){const e=[];await Promise.all(this.pattern.aggregates.map((async t=>{const r=t.variable,n=await this.mediatorBindingsAggregatorFactory.mediate({expr:t,context:this.context}),i=await n.result();void 0!==i&&e.push([r,i])}))),t=[this.bindingsFactory.bindings(e)]}this.waitResolver(t)}resultCheck(){if(this.resultHasBeenCalled)return Promise.reject(new Error("Calling any function after calling collectResult is invalid."))}async collectResults(){const e=this.resultCheck();if(e)return e;this.resultHasBeenCalled=!0;const t=new Promise((e=>{this.waitResolver=e}));return await this.subtractWaitCounterAndCollect(),t}hashBindings(e){return(0,i.bindingsToCompactString)(e,this.variables)}}},80715:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(72316),t)},5104:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationJoin=void 0;const n=r(23034),i=r(44789),a=r(97356),o=r(34005),s=r(49102),c=r(98989),u=r(76664),l=r(18050);class d extends n.ActorQueryOperationTypedMediated{mediatorJoin;constructor(e){super(e,o.Algebra.Types.JOIN),this.mediatorJoin=e.mediatorJoin}async testOperation(e,t){return(0,a.passTestVoid)()}async runOperation(e,t){const r=(await Promise.all(e.input.map((async e=>({output:await this.mediatorQueryOperation.mediate({operation:e,context:t}),operation:e}))))).map((({output:e,operation:t})=>({output:(0,c.getSafeBindings)(e),operation:t})));if((await Promise.all(r.map((e=>e.output.metadata())))).some((e=>0===e.cardinality.value&&"exact"===e.cardinality.type))){for(const e of r)e.output.bindingsStream.close();return{bindingsStream:new u.ArrayIterator([],{autoStart:!1}),metadata:async()=>({state:new s.MetadataValidationState,cardinality:{type:"exact",value:0},variables:i.ActorRdfJoin.joinVariables(new l.DataFactory,await i.ActorRdfJoin.getMetadatas(r))}),type:"bindings"}}return this.mediatorJoin.mediate({type:"inner",entries:r,context:t})}}t.ActorQueryOperationJoin=d},11952:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5104),t)},82532:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationLeftJoin=void 0;const n=r(23034),i=r(72407),a=r(97356),o=r(34005),s=r(98989);class c extends n.ActorQueryOperationTypedMediated{mediatorJoin;constructor(e){super(e,o.Algebra.Types.LEFT_JOIN),this.mediatorJoin=e.mediatorJoin}async testOperation(e,t){return(0,a.passTestVoid)()}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new o.AlgebraFactory(r),a=await Promise.all(e.input.map((async(r,i)=>{const a=(0,s.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:r,context:t}));return e.expression&&1===i?{output:a,operation:n.createFilter(r,e.expression),operationRequired:!0}:{output:a,operation:r}})));return await this.mediatorJoin.mediate({type:"optional",entries:a,context:t})}}t.ActorQueryOperationLeftJoin=c},85065:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(82532),t)},88610:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationMinus=void 0;const n=r(23034),i=r(97356),a=r(34005),o=r(98989);class s extends n.ActorQueryOperationTypedMediated{mediatorJoin;constructor(e){super(e,a.Algebra.Types.MINUS),this.mediatorJoin=e.mediatorJoin}async testOperation(e,t){return(0,i.passTestVoid)()}async runOperation(e,t){const r=e.graphScopeVar,n=(await Promise.all(e.input.map((async e=>({output:await this.mediatorQueryOperation.mediate({operation:e,context:t}),operation:e}))))).map((({output:e,operation:t})=>({output:(0,o.getSafeBindings)(e),operation:t})));return this.mediatorJoin.mediate({type:"minus",entries:n,context:t,graphVariableFromParentScope:r})}}t.ActorQueryOperationMinus=s},44408:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(88610),t)},66732:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationNodes=void 0;const n=r(23034),i=r(72407),a=r(97356),o=r(34005),s=r(98989);class c extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"nodes")}async testOperation(e,t){return(0,s.getOperationSource)(e)?(0,a.passTestVoid)():(0,a.failTest)(`Actor ${this.name} requires an operation with source annotation.`)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new o.AlgebraFactory(r),a=(0,s.getOperationSource)(e),c=r.variable("__p"),u=r.variable("__x"),l=(0,s.getSafeBindings)(await this.mediatorQueryOperation.mediate({context:t,operation:n.createDistinct(n.createUnion([(0,s.assignOperationSource)(n.createPattern(e.variable,c,u,e.graph),a),(0,s.assignOperationSource)(n.createPattern(u,c,e.variable,e.graph),a)]))}));return{type:"bindings",bindingsStream:l.bindingsStream.map((e=>e.delete(c).delete(u))),metadata:l.metadata}}}t.ActorQueryOperationNodes=c},43329:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(66732),t)},95920:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationNop=void 0;const n=r(23034),i=r(72407),a=r(97356),o=r(34005),s=r(23814),c=r(49102),u=r(76664);class l extends n.ActorQueryOperationTypedMediated{mediatorMergeBindingsContext;constructor(e){super(e,o.Algebra.Types.NOP),this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}async testOperation(e,t){return(0,a.passTestVoid)()}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=await s.BindingsFactory.create(this.mediatorMergeBindingsContext,t,r);return{bindingsStream:new u.SingletonIterator(n.bindings()),metadata:()=>Promise.resolve({state:new c.MetadataValidationState,cardinality:{type:"exact",value:1},variables:[]}),type:"bindings"}}}t.ActorQueryOperationNop=l},57041:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(95920),t)},84432:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationOrderBy=void 0;const n=r(23034),i=r(97356),a=r(34005),o=r(12233),s=r(98989),c=r(66543);class u extends n.ActorQueryOperationTypedMediated{window;mediatorExpressionEvaluatorFactory;mediatorTermComparatorFactory;constructor(e){super(e,a.Algebra.Types.ORDER_BY),this.window=e.window??Number.POSITIVE_INFINITY,this.mediatorExpressionEvaluatorFactory=e.mediatorExpressionEvaluatorFactory,this.mediatorTermComparatorFactory=e.mediatorTermComparatorFactory}async testOperation(){return(0,i.passTestVoid)()}async runOperation(e,t){const r=await this.mediatorQueryOperation.mediate({operation:e.input,context:t}),n=(0,s.getSafeBindings)(r),i={window:this.window};let{bindingsStream:a}=n;const u=await this.mediatorTermComparatorFactory.mediate({context:t});for(let r=e.expressions.length-1;r>=0;r--){let n=e.expressions[r];const s=this.isAscending(n);n=this.extractSortExpression(n);const l=await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:n,context:t}),d=async(e,t,r)=>{try{r({bindings:e,result:await l.evaluate(e)})}catch(t){(0,o.isExpressionError)(t)||a.emit("error",t),r({bindings:e,result:void 0})}t()},p=a.transform({transform:d}),h=new c.SortIterator(p,((e,t)=>{let r=u.orderTypes(e.result,t.result);return s||(r*=-1),r}),i);a=h.map((({bindings:e})=>e))}return{type:"bindings",bindingsStream:a,metadata:n.metadata}}extractSortExpression(e){return(0,a.isKnownSubType)(e,a.Algebra.ExpressionTypes.OPERATOR)&&"desc"===e.operator?e.args[0]:e}isAscending(e){return!(0,a.isKnownSubType)(e,a.Algebra.ExpressionTypes.OPERATOR)||"desc"!==e.operator}}t.ActorQueryOperationOrderBy=u},66543:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SortIterator=void 0;const n=r(76664);class i extends n.TransformIterator{windowLength;sort;sorted;constructor(e,t,r){super(e,r);const n=r&&r.window;this.windowLength=Number.isFinite(n)&&n>0?n:Number.POSITIVE_INFINITY,this.sort=t,this.sorted=[]}_read(e,t){let r,{length:n}=this.sorted;for(;n!==this.windowLength&&(r=this.source.read(),null!==r);){let e,t,i=0,a=n-1;for(;i<=a;)e=Math.trunc((i+a)/2),t=this.sort(r,this.sorted[e]),t<0?i=e+1:t>0?a=e-1:(i=e,a=-1);this.sorted.splice(i,0,r),n++}n===this.windowLength&&this._push(this.sorted.pop()),t()}_flush(e){let{length:t}=this.sorted;for(;t--;)this._push(this.sorted.pop());e()}}t.SortIterator=i},9721:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(84432),t)},24631:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationPathAlt=void 0;const n=r(43971),i=r(64151),a=r(72407),o=r(34005),s=r(98989),c=r(76664);class u extends n.ActorAbstractPath{mediatorRdfMetadataAccumulate;constructor(e){super(e,o.Algebra.Types.ALT),this.mediatorRdfMetadataAccumulate=e.mediatorRdfMetadataAccumulate}async runOperation(e,t){const r=t.getSafe(a.KeysInitQuery.dataFactory),n=new o.AlgebraFactory(r),u=e.predicate,l=(await Promise.all(u.input.map((r=>this.mediatorQueryOperation.mediate({context:t,operation:n.createPath(e.subject,r,e.object,e.graph)}))))).map(s.getSafeBindings);return{type:"bindings",bindingsStream:new c.UnionIterator(l.map((e=>e.bindingsStream)),{autoStart:!1}),metadata:()=>Promise.all(l.map((e=>e.metadata()))).then((e=>i.ActorQueryOperationUnion.unionMetadata(e,!0,t,this.mediatorRdfMetadataAccumulate)))}}}t.ActorQueryOperationPathAlt=u},96713:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(24631),t)},63227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationPathInv=void 0;const n=r(43971),i=r(72407),a=r(34005);class o extends n.ActorAbstractPath{constructor(e){super(e,a.Algebra.Types.INV)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new a.AlgebraFactory(r),o=e.predicate,s=n.createPath(e.object,o.path,e.subject,e.graph);return this.mediatorQueryOperation.mediate({operation:s,context:t})}}t.ActorQueryOperationPathInv=o},30201:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(63227),t)},62537:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationPathLink=void 0;const n=r(43971),i=r(72407),a=r(34005);class o extends n.ActorAbstractPath{constructor(e){super(e,a.Algebra.Types.LINK)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new a.AlgebraFactory(r),o=e.predicate,s=Object.assign(n.createPattern(e.subject,o.iri,e.object,e.graph),{metadata:o.metadata});return this.mediatorQueryOperation.mediate({operation:s,context:t})}}t.ActorQueryOperationPathLink=o},68522:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(62537),t)},9911:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationPathNps=void 0;const n=r(43971),i=r(72407),a=r(34005),o=r(98989);class s extends n.ActorAbstractPath{constructor(e){super(e,a.Algebra.Types.NPS)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new a.AlgebraFactory(r),s=e.predicate,c=this.generateVariable(r,e),u=Object.assign(n.createPattern(e.subject,c,e.object,e.graph),{metadata:s.metadata}),l=(0,o.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:u,context:t}));return{type:"bindings",bindingsStream:l.bindingsStream.map((e=>s.iris.some((t=>t.equals(e.get(c))))?null:e.delete(c))),metadata:l.metadata}}}t.ActorQueryOperationPathNps=s},77637:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(9911),t)},19445:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationPathOneOrMore=void 0;const n=r(43971),i=r(72407),a=r(34005),o=r(23814),s=r(98989),c=r(76664);class u extends n.ActorAbstractPath{mediatorMergeBindingsContext;constructor(e){super(e,a.Algebra.Types.ONE_OR_MORE_PATH),this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new a.AlgebraFactory(r),u=await o.BindingsFactory.create(this.mediatorMergeBindingsContext,t,r),l=await this.isPathArbitraryLengthDistinct(n,t,e);if(l.operation)return l.operation;t=l.context;const d=e.predicate;if("Variable"!==e.subject.termType&&"Variable"===e.object.termType){const r=e.object,i=await this.getObjectsPredicateStarEval(e.subject,d.path,r,e.graph,t,!1,n,u),a=("Variable"===e.graph.termType?[r,e.graph]:[r]).map((e=>({variable:e,canBeUndef:!1})));return{type:"bindings",bindingsStream:i.bindingsStream,metadata:async()=>({...await i.metadata(),variables:a})}}if("Variable"===e.subject.termType&&"Variable"===e.object.termType){const r=n.createDistinct(n.createPath(e.subject,d.path,e.object,e.graph)),i=(0,s.getSafeBindings)(await this.mediatorQueryOperation.mediate({context:t,operation:r})),a=e.subject,o=e.object,l={},p=new c.MultiTransformIterator(i.bindingsStream,{multiTransform:r=>{const i=r.get(a),s=r.get(o),p="Variable"===e.graph.termType?r.get(e.graph):e.graph;return new c.TransformIterator((async()=>{const r=new c.BufferedIterator;return await this.getSubjectAndObjectBindingsPredicateStar(a,o,i,s,d.path,p,t,l,{},r,{count:0},n,u),r.map((t=>("Variable"===e.graph.termType&&(t=t.set(e.graph,p)),t)))}),{autoStart:!1,maxBufferSize:128})},autoStart:!1}),h=("Variable"===e.graph.termType?[a,o,e.graph]:[a,o]).map((e=>({variable:e,canBeUndef:!1})));return{type:"bindings",bindingsStream:p,metadata:async()=>({...await i.metadata(),variables:h})}}if("Variable"===e.subject.termType&&"Variable"!==e.object.termType)return this.mediatorQueryOperation.mediate({context:t,operation:n.createPath(e.object,n.createOneOrMorePath(n.createInv(d.path)),e.subject,e.graph)});const p=this.generateVariable(r),h=(0,s.getSafeBindings)(await this.mediatorQueryOperation.mediate({context:t,operation:n.createPath(e.subject,d,p,e.graph)}));return{type:"bindings",bindingsStream:h.bindingsStream.map((t=>e.object.equals(t.get(p))?"Variable"===e.graph.termType?u.bindings([[e.graph,t.get(e.graph)]]):u.bindings():null)),metadata:async()=>({...await h.metadata(),variables:("Variable"===e.graph.termType?[e.graph]:[]).map((e=>({variable:e,canBeUndef:!1})))})}}}t.ActorQueryOperationPathOneOrMore=u},230:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(19445),t)},83463:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationPathSeq=void 0;const n=r(43971),i=r(72407),a=r(34005),o=r(98989);class s extends n.ActorAbstractPath{mediatorJoin;constructor(e){super(e,a.Algebra.Types.SEQ),this.mediatorJoin=e.mediatorJoin}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new a.AlgebraFactory(r),s=e.predicate;let c=e.subject;const u=[],l=await Promise.all(s.input.map(((i,a)=>{const o=a===s.input.length-1?e.object:this.generateVariable(r,e,`b${a}`),l=n.createPath(c,i,o,e.graph),d=this.mediatorQueryOperation.mediate({context:t,operation:l});return c=o,a({output:(0,o.getSafeBindings)(await e),operation:t})))),d=(0,o.getSafeBindings)(await this.mediatorJoin.mediate({type:"inner",entries:l,context:t}));return{type:"bindings",bindingsStream:d.bindingsStream.transform({transform(e,t,r){for(const t of u)e=e.delete(t);r(e),t()}}),async metadata(){const e=await d.metadata(),t=e.variables.filter((e=>!u.some((t=>t.value===e.variable.value))));return{...e,variables:t}}}}}t.ActorQueryOperationPathSeq=s},7177:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(83463),t)},51441:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationPathZeroOrMore=void 0;const n=r(43971),i=r(72407),a=r(34005),o=r(23814),s=r(76664);class c extends n.ActorAbstractPath{mediatorMergeBindingsContext;constructor(e){super(e,a.Algebra.Types.ZERO_OR_MORE_PATH),this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new a.AlgebraFactory(r),c=await o.BindingsFactory.create(this.mediatorMergeBindingsContext,t,r),u=await this.isPathArbitraryLengthDistinct(n,t,e);if(u.operation)return u.operation;t=u.context;const l=e.predicate,d=this.getPathSources(l),p="Variable"===e.subject.termType,h="Variable"===e.object.termType;if("Variable"===e.subject.termType&&"Variable"===e.object.termType){const r=await this.getNodes(e,t,n,d),i=e.subject,a=e.object,o={},u=new s.MultiTransformIterator(r.bindingsStream,{multiTransform:r=>{const u=r.get(i),d="Variable"===e.graph.termType?r.get(e.graph):e.graph;return new s.TransformIterator((async()=>{const r=new s.BufferedIterator;return await this.getSubjectAndObjectBindingsPredicateStar(i,a,u,u,l.path,d,t,o,{},r,{count:0},n,c),r.map((t=>("Variable"===e.graph.termType&&(t=t.set(e.graph,d)),t)))}),{autoStart:!1,maxBufferSize:128})},autoStart:!1}),p=("Variable"===e.graph.termType?[i,e.object,e.graph]:[i,e.object]).map((e=>({variable:e,canBeUndef:!1})));return{type:"bindings",bindingsStream:u,metadata:async()=>({...await r.metadata(),variables:p})}}if(!p&&!h){const i=this.generateVariable(r),a=await this.getObjectsPredicateStarEval(e.subject,l.path,i,e.graph,t,!0,n,c);return{type:"bindings",bindingsStream:a.bindingsStream.map((t=>e.object.equals(t.get(i))?"Variable"===e.graph.termType?c.bindings([[e.graph,t.get(e.graph)]]):c.bindings():null)),metadata:async()=>({...await a.metadata(),variables:("Variable"===e.graph.termType?[e.graph]:[]).map((e=>({variable:e,canBeUndef:!1})))})}}const f=p?e.object:e.subject,y=p?e.subject:e.object,m=p?n.createInv(l.path):l.path,g=await this.getObjectsPredicateStarEval(f,m,y,e.graph,t,!0,n,c),b=("Variable"===e.graph.termType?[y,e.graph]:[y]).map((e=>({variable:e,canBeUndef:!1})));return{type:"bindings",bindingsStream:g.bindingsStream,metadata:async()=>({...await g.metadata(),variables:b})}}}t.ActorQueryOperationPathZeroOrMore=c},16411:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(51441),t)},66587:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationPathZeroOrOne=void 0;const n=r(43971),i=r(72407),a=r(34005),o=r(23814),s=r(49102),c=r(98989),u=r(76664);class l extends n.ActorAbstractPath{mediatorMergeBindingsContext;constructor(e){super(e,a.Algebra.Types.ZERO_OR_ONE_PATH),this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new a.AlgebraFactory(r),l=await o.BindingsFactory.create(this.mediatorMergeBindingsContext,t,r),d=e.predicate,p=this.getPathSources(d),h=[];if("Variable"!==e.subject.termType&&"Variable"!==e.object.termType&&e.subject.equals(e.object))return{type:"bindings",bindingsStream:new u.SingletonIterator(l.bindings()),metadata:()=>Promise.resolve({state:new s.MetadataValidationState,cardinality:{type:"exact",value:1},variables:[]})};const f=await this.isPathArbitraryLengthDistinct(n,t,e);if(f.operation)return f.operation;t=f.context;const y=(0,c.getSafeBindings)(await this.mediatorQueryOperation.mediate({context:t,operation:n.createPath(e.subject,d.path,e.object,e.graph)}));let m;return"Variable"===e.subject.termType&&"Variable"===e.object.termType?m=new u.UnionIterator([(await this.getNodes(e,t,n,p)).bindingsStream,y.bindingsStream],{autoStart:!1}):("Variable"===e.subject.termType&&h.push(l.bindings([[e.subject,e.object]])),"Variable"===e.object.termType&&h.push(l.bindings([[e.object,e.subject]])),m=y.bindingsStream.prepend(h)),{type:"bindings",bindingsStream:m,metadata:async()=>{const e=await y.metadata();return{...e,cardinality:{...e.cardinality,value:e.cardinality.value+1}}}}}}t.ActorQueryOperationPathZeroOrOne=l},59975:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(66587),t)},97440:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationProject=void 0;const n=r(23034),i=r(72407),a=r(97356),o=r(34005),s=r(98080),c=r(98989);class u extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,o.Algebra.Types.PROJECT)}async testOperation(e,t){return(0,a.passTestVoid)()}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=(0,c.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:e.input,context:t})),a=await n.metadata(),o=Object.fromEntries(a.variables.map((e=>[e.variable.value,e]))),u=e.variables.map((e=>({variable:e,canBeUndef:!1}))),l=Object.fromEntries(u.map((e=>[e.variable.value,e]))),d=a.variables.filter((e=>!(e.variable.value in l))),p=u.map((e=>({variable:e.variable,canBeUndef:!(e.variable.value in o)||o[e.variable.value].canBeUndef})));let h=0===d.length?n.bindingsStream:n.bindingsStream.map((e=>{for(const t of d)e=e.delete(t.variable);return e})),f=0;return h=h.map((e=>{f++;const t=new Map;return e.map((e=>{if(e instanceof s.BlankNodeBindingsScoped){let n=t.get(e.value);return n||(n=r.blankNode(`${e.value}${f}`),t.set(e.value,n)),n}return e}))})),{type:"bindings",bindingsStream:h,metadata:async()=>({...a,variables:p})}}}t.ActorQueryOperationProject=u},44521:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(97440),t)},30755:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationReducedHash=void 0;const n=r(23034),i=r(97356),a=r(34005),o=r(98989),s=r(35069);class c extends n.ActorQueryOperationTypedMediated{mediatorHashBindings;cacheSize;constructor(e){super(e,a.Algebra.Types.REDUCED),this.mediatorHashBindings=e.mediatorHashBindings,this.cacheSize=e.cacheSize}async testOperation(e,t){return(0,i.passTestVoid)()}async runOperation(e,t){const r=(0,o.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:e.input,context:t})),n=(await r.metadata()).variables.map((e=>e.variable));return{type:"bindings",bindingsStream:r.bindingsStream.filter(await this.newHashFilter(t,n)),metadata:r.metadata}}async newHashFilter(e,t){const{hashFunction:r}=await this.mediatorHashBindings.mediate({context:e}),n=new s.LRUCache({max:this.cacheSize});return e=>{const i=r(e,t);return!n.has(i)&&(n.set(i,!0),!0)}}}t.ActorQueryOperationReducedHash=c},11545:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(30755),t)},49062:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationSlice=void 0;const n=r(23034),i=r(72407),a=r(97356),o=r(34005);class s extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,o.Algebra.Types.SLICE)}async testOperation(e,t){return(0,a.passTestVoid)()}async runOperation(e,t){e.length&&(t=t.set(i.KeysQueryOperation.limitIndicator,e.length));const r=await this.mediatorQueryOperation.mediate({operation:e.input,context:t});return"bindings"===r.type?{type:"bindings",bindingsStream:this.sliceStream(r.bindingsStream,e),metadata:this.sliceMetadata(r,e)}:"quads"===r.type?{type:"quads",quadStream:this.sliceStream(r.quadStream,e),metadata:this.sliceMetadata(r,e)}:r}sliceStream(e,t){const r=Boolean(t.length)||0===t.length,{start:n}=t,i=r?t.start+t.length-1:Number.POSITIVE_INFINITY;return e.transform({offset:n,limit:Math.max(i-n+1,0),autoStart:!1})}sliceMetadata(e,t){const r=Boolean(t.length)||0===t.length;return()=>e.metadata().then((e=>{const n={...e.cardinality};return Number.isFinite(n.value)&&(n.value=Math.max(0,n.value-t.start),r&&(n.value=Math.min(n.value,t.length))),{...e,cardinality:n}}))}}t.ActorQueryOperationSlice=s},69006:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(49062),t)},84204:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationSource=void 0;const n=r(23034),i=r(72407),a=r(97356),o=r(34005),s=r(49102),c=r(98989);class u extends n.ActorQueryOperation{constructor(e){super(e)}async test(e){const t=(0,c.getOperationSource)(e.operation);return t?(0,c.doesShapeAcceptOperation)(await t.source.getSelectorShape(e.context),e.operation,{wildcardAcceptAllExtensionFunctions:!0})?(0,a.passTest)({httpRequests:1}):(0,a.failTest)(`Actor ${this.name} does not accept the operation ${e.operation.type}.`):(0,a.failTest)(`Actor ${this.name} requires an operation with source annotation.`)}async run(e){const t=e.context.get(i.KeysInitQuery.physicalQueryPlanLogger);t&&(t.logOperation(e.operation.type,void 0,e.operation,e.context.get(i.KeysInitQuery.physicalQueryPlanNode),this.name,{}),e.context=e.context.set(i.KeysInitQuery.physicalQueryPlanNode,e.operation));const r=(0,c.getOperationSource)(e.operation),n=r.context?e.context.merge(r.context):e.context;let a=!1;if(o.algebraUtils.visitOperation(e.operation,{[o.Algebra.Types.CONSTRUCT]:{preVisitor:()=>(a=!0,{shortcut:!0})}}),a){const t=r.source.queryQuads(e.operation,n);return{type:"quads",quadStream:t,metadata:(0,s.getMetadataQuads)(t)}}switch(e.operation.type){case o.Algebra.Types.ASK:return{type:"boolean",execute:()=>r.source.queryBoolean(e.operation,n)};case o.Algebra.Types.COMPOSITE_UPDATE:case o.Algebra.Types.DELETE_INSERT:case o.Algebra.Types.LOAD:case o.Algebra.Types.CLEAR:case o.Algebra.Types.CREATE:case o.Algebra.Types.DROP:case o.Algebra.Types.ADD:case o.Algebra.Types.MOVE:case o.Algebra.Types.COPY:return{type:"void",execute:()=>r.source.queryVoid(e.operation,n)}}const u=r.source.queryBindings(e.operation,n);return{type:"bindings",bindingsStream:u,metadata:(0,s.getMetadataBindings)(u)}}}t.ActorQueryOperationSource=u},83241:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(84204),t)},44364:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationUnion=void 0;const n=r(23034),i=r(97356),a=r(34005),o=r(49102),s=r(98989),c=r(76664);class u extends n.ActorQueryOperationTypedMediated{mediatorRdfMetadataAccumulate;constructor(e){super(e,a.Algebra.Types.UNION),this.mediatorRdfMetadataAccumulate=e.mediatorRdfMetadataAccumulate}static unionVariables(e){const t={};for(const r of e)for(const e of r){t[e.variable.value]||(t[e.variable.value]={variable:e.variable,canBeUndef:e.canBeUndef,occurrences:0});const r=t[e.variable.value];r.canBeUndef=r.canBeUndef||e.canBeUndef,r.occurrences++}return Object.values(t).map((t=>t.occurrences===e.length?{variable:t.variable,canBeUndef:t.canBeUndef}:{variable:t.variable,canBeUndef:!0}))}static async unionMetadata(e,t,r,n){let i=(await n.mediate({mode:"initialize",context:r})).metadata;for(const t of e)i={...t,...(await n.mediate({mode:"append",accumulatedMetadata:i,appendingMetadata:t,context:r})).metadata};i.state=new o.MetadataValidationState;const a=()=>i.state.invalidate();for(const t of e)t.state.addInvalidateListener(a);if(t){const t=e.map((e=>e.variables));i.variables=u.unionVariables(t)}return i}async testOperation(e,t){return(0,i.passTestVoid)()}async runOperation(e,t){const r=await Promise.all(e.input.map((e=>this.mediatorQueryOperation.mediate({operation:e,context:t}))));let n;for(const e of r)if(void 0===n)n=e.type;else if(n!==e.type)throw new Error(`Unable to union ${n} and ${e.type}`);if("bindings"===n||0===e.input.length){const e=r.map(s.getSafeBindings);return{type:"bindings",bindingsStream:new c.UnionIterator(e.map((e=>e.bindingsStream)),{autoStart:!1}),metadata:()=>Promise.all(e.map((e=>e.metadata()))).then((e=>u.unionMetadata(e,!0,t,this.mediatorRdfMetadataAccumulate)))}}if("quads"===n){const e=r.map(s.getSafeQuads);return{type:"quads",quadStream:new c.UnionIterator(e.map((e=>e.quadStream)),{autoStart:!1}),metadata:()=>Promise.all(e.map((e=>e.metadata()))).then((e=>u.unionMetadata(e,!1,t,this.mediatorRdfMetadataAccumulate)))}}throw new Error(`Unable to union ${n}`)}}t.ActorQueryOperationUnion=u},64151:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(44364),t)},27428:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationClear=void 0;const n=r(23034),i=r(72407),a=r(34005),o=r(98989);class s extends n.ActorQueryOperationTypedMediated{mediatorUpdateQuads;constructor(e){super(e,a.Algebra.Types.CLEAR),this.mediatorUpdateQuads=e.mediatorUpdateQuads}async testOperation(e,t){return(0,o.testReadOnly)(t)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory);let n;n="DEFAULT"===e.source?r.defaultGraph():"string"==typeof e.source?e.source:[e.source];const{execute:a}=await this.mediatorUpdateQuads.mediate({deleteGraphs:{graphs:n,requireExistence:!e.silent,dropGraphs:!1},context:t});return{type:"void",execute:a}}}t.ActorQueryOperationClear=s},17397:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(27428),t)},92425:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationUpdateCompositeUpdate=void 0;const n=r(23034),i=r(34005),a=r(98989);class o extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,i.Algebra.Types.COMPOSITE_UPDATE)}async testOperation(e,t){return(0,a.testReadOnly)(t)}async runOperation(e,t){return{type:"void",execute:()=>(async()=>{for(const r of e.updates){const e=(0,a.getSafeVoid)(await this.mediatorQueryOperation.mediate({operation:r,context:t}));await e.execute()}})()}}}t.ActorQueryOperationUpdateCompositeUpdate=o},47114:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(92425),t)},77272:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationCreate=void 0;const n=r(23034),i=r(34005),a=r(98989);class o extends n.ActorQueryOperationTypedMediated{mediatorUpdateQuads;constructor(e){super(e,i.Algebra.Types.CREATE),this.mediatorUpdateQuads=e.mediatorUpdateQuads}async testOperation(e,t){return(0,a.testReadOnly)(t)}async runOperation(e,t){const{execute:r}=await this.mediatorUpdateQuads.mediate({createGraphs:{graphs:[e.source],requireNonExistence:!e.silent},context:t});return{type:"void",execute:r}}}t.ActorQueryOperationCreate=o},26032:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(77272),t)},35953:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationUpdateDeleteInsert=void 0;const n=r(31289),i=r(23034),a=r(72407),o=r(34005),s=r(23814),c=r(98989),u=r(76664);class l extends i.ActorQueryOperationTypedMediated{mediatorUpdateQuads;mediatorMergeBindingsContext;blankNodeCounter=0;constructor(e){super(e,o.Algebra.Types.DELETE_INSERT),this.mediatorUpdateQuads=e.mediatorUpdateQuads,this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}async testOperation(e,t){return(0,c.testReadOnly)(t)}async runOperation(e,t){const r=t.getSafe(a.KeysInitQuery.dataFactory),i=await s.BindingsFactory.create(this.mediatorMergeBindingsContext,t,r),o=e.where?(0,c.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:e.where,context:t})).bindingsStream:new u.ArrayIterator([i.bindings()],{autoStart:!1});let l,d;e.insert&&(l=new n.BindingsToQuadsIterator(r,e.insert.map(n.BindingsToQuadsIterator.localizeQuad.bind(null,r,this.blankNodeCounter)),o.clone()),this.blankNodeCounter++),e.delete&&(d=new n.BindingsToQuadsIterator(r,e.delete.map(n.BindingsToQuadsIterator.localizeQuad.bind(null,r,this.blankNodeCounter)),o.clone()),this.blankNodeCounter++);const{execute:p}=await this.mediatorUpdateQuads.mediate({quadStreamInsert:l,quadStreamDelete:d,context:t});return{type:"void",execute:p}}}t.ActorQueryOperationUpdateDeleteInsert=l},17338:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(35953),t)},72624:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationDrop=void 0;const n=r(23034),i=r(72407),a=r(34005),o=r(98989);class s extends n.ActorQueryOperationTypedMediated{mediatorUpdateQuads;constructor(e){super(e,a.Algebra.Types.DROP),this.mediatorUpdateQuads=e.mediatorUpdateQuads}async testOperation(e,t){return(0,o.testReadOnly)(t)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory);let n;n="DEFAULT"===e.source?r.defaultGraph():"string"==typeof e.source?e.source:[e.source];const{execute:a}=await this.mediatorUpdateQuads.mediate({deleteGraphs:{graphs:n,requireExistence:!e.silent,dropGraphs:!0},context:t});return{type:"void",execute:a}}}t.ActorQueryOperationDrop=s},86301:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(72624),t)},36096:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationLoad=void 0;const n=r(23034),i=r(72407),a=r(34005),o=r(98989);class s extends n.ActorQueryOperationTypedMediated{mediatorUpdateQuads;mediatorQuerySourceIdentify;constructor(e){super(e,a.Algebra.Types.LOAD),this.mediatorUpdateQuads=e.mediatorUpdateQuads,this.mediatorQuerySourceIdentify=e.mediatorQuerySourceIdentify}async testOperation(e,t){return(0,o.testReadOnly)(t)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new a.AlgebraFactory(r);let s=t;e.silent&&(s=s.set(i.KeysInitQuery.lenient,!0));const{querySource:c}=await this.mediatorQuerySourceIdentify.mediate({querySourceUnidentified:{value:e.source.value},context:s});let u=(0,o.getSafeQuads)(await this.mediatorQueryOperation.mediate({operation:n.createConstruct((0,o.assignOperationSource)(n.createPattern(r.variable("s"),r.variable("p"),r.variable("o")),c),[n.createPattern(r.variable("s"),r.variable("p"),r.variable("o"))]),context:s})).quadStream;e.destination&&(u=u.map((t=>r.quad(t.subject,t.predicate,t.object,e.destination))));const{execute:l}=await this.mediatorUpdateQuads.mediate({quadStreamInsert:u,context:t});return{type:"void",execute:l}}}t.ActorQueryOperationLoad=s},16920:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(36096),t)},8360:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationValues=void 0;const n=r(23034),i=r(72407),a=r(97356),o=r(34005),s=r(23814),c=r(49102),u=r(76664);class l extends n.ActorQueryOperationTyped{mediatorMergeBindingsContext;constructor(e){super(e,o.Algebra.Types.VALUES),this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}async testOperation(e,t){return(0,a.passTestVoid)()}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=await s.BindingsFactory.create(this.mediatorMergeBindingsContext,t,r);return{type:"bindings",bindingsStream:new u.ArrayIterator(e.bindings.map((e=>n.bindings(Object.entries(e).map((([e,t])=>[r.variable(e),t]))))),{autoStart:!1}),metadata:()=>Promise.resolve({state:new c.MetadataValidationState,cardinality:{type:"exact",value:e.bindings.length},variables:e.variables.map((t=>({variable:t,canBeUndef:e.bindings.some((e=>!(t.value in e)))})))})}}}t.ActorQueryOperationValues=l},56122:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8360),t)},73816:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryParseGraphql=void 0;const n=r(49812),i=r(72407),a=r(97356),o=r(1427);class s extends n.ActorQueryParse{graphqlToSparql;constructor(e){super(e),this.graphqlToSparql=new o.Converter({requireContext:!0})}async test(e){return"graphql"!==e.queryFormat?.language?(0,a.failTest)("This actor can only parse GraphQL queries"):(0,a.passTestVoid)()}async run(e){const t=e.context.get(i.KeysInitQuery.jsonLdContext)||{},r={singularizeVariables:e.context.get(i.KeysInitQuery.graphqlSingularizeVariables)};return{operation:await this.graphqlToSparql.graphqlToSparqlAlgebra(e.query,t,r)}}}t.ActorQueryParseGraphql=s},17807:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(73816),t)},27096:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryParseSparql=void 0;const n=r(49812),i=r(72407),a=r(97356),o=r(64423),s=r(43216),c=r(70104);class u extends n.ActorQueryParse{prefixes;minimalErrorMessages;parser;constructor(e){super(e),this.prefixes=Object.freeze(e.prefixes),this.minimalErrorMessages=e.minimalErrorMessages??!1,this.parser=new s.Parser({lexerConfig:{positionTracking:this.minimalErrorMessages?"onlyOffset":"full"}})}async test(e){return e.queryFormat&&"sparql"!==e.queryFormat.language?(0,a.failTest)("This actor can only parse SPARQL queries"):(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new c.AstFactory,n=this.parser.parse(e.query,{prefixes:this.prefixes,baseIRI:e.baseIRI,astFactory:r});let a;if(r.isQuery(n))for(const e of n.context)r.isContextDefinitionBase(e)&&(a=e.value.value);return{baseIRI:a,operation:(0,o.toAlgebra)(n,{quads:!0,prefixes:this.prefixes,blankToVariable:!0,baseIRI:e.baseIRI,dataFactory:t})}}}t.ActorQueryParseSparql=u},18531:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(27096),t)},17019:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryProcessExplainLogical=void 0;const n=r(19062),i=r(72407),a=r(97356);class o extends n.ActorQueryProcess{queryProcessor;constructor(e){super(e),this.queryProcessor=e.queryProcessor}async test(e){return"logical"!==(e.context.get(i.KeysInitQuery.explain)??e.context.get(new a.ActionContextKey("explain")))?(0,a.failTest)(`${this.name} can only explain in 'logical' mode.`):(0,a.passTestVoid)()}async run(e){let{operation:t,context:r}=await this.queryProcessor.parse(e.query,e.context);return({operation:t,context:r}=await this.queryProcessor.optimize(t,r)),{result:{explain:!0,type:"logical",data:t}}}}t.ActorQueryProcessExplainLogical=o},78377:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(17019),t)},85745:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryProcessExplainParsed=void 0;const n=r(19062),i=r(72407),a=r(97356);class o extends n.ActorQueryProcess{queryProcessor;constructor(e){super(e),this.queryProcessor=e.queryProcessor}async test(e){return"parsed"!==(e.context.get(i.KeysInitQuery.explain)??e.context.get(new a.ActionContextKey("explain")))?(0,a.failTest)(`${this.name} can only explain in 'parsed' mode.`):(0,a.passTestVoid)()}async run(e){const{operation:t}=await this.queryProcessor.parse(e.query,e.context);return{result:{explain:!0,type:"parsed",data:t}}}}t.ActorQueryProcessExplainParsed=o},94915:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(85745),t)},83709:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryProcessExplainPhysical=void 0;const n=r(19062),i=r(72407),a=r(97356),o=r(15766);class s extends n.ActorQueryProcess{queryProcessor;constructor(e){super(e),this.queryProcessor=e.queryProcessor}async test(e){const t=e.context.get(i.KeysInitQuery.explain)??e.context.get(new a.ActionContextKey("explain"));return"physical"!==t&&"physical-json"!==t?(0,a.failTest)(`${this.name} can only explain in 'physical' or 'physical-json' mode.`):(0,a.passTestVoid)()}async run(e){let{operation:t,context:r}=await this.queryProcessor.parse(e.query,e.context);({operation:t,context:r}=await this.queryProcessor.optimize(t,r));const n=new o.MemoryPhysicalQueryPlanLogger;r=r.set(i.KeysInitQuery.physicalQueryPlanLogger,n);const s=await this.queryProcessor.evaluate(t,r);switch(s.type){case"bindings":await s.bindingsStream.toArray();break;case"quads":await s.quadStream.toArray();break;case"boolean":case"void":await s.execute()}const c=e.context.get(i.KeysInitQuery.explain)??e.context.getSafe(new a.ActionContextKey("explain"));return{result:{explain:!0,type:c,data:"physical"===c?n.toCompactString():n.toJson()}}}}t.ActorQueryProcessExplainPhysical=s},15766:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MemoryPhysicalQueryPlanLogger=void 0,t.numberToString=a;const n=r(34005),i=r(22112);function a(e){return e.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:3})}t.MemoryPhysicalQueryPlanLogger=class{planNodes;rootNode;constructor(){this.planNodes=new Map}logOperation(e,t,r,n,i,a){const o={actor:i,logicalOperator:e,physicalOperator:t,rawNode:r,children:[],metadata:a};if(this.planNodes.set(r,o),this.rootNode){if(!n)throw new Error("Detected more than one parent-less node");const e=this.planNodes.get(n);if(!e)throw new Error("Could not find parent node");e.children.push(o)}else{if(n)throw new Error("No root node has been set yet, while a parent is being referenced");this.rootNode=o}}stashChildren(e,t){const r=this.planNodes.get(e);if(!r)throw new Error("Could not find plan node");r.children=t?r.children.filter(t):[]}unstashChild(e,t){const r=this.planNodes.get(e);if(r){const e=this.planNodes.get(t);if(!e)throw new Error("Could not find plan parent node");e.children.push(r)}}appendMetadata(e,t){const r=this.planNodes.get(e);r&&(r.metadata={...r.metadata,...t})}toJson(){return this.rootNode?this.planNodeToJson(this.rootNode):{}}planNodeToJson(e){const t={logical:e.logicalOperator,physical:e.physicalOperator,...this.getLogicalMetadata(e.rawNode),...this.compactMetadata(e.metadata)};if(e.children.length>0&&(t.children=e.children.map((e=>this.planNodeToJson(e)))),"bind"===t.physical&&t.children){const e={};for(const r of t.children){const t=r.children?.at(-1)??r,n=this.getPlanHash(t).join(",");e[n]||(e[n]=[]),e[n].push(r)}const r=[];for(const t of Object.values(e))r.push({occurrences:t.length,firstOccurrence:t[0]});t.childrenCompact=r,delete t.children}return t}getPlanHash(e){let t=[`${e.logical}-${e.physical}`];return e.children?t=[...t,...e.children.flatMap((e=>this.getPlanHash(e)))]:e.childrenCompact&&(t=[...t,...e.childrenCompact.flatMap((e=>this.getPlanHash(e.firstOccurrence)))]),t}compactMetadata(e){return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,this.compactMetadataValue(t)])))}compactMetadataValue(e){return e&&"object"==typeof e&&"termType"in e?this.getLogicalMetadata(e):e}getLogicalMetadata(e){const t={};if("type"in e){const r=e;r.metadata?.scopedSource&&(t.source=r.metadata.scopedSource.source.toString()),(0,n.isKnownOperation)(r,n.Algebra.Types.PATTERN)?t.pattern=this.quadToString(r):(0,n.isKnownOperation)(r,n.Algebra.Types.PROJECT)&&(t.variables=r.variables.map((e=>e.value)))}return t}quadToString(e){return`${(0,i.termToString)(e.subject)} ${(0,i.termToString)(e.predicate)} ${(0,i.termToString)(e.object)}${"DefaultGraph"===e.graph.termType?"":` ${(0,i.termToString)(e.graph)}`}`}toCompactString(){const e=this.toJson(),t=[],r=new Map;if("logical"in e?this.nodeToCompactString(t,r,"",e):t.push("Empty"),r.size>0){t.push(""),t.push("sources:");for(const[e,n]of r.entries())t.push(` ${n}: ${e}`)}return t.join("\n")}nodeToCompactString(e,t,r,n,i){let o;n.source&&(o=t.get(n.source),void 0===o&&(o=t.size,t.set(n.source,o))),e.push(`${r}${n.logical}${n.physical?`(${n.physical})`:""}${n.pattern?` (${n.pattern})`:""}${n.variables?` (${n.variables.join(",")})`:""}${n.bindOperation?` bindOperation:(${n.bindOperation.pattern}) bindCardEst:${"estimate"===n.bindOperationCardinality.type?"~":""}${a(n.bindOperationCardinality.value)}`:""}${n.cardinality?` cardEst:${"estimate"===n.cardinality.type?"~":""}${a(n.cardinality.value)}`:""}${n.source?` src:${o}`:""}${n.cardinalityReal?` cardReal:${n.cardinalityReal}`:""}${n.timeSelf?` timeSelf:${a(n.timeSelf)}ms`:""}${n.timeLife?` timeLife:${a(n.timeLife)}ms`:""}${i?` ${i}`:""}`);for(const i of n.children??[])this.nodeToCompactString(e,t,`${r} `,i);for(const i of n.childrenCompact??[])this.nodeToCompactString(e,t,`${r} `,i.firstOccurrence,`compacted-occurrences:${i.occurrences}`)}}},29175:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(83709),t),i(r(15766),t)},92939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryProcessExplainQuery=void 0;const n=r(19062),i=r(72407),a=r(97356),o=r(34005),s=r(98989);class c extends n.ActorQueryProcess{queryProcessor;mediatorQuerySerialize;constructor(e){super(e),this.queryProcessor=e.queryProcessor,this.mediatorQuerySerialize=e.mediatorQuerySerialize}async test(e){return"query"!==(e.context.get(i.KeysInitQuery.explain)??e.context.get(new a.ActionContextKey("explain")))?(0,a.failTest)(`${this.name} can only explain in 'query' mode.`):(0,a.passTestVoid)()}async run(e){let{operation:t,context:r}=await this.queryProcessor.parse(e.query,e.context);({operation:t,context:r}=await this.queryProcessor.optimize(t,r));const n=new o.AlgebraFactory;let a;return t=c.sourceAnnotationToServices(n,r.getSafe(i.KeysInitQuery.dataFactory),t),a=t.type===o.Algebra.Types.UNION?"SELECT * WHERE { FILTER(false) }":(await this.mediatorQuerySerialize.mediate({queryFormat:{language:"sparql",version:"1.1"},operation:t,newlines:!0,indentWidth:2,context:r})).query,{result:{explain:!0,type:"query",data:a}}}static sourceAnnotationToServices(e,t,r){return o.transformer.transformObject(r,(r=>{const n=r,a=(0,s.getOperationSource)(n);return a?e.createService(n,"string"==typeof a.source.referenceValue?t.namedNode(a.source.referenceValue):t.namedNode(`comunica:${a.source.referenceValue.constructor.name}`),a.context?.get(i.KeysInitQuery.lenient)):n}))}}t.ActorQueryProcessExplainQuery=c},70842:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(92939),t)},9152:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryProcessSequential=void 0;const n=r(19062),i=r(72407),a=r(97356),o=r(34005),s=r(23814),c=r(98989);class u extends n.ActorQueryProcess{mediatorContextPreprocess;mediatorQueryParse;mediatorOptimizeQueryOperation;mediatorQueryOperation;mediatorMergeBindingsContext;constructor(e){super(e),this.mediatorContextPreprocess=e.mediatorContextPreprocess,this.mediatorQueryParse=e.mediatorQueryParse,this.mediatorOptimizeQueryOperation=e.mediatorOptimizeQueryOperation,this.mediatorQueryOperation=e.mediatorQueryOperation,this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}async test(e){return e.context.get(i.KeysInitQuery.explain)??e.context.get(new a.ActionContextKey("explain"))?(0,a.failTest)(`${this.name} is not able to explain queries.`):(0,a.passTestVoid)()}async run(e){let{operation:t,context:r}=await this.parse(e.query,e.context);return({operation:t,context:r}=await this.optimize(t,r)),{result:await this.evaluate(t,r)}}async parse(e,t){let r;if(t=(await this.mediatorContextPreprocess.mediate({context:t,initialize:!0})).context,"string"==typeof e){const n=(t=t.set(i.KeysInitQuery.queryString,e)).get(i.KeysInitQuery.baseIRI),a=t.get(i.KeysInitQuery.queryFormat),o=await this.mediatorQueryParse.mediate({context:t,query:e,queryFormat:a,baseIRI:n});r=o.operation,o.baseIRI&&(t=t.set(i.KeysInitQuery.baseIRI,o.baseIRI))}else r=e;if(t.has(i.KeysInitQuery.initialBindings)){const e=t.getSafe(i.KeysInitQuery.dataFactory),n=new o.AlgebraFactory(e),a=await s.BindingsFactory.create(this.mediatorMergeBindingsContext,t,e);r=(0,c.materializeOperation)(r,t.get(i.KeysInitQuery.initialBindings),n,a,{strictTargetVariables:!0}),t=t.delete(i.KeysInitQuery.queryString)}return{operation:r,context:t}}async optimize(e,t){return t=t.set(i.KeysInitQuery.query,e),({operation:e,context:t}=await this.mediatorOptimizeQueryOperation.mediate({context:t,operation:e})),{operation:e,context:t=t.set(i.KeysInitQuery.query,e)}}async evaluate(e,t){const r=await this.mediatorQueryOperation.mediate({context:t,operation:e});return r.context=t,r}}t.ActorQueryProcessSequential=u},60295:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(9152),t)},76117:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;o{},"bindings"===e.type||"quads"===e.type){let t="bindings"===e.type?(0,u.wrap)(e.bindingsStream).map((e=>JSON.stringify(Object.fromEntries([...e].map((([e,t])=>[e.value,l.termToString(t)])))))):(0,u.wrap)(e.quadStream).map((e=>JSON.stringify(l.quadToStringQuad(e)))),r=!0;t=t.map((e=>{const t=`${r?"":","}\n${e}`;return r=!1,t})).prepend(["["]).append(["\n]\n"]),n.wrap(t)}else try{n.push(`${JSON.stringify(await e.execute())}\n`),n.push(null)}catch(e){setTimeout((()=>n.emit("error",e)))}return{data:n}}}t.ActorQueryResultSerializeJson=p},96111:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(76117),t)},68555:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeRdf=void 0;const n=r(89655),i=r(97356);class a extends n.ActorQueryResultSerialize{mediatorRdfSerialize;mediatorMediaTypeCombiner;mediatorMediaTypeFormatCombiner;constructor(e){super(e),this.mediatorRdfSerialize=e.mediatorRdfSerialize,this.mediatorMediaTypeCombiner=e.mediatorMediaTypeCombiner,this.mediatorMediaTypeFormatCombiner=e.mediatorMediaTypeFormatCombiner}async testHandle(e,t,r){if("quads"!==e.type)return(0,i.failTest)(`Actor ${this.name} can only handle quad streams`);const{mediaTypes:n}=await this.mediatorMediaTypeCombiner.mediate({context:r,mediaTypes:!0});return t in n?(0,i.passTestVoid)():(0,i.failTest)(`Actor ${this.name} can not handle media type ${t}. All available types: ${Object.keys(n)}`)}async runHandle(e,t,r){return(await this.mediatorRdfSerialize.mediate({context:r,handle:{context:r,quadStream:e.quadStream},handleMediaType:t})).handle}async testMediaType(e){return(0,i.passTestVoid)()}async getMediaTypes(e){return(await this.mediatorMediaTypeCombiner.mediate({context:e,mediaTypes:!0})).mediaTypes}async testMediaTypeFormats(e){return(0,i.passTestVoid)()}async getMediaTypeFormats(e){return(await this.mediatorMediaTypeFormatCombiner.mediate({context:e,mediaTypeFormats:!0})).mediaTypeFormats}}t.ActorQueryResultSerializeRdf=a},92571:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(68555),t)},84985:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeSimple=void 0;const n=r(89655),i=r(97356),a=r(76664),o=r(22112),s=r(58521);class c extends n.ActorQueryResultSerializeFixedMediaTypes{constructor(e){super(e)}async testHandleChecked(e,t){return["bindings","quads","boolean","void"].includes(e.type)?(0,i.passTestVoid)():(0,i.failTest)("This actor can only handle bindings streams, quad streams, booleans, or updates.")}static termToString(e){return"Quad"===e.termType?(0,o.termToString)(e):e.value}async runHandle(e,t,r){const n=new s.Readable;return"bindings"===e.type?n.wrap(e.bindingsStream.map((e=>`${[...e].map((([e,t])=>`?${e.value}: ${c.termToString(t)}`)).join("\n")}\n\n`))):"quads"===e.type?n.wrap(e.quadStream.map((e=>`subject: ${c.termToString(e.subject)}\npredicate: ${c.termToString(e.predicate)}\nobject: ${c.termToString(e.object)}\ngraph: ${c.termToString(e.graph)}\n\n`))):n.wrap((0,a.wrap)("boolean"===e.type?e.execute().then((e=>[`${e}\n`])):e.execute().then((()=>["ok\n"])))),{data:n}}}t.ActorQueryResultSerializeSimple=c},6651:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(84985),t)},6786:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeSparqlCsv=void 0;const n=r(89655),i=r(97356),a=r(58521);class o extends n.ActorQueryResultSerializeFixedMediaTypes{constructor(e){super(e)}static bindingToCsvBindings(e){if(!e)return"";let t=e.value;if("BlankNode"===e.termType)t=`_:${t}`;else if("Quad"===e.termType){let r=o.bindingToCsvBindings(e.object);"Literal"===e.object.termType&&(r=`"${r.replaceAll('"','""')}"`),t=`<<( ${o.bindingToCsvBindings(e.subject)} ${o.bindingToCsvBindings(e.predicate)} ${r} )>>`}return/[",\n\r]/u.test(t)&&(t=`"${t.replaceAll('"','""')}"`),t}async testHandleChecked(e,t){return"bindings"!==e.type?(0,i.failTest)("This actor can only handle bindings streams."):(0,i.passTestVoid)()}async runHandle(e,t,r){const n=e,i=new a.Readable,s=await n.metadata();return i.push(`${s.variables.map((e=>e.variable.value)).join(",")}\r\n`),i.wrap(n.bindingsStream.map((e=>`${s.variables.map((t=>o.bindingToCsvBindings(e.get(t.variable)))).join(",")}\r\n`))),{data:i}}}t.ActorQueryResultSerializeSparqlCsv=o},10569:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6786),t)},25209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionObserverHttp=void 0;const n=r(97356);class i extends n.ActionObserver{httpInvalidator;observedActors;requests=0;constructor(e){super(e),this.httpInvalidator=e.httpInvalidator,this.observedActors=e.observedActors,this.bus.subscribeObserver(this),this.httpInvalidator.addInvalidateListener((()=>{this.requests=0}))}onRun(e,t,r){this.observedActors.includes(e.name)&&this.requests++}}t.ActionObserverHttp=i},34386:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeSparqlJson=void 0;const n=r(89655),i=r(97356),a=r(76664),o=r(58521);class s extends n.ActorQueryResultSerializeFixedMediaTypes{emitMetadata;httpObserver;constructor(e){super(e),this.emitMetadata=e.emitMetadata,this.httpObserver=e.httpObserver}static bindingToJsonBindings(e){if("Literal"===e.termType){const t=e,r={value:t.value,type:"literal"},{language:n,direction:i,datatype:a}=t;return n?(r["xml:lang"]=n,i&&(r["its:dir"]=i)):a&&"http://www.w3.org/2001/XMLSchema#string"!==a.value&&(r.datatype=a.value),r}return"BlankNode"===e.termType?{value:e.value,type:"bnode"}:"Quad"===e.termType?{value:{subject:s.bindingToJsonBindings(e.subject),predicate:s.bindingToJsonBindings(e.predicate),object:s.bindingToJsonBindings(e.object)},type:"triple"}:{value:e.value,type:"uri"}}async testHandleChecked(e,t){return["bindings","boolean"].includes(e.type)?(0,i.passTestVoid)():(0,i.failTest)("This actor can only handle bindings streams or booleans.")}async runHandle(e,t,r){const n=new o.Readable,i={};if("bindings"===e.type){const c=await e.metadata();c.variables.length>0&&(i.vars=c.variables.map((e=>e.variable.value)))}if(n.push(`{"head": ${JSON.stringify(i)},\n`),"bindings"===e.type){const u=e.bindingsStream;n.push('"results": { "bindings": [\n');let l=!0;function*d(e){yield e()}n.wrap((0,a.wrap)(u).map((e=>{const t=`${l?"":",\n"}${JSON.stringify(Object.fromEntries([...e].map((([e,t])=>[e.value,s.bindingToJsonBindings(t)]))))}`;return l=!1,t})).append((0,a.wrap)(d((()=>`\n]}${this.emitMetadata?`,\n"metadata": { "httpRequests": ${this.httpObserver.requests} }`:""}}\n`)))))}else n.wrap((0,a.wrap)(e.execute().then((e=>[`"boolean":${e}\n}\n`]))));return{data:n}}}t.ActorQueryResultSerializeSparqlJson=s},89157:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(25209),t),i(r(34386),t)},84668:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeSparqlTsv=void 0;const n=r(89655),i=r(97356),a=r(64817),o=r(58521);class s extends n.ActorQueryResultSerializeFixedMediaTypes{constructor(e){super(e)}static bindingToTsvBindings(e){return e?(0,a.termToString)(e).replaceAll("\t","\\t").replaceAll("\n","\\n").replaceAll("\r","\\r"):""}async testHandleChecked(e,t){return"bindings"!==e.type?(0,i.failTest)("This actor can only handle bindings streams."):(0,i.passTestVoid)()}async runHandle(e,t,r){const n=e,i=new o.Readable,a=await n.metadata();return i.push(`${a.variables.map((e=>`?${e.variable.value}`)).join("\t")}\n`),i.wrap(n.bindingsStream.map((e=>`${a.variables.map((t=>s.bindingToTsvBindings(e.get(t.variable)))).join("\t")}\n`))),{data:i}}}t.ActorQueryResultSerializeSparqlTsv=s},53724:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(84668),t)},12560:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeSparqlXml=void 0;const n=r(89655),i=r(97356),a=r(76664),o=r(58521),s=r(67109);class c extends n.ActorQueryResultSerializeFixedMediaTypes{constructor(e){super(e)}static bindingToXmlBindings(e,t){return{name:"binding",attributes:{name:t.value},children:[this.valueToXmlValue(e)]}}static valueToXmlValue(e){let t;switch(e.termType){case"Literal":return t=e.language?{"xml:lang":e.language,...e.direction?{"its:dir":e.direction}:{}}:e.datatype&&"http://www.w3.org/2001/XMLSchema#string"!==e.datatype.value?{datatype:e.datatype.value}:{},{name:"literal",attributes:t,children:e.value};case"BlankNode":return{name:"bnode",children:e.value};case"Quad":return{name:"triple",children:[{name:"subject",children:[this.valueToXmlValue(e.subject)]},{name:"predicate",children:[this.valueToXmlValue(e.predicate)]},{name:"object",children:[this.valueToXmlValue(e.object)]}]};default:return{name:"uri",children:e.value}}}async testHandleChecked(e,t){return["bindings","boolean"].includes(e.type)?(0,i.passTestVoid)():(0,i.failTest)("This actor can only handle bindings streams or booleans.")}async runHandle(e,t,r){const n=new o.Readable;n._read=()=>{};const i=new s.XmlSerializer,u=await e.metadata();if(n.push(s.XmlSerializer.header),n.push(i.open("sparql",{xmlns:"http://www.w3.org/2005/sparql-results#","xmlns:its":"http://www.w3.org/2005/11/its","its:version":"2.0"})),n.push(i.serializeNode({name:"head",children:u.variables.map((e=>({name:"variable",attributes:{name:e.variable.value}})))})),"bindings"===e.type){function*l(){yield i.close(),yield i.close()}n.push(i.open("results"));const d=(0,a.wrap)(e.bindingsStream).map((e=>i.serializeNode({name:"result",children:[...e].map((([e,t])=>c.bindingToXmlBindings(t,e)))}))).append((0,a.wrap)(l()));n.wrap(d)}else try{const p=await e.execute();n.push(i.serializeNode({name:"boolean",children:p.toString()})),n.push(i.close()),setTimeout((()=>n.push(null)))}catch(h){setTimeout((()=>n.emit("error",h)))}return{data:n}}}t.ActorQueryResultSerializeSparqlXml=c},67109:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XmlSerializer=void 0,t.XmlSerializer=class{stack=[];static header='\n';constructor(){}open(e,t){const r=`${this.identation()+this.formatTag(e,t,"open")}\n`;return this.stack.push(e),r}close(){const e=this.stack.pop();if(void 0===e)throw new Error("There is no tag left to close");return`${this.identation()+this.formatTag(e,{},"close")}\n`}serializeNode(e){if(void 0===e.children)return`${this.identation()+this.formatTag(e.name,e.attributes,"self-closing")}\n`;if("string"==typeof e.children)return`${this.identation()+this.formatTag(e.name,e.attributes,"open")+this.escape(e.children)+this.formatTag(e.name,{},"close")}\n`;const t=[];t.push(`${this.identation()+this.formatTag(e.name,e.attributes,"open")}\n`),this.stack.push(e.name);for(const r of e.children)t.push(this.serializeNode(r));return this.stack.pop(),t.push(`${this.identation()+this.formatTag(e.name,{},"close")}\n`),t.join("")}identation(){return this.stack.map((e=>" ")).join("")}formatTag(e,t,r){return`<${"close"===r?"/":""}${e}${Object.entries(t??{}).map((e=>` ${e[0]}="${this.escape(e[1])}"`)).join("")}${"self-closing"===r?"/":""}>`}escape(e){return e.replaceAll(/["&'<>]/gu,(e=>{switch(e){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case'"':return"""}}))}}},72512:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(12560),t)},13762:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionObserverHttp=void 0;const n=r(97356);class i extends n.ActionObserver{httpInvalidator;observedActors;requests=0;constructor(e){super(e),this.httpInvalidator=e.httpInvalidator,this.observedActors=e.observedActors,this.bus.subscribeObserver(this),this.httpInvalidator.addInvalidateListener((()=>{this.requests=0}))}onRun(e,t,r){this.observedActors.includes(e.name)&&this.requests++}}t.ActionObserverHttp=i},37145:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeStats=void 0;const n=r(89655),i=r(72407),a=r(97356),o=r(76664),s=r(58521);class c extends n.ActorQueryResultSerializeFixedMediaTypes{httpObserver;constructor(e){super(e),this.httpObserver=e.httpObserver}async testHandleChecked(e,t){return["bindings","quads"].includes(e.type)?(0,a.passTestVoid)():(0,a.failTest)("This actor can only handle bindings streams or quad streams.")}pushHeader(e){const t=["Result","Delay (ms)","HTTP requests"].join(",");e.push(`${t}\n`)}createStat(e,t){return`${[t,this.delay(e),this.httpObserver.requests].join(",")}\n`}createSpecialLine(e,t){return`${[e,this.delay(t),this.httpObserver.requests].join(",")}\n`}async runHandle(e,t,r){const n=new s.Readable,a="bindings"===e.type?e.bindingsStream:e.quadStream,c=e.context.getSafe(i.KeysInitQuery.queryTimestampHighResolution);let u=1;const l=(0,o.wrap)(a).map((()=>this.createStat(c,u++))).prepend([this.createSpecialLine("PLANNING",c)]).append((0,o.wrap)(function*(e){yield e()}((()=>this.createSpecialLine("TOTAL",c)))));return this.pushHeader(n),n.wrap(l),{data:n}}now(){return performance.now()}delay(e){return this.now()-e}}t.ActorQueryResultSerializeStats=c},35712:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(13762),t),i(r(37145),t)},89695:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeTable=void 0;const n=r(89655),i=r(72407),a=r(97356),o=r(22112),s=r(13252),c=r(58521);class u extends n.ActorQueryResultSerializeFixedMediaTypes{columnWidth;padding;constructor(e){super(e),this.columnWidth=e.columnWidth,this.padding=u.repeat(" ",this.columnWidth)}static repeat(e,t){return e.repeat(t)}async testHandleChecked(e,t){return["bindings","quads"].includes(e.type)?(0,a.passTestVoid)():(0,a.failTest)("This actor can only handle bindings or quad streams.")}termToString(e){return"Quad"===e.termType?(0,o.termToString)(e):e.value}pad(e){return e.length<=this.columnWidth?e+this.padding.slice(e.length):`${e.slice(0,this.columnWidth-1)}…`}pushHeader(e,t){const r=t.map((e=>this.pad(e.value))).join(" ");e.push(`${r}\n${u.repeat("-",r.length)}\n`)}createRow(e,t){return`${e.map((e=>t.has(e)?this.termToString(t.get(e)):"")).map((e=>this.pad(e))).join(" ")}\n`}async runHandle(e,t,r){const n=new c.Readable;let a;if("bindings"===e.type){a=e.bindingsStream.map((e=>this.createRow(t,e)));const t=(await e.metadata()).variables.map((e=>e.variable));this.pushHeader(n,t)}else{a=e.quadStream.map((e=>`${(0,s.getTerms)(e).map((e=>this.pad(this.termToString(e)))).join(" ")}\n`));const t=e.context.getSafe(i.KeysInitQuery.dataFactory);this.pushHeader(n,s.QUAD_TERM_NAMES.map((e=>t.variable(e))))}return n.wrap(a),{data:n}}}t.ActorQueryResultSerializeTable=u},79171:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(89695),t)},91937:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeTree=void 0;const n=r(89655),i=r(72407),a=r(97356),o=r(58521),s=r(43004);class c extends n.ActorQueryResultSerializeFixedMediaTypes{constructor(e){super(e)}static async bindingsStreamToGraphQl(e,t,r){const n=a.ActionContext.ensureActionContext(t),o=new s.Converter(r),c={singularizeVariables:n.get(i.KeysInitQuery.graphqlSingularizeVariables)??{}};return o.bindingsToTree(await e.map((e=>Object.fromEntries([...e].map((([e,t])=>[e.value,t]))))).toArray(),c)}async testHandleChecked(e){return"bindings"!==e.type?(0,a.failTest)("This actor can only handle bindings streams."):(0,a.passTestVoid)()}async runHandle(e,t){const r=new o.Readable;return r._read=()=>{r._read=()=>{},c.bindingsStreamToGraphQl(e.bindingsStream,e.context,{materializeRdfJsTerms:!0}).then((e=>{r.push(JSON.stringify(e,null," ")),r.push(null)})).catch((e=>r.emit("error",e)))},{data:r}}}t.ActorQueryResultSerializeTree=c},74213:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.bindingsStreamToGraphQl=void 0;const a=r(91937),{bindingsStreamToGraphQl:o}=a.ActorQueryResultSerializeTree;t.bindingsStreamToGraphQl=o,i(r(91937),t)},88622:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySerializeSparql=void 0;const n=r(20685),i=r(97356),a=r(64423),o=r(74735),s=r(64394);class c extends n.ActorQuerySerialize{constructor(e){super(e)}async test(e){return"sparql"!==e.queryFormat.language?(0,i.failTest)("This actor can only serialize SPARQL queries"):(0,i.passTestVoid)()}async run(e){const t=new s.Generator({[o.traqulaIndentation]:!1===e.newlines?-1:0,indentInc:e.indentWidth??2}),r=(0,a.toAst)(e.operation);return{query:t.generate(r).trim()}}}t.ActorQuerySerializeSparql=c},7072:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(88622),t)},30169:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceDereferenceLinkForceSparql=void 0;const n=r(89372),i=r(72407),a=r(97356),o=r(58521);class s extends n.ActorQuerySourceDereferenceLink{mediatorMetadataAccumulate;mediatorQuerySourceIdentifyHypermedia;constructor(e){super(e),this.mediatorMetadataAccumulate=e.mediatorMetadataAccumulate,this.mediatorQuerySourceIdentifyHypermedia=e.mediatorQuerySourceIdentifyHypermedia}async test(e){return"sparql"===e.link.forceSourceType&&1===e.context.get(i.KeysQueryOperation.querySources)?.length?(0,a.passTestVoid)():(0,a.failTest)(`${this.name} can only handle a single forced SPARQL source`)}async run(e){const t=e.link.context?e.context.merge(e.link.context):e.context,r=new o.Readable;r._read=()=>(r.push(null),null);const n=(await this.mediatorMetadataAccumulate.mediate({context:e.context,mode:"initialize"})).metadata,{source:i,dataset:a}=await this.mediatorQuerySourceIdentifyHypermedia.mediate({context:t,forceSourceType:e.link.forceSourceType,handledDatasets:e.handledDatasets,metadata:n,quads:r,url:e.link.url});return{source:i,metadata:n,dataset:a}}}t.ActorQuerySourceDereferenceLinkForceSparql=s},61245:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(30169),t)},9980:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceDereferenceLinkHypermedia=void 0;const n=r(89372),i=r(72407),a=r(97356),o=r(58521),s=r(7326);class c extends n.ActorQuerySourceDereferenceLink{mediatorDereferenceRdf;mediatorMetadata;mediatorMetadataExtract;mediatorMetadataAccumulate;mediatorQuerySourceIdentifyHypermedia;sparqlServiceDescriptionTimeout;constructor(e){super(e),this.mediatorDereferenceRdf=e.mediatorDereferenceRdf,this.mediatorMetadata=e.mediatorMetadata,this.mediatorMetadataExtract=e.mediatorMetadataExtract,this.mediatorMetadataAccumulate=e.mediatorMetadataAccumulate,this.mediatorQuerySourceIdentifyHypermedia=e.mediatorQuerySourceIdentifyHypermedia,this.sparqlServiceDescriptionTimeout=e.sparqlServiceDescriptionTimeout??3e3}async test(e){return(0,a.passTestVoid)()}getDereferenceRdfContext(e,t,r){const n="sparql"===r||!r&&(t.endsWith("/sparql")||t.endsWith("/sparql/"));if(this.sparqlServiceDescriptionTimeout>0&&n){const t=e.get(i.KeysHttp.httpTimeout),r=void 0!==t&&t>0?Math.min(t,this.sparqlServiceDescriptionTimeout):this.sparqlServiceDescriptionTimeout;return r===t?e:e.set(i.KeysHttp.httpTimeout,r)}return e}async run(e){const t=e.link.context?e.context.merge(e.link.context):e.context;let r,n,a,c=e.link.url;try{const i=this.getDereferenceRdfContext(t,c,e.link.forceSourceType),o=await this.mediatorDereferenceRdf.mediate({context:i,url:c});c=o.url,o.cachePolicy&&(a=new s.QuerySourceCachePolicyDereferenceWrapper(o.cachePolicy));const u=await this.mediatorMetadata.mediate({context:t,url:c,quads:o.data,triples:o.metadata?.triples});u.data.on("error",(()=>{})),n=(await this.mediatorMetadataExtract.mediate({context:t,url:c,metadata:u.metadata,headers:o.headers,requestTime:o.requestTime})).metadata,r=u.data,e.link.transform&&(r=await e.link.transform(r))}catch(i){r=new o.Readable,r.read=()=>(setTimeout((()=>r.emit("error",i))),null),({metadata:n}=await this.mediatorMetadataAccumulate.mediate({context:t,mode:"initialize"})),this.logWarn(t,`Metadata extraction for ${e.link.url} failed: ${i.message}`)}const{source:u,dataset:l}=await this.mediatorQuerySourceIdentifyHypermedia.mediate({context:t,forceSourceType:e.link.forceSourceType,handledDatasets:e.handledDatasets,metadata:n,quads:r,url:c});return l&&e.handledDatasets&&(e.handledDatasets[l]=!0),t.get(i.KeysStatistics.dereferencedLinks)?.updateStatistic({url:e.link.url,metadata:n},u),{source:u,metadata:n,dataset:l,cachePolicy:a}}}t.ActorQuerySourceDereferenceLinkHypermedia=c},7326:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuerySourceCachePolicyDereferenceWrapper=void 0;class r{cachePolicy;constructor(e){this.cachePolicy=e}storable(){return this.cachePolicy.storable()}async satisfiesWithoutRevalidation(e){return this.cachePolicy.satisfiesWithoutRevalidation({url:e.link.url,context:e.context})}responseHeaders(){return this.cachePolicy.responseHeaders()}timeToLive(){return this.cachePolicy.timeToLive()}async revalidationHeaders(e){return this.cachePolicy.revalidationHeaders({url:e.link.url,context:e.context})}async revalidatedPolicy(e,t){const n=await this.cachePolicy.revalidatedPolicy({url:e.link.url,context:e.context},t);return{policy:new r(n.policy),modified:n.modified,matches:n.matches}}}t.QuerySourceCachePolicyDereferenceWrapper=r},78652:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(9980),t),i(r(7326),t)},56947:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceIdentifyCompositeFile=void 0;const n=r(54598),i=r(70287),a=r(72407),o=r(97356),s=r(34005),c=r(23814),u=r(92427);class l extends i.ActorQuerySourceIdentify{mediatorQuerySourceIdentify;mediatorMergeBindingsContext;constructor(e){super(e),this.mediatorQuerySourceIdentify=e.mediatorQuerySourceIdentify,this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}async test(e){return"compositefile"!==e.querySourceUnidentified.type?(0,o.failTest)(`${this.name} requires a single query source with compositefile type to be present in the context.`):Array.isArray(e.querySourceUnidentified.value)?(0,o.passTestVoid)():(0,o.failTest)(`${this.name} requires a compositefile source with an array of file URLs as value.`)}async run(e){const t=e.querySourceUnidentified,r=e.context.getSafe(a.KeysInitQuery.dataFactory),i=new s.AlgebraFactory(r),o=u.RdfStore.createDefault(!0);for(const n of t.value){const t=("string"==typeof n?(await this.mediatorQuerySourceIdentify.mediate({querySourceUnidentified:{type:"file",value:n},context:e.context})).querySource:n).source.queryQuads(i.createPattern(r.variable("s"),r.variable("p"),r.variable("o"),r.variable("g")),e.context);await new Promise(((e,r)=>{o.import(t).on("error",r).once("end",e)}))}const l=new n.QuerySourceRdfJs(o,r,await c.BindingsFactory.create(this.mediatorMergeBindingsContext,e.context,r)),d=t.value.map((e=>"string"==typeof e?e:e.source.referenceValue));return l.referenceValue=d.join("\n"),l.toString=()=>`QuerySourceRdfJs(composite: ${d.join(",")})`,{querySource:{source:l,context:t.context}}}}t.ActorQuerySourceIdentifyCompositeFile=l},21188:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(56947),t)},8754:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceIdentifyHypermediaNone=void 0;const n=r(54598),i=r(30196),a=r(72407),o=r(97356),s=r(23814),c=r(92427);class u extends i.ActorQuerySourceIdentifyHypermedia{mediatorMergeBindingsContext;constructor(e){super(e,"file"),this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}async testMetadata(e){return(0,o.passTest)({filterFactor:0})}async run(e){this.logInfo(e.context,`Identified as file source: ${e.url}`);const t=e.context.getSafe(a.KeysInitQuery.dataFactory),r=new n.QuerySourceRdfJs(await u.storeStream(e.quads),t,await s.BindingsFactory.create(this.mediatorMergeBindingsContext,e.context,t));return r.toString=()=>`QuerySourceRdfJs(${e.url})`,r.referenceValue=e.url,{source:r}}static storeStream(e){const t=c.RdfStore.createDefault(!0);return new Promise(((r,n)=>t.import(e).on("error",n).once("end",(()=>r(t)))))}}t.ActorQuerySourceIdentifyHypermediaNone=u},20278:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8754),t)},86852:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceIdentifyHypermediaQpf=void 0;const n=r(30196),i=r(72407),a=r(97356),o=r(34005),s=r(23814),c=r(19851);class u extends n.ActorQuerySourceIdentifyHypermedia{mediatorMetadata;mediatorMetadataExtract;mediatorDereferenceRdf;mediatorMergeBindingsContext;subjectUri;predicateUri;objectUri;graphUri;constructor(e){super(e,"qpf"),this.mediatorMetadata=e.mediatorMetadata,this.mediatorMetadataExtract=e.mediatorMetadataExtract,this.mediatorDereferenceRdf=e.mediatorDereferenceRdf,this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext,this.subjectUri=e.subjectUri,this.predicateUri=e.predicateUri,this.objectUri=e.objectUri,this.graphUri=e.graphUri}async test(e){return e.forceSourceType&&"qpf"!==e.forceSourceType&&"brtpf"!==e.forceSourceType?(0,a.failTest)(`Actor ${this.name} is not able to handle source type ${e.forceSourceType}.`):this.testMetadata(e)}async testMetadata(e){const{searchForm:t}=await this.createSource(e.url,e.metadata,e.context,"brtpf"===e.forceSourceType);return t?e.handledDatasets&&e.handledDatasets[t.dataset]?(0,a.failTest)(`Actor ${this.name} can only be applied for the first page of a QPF dataset.`):(0,a.passTest)({filterFactor:1}):(0,a.failTest)("Illegal state: found no TPF/QPF search form anymore in metadata.")}async run(e){this.logInfo(e.context,`Identified as qpf source: ${e.url}`);const t=await this.createSource(e.url,e.metadata,e.context,"brtpf"===e.forceSourceType,e.quads);return{source:t,dataset:t.searchForm.dataset}}async createSource(e,t,r,n,a){const u=r.getSafe(i.KeysInitQuery.dataFactory),l=new o.AlgebraFactory(u);return new c.QuerySourceQpf(this.mediatorMetadata,this.mediatorMetadataExtract,this.mediatorDereferenceRdf,u,l,await s.BindingsFactory.create(this.mediatorMergeBindingsContext,r,u),this.subjectUri,this.predicateUri,this.objectUri,this.graphUri,e,t,n,a)}}t.ActorQuerySourceIdentifyHypermediaQpf=u},19851:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuerySourceQpf=void 0;const n=r(70287),i=r(72407),a=r(34005),o=r(49102),s=r(76664),c=r(22112),u=r(64817),l=r(13252);function d(e){return"DefaultGraph"===e.termType?"|":(0,c.termToString)(e)}t.QuerySourceQpf=class{selectorShape;searchForm;mediatorMetadata;mediatorMetadataExtract;mediatorDereferenceRdf;dataFactory;algebraFactory;bindingsFactory;referenceValue;subjectUri;predicateUri;objectUri;graphUri;url;defaultGraph;bindingsRestricted;cachedQuads;constructor(e,t,r,n,i,a,c,u,l,d,p,h,f,y){if(this.referenceValue=p,this.mediatorMetadata=e,this.mediatorMetadataExtract=t,this.mediatorDereferenceRdf=r,this.dataFactory=n,this.algebraFactory=i,this.bindingsFactory=a,this.subjectUri=c,this.predicateUri=u,this.objectUri=l,this.graphUri=d,this.url=p,this.bindingsRestricted=f,this.cachedQuads={},this.searchForm=this.getSearchForm(h),this.defaultGraph=h.defaultGraph?this.dataFactory.namedNode(h.defaultGraph):void 0,y){let e=(0,s.wrap)(y);this.defaultGraph&&(e=this.reverseMapQuadsToDefaultGraph(e)),h={...h,state:new o.MetadataValidationState},e.setProperty("metadata",h),this.cacheQuads(e,this.dataFactory.variable(""),this.dataFactory.variable(""),this.dataFactory.variable(""),this.dataFactory.variable(""))}this.selectorShape=this.bindingsRestricted?{type:"operation",operation:{operationType:"pattern",pattern:this.algebraFactory.createPattern(this.dataFactory.variable("s"),this.dataFactory.variable("p"),this.dataFactory.variable("o"),this.dataFactory.variable("g"))},variablesOptional:[this.dataFactory.variable("s"),this.dataFactory.variable("p"),this.dataFactory.variable("o"),this.dataFactory.variable("g")],filterBindings:!0}:{type:"operation",operation:{operationType:"pattern",pattern:this.algebraFactory.createPattern(this.dataFactory.variable("s"),this.dataFactory.variable("p"),this.dataFactory.variable("o"),this.dataFactory.variable("g"))},variablesOptional:[this.dataFactory.variable("s"),this.dataFactory.variable("p"),this.dataFactory.variable("o"),this.dataFactory.variable("g")]}}async getFilterFactor(){return 1}async getSelectorShape(){return this.selectorShape}queryBindings(e,t,r){if(!(0,a.isKnownOperation)(e,a.Algebra.Types.PATTERN))throw new Error(`Attempted to pass non-pattern operation '${e.type}' to QuerySourceQpf`);const o=Boolean(t.get(i.KeysQueryOperation.unionDefaultGraph)),s=this.match(e.subject,e.predicate,e.object,e.graph,o,t,r);return(0,n.quadsToBindings)(s,e,this.dataFactory,this.bindingsFactory,o)}getSearchForm(e){if(!e.searchForms||!e.searchForms.values)return;const{searchForms:t}=e;for(const e of t.values){if(this.graphUri&&this.subjectUri in e.mappings&&this.predicateUri in e.mappings&&this.objectUri in e.mappings&&this.graphUri in e.mappings&&4===Object.keys(e.mappings).length)return e;if(this.subjectUri in e.mappings&&this.predicateUri in e.mappings&&this.objectUri in e.mappings&&3===Object.keys(e.mappings).length)return e}}createFragmentUri(e,t,r,n,i){const a={},o=[{uri:this.subjectUri,term:t},{uri:this.predicateUri,term:r},{uri:this.objectUri,term:n},{uri:this.graphUri,term:i}];for(const e of o)e.uri&&(this.bindingsRestricted||"Variable"!==e.term.termType&&("Quad"!==e.term.termType||(0,l.everyTermsNested)(e.term,(e=>"Variable"!==e.termType))))&&(a[e.uri]=(0,c.termToString)(e.term));return e.getUri(a)}match(e,t,r,n,i,a,c){let u=!1;if("DefaultGraph"===n.termType)if(this.defaultGraph)u=!0,n=this.defaultGraph;else if(4!==Object.keys(this.searchForm.mappings).length||this.defaultGraph)n=this.dataFactory.variable("g");else{if(!i){const e=new s.ArrayIterator([],{autoStart:!1});return e.setProperty("metadata",{state:new o.MetadataValidationState,requestTime:0,cardinality:{type:"exact",value:0},first:null,next:null,last:null}),e}n=this.dataFactory.variable("g")}if(!c?.filterBindings){const i=this.getCachedQuads(e,t,r,n);if(i)return i}const d=this;let p;const h=async function(){let i=d.createFragmentUri(d.searchForm,e,t,r,n);c?.filterBindings&&(i=await d.getBindingsRestrictedLink(e,t,r,n,i,c.filterBindings));const s=await d.mediatorDereferenceRdf.mediate({context:a,url:i});i=s.url;const u=await d.mediatorMetadata.mediate({context:a,url:i,quads:s.data,triples:s.metadata?.triples}),{metadata:l}=await d.mediatorMetadataExtract.mediate({context:a,url:i,metadata:u.metadata,requestTime:s.requestTime});return p.setProperty("metadata",{...l,state:new o.MetadataValidationState,subsetOf:d.url}),u.data}();return p=new s.TransformIterator((async()=>{const i=await h,a=this.dataFactory.defaultGraph();let o=(0,s.wrap)(i).transform({filter:i=>!!(0,l.matchPattern)(i,e,t,r,n)||u&&(0,l.matchPattern)(i,e,t,r,a)});return(u||"Variable"===n.termType)&&(o=this.reverseMapQuadsToDefaultGraph(o)),o}),{autoStart:!1}),c?.filterBindings?p:(this.cacheQuads(p,e,t,r,n),this.getCachedQuads(e,t,r,n))}async getBindingsRestrictedLink(e,t,r,n,i,a){const o=[];for(const e of await a.bindings.toArray()){const t=["("];for(const r of a.metadata.variables){const n=e.get(r.variable);t.push(n?(0,u.termToString)(n):"UNDEF"),t.push(" ")}t.push(")"),o.push(t.join(""))}return 0===o.length&&o.push("()"),`${i}&values=${encodeURIComponent(`(${a.metadata.variables.map((e=>`?${e.variable.value}`)).join(" ")}) { ${o.join(" ")} }`)}`}reverseMapQuadsToDefaultGraph(e){const t=this.dataFactory.defaultGraph();return e.map((e=>(0,l.mapTerms)(e,((e,r)=>"graph"===r&&e.equals(this.defaultGraph)?t:e))))}getPatternId(e,t,r,n){return JSON.stringify({s:"Variable"===e.termType?"":d(e),p:"Variable"===t.termType?"":d(t),o:"Variable"===r.termType?"":d(r),g:"Variable"===n.termType?"":d(n)})}cacheQuads(e,t,r,n,i){const a=this.getPatternId(t,r,n,i);this.cachedQuads[a]=e.clone()}getCachedQuads(e,t,r,n){const i=this.getPatternId(e,t,r,n),a=this.cachedQuads[i];if(a)return a.clone()}queryQuads(e,t){throw new Error("queryQuads is not implemented in QuerySourceQpf")}queryBoolean(e,t){throw new Error("queryBoolean is not implemented in QuerySourceQpf")}queryVoid(e,t){throw new Error("queryVoid is not implemented in QuerySourceQpf")}}},35945:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(86852),t),i(r(19851),t)},99612:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceIdentifyHypermediaSparql=void 0;const n=r(30196),i=r(72407),a=r(97356),o=r(34005),s=r(23814),c=r(95941);class u extends n.ActorQuerySourceIdentifyHypermedia{mediatorHttp;mediatorMergeBindingsContext;mediatorQuerySerialize;checkUrlSuffix;forceHttpGet;cacheSize;forceSourceType;bindMethod;countTimeout;cardinalityCountQueries;cardinalityEstimateConstruction;forceGetIfUrlLengthBelow;sparqlServerSoftwarePatterns;constructor(e){super(e,"sparql"),this.mediatorHttp=e.mediatorHttp,this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext,this.mediatorQuerySerialize=e.mediatorQuerySerialize,this.checkUrlSuffix=e.checkUrlSuffix,this.forceHttpGet=e.forceHttpGet,this.cacheSize=e.cacheSize,this.forceSourceType=Boolean(e.forceSourceType),this.bindMethod=e.bindMethod,this.countTimeout=e.countTimeout,this.cardinalityCountQueries=e.cardinalityCountQueries,this.cardinalityEstimateConstruction=e.cardinalityEstimateConstruction,this.forceGetIfUrlLengthBelow=e.forceGetIfUrlLengthBelow,this.sparqlServerSoftwarePatterns=(e.sparqlServerSoftwarePatterns??[]).map((e=>new RegExp(e,"u")))}checkServerSoftware(e){if(!e)return!1;for(const t of this.sparqlServerSoftwarePatterns)if(t.test(e))return!0;return!1}async testMetadata(e){return e.forceSourceType||this.forceSourceType||e.metadata.sparqlService||this.checkUrlSuffix&&(e.url.endsWith("/sparql")||e.url.endsWith("/sparql/"))||this.checkServerSoftware(e.metadata.serverSoftware)?(0,a.passTest)({filterFactor:1}):(0,a.failTest)(`Actor ${this.name} could not detect a SPARQL service description or URL ending on /sparql.`)}async run(e){this.logInfo(e.context,`Identified ${e.url} as sparql source with service URL: ${e.metadata.sparqlService||e.url}`);const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.AlgebraFactory(t),n=1===e.context.get(i.KeysQueryOperation.querySources)?.length;return{source:new c.QuerySourceSparql(e.forceSourceType??this.forceSourceType?e.url:e.metadata.sparqlService||e.url,e.url,e.context,this.mediatorHttp,this.mediatorQuerySerialize,this.bindMethod,t,r,await s.BindingsFactory.create(this.mediatorMergeBindingsContext,e.context,t),this.forceHttpGet,this.cacheSize,this.countTimeout,this.cardinalityCountQueries&&!n,this.cardinalityEstimateConstruction,this.forceGetIfUrlLengthBelow,Boolean(e.context.get(i.KeysInitQuery.parseUnsupportedVersions)),e.metadata)}}}t.ActorQuerySourceIdentifyHypermediaSparql=u},95941:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuerySourceSparql=void 0;const n=r(72407),i=r(97356),a=r(34005),o=r(49102),s=r(98989),c=r(76664),u=r(74190),l=r(35069),d=r(13252);class p{referenceValue;url;urlBackup;context;mediatorHttp;mediatorQuerySerialize;bindMethod;countTimeout;cardinalityCountQueries;cardinalityEstimateConstruction;defaultGraph;unionDefaultGraph;propertyFeatures;datasets;extensionFunctions;dataFactory;algebraFactory;bindingsFactory;endpointFetcher;cache;lastSourceContext;constructor(e,t,r,n,a,o,s,c,d,p,h,f,y,m,g,b,v){this.referenceValue=t,this.url=e,this.urlBackup=t,this.context=r,this.mediatorHttp=n,this.mediatorQuerySerialize=a,this.bindMethod=o,this.dataFactory=s,this.algebraFactory=c,this.bindingsFactory=d,this.endpointFetcher=new u.SparqlEndpointFetcher({method:p?"GET":"POST",fetch:async(e,t)=>{const r=await this.mediatorHttp.mediate({input:e,init:t,context:this.lastSourceContext});return 404===r.status&&this.url!==this.urlBackup?(i.Actor.getContextLogger(this.context)?.warn(`Encountered a 404 when requesting ${this.url} according to the service description of ${this.urlBackup}. This is a server configuration issue. Retrying the current and modifying future requests to ${this.urlBackup} instead.`),e=e.replace(this.url,this.urlBackup),this.url=this.urlBackup,await this.mediatorHttp.mediate({input:e,init:t,context:this.lastSourceContext})):r},prefixVariableQuestionMark:!0,dataFactory:s,forceGetIfUrlLengthBelow:g,directPost:v.postAccepted&&!v.postAccepted.includes("application/x-www-form-urlencoded"),parseUnsupportedVersions:b}),this.cache=h>0?new l.LRUCache({max:h}):void 0,this.countTimeout=f,this.cardinalityCountQueries=y,this.cardinalityEstimateConstruction=m,this.defaultGraph=v.defaultGraph,this.unionDefaultGraph=v.unionDefaultGraph??!1,this.datasets=v.datasets,this.extensionFunctions=v.extensionFunctions,this.propertyFeatures=v.propertyFeatures?new Set(v.propertyFeatures):void 0}async getFilterFactor(){return 1}async getSelectorShape(){const e={type:"disjunction",children:[{type:"operation",operation:{operationType:"wildcard"},joinBindings:!0}]};return this.extensionFunctions&&e.children.push({type:"operation",operation:{operationType:"type",type:a.Algebra.Types.EXPRESSION,extensionFunctions:this.extensionFunctions},joinBindings:!0}),{type:"conjunction",children:[e,{type:"negation",child:{type:"operation",operation:{operationType:"type",type:a.Algebra.Types.DISTINCT},children:[{type:"operation",operation:{operationType:"type",type:a.Algebra.Types.CONSTRUCT},children:[{type:"operation",operation:{operationType:"wildcard"},joinBindings:!0}]}]}}]}}queryBindings(e,t,r){let i;i=r?.joinBindings?p.addBindingsToOperation(this.algebraFactory,this.bindMethod,e,r.joinBindings):Promise.resolve(e);const o=new c.TransformIterator((async()=>{const e=await i,o=a.algebraUtils.inScopeVariables(e),s=t.get(n.KeysInitQuery.queryString),c=t.getSafe(n.KeysInitQuery.queryFormat),u=!r?.joinBindings&&s&&"sparql"===c.language?s:await this.operationToSelectQuery(this.algebraFactory,e,o),l=p.getOperationUndefs(e);return this.queryBindingsRemote(this.url,u,o,t,l)}),{autoStart:!1});return this.attachMetadata(o,t,i),o}queryQuads(e,t){const r=(0,c.wrap)((async()=>{this.lastSourceContext=this.context.merge(t);const r=t.get(n.KeysInitQuery.queryString)??await this.operationToQuery(e);return await this.endpointFetcher.fetchTriples(this.url,r)})(),{autoStart:!1,maxBufferSize:Number.POSITIVE_INFINITY});return this.attachMetadata(r,t,Promise.resolve(e.input)),r}async queryBoolean(e,t){if(this.operationUsesPropertyFeatures(e))return!0;this.lastSourceContext=this.context.merge(t);const r=t.get(n.KeysInitQuery.queryString)??await this.operationToQuery(e);return this.endpointFetcher.fetchAsk(this.url,r)}async queryVoid(e,t){this.lastSourceContext=this.context.merge(t);const r=t.get(n.KeysInitQuery.queryString)??await this.operationToQuery(e);return this.endpointFetcher.fetchUpdate(this.url,r)}attachMetadata(e,t,r){let n=[];new Promise((async(e,i)=>{try{const i=await r,o=a.algebraUtils.inScopeVariables(i),s=await this.operationToNormalizedCountQuery(i),c=p.getOperationUndefs(i);n=o.map((e=>({variable:e,canBeUndef:c.some((t=>t.equals(e)))})));const u=this.cache?.get(s);if(u)return e(u);if(this.cardinalityEstimateConstruction){const t=await this.estimateOperationCardinality(i);if(Number.isFinite(t.value))return this.cache?.set(s,t),e(t)}if(!this.cardinalityCountQueries)return e({type:"estimate",value:Number.POSITIVE_INFINITY,dataset:this.url});const l=setTimeout((()=>e({type:"estimate",value:Number.POSITIVE_INFINITY,dataset:this.url})),this.countTimeout),d=this.dataFactory.variable("count");(await this.queryBindingsRemote(this.url,s,[d],t,[])).on("data",(t=>{clearTimeout(l);const r=t.get(d),n={type:"estimate",value:Number.POSITIVE_INFINITY,dataset:this.url};if(r){const e=Number.parseInt(r.value,10);Number.isNaN(e)||(n.type="exact",n.value=e,this.cache?.set(s,n))}return e(n)})).on("error",(()=>{clearTimeout(l),e({type:"estimate",value:Number.POSITIVE_INFINITY,dataset:this.url})})).on("end",(()=>{clearTimeout(l),e({type:"estimate",value:Number.POSITIVE_INFINITY,dataset:this.url})}))}catch(e){i(e)}})).then((t=>e.setProperty("metadata",{state:new o.MetadataValidationState,cardinality:t,variables:n}))).catch((()=>e.setProperty("metadata",{state:new o.MetadataValidationState,cardinality:{type:"estimate",value:Number.POSITIVE_INFINITY,dataset:this.url},variables:n})))}async operationToNormalizedCountQuery(e){const t=(0,a.isKnownOperation)(e,a.Algebra.Types.PATTERN)?this.algebraFactory.createPattern("Variable"===e.subject.termType?this.dataFactory.variable("s"):e.subject,"Variable"===e.predicate.termType?this.dataFactory.variable("p"):e.predicate,"Variable"===e.object.termType?this.dataFactory.variable("o"):e.object):e;return await this.operationToCountQuery(this.dataFactory,this.algebraFactory,t)}async estimateOperationCardinality(e){if(this.operationUsesPropertyFeatures(e))return{type:"estimate",value:1,dataset:this.url};const t={getCardinality:async e=>{const t=await this.operationToNormalizedCountQuery(e),r=this.cache?.get(t);if(r)return r;if(this.datasets){const t=await Promise.all(this.datasets.filter((e=>this.unionDefaultGraph||this.defaultGraph&&e.uri.endsWith(this.defaultGraph))).map((t=>(0,s.estimateCardinality)(e,t))));return{type:t.some((e=>"estimate"===e.type))?"estimate":"exact",value:t.length>0?t.reduce(((e,t)=>e+t.value),0):0,dataset:this.url}}},source:this.url,uri:this.url};return(0,s.estimateCardinality)(e,t)}operationUsesPropertyFeatures(e){let t=!1;return this.propertyFeatures&&a.algebraUtils.visitOperation(e,{[a.Algebra.Types.PATTERN]:{visitor:e=>("NamedNode"===e.predicate.termType&&this.propertyFeatures.has(e.predicate.value)&&(t=!0),!1)},[a.Algebra.Types.LINK]:{visitor:e=>(this.propertyFeatures.has(e.iri.value)&&(t=!0),!1)},[a.Algebra.Types.NPS]:{visitor:e=>(e.iris.some((e=>this.propertyFeatures.has(e.value)))&&(t=!0),!1)}}),t}static async addBindingsToOperation(e,t,r,n){const i=await n.bindings.toArray();switch(t){case"values":return e.createJoin([e.createValues(n.metadata.variables.map((e=>e.variable)),i.map((e=>Object.fromEntries([...e].map((([e,t])=>[e.value,t])))))),r],!1);case"union":throw new Error('Not implemented yet: "union" case');case"filter":throw new Error('Not implemented yet: "filter" case')}}operationToSelectQuery(e,t,r){return this.operationToQuery(e.createProject(t,r))}operationToCountQuery(e,t,r){return this.operationToQuery(t.createProject(t.createExtend(t.createGroup(r,[],[t.createBoundAggregate(e.variable("var0"),"count",t.createWildcardExpression(),!1)]),e.variable("count"),t.createTermExpression(e.variable("var0"))),[e.variable("count")]))}async operationToQuery(e){return(await this.mediatorQuerySerialize.mediate({queryFormat:{language:"sparql",version:"1.2"},operation:e,newlines:!1,indentWidth:0,context:this.context})).query}static getOperationUndefs(e){const t=[];return a.algebraUtils.visitOperation(e,{[a.Algebra.Types.LEFT_JOIN]:{preVisitor:e=>{const r=a.algebraUtils.inScopeVariables(e.input[0]),n=a.algebraUtils.inScopeVariables(e.input[1]);for(const e of n)r.some((t=>t.equals(e)))||t.push(e);return{continue:!1}}},[a.Algebra.Types.VALUES]:{preVisitor:e=>{for(const r of e.variables)e.bindings.some((e=>!(r.value in e)))&&t.push(r);return{continue:!1}}},[a.Algebra.Types.UNION]:{preVisitor:e=>{const r=e.input.map((e=>a.algebraUtils.inScopeVariables(e)));for(const e of(0,d.uniqTerms)(r.flat()))r.every((t=>t.some((t=>t.equals(e)))))||t.push(e);return{}}}}),(0,d.uniqTerms)(t)}async queryBindingsRemote(e,t,r,n,a){const o=new Set(a.map((e=>e.value)));this.lastSourceContext=this.context.merge(n);const s=await this.endpointFetcher.fetchBindings(e,t);return(0,c.wrap)(s,{autoStart:!1,maxBufferSize:Number.POSITIVE_INFINITY}).map((t=>{const n=r.map((r=>{const n=t[`?${r.value}`];return o.has(r.value)||n||i.Actor.getContextLogger(this.context)?.warn(`The endpoint ${e} failed to provide a binding for ${r.value}.`),[r,n]})).filter((([e,t])=>Boolean(t)));return this.bindingsFactory.bindings(n)}))}toString(){return`QuerySourceSparql(${this.url})`}}t.QuerySourceSparql=p},54333:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(99612),t),i(r(95941),t)},8853:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceIdentifyHypermedia=void 0;const n=r(70287),i=r(72407),a=r(97356),o=r(23814),s=r(36962);class c extends n.ActorQuerySourceIdentify{mediatorMetadataAccumulate;mediatorQuerySourceDereferenceLink;mediatorRdfResolveHypermediaLinks;mediatorRdfResolveHypermediaLinksQueue;mediatorMergeBindingsContext;cacheSize;maxIterators;constructor(e){super(e),this.mediatorMetadataAccumulate=e.mediatorMetadataAccumulate,this.mediatorQuerySourceDereferenceLink=e.mediatorQuerySourceDereferenceLink,this.mediatorRdfResolveHypermediaLinks=e.mediatorRdfResolveHypermediaLinks,this.mediatorRdfResolveHypermediaLinksQueue=e.mediatorRdfResolveHypermediaLinksQueue,this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext,this.cacheSize=e.cacheSize,this.maxIterators=e.maxIterators}async test(e){return"string"!=typeof e.querySourceUnidentified.value?(0,a.failTest)(`${this.name} requires a single query source with a URL value to be present in the context.`):(0,a.passTestVoid)()}async run(e){const t=e.querySourceUnidentified.context??new a.ActionContext,r=e.context.getSafe(i.KeysInitQuery.dataFactory);return{querySource:{source:new s.QuerySourceHypermedia(this.cacheSize,{url:e.querySourceUnidentified.value,forceSourceType:e.querySourceUnidentified.type},this.maxIterators,{mediatorMetadataAccumulate:this.mediatorMetadataAccumulate,mediatorQuerySourceDereferenceLink:this.mediatorQuerySourceDereferenceLink,mediatorRdfResolveHypermediaLinks:this.mediatorRdfResolveHypermediaLinks,mediatorRdfResolveHypermediaLinksQueue:this.mediatorRdfResolveHypermediaLinksQueue},r,await o.BindingsFactory.create(this.mediatorMergeBindingsContext,e.context,r)),context:t}}}}t.ActorQuerySourceIdentifyHypermedia=c},3668:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedRdfSourcesAsyncRdfIterator=void 0;const n=r(72407),i=r(49102),a=r(76664);class o extends a.BufferedIterator{operation;queryBindingsOptions;context;firstLink;maxIterators;sourceStateGetter;started=!1;currentIterators=[];iteratorsPendingCreation=0;iteratorsPendingTermination=0;accumulatedMetadata=Promise.resolve(void 0);preflightMetadata;constructor(e,t,r,n,i,a,o){if(super({autoStart:!1,...o}),this._reading=!1,this.operation=e,this.queryBindingsOptions=t,this.context=r,this.firstLink=n,this.maxIterators=i,this.sourceStateGetter=a,this.maxIterators<=0)throw new Error(`LinkedRdfSourcesAsyncRdfIterator.maxIterators must be larger than zero, but got ${this.maxIterators}`)}kickstart(){this.started||this._fillBufferAsync()}getProperty(e,t){return"metadata"!==e||this.started||(this.preflightMetadata||(this.preflightMetadata=new Promise(((e,t)=>{this.sourceStateGetter(this.firstLink,{}).then((t=>{const r=t.source.queryBindings(this.operation,this.context);r.getProperty("metadata",(n=>{n.state=new i.MetadataValidationState,r.destroy(),this.accumulateMetadata(t.metadata,n).then((r=>{const i={...t.metadata,...n,...r};e(i)})).catch((()=>{e({...t.metadata,state:new i.MetadataValidationState})}))}))})).catch(t)}))),this.preflightMetadata.then((e=>this.setProperty("metadata",e))).catch((e=>this.emit("error",e)))),super.getProperty(e,t)}_end(e){for(const e of this.currentIterators)e.destroy();super._end(e)}_read(e,t){if(this.started){for(const t of this.currentIterators){for(;e>0;){const r=t.read();if(null===r)break;e--,this._push(r)}if(e<=0)break}e>=0&&this.canStartNewIterator()&&this.sourceStateGetter(this.firstLink,{}).then((e=>{this.startIteratorsForNextUrls(e.handledDatasets,!1)})),t()}else this.started=!0,this.sourceStateGetter(this.firstLink,{}).then((e=>{this.startIterator(e),t()})).catch((e=>setTimeout((()=>this.destroy(e)))))}canStartNewIterator(){return this.currentIterators.length+this.iteratorsPendingCreation+this.iteratorsPendingTermination0}startIterator(e){try{const t=e.source.queryBindings(this.operation,this.context,this.queryBindingsOptions);this.currentIterators.push(t);let r=!1,n=!1;t._destination=this,t.on("error",(e=>this.destroy(e))),t.on("readable",(()=>this._fillBuffer())),t.on("end",(()=>{this.currentIterators.splice(this.currentIterators.indexOf(t),1),r=!0,n||this.iteratorsPendingTermination++,n&&this.startIteratorsForNextUrls(e.handledDatasets,!0)})),t.getProperty("metadata",(t=>{this.accumulatedMetadata=this.accumulatedMetadata.then((a=>(async()=>(a||(a=e.metadata),this.accumulateMetadata(a,t)))().then((a=>{const o={...e.metadata,...t,...a};return o.state=new i.MetadataValidationState,this.updateMetadata(o),this.preflightMetadata&&this.preflightMetadata.then((e=>e.state.invalidate())).catch((()=>{})),this.getSourceLinks(o,e).then((e=>Promise.all(e))).then((async t=>{const i=await this.getLinkQueue();for(const r of t)i.push(r,e.link);n=!0,r&&this.iteratorsPendingTermination--,this.startIteratorsForNextUrls(e.handledDatasets,!0)})).catch((e=>this.destroy(e))),o})))).catch((e=>(this.destroy(e),{})))}))}catch(e){this.destroy(e)}}updateMetadata(e){const t=this.getProperty("metadata");this.setProperty("metadata",e),t?.state.invalidate()}isRunning(){return!this.done}startIteratorsForNextUrls(e,t){this.getLinkQueue().then((r=>{for(;this.canStartNewIterator()&&this.isRunning();){const t=r.pop();if(!t)break;this.iteratorsPendingCreation++,this.sourceStateGetter(t,e).then((e=>{const t=this.context.get(n.KeysStatistics.dereferencedLinks);t&&t.updateStatistic({url:e.link.url,metadata:{...e.metadata,...e.link.metadata}},e.source),this.iteratorsPendingCreation--,this.startIterator(e)})).catch((e=>this.emit("error",e)))}t&&this.isCloseable(r,!0)&&this.close()})).catch((e=>this.destroy(e)))}isCloseable(e,t){return e.isEmpty()&&!this.areIteratorsRunning()}}t.LinkedRdfSourcesAsyncRdfIterator=o},42805:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediatedLinkedRdfSourcesAsyncRdfIterator=void 0;const n=r(72407),i=r(3668);class a extends i.LinkedRdfSourcesAsyncRdfIterator{mediatorMetadataAccumulate;mediatorRdfResolveHypermediaLinks;mediatorRdfResolveHypermediaLinksQueue;handledUrls;linkQueue;constructor(e,t,r,n,i,a,o,s,c){super(e,t,r,n,i,a),this.mediatorMetadataAccumulate=o,this.mediatorRdfResolveHypermediaLinks=s,this.mediatorRdfResolveHypermediaLinksQueue=c,this.handledUrls={[n.url]:!0}}isCloseable(e,t){return e.isEmpty()&&!this.areIteratorsRunning()}getLinkQueue(){return this.linkQueue||(this.linkQueue=this.mediatorRdfResolveHypermediaLinksQueue.mediate({context:this.context}).then((e=>e.linkQueue))),this.linkQueue}async getSourceLinks(e,t){try{const{links:r}=await this.mediatorRdfResolveHypermediaLinks.mediate({context:this.context,metadata:e}),i=this.context.get(n.KeysStatistics.discoveredLinks);if(i)for(const e of r)i.updateStatistic({url:e.url,metadata:{...e.metadata}},t.link);return r.filter((e=>!this.handledUrls[e.url]&&(this.handledUrls[e.url]=!0,!0)))}catch{return[]}}async accumulateMetadata(e,t){return(await this.mediatorMetadataAccumulate.mediate({mode:"append",accumulatedMetadata:e,appendingMetadata:t,context:this.context})).metadata}}t.MediatedLinkedRdfSourcesAsyncRdfIterator=a},36962:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuerySourceHypermedia=void 0;const n=r(76664),i=r(35069),a=r(42805);t.QuerySourceHypermedia=class{referenceValue;firstLink;mediators;dataFactory;bindingsFactory;sourcesState;cacheSize;maxIterators;constructor(e,t,r,n,a,o){this.referenceValue=t.url,this.cacheSize=e,this.firstLink=t,this.maxIterators=r,this.mediators=n,this.dataFactory=a,this.bindingsFactory=o,this.sourcesState=new i.LRUCache({max:this.cacheSize})}async getSelectorShape(e){return(await this.getSourceCached(this.firstLink,{},e)).source.getSelectorShape(e)}async getFilterFactor(e){return(await this.getSourceCached(this.firstLink,{},e)).source.getFilterFactor(e)}queryBindings(e,t,r){0===this.sourcesState.size&&this.getSourceCached(this.firstLink,{},t).catch((e=>n.destroy(e)));const n=new a.MediatedLinkedRdfSourcesAsyncRdfIterator(e,r,t,this.firstLink,this.maxIterators,((e,r)=>this.getSourceCached(e,r,t)),this.mediators.mediatorMetadataAccumulate,this.mediators.mediatorRdfResolveHypermediaLinks,this.mediators.mediatorRdfResolveHypermediaLinksQueue);return n}queryQuads(e,t){return new n.TransformIterator((async()=>(await this.getSourceCached(this.firstLink,{},t)).source.queryQuads(e,t)),{autoStart:!1})}async queryBoolean(e,t){const r=await this.getSourceCached(this.firstLink,{},t);return await r.source.queryBoolean(e,t)}async queryVoid(e,t){const r=await this.getSourceCached(this.firstLink,{},t);return await r.source.queryVoid(e,t)}async getSource(e,t,r){const{source:n,metadata:i,cachePolicy:a}=await this.mediators.mediatorQuerySourceDereferenceLink.mediate({link:e,handledDatasets:t,context:r});return{link:e,source:n,metadata:i,handledDatasets:t,cachePolicy:a}}getSourceCached(e,t,r){let n=this.sourcesState.get(e.url);return n?(async()=>{const i=await n;return i.cachePolicy&&!await(i.cachePolicy?.satisfiesWithoutRevalidation({link:e,context:r}))?(this.sourcesState.delete(e.url),this.getSourceCached(e,t,r)):i})():(n=this.getSource(e,t,r),this.sourcesState.set(e.url,n),n)}toString(){return`QuerySourceHypermedia(${this.firstLink.url})`}}},7241:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8853),t),i(r(36962),t)},8995:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceIdentifyRdfJs=void 0;const n=r(70287),i=r(72407),a=r(97356),o=r(23814),s=r(22372);class c extends n.ActorQuerySourceIdentify{mediatorMergeBindingsContext;constructor(e){super(e),this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}async test(e){const t=e.querySourceUnidentified;return void 0!==t.type&&"rdfjs"!==t.type?(0,a.failTest)(`${this.name} requires a single query source with rdfjs type to be present in the context.`):"string"!=typeof t.value&&"match"in t.value?(0,a.passTestVoid)():(0,a.failTest)(`${this.name} received an invalid rdfjs query source.`)}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory);return{querySource:{source:new s.QuerySourceRdfJs(e.querySourceUnidentified.value,t,await o.BindingsFactory.create(this.mediatorMergeBindingsContext,e.context,t)),context:e.querySourceUnidentified.context??new a.ActionContext}}}}t.ActorQuerySourceIdentifyRdfJs=c},40973:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},22372:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuerySourceRdfJs=void 0;const n=r(70287),i=r(72407),a=r(34005),o=r(49102),s=r(76664),c=r(13252);class u{selectorShape;referenceValue;source;dataFactory;bindingsFactory;dummyDefaultGraph;constructor(e,t,r){this.source=e,this.referenceValue=e,this.dataFactory=t,this.bindingsFactory=r;let n={type:"operation",operation:{operationType:"pattern",pattern:new a.AlgebraFactory(this.dataFactory).createPattern(this.dataFactory.variable("s"),this.dataFactory.variable("p"),this.dataFactory.variable("o"))},variablesOptional:[this.dataFactory.variable("s"),this.dataFactory.variable("p"),this.dataFactory.variable("o")]};const i=[];"features"in this.source&&this.source.features?.indexNodes&&i.push({type:"operation",operation:{operationType:"type",type:a.TypesComunica.NODES}}),"features"in this.source&&this.source.features?.indexDistinctTerms&&i.push({type:"operation",operation:{operationType:"type",type:a.TypesComunica.DISTINCT_TERMS}}),i.length>0&&(n={type:"disjunction",children:[n,...i]}),this.selectorShape=n,this.dummyDefaultGraph=this.dataFactory.variable("__comunica:defaultGraph")}static nullifyVariables(e,t){return!e||"Variable"===e.termType||!t&&"Quad"===e.termType&&(0,c.someTermsNested)(e,(e=>"Variable"===e.termType))?void 0:e}static hasDuplicateVariables(e){const t=(0,c.filterTermsNested)(e,(e=>"Variable"===e.termType));return t.length>1&&(0,c.uniqTerms)(t).lengththis.bindingsFactory.bindings([...r?[[e.graph,t[0]]]:[],[e.variable,t[1]]])));return n.setProperty("metadata",{state:new o.MetadataValidationState,cardinality:{type:"exact",value:this.source.countNodes(e.graph)},requestTime:0,variables:[...r?[{variable:e.graph,canBeUndef:!1}]:[],{variable:e.variable,canBeUndef:!1}]}),n}if((0,a.isKnownOperation)(e,a.TypesComunica.DISTINCT_TERMS)&&"matchDistinctTerms"in this.source&&this.source.matchDistinctTerms){const t=e.variables.map((t=>e.terms[t.value])),r=this.source.matchDistinctTerms(t),n=(r instanceof s.AsyncIterator?r:(0,s.wrap)(r,{autoStart:!1})).map((t=>this.bindingsFactory.bindings(e.variables.map(((e,r)=>[e,t[r]])))));return n.setProperty("metadata",{state:new o.MetadataValidationState,cardinality:{type:"exact",value:this.source.countDistinctTerms(t)},requestTime:0,variables:e.variables.map((e=>({variable:e,canBeUndef:!1})))}),n}if(!(0,a.isKnownOperation)(e,a.Algebra.Types.PATTERN))throw new Error(`Attempted to pass non-pattern operation '${e.type}' to QuerySourceRdfJs`);const r=Boolean(t.get(i.KeysQueryOperation.unionDefaultGraph));if("DefaultGraph"===e.graph.termType&&r&&(e.graph=this.dummyDefaultGraph),"matchBindings"in this.source&&this.source.matchBindings){const i=this.source.matchBindings(this.bindingsFactory,e.subject,e.predicate,e.object,e.graph);let a=i instanceof s.AsyncIterator?i:(0,s.wrap)(i,{autoStart:!1}),o=!1;if("Variable"===e.graph.termType&&!r){o=!0;const t=e.graph;a=a.filter((e=>"DefaultGraph"!==e.get(t).termType))}if(e.graph.equals(this.dummyDefaultGraph)&&(a=a.map((e=>e.delete(this.dummyDefaultGraph))),e.graph=this.dataFactory.defaultGraph()),!a.getProperty("metadata")){const r=(0,n.getVariables)(e).map((e=>({variable:e,canBeUndef:!1})));this.setMetadata(a,e,t,o,{variables:r}).catch((e=>a.destroy(e)))}return a}const c=Boolean("features"in this.source&&this.source.features?.quotedTripleFiltering),l=this.source.match(u.nullifyVariables(e.subject,c),u.nullifyVariables(e.predicate,c),u.nullifyVariables(e.object,c),u.nullifyVariables(e.graph,c));let d=l instanceof s.AsyncIterator?l:(0,s.wrap)(l,{autoStart:!1});return c||(d=(0,n.filterMatchingQuotedQuads)(e,d)),d.getProperty("metadata")||this.setMetadata(d,e,t).catch((e=>d.destroy(e))),e.graph.equals(this.dummyDefaultGraph)&&(e.graph=this.dataFactory.defaultGraph()),(0,n.quadsToBindings)(d,e,this.dataFactory,this.bindingsFactory,Boolean(t.get(i.KeysQueryOperation.unionDefaultGraph)))}async setMetadata(e,t,r,n=!1,a={}){const l=Boolean("features"in this.source&&this.source.features?.quotedTripleFiltering),d=Boolean(r.get(i.KeysQueryOperation.unionDefaultGraph));let p;if("DefaultGraph"===t.graph.termType&&d&&(t.graph=this.dummyDefaultGraph),"countQuads"in this.source&&this.source.countQuads)p=await this.source.countQuads(u.nullifyVariables(t.subject,l),u.nullifyVariables(t.predicate,l),u.nullifyVariables(t.object,l),u.nullifyVariables(t.graph,l));else{let e=0;p=await new Promise(((r,n)=>{let i=this.source.match(u.nullifyVariables(t.subject,l),u.nullifyVariables(t.predicate,l),u.nullifyVariables(t.object,l),u.nullifyVariables(t.graph,l));"function"!=typeof i.on&&(i=new s.ArrayIterator(i,{autoStart:!1})),i.on("error",n),i.on("end",(()=>r(e))),i.on("data",(()=>e++))}))}const h=!l&&(0,c.someTerms)(t,(e=>"Quad"===e.termType))||u.hasDuplicateVariables(t);e.setProperty("metadata",{state:new o.MetadataValidationState,cardinality:{type:h||n?"estimate":"exact",value:p},requestTime:0,...a})}queryQuads(e,t){if((0,a.isKnownOperation)(e,a.Algebra.Types.PATTERN))return(0,s.wrap)(this.source.match(e.subject,e.predicate,e.object,e.graph),{autoStart:!1});throw new Error("queryQuads is not implemented in QuerySourceRdfJs")}queryBoolean(e,t){throw new Error("queryBoolean is not implemented in QuerySourceRdfJs")}queryVoid(e,t){throw new Error("queryVoid is not implemented in QuerySourceRdfJs")}toString(){return`QuerySourceRdfJs(${this.source.constructor.name})`}}t.QuerySourceRdfJs=u},54598:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8995),t),i(r(40973),t),i(r(22372),t)},4753:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceIdentifySerialized=void 0;const n=r(70287),i=r(97356),a=r(10953),o=r(58521);class s extends n.ActorQuerySourceIdentify{mediatorRdfParse;mediatorQuerySourceIdentify;constructor(e){super(e),this.mediatorRdfParse=e.mediatorRdfParse,this.mediatorQuerySourceIdentify=e.mediatorQuerySourceIdentify}async test(e){return this.isStringSource(e.querySourceUnidentified)?(0,i.passTestVoid)():(0,i.failTest)(`${this.name} requires a single query source with serialized type to be present in the context.`)}async run(e){return await this.mediatorQuerySourceIdentify.mediate({querySourceUnidentified:{type:"rdfjs",value:await this.getRdfSource(e.context,e.querySourceUnidentified),context:e.querySourceUnidentified.context},context:e.context})}async getRdfSource(e,t){const r=new o.Readable({objectMode:!0});r._read=()=>{},r.push(t.value),r.push(null);const n={context:e,handle:{metadata:{baseIRI:t.baseIRI,version:t.version},data:r,context:e},handleMediaType:t.mediaType},i=await this.mediatorRdfParse.mediate(n);return await(0,a.storeStream)(i.handle.data)}isStringSource(e){return"type"in e?"serialized"===e.type:"string"==typeof e.value&&"mediaType"in e}}t.ActorQuerySourceIdentifySerialized=s},10777:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4753),t)},10290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinEntriesSortCardinality=void 0;const n=r(70555),i=r(97356);class a extends n.ActorRdfJoinEntriesSort{constructor(e){super(e)}async test(e){return(0,i.passTest)({accuracy:0===e.entries.length?1:e.entries.reduce(((e,t)=>e+(Number.isFinite(t.metadata.cardinality.value)?1:0)),0)/e.entries.length})}async run(e){return{entries:[...e.entries].sort(((e,t)=>e.metadata.cardinality.value-t.metadata.cardinality.value))}}}t.ActorRdfJoinEntriesSortCardinality=a},57277:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(10290),t)},29120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinEntriesSortSelectivity=void 0;const n=r(70555),i=r(97356);class a extends n.ActorRdfJoinEntriesSort{mediatorJoinSelectivity;constructor(e){super(e),this.mediatorJoinSelectivity=e.mediatorJoinSelectivity}async test(e){return(0,i.passTest)({accuracy:.501})}async run(e){const t=[...e.entries],r=[];for(;t.length>0;){let n=Number.MAX_VALUE,i=-1;for(const[a,o]of t.entries()){const{selectivity:t}=await this.mediatorJoinSelectivity.mediate({entries:[o,...r],context:e.context});t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinHash=void 0;const n=r(44789),i=r(97356),a=r(42536),o=r(34569),s=r(76664),c=r(2922),u=r(22112);class l extends n.ActorRdfJoin{mediatorHashBindings;constructor(e){super(e,{logicalType:"inner",physicalName:"hash-"+(e.canHandleUndefs?"undef":"def"),limitEntries:2,requiresVariableOverlap:!0,canHandleUndefs:e.canHandleUndefs}),this.mediatorHashBindings=e.mediatorHashBindings}async getOutput(e,t){const r=t.metadatas;let i;const l=n.ActorRdfJoin.overlappingVariables(r);if(this.canHandleUndefs){const e=t.entriesSorted[0].output,r=t.entriesSorted[1].output;i=new o.ClosableTransformIterator((async()=>{const t=new a.BindingsIndexUndef(l,(e=>e&&"Variable"!==e.termType?(0,u.termToString)(e):""),!0);return await new Promise((r=>{e.bindingsStream.on("data",(e=>{(t.getFirst(e,!1)??t.put(e,[])).push(e)})),e.bindingsStream.on("end",r),e.bindingsStream.on("error",(e=>{i.emit("error",e)}))})),new s.MultiTransformIterator(r.bindingsStream,{multiTransform:e=>new s.ArrayIterator(t.get(e).flat().map((t=>n.ActorRdfJoin.joinBindings(e,t))).filter((e=>null!==e)),{autoStart:!1}),autoStart:!1})}),{autoStart:!1,onClose(){e.bindingsStream.destroy(),r.bindingsStream.destroy()}})}else{const{hashFunction:r}=await this.mediatorHashBindings.mediate({context:e.context}),a=l.map((e=>e.variable));i=new c.HashJoin(t.entriesSorted[0].output.bindingsStream,t.entriesSorted[1].output.bindingsStream,(e=>r(e,a)),n.ActorRdfJoin.joinBindings)}return{result:{type:"bindings",bindingsStream:i,metadata:async()=>await this.constructResultMetadata(t.entriesSorted,r,e.context)}}}async getJoinCoefficients(e,t){let r=e.entries;t.metadatas[1].cardinality.value{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinMultiBindSource=void 0;const n=r(44789),i=r(72407),a=r(97356),o=r(34005),s=r(34569),c=r(98989),u=r(76664);class l extends n.ActorRdfJoin{selectivityModifier;blockSize;mediatorJoinEntriesSort;constructor(e){super(e,{logicalType:"inner",physicalName:"bind-source",canHandleUndefs:!0}),this.selectivityModifier=e.selectivityModifier,this.blockSize=e.blockSize,this.mediatorJoinEntriesSort=e.mediatorJoinEntriesSort}async getOutput(e,t){const r=e.context.getSafe(i.KeysInitQuery.dataFactory),n=new o.AlgebraFactory(r),a=t.entriesSorted;this.logDebug(e.context,"First entry for Bind Join Source: ",(()=>({entry:a[0].operation,cardinality:a[0].metadata.cardinality,order:a[0].metadata.order,availableOrders:a[0].metadata.availableOrders})));for(const[e,t]of a.entries())0!==e&&t.output.bindingsStream.close();const l=a[0].output,d=a[0].metadata,p=[...a];p.splice(0,1);const h=(0,c.getOperationSource)(p[0].operation),f=this.createOperationFromEntries(n,p),y=new s.ChunkedIterator(l.bindingsStream,this.blockSize,{autoStart:!1});return{result:{type:"bindings",bindingsStream:new u.UnionIterator(y.map((t=>h.source.queryBindings(f,h.context?e.context.merge(h.context):e.context,{joinBindings:{bindings:t,metadata:d}}))),{autoStart:!1}),metadata:()=>this.constructResultMetadata(a,a.map((e=>e.metadata)),e.context)},physicalPlanMetadata:{bindIndex:t.entriesUnsorted.indexOf(a[0])}}}async sortJoinEntries(e,t){const r=await n.ActorRdfJoin.sortJoinEntries(this.mediatorJoinEntriesSort,e,t);return r.isFailed()?r:(e=(e=r.get()).sort(((e,t)=>e.operationModified&&!t.operationModified?-1:0)),(0,a.passTest)(e))}async getJoinCoefficients(e,t){let{metadatas:r}=t;const s=e.context.getSafe(i.KeysInitQuery.dataFactory),u=new o.AlgebraFactory(s),l=e.entries.map(((e,t)=>({...e,metadata:r[t]}))),d=await this.sortJoinEntries(l,e.context);if(d.isFailed())return d;const p=d.get();r=p.map((e=>e.metadata));const h=n.ActorRdfJoin.getRequestInitialTimes(r),f=n.ActorRdfJoin.getRequestItemTimes(r),y=[...p],m=[...h],g=[...f];y.splice(0,1),m.splice(0,1),g.splice(0,1);const b=y.map((e=>(0,c.getOperationSource)(e.operation)));if(b.some((e=>!e)))return(0,a.failTest)(`Actor ${this.name} can not bind on remaining operations without source annotation`);if(b.some((e=>e!==b[0])))return(0,a.failTest)(`Actor ${this.name} can not bind on remaining operations with non-equal source annotation`);const v=b[0],_=this.createOperationFromEntries(u,y),T=await v.source.getSelectorShape(e.context),O=e.context.get(i.KeysInitQuery.extensionFunctionsAlwaysPushdown);if(!(0,c.doesShapeAcceptOperation)(T,_,{joinBindings:!0,wildcardAcceptAllExtensionFunctions:O}))return(0,a.failTest)(`Actor ${this.name} detected a source that can not handle passing down join bindings`);const w=await Promise.all(y.map((async t=>(await this.mediatorJoinSelectivity.mediate({entries:[p[0],t],context:e.context})).selectivity*this.selectivityModifier))),S=y.map(((e,t)=>e.metadata.cardinality.value*w[t])).reduce(((e,t)=>e+t),0);return(0,a.passTestWithSideData)({iterations:1,persistedItems:r[0].cardinality.value,blockingItems:r[0].cardinality.value,requestTime:h[0]+r[0].cardinality.value*f[0]+h[1]+S*f[1]},{...t,entriesUnsorted:l,entriesSorted:p})}createOperationFromEntries(e,t){return 1===t.length?t[0].operation:e.createJoin(t.map((e=>e.operation)),!0)}}t.ActorRdfJoinMultiBindSource=l},25875:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(70985),t)},25660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinMultiBind=void 0;const n=r(44789),i=r(72407),a=r(97356),o=r(34005),s=r(23814),c=r(98989),u=r(76664);class l extends n.ActorRdfJoin{bindOrder;selectivityModifier;minMaxCardinalityRatio;mediatorJoinEntriesSort;mediatorQueryOperation;mediatorMergeBindingsContext;constructor(e){super(e,{logicalType:"inner",physicalName:"bind",canHandleUndefs:!0,isLeaf:!1}),this.bindOrder=e.bindOrder,this.selectivityModifier=e.selectivityModifier,this.minMaxCardinalityRatio=e.minMaxCardinalityRatio,this.mediatorJoinEntriesSort=e.mediatorJoinEntriesSort,this.mediatorQueryOperation=e.mediatorQueryOperation,this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}static createBindStream(e,t,r,n,i,a,o){const s="depth-first"===e,l=e=>{const t=r.map((t=>(0,c.materializeOperation)(t,e,a,o,{bindFilter:!0}))),i=t=>t.merge(e);return new u.TransformIterator((async()=>(await n(t,e)).transform({map:i})),{maxBufferSize:128,autoStart:s})};switch(e){case"depth-first":return new u.MultiTransformIterator(t,{autoStart:!1,multiTransform:l,optional:i});case"breadth-first":return new u.UnionIterator(t.transform({map:l,optional:i,autoStart:!1}),{autoStart:!1});default:throw new Error(`Received request for unknown bind order: ${e}`)}}async getOutput(e,t){const r=e.context.getSafe(i.KeysInitQuery.dataFactory),n=new o.AlgebraFactory(r),a=await s.BindingsFactory.create(this.mediatorMergeBindingsContext,e.context,r),u=t.entriesSorted;this.logDebug(e.context,"First entry for Bind Join: ",(()=>({entry:{...u[0].operation,metadata:void 0},cardinality:u[0].metadata.cardinality,order:u[0].metadata.order,availableOrders:u[0].metadata.availableOrders})));for(const[e,t]of u.entries())0!==e&&t.output.bindingsStream.destroy();const d=u[0].output,p=[...u];p.splice(0,1);const h=e.context.set(i.KeysQueryOperation.joinLeftMetadata,u[0].metadata).set(i.KeysQueryOperation.joinRightMetadatas,p.map((e=>e.metadata)));return{result:{type:"bindings",bindingsStream:l.createBindStream(this.bindOrder,d.bindingsStream,p.map((e=>e.operation)),(async(e,t)=>{const r=1===e.length?e[0]:n.createJoin(e,e.every((e=>!e.metadata)));return(0,c.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:r,context:h?.set(i.KeysQueryOperation.joinBindings,t)})).bindingsStream}),!1,n,a),metadata:()=>this.constructResultMetadata(u,u.map((e=>e.metadata)),e.context)},physicalPlanMetadata:{bindIndex:t.entriesUnsorted.indexOf(u[0]),bindOperation:u[0].operation,bindOperationCardinality:u[0].metadata.cardinality,bindOrder:this.bindOrder}}}canBindWithOperation(e){let t=!0;return o.algebraUtils.visitOperation(e,{[o.Algebra.Types.EXTEND]:{preVisitor:()=>(t=!1,{shortcut:!0})},[o.Algebra.Types.GROUP]:{preVisitor:()=>(t=!1,{shortcut:!0})}}),t}async getJoinCoefficients(e,t){let{metadatas:r}=t;const i=e.entries.map(((e,t)=>({...e,metadata:r[t]}))),o=await n.ActorRdfJoin.sortJoinEntries(this.mediatorJoinEntriesSort,i,e.context);if(o.isFailed())return o;const s=o.get();r=s.map((e=>e.metadata));const c=n.ActorRdfJoin.getRequestInitialTimes(r),u=n.ActorRdfJoin.getRequestItemTimes(r),l=[...s],d=[...c],p=[...u];if(l.splice(0,1),d.splice(0,1),p.splice(0,1),l.some((e=>!this.canBindWithOperation(e.operation))))return(0,a.failTest)(`Actor ${this.name} can not bind on Extend and Group operations`);if(l.some((e=>e.operationModified)))return(0,a.failTest)(`Actor ${this.name} can not be used over remaining entries with modified operations`);const h=u.some((e=>e>0));if(r[0].cardinality.value*this.minMaxCardinalityRatio/(h?1:3)>Math.max(...r.map((e=>e.cardinality.value))))return(0,a.failTest)(`Actor ${this.name} can only run if the smallest stream is much smaller than largest stream`);const f=await Promise.all(l.map((async t=>(await this.mediatorJoinSelectivity.mediate({entries:[s[0],t],context:e.context})).selectivity*this.selectivityModifier))),y=l.map(((e,t)=>e.metadata.cardinality.value*f[t])).reduce(((e,t)=>e+t),0),m=d.reduce(((e,t)=>e+t),0),g=p.reduce(((e,t)=>e+t),0);return(0,a.passTestWithSideData)({iterations:r[0].cardinality.value*y,persistedItems:0,blockingItems:0,requestTime:c[0]+r[0].cardinality.value*(u[0]+m+y*g)},{...t,entriesUnsorted:i,entriesSorted:s})}}t.ActorRdfJoinMultiBind=l},4735:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(25660),t)},26448:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinMultiEmpty=void 0;const n=r(44789),i=r(72407),a=r(97356),o=r(49102),s=r(76664);class c extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"inner",physicalName:"multi-empty",canHandleUndefs:!0})}async test(e){return(await n.ActorRdfJoin.getMetadatas(e.entries)).every((e=>n.ActorRdfJoin.getCardinality(e).value>0))?(0,a.failTest)(`Actor ${this.name} can only join entries where at least one is empty`):super.test(e)}async getOutput(e){for(const t of e.entries)t.output.bindingsStream.close();const t=e.context.getSafe(i.KeysInitQuery.dataFactory);return{result:{bindingsStream:new s.ArrayIterator([],{autoStart:!1}),metadata:async()=>({state:new o.MetadataValidationState,cardinality:{type:"exact",value:0},variables:n.ActorRdfJoin.joinVariables(t,await n.ActorRdfJoin.getMetadatas(e.entries))}),type:"bindings"}}}async getJoinCoefficients(e,t){return(0,a.passTestWithSideData)({iterations:0,persistedItems:0,blockingItems:0,requestTime:0},t)}}t.ActorRdfJoinMultiEmpty=c},20517:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(26448),t)},6598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinMultiSmallestFilterBindings=void 0;const n=r(44789),i=r(72407),a=r(97356),o=r(34005),s=r(23814),c=r(34569),u=r(98989),l=r(76664);class d extends n.ActorRdfJoin{selectivityModifier;blockSize;mediatorJoinEntriesSort;mediatorJoin;constructor(e){super(e,{logicalType:"inner",physicalName:"multi-smallest-filter-bindings",limitEntries:2,limitEntriesMin:!0,isLeaf:!1}),this.selectivityModifier=e.selectivityModifier,this.blockSize=e.blockSize,this.mediatorJoinEntriesSort=e.mediatorJoinEntriesSort,this.mediatorJoin=e.mediatorJoin}async sortJoinEntries(e,t){let{entries:r}=await this.mediatorJoinEntriesSort.mediate({entries:e,context:t});r=r.sort(((e,t)=>e.operationModified&&!t.operationModified?-1:0));const n=r.splice(0,1)[0];let i,o=-1,s=0;for(const[e,t]of r.entries()){const r=n.metadata.variables.filter((e=>t.metadata.variables.some((t=>e.variable.equals(t.variable))))).length;(!i||r>s||r===s&&(t.metadata.variables.lengthp.metadata.variables.some((t=>e.variable.equals(t.variable))))),m={},g=f.clone().map((e=>e.filter(((e,t)=>y.some((e=>e.variable.equals(t))))))).filter((e=>{const t=(0,s.bindingsToString)(e);return!(t in m)&&(m[t]=!0)})),b=new c.ChunkedIterator(g,this.blockSize,{autoStart:!1}),v=(0,u.getOperationSource)(p.operation),_={output:{type:"bindings",bindingsStream:new l.UnionIterator(b.map((t=>v.source.queryBindings(p.operation,v.context?e.context.merge(v.context):e.context,{filterBindings:{bindings:t,metadata:d.metadata}}))),{autoStart:!1}),metadata:p.output.metadata},operation:p.operation,operationModified:!0};p.output.bindingsStream.destroy();const T={output:(0,u.getSafeBindings)(await this.mediatorJoin.mediate({type:e.type,entries:[d,_],context:e.context.set(i.KeysRdfJoin.lastPhysicalJoin,this.physicalName)})),operation:r.createJoin([d.operation,_.operation],!1),operationModified:!0},O=h;return O.unshift(T),{result:await this.mediatorJoin.mediate({type:e.type,entries:O,context:e.context}),physicalPlanMetadata:{firstIndex:a.indexOf(d),secondIndex:a.indexOf(p)}}}async getJoinCoefficients(e,t){let{metadatas:r}=t;if(e.context.get(i.KeysRdfJoin.lastPhysicalJoin)===this.physicalName)return(0,a.failTest)(`Actor ${this.name} can not be called recursively`);r=[...r];const o=await this.sortJoinEntries(e.entries.map(((e,t)=>({...e,metadata:r[t]}))),e.context);if(o.isFailed())return o;const{first:s,second:c,remaining:l}=o.get(),d=(0,u.getOperationSource)(c.operation);if(!d)return(0,a.failTest)(`Actor ${this.name} can only process if entries[1] has a source`);const p=c.operation,h=await d.source.getSelectorShape(e.context),f=e.context.get(i.KeysInitQuery.extensionFunctionsAlwaysPushdown);if(!(0,u.doesShapeAcceptOperation)(h,p,{filterBindings:!0,wildcardAcceptAllExtensionFunctions:f}))return(0,a.failTest)(`Actor ${this.name} can only process if entries[1] accept filterBindings`);r=[s.metadata,c.metadata,...l.map((e=>e.metadata))];const y=n.ActorRdfJoin.getRequestInitialTimes(r),m=n.ActorRdfJoin.getRequestItemTimes(r),{selectivity:g}=await this.mediatorJoinSelectivity.mediate({entries:[s,c],context:e.context}),b=l.reduce(((e,t)=>e*t.metadata.cardinality.value*this.selectivityModifier),1);return(0,a.passTestWithSideData)({iterations:g*this.selectivityModifier*c.metadata.cardinality.value*b,persistedItems:s.metadata.cardinality.value,blockingItems:s.metadata.cardinality.value,requestTime:y[0]+r[0].cardinality.value*m[0]+y[1]+b*m[1]},t)}}t.ActorRdfJoinMultiSmallestFilterBindings=d},38807:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6598),t)},4972:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinMultiSmallest=void 0;const n=r(44789),i=r(72407),a=r(97356),o=r(34005),s=r(98989);class c extends n.ActorRdfJoin{mediatorJoinEntriesSort;mediatorJoin;constructor(e){super(e,{logicalType:"inner",physicalName:"multi-smallest",limitEntries:3,limitEntriesMin:!0,canHandleUndefs:!0,isLeaf:!1}),this.mediatorJoinEntriesSort=e.mediatorJoinEntriesSort,this.mediatorJoin=e.mediatorJoin}getJoinIndexes(e){for(let t=0;te.variable.value)),n=new Set(t.metadata.variables.map((e=>e.variable.value)));return r.some((e=>n.has(e)))}async sortJoinEntries(e,t){return(await this.mediatorJoinEntriesSort.mediate({entries:e,context:t})).entries}async getOutput(e,t){const r=e.context.getSafe(i.KeysInitQuery.dataFactory),a=new o.AlgebraFactory(r),c=t.sortedEntries,u=await n.ActorRdfJoin.getEntriesWithMetadatas(c),l=this.getJoinIndexes(u),d=c[l[0]],p=c[l[1]];c.splice(l[1],1),c.splice(l[0],1);const h={output:(0,s.getSafeBindings)(await this.mediatorJoin.mediate({type:e.type,entries:[d,p],context:e.context})),operation:a.createJoin([d.operation,p.operation],!1)};return c.push(h),{result:await this.mediatorJoin.mediate({type:e.type,entries:c,context:e.context})}}async getJoinCoefficients(e,t){let{metadatas:r}=t;r=[...r];const i=await this.sortJoinEntries(e.entries.map(((e,t)=>({...e,metadata:r[t]}))),e.context);r=i.map((e=>e.metadata));const o=n.ActorRdfJoin.getRequestInitialTimes(r),s=n.ActorRdfJoin.getRequestItemTimes(r);return(0,a.passTestWithSideData)({iterations:r.reduce(((e,t)=>e*t.cardinality.value),1),persistedItems:0,blockingItems:0,requestTime:r.reduce(((e,t,r)=>e+o[r]+t.cardinality.value*s[r]),0)},{...t,sortedEntries:i})}}t.ActorRdfJoinMultiSmallest=c},58405:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4972),t)},64579:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinNestedLoop=void 0;const n=r(44789),i=r(97356),a=r(2922);class o extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"inner",physicalName:"nested-loop",limitEntries:2,canHandleUndefs:!0})}async getOutput(e){return{result:{type:"bindings",bindingsStream:new a.NestedLoopJoin(e.entries[0].output.bindingsStream,e.entries[1].output.bindingsStream,n.ActorRdfJoin.joinBindings,{autoStart:!1}),metadata:async()=>await this.constructResultMetadata(e.entries,await n.ActorRdfJoin.getMetadatas(e.entries),e.context)}}}async getJoinCoefficients(e,t){const{metadatas:r}=t,a=n.ActorRdfJoin.getRequestInitialTimes(r),o=n.ActorRdfJoin.getRequestItemTimes(r);return(0,i.passTestWithSideData)({iterations:r[0].cardinality.value*r[1].cardinality.value,persistedItems:0,blockingItems:0,requestTime:a[0]+r[0].cardinality.value*o[0]+a[1]+r[1].cardinality.value*o[1]},t)}}t.ActorRdfJoinNestedLoop=o},84229:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(64579),t)},63865:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinNone=void 0;const n=r(44789),i=r(72407),a=r(97356),o=r(23814),s=r(49102),c=r(76664);class u extends n.ActorRdfJoin{mediatorMergeBindingsContext;constructor(e){super(e,{logicalType:"inner",physicalName:"none",limitEntries:0}),this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}async test(e){return e.entries.length>0?(0,a.failTest)(`Actor ${this.name} can only join zero entries`):await this.getJoinCoefficients(e,void 0)}async getOutput(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=await o.BindingsFactory.create(this.mediatorMergeBindingsContext,e.context,t);return{result:{bindingsStream:new c.ArrayIterator([r.bindings()],{autoStart:!1}),metadata:()=>Promise.resolve({state:new s.MetadataValidationState,cardinality:{type:"exact",value:1},variables:[]}),type:"bindings"}}}async getJoinCoefficients(e,t){return(0,a.passTestWithSideData)({iterations:0,persistedItems:0,blockingItems:0,requestTime:0},t)}}t.ActorRdfJoinNone=u},17374:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(63865),t)},78705:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinSingle=void 0;const n=r(44789),i=r(97356);class a extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"inner",physicalName:"single",limitEntries:1}),this.includeInLogs=!1}async test(e){return 1!==e.entries.length?(0,i.failTest)(`Actor ${this.name} can only join a single entry`):await this.getJoinCoefficients(e,void 0)}async getOutput(e){return{result:e.entries[0].output}}async getJoinCoefficients(e,t){return(0,i.passTestWithSideData)({iterations:0,persistedItems:0,blockingItems:0,requestTime:0},t)}}t.ActorRdfJoinSingle=a},38676:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(78705),t)},133:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinSymmetricHash=void 0;const n=r(44789),i=r(97356),a=r(2922);class o extends n.ActorRdfJoin{mediatorHashBindings;constructor(e){super(e,{logicalType:"inner",physicalName:"symmetric-hash",limitEntries:2,requiresVariableOverlap:!0}),this.mediatorHashBindings=e.mediatorHashBindings}async getOutput(e){const t=await n.ActorRdfJoin.getMetadatas(e.entries),r=n.ActorRdfJoin.overlappingVariables(t),{hashFunction:i}=await this.mediatorHashBindings.mediate({context:e.context}),o=r.map((e=>e.variable));return{result:{type:"bindings",bindingsStream:new a.SymmetricHashJoin(e.entries[0].output.bindingsStream,e.entries[1].output.bindingsStream,(e=>i(e,o)),n.ActorRdfJoin.joinBindings),metadata:async()=>await this.constructResultMetadata(e.entries,t,e.context)}}}async getJoinCoefficients(e,t){const{metadatas:r}=t,a=n.ActorRdfJoin.getRequestInitialTimes(r),o=n.ActorRdfJoin.getRequestItemTimes(r);return(0,i.passTestWithSideData)({iterations:r[0].cardinality.value+r[1].cardinality.value,persistedItems:r[0].cardinality.value+r[1].cardinality.value,blockingItems:0,requestTime:a[0]+r[0].cardinality.value*o[0]+a[1]+r[1].cardinality.value*o[1]},t)}}t.ActorRdfJoinSymmetricHash=o},31523:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(133),t)},69801:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinMinusHash=void 0;const n=r(44789),i=r(97356),a=r(23814),o=r(42536),s=r(34569),c=r(22112);class u extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"minus",physicalName:"hash-"+(e.canHandleUndefs?"undef":"def"),limitEntries:2,canHandleUndefs:e.canHandleUndefs})}static constructIndex(e,t){return e?new o.BindingsIndexUndef(t,(e=>e&&"Variable"!==e.termType?(0,c.termToString)(e):""),!1):new o.BindingsIndexDef(t,a.bindingsToCompactString)}async getOutput(e){const t=e.entries[1].output,r=e.entries[0].output,i=await n.ActorRdfJoin.getMetadatas(e.entries);let a=n.ActorRdfJoin.overlappingVariables(i);if(e.graphVariableFromParentScope&&(a=a.filter((t=>!t.variable.equals(e.graphVariableFromParentScope)))),0===a.length)return t.bindingsStream.destroy(),{result:r};const o=new s.ClosableTransformIterator((async()=>{const e=u.constructIndex(this.canHandleUndefs,a);return await new Promise((r=>{t.bindingsStream.on("data",(t=>e.put(t,!0))),t.bindingsStream.on("end",r),t.bindingsStream.on("error",(e=>o.emit("error",e)))})),r.bindingsStream.filter((t=>!e.getFirst(t,!0)))}),{autoStart:!1,onClose(){t.bindingsStream.destroy(),r.bindingsStream.destroy()}});return{result:{type:"bindings",bindingsStream:o,metadata:r.metadata}}}async getJoinCoefficients(e,t){const{metadatas:r}=t,a=n.ActorRdfJoin.getRequestInitialTimes(r),o=n.ActorRdfJoin.getRequestItemTimes(r);let s=r[0].cardinality.value+r[1].cardinality.value;return this.canHandleUndefs||(s*=.8),(0,i.passTestWithSideData)({iterations:s,persistedItems:r[0].cardinality.value,blockingItems:r[0].cardinality.value,requestTime:a[0]+r[0].cardinality.value*o[0]+a[1]+r[1].cardinality.value*o[1]},t)}}t.ActorRdfJoinMinusHash=u},41844:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(69801),t)},77441:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinOptionalBind=void 0;const n=r(4735),i=r(44789),a=r(72407),o=r(97356),s=r(34005),c=r(23814),u=r(98989);class l extends i.ActorRdfJoin{bindOrder;selectivityModifier;mediatorQueryOperation;mediatorMergeBindingsContext;constructor(e){super(e,{logicalType:"optional",physicalName:"bind",limitEntries:2,canHandleUndefs:!0,isLeaf:!1,requiresVariableOverlap:!0,canHandleOperationRequired:!0}),this.bindOrder=e.bindOrder,this.selectivityModifier=e.selectivityModifier,this.mediatorQueryOperation=e.mediatorQueryOperation,this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}async getOutput(e){const t=e.context.getSafe(a.KeysInitQuery.dataFactory),r=new s.AlgebraFactory(t),o=await c.BindingsFactory.create(this.mediatorMergeBindingsContext,e.context,t);e.entries[1].output.bindingsStream.close();const l=e.context.set(a.KeysQueryOperation.joinLeftMetadata,await e.entries[0].output.metadata()).set(a.KeysQueryOperation.joinRightMetadatas,[await e.entries[1].output.metadata()]);return{result:{type:"bindings",bindingsStream:n.ActorRdfJoinMultiBind.createBindStream(this.bindOrder,e.entries[0].output.bindingsStream,[e.entries[1].operation],(async(e,t)=>{const r=e[0];return(0,u.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:r,context:l?.set(a.KeysQueryOperation.joinBindings,t)})).bindingsStream}),!0,r,o),metadata:async()=>await this.constructResultMetadata(e.entries,await i.ActorRdfJoin.getMetadatas(e.entries),e.context,{},!0)}}}async getJoinCoefficients(e,t){const{metadatas:r}=t,n=i.ActorRdfJoin.getRequestInitialTimes(r),a=i.ActorRdfJoin.getRequestItemTimes(r);if(e.entries[1].operation.type===s.Algebra.Types.EXTEND||e.entries[1].operation.type===s.Algebra.Types.GROUP)return(0,o.failTest)(`Actor ${this.name} can not bind on Extend and Group operations`);const c=(await this.mediatorJoinSelectivity.mediate({entries:e.entries,context:e.context})).selectivity*this.selectivityModifier;return(0,o.passTestWithSideData)({iterations:r[0].cardinality.value*r[1].cardinality.value*c,persistedItems:0,blockingItems:0,requestTime:n[0]+r[0].cardinality.value*(a[0]+n[1]+c*r[1].cardinality.value*a[1])},t)}}t.ActorRdfJoinOptionalBind=l},29429:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(77441),t)},77907:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinOptionalHash=void 0;const n=r(44789),i=r(97356),a=r(23814),o=r(42536),s=r(34569),c=r(76664),u=r(22112);class l extends n.ActorRdfJoin{blocking;constructor(e){super(e,{logicalType:"optional",physicalName:`hash-${e.canHandleUndefs?"undef":"def"}-${e.blocking?"blocking":"nonblocking"}`,limitEntries:2,canHandleUndefs:e.canHandleUndefs,requiresVariableOverlap:!0}),this.blocking=e.blocking}static constructIndex(e,t){return e?new o.BindingsIndexUndef(t,(e=>e&&"Variable"!==e.termType?(0,u.termToString)(e):""),!0):new o.BindingsIndexDef(t,a.bindingsToCompactString)}async getOutput(e){const t=e.entries[1].output,r=e.entries[0].output,i=await n.ActorRdfJoin.getMetadatas(e.entries),a=n.ActorRdfJoin.overlappingVariables(i);let o;return o=this.blocking?new s.ClosableTransformIterator((async()=>{const e=l.constructIndex(this.canHandleUndefs,a);return await new Promise((r=>{t.bindingsStream.on("data",(t=>{(e.getFirst(t,!0)??e.put(t,[])).push(t)})),t.bindingsStream.on("end",r),t.bindingsStream.on("error",(e=>{o.emit("error",e)}))})),new c.MultiTransformIterator(r.bindingsStream,{multiTransform:t=>new c.ArrayIterator(e.get(t).flat().map((e=>n.ActorRdfJoin.joinBindings(t,e))).filter((e=>null!==e)),{autoStart:!1}),optional:!0,autoStart:!1})}),{autoStart:!1,onClose(){t.bindingsStream.destroy(),r.bindingsStream.destroy()}}):new s.ClosableTransformIterator((async()=>{const e=l.constructIndex(this.canHandleUndefs,a);let i=!0;return t.bindingsStream.on("data",(t=>{(e.getFirst(t,!0)??e.put(t,new c.BufferedIterator({autoStart:!1})))._push(t)})),t.bindingsStream.on("end",(()=>{for(const t of e.values())t.close();i=!1})),t.bindingsStream.on("error",(e=>{o.emit("error",e)})),new c.MultiTransformIterator(r.bindingsStream,{multiTransform:t=>{let r=e.get(t);return 0===r.length&&(r=i?[e.put(t,new c.BufferedIterator({autoStart:!1}))]:[]),new c.UnionIterator(r.map((e=>e.clone())),{autoStart:!1}).map((e=>n.ActorRdfJoin.joinBindings(t,e)))},optional:!0,autoStart:!1})}),{autoStart:!1,onClose(){t.bindingsStream.destroy(),r.bindingsStream.destroy()}}),{result:{type:"bindings",bindingsStream:o,metadata:async()=>await this.constructResultMetadata(e.entries,i,e.context,{},!0)}}}async getJoinCoefficients(e,t){const{metadatas:r}=t,a=n.ActorRdfJoin.getRequestInitialTimes(r),o=n.ActorRdfJoin.getRequestItemTimes(r);let s=r[0].cardinality.value+r[1].cardinality.value;return this.canHandleUndefs||(s*=.8),this.blocking&&(s*=.9),(0,i.passTestWithSideData)({iterations:s,persistedItems:r[0].cardinality.value,blockingItems:this.blocking?r[0].cardinality.value:0,requestTime:a[0]+r[0].cardinality.value*o[0]+a[1]+r[1].cardinality.value*o[1]},t)}}t.ActorRdfJoinOptionalHash=l},60434:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(77907),t)},92089:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinOptionalNestedLoop=void 0;const n=r(44789),i=r(97356),a=r(2922);class o extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"optional",physicalName:"nested-loop",limitEntries:2,canHandleUndefs:!0})}async getOutput(e){return{result:{type:"bindings",bindingsStream:new a.NestedLoopJoin(e.entries[0].output.bindingsStream,e.entries[1].output.bindingsStream,n.ActorRdfJoin.joinBindings,{optional:!0,autoStart:!1}),metadata:async()=>await this.constructResultMetadata(e.entries,await n.ActorRdfJoin.getMetadatas(e.entries),e.context,{},!0)}}}async getJoinCoefficients(e,t){const{metadatas:r}=t,a=n.ActorRdfJoin.getRequestInitialTimes(r),o=n.ActorRdfJoin.getRequestItemTimes(r);return(0,i.passTestWithSideData)({iterations:r[0].cardinality.value*r[1].cardinality.value,persistedItems:0,blockingItems:0,requestTime:a[0]+r[0].cardinality.value*o[0]+a[1]+r[1].cardinality.value*o[1]},t)}}t.ActorRdfJoinOptionalNestedLoop=o},69715:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(92089),t)},81614:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JoinTypes=t.ActorRdfJoinSelectivityVariableCounting=void 0;const n=r(42489),i=r(97356),a=r(34005);class o extends n.ActorRdfJoinSelectivity{static MAX_PAIRWISE_COST=82;constructor(e){super(e)}async test(e){return(0,i.passTest)({accuracy:.5})}static getPatternCost(e){let t=1;return"Variable"===e.subject.termType&&(t+=4),("termType"in e.predicate&&"Variable"===e.predicate.termType||e.type===a.Algebra.Types.PATH)&&(t+=1),"Variable"===e.object.termType&&(t+=2),"Variable"===e.graph.termType&&(t+=1),t/9}static getJoinTypes(e,t){const r=[];return"Variable"===e.subject.termType?(e.subject.equals(t.subject)&&r.push(s.unboundSS),"pattern"===t.type&&e.subject.equals(t.predicate)&&r.push(s.unboundSP),e.subject.equals(t.object)&&r.push(s.unboundSO),e.subject.equals(t.graph)&&r.push(s.unboundSG)):(e.subject.equals(t.subject)&&r.push(s.boundSS),"pattern"===t.type&&e.subject.equals(t.predicate)&&r.push(s.boundSP),e.subject.equals(t.object)&&r.push(s.boundSO),e.subject.equals(t.graph)&&r.push(s.boundSG)),"pattern"===e.type&&("Variable"===e.predicate.termType?(e.predicate.equals(t.subject)&&r.push(s.unboundPS),"pattern"===t.type&&e.predicate.equals(t.predicate)&&r.push(s.unboundPP),e.predicate.equals(t.object)&&r.push(s.unboundPO),e.predicate.equals(t.graph)&&r.push(s.unboundPG)):(e.predicate.equals(t.subject)&&r.push(s.boundPS),"pattern"===t.type&&e.predicate.equals(t.predicate)&&r.push(s.boundPP),e.predicate.equals(t.object)&&r.push(s.boundPO),e.predicate.equals(t.graph)&&r.push(s.boundPG))),"Variable"===e.object.termType?(e.object.equals(t.subject)&&r.push(s.unboundOS),"pattern"===t.type&&e.object.equals(t.predicate)&&r.push(s.unboundOP),e.object.equals(t.object)&&r.push(s.unboundOO),e.object.equals(t.graph)&&r.push(s.unboundOG)):(e.object.equals(t.subject)&&r.push(s.boundOS),"pattern"===t.type&&e.object.equals(t.predicate)&&r.push(s.boundOP),e.object.equals(t.object)&&r.push(s.boundOO),e.object.equals(t.graph)&&r.push(s.boundOG)),"Variable"===e.graph.termType?(e.graph.equals(t.subject)&&r.push(s.unboundGS),"pattern"===t.type&&e.graph.equals(t.predicate)&&r.push(s.unboundGP),e.graph.equals(t.object)&&r.push(s.unboundGO),e.graph.equals(t.graph)&&r.push(s.unboundGG)):(e.graph.equals(t.subject)&&r.push(s.boundGS),"pattern"===t.type&&e.graph.equals(t.predicate)&&r.push(s.boundGP),e.graph.equals(t.object)&&r.push(s.boundGO),e.graph.equals(t.graph)&&r.push(s.boundGG)),r}static getOperationsPairwiseJoinCost(e,t){let r=o.MAX_PAIRWISE_COST;for(const n of o.getJoinTypes(e,t))switch(n){case s.boundSS:r-=4;break;case s.boundSP:r-=6;break;case s.boundSO:r-=2;break;case s.boundSG:case s.boundPS:r-=6;break;case s.boundPP:return 1;case s.boundPO:case s.boundPG:r-=6;break;case s.boundOS:r-=2;break;case s.boundOP:r-=6;break;case s.boundOO:r-=2;break;case s.boundOG:case s.boundGS:case s.boundGP:case s.boundGO:case s.boundGG:r-=6;break;case s.unboundSS:r-=2;break;case s.unboundSP:r-=3;break;case s.unboundSO:r-=1;break;case s.unboundSG:case s.unboundPS:case s.unboundPP:case s.unboundPO:case s.unboundPG:r-=3;break;case s.unboundOS:r-=1;break;case s.unboundOP:r-=3;break;case s.unboundOO:r-=1;break;case s.unboundOG:case s.unboundGS:case s.unboundGP:case s.unboundGO:case s.unboundGG:r-=3}return r/o.MAX_PAIRWISE_COST}static getOperationsJoinCost(e){const t=[];for(const r of e)a.algebraUtils.visitOperation(r,{[a.Algebra.Types.PATTERN]:{preVisitor:e=>(t.push(e),{continue:!1})},[a.Algebra.Types.PATH]:{preVisitor:e=>(t.push(e),{continue:!1})}});let r=0,n=0;for(const e of t)for(const i of t)e!==i&&(r+=o.getOperationsPairwiseJoinCost(e,i),n++);return 0===n?1:r/n*t.reduce(((e,t)=>e*o.getPatternCost(t)),1)}async run(e){return e.entries.length<=1?{selectivity:1}:{selectivity:o.getOperationsJoinCost(e.entries.map((e=>e.operation)))}}}var s;t.ActorRdfJoinSelectivityVariableCounting=o,function(e){e[e.boundSS=0]="boundSS",e[e.boundSP=1]="boundSP",e[e.boundSO=2]="boundSO",e[e.boundSG=3]="boundSG",e[e.boundPS=4]="boundPS",e[e.boundPP=5]="boundPP",e[e.boundPO=6]="boundPO",e[e.boundPG=7]="boundPG",e[e.boundOS=8]="boundOS",e[e.boundOP=9]="boundOP",e[e.boundOO=10]="boundOO",e[e.boundOG=11]="boundOG",e[e.boundGS=12]="boundGS",e[e.boundGP=13]="boundGP",e[e.boundGO=14]="boundGO",e[e.boundGG=15]="boundGG",e[e.unboundSS=16]="unboundSS",e[e.unboundSP=17]="unboundSP",e[e.unboundSO=18]="unboundSO",e[e.unboundSG=19]="unboundSG",e[e.unboundPS=20]="unboundPS",e[e.unboundPP=21]="unboundPP",e[e.unboundPO=22]="unboundPO",e[e.unboundPG=23]="unboundPG",e[e.unboundOS=24]="unboundOS",e[e.unboundOP=25]="unboundOP",e[e.unboundOO=26]="unboundOO",e[e.unboundOG=27]="unboundOG",e[e.unboundGS=28]="unboundGS",e[e.unboundGP=29]="unboundGP",e[e.unboundGO=30]="unboundGO",e[e.unboundGG=31]="unboundGG"}(s||(t.JoinTypes=s={}))},11755:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(81614),t)},5151:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataAccumulateCardinality=void 0;const n=r(64961),i=r(97356);class a extends n.ActorRdfMetadataAccumulate{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){if("initialize"===e.mode)return{metadata:{cardinality:{type:"exact",value:0}}};const t={...e.accumulatedMetadata.cardinality};if(t.dataset){if(e.accumulatedMetadata.defaultGraph===t.dataset&&t.dataset!==e.appendingMetadata.cardinality.dataset)return{metadata:{cardinality:e.appendingMetadata.cardinality}};if(!e.appendingMetadata.cardinality.dataset)return{metadata:{cardinality:t}};if(t.dataset!==e.appendingMetadata.cardinality.dataset&&e.appendingMetadata.subsetOf===t.dataset)return{metadata:{cardinality:e.appendingMetadata.cardinality}};if(t.dataset===e.appendingMetadata.cardinality.dataset)return{metadata:{cardinality:t}};delete t.dataset}return e.appendingMetadata.cardinality&&Number.isFinite(e.appendingMetadata.cardinality.value)?("estimate"===e.appendingMetadata.cardinality.type&&(t.type="estimate"),t.value+=e.appendingMetadata.cardinality.value):(t.type="estimate",t.value=Number.POSITIVE_INFINITY),{metadata:{cardinality:t}}}}t.ActorRdfMetadataAccumulateCardinality=a},60631:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5151),t)},95237:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataAccumulatePageSize=void 0;const n=r(64961),i=r(97356);class a extends n.ActorRdfMetadataAccumulate{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){return"initialize"===e.mode?{metadata:{}}:{metadata:{..."pageSize"in e.accumulatedMetadata||"pageSize"in e.appendingMetadata?{pageSize:(e.accumulatedMetadata.pageSize??0)+(e.appendingMetadata.pageSize??0)}:{}}}}}t.ActorRdfMetadataAccumulatePageSize=a},72639:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(95237),t)},56499:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataAccumulateRequestTime=void 0;const n=r(64961),i=r(97356);class a extends n.ActorRdfMetadataAccumulate{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){return"initialize"===e.mode?{metadata:{}}:{metadata:{..."requestTime"in e.accumulatedMetadata||"requestTime"in e.appendingMetadata?{requestTime:(e.accumulatedMetadata.requestTime??0)+(e.appendingMetadata.requestTime??0)}:{}}}}}t.ActorRdfMetadataAccumulateRequestTime=a},36323:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(56499),t)},58370:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataAll=void 0;const n=r(34592),i=r(97356),a=r(58521);class o extends n.ActorRdfMetadata{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){const t=new a.Readable({objectMode:!0}),r=new a.Readable({objectMode:!0});e.quads.on("error",(e=>{t.emit("error",e),r.emit("error",e)})),e.quads.on("end",(()=>{t.push(null),r.push(null)}));const n=t._read=r._read=i=>{for(;i>0;){const a=e.quads.read();if(null===a)return e.quads.once("readable",(()=>n(i)));i--,t.push(a),r.push(a)}};return{data:t,metadata:r}}}t.ActorRdfMetadataAll=o},69143:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(58370),t)},68085:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataExtractAllowHttpMethods=void 0;const n=r(33228),i=r(97356);class a extends n.ActorRdfMetadataExtract{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){const t={};return e.headers?.get("allow")&&(t.allowHttpMethods=e.headers.get("allow")?.split(/, */u)),{metadata:t}}}t.ActorRdfMetadataExtractAllowHttpMethods=a},98123:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(68085),t)},12558:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataExtractHydraControls=void 0;const n=r(33228),i=r(97356),a=r(68492);class o extends n.ActorRdfMetadataExtract{static HYDRA="http://www.w3.org/ns/hydra/core#";static LINK_TYPES=["first","next","previous","last"];parsedUriTemplateCache={};constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}getLinks(e,t){return Object.fromEntries(o.LINK_TYPES.map((r=>{const n=t[r]||t[`${r}Page`],i=n&&n[e];return[r,i&&i.length>0?[i[0]]:[]]})))}parseUriTemplateCached(e){return this.parsedUriTemplateCache[e]||(this.parsedUriTemplateCache[e]=(0,a.parse)(e))}getSearchForms(e){const t=e.search,r=[];if(t)for(const n in t)for(const i of t[n]){const t=(e.template||{})[i]||[];if(1!==t.length)throw new Error(`Expected 1 hydra:template for ${i}`);const a=t[0],o=this.parseUriTemplateCached(a),s=Object.fromEntries(((e.mapping||{})[i]||[]).map((t=>{const r=((e.variable||{})[t]||[])[0],n=((e.property||{})[t]||[])[0];if(!r)throw new Error(`Expected a hydra:variable for ${t}`);if(!n)throw new Error(`Expected a hydra:property for ${t}`);return[n,r]}))),c=e=>o.expand(Object.fromEntries(Object.keys(e).map((t=>[s[t],e[t]]))));r.push({dataset:n,template:a,mappings:s,getUri:c})}return{values:r}}getHydraProperties(e){return new Promise(((t,r)=>{e.on("error",r);const n={};e.on("data",(e=>{if(e.predicate.value.startsWith(o.HYDRA)){const t=e.predicate.value.slice(o.HYDRA.length),r=n[t]||(n[t]={});(r[e.subject.value]||(r[e.subject.value]=[])).push(e.object.value)}})),e.on("end",(()=>t(n)))}))}async run(e){const t={},r=await this.getHydraProperties(e.metadata);return Object.assign(t,this.getLinks(e.url,r)),t.searchForms=this.getSearchForms(r),{metadata:t}}}t.ActorRdfMetadataExtractHydraControls=o},21113:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(12558),t)},4294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataExtractHydraCount=void 0;const n=r(33228),i=r(97356);class a extends n.ActorRdfMetadataExtract{predicates;constructor(e){super(e),this.predicates=e.predicates}async test(e){return(0,i.passTestVoid)()}run(e){return new Promise(((t,r)=>{e.metadata.on("error",r),e.metadata.on("data",(e=>{this.predicates.includes(e.predicate.value)&&t({metadata:{cardinality:{type:"estimate",value:Number.parseInt(e.object.value,10),dataset:e.subject.value}}})})),e.metadata.on("end",(()=>{t({metadata:{cardinality:{type:"estimate",value:0}}})}))}))}}t.ActorRdfMetadataExtractHydraCount=a},93134:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4294),t)},30166:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataExtractHydraPagesize=void 0;const n=r(33228),i=r(97356);class a extends n.ActorRdfMetadataExtract{predicates;constructor(e){super(e),this.predicates=e.predicates}async test(e){return(0,i.passTestVoid)()}async run(e){return new Promise(((t,r)=>{e.metadata.on("error",r),e.metadata.on("data",(e=>{this.predicates.includes(e.predicate.value)&&t({metadata:{pageSize:Number.parseInt(e.object.value,10)}})})),e.metadata.on("end",(()=>{t({metadata:{}})}))}))}}t.ActorRdfMetadataExtractHydraPagesize=a},92389:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(30166),t)},81055:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataExtractPatchSparqlUpdate=void 0;const n=r(33228),i=r(97356);class a extends n.ActorRdfMetadataExtract{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){const t={};return(e.headers?.get("accept-patch")?.includes("application/sparql-update")??e.headers?.get("ms-author-via")?.includes("SPARQL"))&&(t.patchSparqlUpdate=!0),{metadata:t}}}t.ActorRdfMetadataExtractPatchSparqlUpdate=a},398:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(81055),t)},78248:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataExtractPostAccepted=void 0;const n=r(33228),i=r(97356);class a extends n.ActorRdfMetadataExtract{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){const t={},r=e.headers?.get("accept-post");return r&&(t.postAccepted=r.split(/, */u)),{metadata:t}}}t.ActorRdfMetadataExtractPostAccepted=a},83696:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(78248),t)},65524:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataExtractPutAccepted=void 0;const n=r(33228),i=r(97356);class a extends n.ActorRdfMetadataExtract{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){const t={},r=e.headers?.get("accept-put");return r&&(t.putAccepted=r.split(/, */u)),{metadata:t}}}t.ActorRdfMetadataExtractPutAccepted=a},68545:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(65524),t)},59632:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataExtractRequestTime=void 0;const n=r(33228),i=r(97356);class a extends n.ActorRdfMetadataExtract{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){return{metadata:{requestTime:e.requestTime}}}}t.ActorRdfMetadataExtractRequestTime=a},27161:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(59632),t)},5950:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataExtractServerSoftware=void 0;const n=r(33228),i=r(97356);class a extends n.ActorRdfMetadataExtract{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){const t={},r=e.headers?.get("server");return r&&(t.serverSoftware=r),{metadata:t}}}t.ActorRdfMetadataExtractServerSoftware=a},52675:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5950),t)},20546:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataExtractSparqlService=void 0;const n=r(33228),i=r(97356),a=r(9929);class o extends n.ActorRdfMetadataExtract{static SD="http://www.w3.org/ns/sparql-service-description#";static SPARQL="http://www.w3.org/ns/sparql#";inferHttpsEndpoint;constructor(e){super(e),this.inferHttpsEndpoint=e.inferHttpsEndpoint}async test(e){return(0,i.passTestVoid)()}async run(e){return new Promise(((t,r)=>{e.metadata.on("error",r);const n=new Set([e.url]),i={},s=new Set,c=new Set,u=new Set,l=new Set,d=new Set,p=new Set,h=`${o.SD}SPARQL10Query`,f=`${o.SD}SPARQL11Query`,y=`${o.SD}SPARQLQuery`,m=`${o.SPARQL}version-1.0`,g=`${o.SPARQL}version-1.1`,b=`${o.SPARQL}version-1.2`,v=`${o.SPARQL}version-1.2-basic`;e.metadata.on("data",(t=>{if("http://rdfs.org/ns/void#subset"===t.predicate.value&&t.object.value===e.url)n.add(t.subject.value);else if(t.subject.value===i.defaultDataset||"BlankNode"===t.subject.termType||n.has(t.subject.value))switch(t.predicate.value){case`${o.SD}endpoint`:i.sparqlService="Literal"===t.object.termType?(0,a.resolve)(t.object.value,e.url):t.object.value,this.inferHttpsEndpoint&&e.url.startsWith("https")&&!t.object.value.startsWith("https")&&(i.sparqlService=i.sparqlService.replace(/^http:/u,"https:"));break;case`${o.SD}defaultDataset`:i.defaultDataset=t.object.value;break;case`${o.SD}defaultGraph`:i.defaultGraph=t.object.value;break;case`${o.SD}inputFormat`:s.add(t.object.value);break;case`${o.SD}resultFormat`:c.add(t.object.value);break;case`${o.SD}supportedLanguage`:switch(u.add(t.object.value),t.object.value){case h:u.add(y),l.add(m);break;case f:u.add(y),l.add(g)}break;case`${o.SD}supportedVersion`:switch(l.add(t.object.value),t.object.value){case m:u.add(h);break;case g:case b:case v:u.add(f)}break;case`${o.SD}propertyFeature`:p.add(t.object.value);break;case`${o.SD}feature`:t.object.value===`${o.SD}UnionDefaultGraph`?i.unionDefaultGraph=!0:t.object.value===`${o.SD}BasicFederatedQuery`&&(i.basicFederatedQuery=!0);break;case`${o.SD}extensionFunction`:d.add(t.object.value)}})),e.metadata.on("end",(()=>{t({metadata:{...i,...s.size>0?{inputFormats:[...s.values()]}:{},...c.size>0?{resultFormats:[...c.values()]}:{},...u.size>0?{supportedLanguages:[...u.values()]}:{},...l.size>0?{supportedVersions:[...l.values()]}:{},...d.size>0?{extensionFunctions:[...d.values()]}:{},...p.size>0?{propertyFeatures:[...p.values()]}:{}}})}))}))}}t.ActorRdfMetadataExtractSparqlService=o},21007:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(20546),t)},58139:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataExtractVoid=void 0;const n=r(33228),i=r(97356),a=r(34005),o=r(38648),s=r(33699);class c extends n.ActorRdfMetadataExtract{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){return new Promise(((t,r)=>{const n=new Set,i=new Set,c={},u={},l={},d={},p={},h={},f={},y={},m={},g={},b={};let v,_,T=!1;e.metadata.on("error",r).on("data",(e=>{switch(e.predicate.value){case o.RDF_TYPE:e.object.value!==o.SD_GRAPH&&e.object.value!==o.VOID_DATASET||n.add(e.subject.value);break;case o.VOID_TRIPLES:c[e.subject.value]=Number.parseInt(e.object.value,10);break;case o.VOID_ENTITIES:u[e.subject.value]=Number.parseInt(e.object.value,10);break;case o.VOID_CLASSES:d[e.subject.value]=Number.parseInt(e.object.value,10);break;case o.VOID_CLASS:b[e.subject.value]=e.object.value;break;case o.VOID_PROPERTY:m[e.subject.value]=e.object.value;break;case o.VOID_DISTINCT_OBJECTS:p[e.subject.value]=Number.parseInt(e.object.value,10);break;case o.VOID_DISTINCT_SUBJECTS:h[e.subject.value]=Number.parseInt(e.object.value,10);break;case o.VOID_VOCABULARY:l[e.subject.value]?l[e.subject.value].push(e.object.value):l[e.subject.value]=[e.object.value];break;case o.VOID_URI_SPACE:f[e.subject.value]||(f[e.subject.value]=new RegExp(`^${e.object.value}`,"u"));break;case o.VOID_URI_REGEX_PATTERN:f[e.subject.value]=new RegExp(e.object.value,"u");break;case o.VOID_PROPERTY_PARTITION:i.add(e.object.value),y[e.subject.value]?y[e.subject.value].push(e.object.value):y[e.subject.value]=[e.object.value];break;case o.VOID_CLASS_PARTITION:i.add(e.object.value),g[e.subject.value]?g[e.subject.value].push(e.object.value):g[e.subject.value]=[e.object.value];break;case o.SD_DEFAULT_DATASET:v=e.object.value;break;case o.SD_DEFAULT_GRAPH:_=e.object.value;break;case o.SD_FEATURE:e.object.value===o.SD_UNION_DEFAULT_GRAPH&&(T=!0)}})).on("end",(()=>{const r=[],o=e=>{const t={};for(const r of y[e]){const e=m[r];e&&(t[e]={distinctObjects:p[r],distinctSubjects:h[r],triples:c[r]})}return t},O=e=>{const t={};for(const r of g[e]){const e=b[r];e&&(t[e]={entities:u[r],propertyPartitions:y[r]?o(r):void 0})}return t};v&&i.add(v),T&&_&&i.add(_),v&&_&&l[v]&&(l[_]=[...l[_]??[],...l[v]]);for(const e of i)n.delete(e);for(const t of n)if(c[t]){const n={entities:u[t],identifier:t,classes:d[t]??g[t]?.length??0,classPartitions:g[t]?O(t):void 0,distinctObjects:p[t],distinctSubjects:h[t],propertyPartitions:y[t]?o(t):void 0,triples:c[t],uriRegexPattern:f[t],vocabularies:l[t]};r.push({uri:t,source:e.url,getCardinality:async e=>{if((0,a.isKnownOperation)(e,a.Algebra.Types.PATTERN))return{...(0,s.estimatePatternCardinality)(n,e),dataset:t}}})}t({metadata:r.length>0?{datasets:r}:{}})}))}))}}t.ActorRdfMetadataExtractVoid=c},38648:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VOID_CLASS_PARTITION=t.VOID_PROPERTY_PARTITION=t.VOID_DISTINCT_SUBJECTS=t.VOID_DISTINCT_OBJECTS=t.VOID_URI_REGEX_PATTERN=t.VOID_URI_SPACE=t.VOID_VOCABULARY=t.VOID_PROPERTY=t.VOID_CLASS=t.VOID_ENTITIES=t.VOID_TRIPLES=t.VOID_CLASSES=t.VOID_DATASET=t.VOID=t.SD_GRAPH=t.SD_FEATURE=t.SD_UNION_DEFAULT_GRAPH=t.SD_DEFAULT_GRAPH=t.SD_DEFAULT_DATASET=t.SD=t.RDF_TYPE=void 0,t.RDF_TYPE="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",t.SD="http://www.w3.org/ns/sparql-service-description#",t.SD_DEFAULT_DATASET=`${t.SD}defaultDataset`,t.SD_DEFAULT_GRAPH=`${t.SD}defaultGraph`,t.SD_UNION_DEFAULT_GRAPH=`${t.SD}UnionDefaultGraph`,t.SD_FEATURE=`${t.SD}feature`,t.SD_GRAPH=`${t.SD}Graph`,t.VOID="http://rdfs.org/ns/void#",t.VOID_DATASET=`${t.VOID}Dataset`,t.VOID_CLASSES=`${t.VOID}classes`,t.VOID_TRIPLES=`${t.VOID}triples`,t.VOID_ENTITIES=`${t.VOID}entities`,t.VOID_CLASS=`${t.VOID}class`,t.VOID_PROPERTY=`${t.VOID}property`,t.VOID_VOCABULARY=`${t.VOID}vocabulary`,t.VOID_URI_SPACE=`${t.VOID}uriSpace`,t.VOID_URI_REGEX_PATTERN=`${t.VOID}uriRegexPattern`,t.VOID_DISTINCT_OBJECTS=`${t.VOID}distinctSubjects`,t.VOID_DISTINCT_SUBJECTS=`${t.VOID}distinctObjects`,t.VOID_PROPERTY_PARTITION=`${t.VOID}propertyPartition`,t.VOID_CLASS_PARTITION=`${t.VOID}classPartition`},33699:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.estimatePatternCardinality=function(e,t){const r={type:"exact",value:0};if(a(e,t)&&i(e,t)){const n=o(e,t);n>0&&(r.value=n,r.type="estimate")}return r},t.matchPatternResourceUris=i,t.matchPatternVocabularies=a,t.estimatePatternCardinalityRaw=o,t.getDistinctObjects=s,t.getDistinctSubjects=c,t.getPredicateObjects=u,t.getPredicateSubjects=l,t.getPredicateTriples=d,t.getClassPartitionEntities=p;const n=r(38648);function i(e,t){return!e.uriRegexPattern||"NamedNode"!==t.subject.termType||e.uriRegexPattern.test(t.subject.value)||"NamedNode"!==t.object.termType||e.uriRegexPattern.test(t.object.value)}function a(e,t){return void 0===e.vocabularies||"NamedNode"!==t.predicate.termType||e.vocabularies.some((e=>t.predicate.value.startsWith(e)))}function o(e,t){if("Variable"===t.subject.termType&&"NamedNode"===t.predicate.termType&&t.predicate.value===n.RDF_TYPE&&("NamedNode"===t.object.termType||"BlankNode"===t.object.termType))return p(e,t.object);if("Variable"===t.subject.termType&&"Variable"===t.predicate.termType&&"Variable"===t.object.termType)return e.triples;if(!("NamedNode"!==t.subject.termType&&"BlankNode"!==t.subject.termType||"Variable"!==t.predicate.termType||"Variable"!==t.object.termType&&"Literal"!==t.object.termType)){const t=c(e);if(t>0)return e.triples/t}if("Variable"===t.subject.termType&&"NamedNode"===t.predicate.termType&&("Variable"===t.object.termType||"Literal"===t.object.termType))return d(e,t.predicate);if("Variable"===t.subject.termType&&"Variable"===t.predicate.termType&&("NamedNode"===t.object.termType||"BlankNode"===t.object.termType||"Literal"===t.object.termType)){const t=s(e);if(t>0)return e.triples/t}if(!("NamedNode"!==t.subject.termType&&"BlankNode"!==t.subject.termType||"NamedNode"!==t.predicate.termType||"Variable"!==t.object.termType&&"Literal"!==t.object.termType)){const r=d(e,t.predicate),n=l(e,t.predicate);return n>0?r/n:r}if(!("NamedNode"!==t.subject.termType&&"BlankNode"!==t.subject.termType||"Variable"!==t.predicate.termType||"NamedNode"!==t.object.termType&&"BlankNode"!==t.object.termType)){const t=c(e),r=s(e);if(t>0&&r>0)return e.triples/(t*r)}if("Variable"===t.subject.termType&&"NamedNode"===t.predicate.termType&&("NamedNode"===t.object.termType||"BlankNode"===t.object.termType)){const r=d(e,t.predicate),n=u(e,t.predicate);return n>0?r/n:r}if(!("NamedNode"!==t.subject.termType&&"BlankNode"!==t.subject.termType||"NamedNode"!==t.predicate.termType||"NamedNode"!==t.object.termType&&"BlankNode"!==t.object.termType)){const r=d(e,t.predicate),n=l(e,t.predicate),i=u(e,t.predicate);return n>0&&i>0?r/(n*i):r}return e.triples}function s(e){return e.distinctObjects??e.entities??e.triples}function c(e){return e.distinctSubjects??e.entities??e.triples}function u(e,t){if(e.propertyPartitions){const r=e.propertyPartitions[t.value];return r?.distinctObjects??r?.triples??0}return e.triples}function l(e,t){if(e.propertyPartitions){const r=e.propertyPartitions[t.value];return r?.distinctSubjects??r?.triples??0}return e.triples}function d(e,t){return e.propertyPartitions?e.propertyPartitions[t.value]?.triples??0:e.triples}function p(e,t){return e.classPartitions?e.classPartitions[t.value]?.entities??0:void 0!==e.entities&&e.classes?e.entities/e.classes:e.triples}},2438:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(58139),t)},75525:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataPrimaryTopic=void 0;const n=r(34592),i=r(97356),a=r(58521);class o extends n.ActorRdfMetadata{metadataToData;dataToMetadataOnInvalidMetadataGraph;constructor(e){super(e),this.metadataToData=e.metadataToData,this.dataToMetadataOnInvalidMetadataGraph=e.dataToMetadataOnInvalidMetadataGraph}async test(e){return e.triples?(0,i.failTest)("This actor only supports non-triple quad streams."):(0,i.passTestVoid)()}async run(e){const t=new a.Readable({objectMode:!0}),r=new a.Readable({objectMode:!0}),n=()=>{t._read=r._read=()=>{},e.quads.on("error",(e=>{t.emit("error",e),r.emit("error",e)}));const n={};let i;const a={};e.quads.on("data",(t=>{"http://rdfs.org/ns/void#subset"===t.predicate.value&&t.object.value===e.url?i=t.subject.value:"http://xmlns.com/foaf/0.1/primaryTopic"===t.predicate.value&&(a[t.object.value]=t.subject.value);let r=n[t.graph.value];r||(r=n[t.graph.value]=[]),r.push(t)})),e.quads.on("end",(()=>{const e=i?a[i]:void 0;for(const i in n)if(i===e){for(const e of n[i])r.push(e);if(this.metadataToData)for(const e of n[i])t.push(e)}else{for(const e of n[i])t.push(e);if(!e&&this.dataToMetadataOnInvalidMetadataGraph)for(const e of n[i])r.push(e)}t.push(null),r.push(null)}))};return t._read=r._read=()=>{n()},{data:t,metadata:r}}}t.ActorRdfMetadataPrimaryTopic=o},42380:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(75525),t)},52645:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfParseHtmlMicrodata=void 0;const n=r(70914),i=r(72407),a=r(97356),o=r(64134);class s extends n.ActorRdfParseHtml{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=e.headers?e.headers.get("content-type"):null,n=r?.includes("xml"),a=new o.MicrodataRdfParser({dataFactory:t,baseIRI:e.baseIRI,xmlMode:n});a.on("error",e.error),a.on("data",e.emit);const s=a.onEnd;return a.onEnd=()=>{s.call(a),e.end()},{htmlParseListener:a}}}t.ActorRdfParseHtmlMicrodata=s},6161:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(52645),t)},64134:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(13463),t),i(r(23743),t),i(r(36505),t),i(r(95377),t),i(r(73039),t),i(r(22621),t),i(r(71608),t),i(r(78821),t),i(r(80675),t),i(r(60004),t)},22621:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},71608:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},78821:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},80675:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MicrodataRdfParser=void 0;const n=r(15482),i=r(58521),a=r(23743),o=r(36505),s=r(95377),c=r(73039),u=r(60004),l=r(17442);class d extends i.Transform{constructor(e){super({readableObjectMode:!0}),this.itemScopeStack=[],this.textBufferStack=[],this.isEmittingReferences=!1,this.pendingItemRefsDomain={},this.pendingItemRefsRangeFinalized={},this.pendingItemRefsRangeCollecting={},e=e||{},this.options=e,this.util=new u.Util(e.dataFactory,e.baseIRI),this.defaultGraph=e.defaultGraph||this.util.dataFactory.defaultGraph(),this.htmlParseListener=e.htmlParseListener,this.vocabRegistry=e.vocabRegistry||l,this.parser=this.initializeParser(!!e.xmlMode)}import(e){const t=new i.PassThrough({readableObjectMode:!0});e.on("error",(e=>r.emit("error",e))),e.on("data",(e=>t.push(e))),e.on("end",(()=>t.push(null)));const r=t.pipe(new d(this.options));return r}_transform(e,t,r){this.parser.write(e.toString()),r()}_flush(e){this.parser.end(),e()}getItemScope(e){let t=this.itemScopeStack.length-(e?2:1);for(;t>0&&!this.itemScopeStack[t];)t--;return this.itemScopeStack[t]}getDepth(){return this.itemScopeStack.length}onTagOpen(e,t){if(!this.isEmittingReferences){if("id"in t){const e=t.id;this.pendingItemRefsRangeCollecting[e]={events:[],counter:0,ids:[]}}for(const r of Object.values(this.pendingItemRefsRangeCollecting))r.counter++,r.events.push({type:"open",name:e,attributes:t})}let r;if(this.textBufferStack.push(void 0),"itemscope"in t){let e;if(this.emittingReferencesItemScopeIdGenerator)e=this.emittingReferencesItemScopeIdGenerator();else{e="itemid"in t&&this.util.createSubject(t.itemid)||this.util.dataFactory.blankNode();for(const t of Object.values(this.pendingItemRefsRangeCollecting))t.ids.push(e)}r={subject:e},this.isEmittingReferences&&(r.blockEmission=!0);const n=this.getItemScope();n&&n.vocab&&(r.vocab=n.vocab),this.itemScopeStack.push(r)}else r=this.getItemScope(),this.itemScopeStack.push(void 0);if(r){if("itemtype"in t)for(const e of this.util.createVocabIris(t.itemtype,r,!1))r.vocab||(r.vocab=this.util.deriveVocab(e.value,this.vocabRegistry)),r.blockEmission||this.emitTriple(r.subject,this.util.dataFactory.namedNode(`${u.Util.RDF}type`),e);if("lang"in t&&(r.language=t.lang),"xml:lang"in t&&(r.language=t["xml:lang"]),"itemscope"in t&&!this.isEmittingReferences&&"itemref"in t)for(const e of t.itemref.split(/\s+/u))e in this.pendingItemRefsDomain||(this.pendingItemRefsDomain[e]=[]),this.pendingItemRefsDomain[e].push(r),this.tryToEmitReferences(e,r)}"itemprop"in t&&this.handleItemProperties(t.itemprop,!1,r,e,t),"itemprop-reverse"in t&&this.handleItemProperties(t["itemprop-reverse"],!0,r,e,t)}onText(e){if(!this.isEmittingReferences)for(const t of Object.values(this.pendingItemRefsRangeCollecting))t.events.push({type:"text",data:e});for(const t of this.textBufferStack)t&&t.push(e)}onTagClose(){if(!this.isEmittingReferences)for(const[e,t]of Object.entries(this.pendingItemRefsRangeCollecting))t.counter--,t.events.push({type:"close"}),0===t.counter&&(this.pendingItemRefsRangeFinalized[e]=t,delete this.pendingItemRefsRangeCollecting[e],this.tryToEmitReferences(e));const e=this.getItemScope(!0);if(e){const t=this.getDepth();if(e.predicates&&t in e.predicates)for(const[r,n]of Object.entries(e.predicates[t])){const i=this.util.createLiteral(this.textBufferStack[t].join(""),e);this.emitPredicateTriples(e,n,i,"reverse"===r),delete e.predicates[t][r]}}this.itemScopeStack.pop(),this.textBufferStack.pop()}onEnd(){}initializeParser(e){return new n.Parser({onclosetag:()=>{try{this.onTagClose(),this.htmlParseListener&&this.htmlParseListener.onTagClose()}catch(e){this.emit("error",e)}},onend:()=>{try{this.onEnd(),this.htmlParseListener&&this.htmlParseListener.onEnd()}catch(e){this.emit("error",e)}},onopentag:(e,t)=>{try{this.onTagOpen(e,t),this.htmlParseListener&&this.htmlParseListener.onTagOpen(e,t)}catch(e){this.emit("error",e)}},ontext:e=>{try{this.onText(e),this.htmlParseListener&&this.htmlParseListener.onText(e)}catch(e){this.emit("error",e)}}},{decodeEntities:!0,recognizeSelfClosing:!0,xmlMode:e})}handleItemProperties(e,t,r,n,i){const a=this.getItemScope(!0);if(a){const o=this.getDepth(),s=this.util.createVocabIris(e,a,!0);a.predicates||(a.predicates={}),a.predicates[o]||(a.predicates[o]={});const c=t?"reverse":"forward";a.predicates[o][c]=s;for(const t of this.util.getVocabularyExpansionType(e,a,this.vocabRegistry))s.push(t);if(r&&"itemscope"in i)this.emitPredicateTriples(a,s,r.subject,t),delete a.predicates[o][c];else for(const e of d.ITEM_PROPERTY_HANDLERS)if(e.canHandle(n,i)){const r=e.getObject(i,this.util,a);this.emitPredicateTriples(a,s,r,t),delete a.predicates[o][c]}a.predicates[o][c]&&(this.textBufferStack[o]=[])}}emitPredicateTriples(e,t,r,n){if(!e.blockEmission)for(const i of t)n?"Literal"!==r.termType&&this.emitTriple(r,i,e.subject):this.emitTriple(e.subject,i,r)}emitTriple(e,t,r){this.push(this.util.dataFactory.quad(e,t,r,this.defaultGraph))}tryToEmitReferences(e,t){const r=this.pendingItemRefsRangeFinalized[e];if(r){let n;if(t){n=[t];const r=this.pendingItemRefsDomain[e].indexOf(t);this.pendingItemRefsDomain[e].splice(r,1)}else n=this.pendingItemRefsDomain[e],delete this.pendingItemRefsDomain[e];if(n){const e=this.itemScopeStack,t=this.textBufferStack;this.isEmittingReferences=!0;for(const e of n){this.itemScopeStack=[e],this.textBufferStack=[void 0];const t=[...r.ids];this.emittingReferencesItemScopeIdGenerator=()=>t.shift();for(const e of r.events)switch(e.type){case"open":this.onTagOpen(e.name,e.attributes);break;case"text":this.onText(e.data);break;case"close":this.onTagClose()}}this.emittingReferencesItemScopeIdGenerator=void 0,this.itemScopeStack=e,this.textBufferStack=t,this.isEmittingReferences=!1}}}}t.MicrodataRdfParser=d,d.ITEM_PROPERTY_HANDLERS=[new a.ItemPropertyHandlerContent,new c.ItemPropertyHandlerUrl("a","href"),new c.ItemPropertyHandlerUrl("area","href"),new c.ItemPropertyHandlerUrl("audio","src"),new c.ItemPropertyHandlerUrl("embed","src"),new c.ItemPropertyHandlerUrl("iframe","src"),new c.ItemPropertyHandlerUrl("img","src"),new c.ItemPropertyHandlerUrl("link","href"),new c.ItemPropertyHandlerUrl("object","data"),new c.ItemPropertyHandlerUrl("source","src"),new c.ItemPropertyHandlerUrl("track","src"),new c.ItemPropertyHandlerUrl("video","src"),new o.ItemPropertyHandlerNumber("data","value"),new o.ItemPropertyHandlerNumber("meter","value"),new s.ItemPropertyHandlerTime]},60004:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=void 0;const n=r(18050),i=r(80441);class a{constructor(e,t){this.dataFactory=e||new n.DataFactory,this.baseIRI=t||""}static isValidIri(e){return a.IRI_REGEX.test(e)}createVocabIris(e,t,r){return e.split(/\s+/u).filter((e=>!!e)).map((e=>{if(!a.isValidIri(e)){if(!r)return;e=`${t.vocab||`${this.baseIRI}#`}${e}`}return this.dataFactory.namedNode(e)})).filter((e=>!!e))}getVocabularyExpansionType(e,t,r){const n=e.split(/\s+/u);if(n.includes("subPropertyOf")||n.includes("equivalentProperty"))return[this.dataFactory.namedNode(`${a.RDF}type`)];if(t.vocab&&t.vocab in r&&r[t.vocab].properties){let e=[];for(const[i,a]of Object.entries(r[t.vocab].properties))n.includes(i)&&(e=[...Object.values(a).map((e=>this.dataFactory.namedNode(e)))]);return e}return[]}createSubject(e){if(!a.isValidIri(e))try{e=(0,i.resolve)(e,this.baseIRI)}catch(e){return}return this.dataFactory.namedNode(e)}createLiteral(e,t){return this.dataFactory.literal(e,t.language)}deriveVocab(e,t){let r;for(const n in t)if(e.startsWith(n)){r=n,r.endsWith("/")||(r+="#");break}if(!r){const t=e.indexOf("#");r=t>0?e.slice(0,t+1):(0,i.resolve)(".",e)}return r}}t.Util=a,a.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",a.XSD="http://www.w3.org/2001/XMLSchema#",a.RDFA="http://www.w3.org/ns/rdfa#",a.IRI_REGEX=/^([A-Za-z][\d+-.A-Za-z]*|_):[^ "<>[\\\]`{|}]*$/u},13463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},23743:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemPropertyHandlerContent=void 0,t.ItemPropertyHandlerContent=class{canHandle(e,t){return"content"in t}getObject(e,t,r){return t.createLiteral(e.content,r)}}},36505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemPropertyHandlerNumber=void 0;const n=r(60004);t.ItemPropertyHandlerNumber=class{constructor(e,t){this.tagName=e,this.attributeName=t}canHandle(e,t){return this.tagName===e&&this.attributeName in t}getObject(e,t,r){const i=e[this.attributeName];let a;return Number.isNaN(Number.parseInt(i,10))||i.includes(".")?Number.isNaN(Number.parseFloat(i))||(a=`${n.Util.XSD}double`):a=`${n.Util.XSD}integer`,t.dataFactory.literal(i,a&&t.dataFactory.namedNode(a))}}},95377:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemPropertyHandlerTime=void 0;const n=r(60004);class i{canHandle(e,t){return"time"===e&&"datetime"in t}getObject(e,t,r){const a=e.datetime;let o;for(const e of i.TIME_REGEXES)if(e.regex.test(a)){o=t.dataFactory.namedNode(n.Util.XSD+e.type);break}return t.dataFactory.literal(a,o)}}t.ItemPropertyHandlerTime=i,i.TIME_REGEXES=[{regex:/^-?P(\d+Y)?(\d+M)?(\d+D)?(T(\d+H)?(\d+M)?(\d+(\.\d)?S)?)?$/u,type:"duration"},{regex:/^\d+-\d\d-\d\dT\d\d:\d\d:\d\d((Z?)|([+-]\d\d:\d\d))$/u,type:"dateTime"},{regex:/^\d+-\d\d-\d\dZ?$/u,type:"date"},{regex:/^\d\d:\d\d:\d\d((Z?)|([+-]\d\d:\d\d))$/u,type:"time"},{regex:/^\d+-\d\d$/u,type:"gYearMonth"},{regex:/^\d+$/u,type:"gYear"}]},73039:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemPropertyHandlerUrl=void 0;const n=r(80441);t.ItemPropertyHandlerUrl=class{constructor(e,t){this.tagName=e,this.attributeName=t}canHandle(e,t){return this.tagName===e&&this.attributeName in t}getObject(e,t,r){return t.dataFactory.namedNode((0,n.resolve)(e[this.attributeName],t.baseIRI))}}},80441:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(47589),t)},47589:(e,t)=>{"use strict";function r(e){const t=[];let r=0;for(;re.join(""))).join("/")}function n(e,t){let n=t+1;t>=0?"/"===e[t+1]&&"/"===e[t+2]&&(n=t+3):"/"===e[0]&&"/"===e[1]&&(n=2);const i=e.indexOf("/",n);return i<0?e:e.substr(0,i)+r(e.substr(i))}function i(e){return!e||"#"===e||"?"===e||"/"===e}Object.defineProperty(t,"__esModule",{value:!0}),t.removeDotSegmentsOfPath=t.removeDotSegments=t.resolve=void 0,t.resolve=function(e,t){const i=(t=t||"").indexOf("#");if(i>0&&(t=t.substr(0,i)),!e.length){if(t.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);return t}if(e.startsWith("?")){const r=t.indexOf("?");return r>0&&(t=t.substr(0,r)),t+e}if(e.startsWith("#"))return t+e;if(!t.length){const t=e.indexOf(":");if(t<0)throw new Error(`Found invalid relative IRI '${e}' for a missing baseIRI`);return n(e,t)}const a=e.indexOf(":");if(a>=0)return n(e,a);const o=t.indexOf(":");if(o<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);const s=t.substr(0,o+1);if(0===e.indexOf("//"))return s+n(e,a);let c;if(t.indexOf("//",o)===o+1){if(c=t.indexOf("/",o+3),c<0)return t.length>o+3?t+"/"+n(e,a):s+n(e,a)}else if(c=t.indexOf("/",o+1),c<0)return s+n(e,a);if(0===e.indexOf("/"))return t.substr(0,c)+r(e);let u=t.substr(c);const l=u.lastIndexOf("/");return l>=0&&l{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfParseHtmlRdfa=void 0;const n=r(70914),i=r(72407),a=r(97356),o=r(86453);class s extends n.ActorRdfParseHtml{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=e.headers?e.headers.get("content-type"):null,n=(e.headers&&e.headers.get("content-language"))??void 0,a=r&&r.includes("xml")?"xhtml":"html",s=new o.RdfaParser({dataFactory:t,baseIRI:e.baseIRI,profile:a,language:n});s.on("error",e.error),s.on("data",e.emit);const c=s.onEnd;return s.onEnd=()=>{c.call(s),e.end()},{htmlParseListener:s}}}t.ActorRdfParseHtmlRdfa=s},37085:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(89561),t)},86453:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(14726),t),i(r(92236),t),i(r(44887),t),i(r(97633),t),i(r(28669),t),i(r(1341),t)},14726:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},92236:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},44887:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},97633:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RdfaParser=void 0;const n=r(15482),i=r(58521),a=r(47916),o=r(22436),s=r(28669),c=r(1341);class u extends i.Transform{constructor(e){super({readableObjectMode:!0}),this.activeTagStack=[],e=e||{},this.options=e,this.util=new c.Util(e.dataFactory,e.baseIRI),this.defaultGraph=e.defaultGraph||this.util.dataFactory.defaultGraph();const t=e.contentType?c.Util.contentTypeToProfile(e.contentType):e.profile||"";this.features=e.features||s.RDFA_FEATURES[t],this.htmlParseListener=e.htmlParseListener,this.rdfaPatterns=this.features.copyRdfaPatterns?{}:null,this.pendingRdfaPatternCopies=this.features.copyRdfaPatterns?{}:null,this.parser=this.initializeParser("xml"===t),this.activeTagStack.push({incompleteTriples:[],inlist:!1,language:e.language,listMapping:{},listMappingLocal:{},name:"",prefixesAll:Object.assign(Object.assign({},o["@context"]),this.features.xhtmlInitialContext?a["@context"]:{}),prefixesCustom:{},skipElement:!1,vocab:e.vocab})}import(e){const t=new i.PassThrough({readableObjectMode:!0});e.on("error",(e=>r.emit("error",e))),e.on("data",(e=>t.push(e))),e.on("end",(()=>t.push(null)));const r=t.pipe(new u(this.options));return r}_transform(e,t,r){this.parser.write(e.toString()),r()}_flush(e){this.parser.end(),e()}onTagOpen(e,t){let r=this.activeTagStack.length-1;for(;r>0&&this.activeTagStack[r].skipElement;)r--;let n=this.activeTagStack[r];r!==this.activeTagStack.length-1&&(n=Object.assign(Object.assign({},n),{language:this.activeTagStack[this.activeTagStack.length-1].language,prefixesAll:this.activeTagStack[this.activeTagStack.length-1].prefixesAll,prefixesCustom:this.activeTagStack[this.activeTagStack.length-1].prefixesCustom,vocab:this.activeTagStack[this.activeTagStack.length-1].vocab}));const i={collectChildTags:n.collectChildTags,collectChildTagsForCurrentTag:n.collectChildTagsForCurrentTag,incompleteTriples:[],inlist:"inlist"in t,listMapping:[],listMappingLocal:n.listMapping,localBaseIRI:n.localBaseIRI,name:e,prefixesAll:null,prefixesCustom:null,skipElement:!1};if(this.activeTagStack.push(i),i.collectChildTags){for(const e of Object.keys(n.prefixesCustom).sort()){const r=n.prefixesCustom[e],i=""===e?"xmlns":"xmlns:"+e;i in t||(t[i]=r)}const r=Object.keys(t).map((e=>`${e}="${t[e]}"`)).join(" ");if(i.textWithTags=[`<${e}${r?" "+r:""}>`],this.features.skipHandlingXmlLiteralChildren)return}let a,o,s,u=!0,l=!0;if(this.features.onlyAllowUriRelRevIfProperty&&("property"in t&&"rel"in t&&(u=!1,t.rel.indexOf(":")<0&&delete t.rel),"property"in t&&"rev"in t&&(l=!1,t.rev.indexOf(":")<0&&delete t.rev)),this.features.copyRdfaPatterns){if(n.collectedPatternTag){const r={attributes:t,children:[],name:e,referenced:!1,rootPattern:!1,text:[]};return n.collectedPatternTag.children.push(r),void(i.collectedPatternTag=r)}if("rdfa:Pattern"===t.typeof)return void(i.collectedPatternTag={attributes:t,children:[],name:e,parentTag:n,referenced:!1,rootPattern:!0,text:[]});if("rdfa:copy"===t.property){const e=t.resource||t.href||t.src;return void(this.rdfaPatterns[e]?this.emitPatternCopy(n,this.rdfaPatterns[e],e):(this.pendingRdfaPatternCopies[e]||(this.pendingRdfaPatternCopies[e]=[]),this.pendingRdfaPatternCopies[e].push(n)))}}if(this.features.baseTag&&"base"===e&&t.href&&(this.util.baseIRI=this.util.getBaseIRI(t.href)),this.features.xmlBase&&t["xml:base"]&&(i.localBaseIRI=this.util.getBaseIRI(t["xml:base"])),this.features.timeTag&&"time"===e&&!t.datatype&&(i.interpretObjectAsTime=!0),"vocab"in t?t.vocab?(i.vocab=t.vocab,this.emitTriple(this.util.getBaseIriTerm(i),this.util.dataFactory.namedNode(c.Util.RDFA+"usesVocabulary"),this.util.dataFactory.namedNode(i.vocab))):i.vocab=this.activeTagStack[0].vocab:i.vocab=n.vocab,i.prefixesCustom=c.Util.parsePrefixes(t,n.prefixesCustom,this.features.xmlnsPrefixMappings),i.prefixesAll=Object.keys(i.prefixesCustom).length>0?Object.assign(Object.assign({},n.prefixesAll),i.prefixesCustom):n.prefixesAll,this.features.roleAttribute&&t.role){const e=t.id?this.util.createIri("#"+t.id,i,!1,!1,!1):this.util.createBlankNode(),r=i.vocab;i.vocab="http://www.w3.org/1999/xhtml/vocab#";for(const r of this.util.createVocabIris(t.role,i,!0,!1))this.emitTriple(e,this.util.dataFactory.namedNode("http://www.w3.org/1999/xhtml/vocab#role"),r);i.vocab=r}"xml:lang"in t||this.features.langAttribute&&"lang"in t?i.language=t["xml:lang"]||t.lang:i.language=n.language;const d=2===this.activeTagStack.length;if("rel"in t||"rev"in t?("about"in t?(a=this.util.createIri(t.about,i,!1,!0,!0),i.explicitNewSubject=!!a,"typeof"in t&&(s=a)):d?a=!0:n.object&&(a=n.object),"resource"in t&&(o=this.util.createIri(t.resource,i,!1,!0,!0)),o||("href"in t||"src"in t?o=this.util.createIri(t.href||t.src,i,!1,!1,!0):!("typeof"in t)||"about"in t||this.isInheritSubjectInHeadBody(e)||(o=this.util.createBlankNode())),"typeof"in t&&!("about"in t)&&(s=this.isInheritSubjectInHeadBody(e)?a:o)):!("property"in t)||"content"in t||"datatype"in t?(("about"in t||"resource"in t)&&(a=this.util.createIri(t.about||t.resource,i,!1,!0,!0),i.explicitNewSubject=!!a),a||!("href"in t)&&!("src"in t)||(a=this.util.createIri(t.href||t.src,i,!1,!1,!0),i.explicitNewSubject=!!a),a||(d?a=!0:this.isInheritSubjectInHeadBody(e)?a=n.object:"typeof"in t?(a=this.util.createBlankNode(),i.explicitNewSubject=!0):n.object&&(a=n.object,"property"in t||(i.skipElement=!0))),"typeof"in t&&(s=a)):("about"in t?(a=this.util.createIri(t.about,i,!1,!0,!0),i.explicitNewSubject=!!a):d?a=!0:n.object&&(a=n.object),"typeof"in t&&("about"in t&&(s=this.util.createIri(t.about,i,!1,!0,!0)),!s&&d&&(s=!0),!s&&"resource"in t&&(s=this.util.createIri(t.resource,i,!1,!0,!0)),s||!("href"in t)&&!("src"in t)||(s=this.util.createIri(t.href||t.src,i,!1,!1,!0)),!s&&this.isInheritSubjectInHeadBody(e)&&(s=a),s||(s=this.util.createBlankNode()),o=s)),s)for(const e of this.util.createVocabIris(t.typeof,i,!0,!0))this.emitTriple(this.util.getResourceOrBaseIri(s,i),this.util.dataFactory.namedNode(c.Util.RDF+"type"),e);if(a&&(i.listMapping={}),o){if("rel"in t&&"inlist"in t)for(const e of this.util.createVocabIris(t.rel,i,u,!1))this.addListMapping(i,a,e,o);if(!("rel"in t)||!("inlist"in t)){if("rel"in t)for(const e of this.util.createVocabIris(t.rel,i,u,!1))this.emitTriple(this.util.getResourceOrBaseIri(a,i),e,this.util.getResourceOrBaseIri(o,i));if("rev"in t)for(const e of this.util.createVocabIris(t.rev,i,l,!1))this.emitTriple(this.util.getResourceOrBaseIri(o,i),e,this.util.getResourceOrBaseIri(a,i))}}if(!o){if("rel"in t)if("inlist"in t)for(const e of this.util.createVocabIris(t.rel,i,u,!1))this.addListMapping(i,a,e,null),i.incompleteTriples.push({predicate:e,reverse:!1,list:!0});else for(const e of this.util.createVocabIris(t.rel,i,u,!1))i.incompleteTriples.push({predicate:e,reverse:!1});if("rev"in t)for(const e of this.util.createVocabIris(t.rev,i,l,!1))i.incompleteTriples.push({predicate:e,reverse:!0});i.incompleteTriples.length>0&&(o=this.util.createBlankNode())}if("property"in t){let e;if(i.predicates=this.util.createVocabIris(t.property,i,!0,!1),"datatype"in t?(i.datatype=this.util.createIri(t.datatype,i,!0,!0,!1),i.datatype&&(i.datatype.value===c.Util.RDF+"XMLLiteral"||this.features.htmlDatatype&&i.datatype.value===c.Util.RDF+"HTML")&&(i.collectChildTags=!0,i.collectChildTagsForCurrentTag=!0)):("rev"in t||"rel"in t||"content"in t||("resource"in t&&(e=this.util.createIri(t.resource,i,!1,!0,!0)),!e&&"href"in t&&(e=this.util.createIri(t.href,i,!1,!1,!0)),!e&&"src"in t&&(e=this.util.createIri(t.src,i,!1,!1,!0))),"typeof"in t&&!("about"in t)&&(e=s)),"datatype"in t&&""!==t.datatype||(i.collectChildTagsForCurrentTag=!1),"content"in t){const e=this.util.createLiteral(t.content,i);if("inlist"in t)for(const t of i.predicates)this.addListMapping(i,a,t,e);else{const t=this.util.getResourceOrBaseIri(a,i);for(const r of i.predicates)this.emitTriple(t,r,e)}i.predicates=null}else if(this.features.datetimeAttribute&&"datetime"in t){i.interpretObjectAsTime=!0;const e=this.util.createLiteral(t.datetime,i);if("inlist"in t)for(const t of i.predicates)this.addListMapping(i,a,t,e);else{const t=this.util.getResourceOrBaseIri(a,i);for(const r of i.predicates)this.emitTriple(t,r,e)}i.predicates=null}else if(e){const r=this.util.getResourceOrBaseIri(e,i);if("inlist"in t)for(const e of i.predicates)this.addListMapping(i,a,e,r);else{const e=this.util.getResourceOrBaseIri(a,i);for(const t of i.predicates)this.emitTriple(e,t,r)}i.predicates=null}}let p=!1;if(!i.skipElement&&a&&n.incompleteTriples.length>0){p=!0;const e=this.util.getResourceOrBaseIri(n.subject,i),t=this.util.getResourceOrBaseIri(a,i);for(const r of n.incompleteTriples)if(r.reverse)this.emitTriple(t,r.predicate,e);else if(r.list){let e=null;for(let t=this.activeTagStack.length-1;t>=0;t--)if(this.activeTagStack[t].inlist){e=this.activeTagStack[t];break}this.addListMapping(e,a,r.predicate,t)}else this.emitTriple(e,r.predicate,t)}!p&&n.incompleteTriples.length>0&&(i.incompleteTriples=i.incompleteTriples.concat(n.incompleteTriples)),i.subject=a||n.subject,i.object=o||a}onText(e){const t=this.activeTagStack[this.activeTagStack.length-1];this.features.copyRdfaPatterns&&t.collectedPatternTag?t.collectedPatternTag.text.push(e):(t.textWithTags||(t.textWithTags=[]),t.textWithoutTags||(t.textWithoutTags=[]),t.textWithTags.push(e),t.textWithoutTags.push(e))}onTagClose(){const e=this.activeTagStack[this.activeTagStack.length-1],t=this.activeTagStack[this.activeTagStack.length-2];if(!(e.collectChildTags&&t.collectChildTags&&this.features.skipHandlingXmlLiteralChildren)){if(this.features.copyRdfaPatterns&&e.collectedPatternTag&&e.collectedPatternTag.rootPattern){const t=e.collectedPatternTag.attributes.resource;if(delete e.collectedPatternTag.attributes.resource,delete e.collectedPatternTag.attributes.typeof,this.rdfaPatterns[t]=e.collectedPatternTag,this.pendingRdfaPatternCopies[t]){for(const r of this.pendingRdfaPatternCopies[t])this.emitPatternCopy(r,e.collectedPatternTag,t);delete this.pendingRdfaPatternCopies[t]}return void this.activeTagStack.pop()}if(e.predicates){const r=this.util.getResourceOrBaseIri(e.subject,e);let n;e.collectChildTagsForCurrentTag?(n=e.textWithTags||[],e.collectChildTags&&t.collectChildTags&&(n=n.slice(1))):n=e.textWithoutTags||[];const i=this.util.createLiteral(n.join(""),e);if(e.inlist)for(const t of e.predicates)this.addListMapping(e,r,t,i);else for(const t of e.predicates)this.emitTriple(r,t,i);t.predicates||(e.textWithoutTags=null,e.textWithTags=null)}if(e.object&&Object.keys(e.listMapping).length>0){const t=this.util.getResourceOrBaseIri(e.object,e);for(const r in e.listMapping){const n=this.util.dataFactory.namedNode(r),i=e.listMapping[r];if(i.length>0){const r=i.map((()=>this.util.createBlankNode()));for(let t=0;t`),e.textWithTags&&t&&(t.textWithTags?t.textWithTags=t.textWithTags.concat(e.textWithTags):t.textWithTags=e.textWithTags),e.textWithoutTags&&t&&(t.textWithoutTags?t.textWithoutTags=t.textWithoutTags.concat(e.textWithoutTags):t.textWithoutTags=e.textWithoutTags)}onEnd(){if(this.features.copyRdfaPatterns){this.features.copyRdfaPatterns=!1;for(const e in this.rdfaPatterns){const t=this.rdfaPatterns[e];t.referenced||(t.attributes.typeof="rdfa:Pattern",t.attributes.resource=e,this.emitPatternCopy(t.parentTag,t,e),t.referenced=!1,delete t.attributes.typeof,delete t.attributes.resource)}for(const e in this.pendingRdfaPatternCopies)for(const t of this.pendingRdfaPatternCopies[e])this.activeTagStack.push(t),this.onTagOpen("link",{property:"rdfa:copy",href:e}),this.onTagClose(),this.activeTagStack.pop();this.features.copyRdfaPatterns=!0}}isInheritSubjectInHeadBody(e){return this.features.inheritSubjectInHeadBody&&("head"===e||"body"===e)}addListMapping(e,t,r,n){if(e.explicitNewSubject){const i=this.util.createBlankNode();this.emitTriple(this.util.getResourceOrBaseIri(t,e),r,i),this.emitTriple(i,this.util.dataFactory.namedNode(c.Util.RDF+"first"),this.util.getResourceOrBaseIri(n,e)),this.emitTriple(i,this.util.dataFactory.namedNode(c.Util.RDF+"rest"),this.util.dataFactory.namedNode(c.Util.RDF+"nil"))}else{let t=e.listMappingLocal[r.value];t||(e.listMappingLocal[r.value]=t=[]),n&&t.push(n)}}emitTriple(e,t,r){"NamedNode"===e.termType&&e.value.indexOf(":")<0||"NamedNode"===t.termType&&t.value.indexOf(":")<0||"NamedNode"===r.termType&&r.value.indexOf(":")<0||this.push(this.util.dataFactory.quad(e,t,r,this.defaultGraph))}emitPatternCopy(e,t,r){if(this.activeTagStack.push(e),t.referenced=!0,t.constructedBlankNodes){let e=0;this.util.blankNodeFactory=()=>t.constructedBlankNodes[e++]}else t.constructedBlankNodes=[],this.util.blankNodeFactory=()=>{const e=this.util.dataFactory.blankNode();return t.constructedBlankNodes.push(e),e};this.emitPatternCopyAbsolute(t,!0,r),this.util.blankNodeFactory=null,this.activeTagStack.pop()}emitPatternCopyAbsolute(e,t,r){if(t||"rdfa:copy"!==e.attributes.property||e.attributes.href!==r){this.onTagOpen(e.name,e.attributes);for(const t of e.text)this.onText(t);for(const t of e.children)this.emitPatternCopyAbsolute(t,!1,r);this.onTagClose()}}initializeParser(e){return new n.Parser({onclosetag:()=>{try{this.onTagClose(),this.htmlParseListener&&this.htmlParseListener.onTagClose()}catch(e){this.emit("error",e)}},onend:()=>{try{this.onEnd(),this.htmlParseListener&&this.htmlParseListener.onEnd()}catch(e){this.emit("error",e)}},onopentag:(e,t)=>{try{this.onTagOpen(e,t),this.htmlParseListener&&this.htmlParseListener.onTagOpen(e,t)}catch(e){this.emit("error",e)}},ontext:e=>{try{this.onText(e),this.htmlParseListener&&this.htmlParseListener.onText(e)}catch(e){this.emit("error",e)}}},{decodeEntities:!0,recognizeSelfClosing:!0,xmlMode:e})}}t.RdfaParser=u},28669:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RDFA_CONTENTTYPES=t.RDFA_FEATURES=void 0,t.RDFA_FEATURES={"":{baseTag:!0,xmlBase:!0,langAttribute:!0,onlyAllowUriRelRevIfProperty:!0,inheritSubjectInHeadBody:!0,datetimeAttribute:!0,timeTag:!0,htmlDatatype:!0,copyRdfaPatterns:!0,xmlnsPrefixMappings:!0,xhtmlInitialContext:!0,roleAttribute:!0},core:{baseTag:!1,xmlBase:!1,langAttribute:!0,onlyAllowUriRelRevIfProperty:!0,inheritSubjectInHeadBody:!1,datetimeAttribute:!1,timeTag:!1,htmlDatatype:!1,copyRdfaPatterns:!0,xmlnsPrefixMappings:!0,xhtmlInitialContext:!1,roleAttribute:!1},html:{baseTag:!0,xmlBase:!1,langAttribute:!0,onlyAllowUriRelRevIfProperty:!0,inheritSubjectInHeadBody:!0,datetimeAttribute:!0,timeTag:!0,htmlDatatype:!0,copyRdfaPatterns:!0,xmlnsPrefixMappings:!0,xhtmlInitialContext:!1,roleAttribute:!0},xhtml:{baseTag:!0,xmlBase:!1,langAttribute:!0,onlyAllowUriRelRevIfProperty:!0,inheritSubjectInHeadBody:!0,datetimeAttribute:!0,timeTag:!0,htmlDatatype:!0,copyRdfaPatterns:!0,xmlnsPrefixMappings:!0,xhtmlInitialContext:!0,roleAttribute:!0},xml:{baseTag:!1,xmlBase:!0,langAttribute:!0,onlyAllowUriRelRevIfProperty:!1,inheritSubjectInHeadBody:!1,datetimeAttribute:!0,timeTag:!0,htmlDatatype:!1,copyRdfaPatterns:!1,xmlnsPrefixMappings:!0,xhtmlInitialContext:!1,roleAttribute:!0}},t.RDFA_CONTENTTYPES={"text/html":"html","application/xhtml+xml":"xhtml","application/xml":"xml","text/xml":"xml","image/svg+xml":"xml"}},1341:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=void 0;const n=r(47318),i=r(28669),a=r(18050);class o{constructor(e,t){this.dataFactory=e||new a.DataFactory,this.baseIRI=this.dataFactory.namedNode(t||""),this.baseIRIDocument=this.baseIRI}static parsePrefixes(e,t,r){const n={};if(r)for(const t in e)t.startsWith("xmlns")&&(n[t.substr(6)]=e[t]);if(e.prefix||Object.keys(n).length>0){const r=Object.assign(Object.assign({},t),n);if(e.prefix){let t;for(;t=o.PREFIX_REGEX.exec(e.prefix);)r[t[1]]=t[2]}return r}return t}static expandPrefixedTerm(e,t){const r=e.indexOf(":");let n,i;if(r>=0&&(n=e.substr(0,r),i=e.substr(r+1)),""===n)return"http://www.w3.org/1999/xhtml/vocab#"+i;if(n){const e=t.prefixesAll[n];if(e)return e+i}if(e){const r=t.prefixesAll[e.toLocaleLowerCase()];if(r)return r}return e}static isValidIri(e){return o.IRI_REGEX.test(e)}static contentTypeToProfile(e){return i.RDFA_CONTENTTYPES[e]||""}getBaseIRI(e){let t=e;const r=t.indexOf("#");return r>=0&&(t=t.substr(0,r)),this.dataFactory.namedNode((0,n.resolve)(t,this.baseIRI.value))}getResourceOrBaseIri(e,t){return!0===e?this.getBaseIriTerm(t):e}getBaseIriTerm(e){return e.localBaseIRI||this.baseIRI}createVocabIris(e,t,r,n){return e.split(/\s+/).filter((e=>e&&(r||e.indexOf(":")>=0))).map((e=>this.createIri(e,t,!0,!0,n))).filter((e=>null!=e))}createLiteral(e,t){var r;if(t.interpretObjectAsTime&&!t.datatype)for(const r of o.TIME_REGEXES)if(e.match(r.regex)){t.datatype=this.dataFactory.namedNode(o.XSD+r.type);break}return this.dataFactory.literal(e,t.datatype||(null===(r=t.language)||void 0===r?void 0:r.toLowerCase()))}createBlankNode(){return this.blankNodeFactory?this.blankNodeFactory():this.dataFactory.blankNode()}createIri(e,t,r,i,a){if(e=e||"",!i)return r||(e=(0,n.resolve)(e,this.getBaseIriTerm(t).value)),o.isValidIri(e)?this.dataFactory.namedNode(e):null;if(e.length>0&&"["===e[0]&&"]"===e[e.length-1]&&(e=e.substr(1,e.length-2)).indexOf(":")<0)return null;if(e.startsWith("_:"))return a?this.dataFactory.blankNode(e.substr(2)||"b_identity"):null;if(r&&t.vocab&&e.indexOf(":")<0)return this.dataFactory.namedNode(t.vocab+e);let s=o.expandPrefixedTerm(e,t);return r?e!==s&&(s=(0,n.resolve)(s,this.baseIRIDocument.value)):s=(0,n.resolve)(s,this.getBaseIriTerm(t).value),o.isValidIri(s)?this.dataFactory.namedNode(s):null}}t.Util=o,o.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",o.XSD="http://www.w3.org/2001/XMLSchema#",o.RDFA="http://www.w3.org/ns/rdfa#",o.PREFIX_REGEX=/\s*([^:\s]*)*:\s*([^\s]*)*\s*/g,o.TIME_REGEXES=[{regex:/^-?P([0-9]+Y)?([0-9]+M)?([0-9]+D)?(T([0-9]+H)?([0-9]+M)?([0-9]+(\.[0-9])?S)?)?$/,type:"duration"},{regex:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,type:"dateTime"},{regex:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,type:"date"},{regex:/^[0-9][0-9]:[0-9][0-9]:[0-9][0-9]((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,type:"time"},{regex:/^[0-9]+-[0-9][0-9]$/,type:"gYearMonth"},{regex:/^[0-9]+$/,type:"gYear"}],o.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^ "<>{}|\\\[\]`]*$/},47318:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(70534),t)},70534:(e,t)=>{"use strict";function r(e){const t=[];let r=0;for(;re.join(""))).join("/")}function n(e,t){let n=t+1;t>=0?"/"===e[t+1]&&"/"===e[t+2]&&(n=t+3):"/"===e[0]&&"/"===e[1]&&(n=2);const i=e.indexOf("/",n);return i<0?e:e.substr(0,i)+r(e.substr(i))}function i(e){return!e||"#"===e||"?"===e||"/"===e}Object.defineProperty(t,"__esModule",{value:!0}),t.removeDotSegmentsOfPath=t.removeDotSegments=t.resolve=void 0,t.resolve=function(e,t){const i=(t=t||"").indexOf("#");if(i>0&&(t=t.substr(0,i)),!e.length){if(t.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);return t}if(e.startsWith("?")){const r=t.indexOf("?");return r>0&&(t=t.substr(0,r)),t+e}if(e.startsWith("#"))return t+e;if(!t.length){const t=e.indexOf(":");if(t<0)throw new Error(`Found invalid relative IRI '${e}' for a missing baseIRI`);return n(e,t)}const a=e.indexOf(":");if(a>=0)return n(e,a);const o=t.indexOf(":");if(o<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);const s=t.substr(0,o+1);if(0===e.indexOf("//"))return s+n(e,a);let c;if(t.indexOf("//",o)===o+1){if(c=t.indexOf("/",o+3),c<0)return t.length>o+3?t+"/"+n(e,a):s+n(e,a)}else if(c=t.indexOf("/",o+1),c<0)return s+n(e,a);if(0===e.indexOf("/"))return t.substr(0,c)+r(e);let u=t.substr(c);const l=u.lastIndexOf("/");return l>=0&&l{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfParseHtmlScript=void 0;const n=r(70914),i=r(97356),a=r(42639);class o extends n.ActorRdfParseHtml{mediatorRdfParseMediatypes;mediatorRdfParseHandle;constructor(e){super(e),this.mediatorRdfParseMediatypes=e.mediatorRdfParseMediatypes,this.mediatorRdfParseHandle=e.mediatorRdfParseHandle}async test(e){return(0,i.passTestVoid)()}async run(e){const t=(await this.mediatorRdfParseMediatypes.mediate({context:e.context,mediaTypes:!0})).mediaTypes;return{htmlParseListener:new a.HtmlScriptListener(this.mediatorRdfParseHandle,e.emit,e.error,e.end,t,e.context,e.baseIRI,e.headers)}}}t.ActorRdfParseHtmlScript=o},42639:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HtmlScriptListener=void 0;const n=r(72407),i=r(58521),a=r(9929);class o{mediatorRdfParseHandle;cbQuad;cbError;cbEnd;supportedTypes;context;baseIRI;headers;onlyFirstScript;targetScriptId;handleMediaType;textChunks;textChunksJsonLd=[];endBarrier=1;passedScripts=0;isFinalJsonLdProcessing=!1;constructor(e,t,r,i,a,o,s,c){this.mediatorRdfParseHandle=e,this.cbQuad=t,this.cbError=r,this.cbEnd=i,this.supportedTypes=a,this.context=o.set(n.KeysRdfParseHtmlScript.processingHtmlScript,!0),this.baseIRI=s,this.headers=c,this.onlyFirstScript=!1===o.get(n.KeysRdfParseHtmlScript.extractAllScripts);const u=this.baseIRI.indexOf("#");this.targetScriptId=u>0?this.baseIRI.slice(u+1,this.baseIRI.length):null}static newErrorCoded(e,t){const r=new Error(e);return r.code=t,r}onEnd(){0==--this.endBarrier&&(this.textChunksJsonLd.length>0?(this.handleMediaType="application/ld+json",this.textChunks=this.textChunksJsonLd,this.textChunks.push("]"),this.textChunksJsonLd=[],this.isFinalJsonLdProcessing=!0,this.endBarrier++,this.onTagClose()):(0===this.passedScripts&&this.targetScriptId&&this.cbError(o.newErrorCoded(`Failed to find targeted script id "${this.targetScriptId}"`,"loading document failed")),this.cbEnd()),this.isFinalJsonLdProcessing=!1)}onTagClose(){if(this.handleMediaType)if(this.requiresCustomJsonLdHandling(this.handleMediaType)&&!this.isFinalJsonLdProcessing)this.handleMediaType=void 0,this.textChunks=void 0,this.onEnd();else{const e=new i.Readable({objectMode:!0});e._read=()=>{};const t=this.textChunks,r={context:this.context,handle:{metadata:{baseIRI:this.baseIRI},data:e,headers:this.headers,context:this.context},handleMediaType:this.handleMediaType};this.mediatorRdfParseHandle.mediate(r).then((({handle:r})=>{r.data.on("error",(e=>this.cbError(o.newErrorCoded(e.message,"invalid script element")))).on("data",this.cbQuad).on("end",(()=>this.onEnd()));for(const r of t)e.push(r);e.push(null)})).catch((e=>{this.targetScriptId?this.cbError(o.newErrorCoded(e.message,"loading document failed")):this.onEnd()})),this.handleMediaType=void 0,this.textChunks=void 0}}onTagOpen(e,t){"base"===e&&t.href&&(this.baseIRI=(0,a.resolve)(t.href,this.baseIRI)),"script"!==e||this.targetScriptId&&t.id!==this.targetScriptId?this.handleMediaType=void 0:this.supportedTypes[t.type]?this.onlyFirstScript&&this.passedScripts>0?this.handleMediaType=void 0:(this.passedScripts++,this.handleMediaType=t.type,this.endBarrier++,this.requiresCustomJsonLdHandling(this.handleMediaType)?(this.textChunks=this.textChunksJsonLd,this.textChunks.push(0===this.textChunks.length?"[":",")):this.textChunks=[]):this.targetScriptId&&this.cbError(o.newErrorCoded(`Targeted script "${this.targetScriptId}" does not have a supported type`,"loading document failed"))}onText(e){this.handleMediaType&&this.textChunks.push(e)}requiresCustomJsonLdHandling(e){return!this.onlyFirstScript&&!this.targetScriptId&&"application/ld+json"===e}}t.HtmlScriptListener=o},54454:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(20581),t)},34204:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfParseHtml=void 0;const n=r(55252),i=r(128),a=r(58521);class o extends n.ActorRdfParseFixedMediaTypes{busRdfParseHtml;constructor(e){super(e),this.busRdfParseHtml=e.busRdfParseHtml}async runHandle(e,t,r){const n=new a.Readable({objectMode:!0});n._read=()=>{};let o=0,s=1;function c(e){n.emit("error",e)}function u(){0==--s&&n.push(null)}const l={baseIRI:e.metadata?.baseIRI??"",context:r,emit:e=>{o--,n.push(e)},end:u,error:c,headers:e.headers};try{const t=await Promise.all(this.busRdfParseHtml.publish(l));s+=t.length;const r=[];for(const e of t){const{htmlParseListener:t}=await e.actor.run(l,void 0);r.push(t)}const a=new i.Parser({onclosetag(){try{for(const e of r)e.onTagClose()}catch(e){c(e)}},onend(){try{for(const e of r)e.onEnd()}catch(e){c(e)}u()},onopentag(e,t){try{for(const n of r)n.onTagOpen(e,t)}catch(e){c(e)}},ontext(e){try{for(const t of r)t.onText(e)}catch(e){c(e)}}},{decodeEntities:!0,recognizeSelfClosing:!0,xmlMode:!1}),d=n._read=t=>{for(o=Math.max(t,o);o>0;){const t=e.data.read();if(null===t)return void e.data.once("readable",(()=>d(0)));a.write(t.toString())}};e.data.on("error",c).on("end",(()=>a.end()))}catch(e){setTimeout((()=>{n.emit("error",e)}))}return{data:n}}}t.ActorRdfParseHtml=o},83983:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(34204),t)},64159:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFeed=function(e){var t=c(d,e);return t?"feed"===t.name?function(e){var t,r=e.children,n={type:"atom",items:(0,i.getElementsByTagName)("entry",r).map((function(e){var t,r=e.children,n={media:s(r)};l(n,"id","id",r),l(n,"title","title",r);var i=null===(t=c("link",r))||void 0===t?void 0:t.attribs.href;i&&(n.link=i);var a=u("summary",r)||u("content",r);a&&(n.description=a);var o=u("updated",r);return o&&(n.pubDate=new Date(o)),n}))};l(n,"id","id",r),l(n,"title","title",r);var a=null===(t=c("link",r))||void 0===t?void 0:t.attribs.href;a&&(n.link=a),l(n,"description","subtitle",r);var o=u("updated",r);return o&&(n.updated=new Date(o)),l(n,"author","email",r,!0),n}(t):function(e){var t,r,n=null!==(r=null===(t=c("channel",e.children))||void 0===t?void 0:t.children)&&void 0!==r?r:[],a={type:e.name.substr(0,3),id:"",items:(0,i.getElementsByTagName)("item",e.children).map((function(e){var t=e.children,r={media:s(t)};l(r,"id","guid",t),l(r,"title","title",t),l(r,"link","link",t),l(r,"description","description",t);var n=u("pubDate",t)||u("dc:date",t);return n&&(r.pubDate=new Date(n)),r}))};l(a,"title","title",n),l(a,"link","link",n),l(a,"description","description",n);var o=u("lastBuildDate",n);return o&&(a.updated=new Date(o)),l(a,"author","managingEditor",n,!0),a}(t):null};var n=r(79579),i=r(11391),a=["url","type","lang"],o=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function s(e){return(0,i.getElementsByTagName)("media:content",e).map((function(e){for(var t=e.attribs,r={medium:t.medium,isDefault:!!t.isDefault},n=0,i=a;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentPosition=void 0,t.removeSubsets=function(e){for(var t=e.length;--t>=0;){var r=e[t];if(t>0&&e.lastIndexOf(r,t-1)>=0)e.splice(t,1);else for(var n=r.parent;n;n=n.parent)if(e.includes(n)){e.splice(t,1);break}}return e},t.compareDocumentPosition=a,t.uniqueSort=function(e){return(e=e.filter((function(e,t,r){return!r.includes(e,t+1)}))).sort((function(e,t){var r=a(e,t);return r&n.PRECEDING?-1:r&n.FOLLOWING?1:0})),e};var n,i=r(21138);function a(e,t){var r=[],a=[];if(e===t)return 0;for(var o=(0,i.hasChildren)(e)?e:e.parent;o;)r.unshift(o),o=o.parent;for(o=(0,i.hasChildren)(t)?t:t.parent;o;)a.unshift(o),o=o.parent;for(var s=Math.min(r.length,a.length),c=0;cl.indexOf(p)?u===t?n.FOLLOWING|n.CONTAINED_BY:n.FOLLOWING:u===e?n.PRECEDING|n.CONTAINS:n.PRECEDING}!function(e){e[e.DISCONNECTED=1]="DISCONNECTED",e[e.PRECEDING=2]="PRECEDING",e[e.FOLLOWING=4]="FOLLOWING",e[e.CONTAINS=8]="CONTAINS",e[e.CONTAINED_BY=16]="CONTAINED_BY"}(n||(t.DocumentPosition=n={}))},20806:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.hasChildren=t.isDocument=t.isComment=t.isText=t.isCDATA=t.isTag=void 0,i(r(79579),t),i(r(57916),t),i(r(80453),t),i(r(22224),t),i(r(11391),t),i(r(16855),t),i(r(64159),t);var a=r(21138);Object.defineProperty(t,"isTag",{enumerable:!0,get:function(){return a.isTag}}),Object.defineProperty(t,"isCDATA",{enumerable:!0,get:function(){return a.isCDATA}}),Object.defineProperty(t,"isText",{enumerable:!0,get:function(){return a.isText}}),Object.defineProperty(t,"isComment",{enumerable:!0,get:function(){return a.isComment}}),Object.defineProperty(t,"isDocument",{enumerable:!0,get:function(){return a.isDocument}}),Object.defineProperty(t,"hasChildren",{enumerable:!0,get:function(){return a.hasChildren}})},11391:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testElement=function(e,t){var r=c(e);return!r||r(t)},t.getElements=function(e,t,r,n){void 0===n&&(n=1/0);var a=c(e);return a?(0,i.filter)(a,t,r,n):[]},t.getElementById=function(e,t,r){return void 0===r&&(r=!0),Array.isArray(t)||(t=[t]),(0,i.findOne)(o("id",e),t,r)},t.getElementsByTagName=function(e,t,r,n){return void 0===r&&(r=!0),void 0===n&&(n=1/0),(0,i.filter)(a.tag_name(e),t,r,n)},t.getElementsByClassName=function(e,t,r,n){return void 0===r&&(r=!0),void 0===n&&(n=1/0),(0,i.filter)(o("class",e),t,r,n)},t.getElementsByTagType=function(e,t,r,n){return void 0===r&&(r=!0),void 0===n&&(n=1/0),(0,i.filter)(a.tag_type(e),t,r,n)};var n=r(21138),i=r(22224),a={tag_name:function(e){return"function"==typeof e?function(t){return(0,n.isTag)(t)&&e(t.name)}:"*"===e?n.isTag:function(t){return(0,n.isTag)(t)&&t.name===e}},tag_type:function(e){return"function"==typeof e?function(t){return e(t.type)}:function(t){return t.type===e}},tag_contains:function(e){return"function"==typeof e?function(t){return(0,n.isText)(t)&&e(t.data)}:function(t){return(0,n.isText)(t)&&t.data===e}}};function o(e,t){return"function"==typeof t?function(r){return(0,n.isTag)(r)&&t(r.attribs[e])}:function(r){return(0,n.isTag)(r)&&r.attribs[e]===t}}function s(e,t){return function(r){return e(r)||t(r)}}function c(e){var t=Object.keys(e).map((function(t){var r=e[t];return Object.prototype.hasOwnProperty.call(a,t)?a[t](r):o(t,r)}));return 0===t.length?null:t.reduce(s)}},80453:(e,t)=>{"use strict";function r(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){var t=e.parent.children,r=t.lastIndexOf(e);r>=0&&t.splice(r,1)}e.next=null,e.prev=null,e.parent=null}Object.defineProperty(t,"__esModule",{value:!0}),t.removeElement=r,t.replaceElement=function(e,t){var r=t.prev=e.prev;r&&(r.next=t);var n=t.next=e.next;n&&(n.prev=t);var i=t.parent=e.parent;if(i){var a=i.children;a[a.lastIndexOf(e)]=t,e.parent=null}},t.appendChild=function(e,t){if(r(t),t.next=null,t.parent=e,e.children.push(t)>1){var n=e.children[e.children.length-2];n.next=t,t.prev=n}else t.prev=null},t.append=function(e,t){r(t);var n=e.parent,i=e.next;if(t.next=i,t.prev=e,e.next=t,t.parent=n,i){if(i.prev=t,n){var a=n.children;a.splice(a.lastIndexOf(i),0,t)}}else n&&n.children.push(t)},t.prependChild=function(e,t){if(r(t),t.parent=e,t.prev=null,1!==e.children.unshift(t)){var n=e.children[1];n.prev=t,t.next=n}else t.next=null},t.prepend=function(e,t){r(t);var n=e.parent;if(n){var i=n.children;i.splice(i.indexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=n,t.prev=e.prev,t.next=e,e.prev=t}},22224:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filter=function(e,t,r,n){return void 0===r&&(r=!0),void 0===n&&(n=1/0),i(e,Array.isArray(t)?t:[t],r,n)},t.find=i,t.findOneChild=function(e,t){return t.find(e)},t.findOne=function e(t,r,i){void 0===i&&(i=!0);for(var a=Array.isArray(r)?r:[r],o=0;o0)return e(t,s.children,!0)}return null},t.existsOne=function e(t,r){return(Array.isArray(r)?r:[r]).some((function(r){return(0,n.isTag)(r)&&t(r)||(0,n.hasChildren)(r)&&e(t,r.children)}))},t.findAll=function(e,t){for(var r=[],i=[Array.isArray(t)?t:[t]],a=[0];;)if(a[0]>=i[0].length){if(1===i.length)return r;i.shift(),a.shift()}else{var o=i[0][a[0]++];(0,n.isTag)(o)&&e(o)&&r.push(o),(0,n.hasChildren)(o)&&o.children.length>0&&(a.unshift(0),i.unshift(o.children))}};var n=r(21138);function i(e,t,r,i){for(var a=[],o=[Array.isArray(t)?t:[t]],s=[0];;)if(s[0]>=o[0].length){if(1===s.length)return a;o.shift(),s.shift()}else{var c=o[0][s[0]++];if(e(c)&&(a.push(c),--i<=0))return a;r&&(0,n.hasChildren)(c)&&c.children.length>0&&(s.unshift(0),o.unshift(c.children))}}},79579:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getOuterHTML=s,t.getInnerHTML=function(e,t){return(0,i.hasChildren)(e)?e.children.map((function(e){return s(e,t)})).join(""):""},t.getText=function e(t){return Array.isArray(t)?t.map(e).join(""):(0,i.isTag)(t)?"br"===t.name?"\n":e(t.children):(0,i.isCDATA)(t)?e(t.children):(0,i.isText)(t)?t.data:""},t.textContent=function e(t){return Array.isArray(t)?t.map(e).join(""):(0,i.hasChildren)(t)&&!(0,i.isComment)(t)?e(t.children):(0,i.isText)(t)?t.data:""},t.innerText=function e(t){return Array.isArray(t)?t.map(e).join(""):(0,i.hasChildren)(t)&&(t.type===o.ElementType.Tag||(0,i.isCDATA)(t))?e(t.children):(0,i.isText)(t)?t.data:""};var i=r(21138),a=n(r(5193)),o=r(93338);function s(e,t){return(0,a.default)(e,t)}},57916:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getChildren=i,t.getParent=a,t.getSiblings=function(e){var t=a(e);if(null!=t)return i(t);for(var r=[e],n=e.prev,o=e.next;null!=n;)r.unshift(n),n=n.prev;for(;null!=o;)r.push(o),o=o.next;return r},t.getAttributeValue=function(e,t){var r;return null===(r=e.attribs)||void 0===r?void 0:r[t]},t.hasAttrib=function(e,t){return null!=e.attribs&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&null!=e.attribs[t]},t.getName=function(e){return e.name},t.nextElementSibling=function(e){for(var t=e.next;null!==t&&!(0,n.isTag)(t);)t=t.next;return t},t.prevElementSibling=function(e){for(var t=e.prev;null!==t&&!(0,n.isTag)(t);)t=t.prev;return t};var n=r(21138);function i(e){return(0,n.hasChildren)(e)?e.children:[]}function a(e){return e.parent||null}},47440:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfParseJsonLd=void 0;const n=r(55252),i=r(72407),a=r(97356),o=r(50631),s=r(35069),c=r(39373);class u extends n.ActorRdfParseFixedMediaTypes{mediatorHttp;httpInvalidator;cache;constructor(e){super(e),this.mediatorHttp=e.mediatorHttp,this.httpInvalidator=e.httpInvalidator,this.cache=e.cacheSize?new s.LRUCache({max:e.cacheSize}):void 0;const t=this.cache;t&&this.httpInvalidator.addInvalidateListener((({url:e})=>e?t.delete(e):t.clear()))}async testHandle(e,t,r){return r.has(i.KeysRdfParseHtmlScript.processingHtmlScript)&&"application/ld+json"!==t?(0,a.failTest)("JSON-LD in script tags can only have media type 'application/ld+json'"):t&&(t in this.mediaTypePriorities||t.endsWith("+json"))?await this.testHandleChecked(e):(0,a.failTest)(`Unrecognized media type: ${t}`)}async runHandle(e,t,r){const n=e.context.getSafe(i.KeysInitQuery.dataFactory);return{data:o.JsonLdParser.fromHttpResponse(e.metadata?.baseIRI??"",t,e.headers,{dataFactory:n,documentLoader:r.get(i.KeysRdfParseJsonLd.documentLoader)??new c.DocumentLoaderMediated(this.mediatorHttp,r,this.cache),strictValues:r.get(i.KeysRdfParseJsonLd.strictValues),...r.get(i.KeysRdfParseJsonLd.parserOptions)}).import(e.data)}}}t.ActorRdfParseJsonLd=u},39373:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentLoaderMediated=void 0;const n=r(62034),i=r(31759),a=r(53160);class o extends a.FetchDocumentLoader{context;lastCachePolicies;cache;constructor(e,t,r,n={}){super(o.createFetcher(e,t,n)),this.context=t,this.lastCachePolicies=n,this.cache=r}static createFetcher(e,t,r){return async(a,o)=>{const s=await e.mediate({input:a,init:o,context:t});return s.cachePolicy&&(r[a]=e=>s.cachePolicy.satisfiesWithoutRevalidation({input:a,init:o,context:e})),s.json=async()=>JSON.parse(await(0,i.stringify)(n.ActorHttp.toNodeReadable(s.body))),s}}async load(e){const t=this.cache;if(t){const r=t.get(e);if(r){if(r.isStillValid&&await r.isStillValid(this.context))return r.context;t.delete(e)}}const r=await super.load(e);return this.cache?.set(e,{context:r,isStillValid:this.lastCachePolicies[e]}),r}}t.DocumentLoaderMediated=o},21972:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(47440),t),i(r(39373),t)},11592:function(e,t,r){!function(e){!function(t){var n="undefined"!=typeof globalThis&&globalThis||void 0!==e&&e||void 0!==r.g&&r.g||{},i="URLSearchParams"in n,a="Symbol"in n&&"iterator"in Symbol,o="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in n,c="ArrayBuffer"in n;if(c)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&u.indexOf(Object.prototype.toString.call(e))>-1};function d(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function p(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return a&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function y(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function m(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=m(t);return t.readAsArrayBuffer(e),r}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():c&&o&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=y(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return y(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(o)return this.blob().then(g);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,r,n,i,a=y(this);if(a)return a;if(this._bodyBlob)return e=this._bodyBlob,r=m(t=new FileReader),i=(n=/charset=([A-Za-z0-9_-]+)/.exec(e.type))?n[1]:"utf-8",t.readAsText(e,i),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n-1?i:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in n)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(a),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function O(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function w(e,t){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}T.prototype.clone=function(){return new T(this,{body:this._bodyInit})},v.call(T.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var S=[301,302,303,307,308];w.redirect=function(e,t){if(-1===S.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=n.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,r){return new Promise((function(i,a){var s=new T(e,r);if(s.signal&&s.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function l(){u.abort()}if(u.onload=function(){var e,t,r={statusText:u.statusText,headers:(e=u.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();try{t.append(n,i)}catch(e){console.warn("Response "+e.message)}}})),t)};0===s.url.indexOf("file://")&&(u.status<200||u.status>599)?r.status=200:r.status=u.status,r.url="responseURL"in u?u.responseURL:r.headers.get("X-Request-URL");var n="response"in u?u.response:u.responseText;setTimeout((function(){i(new w(n,r))}),0)},u.onerror=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)},u.ontimeout=function(){setTimeout((function(){a(new TypeError("Network request timed out"))}),0)},u.onabort=function(){setTimeout((function(){a(new t.DOMException("Aborted","AbortError"))}),0)},u.open(s.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(s.url),!0),"include"===s.credentials?u.withCredentials=!0:"omit"===s.credentials&&(u.withCredentials=!1),"responseType"in u&&(o?u.responseType="blob":c&&(u.responseType="arraybuffer")),r&&"object"==typeof r.headers&&!(r.headers instanceof f||n.Headers&&r.headers instanceof n.Headers)){var h=[];Object.getOwnPropertyNames(r.headers).forEach((function(e){h.push(d(e)),u.setRequestHeader(e,p(r.headers[e]))})),s.headers.forEach((function(e,t){-1===h.indexOf(t)&&u.setRequestHeader(t,e)}))}else s.headers.forEach((function(e,t){u.setRequestHeader(t,e)}));s.signal&&(s.signal.addEventListener("abort",l),u.onreadystatechange=function(){4===u.readyState&&s.signal.removeEventListener("abort",l)}),u.send(void 0===s._bodyInit?null:s._bodyInit)}))}E.polyfill=!0,n.fetch||(n.fetch=E,n.Headers=f,n.Request=T,n.Response=w),t.Headers=f,t.Request=T,t.Response=w,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})}({})}("undefined"!=typeof self?self:this)},53160:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(21748),t),i(r(47455),t),i(r(31278),t),i(r(52953),t),i(r(79241),t),i(r(59928),t),i(r(63750),t)},21748:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextParser=void 0,r(11592);const n=r(9929),i=r(47455),a=r(31278),o=r(59928),s=r(63750);class c{constructor(e){e=e||{},this.documentLoader=e.documentLoader||new a.FetchDocumentLoader,this.documentCache={},this.validateContext=!e.skipValidation,this.expandContentTypeToBase=!!e.expandContentTypeToBase,this.remoteContextsDepthLimit=e.remoteContextsDepthLimit||32,this.redirectSchemaOrgHttps=!("redirectSchemaOrgHttps"in e)||!!e.redirectSchemaOrgHttps}static validateLanguage(e,t,r){if("string"!=typeof e)throw new i.ErrorCoded(`The value of an '@language' must be a string, got '${JSON.stringify(e)}'`,r);if(!s.Util.REGEX_LANGUAGE_TAG.test(e)){if(t)throw new i.ErrorCoded(`The value of an '@language' must be a valid language tag, got '${JSON.stringify(e)}'`,r);return!1}return!0}static validateDirection(e,t){if("string"!=typeof e)throw new i.ErrorCoded(`The value of an '@direction' must be a string, got '${JSON.stringify(e)}'`,i.ERROR_CODES.INVALID_BASE_DIRECTION);if(!s.Util.REGEX_DIRECTION_TAG.test(e)){if(t)throw new i.ErrorCoded(`The value of an '@direction' must be 'ltr' or 'rtl', got '${JSON.stringify(e)}'`,i.ERROR_CODES.INVALID_BASE_DIRECTION);return!1}return!0}idifyReverseTerms(e){for(const t of Object.keys(e)){let r=e[t];if(r&&"object"==typeof r&&r["@reverse"]&&!r["@id"]){if("string"!=typeof r["@reverse"]||s.Util.isValidKeyword(r["@reverse"]))throw new i.ErrorCoded(`Invalid @reverse value, must be absolute IRI or blank node: '${r["@reverse"]}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);r=e[t]=Object.assign(Object.assign({},r),{"@id":r["@reverse"]}),r["@id"]=r["@reverse"],s.Util.isPotentialKeyword(r["@reverse"])?delete r["@reverse"]:r["@reverse"]=!0}}return e}expandPrefixedTerms(e,t,r){const n=e.getContextRaw();for(const a of r||Object.keys(n))if(s.Util.EXPAND_KEYS_BLACKLIST.indexOf(a)<0&&!s.Util.isReservedInternalKeyword(a)){const r=n[a];if(s.Util.isPotentialKeyword(a)&&s.Util.ALIAS_DOMAIN_BLACKLIST.indexOf(a)>=0&&("@type"!==a||"object"==typeof n[a]&&!n[a]["@protected"]&&"@set"!==n[a]["@container"]))throw new i.ErrorCoded(`Keywords can not be aliased to something else.\nTried mapping ${a} to ${JSON.stringify(r)}`,i.ERROR_CODES.KEYWORD_REDEFINITION);if(s.Util.ALIAS_RANGE_BLACKLIST.indexOf(s.Util.getContextValueId(r))>=0)throw new i.ErrorCoded(`Aliasing to certain keywords is not allowed.\nTried mapping ${a} to ${JSON.stringify(r)}`,i.ERROR_CODES.INVALID_KEYWORD_ALIAS);if(r&&s.Util.isPotentialKeyword(s.Util.getContextValueId(r))&&!0===r["@prefix"])throw new i.ErrorCoded(`Tried to use keyword aliases as prefix: '${a}': '${JSON.stringify(r)}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);for(;s.Util.isPrefixValue(n[a]);){const r=n[a];let i=!1;if("string"==typeof r)n[a]=e.expandTerm(r,!0),i=i||r!==n[a];else{const o=r["@id"],c=r["@type"],u=!("@prefix"in r)||s.Util.isValidIri(a);if("@id"in r)null!=o&&"string"==typeof o&&(n[a]=Object.assign(Object.assign({},n[a]),{"@id":e.expandTerm(o,!0)}),i=i||o!==n[a]["@id"]);else if(!s.Util.isPotentialKeyword(a)&&u){const t=e.expandTerm(a,!0);t!==a&&(n[a]=Object.assign(Object.assign({},n[a]),{"@id":t}),i=!0)}if(c&&"string"==typeof c&&"@vocab"!==c&&(!r["@container"]||!r["@container"]["@type"])&&u){let r=e.expandTerm(c,!0);t&&c===r&&(r=e.expandTerm(c,!1)),r!==c&&(i=!0,n[a]=Object.assign(Object.assign({},n[a]),{"@type":r}))}}if(!i)break}}}normalize(e,{processingMode:t,normalizeLanguageTags:r}){if(r||1===t)for(const t of Object.keys(e))if("@language"===t&&"string"==typeof e[t])e[t]=e[t].toLowerCase();else{const r=e[t];if(r&&"object"==typeof r&&"string"==typeof r["@language"]){const n=r["@language"].toLowerCase();n!==r["@language"]&&(e[t]=Object.assign(Object.assign({},r),{"@language":n}))}}}containersToHash(e){for(const t of Object.keys(e)){const r=e[t];if(r&&"object"==typeof r)if("string"==typeof r["@container"])e[t]=Object.assign(Object.assign({},r),{"@container":{[r["@container"]]:!0}});else if(Array.isArray(r["@container"])){const n={};for(const e of r["@container"])n[e]=!0;e[t]=Object.assign(Object.assign({},r),{"@container":n})}}}applyScopedProtected(e,{processingMode:t},r){if(t&&t>=1.1&&e["@protected"]){for(const t of Object.keys(e))if(!s.Util.isReservedInternalKeyword(t)&&!s.Util.isPotentialKeyword(t)&&!s.Util.isTermProtected(e,t)){const n=e[t];n&&"object"==typeof n?"@protected"in e[t]||(e[t]=Object.assign(Object.assign({},e[t]),{"@protected":!0})):(e[t]={"@id":n,"@protected":!0},s.Util.isSimpleTermDefinitionPrefix(n,r)&&(e[t]=Object.assign(Object.assign({},e[t]),{"@prefix":!0})))}delete e["@protected"]}}validateKeywordRedefinitions(e,t,r,n){for(const r of null!=n?n:Object.keys(t))if(s.Util.isTermProtected(e,r)&&("string"==typeof t[r]?t[r]={"@id":t[r],"@protected":!0}:t[r]=Object.assign(Object.assign({},t[r]),{"@protected":!0}),!s.Util.deepEqual(e[r],t[r])))throw new i.ErrorCoded(`Attempted to override the protected keyword ${r} from ${JSON.stringify(s.Util.getContextValueId(e[r]))} to ${JSON.stringify(s.Util.getContextValueId(t[r]))}`,i.ERROR_CODES.PROTECTED_TERM_REDEFINITION)}validate(e,{processingMode:t}){for(const r of Object.keys(e)){if(s.Util.isReservedInternalKeyword(r))continue;if(""===r)throw new i.ErrorCoded(`The empty term is not allowed, got: '${r}': '${JSON.stringify(e[r])}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);const n=e[r],a=typeof n;if(s.Util.isPotentialKeyword(r)){switch(r.substr(1)){case"vocab":if(null!==n&&"string"!==a)throw new i.ErrorCoded(`Found an invalid @vocab IRI: ${n}`,i.ERROR_CODES.INVALID_VOCAB_MAPPING);break;case"base":if(null!==n&&"string"!==a)throw new i.ErrorCoded(`Found an invalid @base IRI: ${e[r]}`,i.ERROR_CODES.INVALID_BASE_IRI);break;case"language":null!==n&&c.validateLanguage(n,!0,i.ERROR_CODES.INVALID_DEFAULT_LANGUAGE);break;case"version":if(null!==n&&"number"!==a)throw new i.ErrorCoded(`Found an invalid @version number: ${n}`,i.ERROR_CODES.INVALID_VERSION_VALUE);break;case"direction":null!==n&&c.validateDirection(n,!0);break;case"propagate":if(1===t)throw new i.ErrorCoded(`Found an illegal @propagate keyword: ${n}`,i.ERROR_CODES.INVALID_CONTEXT_ENTRY);if(null!==n&&"boolean"!==a)throw new i.ErrorCoded(`Found an invalid @propagate value: ${n}`,i.ERROR_CODES.INVALID_PROPAGATE_VALUE)}if(s.Util.isValidKeyword(r)&&s.Util.isValidKeyword(s.Util.getContextValueId(n)))throw new i.ErrorCoded(`Illegal keyword alias in term value, found: '${r}': '${s.Util.getContextValueId(n)}'`,i.ERROR_CODES.KEYWORD_REDEFINITION)}else if(null!==n)switch(a){case"string":if(s.Util.getPrefix(n,e)===r)throw new i.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.CYCLIC_IRI_MAPPING);if(s.Util.isValidIriWeak(r)){if("@type"===n)throw new i.ErrorCoded(`IRIs can not be mapped to @type, found: '${r}': '${n}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIri(n)&&n!==new o.JsonLdContextNormalized(e).expandTerm(r))throw new i.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${r}': '${n}'`,i.ERROR_CODES.INVALID_IRI_MAPPING)}break;case"object":if(!(s.Util.isCompactIri(r)||"@id"in n||("@id"===n["@type"]?e["@base"]:e["@vocab"])))throw new i.ErrorCoded(`Missing @id in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);for(const u of Object.keys(n)){const l=n[u];if(l)switch(u){case"@id":if(s.Util.isValidKeyword(l)&&"@type"!==l&&"@id"!==l&&"@graph"!==l&&"@nest"!==l)throw new i.ErrorCoded(`Illegal keyword alias in term value, found: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIriWeak(r)){if("@type"===l)throw new i.ErrorCoded(`IRIs can not be mapped to @type, found: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIri(l)&&l!==new o.JsonLdContextNormalized(e).expandTerm(r))throw new i.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING)}if("string"!=typeof l)throw new i.ErrorCoded(`Detected non-string @id in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.getPrefix(l,e)===r)throw new i.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.CYCLIC_IRI_MAPPING);break;case"@type":if("@type"===n["@container"]&&"@id"!==l&&"@vocab"!==l)throw new i.ErrorCoded(`@container: @type only allows @type: @id or @vocab, but got: '${r}': '${l}'`,i.ERROR_CODES.INVALID_TYPE_MAPPING);if("string"!=typeof l)throw new i.ErrorCoded(`The value of an '@type' must be a string, got '${JSON.stringify(a)}'`,i.ERROR_CODES.INVALID_TYPE_MAPPING);if(!("@id"===l||"@vocab"===l||1!==t&&"@json"===l||1!==t&&"@none"===l||"_"!==l[0]&&s.Util.isValidIri(l)))throw new i.ErrorCoded(`A context @type must be an absolute IRI, found: '${r}': '${l}'`,i.ERROR_CODES.INVALID_TYPE_MAPPING);break;case"@reverse":if("string"==typeof l&&n["@id"]&&n["@id"]!==l)throw new i.ErrorCoded(`Found non-matching @id and @reverse term values in '${r}':'${l}' and '${n["@id"]}'`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY);if("@nest"in n)throw new i.ErrorCoded(`@nest is not allowed in the reverse property '${r}'`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY);break;case"@container":if(1===t&&(Object.keys(l).length>1||s.Util.CONTAINERS_1_0.indexOf(Object.keys(l)[0])<0))throw new i.ErrorCoded(`Invalid term @container for '${r}' ('${Object.keys(l)}') in 1.0, must be only one of ${s.Util.CONTAINERS_1_0.join(", ")}`,i.ERROR_CODES.INVALID_CONTAINER_MAPPING);for(const e of Object.keys(l)){if("@list"===e&&n["@reverse"])throw new i.ErrorCoded(`Term value can not be @container: @list and @reverse at the same time on '${r}'`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY);if(s.Util.CONTAINERS.indexOf(e)<0)throw new i.ErrorCoded(`Invalid term @container for '${r}' ('${e}'), must be one of ${s.Util.CONTAINERS.join(", ")}`,i.ERROR_CODES.INVALID_CONTAINER_MAPPING)}break;case"@language":c.validateLanguage(l,!0,i.ERROR_CODES.INVALID_LANGUAGE_MAPPING);break;case"@direction":c.validateDirection(l,!0);break;case"@prefix":if(null!==l&&"boolean"!=typeof l)throw new i.ErrorCoded(`Found an invalid term @prefix boolean in: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_PREFIX_VALUE);if(!("@id"in n)&&!s.Util.isValidIri(r))throw new i.ErrorCoded(`Invalid @prefix definition for '${r}' ('${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);break;case"@index":if(1===t||!n["@container"]||!n["@container"]["@index"])throw new i.ErrorCoded(`Attempt to add illegal key to value object: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);break;case"@nest":if(s.Util.isPotentialKeyword(l)&&"@nest"!==l)throw new i.ErrorCoded(`Found an invalid term @nest value in: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_NEST_VALUE)}}break;default:throw new i.ErrorCoded(`Found an invalid term value: '${r}': '${n}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION)}}}applyBaseEntry(e,t,r){return"string"==typeof e||(r&&!("@base"in e)&&t.parentContext&&"object"==typeof t.parentContext&&"@base"in t.parentContext&&(e["@base"]=t.parentContext["@base"],t.parentContext["@__baseDocument"]&&(e["@__baseDocument"]=!0)),t.baseIRI&&!t.external&&("@base"in e?null===e["@base"]||"string"!=typeof e["@base"]||s.Util.isValidIri(e["@base"])||(e["@base"]=(0,n.resolve)(e["@base"],t.parentContext&&t.parentContext["@base"]||t.baseIRI)):(e["@base"]=t.baseIRI,e["@__baseDocument"]=!0))),e}normalizeContextIri(e,t){if(!s.Util.isValidIri(e))try{e=(0,n.resolve)(e,t)}catch(t){throw new Error(`Invalid context IRI: ${e}`)}return this.redirectSchemaOrgHttps&&e.startsWith("http://schema.org")&&(e="https://schema.org/"),e}async parseInnerContexts(e,t,r){for(const n of null!=r?r:Object.keys(e)){const r=e[n];if(r&&"object"==typeof r&&"@context"in r&&null!==r["@context"]&&!t.ignoreScopedContexts){if(this.validateContext)try{const i=Object.assign(Object.assign({},e),{[n]:Object.assign({},e[n])});delete i[n]["@context"],await this.parse(r["@context"],Object.assign(Object.assign({},t),{external:!1,parentContext:i,ignoreProtection:!0,ignoreRemoteScopedContexts:!0,ignoreScopedContexts:!0}))}catch(e){throw new i.ErrorCoded(e.message,i.ERROR_CODES.INVALID_SCOPED_CONTEXT)}e[n]=Object.assign(Object.assign({},r),{"@context":(await this.parse(r["@context"],Object.assign(Object.assign({},t),{external:!1,minimalProcessing:!0,ignoreRemoteScopedContexts:!0,parentContext:e}))).getContextRaw()})}}return e}async parse(e,t={},r={}){const{baseIRI:n,parentContext:a,external:u,processingMode:l=c.DEFAULT_PROCESSING_MODE,normalizeLanguageTags:d,ignoreProtection:p,minimalProcessing:h}=t,f=t.remoteContexts||{};if(Object.keys(f).length>=this.remoteContextsDepthLimit)throw new i.ErrorCoded("Detected an overflow in remote context inclusions: "+Object.keys(f),i.ERROR_CODES.CONTEXT_OVERFLOW);if(null==e){if(!p&&a&&s.Util.hasProtectedTerms(a))throw new i.ErrorCoded("Illegal context nullification when terms are protected",i.ERROR_CODES.INVALID_CONTEXT_NULLIFICATION);return new o.JsonLdContextNormalized(this.applyBaseEntry({},t,!1))}if("string"==typeof e){const r=this.normalizeContextIri(e,n),i=this.getOverriddenLoad(r,t);if(i)return new o.JsonLdContextNormalized(i);const a=await this.parse(await this.load(r),Object.assign(Object.assign({},t),{baseIRI:r,external:!0,remoteContexts:Object.assign(Object.assign({},f),{[r]:!0})}));return this.applyBaseEntry(a.getContextRaw(),t,!0),a}if(Array.isArray(e)){const r=[],i=await Promise.all(e.map(((e,i)=>{if("string"==typeof e){const a=this.normalizeContextIri(e,n);r[i]=a;return this.getOverriddenLoad(a,t)||this.load(a)}return e})));if(h)return new o.JsonLdContextNormalized(i);const s=await i.reduce(((e,n,a)=>e.then((e=>this.parse(n,Object.assign(Object.assign({},t),{baseIRI:r[a]||t.baseIRI,external:!!r[a]||t.external,parentContext:e.getContextRaw(),remoteContexts:r[a]?Object.assign(Object.assign({},f),{[r[a]]:!0}):f}),{skipValidation:a=1.1))throw new i.ErrorCoded("Context importing is not supported in JSON-LD 1.0",i.ERROR_CODES.INVALID_CONTEXT_ENTRY);if("string"!=typeof e["@import"])throw new i.ErrorCoded("An @import value must be a string, but got "+typeof e["@import"],i.ERROR_CODES.INVALID_IMPORT_VALUE);f=await this.loadImportContext(this.normalizeContextIri(e["@import"],n)),delete e["@import"]}this.applyScopedProtected(f,{processingMode:l},o.defaultExpandOptions);const y=Object.assign(f,e);this.idifyReverseTerms(y),this.normalize(y,{processingMode:l,normalizeLanguageTags:d}),this.applyScopedProtected(y,{processingMode:l},o.defaultExpandOptions);const m=Object.keys(y),g=[];if("object"==typeof a)for(const e in a)e in y?g.push(e):y[e]=a[e];await this.parseInnerContexts(y,t,m);const b=new o.JsonLdContextNormalized(y);return(y&&y["@version"]||c.DEFAULT_PROCESSING_MODE)>=1.1&&(e["@vocab"]&&"string"==typeof e["@vocab"]||""===e["@vocab"])&&(a&&"@vocab"in a&&e["@vocab"].indexOf(":")<0?y["@vocab"]=a["@vocab"]+e["@vocab"]:(s.Util.isCompactIri(e["@vocab"])||e["@vocab"]in y)&&(y["@vocab"]=b.expandTerm(e["@vocab"],!0))),this.expandPrefixedTerms(b,this.expandContentTypeToBase,m),!p&&a&&l>=1.1&&this.validateKeywordRedefinitions(a,y,o.defaultExpandOptions,g),this.validateContext&&!r.skipValidation&&this.validate(y,{processingMode:l}),b}throw new i.ErrorCoded(`Tried parsing a context that is not a string, array or object, but got ${e}`,i.ERROR_CODES.INVALID_LOCAL_CONTEXT)}async load(e){const t=this.documentCache[e];if(t)return t;let r;try{r=await this.documentLoader.load(e)}catch(t){throw new i.ErrorCoded(`Failed to load remote context ${e}: ${t.message}`,i.ERROR_CODES.LOADING_REMOTE_CONTEXT_FAILED)}if(!("@context"in r))throw new i.ErrorCoded(`Missing @context in remote context at ${e}`,i.ERROR_CODES.INVALID_REMOTE_CONTEXT);return this.documentCache[e]=r["@context"]}getOverriddenLoad(e,t){if(e in(t.remoteContexts||{})){if(t.ignoreRemoteScopedContexts)return e;throw new i.ErrorCoded("Detected a cyclic context inclusion of "+e,i.ERROR_CODES.RECURSIVE_CONTEXT_INCLUSION)}return null}async loadImportContext(e){let t=await this.load(e);if("object"!=typeof t||Array.isArray(t))throw new i.ErrorCoded("An imported context must be a single object: "+e,i.ERROR_CODES.INVALID_REMOTE_CONTEXT);if("@import"in t)throw new i.ErrorCoded("An imported context can not import another context: "+e,i.ERROR_CODES.INVALID_CONTEXT_ENTRY);return t=Object.assign({},t),this.containersToHash(t),t}}c.DEFAULT_PROCESSING_MODE=1.1,t.ContextParser=c},47455:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_CODES=t.ErrorCoded=void 0;class r extends Error{constructor(e,t){super(e),this.code=t}}var n;t.ErrorCoded=r,(n=t.ERROR_CODES||(t.ERROR_CODES={})).COLLIDING_KEYWORDS="colliding keywords",n.CONFLICTING_INDEXES="conflicting indexes",n.CYCLIC_IRI_MAPPING="cyclic IRI mapping",n.INVALID_ID_VALUE="invalid @id value",n.INVALID_INDEX_VALUE="invalid @index value",n.INVALID_NEST_VALUE="invalid @nest value",n.INVALID_PREFIX_VALUE="invalid @prefix value",n.INVALID_PROPAGATE_VALUE="invalid @propagate value",n.INVALID_REVERSE_VALUE="invalid @reverse value",n.INVALID_IMPORT_VALUE="invalid @import value",n.INVALID_VERSION_VALUE="invalid @version value",n.INVALID_BASE_IRI="invalid base IRI",n.INVALID_CONTAINER_MAPPING="invalid container mapping",n.INVALID_CONTEXT_ENTRY="invalid context entry",n.INVALID_CONTEXT_NULLIFICATION="invalid context nullification",n.INVALID_DEFAULT_LANGUAGE="invalid default language",n.INVALID_INCLUDED_VALUE="invalid @included value",n.INVALID_IRI_MAPPING="invalid IRI mapping",n.INVALID_JSON_LITERAL="invalid JSON literal",n.INVALID_KEYWORD_ALIAS="invalid keyword alias",n.INVALID_LANGUAGE_MAP_VALUE="invalid language map value",n.INVALID_LANGUAGE_MAPPING="invalid language mapping",n.INVALID_LANGUAGE_TAGGED_STRING="invalid language-tagged string",n.INVALID_LANGUAGE_TAGGED_VALUE="invalid language-tagged value",n.INVALID_LOCAL_CONTEXT="invalid local context",n.INVALID_REMOTE_CONTEXT="invalid remote context",n.INVALID_REVERSE_PROPERTY="invalid reverse property",n.INVALID_REVERSE_PROPERTY_MAP="invalid reverse property map",n.INVALID_REVERSE_PROPERTY_VALUE="invalid reverse property value",n.INVALID_SCOPED_CONTEXT="invalid scoped context",n.INVALID_SCRIPT_ELEMENT="invalid script element",n.INVALID_SET_OR_LIST_OBJECT="invalid set or list object",n.INVALID_TERM_DEFINITION="invalid term definition",n.INVALID_TYPE_MAPPING="invalid type mapping",n.INVALID_TYPE_VALUE="invalid type value",n.INVALID_TYPED_VALUE="invalid typed value",n.INVALID_VALUE_OBJECT="invalid value object",n.INVALID_VALUE_OBJECT_VALUE="invalid value object value",n.INVALID_VOCAB_MAPPING="invalid vocab mapping",n.IRI_CONFUSED_WITH_PREFIX="IRI confused with prefix",n.KEYWORD_REDEFINITION="keyword redefinition",n.LOADING_DOCUMENT_FAILED="loading document failed",n.LOADING_REMOTE_CONTEXT_FAILED="loading remote context failed",n.MULTIPLE_CONTEXT_LINK_HEADERS="multiple context link headers",n.PROCESSING_MODE_CONFLICT="processing mode conflict",n.PROTECTED_TERM_REDEFINITION="protected term redefinition",n.CONTEXT_OVERFLOW="context overflow",n.INVALID_BASE_DIRECTION="invalid base direction",n.RECURSIVE_CONTEXT_INCLUSION="recursive context inclusion",n.INVALID_STREAMING_KEY_ORDER="invalid streaming key order",n.INVALID_EMBEDDED_NODE="invalid embedded node",n.INVALID_ANNOTATION="invalid annotation"},31278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FetchDocumentLoader=void 0,r(11592);const n=r(47455),i=r(75441),a=r(9929);t.FetchDocumentLoader=class{constructor(e){this.fetcher=e}async load(e){const t=await(this.fetcher||fetch)(e,{headers:new Headers({accept:"application/ld+json"})});if(t.ok&&t.headers){let r=t.headers.get("Content-Type");if(r){const e=r.indexOf(";");e>0&&(r=r.substr(0,e))}if("application/ld+json"===r)return await t.json();if(t.headers.has("Link")){let r;if(t.headers.forEach(((t,n)=>{if("link"===n){const n=(0,i.parse)(t);for(const t of n.get("type","application/ld+json"))if("alternate"===t.rel){if(r)throw new Error("Multiple JSON-LD alternate links were found on "+e);r=(0,a.resolve)(t.uri,e)}}})),r)return this.load(r)}throw new n.ErrorCoded(`Unsupported JSON-LD media type ${r}`,n.ERROR_CODES.LOADING_DOCUMENT_FAILED)}throw new Error(t.statusText||`Status code: ${t.status}`)}}},52953:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},79241:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},59928:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultExpandOptions=t.JsonLdContextNormalized=void 0;const n=r(9929),i=r(47455),a=r(63750);t.JsonLdContextNormalized=class{constructor(e){this.contextRaw=e}getContextRaw(){return this.contextRaw}expandTerm(e,r,o=t.defaultExpandOptions){const s=this.contextRaw[e];if(null===s||s&&null===s["@id"])return null;let c=!0;if(s&&r){const t=a.Util.getContextValueId(s);if(t&&t!==e){if("string"==typeof t&&(a.Util.isValidIri(t)||a.Util.isValidKeyword(t)))return t;a.Util.isPotentialKeyword(t)||(c=!1)}}const u=a.Util.getPrefix(e,this.contextRaw),l=this.contextRaw["@vocab"],d=(!!l||""===l)&&l.indexOf(":")<0,p=this.contextRaw["@base"],h=a.Util.isPotentialKeyword(e);if(u){const t=this.contextRaw[u],r=a.Util.getContextValueId(t);if(r){if("string"!=typeof t&&o.allowPrefixForcing){if("_"!==r[0]&&!h&&!t["@prefix"]&&!(e in this.contextRaw))return e}else if(!a.Util.isSimpleTermDefinitionPrefix(r,o))return e;return r+e.substr(u.length+1)}}else{if(r&&(l||""===l||o.allowVocabRelativeToBase&&p&&d)&&!h&&!a.Util.isCompactIri(e)){if(d){if(o.allowVocabRelativeToBase)return(l||p?(0,n.resolve)(l,p):"")+e;throw new i.ErrorCoded(`Relative vocab expansion for term '${e}' with vocab '${l}' is not allowed.`,i.ERROR_CODES.INVALID_VOCAB_MAPPING)}return l+e}if(!r&&p&&!h&&!a.Util.isCompactIri(e))return(0,n.resolve)(e,p)}if(c)return e;throw new i.ErrorCoded(`Invalid IRI mapping found for context entry '${e}': '${JSON.stringify(s)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING)}compactIri(e,t){if(t&&this.contextRaw["@vocab"]&&e.startsWith(this.contextRaw["@vocab"]))return e.substr(this.contextRaw["@vocab"].length);if(!t&&this.contextRaw["@base"]&&e.startsWith(this.contextRaw["@base"]))return e.substr(this.contextRaw["@base"].length);const r={prefix:"",suffix:e};for(const n in this.contextRaw){const i=this.contextRaw[n];if(i&&!a.Util.isPotentialKeyword(n)){const o=a.Util.getContextValueId(i);if(e.startsWith(o)){const i=e.substr(o.length);if(i)i.length{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=void 0;class r{static isCompactIri(e){return e.indexOf(":")>0&&!(e&&"#"===e[0])}static getPrefix(e,t){if(e&&"#"===e[0])return null;const r=e.indexOf(":");if(r>=0){if(e.length>r+1&&"/"===e.charAt(r+1)&&"/"===e.charAt(r+2))return null;const n=e.substr(0,r);if("_"===n)return null;if(t[n])return n}return null}static getContextValueId(e){if(null===e||"string"==typeof e)return e;return e["@id"]||null}static isSimpleTermDefinitionPrefix(e,t){return!r.isPotentialKeyword(e)&&(t.allowPrefixNonGenDelims||"string"==typeof e&&("_"===e[0]||r.isPrefixIriEndingWithGenDelim(e)))}static isPotentialKeyword(e){return"string"==typeof e&&r.KEYWORD_REGEX.test(e)}static isPrefixIriEndingWithGenDelim(e){return r.ENDS_WITH_GEN_DELIM.test(e)}static isPrefixValue(e){return e&&("string"==typeof e||e&&"object"==typeof e)}static isValidIri(e){return Boolean(e&&r.IRI_REGEX.test(e))}static isValidIriWeak(e){return!!e&&":"!==e[0]&&r.IRI_REGEX_WEAK.test(e)}static isValidKeyword(e){return r.VALID_KEYWORDS[e]}static isTermProtected(e,t){const r=e[t];return!("string"==typeof r)&&r&&r["@protected"]}static hasProtectedTerms(e){for(const t of Object.keys(e))if(r.isTermProtected(e,t))return!0;return!1}static isReservedInternalKeyword(e){return e.startsWith("@__")}static deepEqual(e,t){const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every((r=>{const n=e[r],i=t[r];return n===i||null!==n&&null!==i&&"object"==typeof n&&"object"==typeof i&&this.deepEqual(n,i)}))}}r.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^ "<>{}|\\\[\]`#]*(#[^#]*)?$/,r.IRI_REGEX_WEAK=/(?::[^:])|\//,r.KEYWORD_REGEX=/^@[a-z]+$/i,r.ENDS_WITH_GEN_DELIM=/[:/?#\[\]@]$/,r.REGEX_LANGUAGE_TAG=/^[a-zA-Z]+(-[a-zA-Z0-9]+)*$/,r.REGEX_DIRECTION_TAG=/^(ltr)|(rtl)$/,r.VALID_KEYWORDS={"@annotation":!0,"@base":!0,"@container":!0,"@context":!0,"@direction":!0,"@graph":!0,"@id":!0,"@import":!0,"@included":!0,"@index":!0,"@json":!0,"@language":!0,"@list":!0,"@nest":!0,"@none":!0,"@prefix":!0,"@propagate":!0,"@protected":!0,"@reverse":!0,"@set":!0,"@type":!0,"@value":!0,"@version":!0,"@vocab":!0},r.EXPAND_KEYS_BLACKLIST=["@base","@vocab","@language","@version","@direction"],r.ALIAS_DOMAIN_BLACKLIST=["@container","@graph","@id","@index","@list","@nest","@none","@prefix","@reverse","@set","@type","@value","@version"],r.ALIAS_RANGE_BLACKLIST=["@context","@preserve"],r.CONTAINERS=["@list","@set","@index","@language","@graph","@id","@type"],r.CONTAINERS_1_0=["@list","@set","@index"],t.Util=r},48176:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfParseN3=void 0;const n=r(55252),i=r(72407),a=r(54957);class o extends n.ActorRdfParseFixedMediaTypes{constructor(e){super(e)}async runHandle(e,t,r){const n=e.context.getSafe(i.KeysInitQuery.dataFactory);e.data.on("error",(e=>o.emit("error",e)));const o=e.data.pipe(new a.StreamParser({factory:n,baseIRI:e.metadata?.baseIRI,format:t.endsWith("n3")?t:`${t}*`,parseUnsupportedVersions:Boolean(e.context.get(i.KeysInitQuery.parseUnsupportedVersions)),version:e.metadata?.version}));return{data:o,metadata:{triples:"text/turtle"===t||"application/n-triples"===t||"text/n3"===t}}}}t.ActorRdfParseN3=o},57225:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(48176),t)},53452:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfParseRdfXml=void 0;const n=r(55252),i=r(72407),a=r(97990);class o extends n.ActorRdfParseFixedMediaTypes{constructor(e){super(e)}async runHandle(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory);e.data.on("error",(e=>r.emit("error",e)));const r=e.data.pipe(new a.RdfXmlParser({dataFactory:t,baseIRI:e.metadata?.baseIRI,parseUnsupportedVersions:Boolean(e.context.get(i.KeysInitQuery.parseUnsupportedVersions)),version:e.metadata?.version}));return{data:r,metadata:{triples:!0}}}}t.ActorRdfParseRdfXml=o},19387:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(53452),t)},58984:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfParseShaclc=void 0;const n=r(55252),i=r(31759),a=r(58521),o=r(64232),s=r(98952);class c extends n.ActorRdfParseFixedMediaTypes{constructor(e){super(e)}async runHandle(e,t,r){const n=new s.PrefixWrappingIterator((0,i.stringify)(e.data).then((r=>(0,o.parse)(r,{extendedSyntax:"text/shaclc-ext"===t,baseIRI:e.metadata?.baseIRI})))),c=new a.Readable({objectMode:!0});return n.on("prefix",((...e)=>c.emit("prefix",...e))),{data:c.wrap(n),metadata:{triples:!0}}}}t.ActorRdfParseShaclc=c},98952:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrefixWrappingIterator=void 0;const n=r(76664);class i extends n.WrappingIterator{prefixes;constructor(e){super(e?.then((e=>(this.prefixes=e.prefixes,e))))}read(){if(this.prefixes){for(const e of Object.entries(this.prefixes))this.emit("prefix",...e);delete this.prefixes}return super.read()}}t.PrefixWrappingIterator=i},79964:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(58984),t)},39995:e=>{var t=function(){var e=function(e,t,r,n){for(r=r||{},n=e.length;n--;r[e[n]]=t);return r},t=[7,12,13,14,15,16,20,25,115,130],r=[7,13,16,20,25,115,130],n=[7,13,16,115,130],i=[1,25],a=[1,29],o=[1,27],s=[1,28],c=[13,16,115,130],u=[13,16,28,38,40,42,44,46,48,53,56,61,67,85,87,92,93,95,96,102,110,111,115,119,120,126,128,129,130,131,132,133,134,135,136],l=[28,56],d=[1,42],p=[46,48,53,56],h=[1,54],f=[1,60],y=[1,56],m=[1,57],g=[1,58],b=[1,63],v=[1,64],_=[1,65],T=[1,66],O=[1,67],w=[1,68],S=[1,75],E=[28,46,48,53,56],A=[28,42,46,48,53,56],x=[13,16,28,38,40,42,44,46,48,53,56,92,115,119,120,130,131,132,133,134,135,136],I=[13,16,28,38,40,42,44,46,48,53,56,67,85,87,92,95,96,115,119,120,126,128,129,130,131,132,133,134,135,136],P=[13,16,38,40,44,92,115,119,120,130,131,132,133,134,135,136],R=[13,16,28,38,40,42,44,46,48,53,56,67,85,87,92,95,96,115,117,118,119,120,126,128,129,130,131,132,133,134,135,136],N=[13,16,28,56,115,130],j=[13,16,38,58,87,96,109,115,126,130],L=[1,116],D=[1,112],F=[1,108],M=[1,114],C=[1,111],k=[7,13,16,20,25,44,48,53,56,67,85,87,95,96,115,128,129,130],U=[48,53],B=[48,53,87,96,126],q=[13,16,44,48,53,56,85,87,95,96,115,128,129,130],V=[1,126],$=[13,16,40,44,48,53,56,85,87,95,96,115,128,129,130],G=[1,129],Q=[48,53,67,87,96,126],H=[13,16,40,44,48,53,56,67,85,87,95,96,115,128,129,130],z=[1,133],K=[13,16,40,44,48,53,56,67,85,87,95,96,102,115,128,129,130],X=[13,16,40,44,48,53,56,67,85,87,93,95,96,102,110,111,115,128,129,130],W=[1,151],J=[1,153],Y=[1,156],Z=[1,157],ee=[1,158],te=[1,167],re=[1,175],ne=[13,16,44,48,53,56,67,85,87,95,96,115,128,129,130],ie=[13,16,44,48,53,56,67,85,87,95,96,115,126,128,129,130],ae=[13,16,46,92,115,119,120,130,131,132,133,134,135,136],oe={trace:function(){},yy:{},symbols_:{error:2,shaclDoc:3,shaclDoc_repetition0:4,shaclDoc_repetition1:5,ttlSection:6,EOF:7,directive:8,baseDecl:9,importsDecl:10,prefixDecl:11,KW_BASE:12,IRIREF:13,KW_IMPORTS:14,KW_PREFIX:15,PNAME_NS:16,nodeShapeIri:17,iri:18,nodeShape:19,KW_SHAPE:20,nodeShape_option0:21,nodeShape_option1:22,nodeShapeBody:23,shapeClass:24,KW_SHAPE_CLASS:25,shapeClass_option0:26,turtleAnnotation:27,";":28,turtleAnnotation2:29,predicate:30,turtleAnnotation2_option0:31,objectList:32,object:33,objectList_repetition0:34,iriOrLiteral:35,blankNodeSection:36,list:37,"(":38,list_repetition0:39,")":40,objectTail:41,",":42,LB:43,"[":44,RB:45,"]":46,LP:47,"%":48,RP:49,pcSection:50,iriHead:51,ttlStatement:52,".":53,ttlSection_repetition0:54,startNodeShape:55,"{":56,endNodeShape:57,"}":58,nodeShapeBody_repetition0:59,targetClass:60,"->":61,targetClass_repetition_plus0:62,constraint:63,constraint_group0:64,constraint_option0:65,orNotComponent:66,"|":67,nodeNot:68,nodeOrEmit:69,nodeOr:70,nodeOr_repetition_plus0:71,nodeValue:72,negation:73,nodeValue_group0:74,"=":75,iriOrLiteralOrArray:76,propertyShape:77,path:78,propertyShape_repetition0:79,propertyOrComponent:80,propertyNot:81,propertyOr:82,propertyOr_repetition_plus0:83,propertyAtom:84,NODEKIND:85,shapeRef:86,PARAM:87,propertyCount:88,propertyMinCount:89,"..":90,propertyMaxCount:91,INTEGER:92,"*":93,shapeRef_group0:94,"@":95,"!":96,pathAlternative:97,additionalAlternative:98,pathSequence:99,pathAlternative_repetition_plus0:100,additionalSequence:101,"/":102,pathEltOrInverse:103,pathSequence_repetition_plus0:104,pathElt:105,pathPrimary:106,pathMod:107,pathInverse:108,"^":109,"?":110,"+":111,iriOrLiteralOrArray_repetition0:112,literal:113,iri_group0:114,a:115,string:116,LANGTAG:117,"^^":118,DECIMAL:119,DOUBLE:120,literal_group0:121,string_group0:122,string_group1:123,shaclDoc_repetition1_group0:124,constraint_group0_repetition_plus0:125,TARGET:126,propertyShape_repetition0_group0:127,ATPNAME_LN:128,ATPNAME_NS:129,PNAME_LN:130,KW_TRUE:131,KW_FALSE:132,STRING_LITERAL1:133,STRING_LITERAL2:134,STRING_LITERAL_LONG1:135,STRING_LITERAL_LONG2:136,$accept:0,$end:1},terminals_:{2:"error",7:"EOF",12:"KW_BASE",13:"IRIREF",14:"KW_IMPORTS",15:"KW_PREFIX",16:"PNAME_NS",20:"KW_SHAPE",25:"KW_SHAPE_CLASS",28:";",38:"(",40:")",42:",",44:"[",46:"]",48:"%",53:".",56:"{",58:"}",61:"->",67:"|",75:"=",85:"NODEKIND",87:"PARAM",90:"..",92:"INTEGER",93:"*",95:"@",96:"!",102:"/",109:"^",110:"?",111:"+",115:"a",117:"LANGTAG",118:"^^",119:"DECIMAL",120:"DOUBLE",126:"TARGET",128:"ATPNAME_LN",129:"ATPNAME_NS",130:"PNAME_LN",131:"KW_TRUE",132:"KW_FALSE",133:"STRING_LITERAL1",134:"STRING_LITERAL2",135:"STRING_LITERAL_LONG1",136:"STRING_LITERAL_LONG2"},productions_:[0,[3,4],[8,1],[8,1],[8,1],[9,2],[10,2],[11,3],[17,1],[19,5],[24,4],[27,2],[29,2],[30,2],[32,2],[33,1],[33,1],[33,1],[37,3],[41,2],[43,1],[45,1],[36,3],[47,1],[49,1],[50,3],[51,1],[52,3],[6,1],[55,1],[57,1],[23,3],[60,2],[63,3],[66,2],[69,1],[70,1],[70,2],[68,1],[68,2],[72,3],[77,2],[80,2],[82,1],[82,2],[81,1],[81,2],[84,1],[84,1],[84,1],[84,3],[84,1],[88,5],[89,1],[91,1],[91,1],[86,1],[86,2],[73,1],[78,1],[98,2],[97,1],[97,2],[101,2],[99,1],[99,2],[105,1],[105,2],[103,1],[103,2],[108,1],[107,1],[107,1],[107,1],[106,1],[106,3],[76,1],[76,3],[35,1],[35,1],[18,1],[18,1],[18,1],[113,1],[113,2],[113,3],[113,1],[113,1],[113,1],[113,1],[116,1],[116,1],[4,0],[4,2],[124,1],[124,1],[5,0],[5,2],[21,0],[21,1],[22,0],[22,1],[26,0],[26,1],[31,0],[31,1],[34,0],[34,2],[39,0],[39,2],[54,0],[54,2],[59,0],[59,2],[62,1],[62,2],[125,1],[125,2],[64,1],[64,1],[65,0],[65,1],[71,1],[71,2],[74,1],[74,1],[127,1],[127,1],[79,0],[79,2],[83,1],[83,2],[94,1],[94,1],[100,1],[100,2],[104,1],[104,2],[112,0],[112,2],[114,1],[114,1],[121,1],[121,1],[122,1],[122,1],[123,1],[123,1]],performAction:function(e,t,r,n,i,a,o){var s,c,u=a.length-1;switch(i){case 1:this.$=Ie(je.factory.namedNode(Oe("")),je.factory.namedNode(ce),je.factory.namedNode(be+"Ontology"));break;case 5:je.base=je.factory.namedNode(a[u].slice(1,-1)),je.n3Parser._setBase(Oe(je.base.value));break;case 6:this.$=Ie(je.base,je.factory.namedNode(be+"imports"),je.factory.namedNode(a[u].slice(1,-1)));break;case 7:this.$=je.prefixes[a[u-1].substr(0,a[u-1].length-1)]=Oe(a[u]);break;case 8:je.nodeShapeStack=!1,Ie(je.currentNodeShape=a[u],je.factory.namedNode(ce),je.factory.namedNode(ge+"NodeShape"));break;case 10:this.$=Ie(je.currentNodeShape,je.factory.namedNode(ce),je.factory.namedNode(ve+"Class"));break;case 11:this.$=Re();break;case 13:this.$=a[u].forEach((e=>Ie(je.currentNodeShape,a[u-1],e)));break;case 14:this.$=[a[u-1],...a[u]];break;case 18:this.$=Te(a[u-1],!0);break;case 19:case 34:case 42:case 60:case 63:this.$=a[u];break;case 20:je.tempCurrentNodeShape=je.currentNodeShape,this.$=je.currentNodeShape=Ee();break;case 21:case 24:je.currentNodeShape=je.tempCurrentNodeShape;break;case 22:case 31:this.$=a[u-2];break;case 23:je.tempCurrentNodeShape=je.currentNodeShape,je.currentNodeShape=je.currentPropertyNode;break;case 26:je.currentNodeShape=a[u];break;case 29:je.nodeShapeStack?(je.nodeShapeStack.push(je.currentNodeShape),Ie(je.currentPropertyNode,je.factory.namedNode(ge+"node"),je.currentNodeShape=Ee())):je.nodeShapeStack=[],this.$=je.currentNodeShape;break;case 30:je.nodeShapeStack.length>0&&(je.currentNodeShape=je.nodeShapeStack.pop());break;case 32:this.$=a[u].forEach((e=>{Ie(je.currentNodeShape,je.factory.namedNode(ge+"targetClass"),e)}));break;case 35:this.$=Ie(je.currentNodeShape,je.factory.namedNode(ge+a[u][0]),a[u][1]);break;case 36:break;case 37:const e=Te([a[u-1],...a[u]].map((e=>{const t=Ee();return Ie(t,je.factory.namedNode(ge+e[0]),e[1]),t})));this.$=["or",e];break;case 39:case 46:this.$=function(e,t,r){const n=Ee();return Ie(n,je.factory.namedNode(ge+t),r),[e,n]}("not",...a[u]);break;case 40:case 50:this.$=[a[u-2],a[u]];break;case 43:this.$=a[u]&&Pe(...a[u]);break;case 44:this.$=Pe("or",Te([a[u-1],...a[u]].map((e=>{const t=Ee();return Ie(t,je.factory.namedNode(ge+e[0]),e[1]),t}))));break;case 47:this.$=[_e[a[u].value]?"datatype":"class",a[u]];break;case 48:this.$=["nodeKind",je.factory.namedNode(ge+a[u])];break;case 49:this.$=["node",je.factory.namedNode(a[u])];break;case 51:this.$=void 0;break;case 53:this.$=a[u]>0&&Pe("minCount",Se(a[u],he));break;case 54:this.$=Pe("maxCount",Se(a[u],he));break;case 56:this.$=we(a[u].slice(1));break;case 57:this.$=Oe(a[u]);break;case 59:Ie(je.currentNodeShape,je.factory.namedNode(ge+"property"),je.currentPropertyNode=Ee()),Pe("path",a[u]);break;case 62:const t=Ee();Ie(t,je.factory.namedNode(ge+"alternativePath"),Te([a[u-1],...a[u]])),this.$=t;break;case 65:this.$=Te([a[u-1],...a[u]]);break;case 67:Ie(this.$=Ee(),je.factory.namedNode(ge+a[u]),a[u-1]);break;case 69:Ie(this.$=Ee(),je.factory.namedNode(ge+"inversePath"),a[u]);break;case 71:this.$="zeroOrOnePath";break;case 72:this.$="zeroOrMorePath";break;case 73:this.$="oneOrMorePath";break;case 75:this.$=a[u-1];break;case 77:this.$=Te(a[u-1]);break;case 80:this.$=je.factory.namedNode(Oe(a[u]));break;case 81:this.$=je.factory.namedNode(we(a[u]));break;case 82:this.$=Re(je.factory.namedNode(ce));break;case 83:this.$=Se(a[u]);break;case 84:this.$=(s=a[u-1],c=a[u].substr(1).toLowerCase(),je.factory.literal(s,c));break;case 85:this.$=Se(a[u-2],a[u]);break;case 86:this.$=Se(a[u],he);break;case 87:this.$=Se(a[u],fe);break;case 88:this.$=Se(a[u].toLowerCase(),ye);break;case 89:this.$=Se(a[u].toLowerCase(),me);break;case 90:this.$=xe(a[u],1);break;case 91:this.$=xe(a[u],3);break;case 92:case 96:case 106:case 108:case 110:case 112:case 128:case 138:this.$=[];break;case 93:case 97:case 107:case 109:case 111:case 113:case 115:case 117:case 123:case 129:case 131:case 135:case 137:case 139:a[u-1].push(a[u]);break;case 114:case 116:case 122:case 130:case 134:case 136:this.$=[a[u]]}},table:[e(t,[2,92],{3:1,4:2}),{1:[3]},e(r,[2,96],{5:3,8:4,9:5,10:6,11:7,12:[1,8],14:[1,9],15:[1,10]}),e(n,[2,110],{6:11,124:12,54:13,19:14,24:15,20:[1,16],25:[1,17]}),e(t,[2,93]),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{13:[1,18]},{13:[1,19]},{16:[1,20]},{7:[1,21]},e(r,[2,97]),{7:[2,28],13:i,16:a,18:24,51:23,52:22,114:26,115:o,130:s},e(r,[2,94]),e(r,[2,95]),{13:i,16:a,17:30,18:31,114:26,115:o,130:s},{13:i,16:a,17:32,18:31,114:26,115:o,130:s},e(t,[2,5]),e(t,[2,6]),{13:[1,33]},{1:[2,1]},e(n,[2,111]),{13:i,16:a,18:36,29:34,30:35,114:26,115:o,130:s},e(c,[2,26]),e(u,[2,80]),e(u,[2,81]),e(u,[2,82]),e(u,[2,140]),e(u,[2,141]),e(l,[2,98],{21:37,60:38,61:[1,39]}),e([28,56,61],[2,8]),{26:40,27:41,28:d,56:[2,102]},e(t,[2,7]),{53:[1,43]},e(p,[2,104],{31:44,27:45,28:d}),{13:i,16:a,18:51,32:46,33:47,35:48,36:49,37:50,38:h,43:53,44:f,92:y,113:52,114:26,115:o,116:55,119:m,120:g,121:59,122:61,123:62,130:s,131:b,132:v,133:_,134:T,135:O,136:w},{22:69,27:70,28:d,56:[2,100]},e(l,[2,99]),{13:i,16:a,18:72,62:71,114:26,115:o,130:s},{23:73,55:74,56:S},{56:[2,103]},{13:i,16:a,18:36,29:76,30:35,114:26,115:o,130:s},e(n,[2,27]),e(p,[2,12]),e(p,[2,105]),e(E,[2,13]),e(A,[2,106],{34:77}),e(x,[2,15]),e(x,[2,16]),e(x,[2,17]),e(I,[2,78]),e(I,[2,79]),{13:i,16:a,18:36,29:78,30:35,114:26,115:o,130:s},e(P,[2,108],{39:79}),e(I,[2,83],{117:[1,80],118:[1,81]}),e(I,[2,86]),e(I,[2,87]),e(I,[2,88]),e(I,[2,89]),e(c,[2,20]),e(R,[2,90]),e(R,[2,91]),e(I,[2,142]),e(I,[2,143]),e(R,[2,144]),e(R,[2,145]),e(R,[2,146]),e(R,[2,147]),{23:82,55:74,56:S},{56:[2,101]},e(l,[2,32],{114:26,18:83,13:i,16:a,115:o,130:s}),e(N,[2,114]),e(r,[2,10]),e(j,[2,112],{59:84}),e(j,[2,29]),e(p,[2,11]),e(E,[2,14],{41:85,42:[1,86]}),{45:87,46:[1,88]},{13:i,16:a,18:51,33:90,35:48,36:49,37:50,38:h,40:[1,89],43:53,44:f,92:y,113:52,114:26,115:o,116:55,119:m,120:g,121:59,122:61,123:62,130:s,131:b,132:v,133:_,134:T,135:O,136:w},e(I,[2,84]),{13:i,16:a,18:91,114:26,115:o,130:s},e(r,[2,9]),e(N,[2,115]),{13:i,16:a,18:115,38:L,57:92,58:[1,94],63:93,64:95,68:102,69:98,70:100,72:104,73:105,74:107,77:97,78:99,87:D,96:F,97:101,99:103,103:106,105:109,106:113,108:110,109:M,114:26,115:o,125:96,126:C,130:s},e(A,[2,107]),{13:i,16:a,18:51,33:117,35:48,36:49,37:50,38:h,43:53,44:f,92:y,113:52,114:26,115:o,116:55,119:m,120:g,121:59,122:61,123:62,130:s,131:b,132:v,133:_,134:T,135:O,136:w},e(x,[2,22]),e(x,[2,21]),e(x,[2,18]),e(P,[2,109]),e(I,[2,85]),e(k,[2,31]),e(j,[2,113]),e(k,[2,30]),{47:120,48:[1,121],50:119,53:[2,120],65:118},e(U,[2,118],{70:100,68:102,72:104,73:105,74:107,69:122,87:D,96:F,126:C}),e(U,[2,119]),e(B,[2,116]),e(q,[2,128],{79:123}),e(B,[2,35]),e(q,[2,59]),e(B,[2,36],{71:124,66:125,67:V}),e($,[2,61],{100:127,98:128,67:G}),e(Q,[2,38]),{72:130,74:107,87:D,126:C},e(H,[2,64],{104:131,101:132,102:z}),{75:[1,134]},e([13,16,56,85,87,95,115,126,128,129,130],[2,58]),e(K,[2,68]),{13:i,16:a,18:115,38:L,105:135,106:113,114:26,115:o,130:s},{75:[2,124]},{75:[2,125]},e(K,[2,66],{107:136,93:[1,138],110:[1,137],111:[1,139]}),e([13,16,38,115,130],[2,70]),e(X,[2,74]),{13:i,16:a,18:115,38:L,97:140,99:103,103:106,105:109,106:113,108:110,109:M,114:26,115:o,130:s},e(A,[2,19]),{53:[1,141]},{53:[2,121]},{13:i,16:a,18:36,29:142,30:35,114:26,115:o,130:s},e(c,[2,23]),e(B,[2,117]),e(U,[2,41],{114:26,55:74,127:143,88:144,82:145,81:147,84:148,73:149,18:150,86:152,23:154,94:155,13:i,16:a,44:[1,146],56:S,85:W,87:J,95:Y,96:F,115:o,128:Z,129:ee,130:s}),e(B,[2,37],{66:159,67:V}),e(Q,[2,122]),{68:160,72:104,73:105,74:107,87:D,96:F,126:C},e($,[2,62],{98:161,67:G}),e(H,[2,134]),{13:i,16:a,18:115,38:L,99:162,103:106,105:109,106:113,108:110,109:M,114:26,115:o,130:s},e(Q,[2,39]),e(H,[2,65],{101:163,102:z}),e(K,[2,136]),{13:i,16:a,18:115,38:L,103:164,105:109,106:113,108:110,109:M,114:26,115:o,130:s},{13:i,16:a,18:51,35:166,44:te,76:165,92:y,113:52,114:26,115:o,116:55,119:m,120:g,121:59,122:61,123:62,130:s,131:b,132:v,133:_,134:T,135:O,136:w},e(K,[2,69]),e(K,[2,67]),e(K,[2,71]),e(K,[2,72]),e(K,[2,73]),{40:[1,168]},e(j,[2,33]),{48:[1,170],49:169},e(q,[2,129]),e(q,[2,126]),e(q,[2,127]),{89:171,92:[1,172]},e(q,[2,43],{83:173,80:174,67:re}),e(ne,[2,45]),{13:i,16:a,18:150,23:154,55:74,56:S,84:176,85:W,86:152,87:J,94:155,95:Y,114:26,115:o,128:Z,129:ee,130:s},e(ne,[2,47]),e(ne,[2,48]),e(ne,[2,49]),{75:[1,177]},e(ne,[2,51]),e(ne,[2,56]),{13:[1,178]},e(ne,[2,132]),e(ne,[2,133]),e(Q,[2,123]),e(Q,[2,34]),e(H,[2,135]),e(H,[2,60]),e(K,[2,137]),e(K,[2,63]),e(Q,[2,40]),e(ie,[2,76]),e(ae,[2,138],{112:179}),e(X,[2,75]),{53:[2,25]},{53:[2,24]},{90:[1,180]},{90:[2,53]},e(q,[2,44],{80:181,67:re}),e(ne,[2,130]),{13:i,16:a,18:150,23:154,55:74,56:S,73:149,81:182,84:148,85:W,86:152,87:J,94:155,95:Y,96:F,114:26,115:o,128:Z,129:ee,130:s},e(ne,[2,46]),{13:i,16:a,18:51,35:166,44:te,76:183,92:y,113:52,114:26,115:o,116:55,119:m,120:g,121:59,122:61,123:62,130:s,131:b,132:v,133:_,134:T,135:O,136:w},e(ne,[2,57]),{13:i,16:a,18:51,35:185,46:[1,184],92:y,113:52,114:26,115:o,116:55,119:m,120:g,121:59,122:61,123:62,130:s,131:b,132:v,133:_,134:T,135:O,136:w},{91:186,92:[1,187],93:[1,188]},e(ne,[2,131]),e(ne,[2,42]),e(ne,[2,50]),e(ie,[2,77]),e(ae,[2,139]),{46:[1,189]},{46:[2,54]},{46:[2,55]},e(q,[2,52])],defaultActions:{21:[2,1],41:[2,103],70:[2,101],111:[2,124],112:[2,125],119:[2,121],169:[2,25],170:[2,24],172:[2,53],187:[2,54],188:[2,55]},parseError:function(e,t){if(!t.recoverable){var r=new Error(e);throw r.hash=t,r}this.trace(e)},parse:function(e){var t=this,r=[0],n=[null],i=[],a=this.table,o="",s=0,c=0,u=0,l=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(p.yy[h]=this.yy[h]);d.setInput(e,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var f=d.yylloc;i.push(f);var y,m=d.options&&d.options.ranges;"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var g,b,v,_,T,O,w,S,E,A={};;){if(v=r[r.length-1],this.defaultActions[v]?_=this.defaultActions[v]:(null==g&&(y=void 0,"number"!=typeof(y=d.lex()||1)&&(y=t.symbols_[y]||y),g=y),_=a[v]&&a[v][g]),void 0===_||!_.length||!_[0]){var x;for(O in E=[],a[v])this.terminals_[O]&&O>2&&E.push("'"+this.terminals_[O]+"'");x=d.showPosition?"Parse error on line "+(s+1)+":\n"+d.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(s+1)+": Unexpected "+(1==g?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(x,{text:d.match,token:this.terminals_[g]||g,line:d.yylineno,loc:f,expected:E})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(_[0]){case 1:r.push(g),n.push(d.yytext),i.push(d.yylloc),r.push(_[1]),g=null,b?(g=b,b=null):(c=d.yyleng,o=d.yytext,s=d.yylineno,f=d.yylloc,u>0&&u--);break;case 2:if(w=this.productions_[_[1]][1],A.$=n[n.length-w],A._$={first_line:i[i.length-(w||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(w||1)].first_column,last_column:i[i.length-1].last_column},m&&(A._$.range=[i[i.length-(w||1)].range[0],i[i.length-1].range[1]]),void 0!==(T=this.performAction.apply(A,[o,c,s,p.yy,_[1],n,i].concat(l))))return T;w&&(r=r.slice(0,-1*w*2),n=n.slice(0,-1*w),i=i.slice(0,-1*w)),r.push(this.productions_[_[1]][0]),n.push(A.$),i.push(A._$),S=a[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}};const se="http://www.w3.org/1999/02/22-rdf-syntax-ns#",ce=se+"type",ue=se+"first",le=se+"rest",de=se+"nil",pe="http://www.w3.org/2001/XMLSchema#",he=pe+"integer",fe=pe+"decimal",ye=pe+"double",me=pe+"boolean",ge="http://www.w3.org/ns/shacl#",be="http://www.w3.org/2002/07/owl#",ve="http://www.w3.org/2000/01/rdf-schema#",_e={[he]:!0,[fe]:!0,[pe+"float"]:!0,[ye]:!0,[pe+"string"]:!0,[me]:!0,[pe+"dateTime"]:!0,[pe+"nonPositiveInteger"]:!0,[pe+"negativeInteger"]:!0,[pe+"long"]:!0,[pe+"int"]:!0,[pe+"short"]:!0,[pe+"byte"]:!0,[pe+"nonNegativeInteger"]:!0,[pe+"unsignedLong"]:!0,[pe+"unsignedShort"]:!0,[pe+"unsignedByte"]:!0,[pe+"positiveInteger"]:!0,[se+"langString"]:!0};function Te(e,t=!1){let r=0,n=e.length;if(t&&0===n)return je.factory.namedNode(de);const i=head=Ee();return 0===n&&Ie(head,je.factory.namedNode(le),je.factory.namedNode(de)),e.forEach((e=>{if(void 0===e)throw new Error("b");Ie(head,je.factory.namedNode(ue),e),Ie(head,je.factory.namedNode(le),head=++r20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var e,t,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=r,n=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(r,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[n]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{flex:!0,"case-insensitive":!0},performAction:function(e,t,r,n){switch(r){case 0:break;case 1:return 12;case 2:return 14;case 3:return 15;case 4:return 25;case 5:return 20;case 6:return 131;case 7:return 132;case 8:return 85;case 9:return 126;case 10:return 87;case 11:return"PASS";case 12:return"COMMENT";case 13:return 13;case 14:return 16;case 15:return 130;case 16:return 129;case 17:return 128;case 18:return 117;case 19:return 92;case 20:return 119;case 21:return 120;case 22:return"EXPONENT";case 23:return 133;case 24:return 134;case 25:return 135;case 26:return 136;case 27:return 61;case 28:return 90;case 29:return 58;case 30:return 56;case 31:return 38;case 32:return 40;case 33:return 44;case 34:return 46;case 35:return 110;case 36:return 93;case 37:return 111;case 38:return 67;case 39:return 118;case 40:return 53;case 41:return 96;case 42:return 102;case 43:return 75;case 44:return 95;case 45:return 109;case 46:return 28;case 47:return 42;case 48:return 48;case 49:return 115;case 50:return 7;case 51:console.log(t.yytext)}},rules:[/^(?:\s+|#[^\n\r]*)/i,/^(?:BASE)/i,/^(?:IMPORTS)/i,/^(?:PREFIX)/i,/^(?:shapeClass)/i,/^(?:shape)/i,/^(?:true)/i,/^(?:false)/i,/^(?:(BlankNode|IRI|Literal|BlankNodeOrIRI|BlankNodeOrLiteral|IRIOrLiteral\b))/i,/^(?:(targetNode|targetObjectsOf|targetSubjectsOf\b))/i,/^(?:(deactivated|severity|message|class|datatype|nodeKind|minExclusive|minInclusive|maxExclusive|maxInclusive|minLength|maxLength|pattern|flags|languageIn|uniqueLang|equals|disjoint|lessThan|lessThanOrEquals|qualifiedValueShape|qualifiedMinCount|qualifiedMaxCount|qualifiedValueShapesDisjoint|closed|ignoredProperties|hasValue|in))/i,/^(?:([ \t\r\n]+))/i,/^(?:(#[\r\n]*))/i,/^(?:(<([^=<>\"\{\}\|\^`\\\u0000-\u0020]|(\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*>))/i,/^(?:((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])((((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])|_\b)|-|[0-9]|[\u00B7]|[\u0300-\u036F]|[\u203F-\u2040])|\.)*((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])|_\b)|-|[0-9]|[\u00B7]|[\u0300-\u036F]|[\u203F-\u2040]))?)?:))/i,/^(?:(((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])((((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])|_\b)|-|[0-9]|[\u00B7]|[\u0300-\u036F]|[\u203F-\u2040])|\.)*((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])|_\b)|-|[0-9]|[\u00B7]|[\u0300-\u036F]|[\u203F-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))((((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])|_\b)|-|[0-9]|[\u00B7]|[\u0300-\u036F]|[\u203F-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*(((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])|_\b)|-|[0-9]|[\u00B7]|[\u0300-\u036F]|[\u203F-\u2040])|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%)))))?)))/i,/^(?:(@(([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])((((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])|_\b)|-|[0-9]|[\u00B7]|[\u0300-\u036F]|[\u203F-\u2040])|\.)*((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])|_\b)|-|[0-9]|[\u00B7]|[\u0300-\u036F]|[\u203F-\u2040]))?)?:))/i,/^(?:(@((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])((((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])|_\b)|-|[0-9]|[\u00B7]|[\u0300-\u036F]|[\u203F-\u2040])|\.)*((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])|_\b)|-|[0-9]|[\u00B7]|[\u0300-\u036F]|[\u203F-\u2040]))?)?:)(((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])|_\b)|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))((((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])|_\b)|-|[0-9]|[\u00B7]|[\u0300-\u036F]|[\u203F-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*(((([A-Z]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD])|_\b)|-|[0-9]|[\u00B7]|[\u0300-\u036F]|[\u203F-\u2040])|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%)))))?)))/i,/^(?:(@[a-zA-Z]+(-[a-zA-Z0-9]+)*))/i,/^(?:([+-]?[0-9]+))/i,/^(?:([+-]?[0-9]*\.[0-9]+))/i,/^(?:([+-]?([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.?[0-9]+([eE][+-]?[0-9]+))))/i,/^(?:([eE][+-]?[0-9]+))/i,/^(?:('(?:(?:[^\u0027\u005C\u000A\u000D])|(\\[tbnrf\\\"\']))*'))/i,/^(?:("(?:(?:[^\u0022\u005C\u000A\u000D])|(\\[tbnrf\\\"\']))*"))/i,/^(?:('''(?:(?:'|'')?(?:[^'\\]|(\\[tbnrf\\\"\'])))*'''))/i,/^(?:("""(?:(?:"|"")?(?:[^\"\\]|(\\[tbnrf\\\"\'])))*"""))/i,/^(?:->)/i,/^(?:\.\.)/i,/^(?:\})/i,/^(?:\{)/i,/^(?:\()/i,/^(?:\))/i,/^(?:\[)/i,/^(?:\])/i,/^(?:\?)/i,/^(?:\*)/i,/^(?:\+)/i,/^(?:\|)/i,/^(?:\^\^)/i,/^(?:\.)/i,/^(?:!)/i,/^(?:\/)/i,/^(?:=)/i,/^(?:@)/i,/^(?:\^)/i,/^(?:;)/i,/^(?:,)/i,/^(?:%)/i,/^(?:a)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],inclusive:!0}}};function je(){this.yy={}}return oe.lexer=Ne,je.prototype=oe,oe.Parser=je,new je}();e.exports=t},64232:(e,t,r)=>{const n=r(39995).Parser,i=r(54957);class a{constructor(){}parse(e,{extendedSyntax:t,baseIRI:r}={}){this._parser=new n,this._parser.Parser.factory=i.DataFactory,this._parser.Parser.base=i.DataFactory.namedNode(r||"urn:x-base:default"),this._parser.Parser.extended=!0===t,this._parser.Parser.prefixes={rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",sh:"http://www.w3.org/ns/shacl#",xsd:"http://www.w3.org/2001/XMLSchema#",owl:"http://www.w3.org/2002/07/owl#"},this._parser.Parser.currentNodeShape=void 0,this._parser.Parser.currentPropertyNode=void 0,this._parser.Parser.nodeShapeStack=[],this._parser.Parser.tempCurrentNodeShape=void 0,this._parser.Parser.n3Parser=new i.Parser({baseIRI:r||"urn:x-base:default"});const a=[];return this._parser.Parser.onQuad=e=>{a.push(e)},this._parser.parse(e),a.prefixes=this._parser.Parser.prefixes,a}}e.exports.Parser=a,e.exports.parse=function(e,t){return(new a).parse(e,t)}},18181:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfParseXmlRdfa=void 0;const n=r(55252),i=r(72407),a=r(5669);class o extends n.ActorRdfParseFixedMediaTypes{constructor(e){super(e)}async runHandle(e,t,r){const n=e.context.getSafe(i.KeysInitQuery.dataFactory),o=(e.headers&&e.headers.get("content-language"))??void 0;e.data.on("error",(e=>s.emit("error",e)));const s=e.data.pipe(new a.RdfaParser({dataFactory:n,baseIRI:e.metadata?.baseIRI,profile:"xml",language:o}));return{data:s,metadata:{triples:!0}}}}t.ActorRdfParseXmlRdfa=o},12237:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(18181),t)},5669:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7606),t),i(r(28924),t),i(r(60551),t),i(r(64401),t),i(r(34861),t),i(r(44269),t)},7606:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},28924:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},60551:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},64401:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RdfaParser=void 0;const n=r(15482),i=r(58521),a=r(30668),o=r(51172),s=r(34861),c=r(44269);class u extends i.Transform{constructor(e){super({readableObjectMode:!0}),this.activeTagStack=[],e=e||{},this.options=e,this.util=new c.Util(e.dataFactory,e.baseIRI),this.defaultGraph=e.defaultGraph||this.util.dataFactory.defaultGraph();const t=e.contentType?c.Util.contentTypeToProfile(e.contentType):e.profile||"";this.features=e.features||s.RDFA_FEATURES[t],this.htmlParseListener=e.htmlParseListener,this.rdfaPatterns=this.features.copyRdfaPatterns?{}:null,this.pendingRdfaPatternCopies=this.features.copyRdfaPatterns?{}:null,this.parser=this.initializeParser("xml"===t),this.activeTagStack.push({incompleteTriples:[],inlist:!1,language:e.language,listMapping:{},listMappingLocal:{},name:"",prefixesAll:Object.assign(Object.assign({},o["@context"]),this.features.xhtmlInitialContext?a["@context"]:{}),prefixesCustom:{},skipElement:!1,vocab:e.vocab})}import(e){const t=new i.PassThrough({readableObjectMode:!0});e.on("error",(e=>r.emit("error",e))),e.on("data",(e=>t.push(e))),e.on("end",(()=>t.push(null)));const r=t.pipe(new u(this.options));return r}_transform(e,t,r){this.parser.write(e.toString()),r()}_flush(e){this.parser.end(),e()}onTagOpen(e,t){let r=this.activeTagStack.length-1;for(;r>0&&this.activeTagStack[r].skipElement;)r--;let n=this.activeTagStack[r];r!==this.activeTagStack.length-1&&(n=Object.assign(Object.assign({},n),{language:this.activeTagStack[this.activeTagStack.length-1].language,prefixesAll:this.activeTagStack[this.activeTagStack.length-1].prefixesAll,prefixesCustom:this.activeTagStack[this.activeTagStack.length-1].prefixesCustom,vocab:this.activeTagStack[this.activeTagStack.length-1].vocab}));const i={collectChildTags:n.collectChildTags,collectChildTagsForCurrentTag:n.collectChildTagsForCurrentTag,incompleteTriples:[],inlist:"inlist"in t,listMapping:[],listMappingLocal:n.listMapping,localBaseIRI:n.localBaseIRI,name:e,prefixesAll:null,prefixesCustom:null,skipElement:!1};if(this.activeTagStack.push(i),i.collectChildTags){for(const e of Object.keys(n.prefixesCustom).sort()){const r=n.prefixesCustom[e],i=""===e?"xmlns":"xmlns:"+e;i in t||(t[i]=r)}const r=Object.keys(t).map((e=>`${e}="${t[e]}"`)).join(" ");if(i.textWithTags=[`<${e}${r?" "+r:""}>`],this.features.skipHandlingXmlLiteralChildren)return}let a,o,s,u=!0,l=!0;if(this.features.onlyAllowUriRelRevIfProperty&&("property"in t&&"rel"in t&&(u=!1,t.rel.indexOf(":")<0&&delete t.rel),"property"in t&&"rev"in t&&(l=!1,t.rev.indexOf(":")<0&&delete t.rev)),this.features.copyRdfaPatterns){if(n.collectedPatternTag){const r={attributes:t,children:[],name:e,referenced:!1,rootPattern:!1,text:[]};return n.collectedPatternTag.children.push(r),void(i.collectedPatternTag=r)}if("rdfa:Pattern"===t.typeof)return void(i.collectedPatternTag={attributes:t,children:[],name:e,parentTag:n,referenced:!1,rootPattern:!0,text:[]});if("rdfa:copy"===t.property){const e=t.resource||t.href||t.src;return void(this.rdfaPatterns[e]?this.emitPatternCopy(n,this.rdfaPatterns[e],e):(this.pendingRdfaPatternCopies[e]||(this.pendingRdfaPatternCopies[e]=[]),this.pendingRdfaPatternCopies[e].push(n)))}}if(this.features.baseTag&&"base"===e&&t.href&&(this.util.baseIRI=this.util.getBaseIRI(t.href)),this.features.xmlBase&&t["xml:base"]&&(i.localBaseIRI=this.util.getBaseIRI(t["xml:base"])),this.features.timeTag&&"time"===e&&!t.datatype&&(i.interpretObjectAsTime=!0),"vocab"in t?t.vocab?(i.vocab=t.vocab,this.emitTriple(this.util.getBaseIriTerm(i),this.util.dataFactory.namedNode(c.Util.RDFA+"usesVocabulary"),this.util.dataFactory.namedNode(i.vocab))):i.vocab=this.activeTagStack[0].vocab:i.vocab=n.vocab,i.prefixesCustom=c.Util.parsePrefixes(t,n.prefixesCustom,this.features.xmlnsPrefixMappings),i.prefixesAll=Object.keys(i.prefixesCustom).length>0?Object.assign(Object.assign({},n.prefixesAll),i.prefixesCustom):n.prefixesAll,this.features.roleAttribute&&t.role){const e=t.id?this.util.createIri("#"+t.id,i,!1,!1,!1):this.util.createBlankNode(),r=i.vocab;i.vocab="http://www.w3.org/1999/xhtml/vocab#";for(const r of this.util.createVocabIris(t.role,i,!0,!1))this.emitTriple(e,this.util.dataFactory.namedNode("http://www.w3.org/1999/xhtml/vocab#role"),r);i.vocab=r}"xml:lang"in t||this.features.langAttribute&&"lang"in t?i.language=t["xml:lang"]||t.lang:i.language=n.language;const d=2===this.activeTagStack.length;if("rel"in t||"rev"in t?("about"in t?(a=this.util.createIri(t.about,i,!1,!0,!0),i.explicitNewSubject=!!a,"typeof"in t&&(s=a)):d?a=!0:n.object&&(a=n.object),"resource"in t&&(o=this.util.createIri(t.resource,i,!1,!0,!0)),o||("href"in t||"src"in t?o=this.util.createIri(t.href||t.src,i,!1,!1,!0):!("typeof"in t)||"about"in t||this.isInheritSubjectInHeadBody(e)||(o=this.util.createBlankNode())),"typeof"in t&&!("about"in t)&&(s=this.isInheritSubjectInHeadBody(e)?a:o)):!("property"in t)||"content"in t||"datatype"in t?(("about"in t||"resource"in t)&&(a=this.util.createIri(t.about||t.resource,i,!1,!0,!0),i.explicitNewSubject=!!a),a||!("href"in t)&&!("src"in t)||(a=this.util.createIri(t.href||t.src,i,!1,!1,!0),i.explicitNewSubject=!!a),a||(d?a=!0:this.isInheritSubjectInHeadBody(e)?a=n.object:"typeof"in t?(a=this.util.createBlankNode(),i.explicitNewSubject=!0):n.object&&(a=n.object,"property"in t||(i.skipElement=!0))),"typeof"in t&&(s=a)):("about"in t?(a=this.util.createIri(t.about,i,!1,!0,!0),i.explicitNewSubject=!!a):d?a=!0:n.object&&(a=n.object),"typeof"in t&&("about"in t&&(s=this.util.createIri(t.about,i,!1,!0,!0)),!s&&d&&(s=!0),!s&&"resource"in t&&(s=this.util.createIri(t.resource,i,!1,!0,!0)),s||!("href"in t)&&!("src"in t)||(s=this.util.createIri(t.href||t.src,i,!1,!1,!0)),!s&&this.isInheritSubjectInHeadBody(e)&&(s=a),s||(s=this.util.createBlankNode()),o=s)),s)for(const e of this.util.createVocabIris(t.typeof,i,!0,!0))this.emitTriple(this.util.getResourceOrBaseIri(s,i),this.util.dataFactory.namedNode(c.Util.RDF+"type"),e);if(a&&(i.listMapping={}),o){if("rel"in t&&"inlist"in t)for(const e of this.util.createVocabIris(t.rel,i,u,!1))this.addListMapping(i,a,e,o);if(!("rel"in t)||!("inlist"in t)){if("rel"in t)for(const e of this.util.createVocabIris(t.rel,i,u,!1))this.emitTriple(this.util.getResourceOrBaseIri(a,i),e,this.util.getResourceOrBaseIri(o,i));if("rev"in t)for(const e of this.util.createVocabIris(t.rev,i,l,!1))this.emitTriple(this.util.getResourceOrBaseIri(o,i),e,this.util.getResourceOrBaseIri(a,i))}}if(!o){if("rel"in t)if("inlist"in t)for(const e of this.util.createVocabIris(t.rel,i,u,!1))this.addListMapping(i,a,e,null),i.incompleteTriples.push({predicate:e,reverse:!1,list:!0});else for(const e of this.util.createVocabIris(t.rel,i,u,!1))i.incompleteTriples.push({predicate:e,reverse:!1});if("rev"in t)for(const e of this.util.createVocabIris(t.rev,i,l,!1))i.incompleteTriples.push({predicate:e,reverse:!0});i.incompleteTriples.length>0&&(o=this.util.createBlankNode())}if("property"in t){let e;if(i.predicates=this.util.createVocabIris(t.property,i,!0,!1),"datatype"in t?(i.datatype=this.util.createIri(t.datatype,i,!0,!0,!1),i.datatype&&(i.datatype.value===c.Util.RDF+"XMLLiteral"||this.features.htmlDatatype&&i.datatype.value===c.Util.RDF+"HTML")&&(i.collectChildTags=!0,i.collectChildTagsForCurrentTag=!0)):("rev"in t||"rel"in t||"content"in t||("resource"in t&&(e=this.util.createIri(t.resource,i,!1,!0,!0)),!e&&"href"in t&&(e=this.util.createIri(t.href,i,!1,!1,!0)),!e&&"src"in t&&(e=this.util.createIri(t.src,i,!1,!1,!0))),"typeof"in t&&!("about"in t)&&(e=s)),"datatype"in t&&""!==t.datatype||(i.collectChildTagsForCurrentTag=!1),"content"in t){const e=this.util.createLiteral(t.content,i);if("inlist"in t)for(const t of i.predicates)this.addListMapping(i,a,t,e);else{const t=this.util.getResourceOrBaseIri(a,i);for(const r of i.predicates)this.emitTriple(t,r,e)}i.predicates=null}else if(this.features.datetimeAttribute&&"datetime"in t){i.interpretObjectAsTime=!0;const e=this.util.createLiteral(t.datetime,i);if("inlist"in t)for(const t of i.predicates)this.addListMapping(i,a,t,e);else{const t=this.util.getResourceOrBaseIri(a,i);for(const r of i.predicates)this.emitTriple(t,r,e)}i.predicates=null}else if(e){const r=this.util.getResourceOrBaseIri(e,i);if("inlist"in t)for(const e of i.predicates)this.addListMapping(i,a,e,r);else{const e=this.util.getResourceOrBaseIri(a,i);for(const t of i.predicates)this.emitTriple(e,t,r)}i.predicates=null}}let p=!1;if(!i.skipElement&&a&&n.incompleteTriples.length>0){p=!0;const e=this.util.getResourceOrBaseIri(n.subject,i),t=this.util.getResourceOrBaseIri(a,i);for(const r of n.incompleteTriples)if(r.reverse)this.emitTriple(t,r.predicate,e);else if(r.list){let e=null;for(let t=this.activeTagStack.length-1;t>=0;t--)if(this.activeTagStack[t].inlist){e=this.activeTagStack[t];break}this.addListMapping(e,a,r.predicate,t)}else this.emitTriple(e,r.predicate,t)}!p&&n.incompleteTriples.length>0&&(i.incompleteTriples=i.incompleteTriples.concat(n.incompleteTriples)),i.subject=a||n.subject,i.object=o||a}onText(e){const t=this.activeTagStack[this.activeTagStack.length-1];this.features.copyRdfaPatterns&&t.collectedPatternTag?t.collectedPatternTag.text.push(e):(t.textWithTags||(t.textWithTags=[]),t.textWithoutTags||(t.textWithoutTags=[]),t.textWithTags.push(e),t.textWithoutTags.push(e))}onTagClose(){const e=this.activeTagStack[this.activeTagStack.length-1],t=this.activeTagStack[this.activeTagStack.length-2];if(!(e.collectChildTags&&t.collectChildTags&&this.features.skipHandlingXmlLiteralChildren)){if(this.features.copyRdfaPatterns&&e.collectedPatternTag&&e.collectedPatternTag.rootPattern){const t=e.collectedPatternTag.attributes.resource;if(delete e.collectedPatternTag.attributes.resource,delete e.collectedPatternTag.attributes.typeof,this.rdfaPatterns[t]=e.collectedPatternTag,this.pendingRdfaPatternCopies[t]){for(const r of this.pendingRdfaPatternCopies[t])this.emitPatternCopy(r,e.collectedPatternTag,t);delete this.pendingRdfaPatternCopies[t]}return void this.activeTagStack.pop()}if(e.predicates){const r=this.util.getResourceOrBaseIri(e.subject,e);let n;e.collectChildTagsForCurrentTag?(n=e.textWithTags||[],e.collectChildTags&&t.collectChildTags&&(n=n.slice(1))):n=e.textWithoutTags||[];const i=this.util.createLiteral(n.join(""),e);if(e.inlist)for(const t of e.predicates)this.addListMapping(e,r,t,i);else for(const t of e.predicates)this.emitTriple(r,t,i);t.predicates||(e.textWithoutTags=null,e.textWithTags=null)}if(e.object&&Object.keys(e.listMapping).length>0){const t=this.util.getResourceOrBaseIri(e.object,e);for(const r in e.listMapping){const n=this.util.dataFactory.namedNode(r),i=e.listMapping[r];if(i.length>0){const r=i.map((()=>this.util.createBlankNode()));for(let t=0;t`),e.textWithTags&&t&&(t.textWithTags?t.textWithTags=t.textWithTags.concat(e.textWithTags):t.textWithTags=e.textWithTags),e.textWithoutTags&&t&&(t.textWithoutTags?t.textWithoutTags=t.textWithoutTags.concat(e.textWithoutTags):t.textWithoutTags=e.textWithoutTags)}onEnd(){if(this.features.copyRdfaPatterns){this.features.copyRdfaPatterns=!1;for(const e in this.rdfaPatterns){const t=this.rdfaPatterns[e];t.referenced||(t.attributes.typeof="rdfa:Pattern",t.attributes.resource=e,this.emitPatternCopy(t.parentTag,t,e),t.referenced=!1,delete t.attributes.typeof,delete t.attributes.resource)}for(const e in this.pendingRdfaPatternCopies)for(const t of this.pendingRdfaPatternCopies[e])this.activeTagStack.push(t),this.onTagOpen("link",{property:"rdfa:copy",href:e}),this.onTagClose(),this.activeTagStack.pop();this.features.copyRdfaPatterns=!0}}isInheritSubjectInHeadBody(e){return this.features.inheritSubjectInHeadBody&&("head"===e||"body"===e)}addListMapping(e,t,r,n){if(e.explicitNewSubject){const i=this.util.createBlankNode();this.emitTriple(this.util.getResourceOrBaseIri(t,e),r,i),this.emitTriple(i,this.util.dataFactory.namedNode(c.Util.RDF+"first"),this.util.getResourceOrBaseIri(n,e)),this.emitTriple(i,this.util.dataFactory.namedNode(c.Util.RDF+"rest"),this.util.dataFactory.namedNode(c.Util.RDF+"nil"))}else{let t=e.listMappingLocal[r.value];t||(e.listMappingLocal[r.value]=t=[]),n&&t.push(n)}}emitTriple(e,t,r){"NamedNode"===e.termType&&e.value.indexOf(":")<0||"NamedNode"===t.termType&&t.value.indexOf(":")<0||"NamedNode"===r.termType&&r.value.indexOf(":")<0||this.push(this.util.dataFactory.quad(e,t,r,this.defaultGraph))}emitPatternCopy(e,t,r){if(this.activeTagStack.push(e),t.referenced=!0,t.constructedBlankNodes){let e=0;this.util.blankNodeFactory=()=>t.constructedBlankNodes[e++]}else t.constructedBlankNodes=[],this.util.blankNodeFactory=()=>{const e=this.util.dataFactory.blankNode();return t.constructedBlankNodes.push(e),e};this.emitPatternCopyAbsolute(t,!0,r),this.util.blankNodeFactory=null,this.activeTagStack.pop()}emitPatternCopyAbsolute(e,t,r){if(t||"rdfa:copy"!==e.attributes.property||e.attributes.href!==r){this.onTagOpen(e.name,e.attributes);for(const t of e.text)this.onText(t);for(const t of e.children)this.emitPatternCopyAbsolute(t,!1,r);this.onTagClose()}}initializeParser(e){return new n.Parser({onclosetag:()=>{try{this.onTagClose(),this.htmlParseListener&&this.htmlParseListener.onTagClose()}catch(e){this.emit("error",e)}},onend:()=>{try{this.onEnd(),this.htmlParseListener&&this.htmlParseListener.onEnd()}catch(e){this.emit("error",e)}},onopentag:(e,t)=>{try{this.onTagOpen(e,t),this.htmlParseListener&&this.htmlParseListener.onTagOpen(e,t)}catch(e){this.emit("error",e)}},ontext:e=>{try{this.onText(e),this.htmlParseListener&&this.htmlParseListener.onText(e)}catch(e){this.emit("error",e)}}},{decodeEntities:!0,recognizeSelfClosing:!0,xmlMode:e})}}t.RdfaParser=u},34861:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RDFA_CONTENTTYPES=t.RDFA_FEATURES=void 0,t.RDFA_FEATURES={"":{baseTag:!0,xmlBase:!0,langAttribute:!0,onlyAllowUriRelRevIfProperty:!0,inheritSubjectInHeadBody:!0,datetimeAttribute:!0,timeTag:!0,htmlDatatype:!0,copyRdfaPatterns:!0,xmlnsPrefixMappings:!0,xhtmlInitialContext:!0,roleAttribute:!0},core:{baseTag:!1,xmlBase:!1,langAttribute:!0,onlyAllowUriRelRevIfProperty:!0,inheritSubjectInHeadBody:!1,datetimeAttribute:!1,timeTag:!1,htmlDatatype:!1,copyRdfaPatterns:!0,xmlnsPrefixMappings:!0,xhtmlInitialContext:!1,roleAttribute:!1},html:{baseTag:!0,xmlBase:!1,langAttribute:!0,onlyAllowUriRelRevIfProperty:!0,inheritSubjectInHeadBody:!0,datetimeAttribute:!0,timeTag:!0,htmlDatatype:!0,copyRdfaPatterns:!0,xmlnsPrefixMappings:!0,xhtmlInitialContext:!1,roleAttribute:!0},xhtml:{baseTag:!0,xmlBase:!1,langAttribute:!0,onlyAllowUriRelRevIfProperty:!0,inheritSubjectInHeadBody:!0,datetimeAttribute:!0,timeTag:!0,htmlDatatype:!0,copyRdfaPatterns:!0,xmlnsPrefixMappings:!0,xhtmlInitialContext:!0,roleAttribute:!0},xml:{baseTag:!1,xmlBase:!0,langAttribute:!0,onlyAllowUriRelRevIfProperty:!1,inheritSubjectInHeadBody:!1,datetimeAttribute:!0,timeTag:!0,htmlDatatype:!1,copyRdfaPatterns:!1,xmlnsPrefixMappings:!0,xhtmlInitialContext:!1,roleAttribute:!0}},t.RDFA_CONTENTTYPES={"text/html":"html","application/xhtml+xml":"xhtml","application/xml":"xml","text/xml":"xml","image/svg+xml":"xml"}},44269:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=void 0;const n=r(15430),i=r(34861),a=r(18050);class o{constructor(e,t){this.dataFactory=e||new a.DataFactory,this.baseIRI=this.dataFactory.namedNode(t||""),this.baseIRIDocument=this.baseIRI}static parsePrefixes(e,t,r){const n={};if(r)for(const t in e)t.startsWith("xmlns")&&(n[t.substr(6)]=e[t]);if(e.prefix||Object.keys(n).length>0){const r=Object.assign(Object.assign({},t),n);if(e.prefix){let t;for(;t=o.PREFIX_REGEX.exec(e.prefix);)r[t[1]]=t[2]}return r}return t}static expandPrefixedTerm(e,t){const r=e.indexOf(":");let n,i;if(r>=0&&(n=e.substr(0,r),i=e.substr(r+1)),""===n)return"http://www.w3.org/1999/xhtml/vocab#"+i;if(n){const e=t.prefixesAll[n];if(e)return e+i}if(e){const r=t.prefixesAll[e.toLocaleLowerCase()];if(r)return r}return e}static isValidIri(e){return o.IRI_REGEX.test(e)}static contentTypeToProfile(e){return i.RDFA_CONTENTTYPES[e]||""}getBaseIRI(e){let t=e;const r=t.indexOf("#");return r>=0&&(t=t.substr(0,r)),this.dataFactory.namedNode((0,n.resolve)(t,this.baseIRI.value))}getResourceOrBaseIri(e,t){return!0===e?this.getBaseIriTerm(t):e}getBaseIriTerm(e){return e.localBaseIRI||this.baseIRI}createVocabIris(e,t,r,n){return e.split(/\s+/).filter((e=>e&&(r||e.indexOf(":")>=0))).map((e=>this.createIri(e,t,!0,!0,n))).filter((e=>null!=e))}createLiteral(e,t){var r;if(t.interpretObjectAsTime&&!t.datatype)for(const r of o.TIME_REGEXES)if(e.match(r.regex)){t.datatype=this.dataFactory.namedNode(o.XSD+r.type);break}return this.dataFactory.literal(e,t.datatype||(null===(r=t.language)||void 0===r?void 0:r.toLowerCase()))}createBlankNode(){return this.blankNodeFactory?this.blankNodeFactory():this.dataFactory.blankNode()}createIri(e,t,r,i,a){if(e=e||"",!i)return r||(e=(0,n.resolve)(e,this.getBaseIriTerm(t).value)),o.isValidIri(e)?this.dataFactory.namedNode(e):null;if(e.length>0&&"["===e[0]&&"]"===e[e.length-1]&&(e=e.substr(1,e.length-2)).indexOf(":")<0)return null;if(e.startsWith("_:"))return a?this.dataFactory.blankNode(e.substr(2)||"b_identity"):null;if(r&&t.vocab&&e.indexOf(":")<0)return this.dataFactory.namedNode(t.vocab+e);let s=o.expandPrefixedTerm(e,t);return r?e!==s&&(s=(0,n.resolve)(s,this.baseIRIDocument.value)):s=(0,n.resolve)(s,this.getBaseIriTerm(t).value),o.isValidIri(s)?this.dataFactory.namedNode(s):null}}t.Util=o,o.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",o.XSD="http://www.w3.org/2001/XMLSchema#",o.RDFA="http://www.w3.org/ns/rdfa#",o.PREFIX_REGEX=/\s*([^:\s]*)*:\s*([^\s]*)*\s*/g,o.TIME_REGEXES=[{regex:/^-?P([0-9]+Y)?([0-9]+M)?([0-9]+D)?(T([0-9]+H)?([0-9]+M)?([0-9]+(\.[0-9])?S)?)?$/,type:"duration"},{regex:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,type:"dateTime"},{regex:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,type:"date"},{regex:/^[0-9][0-9]:[0-9][0-9]:[0-9][0-9]((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,type:"time"},{regex:/^[0-9]+-[0-9][0-9]$/,type:"gYearMonth"},{regex:/^[0-9]+$/,type:"gYear"}],o.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^ "<>{}|\\\[\]`]*$/},15430:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(10646),t)},10646:(e,t)=>{"use strict";function r(e){const t=[];let r=0;for(;re.join(""))).join("/")}function n(e,t){let n=t+1;t>=0?"/"===e[t+1]&&"/"===e[t+2]&&(n=t+3):"/"===e[0]&&"/"===e[1]&&(n=2);const i=e.indexOf("/",n);return i<0?e:e.substr(0,i)+r(e.substr(i))}function i(e){return!e||"#"===e||"?"===e||"/"===e}Object.defineProperty(t,"__esModule",{value:!0}),t.removeDotSegmentsOfPath=t.removeDotSegments=t.resolve=void 0,t.resolve=function(e,t){const i=(t=t||"").indexOf("#");if(i>0&&(t=t.substr(0,i)),!e.length){if(t.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);return t}if(e.startsWith("?")){const r=t.indexOf("?");return r>0&&(t=t.substr(0,r)),t+e}if(e.startsWith("#"))return t+e;if(!t.length){const t=e.indexOf(":");if(t<0)throw new Error(`Found invalid relative IRI '${e}' for a missing baseIRI`);return n(e,t)}const a=e.indexOf(":");if(a>=0)return n(e,a);const o=t.indexOf(":");if(o<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);const s=t.substr(0,o+1);if(0===e.indexOf("//"))return s+n(e,a);let c;if(t.indexOf("//",o)===o+1){if(c=t.indexOf("/",o+3),c<0)return t.length>o+3?t+"/"+n(e,a):s+n(e,a)}else if(c=t.indexOf("/",o+1),c<0)return s+n(e,a);if(0===e.indexOf("/"))return t.substr(0,c)+r(e);let u=t.substr(c);const l=u.lastIndexOf("/");return l>=0&&l{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfResolveHypermediaLinksNext=void 0;const n=r(79432),i=r(97356);class a extends n.ActorRdfResolveHypermediaLinks{constructor(e){super(e)}async test(e){return e.metadata.next&&0!==e.metadata.next.length?(0,i.passTestVoid)():(0,i.failTest)(`Actor ${this.name} requires a 'next' metadata entry.`)}async run(e){return{links:e.metadata.next.map((e=>({url:e})))}}}t.ActorRdfResolveHypermediaLinksNext=a},18409:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(98528),t)},26885:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfResolveHypermediaLinksQueueFifo=void 0;const n=r(17498),i=r(97356),a=r(2313);class o extends n.ActorRdfResolveHypermediaLinksQueue{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){return{linkQueue:new a.LinkQueueFifo}}}t.ActorRdfResolveHypermediaLinksQueueFifo=o},2313:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkQueueFifo=void 0,t.LinkQueueFifo=class{links=[];push(e){return this.links.push(e),!0}getSize(){return this.links.length}isEmpty(){return 0===this.links.length}pop(){return this.links.shift()}peek(){return this.links[0]}}},24092:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(26885),t),i(r(2313),t)},58862:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfSerializeJsonLd=void 0;const n=r(9101),i=r(85832);class a extends n.ActorRdfSerializeFixedMediaTypes{jsonStringifyIndentSpaces;constructor(e){super(e),this.jsonStringifyIndentSpaces=e.jsonStringifyIndentSpaces}async runHandle(e,t,r){const n=new i.JsonLdSerializer({space:" ".repeat(this.jsonStringifyIndentSpaces)});let a;return"pipe"in e.quadStream?(e.quadStream.on("error",(e=>n.emit("error",e))),a=e.quadStream.pipe(n)):a=n.import(e.quadStream),{data:a}}}t.ActorRdfSerializeJsonLd=a},82123:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(58862),t)},78586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfSerializeN3=void 0;const n=r(9101),i=r(72407),a=r(54957);class o extends n.ActorRdfSerializeFixedMediaTypes{constructor(e){super(e)}async runHandle(e,t){const r=new a.StreamWriter({format:t,prefixes:e.context.get(i.KeysRdfSerialize.rdfSerializationPrefixes)});let n;return"pipe"in e.quadStream?(e.quadStream.on("error",(e=>r.emit("error",e))),n=e.quadStream.pipe(r)):n=r.import(e.quadStream),{data:n,triples:"text/turtle"===t||"application/n-triples"===t||"text/n3"===t}}}t.ActorRdfSerializeN3=o},20738:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(78586),t)},85282:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfSerializeShaclc=void 0;const i=r(9101),a=n(r(37754)),o=r(58521),s=r(22939);class c extends i.ActorRdfSerializeFixedMediaTypes{constructor(e){super(e)}async runHandle(e,t){const r=new o.Readable;r._read=()=>{};try{const n={};e.quadStream.on("prefix",((e,t)=>{n[e]=t}));const{text:i}=await(0,s.write)(await(0,a.default)(e.quadStream),{errorOnUnused:!0,extendedSyntax:"text/shaclc-ext"===t,prefixes:n});r.push(i),r.push(null)}catch(e){r._read=()=>{r.emit("error",e)}}return{data:r,triples:!0}}}t.ActorRdfSerializeShaclc=c},47459:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(85282),t)},46443:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfUpdateHypermediaPatchSparqlUpdate=void 0;const n=r(78181),i=r(97356),a=r(9588);class o extends n.ActorRdfUpdateHypermedia{mediatorHttp;constructor(e){super(e,"patchSparqlUpdate"),this.mediatorHttp=e.mediatorHttp}async testMetadata(e){return e.forceDestinationType||e.metadata.patchSparqlUpdate?e.forceDestinationType||e.exists?(0,i.passTestVoid)():(0,i.failTest)(`Actor ${this.name} can only patch a destination that already exists.`):(0,i.failTest)(`Actor ${this.name} could not detect a destination with 'application/sparql-update' as 'Accept-Patch' header.`)}async run(e){return this.logInfo(e.context,`Identified as patchSparqlUpdate destination: ${e.url}`),{destination:new a.QuadDestinationPatchSparqlUpdate(e.url,e.context,this.mediatorHttp)}}}t.ActorRdfUpdateHypermediaPatchSparqlUpdate=o},9588:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuadDestinationPatchSparqlUpdate=void 0;const n=r(62034),i=r(76664),a=r(64817),o=r(58521);t.QuadDestinationPatchSparqlUpdate=class{url;context;mediatorHttp;constructor(e,t,r){this.url=e,this.context=t,this.mediatorHttp=r}async update(e){const t=this.createCombinedQuadsQuery(e.insert,e.delete);await this.wrapSparqlUpdateRequest(t)}createCombinedQuadsQuery(e,t){return new i.ArrayIterator([],{autoStart:!1}).append(this.createQuadsQuery("DELETE",t)).append(t&&e?[" ;\n"]:[]).append(this.createQuadsQuery("INSERT",e))}createQuadsQuery(e,t){return t?t.map((e=>{let t=`${(0,a.termToString)(e.subject)} ${(0,a.termToString)(e.predicate)} ${(0,a.termToString)(e.object)} .`;return t="DefaultGraph"===e.graph.termType?` ${t}\n`:` GRAPH ${(0,a.termToString)(e.graph)} { ${t} }\n`,t})).prepend([`${e} DATA {\n`]).append(["}"]):new i.ArrayIterator([],{autoStart:!1})}async wrapSparqlUpdateRequest(e){const t=new o.Readable;t.wrap(e);const r=new Headers({"content-type":"application/sparql-update"}),i=await this.mediatorHttp.mediate({context:this.context,init:{headers:r,method:"PATCH",body:n.ActorHttp.toWebReadableStream(t)},input:this.url});await(0,n.validateAndCloseHttpResponse)(this.url,i)}async deleteGraphs(e,t,r){throw new Error("Patch-based SPARQL Update destinations don't support named graphs")}async createGraphs(e,t){throw new Error("Patch-based SPARQL Update destinations don't support named graphs")}}},51797:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(46443),t),i(r(9588),t)},30120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfUpdateHypermediaPutLdp=void 0;const n=r(78181),i=r(97356),a=r(42429);class o extends n.ActorRdfUpdateHypermedia{mediatorHttp;mediatorRdfSerializeMediatypes;mediatorRdfSerialize;constructor(e){super(e,"putLdp"),this.mediatorHttp=e.mediatorHttp,this.mediatorRdfSerializeMediatypes=e.mediatorRdfSerializeMediatypes,this.mediatorRdfSerialize=e.mediatorRdfSerialize}async testMetadata(e){if(!e.forceDestinationType){if(!e.metadata.allowHttpMethods||!e.metadata.allowHttpMethods.includes("PUT"))return(0,i.failTest)(`Actor ${this.name} could not detect a destination with 'Allow: PUT' header.`);if(e.exists)return(0,i.failTest)(`Actor ${this.name} can only put on a destination that does not already exists.`)}return(0,i.passTestVoid)()}async run(e){return this.logInfo(e.context,`Identified as putLdp destination: ${e.url}`),{destination:new a.QuadDestinationPutLdp(e.url,e.context,e.metadata.putAccepted||[],this.mediatorHttp,this.mediatorRdfSerializeMediatypes,this.mediatorRdfSerialize)}}}t.ActorRdfUpdateHypermediaPutLdp=o},42429:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuadDestinationPutLdp=void 0;const n=r(62034);t.QuadDestinationPutLdp=class{url;context;mediaTypes;mediatorHttp;mediatorRdfSerializeMediatypes;mediatorRdfSerialize;constructor(e,t,r,n,i,a){this.url=e,this.context=t,this.mediaTypes=r,this.mediatorHttp=n,this.mediatorRdfSerializeMediatypes=i,this.mediatorRdfSerialize=a}async update(e){if(e.delete)throw new Error("Put-based LDP destinations don't support deletions");e.insert&&await this.wrapRdfUpdateRequest("INSERT",e.insert)}async wrapRdfUpdateRequest(e,t){const{mediaTypes:r}=await this.mediatorRdfSerializeMediatypes.mediate({context:this.context,mediaTypes:!0}),i=this.mediaTypes.filter((e=>e in r)),a=i.length>0?i[0]:Object.keys(r).sort(((e,t)=>r[t]-r[e]))[0],{handle:{data:o}}=await this.mediatorRdfSerialize.mediate({context:this.context,handle:{quadStream:t,context:this.context},handleMediaType:a}),s=new Headers({"content-type":a}),c=await this.mediatorHttp.mediate({context:this.context,init:{headers:s,method:"PUT",body:n.ActorHttp.toWebReadableStream(o)},input:this.url});await(0,n.validateAndCloseHttpResponse)(this.url,c)}async deleteGraphs(e,t,r){throw new Error("Put-based LDP destinations don't support named graphs")}async createGraphs(e,t){throw new Error("Put-based LDP destinations don't support named graphs")}}},48019:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(30120),t),i(r(42429),t)},72295:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfUpdateHypermediaSparql=void 0;const n=r(78181),i=r(72407),a=r(97356),o=r(41864);class s extends n.ActorRdfUpdateHypermedia{mediatorHttp;checkUrlSuffixSparql;checkUrlSuffixUpdate;constructor(e){super(e,"sparql"),this.mediatorHttp=e.mediatorHttp,this.checkUrlSuffixSparql=e.checkUrlSuffixSparql,this.checkUrlSuffixUpdate=e.checkUrlSuffixUpdate}async testMetadata(e){return e.forceDestinationType||e.metadata.sparqlService||this.checkUrlSuffixSparql&&(e.url.endsWith("/sparql")||e.url.endsWith("/sparql/"))||this.checkUrlSuffixUpdate&&(e.url.endsWith("/update")||e.url.endsWith("/update/"))?(0,a.passTestVoid)():(0,a.failTest)(`Actor ${this.name} could not detect a SPARQL service description or URL ending on /sparql or /update.`)}async run(e){this.logInfo(e.context,`Identified as sparql destination: ${e.url}`);const t=e.context.getSafe(i.KeysInitQuery.dataFactory);return{destination:new o.QuadDestinationSparql(e.metadata.sparqlService||e.url,e.context,this.mediatorHttp,t,Boolean(e.context.get(i.KeysInitQuery.parseUnsupportedVersions)))}}}t.ActorRdfUpdateHypermediaSparql=s},41864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuadDestinationSparql=void 0;const n=r(31759),i=r(76664),a=r(74190),o=r(64817);t.QuadDestinationSparql=class{url;context;mediatorHttp;endpointFetcher;constructor(e,t,r,n,i){this.url=e,this.context=t,this.mediatorHttp=r,this.endpointFetcher=new a.SparqlEndpointFetcher({fetch:(e,t)=>this.mediatorHttp.mediate({input:e,init:t,context:this.context}),prefixVariableQuestionMark:!0,dataFactory:n,parseUnsupportedVersions:i})}async update(e){const t=this.createCombinedQuadsQuery(e.insert,e.delete);await this.wrapSparqlUpdateRequest(t)}createCombinedQuadsQuery(e,t){return new i.ArrayIterator([],{autoStart:!1}).append(this.createQuadsQuery("DELETE",t)).append(t&&e?[" ;\n"]:[]).append(this.createQuadsQuery("INSERT",e))}createQuadsQuery(e,t){return t?t.map((e=>{let t=`${(0,o.termToString)(e.subject)} ${(0,o.termToString)(e.predicate)} ${(0,o.termToString)(e.object)} .`;return t="DefaultGraph"===e.graph.termType?` ${t}\n`:` GRAPH ${(0,o.termToString)(e.graph)} { ${t} }\n`,t})).prepend([`${e} DATA {\n`]).append(["}"]):new i.ArrayIterator([],{autoStart:!1})}async wrapSparqlUpdateRequest(e){const t=await(0,n.stringify)(e);await this.endpointFetcher.fetchUpdate(this.url,t)}async deleteGraphs(e,t,r){const n=Array.isArray(e)?e:[e],i=[];for(const e of n){let n;n="string"==typeof e?e:"DefaultGraph"===e.termType?"DEFAULT":`GRAPH <${e.value}>`,i.push(`${r?"DROP":"CLEAR"} ${t?"":"SILENT "}${n}`)}await this.endpointFetcher.fetchUpdate(this.url,i.join("; "))}async createGraphs(e,t){const r=[];for(const n of e)r.push(`CREATE${t?"":" SILENT"} GRAPH <${n.value}>`);await this.endpointFetcher.fetchUpdate(this.url,r.join("; "))}}},76904:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(72295),t),i(r(41864),t)},22909:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfUpdateQuadsHypermedia=void 0;const n=r(51537),i=r(97356),a=r(98989),o=r(35069);class s extends n.ActorRdfUpdateQuadsDestination{mediatorDereferenceRdf;mediatorMetadata;mediatorMetadataExtract;mediatorRdfUpdateHypermedia;cacheSize;httpInvalidator;cache;constructor(e){super(e),this.mediatorDereferenceRdf=e.mediatorDereferenceRdf,this.mediatorMetadata=e.mediatorMetadata,this.mediatorMetadataExtract=e.mediatorMetadataExtract,this.mediatorRdfUpdateHypermedia=e.mediatorRdfUpdateHypermedia,this.cacheSize=e.cacheSize,this.httpInvalidator=e.httpInvalidator,this.cache=this.cacheSize?new o.LRUCache({max:this.cacheSize}):void 0;const t=this.cache;t&&this.httpInvalidator.addInvalidateListener((({url:e})=>e?t.delete(e):t.clear()))}async test(e){return(0,a.getContextDestinationUrl)((0,a.getContextDestination)(e.context))?(0,i.passTestVoid)():(0,i.failTest)(`Actor ${this.name} can only update quads against a single destination URL.`)}getDestination(e){const t=(0,a.getContextDestination)(e);let r=(0,a.getContextDestinationUrl)(t);if(this.cache){const t=this.cache.get(r);if(t)return(async()=>{const n=await t;return n.cachePolicy&&!await(n.cachePolicy?.satisfiesWithoutRevalidation({url:r,context:e}))?(this.cache.delete(r),this.getDestination(e)):n.destination})()}const n=(async()=>{let n,i,o;try{const t=await this.mediatorDereferenceRdf.mediate({context:e,url:r,acceptErrors:!0});i=t.exists,r=t.url,o=t.cachePolicy;const a=await this.mediatorMetadata.mediate({context:e,url:r,quads:t.data,triples:t.metadata?.triples});n=(await this.mediatorMetadataExtract.mediate({context:e,url:r,metadata:a.metadata,headers:t.headers,requestTime:t.requestTime})).metadata}catch{n={},i=!1}const{destination:s}=await this.mediatorRdfUpdateHypermedia.mediate({context:e,url:r,metadata:n,exists:i,forceDestinationType:(0,a.getDataDestinationType)(t)});return{destination:s,cachePolicy:o}})();return this.cache&&this.cache.set(r,n),n.then((({destination:e})=>e))}}t.ActorRdfUpdateQuadsHypermedia=s},91437:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(22909),t)},56200:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfUpdateQuadsRdfJsStore=void 0;const n=r(51537),i=r(72407),a=r(97356),o=r(98989),s=r(47184);class c extends n.ActorRdfUpdateQuadsDestination{constructor(e){super(e)}async test(e){const t=(0,o.getContextDestination)(e.context);return!t||"string"==typeof t||!("remove"in t)&&"value"in t&&!t.value?.remove?(0,a.failTest)(`${this.name} received an invalid rdfjsStore.`):(0,a.passTestVoid)()}async getDestination(e){const t=(0,o.getContextDestination)(e);return new s.RdfJsQuadDestination(e.getSafe(i.KeysInitQuery.dataFactory),"remove"in t?t:t.value)}}t.ActorRdfUpdateQuadsRdfJsStore=c},47184:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RdfJsQuadDestination=void 0;const n=r(35033),i=r(22112);t.RdfJsQuadDestination=class{dataFactory;store;constructor(e,t){this.dataFactory=e,this.store=t}async update(e){e.delete&&await(0,n.promisifyEventEmitter)(this.store.remove(e.delete)),e.insert&&await(0,n.promisifyEventEmitter)(this.store.import(e.insert))}async deleteGraphs(e,t,r){switch(e){case"ALL":await(0,n.promisifyEventEmitter)(this.store.deleteGraph(this.dataFactory.defaultGraph()));case"NAMED":const t=this.store.match(),r={};t.on("data",(e=>{"DefaultGraph"!==e.graph.termType&&(r[(0,i.termToString)(e.graph)]=!0)})),await(0,n.promisifyEventEmitter)(t),await Promise.all(Object.keys(r).map((e=>(0,n.promisifyEventEmitter)(this.store.deleteGraph((0,i.stringToTerm)(e,this.dataFactory))))));break;default:for(const t of Array.isArray(e)?e:[e])await(0,n.promisifyEventEmitter)(this.store.deleteGraph(t))}}async createGraphs(e,t){if(t)for(const t of e){const e=this.store.match(void 0,void 0,void 0,t);await new Promise(((r,n)=>{e.once("data",(()=>{n(new Error(`Unable to create graph ${t.value} as it already exists`))})),e.on("end",r),e.on("error",n)}))}}}},29870:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(56200),t)},59878:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermComparatorExpressionEvaluator=void 0,t.TermComparatorExpressionEvaluator=class{internalEvaluator;equalityFunction;lessThanFunction;constructor(e,t,r){this.internalEvaluator=e,this.equalityFunction=t,this.lessThanFunction=r}orderTypes(e,t){if(e===t)return 0;if(void 0===e)return-1;if(void 0===t)return 1;if(e.termType!==t.termType)return this._TERM_ORDERING_PRIORITY[e.termType]{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactory=void 0;const n=r(97356);class i extends n.Actor{mediatorExpressionEvaluatorFactory;constructor(e){super(e),this.mediatorExpressionEvaluatorFactory=e.mediatorExpressionEvaluatorFactory}}t.ActorBindingsAggregatorFactory=i},86365:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorContextPreprocess=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorContextPreprocess=i},55406:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(64014),t)},39530:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorDereferenceRdf=void 0;const n=r(10698);class i extends n.ActorDereferenceParse{constructor(e){super(e)}}t.ActorDereferenceRdf=i},69227:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(39530),t)},29951:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorDereference=void 0;const n=r(31262);class i extends n.ActorDereferenceBase{constructor(e){super(e)}async handleDereferenceErrors(e,t,r,n=0){return this.dereferenceErrorHandler(e,t,{url:e.url,exists:!1,status:404,headers:r,requestTime:n})}}t.ActorDereference=i},31262:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorDereferenceBase=void 0,t.emptyReadable=o,t.isHardError=s,t.shouldLogWarning=c;const n=r(72407),i=r(97356),a=r(58521);function o(){const e=new a.Readable;return e.push(null),e}function s(e){return!e.get(n.KeysInitQuery.lenient)}function c(e){return"AbortError"!==e.name}class u extends i.Actor{constructor(e){super(e)}async dereferenceErrorHandler(e,t,r){if(s(e.context))throw t;return c(t)&&this.logWarn(e.context,t.message,(()=>({url:e.url}))),{...r,data:o()}}}t.ActorDereferenceBase=u},68124:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorDereferenceParse=void 0,t.getMediaTypeFromExtension=s;const n=r(97356),i=r(58521),a=r(31262),o=r(4633);function s(e,t){const r=e.lastIndexOf(".");return r>=0&&t?.[e.slice(r+1)]||""}class c extends a.ActorDereferenceBase{mediatorDereference;mediatorParse;mediatorParseMediatypes;mediaMappings;constructor(e){super(e),this.mediatorDereference=e.mediatorDereference,this.mediatorParse=e.mediatorParse,this.mediatorParseMediatypes=e.mediatorParseMediatypes,this.mediaMappings=e.mediaMappings}async test(e){return(0,n.passTestVoid)()}handleDereferenceStreamErrors(e,t){return(0,a.isHardError)(e.context)||(t.on("error",(r=>{(0,a.shouldLogWarning)(r)&&this.logWarn(e.context,r.message,(()=>({url:e.url}))),t.push(null)})),t=t.pipe(new i.PassThrough({objectMode:!0}))),t}async run(e){const{context:t}=e,r=async()=>(await(this.mediatorParseMediatypes?.mediate({context:t,mediaTypes:!0})))?.mediaTypes,n=await this.mediatorDereference.mediate({...e,mediaTypes:r});let i;if(n.exists)try{i=(await this.mediatorParse.mediate({context:t,handle:{context:t,...n,metadata:await this.getMetadata(n)},handleMediaType:n.mediaType||e.mediaType||s(n.url,this.mediaMappings)})).handle,i.data=this.handleDereferenceStreamErrors(e,i.data)}catch(t){await(n.data.close?.()),i=await this.dereferenceErrorHandler(e,t,{})}else await(n.data.close?.()),i={data:(0,a.emptyReadable)()};return{...n,...i,cachePolicy:n.cachePolicy?new o.DereferenceRdfCachePolicyDereferenceWrapper(n.cachePolicy,r):void 0}}}t.ActorDereferenceParse=c},4633:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DereferenceRdfCachePolicyDereferenceWrapper=void 0,t.DereferenceRdfCachePolicyDereferenceWrapper=class{cachePolicy;mediaTypes;constructor(e,t){this.cachePolicy=e,this.mediaTypes=t}storable(){return this.cachePolicy.storable()}async satisfiesWithoutRevalidation(e){return this.cachePolicy.satisfiesWithoutRevalidation({...e,mediaTypes:this.mediaTypes})}responseHeaders(){return this.cachePolicy.responseHeaders()}timeToLive(){return this.cachePolicy.timeToLive()}async revalidationHeaders(e){return this.cachePolicy.revalidationHeaders({...e,mediaTypes:this.mediaTypes})}async revalidatedPolicy(e,t){return await this.cachePolicy.revalidatedPolicy({...e,mediaTypes:this.mediaTypes},t)}}},10698:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(29951),t),i(r(68124),t),i(r(31262),t),i(r(4633),t)},87581:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorExpressionEvaluatorFactory=void 0;const n=r(97356);class i extends n.Actor{mediatorQueryOperation;mediatorFunctionFactory;mediatorMergeBindingsContext;constructor(e){super(e),this.mediatorQueryOperation=e.mediatorQueryOperation,this.mediatorFunctionFactory=e.mediatorFunctionFactory,this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}}t.ActorExpressionEvaluatorFactory=i},26867:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(87581),t)},11812:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediatorFunctionFactory=t.ActorFunctionFactory=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorFunctionFactory=i;class a extends n.Mediator{}t.MediatorFunctionFactory=a},73363:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryDedicated=void 0;const n=r(97356),i=r(11812);class a extends i.ActorFunctionFactory{functionNames;termFunction;constructor(e){super(e),this.functionNames=e.functionNames,this.termFunction=e.termFunction}async test(e){return!this.functionNames.includes(e.functionName)||!this.termFunction&&e.requireTermExpression?(0,n.failTest)(`Actor ${this.name} can not provide implementation for "${e.functionName}", only for ${this.termFunction?"":"non-termExpression "}${this.functionNames.join(" and ")}.`):(0,n.passTestVoid)()}}t.ActorFunctionFactoryDedicated=a},90941:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BusFunctionFactory=void 0;const n=r(97356);class i extends n.BusIndexed{constructor(e){super({...e,actorIdentifierFields:["functionNames"],actionIdentifierFields:["functionName"]})}}t.BusFunctionFactory=i},58537:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionBase=t.ExpressionFunctionBase=void 0;const n=r(72407),i=r(12233);class a{arity;operator;apply;constructor({arity:e,operator:t,apply:r}){this.arity=e,this.operator=t,this.apply=r}checkArity(e){return Array.isArray(this.arity)?this.arity.includes(e.length):this.arity===Number.POSITIVE_INFINITY||e.length===this.arity}}t.ExpressionFunctionBase=a,t.TermFunctionBase=class extends a{supportsTermExpressions=!0;overloads;constructor({arity:e,operator:t,overloads:r}){super({arity:e,operator:t,apply:async({args:e,exprEval:t,mapping:r})=>this.applyOnTerms(await Promise.all(e.map((e=>t.evaluatorExpressionEvaluation(e,r)))),t)}),this.overloads=r}applyOnTerms(e,t){return(this.overloads.search(e,t.context.getSafe(n.KeysExpressionEvaluator.superTypeProvider),t.context.getSafe(n.KeysInitQuery.functionArgumentsCache))??this.handleInvalidTypes(e))(t)(e)}handleInvalidTypes(e){throw new i.InvalidArgumentTypes(e,this.operator)}}},79345:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(11812),t),i(r(73363),t),i(r(90941),t),i(r(58537),t)},84016:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHashBindings=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorHashBindings=i},83691:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(84016),t)},82480:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHashQuads=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorHashQuads=i},61655:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(82480),t)},98980:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHttpInvalidate=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorHttpInvalidate=i},9351:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHttpInvalidateListenable=void 0;const n=r(97356),i=r(98980);class a extends i.ActorHttpInvalidate{invalidateListeners=[];constructor(e){super(e),this.invalidateListeners=[]}addInvalidateListener(e){this.invalidateListeners.push(e)}async test(e){return(0,n.passTestVoid)()}async run(e){for(const t of this.invalidateListeners)t(e);return{}}}t.ActorHttpInvalidateListenable=a},92940:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(98980),t),i(r(9351),t)},18399:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHttp=void 0;const n=r(97356),i=r(33523),a=r(76605),o=r(84077);class s extends n.Actor{constructor(e){super(e)}static toNodeReadable(e){return a(e)||null===e?e:(0,i.readableFromWeb)(e)}static toWebReadableStream(e){return o(e)}static headersToHash(e){const t={};return e.forEach(((e,r)=>{t[r]=e})),t}static getInputUrl(e){return new URL(e instanceof Request?e.url:e)}static createUserAgent(e,t){if(!s.isBrowser()){const r=[`Comunica/${t.split(".")[0]}.0`,`${e}/${t}`];return"object"==typeof globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?r.push(globalThis.navigator.userAgent):"object"==typeof globalThis.process&&"object"==typeof globalThis.process.versions&&"string"==typeof globalThis.process.versions.node&&r.push(`Node.js/${globalThis.process.versions.node.split(".")[0]}`),"object"==typeof globalThis.process&&"string"==typeof globalThis.process.platform&&"string"==typeof globalThis.process.arch&&r.splice(1,0,`(${globalThis.process.platform}; ${globalThis.process.arch})`),r.join(" ")}}static isBrowser(){return"object"==typeof globalThis.window&&"object"==typeof globalThis.window.document||"function"==typeof globalThis.importScripts}}t.ActorHttp=s},62034:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(18399),t),i(r(55667),t)},55667:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAndCloseHttpResponse=async function(e,t){if(t.status>=400){let r="empty response";if(t.body){const e=i.ActorHttp.toNodeReadable(t.body);r=await(0,n.stringify)(e)}throw new Error(`Could not update ${e} (HTTP status ${t.status}):\n${r}`)}await(t.body?.cancel())};const n=r(31759),i=r(18399)},17747:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorInit=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorInit=i},90020:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(17747),t)},42467:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperation=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorOptimizeQueryOperation=i},37216:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(42467),t)},81710:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperation=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorQueryOperation=i},47016:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationTyped=void 0;const n=r(72407),i=r(97356),a=r(49102),o=r(81710);class s extends o.ActorQueryOperation{operationName;constructor(e,t){if(super(e),this.operationName=t,!this.operationName)throw new Error('A valid "operationName" argument must be provided.')}async test(e){if(!e.operation)return(0,i.failTest)("Missing field 'operation' in a query operation action.");if(e.operation.type!==this.operationName)return(0,i.failTest)(`Actor ${this.name} only supports ${this.operationName} operations, but got ${e.operation.type}`);const t=e.operation;return this.testOperation(t,e.context)}async run(e,t){const r=e.context.get(n.KeysInitQuery.physicalQueryPlanLogger);r&&(r.logOperation(e.operation.type,void 0,e.operation,e.context.get(n.KeysInitQuery.physicalQueryPlanNode),this.name,{}),e.context=e.context.set(n.KeysInitQuery.physicalQueryPlanNode,e.operation));const i=e.operation,o=e.context.set(n.KeysQueryOperation.operation,i),s=await this.runOperation(i,o,t);return"metadata"in s&&(s.metadata=(0,a.cachifyMetadata)(s.metadata)),s}}t.ActorQueryOperationTyped=s},11589:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationTypedMediated=void 0;const n=r(47016);class i extends n.ActorQueryOperationTyped{mediatorQueryOperation;constructor(e,t){super(e,t),this.mediatorQueryOperation=e.mediatorQueryOperation}}t.ActorQueryOperationTypedMediated=i},97957:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BusQueryOperation=void 0;const n=r(97356);class i extends n.BusIndexed{constructor(e){super({...e,actorIdentifierFields:["operationName"],actionIdentifierFields:["operation","type"]})}}t.BusQueryOperation=i},23034:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(81710),t),i(r(47016),t),i(r(11589),t),i(r(97957),t)},59254:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryParse=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorQueryParse=i},49812:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(59254),t)},46625:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryProcess=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorQueryProcess=i},19062:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(46625),t)},95319:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerialize=void 0;const n=r(14972);class i extends n.ActorAbstractMediaTyped{constructor(e){super(e)}}t.ActorQueryResultSerialize=i},11488:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeFixedMediaTypes=void 0;const n=r(14972),i=r(97356);class a extends n.ActorAbstractMediaTypedFixed{constructor(e){super(e)}async testHandleChecked(e,t){return(0,i.passTestVoid)()}}t.ActorQueryResultSerializeFixedMediaTypes=a},89655:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(95319),t),i(r(11488),t)},61034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySerialize=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorQuerySerialize=i},20685:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(61034),t)},51486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceDereferenceLink=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorQuerySourceDereferenceLink=i},89372:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(51486),t)},60382:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceIdentifyHypermedia=void 0;const n=r(97356);class i extends n.Actor{sourceType;constructor(e,t){super(e),this.sourceType=t}async test(e){return e.forceSourceType&&this.sourceType!==e.forceSourceType?(0,n.failTest)(`Actor ${this.name} is not able to handle source type ${e.forceSourceType}.`):this.testMetadata(e)}}t.ActorQuerySourceIdentifyHypermedia=i},30196:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(60382),t)},29165:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceIdentify=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorQuerySourceIdentify=i},64970:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.quadsToBindings=function(e,t,r,i,a){const s=u(t),c="Variable"===t.graph.termType&&!a,p=l(t),h=(0,o.reduceTermsNested)(t,((e,t,r)=>("Variable"===t.termType&&(e[r.join("_")]=t.value),e)),{});let f=e;c&&(f=f.filter((e=>"DefaultGraph"!==e.graph.termType))),p&&(f=f.filter((e=>{for(const t in p){const r=t.split("_"),n=(0,o.getValueNestedPath)(e,r);for(const r of p[t])if(!n.equals((0,o.getValueNestedPath)(e,r)))return!1}return!0})));const y=new n.ClosableIterator(f.map((e=>i.bindings(Object.keys(h).map((t=>{const n=t.split("_"),i=h[t],a=(0,o.getValueNestedPath)(e,n);return[r.variable(i),a]}))))),{onClose:()=>e.destroy()});return d(r,y,e,h,s,c||Boolean(p)),y},t.isTermVariable=c,t.getVariables=u,t.getDuplicateElementLinks=l,t.setMetadata=d,t.quadsMetadataToBindingsMetadata=p,t.quadsOrderToBindingsOrder=h,t.filterMatchingQuotedQuads=function(e,t){return(0,o.someTerms)(e,(e=>"Quad"===e.termType))&&(t=t.filter((t=>(0,s.matchPatternMappings)(t,e)))),t};const n=r(34569),i=r(49102),a=r(22112),o=r(13252),s=r(10175);function c(e){return"Variable"===e.termType}function u(e){return(0,o.uniqTerms)((0,o.getTermsNested)(e).filter(c))}function l(e){const t={};let r=!1;if((0,o.forEachTermsNested)(e,((e,n)=>{if("Variable"===e.termType){const i=(0,a.termToString)(e),o=(t[i]||(t[i]=[])).push(n);r=r||o>1}})),!r)return;const n={};for(const e in t){const r=t[e],i=r.slice(1);i.length>0&&(n[r[0].join("_")]=i)}return n}function d(e,t,r,n,a,o){const s=s=>{o&&(s.cardinality.type="estimate"),t.setProperty("metadata",p(e,(0,i.validateMetadataQuads)(s),n,a)),s.state&&s.state.addInvalidateListener((()=>{d(e,t,r,n,a,o)}))},c=r.getProperty("metadata");c?s(c):r.getProperty("metadata",s)}function p(e,t,r,n){return{...t,order:t.order?h(e,t.order,r):void 0,availableOrders:t.availableOrders?t.availableOrders.map((t=>({cost:t.cost,terms:h(e,t.terms,r)}))):void 0,variables:n.map((e=>({variable:e,canBeUndef:!1})))}}function h(e,t,r){const n={};return t.map((t=>{const i=r[t.term];if(i&&!n[i])return n[i]=!0,{term:e.variable(i),direction:t.direction}})).filter(Boolean)}},70287:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(29165),t),i(r(64970),t)},52798:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinEntriesSort=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorRdfJoinEntriesSort=i},70555:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(52798),t)},4817:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinSelectivity=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorRdfJoinSelectivity=i},42489:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4817),t)},58386:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoin=void 0;const n=r(72407),i=r(97356),a=r(34569),o=r(49102);class s extends i.Actor{mediatorJoinSelectivity;includeInLogs=!0;logicalType;physicalName;limitEntries;limitEntriesMin;canHandleUndefs;isLeaf;requiresVariableOverlap;canHandleOperationRequired;constructor(e,t){super(e),this.mediatorJoinSelectivity=e.mediatorJoinSelectivity,this.logicalType=t.logicalType,this.physicalName=t.physicalName,this.limitEntries=t.limitEntries??Number.POSITIVE_INFINITY,this.limitEntriesMin=t.limitEntriesMin??!1,this.canHandleUndefs=t.canHandleUndefs??!1,this.isLeaf=t.isLeaf??!0,this.requiresVariableOverlap=t.requiresVariableOverlap??!1,this.canHandleOperationRequired=t.canHandleOperationRequired??!1}static overlappingVariables(e){const t={};for(const r of e)for(const e of r.variables){t[e.variable.value]||(t[e.variable.value]={variable:e.variable,canBeUndef:e.canBeUndef,occurrences:0});const r=t[e.variable.value];r.canBeUndef=r.canBeUndef||e.canBeUndef,r.occurrences++}return Object.values(t).filter((t=>t.occurrences===e.length)).map((e=>({variable:e.variable,canBeUndef:e.canBeUndef})))}static joinVariables(e,t,r=!1){const n={};let i=!0;for(const e of t){for(const t of e.variables)n[t.variable.value]=n[t.variable.value]||t.canBeUndef||!i&&r&&!(t.variable.value in n);i=!1}return Object.entries(n).map((([t,r])=>({variable:e.variable(t),canBeUndef:r})))}static joinBindings(...e){if(0===e.length)return null;if(1===e.length)return e[0];let t=e[0];for(const r of e.slice(1)){const e=t.merge(r);if(!e)return null;t=e}return t}static getCardinality(e){return e.cardinality}static async getMetadatas(e){return await Promise.all(e.map((e=>e.output.metadata())))}static async getEntriesWithMetadatas(e){const t=await s.getMetadatas(e);return e.map(((e,r)=>({...e,metadata:t[r]})))}static getRequestInitialTimes(e){return e.map((e=>e.pageSize?0:e.requestTime??0))}static getRequestItemTimes(e){return e.map((e=>e.pageSize?(e.requestTime??0)/e.pageSize:0))}constructState(e){const t=new o.MetadataValidationState,r=()=>t.invalidate();for(const t of e)t.state.addInvalidateListener(r);return t}async constructResultMetadata(e,t,r,i={},a=!1){let o;if(i.cardinality)o=i.cardinality;else{let n=!1;o=t.reduce(((e,t)=>{const r=s.getCardinality(t);return 0===r.value&&(n=!0),{type:"estimate"===r.type?"estimate":e.type,value:e.value*(a?Math.max(1,r.value):r.value)}}),{type:"exact",value:1}),n&&!a||(o.value*=(await this.mediatorJoinSelectivity.mediate({entries:e,context:r})).selectivity,0===o.value&&(o.value=Number.MIN_VALUE))}return{state:this.constructState(t),...i,cardinality:{type:o.type,value:o.value},variables:s.joinVariables(r.getSafe(n.KeysInitQuery.dataFactory),t,a)}}static async sortJoinEntries(e,t,r){if(t.some((e=>e.metadata.variables.some((e=>e.canBeUndef)))))return(0,i.passTest)(t);const n={};for(const e of t)for(const t of e.metadata.variables){let e=n[t.variable.value];e||(e=0),n[t.variable.value]=++e}const a=[];for(const[e,t]of Object.entries(n))t>=2&&a.push(e);return 0===a.length?(0,i.failTest)("Bind join can only join entries with at least one common variable"):(0,i.passTest)((await e.mediate({entries:t,context:r})).entries)}async test(e){if(e.type!==this.logicalType)return(0,i.failTest)(`${this.name} can only handle logical joins of type '${this.logicalType}', while '${e.type}' was given.`);if(e.entries.length<=1)return(0,i.failTest)(`${this.name} requires at least two join entries.`);const t=e.entries.some((e=>e.operationRequired));if(!this.canHandleOperationRequired&&t)return(0,i.failTest)(`${this.name} does not work with operationRequired.`);if(this.limitEntriesMin?e.entries.lengththis.limitEntries)return(0,i.failTest)(`${this.name} requires ${this.limitEntries} join entries at ${this.limitEntriesMin?"least":"most"}. The input contained ${e.entries.length}.`);for(const t of e.entries)if("bindings"!==t.output.type)return(0,i.failTest)(`Invalid type of a join entry: Expected 'bindings' but got '${t.output.type}'`);const r=await s.getMetadatas(e.entries);let n;return!this.canHandleUndefs&&(n=s.overlappingVariables(r),n.some((e=>e.canBeUndef)))?(0,i.failTest)(`Actor ${this.name} can not join streams containing undefs`):this.requiresVariableOverlap&&0===(n??s.overlappingVariables(r)).length&&!t?(0,i.failTest)(`Actor ${this.name} can only join entries with at least one common variable`):await this.getJoinCoefficients(e,{metadatas:r})}async run(e,t){let r;e.context.has(n.KeysInitQuery.physicalQueryPlanLogger)&&(r=e.context.get(n.KeysInitQuery.physicalQueryPlanNode),e.context=e.context.set(n.KeysInitQuery.physicalQueryPlanNode,e));const i=e.context.get(n.KeysInitQuery.physicalQueryPlanLogger);let c;this.includeInLogs&&i&&(c={},i.stashChildren(r,(e=>e.logicalOperator.startsWith("join"))),i.logOperation(`join-${this.logicalType}`,this.physicalName,e,r,this.name,c));const{result:u,physicalPlanMetadata:l}=await this.getOutput(e,t);if(c){(0,a.instrumentIterator)(u.bindingsStream).then((t=>{i.appendMetadata(e,{cardinalityReal:t.count,timeSelf:t.timeSelf,timeLife:t.timeLife})})),Object.assign(c,l);const r=t.metadatas.map(s.getCardinality);if(c.cardinalities=r,c.joinCoefficients=(await this.getJoinCoefficients(e,t)).getOrThrow(),this.isLeaf)for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataAccumulate=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorRdfMetadataAccumulate=i},64961:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(81757),t)},50283:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataExtract=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorRdfMetadataExtract=i},33228:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(50283),t)},91008:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadata=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorRdfMetadata=i},34592:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(91008),t)},19205:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfParseHtml=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorRdfParseHtml=i},70914:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(19205),t)},63350:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfParse=void 0;const n=r(14972);class i extends n.ActorAbstractMediaTyped{constructor(e){super(e)}}t.ActorRdfParse=i},31651:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfParseFixedMediaTypes=void 0;const n=r(14972),i=r(97356);class a extends n.ActorAbstractMediaTypedFixed{constructor(e){super(e)}async testHandleChecked(e){return(0,i.passTestVoid)()}}t.ActorRdfParseFixedMediaTypes=a},55252:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(63350),t),i(r(31651),t)},51937:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfResolveHypermediaLinksQueue=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorRdfResolveHypermediaLinksQueue=i},7578:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkQueueWrapper=void 0,t.LinkQueueWrapper=class{linkQueue;constructor(e){this.linkQueue=e}push(e,t){return this.linkQueue.push(e,t)}getSize(){return this.linkQueue.getSize()}isEmpty(){return this.linkQueue.isEmpty()}pop(){return this.linkQueue.pop()}peek(){return this.linkQueue.peek()}}},17498:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(51937),t),i(r(7578),t)},77582:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfResolveHypermediaLinks=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorRdfResolveHypermediaLinks=i},79432:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(77582),t)},31394:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfSerialize=void 0;const n=r(14972);class i extends n.ActorAbstractMediaTyped{constructor(e){super(e)}}t.ActorRdfSerialize=i},52247:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfSerializeFixedMediaTypes=void 0;const n=r(14972),i=r(97356);class a extends n.ActorAbstractMediaTypedFixed{constructor(e){super(e)}async testHandleChecked(){return(0,i.passTestVoid)()}}t.ActorRdfSerializeFixedMediaTypes=a},9101:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(31394),t),i(r(52247),t)},15505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfUpdateHypermedia=void 0;const n=r(97356);class i extends n.Actor{destinationType;constructor(e,t){super(e),this.destinationType=t}async test(e){return e.forceDestinationType&&this.destinationType!==e.forceDestinationType?(0,n.failTest)(`Actor ${this.name} is not able to handle destination type ${e.forceDestinationType}.`):this.testMetadata(e)}}t.ActorRdfUpdateHypermedia=i},78181:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(15505),t)},70867:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfUpdateQuads=void 0;const n=r(97356);class i extends n.Actor{constructor(e){super(e)}}t.ActorRdfUpdateQuads=i},97651:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfUpdateQuadsDestination=void 0,t.deskolemizeStream=s,t.deskolemize=c;const n=r(87092),i=r(72407),a=r(97356),o=r(70867);function s(e,t,r){return t?.map((t=>(0,n.deskolemizeQuad)(e,t,r)))}function c(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=e.context.get(i.KeysRdfUpdateQuads.destination),n=e.context.get(i.KeysQuerySourceIdentify.sourceIds)?.get(r);return n?{...e,quadStreamInsert:s(t,e.quadStreamInsert,n),quadStreamDelete:s(t,e.quadStreamDelete,n)}:e}class u extends o.ActorRdfUpdateQuads{async test(e){return(0,a.passTestVoid)()}async run(e){const t=await this.getDestination(e.context);return await this.getOutput(t,c(e))}async getOutput(e,t){return{execute:async()=>{await e.update({insert:t.quadStreamInsert,delete:t.quadStreamDelete}),await(t.deleteGraphs?e.deleteGraphs(t.deleteGraphs.graphs,t.deleteGraphs.requireExistence,t.deleteGraphs.dropGraphs):Promise.resolve()),await(t.createGraphs?e.createGraphs(t.createGraphs.graphs,t.createGraphs.requireNonExistence):Promise.resolve())}}}}t.ActorRdfUpdateQuadsDestination=u},24657:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},51537:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(70867),t),i(r(97651),t),i(r(24657),t)},68505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorTermComparatorFactory=void 0;const n=r(97356);class i extends n.Actor{mediatorQueryOperation;mediatorFunctionFactory;mediatorMergeBindingsContext;constructor(e){super(e),this.mediatorQueryOperation=e.mediatorQueryOperation,this.mediatorFunctionFactory=e.mediatorFunctionFactory,this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}}t.ActorTermComparatorFactory=i},11908:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(68505),t)},13151:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeysStatistics=t.KeysRdfJoin=t.KeysMergeBindingsContext=t.KeysRdfUpdateQuads=t.KeysQuerySourceIdentify=t.KeysRdfSerialize=t.KeysRdfParseHtmlScript=t.KeysRdfParseJsonLd=t.KeysQueryOperation=t.KeysExpressionEvaluator=t.KeysInitQuery=t.KeysHttpProxy=t.KeysHttpMemento=t.KeysHttpWayback=t.KeysHttp=t.KeysCore=void 0;const n=r(97356);t.KeysCore={log:n.CONTEXT_KEY_LOGGER},t.KeysHttp={includeCredentials:new n.ActionContextKey("@comunica/bus-http:include-credentials"),auth:new n.ActionContextKey("@comunica/bus-http:auth"),fetch:new n.ActionContextKey("@comunica/bus-http:fetch"),httpTimeout:new n.ActionContextKey("@comunica/bus-http:http-timeout"),httpBodyTimeout:new n.ActionContextKey("@comunica/bus-http:http-body-timeout"),httpRetryCount:new n.ActionContextKey("@comunica/bus-http:http-retry-count"),httpRetryDelayFallback:new n.ActionContextKey("@comunica/bus-http:http-retry-delay-fallback"),httpRetryDelayLimit:new n.ActionContextKey("@comunica/bus-http:http-retry-delay-limit"),httpRetryStatusCodes:new n.ActionContextKey("@comunica/bus-http:http-retry-status-codes"),httpRetryBodyCount:new n.ActionContextKey("@comunica/bus-http:http-retry-body-count"),httpRetryBodyDelayFallback:new n.ActionContextKey("@comunica/bus-http:http-retry-body-delay-fallback"),httpRetryBodyAllowUnsafe:new n.ActionContextKey("@comunica/bus-http:http-retry-body-allow-unsafe"),httpRetryBodyMaxBytes:new n.ActionContextKey("@comunica/bus-http:http-retry-body-max-bytes"),httpAbortSignal:new n.ActionContextKey("@comunica/bus-http:http-abort-controller"),httpCache:new n.ActionContextKey("@comunica/bus-http:httpCache")},t.KeysHttpWayback={recoverBrokenLinks:new n.ActionContextKey("@comunica/bus-http:recover-broken-links")},t.KeysHttpMemento={datetime:new n.ActionContextKey("@comunica/actor-http-memento:datetime")},t.KeysHttpProxy={httpProxyHandler:new n.ActionContextKey("@comunica/actor-http-proxy:httpProxyHandler")},t.KeysInitQuery={querySourcesUnidentified:new n.ActionContextKey("@comunica/actor-init-query:querySourcesUnidentified"),initialBindings:new n.ActionContextKey("@comunica/actor-init-query:initialBindings"),queryFormat:new n.ActionContextKey("@comunica/actor-init-query:queryFormat"),graphqlSingularizeVariables:new n.ActionContextKey("@comunica/actor-init-query:singularizeVariables"),lenient:new n.ActionContextKey("@comunica/actor-init-query:lenient"),parseUnsupportedVersions:new n.ActionContextKey("@comunica/actor-init-query:parseUnsupportedVersions"),queryString:new n.ActionContextKey("@comunica/actor-init-query:queryString"),query:new n.ActionContextKey("@comunica/actor-init-query:query"),baseIRI:new n.ActionContextKey("@comunica/actor-init-query:baseIRI"),fileBaseIRI:new n.ActionContextKey("@comunica/actor-init-query:fileBaseIRI"),functionArgumentsCache:new n.ActionContextKey("@comunica/actor-init-query:functionArgumentsCache"),queryTimestamp:new n.ActionContextKey("@comunica/actor-init-query:queryTimestamp"),queryTimestampHighResolution:new n.ActionContextKey("@comunica/actor-init-query:queryTimestampHighResolution"),extensionFunctionCreator:new n.ActionContextKey("@comunica/actor-init-query:extensionFunctionCreator"),extensionFunctions:new n.ActionContextKey("@comunica/actor-init-query:extensionFunctions"),extensionFunctionsAlwaysPushdown:new n.ActionContextKey("@comunica/actor-init-query:extensionFunctionsAlwaysPushdown"),cliArgsHandlers:new n.ActionContextKey("@comunica/actor-init-query:cliArgsHandlers"),explain:new n.ActionContextKey("@comunica/actor-init-query:explain"),physicalQueryPlanLogger:new n.ActionContextKey("@comunica/actor-init-query:physicalQueryPlanLogger"),physicalQueryPlanNode:new n.ActionContextKey("@comunica/actor-init-query:physicalQueryPlanNode"),jsonLdContext:new n.ActionContextKey("@context"),invalidateCache:new n.ActionContextKey("@comunica/actor-init-query:invalidateCache"),dataFactory:new n.ActionContextKey("@comunica/actor-init-query:dataFactory"),distinctConstruct:new n.ActionContextKey("@comunica/actor-init-query:distinctConstruct")},t.KeysExpressionEvaluator={extensionFunctionCreator:new n.ActionContextKey("@comunica/utils-expression-evaluator:extensionFunctionCreator"),superTypeProvider:new n.ActionContextKey("@comunica/utils-expression-evaluator:superTypeProvider"),defaultTimeZone:new n.ActionContextKey("@comunica/utils-expression-evaluator:defaultTimeZone"),actionContext:new n.ActionContextKey("@comunica/utils-expression-evaluator:actionContext")},t.KeysQueryOperation={operation:new n.ActionContextKey("@comunica/bus-query-operation:operation"),joinLeftMetadata:new n.ActionContextKey("@comunica/bus-query-operation:joinLeftMetadata"),joinRightMetadatas:new n.ActionContextKey("@comunica/bus-query-operation:joinRightMetadatas"),joinBindings:new n.ActionContextKey("@comunica/bus-query-operation:joinBindings"),readOnly:new n.ActionContextKey("@comunica/bus-query-operation:readOnly"),isPathArbitraryLengthDistinctKey:new n.ActionContextKey("@comunica/bus-query-operation:isPathArbitraryLengthDistinct"),limitIndicator:new n.ActionContextKey("@comunica/bus-query-operation:limitIndicator"),unionDefaultGraph:new n.ActionContextKey("@comunica/bus-query-operation:unionDefaultGraph"),querySources:new n.ActionContextKey("@comunica/bus-query-operation:querySources"),serviceSources:new n.ActionContextKey("@comunica/bus-query-operation:serviceSources")},t.KeysRdfParseJsonLd={documentLoader:new n.ActionContextKey("@comunica/actor-rdf-parse-jsonld:documentLoader"),strictValues:new n.ActionContextKey("@comunica/actor-rdf-parse-jsonld:strictValues"),parserOptions:new n.ActionContextKey("@comunica/actor-rdf-parse-jsonld:parserOptions")},t.KeysRdfParseHtmlScript={processingHtmlScript:new n.ActionContextKey("@comunica/actor-rdf-parse-html-script:processingHtmlScript"),extractAllScripts:new n.ActionContextKey("extractAllScripts")},t.KeysRdfSerialize={rdfSerializationPrefixes:new n.ActionContextKey("@comunica/bus-rdf-serialize:rdfSerializationPrefixes")},t.KeysQuerySourceIdentify={sourceIds:new n.ActionContextKey("@comunica/bus-query-source-identify:sourceIds"),traverse:new n.ActionContextKey("@comunica/bus-query-source-identify:traverse")},t.KeysRdfUpdateQuads={destination:new n.ActionContextKey("@comunica/bus-rdf-update-quads:destination")},t.KeysMergeBindingsContext={sourcesBinding:new n.ActionContextKey("@comunica/bus-merge-bindings-context:sourcesBinding")},t.KeysRdfJoin={lastPhysicalJoin:new n.ActionContextKey("@comunica/bus-rdf-join:lastPhysicalJoin")},t.KeysStatistics={discoveredLinks:new n.ActionContextKey("@comunica/statistic:discoveredLinks"),dereferencedLinks:new n.ActionContextKey("@comunica/statistic:dereferencedLinks"),intermediateResults:new n.ActionContextKey("@comunica/statistic:intermediateResults")}},72407:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(13151),t)},85917:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionContextKey=t.ActionContext=void 0;const n=r(6081);class i{map;constructor(e={}){this.map=(0,n.Map)(e)}setDefault(e,t){return this.has(e)?this:this.set(e,t)}set(e,t){return this.setRaw(e.name,t)}setRaw(e,t){return new i(this.map.set(e,t))}delete(e){return new i(this.map.delete(e.name))}get(e){return this.getRaw(e.name)}getRaw(e){return this.map.get(e)}getSafe(e){if(!this.has(e))throw new Error(`Context entry ${e.name} is required but not available`);return this.get(e)}has(e){return this.hasRaw(e.name)}hasRaw(e){return this.map.has(e)}merge(...e){let t=this;for(const r of e)for(const e of r.keys())t=t.set(e,r.get(e));return t}keys(){return[...this.map.keys()].map((e=>new a(e)))}toJS(){return this.map.toJS()}toString(){return`ActionContext(${JSON.stringify(this.map.toJS())})`}[Symbol.for("nodejs.util.inspect.custom")](){return`ActionContext(${JSON.stringify(this.map.toJS(),null," ")})`}static ensureActionContext(e){return e instanceof i||e&&"map"in e?e:new i((0,n.Map)(e??{}))}}t.ActionContext=i;class a{name;dummy;constructor(e){this.name=e}}t.ActionContextKey=a},13942:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionObserver=void 0,t.ActionObserver=class{name;bus;constructor(e){this.name=e.name,this.bus=e.bus}}},75081:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Actor=void 0;const n=r(49815);class i{name;bus;beforeActors=[];constructor(e){for(const t of Object.keys(e))"__proto__"!==t&&(this[t]=e[t]);this.name=e.name,this.bus=e.bus,this.bus.subscribe(this),this.beforeActors.length>0&&this.bus.addDependencies(this,this.beforeActors),e.busFailMessage&&(this.bus.failMessage=e.busFailMessage)}static getContextLogger(e){return e.get(n.CONTEXT_KEY_LOGGER)}runObservable(e,t){const r=this.run(e,t);return this.bus.onRun(this,e,r),r}getDefaultLogData(e,t){const r=t?t():{};return r.actor=this.name,r}logTrace(e,t,r){const n=i.getContextLogger(e);n&&n.trace(t,this.getDefaultLogData(e,r))}logDebug(e,t,r){const n=i.getContextLogger(e);n&&n.debug(t,this.getDefaultLogData(e,r))}logInfo(e,t,r){const n=i.getContextLogger(e);n&&n.info(t,this.getDefaultLogData(e,r))}logWarn(e,t,r){const n=i.getContextLogger(e);n&&n.warn(t,this.getDefaultLogData(e,r))}logError(e,t,r){const n=i.getContextLogger(e);n&&n.error(t,this.getDefaultLogData(e,r))}logFatal(e,t,r){const n=i.getContextLogger(e);n&&n.fatal(t,this.getDefaultLogData(e,r))}}t.Actor=i},17982:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Bus=void 0,t.Bus=class{name;actors=[];observers=[];dependencyLinks=new Map;failMessage;constructor(e){this.name=e.name,this.failMessage=`All actors over bus ${this.name} failed to handle an action`}subscribe(e){this.actors.push(e),this.reorderForDependencies()}subscribeObserver(e){this.observers.push(e)}unsubscribe(e){const t=this.actors.indexOf(e);return t>=0&&(this.actors.splice(t,1),!0)}unsubscribeObserver(e){const t=this.observers.indexOf(e);return t>=0&&(this.observers.splice(t,1),!0)}publish(e){return this.actors.map((t=>({actor:t,reply:t.test(e)})))}onRun(e,t,r){for(const n of this.observers)n.onRun(e,t,r)}addDependencies(e,t){for(const r of t){let t=this.dependencyLinks.get(r);t||(t=[],this.dependencyLinks.set(r,t)),t.push(e)}this.reorderForDependencies()}reorderForDependencies(){if(this.dependencyLinks.size>0){const e=[];for(const t of this.dependencyLinks.keys()){const r=this.actors.indexOf(t);r>=0&&(this.actors.splice(r,1),e.push(t))}for(;e.length>0;){let t=-1;for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BusIndexed=void 0;const n=r(17982);class i extends n.Bus{actorsIndex={};actorIdentifierFields;actionIdentifierFields;constructor(e){super(e),this.actorIdentifierFields=e.actorIdentifierFields,this.actionIdentifierFields=e.actionIdentifierFields}subscribe(e){const t=this.getActorIdentifiers(e)??["_undefined_"];for(const r of t){let t=this.actorsIndex[r];t||(t=this.actorsIndex[r]=[]),t.push(e),super.subscribe(e)}}unsubscribe(e){const t=this.getActorIdentifiers(e)??["_undefined_"];let r=!1;for(const n of t){const t=this.actorsIndex[n];if(t){const r=t.indexOf(e);r>=0&&t.splice(r,1),0===t.length&&delete this.actorsIndex[n]}r=r||super.unsubscribe(e)}return r}publish(e){const t=this.getActionIdentifier(e);return t?[...this.actorsIndex[t]||[],...this.actorsIndex._undefined_||[]].map((t=>({actor:t,reply:t.test(e)}))):super.publish(e)}getActorIdentifiers(e){const t=this.actorIdentifierFields.reduce(((e,t)=>e[t]),e);if(t)return Array.isArray(t)?t:[t]}getActionIdentifier(e){return this.actionIdentifierFields.reduce(((e,t)=>e[t]),e)}}t.BusIndexed=i},49815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONTEXT_KEY_LOGGER=void 0;const n=r(85917);t.CONTEXT_KEY_LOGGER=new n.ActionContextKey("@comunica/core:log")},4551:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Mediator=void 0;class r{name;bus;constructor(e){this.name=e.name,this.bus=e.bus}publish(e){const t=this.bus.publish(e);if(0===t.length)throw new Error(`No actors are able to reply to a message in the bus ${this.bus.name}`);return t}async mediateActor(e){return await this.mediateWith(e,this.publish(e))}async mediateTestable(e){return(await this.mediateActor(e)).mapAsync(((t,r)=>t.runObservable(e,r)))}async mediate(e){return(await this.mediateTestable(e)).getOrThrow()}constructFailureMessage(e,t){const n="\n ";return`${this.bus.failMessage.replaceAll(/\$\{(.*?)\}/gu,((t,n)=>r.getObjectValue({action:e},n.split("."))||t))}\n Error messages of failing actors:${n}${t.join(n)}`}static getObjectValue(e,t){return 0===t.length?e:e?r.getObjectValue(e[t[0]],t.slice(1)):void 0}}t.Mediator=r},55895:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestResultFailed=t.TestResultPassed=void 0,t.passTest=function(e){return new r(e,void 0)},t.passTestVoid=function(){return new r(!0,void 0)},t.passTestWithSideData=function(e,t){return new r(e,t)},t.passTestVoidWithSideData=function(e){return new r(!0,e)},t.failTest=function(e){return new n(e)};class r{value;sideData;constructor(e,t){this.value=e,this.sideData=t}isPassed(){return!0}isFailed(){return!1}get(){return this.value}getOrThrow(){return this.value}getSideData(){return this.sideData}getFailMessage(){}map(e){return new r(e(this.value,this.sideData),this.sideData)}async mapAsync(e){return new r(await e(this.value,this.sideData),this.sideData)}}t.TestResultPassed=r;class n{failMessage;constructor(e){this.failMessage=e}isPassed(){return!1}isFailed(){return!0}get(){}getOrThrow(){throw new Error(this.getFailMessage())}getSideData(){throw new Error(this.getFailMessage())}getFailMessage(){return this.failMessage}map(){return this}async mapAsync(){return this}}t.TestResultFailed=n},97356:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(85917),t),i(r(17982),t),i(r(30725),t),i(r(49815),t),i(r(13942),t),i(r(75081),t),i(r(4551),t),i(r(55895),t)},27012:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerVoid=void 0;const n=r(38548);class i extends n.Logger{debug(){}error(){}fatal(){}info(){}trace(){}warn(){}}t.LoggerVoid=i},43192:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(27012),t)},66628:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediatorAll=void 0;const n=r(97356);class i extends n.Mediator{constructor(e){super(e)}async mediate(e){const t=[];let r;try{r=this.publish(e)}catch{r=[]}for(const e of r){const r=await e.reply;r.isPassed()&&t.push({actor:e.actor,sideData:r.getSideData()})}return(await Promise.all(t.map((t=>t.actor.runObservable(e,t.sideData)))))[0]}async mediateWith(){throw new Error("Unsupported operation: MediatorAll#mediateWith")}}t.MediatorAll=i},53592:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(66628),t)},68871:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediatorCombinePipeline=void 0;const n=r(97356);class i extends n.Mediator{filterFailures;order;field;constructor(e){super(e),this.filterFailures=e.filterFailures,this.order=e.order,this.field=e.field}async mediate(e){let t;try{t=this.publish(e)}catch{return e}if(this.filterFailures){const e=[];for(const r of t)(await r.reply).isPassed()&&e.push(r);t=e}const r=[];if(t=await Promise.all(t.map((async({actor:t,reply:n},i)=>{try{const e=await n,a=e.getOrThrow();return r[i]=e.getSideData(),{actor:t,reply:a}}catch(t){throw new Error(this.constructFailureMessage(e,[t.message]))}}))),this.order){const e=e=>{const t=this.field?e[this.field]:e;if("number"!=typeof t)throw new TypeError("Cannot order elements that are not numbers.");return t};t=t.sort(((t,r)=>("increasing"===this.order?1:-1)*(e(t.reply)-e(r.reply))))}let n=e,i=0;for(const{actor:e}of t)n={...n,...await e.runObservable(n,r[i++])};return n}mediateWith(){throw new Error("Method not supported.")}}t.MediatorCombinePipeline=i},56503:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(68871),t)},44515:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediatorCombineUnion=void 0;const n=r(97356);class i extends n.Mediator{filterFailures;field;combiner;constructor(e){super(e),this.filterFailures=e.filterFailures,this.field=e.field,this.combiner=this.createCombiner()}async mediate(e){let t;try{t=this.publish(e)}catch{t=[]}if(this.filterFailures){const e=[];for(const r of t)(await r.reply).isPassed()&&e.push(r);t=e}const r=[];await Promise.all(t.map((async({reply:e},t)=>{const n=await e,i=n.getOrThrow();return r[t]=n.getSideData(),i})));const n=await Promise.all(t.map(((t,n)=>t.actor.runObservable(e,r[n]))));return this.combiner(n)}mediateWith(){throw new Error("Method not supported.")}createCombiner(){return e=>{const t={};return t[this.field]={},[{}].concat(e.map((e=>e[this.field]))).forEach((e=>{t[this.field]={...e,...t[this.field]}})),t}}}t.MediatorCombineUnion=i},62784:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(44515),t)},1686:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediatorJoinCoefficientsFixed=void 0;const n=r(72407),i=r(97356);class a extends i.Mediator{cpuWeight;memoryWeight;timeWeight;ioWeight;constructor(e){super(e),this.cpuWeight=e.cpuWeight,this.memoryWeight=e.memoryWeight,this.timeWeight=e.timeWeight,this.ioWeight=e.ioWeight}async mediateWith(e,t){const r=[],a=t.map((({reply:e})=>e)),o=(await Promise.all(a)).map((e=>{if(!e.isFailed())return{value:e.get(),sideData:e.getSideData()};r.push(e.getFailMessage())}));let s=o.map((e=>{if(e)return e.value.iterations*this.cpuWeight+e.value.persistedItems*this.memoryWeight+e.value.blockingItems*this.timeWeight+e.value.requestTime*this.ioWeight}));const c=Math.max(...s.filter((e=>void 0!==e))),u=e.context.get(n.KeysQueryOperation.limitIndicator);u&&(s=s.map(((e,t)=>void 0!==e&&(o[t]?.value).blockingItems>0&&(o[t]?.value).iterations>u?e+c:e)));let l=-1,d=Number.POSITIVE_INFINITY;for(const[e,t]of s.entries())void 0!==t&&(-1===l||t(await e.output.metadata()).variables.map((e=>e.variable.value))))),costs:Object.fromEntries(s.map(((e,r)=>[`${t[r].actor.logicalType}-${t[r].actor.physicalName}`,e])).filter((e=>void 0!==e[1]))),coefficients:Object.fromEntries(o.map(((e,r)=>[`${t[r].actor.logicalType}-${t[r].actor.physicalName}`,e?.value])).filter((e=>void 0!==e[1])))}),(0,i.passTestWithSideData)(p,o[l].sideData)}}t.MediatorJoinCoefficientsFixed=a},97841:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1686),t)},22010:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediatorNumber=void 0;const n=r(97356);class i extends n.Mediator{field;type;ignoreFailures;indexPicker;constructor(e){super(e),this.field=e.field,this.type=e.type,this.ignoreFailures=Boolean(e.ignoreFailures),this.indexPicker=this.createIndexPicker()}createIndexPicker(){switch(this.type){case"min":return e=>e.reduce(((e,t,r)=>{const n=this.getOrDefault(t[this.field],Number.POSITIVE_INFINITY);return null!==n&&(Number.isNaN(e[0])||e[0]>n)?[n,r]:e}),[Number.NaN,-1])[1];case"max":return e=>e.reduce(((e,t,r)=>{const n=this.getOrDefault(t[this.field],Number.NEGATIVE_INFINITY);return null!==n&&(Number.isNaN(e[0])||e[0]e)));const i=[];if(this.ignoreFailures){const e={};e[this.field]=null,r=r.map((t=>t.isFailed()?(i.push(t.getFailMessage()),(0,n.passTestWithSideData)(e,void 0)):t))}const a=[],o=r.map(((e,t)=>{const r=e.getOrThrow();return a[t]=e.getSideData(),r})),s=this.indexPicker(o);return s<0?(0,n.failTest)(this.constructFailureMessage(e,i)):(0,n.passTestWithSideData)(t[s].actor,a[s])}}t.MediatorNumber=i},83460:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(22010),t)},36494:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediatorRace=void 0;const n=r(97356);class i extends n.Mediator{constructor(e){super(e)}mediateWith(e,t){return new Promise(((r,i)=>{const a=[];for(const o of t)o.reply.then((i=>{i.isPassed()?r((0,n.passTestWithSideData)(o.actor,i.getSideData())):(a.push(i.getFailMessage()),a.length===t.length&&r((0,n.failTest)(this.constructFailureMessage(e,a))))})).catch((e=>{i(e)}))}))}}t.MediatorRace=i},42308:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(36494),t)},15788:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2321:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},48107:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionType=void 0,function(e){e.Aggregate="aggregate",e.Existence="existence",e.Operator="operator",e.Term="term",e.Variable="variable"}(r||(t.ExpressionType=r={}))},91694:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},77027:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},87126:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},60695:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},78479:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},77083:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},53711:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},69908:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1102:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},77647:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},12091:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6524:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},23577:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},38523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},10858:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},77226:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;class r{static LEVELS={trace:0,debug:1,info:2,warn:3,error:4,fatal:5};static getLevelOrdinal(e){return r.LEVELS[e]}activeLogGroups={};repetitionCounter=0;groupedLogLimit=5;logGrouped(e,t){const r=this.activeLogGroups[e];if(r){if(this.repetitionCounter-r.lastSeenIndex-10&&r.callback(r.count)}this.activeLogGroups[e]={count:0,lastSeenIndex:this.repetitionCounter++,callback:t},t(1)}flush(){for(const e in this.activeLogGroups){const{count:t,callback:r}=this.activeLogGroups[e];delete this.activeLogGroups[e],t>0&&r(t)}}}t.Logger=r},38548:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(15788),t),i(r(2321),t),i(r(91694),t),i(r(77027),t),i(r(87126),t),i(r(60695),t),i(r(78479),t),i(r(77083),t),i(r(1102),t),i(r(77647),t),i(r(12091),t),i(r(6524),t),i(r(23577),t),i(r(38523),t),i(r(10858),t),i(r(19294),t),i(r(88552),t),i(r(66065),t),i(r(53711),t),i(r(69908),t),i(r(77226),t),i(r(48107),t)},88552:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},66065:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},19294:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},88825:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionTypes=t.Types=void 0;var n=r(85240);Object.defineProperty(t,"Types",{enumerable:!0,get:function(){return n.Types}}),Object.defineProperty(t,"ExpressionTypes",{enumerable:!0,get:function(){return n.ExpressionTypes}})},65055:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AlgebraFactory=void 0;const n=r(85240),i=r(64953);class a extends n.AlgebraFactory{createNodes(e,t){return{type:i.TypesComunica.NODES,graph:e,variable:t}}createDistinctTerms(e,t){return{type:i.TypesComunica.DISTINCT_TERMS,variables:e,terms:t}}}t.AlgebraFactory=a},64953:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TypesComunica=void 0,function(e){e.NODES="nodes",e.DISTINCT_TERMS="distinctterms"}(r||(t.TypesComunica=r={}))},34005:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inScopeVariables=t.visitOperationSub=t.visitOperation=t.mapOperationSub=t.mapOperationSubStrict=t.mapOperation=t.mapOperationStrict=t.transformer=t.objectify=t.resolveIRI=void 0,t.isKnownOperation=function(e,t,r){return e.type===t&&(void 0===r||e.subType===r)},t.isKnownSubType=function(e,t){return e.subType===t};const n=r(85240),i=r(74735),a=r(64953);t.resolveIRI=n.algebraUtils.resolveIRI,t.objectify=n.algebraUtils.objectify,t.transformer=new i.TransformerSubTyped({shallowKeys:new Set(["metadata"]),ignoreKeys:new Set(["metadata"])},{[n.Types.PATTERN]:{ignoreKeys:new Set(["subject","predicate","object","graph","metadata"])},[n.Types.EXPRESSION]:{ignoreKeys:new Set(["name","term","wildcard","variable","metadata"])},[n.Types.DESCRIBE]:{ignoreKeys:new Set(["terms","metadata"])},[n.Types.EXTEND]:{ignoreKeys:new Set(["variable","metadata"])},[n.Types.FROM]:{ignoreKeys:new Set(["default","named","metadata"])},[n.Types.GRAPH]:{ignoreKeys:new Set(["name","metadata"])},[n.Types.GROUP]:{ignoreKeys:new Set(["variables","metadata"])},[n.Types.LINK]:{ignoreKeys:new Set(["iri","metadata"])},[n.Types.NPS]:{ignoreKeys:new Set(["iris","metadata"])},[n.Types.PATH]:{ignoreKeys:new Set(["subject","object","graph","metadata"])},[n.Types.PROJECT]:{ignoreKeys:new Set(["variables","metadata"])},[n.Types.SERVICE]:{ignoreKeys:new Set(["name","metadata"])},[n.Types.VALUES]:{ignoreKeys:new Set(["variables","bindings","metadata"])},[n.Types.LOAD]:{ignoreKeys:new Set(["source","destination","metadata"])},[n.Types.CLEAR]:{ignoreKeys:new Set(["source","metadata"])},[n.Types.CREATE]:{ignoreKeys:new Set(["source","metadata"])},[n.Types.DROP]:{ignoreKeys:new Set(["source","metadata"])},[n.Types.ADD]:{ignoreKeys:new Set(["source","destination","metadata"])},[n.Types.MOVE]:{ignoreKeys:new Set(["source","destination","metadata"])},[n.Types.COPY]:{ignoreKeys:new Set(["source","destination","metadata"])},[a.TypesComunica.NODES]:{ignoreKeys:new Set(["variable","metadata"])}}),t.mapOperationStrict=t.transformer.transformNode.bind(t.transformer),t.mapOperation=t.mapOperationStrict,t.mapOperationSubStrict=t.transformer.transformNodeSpecific.bind(t.transformer),t.mapOperationSub=t.mapOperationSubStrict,t.visitOperation=t.transformer.visitNode.bind(t.transformer),t.visitOperationSub=t.transformer.visitNodeSpecific.bind(t.transformer),t.inScopeVariables=(e,r=t.visitOperation)=>n.algebraUtils.inScopeVariables(e,r)},83490:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Bindings=void 0;const n=r(97356),i=r(6081),a=r(35714);class o{type="bindings";dataFactory;entries;contextHolder;constructor(e,t,r){this.dataFactory=e,this.entries=t,this.contextHolder=r}has(e){return this.entries.has("string"==typeof e?e:e.value)}get(e){return this.entries.get("string"==typeof e?e:e.value)}set(e,t){return new o(this.dataFactory,this.entries.set("string"==typeof e?e:e.value,t),this.contextHolder)}delete(e){return new o(this.dataFactory,this.entries.delete("string"==typeof e?e:e.value),this.contextHolder)}keys(){return this.mapIterable(this.iteratorToIterable(this.entries.keys()),(e=>this.dataFactory.variable(e)))}values(){return this.iteratorToIterable(this.entries.values())}forEach(e){for(const[t,r]of this.entries.entries())e(r,this.dataFactory.variable(t))}get size(){return this.entries.size}[Symbol.iterator](){return this.mapIterable(this.iteratorToIterable(this.entries.entries()),(([e,t])=>[this.dataFactory.variable(e),t]))[Symbol.iterator]()}equals(e){if(!e)return!1;if(this===e)return!0;if(this.size!==e.size)return!1;for(const t of this.keys())if(!this.get(t)?.equals(e.get(t)))return!1;return!0}filter(e){return new o(this.dataFactory,(0,i.Map)(this.entries.filter(((t,r)=>e(t,this.dataFactory.variable(r))))),this.contextHolder)}map(e){return new o(this.dataFactory,(0,i.Map)(this.entries.map(((t,r)=>e(t,this.dataFactory.variable(r))))),this.contextHolder)}merge(e){if(this.sizee.name))),c=t.keys().filter((e=>s.has(e.name)));for(const n of i){if(1===o[n.name])continue;o[n.name]=1;const i=c.some((e=>e.name===n.name));e[n.name]&&i?a[n.name]=e[n.name].run(t.get(n),r.get(n)):!e[n.name]&&i||(a[n.name]=t.get(n)||r.get(n))}return new n.ActionContext(a)}setContextEntry(e,t){return this.setContextEntryRaw(e,t)}setContextEntryRaw(e,t){return this.contextHolder&&this.contextHolder.context?new o(this.dataFactory,this.entries,{contextMergeHandlers:this.contextHolder.contextMergeHandlers,context:this.contextHolder.context.set(e,t)}):new o(this.dataFactory,this.entries,{contextMergeHandlers:this.contextHolder?.contextMergeHandlers??{},context:(new n.ActionContext).set(e,t)})}deleteContextEntry(e){return this.deleteContextEntryRaw(e)}deleteContextEntryRaw(e){return this.contextHolder?new o(this.dataFactory,this.entries,{contextMergeHandlers:this.contextHolder.contextMergeHandlers,context:this.contextHolder.context?.delete(e)}):new o(this.dataFactory,this.entries)}getContext(){return this.contextHolder?.context}getContextEntry(e){return this.getContext()?.get(e)}toString(){return(0,a.bindingsToString)(this)}*mapIterable(e,t){for(const r of e)yield t(r)}iteratorToIterable(e){return{[Symbol.iterator]:()=>e}}}t.Bindings=o},83210:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingsFactory=void 0;const n=r(6081),i=r(83490);class a{dataFactory;contextMergeHandlers;constructor(e,t){this.dataFactory=e,this.contextMergeHandlers=t}static async create(e,t,r){return new a(r,(await e.mediate({context:t})).mergeHandlers)}bindings(e=[]){return new i.Bindings(this.dataFactory,(0,n.Map)(e.map((([e,t])=>[e.value,t]))),this.contextMergeHandlers?{contextMergeHandlers:this.contextMergeHandlers}:void 0)}fromBindings(e){return this.bindings([...e])}fromRecord(e){return this.bindings(Object.entries(e).map((([e,t])=>[this.dataFactory.variable(e),t])))}}t.BindingsFactory=a},35714:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindingsToString=function(e){const t={};for(const r of e.keys())t[r.value]=(0,n.termToString)(e.get(r));return JSON.stringify(t,null," ")},t.bindingsToCompactString=function(e,t){return t.map((t=>{const r=e.get(t);return r?(0,n.termToString)(r):""})).join("")};const n=r(22112)},23814:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(83490),t),i(r(83210),t),i(r(35714),t)},7079:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingsIndexDef=void 0,t.BindingsIndexDef=class{keys;hashFn;index;constructor(e,t){this.keys=e.map((e=>e.variable)),this.hashFn=t,this.index={}}put(e,t){return this.index[this.hashFn(e,this.keys)]=t}get(e){const t=this.getFirst(e);return t?[t]:[]}getFirst(e){return this.index[this.hashFn(e,this.keys)]}values(){return Object.values(this.index)}}},14190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingsIndexUndef=void 0,t.BindingsIndexUndef=class{keys;data={};hashFn;allowDisjointDomains;constructor(e,t,r){this.keys=e.map((e=>e.variable)),this.hashFn=t,this.allowDisjointDomains=r&&this.keys.length>0}put(e,t){if(this.allowDisjointDomains||this.isBindingsValid(e)){let r=this.data;for(let n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},42536:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7079),t),i(r(14190),t),i(r(48201),t)},76840:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNodeBindingsScoped=void 0,t.BlankNodeBindingsScoped=class{termType="BlankNode";singleBindingsScope=!0;value;constructor(e){this.value=e}equals(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}},11650:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNodeScoped=void 0,t.BlankNodeScoped=class{termType="BlankNode";value;skolemized;constructor(e,t){this.value=e,this.skolemized=t}equals(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}},98080:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(11650),t),i(r(76840),t)},12754:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Aggregate=void 0;const n=r(38548);t.Aggregate=class{name;expression;expressionType=n.ExpressionType.Aggregate;constructor(e,t){this.name=e,this.expression=t}}},51029:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Existence=void 0;const n=r(38548);t.Existence=class{expression;expressionType=n.ExpressionType.Existence;constructor(e){this.expression=e}}},96810:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asTermType=function(e){if("namedNode"===e||"literal"===e||"blankNode"===e||"quad"===e)return e}},86021:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Operator=void 0;const n=r(38548);t.Operator=class{name;args;apply;expressionType=n.ExpressionType.Operator;constructor(e,t,r){this.name=e,this.args=t,this.apply=r}}},33439:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;o0?"INF":e<0?"-INF":"NaN";const t=e.toExponential(),[r,n]=t.split("e"),i=n.replace(/\+/u,"");return`${r.includes(".")?r:`${r}.0`}E${i}`}},t.BooleanLiteral=class extends h{typedValue;strValue;constructor(e,t,r){super(e,r??u.TypeURL.XSD_BOOLEAN,t),this.typedValue=e,this.strValue=t}coerceEBV(){return this.typedValue}},t.LangStringLiteral=class extends h{typedValue;language;constructor(e,t,r){super(e,r??u.TypeURL.RDF_LANG_STRING,e,t),this.typedValue=e,this.language=t}coerceEBV(){return super.coerceEBV()}},t.DirLangStringLiteral=class extends h{typedValue;language;direction;constructor(e,t,r,n){super(e,n??u.TypeURL.RDF_DIR_LANG_STRING,e,t,r),this.typedValue=e,this.language=t,this.direction=r}},t.StringLiteral=class extends h{typedValue;constructor(e,t){super(e,t??u.TypeURL.XSD_STRING,e),this.typedValue=e}coerceEBV(){return this.str().length>0}},t.DateTimeLiteral=class extends h{typedValue;strValue;constructor(e,t,r){super(e,r??u.TypeURL.XSD_DATE_TIME,t),this.typedValue=e,this.strValue=t}str(){return(0,d.serializeDateTime)(this.typedValue)}},t.TimeLiteral=class extends h{typedValue;strValue;constructor(e,t,r){super(e,r??u.TypeURL.XSD_TIME,t),this.typedValue=e,this.strValue=t}str(){return(0,d.serializeTime)(this.typedValue)}},t.DateLiteral=class extends h{typedValue;strValue;constructor(e,t,r){super(e,r??u.TypeURL.XSD_DATE,t),this.typedValue=e,this.strValue=t}str(){return(0,d.serializeDate)(this.typedValue)}};class y extends h{typedValue;strValue;constructor(e,t,r){super(e,r??u.TypeURL.XSD_DURATION,t),this.typedValue=e,this.strValue=t}str(){return(0,d.serializeDuration)(this.typedValue)}}t.DurationLiteral=y,t.DayTimeDurationLiteral=class extends y{typedValue;strValue;constructor(e,t,r){super(e,t,r??u.TypeURL.XSD_DAY_TIME_DURATION),this.typedValue=e,this.strValue=t}},t.YearMonthDurationLiteral=class extends h{typedValue;strValue;constructor(e,t,r){super(e,r??u.TypeURL.XSD_YEAR_MONTH_DURATION,t),this.typedValue=e,this.strValue=t}str(){return(0,d.serializeDuration)(this.typedValue,"P0M")}};class m extends h{openWorldType;constructor(e,t,r,n,i){super({toString:()=>"undefined"},t,n,i),this.openWorldType=r}coerceEBV(){return super.coerceEBV()}toRDF(e){return e.literal(this.str(),this.language??e.namedNode(this.dataType))}str(){return this.strValue??""}}t.NonLexicalLiteral=m},39577:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Variable=void 0;const n=r(38548);t.Variable=class{expressionType=n.ExpressionType.Variable;name;constructor(e){this.name=e}}},58769:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(96810),t),i(r(39577),t),i(r(33439),t),i(r(86021),t),i(r(12754),t),i(r(51029),t)},84530:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;or=>{for(const[e,n]of r.entries())if(n instanceof u.NonLexicalLiteral)throw new p.InvalidLexicalForm(r[e].toRDF(t.context.getSafe(s.KeysInitQuery.dataFactory)));return e(t)(r)}}set(e,t,r=!0){return this.overloadTree.addOverload(e,r?y.wrapInvalidLexicalProtected(t):t),this}copy({from:e,to:t}){const r=this.overloadTree.getImplementationExact(e);if(!r)throw new p.UnexpectedError("Tried to copy implementation, but types not found",{from:e,to:t});return this.set(t,r)}onUnary(e,t,r=!0){return this.set([e],(e=>([r])=>t(e)(r)),r)}onUnaryTyped(e,t,r=!0){return this.set([e],(e=>([r])=>t(e)(r.typedValue)),r)}onBinary(e,t,r=!0){return this.set(e,(e=>([r,n])=>t(e)(r,n)),r)}onBinaryTyped(e,t,r=!0){return this.set(e,(e=>([r,n])=>t(e)(r.typedValue,n.typedValue)),r)}onTernaryTyped(e,t,r=!0){return this.set(e,(e=>([r,n,i])=>t(e)(r.typedValue,n.typedValue,i.typedValue)),r)}onTernary(e,t,r=!0){return this.set(e,(e=>([r,n,i])=>t(e)(r,n,i)),r)}onQuaternaryTyped(e,t,r=!0){return this.set(e,(e=>([r,n,i,a])=>t(e)(r.typedValue,n.typedValue,i.typedValue,a.typedValue)),r)}onTerm1(e,t=!1){return this.set(["term"],(t=>([r])=>e(t)(r)),t)}onTerm3(e){return this.set(["term","term","term"],(t=>([r,n,i])=>e(t)(r,n,i)))}onQuad1(e){return this.set(["quad"],(t=>([r])=>e(t)(r)))}onLiteral1(e,t=!0){return this.set(["literal"],(t=>([r])=>e(t)(r)),t)}onBoolean1(e,t=!0){return this.set([l.TypeURL.XSD_BOOLEAN],(t=>([r])=>e(t)(r)),t)}onBoolean1Typed(e,t=!0){return this.set([l.TypeURL.XSD_BOOLEAN],(t=>([r])=>e(t)(r.typedValue)),t)}onString1(e,t=!0){return this.set([l.TypeURL.XSD_STRING],(t=>([r])=>e(t)(r)),t)}onString1Typed(e,t=!0){return this.set([l.TypeURL.XSD_STRING],(t=>([r])=>e(t)(r.typedValue)),t)}onLangString1(e,t=!0){return this.set([l.TypeURL.RDF_LANG_STRING],(t=>([r])=>e(t)(r)),t)}onDirLangString1(e,t=!0){return this.set([l.TypeURL.RDF_DIR_LANG_STRING],(t=>([r])=>e(t)(r)),t)}onStringly1(e,t=!0){return this.set([l.TypeAlias.SPARQL_STRINGLY],(t=>([r])=>e(t)(r)),t)}onStringly1Typed(e,t=!0){return this.set([l.TypeAlias.SPARQL_STRINGLY],(t=>([r])=>e(t)(r.typedValue)),t)}verifyCompatibility(e,t){const r=e.dataType,n=t.dataType;if(r===d.TypeURL.RDF_DIR_LANG_STRING){if(n===d.TypeURL.RDF_LANG_STRING)throw new h.IncompatibleLanguageOperation(e,t);if(n===d.TypeURL.RDF_DIR_LANG_STRING&&(e.language!==t.language||e.direction!==t.direction))throw new h.IncompatibleLanguageOperation(e,t)}else if(r===d.TypeURL.RDF_LANG_STRING){if(n===d.TypeURL.RDF_DIR_LANG_STRING)throw new h.IncompatibleLanguageOperation(e,t);if(n===d.TypeURL.RDF_LANG_STRING&&e.language!==t.language)throw new h.IncompatibleLanguageOperation(e,t)}if(r===d.TypeURL.XSD_STRING&&(n===d.TypeURL.RDF_DIR_LANG_STRING||n===d.TypeURL.RDF_LANG_STRING))throw new h.IncompatibleLanguageOperation(e,t)}onCompatibleStringly2(e,t=!0){return this.set([l.TypeAlias.SPARQL_STRINGLY,l.TypeAlias.SPARQL_STRINGLY],(t=>([r,n])=>(this.verifyCompatibility(r,n),e(t)(r,n))),t)}onCompatibleStringly2Typed(e,t=!0){return this.set([l.TypeAlias.SPARQL_STRINGLY,l.TypeAlias.SPARQL_STRINGLY],(t=>([r,n])=>(this.verifyCompatibility(r,n),e(t)(r.typedValue,n.typedValue))),t)}onNumeric1(e,t=!0){return this.set([l.TypeAlias.SPARQL_NUMERIC],(t=>([r])=>e(t)(r)),t)}onDateTime1(e,t=!0){return this.set([l.TypeURL.XSD_DATE_TIME],(t=>([r])=>e(t)(r)),t)}numericConverter(e,t=!0){const r=t=>r=>e(t)(r.typedValue);return this.onUnary(d.TypeURL.XSD_INTEGER,(e=>t=>g(r(e)(t))),t).onUnary(d.TypeURL.XSD_DECIMAL,(e=>t=>b(r(e)(t))),t).onUnary(d.TypeURL.XSD_FLOAT,(e=>t=>v(r(e)(t))),t).onUnary(d.TypeURL.XSD_DOUBLE,(e=>t=>_(r(e)(t))),t)}arithmetic(e,t=!0){const r=t=>(r,n)=>e(t)(r.typedValue,n.typedValue);return this.onBinary([d.TypeURL.XSD_INTEGER,d.TypeURL.XSD_INTEGER],(e=>(t,n)=>g(r(e)(t,n))),t).onBinary([d.TypeURL.XSD_DECIMAL,d.TypeURL.XSD_DECIMAL],(e=>(t,n)=>b(r(e)(t,n))),t).onBinary([d.TypeURL.XSD_FLOAT,d.TypeURL.XSD_FLOAT],(e=>(t,n)=>v(r(e)(t,n))),t).onBinary([d.TypeURL.XSD_DOUBLE,d.TypeURL.XSD_DOUBLE],(e=>(t,n)=>_(r(e)(t,n))),t)}numberTest(e){return this.numeric((t=>([r,n])=>m(e(t)(r.typedValue,n.typedValue))))}stringTest(e,t=!0){return this.set([l.TypeURL.XSD_STRING,l.TypeURL.XSD_STRING],(t=>([r,n])=>m(e(t)(r.typedValue,n.typedValue))),t)}booleanTest(e,t=!0){return this.set([l.TypeURL.XSD_BOOLEAN,l.TypeURL.XSD_BOOLEAN],(t=>([r,n])=>m(e(t)(r.typedValue,n.typedValue))),t)}dateTimeTest(e,t=!0){return this.set([l.TypeURL.XSD_DATE_TIME,l.TypeURL.XSD_DATE_TIME],(t=>([r,n])=>m(e(t)(r.typedValue,n.typedValue))),t)}numeric(e){return this.set([l.TypeAlias.SPARQL_NUMERIC,l.TypeAlias.SPARQL_NUMERIC],e)}}function m(e){return new c.BooleanLiteral(e)}function g(e){return new c.IntegerLiteral(e)}function b(e){return new c.DecimalLiteral(e)}function v(e){return new c.FloatLiteral(e)}function _(e){return new c.DoubleLiteral(e)}t.Builder=y},51601:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OverloadTree=void 0;const n=r(58769),i=r(75841);class a{identifier;implementation;promotionCount;generalOverloads;literalOverLoads;depth;constructor(e,t){this.identifier=e,this.implementation=void 0,this.generalOverloads=Object.create(null),this.literalOverLoads=[],this.depth=t??0,this.promotionCount=void 0}getSubtree(e){const t=(0,i.asGeneralType)(e);if(t)return this.generalOverloads[t];for(const[t,r]of this.literalOverLoads)if(e===t)return r}getImplementationExact(e){let t=this;for(const r of e)if(t=t.getSubtree(r),!t)return;return t.implementation}search(e,t,r){let i=r[this.identifier],a=0;for(;a({node:e,index:1}))));o.length>0;){const{index:n,node:i}=o.pop();if(n===e.length&&i.implementation)return this.addToCache(r,e,i.implementation),i.implementation;o.push(...i.getSubTreeWithArg(e[n],t).map((e=>({node:e,index:n+1}))))}}addToCache(e,t,r){function i(e,t){return t in e||(e[t]={}),e[t]}let a=i(e,this.identifier);for(const e of t){const t=(0,n.isLiteralTermExpression)(e),r=t?t.dataType:e.termType;a.cache=a.cache??{},a=i(a.cache,r)}a.func=r}addOverload(e,t){this._addOverload([...e],t,0)}_addOverload(e,t,r){const[n,...o]=e;if(!n)return void((void 0===this.promotionCount||r<=this.promotionCount)&&(this.promotionCount=r,this.implementation=t));let s=this.getSubtree(n);if(!s){const e=new a(this.identifier,this.depth+1),t=(0,i.asGeneralType)(n);t&&(this.generalOverloads[t]=e);const r=(0,i.asOverrideType)(n);r&&this.literalOverLoads.push([r,e]),s=e}if(s._addOverload(o,t,r),i.typePromotion[n])for(const e of i.typePromotion[n])this.addPromotedOverload(e.typeToPromote,t,e.conversionFunction,o,r)}addPromotedOverload(e,t,r,n,i){let o=this.getSubtree(e);if(!o){const t=new a(this.identifier,this.depth+1);this.literalOverLoads.push([e,t]),o=t}o._addOverload(n,(e=>n=>t(e)([...n.slice(0,this.depth),r(n[this.depth]),...n.slice(this.depth+1,n.length)])),i+1)}getSubTreeWithArg(e,t){const r=[],a=(0,n.isLiteralTermExpression)(e);if(this.generalOverloads.term&&r.push(this.generalOverloads.term),this.generalOverloads[e.termType]&&r.push(this.generalOverloads[e.termType]),a){const e=(0,i.asKnownLiteralType)(a.dataType);let n;n=e?i.superTypeDictTable[e]:(0,i.getSuperTypes)(a.dataType,t);const o=this.literalOverLoads.filter((([e,t])=>e in n)).map((([e,t])=>[n[e],t]));o.sort((([e,t],[r,n])=>e-r)),r.push(...o.map((([e,t])=>t)))}return r}}t.OverloadTree=a},12233:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LangStringLiteral=t.TimeLiteral=t.DurationLiteral=t.DateLiteral=t.DayTimeDurationLiteral=t.DateTimeLiteral=t.yearMonthDurationsToMonths=t.toUTCDate=t.toDateTimeRepresentation=t.negateDuration=t.extractRawTimeZone=t.defaultedYearMonthDurationRepresentation=t.defaultedDurationRepresentation=t.defaultedDayTimeDurationRepresentation=t.defaultedDateTimeRepresentation=t.dayTimeDurationsToSeconds=t.isSubTypeOf=t.SparqlOperator=t.TypeAlias=t.TypeURL=t.typedLiteral=t.InvalidArity=t.InvalidLexicalForm=t.ExtensionFunctionError=t.CastError=t.UnboundVariableError=t.NoAggregator=t.InError=t.CoalesceError=t.InvalidArgumentTypes=t.InvalidTimezoneCall=t.IncompatibleLanguageOperation=t.RDFEqualTypeError=t.EmptyAggregateError=t.isExpressionError=t.ExpressionError=t.Builder=t.expressionToVar=t.float=t.decimal=t.langString=t.dateTime=t.integer=t.double=t.string=t.bool=t.declare=t.prepareEvaluatorActionContext=t.OverloadTree=t.TermTransformer=void 0,t.trimToDayTimeDuration=t.trimToYearMonthDuration=t.parseDate=t.parseXSDFloat=t.parseXSDDecimal=t.parseYearMonthDuration=t.parseTime=t.parseDuration=t.parseDayTimeDuration=t.parseDateTime=t.elapsedDuration=t.addDurationToDateTime=t.isNonLexicalLiteral=t.StringLiteral=t.NonLexicalLiteral=t.FloatLiteral=t.IntegerLiteral=t.Literal=t.Existence=t.Aggregate=t.DoubleLiteral=t.DefaultGraph=t.DecimalLiteral=t.BlankNode=t.BooleanLiteral=t.NumericLiteral=t.Variable=t.NamedNode=t.Operator=t.Quad=t.YearMonthDurationLiteral=t.Term=void 0;var n=r(29087);Object.defineProperty(t,"TermTransformer",{enumerable:!0,get:function(){return n.TermTransformer}});var i=r(51601);Object.defineProperty(t,"OverloadTree",{enumerable:!0,get:function(){return i.OverloadTree}});var a=r(66357);Object.defineProperty(t,"prepareEvaluatorActionContext",{enumerable:!0,get:function(){return a.prepareEvaluatorActionContext}});var o=r(84530);Object.defineProperty(t,"declare",{enumerable:!0,get:function(){return o.declare}}),Object.defineProperty(t,"bool",{enumerable:!0,get:function(){return o.bool}}),Object.defineProperty(t,"string",{enumerable:!0,get:function(){return o.string}}),Object.defineProperty(t,"double",{enumerable:!0,get:function(){return o.double}}),Object.defineProperty(t,"integer",{enumerable:!0,get:function(){return o.integer}}),Object.defineProperty(t,"dateTime",{enumerable:!0,get:function(){return o.dateTime}}),Object.defineProperty(t,"langString",{enumerable:!0,get:function(){return o.langString}}),Object.defineProperty(t,"decimal",{enumerable:!0,get:function(){return o.decimal}}),Object.defineProperty(t,"float",{enumerable:!0,get:function(){return o.float}}),Object.defineProperty(t,"expressionToVar",{enumerable:!0,get:function(){return o.expressionToVar}}),Object.defineProperty(t,"Builder",{enumerable:!0,get:function(){return o.Builder}});var s=r(61839);Object.defineProperty(t,"ExpressionError",{enumerable:!0,get:function(){return s.ExpressionError}}),Object.defineProperty(t,"isExpressionError",{enumerable:!0,get:function(){return s.isExpressionError}}),Object.defineProperty(t,"EmptyAggregateError",{enumerable:!0,get:function(){return s.EmptyAggregateError}}),Object.defineProperty(t,"RDFEqualTypeError",{enumerable:!0,get:function(){return s.RDFEqualTypeError}}),Object.defineProperty(t,"IncompatibleLanguageOperation",{enumerable:!0,get:function(){return s.IncompatibleLanguageOperation}}),Object.defineProperty(t,"InvalidTimezoneCall",{enumerable:!0,get:function(){return s.InvalidTimezoneCall}}),Object.defineProperty(t,"InvalidArgumentTypes",{enumerable:!0,get:function(){return s.InvalidArgumentTypes}}),Object.defineProperty(t,"CoalesceError",{enumerable:!0,get:function(){return s.CoalesceError}}),Object.defineProperty(t,"InError",{enumerable:!0,get:function(){return s.InError}}),Object.defineProperty(t,"NoAggregator",{enumerable:!0,get:function(){return s.NoAggregator}}),Object.defineProperty(t,"UnboundVariableError",{enumerable:!0,get:function(){return s.UnboundVariableError}}),Object.defineProperty(t,"CastError",{enumerable:!0,get:function(){return s.CastError}}),Object.defineProperty(t,"ExtensionFunctionError",{enumerable:!0,get:function(){return s.ExtensionFunctionError}}),Object.defineProperty(t,"InvalidLexicalForm",{enumerable:!0,get:function(){return s.InvalidLexicalForm}}),Object.defineProperty(t,"InvalidArity",{enumerable:!0,get:function(){return s.InvalidArity}});var c=r(16068);Object.defineProperty(t,"typedLiteral",{enumerable:!0,get:function(){return c.typedLiteral}}),Object.defineProperty(t,"TypeURL",{enumerable:!0,get:function(){return c.TypeURL}}),Object.defineProperty(t,"TypeAlias",{enumerable:!0,get:function(){return c.TypeAlias}}),Object.defineProperty(t,"SparqlOperator",{enumerable:!0,get:function(){return c.SparqlOperator}});var u=r(75841);Object.defineProperty(t,"isSubTypeOf",{enumerable:!0,get:function(){return u.isSubTypeOf}});var l=r(33632);Object.defineProperty(t,"dayTimeDurationsToSeconds",{enumerable:!0,get:function(){return l.dayTimeDurationsToSeconds}}),Object.defineProperty(t,"defaultedDateTimeRepresentation",{enumerable:!0,get:function(){return l.defaultedDateTimeRepresentation}}),Object.defineProperty(t,"defaultedDayTimeDurationRepresentation",{enumerable:!0,get:function(){return l.defaultedDayTimeDurationRepresentation}}),Object.defineProperty(t,"defaultedDurationRepresentation",{enumerable:!0,get:function(){return l.defaultedDurationRepresentation}}),Object.defineProperty(t,"defaultedYearMonthDurationRepresentation",{enumerable:!0,get:function(){return l.defaultedYearMonthDurationRepresentation}}),Object.defineProperty(t,"extractRawTimeZone",{enumerable:!0,get:function(){return l.extractRawTimeZone}}),Object.defineProperty(t,"negateDuration",{enumerable:!0,get:function(){return l.negateDuration}}),Object.defineProperty(t,"toDateTimeRepresentation",{enumerable:!0,get:function(){return l.toDateTimeRepresentation}}),Object.defineProperty(t,"toUTCDate",{enumerable:!0,get:function(){return l.toUTCDate}}),Object.defineProperty(t,"yearMonthDurationsToMonths",{enumerable:!0,get:function(){return l.yearMonthDurationsToMonths}});var d=r(58769);Object.defineProperty(t,"DateTimeLiteral",{enumerable:!0,get:function(){return d.DateTimeLiteral}}),Object.defineProperty(t,"DayTimeDurationLiteral",{enumerable:!0,get:function(){return d.DayTimeDurationLiteral}}),Object.defineProperty(t,"DateLiteral",{enumerable:!0,get:function(){return d.DateLiteral}}),Object.defineProperty(t,"DurationLiteral",{enumerable:!0,get:function(){return d.DurationLiteral}}),Object.defineProperty(t,"TimeLiteral",{enumerable:!0,get:function(){return d.TimeLiteral}}),Object.defineProperty(t,"LangStringLiteral",{enumerable:!0,get:function(){return d.LangStringLiteral}}),Object.defineProperty(t,"Term",{enumerable:!0,get:function(){return d.Term}}),Object.defineProperty(t,"YearMonthDurationLiteral",{enumerable:!0,get:function(){return d.YearMonthDurationLiteral}}),Object.defineProperty(t,"Quad",{enumerable:!0,get:function(){return d.Quad}}),Object.defineProperty(t,"Operator",{enumerable:!0,get:function(){return d.Operator}}),Object.defineProperty(t,"NamedNode",{enumerable:!0,get:function(){return d.NamedNode}}),Object.defineProperty(t,"Variable",{enumerable:!0,get:function(){return d.Variable}}),Object.defineProperty(t,"NumericLiteral",{enumerable:!0,get:function(){return d.NumericLiteral}}),Object.defineProperty(t,"BooleanLiteral",{enumerable:!0,get:function(){return d.BooleanLiteral}}),Object.defineProperty(t,"BlankNode",{enumerable:!0,get:function(){return d.BlankNode}}),Object.defineProperty(t,"DecimalLiteral",{enumerable:!0,get:function(){return d.DecimalLiteral}}),Object.defineProperty(t,"DefaultGraph",{enumerable:!0,get:function(){return d.DefaultGraph}}),Object.defineProperty(t,"DoubleLiteral",{enumerable:!0,get:function(){return d.DoubleLiteral}}),Object.defineProperty(t,"Aggregate",{enumerable:!0,get:function(){return d.Aggregate}}),Object.defineProperty(t,"Existence",{enumerable:!0,get:function(){return d.Existence}}),Object.defineProperty(t,"Literal",{enumerable:!0,get:function(){return d.Literal}}),Object.defineProperty(t,"IntegerLiteral",{enumerable:!0,get:function(){return d.IntegerLiteral}}),Object.defineProperty(t,"FloatLiteral",{enumerable:!0,get:function(){return d.FloatLiteral}}),Object.defineProperty(t,"NonLexicalLiteral",{enumerable:!0,get:function(){return d.NonLexicalLiteral}}),Object.defineProperty(t,"StringLiteral",{enumerable:!0,get:function(){return d.StringLiteral}}),Object.defineProperty(t,"isNonLexicalLiteral",{enumerable:!0,get:function(){return d.isNonLexicalLiteral}});var p=r(56235);Object.defineProperty(t,"addDurationToDateTime",{enumerable:!0,get:function(){return p.addDurationToDateTime}}),Object.defineProperty(t,"elapsedDuration",{enumerable:!0,get:function(){return p.elapsedDuration}});var h=r(17018);Object.defineProperty(t,"parseDateTime",{enumerable:!0,get:function(){return h.parseDateTime}}),Object.defineProperty(t,"parseDayTimeDuration",{enumerable:!0,get:function(){return h.parseDayTimeDuration}}),Object.defineProperty(t,"parseDuration",{enumerable:!0,get:function(){return h.parseDuration}}),Object.defineProperty(t,"parseTime",{enumerable:!0,get:function(){return h.parseTime}}),Object.defineProperty(t,"parseYearMonthDuration",{enumerable:!0,get:function(){return h.parseYearMonthDuration}}),Object.defineProperty(t,"parseXSDDecimal",{enumerable:!0,get:function(){return h.parseXSDDecimal}}),Object.defineProperty(t,"parseXSDFloat",{enumerable:!0,get:function(){return h.parseXSDFloat}}),Object.defineProperty(t,"parseDate",{enumerable:!0,get:function(){return h.parseDate}});var f=r(33632);Object.defineProperty(t,"trimToYearMonthDuration",{enumerable:!0,get:function(){return f.trimToYearMonthDuration}}),Object.defineProperty(t,"trimToDayTimeDuration",{enumerable:!0,get:function(){return f.trimToDayTimeDuration}})},29087:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SparqlOperator=t.TypeURL=t.TypeAlias=void 0,t.typedLiteral=function(e,t){return a.literal(e,a.namedNode(t))};const n=r(18050);var i;!function(e){e.SPARQL_NUMERIC="SPARQL_NUMERIC",e.SPARQL_STRINGLY="SPARQL_STRINGLY"}(i||(t.TypeAlias=i={}));const a=new n.DataFactory;var o,s;!function(e){e.XSD_ANY_URI="http://www.w3.org/2001/XMLSchema#anyURI",e.XSD_STRING="http://www.w3.org/2001/XMLSchema#string",e.RDF_LANG_STRING="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",e.RDF_DIR_LANG_STRING="http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString",e.XSD_BOOLEAN="http://www.w3.org/2001/XMLSchema#boolean",e.XSD_DATE_TIME="http://www.w3.org/2001/XMLSchema#dateTime",e.XSD_DATE_TIME_STAMP="http://www.w3.org/2001/XMLSchema#dateTimeStamp",e.XSD_DATE="http://www.w3.org/2001/XMLSchema#date",e.XSD_G_MONTH="http://www.w3.org/2001/XMLSchema#gMonth",e.XSD_G_MONTHDAY="http://www.w3.org/2001/XMLSchema#gMonthDay",e.XSD_G_YEAR="http://www.w3.org/2001/XMLSchema#gYear",e.XSD_G_YEAR_MONTH="http://www.w3.org/2001/XMLSchema#gYearMonth",e.XSD_TIME="http://www.w3.org/2001/XMLSchema#time",e.XSD_G_DAY="http://www.w3.org/2001/XMLSchema#gDay",e.XSD_DECIMAL="http://www.w3.org/2001/XMLSchema#decimal",e.XSD_FLOAT="http://www.w3.org/2001/XMLSchema#float",e.XSD_DOUBLE="http://www.w3.org/2001/XMLSchema#double",e.XSD_INTEGER="http://www.w3.org/2001/XMLSchema#integer",e.XSD_NON_POSITIVE_INTEGER="http://www.w3.org/2001/XMLSchema#nonPositiveInteger",e.XSD_NEGATIVE_INTEGER="http://www.w3.org/2001/XMLSchema#negativeInteger",e.XSD_LONG="http://www.w3.org/2001/XMLSchema#long",e.XSD_INT="http://www.w3.org/2001/XMLSchema#int",e.XSD_SHORT="http://www.w3.org/2001/XMLSchema#short",e.XSD_BYTE="http://www.w3.org/2001/XMLSchema#byte",e.XSD_NON_NEGATIVE_INTEGER="http://www.w3.org/2001/XMLSchema#nonNegativeInteger",e.XSD_POSITIVE_INTEGER="http://www.w3.org/2001/XMLSchema#positiveInteger",e.XSD_UNSIGNED_LONG="http://www.w3.org/2001/XMLSchema#unsignedLong",e.XSD_UNSIGNED_INT="http://www.w3.org/2001/XMLSchema#unsignedInt",e.XSD_UNSIGNED_SHORT="http://www.w3.org/2001/XMLSchema#unsignedShort",e.XSD_UNSIGNED_BYTE="http://www.w3.org/2001/XMLSchema#unsignedByte",e.XSD_NORMALIZED_STRING="http://www.w3.org/2001/XMLSchema#normalizedString",e.XSD_TOKEN="http://www.w3.org/2001/XMLSchema#token",e.XSD_LANGUAGE="http://www.w3.org/2001/XMLSchema#language",e.XSD_NM_TOKEN="http://www.w3.org/2001/XMLSchema#NMTOKEN",e.XSD_NAME="http://www.w3.org/2001/XMLSchema#name",e.XSD_NC_NAME="http://www.w3.org/2001/XMLSchema#NCName",e.XSD_ENTITY="http://www.w3.org/2001/XMLSchema#ENTITY",e.XSD_ID="http://www.w3.org/2001/XMLSchema#ID",e.XSD_ID_REF="http://www.w3.org/2001/XMLSchema#IDREF",e.XSD_DURATION="http://www.w3.org/2001/XMLSchema#duration",e.XSD_YEAR_MONTH_DURATION="http://www.w3.org/2001/XMLSchema#yearMonthDuration",e.XSD_DAY_TIME_DURATION="http://www.w3.org/2001/XMLSchema#dayTimeDuration",e.XSD_UNTYPED_ATOMIC="http://www.w3.org/2001/XMLSchema#untypedAtomic"}(o||(t.TypeURL=o={})),function(e){e.NOT="!",e.UMINUS="uminus",e.UPLUS="uplus",e.LOGICAL_OR="||",e.LOGICAL_AND="&&",e.EQUAL="=",e.NOT_EQUAL="!=",e.LT="<",e.GT=">",e.LTE="<=",e.GTE=">=",e.SAME_TERM="sameterm",e.IN="in",e.NOT_IN="notin",e.MULTIPLICATION="*",e.DIVISION="/",e.ADDITION="+",e.SUBTRACTION="-",e.IS_IRI="isiri",e.IS_URI="isuri",e.IS_BLANK="isblank",e.IS_LITERAL="isliteral",e.IS_NUMERIC="isnumeric",e.HAS_LANG="haslang",e.HAS_LANGDIR="haslangdir",e.STR="str",e.LANG="lang",e.LANGDIR="langdir",e.DATATYPE="datatype",e.IRI="iri",e.URI="uri",e.BNODE="bnode",e.STRDT="strdt",e.STRLANG="strlang",e.STRLANGDIR="strlangdir",e.UUID="uuid",e.STRUUID="struuid",e.STRLEN="strlen",e.SUBSTR="substr",e.UCASE="ucase",e.LCASE="lcase",e.STRSTARTS="strstarts",e.STRENDS="strends",e.CONTAINS="contains",e.STRBEFORE="strbefore",e.STRAFTER="strafter",e.ENCODE_FOR_URI="encode_for_uri",e.CONCAT="concat",e.LANG_MATCHES="langmatches",e.REGEX="regex",e.REPLACE="replace",e.ABS="abs",e.ROUND="round",e.CEIL="ceil",e.FLOOR="floor",e.RAND="rand",e.NOW="now",e.YEAR="year",e.MONTH="month",e.DAY="day",e.HOURS="hours",e.MINUTES="minutes",e.SECONDS="seconds",e.TIMEZONE="timezone",e.TZ="tz",e.MD5="md5",e.SHA1="sha1",e.SHA256="sha256",e.SHA384="sha384",e.SHA512="sha512",e.TRIPLE="triple",e.SUBJECT="subject",e.PREDICATE="predicate",e.OBJECT="object",e.IS_TRIPLE="istriple",e.BOUND="bound",e.IF="if",e.COALESCE="coalesce"}(s||(t.SparqlOperator=s={}))},66357:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prepareEvaluatorActionContext=function(e){let t=e;if(t.has(n.KeysInitQuery.extensionFunctionCreator)&&t.has(n.KeysInitQuery.extensionFunctions))throw new Error("Illegal simultaneous usage of extensionFunctionCreator and extensionFunctions in context");if(t.has(n.KeysInitQuery.extensionFunctionCreator))t=t.set(n.KeysExpressionEvaluator.extensionFunctionCreator,t.get(n.KeysInitQuery.extensionFunctionCreator));else if(t.has(n.KeysInitQuery.extensionFunctions)){const e=t.getSafe(n.KeysInitQuery.extensionFunctions);t=t.set(n.KeysExpressionEvaluator.extensionFunctionCreator,(async t=>e[t.value]))}else t=t.setDefault(n.KeysExpressionEvaluator.extensionFunctionCreator,(async()=>{}));return t=t.setDefault(n.KeysExpressionEvaluator.defaultTimeZone,(0,a.extractTimeZone)(t.getSafe(n.KeysInitQuery.queryTimestamp))),t=t.setDefault(n.KeysExpressionEvaluator.superTypeProvider,{cache:new i.LRUCache({max:1e3}),discoverer:()=>"term"}),t};const n=r(72407),i=r(35069),a=r(33632)},33632:(e,t)=>{"use strict";function r(e){return{day:e.day??0,hours:e.hours??0,minutes:e.minutes??0,seconds:e.seconds??0}}function n(e){return{year:e.year??0,month:e.month??0}}function i(e){return{...r(e),...n(e)}}function a(e){return{...e,day:e.day??1,hours:e.hours??0,month:e.month??1,year:e.year??0,seconds:e.seconds??0,minutes:e.minutes??0}}function o(e){const t=new Date(e.year,e.month-1,e.day,e.hours,e.minutes,Math.trunc(e.seconds),e.seconds%1*1e3);if(e.year>=0&&e.year<100){const e=1900;t.setFullYear(t.getFullYear()-e)}return t}Object.defineProperty(t,"__esModule",{value:!0}),t.defaultedDayTimeDurationRepresentation=r,t.defaultedYearMonthDurationRepresentation=n,t.defaultedDurationRepresentation=i,t.simplifyDurationRepresentation=function(e){const t=i(e),r={},n=t.year+Math.trunc(t.month/12);n&&(r.year=n,t.month%=12),t.month&&(r.month=t.month);const a=t.day+Math.trunc(t.hours/24)+Math.trunc(t.minutes/1440)+Math.trunc(t.seconds/86400);a&&(r.day=a,t.hours%=24,t.minutes%=1440,t.seconds%=86400);const o=t.hours+Math.trunc(t.minutes/60)+Math.trunc(t.seconds/3600);o&&(r.hours=o,t.minutes%=60,t.seconds%=3600);const s=t.minutes+Math.trunc(t.seconds/60);return s&&(r.minutes=s,t.seconds%=60),t.seconds&&(r.seconds=t.seconds),r},t.defaultedDateTimeRepresentation=a,t.toDateTimeRepresentation=function({date:e,timeZone:t}){return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds(),zoneHours:t.zoneHours,zoneMinutes:t.zoneMinutes}},t.negateDuration=function(e){return{year:void 0===e.year?void 0:-1*e.year,month:void 0===e.month?void 0:-1*e.month,day:void 0===e.day?void 0:-1*e.day,hours:void 0===e.hours?void 0:-1*e.hours,minutes:void 0===e.minutes?void 0:-1*e.minutes,seconds:void 0===e.seconds?void 0:-1*e.seconds}},t.toJSDate=o,t.toUTCDate=function(e,t){const r=o(a(e)),n=r.getTimezoneOffset(),i=e.zoneHours??t.zoneHours,s=e.zoneMinutes??t.zoneMinutes;return new Date(r.getTime()-60*(n+60*i+s)*1e3)},t.trimToYearMonthDuration=function(e){return{year:e.year,month:e.month}},t.trimToDayTimeDuration=function(e){return{day:e.day,hours:e.hours,minutes:e.minutes,seconds:e.seconds}},t.yearMonthDurationsToMonths=function(e){return 12*e.year+e.month},t.dayTimeDurationsToSeconds=function(e){return 60*(60*(24*e.day+e.hours)+e.minutes)+e.seconds},t.extractRawTimeZone=function(e){return/(Z|([+-]\d\d:\d\d))?$/u.exec(e)[0]},t.extractTimeZone=function(e){return{zoneHours:e.getTimezoneOffset()/60,zoneMinutes:e.getTimezoneOffset()%60}}},61839:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoAggregator=t.ExtensionFunctionError=t.InvalidExpression=t.InvalidArity=t.UnexpectedError=t.ParseError=t.EmptyAggregateError=t.IncompatibleLanguageOperation=t.InvalidTimezoneCall=t.CastError=t.InvalidArgumentTypes=t.InError=t.CoalesceError=t.RDFEqualTypeError=t.EBVCoercionError=t.UnboundVariableError=t.InvalidLexicalForm=t.ExpressionError=void 0,t.isExpressionError=function(e){return e instanceof r};class r extends Error{}t.ExpressionError=r,t.InvalidLexicalForm=class extends r{arg;constructor(e){super(`Invalid lexical form '${c(e)}'`),this.arg=e}},t.UnboundVariableError=class extends r{variable;bindings;constructor(e,t){super(`Unbound variable '${c(e)}'`),this.variable=e,this.bindings=t}},t.EBVCoercionError=class extends r{arg;constructor(e){super(`Cannot coerce term to EBV '${c(e)}'`),this.arg=e}},t.RDFEqualTypeError=class extends r{args;constructor(e){super("Equality test for literals with unsupported datatypes"),this.args=e}},t.CoalesceError=class extends r{errors;constructor(e){super("All COALESCE arguments threw errors"),this.errors=e}},t.InError=class extends r{errors;constructor(e){super(`Some argument to IN errorred and none where equal. ${e.map((e=>`(${e.toString()}) `)).join("and ")}`),this.errors=e}},t.InvalidArgumentTypes=class extends r{args;op;constructor(e,t){super(`Argument types not valid for operator: '${c(t)}' with '${c(e)}`),this.args=e,this.op=t}},t.CastError=class extends r{arg;constructor(e,t){super(`Invalid cast: '${c(e)}' to '${c(t)}'`),this.arg=e}},t.InvalidTimezoneCall=class extends r{dateString;constructor(e){super(`TIMEZONE call on ${e} which has no timezone`),this.dateString=e}},t.IncompatibleLanguageOperation=class extends r{arg1;arg2;constructor(e,t){super(`Operation on incompatible language literals '${c(e)}' and '${c(t)}'`),this.arg1=e,this.arg2=t}},t.EmptyAggregateError=class extends r{constructor(){super("Empty aggregate expression")}},t.ParseError=class extends r{constructor(e,t){super(`Failed to parse "${e}" as ${t}.`)}};class n extends Error{payload;constructor(e,t){super(`Programmer Error '${e}'`),this.payload=t}}t.UnexpectedError=n;class i extends Error{args;op;constructor(e,t){super(`The number of args does not match the arity of the operator '${c(t)}'.`),this.args=e,this.op=t}}t.InvalidArity=i;class a extends Error{constructor(e){super(`Invalid SPARQL Expression '${c(e)}'`)}}t.InvalidExpression=a;class o extends Error{constructor(e,t){t instanceof Error?super(`Error thrown in ${e}: ${t.message}${t.stack?`\n${t.stack}`:""}`):super(`Error thrown in ${e}`)}}t.ExtensionFunctionError=o;class s extends Error{constructor(e){super(`Aggregate expression ${c(e)} found, but no aggregate hook provided.`)}}function c(e){return JSON.stringify(e)}t.NoAggregator=s},17018:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseXSDFloat=function(e){const t=Number(e);return Number.isNaN(t)?"NaN"===e?Number.NaN:"INF"===e||"+INF"===e?Number.POSITIVE_INFINITY:"-INF"===e?Number.NEGATIVE_INFINITY:void 0:t},t.parseXSDDecimal=function(e){const t=Number(e);return Number.isNaN(t)?void 0:t},t.parseDateTime=function(e){const[t,r]=e.split("T");if(void 0===r)throw new i.ParseError(e,"dateTime");return{...s(t),...c(r)}},t.parseDate=s,t.parseTime=function(e){const t=c(e);return t.hours%=24,t},t.parseDuration=u,t.parseYearMonthDuration=function(e){const t=u(e);if(["hours","minutes","seconds","day"].some((e=>Boolean(t[e]))))throw new i.ParseError(e,"yearMonthDuration");return t},t.parseDayTimeDuration=function(e){const t=u(e);if(["year","month"].some((e=>Boolean(t[e]))))throw new i.ParseError(e,"dayTimeDuration");return t};const n=r(33632),i=r(61839),a=r(56235);function o(e){if(""===e)return{zoneHours:void 0,zoneMinutes:void 0};if("Z"===e)return{zoneHours:0,zoneMinutes:0};const t=e.replaceAll(/^([+|-])(\d\d):(\d\d)$/gu,"$11!$2!$3").split("!").map(Number);return{zoneHours:t[0]*t[1],zoneMinutes:t[0]*t[2]}}function s(e){const t=e.replaceAll(/^(-)?([123456789]*\d{4})-(\d\d)-(\d\d)(Z|([+-]\d\d:\d\d))?$/gu,"$11!$2!$3!$4!$5");if(t===e)throw new i.ParseError(e,"date");const r=t.split("!"),n=r.slice(0,-1).map(Number),s={year:n[0]*n[1],month:n[2],day:n[3],...o(r[4])};if(!(s.month>=1&&s.month<=12&&s.day>=1&&s.day<=(0,a.maximumDayInMonthFor)(s.year,s.month)))throw new i.ParseError(e,"date");return s}function c(e){const t=e.replaceAll(/^(\d\d):(\d\d):(\d\d(\.\d+)?)(Z|([+-]\d\d:\d\d))?$/gu,"$1!$2!$3!$5");if(t===e)throw new i.ParseError(e,"time");const r=t.split("!"),n=r.slice(0,-1).map(Number),a={hours:n[0],minutes:n[1],seconds:n[2],...o(r[3])};if(a.seconds>=60||a.minutes>=60||a.hours>24||24===a.hours&&(0!==a.minutes||0!==a.seconds))throw new i.ParseError(e,"time");return a}function u(e){const[t,r]=e.split("T"),a=t.replaceAll(/^(-)?P(\d+Y)?(\d+M)?(\d+D)?$/gu,"$11S!$2!$3!$4");if(a===t)throw new i.ParseError(e,"duration");const o=a.split("!");if(void 0!==r){const t=r.replaceAll(/^(\d+H)?(\d+M)?(\d+(\.\d+)?S)?$/gu,"$1!$2!$3");if(""===r||r===t)throw new i.ParseError(e,"duration");o.push(...t.split("!"))}const s=o.map((e=>e.slice(0,-1)));if(!s.slice(1).some(Boolean))throw new i.ParseError(e,"duration");const c=Number(s[0]);return(0,n.simplifyDurationRepresentation)({year:s[1]?c*Number(s[1]):void 0,month:s[2]?c*Number(s[2]):void 0,day:s[3]?c*Number(s[3]):void 0,hours:s[4]?c*Number(s[4]):void 0,minutes:s[5]?c*Number(s[5]):void 0,seconds:s[6]?c*Number(s[6]):void 0})}},54966:(e,t)=>{"use strict";function r(e,t=2){return e.toLocaleString(void 0,{minimumIntegerDigits:t,useGrouping:!1})}function n(e){if(void 0===e.zoneHours&&void 0===e.zoneMinutes)return"";const t=e.zoneHours??0,n=e.zoneMinutes??0;return 0===t&&0===n?"Z":`${t>=0?`+${r(t)}`:r(t)}:${r(Math.abs(n))}`}function i(e){return`${r(e.year,4)}-${r(e.month)}-${r(e.day)}${n(e)}`}function a(e){return`${r(e.hours)}:${r(e.minutes)}:${r(e.seconds)}${n(e)}`}Object.defineProperty(t,"__esModule",{value:!0}),t.serializeDateTime=function(e){return`${i({year:e.year,month:e.month,day:e.day})}T${a(e)}`},t.serializeTimeZone=n,t.serializeDate=i,t.serializeTime=a,t.serializeDuration=function(e,t="PT0S"){if(!Object.values(e).some((e=>0!==(e||0))))return t;const r=`${Object.values(e).some((e=>(e||0)<0))?"-":""}P${e.year?`${Math.abs(e.year)}Y`:""}${e.month?`${Math.abs(e.month)}M`:""}${e.day?`${Math.abs(e.day)}D`:""}`;if(!(e.hours||e.minutes||e.seconds))return r;return`${r}T${e.hours?`${Math.abs(e.hours)}H`:""}${e.minutes?`${Math.abs(e.minutes)}M`:""}${e.seconds?`${Math.abs(e.seconds)}S`:""}`}},56235:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.maximumDayInMonthFor=a,t.addDurationToDateTime=function(e,t){const r={...e};let n=i(e.month+t.month,13,1);for(r.month=n.remainder,r.year=e.year+t.year+n.intDiv,n=i(e.seconds+t.seconds,60),r.seconds=n.remainder,n=i(e.minutes+t.minutes+n.intDiv,60),r.minutes=n.remainder,n=i(e.hours+t.hours+n.intDiv,24),r.hours=n.remainder,r.day=e.day+t.day+n.intDiv;;){let e;if(r.day<1)r.day+=a(r.year,r.month-1),e=-1;else{if(!(r.day>a(r.year,r.month)))break;r.day-=a(r.year,r.month),e=1}n=i(r.month+e,13,1),r.month=n.remainder,r.year+=n.intDiv}return r},t.elapsedDuration=function(e,t,r){const i=(0,n.toUTCDate)(e,r),a=(0,n.toUTCDate)(t,r),o=i.getTime()-a.getTime();return{day:Math.floor(o/864e5),hours:Math.floor(o%864e5/36e5),minutes:Math.floor(o%36e5/6e4),seconds:o%6e4}};const n=r(33632);function i(e,t,r=0){const n=e-r,i=t-r,a=Math.floor(n/i);return{intDiv:a,remainder:e-a*i}}function a(e,t){const{intDiv:r,remainder:n}=i(t,13,1),a=e+r;return[1,3,5,7,8,10,12].includes(n)?31:[4,6,9,11].includes(n)?30:2===n&&(0===i(a,400).remainder||0!==i(a,100).remainder&&0===i(a,4).remainder)?29:28}},75841:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typePromotion=t.typeAliasCheck=t.superTypeDictTable=t.extensionTableInput=void 0,t.getSuperTypes=o,t.extensionTableInit=s,t.asTypeAlias=function(e){if(e in t.typeAliasCheck)return e},t.asKnownLiteralType=u,t.asOverrideType=function(e){if(u(e)??"term"===e)return e},t.asGeneralType=function(e){if("term"===e||(0,n.asTermType)(e))return e},t.isInternalSubType=function(e,r){return"term"!==e&&t.superTypeDictTable[e]&&void 0!==t.superTypeDictTable[e][r]},t.getSuperTypeDict=l,t.isSubTypeOf=function(e,t,r){return"term"!==e&&void 0!==l(e,r)[t]};const n=r(58769),i=r(84530),a=r(16068);function o(e,r){const n=r.cache.get(e);if(n)return n;const i=r.discoverer(e);if("term"===i){const t=Object.create(null);return t.__depth=0,t[e]=0,r.cache.set(e,t),t}let a;const s=u(i);return a=s?{...t.superTypeDictTable[s]}:{...o(i,r)},a.__depth++,a[e]=a.__depth,r.cache.set(e,a),a}function s(){for(const[e,r]of Object.entries(t.extensionTableInput)){const n=e;t.superTypeDictTable[n]||c(n,r,t.superTypeDictTable)}}function c(e,r,n){if("term"===r||void 0===r){const t=Object.create(null);return t.__depth=0,t[e]=0,void(n[e]=t)}n[r]||c(r,t.extensionTableInput[r],n),n[e]={...n[r],[e]:n[r].__depth+1,__depth:n[r].__depth+1}}function u(e){if(e in t.superTypeDictTable)return e}function l(e,r){const n=u(e);return n?t.superTypeDictTable[n]:o(e,r)}t.extensionTableInput={[a.TypeURL.XSD_DATE_TIME_STAMP]:a.TypeURL.XSD_DATE_TIME,[a.TypeURL.XSD_DAY_TIME_DURATION]:a.TypeURL.XSD_DURATION,[a.TypeURL.XSD_YEAR_MONTH_DURATION]:a.TypeURL.XSD_DURATION,[a.TypeURL.RDF_LANG_STRING]:a.TypeAlias.SPARQL_STRINGLY,[a.TypeURL.RDF_DIR_LANG_STRING]:a.TypeAlias.SPARQL_STRINGLY,[a.TypeURL.XSD_STRING]:a.TypeAlias.SPARQL_STRINGLY,[a.TypeURL.XSD_NORMALIZED_STRING]:a.TypeURL.XSD_STRING,[a.TypeURL.XSD_TOKEN]:a.TypeURL.XSD_NORMALIZED_STRING,[a.TypeURL.XSD_LANGUAGE]:a.TypeURL.XSD_TOKEN,[a.TypeURL.XSD_NM_TOKEN]:a.TypeURL.XSD_TOKEN,[a.TypeURL.XSD_NAME]:a.TypeURL.XSD_TOKEN,[a.TypeURL.XSD_NC_NAME]:a.TypeURL.XSD_NAME,[a.TypeURL.XSD_ENTITY]:a.TypeURL.XSD_NC_NAME,[a.TypeURL.XSD_ID]:a.TypeURL.XSD_NC_NAME,[a.TypeURL.XSD_ID_REF]:a.TypeURL.XSD_NC_NAME,[a.TypeURL.XSD_UNTYPED_ATOMIC]:a.TypeURL.XSD_STRING,[a.TypeURL.XSD_DOUBLE]:a.TypeAlias.SPARQL_NUMERIC,[a.TypeURL.XSD_FLOAT]:a.TypeAlias.SPARQL_NUMERIC,[a.TypeURL.XSD_DECIMAL]:a.TypeAlias.SPARQL_NUMERIC,[a.TypeURL.XSD_INTEGER]:a.TypeURL.XSD_DECIMAL,[a.TypeURL.XSD_NON_POSITIVE_INTEGER]:a.TypeURL.XSD_INTEGER,[a.TypeURL.XSD_NEGATIVE_INTEGER]:a.TypeURL.XSD_NON_POSITIVE_INTEGER,[a.TypeURL.XSD_LONG]:a.TypeURL.XSD_INTEGER,[a.TypeURL.XSD_INT]:a.TypeURL.XSD_LONG,[a.TypeURL.XSD_SHORT]:a.TypeURL.XSD_INT,[a.TypeURL.XSD_BYTE]:a.TypeURL.XSD_SHORT,[a.TypeURL.XSD_NON_NEGATIVE_INTEGER]:a.TypeURL.XSD_INTEGER,[a.TypeURL.XSD_POSITIVE_INTEGER]:a.TypeURL.XSD_NON_NEGATIVE_INTEGER,[a.TypeURL.XSD_UNSIGNED_LONG]:a.TypeURL.XSD_NON_NEGATIVE_INTEGER,[a.TypeURL.XSD_UNSIGNED_INT]:a.TypeURL.XSD_UNSIGNED_LONG,[a.TypeURL.XSD_UNSIGNED_SHORT]:a.TypeURL.XSD_UNSIGNED_INT,[a.TypeURL.XSD_UNSIGNED_BYTE]:a.TypeURL.XSD_UNSIGNED_SHORT,[a.TypeURL.XSD_DATE_TIME]:"term",[a.TypeURL.XSD_BOOLEAN]:"term",[a.TypeURL.XSD_DATE]:"term",[a.TypeURL.XSD_G_MONTH]:"term",[a.TypeURL.XSD_G_MONTHDAY]:"term",[a.TypeURL.XSD_G_YEAR]:"term",[a.TypeURL.XSD_G_YEAR_MONTH]:"term",[a.TypeURL.XSD_TIME]:"term",[a.TypeURL.XSD_G_DAY]:"term",[a.TypeURL.XSD_DURATION]:"term",[a.TypeAlias.SPARQL_NUMERIC]:"term",[a.TypeAlias.SPARQL_STRINGLY]:"term",[a.TypeURL.XSD_ANY_URI]:"term"},t.superTypeDictTable=Object.create(null),s(),t.typeAliasCheck=Object.create(null),function(){for(const e of Object.values(a.TypeAlias))t.typeAliasCheck[e]=!0}(),t.typePromotion={[a.TypeURL.XSD_STRING]:[{typeToPromote:a.TypeURL.XSD_ANY_URI,conversionFunction:e=>(0,i.string)(e.str())}],[a.TypeURL.XSD_DOUBLE]:[{typeToPromote:a.TypeURL.XSD_FLOAT,conversionFunction:e=>(0,i.double)(e.typedValue)},{typeToPromote:a.TypeURL.XSD_DECIMAL,conversionFunction:e=>(0,i.double)(e.typedValue)}],[a.TypeURL.XSD_FLOAT]:[{typeToPromote:a.TypeURL.XSD_DECIMAL,conversionFunction:e=>(0,i.float)(e.typedValue)}]}},44675:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChunkedIterator=void 0;const n=r(76664);class i extends n.TransformIterator{blockSize;chunk=[];constructor(e,t,r){super(e,r),this.blockSize=t}consumeChunkAsIterator(){const e=new n.ArrayIterator(this.chunk,{autoStart:!1});return this.chunk=[],e}_transform(e,t,r){this.chunk.push(e),this.chunk.length>=this.blockSize&&r(this.consumeChunkAsIterator()),t()}_flush(e){this.chunk.length>0&&this._push(this.consumeChunkAsIterator()),super._flush(e)}}t.ChunkedIterator=i},83858:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClosableIterator=void 0;const n=r(76664);class i extends n.AsyncIterator{_source;onClose;constructor(e,t){super(),this.onClose=t.onClose,this._source=e,this._source[n.DESTINATION]=this,this._source.on("end",s),this._source.on("error",o),this._source.on("readable",a),this.readable=this._source.readable}read(){const e=this._source.read();return e||(this.readable=!1,this._source.done&&this.close()),e}_end(e){this.onClose(),this._source.removeListener("end",s),this._source.removeListener("error",o),this._source.removeListener("readable",a),delete this._source[n.DESTINATION],this._source.destroy(),super._end(e)}}function a(){this[n.DESTINATION].readable=!0}function o(e){this[n.DESTINATION].emit("error",e)}function s(){this[n.DESTINATION].close()}t.ClosableIterator=i},45436:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClosableTransformIterator=void 0;const n=r(76664);class i extends n.TransformIterator{onClose;constructor(e,t){super(e,t),this.onClose=t.onClose}_end(e){this.onClose(),super._end(e)}}t.ClosableTransformIterator=i},34569:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(44675),t),i(r(83858),t),i(r(45436),t),i(r(23322),t)},23322:(e,t)=>{"use strict";function r(e,t,n){if(!("_profileInstrumented"in e)){if(e._profileInstrumented=!0,"_read"in e){const r=e._read;e._read=(n,i)=>{const a=performance.now();r.call(e,n,(()=>{t.timeSelf+=performance.now()-a,i()}))}}const i=e.read;if(e.read=()=>{const r=performance.now(),a=i.call(e);return n&&a&&t.count++,t.timeSelf+=performance.now()-r,a},n){const r=performance.now();e.on("end",(()=>{t.timeLife=performance.now()-r}))}"_source"in e&&r(e._source,t,!1)}}Object.defineProperty(t,"__esModule",{value:!0}),t.instrumentIterator=function(e){const t={count:0,timeSelf:0,timeLife:0};return r(e,t,!0),new Promise((r=>{e.on("end",(()=>{r(t)}))}))}},29349:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MetadataValidationState=void 0,t.MetadataValidationState=class{invalidateListeners=[];valid=!0;addInvalidateListener(e){this.invalidateListeners.push(e)}invalidate(){if(this.valid){this.valid=!1;for(const e of this.invalidateListeners)e()}}}},62143:(e,t)=>{"use strict";function r(e){for(const t of["cardinality"])if(!(t in e))throw new Error(`Invalid metadata: missing ${t} in ${JSON.stringify(e)}`);return e}function n(e){for(const t of["cardinality","variables"])if(!(t in e))throw new Error(`Invalid metadata: missing ${t} in ${JSON.stringify(e)}`);return e}function i(e){let t;return()=>(t||(t=e(),t.then((e=>e.state.addInvalidateListener((()=>{t=void 0})))).catch((()=>{}))),t)}Object.defineProperty(t,"__esModule",{value:!0}),t.getMetadataQuads=function(e){return i((()=>new Promise(((t,r)=>{e.getProperty("metadata",(e=>t(e))),e.on("error",r)})).then((e=>r(e)))))},t.getMetadataBindings=function(e){return i((()=>new Promise(((t,r)=>{e.getProperty("metadata",(e=>t(e))),e.on("error",r)})).then((e=>n(e)))))},t.validateMetadataQuads=r,t.validateMetadataBindings=n,t.cachifyMetadata=i},49102:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(29349),t),i(r(62143),t)},28542:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.estimateCardinality=o,t.estimateMinusCardinality=s,t.estimateSliceCardinality=c,t.estimateUnionCardinality=u,t.estimateJoinCardinality=l,t.estimateNpsCardinality=d;const n=r(34005),i=new(r(18050).DataFactory),a=new n.AlgebraFactory(i);async function o(e,t){const r=await t.getCardinality(e);if(r)return r;switch(e.type){case n.Algebra.Types.ASK:return{type:"exact",value:1,dataset:t.uri};case n.Algebra.Types.LOAD:case n.Algebra.Types.DELETE_INSERT:case n.Algebra.Types.ADD:case n.Algebra.Types.COMPOSITE_UPDATE:case n.Algebra.Types.CLEAR:case n.Algebra.Types.NOP:case n.Algebra.Types.DROP:case n.Algebra.Types.CREATE:case n.Algebra.Types.MOVE:case n.Algebra.Types.COPY:return{type:"exact",value:0,dataset:t.uri};case n.Algebra.Types.PROJECT:case n.Algebra.Types.FILTER:case n.Algebra.Types.ORDER_BY:case n.Algebra.Types.GROUP:case n.Algebra.Types.CONSTRUCT:case n.Algebra.Types.DISTINCT:case n.Algebra.Types.REDUCED:case n.Algebra.Types.EXTEND:case n.Algebra.Types.FROM:case n.Algebra.Types.GRAPH:return o(e.input,t);case n.Algebra.Types.ZERO_OR_ONE_PATH:case n.Algebra.Types.ZERO_OR_MORE_PATH:case n.Algebra.Types.ONE_OR_MORE_PATH:case n.Algebra.Types.INV:return o(e.path,t);case n.Algebra.Types.PATH:return o(e.predicate,t);case n.Algebra.Types.NPS:return d(e,t);case n.Algebra.Types.LINK:return o(a.createPattern(i.variable("s"),e.iri,i.variable("o")),t);case n.Algebra.Types.UNION:case n.Algebra.Types.SEQ:case n.Algebra.Types.ALT:return u(e.input,t);case n.Algebra.Types.BGP:return l(e.patterns,t);case n.Algebra.Types.JOIN:case n.Algebra.Types.LEFT_JOIN:return l(e.input,t);case n.Algebra.Types.SLICE:return c(e,t);case n.Algebra.Types.MINUS:return s(e,t);case n.Algebra.Types.VALUES:return{type:"exact",value:e.bindings.length,dataset:t.uri};case n.Algebra.Types.SERVICE:case n.Algebra.Types.DESCRIBE:case n.Algebra.Types.EXPRESSION:case n.Algebra.Types.PATTERN:return{type:"estimate",value:Number.POSITIVE_INFINITY,dataset:t.uri}}return{type:"estimate",value:Number.POSITIVE_INFINITY,dataset:t.uri}}async function s(e,t){const r=await o(e.input[0],t),n=await o(e.input[1],t);return{type:"estimate",value:Math.max(r.value-n.value,0),dataset:t.uri}}async function c(e,t){const r=await o(e.input,t);return r.value>0&&(r.value=Math.max(r.value-e.start,0),void 0!==e.length&&(r.value=Math.min(r.value,e.length))),r}async function u(e,t){const r={type:"exact",value:0,dataset:t.uri};for(const n of e){const e=await o(n,t);"estimate"===e.type&&"exact"===r.type&&(r.type=e.type),r.value+=e.value}return r}async function l(e,t){const r=[];for(const t of e){const e=n.algebraUtils.inScopeVariables(t).map((e=>e.value)),i=r.find((t=>e.some((e=>t.vars.has(e)))));if(i){i.ops.push(t);for(const t of e)i.vars.add(t)}else r.push({ops:[t],vars:new Set(e)})}return{type:"estimate",value:(await Promise.all(r.map((async e=>Math.min(...await Promise.all(e.ops.map((async e=>(await o(e,t)).value)))))))).reduce(((e,t)=>e*t),1),dataset:t.uri}}async function d(e,t){const r=a.createSeq([...e.iris].reverse().map((e=>a.createLink(e)))),n=await o(r,t),s=a.createPattern(i.variable("s"),i.variable("p"),i.variable("o")),c=await o(s,t);return{type:"estimate",value:Math.max(0,c.value-n.value),dataset:t.uri}}},20030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getExpressionVariables=function e(t){if((0,n.isKnownSubType)(t,n.Algebra.ExpressionTypes.EXISTENCE))return n.algebraUtils.inScopeVariables(t.input);if((0,n.isKnownSubType)(t,n.Algebra.ExpressionTypes.NAMED))return[];if((0,n.isKnownSubType)(t,n.Algebra.ExpressionTypes.OPERATOR))return(0,i.uniqTerms)(t.args.flatMap((t=>e(t))));if((0,n.isKnownSubType)(t,n.Algebra.ExpressionTypes.TERM))return"Variable"===t.term.termType?[t.term]:[];throw new Error(`Getting expression variables is not supported for ${t.subType}`)};const n=r(34005),i=r(13252)},72478:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.doesShapeAcceptOperation=o,t.passFullOperationToSource=async function(e,t,r){if(1===t.length){const i=t[0],s=r.get(n.KeysRdfUpdateQuads.destination);if(!s||i.source.referenceValue===(0,a.getDataDestinationValue)(s))try{if(o(await i.source.getSelectorShape(r),e))return!0}catch{}}return!1};const n=r(72407),i=r(34005),a=r(62968);function o(e,t,r){return s(e,e,t,new Map,r)}function s(e,t,r,n,a){if("conjunction"===t.type)return t.children.every((t=>s(e,t,r,n,a)));if("disjunction"===t.type)return t.children.some((t=>s(e,t,r,n,a)));if("negation"===t.type){const e=new Map;return!s(t.child,t.child,r,e,a)}if("arity"===t.type)return s(e,t.child,r,n,a);if((a?.joinBindings&&!t.joinBindings)??(a?.filterBindings&&!t.filterBindings))return!1;const d=t.operation;switch(d.operationType){case"type":return!(!(d.type!==i.Algebra.Types.EXPRESSION||!l(r)||"extensionFunctions"in d&&d.extensionFunctions?.includes(r.name.value))||!c(e,t.children,r,n,a)&&!u(e,r,n,a)||d.type!==r.type);case"pattern":return!(!c(e,t.children,r,n,a)&&!u(e,r,n,a))&&d.pattern.type===r.type;case"wildcard":{if(a?.wildcardAcceptAllExtensionFunctions)return!0;if(l(r))return!1;let t=!1;return i.algebraUtils.visitOperation(r,{[i.Algebra.Types.EXPRESSION]:{visitor:r=>!(l(r)&&!o(e,r,a)&&(t=!0,1))}}),!t}}}function c(e,t,r,n,i){if(l(r)||l(r.expression))return!1;if(t){const a=r,o=a.input?Array.isArray(a.input)?a.input:[a.input]:a.patterns??[];for(const[r,a]of t.entries())if(!o[r]||!s(e,a,o[r],n,i))return!1;return!0}return!1}function u(e,t,r,n){const i=r.get(t);if(void 0!==i)return i;const a=function(e,t,r,n){const i=t;if(i.input&&!(Array.isArray(i.input)?i.input:[i.input]).every((t=>s(e,e,t,r,n))))return!1;if(i.expression&&l(i.expression)&&!s(e,e,i.expression,r,n))return!1;return!(i.patterns&&!i.patterns.every((t=>s(e,e,t,r,n))))}(e,t,r,n);return r.set(t,a),a}function l(e){return e&&e.type===i.Algebra.Types.EXPRESSION&&(0,i.isKnownSubType)(e,i.Algebra.ExpressionTypes.NAMED)&&(t=e.name.value,!/^https?:\/\/www\.w3\.org\//u.test(t));var t}},88542:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.materializeTerm=o,t.materializeOperation=function e(t,r,a,c,u={}){return u={strictTargetVariables:u.strictTargetVariables??!1,bindFilter:u.bindFilter??!0,originalBindings:u.originalBindings??r},n.algebraUtils.mapOperation(t,{[n.Algebra.Types.PATH]:{preVisitor:()=>({continue:!1}),transform:e=>Object.assign(a.createPath(o(e.subject,r),e.predicate,o(e.object,r),o(e.graph,r)),{metadata:e.metadata})},[n.Algebra.Types.PATTERN]:{preVisitor:()=>({continue:!1}),transform:e=>Object.assign(a.createPattern(o(e.subject,r),o(e.predicate,r),o(e.object,r),o(e.graph,r)),{metadata:e.metadata})},[n.Algebra.Types.JOIN]:{preVisitor:()=>({continue:!1}),transform:t=>Object.assign(a.createJoin(t.input.map((t=>e(t,r,a,c,u))),t.input.every((e=>!e.metadata))),{metadata:t.metadata})},[n.Algebra.Types.EXTEND]:{transform:t=>{if(r.has(t.variable)){if(u.strictTargetVariables)throw new Error(`Tried to bind variable ${(0,i.termToString)(t.variable)} in a BIND operator.`);return e(t.input,r,a,c,u)}return t}},[n.Algebra.Types.GROUP]:{transform:e=>{if(u.strictTargetVariables){for(const t of e.variables)if(r.has(t))throw new Error(`Tried to bind variable ${(0,i.termToString)(t)} in a GROUP BY operator.`);return e}const t=e.variables.filter((e=>!r.has(e)));return a.createGroup(e.input,t,e.aggregates)}},[n.Algebra.Types.FILTER]:{preVisitor:()=>({continue:!1}),transform:t=>{const n=u.originalBindings;if(0===n.size)return t;if("existence"===t.expression.subType){const n=e(t.expression,r,a,c,u),i=e(t.input,r,a,c,u);return a.createFilter(i,n)}if("operator"!==t.expression.subType)return t;const i=s(a,n),o=e(t.expression,r,a,c,u);let l=e(t.input,r,a,c,u);return l=a.createJoin([...i,l]),a.createFilter(l,o)}},[n.Algebra.Types.PROJECT]:{preVisitor:()=>({continue:!1}),transform:t=>{const n=s(a,u.originalBindings,t.variables);let i=e(t.input,r,a,c,u);return n.length>0&&(i=a.createJoin([...n,i])),a.createProject(i,t.variables)}},[n.Algebra.Types.VALUES]:{preVisitor:()=>({continue:!u.strictTargetVariables}),transform:e=>{if(u.strictTargetVariables){for(const t of e.variables)if(r.has(t))throw new Error(`Tried to bind variable ${(0,i.termToString)(t)} in a VALUES operator.`);return e}const t=e.variables.filter((e=>!r.has(e))),n=e.bindings.map((e=>{const t={...e};let n=!0;return r.forEach(((e,r)=>{r.value in t&&(e.equals(t[r.value])||(n=!1),delete t[r.value])})),n?t:void 0})).filter(Boolean);return a.createValues(t,n)}},[n.Algebra.Types.EXPRESSION]:{preVisitor:e=>u.bindFilter?"term"===e.subType||"operator"===e.subType&&"bound"===e.operator&&1===e.args.length&&"term"===e.args[0].subType&&[...r.keys()].some((t=>e.args[0].term.equals(t)))?{continue:!1}:{continue:!0}:{continue:!1},transform:e=>{if(!u.bindFilter)return e;if("term"===e.subType)return a.createTermExpression(o(e.term,r));if("operator"===e.subType)return"bound"===e.operator&&1===e.args.length&&"term"===e.args[0].subType&&[...r.keys()].some((t=>e.args[0].term.equals(t)))?a.createTermExpression(a.dataFactory.literal("true",a.dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean"))):e;if("aggregate"===e.subType&&"variable"in e&&r.has(e.variable)){if(u.strictTargetVariables)throw new Error(`Tried to bind ${(0,i.termToString)(e.variable)} in a ${e.aggregator} aggregate.`);return e}return e}}})};const n=r(34005),i=r(22112),a=r(13252);function o(e,t){if("Variable"===e.termType){const r=t.get(e);if(r)return r}return"Quad"===e.termType&&(0,a.someTermsNested)(e,(e=>"Variable"===e.termType))?(0,a.mapTermsNested)(e,(e=>o(e,t))):e}function s(e,t,r){const n=[];for(const[i,a]of t)if(!r||r.some((e=>e.equals(i)))){const t={[i.value]:a};n.push(e.createValues([i],[t]))}return n}},62968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSafeBindings=function(e){return a(e,"bindings"),e},t.getSafeQuads=function(e){return a(e,"quads"),e},t.getSafeBoolean=function(e){return a(e,"boolean"),e},t.getSafeVoid=function(e){return a(e,"void"),e},t.validateQueryOutput=a,t.testReadOnly=function(e){return e.get(n.KeysQueryOperation.readOnly)?(0,i.failTest)("Attempted a write operation in read-only mode"):(0,i.passTestVoid)()},t.getOperationSource=function(e){return e.metadata?.scopedSource},t.assignOperationSource=function(e,t){return(e={...e}).metadata=e.metadata?{...e.metadata}:{},e.metadata.scopedSource=t,e},t.removeOperationSource=function(e){delete e.metadata?.scopedSource,e.metadata&&0===Object.keys(e.metadata).length&&delete e.metadata},t.isDataDestinationRawType=o,t.getDataDestinationType=function(e){return"string"==typeof e?"":"remove"in e?"rdfjsStore":e.type},t.getDataDestinationValue=s,t.getDataDestinationContext=function(e,t){return"string"==typeof e||"remove"in e||!e.context?t:t.merge(e.context)},t.getContextDestination=function(e){return e.get(n.KeysRdfUpdateQuads.destination)},t.getContextDestinationUrl=function(e){if(e){let t=s(e);if("string"==typeof t){const e=t.indexOf("#");return e>=0&&(t=t.slice(0,e)),t}}};const n=r(72407),i=r(97356);function a(e,t){if(e.type!==t)throw new Error(`Invalid query output type: Expected '${t}' but got '${e.type}'`)}function o(e){return"string"==typeof e||"remove"in e}function s(e){return o(e)?e:e.value}},98989:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(28542),t),i(r(20030),t),i(r(72478),t),i(r(62968),t),i(r(88542),t)},33624:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(84423),t),i(r(11827),t)},11827:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toAlgebra11Builder=void 0,t.toAlgebra=function(e,r={}){const i=(0,n.createAlgebraContext)(r);return t.toAlgebra11Builder.build().translateQuery(i,e,r.quads,r.blankToVariable)};const n=r(52327),i=r(74735);t.toAlgebra11Builder=i.IndirBuilder.create([n.translateAggregates,n.mapAggregate,n.translateBoundAggregate]).addMany(n.translateNamed,n.translateTerm,n.registerContextDefinitions,n.translateInlineData,n.translateDatasetClause,n.translateBlankNodesToVariables,n.findAllVariables,n.inScopeVariables,n.generateFreshVar,n.translatePath,n.translatePathPredicate,n.simplifyPath,n.translateExpression,n.translateGraphPattern,n.translateBgp,n.accumulateGroupGraphPattern,n.simplifiedJoin,n.translateTripleCollection,n.translateBasicGraphPattern,n.translateTripleNesting,n.recurseGraph,n.translateQuad,n.translateUpdate,n.translateSingleUpdate,n.translateInsertDelete,n.translateUpdateTriplesBlock,n.translateGraphRefSpecific,n.translateGraphRefDefSpec,n.translateGraphRef,n.translateUpdateGraphLoad,n.translateQuery)},84423:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toAst11Builder=void 0,t.toAst=function(e){const r=(0,n.createAstContext)();return t.toAst11Builder.build().algToSparql(r,e)};const n=r(52327),i=r(74735);t.toAst11Builder=i.IndirBuilder.create([n.resetContext,n.registerProjection]).addMany(n.translateAlgPureExpression,n.translateAlgExpressionOrWild,n.translateAlgExpressionOrOrdering,n.translateAlgAnyExpression,n.translateAlgAggregateExpression,n.translateAlgExistenceExpression,n.translateAlgNamedExpression,n.translateAlgPureOperatorExpression,n.translateAlgOperatorExpression,n.translateAlgWildcardExpression,n.translateAlgTerm,n.translateAlgExtend,n.translateAlgDatasetClauses,n.translateAlgOrderBy,n.translateAlgPattern,n.translateAlgReduced,n.translateAlgDistinct,n.translateAlgPathComponent,n.translateAlgAlt,n.translateAlgInv,n.translateAlgLink,n.translateAlgNps,n.translateAlgOneOrMorePath,n.translateAlgSeq,n.translateAlgZeroOrMorePath,n.translateAlgZeroOrOnePath).addMany(n.translateAlgPatternIntoGroup,n.translateAlgSinglePattern,n.translateAlgPatternNew,n.translateAlgBoundAggregate,n.translateAlgBgp,n.translateAlgPath,n.translateAlgFrom,n.translateAlgFilter,n.translateAlgGraph,n.translateAlgGroup,n.translateAlgJoin,n.translateAlgLeftJoin,n.translateAlgMinus,n.translateAlgService,n.operationAlgInputAsPatternList,n.translateAlgSlice,n.algWrapInPatternGroup,n.translateAlgUnion,n.translateAlgValues,n.removeAlgQuads,n.removeAlgQuadsRecursive,n.splitAlgBgpToGraphs,n.translateAlgConstruct,n.replaceAlgAggregatorVariables,n.translateAlgProject,n.registerAlgGroupBy,n.registerOrderBy,n.registerVariables,n.putExtensionsInGroup,n.filterReplace,n.objectContainsVariable,n.translateAlgUpdateOperation,n.toUpdate,n.translateAlgCompositeUpdate,n.translateAlgDeleteInsert,n.cleanupAlgUpdateOperationModify,n.translateAlgLoad,n.translateAlgGraphRef,n.translateAlgClear,n.translateAlgCreate,n.translateAlgDrop,n.translateAlgAdd,n.translateAlgMove,n.translateAlgCopy,n.convertAlgUpdatePatterns,n.algToSparql)},64423:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(93307),t),i(r(5615),t)},5615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toAlgebra12Builder=void 0,t.toAlgebra=function(e,r={}){const n=(0,i.createAlgebraContext)(r);return t.toAlgebra12Builder.build().translateQuery(n,e,r.quads,r.blankToVariable)};const n=r(33624),i=r(85240),a=r(74735);t.toAlgebra12Builder=a.IndirBuilder.create(n.toAlgebra11Builder).widenContext().patchRule(i.translateTerm12).patchRule(i.translateTripleCollection12).patchRule(i.translateTripleNesting12).patchRule(i.inScopeVariables).typePatch()},93307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toAst12Builder=void 0,t.toAst=function(e){const r=(0,i.createAstContext)();return t.toAst12Builder.build().algToSparql(r,e)};const n=r(33624),i=r(85240),a=r(74735);t.toAst12Builder=a.IndirBuilder.create(n.toAst11Builder).widenContext().patchRule(i.translateAlgTerm12).typePatch()},50371:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionTypes=t.Types=void 0,function(e){e.ASK="ask",e.BGP="bgp",e.CONSTRUCT="construct",e.DESCRIBE="describe",e.DISTINCT="distinct",e.EXPRESSION="expression",e.EXTEND="extend",e.FILTER="filter",e.FROM="from",e.GRAPH="graph",e.GROUP="group",e.JOIN="join",e.LEFT_JOIN="leftjoin",e.MINUS="minus",e.NOP="nop",e.ORDER_BY="orderby",e.PATTERN="pattern",e.PROJECT="project",e.REDUCED="reduced",e.SERVICE="service",e.SLICE="slice",e.UNION="union",e.VALUES="values",e.COMPOSITE_UPDATE="compositeupdate",e.DELETE_INSERT="deleteinsert",e.LOAD="load",e.CLEAR="clear",e.CREATE="create",e.DROP="drop",e.ADD="add",e.MOVE="move",e.COPY="copy",e.PATH="path",e.ALT="alt",e.INV="inv",e.LINK="link",e.ONE_OR_MORE_PATH="OneOrMorePath",e.SEQ="seq",e.NPS="nps",e.ZERO_OR_MORE_PATH="ZeroOrMorePath",e.ZERO_OR_ONE_PATH="ZeroOrOnePath"}(r||(t.Types=r={})),function(e){e.AGGREGATE="aggregate",e.EXISTENCE="existence",e.NAMED="named",e.OPERATOR="operator",e.TERM="term",e.WILDCARD="wildcard"}(n||(t.ExpressionTypes=n={}))},17085:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;o({result:n.createPath(this.replaceValue(e.subject,r,t,n),e.predicate,this.replaceValue(e.object,r,t,n),this.replaceValue(e.graph,r,t,n)),recurse:!0})},[c.Types.PATTERN]:{transform:e=>({result:n.createPattern(this.replaceValue(e.subject,r,t,n),this.replaceValue(e.predicate,r,t,n),this.replaceValue(e.object,r,t,n),this.replaceValue(e.graph,r,t,n)),recurse:!0})},[c.Types.CONSTRUCT]:{transform:e=>({result:n.createConstruct(e.input,e.template),recurse:!0})}})}replaceValue(e,t,r,n){if("Quad"===e.termType)return n.createPattern(this.replaceValue(e.subject,t,r,n),this.replaceValue(e.predicate,t,r,n),this.replaceValue(e.object,t,r,n),this.replaceValue(e.graph,t,r,n));if("BlankNode"!==e.termType&&("Variable"!==e.termType||!r))return e;const i=new s.DataFactory,a="Variable"===e.termType?i.variable.bind(i):i.blankNode.bind(i);let o=t[e.value];return o||(o=this.genValue(),t[e.value]=o),a(o)}}},52327:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)},s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;o({astFactory:r,algebraFactory:n,dataFactory:i},c,u)=>{const l=[],d={},p=r.isQuerySelect(c)||r.isQueryDescribe(c)?c.variables.map((r=>e(t.mapAggregate,r,d))):void 0,h=c.solutionModifiers.having?c.solutionModifiers.having.having.map((r=>e(t.mapAggregate,r,d))):void 0,f=c.solutionModifiers.order?c.solutionModifiers.order.orderDefs.map((r=>e(t.mapAggregate,r,d))):void 0;if(c.solutionModifiers.group??Object.keys(d).length>0){const s=Object.keys(d).map((r=>e(t.translateBoundAggregate,d[r],i.variable(r)))),l=[];if(c.solutionModifiers.group)for(const t of c.solutionModifiers.group.groupings)if(r.isTerm(t))l.push(e(a.translateTerm,t));else{let r,i;"variable"in t?(r=e(a.translateTerm,t.variable),i=t.value):(r=e(a.generateFreshVar),i=t),u=n.createExtend(u,r,e(o.translateExpression,i)),l.push(r)}u=n.createGroup(u,l,s)}if(h)for(const t of h)u=n.createFilter(u,e(o.translateExpression,t));c.values&&(u=n.createJoin([u,e(a.translateInlineData,c.values)]));let y=[];if(p)if(p.some((e=>r.isWildcard(e))))y=[...e(a.inScopeVariables,c).values()].map((e=>i.variable(e))).sort(((e,t)=>e.value.localeCompare(t.value)));else for(const t of p)r.isTerm(t)?y.push(e(a.translateTerm,t)):(y.push(e(a.translateTerm,t.variable)),l.push(t));for(const t of l)u=n.createExtend(u,e(a.translateTerm,t.variable),e(o.translateExpression,t.expression));if(f&&(u=n.createOrderBy(u,f.map((t=>{let r=e(o.translateExpression,t.expression);return t.descending&&(r=n.createOperatorExpression("desc",[r])),r})))),r.isQuerySelect(c)&&(u=n.createProject(u,y)),c.distinct&&(u=n.createDistinct(u)),c.reduced&&(u=n.createReduced(u)),r.isQueryConstruct(c)){const t=[];e(s.translateBasicGraphPattern,c.template.triples,t),u=n.createConstruct(u,t.map((t=>e(s.translateQuad,t))))}else r.isQueryAsk(c)?u=n.createAsk(u):r.isQueryDescribe(c)&&(u=n.createDescribe(u,y));const m=c.solutionModifiers.limitOffset;if((m?.limit??m?.offset)&&(u=n.createSlice(u,m.offset??0,m.limit)),c.datasets.clauses.length>0){const t=e(a.translateDatasetClause,c.datasets);u=n.createFrom(u,t.default,t.named)}return u}},t.mapAggregate={name:"mapAggregate",fun:({SUBRULE:e})=>({astFactory:r},n,o)=>{if(r.isExpressionAggregate(n)){const t=r.forcedAutoGenTree(n);let s;for(const[e,n]of Object.entries(o))if((0,i.default)(n,t)){s=r.termVariable(e,r.sourceLocation());break}if(void 0!==s)return s;const c=e(a.generateFreshVar);return o[c.value]=t,r.termVariable(c.value,r.sourceLocation())}return r.isExpressionPure(n)&&!r.isExpressionPatternOperation(n)?{...n,args:n.args.map((r=>e(t.mapAggregate,r,o)))}:"expression"in n&&n.expression?{...n,expression:e(t.mapAggregate,n.expression,o)}:n}},t.translateBoundAggregate={name:"translateBoundAggregate",fun:({SUBRULE:e})=>(t,r,n)=>({...e(o.translateExpression,r),variable:n})}},30148:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;o({astFactory:e,currentPrefixes:t,currentBase:r,dataFactory:n},i)=>{let a=i.value;if(e.isTermNamedPrefixed(i)){const e=t[i.prefix];if(!e)throw new Error(`Unknown prefix: ${i.prefix}`);a=e+i.value}return n.namedNode(u.resolveIRI(a,r))}},t.translateTerm={name:"translateTerm",fun:({SUBRULE:e})=>({astFactory:r,dataFactory:n},i)=>{if(r.isTermNamed(i))return e(t.translateNamed,i);if(r.isTermBlank(i))return n.blankNode(i.label);if(r.isTermVariable(i))return n.variable(i.value);if(r.isTermLiteral(i)){const r="object"==typeof i.langOrIri?e(t.translateNamed,i.langOrIri):i.langOrIri;return n.literal(i.value,r)}throw new Error(`Unexpected term: ${JSON.stringify(i)}`)}},t.registerContextDefinitions={name:"registerContextDefinitions",fun:({SUBRULE:e})=>(r,n)=>{const{astFactory:i,currentPrefixes:a}=r;for(const o of n)i.isContextDefinitionPrefix(o)&&(a[o.key]=e(t.translateTerm,o.value).value),i.isContextDefinitionBase(o)&&(r.currentBase=e(t.translateTerm,o.value).value)}},t.translateInlineData={name:"translateInlineData",fun:({SUBRULE:e})=>({algebraFactory:r},n)=>{const i=n.variables.map((r=>e(t.translateTerm,r))),a=n.values.map((r=>{const n={};for(const[i,a]of Object.entries(r))void 0!==a&&(n[i]=e(t.translateTerm,a));return n}));return r.createValues(i,a)}},t.translateDatasetClause={name:"translateDatasetClause",fun:({SUBRULE:e})=>(r,n)=>({default:n.clauses.filter((e=>"default"===e.clauseType)).map((r=>e(t.translateNamed,r.value))),named:n.clauses.filter((e=>"named"===e.clauseType)).map((r=>e(t.translateNamed,r.value)))})},t.translateBlankNodesToVariables={name:"translateBlankNodesToVariables",fun:({SUBRULE:e})=>({algebraFactory:r,variables:n},i)=>{const a={},o=new Set(n);function s(e){if("BlankNode"===e.termType){let t=a[e.value];return t||(t=function(e){let t=0,i=e;for(;n.has(i);)i=`${e}${t++}`;return r.dataFactory.variable(i)}(e.value),o.add(t.value),a[e.value]=t),t}return"Quad"===e.termType?r.dataFactory.quad(s(e.subject),s(e.predicate),s(e.object),s(e.graph)):e}return u.mapOperation(i,{[c.Types.PATH]:{preVisitor:()=>({continue:!1}),transform:e=>r.createPath(s(e.subject),e.predicate,s(e.object),s(e.graph))},[c.Types.PATTERN]:{preVisitor:()=>({continue:!1}),transform:e=>r.createPattern(s(e.subject),s(e.predicate),s(e.object),s(e.graph))},[c.Types.CONSTRUCT]:{preVisitor:()=>({continue:!1}),transform:n=>r.createConstruct(e(t.translateBlankNodesToVariables,n.input),n.template)},[c.Types.DELETE_INSERT]:{preVisitor:()=>({continue:!1}),transform:n=>r.createDeleteInsert(n.delete,n.insert,n.where&&e(t.translateBlankNodesToVariables,n.where))}})}},t.findAllVariables={name:"findAllVariables",fun:()=>({transformer:e,variables:t},r)=>{e.visitNodeSpecific(r,{},{term:{variable:{visitor:e=>{t.add(e.value)}}}})}},t.inScopeVariables={name:"inScopeVariables",fun:()=>(e,t)=>{const r=new Set;return(0,s.findPatternBoundedVars)(t,r),r}},t.generateFreshVar={name:"generateFreshVar",fun:()=>e=>{let t="var"+e.varCount++;for(;e.variables.has(t);)t="var"+e.varCount++;return e.variables.add(t),e.dataFactory.variable(t)}}},66123:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(73080),t),i(r(30148),t),i(r(58543),t),i(r(31204),t),i(r(93016),t),i(r(83400),t),i(r(71517),t),i(r(55393),t)},31204:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifyPath=t.translatePathPredicate=t.translatePath=void 0;const n=r(50371),i=r(30148),a=r(58543);t.translatePath={name:"translatePath",fun:({SUBRULE:e})=>(r,n)=>{const i=n.subject,a=e(t.translatePathPredicate,n.predicate),o=n.object;return e(t.simplifyPath,i,a,o)}},t.translatePathPredicate={name:"translatePathPredicate",fun:({SUBRULE:e})=>({astFactory:r,algebraFactory:n},o)=>{if(r.isTerm(o))return e(t.translatePathPredicate,e(a.translateNamed,o));if((0,i.isTerm)(o))return n.createLink(o);if("^"===o.subType)return n.createInv(e(t.translatePathPredicate,o.items[0]));if("!"===o.subType){const t=[],i=[],s=o.items[0];let c;c=r.isPathPure(s)&&"|"===s.subType?s.items:[s];for(const e of c)if(r.isTerm(e))t.push(e);else{if("^"!==e.subType)throw new Error(`Unexpected item: ${JSON.stringify(e)}`);i.push(e.items[0])}const u=n.createNps(t.map((t=>e(a.translateNamed,t)))),l=n.createInv(n.createNps(i.map((t=>e(a.translateNamed,t)))));return 0===i.length?u:0===t.length?l:n.createAlt([u,l])}if("/"===o.subType)return n.createSeq(o.items.map((r=>e(t.translatePathPredicate,r))));if("|"===o.subType)return n.createAlt(o.items.map((r=>e(t.translatePathPredicate,r))));if("*"===o.subType)return n.createZeroOrMorePath(e(t.translatePathPredicate,o.items[0]));if("+"===o.subType)return n.createOneOrMorePath(e(t.translatePathPredicate,o.items[0]));if("?"===o.subType)return n.createZeroOrOnePath(e(t.translatePathPredicate,o.items[0]));throw new Error(`Unable to translate path expression ${JSON.stringify(o)}`)}},t.simplifyPath={name:"simplifyPath",fun:({SUBRULE:e})=>({algebraFactory:r},i,o,s)=>{if(o.type===n.Types.LINK)return[r.createPattern(i,o.iri,s)];if(o.type===n.Types.INV)return e(t.simplifyPath,s,o.path,i);if(o.type===n.Types.SEQ){let r=i;const n=[];for(const i of o.input.slice(0,-1)){const o=e(a.generateFreshVar);n.push(...e(t.simplifyPath,r,i,o)),r=o}return n.push(...e(t.simplifyPath,r,o.input.at(-1),s)),n}return[r.createPath(i,o,s)]}}},93016:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedJoin=t.accumulateGroupGraphPattern=t.translateBgp=t.translateGraphPattern=t.translateExpression=void 0;const n=r(30148),i=r(58543),a=r(31204),o=r(83400),s=r(71517);t.translateExpression={name:"translateExpression",fun:({SUBRULE:e})=>({astFactory:r,algebraFactory:n},a)=>{if(r.isTerm(a))return n.createTermExpression(e(i.translateTerm,a));if(r.isWildcard(a))return n.createWildcardExpression();if(r.isExpressionAggregate(a))return n.createAggregateExpression(a.aggregation,e(t.translateExpression,a.expression[0]),a.distinct,r.isExpressionAggregateSeparator(a)?a.separator:void 0);if(r.isExpressionFunctionCall(a))return n.createNamedExpression(e(i.translateNamed,a.function),a.args.map((r=>e(t.translateExpression,r))));if(r.isExpressionOperator(a))return n.createOperatorExpression(a.operator,a.args.map((r=>e(t.translateExpression,r))));if(r.isExpressionPatternOperation(a))return n.createExistenceExpression("notexists"===a.operator,e(t.translateGraphPattern,a.args));throw new Error(`Unknown expression: ${JSON.stringify(a)}`)}},t.translateGraphPattern={name:"translateGraphPattern",fun:({SUBRULE:e})=>({astFactory:r,algebraFactory:n,useQuads:a},c)=>{if(r.isPatternBgp(c))return e(t.translateBgp,c);if(r.isPatternUnion(c))return n.createUnion(c.patterns.map((r=>e(t.translateGraphPattern,r))));if(r.isPatternGraph(c)){const o=r.patternGroup(c.patterns,c.loc);let u=e(t.translateGraphPattern,o);return u=a?e(s.recurseGraph,u,e(i.translateTerm,c.name),void 0):n.createGraph(u,e(i.translateTerm,c.name)),u}if(r.isPatternValues(c))return e(i.translateInlineData,c);if(r.isQuerySelect(c))return e(o.translateQuery,c,a,!1);if(r.isPatternGroup(c)){const i=[],a=[];for(const e of c.patterns)r.isPatternFilter(e)?i.push(e):a.push(e);let o=n.createBgp([]);for(const r of a)o=e(t.accumulateGroupGraphPattern,o,r);const s=i.map((r=>e(t.translateExpression,r.expression)));if(s.length>0){let e=s[0];for(const t of s.slice(1))e=n.createOperatorExpression("&&",[e,t]);o=n.createFilter(o,e)}return o}throw new Error(`Unexpected pattern: ${c.subType}`)}},t.translateBgp={name:"translateBgp",fun:({SUBRULE:e})=>({astFactory:t,algebraFactory:r},i)=>{let o=[];const c=[],u=[];e(s.translateBasicGraphPattern,i.triples,u);for(const i of u)if(t.isPathPure(i.predicate)){const t=i,s=e(a.translatePath,t);for(const e of s)e.type===n.types.PATH?(o.length>0&&c.push(r.createBgp(o)),o=[],c.push(e)):o.push(e)}else o.push(e(s.translateQuad,i));return o.length>0&&c.push(r.createBgp(o)),1===c.length?c[0]:r.createJoin(c)}},t.accumulateGroupGraphPattern={name:"accumulateGroupGraphPattern",fun:({SUBRULE:e})=>({astFactory:r,algebraFactory:a},o,s)=>{if(r.isPatternOptional(s)){const i=e(t.translateGraphPattern,r.patternGroup(s.patterns,s.loc));return i.type===n.types.FILTER?a.createLeftJoin(o,i.input,i.expression):a.createLeftJoin(o,i)}if(r.isPatternMinus(s)){const n=e(t.translateGraphPattern,r.patternGroup(s.patterns,s.loc));return a.createMinus(o,n)}if(r.isPatternBind(s))return a.createExtend(o,e(i.translateTerm,s.variable),e(t.translateExpression,s.expression));if(r.isPatternService(s)){const n=r.patternGroup(s.patterns,s.loc),c=a.createService(e(t.translateGraphPattern,n),e(i.translateTerm,s.name),s.silent);return e(t.simplifiedJoin,o,c)}const c=e(t.translateGraphPattern,s);return e(t.simplifiedJoin,o,c)}},t.simplifiedJoin={name:"simplifiedJoin",fun:()=>({algebraFactory:e},t,r)=>(t.type===n.types.BGP&&r.type===n.types.BGP?t=e.createBgp([...t.patterns,...r.patterns]):t.type===n.types.BGP&&0===t.patterns.length?t=r:r.type===n.types.BGP&&0===r.patterns.length||(t=e.createJoin([t,r])),t)}},83400:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.translateQuery=void 0;const n=r(73080),i=r(58543),a=r(93016),o=r(55393);t.translateQuery={name:"translateQuery",fun:({SUBRULE:e})=>(t,r,s,c)=>{const u=t.astFactory;let l;if(t.variables=new Set,t.varCount=0,t.useQuads=s??!1,e(i.findAllVariables,r),u.isQuery(r)){e(i.registerContextDefinitions,r.context);const t=r.where??u.patternGroup([],u.gen());l=e(a.translateGraphPattern,t),l=e(n.translateAggregates,r,l)}else l=e(o.translateUpdate,r);return c&&(l=e(i.translateBlankNodesToVariables,l)),l}}},71517:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.translateQuad=t.recurseGraph=t.translateTripleNesting=t.translateBasicGraphPattern=t.translateTripleCollection=void 0;const n=r(30148),i=r(58543);t.translateTripleCollection={name:"translateTripleCollection",fun:({SUBRULE:e})=>(r,n,i)=>{e(t.translateBasicGraphPattern,n.triples,i)}},t.translateBasicGraphPattern={name:"translateBasicGraphPattern",fun:({SUBRULE:e})=>({astFactory:r},n,i)=>{for(const a of n)r.isTripleCollection(a)?e(t.translateTripleCollection,a,i):e(t.translateTripleNesting,a,i)}},t.translateTripleNesting={name:"translateTripleNesting",fun:({SUBRULE:e})=>({astFactory:r},n,a)=>{let o,s,c;r.isTripleCollection(n.subject)?(e(t.translateTripleCollection,n.subject,a),o=e(i.translateTerm,n.subject.identifier)):o=e(i.translateTerm,n.subject),s=r.isPathPure(n.predicate)?n.predicate:e(i.translateTerm,n.predicate),r.isTripleCollection(n.object)?(e(t.translateTripleCollection,n.object,a),c=e(i.translateTerm,n.object.identifier)):c=e(i.translateTerm,n.object),a.push({subject:o,predicate:s,object:c})}},t.recurseGraph={name:"recurseGraph",fun:({SUBRULE:e})=>(r,a,o,s)=>{if(a.type===n.types.GRAPH){if(s)throw new Error("Recursing through nested GRAPH statements with a replacement is impossible.");a=e(t.recurseGraph,a.input,a.name,void 0)}else if(a.type===n.types.SERVICE);else if(a.type===n.types.BGP)a.patterns=a.patterns.map((e=>(s&&(e.subject.equals(o)&&(e.subject=s),e.predicate.equals(o)&&(e.predicate=s),e.object.equals(o)&&(e.object=s)),"DefaultGraph"===e.graph.termType&&(e.graph=o),e)));else if(a.type===n.types.PATH)s&&(a.subject.equals(o)&&(a.subject=s),a.object.equals(o)&&(a.object=s)),"DefaultGraph"===a.graph.termType&&(a.graph=o);else if(a.type!==n.types.PROJECT||s)if(a.type!==n.types.EXTEND||s)if(a.type===n.types.MINUS&&"Variable"===o.termType)a.graphScopeVar=o,a.input=[e(t.recurseGraph,a.input[0],o,s),e(t.recurseGraph,a.input[1],o,s)];else for(const[r,i]of Object.entries(a)){const c=r;Array.isArray(i)?a[c]=i.map((r=>e(t.recurseGraph,r,o,s))):n.typeVals.includes(i.type)?a[c]=e(t.recurseGraph,i,o,s):s&&(0,n.isVariable)(i)&&i.equals(o)&&(a[c]=s)}else a.variable.equals(o)&&(s=e(i.generateFreshVar)),a.input=e(t.recurseGraph,a.input,o,s);else a.variables.some((e=>e.equals(o)))||(s=e(i.generateFreshVar)),a.input=e(t.recurseGraph,a.input,o,s);return a}},t.translateQuad={name:"translateQuad",fun:()=>({astFactory:e,algebraFactory:t},r)=>{if(e.isPathPure(r.predicate))throw new Error("Trying to translate property path to quad.");return t.createPattern(r.subject,r.predicate,r.object,r.graph)}}},55393:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.translateUpdateGraphLoad=t.translateGraphRef=t.translateGraphRefDefSpec=t.translateGraphRefSpecific=t.translateUpdateTriplesBlock=t.translateInsertDelete=t.translateSingleUpdate=t.translateUpdate=void 0;const n=r(58543),i=r(93016),a=r(71517);t.translateUpdate={name:"translateUpdate",fun:({SUBRULE:e})=>({algebraFactory:r},i)=>{const a=i.updates.flatMap((r=>(e(n.registerContextDefinitions,r.context),r.operation?[e(t.translateSingleUpdate,r.operation)]:[])));return 0===a.length?r.createNop():1===a.length?a[0]:r.createCompositeUpdate(a)}},t.translateSingleUpdate={name:"translateSingleUpdate",fun:({SUBRULE:e})=>({astFactory:r,algebraFactory:n},i)=>{if(r.isUpdateOperationLoad(i))return e(t.translateUpdateGraphLoad,i);if(r.isUpdateOperationClear(i))return n.createClear(e(t.translateGraphRef,i.destination),i.silent);if(r.isUpdateOperationCreate(i))return n.createCreate(e(t.translateGraphRef,i.destination),i.silent);if(r.isUpdateOperationDrop(i))return n.createDrop(e(t.translateGraphRef,i.destination),i.silent);if(r.isUpdateOperationAdd(i))return n.createAdd(e(t.translateGraphRefDefSpec,i.source),e(t.translateGraphRefDefSpec,i.destination),i.silent);if(r.isUpdateOperationCopy(i))return n.createCopy(e(t.translateGraphRefDefSpec,i.source),e(t.translateGraphRefDefSpec,i.destination),i.silent);if(r.isUpdateOperationMove(i))return n.createMove(e(t.translateGraphRefDefSpec,i.source),e(t.translateGraphRefDefSpec,i.destination),i.silent);if(r.isUpdateOperationInsertData(i)||r.isUpdateOperationDeleteData(i)||r.isUpdateOperationDeleteWhere(i)||r.isUpdateOperationModify(i))return e(t.translateInsertDelete,i);throw new Error(`Unknown update type ${JSON.stringify(i)}`)}},t.translateInsertDelete={name:"translateInsertDelete",fun:({SUBRULE:e})=>({useQuads:r,algebraFactory:o,astFactory:s},c)=>{if(!r)throw new Error("INSERT/DELETE operations are only supported with quads option enabled");const u=[],l=[];let d;if(s.isUpdateOperationDeleteData(c)||s.isUpdateOperationDeleteWhere(c))u.push(...c.data.flatMap((r=>e(t.translateUpdateTriplesBlock,r,void 0)))),s.isUpdateOperationDeleteWhere(c)&&(d=o.createBgp(u));else if(s.isUpdateOperationInsertData(c))l.push(...c.data.flatMap((r=>e(t.translateUpdateTriplesBlock,r,void 0))));else if(u.push(...c.delete.flatMap((r=>e(t.translateUpdateTriplesBlock,r,c.graph?e(n.translateNamed,c.graph):c.graph)))),l.push(...c.insert.flatMap((r=>e(t.translateUpdateTriplesBlock,r,c.graph?e(n.translateNamed,c.graph):c.graph)))),c.where.patterns.length>0){d=e(i.translateGraphPattern,c.where);const t=e(n.translateDatasetClause,c.from);t.default.length>0||t.named.length>0?d=o.createFrom(d,t.default,t.named):s.isUpdateOperationModify(c)&&c.graph&&(d=e(a.recurseGraph,d,e(n.translateNamed,c.graph),void 0))}return o.createDeleteInsert(u.length>0?u:void 0,l.length>0?l:void 0,d)}},t.translateUpdateTriplesBlock={name:"translateUpdateTriplesBlock",fun:({SUBRULE:e})=>(t,r,i)=>{const o=t.astFactory;let s,c=i;o.isGraphQuads(r)?(c=e(n.translateTerm,r.graph),s=r.triples):s=r;let u=[];return e(a.translateBasicGraphPattern,s.triples,u),c&&(u=u.map((e=>Object.assign(e,{graph:c})))),u.map((t=>e(a.translateQuad,t)))}},t.translateGraphRefSpecific={name:"translateGraphRefSpecific",fun:({SUBRULE:e})=>(t,r)=>e(n.translateNamed,r.graph)},t.translateGraphRefDefSpec={name:"translateGraphRefDefSpec",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.isGraphRefDefault(n)?"DEFAULT":e(t.translateGraphRefSpecific,n)},t.translateGraphRef={name:"translateGraphRef",fun:({SUBRULE:e})=>(r,n)=>{const i=r.astFactory;return i.isGraphRefAll(n)?"ALL":i.isGraphRefNamed(n)?"NAMED":e(t.translateGraphRefDefSpec,n)}},t.translateUpdateGraphLoad={name:"translateUpdateGraphLoad",fun:({SUBRULE:e})=>({algebraFactory:t},r)=>t.createLoad(e(n.translateNamed,r.source),r.destination?e(n.translateNamed,r.destination.graph):void 0,r.silent)}},42448:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;oe=>{e.project=!1,e.extend=[],e.group=[],e.aggregates=[],e.order=[]}},t.registerProjection={name:"registerProjection",fun:()=>(e,t)=>{t.type!==l.types.EXTEND&&t.type!==l.types.ORDER_BY&&t.type!==l.types.GRAPH&&(e.project=!1)}}},95385:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.translateAlgWildcardExpression=t.translateAlgOperatorExpression=t.translateAlgPureOperatorExpression=t.translateAlgNamedExpression=t.translateAlgExistenceExpression=t.translateAlgAggregateExpression=t.translateAlgAnyExpression=t.translateAlgExpressionOrOrdering=t.translateAlgExpressionOrWild=t.translateAlgPureExpression=void 0;const n=r(42448),i=r(33755),a=r(18513);t.translateAlgPureExpression={name:"translatePureExpression",fun:({SUBRULE:e})=>(r,a)=>{switch(a.subType){case n.eTypes.AGGREGATE:return e(t.translateAlgAggregateExpression,a);case n.eTypes.EXISTENCE:return e(t.translateAlgExistenceExpression,a);case n.eTypes.NAMED:return e(t.translateAlgNamedExpression,a);case n.eTypes.OPERATOR:return e(t.translateAlgPureOperatorExpression,a);case n.eTypes.TERM:return e(i.translateAlgTerm,a.term);default:throw new Error(`Unknown Expression Operation type ${a.subType}`)}}},t.translateAlgExpressionOrWild={name:"translateExpressionOrWild",fun:({SUBRULE:e})=>(r,i)=>i.subType===n.eTypes.WILDCARD?e(t.translateAlgWildcardExpression,i):e(t.translateAlgPureExpression,i)},t.translateAlgExpressionOrOrdering={name:"translateExpressionOrOrdering",fun:({SUBRULE:e})=>(r,i)=>i.subType===n.eTypes.OPERATOR?e(t.translateAlgOperatorExpression,i):e(t.translateAlgPureExpression,i)},t.translateAlgAnyExpression={name:"translateAnyExpression",fun:({SUBRULE:e})=>(r,i)=>i.subType===n.eTypes.OPERATOR?e(t.translateAlgOperatorExpression,i):e(t.translateAlgExpressionOrWild,i)},t.translateAlgAggregateExpression={name:"translateAggregateExpression",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.aggregate(n.aggregator,n.distinct,e(t.translateAlgExpressionOrWild,n.expression),n.separator,r.gen())},t.translateAlgExistenceExpression={name:"translateExistenceExpression",fun:({SUBRULE:e})=>({astFactory:t},r)=>t.expressionPatternOperation(r.not?"notexists":"exists",t.patternGroup([e(a.translateAlgPatternNew,r.input)].flat(),t.gen()),t.gen())},t.translateAlgNamedExpression={name:"translateNamedExpression",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.expressionFunctionCall(e(i.translateAlgTerm,n.name),n.args.map((r=>e(t.translateAlgPureExpression,r))),!1,r.gen())},t.translateAlgPureOperatorExpression={name:"translatePureOperatorExpression",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.expressionOperation(n.operator,n.args.map((r=>e(t.translateAlgPureExpression,r))),r.gen())},t.translateAlgOperatorExpression={name:"translateOperatorExpression",fun:({SUBRULE:e})=>({astFactory:r},n)=>"desc"===n.operator?{expression:e(t.translateAlgPureExpression,n.args[0]),descending:!0,loc:r.gen()}:e(t.translateAlgPureOperatorExpression,n)},t.translateAlgWildcardExpression={name:"translateWildcardExpression",fun:()=>({astFactory:e},t)=>e.wildcard(e.gen())}},33755:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.translateAlgDistinct=t.translateAlgReduced=t.translateAlgPattern=t.translateAlgOrderBy=t.translateAlgDatasetClauses=t.translateAlgExtend=t.translateAlgTerm=void 0;const n=r(52327),i=r(95385),a=r(18513);t.translateAlgTerm={name:"translateTerm",fun:({SUBRULE:e})=>({astFactory:r},n)=>{if("NamedNode"===n.termType)return r.termNamed(r.gen(),n.value);if("BlankNode"===n.termType)return r.termBlank(n.value,r.gen());if("Variable"===n.termType)return r.termVariable(n.value,r.gen());if("Literal"===n.termType)return r.termLiteral(r.gen(),n.value,n.language?n.language:e(t.translateAlgTerm,n.datatype));throw new Error(`invalid term type: ${n.termType}`)}},t.translateAlgExtend={name:"translateExtend",fun:({SUBRULE:e})=>({astFactory:r,project:o,extend:s},c)=>{if(o)return s.push(c),e(a.translateAlgPatternNew,c.input);const u=[],l=function e(t){return t.type===n.Algebra.Types.EXTEND?(u.push(t),e(t.input)):t}(c);return r.patternGroup([e(a.translateAlgPatternNew,l),...u.reverse().map((n=>r.patternBind(e(i.translateAlgPureExpression,n.expression),e(t.translateAlgTerm,n.variable),r.gen())))].flat(),r.gen())}},t.translateAlgDatasetClauses={name:"translateDatasetClauses",fun:({SUBRULE:e})=>({astFactory:r},n,i)=>r.datasetClauses([...n.map((r=>({clauseType:"default",value:e(t.translateAlgTerm,r)}))),...i.map((r=>({clauseType:"named",value:e(t.translateAlgTerm,r)})))],r.gen())},t.translateAlgOrderBy={name:"translateOrderBy",fun:({SUBRULE:e})=>({order:t},r)=>(t.push(...r.expressions),e(a.translateAlgPatternNew,r.input))},t.translateAlgPattern={name:"translatePattern",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.triple(e(t.translateAlgTerm,n.subject),e(t.translateAlgTerm,n.predicate),e(t.translateAlgTerm,n.object))},t.translateAlgReduced={name:"translateReduced",fun:({SUBRULE:e})=>(t,r)=>{const n=e(a.translateAlgPatternIntoGroup,r.input);return n.patterns[0].reduced=!0,n}},t.translateAlgDistinct={name:"translateDistinct",fun:({SUBRULE:e})=>(t,r)=>{const n=e(a.translateAlgPatternIntoGroup,r.input);return n.patterns[0].distinct=!0,n}}},82743:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(42448),t),i(r(95385),t),i(r(33755),t),i(r(32488),t),i(r(18513),t),i(r(87719),t),i(r(33473),t),i(r(75824),t),i(r(31012),t)},32488:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.translateAlgZeroOrOnePath=t.translateAlgZeroOrMorePath=t.translateAlgSeq=t.translateAlgOneOrMorePath=t.translateAlgNps=t.translateAlgLink=t.translateAlgInv=t.translateAlgAlt=t.translateAlgPathComponent=void 0;const n=r(30148),i=r(33755);t.translateAlgPathComponent={name:"translatePathComponent",fun:({SUBRULE:e})=>(r,i)=>{switch(i.type){case n.types.ALT:return e(t.translateAlgAlt,i);case n.types.INV:return e(t.translateAlgInv,i);case n.types.LINK:return e(t.translateAlgLink,i);case n.types.NPS:return e(t.translateAlgNps,i);case n.types.ONE_OR_MORE_PATH:return e(t.translateAlgOneOrMorePath,i);case n.types.SEQ:return e(t.translateAlgSeq,i);case n.types.ZERO_OR_MORE_PATH:return e(t.translateAlgZeroOrMorePath,i);case n.types.ZERO_OR_ONE_PATH:return e(t.translateAlgZeroOrOnePath,i);default:throw new Error(`Unknown Path type ${i.type}`)}}},t.translateAlgAlt={name:"translateAlt",fun:({SUBRULE:e})=>({astFactory:r},n)=>{const i=n.input.map((r=>e(t.translateAlgPathComponent,r)));return i.every((e=>r.isPathOfType(e,["!"])))?r.path("!",[r.path("|",i.flatMap((e=>e.items)),r.gen())],r.gen()):r.path("|",i,r.gen())}},t.translateAlgInv={name:"translateInv",fun:({SUBRULE:e})=>({astFactory:r},a)=>{if(a.path.type===n.types.NPS){const t=a.path.iris.map((t=>r.path("^",[e(i.translateAlgTerm,t)],r.gen())));return t.length<=1?r.path("!",t,r.gen()):r.path("!",[r.path("|",t,r.gen())],r.gen())}return r.path("^",[e(t.translateAlgPathComponent,a.path)],r.gen())}},t.translateAlgLink={name:"translateLink",fun:({SUBRULE:e})=>(t,r)=>e(i.translateAlgTerm,r.iri)},t.translateAlgNps={name:"translateNps",fun:({SUBRULE:e})=>({astFactory:t},r)=>1===r.iris.length?t.path("!",[e(i.translateAlgTerm,r.iris[0])],t.gen()):t.path("!",[t.path("|",r.iris.map((t=>e(i.translateAlgTerm,t))),t.gen())],t.gen())},t.translateAlgOneOrMorePath={name:"translateOneOrMorePath",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.path("+",[e(t.translateAlgPathComponent,n.path)],r.gen())},t.translateAlgSeq={name:"translateSeq",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.path("/",n.input.map((r=>e(t.translateAlgPathComponent,r))),r.gen())},t.translateAlgZeroOrMorePath={name:"translateZeroOrMorePath",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.path("*",[e(t.translateAlgPathComponent,n.path)],r.gen())},t.translateAlgZeroOrOnePath={name:"translateZeroOrOnePath",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.path("?",[e(t.translateAlgPathComponent,n.path)],r.gen())}},18513:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.translateAlgValues=t.translateAlgUnion=t.algWrapInPatternGroup=t.translateAlgSlice=t.operationAlgInputAsPatternList=t.translateAlgService=t.translateAlgMinus=t.translateAlgLeftJoin=t.translateAlgJoin=t.translateAlgGroup=t.translateAlgGraph=t.translateAlgFilter=t.translateAlgFrom=t.translateAlgPath=t.translateAlgBgp=t.translateAlgBoundAggregate=t.translateAlgPatternNew=t.translateAlgSinglePattern=t.translateAlgPatternIntoGroup=void 0;const n=r(66123),i=r(42448),a=r(95385),o=r(33755),s=r(32488),c=r(33473);t.translateAlgPatternIntoGroup={name:"translatePatternIntoGroup",fun:({SUBRULE:e})=>(r,i)=>{switch(i.type){case n.types.ASK:return e(c.translateAlgProject,i,n.types.ASK);case n.types.PROJECT:return e(c.translateAlgProject,i,n.types.PROJECT);case n.types.CONSTRUCT:return e(c.translateAlgConstruct,i);case n.types.DESCRIBE:return e(c.translateAlgProject,i,n.types.DESCRIBE);case n.types.DISTINCT:return e(o.translateAlgDistinct,i);case n.types.FROM:return e(t.translateAlgFrom,i);case n.types.FILTER:return e(t.translateAlgFilter,i);case n.types.REDUCED:return e(o.translateAlgReduced,i);case n.types.SLICE:return e(t.translateAlgSlice,i);default:throw new Error(`Unknown Operation type ${i.type}`)}}},t.translateAlgSinglePattern={name:"translateSinglePattern",fun:({SUBRULE:e})=>({astFactory:r},a)=>{switch(e(i.registerProjection,a),a.type){case n.types.PATH:return e(t.translateAlgPath,a);case n.types.BGP:return e(t.translateAlgBgp,a);case n.types.GRAPH:return e(t.translateAlgGraph,a);case n.types.SERVICE:return e(t.translateAlgService,a);case n.types.UNION:return e(t.translateAlgUnion,a);case n.types.VALUES:return e(t.translateAlgValues,a);case n.types.PATTERN:return r.patternBgp([e(o.translateAlgPattern,a)],r.gen());default:return e(t.translateAlgPatternIntoGroup,a)}}},t.translateAlgPatternNew={name:"translatePatternNew",fun:({SUBRULE:e})=>(r,a)=>{switch(e(i.registerProjection,a),a.type){case n.types.ORDER_BY:return e(o.translateAlgOrderBy,a);case n.types.GROUP:return e(t.translateAlgGroup,a);case n.types.EXTEND:return e(o.translateAlgExtend,a);case n.types.JOIN:return e(t.translateAlgJoin,a);case n.types.LEFT_JOIN:return e(t.translateAlgLeftJoin,a);case n.types.MINUS:return e(t.translateAlgMinus,a);default:return e(t.translateAlgSinglePattern,a)}}},t.translateAlgBoundAggregate={name:"translateBoundAggregate",fun:()=>(e,t)=>t},t.translateAlgBgp={name:"translateBgp",fun:({SUBRULE:e})=>({astFactory:t},r)=>{const n=r.patterns.map((t=>e(o.translateAlgPattern,t)));return t.patternBgp(n,t.gen())}},t.translateAlgPath={name:"translatePath",fun:({SUBRULE:e})=>({astFactory:t},r)=>t.patternBgp([t.triple(e(o.translateAlgTerm,r.subject),e(s.translateAlgPathComponent,r.predicate),e(o.translateAlgTerm,r.object))],t.gen())},t.translateAlgFrom={name:"translateFrom",fun:({SUBRULE:e})=>(r,n)=>{const i=e(t.translateAlgPatternIntoGroup,n.input);return i.patterns[0].datasets=e(o.translateAlgDatasetClauses,n.default,n.named),i}},t.translateAlgFilter={name:"translateFilter",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.patternGroup([e(t.translateAlgPatternNew,n.input),r.patternFilter(e(a.translateAlgPureExpression,n.expression),r.gen())].flat(),r.gen())},t.translateAlgGraph={name:"translateGraph",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.patternGraph(e(o.translateAlgTerm,n.name),[e(t.translateAlgPatternNew,n.input)].flat(),r.gen())},t.translateAlgGroup={name:"translateGroup",fun:({SUBRULE:e})=>({aggregates:r,group:n},i)=>{const a=e(t.translateAlgPatternNew,i.input),o=i.aggregates.map((r=>e(t.translateAlgBoundAggregate,r)));return r.push(...o),n.push(...i.variables),a}},t.translateAlgJoin={name:"translateJoin",fun:({SUBRULE:e})=>({astFactory:r},n)=>{const i=n.input.flatMap((r=>e(t.translateAlgPatternNew,r))),a=[];for(const e of i){const t=a.at(-1);r.isPatternBgp(e)&&0!==a.length&&r.isPatternBgp(t)?t.triples.push(...e.triples):a.push(e)}return a}},t.translateAlgLeftJoin={name:"translateLeftJoin",fun:({SUBRULE:e})=>({astFactory:r},n)=>{const i=r.patternOptional(e(t.operationAlgInputAsPatternList,n.input[1]),r.gen());return n.expression&&i.patterns.push(r.patternFilter(e(a.translateAlgPureExpression,n.expression),r.gen())),i.patterns=i.patterns.filter(Boolean),[e(t.translateAlgPatternNew,n.input[0]),i].flat()}},t.translateAlgMinus={name:"translateMinus",fun:({SUBRULE:e})=>({astFactory:r},n)=>[e(t.translateAlgPatternNew,n.input[0]),r.patternMinus(e(t.operationAlgInputAsPatternList,n.input[1]),r.gen())].flat()},t.translateAlgService={name:"translateService",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.patternService(e(o.translateAlgTerm,n.name),e(t.operationAlgInputAsPatternList,n.input),n.silent,r.gen())},t.operationAlgInputAsPatternList={name:"operationInputAsPatternList",fun:({SUBRULE:e})=>(r,n)=>{const i=e(t.translateAlgPatternNew,n);return Array.isArray(i)?i:[i]}},t.translateAlgSlice={name:"translateSlice",fun:({SUBRULE:e})=>({astFactory:r},n)=>{const i=e(t.translateAlgPatternIntoGroup,n.input),a=i.patterns[0];return 0!==n.start&&(a.solutionModifiers.limitOffset=a.solutionModifiers.limitOffset??r.solutionModifierLimitOffset(void 0,n.start,r.gen()),a.solutionModifiers.limitOffset.offset=n.start),void 0!==n.length&&(a.solutionModifiers.limitOffset=a.solutionModifiers.limitOffset??r.solutionModifierLimitOffset(n.length,void 0,r.gen()),a.solutionModifiers.limitOffset.limit=n.length),i}},t.algWrapInPatternGroup={name:"wrapInPatternGroup",fun:()=>({astFactory:e},t)=>Array.isArray(t)?e.patternGroup(t,e.gen()):e.isPatternGroup(t)?t:e.patternGroup([t],e.gen())},t.translateAlgUnion={name:"translateUnion",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.patternUnion(n.input.map((r=>e(t.algWrapInPatternGroup,e(t.translateAlgPatternNew,r)))),r.gen())},t.translateAlgValues={name:"translateValues",fun:({SUBRULE:e})=>({astFactory:t},r)=>t.patternValues(r.variables.map((e=>t.termVariable(e.value,t.gen()))),r.bindings.map((t=>{const n={};for(const i of r.variables){const r=i.value;t[r]?n[r]=e(o.translateAlgTerm,t[r]):n[r]=void 0}return n})),t.gen())}},87719:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitAlgBgpToGraphs=t.removeAlgQuadsRecursive=t.removeAlgQuads=void 0;const n=r(66123);t.removeAlgQuads={name:"removeQuads",fun:({SUBRULE:e})=>(r,n)=>e(t.removeAlgQuadsRecursive,n,[])},t.removeAlgQuadsRecursive={name:"removeQuadsRecursive",fun:({SUBRULE:e})=>({algebraFactory:r},i,a)=>{if(Array.isArray(i))return i.map((r=>e(t.removeAlgQuadsRecursive,r,a)));if("object"!=typeof i||null===i||!("type"in i)||!i.type)return i;const o=i;if(o.type===n.types.DELETE_INSERT)return i;if((o.type===n.types.PATTERN||o.type===n.types.PATH)&&o.graph){const e=o.graph;return a.push(e),""!==e.value?o.type===n.types.PATTERN?r.createPattern(o.subject,o.predicate,o.object):r.createPath(o.subject,o.predicate,o.object):o}const s={},c={},u={};for(const[r,n]of Object.entries(o)){const i=[];if(s[r]=e(t.removeAlgQuadsRecursive,n,i),i.length>0){c[r]=i;for(const e of i)u[e.value]=e}}const l=Object.keys(u);if(l.length>0)if(1!==l.length||[n.types.PROJECT,n.types.SERVICE].includes(o.type)){if(o.type===n.types.BGP)return e(t.splitAlgBgpToGraphs,o,c.patterns);for(const e of Object.keys(c)){const t=s[e];Array.isArray(t)?s[e]=t.map(((t,n)=>"DefaultGraph"===c[e][n].termType?t:r.createGraph(t,c[e][n]))):"DefaultGraph"!==c[e][0].termType&&(s[e]=r.createGraph(t,c[e][0]))}}else a.push(u[l[0]]);return s}},t.splitAlgBgpToGraphs={name:"splitBgpToGraphs",fun:()=>({algebraFactory:e},t,r)=>{const n={};for(const[e,i]of t.patterns.entries()){const t=r[e];n[t.value]=n[t.value]??{patterns:[],graph:t},n[t.value].patterns.push(i)}const i=[];for(const[t,{patterns:r,graph:a}]of Object.entries(n)){const n=e.createBgp(r);i.push(""===t?n:e.createGraph(n,a))}let a=i[0];for(const t of i.slice(1))a=e.createJoin([a,t]);return a}}},33473:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.objectContainsVariable=t.filterReplace=t.putExtensionsInGroup=t.registerVariables=t.registerOrderBy=t.registerAlgGroupBy=t.translateAlgProject=t.replaceAlgAggregatorVariables=t.translateAlgConstruct=void 0;const n=r(66123),i=r(42448),a=r(95385),o=r(33755),s=r(18513);t.translateAlgConstruct={name:"translateConstruct",fun:({SUBRULE:e})=>({astFactory:r,order:n},i)=>{const a=r.queryConstruct(r.gen(),[],r.patternBgp(i.template.map((t=>e(o.translateAlgPattern,t))),r.gen()),r.patternGroup([e(s.translateAlgPatternNew,i.input)].flat(),r.gen()),{},r.datasetClauses([],r.gen()));return e(t.registerOrderBy,a),n.length=0,r.patternGroup([a],r.gen())}},t.replaceAlgAggregatorVariables={name:"replaceAggregatorVariables",fun:({SUBRULE:e})=>({astFactory:r},n,i)=>{const a=void 0!==(s=n).termType&&"Quad"!==s.termType&&"wildcard"!==s.termType&&"Wildcard"!==s.termType?e(o.translateAlgTerm,n):n;var s;if(r.isTermVariable(a)){if(i[a.value])return i[a.value]}else if(Array.isArray(n))n=n.map((r=>e(t.replaceAlgAggregatorVariables,r,i)));else if("object"==typeof n){const r=n;for(const n of Object.keys(r))r[n]=e(t.replaceAlgAggregatorVariables,r[n],i)}return n}},t.translateAlgProject={name:"translateProject",fun:({SUBRULE:e})=>(r,c,u)=>{const l=r.astFactory,d={type:"query",solutionModifiers:{},loc:l.gen(),datasets:l.datasetClauses([],l.gen()),context:[]},p=d;let h;u===n.types.PROJECT?(d.subType="select",h=c.variables):u===n.types.ASK?d.subType="ask":(d.subType="describe",h=c.terms);const f=r.extend,y=r.group,m=r.aggregates,g=r.order;e(i.resetContext),r.project=!0;let b=[e(s.translateAlgPatternNew,c.input)].flat();1===b.length&&l.isPatternGroup(b[0])&&(b=b[0].patterns),d.where=l.patternGroup(b,l.gen());const v={};for(const t of r.aggregates)v[e(o.translateAlgTerm,t.variable).value]=e(a.translateAlgPureExpression,t);const _={};for(const n of r.extend.reverse()){const r=e(a.translateAlgPureExpression,n.expression);_[e(o.translateAlgTerm,n.variable).value]=e(t.replaceAlgAggregatorVariables,r,v)}e(t.registerAlgGroupBy,d,_),e(t.registerOrderBy,d),e(t.registerVariables,p,h,_),e(t.putExtensionsInGroup,d,_);const T=[];return d.where=e(t.filterReplace,d.where,v,T),T.length>0&&(p.solutionModifiers.having=l.solutionModifierHaving(T,l.gen())),r.extend=f,r.group=y,r.aggregates=m,r.order=g,l.patternGroup([p],l.gen())}},t.registerAlgGroupBy={name:"registerGroupBy",fun:({SUBRULE:e})=>({astFactory:t,group:r},n,i)=>{r.length>0&&(n.solutionModifiers.group=t.solutionModifierGroup(r.map((r=>{const n=e(o.translateAlgTerm,r);if(i[n.value]){const e=i[n.value];return delete i[n.value],{variable:n,value:e,loc:t.gen()}}return n})),t.gen()))}},t.registerOrderBy={name:"registerOrderBy",fun:({SUBRULE:e})=>({astFactory:t,order:r},n)=>{r.length>0&&(n.solutionModifiers.order=t.solutionModifierOrder(r.map((t=>e(a.translateAlgExpressionOrOrdering,t))).map((e=>t.isExpression(e)?{expression:e,descending:!1,loc:t.gen()}:e)),t.gen()))}},t.registerVariables={name:"registerVariables",fun:({SUBRULE:e})=>({astFactory:t},r,n,i)=>{n&&(r.variables=n.map((r=>{const n=e(o.translateAlgTerm,r);if(i[n.value]){const e=i[n.value];return delete i[n.value],t.patternBind(e,n,t.gen())}return n})),0===r.variables.length&&(r.variables=[t.wildcard(t.gen())]))}},t.putExtensionsInGroup={name:"putExtensionsInGroup",fun:()=>({astFactory:e},t,r)=>{const n=Object.entries(r);if(n.length>0){t.where=t.where??e.patternGroup([],e.gen());for(const[r,i]of n)t.where.patterns.push(e.patternBind(i,e.termVariable(r,e.gen()),e.gen()))}}},t.filterReplace={name:"filterReplace",fun:({SUBRULE:e})=>({astFactory:r},n,i,a)=>{if(!r.isPatternGroup(n))return n;const o=n.patterns.map((r=>e(t.filterReplace,r,i,a))).flatMap((n=>r.isPatternFilter(n)&&e(t.objectContainsVariable,n,Object.keys(i))?(a.push(e(t.replaceAlgAggregatorVariables,n.expression,i)),[]):[n]));return r.patternGroup(o,r.gen())}},t.objectContainsVariable={name:"objectContainsVariable",fun:({SUBRULE:e})=>({astFactory:r},n,i)=>{const a=n;return r.isTermVariable(a)?i.includes(a.value):Array.isArray(n)?n.some((r=>e(t.objectContainsVariable,r,i))):n===Object(n)&&Object.keys(n).some((r=>e(t.objectContainsVariable,n[r],i)))}}},75824:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.algToSparql=void 0;const n=r(30148),i=r(42448),a=r(18513),o=r(87719),s=r(31012);t.algToSparql={name:"algToSparql",fun:({SUBRULE:e})=>(t,r)=>{if(e(i.resetContext),(r=e(o.removeAlgQuads,r)).type===n.types.COMPOSITE_UPDATE)return e(s.translateAlgCompositeUpdate,r);if(r.type===n.types.NOP)return e(s.toUpdate,[]);try{return e(s.toUpdate,[e(s.translateAlgUpdateOperation,r)])}catch{}return e(a.translateAlgPatternIntoGroup,r).patterns[0]}}},31012:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertAlgUpdatePatterns=t.translateAlgCopy=t.translateAlgMove=t.translateAlgAdd=t.translateAlgDrop=t.translateAlgCreate=t.translateAlgClear=t.translateAlgGraphRef=t.translateAlgLoad=t.cleanupAlgUpdateOperationModify=t.translateAlgDeleteInsert=t.translateAlgCompositeUpdate=t.toUpdate=t.translateAlgUpdateOperation=void 0;const n=r(91032),i=r(50371),a=r(66123),o=r(33755),s=r(18513),c=r(87719);t.translateAlgUpdateOperation={name:"translateUpdateOperation",fun:({SUBRULE:e})=>(r,n)=>{switch(n.type){case i.Types.DELETE_INSERT:return e(t.translateAlgDeleteInsert,n);case i.Types.LOAD:return e(t.translateAlgLoad,n);case i.Types.CLEAR:return e(t.translateAlgClear,n);case i.Types.CREATE:return e(t.translateAlgCreate,n);case i.Types.DROP:return e(t.translateAlgDrop,n);case i.Types.ADD:return e(t.translateAlgAdd,n);case i.Types.MOVE:return e(t.translateAlgMove,n);case i.Types.COPY:return e(t.translateAlgCopy,n);default:throw new Error(`Unknown Operation type ${n.type}`)}}},t.toUpdate={name:"toUpdate",fun:()=>({astFactory:e},t)=>({type:"update",updates:t.map((e=>({context:[],operation:e}))),loc:e.gen()})},t.translateAlgCompositeUpdate={name:"translateCompositeUpdate",fun:({SUBRULE:e})=>(r,n)=>e(t.toUpdate,n.updates.map((r=>r.type===i.Types.NOP?void 0:e(t.translateAlgUpdateOperation,r))))},t.translateAlgDeleteInsert={name:"translateDeleteInsert",fun:({SUBRULE:e})=>({astFactory:r},n)=>{let i,u=n.where;if(u&&u.type===a.types.FROM){const t=u;u=t.input,i=e(o.translateAlgDatasetClauses,t.default,t.named)}const l={type:"updateOperation",subType:"modify",delete:e(t.convertAlgUpdatePatterns,n.delete??[]),insert:e(t.convertAlgUpdatePatterns,n.insert??[]),where:r.patternGroup([],r.gen()),from:i??r.datasetClauses([],r.gen()),loc:r.gen(),graph:void 0};if(u&&(u.type!==a.types.BGP||u.patterns.length>0)){const t=[],n=e(s.translateAlgPatternNew,e(c.removeAlgQuadsRecursive,u,t));l.where=e(s.algWrapInPatternGroup,n),1===t.length&&""!==t.at(0)?.value&&(l.where.patterns=[r.patternGraph(e(o.translateAlgTerm,t[0]),l.where.patterns,r.gen())])}return e(t.cleanupAlgUpdateOperationModify,l,n)}},t.cleanupAlgUpdateOperationModify={name:"cleanUpUpdateOperationModify",fun:()=>(e,t,r)=>{const i={...t};if(!r.delete&&!r.where){const e=i;return e.subType="insertdata",e.data=i.insert,delete e.delete,delete e.where,e}if(!r.insert&&!r.where){const e=i;return e.data=i.delete,delete e.insert,delete e.where,r.delete.some((e=>(0,a.isVariable)(e.subject)||(0,a.isVariable)(e.predicate)||(0,a.isVariable)(e.object)))?e.subType="deletewhere":e.subType="deletedata",e}if(!r.insert&&r.where&&"bgp"===r.where.type&&(0,n.isomorphic)(r.delete,r.where.patterns)){const e=i;return e.data=i.delete,delete e.where,delete e.delete,e.subType="deletewhere",e}return t}},t.translateAlgLoad={name:"translateLoad",fun:({SUBRULE:e})=>({astFactory:t},r)=>t.updateOperationLoad(t.gen(),e(o.translateAlgTerm,r.source),Boolean(r.silent),r.destination?t.graphRefSpecific(e(o.translateAlgTerm,r.destination),t.gen()):void 0)},t.translateAlgGraphRef={name:"translateGraphRef",fun:({SUBRULE:e})=>({astFactory:t},r)=>"DEFAULT"===r?t.graphRefDefault(t.gen()):"NAMED"===r?t.graphRefNamed(t.gen()):"ALL"===r?t.graphRefAll(t.gen()):t.graphRefSpecific(e(o.translateAlgTerm,r),t.gen())},t.translateAlgClear={name:"translateClear",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.updateOperationClear(e(t.translateAlgGraphRef,n.source),n.silent??!1,r.gen())},t.translateAlgCreate={name:"translateCreate",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.updateOperationCreate(e(t.translateAlgGraphRef,n.source),n.silent??!1,r.gen())},t.translateAlgDrop={name:"translateDrop",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.updateOperationDrop(e(t.translateAlgGraphRef,n.source),n.silent??!1,r.gen())},t.translateAlgAdd={name:"translateAdd",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.updateOperationAdd(e(t.translateAlgGraphRef,n.source),e(t.translateAlgGraphRef,n.destination),n.silent??!1,r.gen())},t.translateAlgMove={name:"translateMove",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.updateOperationMove(e(t.translateAlgGraphRef,n.source),e(t.translateAlgGraphRef,n.destination),n.silent??!1,r.gen())},t.translateAlgCopy={name:"translateCopy",fun:({SUBRULE:e})=>({astFactory:r},n)=>r.updateOperationCopy(e(t.translateAlgGraphRef,n.source),e(t.translateAlgGraphRef,n.destination),n.silent??!1,r.gen())},t.convertAlgUpdatePatterns={name:"convertUpdatePatterns",fun:({SUBRULE:e})=>({astFactory:t},r)=>{if(!r)return[];const n=Object.create(null);for(const e of r){const t=e.graph.value;n[t]||(n[t]=[]),n[t].push(e)}return Object.keys(n).map((r=>{const i=t.patternBgp(n[r].map((t=>e(o.translateAlgPattern,t))),t.gen());return""===r?i:t.graphQuads(e(o.translateAlgTerm,n[r][0].graph),i,t.gen())}))}}},16135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.visitOperationSub=t.visitOperation=t.mapOperationSub=t.mapOperation=void 0,t.resolveIRI=function(e,t){if(/^[a-z][\d+.a-z-]*:/iu.test(e))return e;if(!t)throw new Error(`Cannot resolve relative IRI ${e} because no base IRI was set.`);switch(e[0]){case void 0:return t;case"#":return t+e;case"?":return t.replace(/(?:\?.*)?$/u,e);case"/":return/^(?:[a-z]+:\/*)?[^/]*/u.exec(t)[0]+e;default:return t.replace(/[^/:]*$/u,"")+e}},t.objectify=function e(t){if(t.termType){if("Quad"===t.termType)return{type:"pattern",termType:"Quad",subject:e(t.subject),predicate:e(t.predicate),object:e(t.object),graph:e(t.graph)};const r={termType:t.termType,value:t.value};return t.language&&(r.language=t.language),t.datatype&&(r.datatype=e(t.datatype)),r}if(Array.isArray(t))return t.map((t=>e(t)));if(t===Object(t)){const r={};for(const n of Object.keys(t))r[n]=e(t[n]);return r}return t},t.inScopeVariables=function(e,r=t.visitOperation){const n={};function a(e){n[e.value]=e}function o(e){"Variable"===e.subject.termType?a(e.subject):"Quad"===e.subject.termType&&o(e.subject),"Variable"===e.predicate.termType?a(e.predicate):"Quad"===e.predicate.termType&&o(e.predicate),"Variable"===e.object.termType?a(e.object):"Quad"===e.object.termType&&o(e.object),"Variable"===e.graph.termType&&a(e.graph),"Quad"===e.graph.termType&&o(e.graph)}return function e(t){r(t,{[i.Types.EXPRESSION]:{visitor:e=>{e.subType===i.ExpressionTypes.AGGREGATE&&e.variable&&a(e.variable)}},[i.Types.EXTEND]:{visitor:e=>a(e.variable)},[i.Types.GRAPH]:{visitor:e=>{"Variable"===e.name.termType&&a(e.name)}},[i.Types.GROUP]:{visitor:e=>{for(const t of e.variables)a(t)}},[i.Types.PATH]:{visitor:e=>{"Variable"===e.subject.termType?a(e.subject):"Quad"===e.subject.termType&&o(e.subject),"Variable"===e.object.termType?a(e.object):"Quad"===e.object.termType&&o(e.object),"Variable"===e.graph.termType?a(e.graph):"Quad"===e.graph.termType&&o(e.graph)}},[i.Types.PATTERN]:{visitor:e=>o(e)},[i.Types.PROJECT]:{preVisitor:()=>({continue:!1}),visitor:e=>{for(const t of e.variables)a(t)}},[i.Types.SERVICE]:{visitor:e=>{"Variable"===e.name.termType&&a(e.name)}},[i.Types.VALUES]:{visitor:e=>{for(const t of e.variables)a(t)}},[i.Types.MINUS]:{preVisitor:()=>({continue:!1}),visitor:t=>{e(t.input[0])}}})}(e),Object.values(n)};const n=r(74735),i=r(50371),a=new n.TransformerSubTyped({},{[i.Types.PATTERN]:{ignoreKeys:new Set(["subject","predicate","object","graph"])},[i.Types.EXPRESSION]:{ignoreKeys:new Set(["name","term","wildcard","variable"])},[i.Types.DESCRIBE]:{ignoreKeys:new Set(["terms"])},[i.Types.EXTEND]:{ignoreKeys:new Set(["variable"])},[i.Types.FROM]:{ignoreKeys:new Set(["default","named"])},[i.Types.GRAPH]:{ignoreKeys:new Set(["name"])},[i.Types.GROUP]:{ignoreKeys:new Set(["variables"])},[i.Types.LINK]:{ignoreKeys:new Set(["iri"])},[i.Types.NPS]:{ignoreKeys:new Set(["iris"])},[i.Types.PATH]:{ignoreKeys:new Set(["subject","object","graph"])},[i.Types.PROJECT]:{ignoreKeys:new Set(["variables"])},[i.Types.SERVICE]:{ignoreKeys:new Set(["name"])},[i.Types.VALUES]:{ignoreKeys:new Set(["variables","bindings"])},[i.Types.LOAD]:{ignoreKeys:new Set(["source","destination"])},[i.Types.CLEAR]:{ignoreKeys:new Set(["source"])},[i.Types.CREATE]:{ignoreKeys:new Set(["source"])},[i.Types.DROP]:{ignoreKeys:new Set(["source"])},[i.Types.ADD]:{ignoreKeys:new Set(["source","destination"])},[i.Types.MOVE]:{ignoreKeys:new Set(["source","destination"])},[i.Types.COPY]:{ignoreKeys:new Set(["source","destination"])}});t.mapOperation=a.transformNode.bind(a),t.mapOperationSub=a.transformNodeSpecific.bind(a),t.visitOperation=a.visitNode.bind(a),t.visitOperationSub=a.visitNodeSpecific.bind(a)},85240:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inScopeVariables=t.translateTripleNesting12=t.translateTripleCollection12=t.translateTerm12=void 0;const n=r(52327),i=r(70104),a=r(22112),o="http://www.w3.org/1999/02/22-rdf-syntax-ns#reifies";t.translateTerm12={name:"translateTerm",fun:e=>(r,i)=>{if(r.astFactory.isTermTriple(i))return r.dataFactory.quad(e.SUBRULE(t.translateTerm12,i.subject),e.SUBRULE(t.translateTerm12,i.predicate),e.SUBRULE(t.translateTerm12,i.object));if(r.astFactory.isTermLiteral(i)){if(!i.langOrIri)return r.dataFactory.literal(i.value);if("object"==typeof i.langOrIri){const t=e.SUBRULE(n.translateNamed,i.langOrIri);return r.dataFactory.literal(i.value,t)}const[t,a]=i.langOrIri.split("--");return!a||""!==a&&"ltr"!==a&&"rtl"!==a?r.dataFactory.literal(i.value,i.langOrIri):r.dataFactory.literal(i.value,{language:t,direction:a})}return n.translateTerm.fun(e)(r,i)}},t.translateTripleCollection12={name:"translateTripleCollection",fun:e=>(r,i,a)=>{if(r.astFactory.isTripleCollectionReifiedTriple(i)){const{SUBRULE:n}=e,{dataFactory:s}=r,c=n(t.translateTerm12,i.identifier);n(t.translateTripleNesting12,i.triples[0],a);const{subject:u,predicate:l,object:d}=a.pop(),p=s.quad(u,l,d);a.push({subject:c,predicate:s.namedNode(o),object:p})}else n.translateTripleCollection.fun(e)(r,i,a)}},t.translateTripleNesting12={name:"translateTripleNesting",fun:e=>(r,i,s)=>{n.translateTripleNesting.fun(e)(r,i,s);const c=e.SUBRULE,{subject:u,predicate:l,object:d}=s.at(-1),{astFactory:p,dataFactory:h}=r;if(i.annotations&&i.annotations.length>0){const e=h.quad(u,l,d),r=new Set;for(const n of i.annotations){let i;const u=p.isTripleCollection(n);i=c(t.translateTerm12,u?n.identifier:n.val),r.has((0,a.termToString)(i))||s.push({subject:i,predicate:h.namedNode(o),object:e}),r.add((0,a.termToString)(i)),u&&c(t.translateTripleCollection12,n,s)}}}},t.inScopeVariables={name:"inScopeVariables",fun:()=>(e,t)=>{const r=new Set;return(0,i.findPatternBoundedVars)(t,r),r}}},40192:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.translateAlgTerm12=void 0;const n=r(52327);t.translateAlgTerm12={name:"translateTerm",fun:e=>(t,r)=>{const{SUBRULE:i}=e,{astFactory:a}=t;return"Quad"===r.termType?a.termTriple(i(n.translateAlgTerm,r.subject),i(n.translateAlgTerm,r.predicate),i(n.translateAlgTerm,r.object),a.gen()):"Literal"===r.termType&&r.direction?a.termLiteral(a.gen(),r.value,`${r.language}--${r.direction}`):n.translateAlgTerm.fun(e)(t,r)}}},90973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAlgebraContext=function(e){return{...(0,n.createAlgebraContext)(e),astFactory:new i.AstFactory}},t.createAstContext=function(){return{...(0,n.createAstContext)(),astFactory:new i.AstFactory}};const n=r(52327),i=r(70104)},66017:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.objectify=function e(t){if(t.termType){if("Quad"===t.termType)return{type:"pattern",termType:"Quad",subject:e(t.subject),predicate:e(t.predicate),object:e(t.object),graph:e(t.graph)};const r={termType:t.termType,value:t.value};return t.language&&(r.language=t.language),t.direction&&(r.direction=t.direction),t.datatype&&(r.datatype=e(t.datatype)),r}if(Array.isArray(t))return t.map((t=>e(t)));if(t===Object(t)){const r={};for(const n of Object.keys(t))r[n]=e(t[n]);return r}return t}},19287:(e,t,r)=>{"use strict";e=r.nmd(e);var n,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,c={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(c,{Alternation:()=>ji,Alternative:()=>Ai,CstParser:()=>Ms,EMPTY_ALT:()=>Ls,EOF:()=>no,EarlyExitException:()=>es,EmbeddedActionsParser:()=>Cs,GAstVisitor:()=>Mi,LLkLookaheadStrategy:()=>us,Lexer:()=>$a,LexerDefinitionErrorType:()=>Ua,MismatchedTokenException:()=>Jo,NoViableAltException:()=>Yo,NonTerminal:()=>Si,NotAllInputParsedException:()=>Zo,Option:()=>xi,Parser:()=>zs,ParserDefinitionErrorType:()=>Ps,Repetition:()=>Ri,RepetitionMandatory:()=>Ii,RepetitionMandatoryWithSeparator:()=>Pi,RepetitionWithSeparator:()=>Ni,Rule:()=>Ei,Terminal:()=>Li,VERSION:()=>h,clearCache:()=>Hs,createSyntaxDiagramsCode:()=>Qs,createToken:()=>ro,createTokenInstance:()=>io,defaultLexerErrorProvider:()=>qa,defaultParserErrorProvider:()=>oo,generateCstDts:()=>Gs,getLookaheadPaths:()=>So,isRecognitionException:()=>Xo,serializeGrammar:()=>Di,serializeProduction:()=>Fi,tokenLabel:()=>Ga,tokenMatcher:()=>ao,tokenName:()=>Qa}),e.exports=(n=c,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of o(t))s.call(e,r)||undefined===r||i(e,r,{get:()=>t[r],enumerable:!(n=a(t,r))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var u,l,d,p,h="11.2.0",f="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,y="object"==typeof self&&self&&self.Object===Object&&self,m=f||y||Function("return this")(),g=m.Symbol,b=Object.prototype,v=b.hasOwnProperty,_=b.toString,T=g?g.toStringTag:void 0,O=Object.prototype.toString,w=g?g.toStringTag:void 0,S=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":w&&w in Object(e)?function(e){var t=v.call(e,T),r=e[T];try{e[T]=void 0;var n=!0}catch(e){}var i=_.call(e);return n&&(t?e[T]=r:delete e[T]),i}(e):function(e){return O.call(e)}(e)},E=function(e){return null!=e&&"object"==typeof e},A=function(e){return"symbol"==typeof e||E(e)&&"[object Symbol]"==S(e)},x=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r0){if(++d>=800)return arguments[0]}else d=0;return l.apply(void 0,arguments)}),le=function(e,t){for(var r=-1,n=null==e?0:e.length;++r-1},ye=/^(?:0|[1-9]\d*)$/,me=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&ye.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},Ee=function(e){return null!=e&&Se(e.length)&&!G(e)},Ae=function(e,t,r){if(!F(r))return!1;var n=typeof t;return!!("number"==n?Ee(r)&&me(t,r.length):"string"==n&&t in r)&&be(r[t],e)},xe=Object.prototype,Ie=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||xe)},Pe=function(e){return E(e)&&"[object Arguments]"==S(e)},Re=Object.prototype,Ne=Re.hasOwnProperty,je=Re.propertyIsEnumerable,Le=Pe(function(){return arguments}())?Pe:function(e){return E(e)&&Ne.call(e,"callee")&&!je.call(e,"callee")},De=t&&!t.nodeType&&t,Fe=De&&e&&!e.nodeType&&e,Me=Fe&&Fe.exports===De?m.Buffer:void 0,Ce=(Me?Me.isBuffer:void 0)||function(){return!1},ke={};ke["[object Float32Array]"]=ke["[object Float64Array]"]=ke["[object Int8Array]"]=ke["[object Int16Array]"]=ke["[object Int32Array]"]=ke["[object Uint8Array]"]=ke["[object Uint8ClampedArray]"]=ke["[object Uint16Array]"]=ke["[object Uint32Array]"]=!0,ke["[object Arguments]"]=ke["[object Array]"]=ke["[object ArrayBuffer]"]=ke["[object Boolean]"]=ke["[object DataView]"]=ke["[object Date]"]=ke["[object Error]"]=ke["[object Function]"]=ke["[object Map]"]=ke["[object Number]"]=ke["[object Object]"]=ke["[object RegExp]"]=ke["[object Set]"]=ke["[object String]"]=ke["[object WeakMap]"]=!1;var Ue,Be=function(e){return function(t){return e(t)}},qe=t&&!t.nodeType&&t,Ve=qe&&e&&!e.nodeType&&e,$e=Ve&&Ve.exports===qe&&f.process,Ge=function(){try{return Ve&&Ve.require&&Ve.require("util").types||$e&&$e.binding&&$e.binding("util")}catch(e){}}(),Qe=Ge&&Ge.isTypedArray,He=Qe?Be(Qe):function(e){return E(e)&&Se(e.length)&&!!ke[S(e)]},ze=Object.prototype.hasOwnProperty,Ke=function(e,t){var r=I(e),n=!r&&Le(e),i=!r&&!n&&Ce(e),a=!r&&!n&&!i&&He(e),o=r||n||i||a,s=o?function(e,t){for(var r=-1,n=Array(e);++r1?t[n-1]:void 0,a=n>2?t[2]:void 0;for(i=Ue.length>3&&"function"==typeof i?(n--,i):void 0,a&&Ae(t[0],t[1],a)&&(i=n<3?void 0:i,n=1),e=Object(e);++r-1},yt.prototype.set=function(e,t){var r=this.__data__,n=ht(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};var mt=yt,gt=re(m,"Map"),bt=function(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map};function vt(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t0&&n(c)?r>1?e(c,r-1,n,i,a):Nt(a,c):i||(a[a.length]=c)}return a},Ft=function(e){return null!=e&&e.length?Dt(e,1):[]},Mt=Xe(Object.getPrototypeOf,Object),Ct=function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=i?t:Ct(t,r,n)).join(""):e.slice(1);return o.toUpperCase()+s},er=function(e,t,r,n){var i=-1,a=null==e?0:e.length;for(n&&a&&(r=e[++i]);++is))return!1;var u=a.get(e),l=a.get(t);if(u&&l)return u==t&&l==e;var d=-1,p=!0,h=2&r?new Zr:void 0;for(a.set(e,t),a.set(t,e);++d2?t[2]:void 0;for(i&&Ae(t[0],t[1],i)&&(n=1);++r=200&&(a=tn,o=!1,t=new Zr(t));e:for(;++i-1?n[i?e[a]:a]:void 0}),Gn=function(e){return e&&e.length?e[0]:void 0},Qn=function(e,t){var r=-1,n=Ee(e)?Array(e.length):[];return En(e,(function(e,i,a){n[++r]=t(e,i,a)})),n},Hn=function(e,t){return(I(e)?x:Qn)(e,On(t))},zn=function(e,t){return Dt(Hn(e,t),1)},Kn=Object.prototype.hasOwnProperty,Xn=(Jr=function(e,t,r){Kn.call(e,r)?e[r].push(t):ge(e,r,[t])},function(e,t){var r=I(e)?wn:An,n=Yr?Yr():{};return r(e,Jr,On(t),n)}),Wn=Object.prototype.hasOwnProperty,Jn=function(e,t){return null!=e&&Wn.call(e,t)},Yn=function(e,t){return null!=e&&vn(e,t,Jn)},Zn=function(e){return"string"==typeof e||!I(e)&&E(e)&&"[object String]"==S(e)},ei=function(e){return null==e?[]:function(e,t){return x(t,(function(t){return e[t]}))}(e,Ze(e))},ti=Math.max,ri=function(e,t,r,n){e=Ee(e)?e:ei(e),r=r&&!n?V(r):0;var i=e.length;return r<0&&(r=ti(i+r,0)),Zn(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&he(e,t,r)>-1},ni=Math.max,ii=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:V(r);return i<0&&(i=ni(n+i,0)),he(e,t,i)},ai=Object.prototype.hasOwnProperty,oi=function(e){if(null==e)return!0;if(Ee(e)&&(I(e)||"string"==typeof e||"function"==typeof e.splice||Ce(e)||He(e)||Le(e)))return!e.length;var t=Rr(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(Ie(e))return!Ye(e).length;for(var r in e)if(ai.call(e,r))return!1;return!0},si=Ge&&Ge.isRegExp,ci=si?Be(si):function(e){return E(e)&&"[object RegExp]"==S(e)},ui=function(e){return void 0===e},li=function(e,t,r,n){if(!F(e))return e;for(var i=-1,a=(t=It(t,e)).length,o=a-1,s=e;null!=s&&++i=200){var u=t?null:gi(e);if(u)return an(u);o=!1,i=tn,c=new Zr}else c=t?[]:s;e:for(;++n{t.accept(e)}))}},Si=class extends wi{constructor(e){super([]),this.idx=1,tt(this,di(e,(e=>void 0!==e)))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Ei=class extends wi{constructor(e){super(e.definition),this.orgText="",tt(this,di(e,(e=>void 0!==e)))}},Ai=class extends wi{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,tt(this,di(e,(e=>void 0!==e)))}},xi=class extends wi{constructor(e){super(e.definition),this.idx=1,tt(this,di(e,(e=>void 0!==e)))}},Ii=class extends wi{constructor(e){super(e.definition),this.idx=1,tt(this,di(e,(e=>void 0!==e)))}},Pi=class extends wi{constructor(e){super(e.definition),this.idx=1,tt(this,di(e,(e=>void 0!==e)))}},Ri=class extends wi{constructor(e){super(e.definition),this.idx=1,tt(this,di(e,(e=>void 0!==e)))}},Ni=class extends wi{constructor(e){super(e.definition),this.idx=1,tt(this,di(e,(e=>void 0!==e)))}},ji=class extends wi{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,tt(this,di(e,(e=>void 0!==e)))}},Li=class{constructor(e){this.idx=1,tt(this,di(e,(e=>void 0!==e)))}accept(e){e.visit(this)}};function Di(e){return Hn(e,Fi)}function Fi(e){function t(e){return Hn(e,Fi)}if(e instanceof Si){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return Zn(e.label)&&(t.label=e.label),t}if(e instanceof Ai)return{type:"Alternative",definition:t(e.definition)};if(e instanceof xi)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof Ii)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof Pi)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:Fi(new Li({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof Ni)return{type:"RepetitionWithSeparator",idx:e.idx,separator:Fi(new Li({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof Ri)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof ji)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof Li){const t={type:"Terminal",name:e.terminalType.name,label:(r=e.terminalType,Zn((n=r).LABEL)&&""!==n.LABEL?r.LABEL:r.name),idx:e.idx};Zn(e.label)&&(t.terminalLabel=e.label);const i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=ci(i)?i.source:i),t}var r,n;if(e instanceof Ei)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}var Mi=class{visit(e){const t=e;switch(t.constructor){case Si:return this.visitNonTerminal(t);case Ai:return this.visitAlternative(t);case xi:return this.visitOption(t);case Ii:return this.visitRepetitionMandatory(t);case Pi:return this.visitRepetitionMandatoryWithSeparator(t);case Ni:return this.visitRepetitionWithSeparator(t);case Ri:return this.visitRepetition(t);case ji:return this.visitAlternation(t);case Li:return this.visitTerminal(t);case Ei:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function Ci(e,t=[]){return!!(e instanceof xi||e instanceof Ri||e instanceof Ni)||(e instanceof ji?mi(e.definition,(e=>Ci(e,t))):!(e instanceof Si&&ri(t,e))&&e instanceof wi&&(e instanceof Si&&t.push(e),Un(e.definition,(e=>Ci(e,t)))))}function ki(e){if(e instanceof Si)return"SUBRULE";if(e instanceof xi)return"OPTION";if(e instanceof ji)return"OR";if(e instanceof Ii)return"AT_LEAST_ONE";if(e instanceof Pi)return"AT_LEAST_ONE_SEP";if(e instanceof Ni)return"MANY_SEP";if(e instanceof Ri)return"MANY";if(e instanceof Li)return"CONSUME";throw Error("non exhaustive match")}var Ui=class{walk(e,t=[]){Mn(e.definition,((r,n)=>{const i=Dn(e.definition,n+1);if(r instanceof Si)this.walkProdRef(r,i,t);else if(r instanceof Li)this.walkTerminal(r,i,t);else if(r instanceof Ai)this.walkFlat(r,i,t);else if(r instanceof xi)this.walkOption(r,i,t);else if(r instanceof Ii)this.walkAtLeastOne(r,i,t);else if(r instanceof Pi)this.walkAtLeastOneSep(r,i,t);else if(r instanceof Ni)this.walkManySep(r,i,t);else if(r instanceof Ri)this.walkMany(r,i,t);else{if(!(r instanceof ji))throw Error("non exhaustive match");this.walkOr(r,i,t)}}))}walkTerminal(e,t,r){}walkProdRef(e,t,r){}walkFlat(e,t,r){const n=t.concat(r);this.walk(e,n)}walkOption(e,t,r){const n=t.concat(r);this.walk(e,n)}walkAtLeastOne(e,t,r){const n=[new xi({definition:e.definition})].concat(t,r);this.walk(e,n)}walkAtLeastOneSep(e,t,r){const n=Bi(e,t,r);this.walk(e,n)}walkMany(e,t,r){const n=[new xi({definition:e.definition})].concat(t,r);this.walk(e,n)}walkManySep(e,t,r){const n=Bi(e,t,r);this.walk(e,n)}walkOr(e,t,r){const n=t.concat(r);Mn(e.definition,(e=>{const t=new Ai({definition:[e]});this.walk(t,n)}))}};function Bi(e,t,r){return[new xi({definition:[new Li({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}function qi(e){if(e instanceof Si)return qi(e.referencedRule);if(e instanceof Li)return[e.terminalType];if(function(e){return e instanceof Ai||e instanceof xi||e instanceof Ri||e instanceof Ii||e instanceof Pi||e instanceof Ni||e instanceof Li||e instanceof Ei}(e))return function(e){let t=[];const r=e.definition;let n,i=0,a=r.length>i,o=!0;for(;a&&o;)n=r[i],o=Ci(n),t=t.concat(qi(n)),i+=1,a=r.length>i;return bi(t)}(e);if(function(e){return e instanceof ji}(e))return function(e){const t=Hn(e.definition,(e=>qi(e)));return bi(Ft(t))}(e);throw Error("non exhaustive match")}var Vi="_~IN~_",$i=class extends Ui{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,r){}walkProdRef(e,t,r){const n=(i=e.referencedRule,a=e.idx,i.name+a+Vi+this.topProd.name);var i,a;const o=t.concat(r),s=qi(new Ai({definition:o}));this.follows[n]=s}};function Gi(e){return e.charCodeAt(0)}function Qi(e,t){Array.isArray(e)?e.forEach((function(e){t.push(e)})):t.push(e)}function Hi(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function zi(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function Ki(){throw Error("Internal Error - Should never get here!")}function Xi(e){return"Character"===e.type}var Wi=[];for(let e=Gi("0");e<=Gi("9");e++)Wi.push(e);var Ji=[Gi("_")].concat(Wi);for(let e=Gi("a");e<=Gi("z");e++)Ji.push(e);for(let e=Gi("A");e<=Gi("Z");e++)Ji.push(e);var Yi=[Gi(" "),Gi("\f"),Gi("\n"),Gi("\r"),Gi("\t"),Gi("\v"),Gi("\t"),Gi(" "),Gi(" "),Gi(" "),Gi(" "),Gi(" "),Gi(" "),Gi(" "),Gi(" "),Gi(" "),Gi(" "),Gi(" "),Gi(" "),Gi(" "),Gi("\u2028"),Gi("\u2029"),Gi(" "),Gi(" "),Gi(" "),Gi("\ufeff")],Zi=/[0-9a-fA-F]/,ea=/[0-9]/,ta=/[1-9]/,ra=class{visitChildren(e){for(const t in e){const r=e[t];e.hasOwnProperty(t)&&(void 0!==r.type?this.visit(r):Array.isArray(r)&&r.forEach((e=>{this.visit(e)}),this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},na={},ia=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const r={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Hi(r,"global");break;case"i":Hi(r,"ignoreCase");break;case"m":Hi(r,"multiLine");break;case"u":Hi(r,"unicode");break;case"y":Hi(r,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}}zi(t);const r=this.disjunction();return this.consumeChar(")"),{type:t,value:r,loc:this.loc(e)}}return Ki()}quantifier(e=!1){let t;const r=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const r=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:r,atMost:r};break;case",":let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:r,atMost:e}):t={atLeast:r,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;zi(t)}if(!0!==e||void 0!==t)return zi(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(r),t):void 0}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),zi(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):Ki()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Gi("\n"),Gi("\r"),Gi("\u2028"),Gi("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Wi;break;case"D":e=Wi,t=!0;break;case"s":e=Yi;break;case"S":e=Yi,t=!0;break;case"w":e=Ji;break;case"W":e=Ji,t=!0}return zi(e)?{type:"Set",value:e,complement:t}:Ki()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Gi("\f");break;case"n":e=Gi("\n");break;case"r":e=Gi("\r");break;case"t":e=Gi("\t");break;case"v":e=Gi("\v")}return zi(e)?{type:"Character",value:e}:Ki()}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:Gi("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:Gi(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:Gi(this.popChar())}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const t=this.classAtom();if(t.type,Xi(t)&&this.isRangeDash()){this.consumeChar("-");const r=this.classAtom();if(r.type,Xi(r)){if(r.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function aa(e){const t=e.toString();if(na.hasOwnProperty(t))return na[t];{const e=ia.pattern(t);return na[t]=e,e}}var oa="Complement Sets are not supported for first char optimization",sa='Unable to use "first char" lexer optimizations:\n';function ca(e,t=!1){try{const t=aa(e);return ua(t.value,{},t.flags.ignoreCase)}catch(r){if(r.message===oa)t&&_i(`${sa}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let r="";t&&(r="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),vi(`${sa}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function ua(e,t,r){switch(e.type){case"Disjunction":for(let n=0;n{if("number"==typeof e)la(e,t,r);else{const n=e;if(!0===r)for(let e=n.from;e<=n.to;e++)la(e,t,r);else{for(let e=n.from;e<=n.to&&e=xa){const e=n.from>=xa?n.from:xa,r=n.to,i=Pa(e),a=Pa(r);for(let e=i;e<=a;e++)t[e]=e}}}}));break;case"Group":ua(a.value,t,r);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==a.quantifier&&0===a.quantifier.atLeast;if("Group"===a.type&&!1===pa(a)||"Group"!==a.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return ei(t)}function la(e,t,r){const n=Pa(e);t[n]=n,!0===r&&function(e,t){const r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r){const e=Pa(n.charCodeAt(0));t[e]=e}else{const e=r.toLowerCase();if(e!==r){const r=Pa(e.charCodeAt(0));t[r]=r}}}(e,t)}function da(e,t){return $n(e.value,(e=>{if("number"==typeof e)return ri(t,e);{const r=e;return void 0!==$n(t,(e=>r.from<=e&&e<=r.to))}}))}function pa(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(I(e.value)?Un(e.value,pa):pa(e.value))}var ha=class extends ra{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e);case"Lookbehind":return void this.visitLookbehind(e);case"NegativeLookbehind":return void this.visitNegativeLookbehind(e)}super.visitChildren(e)}}visitCharacter(e){ri(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===da(e,this.targetCharCodes)&&(this.found=!0):void 0!==da(e,this.targetCharCodes)&&(this.found=!0)}};function fa(e,t){if(t instanceof RegExp){const r=aa(t),n=new ha(e);return n.visit(r),n.found}return void 0!==$n(t,(t=>ri(e,t.charCodeAt(0))))}var ya="PATTERN",ma="defaultMode",ga="modes";var ba=/[^\\][$]/,va=/[^\\[][\^]|^\^/;function _a(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function Ta(e){const t=e.PATTERN;if(ci(t))return!1;if(G(t))return!0;if(Yn(t,"exec"))return!0;if(Zn(t))return!1;throw Error("non exhaustive match")}function Oa(e){return!(!Zn(e)||1!==e.length)&&e.charCodeAt(0)}var wa={test:function(e){const t=e.length;for(let r=this.lastIndex;rZn(e)?e.charCodeAt(0):e))}function Aa(e,t,r){void 0===e[t]?e[t]=[r]:e[t].push(r)}var xa=256,Ia=[];function Pa(e){return ee.CATEGORIES))));const e=jn(r,t);t=t.concat(e),oi(e)?n=!1:r=e}return t}(e);!function(e){Mn(e,(e=>{Ma(e)||(La[ja]=e,e.tokenTypeIdx=ja++),Ca(e)&&!I(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Ca(e)||(e.CATEGORIES=[]),Yn(e,"categoryMatches")||(e.categoryMatches=[]),Yn(e,"categoryMatchesMap")||(e.categoryMatchesMap={})}))}(t),function(e){Mn(e,(e=>{Fa([],e)}))}(t),function(e){Mn(e,(e=>{e.categoryMatches=[],Mn(e.categoryMatchesMap,((t,r)=>{e.categoryMatches.push(La[r].tokenTypeIdx)}))}))}(t),Mn(t,(e=>{e.isParent=e.categoryMatches.length>0}))}function Fa(e,t){Mn(e,(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0})),Mn(t.CATEGORIES,(r=>{const n=e.concat(t);ri(n,r)||Fa(n,r)}))}function Ma(e){return Yn(e,"tokenTypeIdx")}function Ca(e){return Yn(e,"CATEGORIES")}function ka(e){return Yn(e,"tokenTypeIdx")}var Ua,Ba,qa={buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,r,n,i,a)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${r} characters.`};(Ba=Ua||(Ua={}))[Ba.MISSING_PATTERN=0]="MISSING_PATTERN",Ba[Ba.INVALID_PATTERN=1]="INVALID_PATTERN",Ba[Ba.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",Ba[Ba.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",Ba[Ba.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",Ba[Ba.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",Ba[Ba.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",Ba[Ba.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",Ba[Ba.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",Ba[Ba.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",Ba[Ba.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",Ba[Ba.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",Ba[Ba.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",Ba[Ba.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",Ba[Ba.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",Ba[Ba.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",Ba[Ba.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",Ba[Ba.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";var Va={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:qa,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Va);var $a=class{constructor(e,t=Va){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:n,value:i}=Ti(t),a=n>10?console.warn:console.log;return this.traceInitIndent time: ${n}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=tt({},Va,t);const r=this.config.traceInitPerf;!0===r?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof r&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(()=>{let r,n=!0;this.TRACE_INIT("Lexer Config handling",(()=>{if(this.config.lineTerminatorsPattern===Va.lineTerminatorsPattern)this.config.lineTerminatorsPattern=wa;else if(this.config.lineTerminatorCharacters===Va.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),I(e)?r={modes:{defaultMode:zr(e)},defaultMode:ma}:(n=!1,r=zr(e))})),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",(()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t,r){const n=[];return Yn(e,ma)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+ma+"> property in its definition\n",type:Ua.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Yn(e,ga)||n.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:Ua.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Yn(e,ga)&&Yn(e,ma)&&!Yn(e.modes,e.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${ma}: <${e.defaultMode}>which does not exist\n`,type:Ua.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Yn(e,ga)&&Mn(e.modes,((e,t)=>{Mn(e,((r,i)=>{if(ui(r))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${t}> at index: <${i}>\n`,type:Ua.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Yn(r,"LONGER_ALT")){const i=I(r.LONGER_ALT)?r.LONGER_ALT:[r.LONGER_ALT];Mn(i,(i=>{ui(i)||ri(e,i)||n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${r.name}> outside of mode <${t}>\n`,type:Ua.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})}))}}))})),n}(r,this.trackStartLines,this.config.lineTerminatorCharacters))})),this.TRACE_INIT("performWarningRuntimeChecks",(()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function(e,t,r){const n=[];let i=!1;const a=Kr(Ft(ei(e.modes))),o=fi(a,(e=>e[ya]===$a.NA)),s=Ea(r);return t&&Mn(o,(e=>{const t=Sa(e,s);if(!1!==t){const r=function(e,t){if(t.issue===Ua.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Ua.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:r,type:t.issue,tokenType:e};n.push(i)}else Yn(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):fa(s,e.PATTERN)&&(i=!0)})),t&&!i&&n.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Ua.NO_LINE_BREAKS_FLAGS}),n}(r,this.trackStartLines,this.config.lineTerminatorCharacters))}))),r.modes=r.modes?r.modes:{},Mn(r.modes,((e,t)=>{r.modes[t]=fi(e,(e=>ui(e)))}));const i=Ze(r.modes);if(Mn(r.modes,((e,r)=>{this.TRACE_INIT(`Mode: <${r}> processing`,(()=>{if(this.modes.push(r),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",(()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t){let r=[];const n=function(e){const t=qn(e,(e=>!Yn(e,ya)));return{errors:Hn(t,(e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:Ua.MISSING_PATTERN,tokenTypes:[e]}))),valid:jn(e,t)}}(e);r=r.concat(n.errors);const i=function(e){const t=qn(e,(e=>{const t=e[ya];return!(ci(t)||G(t)||Yn(t,"exec")||Zn(t))}));return{errors:Hn(t,(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Ua.INVALID_PATTERN,tokenTypes:[e]}))),valid:jn(e,t)}}(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(function(e){let t=[];const r=qn(e,(e=>ci(e[ya])));return t=t.concat(function(e){class t extends ra{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}const r=qn(e,(e=>{const r=e.PATTERN;try{const e=aa(r),n=new t;return n.visit(e),n.found}catch(e){return ba.test(r.source)}}));return Hn(r,(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Ua.EOI_ANCHOR_FOUND,tokenTypes:[e]})))}(r)),t=t.concat(function(e){class t extends ra{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}const r=qn(e,(e=>{const r=e.PATTERN;try{const e=aa(r),n=new t;return n.visit(e),n.found}catch(e){return va.test(r.source)}}));return Hn(r,(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Ua.SOI_ANCHOR_FOUND,tokenTypes:[e]})))}(r)),t=t.concat(function(e){const t=qn(e,(e=>{const t=e[ya];return t instanceof RegExp&&(t.multiline||t.global)}));return Hn(t,(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ua.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]})))}(r)),t=t.concat(function(e){const t=[];let r=Hn(e,(r=>hi(e,((e,n)=>(r.PATTERN.source!==n.PATTERN.source||ri(t,n)||n.PATTERN===$a.NA||(t.push(n),e.push(n)),e)),[])));r=Kr(r);const n=qn(r,(e=>e.length>1));return Hn(n,(e=>{const t=Hn(e,(e=>e.name));return{message:`The same RegExp pattern ->${Gn(e).PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:Ua.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}}))}(r)),t=t.concat(function(e){const t=qn(e,(e=>e.PATTERN.test("")));return Hn(t,(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:Ua.EMPTY_MATCH_PATTERN,tokenTypes:[e]})))}(r)),t}(a)),r=r.concat(function(e){const t=qn(e,(e=>{if(!Yn(e,"GROUP"))return!1;const t=e.GROUP;return t!==$a.SKIPPED&&t!==$a.NA&&!Zn(t)}));return Hn(t,(e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ua.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]})))}(a)),r=r.concat(function(e,t){const r=qn(e,(e=>void 0!==e.PUSH_MODE&&!ri(t,e.PUSH_MODE)));return Hn(r,(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:Ua.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]})))}(a,t)),r=r.concat(function(e){const t=[],r=hi(e,((e,t,r)=>{const n=t.PATTERN;return n===$a.NA||(Zn(n)?e.push({str:n,idx:r,tokenType:t}):ci(n)&&(i=n,void 0===$n([".","\\","[","]","|","^","$","(",")","?","*","+","{"],(e=>-1!==i.source.indexOf(e))))&&e.push({str:n.source,idx:r,tokenType:t})),e;var i}),[]);return Mn(e,((e,n)=>{Mn(r,(({str:r,idx:i,tokenType:a})=>{if(n${a.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:r,type:Ua.UNREACHABLE_PATTERN,tokenTypes:[e,a]})}}))})),t}(a)),r}(e,i))})),oi(this.lexerDefinitionErrors)){let n;Da(e),this.TRACE_INIT("analyzeTokenTypes",(()=>{n=function(e,t){const r=(t=Pn(t,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()})).tracer;let n;r("initCharCodeToOptimizedIndexMap",(()=>{!function(){if(oi(Ia)){Ia=new Array(65536);for(let e=0;e<65536;e++)Ia[e]=e>255?255+~~(e/255):e}}()})),r("Reject Lexer.NA",(()=>{n=fi(e,(e=>e[ya]===$a.NA))}));let i,a,o,s,c,u,l,d,p,h,f,y=!1;r("Transform Patterns",(()=>{y=!1,i=Hn(n,(e=>{const t=e[ya];if(ci(t)){const e=t.source;return 1!==e.length||"^"===e||"$"===e||"."===e||t.ignoreCase?2!==e.length||"\\"!==e[0]||ri(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],e[1])?_a(t):e[1]:e}if(G(t))return y=!0,{exec:t};if("object"==typeof t)return y=!0,t;if("string"==typeof t){if(1===t.length)return t;{const e=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return _a(new RegExp(e))}}throw Error("non exhaustive match")}))})),r("misc mapping",(()=>{a=Hn(n,(e=>e.tokenTypeIdx)),o=Hn(n,(e=>{const t=e.GROUP;if(t!==$a.SKIPPED){if(Zn(t))return t;if(ui(t))return!1;throw Error("non exhaustive match")}})),s=Hn(n,(e=>{const t=e.LONGER_ALT;if(t)return I(t)?Hn(t,(e=>ii(n,e))):[ii(n,t)]})),c=Hn(n,(e=>e.PUSH_MODE)),u=Hn(n,(e=>Yn(e,"POP_MODE")))})),r("Line Terminator Handling",(()=>{const e=Ea(t.lineTerminatorCharacters);l=Hn(n,(e=>!1)),"onlyOffset"!==t.positionTracking&&(l=Hn(n,(t=>Yn(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===Sa(t,e)&&fa(e,t.PATTERN))))})),r("Misc Mapping #2",(()=>{d=Hn(n,Ta),p=Hn(i,Oa),h=hi(n,((e,t)=>{const r=t.GROUP;return Zn(r)&&r!==$a.SKIPPED&&(e[r]=[]),e}),{}),f=Hn(i,((e,t)=>({pattern:i[t],longerAlt:s[t],canLineTerminator:l[t],isCustom:d[t],short:p[t],group:o[t],push:c[t],pop:u[t],tokenTypeIdx:a[t],tokenType:n[t]})))}));let m=!0,g=[];return t.safeMode||r("First Char Optimization",(()=>{g=hi(n,((e,r,n)=>{if("string"==typeof r.PATTERN){const t=Pa(r.PATTERN.charCodeAt(0));Aa(e,t,f[n])}else if(I(r.START_CHARS_HINT)){let t;Mn(r.START_CHARS_HINT,(r=>{const i=Pa("string"==typeof r?r.charCodeAt(0):r);t!==i&&(t=i,Aa(e,i,f[n]))}))}else if(ci(r.PATTERN))if(r.PATTERN.unicode)m=!1,t.ensureOptimizations&&vi(`${sa}\tUnable to analyze < ${r.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=ca(r.PATTERN,t.ensureOptimizations);oi(i)&&(m=!1),Mn(i,(t=>{Aa(e,t,f[n])}))}else t.ensureOptimizations&&vi(`${sa}\tTokenType: <${r.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),m=!1;return e}),[])})),{emptyGroups:h,patternIdxToConfig:f,charCodeToPatternIdxToConfig:g,hasCustom:y,canBeOptimized:m}}(e,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})})),this.patternIdxToConfig[r]=n.patternIdxToConfig,this.charCodeToPatternIdxToConfig[r]=n.charCodeToPatternIdxToConfig,this.emptyGroups=tt({},this.emptyGroups,n.emptyGroups),this.hasCustom=n.hasCustom||this.hasCustom,this.canModeBeOptimized[r]=n.canBeOptimized}}))})),this.defaultMode=r.defaultMode,!oi(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const e=Hn(this.lexerDefinitionErrors,(e=>e.message)).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}Mn(this.lexerDefinitionWarning,(e=>{_i(e.message)})),this.TRACE_INIT("Choosing sub-methods implementations",(()=>{if(n&&(this.handleModes=oe),!1===this.trackStartLines&&(this.computeNewColumn=$),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=oe),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)})),this.TRACE_INIT("Failed Optimization Warnings",(()=>{const e=hi(this.canModeBeOptimized,((e,t,r)=>(!1===t&&e.push(r),e)),[]);if(t.ensureOptimizations&&!oi(e))throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)})),this.TRACE_INIT("clearRegExpParserCache",(()=>{na={}})),this.TRACE_INIT("toFastProperties",(()=>{Oi(this)}))}))}tokenize(e,t=this.defaultMode){if(!oi(this.lexerDefinitionErrors)){const e=Hn(this.lexerDefinitionErrors,(e=>e.message)).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let r,n,i,a,o,s,c,u,l,d,p,h,f,y,m;const g=e,b=g.length;let v=0,_=0;const T=this.hasCustom?0:Math.floor(e.length/10),O=new Array(T),w=[];let S=this.trackStartLines?1:void 0,E=this.trackStartLines?1:void 0;const A=function(e){const t={},r=Ze(e);return Mn(r,(r=>{const n=e[r];if(!I(n))throw Error("non exhaustive match");t[r]=[]})),t}(this.emptyGroups),x=this.trackStartLines,P=this.config.lineTerminatorsPattern;let R=0,N=[],j=[];const L=[],D=[];Object.freeze(D);let F=!1;const M=e=>{if(1===L.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);w.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{L.pop();const e=Ln(L);N=this.patternIdxToConfig[e],j=this.charCodeToPatternIdxToConfig[e],R=N.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;F=!(!j||!t)}};function C(e){L.push(e),j=this.charCodeToPatternIdxToConfig[e],N=this.patternIdxToConfig[e],R=N.length,R=N.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;F=!(!j||!t)}let k;C.call(this,t);const U=this.config.recoveryEnabled;for(;vs.length){s=a,l=a.length,c=u,k=t;break}}}break}}if(-1!==l){if(d=k.group,void 0!==d&&(s=null!==s?s:e.substring(v,v+l),p=k.tokenTypeIdx,h=this.createTokenInstance(s,v,p,k.tokenType,S,E,l),this.handlePayload(h,c),!1===d?_=this.addToken(O,_,h):A[d].push(h)),!0===x&&!0===k.canLineTerminator){let t,r,n=0;P.lastIndex=0;do{s=null!==s?s:e.substring(v,v+l),t=P.test(s),!0===t&&(r=P.lastIndex-1,n++)}while(!0===t);0!==n?(S+=n,E=l-r,this.updateTokenEndLineColumnLocation(h,d,r,n,S,E,l)):E=this.computeNewColumn(E,l)}else E=this.computeNewColumn(E,l);v+=l,this.handleModes(k,M,C,h)}else{const t=v,r=S,i=E;let a=!1===U;for(;!1===a&&v`Expecting ${Ha(e)?`--\x3e ${Ga(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:r,customUserDescription:n,ruleName:i}){const a="Expecting: ",o="\nbut found: '"+Gn(t).image+"'";if(n)return a+n+o;{const t=hi(e,((e,t)=>e.concat(t)),[]),r=Hn(t,(e=>`[${Hn(e,(e=>Ga(e))).join(", ")}]`));return a+`one of these possible Token sequences:\n${Hn(r,((e,t)=>` ${t+1}. ${e}`)).join("\n")}`+o}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:r,ruleName:n}){const i="Expecting: ",a="\nbut found: '"+Gn(t).image+"'";return r?i+r+a:i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${Hn(e,(e=>`[${Hn(e,(e=>Ga(e))).join(",")}]`)).join(" ,")}>`+a}};Object.freeze(oo);var so,co,uo={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},lo={buildDuplicateFoundError(e,t){const r=e.name,n=Gn(t),i=n.idx,a=ki(n),o=(s=n)instanceof Li?s.terminalType.name:s instanceof Si?s.nonTerminalName:"";var s;let c=`->${a}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${r}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,"\n"),c},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=Hn(e.prefixPath,(e=>Ga(e))).join(", "),r=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=0===e.alternation.idx?"":e.alternation.idx,r=0===e.prefixPath.length;let n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n`;return n+=r?"These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n":`<${Hn(e.prefixPath,(e=>Ga(e))).join(", ")}> may appears as a prefix path in all these alternatives.\n`,n+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",n},buildEmptyRepetitionError(e){let t=ki(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${t} --\x3e ${Hn(e.leftRecursionPath,(e=>e.name)).concat([t]).join(" --\x3e ")}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof Ei?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}},po=class extends Mi{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Mn(ei(this.nameToTopRule),(e=>{this.currTopLevel=e,e.accept(this)}))}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:Ps.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},ho=class extends Ui{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=zr(this.path.ruleStack).reverse(),this.occurrenceStack=zr(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const n=t.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,n)}}updateExpectedNext(){oi(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},fo=class extends ho{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(r),n=new Ai({definition:e});this.possibleTokTypes=qi(n),this.found=!0}}},yo=class extends Ui{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},mo=class extends yo{walkMany(e,t,r){if(e.idx===this.occurrence){const e=Gn(t.concat(r));this.result.isEndOfRule=void 0===e,e instanceof Li&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,r)}},go=class extends yo{walkManySep(e,t,r){if(e.idx===this.occurrence){const e=Gn(t.concat(r));this.result.isEndOfRule=void 0===e,e instanceof Li&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,r)}},bo=class extends yo{walkAtLeastOne(e,t,r){if(e.idx===this.occurrence){const e=Gn(t.concat(r));this.result.isEndOfRule=void 0===e,e instanceof Li&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,r)}},vo=class extends yo{walkAtLeastOneSep(e,t,r){if(e.idx===this.occurrence){const e=Gn(t.concat(r));this.result.isEndOfRule=void 0===e,e instanceof Li&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,r)}};function _o(e,t,r=[]){r=zr(r);let n=[],i=0;function a(a){const o=_o(a.concat(Dn(e,i+1)),t,r);return n.concat(o)}for(;r.length{!1===oi(e.definition)&&(n=a(e.definition))})),n;if(!(t instanceof Li))throw Error("non exhaustive match");r.push(t.terminalType)}}i++}return n.push({partialPath:r,suffixDef:Dn(e,i)}),n}function To(e,t,r,n){const i="EXIT_NONE_TERMINAL",a=[i],o="EXIT_ALTERNATIVE";let s=!1;const c=t.length,u=c-n-1,l=[],d=[];for(d.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!oi(d);){const e=d.pop();if(e===o){s&&Ln(d).idx<=u&&d.pop();continue}const n=e.def,p=e.idx,h=e.ruleStack,f=e.occurrenceStack;if(oi(n))continue;const y=n[0];if(y===i){const e={idx:p,def:Dn(n),ruleStack:Fn(h),occurrenceStack:Fn(f)};d.push(e)}else if(y instanceof Li)if(p=0;e--){const t={idx:p,def:y.definition[e].definition.concat(Dn(n)),ruleStack:h,occurrenceStack:f};d.push(t),d.push(o)}else if(y instanceof Ai)d.push({idx:p,def:y.definition.concat(Dn(n)),ruleStack:h,occurrenceStack:f});else{if(!(y instanceof Ei))throw Error("non exhaustive match");d.push(Oo(y,p,h,f))}}return l}function Oo(e,t,r,n){const i=zr(r);i.push(e.name);const a=zr(n);return a.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:a}}function wo(e){if(e instanceof xi||"Option"===e)return so.OPTION;if(e instanceof Ri||"Repetition"===e)return so.REPETITION;if(e instanceof Ii||"RepetitionMandatory"===e)return so.REPETITION_MANDATORY;if(e instanceof Pi||"RepetitionMandatoryWithSeparator"===e)return so.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof Ni||"RepetitionWithSeparator"===e)return so.REPETITION_WITH_SEPARATOR;if(e instanceof ji||"Alternation"===e)return so.ALTERNATION;throw Error("non exhaustive match")}function So(e){const{occurrence:t,rule:r,prodType:n,maxLookahead:i}=e,a=wo(n);return a===so.ALTERNATION?Lo(t,r,i):Do(t,r,a,i)}function Eo(e,t,r,n){const i=e.length,a=Un(e,(e=>Un(e,(e=>1===e.length))));if(t)return function(t){const n=Hn(t,(e=>e.GATE));for(let t=0;tFt(e))),r=hi(t,((e,t,r)=>(Mn(t,(t=>{Yn(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=r),Mn(t.categoryMatches,(t=>{Yn(e,t)||(e[t]=r)}))})),e)),{});return function(){const e=this.LA_FAST(1);return r[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length)),i=e.length;if(n&&!r){const t=Ft(e);if(1===t.length&&oi(t[0].categoryMatches)){const e=t[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===e}}{const e=hi(t,((e,t,r)=>(e[t.tokenTypeIdx]=!0,Mn(t.categoryMatches,(t=>{e[t]=!0})),e)),[]);return function(){const t=this.LA_FAST(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let r=0;r_o([e],1))),n=Po(r.length),i=Hn(r,(e=>{const t={};return Mn(e,(e=>{const r=Ro(e.partialPath);Mn(r,(e=>{t[e]=!0}))})),t}));let a=r;for(let e=1;e<=t;e++){const r=a;a=Po(r.length);for(let o=0;o{const t=Ro(e.partialPath);Mn(t,(e=>{i[o][e]=!0}))}))}}}}return n}function Lo(e,t,r,n){const i=new Io(e,so.ALTERNATION,n);return t.accept(i),jo(i.result,r)}function Do(e,t,r,n){const i=new Io(e,r);t.accept(i);const a=i.result,o=new xo(t,e,r).startWalking();return jo([new Ai({definition:a}),new Ai({definition:o})],n)}function Fo(e,t){e:for(let r=0;rUn(e,(e=>Un(e,(e=>oi(e.categoryMatches)))))))}function Co(e){return`${ki(e)}_#_${e.idx}_#_${ko(e)}`}function ko(e){return e instanceof Li?e.terminalType.name:e instanceof Si?e.nonTerminalName:""}var Uo=class extends Mi{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function Bo(e,t,r,n=[]){const i=[],a=qo(t.definition);if(oi(a))return[];{const t=e.name;ri(a,e)&&i.push({message:r.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:Ps.LEFT_RECURSION,ruleName:t});const o=jn(a,n.concat([e])),s=zn(o,(t=>{const i=zr(n);return i.push(t),Bo(e,t,r,i)}));return i.concat(s)}}function qo(e){let t=[];if(oi(e))return t;const r=Gn(e);if(r instanceof Si)t.push(r.referencedRule);else if(r instanceof Ai||r instanceof xi||r instanceof Ii||r instanceof Pi||r instanceof Ni||r instanceof Ri)t=t.concat(qo(r.definition));else if(r instanceof ji)t=Ft(Hn(r.definition,(e=>qo(e.definition))));else if(!(r instanceof Li))throw Error("non exhaustive match");const n=Ci(r),i=e.length>1;if(n&&i){const r=Dn(e);return t.concat(qo(r))}return t}var Vo=class extends Mi{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};var $o=class extends Mi{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};var Go="MismatchedTokenException",Qo="NoViableAltException",Ho="EarlyExitException",zo="NotAllInputParsedException",Ko=[Go,Qo,Ho,zo];function Xo(e){return ri(Ko,e.name)}Object.freeze(Ko);var Wo=class extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Jo=class extends Wo{constructor(e,t,r){super(e,t),this.previousToken=r,this.name=Go}},Yo=class extends Wo{constructor(e,t,r){super(e,t),this.previousToken=r,this.name=Qo}},Zo=class extends Wo{constructor(e,t){super(e,t),this.name=zo}},es=class extends Wo{constructor(e,t,r){super(e,t),this.previousToken=r,this.name=Ho}},ts={},rs="InRuleRecoveryException",ns=class extends Error{constructor(e){super(e),this.name=rs}};function is(e,t,r,n,i,a,o){const s=this.getKeyForAutomaticLookahead(n,i);let c=this.firstAfterRepMap[s];if(void 0===c){const e=this.getCurrRuleFullName();c=new a(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[s]=c}let u=c.token,l=c.occurrence;const d=c.isEndOfRule;0===this.RULE_STACK_IDX&&d&&void 0===u&&(u=no,l=1),void 0!==u&&void 0!==l&&this.shouldInRepetitionRecoveryBeTried(u,l,o)&&this.tryInRepetitionRecovery(e,t,r,u)}var as=1024,os=1280,ss=1536;function cs(e,t,r){return r|t|e}var us=class{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:Ns.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(oi(t)){const r=this.validateEmptyOrAlternatives(e.rules),n=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...r,...n,...i]}return t}validateNoLeftRecursion(e){return zn(e,(e=>Bo(e,e,lo)))}validateEmptyOrAlternatives(e){return zn(e,(e=>function(e,t){const r=new Vo;e.accept(r);const n=r.alternations;return zn(n,(r=>{const n=Fn(r.definition);return zn(n,((n,i)=>{const a=To([n],[],Ra,1);return oi(a)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:r,emptyChoiceIdx:i}),type:Ps.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:r.idx,alternative:i+1}]:[]}))}))}(e,lo)))}validateAmbiguousAlternationAlternatives(e,t){return zn(e,(e=>function(e,t,r){const n=new Vo;e.accept(n);let i=n.alternations;i=fi(i,(e=>!0===e.ignoreAmbiguities));const a=zn(i,(n=>{const i=n.idx,a=n.maxLookahead||t,o=Lo(i,e,a,n),s=function(e,t,r,n){const i=[],a=hi(e,((r,n,a)=>(!0===t.definition[a].ignoreAmbiguities||Mn(n,(n=>{const o=[a];Mn(e,((e,r)=>{a!==r&&Fo(e,n)&&!0!==t.definition[r].ignoreAmbiguities&&o.push(r)})),o.length>1&&!Fo(i,n)&&(i.push(n),r.push({alts:o,path:n}))})),r)),[]);return Hn(a,(e=>{const i=Hn(e.alts,(e=>e+1));return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:Ps.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:t.idx,alternatives:e.alts}}))}(o,n,e,r),c=function(e,t,r,n){const i=hi(e,((e,t,r)=>{const n=Hn(t,(e=>({idx:r,path:e})));return e.concat(n)}),[]);return Kr(zn(i,(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const a=e.idx,o=e.path,s=qn(i,(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const r=n[t];return e===r||r.categoryMatchesMap[e.tokenTypeIdx]})));var r,n}));return Hn(s,(e=>{const i=[e.idx+1,a+1],o=0===t.idx?"":t.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:Ps.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:o,alternatives:i}}))})))}(o,n,e,r);return s.concat(c)}));return a}(e,t,lo)))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,r){const n=[];return Mn(e,(e=>{const i=new $o;e.accept(i);const a=i.allProductions;Mn(a,(i=>{const a=wo(i),o=i.maxLookahead||t,s=Do(i.idx,e,a,o)[0];if(oi(Ft(s))){const t=r.buildEmptyRepetitionError({topLevelRule:e,repetition:i});n.push({message:t,type:Ps.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}}))})),n}(e,t,lo)}buildLookaheadForAlternation(e){return function(e,t,r,n,i,a){const o=Lo(e,t,r);return a(o,n,Mo(o)?Na:Ra,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Eo)}buildLookaheadForOptional(e){return function(e,t,r,n,i,a){const o=Do(e,t,i,r),s=Mo(o)?Na:Ra;return a(o[0],s,n)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,wo(e.prodType),Ao)}},ls=new class extends Mi{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function ds(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffsetG(e.GATE)));return a.hasPredicates=o,r.definition.push(a),Mn(i,(e=>{const t=new Ai({definition:[]});a.definition.push(t),Yn(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Yn(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()})),bs}function As(e){return 0===e?"":`${e}`}function xs(e){if(e<0||e>_s){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${_s+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}var Is=io(no,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Is);var Ps,Rs,Ns=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:oo,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),js=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});function Ls(e=void 0){return function(){return e}}(Rs=Ps||(Ps={}))[Rs.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",Rs[Rs.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",Rs[Rs.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",Rs[Rs.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",Rs[Rs.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",Rs[Rs.LEFT_RECURSION=5]="LEFT_RECURSION",Rs[Rs.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",Rs[Rs.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",Rs[Rs.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",Rs[Rs.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",Rs[Rs.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",Rs[Rs.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",Rs[Rs.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",Rs[Rs.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION";var Ds,Fs=class e{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",(()=>{let t;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",(()=>{Oi(this)})),this.TRACE_INIT("Grammar Recording",(()=>{try{this.enableRecording(),Mn(this.definedRulesNames,(e=>{const t=this[e].originalGrammarAction;let r;this.TRACE_INIT(`${e} Rule`,(()=>{r=this.topLevelRuleRecord(e,t)})),this.gastProductionsCache[e]=r}))}finally{this.disableRecording()}}));let n=[];if(this.TRACE_INIT("Grammar Resolving",(()=>{n=function(e){const t=Pn(e,{errMsgProvider:uo}),r={};return Mn(e.rules,(e=>{r[e.name]=e})),function(e,t){const r=new po(e,t);return r.resolveRefs(),r.errors}(r,t.errMsgProvider)}({rules:ei(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)})),this.TRACE_INIT("Grammar Validations",(()=>{if(oi(n)&&!1===this.skipValidations){const t=(e={rules:ei(this.gastProductionsCache),tokenTypes:ei(this.tokensMap),errMsgProvider:lo,grammarName:r},function(e,t,r,n){const i=zn(e,(e=>function(e,t){const r=new Uo;e.accept(r);const n=r.allProductions,i=Xn(n,Co),a=di(i,(e=>e.length>1));return Hn(ei(a),(r=>{const n=Gn(r),i=t.buildDuplicateFoundError(e,r),a=ki(n),o={message:i,type:Ps.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:a,occurrence:n.idx},s=ko(n);return s&&(o.parameter=s),o}))}(e,r))),a=function(e,t,r){const n=[],i=Hn(t,(e=>e.name));return Mn(e,(e=>{const t=e.name;if(ri(i,t)){const i=r.buildNamespaceConflictError(e);n.push({message:i,type:Ps.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}})),n}(e,t,r),o=zn(e,(e=>function(e,t){const r=new Vo;e.accept(r);const n=r.alternations;return zn(n,(r=>r.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:r}),type:Ps.TOO_MANY_ALTS,ruleName:e.name,occurrence:r.idx}]:[]))}(e,r))),s=zn(e,(t=>function(e,t,r,n){const i=[],a=hi(t,((t,r)=>r.name===e.name?t+1:t),0);if(a>1){const t=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:r});i.push({message:t,type:Ps.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,n,r)));return i.concat(a,o,s)}((e=Pn(e,{errMsgProvider:lo})).rules,e.tokenTypes,e.errMsgProvider,e.grammarName)),n=function(e){const t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return Hn(t,(e=>Object.assign({type:Ps.CUSTOM_LOOKAHEAD_VALIDATION},e)))}({lookaheadStrategy:this.lookaheadStrategy,rules:ei(this.gastProductionsCache),tokenTypes:ei(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(t,n)}var e})),oi(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",(()=>{const e=function(e){const t={};return Mn(e,(e=>{const r=new $i(e).startWalking();tt(t,r)})),t}(ei(this.gastProductionsCache));this.resyncFollows=e})),this.TRACE_INIT("ComputeLookaheadFunctions",(()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:ei(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(ei(this.gastProductionsCache))}))),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!oi(this.definitionErrors))throw t=Hn(this.definitionErrors,(e=>e.message)),new Error(`Parser Definition Errors detected:\n ${t.join("\n-------------------------------\n")}`)}))}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const r=this;if(r.initErrorHandler(t),r.initLexerAdapter(),r.initLooksAhead(t),r.initRecognizerEngine(e,t),r.initRecoverable(t),r.initTreeBuilder(t),r.initContentAssist(),r.initGastRecorder(t),r.initPerformanceTracer(t),Yn(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Yn(t,"skipValidations")?t.skipValidations:Ns.skipValidations}};Fs.DEFER_DEFINITION_ERRORS_HANDLING=!1,Ds=Fs,[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Yn(e,"recoveryEnabled")?e.recoveryEnabled:Ns.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=is)}getTokenToInsert(e){const t=io(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,r,n){const i=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let s=!1;const c=this.LA_FAST(1);let u=this.LA_FAST(1);const l=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:c,previous:e,ruleName:this.getCurrRuleFullName()}),r=new Jo(t,c,this.LA(0));r.resyncedTokens=Fn(o),this.SAVE_ERROR(r)};for(;!s;){if(this.tokenMatcher(u,n))return void l();if(r.call(this))return l(),void e.apply(this,t);this.tokenMatcher(u,i)?s=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o))}this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,t,r){return!1!==r&&!this.tokenMatcher(this.LA_FAST(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getFollowsForInRuleRecovery(e,t){const r=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new ns("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(oi(t))return!1;const r=this.LA_FAST(1);return void 0!==$n(t,(e=>this.tokenMatcher(r,e)))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(t);return ri(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA_FAST(1),r=2;for(;;){const n=$n(e,(e=>ao(t,e)));if(void 0!==n)return n;t=this.LA(r),r++}}getCurrFollowKey(){if(0===this.RULE_STACK_IDX)return ts;const e=this.currRuleShortName,t=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK,r=this.RULE_STACK_IDX+1,n=new Array(r);for(let i=0;ithis.getFollowSetFromFollowKey(e)));return Ft(e)}getFollowSetFromFollowKey(e){if(e===ts)return[no];const t=e.ruleName+e.idxInCallingRule+Vi+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,no)||t.push(e),t}reSyncTo(e){const t=[];let r=this.LA_FAST(1);for(;!1===this.tokenMatcher(r,e);)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,t);return Fn(t)}attemptInRepetitionRecovery(e,t,r,n,i,a,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){const e=this.RULE_STACK_IDX+1,t=new Array(e);for(let r=0;r{this.TRACE_INIT(`${e.name} Rule Lookahead`,(()=>{const{alternation:t,repetition:r,option:n,repetitionMandatory:i,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:o}=function(e){ls.reset(),e.accept(ls);const t=ls.dslMethods;return ls.reset(),t}(e);Mn(t,(t=>{const r=0===t.idx?"":t.idx;this.TRACE_INIT(`${ki(t)}${r}`,(()=>{const r=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),n=cs(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(n,r)}))})),Mn(r,(t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,ki(t))})),Mn(n,(t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,ki(t))})),Mn(i,(t=>{this.computeLookaheadFunc(e,t.idx,as,"RepetitionMandatory",t.maxLookahead,ki(t))})),Mn(a,(t=>{this.computeLookaheadFunc(e,t.idx,ss,"RepetitionMandatoryWithSeparator",t.maxLookahead,ki(t))})),Mn(o,(t=>{this.computeLookaheadFunc(e,t.idx,os,"RepetitionWithSeparator",t.maxLookahead,ki(t))}))}))}))}computeLookaheadFunc(e,t,r,n,i,a){this.TRACE_INIT(`${a}${0===t?"":t}`,(()=>{const a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:n}),o=cs(this.fullRuleNameToShort[e.name],r,t);this.setLaFuncCache(o,a)}))}getKeyForAutomaticLookahead(e,t){return cs(this.currRuleShortName,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Yn(e,"nodeLocationTracking")?e.nodeLocationTracking:Ns.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=ps,this.setNodeLocationFromNode=ps,this.cstPostRule=oe,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=oe,this.setNodeLocationFromNode=oe,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=ds,this.setNodeLocationFromNode=ds,this.cstPostRule=oe,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=oe,this.setNodeLocationFromNode=oe,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=oe,this.setNodeLocationFromNode=oe,this.cstPostRule=oe,this.setInitialNodeLocation=oe}else this.cstInvocationStateUpdate=oe,this.cstFinallyStateUpdate=oe,this.cstPostTerminal=oe,this.cstPostNonTerminal=oe,this.cstPostRule=oe}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA_FAST(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),r=e.location;r.startOffset<=t.startOffset==1?(r.endOffset=t.endOffset,r.endLine=t.endLine,r.endColumn=t.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),r=e.location;r.startOffset<=t.startOffset==1?r.endOffset=t.endOffset:r.startOffset=NaN}cstPostTerminal(e,t){const r=this.CST_STACK[this.CST_STACK.length-1];var n,i,a;i=t,a=e,void 0===(n=r).children[a]?n.children[a]=[i]:n.children[a].push(i),this.setNodeLocationFromToken(r.location,t)}cstPostNonTerminal(e,t){const r=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,r){void 0===e.children[t]?e.children[t]=[r]:e.children[t].push(r)}(r,t,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(ui(this.baseCstVisitorConstructor)){const e=function(e,t){const r=function(){};ms(r,e+"BaseSemantics");const n={visit:function(e,t){if(I(e)&&(e=e[0]),!ui(e))return this[e.name](e.children,t)},validateVisitor:function(){const e=function(e,t){const r=function(e,t){const r=qn(t,(t=>!1===G(e[t]))),n=Hn(r,(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:hs.MISSING_METHOD,methodName:t})));return Kr(n)}(e,t);return r}(this,t);if(!oi(e)){const t=Hn(e,(e=>e.msg));throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(r.prototype=n).constructor=r,r._RULE_NAMES=t,r}(this.className,Ze(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(ui(this.baseCstVisitorWithDefaultsConstructor)){const e=function(e,t,r){const n=function(){};ms(n,e+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return Mn(t,(e=>{i[e]=gs})),(n.prototype=i).constructor=n,n}(this.className,Ze(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):Is}LA_FAST(e){const t=this.currIdx+e;return this.tokVector[t]}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Is:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Na,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Yn(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(I(e)){if(oi(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(I(e))this.tokensMap=hi(e,((e,t)=>(e[t.name]=t,e)),{});else if(Yn(e,"modes")&&Un(Ft(ei(e.modes)),ka)){const t=Ft(ei(e.modes)),r=bi(t);this.tokensMap=hi(r,((e,t)=>(e[t.name]=t,e)),{})}else{if(!F(e))throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=zr(e)}this.tokensMap.EOF=no;const r=Yn(e,"modes")?Ft(ei(e.modes)):ei(e),n=Un(r,(e=>oi(e.categoryMatches)));this.tokenMatcher=n?Na:Ra,Da(ei(this.tokensMap))}defineRule(e,t,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const n=Yn(r,"resyncEnabled")?r.resyncEnabled:js.resyncEnabled,i=Yn(r,"recoveryValueFunc")?r.recoveryValueFunc:js.recoveryValueFunc,a=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a,o=!0===this.outputCst?function(...r){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,r);const n=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(n),n}catch(e){return this.invokeRuleCatch(e,n,i)}finally{this.ruleFinallyStateUpdate()}}:function(...r){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,r)}catch(e){return this.invokeRuleCatch(e,n,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign((function(...t){this.onBeforeParse(e);try{return o.apply(this,t)}finally{this.onAfterParse(e)}}),{ruleName:e,originalGrammarAction:t,coreRule:o})}invokeRuleCatch(e,t,r){const n=0===this.RULE_STACK_IDX,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(Xo(e)){const t=e;if(i){const n=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(n)){if(t.resyncedTokens=this.reSyncTo(n),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return r(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(n)return this.moveToTerminatedState(),r(e);throw t}throw e}optionInternal(e,t){const r=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,r)}optionInternalLogic(e,t,r){let n,i=this.getLaFuncFromCache(r);if("function"!=typeof e){n=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else n=e;if(!0===i.call(this))return n.call(this)}atLeastOneInternal(e,t){const r=this.getKeyForAutomaticLookahead(as,e);return this.atLeastOneInternalLogic(e,t,r)}atLeastOneInternalLogic(e,t,r){let n,i=this.getLaFuncFromCache(r);if("function"!=typeof t){n=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else n=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,so.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(n);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(n)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,as,e,bo)}atLeastOneSepFirstInternal(e,t){const r=this.getKeyForAutomaticLookahead(ss,e);this.atLeastOneSepFirstInternalLogic(e,t,r)}atLeastOneSepFirstInternalLogic(e,t,r){const n=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(r).call(this))throw this.raiseEarlyExitException(e,so.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{n.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,n,vo],t,ss,e,vo)}}manyInternal(e,t){const r=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,r)}manyInternalLogic(e,t,r){let n,i=this.getLaFuncFromCache(r);if("function"!=typeof t){n=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else n=t;let a=!0;for(;!0===i.call(this)&&!0===a;)a=this.doSingleRepetition(n);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,mo,a)}manySepFirstInternal(e,t){const r=this.getKeyForAutomaticLookahead(os,e);this.manySepFirstInternalLogic(e,t,r)}manySepFirstInternalLogic(e,t,r){const n=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(r).call(this)){n.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,n,go],t,os,e,go)}}repetitionSepSecondInternal(e,t,r,n,i){for(;r();)this.CONSUME(t),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,r,n,i],r,ss,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const r=this.getKeyForAutomaticLookahead(256,t),n=I(e)?e:e.DEF,i=this.getLaFuncFromCache(r).call(this,n);if(void 0!==i)return n[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,t,r){let n;try{const i=void 0!==r?r.ARGS:void 0;return this.subruleIdx=t,n=e.coreRule.apply(this,i),this.cstPostNonTerminal(n,void 0!==r&&void 0!==r.LABEL?r.LABEL:e.ruleName),n}catch(t){throw this.subruleInternalError(t,r,e.ruleName)}}subruleInternalError(e,t,r){throw Xo(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,t,r){let n;try{const t=this.LA_FAST(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),n=t):this.consumeInternalError(e,t,r)}catch(r){n=this.consumeInternalRecovery(e,t,r)}return this.cstPostTerminal(void 0!==r&&void 0!==r.LABEL?r.LABEL:e.name,n),n}consumeInternalError(e,t,r){let n;const i=this.LA(0);throw n=void 0!==r&&r.ERR_MSG?r.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Jo(n,t,i))}consumeInternalRecovery(e,t,r){if(!this.recoveryEnabled||"MismatchedTokenException"!==r.name||this.isBackTracking())throw r;{const n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(e){throw e.name===rs?r:e}}}saveRecogState(){const e=this.errors,t=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);const t=e.RULE_STACK;for(let e=0;e=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,t,r){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=r,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),no)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let e=0;e${e}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:Ps.INVALID_RULE_OVERRIDE,ruleName:e})),n}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(n);const i=this.defineRule(e,t,r);return this[e]=i,i}BACKTRACK(e,t){var r;const n=null!==(r=e.coreRule)&&void 0!==r?r:e;return function(){this.isBackTrackingStack.push(1);const e=this.saveRecogState();try{return n.apply(this,t),!0}catch(e){if(Xo(e))return!1;throw e}finally{this.reloadRecogState(e),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Di(ei(this.gastProductionsCache))}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Yn(e,"errorMessageProvider")?e.errorMessageProvider:Ns.errorMessageProvider}SAVE_ERROR(e){if(Xo(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return zr(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,r){const n=this.getCurrRuleFullName(),i=Do(e,this.getGAstProductions()[n],t,this.maxLookahead)[0],a=[];for(let e=1;e<=this.maxLookahead;e++)a.push(this.LA(e));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:a,previous:this.LA(0),customUserDescription:r,ruleName:n});throw this.SAVE_ERROR(new es(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const r=this.getCurrRuleFullName(),n=Lo(e,this.getGAstProductions()[r],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const a=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:n,actual:i,previous:a,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Yo(o,this.LA(1),a))}},class{initContentAssist(){}computeContentAssist(e,t){const r=this.gastProductionsCache[e];if(ui(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return To([r],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const t=Gn(e.ruleStack),r=this.getGAstProductions()[t];return new fo(r,e).startWalking()}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",(()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,r){return this.consumeInternalRecord(t,e,r)},this[`SUBRULE${t}`]=function(t,r){return this.subruleInternalRecord(t,e,r)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,r){return this.consumeInternalRecord(t,e,r)},this.subrule=function(e,t,r){return this.subruleInternalRecord(t,e,r)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD}))}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",(()=>{const e=this;for(let t=0;t<10;t++){const r=t>0?t:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA}))}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return Is}topLevelRuleRecord(e,t){try{const r=new Ei({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),t.call(this),this.recordingProdStack.pop(),r}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return Ss.call(this,xi,e,t)}atLeastOneInternalRecord(e,t){Ss.call(this,Ii,t,e)}atLeastOneSepFirstInternalRecord(e,t){Ss.call(this,Pi,t,e,vs)}manyInternalRecord(e,t){Ss.call(this,Ri,t,e)}manySepFirstInternalRecord(e,t){Ss.call(this,Ni,t,e,vs)}orInternalRecord(e,t){return Es.call(this,e,t)}subruleInternalRecord(e,t,r){if(xs(t),!e||!1===Yn(e,"ruleName")){const r=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw r.KNOWN_RECORDER_ERROR=!0,r}const n=Ln(this.recordingProdStack),i=e.ruleName,a=new Si({idx:t,nonTerminalName:i,label:null==r?void 0:r.LABEL,referencedRule:void 0});return n.definition.push(a),this.outputCst?ws:bs}consumeInternalRecord(e,t,r){if(xs(t),!Ma(e)){const r=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw r.KNOWN_RECORDER_ERROR=!0,r}const n=Ln(this.recordingProdStack),i=new Li({idx:t,terminalType:e,label:null==r?void 0:r.LABEL});return n.definition.push(i),Os}},class{initPerformanceTracer(e){if(Yn(e,"traceInitPerf")){const t=e.traceInitPerf,r="number"==typeof t;this.traceInitMaxIdent=r?t:1/0,this.traceInitPerf=r?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Ns.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:n,value:i}=Ti(t),a=n>10?console.warn:console.log;return this.traceInitIndent time: ${n}ms`),this.traceInitIndent--,i}return t()}}].forEach((e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach((r=>{if("constructor"===r)return;const n=Object.getOwnPropertyDescriptor(t,r);n&&(n.get||n.set)?Object.defineProperty(Ds.prototype,r,n):Ds.prototype[r]=e.prototype[r]}))}));var Ms=class extends Fs{constructor(e,t=Ns){const r=zr(t);r.outputCst=!0,super(e,r)}},Cs=class extends Fs{constructor(e,t=Ns){const r=zr(t);r.outputCst=!1,super(e,r)}},ks=class extends Mi{visitRule(e){const t=this.visitEach(e.definition),r=Xn(t,(e=>e.propertyName)),n=Hn(r,((e,t)=>{const r=!mi(e,(e=>!e.canBeNull));let n=e[0].type;return e.length>1&&(n=Hn(e,(e=>e.type))),{name:t,type:n,optional:r}}));return{name:e.name,properties:n}}visitAlternative(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0})}visitOption(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0})}visitRepetition(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0})}visitRepetitionMandatory(e){return this.visitEach(e.definition)}visitRepetitionMandatoryWithSeparator(e){return this.visitEach(e.definition).concat({propertyName:e.separator.name,canBeNull:!0,type:Us(e.separator)})}visitRepetitionWithSeparator(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0}).concat({propertyName:e.separator.name,canBeNull:!0,type:Us(e.separator)})}visitAlternation(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0})}visitTerminal(e){return[{propertyName:e.label||e.terminalType.name,canBeNull:!1,type:Us(e)}]}visitNonTerminal(e){return[{propertyName:e.label||e.nonTerminalName,canBeNull:!1,type:Us(e)}]}visitEachAndOverrideWith(e,t){return Hn(this.visitEach(e),(e=>tt({},e,t)))}visitEach(e){return Ft(Hn(e,(e=>this.visit(e))))}};function Us(e){return e instanceof Si?{kind:"rule",name:e.referencedRule.name}:{kind:"token"}}function Bs(e){return"token"===e.kind?"IToken":qs(e.name)}function qs(e){return Zt(e)+"CstNode"}function Vs(e){return Zt(e)+"CstChildren"}var $s={includeVisitorInterface:!0,visitorInterfaceName:"ICstNodeVisitor"};function Gs(e,t){const r=Object.assign(Object.assign({},$s),t),n=function(e){const t=new ks,r=ei(e);return Hn(r,(e=>t.visitRule(e)))}(e);return function(e,t){let r=[];return r=r.concat('import type { CstNode, ICstVisitor, IToken } from "chevrotain";'),r=r.concat(Ft(Hn(e,(e=>function(e){const t=function(e){const t=qs(e.name),r=Vs(e.name);return`export interface ${t} extends CstNode {\n name: "${e.name}";\n children: ${r};\n}`}(e),r=function(e){return`export type ${Vs(e.name)} = {\n ${Hn(e.properties,(e=>function(e){const t=function(e){if(I(e)){const t=bi(Hn(e,(e=>Bs(e))));return"("+hi(t,((e,t)=>e+" | "+t))+")"}return Bs(e)}(e.type);return`${e.name}${e.optional?"?":""}: ${t}[];`}(e))).join("\n ")}\n};`}(e);return[t,r]}(e))))),t.includeVisitorInterface&&(r=r.concat(`export interface ${t.visitorInterfaceName} extends ICstVisitor {\n ${Hn(e,(e=>function(e){const t=Vs(e.name);return`${e.name}(children: ${t}, param?: IN): OUT;`}(e))).join("\n ")}\n}`)),r.join("\n\n")+"\n"}(n,r)}function Qs(e,{resourceBase:t=`https://unpkg.com/chevrotain@${h}/diagrams/`,css:r=`https://unpkg.com/chevrotain@${h}/diagrams/diagrams.css`}={}){return`\n\x3c!-- This is a generated file --\x3e\n\n\n\n\n\n\n\n + +