From 80bad8ccea1057f898077c24213e4d8a13a58807 Mon Sep 17 00:00:00 2001 From: Mario Scrocca Date: Thu, 5 Dec 2024 18:52:46 +0100 Subject: [PATCH] fix: update prefixes in lifting template --- dist/index.html | 2 +- dist/js/{109.8a94cc6b.js => 109.350c7c05.js} | 2 +- ...09.8a94cc6b.js.map => 109.350c7c05.js.map} | 2 +- dist/js/{13.6c9a5db4.js => 13.06cd2e07.js} | 2 +- ...{13.6c9a5db4.js.map => 13.06cd2e07.js.map} | 2 +- dist/js/{148.55fc6e6c.js => 148.2b6347d2.js} | 2 +- ...48.55fc6e6c.js.map => 148.2b6347d2.js.map} | 2 +- dist/js/{200.944c37a3.js => 200.4dc78eed.js} | 2 +- ...00.944c37a3.js.map => 200.4dc78eed.js.map} | 2 +- dist/js/208.65de7a32.js | 2 + dist/js/208.65de7a32.js.map | 1 + dist/js/208.e089da2b.js | 2 - dist/js/208.e089da2b.js.map | 1 - dist/js/{236.aff9ab69.js => 236.207c840f.js} | 2 +- ...36.aff9ab69.js.map => 236.207c840f.js.map} | 2 +- dist/js/{420.14eb6617.js => 420.fb240bdb.js} | 2 +- ...20.14eb6617.js.map => 420.fb240bdb.js.map} | 2 +- dist/js/{43.d0b4a88a.js => 43.fb5b896b.js} | 2 +- ...{43.d0b4a88a.js.map => 43.fb5b896b.js.map} | 2 +- dist/js/{49.11942c3a.js => 49.f2c20221.js} | 2 +- ...{49.11942c3a.js.map => 49.f2c20221.js.map} | 2 +- dist/js/{55.a9b33011.js => 55.d111b5d7.js} | 2 +- ...{55.a9b33011.js.map => 55.d111b5d7.js.map} | 2 +- dist/js/564.9497f0a9.js | 2 - dist/js/564.9497f0a9.js.map | 1 - dist/js/{590.a00bbba2.js => 590.47d0c120.js} | 6 +-- ...90.a00bbba2.js.map => 590.47d0c120.js.map} | 2 +- dist/js/{595.21fc48c4.js => 595.96320e8c.js} | 2 +- ...95.21fc48c4.js.map => 595.96320e8c.js.map} | 2 +- dist/js/{611.575aef38.js => 611.77fb901c.js} | 2 +- ...11.575aef38.js.map => 611.77fb901c.js.map} | 2 +- dist/js/{675.39da3138.js => 675.a10f8029.js} | 2 +- ...75.39da3138.js.map => 675.a10f8029.js.map} | 2 +- dist/js/{699.a64bba25.js => 699.15a1d044.js} | 2 +- ...99.a64bba25.js.map => 699.15a1d044.js.map} | 2 +- dist/js/{731.bc66358b.js => 731.a686c60c.js} | 4 +- dist/js/731.a686c60c.js.map | 1 + dist/js/731.bc66358b.js.map | 1 - dist/js/{733.fefd97ec.js => 733.320f4a50.js} | 2 +- ...33.fefd97ec.js.map => 733.320f4a50.js.map} | 2 +- dist/js/{818.e865edf8.js => 818.44b91e54.js} | 2 +- ...18.e865edf8.js.map => 818.44b91e54.js.map} | 2 +- dist/js/{954.3ce06965.js => 954.898da33a.js} | 2 +- ...54.3ce06965.js.map => 954.898da33a.js.map} | 2 +- dist/js/{978.c30ec276.js => 978.44af7ef6.js} | 2 +- ...78.c30ec276.js.map => 978.44af7ef6.js.map} | 2 +- dist/js/app.199b58f6.js | 2 + dist/js/app.199b58f6.js.map | 1 + dist/js/app.2e291fc4.js | 2 - dist/js/app.2e291fc4.js.map | 1 - ....afa21783.js => chunk-vendors.98f07d13.js} | 48 +++++++++---------- ...3.js.map => chunk-vendors.98f07d13.js.map} | 2 +- src/assets/mobility-lifting.jinja | 2 +- 53 files changed, 74 insertions(+), 77 deletions(-) rename dist/js/{109.8a94cc6b.js => 109.350c7c05.js} (99%) rename dist/js/{109.8a94cc6b.js.map => 109.350c7c05.js.map} (99%) rename dist/js/{13.6c9a5db4.js => 13.06cd2e07.js} (99%) rename dist/js/{13.6c9a5db4.js.map => 13.06cd2e07.js.map} (99%) rename dist/js/{148.55fc6e6c.js => 148.2b6347d2.js} (96%) rename dist/js/{148.55fc6e6c.js.map => 148.2b6347d2.js.map} (98%) rename dist/js/{200.944c37a3.js => 200.4dc78eed.js} (99%) rename dist/js/{200.944c37a3.js.map => 200.4dc78eed.js.map} (99%) create mode 100644 dist/js/208.65de7a32.js create mode 100644 dist/js/208.65de7a32.js.map delete mode 100644 dist/js/208.e089da2b.js delete mode 100644 dist/js/208.e089da2b.js.map rename dist/js/{236.aff9ab69.js => 236.207c840f.js} (99%) rename dist/js/{236.aff9ab69.js.map => 236.207c840f.js.map} (99%) rename dist/js/{420.14eb6617.js => 420.fb240bdb.js} (97%) rename dist/js/{420.14eb6617.js.map => 420.fb240bdb.js.map} (99%) rename dist/js/{43.d0b4a88a.js => 43.fb5b896b.js} (98%) rename dist/js/{43.d0b4a88a.js.map => 43.fb5b896b.js.map} (99%) rename dist/js/{49.11942c3a.js => 49.f2c20221.js} (99%) rename dist/js/{49.11942c3a.js.map => 49.f2c20221.js.map} (99%) rename dist/js/{55.a9b33011.js => 55.d111b5d7.js} (99%) rename dist/js/{55.a9b33011.js.map => 55.d111b5d7.js.map} (99%) delete mode 100644 dist/js/564.9497f0a9.js delete mode 100644 dist/js/564.9497f0a9.js.map rename dist/js/{590.a00bbba2.js => 590.47d0c120.js} (97%) rename dist/js/{590.a00bbba2.js.map => 590.47d0c120.js.map} (99%) rename dist/js/{595.21fc48c4.js => 595.96320e8c.js} (93%) rename dist/js/{595.21fc48c4.js.map => 595.96320e8c.js.map} (95%) rename dist/js/{611.575aef38.js => 611.77fb901c.js} (99%) rename dist/js/{611.575aef38.js.map => 611.77fb901c.js.map} (99%) rename dist/js/{675.39da3138.js => 675.a10f8029.js} (99%) rename dist/js/{675.39da3138.js.map => 675.a10f8029.js.map} (99%) rename dist/js/{699.a64bba25.js => 699.15a1d044.js} (99%) rename dist/js/{699.a64bba25.js.map => 699.15a1d044.js.map} (99%) rename dist/js/{731.bc66358b.js => 731.a686c60c.js} (80%) create mode 100644 dist/js/731.a686c60c.js.map delete mode 100644 dist/js/731.bc66358b.js.map rename dist/js/{733.fefd97ec.js => 733.320f4a50.js} (98%) rename dist/js/{733.fefd97ec.js.map => 733.320f4a50.js.map} (99%) rename dist/js/{818.e865edf8.js => 818.44b91e54.js} (99%) rename dist/js/{818.e865edf8.js.map => 818.44b91e54.js.map} (99%) rename dist/js/{954.3ce06965.js => 954.898da33a.js} (98%) rename dist/js/{954.3ce06965.js.map => 954.898da33a.js.map} (99%) rename dist/js/{978.c30ec276.js => 978.44af7ef6.js} (99%) rename dist/js/{978.c30ec276.js.map => 978.44af7ef6.js.map} (99%) create mode 100644 dist/js/app.199b58f6.js create mode 100644 dist/js/app.199b58f6.js.map delete mode 100644 dist/js/app.2e291fc4.js delete mode 100644 dist/js/app.2e291fc4.js.map rename dist/js/{chunk-vendors.afa21783.js => chunk-vendors.98f07d13.js} (56%) rename dist/js/{chunk-vendors.afa21783.js.map => chunk-vendors.98f07d13.js.map} (57%) diff --git a/dist/index.html b/dist/index.html index c5c21de..91d1a7a 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1 +1 @@ -Vue App
\ No newline at end of file +Vue App
\ No newline at end of file diff --git a/dist/js/109.8a94cc6b.js b/dist/js/109.350c7c05.js similarity index 99% rename from dist/js/109.8a94cc6b.js rename to dist/js/109.350c7c05.js index 729c495..2b3148d 100644 --- a/dist/js/109.8a94cc6b.js +++ b/dist/js/109.350c7c05.js @@ -1,2 +1,2 @@ (self["webpackChunkmobilitydcatap_ui"]=self["webpackChunkmobilitydcatap_ui"]||[]).push([[109],{5109:function(t,e,r){const i=r(19488),n=r(67234);class a extends i{constructor(t){super(n,t)}}t.exports=a},67234:function(t,e,r){const i=r(13943),{JsonLdParser:n}=r(38690),{Transform:a}=r(28399),o="null:";function s(t){return e=>"NamedNode"!==e.termType?null:e.value.startsWith(o)?t.namedNode(e.value.slice(o.length)):null}function l(t){const e=s(t);return r=>{const i=e(r.subject),n=e(r.predicate),a=e(r.object),o=e(r.graph);return i||n||a||o?t.quad(i||r.subject,n||r.predicate,a||r.object,o||r.graph):r}}class d{constructor(t,{baseIRI:e=o,context:r=null,factory:s=i}={}){const d=new n({baseIRI:e,context:r,dataFactory:s,streamingProfile:!1});t.pipe(d);const c=l(s),u=new a({objectMode:!0,transform:(t,e,r)=>{r(null,c(t))}});return d.on("context",(t=>{Object.entries(t).forEach((([t,e])=>{u.emit("prefix",t,s.namedNode(e))}))})),d.on("error",(t=>u.destroy(t))),d.pipe(u),u}}t.exports=d},13943:function(t,e,r){const i=r(82501);t.exports=i},14313:function(t){class e{constructor(t){this.value=t||"b"+ ++e.nextId}equals(t){return!!t&&t.termType===this.termType&&t.value===this.value}}e.prototype.termType="BlankNode",e.nextId=0,t.exports=e},82501:function(t,e,r){const i=r(14313),n=r(81856),a=r(4889),o=r(48736),s=r(84482),l=r(84200),d=r(46419);function c(t){return new s(t)}function u(t){return new i(t)}function h(t,e){return"string"===typeof e?-1===e.indexOf(":")?new o(t,e):new o(t,null,w.namedNode(e)):new o(t,null,e)}function f(t){return new d(t)}function p(){return w.defaultGraphInstance}function g(t,e,r){return w.quad(t,e,r)}function y(t,e,r,i){return new l(t,e,r,i||w.defaultGraphInstance)}function E(t){return a.call(w,t)}function C(t){return a.call(w,t)}const w={namedNode:c,blankNode:u,literal:h,variable:f,defaultGraph:p,triple:g,quad:y,fromTerm:E,fromQuad:C,defaultGraphInstance:new n};t.exports=w},81856:function(t){class e{equals(t){return!!t&&t.termType===this.termType}}e.prototype.termType="DefaultGraph",e.prototype.value="",t.exports=e},48736:function(t,e,r){const i=r(84482);class n{constructor(t,e,r){this.value=t,this.datatype=n.stringDatatype,this.language="",e?(this.language=e,this.datatype=n.langStringDatatype):r&&(this.datatype=r)}equals(t){return!!t&&t.termType===this.termType&&t.value===this.value&&t.language===this.language&&t.datatype.equals(this.datatype)}}n.prototype.termType="Literal",n.langStringDatatype=new i("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),n.stringDatatype=new i("http://www.w3.org/2001/XMLSchema#string"),t.exports=n},84482:function(t){class e{constructor(t){this.value=t}equals(t){return!!t&&t.termType===this.termType&&t.value===this.value}}e.prototype.termType="NamedNode",t.exports=e},84200:function(t,e,r){const i=r(81856);class n{constructor(t,e,r,n){this.subject=t,this.predicate=e,this.object=r,this.graph=n||new i}equals(t){return!!t&&("Quad"===t.termType||!t.termType)&&t.subject.equals(this.subject)&&t.predicate.equals(this.predicate)&&t.object.equals(this.object)&&t.graph.equals(this.graph)}}n.prototype.termType="Quad",n.prototype.value="",t.exports=n},46419:function(t){class e{constructor(t){this.value=t}equals(t){return!!t&&t.termType===this.termType&&t.value===this.value}}e.prototype.termType="Variable",t.exports=e},4889:function(t){function e(t){if(!t)return null;if("BlankNode"===t.termType)return this.blankNode(t.value);if("DefaultGraph"===t.termType)return this.defaultGraph();if("Literal"===t.termType)return this.literal(t.value,t.language||this.namedNode(t.datatype.value));if("NamedNode"===t.termType)return this.namedNode(t.value);if("Quad"===t.termType){const e=this.fromTerm(t.subject),r=this.fromTerm(t.predicate),i=this.fromTerm(t.object),n=this.fromTerm(t.graph);return this.quad(e,r,i,n)}if("Variable"===t.termType)return this.variable(t.value);throw new Error(`unknown termType ${t.termType}`)}t.exports=e},19488:function(t){class e{constructor(t,e){this.Impl=t,this.options=e}import(t,e){const r=new this.Impl(t,Object.assign({},this.options,e));return t.on("end",(()=>{r.readable||r.emit("end")})),t.on("error",(t=>{r.emit("error",t)})),r}}t.exports=e},86547:function(){(function(t){(function(e){var r={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};function i(t){return t&&DataView.prototype.isPrototypeOf(t)}if(r.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(t){return t&&n.indexOf(Object.prototype.toString.call(t))>-1};function o(t){if("string"!==typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function s(t){return"string"!==typeof t&&(t=String(t)),t}function l(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r.iterable&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function u(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function h(t){var e=new FileReader,r=u(e);return e.readAsArrayBuffer(t),r}function f(t){var e=new FileReader,r=u(e);return e.readAsText(t),r}function p(t){for(var e=new Uint8Array(t),r=new Array(e.length),i=0;i-1?e:t}function w(t,e){e=e||{};var r=e.body;if(t instanceof w){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new d(e.headers)),this.method=C(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function I(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(n))}})),e}function _(t){var e=new d,r=t.replace(/\r?\n[\t ]+/g," ");return r.split(/\r?\n/).forEach((function(t){var r=t.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();e.append(i,n)}})),e}function O(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},y.call(w.prototype),y.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},O.error=function(){var t=new O(null,{status:0,statusText:""});return t.type="error",t};var R=[301,302,303,307,308];O.redirect=function(t,e){if(-1===R.indexOf(e))throw new RangeError("Invalid status code");return new O(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(b){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function x(t,i){return new Promise((function(n,a){var o=new w(t,i);if(o.signal&&o.signal.aborted)return a(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var t={status:s.status,statusText:s.statusText,headers:_(s.getAllResponseHeaders()||"")};t.url="responseURL"in s?s.responseURL:t.headers.get("X-Request-URL");var e="response"in s?s.response:s.responseText;n(new O(e,t))},s.onerror=function(){a(new TypeError("Network request failed"))},s.ontimeout=function(){a(new TypeError("Network request failed"))},s.onabort=function(){a(new e.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&&r.blob&&(s.responseType="blob"),o.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),o.signal&&(o.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",l)}),s.send("undefined"===typeof o._bodyInit?null:o._bodyInit)}))}x.polyfill=!0,t.fetch||(t.fetch=x,t.Headers=d,t.Request=w,t.Response=O),e.Headers=d,e.Request=w,e.Response=O,e.fetch=x,Object.defineProperty(e,"__esModule",{value:!0})})({})})("undefined"!==typeof self?self:this)},42395:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(72803),e),n(r(75094),e),n(r(60585),e),n(r(29146),e),n(r(45086),e),n(r(85215),e),n(r(94931),e)},72803:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContextParser=void 0,r(86547);const i=r(70742),n=r(75094),a=r(60585),o=r(85215),s=r(94931);class l{constructor(t){t=t||{},this.documentLoader=t.documentLoader||new a.FetchDocumentLoader,this.documentCache={},this.validateContext=!t.skipValidation,this.expandContentTypeToBase=!!t.expandContentTypeToBase,this.remoteContextsDepthLimit=t.remoteContextsDepthLimit||32,this.redirectSchemaOrgHttps=!("redirectSchemaOrgHttps"in t)||!!t.redirectSchemaOrgHttps}static validateLanguage(t,e,r){if("string"!==typeof t)throw new n.ErrorCoded(`The value of an '@language' must be a string, got '${JSON.stringify(t)}'`,r);if(!s.Util.REGEX_LANGUAGE_TAG.test(t)){if(e)throw new n.ErrorCoded(`The value of an '@language' must be a valid language tag, got '${JSON.stringify(t)}'`,r);return!1}return!0}static validateDirection(t,e){if("string"!==typeof t)throw new n.ErrorCoded(`The value of an '@direction' must be a string, got '${JSON.stringify(t)}'`,n.ERROR_CODES.INVALID_BASE_DIRECTION);if(!s.Util.REGEX_DIRECTION_TAG.test(t)){if(e)throw new n.ErrorCoded(`The value of an '@direction' must be 'ltr' or 'rtl', got '${JSON.stringify(t)}'`,n.ERROR_CODES.INVALID_BASE_DIRECTION);return!1}return!0}idifyReverseTerms(t){for(const e of Object.keys(t)){let r=t[e];if(r&&"object"===typeof r&&r["@reverse"]&&!r["@id"]){if("string"!==typeof r["@reverse"]||s.Util.isValidKeyword(r["@reverse"]))throw new n.ErrorCoded(`Invalid @reverse value, must be absolute IRI or blank node: '${r["@reverse"]}'`,n.ERROR_CODES.INVALID_IRI_MAPPING);r=t[e]=Object.assign(Object.assign({},r),{"@id":r["@reverse"]}),r["@id"]=r["@reverse"],s.Util.isPotentialKeyword(r["@reverse"])?delete r["@reverse"]:r["@reverse"]=!0}}return t}expandPrefixedTerms(t,e,r){const i=t.getContextRaw();for(const a of r||Object.keys(i))if(s.Util.EXPAND_KEYS_BLACKLIST.indexOf(a)<0&&!s.Util.isReservedInternalKeyword(a)){const r=i[a];if(s.Util.isPotentialKeyword(a)&&s.Util.ALIAS_DOMAIN_BLACKLIST.indexOf(a)>=0&&("@type"!==a||"object"===typeof i[a]&&!i[a]["@protected"]&&"@set"!==i[a]["@container"]))throw new n.ErrorCoded(`Keywords can not be aliased to something else.\nTried mapping ${a} to ${JSON.stringify(r)}`,n.ERROR_CODES.KEYWORD_REDEFINITION);if(s.Util.ALIAS_RANGE_BLACKLIST.indexOf(s.Util.getContextValueId(r))>=0)throw new n.ErrorCoded(`Aliasing to certain keywords is not allowed.\nTried mapping ${a} to ${JSON.stringify(r)}`,n.ERROR_CODES.INVALID_KEYWORD_ALIAS);if(r&&s.Util.isPotentialKeyword(s.Util.getContextValueId(r))&&!0===r["@prefix"])throw new n.ErrorCoded(`Tried to use keyword aliases as prefix: '${a}': '${JSON.stringify(r)}'`,n.ERROR_CODES.INVALID_TERM_DEFINITION);while(s.Util.isPrefixValue(i[a])){const r=i[a];let n=!1;if("string"===typeof r)i[a]=t.expandTerm(r,!0),n=n||r!==i[a];else{const o=r["@id"],l=r["@type"],d=!("@prefix"in r)||s.Util.isValidIri(a);if("@id"in r)void 0!==o&&null!==o&&"string"===typeof o&&(i[a]=Object.assign(Object.assign({},i[a]),{"@id":t.expandTerm(o,!0)}),n=n||o!==i[a]["@id"]);else if(!s.Util.isPotentialKeyword(a)&&d){const e=t.expandTerm(a,!0);e!==a&&(i[a]=Object.assign(Object.assign({},i[a]),{"@id":e}),n=!0)}if(l&&"string"===typeof l&&"@vocab"!==l&&(!r["@container"]||!r["@container"]["@type"])&&d){let r=t.expandTerm(l,!0);e&&l===r&&(r=t.expandTerm(l,!1)),r!==l&&(n=!0,i[a]=Object.assign(Object.assign({},i[a]),{"@type":r}))}}if(!n)break}}}normalize(t,{processingMode:e,normalizeLanguageTags:r}){if(r||1===e)for(const i of Object.keys(t))if("@language"===i&&"string"===typeof t[i])t[i]=t[i].toLowerCase();else{const e=t[i];if(e&&"object"===typeof e&&"string"===typeof e["@language"]){const r=e["@language"].toLowerCase();r!==e["@language"]&&(t[i]=Object.assign(Object.assign({},e),{"@language":r}))}}}containersToHash(t){for(const e of Object.keys(t)){const r=t[e];if(r&&"object"===typeof r)if("string"===typeof r["@container"])t[e]=Object.assign(Object.assign({},r),{"@container":{[r["@container"]]:!0}});else if(Array.isArray(r["@container"])){const i={};for(const t of r["@container"])i[t]=!0;t[e]=Object.assign(Object.assign({},r),{"@container":i})}}}applyScopedProtected(t,{processingMode:e},r){if(e&&e>=1.1&&t["@protected"]){for(const e of Object.keys(t))if(!s.Util.isReservedInternalKeyword(e)&&!s.Util.isPotentialKeyword(e)&&!s.Util.isTermProtected(t,e)){const i=t[e];i&&"object"===typeof i?"@protected"in t[e]||(t[e]=Object.assign(Object.assign({},t[e]),{"@protected":!0})):(t[e]={"@id":i,"@protected":!0},s.Util.isSimpleTermDefinitionPrefix(i,r)&&(t[e]=Object.assign(Object.assign({},t[e]),{"@prefix":!0})))}delete t["@protected"]}}validateKeywordRedefinitions(t,e,r,i){for(const a of null!==i&&void 0!==i?i:Object.keys(e))if(s.Util.isTermProtected(t,a)&&("string"===typeof e[a]?e[a]={"@id":e[a],"@protected":!0}:e[a]=Object.assign(Object.assign({},e[a]),{"@protected":!0}),!s.Util.deepEqual(t[a],e[a])))throw new n.ErrorCoded(`Attempted to override the protected keyword ${a} from ${JSON.stringify(s.Util.getContextValueId(t[a]))} to ${JSON.stringify(s.Util.getContextValueId(e[a]))}`,n.ERROR_CODES.PROTECTED_TERM_REDEFINITION)}validate(t,{processingMode:e}){for(const r of Object.keys(t)){if(s.Util.isReservedInternalKeyword(r))continue;if(""===r)throw new n.ErrorCoded(`The empty term is not allowed, got: '${r}': '${JSON.stringify(t[r])}'`,n.ERROR_CODES.INVALID_TERM_DEFINITION);const i=t[r],a=typeof i;if(s.Util.isPotentialKeyword(r)){switch(r.substr(1)){case"vocab":if(null!==i&&"string"!==a)throw new n.ErrorCoded(`Found an invalid @vocab IRI: ${i}`,n.ERROR_CODES.INVALID_VOCAB_MAPPING);break;case"base":if(null!==i&&"string"!==a)throw new n.ErrorCoded(`Found an invalid @base IRI: ${t[r]}`,n.ERROR_CODES.INVALID_BASE_IRI);break;case"language":null!==i&&l.validateLanguage(i,!0,n.ERROR_CODES.INVALID_DEFAULT_LANGUAGE);break;case"version":if(null!==i&&"number"!==a)throw new n.ErrorCoded(`Found an invalid @version number: ${i}`,n.ERROR_CODES.INVALID_VERSION_VALUE);break;case"direction":null!==i&&l.validateDirection(i,!0);break;case"propagate":if(1===e)throw new n.ErrorCoded(`Found an illegal @propagate keyword: ${i}`,n.ERROR_CODES.INVALID_CONTEXT_ENTRY);if(null!==i&&"boolean"!==a)throw new n.ErrorCoded(`Found an invalid @propagate value: ${i}`,n.ERROR_CODES.INVALID_PROPAGATE_VALUE);break}if(s.Util.isValidKeyword(r)&&s.Util.isValidKeyword(s.Util.getContextValueId(i)))throw new n.ErrorCoded(`Illegal keyword alias in term value, found: '${r}': '${s.Util.getContextValueId(i)}'`,n.ERROR_CODES.KEYWORD_REDEFINITION)}else if(null!==i)switch(a){case"string":if(s.Util.getPrefix(i,t)===r)throw new n.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${r}': '${JSON.stringify(i)}'`,n.ERROR_CODES.CYCLIC_IRI_MAPPING);if(s.Util.isValidIriWeak(r)){if("@type"===i)throw new n.ErrorCoded(`IRIs can not be mapped to @type, found: '${r}': '${i}'`,n.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIri(i)&&i!==new o.JsonLdContextNormalized(t).expandTerm(r))throw new n.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${r}': '${i}'`,n.ERROR_CODES.INVALID_IRI_MAPPING)}break;case"object":if(!s.Util.isCompactIri(r)&&!("@id"in i)&&("@id"===i["@type"]?!t["@base"]:!t["@vocab"]))throw new n.ErrorCoded(`Missing @id in context entry: '${r}': '${JSON.stringify(i)}'`,n.ERROR_CODES.INVALID_IRI_MAPPING);for(const d of Object.keys(i)){const c=i[d];if(c)switch(d){case"@id":if(s.Util.isValidKeyword(c)&&"@type"!==c&&"@id"!==c&&"@graph"!==c&&"@nest"!==c)throw new n.ErrorCoded(`Illegal keyword alias in term value, found: '${r}': '${JSON.stringify(i)}'`,n.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIriWeak(r)){if("@type"===c)throw new n.ErrorCoded(`IRIs can not be mapped to @type, found: '${r}': '${JSON.stringify(i)}'`,n.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIri(c)&&c!==new o.JsonLdContextNormalized(t).expandTerm(r))throw new n.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${r}': '${JSON.stringify(i)}'`,n.ERROR_CODES.INVALID_IRI_MAPPING)}if("string"!==typeof c)throw new n.ErrorCoded(`Detected non-string @id in context entry: '${r}': '${JSON.stringify(i)}'`,n.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.getPrefix(c,t)===r)throw new n.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${r}': '${JSON.stringify(i)}'`,n.ERROR_CODES.CYCLIC_IRI_MAPPING);break;case"@type":if("@type"===i["@container"]&&"@id"!==c&&"@vocab"!==c)throw new n.ErrorCoded(`@container: @type only allows @type: @id or @vocab, but got: '${r}': '${c}'`,n.ERROR_CODES.INVALID_TYPE_MAPPING);if("string"!==typeof c)throw new n.ErrorCoded(`The value of an '@type' must be a string, got '${JSON.stringify(a)}'`,n.ERROR_CODES.INVALID_TYPE_MAPPING);if("@id"!==c&&"@vocab"!==c&&(1===e||"@json"!==c)&&(1===e||"@none"!==c)&&("_"===c[0]||!s.Util.isValidIri(c)))throw new n.ErrorCoded(`A context @type must be an absolute IRI, found: '${r}': '${c}'`,n.ERROR_CODES.INVALID_TYPE_MAPPING);break;case"@reverse":if("string"===typeof c&&i["@id"]&&i["@id"]!==c)throw new n.ErrorCoded(`Found non-matching @id and @reverse term values in '${r}':'${c}' and '${i["@id"]}'`,n.ERROR_CODES.INVALID_REVERSE_PROPERTY);if("@nest"in i)throw new n.ErrorCoded(`@nest is not allowed in the reverse property '${r}'`,n.ERROR_CODES.INVALID_REVERSE_PROPERTY);break;case"@container":if(1===e&&(Object.keys(c).length>1||s.Util.CONTAINERS_1_0.indexOf(Object.keys(c)[0])<0))throw new n.ErrorCoded(`Invalid term @container for '${r}' ('${Object.keys(c)}') in 1.0, must be only one of ${s.Util.CONTAINERS_1_0.join(", ")}`,n.ERROR_CODES.INVALID_CONTAINER_MAPPING);for(const t of Object.keys(c)){if("@list"===t&&i["@reverse"])throw new n.ErrorCoded(`Term value can not be @container: @list and @reverse at the same time on '${r}'`,n.ERROR_CODES.INVALID_REVERSE_PROPERTY);if(s.Util.CONTAINERS.indexOf(t)<0)throw new n.ErrorCoded(`Invalid term @container for '${r}' ('${t}'), must be one of ${s.Util.CONTAINERS.join(", ")}`,n.ERROR_CODES.INVALID_CONTAINER_MAPPING)}break;case"@language":l.validateLanguage(c,!0,n.ERROR_CODES.INVALID_LANGUAGE_MAPPING);break;case"@direction":l.validateDirection(c,!0);break;case"@prefix":if(null!==c&&"boolean"!==typeof c)throw new n.ErrorCoded(`Found an invalid term @prefix boolean in: '${r}': '${JSON.stringify(i)}'`,n.ERROR_CODES.INVALID_PREFIX_VALUE);if(!("@id"in i)&&!s.Util.isValidIri(r))throw new n.ErrorCoded(`Invalid @prefix definition for '${r}' ('${JSON.stringify(i)}'`,n.ERROR_CODES.INVALID_TERM_DEFINITION);break;case"@index":if(1===e||!i["@container"]||!i["@container"]["@index"])throw new n.ErrorCoded(`Attempt to add illegal key to value object: '${r}': '${JSON.stringify(i)}'`,n.ERROR_CODES.INVALID_TERM_DEFINITION);break;case"@nest":if(s.Util.isPotentialKeyword(c)&&"@nest"!==c)throw new n.ErrorCoded(`Found an invalid term @nest value in: '${r}': '${JSON.stringify(i)}'`,n.ERROR_CODES.INVALID_NEST_VALUE)}}break;default:throw new n.ErrorCoded(`Found an invalid term value: '${r}': '${i}'`,n.ERROR_CODES.INVALID_TERM_DEFINITION)}}}applyBaseEntry(t,e,r){return"string"===typeof t||(r&&!("@base"in t)&&e.parentContext&&"object"===typeof e.parentContext&&"@base"in e.parentContext&&(t["@base"]=e.parentContext["@base"],e.parentContext["@__baseDocument"]&&(t["@__baseDocument"]=!0)),e.baseIRI&&!e.external&&("@base"in t?null===t["@base"]||"string"!==typeof t["@base"]||s.Util.isValidIri(t["@base"])||(t["@base"]=(0,i.resolve)(t["@base"],e.parentContext&&e.parentContext["@base"]||e.baseIRI)):(t["@base"]=e.baseIRI,t["@__baseDocument"]=!0))),t}normalizeContextIri(t,e){if(!s.Util.isValidIri(t))try{t=(0,i.resolve)(t,e)}catch(r){throw new Error(`Invalid context IRI: ${t}`)}return this.redirectSchemaOrgHttps&&t.startsWith("http://schema.org")&&(t="https://schema.org/"),t}async parseInnerContexts(t,e,r){for(const a of null!==r&&void 0!==r?r:Object.keys(t)){const r=t[a];if(r&&"object"===typeof r&&"@context"in r&&null!==r["@context"]&&!e.ignoreScopedContexts){if(this.validateContext)try{const i=Object.assign(Object.assign({},t),{[a]:Object.assign({},t[a])});delete i[a]["@context"],await this.parse(r["@context"],Object.assign(Object.assign({},e),{external:!1,parentContext:i,ignoreProtection:!0,ignoreRemoteScopedContexts:!0,ignoreScopedContexts:!0}))}catch(i){throw new n.ErrorCoded(i.message,n.ERROR_CODES.INVALID_SCOPED_CONTEXT)}t[a]=Object.assign(Object.assign({},r),{"@context":(await this.parse(r["@context"],Object.assign(Object.assign({},e),{external:!1,minimalProcessing:!0,ignoreRemoteScopedContexts:!0,parentContext:t}))).getContextRaw()})}}return t}async parse(t,e={},r={}){const{baseIRI:i,parentContext:a,external:d,processingMode:c=l.DEFAULT_PROCESSING_MODE,normalizeLanguageTags:u,ignoreProtection:h,minimalProcessing:f}=e,p=e.remoteContexts||{};if(Object.keys(p).length>=this.remoteContextsDepthLimit)throw new n.ErrorCoded("Detected an overflow in remote context inclusions: "+Object.keys(p),n.ERROR_CODES.CONTEXT_OVERFLOW);if(null===t||void 0===t){if(!h&&a&&s.Util.hasProtectedTerms(a))throw new n.ErrorCoded("Illegal context nullification when terms are protected",n.ERROR_CODES.INVALID_CONTEXT_NULLIFICATION);return new o.JsonLdContextNormalized(this.applyBaseEntry({},e,!1))}if("string"===typeof t){const r=this.normalizeContextIri(t,i),n=this.getOverriddenLoad(r,e);if(n)return new o.JsonLdContextNormalized(n);const a=await this.parse(await this.load(r),Object.assign(Object.assign({},e),{baseIRI:r,external:!0,remoteContexts:Object.assign(Object.assign({},p),{[r]:!0})}));return this.applyBaseEntry(a.getContextRaw(),e,!0),a}if(Array.isArray(t)){const r=[],n=await Promise.all(t.map(((t,n)=>{if("string"===typeof t){const a=this.normalizeContextIri(t,i);r[n]=a;const o=this.getOverriddenLoad(a,e);return o||this.load(a)}return t})));if(f)return new o.JsonLdContextNormalized(n);const s=await n.reduce(((t,i,a)=>t.then((t=>this.parse(i,Object.assign(Object.assign({},e),{baseIRI:r[a]||e.baseIRI,external:!!r[a]||e.external,parentContext:t.getContextRaw(),remoteContexts:r[a]?Object.assign(Object.assign({},p),{[r[a]]:!0}):p}),{skipValidation:a=1.1))throw new n.ErrorCoded("Context importing is not supported in JSON-LD 1.0",n.ERROR_CODES.INVALID_CONTEXT_ENTRY);if("string"!==typeof t["@import"])throw new n.ErrorCoded("An @import value must be a string, but got "+typeof t["@import"],n.ERROR_CODES.INVALID_IMPORT_VALUE);p=await this.loadImportContext(this.normalizeContextIri(t["@import"],i)),delete t["@import"]}this.applyScopedProtected(p,{processingMode:c},o.defaultExpandOptions);const g=Object.assign(p,t);this.idifyReverseTerms(g),this.normalize(g,{processingMode:c,normalizeLanguageTags:u}),this.applyScopedProtected(g,{processingMode:c},o.defaultExpandOptions);const y=Object.keys(g),E=[];if("object"===typeof a)for(const t in a)t in g?E.push(t):g[t]=a[t];await this.parseInnerContexts(g,e,y);const C=new o.JsonLdContextNormalized(g);return(g&&g["@version"]||l.DEFAULT_PROCESSING_MODE)>=1.1&&(t["@vocab"]&&"string"===typeof t["@vocab"]||""===t["@vocab"])&&(a&&"@vocab"in a&&t["@vocab"].indexOf(":")<0?g["@vocab"]=a["@vocab"]+t["@vocab"]:(s.Util.isCompactIri(t["@vocab"])||t["@vocab"]in g)&&(g["@vocab"]=C.expandTerm(t["@vocab"],!0))),this.expandPrefixedTerms(C,this.expandContentTypeToBase,y),!h&&a&&c>=1.1&&this.validateKeywordRedefinitions(a,g,o.defaultExpandOptions,E),this.validateContext&&!r.skipValidation&&this.validate(g,{processingMode:c}),C}throw new n.ErrorCoded(`Tried parsing a context that is not a string, array or object, but got ${t}`,n.ERROR_CODES.INVALID_LOCAL_CONTEXT)}async load(t){const e=this.documentCache[t];if(e)return e;let r;try{r=await this.documentLoader.load(t)}catch(i){throw new n.ErrorCoded(`Failed to load remote context ${t}: ${i.message}`,n.ERROR_CODES.LOADING_REMOTE_CONTEXT_FAILED)}if(!("@context"in r))throw new n.ErrorCoded(`Missing @context in remote context at ${t}`,n.ERROR_CODES.INVALID_REMOTE_CONTEXT);return this.documentCache[t]=r["@context"]}getOverriddenLoad(t,e){if(t in(e.remoteContexts||{})){if(e.ignoreRemoteScopedContexts)return t;throw new n.ErrorCoded("Detected a cyclic context inclusion of "+t,n.ERROR_CODES.RECURSIVE_CONTEXT_INCLUSION)}return null}async loadImportContext(t){let e=await this.load(t);if("object"!==typeof e||Array.isArray(e))throw new n.ErrorCoded("An imported context must be a single object: "+t,n.ERROR_CODES.INVALID_REMOTE_CONTEXT);if("@import"in e)throw new n.ErrorCoded("An imported context can not import another context: "+t,n.ERROR_CODES.INVALID_CONTEXT_ENTRY);return e=Object.assign({},e),this.containersToHash(e),e}}l.DEFAULT_PROCESSING_MODE=1.1,e.ContextParser=l},75094:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ERROR_CODES=e.ErrorCoded=void 0;class r extends Error{constructor(t,e){super(t),this.code=e}}e.ErrorCoded=r,function(t){t["COLLIDING_KEYWORDS"]="colliding keywords",t["CONFLICTING_INDEXES"]="conflicting indexes",t["CYCLIC_IRI_MAPPING"]="cyclic IRI mapping",t["INVALID_ID_VALUE"]="invalid @id value",t["INVALID_INDEX_VALUE"]="invalid @index value",t["INVALID_NEST_VALUE"]="invalid @nest value",t["INVALID_PREFIX_VALUE"]="invalid @prefix value",t["INVALID_PROPAGATE_VALUE"]="invalid @propagate value",t["INVALID_REVERSE_VALUE"]="invalid @reverse value",t["INVALID_IMPORT_VALUE"]="invalid @import value",t["INVALID_VERSION_VALUE"]="invalid @version value",t["INVALID_BASE_IRI"]="invalid base IRI",t["INVALID_CONTAINER_MAPPING"]="invalid container mapping",t["INVALID_CONTEXT_ENTRY"]="invalid context entry",t["INVALID_CONTEXT_NULLIFICATION"]="invalid context nullification",t["INVALID_DEFAULT_LANGUAGE"]="invalid default language",t["INVALID_INCLUDED_VALUE"]="invalid @included value",t["INVALID_IRI_MAPPING"]="invalid IRI mapping",t["INVALID_JSON_LITERAL"]="invalid JSON literal",t["INVALID_KEYWORD_ALIAS"]="invalid keyword alias",t["INVALID_LANGUAGE_MAP_VALUE"]="invalid language map value",t["INVALID_LANGUAGE_MAPPING"]="invalid language mapping",t["INVALID_LANGUAGE_TAGGED_STRING"]="invalid language-tagged string",t["INVALID_LANGUAGE_TAGGED_VALUE"]="invalid language-tagged value",t["INVALID_LOCAL_CONTEXT"]="invalid local context",t["INVALID_REMOTE_CONTEXT"]="invalid remote context",t["INVALID_REVERSE_PROPERTY"]="invalid reverse property",t["INVALID_REVERSE_PROPERTY_MAP"]="invalid reverse property map",t["INVALID_REVERSE_PROPERTY_VALUE"]="invalid reverse property value",t["INVALID_SCOPED_CONTEXT"]="invalid scoped context",t["INVALID_SCRIPT_ELEMENT"]="invalid script element",t["INVALID_SET_OR_LIST_OBJECT"]="invalid set or list object",t["INVALID_TERM_DEFINITION"]="invalid term definition",t["INVALID_TYPE_MAPPING"]="invalid type mapping",t["INVALID_TYPE_VALUE"]="invalid type value",t["INVALID_TYPED_VALUE"]="invalid typed value",t["INVALID_VALUE_OBJECT"]="invalid value object",t["INVALID_VALUE_OBJECT_VALUE"]="invalid value object value",t["INVALID_VOCAB_MAPPING"]="invalid vocab mapping",t["IRI_CONFUSED_WITH_PREFIX"]="IRI confused with prefix",t["KEYWORD_REDEFINITION"]="keyword redefinition",t["LOADING_DOCUMENT_FAILED"]="loading document failed",t["LOADING_REMOTE_CONTEXT_FAILED"]="loading remote context failed",t["MULTIPLE_CONTEXT_LINK_HEADERS"]="multiple context link headers",t["PROCESSING_MODE_CONFLICT"]="processing mode conflict",t["PROTECTED_TERM_REDEFINITION"]="protected term redefinition",t["CONTEXT_OVERFLOW"]="context overflow",t["INVALID_BASE_DIRECTION"]="invalid base direction",t["RECURSIVE_CONTEXT_INCLUSION"]="recursive context inclusion",t["INVALID_STREAMING_KEY_ORDER"]="invalid streaming key order",t["INVALID_EMBEDDED_NODE"]="invalid embedded node",t["INVALID_ANNOTATION"]="invalid annotation"}(e.ERROR_CODES||(e.ERROR_CODES={}))},60585:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FetchDocumentLoader=void 0,r(86547);const i=r(75094),n=r(2384),a=r(70742);class o{constructor(t){this.fetcher=t}async load(t){const e=await(this.fetcher||fetch)(t,{headers:new Headers({accept:"application/ld+json"})});if(e.ok&&e.headers){let r=e.headers.get("Content-Type");if(r){const t=r.indexOf(";");t>0&&(r=r.substr(0,t))}if("application/ld+json"===r)return await e.json();if(e.headers.has("Link")){let r;if(e.headers.forEach(((e,i)=>{if("link"===i){const i=(0,n.parse)(e);for(const e of i.get("type","application/ld+json"))if("alternate"===e.rel){if(r)throw new Error("Multiple JSON-LD alternate links were found on "+t);r=(0,a.resolve)(e.uri,t)}}})),r)return this.load(r)}throw new i.ErrorCoded(`Unsupported JSON-LD media type ${r}`,i.ERROR_CODES.LOADING_DOCUMENT_FAILED)}throw new Error(e.statusText||`Status code: ${e.status}`)}}e.FetchDocumentLoader=o},29146:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},45086:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},85215:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defaultExpandOptions=e.JsonLdContextNormalized=void 0;const i=r(70742),n=r(75094),a=r(94931);class o{constructor(t){this.contextRaw=t}getContextRaw(){return this.contextRaw}expandTerm(t,r,o=e.defaultExpandOptions){const s=this.contextRaw[t];if(null===s||s&&null===s["@id"])return null;let l=!0;if(s&&r){const e=a.Util.getContextValueId(s);if(e&&e!==t){if("string"===typeof e&&(a.Util.isValidIri(e)||a.Util.isValidKeyword(e)))return e;a.Util.isPotentialKeyword(e)||(l=!1)}}const d=a.Util.getPrefix(t,this.contextRaw),c=this.contextRaw["@vocab"],u=(!!c||""===c)&&c.indexOf(":")<0,h=this.contextRaw["@base"],f=a.Util.isPotentialKeyword(t);if(d){const e=this.contextRaw[d],r=a.Util.getContextValueId(e);if(r){if("string"!==typeof e&&o.allowPrefixForcing){if("_"!==r[0]&&!f&&!e["@prefix"]&&!(t in this.contextRaw))return t}else if(!a.Util.isSimpleTermDefinitionPrefix(r,o))return t;return r+t.substr(d.length+1)}}else{if(r&&(c||""===c||o.allowVocabRelativeToBase&&h&&u)&&!f&&!a.Util.isCompactIri(t)){if(u){if(o.allowVocabRelativeToBase)return(c||h?(0,i.resolve)(c,h):"")+t;throw new n.ErrorCoded(`Relative vocab expansion for term '${t}' with vocab '${c}' is not allowed.`,n.ERROR_CODES.INVALID_VOCAB_MAPPING)}return c+t}if(!r&&h&&!f&&!a.Util.isCompactIri(t))return(0,i.resolve)(t,h)}if(l)return t;throw new n.ErrorCoded(`Invalid IRI mapping found for context entry '${t}': '${JSON.stringify(s)}'`,n.ERROR_CODES.INVALID_IRI_MAPPING)}compactIri(t,e){if(e&&this.contextRaw["@vocab"]&&t.startsWith(this.contextRaw["@vocab"]))return t.substr(this.contextRaw["@vocab"].length);if(!e&&this.contextRaw["@base"]&&t.startsWith(this.contextRaw["@base"]))return t.substr(this.contextRaw["@base"].length);const r={prefix:"",suffix:t};for(const i in this.contextRaw){const n=this.contextRaw[i];if(n&&!a.Util.isPotentialKeyword(i)){const o=a.Util.getContextValueId(n);if(t.startsWith(o)){const n=t.substr(o.length);if(n)n.length0&&!(t&&"#"===t[0])}static getPrefix(t,e){if(t&&"#"===t[0])return null;const r=t.indexOf(":");if(r>=0){if(t.length>r+1&&"/"===t.charAt(r+1)&&"/"===t.charAt(r+2))return null;const i=t.substr(0,r);if("_"===i)return null;if(e[i])return i}return null}static getContextValueId(t){if(null===t||"string"===typeof t)return t;const e=t["@id"];return e||null}static isSimpleTermDefinitionPrefix(t,e){return!r.isPotentialKeyword(t)&&(e.allowPrefixNonGenDelims||"string"===typeof t&&("_"===t[0]||r.isPrefixIriEndingWithGenDelim(t)))}static isPotentialKeyword(t){return"string"===typeof t&&r.KEYWORD_REGEX.test(t)}static isPrefixIriEndingWithGenDelim(t){return r.ENDS_WITH_GEN_DELIM.test(t)}static isPrefixValue(t){return t&&("string"===typeof t||t&&"object"===typeof t)}static isValidIri(t){return Boolean(t&&r.IRI_REGEX.test(t))}static isValidIriWeak(t){return!!t&&":"!==t[0]&&r.IRI_REGEX_WEAK.test(t)}static isValidKeyword(t){return r.VALID_KEYWORDS[t]}static isTermProtected(t,e){const r=t[e];return!("string"===typeof r)&&r&&r["@protected"]}static hasProtectedTerms(t){for(const e of Object.keys(t))if(r.isTermProtected(t,e))return!0;return!1}static isReservedInternalKeyword(t){return t.startsWith("@__")}static deepEqual(t,e){const r=Object.keys(t),i=Object.keys(e);return r.length===i.length&&r.every((r=>{const i=t[r],n=e[r];return i===n||null!==i&&null!==n&&"object"===typeof i&&"object"===typeof n&&this.deepEqual(i,n)}))}}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"],e.Util=r},38690:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(52277),e)},4405:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContextTree=void 0;class r{constructor(){this.subTrees={}}getContext(t){if(t.length>0){const[e,...r]=t,i=this.subTrees[e];if(i){const t=i.getContext(r);if(t)return t.then((({context:t,depth:e})=>({context:t,depth:e+1})))}}return this.context?this.context.then((t=>({context:t,depth:0}))):null}setContext(t,e){if(0===t.length)this.context=e;else{const[i,...n]=t;let a=this.subTrees[i];a||(a=this.subTrees[i]=new r),a.setContext(n,e)}}removeContext(t){this.setContext(t,null)}}e.ContextTree=r},52277:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JsonLdParser=void 0;const i=r(54727),n=r(42395),a=r(88310),o=r(39693),s=r(64860),l=r(22386),d=r(76970),c=r(23809),u=r(55998),h=r(15517),f=r(70736),p=r(24910),g=r(62036),y=r(86454),E=r(33283),C=r(93099),w=r(10888),I=r(2384);class _ extends a.Transform{constructor(t){super({readableObjectMode:!0}),t=t||{},this.options=t,this.parsingContext=new C.ParsingContext(Object.assign({parser:this},t)),this.util=new w.Util({dataFactory:t.dataFactory,parsingContext:this.parsingContext}),this.jsonParser=new i,this.contextJobs=[],this.typeJobs=[],this.contextAwaitingJobs=[],this.lastDepth=0,this.lastKeys=[],this.lastOnValueJob=Promise.resolve(),this.attachJsonParserListeners(),this.on("end",(()=>{"undefined"!==typeof this.jsonParser.mode&&this.emit("error",new Error("Unclosed document"))}))}static fromHttpResponse(t,e,r,i){let a,o;if("application/ld+json"!==e){if("application/json"!==e&&!e.endsWith("+json"))throw new n.ErrorCoded(`Unsupported JSON-LD media type ${e}`,n.ERROR_CODES.LOADING_DOCUMENT_FAILED);if(r&&r.has("Link")&&r.forEach(((e,r)=>{if("link"===r){const r=I.parse(e);for(const e of r.get("rel","http://www.w3.org/ns/json-ld#context")){if(a)throw new n.ErrorCoded("Multiple JSON-LD context link headers were found on "+t,n.ERROR_CODES.MULTIPLE_CONTEXT_LINK_HEADERS);a=e.uri}}})),!a&&!(null===i||void 0===i?void 0:i.ignoreMissingContextLinkHeader))throw new n.ErrorCoded(`Missing context link header for media type ${e} on ${t}`,n.ERROR_CODES.LOADING_DOCUMENT_FAILED)}if(r&&r.has("Content-Type")){const t=r.get("Content-Type"),e=/; *profile=([^"]*)/.exec(t);e&&"http://www.w3.org/ns/json-ld#streaming"===e[1]&&(o=!0)}return new _(Object.assign({baseIRI:t,context:a,streamingProfile:o},i||{}))}import(t){const e=new a.PassThrough({readableObjectMode:!0});t.on("error",(t=>r.emit("error",t))),t.on("data",(t=>e.push(t))),t.on("end",(()=>e.push(null)));const r=e.pipe(new _(this.options));return r}_transform(t,e,r){this.jsonParser.write(t),this.lastOnValueJob.then((()=>r()),(t=>r(t)))}async newOnValueJob(t,e,r,i){let a=!0;if(i&&r1&&(c=this.parsingContext.validationStack[this.parsingContext.validationStack.length-1].property);for(let n=Math.max(1,this.parsingContext.validationStack.length-1);n=0?this.parsingContext.idStack[t-r-1]:[await this.util.getGraphContainerValue(e,t)];if(a)for(const e of a){this.parsingContext.emittedStack[t]=!0;for(const r of i)r.reverse?this.parsingContext.emitQuad(t,this.util.dataFactory.quad(r.object,r.predicate,n,e)):this.parsingContext.emitQuad(t,this.util.dataFactory.quad(n,r.predicate,r.object,e))}else{const r=this.parsingContext.getUnidentifiedGraphBufferSafe(t-await this.util.getDepthOffsetGraph(t,e)-1);for(const t of i)t.reverse?r.push({object:n,predicate:t.predicate,subject:t.object}):r.push({object:t.object,predicate:t.predicate,subject:n})}}this.parsingContext.unidentifiedValuesBuffer.splice(t,1),this.parsingContext.literalStack.splice(t,1),this.parsingContext.jsonLiteralStack.splice(t,1)}const n=this.parsingContext.unidentifiedGraphsBuffer[t];if(n){for(const e of r){const r=1!==t||"BlankNode"!==e.termType||this.parsingContext.topLevelProperties?e:this.util.getDefaultGraph();this.parsingContext.emittedStack[t]=!0;for(const e of n)this.parsingContext.emitQuad(t,this.util.dataFactory.quad(e.subject,e.predicate,e.object,r))}this.parsingContext.unidentifiedGraphsBuffer.splice(t,1)}}async validateKey(t,e,r){for(const i of _.ENTRY_HANDLERS)if(await i.validate(this.parsingContext,this.util,t,e,r))return{valid:!0,property:r||i.isPropertyHandler()};return{valid:!1,property:!1}}attachJsonParserListeners(){this.jsonParser.onValue=t=>{const e=this.jsonParser.stack.length,r=new Array(e+1).fill(0).map(((t,r)=>r===e?this.jsonParser.key:this.jsonParser.stack[r].key));if(!this.isParsingContextInner(e)){const i=()=>this.newOnValueJob(r,t,e,!0);if(this.parsingContext.streamingProfile||this.parsingContext.contextTree.getContext(r.slice(0,-1)))this.lastOnValueJob=this.lastOnValueJob.then(i);else if("@context"===r[e]){let t=this.contextJobs[e];t||(t=this.contextJobs[e]=[]),t.push(i)}else"@type"===r[e]||"number"===typeof r[e]&&"@type"===r[e-1]?this.typeJobs.push({job:i,keys:r.slice(0,r.length-1)}):this.contextAwaitingJobs.push({job:i,keys:r});this.parsingContext.streamingProfile||0!==e||(this.lastOnValueJob=this.lastOnValueJob.then((()=>this.executeBufferedJobs())))}},this.jsonParser.onError=t=>{this.emit("error",t)}}isParsingContextInner(t){for(let e=t;e>0;e--)if("@context"===this.jsonParser.stack[e-1].key)return!0;return!1}async executeBufferedJobs(){for(const t of this.contextJobs)if(t)for(const e of t)await e();this.parsingContext.unaliasedKeywordCacheStack.splice(0);for(const t of this.contextAwaitingJobs){if(this.typeJobs.length>0){const e=[],r=[];for(let a=0;at.keys.length-e.keys.length));for(const t of i)await t.job();const n=r.sort().reverse();for(const t of n)this.typeJobs.splice(t,1)}await t.job()}}}e.JsonLdParser=_,_.DEFAULT_PROCESSING_MODE="1.1",_.ENTRY_HANDLERS=[new o.EntryHandlerArrayValue,new c.EntryHandlerKeywordContext,new h.EntryHandlerKeywordId,new f.EntryHandlerKeywordIncluded,new u.EntryHandlerKeywordGraph,new p.EntryHandlerKeywordNest,new g.EntryHandlerKeywordType,new E.EntryHandlerKeywordValue,new s.EntryHandlerContainer,new y.EntryHandlerKeywordUnknownFallback,new d.EntryHandlerPredicate,new l.EntryHandlerInvalidFallback]},93099:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ParsingContext=void 0;const i=r(42395),n=r(75094),a=r(4405),o=r(52277);class s{constructor(t){this.contextParser=new i.ContextParser({documentLoader:t.documentLoader,skipValidation:t.skipContextValidation}),this.streamingProfile=!!t.streamingProfile,this.baseIRI=t.baseIRI,this.produceGeneralizedRdf=!!t.produceGeneralizedRdf,this.allowSubjectList=!!t.allowSubjectList,this.processingMode=t.processingMode||o.JsonLdParser.DEFAULT_PROCESSING_MODE,this.strictValues=!!t.strictValues,this.validateValueIndexes=!!t.validateValueIndexes,this.defaultGraph=t.defaultGraph,this.rdfDirection=t.rdfDirection,this.normalizeLanguageTags=t.normalizeLanguageTags,this.streamingProfileAllowOutOfOrderPlainType=t.streamingProfileAllowOutOfOrderPlainType,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.pendingContainerFlushBuffers=[],this.parser=t.parser,t.context?(this.rootContext=this.parseContext(t.context),this.rootContext.then((t=>this.validateContext(t)))):this.rootContext=Promise.resolve(new i.JsonLdContextNormalized(this.baseIRI?{"@base":this.baseIRI,"@__baseDocument":!0}:{}))}async parseContext(t,e,r){return this.contextParser.parse(t,{baseIRI:this.baseIRI,ignoreProtection:r,normalizeLanguageTags:this.normalizeLanguageTags,parentContext:e,processingMode:this.activeProcessingMode})}validateContext(t){const e=t.getContextRaw()["@version"];if(e){if(this.activeProcessingMode&&e>this.activeProcessingMode)throw new n.ErrorCoded(`Unsupported JSON-LD version '${e}' under active processing mode ${this.activeProcessingMode}.`,n.ERROR_CODES.PROCESSING_MODE_CONFLICT);if(this.activeProcessingMode&&e0&&!1===n.context.getContextRaw()["@propagate"]&&n.depth!==e&&!r);return 0===n.depth&&!1===n.context.getContextRaw()["@propagate"]&&n.depth!==e&&(n.context=new i.JsonLdContextNormalized({})),n}async newOnValueJob(t,e,r,i){await this.parser.newOnValueJob(t,e,r,i)}async handlePendingContainerFlushBuffers(){if(this.pendingContainerFlushBuffers.length>0){for(const t of this.pendingContainerFlushBuffers)await this.parser.flushBuffer(t.depth,t.keys),this.parser.flushStacks(t.depth);return this.pendingContainerFlushBuffers.splice(0,this.pendingContainerFlushBuffers.length),!0}return!1}emitQuad(t,e){1===t&&(this.topLevelProperties=!0),this.parser.push(e)}emitError(t){this.parser.emit("error",t)}emitContext(t){this.parser.emit("context",t)}getUnidentifiedValueBufferSafe(t){let e=this.unidentifiedValuesBuffer[t];return e||(e=[],this.unidentifiedValuesBuffer[t]=e),e}getUnidentifiedGraphBufferSafe(t){let e=this.unidentifiedGraphsBuffer[t];return e||(e=[],this.unidentifiedGraphsBuffer[t]=e),e}getExpandOptions(){return s.EXPAND_OPTIONS[this.activeProcessingMode]}shiftStack(t,e){const r=this.idStack[t+e];if(r&&(this.idStack[t]=r,this.emittedStack[t]=!0,delete this.idStack[t+e]),this.pendingContainerFlushBuffers.length)for(const i of this.pendingContainerFlushBuffers)i.depth>=t+e&&(i.depth-=e,i.keys.splice(t,e));this.unidentifiedValuesBuffer[t+e]&&(this.unidentifiedValuesBuffer[t]=this.unidentifiedValuesBuffer[t+e],delete this.unidentifiedValuesBuffer[t+e])}}e.ParsingContext=s,s.EXPAND_OPTIONS={1:{allowPrefixForcing:!1,allowPrefixNonGenDelims:!1,allowVocabRelativeToBase:!1},1.1:{allowPrefixForcing:!0,allowPrefixNonGenDelims:!1,allowVocabRelativeToBase:!0}}},10888:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Util=void 0;const i=r(42395),n=r(47793),a=r(64860),o=r(82341);class s{constructor(t){this.parsingContext=t.parsingContext,this.dataFactory=t.dataFactory||new n.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(t,e,r,i){const n=t.getContextRaw()[r];if(!n)return i;const a=n[e];return void 0===a?i:a}static getContextValueContainer(t,e){return s.getContextValue(t,"@container",e,{"@set":!0})}static getContextValueType(t,e){const r=s.getContextValue(t,"@type",e,null);return"@none"===r?null:r}static getContextValueLanguage(t,e){return s.getContextValue(t,"@language",e,t.getContextRaw()["@language"]||null)}static getContextValueDirection(t,e){return s.getContextValue(t,"@direction",e,t.getContextRaw()["@direction"]||null)}static isContextValueReverse(t,e){return!!s.getContextValue(t,"@reverse",e,null)}static getContextValueIndex(t,e){return s.getContextValue(t,"@index",e,t.getContextRaw()["@index"]||null)}static isPropertyReverse(t,e,r){return"@reverse"===r!==s.isContextValueReverse(t,e)}static isValidIri(t){return null!==t&&i.Util.isValidIri(t)}static isPrefixArray(t,e){if(t.length>e.length)return!1;for(let r=0;r1)throw new i.ErrorCoded(`Found illegal neighbouring entries next to @set for key: '${e}'`,i.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT);return[]}if("@list"in r){if(Object.keys(r).length>1)throw new i.ErrorCoded(`Found illegal neighbouring entries next to @list for key: '${e}'`,i.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT);const t=r["@list"];return Array.isArray(t)?0===t.length?[this.rdfNil]:this.parsingContext.idStack[n+1]||[]:await this.valueToTerm(await this.parsingContext.getContext(a),e,t,n-1,a.slice(0,-1))}if("@reverse"in r&&"boolean"===typeof r["@reverse"])return[];if("@graph"in s.getContextValueContainer(await this.parsingContext.getContext(a),e)){const t=this.parsingContext.graphContainerTermStack[n+1];return t?Object.values(t):[this.dataFactory.blankNode()]}return"@id"in r?(Object.keys(r).length>1&&(t=await this.parsingContext.getContext(a,0)),"@context"in r&&(t=await this.parsingContext.parseContext(r["@context"],t.getContextRaw())),"@vocab"===r["@type"]?this.nullableTermToArray(this.createVocabOrBaseTerm(t,r["@id"])):this.nullableTermToArray(this.resourceToTerm(t,r["@id"]))):this.parsingContext.emittedStack[n+1]||r&&"object"===typeof r&&0===Object.keys(r).length?this.parsingContext.idStack[n+1]||(this.parsingContext.idStack[n+1]=[this.dataFactory.blankNode()]):[];case"string":return this.nullableTermToArray(this.stringValueToTerm(n,await this.getContextSelfOrPropertyScoped(t,e),e,r,null));case"boolean":return this.nullableTermToArray(this.stringValueToTerm(n,await this.getContextSelfOrPropertyScoped(t,e),e,Boolean(r).toString(),this.dataFactory.namedNode(s.XSD_BOOLEAN)));case"number":return this.nullableTermToArray(this.stringValueToTerm(n,await this.getContextSelfOrPropertyScoped(t,e),e,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(t,e){const r=t.getContextRaw()[e];return r&&"object"===typeof r&&"@context"in r&&(t=await this.parsingContext.parseContext(r,t.getContextRaw(),!0)),t}nullableTermToArray(t){return t?[t]:[]}predicateToTerm(t,e){const r=t.expandTerm(e,!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 i.ErrorCoded(`Invalid predicate IRI: ${r}`,i.ERROR_CODES.INVALID_IRI_MAPPING)),null):null:null}resourceToTerm(t,e){if(e.startsWith("_:"))return this.dataFactory.blankNode(e.substr(2));const r=t.expandTerm(e,!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(t,e){if(e.startsWith("_:"))return this.dataFactory.blankNode(e.substr(2));const r=this.parsingContext.getExpandOptions();let i=t.expandTerm(e,!0,r);if(i===e&&(i=t.expandTerm(e,!1,r)),!s.isValidIri(i)){if(!i||!this.parsingContext.strictValues||i.startsWith("@"))return null;this.parsingContext.emitError(new Error(`Invalid term IRI: ${i}`))}return this.dataFactory.namedNode(i)}intToString(t,e){if("number"===typeof t){if(Number.isFinite(t)){const r=t%1===0;return!r||e&&e.value===s.XSD_DOUBLE?t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"):Number(t).toString()}return t>0?"INF":"-INF"}return t}stringValueToTerm(t,e,r,i,n){const a=s.getContextValueType(e,r);if(a)if("@id"===a){if(!n)return this.resourceToTerm(e,this.intToString(i,n))}else if("@vocab"===a){if(!n)return this.createVocabOrBaseTerm(e,this.intToString(i,n))}else n=this.dataFactory.namedNode(a);if(!n){const a=s.getContextValueLanguage(e,r),o=s.getContextValueDirection(e,r);return o&&this.parsingContext.rdfDirection?this.createLanguageDirectionLiteral(t,this.intToString(i,n),a,o):this.dataFactory.literal(this.intToString(i,n),a)}return this.dataFactory.literal(this.intToString(i,n),n)}createLanguageDirectionLiteral(t,e,r,i){if("i18n-datatype"===this.parsingContext.rdfDirection)return r||(r=""),this.dataFactory.literal(e,this.dataFactory.namedNode(`https://www.w3.org/ns/i18n#${r}_${i}`));{const n=this.dataFactory.blankNode(),a=this.getDefaultGraph();return this.parsingContext.emitQuad(t,this.dataFactory.quad(n,this.dataFactory.namedNode(s.RDF+"value"),this.dataFactory.literal(e),a)),r&&this.parsingContext.emitQuad(t,this.dataFactory.quad(n,this.dataFactory.namedNode(s.RDF+"language"),this.dataFactory.literal(r),a)),this.parsingContext.emitQuad(t,this.dataFactory.quad(n,this.dataFactory.namedNode(s.RDF+"direction"),this.dataFactory.literal(i),a)),n}}valueToJsonString(t){return o(t)}async unaliasKeyword(t,e,r,n,a){if(Number.isInteger(t))return t;if(!n){const t=this.parsingContext.unaliasedKeywordCacheStack[r];if(t)return t}if(!i.Util.isPotentialKeyword(t)){a=a||await this.parsingContext.getContext(e);let r=a.getContextRaw()[t];r&&"object"===typeof r&&(r=r["@id"]),i.Util.isValidKeyword(r)&&(t=r)}return n?t:this.parsingContext.unaliasedKeywordCacheStack[r]=t}async unaliasKeywordParent(t,e){return await this.unaliasKeyword(e>0&&t[e-1],t,e-1)}async unaliasKeywords(t,e,r,i){const n={};for(const a in t)n[await this.unaliasKeyword(a,e,r+1,!0,i)]=t[a];return n}isLiteral(t){for(let e=t;e>=0;e--)if(this.parsingContext.literalStack[e]||this.parsingContext.jsonLiteralStack[e])return!0;return!1}async getDepthOffsetGraph(t,e){for(let r=t-1;r>0;r--)if("@graph"===await this.unaliasKeyword(e[r],e,r)){const i=(await a.EntryHandlerContainer.getContainerHandler(this.parsingContext,e,r)).containers;return a.EntryHandlerContainer.isComplexGraphContainer(i)?-1:t-r-1}return-1}validateReverseSubject(t){if("Literal"===t.termType)throw new i.ErrorCoded(`Found illegal literal in subject position: ${t.value}`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY_VALUE)}getDefaultGraph(){return this.parsingContext.defaultGraph||this.dataFactory.defaultGraph()}async getGraphContainerValue(t,e){let r=this.getDefaultGraph();const{containers:i,depth:n}=await a.EntryHandlerContainer.getContainerHandler(this.parsingContext,t,e);if("@graph"in i){const e=a.EntryHandlerContainer.getContainerGraphIndex(i,n,t),o=this.parsingContext.graphContainerTermStack[n];if(r=o?o[e]:null,!r){let a=null;if("@id"in i){const e=await this.getContainerKey(t[n],t,n);null!==e&&(a=await this.resourceToTerm(await this.parsingContext.getContext(t),e))}a||(a=this.dataFactory.blankNode()),this.parsingContext.graphContainerTermStack[n]||(this.parsingContext.graphContainerTermStack[n]={}),r=this.parsingContext.graphContainerTermStack[n][e]=a}}return r}async getPropertiesDepth(t,e){let r=e;for(let i=e-1;i>0;i--)if("number"!==typeof t[i]){const e=await this.unaliasKeyword(t[i],t,i);if("@reverse"===e)return i;if("@nest"!==e)return r;r=i}return r}async getContainerKey(t,e,r){const i=await this.unaliasKeyword(t,e,r);return"@none"===i?null:i}}e.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#"},7986:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerHandlerIdentifier=void 0;class r{canCombineWithGraph(){return!0}async handle(t,e,r,i,n,a){let o;if(e.emittedStack[a+1]&&e.idStack[a+1])o=e.idStack[a+1][0];else{const t=await r.getContainerKey(i[a],i,a),n=null!==t?await r.resourceToTerm(await e.getContext(i),i[a]):r.dataFactory.blankNode();if(!n)return void(e.emittedStack[a]=!1);o=n,e.idStack[a+1]=[o]}let s=e.idStack[a];s||(s=e.idStack[a]=[]),s.some((t=>t.equals(o)))||s.push(o),await e.handlePendingContainerFlushBuffers()||(e.emittedStack[a]=!1)}}e.ContainerHandlerIdentifier=r},71977:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerHandlerIndex=void 0;const i=r(42395),n=r(76970),a=r(10888);class o{canCombineWithGraph(){return!0}async handle(t,e,r,o,s,l){if(!Array.isArray(s)){const d="@graph"in t,c=await e.getContext(o),u=o[l-1],h=a.Util.getContextValueIndex(c,u);if(h){if(i.Util.isPotentialKeyword(h))throw new i.ErrorCoded(`Keywords can not be used as @index value, got: ${h}`,i.ERROR_CODES.INVALID_TERM_DEFINITION);if("string"!==typeof h)throw new i.ErrorCoded(`@index values must be strings, got: ${h}`,i.ERROR_CODES.INVALID_TERM_DEFINITION);if("object"!==typeof s){if("@id"!==a.Util.getContextValueType(c,u))throw new i.ErrorCoded(`Property-based index containers require nodes as values or strings with @type: @id, but got: ${s}`,i.ERROR_CODES.INVALID_VALUE_OBJECT);const t=r.resourceToTerm(c,s);t&&(e.idStack[l+1]=[t])}const t=r.createVocabOrBaseTerm(c,h);if(t){const i=await r.valueToTerm(c,h,await r.getContainerKey(o[l],o,l),l,o);if(d){const n=await r.getGraphContainerValue(o,l+1);for(const a of i)e.emitQuad(l,r.dataFactory.quad(n,t,a,r.getDefaultGraph()))}else for(const a of i)await n.EntryHandlerPredicate.handlePredicateObject(e,r,o,l+1,t,a,!1)}}const f=d?2:1;await e.newOnValueJob(o.slice(0,o.length-f),s,l-f,!0),await e.handlePendingContainerFlushBuffers()}e.emittedStack[l]=!1}}e.ContainerHandlerIndex=o},63847:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerHandlerLanguage=void 0;const i=r(42395);class n{canCombineWithGraph(){return!1}async handle(t,e,r,n,a,o){const s=await r.getContainerKey(n[o],n,o);if(Array.isArray(a))a=a.map((t=>({"@value":t,"@language":s})));else{if("string"!==typeof a)throw new i.ErrorCoded(`Got invalid language map value, got '${JSON.stringify(a)}', but expected string`,i.ERROR_CODES.INVALID_LANGUAGE_MAP_VALUE);a={"@value":a,"@language":s}}await e.newOnValueJob(n.slice(0,n.length-1),a,o-1,!0),e.emittedStack[o]=!1}}e.ContainerHandlerLanguage=n},47229:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerHandlerType=void 0;const i=r(76970),n=r(10888);class a{canCombineWithGraph(){return!1}async handle(t,e,r,a,o,s){if(!Array.isArray(o)){if("string"===typeof o){const t=await e.getContext(a),i=n.Util.getContextValueType(t,a[s-1]),l="@vocab"===i?await r.createVocabOrBaseTerm(t,o):await r.resourceToTerm(t,o);if(l){const t={"@id":"NamedNode"===l.termType?l.value:o};await e.newOnValueJob(a.slice(0,a.length-1),t,s-1,!0),e.idStack[s+1]=[l]}}else{const t=!!e.idStack[s+1];t||delete e.idStack[s],await e.newOnValueJob(a.slice(0,a.length-1),o,s-1,!0),t||(e.idStack[s+1]=e.idStack[s])}const t=await r.getContainerKey(a[s],a,s),l=null!==t?r.createVocabOrBaseTerm(await e.getContext(a),t):null;l&&await i.EntryHandlerPredicate.handlePredicateObject(e,r,a,s+1,r.rdfType,l,!1),await e.handlePendingContainerFlushBuffers()}e.emittedStack[s]=!1}}e.ContainerHandlerType=a},39693:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EntryHandlerArrayValue=void 0;const i=r(10888);class n{isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(t,e,r,i,n){return this.test(t,e,null,r,i)}async test(t,e,r,i,n){return"number"===typeof i[n]}async handle(t,e,r,n,a,o){let s=await e.unaliasKeywordParent(n,o);if("@list"===s){let r=null,i=0;for(let t=o-2;t>0;t--){const e=n[t];if("string"===typeof e||"number"===typeof e){i=t,r=e;break}}if(null!==r){const s=await e.valueToTerm(await t.getContext(n),r,a,o,n);for(const r of s)await this.handleListElement(t,e,r,a,o,n.slice(0,i),i);0===s.length&&await this.handleListElement(t,e,null,a,o,n.slice(0,i),i)}}else if("@set"===s)await t.newOnValueJob(n.slice(0,-2),a,o-2,!1);else if(void 0!==s&&"@type"!==s){for(let t=o-1;t>0;t--)if("number"!==typeof n[t]){s=await e.unaliasKeyword(n[t],n,t);break}const r=await t.getContext(n.slice(0,-1));if("@list"in i.Util.getContextValueContainer(r,s)){t.emittedStack[o+1]=!0;const r=await e.valueToTerm(await t.getContext(n),s,a,o,n);for(const i of r)await this.handleListElement(t,e,i,a,o,n.slice(0,-1),o-1);0===r.length&&await this.handleListElement(t,e,null,a,o,n.slice(0,-1),o-1)}else t.shiftStack(o,1),await t.newOnValueJob(n.slice(0,-1),a,o-1,!1),t.contextTree.removeContext(n.slice(0,-1))}}async handleListElement(t,e,r,i,n,a,o){let s=t.listPointerStack[n];if(null!==i&&null!==(await e.unaliasKeywords(i,a,n))["@value"]){if(s&&s.value){const r=e.dataFactory.blankNode();t.emitQuad(n,e.dataFactory.quad(s.value,e.rdfRest,r,e.getDefaultGraph())),s.value=r}else{const t=e.dataFactory.blankNode();s={value:t,listRootDepth:o,listId:t}}r&&t.emitQuad(n,e.dataFactory.quad(s.value,e.rdfFirst,r,e.getDefaultGraph()))}else s||(s={listRootDepth:o,listId:e.rdfNil});t.listPointerStack[n]=s}}e.EntryHandlerArrayValue=n},64860:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EntryHandlerContainer=void 0;const i=r(7986),n=r(71977),a=r(63847),o=r(47229),s=r(10888);class l{static isSimpleGraphContainer(t){return"@graph"in t&&("@set"in t&&2===Object.keys(t).length||1===Object.keys(t).length)}static isComplexGraphContainer(t){return"@graph"in t&&("@set"in t&&Object.keys(t).length>2||!("@set"in t)&&Object.keys(t).length>1)}static getContainerGraphIndex(t,e,r){let i=l.isSimpleGraphContainer(t),n="";for(let a=e;a=0;o--)if("number"!==typeof e[o]){const t=s.Util.getContextValue(a,"@container",e[o],!1);if(t&&l.isSimpleGraphContainer(t))return{containers:t,depth:o+1,fallback:!1};const r=s.Util.getContextValue(a,"@container",e[o-1],!1);if(r){const t="@graph"in r;for(const e in l.CONTAINER_HANDLERS)if(r[e])return t?l.CONTAINER_HANDLERS[e].canCombineWithGraph()?{containers:r,depth:o,fallback:!1}:i:n?i:{containers:r,depth:o,fallback:!1};return i}if(n)return i;n=!0}return i}static async isBufferableContainerHandler(t,e,r){const i=await l.getContainerHandler(t,e,r);return!i.fallback&&!("@graph"in i.containers)}isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(t,e,r,i,n){return!!await this.test(t,e,null,r,i)}async test(t,e,r,i,n){const a=s.Util.getContextValueContainer(await t.getContext(i,2),i[n-1]);for(const o in l.CONTAINER_HANDLERS)if(a[o])return{containers:a,handler:l.CONTAINER_HANDLERS[o]};return null}async handle(t,e,r,i,n,a,o){return o.handler.handle(o.containers,t,e,i,n,a)}}e.EntryHandlerContainer=l,l.CONTAINER_HANDLERS={"@id":new i.ContainerHandlerIdentifier,"@index":new n.ContainerHandlerIndex,"@language":new a.ContainerHandlerLanguage,"@type":new o.ContainerHandlerType}},22386:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EntryHandlerInvalidFallback=void 0;class r{isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(t,e,r,i,n){return!1}async test(t,e,r,i,n){return!0}async handle(t,e,r,i,n,a){t.emittedStack[a]=!1}}e.EntryHandlerInvalidFallback=r},76970:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EntryHandlerPredicate=void 0;const i=r(42395),n=r(10888);class a{static async handlePredicateObject(t,e,r,i,n,a,o){const s=await e.getPropertiesDepth(r,i),l=await e.getDepthOffsetGraph(i,r),d=i-l,c=t.idStack[s];if(c)for(const u of c){const c=l>=0;if(c){const r=t.idStack[d-1];if(r)for(const s of r)o?(e.validateReverseSubject(a),t.emitQuad(i,e.dataFactory.quad(a,n,u,s))):t.emitQuad(i,e.dataFactory.quad(u,n,a,s));else o?(e.validateReverseSubject(a),t.getUnidentifiedGraphBufferSafe(d-1).push({subject:a,predicate:n,object:u})):t.getUnidentifiedGraphBufferSafe(d-1).push({subject:u,predicate:n,object:a})}else{const l=await e.getGraphContainerValue(r,s);o?(e.validateReverseSubject(a),t.emitQuad(i,e.dataFactory.quad(a,n,u,l))):t.emitQuad(i,e.dataFactory.quad(u,n,a,l))}}else o&&e.validateReverseSubject(a),t.getUnidentifiedValueBufferSafe(s).push({predicate:n,object:a,reverse:o})}isPropertyHandler(){return!0}isStackProcessor(){return!0}async validate(t,e,r,i,a){const o=r[i];if(o){const a=await t.getContext(r);if(!t.jsonLiteralStack[i]&&await e.predicateToTerm(a,r[i]))return"@json"===n.Util.getContextValueType(a,o)&&(t.jsonLiteralStack[i+1]=!0),!0}return!1}async test(t,e,r,i,n){return i[n]}async handle(t,e,r,o,s,l,d){const c=o[l],u=await t.getContext(o),h=await e.predicateToTerm(u,r);if(h){const d=await e.valueToTerm(u,r,s,l,o);if(d.length)for(let f of d){const d=n.Util.isPropertyReverse(u,c,await e.unaliasKeywordParent(o,l));if(s){const a="@list"in n.Util.getContextValueContainer(u,r);if(a||s["@list"]){if((a&&!Array.isArray(s)&&!s["@list"]||s["@list"]&&!Array.isArray(s["@list"]))&&f!==e.rdfNil){const r=e.dataFactory.blankNode();t.emitQuad(l,e.dataFactory.quad(r,e.rdfRest,e.rdfNil,e.getDefaultGraph())),t.emitQuad(l,e.dataFactory.quad(r,e.rdfFirst,f,e.getDefaultGraph())),f=r}if(d&&!t.allowSubjectList)throw new i.ErrorCoded(`Found illegal list value in subject position at ${r}`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY_VALUE)}}await a.handlePredicateObject(t,e,o,l,h,f,d)}}}}e.EntryHandlerPredicate=a},1548:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EntryHandlerKeyword=void 0;class r{constructor(t){this.keyword=t}isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(t,e,r,i,n){return!1}async test(t,e,r,i,n){return r===this.keyword}}e.EntryHandlerKeyword=r},23809:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EntryHandlerKeywordContext=void 0;const i=r(42395),n=r(1548);class a extends n.EntryHandlerKeyword{constructor(){super("@context")}isStackProcessor(){return!1}async handle(t,e,r,n,a,o){t.streamingProfile&&(t.processingStack[o]||t.processingType[o]||void 0!==t.idStack[o])&&t.emitError(new i.ErrorCoded("Found an out-of-order context, while streaming is enabled.(disable `streamingProfile`)",i.ERROR_CODES.INVALID_STREAMING_KEY_ORDER));const s=t.getContext(n),l=t.parseContext(a,(await s).getContextRaw());t.contextTree.setContext(n.slice(0,-1),l),t.emitContext(a),await t.validateContext(await l)}}e.EntryHandlerKeywordContext=a},55998:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EntryHandlerKeywordGraph=void 0;const i=r(1548);class n extends i.EntryHandlerKeyword{constructor(){super("@graph")}async handle(t,e,r,i,n,a){t.graphStack[a+1]=!0}}e.EntryHandlerKeywordGraph=n},15517:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EntryHandlerKeywordId=void 0;const i=r(42395),n=r(1548);class a extends n.EntryHandlerKeyword{constructor(){super("@id")}isStackProcessor(){return!1}async handle(t,e,r,n,a,o){"string"!==typeof a&&t.emitError(new i.ErrorCoded(`Found illegal @id '${a}'`,i.ERROR_CODES.INVALID_ID_VALUE));const s=await e.getPropertiesDepth(n,o);void 0!==t.idStack[s]&&(t.idStack[s][0].listHead?t.emitError(new i.ErrorCoded(`Found illegal neighbouring entries next to @list for key: '${n[o-1]}'`,i.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT)):t.emitError(new i.ErrorCoded(`Found duplicate @ids '${t.idStack[s][0].value}' and '${a}'`,i.ERROR_CODES.COLLIDING_KEYWORDS))),t.idStack[s]=e.nullableTermToArray(await e.resourceToTerm(await t.getContext(n),a))}}e.EntryHandlerKeywordId=a},70736:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EntryHandlerKeywordIncluded=void 0;const i=r(42395),n=r(1548);class a extends n.EntryHandlerKeyword{constructor(){super("@included")}async handle(t,e,r,n,a,o){"object"!==typeof a&&t.emitError(new i.ErrorCoded(`Found illegal @included '${a}'`,i.ERROR_CODES.INVALID_INCLUDED_VALUE));const s=await e.unaliasKeywords(a,n,o,await t.getContext(n));"@value"in s&&t.emitError(new i.ErrorCoded(`Found an illegal @included @value node '${JSON.stringify(a)}'`,i.ERROR_CODES.INVALID_INCLUDED_VALUE)),"@list"in s&&t.emitError(new i.ErrorCoded(`Found an illegal @included @list node '${JSON.stringify(a)}'`,i.ERROR_CODES.INVALID_INCLUDED_VALUE)),t.emittedStack[o]=!1}}e.EntryHandlerKeywordIncluded=a},24910:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EntryHandlerKeywordNest=void 0;const i=r(42395),n=r(1548);class a extends n.EntryHandlerKeyword{constructor(){super("@nest")}async handle(t,e,r,n,a,o){"object"!==typeof a&&t.emitError(new i.ErrorCoded(`Found invalid @nest entry for '${r}': '${a}'`,i.ERROR_CODES.INVALID_NEST_VALUE)),"@value"in await e.unaliasKeywords(a,n,o,await t.getContext(n))&&t.emitError(new i.ErrorCoded(`Found an invalid @value node for '${r}'`,i.ERROR_CODES.INVALID_NEST_VALUE)),t.emittedStack[o]=!1}}e.EntryHandlerKeywordNest=a},62036:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EntryHandlerKeywordType=void 0;const i=r(42395),n=r(10888),a=r(76970),o=r(1548);class s extends o.EntryHandlerKeyword{constructor(){super("@type")}isStackProcessor(){return!1}async handle(t,e,r,o,s,l){const d=o[l],c=await t.getContext(o),u=e.rdfType,h=n.Util.isPropertyReverse(c,d,await e.unaliasKeywordParent(o,l)),f=Array.isArray(s)?s:[s];for(const n of f){"string"!==typeof n&&t.emitError(new i.ErrorCoded(`Found illegal @type '${n}'`,i.ERROR_CODES.INVALID_TYPE_VALUE));const r=e.createVocabOrBaseTerm(c,n);r&&await a.EntryHandlerPredicate.handlePredicateObject(t,e,o,l,u,r,h)}let p=Promise.resolve(c),g=!1;for(const i of f.sort()){const e=n.Util.getContextValue(c,"@context",i,null);e&&(g=!0,p=p.then((r=>t.parseContext(e,r.getContextRaw()))))}!t.streamingProfile||!g&&t.streamingProfileAllowOutOfOrderPlainType||!t.processingStack[l]&&!t.idStack[l]||t.emitError(new i.ErrorCoded("Found an out-of-order type-scoped context, while streaming is enabled.(disable `streamingProfile`)",i.ERROR_CODES.INVALID_STREAMING_KEY_ORDER)),g&&(p=p.then((t=>("@propagate"in t.getContextRaw()||(t.getContextRaw()["@propagate"]=!1),!1===t.getContextRaw()["@propagate"]&&(t.getContextRaw()["@__propagateFallback"]=c.getContextRaw()),t))),t.contextTree.setContext(o.slice(0,o.length-1),p)),t.processingType[l]=!0}}e.EntryHandlerKeywordType=s},86454:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EntryHandlerKeywordUnknownFallback=void 0;const i=r(42395);class n{isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(t,e,r,n,a){const o=await e.unaliasKeyword(r[n],r,n);return!!i.Util.isPotentialKeyword(o)&&!(!a&&"@list"===o)}async test(t,e,r,n,a){return i.Util.isPotentialKeyword(r)}async handle(t,e,r,a,o,s){const l=n.VALID_KEYWORDS_TYPES[r];void 0!==l?l&&typeof o!==l.type&&t.emitError(new i.ErrorCoded(`Invalid value type for '${r}' with value '${o}'`,l.errorCode)):t.strictValues&&t.emitError(new Error(`Unknown keyword '${r}' with value '${o}'`)),t.emittedStack[s]=!1}}e.EntryHandlerKeywordUnknownFallback=n,n.VALID_KEYWORDS_TYPES={"@index":{type:"string",errorCode:i.ERROR_CODES.INVALID_INDEX_VALUE},"@list":null,"@reverse":{type:"object",errorCode:i.ERROR_CODES.INVALID_REVERSE_VALUE},"@set":null,"@value":null}},33283:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EntryHandlerKeywordValue=void 0;const i=r(1548);class n extends i.EntryHandlerKeyword{constructor(){super("@value")}async validate(t,e,r,i,n){const a=r[i];return a&&!t.literalStack[i]&&await this.test(t,e,a,r,i)&&(t.literalStack[i]=!0),super.validate(t,e,r,i,n)}async test(t,e,r,i,n){return"@value"===await e.unaliasKeyword(i[n],i.slice(0,i.length-1),n-1,!0)}async handle(t,e,r,i,n,a){t.literalStack[a]=!0,delete t.unidentifiedValuesBuffer[a],delete t.unidentifiedGraphsBuffer[a],t.emittedStack[a]=!1}}e.EntryHandlerKeywordValue=n},54727:function(t,e,r){var i=r(48287)["Buffer"],n={},a=n.LEFT_BRACE=1,o=n.RIGHT_BRACE=2,s=n.LEFT_BRACKET=3,l=n.RIGHT_BRACKET=4,d=n.COLON=5,c=n.COMMA=6,u=n.TRUE=7,h=n.FALSE=8,f=n.NULL=9,p=n.STRING=10,g=n.NUMBER=11,y=n.START=17,E=n.STOP=18,C=n.TRUE1=33,w=n.TRUE2=34,I=n.TRUE3=35,_=n.FALSE1=49,O=n.FALSE2=50,R=n.FALSE3=51,x=n.FALSE4=52,b=n.NULL1=65,m=n.NULL2=66,S=n.NULL3=67,v=n.NUMBER1=81,T=n.NUMBER3=83,N=n.STRING1=97,D=n.STRING2=98,A=n.STRING3=99,L=n.STRING4=100,P=n.STRING5=101,V=n.STRING6=102,k=n.VALUE=113,j=n.KEY=114,U=n.OBJECT=129,F=n.ARRAY=130,G="\\".charCodeAt(0),B="/".charCodeAt(0),M="\b".charCodeAt(0),K="\f".charCodeAt(0),$="\n".charCodeAt(0),J="\r".charCodeAt(0),H="\t".charCodeAt(0),X=65536;function q(){this.tState=y,this.value=void 0,this.string=void 0,this.stringBuffer=i.alloc?i.alloc(X):new i(X),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=k,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new i(2),3:new i(3),4:new i(4)},this.offset=-1}q.toknam=function(t){for(var e=Object.keys(n),r=0,i=e.length;r=X&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=t},Y.appendStringBuf=function(t,e,r){var i=t.length;"number"===typeof e&&(i="number"===typeof r?r<0?t.length-e+r:r-e:t.length-e),i<0&&(i=0),this.stringBufferOffset+i>X&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),t.copy(this.stringBuffer,this.stringBufferOffset,e,r),this.stringBufferOffset+=i},Y.write=function(t){var e;"string"===typeof t&&(t=new i(t));for(var r=0,n=t.length;r=48&&e<64)this.string=String.fromCharCode(e),this.tState=T;else if(32!==e&&9!==e&&10!==e&&13!==e)return this.charError(t,r)}else if(this.tState===N)if(e=t[r],this.bytes_remaining>0){for(var E=0;E=128){if(e<=193||e>244)return this.onError(new Error("Invalid UTF-8 character at position "+r+" in state "+q.toknam(this.tState)));if(e>=194&&e<=223&&(this.bytes_in_sequence=2),e>=224&&e<=239&&(this.bytes_in_sequence=3),e>=240&&e<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+r>t.length){for(var k=0;k<=t.length-1-r;k++)this.temp_buffs[this.bytes_in_sequence][k]=t[r+k];this.bytes_remaining=r+this.bytes_in_sequence-t.length,r=t.length-1}else this.appendStringBuf(t,r,r+this.bytes_in_sequence),r=r+this.bytes_in_sequence-1}else if(34===e)this.tState=y,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(p,this.string),this.offset+=i.byteLength(this.string,"utf8")+1,this.string=void 0;else if(92===e)this.tState=D;else{if(!(e>=32))return this.charError(t,r);this.appendStringChar(e)}else if(this.tState===D)if(e=t[r],34===e)this.appendStringChar(e),this.tState=N;else if(92===e)this.appendStringChar(G),this.tState=N;else if(47===e)this.appendStringChar(B),this.tState=N;else if(98===e)this.appendStringChar(M),this.tState=N;else if(102===e)this.appendStringChar(K),this.tState=N;else if(110===e)this.appendStringChar($),this.tState=N;else if(114===e)this.appendStringChar(J),this.tState=N;else if(116===e)this.appendStringChar(H),this.tState=N;else{if(117!==e)return this.charError(t,r);this.unicode="",this.tState=A}else if(this.tState===A||this.tState===L||this.tState===P||this.tState===V){if(e=t[r],!(e>=48&&e<64||e>64&&e<=70||e>96&&e<=102))return this.charError(t,r);if(this.unicode+=String.fromCharCode(e),this.tState++===V){var j=parseInt(this.unicode,16);this.unicode=void 0,void 0!==this.highSurrogate&&j>=56320&&j<57344?(this.appendStringBuf(new i(String.fromCharCode(this.highSurrogate,j))),this.highSurrogate=void 0):void 0===this.highSurrogate&&j>=55296&&j<56320?this.highSurrogate=j:(void 0!==this.highSurrogate&&(this.appendStringBuf(new i(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new i(String.fromCharCode(j)))),this.tState=N}}else if(this.tState===v||this.tState===T)switch(e=t[r],e){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(e),this.tState=T;break;default:this.tState=y;var U=Number(this.string);if(isNaN(U))return this.charError(t,r);this.string.match(/[0-9]+/)==this.string&&U.toString()!=this.string?this.onToken(p,this.string):this.onToken(g,U),this.offset+=this.string.length-1,this.string=void 0,r--;break}else if(this.tState===C){if(114!==t[r])return this.charError(t,r);this.tState=w}else if(this.tState===w){if(117!==t[r])return this.charError(t,r);this.tState=I}else if(this.tState===I){if(101!==t[r])return this.charError(t,r);this.tState=y,this.onToken(u,!0),this.offset+=3}else if(this.tState===_){if(97!==t[r])return this.charError(t,r);this.tState=O}else if(this.tState===O){if(108!==t[r])return this.charError(t,r);this.tState=R}else if(this.tState===R){if(115!==t[r])return this.charError(t,r);this.tState=x}else if(this.tState===x){if(101!==t[r])return this.charError(t,r);this.tState=y,this.onToken(h,!1),this.offset+=4}else if(this.tState===b){if(117!==t[r])return this.charError(t,r);this.tState=m}else if(this.tState===m){if(108!==t[r])return this.charError(t,r);this.tState=S}else if(this.tState===S){if(108!==t[r])return this.charError(t,r);this.tState=y,this.onToken(f,null),this.offset+=3}},Y.onToken=function(t,e){},Y.parseError=function(t,e){this.tState=E,this.onError(new Error("Unexpected "+q.toknam(t)+(e?"("+JSON.stringify(e)+")":"")+" in state "+q.toknam(this.state)))},Y.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},Y.pop=function(){var t=this.value,e=this.stack.pop();this.value=e.value,this.key=e.key,this.mode=e.mode,this.emit(t),this.mode||(this.state=k)},Y.emit=function(t){this.mode&&(this.state=c),this.onValue(t)},Y.onValue=function(t){},Y.onToken=function(t,e){if(this.state===k)if(t===p||t===g||t===u||t===h||t===f)this.value&&(this.value[this.key]=e),this.emit(e);else if(t===a)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=j,this.mode=U;else if(t===s)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=F,this.state=k;else if(t===o){if(this.mode!==U)return this.parseError(t,e);this.pop()}else{if(t!==l)return this.parseError(t,e);if(this.mode!==F)return this.parseError(t,e);this.pop()}else if(this.state===j)if(t===p)this.key=e,this.state=d;else{if(t!==o)return this.parseError(t,e);this.pop()}else if(this.state===d){if(t!==d)return this.parseError(t,e);this.state=k}else{if(this.state!==c)return this.parseError(t,e);if(t===c)this.mode===F?(this.key++,this.state=k):this.mode===U&&(this.state=j);else{if(!(t===l&&this.mode===F||t===o&&this.mode===U))return this.parseError(t,e);this.pop()}}},q.C=n,t.exports=q}}]); -//# sourceMappingURL=109.8a94cc6b.js.map \ No newline at end of file +//# sourceMappingURL=109.350c7c05.js.map \ No newline at end of file diff --git a/dist/js/109.8a94cc6b.js.map b/dist/js/109.350c7c05.js.map similarity index 99% rename from dist/js/109.8a94cc6b.js.map rename to dist/js/109.350c7c05.js.map index 2b3ea66..a180a53 100644 --- a/dist/js/109.8a94cc6b.js.map +++ b/dist/js/109.350c7c05.js.map @@ -1 +1 @@ -{"version":3,"file":"js/109.8a94cc6b.js","mappings":"oHAAA,MAAMA,EAAO,EAAQ,OACfC,EAAe,EAAQ,OAE7B,MAAMC,UAAeF,EACnB,WAAAG,CAAaC,GACXC,MAAMJ,EAAcG,EACtB,EAGFE,EAAOC,QAAUL,C,wBCTjB,MAAMM,EAAM,EAAQ,QACd,aAAEC,GAAiB,EAAQ,QAC3B,UAAEC,GAAc,EAAQ,OAExBC,EAAsB,QAE5B,SAASC,EAAaC,GACpB,OAAOC,GACiB,cAAlBA,EAAKC,SACA,KAGJD,EAAKE,MAAMC,WAAWN,GAKpBE,EAAQK,UAAUJ,EAAKE,MAAMG,MAAMR,EAAoBS,SAJrD,IAMb,CAEA,SAASC,EAAaR,GACpB,MAAMS,EAAUV,EAAYC,GAE5B,OAAOU,IACL,MAAMC,EAAUF,EAAQC,EAAKC,SACvBC,EAAYH,EA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mvB,QAAUhD,EAAM,CAC5B,GAAIqE,IAAUrE,EACP,OAAOnsB,KAAKywB,WAAWD,EAAO3yB,GADdmC,KAAKmvB,MAAQrB,CAEtC,KAAM,IAAG9tB,KAAKmvB,QAAU/C,EAWtB,OAAOpsB,KAAKywB,WAAWD,EAAO3yB,GAV9B,GAAI2yB,IAAUpE,EACRpsB,KAAKyI,OAASwlB,GAASjuB,KAAKuJ,MAAOvJ,KAAKmvB,MAAQrB,GAC3C9tB,KAAKyI,OAASulB,IAAUhuB,KAAKmvB,MAAQpB,OAEzC,MAAIyC,IAAUtE,GAAiBlsB,KAAKyI,OAASwlB,GAASuC,IAAUxE,GAAehsB,KAAKyI,OAASulB,GAGlG,OAAOhuB,KAAKywB,WAAWD,EAAO3yB,GAF9BmC,KAAK0wB,KAGP,CAGF,CACF,EAEA3zB,EAAO+uB,EAAIA,EAEX3uB,EAAOC,QAAUL,C","sources":["webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/index.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/lib/ParserStream.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/index.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/lib/BlankNode.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/lib/DataFactory.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/lib/DefaultGraph.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/lib/Literal.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/lib/NamedNode.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/lib/Quad.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/lib/Variable.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/lib/fromTerm.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/sink/index.js","webpack://mobilitydcatap-ui/./node_modules/cross-fetch/dist/browser-polyfill.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-context-parser/index.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-context-parser/lib/ContextParser.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-context-parser/lib/ErrorCoded.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-context-parser/lib/FetchDocumentLoader.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-context-parser/lib/IDocumentLoader.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-context-parser/lib/JsonLdContext.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-context-parser/lib/JsonLdContextNormalized.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-context-parser/lib/Util.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/index.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/ContextTree.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/JsonLdParser.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/ParsingContext.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/Util.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/containerhandler/ContainerHandlerIdentifier.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/containerhandler/ContainerHandlerIndex.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/containerhandler/ContainerHandlerLanguage.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/containerhandler/ContainerHandlerType.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/EntryHandlerArrayValue.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/EntryHandlerContainer.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/EntryHandlerInvalidFallback.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/EntryHandlerPredicate.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeyword.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeywordContext.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeywordGraph.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeywordId.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeywordIncluded.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeywordNest.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeywordType.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeywordUnknownFallback.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeywordValue.js","webpack://mobilitydcatap-ui/./node_modules/jsonparse/jsonparse.js"],"sourcesContent":["const Sink = require('@rdfjs/sink')\nconst ParserStream = require('./lib/ParserStream')\n\nclass Parser extends Sink {\n constructor (options) {\n super(ParserStream, options)\n }\n}\n\nmodule.exports = Parser\n","const rdf = require('@rdfjs/data-model')\nconst { JsonLdParser } = require('jsonld-streaming-parser')\nconst { Transform } = require('readable-stream')\n\nconst relativeIriProtocol = 'null:'\n\nfunction termCleanup (factory) {\n return term => {\n if (term.termType !== 'NamedNode') {\n return null\n }\n\n if (!term.value.startsWith(relativeIriProtocol)) {\n return null\n }\n\n // remove dummy protocol workaround for relative IRIs\n return factory.namedNode(term.value.slice(relativeIriProtocol.length))\n }\n}\n\nfunction quadCleanup (factory) {\n const cleanup = termCleanup(factory)\n\n return quad => {\n const subject = cleanup(quad.subject)\n const predicate = cleanup(quad.predicate)\n const object = cleanup(quad.object)\n const graph = cleanup(quad.graph)\n\n if (subject || predicate || object || graph) {\n return factory.quad(\n subject || quad.subject,\n predicate || quad.predicate,\n object || quad.object,\n graph || quad.graph\n )\n }\n\n return quad\n }\n}\n\nclass ParserStream {\n constructor (input, { baseIRI = relativeIriProtocol, context = null, factory = rdf } = {}) {\n const parser = new JsonLdParser({\n baseIRI,\n context,\n dataFactory: factory,\n streamingProfile: false\n })\n\n input.pipe(parser)\n\n const cleanup = quadCleanup(factory)\n\n const transform = new Transform({\n objectMode: true,\n transform: (quad, encoding, callback) => {\n callback(null, cleanup(quad))\n }\n })\n\n parser.on('context', context => {\n Object.entries(context).forEach(([prefix, iri]) => {\n transform.emit('prefix', prefix, factory.namedNode(iri))\n })\n })\n parser.on('error', err => transform.destroy(err))\n parser.pipe(transform)\n\n return transform\n }\n}\n\nmodule.exports = ParserStream\n","const DataFactory = require('./lib/DataFactory.js')\n\nmodule.exports = DataFactory\n","class BlankNode {\n constructor (id) {\n this.value = id || ('b' + (++BlankNode.nextId))\n }\n\n equals (other) {\n return !!other && other.termType === this.termType && other.value === this.value\n }\n}\n\nBlankNode.prototype.termType = 'BlankNode'\n\nBlankNode.nextId = 0\n\nmodule.exports = BlankNode\n","const BlankNode = require('./BlankNode.js')\nconst DefaultGraph = require('./DefaultGraph.js')\nconst fromTermRaw = require('./fromTerm.js')\nconst Literal = require('./Literal.js')\nconst NamedNode = require('./NamedNode.js')\nconst Quad = require('./Quad.js')\nconst Variable = require('./Variable.js')\n\nfunction namedNode (value) {\n return new NamedNode(value)\n}\n\nfunction blankNode (value) {\n return new BlankNode(value)\n}\n\nfunction literal (value, languageOrDatatype) {\n if (typeof languageOrDatatype === 'string') {\n if (languageOrDatatype.indexOf(':') === -1) {\n return new Literal(value, languageOrDatatype)\n }\n\n return new Literal(value, null, DataFactory.namedNode(languageOrDatatype))\n }\n\n return new Literal(value, null, languageOrDatatype)\n}\n\nfunction variable (value) {\n return new Variable(value)\n}\n\nfunction defaultGraph () {\n return DataFactory.defaultGraphInstance\n}\n\nfunction triple (subject, predicate, object) {\n return DataFactory.quad(subject, predicate, object)\n}\n\nfunction quad (subject, predicate, object, graph) {\n return new Quad(subject, predicate, object, graph || DataFactory.defaultGraphInstance)\n}\n\nfunction fromTerm (original) {\n return fromTermRaw.call(DataFactory, original)\n}\n\nfunction fromQuad (original) {\n return fromTermRaw.call(DataFactory, original)\n}\n\nconst DataFactory = {\n namedNode,\n blankNode,\n literal,\n variable,\n defaultGraph,\n triple,\n quad,\n fromTerm,\n fromQuad,\n defaultGraphInstance: new DefaultGraph()\n}\n\nmodule.exports = DataFactory\n","class DefaultGraph {\n equals (other) {\n return !!other && other.termType === this.termType\n }\n}\n\nDefaultGraph.prototype.termType = 'DefaultGraph'\nDefaultGraph.prototype.value = ''\n\nmodule.exports = DefaultGraph\n","const NamedNode = require('./NamedNode.js')\n\nclass Literal {\n constructor (value, language, datatype) {\n this.value = value\n this.datatype = Literal.stringDatatype\n this.language = ''\n\n if (language) {\n this.language = language\n this.datatype = Literal.langStringDatatype\n } else if (datatype) {\n this.datatype = datatype\n }\n }\n\n equals (other) {\n return !!other && other.termType === this.termType && other.value === this.value &&\n other.language === this.language && other.datatype.equals(this.datatype)\n }\n}\n\nLiteral.prototype.termType = 'Literal'\n\nLiteral.langStringDatatype = new NamedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString')\nLiteral.stringDatatype = new NamedNode('http://www.w3.org/2001/XMLSchema#string')\n\nmodule.exports = Literal\n","class NamedNode {\n constructor (iri) {\n this.value = iri\n }\n\n equals (other) {\n return !!other && other.termType === this.termType && other.value === this.value\n }\n}\n\nNamedNode.prototype.termType = 'NamedNode'\n\nmodule.exports = NamedNode\n","const DefaultGraph = require('./DefaultGraph.js')\n\nclass Quad {\n constructor (subject, predicate, object, graph) {\n this.subject = subject\n this.predicate = predicate\n this.object = object\n\n if (graph) {\n this.graph = graph\n } else {\n this.graph = new DefaultGraph()\n }\n }\n\n equals (other) {\n // `|| !other.termType` is for backwards-compatibility with old factories without RDF* support.\n return !!other && (other.termType === 'Quad' || !other.termType) &&\n other.subject.equals(this.subject) && other.predicate.equals(this.predicate) &&\n other.object.equals(this.object) && other.graph.equals(this.graph)\n }\n}\n\nQuad.prototype.termType = 'Quad'\nQuad.prototype.value = ''\n\nmodule.exports = Quad\n","class Variable {\n constructor (name) {\n this.value = name\n }\n\n equals (other) {\n return !!other && other.termType === this.termType && other.value === this.value\n }\n}\n\nVariable.prototype.termType = 'Variable'\n\nmodule.exports = Variable\n","function fromTerm (original) {\n if (!original) {\n return null\n }\n\n if (original.termType === 'BlankNode') {\n return this.blankNode(original.value)\n }\n\n if (original.termType === 'DefaultGraph') {\n return this.defaultGraph()\n }\n\n if (original.termType === 'Literal') {\n return this.literal(original.value, original.language || this.namedNode(original.datatype.value))\n }\n\n if (original.termType === 'NamedNode') {\n return this.namedNode(original.value)\n }\n\n if (original.termType === 'Quad') {\n const subject = this.fromTerm(original.subject)\n const predicate = this.fromTerm(original.predicate)\n const object = this.fromTerm(original.object)\n const graph = this.fromTerm(original.graph)\n\n return this.quad(subject, predicate, object, graph)\n }\n\n if (original.termType === 'Variable') {\n return this.variable(original.value)\n }\n\n throw new Error(`unknown termType ${original.termType}`)\n}\n\nmodule.exports = fromTerm\n","class Sink {\n constructor (Impl, options) {\n this.Impl = Impl\n this.options = options\n }\n\n import (input, options) {\n const output = new this.Impl(input, Object.assign({}, this.options, options))\n\n input.on('end', () => {\n if (!output.readable) {\n output.emit('end')\n }\n })\n\n input.on('error', (err) => {\n output.emit('error', err)\n })\n\n return output\n }\n}\n\nmodule.exports = Sink\n","(function(self) {\n\nvar irrelevant = (function (exports) {\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob:\n 'FileReader' in self &&\n 'Blob' in self &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : 'OK';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = self.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options));\n };\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.onabort = function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n };\n\n xhr.open(request.method, request.url, true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob';\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!self.fetch) {\n self.fetch = fetch;\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n return exports;\n\n})({});\n})(typeof self !== 'undefined' ? self : this);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lib/ContextParser\"), exports);\n__exportStar(require(\"./lib/ErrorCoded\"), exports);\n__exportStar(require(\"./lib/FetchDocumentLoader\"), exports);\n__exportStar(require(\"./lib/IDocumentLoader\"), exports);\n__exportStar(require(\"./lib/JsonLdContext\"), exports);\n__exportStar(require(\"./lib/JsonLdContextNormalized\"), exports);\n__exportStar(require(\"./lib/Util\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContextParser = void 0;\nrequire(\"cross-fetch/polyfill\");\nconst relative_to_absolute_iri_1 = require(\"relative-to-absolute-iri\");\nconst ErrorCoded_1 = require(\"./ErrorCoded\");\nconst FetchDocumentLoader_1 = require(\"./FetchDocumentLoader\");\nconst JsonLdContextNormalized_1 = require(\"./JsonLdContextNormalized\");\nconst Util_1 = require(\"./Util\");\n/**\n * Parses JSON-LD contexts.\n */\nclass ContextParser {\n constructor(options) {\n options = options || {};\n this.documentLoader = options.documentLoader || new FetchDocumentLoader_1.FetchDocumentLoader();\n this.documentCache = {};\n this.validateContext = !options.skipValidation;\n this.expandContentTypeToBase = !!options.expandContentTypeToBase;\n this.remoteContextsDepthLimit = options.remoteContextsDepthLimit || 32;\n this.redirectSchemaOrgHttps = 'redirectSchemaOrgHttps' in options ? !!options.redirectSchemaOrgHttps : true;\n }\n /**\n * Validate the given @language value.\n * An error will be thrown if it is invalid.\n * @param value An @language value.\n * @param {boolean} strictRange If the string value should be strictly checked against a regex.\n * @param {string} errorCode The error code to emit on errors.\n * @return {boolean} If validation passed.\n * Can only be false if strictRange is false and the string value did not pass the regex.\n */\n static validateLanguage(value, strictRange, errorCode) {\n if (typeof value !== 'string') {\n throw new ErrorCoded_1.ErrorCoded(`The value of an '@language' must be a string, got '${JSON.stringify(value)}'`, errorCode);\n }\n if (!Util_1.Util.REGEX_LANGUAGE_TAG.test(value)) {\n if (strictRange) {\n throw new ErrorCoded_1.ErrorCoded(`The value of an '@language' must be a valid language tag, got '${JSON.stringify(value)}'`, errorCode);\n }\n else {\n return false;\n }\n }\n return true;\n }\n /**\n * Validate the given @direction value.\n * An error will be thrown if it is invalid.\n * @param value An @direction value.\n * @param {boolean} strictValues If the string value should be strictly checked against a regex.\n * @return {boolean} If validation passed.\n * Can only be false if strictRange is false and the string value did not pass the regex.\n */\n static validateDirection(value, strictValues) {\n if (typeof value !== 'string') {\n throw new ErrorCoded_1.ErrorCoded(`The value of an '@direction' must be a string, got '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_BASE_DIRECTION);\n }\n if (!Util_1.Util.REGEX_DIRECTION_TAG.test(value)) {\n if (strictValues) {\n throw new ErrorCoded_1.ErrorCoded(`The value of an '@direction' must be 'ltr' or 'rtl', got '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_BASE_DIRECTION);\n }\n else {\n return false;\n }\n }\n return true;\n }\n /**\n * Add an @id term for all @reverse terms.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n * @return {IJsonLdContextNormalizedRaw} The mutated input context.\n */\n idifyReverseTerms(context) {\n for (const key of Object.keys(context)) {\n let value = context[key];\n if (value && typeof value === 'object') {\n if (value['@reverse'] && !value['@id']) {\n if (typeof value['@reverse'] !== 'string' || Util_1.Util.isValidKeyword(value['@reverse'])) {\n throw new ErrorCoded_1.ErrorCoded(`Invalid @reverse value, must be absolute IRI or blank node: '${value['@reverse']}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n value = context[key] = Object.assign(Object.assign({}, value), { '@id': value['@reverse'] });\n value['@id'] = value['@reverse'];\n if (Util_1.Util.isPotentialKeyword(value['@reverse'])) {\n delete value['@reverse'];\n }\n else {\n value['@reverse'] = true;\n }\n }\n }\n }\n return context;\n }\n /**\n * Expand all prefixed terms in the given context.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n * @param {boolean} expandContentTypeToBase If @type inside the context may be expanded\n * via @base if @vocab is set to null.\n * @param {string[]} keys Optional set of keys from the context to expand. If left undefined, all\n * keys in the context will be expanded.\n */\n expandPrefixedTerms(context, expandContentTypeToBase, keys) {\n const contextRaw = context.getContextRaw();\n for (const key of (keys || Object.keys(contextRaw))) {\n // Only expand allowed keys\n if (Util_1.Util.EXPAND_KEYS_BLACKLIST.indexOf(key) < 0 && !Util_1.Util.isReservedInternalKeyword(key)) {\n // Error if we try to alias a keyword to something else.\n const keyValue = contextRaw[key];\n if (Util_1.Util.isPotentialKeyword(key) && Util_1.Util.ALIAS_DOMAIN_BLACKLIST.indexOf(key) >= 0) {\n if (key !== '@type' || typeof contextRaw[key] === 'object'\n && !(contextRaw[key]['@protected'] || contextRaw[key]['@container'] === '@set')) {\n throw new ErrorCoded_1.ErrorCoded(`Keywords can not be aliased to something else.\nTried mapping ${key} to ${JSON.stringify(keyValue)}`, ErrorCoded_1.ERROR_CODES.KEYWORD_REDEFINITION);\n }\n }\n // Error if we try to alias to an illegal keyword\n if (Util_1.Util.ALIAS_RANGE_BLACKLIST.indexOf(Util_1.Util.getContextValueId(keyValue)) >= 0) {\n throw new ErrorCoded_1.ErrorCoded(`Aliasing to certain keywords is not allowed.\nTried mapping ${key} to ${JSON.stringify(keyValue)}`, ErrorCoded_1.ERROR_CODES.INVALID_KEYWORD_ALIAS);\n }\n // Error if this term was marked as prefix as well\n if (keyValue && Util_1.Util.isPotentialKeyword(Util_1.Util.getContextValueId(keyValue))\n && keyValue['@prefix'] === true) {\n throw new ErrorCoded_1.ErrorCoded(`Tried to use keyword aliases as prefix: '${key}': '${JSON.stringify(keyValue)}'`, ErrorCoded_1.ERROR_CODES.INVALID_TERM_DEFINITION);\n }\n // Loop because prefixes might be nested\n while (Util_1.Util.isPrefixValue(contextRaw[key])) {\n const value = contextRaw[key];\n let changed = false;\n if (typeof value === 'string') {\n contextRaw[key] = context.expandTerm(value, true);\n changed = changed || value !== contextRaw[key];\n }\n else {\n const id = value['@id'];\n const type = value['@type'];\n // If @id is missing, don't allow @id to be added if @prefix: true and key not being a valid IRI.\n const canAddIdEntry = !('@prefix' in value) || Util_1.Util.isValidIri(key);\n if ('@id' in value) {\n // Use @id value for expansion\n if (id !== undefined && id !== null && typeof id === 'string') {\n contextRaw[key] = Object.assign(Object.assign({}, contextRaw[key]), { '@id': context.expandTerm(id, true) });\n changed = changed || id !== contextRaw[key]['@id'];\n }\n }\n else if (!Util_1.Util.isPotentialKeyword(key) && canAddIdEntry) {\n // Add an explicit @id value based on the expanded key value\n const newId = context.expandTerm(key, true);\n if (newId !== key) {\n // Don't set @id if expansion failed\n contextRaw[key] = Object.assign(Object.assign({}, contextRaw[key]), { '@id': newId });\n changed = true;\n }\n }\n if (type && typeof type === 'string' && type !== '@vocab'\n && (!value['@container'] || !value['@container']['@type'])\n && canAddIdEntry) {\n // First check @vocab, then fallback to @base\n let expandedType = context.expandTerm(type, true);\n if (expandContentTypeToBase && type === expandedType) {\n expandedType = context.expandTerm(type, false);\n }\n if (expandedType !== type) {\n changed = true;\n contextRaw[key] = Object.assign(Object.assign({}, contextRaw[key]), { '@type': expandedType });\n }\n }\n }\n if (!changed) {\n break;\n }\n }\n }\n }\n }\n /**\n * Normalize the @language entries in the given context to lowercase.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n * @param {IParseOptions} parseOptions The parsing options.\n */\n normalize(context, { processingMode, normalizeLanguageTags }) {\n // Lowercase language keys in 1.0\n if (normalizeLanguageTags || processingMode === 1.0) {\n for (const key of Object.keys(context)) {\n if (key === '@language' && typeof context[key] === 'string') {\n context[key] = context[key].toLowerCase();\n }\n else {\n const value = context[key];\n if (value && typeof value === 'object') {\n if (typeof value['@language'] === 'string') {\n const lowercase = value['@language'].toLowerCase();\n if (lowercase !== value['@language']) {\n context[key] = Object.assign(Object.assign({}, value), { '@language': lowercase });\n }\n }\n }\n }\n }\n }\n }\n /**\n * Convert all @container strings and array values to hash-based values.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n */\n containersToHash(context) {\n for (const key of Object.keys(context)) {\n const value = context[key];\n if (value && typeof value === 'object') {\n if (typeof value['@container'] === 'string') {\n context[key] = Object.assign(Object.assign({}, value), { '@container': { [value['@container']]: true } });\n }\n else if (Array.isArray(value['@container'])) {\n const newValue = {};\n for (const containerValue of value['@container']) {\n newValue[containerValue] = true;\n }\n context[key] = Object.assign(Object.assign({}, value), { '@container': newValue });\n }\n }\n }\n }\n /**\n * Normalize and apply context-level @protected terms onto each term separately.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n * @param {number} processingMode The processing mode.\n */\n applyScopedProtected(context, { processingMode }, expandOptions) {\n if (processingMode && processingMode >= 1.1) {\n if (context['@protected']) {\n for (const key of Object.keys(context)) {\n if (Util_1.Util.isReservedInternalKeyword(key)) {\n continue;\n }\n if (!Util_1.Util.isPotentialKeyword(key) && !Util_1.Util.isTermProtected(context, key)) {\n const value = context[key];\n if (value && typeof value === 'object') {\n if (!('@protected' in context[key])) {\n // Mark terms with object values as protected if they don't have an @protected: false annotation\n context[key] = Object.assign(Object.assign({}, context[key]), { '@protected': true });\n }\n }\n else {\n // Convert string-based term values to object-based values with @protected: true\n context[key] = {\n '@id': value,\n '@protected': true,\n };\n if (Util_1.Util.isSimpleTermDefinitionPrefix(value, expandOptions)) {\n context[key] = Object.assign(Object.assign({}, context[key]), { '@prefix': true });\n }\n }\n }\n }\n delete context['@protected'];\n }\n }\n }\n /**\n * Check if the given context inheritance does not contain any overrides of protected terms.\n * @param {IJsonLdContextNormalizedRaw} contextBefore The context that may contain some protected terms.\n * @param {IJsonLdContextNormalizedRaw} contextAfter A new context that is being applied on the first one.\n * @param {IExpandOptions} expandOptions Options that are needed for any expansions during this validation.\n * @param {string[]} keys Optional set of keys from the context to validate. If left undefined, all\n * keys defined in contextAfter will be checked.\n */\n validateKeywordRedefinitions(contextBefore, contextAfter, expandOptions, keys) {\n for (const key of (keys !== null && keys !== void 0 ? keys : Object.keys(contextAfter))) {\n if (Util_1.Util.isTermProtected(contextBefore, key)) {\n // The entry in the context before will always be in object-mode\n // If the new entry is in string-mode, convert it to object-mode\n // before checking if it is identical.\n if (typeof contextAfter[key] === 'string') {\n contextAfter[key] = { '@id': contextAfter[key], '@protected': true };\n }\n else {\n // We modify this deliberately,\n // as we need it for the value comparison (they must be identical modulo '@protected')),\n // and for the fact that this new value will override the first one.\n contextAfter[key] = Object.assign(Object.assign({}, contextAfter[key]), { '@protected': true });\n }\n // Error if they are not identical\n if (!Util_1.Util.deepEqual(contextBefore[key], contextAfter[key])) {\n throw new ErrorCoded_1.ErrorCoded(`Attempted to override the protected keyword ${key} from ${JSON.stringify(Util_1.Util.getContextValueId(contextBefore[key]))} to ${JSON.stringify(Util_1.Util.getContextValueId(contextAfter[key]))}`, ErrorCoded_1.ERROR_CODES.PROTECTED_TERM_REDEFINITION);\n }\n }\n }\n }\n /**\n * Validate the entries of the given context.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n * @param {IParseOptions} options The parse options.\n */\n validate(context, { processingMode }) {\n for (const key of Object.keys(context)) {\n // Ignore reserved internal keywords.\n if (Util_1.Util.isReservedInternalKeyword(key)) {\n continue;\n }\n // Do not allow empty term\n if (key === '') {\n throw new ErrorCoded_1.ErrorCoded(`The empty term is not allowed, got: '${key}': '${JSON.stringify(context[key])}'`, ErrorCoded_1.ERROR_CODES.INVALID_TERM_DEFINITION);\n }\n const value = context[key];\n const valueType = typeof value;\n // First check if the key is a keyword\n if (Util_1.Util.isPotentialKeyword(key)) {\n switch (key.substr(1)) {\n case 'vocab':\n if (value !== null && valueType !== 'string') {\n throw new ErrorCoded_1.ErrorCoded(`Found an invalid @vocab IRI: ${value}`, ErrorCoded_1.ERROR_CODES.INVALID_VOCAB_MAPPING);\n }\n break;\n case 'base':\n if (value !== null && valueType !== 'string') {\n throw new ErrorCoded_1.ErrorCoded(`Found an invalid @base IRI: ${context[key]}`, ErrorCoded_1.ERROR_CODES.INVALID_BASE_IRI);\n }\n break;\n case 'language':\n if (value !== null) {\n ContextParser.validateLanguage(value, true, ErrorCoded_1.ERROR_CODES.INVALID_DEFAULT_LANGUAGE);\n }\n break;\n case 'version':\n if (value !== null && valueType !== 'number') {\n throw new ErrorCoded_1.ErrorCoded(`Found an invalid @version number: ${value}`, ErrorCoded_1.ERROR_CODES.INVALID_VERSION_VALUE);\n }\n break;\n case 'direction':\n if (value !== null) {\n ContextParser.validateDirection(value, true);\n }\n break;\n case 'propagate':\n if (processingMode === 1.0) {\n throw new ErrorCoded_1.ErrorCoded(`Found an illegal @propagate keyword: ${value}`, ErrorCoded_1.ERROR_CODES.INVALID_CONTEXT_ENTRY);\n }\n if (value !== null && valueType !== 'boolean') {\n throw new ErrorCoded_1.ErrorCoded(`Found an invalid @propagate value: ${value}`, ErrorCoded_1.ERROR_CODES.INVALID_PROPAGATE_VALUE);\n }\n break;\n }\n // Don't allow keywords to be overridden\n if (Util_1.Util.isValidKeyword(key) && Util_1.Util.isValidKeyword(Util_1.Util.getContextValueId(value))) {\n throw new ErrorCoded_1.ErrorCoded(`Illegal keyword alias in term value, found: '${key}': '${Util_1.Util\n .getContextValueId(value)}'`, ErrorCoded_1.ERROR_CODES.KEYWORD_REDEFINITION);\n }\n continue;\n }\n // Otherwise, consider the key a term\n if (value !== null) {\n switch (valueType) {\n case 'string':\n if (Util_1.Util.getPrefix(value, context) === key) {\n throw new ErrorCoded_1.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${key}': '${JSON\n .stringify(value)}'`, ErrorCoded_1.ERROR_CODES.CYCLIC_IRI_MAPPING);\n }\n if (Util_1.Util.isValidIriWeak(key)) {\n if (value === '@type') {\n throw new ErrorCoded_1.ErrorCoded(`IRIs can not be mapped to @type, found: '${key}': '${value}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n else if (Util_1.Util.isValidIri(value) && value !== new JsonLdContextNormalized_1.JsonLdContextNormalized(context).expandTerm(key)) {\n throw new ErrorCoded_1.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${key}': '${value}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n }\n break;\n case 'object':\n if (!Util_1.Util.isCompactIri(key) && !('@id' in value)\n && (value['@type'] === '@id' ? !context['@base'] : !context['@vocab'])) {\n throw new ErrorCoded_1.ErrorCoded(`Missing @id in context entry: '${key}': '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n for (const objectKey of Object.keys(value)) {\n const objectValue = value[objectKey];\n if (!objectValue) {\n continue;\n }\n switch (objectKey) {\n case '@id':\n if (Util_1.Util.isValidKeyword(objectValue)\n && objectValue !== '@type' && objectValue !== '@id' && objectValue !== '@graph' && objectValue !== '@nest') {\n throw new ErrorCoded_1.ErrorCoded(`Illegal keyword alias in term value, found: '${key}': '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n if (Util_1.Util.isValidIriWeak(key)) {\n if (objectValue === '@type') {\n throw new ErrorCoded_1.ErrorCoded(`IRIs can not be mapped to @type, found: '${key}': '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n else if (Util_1.Util.isValidIri(objectValue)\n && objectValue !== new JsonLdContextNormalized_1.JsonLdContextNormalized(context).expandTerm(key)) {\n throw new ErrorCoded_1.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${key}': '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n }\n if (typeof objectValue !== 'string') {\n throw new ErrorCoded_1.ErrorCoded(`Detected non-string @id in context entry: '${key}': '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n if (Util_1.Util.getPrefix(objectValue, context) === key) {\n throw new ErrorCoded_1.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${key}': '${JSON\n .stringify(value)}'`, ErrorCoded_1.ERROR_CODES.CYCLIC_IRI_MAPPING);\n }\n break;\n case '@type':\n if (value['@container'] === '@type' && objectValue !== '@id' && objectValue !== '@vocab') {\n throw new ErrorCoded_1.ErrorCoded(`@container: @type only allows @type: @id or @vocab, but got: '${key}': '${objectValue}'`, ErrorCoded_1.ERROR_CODES.INVALID_TYPE_MAPPING);\n }\n if (typeof objectValue !== 'string') {\n throw new ErrorCoded_1.ErrorCoded(`The value of an '@type' must be a string, got '${JSON.stringify(valueType)}'`, ErrorCoded_1.ERROR_CODES.INVALID_TYPE_MAPPING);\n }\n if (objectValue !== '@id' && objectValue !== '@vocab'\n && (processingMode === 1.0 || objectValue !== '@json')\n && (processingMode === 1.0 || objectValue !== '@none')\n && (objectValue[0] === '_' || !Util_1.Util.isValidIri(objectValue))) {\n throw new ErrorCoded_1.ErrorCoded(`A context @type must be an absolute IRI, found: '${key}': '${objectValue}'`, ErrorCoded_1.ERROR_CODES.INVALID_TYPE_MAPPING);\n }\n break;\n case '@reverse':\n if (typeof objectValue === 'string' && value['@id'] && value['@id'] !== objectValue) {\n throw new ErrorCoded_1.ErrorCoded(`Found non-matching @id and @reverse term values in '${key}':\\\n'${objectValue}' and '${value['@id']}'`, ErrorCoded_1.ERROR_CODES.INVALID_REVERSE_PROPERTY);\n }\n if ('@nest' in value) {\n throw new ErrorCoded_1.ErrorCoded(`@nest is not allowed in the reverse property '${key}'`, ErrorCoded_1.ERROR_CODES.INVALID_REVERSE_PROPERTY);\n }\n break;\n case '@container':\n if (processingMode === 1.0) {\n if (Object.keys(objectValue).length > 1\n || Util_1.Util.CONTAINERS_1_0.indexOf(Object.keys(objectValue)[0]) < 0) {\n throw new ErrorCoded_1.ErrorCoded(`Invalid term @container for '${key}' ('${Object.keys(objectValue)}') in 1.0, \\\nmust be only one of ${Util_1.Util.CONTAINERS_1_0.join(', ')}`, ErrorCoded_1.ERROR_CODES.INVALID_CONTAINER_MAPPING);\n }\n }\n for (const containerValue of Object.keys(objectValue)) {\n if (containerValue === '@list' && value['@reverse']) {\n throw new ErrorCoded_1.ErrorCoded(`Term value can not be @container: @list and @reverse at the same time on '${key}'`, ErrorCoded_1.ERROR_CODES.INVALID_REVERSE_PROPERTY);\n }\n if (Util_1.Util.CONTAINERS.indexOf(containerValue) < 0) {\n throw new ErrorCoded_1.ErrorCoded(`Invalid term @container for '${key}' ('${containerValue}'), \\\nmust be one of ${Util_1.Util.CONTAINERS.join(', ')}`, ErrorCoded_1.ERROR_CODES.INVALID_CONTAINER_MAPPING);\n }\n }\n break;\n case '@language':\n ContextParser.validateLanguage(objectValue, true, ErrorCoded_1.ERROR_CODES.INVALID_LANGUAGE_MAPPING);\n break;\n case '@direction':\n ContextParser.validateDirection(objectValue, true);\n break;\n case '@prefix':\n if (objectValue !== null && typeof objectValue !== 'boolean') {\n throw new ErrorCoded_1.ErrorCoded(`Found an invalid term @prefix boolean in: '${key}': '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_PREFIX_VALUE);\n }\n if (!('@id' in value) && !Util_1.Util.isValidIri(key)) {\n throw new ErrorCoded_1.ErrorCoded(`Invalid @prefix definition for '${key}' ('${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_TERM_DEFINITION);\n }\n break;\n case '@index':\n if (processingMode === 1.0 || !value['@container'] || !value['@container']['@index']) {\n throw new ErrorCoded_1.ErrorCoded(`Attempt to add illegal key to value object: '${key}': '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_TERM_DEFINITION);\n }\n break;\n case '@nest':\n if (Util_1.Util.isPotentialKeyword(objectValue) && objectValue !== '@nest') {\n throw new ErrorCoded_1.ErrorCoded(`Found an invalid term @nest value in: '${key}': '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_NEST_VALUE);\n }\n }\n }\n break;\n default:\n throw new ErrorCoded_1.ErrorCoded(`Found an invalid term value: '${key}': '${value}'`, ErrorCoded_1.ERROR_CODES.INVALID_TERM_DEFINITION);\n }\n }\n }\n }\n /**\n * Apply the @base context entry to the given context under certain circumstances.\n * @param context A context.\n * @param options Parsing options.\n * @param inheritFromParent If the @base value from the parent context can be inherited.\n * @return The given context.\n */\n applyBaseEntry(context, options, inheritFromParent) {\n // In some special cases, this can be a string, so ignore those.\n if (typeof context === 'string') {\n return context;\n }\n // Give priority to @base in the parent context\n if (inheritFromParent && !('@base' in context) && options.parentContext\n && typeof options.parentContext === 'object' && '@base' in options.parentContext) {\n context['@base'] = options.parentContext['@base'];\n if (options.parentContext['@__baseDocument']) {\n context['@__baseDocument'] = true;\n }\n }\n // Override the base IRI if provided.\n if (options.baseIRI && !options.external) {\n if (!('@base' in context)) {\n // The context base is the document base\n context['@base'] = options.baseIRI;\n context['@__baseDocument'] = true;\n }\n else if (context['@base'] !== null && typeof context['@base'] === 'string'\n && !Util_1.Util.isValidIri(context['@base'])) {\n // The context base is relative to the document base\n context['@base'] = (0, relative_to_absolute_iri_1.resolve)(context['@base'], options.parentContext && options.parentContext['@base'] || options.baseIRI);\n }\n }\n return context;\n }\n /**\n * Resolve relative context IRIs, or return full IRIs as-is.\n * @param {string} contextIri A context IRI.\n * @param {string} baseIRI A base IRI.\n * @return {string} The normalized context IRI.\n */\n normalizeContextIri(contextIri, baseIRI) {\n if (!Util_1.Util.isValidIri(contextIri)) {\n try {\n contextIri = (0, relative_to_absolute_iri_1.resolve)(contextIri, baseIRI);\n }\n catch (_a) {\n throw new Error(`Invalid context IRI: ${contextIri}`);\n }\n }\n // TODO: Temporary workaround for fixing schema.org CORS issues (https://github.com/schemaorg/schemaorg/issues/2578#issuecomment-652324465)\n if (this.redirectSchemaOrgHttps && contextIri.startsWith('http://schema.org')) {\n contextIri = 'https://schema.org/';\n }\n return contextIri;\n }\n /**\n * Parse scoped contexts in the given context.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n * @param {IParseOptions} options Parsing options.\n * @return {IJsonLdContextNormalizedRaw} The mutated input context.\n * @param {string[]} keys Optional set of keys from the context to parseInnerContexts of. If left undefined, all\n * keys in the context will be iterated over.\n */\n async parseInnerContexts(context, options, keys) {\n for (const key of (keys !== null && keys !== void 0 ? keys : Object.keys(context))) {\n const value = context[key];\n if (value && typeof value === 'object') {\n if ('@context' in value && value['@context'] !== null && !options.ignoreScopedContexts) {\n // Simulate a processing based on the parent context to check if there are any (potential errors).\n // Honestly, I find it a bit weird to do this here, as the context may be unused,\n // and the final effective context may differ based on any other embedded/scoped contexts.\n // But hey, it's part of the spec, so we have no choice...\n // https://w3c.github.io/json-ld-api/#h-note-10\n if (this.validateContext) {\n try {\n const parentContext = Object.assign(Object.assign({}, context), { [key]: Object.assign({}, context[key]) });\n delete parentContext[key]['@context'];\n await this.parse(value['@context'], Object.assign(Object.assign({}, options), { external: false, parentContext, ignoreProtection: true, ignoreRemoteScopedContexts: true, ignoreScopedContexts: true }));\n }\n catch (e) {\n throw new ErrorCoded_1.ErrorCoded(e.message, ErrorCoded_1.ERROR_CODES.INVALID_SCOPED_CONTEXT);\n }\n }\n context[key] = Object.assign(Object.assign({}, value), { '@context': (await this.parse(value['@context'], Object.assign(Object.assign({}, options), { external: false, minimalProcessing: true, ignoreRemoteScopedContexts: true, parentContext: context })))\n .getContextRaw() });\n }\n }\n }\n return context;\n }\n async parse(context, options = {}, \n // These options are only for internal use on recursive calls and should not be used by\n // libraries consuming this function\n internalOptions = {}) {\n const { baseIRI, parentContext, external, processingMode = ContextParser.DEFAULT_PROCESSING_MODE, normalizeLanguageTags, ignoreProtection, minimalProcessing, } = options;\n const remoteContexts = options.remoteContexts || {};\n // Avoid remote context overflows\n if (Object.keys(remoteContexts).length >= this.remoteContextsDepthLimit) {\n throw new ErrorCoded_1.ErrorCoded('Detected an overflow in remote context inclusions: ' + Object.keys(remoteContexts), ErrorCoded_1.ERROR_CODES.CONTEXT_OVERFLOW);\n }\n if (context === null || context === undefined) {\n // Don't allow context nullification and there are protected terms\n if (!ignoreProtection && parentContext && Util_1.Util.hasProtectedTerms(parentContext)) {\n throw new ErrorCoded_1.ErrorCoded('Illegal context nullification when terms are protected', ErrorCoded_1.ERROR_CODES.INVALID_CONTEXT_NULLIFICATION);\n }\n // Context that are explicitly set to null are empty.\n return new JsonLdContextNormalized_1.JsonLdContextNormalized(this.applyBaseEntry({}, options, false));\n }\n else if (typeof context === 'string') {\n const contextIri = this.normalizeContextIri(context, baseIRI);\n const overriddenLoad = this.getOverriddenLoad(contextIri, options);\n if (overriddenLoad) {\n return new JsonLdContextNormalized_1.JsonLdContextNormalized(overriddenLoad);\n }\n const parsedStringContext = await this.parse(await this.load(contextIri), Object.assign(Object.assign({}, options), { baseIRI: contextIri, external: true, remoteContexts: Object.assign(Object.assign({}, remoteContexts), { [contextIri]: true }) }));\n this.applyBaseEntry(parsedStringContext.getContextRaw(), options, true);\n return parsedStringContext;\n }\n else if (Array.isArray(context)) {\n // As a performance consideration, first load all external contexts in parallel.\n const contextIris = [];\n const contexts = await Promise.all(context.map((subContext, i) => {\n if (typeof subContext === 'string') {\n const contextIri = this.normalizeContextIri(subContext, baseIRI);\n contextIris[i] = contextIri;\n const overriddenLoad = this.getOverriddenLoad(contextIri, options);\n if (overriddenLoad) {\n return overriddenLoad;\n }\n return this.load(contextIri);\n }\n else {\n return subContext;\n }\n }));\n // Don't apply inheritance logic on minimal processing\n if (minimalProcessing) {\n return new JsonLdContextNormalized_1.JsonLdContextNormalized(contexts);\n }\n const reducedContexts = await contexts.reduce((accContextPromise, contextEntry, i) => accContextPromise\n .then((accContext) => this.parse(contextEntry, Object.assign(Object.assign({}, options), { baseIRI: contextIris[i] || options.baseIRI, external: !!contextIris[i] || options.external, parentContext: accContext.getContextRaw(), remoteContexts: contextIris[i] ? Object.assign(Object.assign({}, remoteContexts), { [contextIris[i]]: true }) : remoteContexts }), \n // @ts-expect-error: This third argument causes a type error because we have hidden it from consumers\n {\n skipValidation: i < contexts.length - 1,\n })), Promise.resolve(new JsonLdContextNormalized_1.JsonLdContextNormalized(parentContext || {})));\n // Override the base IRI if provided.\n this.applyBaseEntry(reducedContexts.getContextRaw(), options, true);\n return reducedContexts;\n }\n else if (typeof context === 'object') {\n if ('@context' in context) {\n return await this.parse(context['@context'], options);\n }\n // Make a deep clone of the given context, to avoid modifying it.\n context = Object.assign({}, context);\n // According to the JSON-LD spec, @base must be ignored from external contexts.\n if (external) {\n delete context['@base'];\n }\n // Override the base IRI if provided.\n this.applyBaseEntry(context, options, true);\n // Hashify container entries\n // Do this before protected term validation as that influences term format\n this.containersToHash(context);\n // Don't perform any other modifications if only minimal processing is needed.\n if (minimalProcessing) {\n return new JsonLdContextNormalized_1.JsonLdContextNormalized(context);\n }\n // In JSON-LD 1.1, load @import'ed context prior to processing.\n let importContext = {};\n if ('@import' in context) {\n if (processingMode >= 1.1) {\n // Only accept string values\n if (typeof context['@import'] !== 'string') {\n throw new ErrorCoded_1.ErrorCoded('An @import value must be a string, but got ' + typeof context['@import'], ErrorCoded_1.ERROR_CODES.INVALID_IMPORT_VALUE);\n }\n // Load context\n importContext = await this.loadImportContext(this.normalizeContextIri(context['@import'], baseIRI));\n delete context['@import'];\n }\n else {\n throw new ErrorCoded_1.ErrorCoded('Context importing is not supported in JSON-LD 1.0', ErrorCoded_1.ERROR_CODES.INVALID_CONTEXT_ENTRY);\n }\n }\n this.applyScopedProtected(importContext, { processingMode }, JsonLdContextNormalized_1.defaultExpandOptions);\n const newContext = Object.assign(importContext, context);\n // Handle terms (before protection checks)\n this.idifyReverseTerms(newContext);\n this.normalize(newContext, { processingMode, normalizeLanguageTags });\n this.applyScopedProtected(newContext, { processingMode }, JsonLdContextNormalized_1.defaultExpandOptions);\n const keys = Object.keys(newContext);\n const overlappingKeys = [];\n if (typeof parentContext === 'object') {\n // Merge different parts of the final context in order\n for (const key in parentContext) {\n if (key in newContext) {\n overlappingKeys.push(key);\n }\n else {\n newContext[key] = parentContext[key];\n }\n }\n }\n // Parse inner contexts with minimal processing\n await this.parseInnerContexts(newContext, options, keys);\n const newContextWrapped = new JsonLdContextNormalized_1.JsonLdContextNormalized(newContext);\n // In JSON-LD 1.1, @vocab can be relative to @vocab in the parent context, or a compact IRI.\n if ((newContext && newContext['@version'] || ContextParser.DEFAULT_PROCESSING_MODE) >= 1.1\n && ((context['@vocab'] && typeof context['@vocab'] === 'string') || context['@vocab'] === '')) {\n if (parentContext && '@vocab' in parentContext && context['@vocab'].indexOf(':') < 0) {\n newContext['@vocab'] = parentContext['@vocab'] + context['@vocab'];\n }\n else if (Util_1.Util.isCompactIri(context['@vocab']) || context['@vocab'] in newContext) {\n // @vocab is a compact IRI or refers exactly to a prefix\n newContext['@vocab'] = newContextWrapped.expandTerm(context['@vocab'], true);\n }\n }\n this.expandPrefixedTerms(newContextWrapped, this.expandContentTypeToBase, keys);\n // In JSON-LD 1.1, check if we are not redefining any protected keywords\n if (!ignoreProtection && parentContext && processingMode >= 1.1) {\n this.validateKeywordRedefinitions(parentContext, newContext, JsonLdContextNormalized_1.defaultExpandOptions, overlappingKeys);\n }\n if (this.validateContext && !internalOptions.skipValidation) {\n this.validate(newContext, { processingMode });\n }\n return newContextWrapped;\n }\n else {\n throw new ErrorCoded_1.ErrorCoded(`Tried parsing a context that is not a string, array or object, but got ${context}`, ErrorCoded_1.ERROR_CODES.INVALID_LOCAL_CONTEXT);\n }\n }\n /**\n * Fetch the given URL as a raw JSON-LD context.\n * @param url An URL.\n * @return A promise resolving to a raw JSON-LD context.\n */\n async load(url) {\n // First try to retrieve the context from cache\n const cached = this.documentCache[url];\n if (cached) {\n return cached;\n }\n // If not in cache, load it\n let document;\n try {\n document = await this.documentLoader.load(url);\n }\n catch (e) {\n throw new ErrorCoded_1.ErrorCoded(`Failed to load remote context ${url}: ${e.message}`, ErrorCoded_1.ERROR_CODES.LOADING_REMOTE_CONTEXT_FAILED);\n }\n // Validate the context\n if (!('@context' in document)) {\n throw new ErrorCoded_1.ErrorCoded(`Missing @context in remote context at ${url}`, ErrorCoded_1.ERROR_CODES.INVALID_REMOTE_CONTEXT);\n }\n return this.documentCache[url] = document['@context'];\n }\n /**\n * Override the given context that may be loaded.\n *\n * This will check whether or not the url is recursively being loaded.\n * @param url An URL.\n * @param options Parsing options.\n * @return An overridden context, or null.\n * Optionally an error can be thrown if a cyclic context is detected.\n */\n getOverriddenLoad(url, options) {\n if (url in (options.remoteContexts || {})) {\n if (options.ignoreRemoteScopedContexts) {\n return url;\n }\n else {\n throw new ErrorCoded_1.ErrorCoded('Detected a cyclic context inclusion of ' + url, ErrorCoded_1.ERROR_CODES.RECURSIVE_CONTEXT_INCLUSION);\n }\n }\n return null;\n }\n /**\n * Load an @import'ed context.\n * @param importContextIri The full URI of an @import value.\n */\n async loadImportContext(importContextIri) {\n // Load the context - and do a deep clone since we are about to mutate it\n let importContext = await this.load(importContextIri);\n // Require the context to be a non-array object\n if (typeof importContext !== 'object' || Array.isArray(importContext)) {\n throw new ErrorCoded_1.ErrorCoded('An imported context must be a single object: ' + importContextIri, ErrorCoded_1.ERROR_CODES.INVALID_REMOTE_CONTEXT);\n }\n // Error if the context contains another @import\n if ('@import' in importContext) {\n throw new ErrorCoded_1.ErrorCoded('An imported context can not import another context: ' + importContextIri, ErrorCoded_1.ERROR_CODES.INVALID_CONTEXT_ENTRY);\n }\n importContext = Object.assign({}, importContext);\n // Containers have to be converted into hash values the same way as for the importing context\n // Otherwise context validation will fail for container values\n this.containersToHash(importContext);\n return importContext;\n }\n}\nContextParser.DEFAULT_PROCESSING_MODE = 1.1;\nexports.ContextParser = ContextParser;\n//# sourceMappingURL=ContextParser.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ERROR_CODES = exports.ErrorCoded = void 0;\n/**\n * An error that has a certain error code.\n *\n * The error code can be any string.\n * All standardized error codes are listed in {@link ERROR_CODES}.\n */\nclass ErrorCoded extends Error {\n /* istanbul ignore next */\n constructor(message, code) {\n super(message);\n this.code = code;\n }\n}\nexports.ErrorCoded = ErrorCoded;\n/**\n * All standardized JSON-LD error codes.\n * @see https://w3c.github.io/json-ld-api/#dom-jsonlderrorcode\n */\n// tslint:disable:object-literal-sort-keys\nvar ERROR_CODES;\n(function (ERROR_CODES) {\n ERROR_CODES[\"COLLIDING_KEYWORDS\"] = \"colliding keywords\";\n ERROR_CODES[\"CONFLICTING_INDEXES\"] = \"conflicting indexes\";\n ERROR_CODES[\"CYCLIC_IRI_MAPPING\"] = \"cyclic IRI mapping\";\n ERROR_CODES[\"INVALID_ID_VALUE\"] = \"invalid @id value\";\n ERROR_CODES[\"INVALID_INDEX_VALUE\"] = \"invalid @index value\";\n ERROR_CODES[\"INVALID_NEST_VALUE\"] = \"invalid @nest value\";\n ERROR_CODES[\"INVALID_PREFIX_VALUE\"] = \"invalid @prefix value\";\n ERROR_CODES[\"INVALID_PROPAGATE_VALUE\"] = \"invalid @propagate value\";\n ERROR_CODES[\"INVALID_REVERSE_VALUE\"] = \"invalid @reverse value\";\n ERROR_CODES[\"INVALID_IMPORT_VALUE\"] = \"invalid @import value\";\n ERROR_CODES[\"INVALID_VERSION_VALUE\"] = \"invalid @version value\";\n ERROR_CODES[\"INVALID_BASE_IRI\"] = \"invalid base IRI\";\n ERROR_CODES[\"INVALID_CONTAINER_MAPPING\"] = \"invalid container mapping\";\n ERROR_CODES[\"INVALID_CONTEXT_ENTRY\"] = \"invalid context entry\";\n ERROR_CODES[\"INVALID_CONTEXT_NULLIFICATION\"] = \"invalid context nullification\";\n ERROR_CODES[\"INVALID_DEFAULT_LANGUAGE\"] = \"invalid default language\";\n ERROR_CODES[\"INVALID_INCLUDED_VALUE\"] = \"invalid @included value\";\n ERROR_CODES[\"INVALID_IRI_MAPPING\"] = \"invalid IRI mapping\";\n ERROR_CODES[\"INVALID_JSON_LITERAL\"] = \"invalid JSON literal\";\n ERROR_CODES[\"INVALID_KEYWORD_ALIAS\"] = \"invalid keyword alias\";\n ERROR_CODES[\"INVALID_LANGUAGE_MAP_VALUE\"] = \"invalid language map value\";\n ERROR_CODES[\"INVALID_LANGUAGE_MAPPING\"] = \"invalid language mapping\";\n ERROR_CODES[\"INVALID_LANGUAGE_TAGGED_STRING\"] = \"invalid language-tagged string\";\n ERROR_CODES[\"INVALID_LANGUAGE_TAGGED_VALUE\"] = \"invalid language-tagged value\";\n ERROR_CODES[\"INVALID_LOCAL_CONTEXT\"] = \"invalid local context\";\n ERROR_CODES[\"INVALID_REMOTE_CONTEXT\"] = \"invalid remote context\";\n ERROR_CODES[\"INVALID_REVERSE_PROPERTY\"] = \"invalid reverse property\";\n ERROR_CODES[\"INVALID_REVERSE_PROPERTY_MAP\"] = \"invalid reverse property map\";\n ERROR_CODES[\"INVALID_REVERSE_PROPERTY_VALUE\"] = \"invalid reverse property value\";\n ERROR_CODES[\"INVALID_SCOPED_CONTEXT\"] = \"invalid scoped context\";\n ERROR_CODES[\"INVALID_SCRIPT_ELEMENT\"] = \"invalid script element\";\n ERROR_CODES[\"INVALID_SET_OR_LIST_OBJECT\"] = \"invalid set or list object\";\n ERROR_CODES[\"INVALID_TERM_DEFINITION\"] = \"invalid term definition\";\n ERROR_CODES[\"INVALID_TYPE_MAPPING\"] = \"invalid type mapping\";\n ERROR_CODES[\"INVALID_TYPE_VALUE\"] = \"invalid type value\";\n ERROR_CODES[\"INVALID_TYPED_VALUE\"] = \"invalid typed value\";\n ERROR_CODES[\"INVALID_VALUE_OBJECT\"] = \"invalid value object\";\n ERROR_CODES[\"INVALID_VALUE_OBJECT_VALUE\"] = \"invalid value object value\";\n ERROR_CODES[\"INVALID_VOCAB_MAPPING\"] = \"invalid vocab mapping\";\n ERROR_CODES[\"IRI_CONFUSED_WITH_PREFIX\"] = \"IRI confused with prefix\";\n ERROR_CODES[\"KEYWORD_REDEFINITION\"] = \"keyword redefinition\";\n ERROR_CODES[\"LOADING_DOCUMENT_FAILED\"] = \"loading document failed\";\n ERROR_CODES[\"LOADING_REMOTE_CONTEXT_FAILED\"] = \"loading remote context failed\";\n ERROR_CODES[\"MULTIPLE_CONTEXT_LINK_HEADERS\"] = \"multiple context link headers\";\n ERROR_CODES[\"PROCESSING_MODE_CONFLICT\"] = \"processing mode conflict\";\n ERROR_CODES[\"PROTECTED_TERM_REDEFINITION\"] = \"protected term redefinition\";\n ERROR_CODES[\"CONTEXT_OVERFLOW\"] = \"context overflow\";\n ERROR_CODES[\"INVALID_BASE_DIRECTION\"] = \"invalid base direction\";\n ERROR_CODES[\"RECURSIVE_CONTEXT_INCLUSION\"] = \"recursive context inclusion\";\n ERROR_CODES[\"INVALID_STREAMING_KEY_ORDER\"] = \"invalid streaming key order\";\n /**\n * JSON-LD-star\n */\n ERROR_CODES[\"INVALID_EMBEDDED_NODE\"] = \"invalid embedded node\";\n ERROR_CODES[\"INVALID_ANNOTATION\"] = \"invalid annotation\";\n})(ERROR_CODES = exports.ERROR_CODES || (exports.ERROR_CODES = {}));\n//# sourceMappingURL=ErrorCoded.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FetchDocumentLoader = void 0;\nrequire(\"cross-fetch/polyfill\");\nconst ErrorCoded_1 = require(\"./ErrorCoded\");\nconst http_link_header_1 = require(\"http-link-header\");\nconst relative_to_absolute_iri_1 = require(\"relative-to-absolute-iri\");\n/**\n * Loads documents via the fetch API.\n */\nclass FetchDocumentLoader {\n constructor(fetcher) {\n this.fetcher = fetcher;\n }\n async load(url) {\n const response = await (this.fetcher || fetch)(url, { headers: new Headers({ accept: 'application/ld+json' }) });\n if (response.ok && response.headers) {\n let mediaType = response.headers.get('Content-Type');\n if (mediaType) {\n const colonPos = mediaType.indexOf(';');\n if (colonPos > 0) {\n mediaType = mediaType.substr(0, colonPos);\n }\n }\n if (mediaType === 'application/ld+json') {\n // Return JSON-LD if proper content type was returned\n return (await response.json());\n }\n else {\n // Check for alternate link for a non-JSON-LD response\n if (response.headers.has('Link')) {\n let alternateUrl;\n response.headers.forEach((value, key) => {\n if (key === 'link') {\n const linkHeader = (0, http_link_header_1.parse)(value);\n for (const link of linkHeader.get('type', 'application/ld+json')) {\n if (link.rel === 'alternate') {\n if (alternateUrl) {\n throw new Error('Multiple JSON-LD alternate links were found on ' + url);\n }\n alternateUrl = (0, relative_to_absolute_iri_1.resolve)(link.uri, url);\n }\n }\n }\n });\n if (alternateUrl) {\n return this.load(alternateUrl);\n }\n }\n throw new ErrorCoded_1.ErrorCoded(`Unsupported JSON-LD media type ${mediaType}`, ErrorCoded_1.ERROR_CODES.LOADING_DOCUMENT_FAILED);\n }\n }\n else {\n throw new Error(response.statusText || `Status code: ${response.status}`);\n }\n }\n}\nexports.FetchDocumentLoader = FetchDocumentLoader;\n//# sourceMappingURL=FetchDocumentLoader.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=IDocumentLoader.js.map","\"use strict\";\n// tslint:disable:max-line-length\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=JsonLdContext.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultExpandOptions = exports.JsonLdContextNormalized = void 0;\nconst relative_to_absolute_iri_1 = require(\"relative-to-absolute-iri\");\nconst ErrorCoded_1 = require(\"./ErrorCoded\");\nconst Util_1 = require(\"./Util\");\n/**\n * A class exposing operations over a normalized JSON-LD context.\n */\nclass JsonLdContextNormalized {\n constructor(contextRaw) {\n this.contextRaw = contextRaw;\n }\n /**\n * @return The raw inner context.\n */\n getContextRaw() {\n return this.contextRaw;\n }\n /**\n * Expand the term or prefix of the given term if it has one,\n * otherwise return the term as-is.\n *\n * This will try to expand the IRI as much as possible.\n *\n * Iff in vocab-mode, then other references to other terms in the context can be used,\n * such as to `myTerm`:\n * ```\n * {\n * \"myTerm\": \"http://example.org/myLongTerm\"\n * }\n * ```\n *\n * @param {string} term A term that is an URL or a prefixed URL.\n * @param {boolean} expandVocab If the term is a predicate or type and should be expanded based on @vocab,\n * otherwise it is considered a regular term that is expanded based on @base.\n * @param {IExpandOptions} options Options that define the way how expansion must be done.\n * @return {string} The expanded term, the term as-is, or null if it was explicitly disabled in the context.\n * @throws If the term is aliased to an invalid value (not a string, IRI or keyword).\n */\n expandTerm(term, expandVocab, options = exports.defaultExpandOptions) {\n const contextValue = this.contextRaw[term];\n // Immediately return if the term was disabled in the context\n if (contextValue === null || (contextValue && contextValue['@id'] === null)) {\n return null;\n }\n // Check the @id\n let validIriMapping = true;\n if (contextValue && expandVocab) {\n const value = Util_1.Util.getContextValueId(contextValue);\n if (value && value !== term) {\n if (typeof value !== 'string' || (!Util_1.Util.isValidIri(value) && !Util_1.Util.isValidKeyword(value))) {\n // Don't mark this mapping as invalid if we have an unknown keyword, but of the correct form.\n if (!Util_1.Util.isPotentialKeyword(value)) {\n validIriMapping = false;\n }\n }\n else {\n return value;\n }\n }\n }\n // Check if the term is prefixed\n const prefix = Util_1.Util.getPrefix(term, this.contextRaw);\n const vocab = this.contextRaw['@vocab'];\n const vocabRelative = (!!vocab || vocab === '') && vocab.indexOf(':') < 0;\n const base = this.contextRaw['@base'];\n const potentialKeyword = Util_1.Util.isPotentialKeyword(term);\n if (prefix) {\n const contextPrefixValue = this.contextRaw[prefix];\n const value = Util_1.Util.getContextValueId(contextPrefixValue);\n if (value) {\n if (typeof contextPrefixValue === 'string' || !options.allowPrefixForcing) {\n // If we have a simple term definition,\n // check the last character of the prefix to determine whether or not it is a prefix.\n // Validate that prefix ends with gen-delim character, unless @prefix is true\n if (!Util_1.Util.isSimpleTermDefinitionPrefix(value, options)) {\n // Treat the term as an absolute IRI\n return term;\n }\n }\n else {\n // If we have an expanded term definition, default to @prefix: false\n if (value[0] !== '_' && !potentialKeyword && !contextPrefixValue['@prefix'] && !(term in this.contextRaw)) {\n // Treat the term as an absolute IRI\n return term;\n }\n }\n return value + term.substr(prefix.length + 1);\n }\n }\n else if (expandVocab && ((vocab || vocab === '') || (options.allowVocabRelativeToBase && (base && vocabRelative)))\n && !potentialKeyword && !Util_1.Util.isCompactIri(term)) {\n if (vocabRelative) {\n if (options.allowVocabRelativeToBase) {\n return ((vocab || base) ? (0, relative_to_absolute_iri_1.resolve)(vocab, base) : '') + term;\n }\n else {\n throw new ErrorCoded_1.ErrorCoded(`Relative vocab expansion for term '${term}' with vocab '${vocab}' is not allowed.`, ErrorCoded_1.ERROR_CODES.INVALID_VOCAB_MAPPING);\n }\n }\n else {\n return vocab + term;\n }\n }\n else if (!expandVocab && base && !potentialKeyword && !Util_1.Util.isCompactIri(term)) {\n return (0, relative_to_absolute_iri_1.resolve)(term, base);\n }\n // Return the term as-is, unless we discovered an invalid IRI mapping for this term in the context earlier.\n if (validIriMapping) {\n return term;\n }\n else {\n throw new ErrorCoded_1.ErrorCoded(`Invalid IRI mapping found for context entry '${term}': '${JSON.stringify(contextValue)}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n }\n /**\n * Compact the given term using @base, @vocab, an aliased term, or a prefixed term.\n *\n * This will try to compact the IRI as much as possible.\n *\n * @param {string} iri An IRI to compact.\n * @param {boolean} vocab If the term is a predicate or type and should be compacted based on @vocab,\n * otherwise it is considered a regular term that is compacted based on @base.\n * @return {string} The compacted term or the IRI as-is.\n */\n compactIri(iri, vocab) {\n // Try @vocab compacting\n if (vocab && this.contextRaw['@vocab'] && iri.startsWith(this.contextRaw['@vocab'])) {\n return iri.substr(this.contextRaw['@vocab'].length);\n }\n // Try @base compacting\n if (!vocab && this.contextRaw['@base'] && iri.startsWith(this.contextRaw['@base'])) {\n return iri.substr(this.contextRaw['@base'].length);\n }\n // Loop over all terms in the context\n // This will try to prefix as short as possible.\n // Once a fully compacted alias is found, return immediately, as we can not go any shorter.\n const shortestPrefixing = { prefix: '', suffix: iri };\n for (const key in this.contextRaw) {\n const value = this.contextRaw[key];\n if (value && !Util_1.Util.isPotentialKeyword(key)) {\n const contextIri = Util_1.Util.getContextValueId(value);\n if (iri.startsWith(contextIri)) {\n const suffix = iri.substr(contextIri.length);\n if (!suffix) {\n if (vocab) {\n // Immediately return on compacted alias\n return key;\n }\n }\n else if (suffix.length < shortestPrefixing.suffix.length) {\n // Overwrite the shortest prefix\n shortestPrefixing.prefix = key;\n shortestPrefixing.suffix = suffix;\n }\n }\n }\n }\n // Return the shortest prefix\n if (shortestPrefixing.prefix) {\n return shortestPrefixing.prefix + ':' + shortestPrefixing.suffix;\n }\n return iri;\n }\n}\nexports.JsonLdContextNormalized = JsonLdContextNormalized;\nexports.defaultExpandOptions = {\n allowPrefixForcing: true,\n allowPrefixNonGenDelims: false,\n allowVocabRelativeToBase: true,\n};\n//# sourceMappingURL=JsonLdContextNormalized.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Util = void 0;\nclass Util {\n /**\n * Check if the given term is a valid compact IRI.\n * Otherwise, it may be an IRI.\n * @param {string} term A term.\n * @return {boolean} If it is a compact IRI.\n */\n static isCompactIri(term) {\n return term.indexOf(':') > 0 && !(term && term[0] === '#');\n }\n /**\n * Get the prefix from the given term.\n * @see https://json-ld.org/spec/latest/json-ld/#compact-iris\n * @param {string} term A term that is an URL or a prefixed URL.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n * @return {string} The prefix or null.\n */\n static getPrefix(term, context) {\n // Do not consider relative IRIs starting with a hash as compact IRIs\n if (term && term[0] === '#') {\n return null;\n }\n const separatorPos = term.indexOf(':');\n if (separatorPos >= 0) {\n // Suffix can not begin with two slashes\n if (term.length > separatorPos + 1\n && term.charAt(separatorPos + 1) === '/'\n && term.charAt(separatorPos + 2) === '/') {\n return null;\n }\n const prefix = term.substr(0, separatorPos);\n // Prefix can not be an underscore (this is a blank node)\n if (prefix === '_') {\n return null;\n }\n // Prefix must match a term in the active context\n if (context[prefix]) {\n return prefix;\n }\n }\n return null;\n }\n /**\n * From a given context entry value, get the string value, or the @id field.\n * @param contextValue A value for a term in a context.\n * @return {string} The id value, or null.\n */\n static getContextValueId(contextValue) {\n if (contextValue === null || typeof contextValue === 'string') {\n return contextValue;\n }\n const id = contextValue['@id'];\n return id ? id : null;\n }\n /**\n * Check if the given simple term definition (string-based value of a context term)\n * should be considered a prefix.\n * @param value A simple term definition value.\n * @param options Options that define the way how expansion must be done.\n */\n static isSimpleTermDefinitionPrefix(value, options) {\n return !Util.isPotentialKeyword(value)\n && (options.allowPrefixNonGenDelims || (typeof value === 'string' && (value[0] === '_' || Util.isPrefixIriEndingWithGenDelim(value))));\n }\n /**\n * Check if the given keyword is of the keyword format \"@\"1*ALPHA.\n * @param {string} keyword A potential keyword.\n * @return {boolean} If the given keyword is of the keyword format.\n */\n static isPotentialKeyword(keyword) {\n return typeof keyword === 'string' && Util.KEYWORD_REGEX.test(keyword);\n }\n /**\n * Check if the given prefix ends with a gen-delim character.\n * @param {string} prefixIri A prefix IRI.\n * @return {boolean} If the given prefix IRI is valid.\n */\n static isPrefixIriEndingWithGenDelim(prefixIri) {\n return Util.ENDS_WITH_GEN_DELIM.test(prefixIri);\n }\n /**\n * Check if the given context value can be a prefix value.\n * @param value A context value.\n * @return {boolean} If it can be a prefix value.\n */\n static isPrefixValue(value) {\n return value && (typeof value === 'string' || (value && typeof value === 'object'));\n }\n /**\n * Check if the given IRI is valid.\n * @param {string} iri A potential IRI.\n * @return {boolean} If the given IRI is valid.\n */\n static isValidIri(iri) {\n return Boolean(iri && Util.IRI_REGEX.test(iri));\n }\n /**\n * Check if the given IRI is valid, this includes the possibility of being a relative IRI.\n * @param {string} iri A potential IRI.\n * @return {boolean} If the given IRI is valid.\n */\n static isValidIriWeak(iri) {\n return !!iri && iri[0] !== ':' && Util.IRI_REGEX_WEAK.test(iri);\n }\n /**\n * Check if the given keyword is a defined according to the JSON-LD specification.\n * @param {string} keyword A potential keyword.\n * @return {boolean} If the given keyword is valid.\n */\n static isValidKeyword(keyword) {\n return Util.VALID_KEYWORDS[keyword];\n }\n /**\n * Check if the given term is protected in the context.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n * @param {string} key A context term.\n * @return {boolean} If the given term has an @protected flag.\n */\n static isTermProtected(context, key) {\n const value = context[key];\n return !(typeof value === 'string') && value && value['@protected'];\n }\n /**\n * Check if the given context has at least one protected term.\n * @param context A context.\n * @return If the context has a protected term.\n */\n static hasProtectedTerms(context) {\n for (const key of Object.keys(context)) {\n if (Util.isTermProtected(context, key)) {\n return true;\n }\n }\n return false;\n }\n /**\n * Check if the given key is an internal reserved keyword.\n * @param key A context key.\n */\n static isReservedInternalKeyword(key) {\n return key.startsWith('@__');\n }\n /**\n * Check if two objects are deepEqual to on another.\n * @param object1 The first object to test.\n * @param object2 The second object to test.\n */\n static deepEqual(object1, object2) {\n const objKeys1 = Object.keys(object1);\n const objKeys2 = Object.keys(object2);\n if (objKeys1.length !== objKeys2.length)\n return false;\n return objKeys1.every((key) => {\n const value1 = object1[key];\n const value2 = object2[key];\n return (value1 === value2) || (value1 !== null &&\n value2 !== null &&\n typeof value1 === \"object\" &&\n typeof value2 === \"object\" &&\n this.deepEqual(value1, value2));\n });\n }\n ;\n}\n// Regex for valid IRIs\nUtil.IRI_REGEX = /^([A-Za-z][A-Za-z0-9+-.]*|_):[^ \"<>{}|\\\\\\[\\]`#]*(#[^#]*)?$/;\n// Weaker regex for valid IRIs, this includes relative IRIs\nUtil.IRI_REGEX_WEAK = /(?::[^:])|\\//;\n// Regex for keyword form\nUtil.KEYWORD_REGEX = /^@[a-z]+$/i;\n// Regex to see if an IRI ends with a gen-delim character (see RFC 3986)\nUtil.ENDS_WITH_GEN_DELIM = /[:/?#\\[\\]@]$/;\n// Regex for language tags\nUtil.REGEX_LANGUAGE_TAG = /^[a-zA-Z]+(-[a-zA-Z0-9]+)*$/;\n// Regex for base directions\nUtil.REGEX_DIRECTION_TAG = /^(ltr)|(rtl)$/;\n// All known valid JSON-LD keywords\n// @see https://www.w3.org/TR/json-ld11/#keywords\nUtil.VALID_KEYWORDS = {\n '@annotation': true,\n '@base': true,\n '@container': true,\n '@context': true,\n '@direction': true,\n '@graph': true,\n '@id': true,\n '@import': true,\n '@included': true,\n '@index': true,\n '@json': true,\n '@language': true,\n '@list': true,\n '@nest': true,\n '@none': true,\n '@prefix': true,\n '@propagate': true,\n '@protected': true,\n '@reverse': true,\n '@set': true,\n '@type': true,\n '@value': true,\n '@version': true,\n '@vocab': true,\n};\n// Keys in the contexts that will not be expanded based on the base IRI\nUtil.EXPAND_KEYS_BLACKLIST = [\n '@base',\n '@vocab',\n '@language',\n '@version',\n '@direction',\n];\n// Keys in the contexts that may not be aliased from\nUtil.ALIAS_DOMAIN_BLACKLIST = [\n '@container',\n '@graph',\n '@id',\n '@index',\n '@list',\n '@nest',\n '@none',\n '@prefix',\n '@reverse',\n '@set',\n '@type',\n '@value',\n '@version',\n];\n// Keys in the contexts that may not be aliased to\nUtil.ALIAS_RANGE_BLACKLIST = [\n '@context',\n '@preserve',\n];\n// All valid @container values\nUtil.CONTAINERS = [\n '@list',\n '@set',\n '@index',\n '@language',\n '@graph',\n '@id',\n '@type',\n];\n// All valid @container values under processing mode 1.0\nUtil.CONTAINERS_1_0 = [\n '@list',\n '@set',\n '@index',\n];\nexports.Util = Util;\n//# sourceMappingURL=Util.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lib/JsonLdParser\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContextTree = void 0;\n/**\n * A tree structure that holds all contexts,\n * based on their position in the JSON object.\n *\n * Positions are identified by a path of keys.\n */\nclass ContextTree {\n constructor() {\n this.subTrees = {};\n }\n getContext(keys) {\n if (keys.length > 0) {\n const [head, ...tail] = keys;\n const subTree = this.subTrees[head];\n if (subTree) {\n const subContext = subTree.getContext(tail);\n if (subContext) {\n return subContext.then(({ context, depth }) => ({ context, depth: depth + 1 }));\n }\n }\n }\n return this.context ? this.context.then((context) => ({ context, depth: 0 })) : null;\n }\n setContext(keys, context) {\n if (keys.length === 0) {\n this.context = context;\n }\n else {\n const [head, ...tail] = keys;\n let subTree = this.subTrees[head];\n if (!subTree) {\n subTree = this.subTrees[head] = new ContextTree();\n }\n subTree.setContext(tail, context);\n }\n }\n removeContext(path) {\n this.setContext(path, null);\n }\n}\nexports.ContextTree = ContextTree;\n//# sourceMappingURL=ContextTree.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.JsonLdParser = void 0;\n// tslint:disable-next-line:no-var-requires\nconst Parser = require('jsonparse');\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst stream_1 = require(\"stream\");\nconst EntryHandlerArrayValue_1 = require(\"./entryhandler/EntryHandlerArrayValue\");\nconst EntryHandlerContainer_1 = require(\"./entryhandler/EntryHandlerContainer\");\nconst EntryHandlerInvalidFallback_1 = require(\"./entryhandler/EntryHandlerInvalidFallback\");\nconst EntryHandlerPredicate_1 = require(\"./entryhandler/EntryHandlerPredicate\");\nconst EntryHandlerKeywordContext_1 = require(\"./entryhandler/keyword/EntryHandlerKeywordContext\");\nconst EntryHandlerKeywordGraph_1 = require(\"./entryhandler/keyword/EntryHandlerKeywordGraph\");\nconst EntryHandlerKeywordId_1 = require(\"./entryhandler/keyword/EntryHandlerKeywordId\");\nconst EntryHandlerKeywordIncluded_1 = require(\"./entryhandler/keyword/EntryHandlerKeywordIncluded\");\nconst EntryHandlerKeywordNest_1 = require(\"./entryhandler/keyword/EntryHandlerKeywordNest\");\nconst EntryHandlerKeywordType_1 = require(\"./entryhandler/keyword/EntryHandlerKeywordType\");\nconst EntryHandlerKeywordUnknownFallback_1 = require(\"./entryhandler/keyword/EntryHandlerKeywordUnknownFallback\");\nconst EntryHandlerKeywordValue_1 = require(\"./entryhandler/keyword/EntryHandlerKeywordValue\");\nconst ParsingContext_1 = require(\"./ParsingContext\");\nconst Util_1 = require(\"./Util\");\nconst http_link_header_1 = require(\"http-link-header\");\n/**\n * A stream transformer that parses JSON-LD (text) streams to an {@link RDF.Stream}.\n */\nclass JsonLdParser extends stream_1.Transform {\n constructor(options) {\n super({ readableObjectMode: true });\n options = options || {};\n this.options = options;\n this.parsingContext = new ParsingContext_1.ParsingContext(Object.assign({ parser: this }, options));\n this.util = new Util_1.Util({ dataFactory: options.dataFactory, parsingContext: this.parsingContext });\n this.jsonParser = new Parser();\n this.contextJobs = [];\n this.typeJobs = [];\n this.contextAwaitingJobs = [];\n this.lastDepth = 0;\n this.lastKeys = [];\n this.lastOnValueJob = Promise.resolve();\n this.attachJsonParserListeners();\n this.on('end', () => {\n if (typeof this.jsonParser.mode !== 'undefined') {\n this.emit('error', new Error('Unclosed document'));\n }\n });\n }\n /**\n * Construct a JsonLdParser from the given HTTP response.\n *\n * This will throw an error if no valid JSON response is received\n * (application/ld+json, application/json, or something+json).\n *\n * For raw JSON responses, exactly one link header pointing to a JSON-LD context is required.\n *\n * This method is not responsible for handling redirects.\n *\n * @param baseIRI The URI of the received response.\n * @param mediaType The received content type.\n * @param headers Optional HTTP headers.\n * @param options Optional parser options.\n */\n static fromHttpResponse(baseIRI, mediaType, headers, options) {\n let context;\n // Special cases when receiving something else than the JSON-LD media type\n if (mediaType !== 'application/ld+json') {\n // Only accept JSON or JSON extension types\n if (mediaType !== 'application/json' && !mediaType.endsWith('+json')) {\n throw new jsonld_context_parser_1.ErrorCoded(`Unsupported JSON-LD media type ${mediaType}`, jsonld_context_parser_1.ERROR_CODES.LOADING_DOCUMENT_FAILED);\n }\n // We need exactly one JSON-LD context in the link header\n if (headers && headers.has('Link')) {\n headers.forEach((value, key) => {\n if (key === 'link') {\n const linkHeader = http_link_header_1.parse(value);\n for (const link of linkHeader.get('rel', 'http://www.w3.org/ns/json-ld#context')) {\n if (context) {\n throw new jsonld_context_parser_1.ErrorCoded('Multiple JSON-LD context link headers were found on ' + baseIRI, jsonld_context_parser_1.ERROR_CODES.MULTIPLE_CONTEXT_LINK_HEADERS);\n }\n context = link.uri;\n }\n }\n });\n }\n if (!context && !(options === null || options === void 0 ? void 0 : options.ignoreMissingContextLinkHeader)) {\n throw new jsonld_context_parser_1.ErrorCoded(`Missing context link header for media type ${mediaType} on ${baseIRI}`, jsonld_context_parser_1.ERROR_CODES.LOADING_DOCUMENT_FAILED);\n }\n }\n // Check if the streaming profile is present\n let streamingProfile;\n if (headers && headers.has('Content-Type')) {\n const contentType = headers.get('Content-Type');\n const match = /; *profile=([^\"]*)/.exec(contentType);\n if (match && match[1] === 'http://www.w3.org/ns/json-ld#streaming') {\n streamingProfile = true;\n }\n }\n return new JsonLdParser(Object.assign({ baseIRI,\n context,\n streamingProfile }, options ? options : {}));\n }\n /**\n * Parses the given text stream into a quad stream.\n * @param {NodeJS.EventEmitter} stream A text stream.\n * @return {RDF.Stream} A quad stream.\n */\n import(stream) {\n const output = new stream_1.PassThrough({ readableObjectMode: true });\n stream.on('error', (error) => parsed.emit('error', error));\n stream.on('data', (data) => output.push(data));\n stream.on('end', () => output.push(null));\n const parsed = output.pipe(new JsonLdParser(this.options));\n return parsed;\n }\n _transform(chunk, encoding, callback) {\n this.jsonParser.write(chunk);\n this.lastOnValueJob\n .then(() => callback(), (error) => callback(error));\n }\n /**\n * Start a new job for parsing the given value.\n *\n * This will let the first valid {@link IEntryHandler} handle the entry.\n *\n * @param {any[]} keys The stack of keys.\n * @param value The value to parse.\n * @param {number} depth The depth to parse at.\n * @param {boolean} lastDepthCheck If the lastDepth check should be done for buffer draining.\n * @return {Promise} A promise resolving when the job is done.\n */\n async newOnValueJob(keys, value, depth, lastDepthCheck) {\n let flushStacks = true;\n // When we go up the stack, emit all unidentified values\n // We need to do this before the new job, because the new job may require determined values from the flushed jobs.\n if (lastDepthCheck && depth < this.lastDepth) {\n // Check if we had any RDF lists that need to be terminated with an rdf:nil\n const listPointer = this.parsingContext.listPointerStack[this.lastDepth];\n if (listPointer) {\n // Terminate the list if the had at least one value\n if (listPointer.value) {\n this.emit('data', this.util.dataFactory.quad(listPointer.value, this.util.rdfRest, this.util.rdfNil, this.util.getDefaultGraph()));\n }\n // Add the list id to the id stack, so it can be used higher up in the stack\n listPointer.listId.listHead = true;\n this.parsingContext.idStack[listPointer.listRootDepth + 1] = [listPointer.listId];\n this.parsingContext.listPointerStack.splice(this.lastDepth, 1);\n }\n // Flush the buffer for lastDepth\n // If the parent key is a special type of container, postpone flushing until that parent is handled.\n if (await EntryHandlerContainer_1.EntryHandlerContainer.isBufferableContainerHandler(this.parsingContext, this.lastKeys, this.lastDepth)) {\n this.parsingContext.pendingContainerFlushBuffers\n .push({ depth: this.lastDepth, keys: this.lastKeys.slice(0, this.lastKeys.length) });\n flushStacks = false;\n }\n else {\n await this.flushBuffer(this.lastDepth, this.lastKeys);\n }\n }\n const key = await this.util.unaliasKeyword(keys[depth], keys, depth);\n const parentKey = await this.util.unaliasKeywordParent(keys, depth);\n this.parsingContext.emittedStack[depth] = true;\n let handleKey = true;\n // Keywords inside @reverse is not allowed apart from @context\n if (jsonld_context_parser_1.Util.isValidKeyword(key) && parentKey === '@reverse' && key !== '@context') {\n this.emit('error', new jsonld_context_parser_1.ErrorCoded(`Found the @id '${value}' inside an @reverse property`, jsonld_context_parser_1.ERROR_CODES.INVALID_REVERSE_PROPERTY_MAP));\n }\n // Skip further processing if one of the parent nodes are invalid.\n // We use the validationStack to reuse validation results that were produced before with common key stacks.\n let inProperty = false;\n if (this.parsingContext.validationStack.length > 1) {\n inProperty = this.parsingContext.validationStack[this.parsingContext.validationStack.length - 1].property;\n }\n for (let i = Math.max(1, this.parsingContext.validationStack.length - 1); i < keys.length - 1; i++) {\n const validationResult = this.parsingContext.validationStack[i]\n || (this.parsingContext.validationStack[i] = await this.validateKey(keys.slice(0, i + 1), i, inProperty));\n if (!validationResult.valid) {\n this.parsingContext.emittedStack[depth] = false;\n handleKey = false;\n break;\n }\n else if (!inProperty && validationResult.property) {\n inProperty = true;\n }\n }\n // Skip further processing if this node is part of a literal\n if (this.util.isLiteral(depth)) {\n handleKey = false;\n }\n // Get handler\n if (handleKey) {\n for (const entryHandler of JsonLdParser.ENTRY_HANDLERS) {\n const testResult = await entryHandler.test(this.parsingContext, this.util, key, keys, depth);\n if (testResult) {\n // Pass processing over to the handler\n await entryHandler.handle(this.parsingContext, this.util, key, keys, value, depth, testResult);\n // Flag that this depth is processed\n if (entryHandler.isStackProcessor()) {\n this.parsingContext.processingStack[depth] = true;\n }\n break;\n }\n }\n }\n // Validate value indexes on the root.\n if (depth === 0 && Array.isArray(value)) {\n await this.util.validateValueIndexes(value);\n }\n // When we go up the stack, flush the old stack\n if (flushStacks && depth < this.lastDepth) {\n // Reset our stacks\n this.flushStacks(this.lastDepth);\n }\n this.lastDepth = depth;\n this.lastKeys = keys;\n // Clear the keyword cache at this depth, and everything underneath.\n this.parsingContext.unaliasedKeywordCacheStack.splice(depth - 1);\n }\n /**\n * Flush the processing stacks at the given depth.\n * @param {number} depth A depth.\n */\n flushStacks(depth) {\n this.parsingContext.processingStack.splice(depth, 1);\n this.parsingContext.processingType.splice(depth, 1);\n this.parsingContext.emittedStack.splice(depth, 1);\n this.parsingContext.idStack.splice(depth, 1);\n this.parsingContext.graphStack.splice(depth + 1, 1);\n this.parsingContext.graphContainerTermStack.splice(depth, 1);\n this.parsingContext.jsonLiteralStack.splice(depth, 1);\n this.parsingContext.validationStack.splice(depth - 1, 2);\n this.parsingContext.literalStack.splice(depth, this.parsingContext.literalStack.length - depth);\n // TODO: just like the literal stack, splice all other stack until the end as well?\n }\n /**\n * Flush buffers for the given depth.\n *\n * This should be called after the last entry at a given depth was processed.\n *\n * @param {number} depth A depth.\n * @param {any[]} keys A stack of keys.\n * @return {Promise} A promise resolving if flushing is done.\n */\n async flushBuffer(depth, keys) {\n let subjects = this.parsingContext.idStack[depth];\n if (!subjects) {\n subjects = this.parsingContext.idStack[depth] = [this.util.dataFactory.blankNode()];\n }\n // Flush values at this level\n const valueBuffer = this.parsingContext.unidentifiedValuesBuffer[depth];\n if (valueBuffer) {\n for (const subject of subjects) {\n const depthOffsetGraph = await this.util.getDepthOffsetGraph(depth, keys);\n const graphs = (this.parsingContext.graphStack[depth] || depthOffsetGraph >= 0)\n ? this.parsingContext.idStack[depth - depthOffsetGraph - 1]\n : [await this.util.getGraphContainerValue(keys, depth)];\n if (graphs) {\n for (const graph of graphs) {\n // Flush values to stream if the graph @id is known\n this.parsingContext.emittedStack[depth] = true;\n for (const bufferedValue of valueBuffer) {\n if (bufferedValue.reverse) {\n this.parsingContext.emitQuad(depth, this.util.dataFactory.quad(bufferedValue.object, bufferedValue.predicate, subject, graph));\n }\n else {\n this.parsingContext.emitQuad(depth, this.util.dataFactory.quad(subject, bufferedValue.predicate, bufferedValue.object, graph));\n }\n }\n }\n }\n else {\n // Place the values in the graphs buffer if the graph @id is not yet known\n const subGraphBuffer = this.parsingContext.getUnidentifiedGraphBufferSafe(depth - await this.util.getDepthOffsetGraph(depth, keys) - 1);\n for (const bufferedValue of valueBuffer) {\n if (bufferedValue.reverse) {\n subGraphBuffer.push({\n object: subject,\n predicate: bufferedValue.predicate,\n subject: bufferedValue.object,\n });\n }\n else {\n subGraphBuffer.push({\n object: bufferedValue.object,\n predicate: bufferedValue.predicate,\n subject,\n });\n }\n }\n }\n }\n this.parsingContext.unidentifiedValuesBuffer.splice(depth, 1);\n this.parsingContext.literalStack.splice(depth, 1);\n this.parsingContext.jsonLiteralStack.splice(depth, 1);\n }\n // Flush graphs at this level\n const graphBuffer = this.parsingContext.unidentifiedGraphsBuffer[depth];\n if (graphBuffer) {\n for (const subject of subjects) {\n // A @graph statement at the root without @id relates to the default graph,\n // unless there are top-level properties,\n // others relate to blank nodes.\n const graph = depth === 1 && subject.termType === 'BlankNode'\n && !this.parsingContext.topLevelProperties ? this.util.getDefaultGraph() : subject;\n this.parsingContext.emittedStack[depth] = true;\n for (const bufferedValue of graphBuffer) {\n this.parsingContext.emitQuad(depth, this.util.dataFactory.quad(bufferedValue.subject, bufferedValue.predicate, bufferedValue.object, graph));\n }\n }\n this.parsingContext.unidentifiedGraphsBuffer.splice(depth, 1);\n }\n }\n /**\n * Check if at least one {@link IEntryHandler} validates the entry to true.\n * @param {any[]} keys A stack of keys.\n * @param {number} depth A depth.\n * @param {boolean} inProperty If the current depth is part of a valid property node.\n * @return {Promise<{ valid: boolean, property: boolean }>} A promise resolving to true or false.\n */\n async validateKey(keys, depth, inProperty) {\n for (const entryHandler of JsonLdParser.ENTRY_HANDLERS) {\n if (await entryHandler.validate(this.parsingContext, this.util, keys, depth, inProperty)) {\n return { valid: true, property: inProperty || entryHandler.isPropertyHandler() };\n }\n }\n return { valid: false, property: false };\n }\n /**\n * Attach all required listeners to the JSON parser.\n *\n * This should only be called once.\n */\n attachJsonParserListeners() {\n // Listen to json parser events\n this.jsonParser.onValue = (value) => {\n const depth = this.jsonParser.stack.length;\n const keys = (new Array(depth + 1).fill(0)).map((v, i) => {\n return i === depth ? this.jsonParser.key : this.jsonParser.stack[i].key;\n });\n if (!this.isParsingContextInner(depth)) { // Don't parse inner nodes inside @context\n const valueJobCb = () => this.newOnValueJob(keys, value, depth, true);\n if (!this.parsingContext.streamingProfile\n && !this.parsingContext.contextTree.getContext(keys.slice(0, -1))) {\n // If an out-of-order context is allowed,\n // we have to buffer everything.\n // We store jobs for @context's and @type's separately,\n // because at the end, we have to process them first.\n // We also handle @type because these *could* introduce a type-scoped context.\n if (keys[depth] === '@context') {\n let jobs = this.contextJobs[depth];\n if (!jobs) {\n jobs = this.contextJobs[depth] = [];\n }\n jobs.push(valueJobCb);\n }\n else if (keys[depth] === '@type'\n || typeof keys[depth] === 'number' && keys[depth - 1] === '@type') { // Also capture @type with array values\n // Remove @type from keys, because we want it to apply to parent later on\n this.typeJobs.push({ job: valueJobCb, keys: keys.slice(0, keys.length - 1) });\n }\n else {\n this.contextAwaitingJobs.push({ job: valueJobCb, keys });\n }\n }\n else {\n // Make sure that our value jobs are chained synchronously\n this.lastOnValueJob = this.lastOnValueJob.then(valueJobCb);\n }\n // Execute all buffered jobs on deeper levels\n if (!this.parsingContext.streamingProfile && depth === 0) {\n this.lastOnValueJob = this.lastOnValueJob\n .then(() => this.executeBufferedJobs());\n }\n }\n };\n this.jsonParser.onError = (error) => {\n this.emit('error', error);\n };\n }\n /**\n * Check if the parser is currently parsing an element that is part of an @context entry.\n * @param {number} depth A depth.\n * @return {boolean} A boolean.\n */\n isParsingContextInner(depth) {\n for (let i = depth; i > 0; i--) {\n if (this.jsonParser.stack[i - 1].key === '@context') {\n return true;\n }\n }\n return false;\n }\n /**\n * Execute all buffered jobs.\n * @return {Promise} A promise resolving if all jobs are finished.\n */\n async executeBufferedJobs() {\n // Handle context jobs\n for (const jobs of this.contextJobs) {\n if (jobs) {\n for (const job of jobs) {\n await job();\n }\n }\n }\n // Clear the keyword cache.\n this.parsingContext.unaliasedKeywordCacheStack.splice(0);\n // Handle non-context jobs\n for (const job of this.contextAwaitingJobs) {\n // Check if we have a type (with possible type-scoped context) that should be handled before.\n // We check all possible parent nodes for the current job, from root to leaves.\n if (this.typeJobs.length > 0) {\n // First collect all applicable type jobs\n const applicableTypeJobs = [];\n const applicableTypeJobIds = [];\n for (let i = 0; i < this.typeJobs.length; i++) {\n const typeJob = this.typeJobs[i];\n if (Util_1.Util.isPrefixArray(typeJob.keys, job.keys)) {\n applicableTypeJobs.push(typeJob);\n applicableTypeJobIds.push(i);\n }\n }\n // Next, sort the jobs from short to long key length (to ensure types higher up in the tree to be handled first)\n const sortedTypeJobs = applicableTypeJobs.sort((job1, job2) => job1.keys.length - job2.keys.length);\n // Finally, execute the jobs in order\n for (const typeJob of sortedTypeJobs) {\n await typeJob.job();\n }\n // Remove the executed type jobs\n // Sort first, so we can efficiently splice\n const sortedApplicableTypeJobIds = applicableTypeJobIds.sort().reverse();\n for (const jobId of sortedApplicableTypeJobIds) {\n this.typeJobs.splice(jobId, 1);\n }\n }\n await job.job();\n }\n }\n}\nexports.JsonLdParser = JsonLdParser;\nJsonLdParser.DEFAULT_PROCESSING_MODE = '1.1';\nJsonLdParser.ENTRY_HANDLERS = [\n new EntryHandlerArrayValue_1.EntryHandlerArrayValue(),\n new EntryHandlerKeywordContext_1.EntryHandlerKeywordContext(),\n new EntryHandlerKeywordId_1.EntryHandlerKeywordId(),\n new EntryHandlerKeywordIncluded_1.EntryHandlerKeywordIncluded(),\n new EntryHandlerKeywordGraph_1.EntryHandlerKeywordGraph(),\n new EntryHandlerKeywordNest_1.EntryHandlerKeywordNest(),\n new EntryHandlerKeywordType_1.EntryHandlerKeywordType(),\n new EntryHandlerKeywordValue_1.EntryHandlerKeywordValue(),\n new EntryHandlerContainer_1.EntryHandlerContainer(),\n new EntryHandlerKeywordUnknownFallback_1.EntryHandlerKeywordUnknownFallback(),\n new EntryHandlerPredicate_1.EntryHandlerPredicate(),\n new EntryHandlerInvalidFallback_1.EntryHandlerInvalidFallback(),\n];\n//# sourceMappingURL=JsonLdParser.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ParsingContext = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst ErrorCoded_1 = require(\"jsonld-context-parser/lib/ErrorCoded\");\nconst ContextTree_1 = require(\"./ContextTree\");\nconst JsonLdParser_1 = require(\"./JsonLdParser\");\n/**\n * Data holder for parsing information.\n */\nclass ParsingContext {\n constructor(options) {\n // Initialize settings\n this.contextParser = new jsonld_context_parser_1.ContextParser({ documentLoader: options.documentLoader, skipValidation: options.skipContextValidation });\n this.streamingProfile = !!options.streamingProfile;\n this.baseIRI = options.baseIRI;\n this.produceGeneralizedRdf = !!options.produceGeneralizedRdf;\n this.allowSubjectList = !!options.allowSubjectList;\n this.processingMode = options.processingMode || JsonLdParser_1.JsonLdParser.DEFAULT_PROCESSING_MODE;\n this.strictValues = !!options.strictValues;\n this.validateValueIndexes = !!options.validateValueIndexes;\n this.defaultGraph = options.defaultGraph;\n this.rdfDirection = options.rdfDirection;\n this.normalizeLanguageTags = options.normalizeLanguageTags;\n this.streamingProfileAllowOutOfOrderPlainType = options.streamingProfileAllowOutOfOrderPlainType;\n this.topLevelProperties = false;\n this.activeProcessingMode = parseFloat(this.processingMode);\n // Initialize stacks\n this.processingStack = [];\n this.processingType = [];\n this.emittedStack = [];\n this.idStack = [];\n this.graphStack = [];\n this.graphContainerTermStack = [];\n this.listPointerStack = [];\n this.contextTree = new ContextTree_1.ContextTree();\n this.literalStack = [];\n this.validationStack = [];\n this.unaliasedKeywordCacheStack = [];\n this.jsonLiteralStack = [];\n this.unidentifiedValuesBuffer = [];\n this.unidentifiedGraphsBuffer = [];\n this.pendingContainerFlushBuffers = [];\n this.parser = options.parser;\n if (options.context) {\n this.rootContext = this.parseContext(options.context);\n this.rootContext.then((context) => this.validateContext(context));\n }\n else {\n this.rootContext = Promise.resolve(new jsonld_context_parser_1.JsonLdContextNormalized(this.baseIRI ? { '@base': this.baseIRI, '@__baseDocument': true } : {}));\n }\n }\n /**\n * Parse the given context with the configured options.\n * @param {JsonLdContext} context A context to parse.\n * @param {JsonLdContextNormalized} parentContext An optional parent context.\n * @param {boolean} ignoreProtection If @protected term checks should be ignored.\n * @return {Promise} A promise resolving to the parsed context.\n */\n async parseContext(context, parentContext, ignoreProtection) {\n return this.contextParser.parse(context, {\n baseIRI: this.baseIRI,\n ignoreProtection,\n normalizeLanguageTags: this.normalizeLanguageTags,\n parentContext,\n processingMode: this.activeProcessingMode,\n });\n }\n /**\n * Check if the given context is valid.\n * If not, an error will be thrown.\n * @param {JsonLdContextNormalized} context A context.\n */\n validateContext(context) {\n const activeVersion = context.getContextRaw()['@version'];\n if (activeVersion) {\n if (this.activeProcessingMode && activeVersion > this.activeProcessingMode) {\n throw new ErrorCoded_1.ErrorCoded(`Unsupported JSON-LD version '${activeVersion}' under active processing mode ${this.activeProcessingMode}.`, ErrorCoded_1.ERROR_CODES.PROCESSING_MODE_CONFLICT);\n }\n else {\n if (this.activeProcessingMode && activeVersion < this.activeProcessingMode) {\n throw new ErrorCoded_1.ErrorCoded(`Invalid JSON-LD version ${activeVersion} under active processing mode ${this.activeProcessingMode}.`, ErrorCoded_1.ERROR_CODES.INVALID_VERSION_VALUE);\n }\n this.activeProcessingMode = activeVersion;\n }\n }\n }\n /**\n * Get the context at the given path.\n * @param {keys} keys The path of keys to get the context at.\n * @param {number} offset The path offset, defaults to 1.\n * @return {Promise} A promise resolving to a context.\n */\n async getContext(keys, offset = 1) {\n const keysOriginal = keys;\n // Ignore array keys at the end\n while (typeof keys[keys.length - 1] === 'number') {\n keys = keys.slice(0, keys.length - 1);\n }\n // Handle offset on keys\n if (offset) {\n keys = keys.slice(0, -offset);\n }\n // Determine the closest context\n const contextData = await this.getContextPropagationAware(keys);\n const context = contextData.context;\n // Process property-scoped contexts (high-to-low)\n let contextRaw = context.getContextRaw();\n for (let i = contextData.depth; i < keysOriginal.length - offset; i++) {\n const key = keysOriginal[i];\n const contextKeyEntry = contextRaw[key];\n if (contextKeyEntry && typeof contextKeyEntry === 'object' && '@context' in contextKeyEntry) {\n const scopedContext = (await this.parseContext(contextKeyEntry, contextRaw, true)).getContextRaw();\n const propagate = !(key in scopedContext)\n || scopedContext[key]['@context']['@propagate']; // Propagation is true by default\n if (propagate !== false || i === keysOriginal.length - 1 - offset) {\n contextRaw = scopedContext;\n // Clean up final context\n delete contextRaw['@propagate'];\n contextRaw[key] = Object.assign({}, contextRaw[key]);\n if ('@id' in contextKeyEntry) {\n contextRaw[key]['@id'] = contextKeyEntry['@id'];\n }\n delete contextRaw[key]['@context'];\n if (propagate !== false) {\n this.contextTree.setContext(keysOriginal.slice(0, i + offset), Promise.resolve(new jsonld_context_parser_1.JsonLdContextNormalized(contextRaw)));\n }\n }\n }\n }\n return new jsonld_context_parser_1.JsonLdContextNormalized(contextRaw);\n }\n /**\n * Get the context at the given path.\n * Non-propagating contexts will be skipped,\n * unless the context at that exact depth is retrieved.\n *\n * This ONLY takes into account context propagation logic,\n * so this should usually not be called directly,\n * call {@link #getContext} instead.\n *\n * @param keys The path of keys to get the context at.\n * @return {Promise<{ context: JsonLdContextNormalized, depth: number }>} A context and its depth.\n */\n async getContextPropagationAware(keys) {\n const originalDepth = keys.length;\n let contextData = null;\n let hasApplicablePropertyScopedContext;\n do {\n hasApplicablePropertyScopedContext = false;\n if (contextData && '@__propagateFallback' in contextData.context.getContextRaw()) {\n // If a propagation fallback context has been set,\n // fallback to that context and retry for the same depth.\n contextData.context = new jsonld_context_parser_1.JsonLdContextNormalized(contextData.context.getContextRaw()['@__propagateFallback']);\n }\n else {\n if (contextData) {\n // If we had a previous iteration, jump to the parent of context depth.\n // We must do this because once we get here, last context had propagation disabled,\n // so we check its first parent instead.\n keys = keys.slice(0, contextData.depth - 1);\n }\n contextData = await this.contextTree.getContext(keys) || { context: await this.rootContext, depth: 0 };\n }\n // Allow non-propagating contexts to propagate one level deeper\n // if it defines a property-scoped context that is applicable for the current key.\n // @see https://w3c.github.io/json-ld-api/tests/toRdf-manifest#tc012\n const lastKey = keys[keys.length - 1];\n if (lastKey in contextData.context.getContextRaw()) {\n const lastKeyValue = contextData.context.getContextRaw()[lastKey];\n if (lastKeyValue && typeof lastKeyValue === 'object' && '@context' in lastKeyValue) {\n hasApplicablePropertyScopedContext = true;\n }\n }\n } while (contextData.depth > 0 // Root context has a special case\n && contextData.context.getContextRaw()['@propagate'] === false // Stop loop if propagation is true\n && contextData.depth !== originalDepth // Stop loop if requesting exact depth of non-propagating\n && !hasApplicablePropertyScopedContext);\n // Special case for root context that does not allow propagation.\n // Fallback to empty context in that case.\n if (contextData.depth === 0\n && contextData.context.getContextRaw()['@propagate'] === false\n && contextData.depth !== originalDepth) {\n contextData.context = new jsonld_context_parser_1.JsonLdContextNormalized({});\n }\n return contextData;\n }\n /**\n * Start a new job for parsing the given value.\n * @param {any[]} keys The stack of keys.\n * @param value The value to parse.\n * @param {number} depth The depth to parse at.\n * @param {boolean} lastDepthCheck If the lastDepth check should be done for buffer draining.\n * @return {Promise} A promise resolving when the job is done.\n */\n async newOnValueJob(keys, value, depth, lastDepthCheck) {\n await this.parser.newOnValueJob(keys, value, depth, lastDepthCheck);\n }\n /**\n * Flush the pending container flush buffers\n * @return {boolean} If any pending buffers were flushed.\n */\n async handlePendingContainerFlushBuffers() {\n if (this.pendingContainerFlushBuffers.length > 0) {\n for (const pendingFlushBuffer of this.pendingContainerFlushBuffers) {\n await this.parser.flushBuffer(pendingFlushBuffer.depth, pendingFlushBuffer.keys);\n this.parser.flushStacks(pendingFlushBuffer.depth);\n }\n this.pendingContainerFlushBuffers.splice(0, this.pendingContainerFlushBuffers.length);\n return true;\n }\n else {\n return false;\n }\n }\n /**\n * Emit the given quad into the output stream.\n * @param {number} depth The depth the quad was generated at.\n * @param {Quad} quad A quad to emit.\n */\n emitQuad(depth, quad) {\n if (depth === 1) {\n this.topLevelProperties = true;\n }\n this.parser.push(quad);\n }\n /**\n * Emit the given error into the output stream.\n * @param {Error} error An error to emit.\n */\n emitError(error) {\n this.parser.emit('error', error);\n }\n /**\n * Emit the given context into the output stream under the 'context' event.\n * @param {JsonLdContext} context A context to emit.\n */\n emitContext(context) {\n this.parser.emit('context', context);\n }\n /**\n * Safely get or create the depth value of {@link ParsingContext.unidentifiedValuesBuffer}.\n * @param {number} depth A depth.\n * @return {{predicate: Term; object: Term; reverse: boolean}[]} An element of\n * {@link ParsingContext.unidentifiedValuesBuffer}.\n */\n getUnidentifiedValueBufferSafe(depth) {\n let buffer = this.unidentifiedValuesBuffer[depth];\n if (!buffer) {\n buffer = [];\n this.unidentifiedValuesBuffer[depth] = buffer;\n }\n return buffer;\n }\n /**\n * Safely get or create the depth value of {@link ParsingContext.unidentifiedGraphsBuffer}.\n * @param {number} depth A depth.\n * @return {{predicate: Term; object: Term; reverse: boolean}[]} An element of\n * {@link ParsingContext.unidentifiedGraphsBuffer}.\n */\n getUnidentifiedGraphBufferSafe(depth) {\n let buffer = this.unidentifiedGraphsBuffer[depth];\n if (!buffer) {\n buffer = [];\n this.unidentifiedGraphsBuffer[depth] = buffer;\n }\n return buffer;\n }\n /**\n * @return IExpandOptions The expand options for the active processing mode.\n */\n getExpandOptions() {\n return ParsingContext.EXPAND_OPTIONS[this.activeProcessingMode];\n }\n /**\n * Shift the stack at the given offset to the given depth.\n *\n * This will override anything in the stack at `depth`,\n * and this will remove anything at `depth + depthOffset`\n *\n * @param depth The target depth.\n * @param depthOffset The origin depth, relative to `depth`.\n */\n shiftStack(depth, depthOffset) {\n // Copy the id stack value up one level so that the next job can access the id.\n const deeperIdStack = this.idStack[depth + depthOffset];\n if (deeperIdStack) {\n this.idStack[depth] = deeperIdStack;\n this.emittedStack[depth] = true;\n delete this.idStack[depth + depthOffset];\n }\n // Shorten key stack\n if (this.pendingContainerFlushBuffers.length) {\n for (const buffer of this.pendingContainerFlushBuffers) {\n if (buffer.depth >= depth + depthOffset) {\n buffer.depth -= depthOffset;\n buffer.keys.splice(depth, depthOffset);\n }\n }\n }\n // Splice stacks\n if (this.unidentifiedValuesBuffer[depth + depthOffset]) {\n this.unidentifiedValuesBuffer[depth] = this.unidentifiedValuesBuffer[depth + depthOffset];\n delete this.unidentifiedValuesBuffer[depth + depthOffset];\n }\n // TODO: also do the same for other stacks\n }\n}\nexports.ParsingContext = ParsingContext;\nParsingContext.EXPAND_OPTIONS = {\n 1.0: {\n allowPrefixForcing: false,\n allowPrefixNonGenDelims: false,\n allowVocabRelativeToBase: false,\n },\n 1.1: {\n allowPrefixForcing: true,\n allowPrefixNonGenDelims: false,\n allowVocabRelativeToBase: true,\n },\n};\n//# sourceMappingURL=ParsingContext.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Util = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst rdf_data_factory_1 = require(\"rdf-data-factory\");\nconst EntryHandlerContainer_1 = require(\"./entryhandler/EntryHandlerContainer\");\n// tslint:disable-next-line:no-var-requires\nconst canonicalizeJson = require('canonicalize');\n/**\n * Utility functions and methods.\n */\nclass Util {\n constructor(options) {\n this.parsingContext = options.parsingContext;\n this.dataFactory = options.dataFactory || new rdf_data_factory_1.DataFactory();\n this.rdfFirst = this.dataFactory.namedNode(Util.RDF + 'first');\n this.rdfRest = this.dataFactory.namedNode(Util.RDF + 'rest');\n this.rdfNil = this.dataFactory.namedNode(Util.RDF + 'nil');\n this.rdfType = this.dataFactory.namedNode(Util.RDF + 'type');\n this.rdfJson = this.dataFactory.namedNode(Util.RDF + 'JSON');\n }\n /**\n * Helper function to get the value of a context entry,\n * or fallback to a certain value.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} contextKey A pre-defined JSON-LD key in context entries.\n * @param {string} key A context entry key.\n * @param {string} fallback A fallback value for when the given contextKey\n * could not be found in the value with the given key.\n * @return {string} The value of the given contextKey in the entry behind key in the given context,\n * or the given fallback value.\n */\n static getContextValue(context, contextKey, key, fallback) {\n const entry = context.getContextRaw()[key];\n if (!entry) {\n return fallback;\n }\n const type = entry[contextKey];\n return type === undefined ? fallback : type;\n }\n /**\n * Get the container type of the given key in the context.\n *\n * Should any context-scoping bugs should occur related to this in the future,\n * it may be required to increase the offset from the depth at which the context is retrieved by one (to 2).\n * This is because containers act 2 levels deep.\n *\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key A context entry key.\n * @return {string} The container type.\n */\n static getContextValueContainer(context, key) {\n return Util.getContextValue(context, '@container', key, { '@set': true });\n }\n /**\n * Get the value type of the given key in the context.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key A context entry key.\n * @return {string} The node type.\n */\n static getContextValueType(context, key) {\n const valueType = Util.getContextValue(context, '@type', key, null);\n if (valueType === '@none') {\n return null;\n }\n return valueType;\n }\n /**\n * Get the language of the given key in the context.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key A context entry key.\n * @return {string} The node type.\n */\n static getContextValueLanguage(context, key) {\n return Util.getContextValue(context, '@language', key, context.getContextRaw()['@language'] || null);\n }\n /**\n * Get the direction of the given key in the context.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key A context entry key.\n * @return {string} The node type.\n */\n static getContextValueDirection(context, key) {\n return Util.getContextValue(context, '@direction', key, context.getContextRaw()['@direction'] || null);\n }\n /**\n * Check if the given key in the context is a reversed property.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key A context entry key.\n * @return {boolean} If the context value has a @reverse key.\n */\n static isContextValueReverse(context, key) {\n return !!Util.getContextValue(context, '@reverse', key, null);\n }\n /**\n * Get the @index of the given key in the context.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key A context entry key.\n * @return {string} The index.\n */\n static getContextValueIndex(context, key) {\n return Util.getContextValue(context, '@index', key, context.getContextRaw()['@index'] || null);\n }\n /**\n * Check if the given key refers to a reversed property.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key The property key.\n * @param {string} parentKey The parent key.\n * @return {boolean} If the property must be reversed.\n */\n static isPropertyReverse(context, key, parentKey) {\n // '!==' is needed because reversed properties in a @reverse container should cancel each other out.\n return parentKey === '@reverse' !== Util.isContextValueReverse(context, key);\n }\n /**\n * Check if the given IRI is valid.\n * @param {string} iri A potential IRI.\n * @return {boolean} If the given IRI is valid.\n */\n static isValidIri(iri) {\n return iri !== null && jsonld_context_parser_1.Util.isValidIri(iri);\n }\n /**\n * Check if the given first array (needle) is a prefix of the given second array (haystack).\n * @param needle An array to check if it is a prefix.\n * @param haystack An array to look in.\n */\n static isPrefixArray(needle, haystack) {\n if (needle.length > haystack.length) {\n return false;\n }\n for (let i = 0; i < needle.length; i++) {\n if (needle[i] !== haystack[i]) {\n return false;\n }\n }\n return true;\n }\n /**\n * Make sure that @id-@index pairs are equal over all array values.\n * Reject otherwise.\n * @param {any[]} value An array value.\n * @return {Promise} A promise rejecting if conflicts are present.\n */\n async validateValueIndexes(value) {\n if (this.parsingContext.validateValueIndexes) {\n const indexHashes = {};\n for (const entry of value) {\n if (entry && typeof entry === 'object') {\n const id = entry['@id'];\n const index = entry['@index'];\n if (id && index) {\n const existingIndexValue = indexHashes[id];\n if (existingIndexValue && existingIndexValue !== index) {\n throw new jsonld_context_parser_1.ErrorCoded(`Conflicting @index value for ${id}`, jsonld_context_parser_1.ERROR_CODES.CONFLICTING_INDEXES);\n }\n indexHashes[id] = index;\n }\n }\n }\n }\n }\n /**\n * Convert a given JSON value to an RDF term.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key The current JSON key.\n * @param value A JSON value.\n * @param {number} depth The depth the value is at.\n * @param {string[]} keys The path of keys.\n * @return {Promise} An RDF term array.\n */\n async valueToTerm(context, key, value, depth, keys) {\n // Skip further processing if we have an @type: @json\n if (Util.getContextValueType(context, key) === '@json') {\n return [this.dataFactory.literal(this.valueToJsonString(value), this.rdfJson)];\n }\n const type = typeof value;\n switch (type) {\n case 'object':\n // Skip if we have a null or undefined object\n if (value === null || value === undefined) {\n return [];\n }\n // Special case for arrays\n if (Array.isArray(value)) {\n // We handle arrays at value level so we can emit earlier, so this is handled already when we get here.\n // Empty context-based lists are emitted at this place, because our streaming algorithm doesn't detect those.\n if ('@list' in Util.getContextValueContainer(context, key)) {\n if (value.length === 0) {\n return [this.rdfNil];\n }\n else {\n return this.parsingContext.idStack[depth + 1] || [];\n }\n }\n await this.validateValueIndexes(value);\n return [];\n }\n // Handle property-scoped contexts\n context = await this.getContextSelfOrPropertyScoped(context, key);\n // Handle local context in the value\n if ('@context' in value) {\n context = await this.parsingContext.parseContext(value['@context'], (await this.parsingContext.getContext(keys, 0)).getContextRaw());\n }\n // In all other cases, we have a hash\n value = await this.unaliasKeywords(value, keys, depth, context); // Un-alias potential keywords in this hash\n if ('@value' in value) {\n let val;\n let valueLanguage;\n let valueDirection;\n let valueType;\n let valueIndex; // We don't use the index, but we need to check its type for spec-compliance\n for (key in value) {\n const subValue = value[key];\n switch (key) {\n case '@value':\n val = subValue;\n break;\n case '@language':\n valueLanguage = subValue;\n break;\n case '@direction':\n valueDirection = subValue;\n break;\n case '@type':\n valueType = subValue;\n break;\n case '@index':\n valueIndex = subValue;\n break;\n default:\n throw new jsonld_context_parser_1.ErrorCoded(`Unknown value entry '${key}' in @value: ${JSON.stringify(value)}`, jsonld_context_parser_1.ERROR_CODES.INVALID_VALUE_OBJECT);\n }\n }\n // Skip further processing if we have an @type: @json\n if (await this.unaliasKeyword(valueType, keys, depth, true, context) === '@json') {\n return [this.dataFactory.literal(this.valueToJsonString(val), this.rdfJson)];\n }\n // Validate @value\n if (val === null) {\n return [];\n }\n if (typeof val === 'object') {\n throw new jsonld_context_parser_1.ErrorCoded(`The value of an '@value' can not be an object, got '${JSON.stringify(val)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_VALUE_OBJECT_VALUE);\n }\n // Validate @index\n if (this.parsingContext.validateValueIndexes && valueIndex && typeof valueIndex !== 'string') {\n throw new jsonld_context_parser_1.ErrorCoded(`The value of an '@index' must be a string, got '${JSON.stringify(valueIndex)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_INDEX_VALUE);\n }\n // Validate @language and @direction\n if (valueLanguage) {\n if (typeof val !== 'string') {\n throw new jsonld_context_parser_1.ErrorCoded(`When an '@language' is set, the value of '@value' must be a string, got '${JSON.stringify(val)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_LANGUAGE_TAGGED_VALUE);\n }\n if (!jsonld_context_parser_1.ContextParser.validateLanguage(valueLanguage, this.parsingContext.strictValues, jsonld_context_parser_1.ERROR_CODES.INVALID_LANGUAGE_TAGGED_STRING)) {\n return [];\n }\n // Language tags are always normalized to lowercase in 1.0.\n if (this.parsingContext.normalizeLanguageTags || this.parsingContext.activeProcessingMode === 1.0) {\n valueLanguage = valueLanguage.toLowerCase();\n }\n }\n if (valueDirection) {\n if (typeof val !== 'string') {\n throw new Error(`When an '@direction' is set, the value of '@value' must be a string, got '${JSON.stringify(val)}'`);\n }\n if (!jsonld_context_parser_1.ContextParser.validateDirection(valueDirection, this.parsingContext.strictValues)) {\n return [];\n }\n }\n // Check @language and @direction\n if (valueLanguage && valueDirection && this.parsingContext.rdfDirection) {\n if (valueType) {\n throw new jsonld_context_parser_1.ErrorCoded(`Can not have '@language', '@direction' and '@type' in a value: '${JSON\n .stringify(value)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_VALUE_OBJECT);\n }\n return this.nullableTermToArray(this\n .createLanguageDirectionLiteral(depth, val, valueLanguage, valueDirection));\n }\n else if (valueLanguage) { // Check @language\n if (valueType) {\n throw new jsonld_context_parser_1.ErrorCoded(`Can not have both '@language' and '@type' in a value: '${JSON.stringify(value)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_VALUE_OBJECT);\n }\n return [this.dataFactory.literal(val, valueLanguage)];\n }\n else if (valueDirection && this.parsingContext.rdfDirection) { // Check @direction\n if (valueType) {\n throw new jsonld_context_parser_1.ErrorCoded(`Can not have both '@direction' and '@type' in a value: '${JSON.stringify(value)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_VALUE_OBJECT);\n }\n return this.nullableTermToArray(this\n .createLanguageDirectionLiteral(depth, val, valueLanguage, valueDirection));\n }\n else if (valueType) { // Validate @type\n if (typeof valueType !== 'string') {\n throw new jsonld_context_parser_1.ErrorCoded(`The value of an '@type' must be a string, got '${JSON.stringify(valueType)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_TYPED_VALUE);\n }\n const typeTerm = this.createVocabOrBaseTerm(context, valueType);\n if (!typeTerm) {\n throw new jsonld_context_parser_1.ErrorCoded(`Invalid '@type' value, got '${JSON.stringify(valueType)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_TYPED_VALUE);\n }\n if (typeTerm.termType !== 'NamedNode') {\n throw new jsonld_context_parser_1.ErrorCoded(`Illegal value type (${typeTerm.termType}): ${valueType}`, jsonld_context_parser_1.ERROR_CODES.INVALID_TYPED_VALUE);\n }\n return [this.dataFactory.literal(val, typeTerm)];\n }\n // We don't pass the context, because context-based things like @language should be ignored\n return await this.valueToTerm(new jsonld_context_parser_1.JsonLdContextNormalized({}), key, val, depth, keys);\n }\n else if ('@set' in value) {\n // No other entries are allow in this value\n if (Object.keys(value).length > 1) {\n throw new jsonld_context_parser_1.ErrorCoded(`Found illegal neighbouring entries next to @set for key: '${key}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT);\n }\n // No need to do anything here, this is handled at the deeper level.\n return [];\n }\n else if ('@list' in value) {\n // No other entries are allowed in this value\n if (Object.keys(value).length > 1) {\n throw new jsonld_context_parser_1.ErrorCoded(`Found illegal neighbouring entries next to @list for key: '${key}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT);\n }\n const listValue = value[\"@list\"];\n // We handle lists at value level so we can emit earlier, so this is handled already when we get here.\n // Empty anonymous lists are emitted at this place, because our streaming algorithm doesn't detect those.\n if (Array.isArray(listValue)) {\n if (listValue.length === 0) {\n return [this.rdfNil];\n }\n else {\n return this.parsingContext.idStack[depth + 1] || [];\n }\n }\n else {\n // We only have a single list element here, so emit this directly as single element\n return await this.valueToTerm(await this.parsingContext.getContext(keys), key, listValue, depth - 1, keys.slice(0, -1));\n }\n }\n else if ('@reverse' in value && typeof value['@reverse'] === 'boolean') {\n // We handle reverse properties at value level so we can emit earlier,\n // so this is handled already when we get here.\n return [];\n }\n else if ('@graph' in Util.getContextValueContainer(await this.parsingContext.getContext(keys), key)) {\n // We are processing a graph container\n const graphContainerEntries = this.parsingContext.graphContainerTermStack[depth + 1];\n return graphContainerEntries ? Object.values(graphContainerEntries) : [this.dataFactory.blankNode()];\n }\n else if (\"@id\" in value) {\n // Use deeper context if the value node contains other properties next to @id.\n if (Object.keys(value).length > 1) {\n context = await this.parsingContext.getContext(keys, 0);\n }\n // Handle local context in the value\n if ('@context' in value) {\n context = await this.parsingContext.parseContext(value['@context'], context.getContextRaw());\n }\n if (value[\"@type\"] === '@vocab') {\n return this.nullableTermToArray(this.createVocabOrBaseTerm(context, value[\"@id\"]));\n }\n else {\n return this.nullableTermToArray(this.resourceToTerm(context, value[\"@id\"]));\n }\n }\n else {\n // Only make a blank node if at least one triple was emitted at the value's level.\n if (this.parsingContext.emittedStack[depth + 1]\n || (value && typeof value === 'object' && Object.keys(value).length === 0)) {\n return (this.parsingContext.idStack[depth + 1]\n || (this.parsingContext.idStack[depth + 1] = [this.dataFactory.blankNode()]));\n }\n else {\n return [];\n }\n }\n case 'string':\n return this.nullableTermToArray(this.stringValueToTerm(depth, await this.getContextSelfOrPropertyScoped(context, key), key, value, null));\n case 'boolean':\n return this.nullableTermToArray(this.stringValueToTerm(depth, await this.getContextSelfOrPropertyScoped(context, key), key, Boolean(value).toString(), this.dataFactory.namedNode(Util.XSD_BOOLEAN)));\n case 'number':\n return this.nullableTermToArray(this.stringValueToTerm(depth, await this.getContextSelfOrPropertyScoped(context, key), key, value, this.dataFactory.namedNode(value % 1 === 0 && value < 1e21 ? Util.XSD_INTEGER : Util.XSD_DOUBLE)));\n default:\n this.parsingContext.emitError(new Error(`Could not determine the RDF type of a ${type}`));\n return [];\n }\n }\n /**\n * If the context defines a property-scoped context for the given key,\n * that context will be returned.\n * Otherwise, the given context will be returned as-is.\n *\n * This should be used for valueToTerm cases that are not objects.\n * @param context A context.\n * @param key A JSON key.\n */\n async getContextSelfOrPropertyScoped(context, key) {\n const contextKeyEntry = context.getContextRaw()[key];\n if (contextKeyEntry && typeof contextKeyEntry === 'object' && '@context' in contextKeyEntry) {\n context = await this.parsingContext.parseContext(contextKeyEntry, context.getContextRaw(), true);\n }\n return context;\n }\n /**\n * If the given term is null, return an empty array, otherwise return an array with the single given term.\n * @param term A term.\n */\n nullableTermToArray(term) {\n return term ? [term] : [];\n }\n /**\n * Convert a given JSON key to an RDF predicate term,\n * based on @vocab.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param key A JSON key.\n * @return {RDF.NamedNode} An RDF named node.\n */\n predicateToTerm(context, key) {\n const expanded = context.expandTerm(key, true, this.parsingContext.getExpandOptions());\n // Immediately return if the predicate was disabled in the context\n if (!expanded) {\n return null;\n }\n // Check if the predicate is a blank node\n if (expanded[0] === '_' && expanded[1] === ':') {\n if (this.parsingContext.produceGeneralizedRdf) {\n return this.dataFactory.blankNode(expanded.substr(2));\n }\n else {\n return null;\n }\n }\n // Check if the predicate is a valid IRI\n if (Util.isValidIri(expanded)) {\n return this.dataFactory.namedNode(expanded);\n }\n else {\n if (expanded && this.parsingContext.strictValues) {\n this.parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Invalid predicate IRI: ${expanded}`, jsonld_context_parser_1.ERROR_CODES.INVALID_IRI_MAPPING));\n }\n else {\n return null;\n }\n }\n return null;\n }\n /**\n * Convert a given JSON key to an RDF resource term or blank node,\n * based on @base.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param key A JSON key.\n * @return {RDF.NamedNode} An RDF named node or null.\n */\n resourceToTerm(context, key) {\n if (key.startsWith('_:')) {\n return this.dataFactory.blankNode(key.substr(2));\n }\n const iri = context.expandTerm(key, false, this.parsingContext.getExpandOptions());\n if (!Util.isValidIri(iri)) {\n if (iri && this.parsingContext.strictValues) {\n this.parsingContext.emitError(new Error(`Invalid resource IRI: ${iri}`));\n }\n else {\n return null;\n }\n }\n return this.dataFactory.namedNode(iri);\n }\n /**\n * Convert a given JSON key to an RDF resource term.\n * It will do this based on the @vocab,\n * and fallback to @base.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param key A JSON key.\n * @return {RDF.NamedNode} An RDF named node or null.\n */\n createVocabOrBaseTerm(context, key) {\n if (key.startsWith('_:')) {\n return this.dataFactory.blankNode(key.substr(2));\n }\n const expandOptions = this.parsingContext.getExpandOptions();\n let expanded = context.expandTerm(key, true, expandOptions);\n if (expanded === key) {\n expanded = context.expandTerm(key, false, expandOptions);\n }\n if (!Util.isValidIri(expanded)) {\n if (expanded && this.parsingContext.strictValues && !expanded.startsWith('@')) {\n this.parsingContext.emitError(new Error(`Invalid term IRI: ${expanded}`));\n }\n else {\n return null;\n }\n }\n return this.dataFactory.namedNode(expanded);\n }\n /**\n * Ensure that the given value becomes a string.\n * @param {string | number} value A string or number.\n * @param {NamedNode} datatype The intended datatype.\n * @return {string} The returned string.\n */\n intToString(value, datatype) {\n if (typeof value === 'number') {\n if (Number.isFinite(value)) {\n const isInteger = value % 1 === 0;\n if (isInteger && (!datatype || datatype.value !== Util.XSD_DOUBLE)) {\n return Number(value).toString();\n }\n else {\n return value.toExponential(15).replace(/(\\d)0*e\\+?/, '$1E');\n }\n }\n else {\n return value > 0 ? 'INF' : '-INF';\n }\n }\n else {\n return value;\n }\n }\n /**\n * Convert a given JSON string value to an RDF term.\n * @param {number} depth The current stack depth.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key The current JSON key.\n * @param {string} value A JSON value.\n * @param {NamedNode} defaultDatatype The default datatype for the given value.\n * @return {RDF.Term} An RDF term or null.\n */\n stringValueToTerm(depth, context, key, value, defaultDatatype) {\n // Check the datatype from the context\n const contextType = Util.getContextValueType(context, key);\n if (contextType) {\n if (contextType === '@id') {\n if (!defaultDatatype) {\n return this.resourceToTerm(context, this.intToString(value, defaultDatatype));\n }\n }\n else if (contextType === '@vocab') {\n if (!defaultDatatype) {\n return this.createVocabOrBaseTerm(context, this.intToString(value, defaultDatatype));\n }\n }\n else {\n defaultDatatype = this.dataFactory.namedNode(contextType);\n }\n }\n // If we don't find such a datatype, check the language from the context\n if (!defaultDatatype) {\n const contextLanguage = Util.getContextValueLanguage(context, key);\n const contextDirection = Util.getContextValueDirection(context, key);\n if (contextDirection && this.parsingContext.rdfDirection) {\n return this.createLanguageDirectionLiteral(depth, this.intToString(value, defaultDatatype), contextLanguage, contextDirection);\n }\n else {\n return this.dataFactory.literal(this.intToString(value, defaultDatatype), contextLanguage);\n }\n }\n // If all else fails, make a literal based on the default content type\n return this.dataFactory.literal(this.intToString(value, defaultDatatype), defaultDatatype);\n }\n /**\n * Create a literal for the given value with the given language and direction.\n * Auxiliary quads may be emitted.\n * @param {number} depth The current stack depth.\n * @param {string} value A string value.\n * @param {string} language A language tag.\n * @param {string} direction A direction.\n * @return {Term} An RDF term.\n */\n createLanguageDirectionLiteral(depth, value, language, direction) {\n if (this.parsingContext.rdfDirection === 'i18n-datatype') {\n // Create a datatyped literal, by encoding the language and direction into https://www.w3.org/ns/i18n#.\n if (!language) {\n language = '';\n }\n return this.dataFactory.literal(value, this.dataFactory.namedNode(`https://www.w3.org/ns/i18n#${language}_${direction}`));\n }\n else {\n // Reify the literal.\n const valueNode = this.dataFactory.blankNode();\n const graph = this.getDefaultGraph();\n this.parsingContext.emitQuad(depth, this.dataFactory.quad(valueNode, this.dataFactory.namedNode(Util.RDF + 'value'), this.dataFactory.literal(value), graph));\n if (language) {\n this.parsingContext.emitQuad(depth, this.dataFactory.quad(valueNode, this.dataFactory.namedNode(Util.RDF + 'language'), this.dataFactory.literal(language), graph));\n }\n this.parsingContext.emitQuad(depth, this.dataFactory.quad(valueNode, this.dataFactory.namedNode(Util.RDF + 'direction'), this.dataFactory.literal(direction), graph));\n return valueNode;\n }\n }\n /**\n * Stringify the given JSON object to a canonical JSON string.\n * @param value Any valid JSON value.\n * @return {string} A canonical JSON string.\n */\n valueToJsonString(value) {\n return canonicalizeJson(value);\n }\n /**\n * If the key is not a keyword, try to check if it is an alias for a keyword,\n * and if so, un-alias it.\n * @param {string} key A key, can be falsy.\n * @param {string[]} keys The path of keys.\n * @param {number} depth The depth to\n * @param {boolean} disableCache If the cache should be disabled\n * @param {JsonLdContextNormalized} context A context to unalias with,\n * will fallback to retrieving the context for the given keys.\n * @return {Promise} A promise resolving to the key itself, or another key.\n */\n async unaliasKeyword(key, keys, depth, disableCache, context) {\n // Numbers can not be an alias\n if (Number.isInteger(key)) {\n return key;\n }\n // Try to grab from cache if it was already un-aliased before.\n if (!disableCache) {\n const cachedUnaliasedKeyword = this.parsingContext.unaliasedKeywordCacheStack[depth];\n if (cachedUnaliasedKeyword) {\n return cachedUnaliasedKeyword;\n }\n }\n if (!jsonld_context_parser_1.Util.isPotentialKeyword(key)) {\n context = context || await this.parsingContext.getContext(keys);\n let unliased = context.getContextRaw()[key];\n if (unliased && typeof unliased === 'object') {\n unliased = unliased['@id'];\n }\n if (jsonld_context_parser_1.Util.isValidKeyword(unliased)) {\n key = unliased;\n }\n }\n return disableCache ? key : (this.parsingContext.unaliasedKeywordCacheStack[depth] = key);\n }\n /**\n * Unalias the keyword of the parent.\n * This adds a safety check if no parent exist.\n * @param {any[]} keys A stack of keys.\n * @param {number} depth The current depth.\n * @return {Promise} A promise resolving to the parent key, or another key.\n */\n async unaliasKeywordParent(keys, depth) {\n return await this.unaliasKeyword(depth > 0 && keys[depth - 1], keys, depth - 1);\n }\n /**\n * Un-alias all keywords in the given hash.\n * @param {{[p: string]: any}} hash A hash object.\n * @param {string[]} keys The path of keys.\n * @param {number} depth The depth.\n * @param {JsonLdContextNormalized} context A context to unalias with,\n * will fallback to retrieving the context for the given keys.\n * @return {Promise<{[p: string]: any}>} A promise resolving to the new hash.\n */\n async unaliasKeywords(hash, keys, depth, context) {\n const newHash = {};\n for (const key in hash) {\n newHash[await this.unaliasKeyword(key, keys, depth + 1, true, context)] = hash[key];\n }\n return newHash;\n }\n /**\n * Check if we are processing a literal (including JSON literals) at the given depth.\n * This will also check higher levels,\n * because if a parent is a literal,\n * then the deeper levels are definitely a literal as well.\n * @param {number} depth The depth.\n * @return {boolean} If we are processing a literal.\n */\n isLiteral(depth) {\n for (let i = depth; i >= 0; i--) {\n if (this.parsingContext.literalStack[i] || this.parsingContext.jsonLiteralStack[i]) {\n return true;\n }\n }\n return false;\n }\n /**\n * Check how many parents should be skipped for checking the @graph for the given node.\n *\n * @param {number} depth The depth of the node.\n * @param {any[]} keys An array of keys.\n * @return {number} The graph depth offset.\n */\n async getDepthOffsetGraph(depth, keys) {\n for (let i = depth - 1; i > 0; i--) {\n if (await this.unaliasKeyword(keys[i], keys, i) === '@graph') {\n // Skip further processing if we are already in an @graph-@id or @graph-@index container\n const containers = (await EntryHandlerContainer_1.EntryHandlerContainer.getContainerHandler(this.parsingContext, keys, i)).containers;\n if (EntryHandlerContainer_1.EntryHandlerContainer.isComplexGraphContainer(containers)) {\n return -1;\n }\n return depth - i - 1;\n }\n }\n return -1;\n }\n /**\n * Check if the given subject is of a valid type.\n * This should be called when applying @reverse'd properties.\n * @param {Term} subject A subject.\n */\n validateReverseSubject(subject) {\n if (subject.termType === 'Literal') {\n throw new jsonld_context_parser_1.ErrorCoded(`Found illegal literal in subject position: ${subject.value}`, jsonld_context_parser_1.ERROR_CODES.INVALID_REVERSE_PROPERTY_VALUE);\n }\n }\n /**\n * Get the default graph.\n * @return {Term} An RDF term.\n */\n getDefaultGraph() {\n return this.parsingContext.defaultGraph || this.dataFactory.defaultGraph();\n }\n /**\n * Get the current graph, while taking into account a graph that can be defined via @container: @graph.\n * If not within a graph container, the default graph will be returned.\n * @param keys The current keys.\n * @param depth The current depth.\n */\n async getGraphContainerValue(keys, depth) {\n // Default to default graph\n let graph = this.getDefaultGraph();\n // Check if we are in an @container: @graph.\n const { containers, depth: depthContainer } = await EntryHandlerContainer_1.EntryHandlerContainer\n .getContainerHandler(this.parsingContext, keys, depth);\n if ('@graph' in containers) {\n // Get the graph from the stack.\n const graphContainerIndex = EntryHandlerContainer_1.EntryHandlerContainer.getContainerGraphIndex(containers, depthContainer, keys);\n const entry = this.parsingContext.graphContainerTermStack[depthContainer];\n graph = entry ? entry[graphContainerIndex] : null;\n // Set the graph in the stack if none has been set yet.\n if (!graph) {\n let graphId = null;\n if ('@id' in containers) {\n const keyUnaliased = await this.getContainerKey(keys[depthContainer], keys, depthContainer);\n if (keyUnaliased !== null) {\n graphId = await this.resourceToTerm(await this.parsingContext.getContext(keys), keyUnaliased);\n }\n }\n if (!graphId) {\n graphId = this.dataFactory.blankNode();\n }\n if (!this.parsingContext.graphContainerTermStack[depthContainer]) {\n this.parsingContext.graphContainerTermStack[depthContainer] = {};\n }\n graph = this.parsingContext.graphContainerTermStack[depthContainer][graphContainerIndex] = graphId;\n }\n }\n return graph;\n }\n /**\n * Get the properties depth for retrieving properties.\n *\n * Typically, the properties depth will be identical to the given depth.\n *\n * The following exceptions apply:\n * * When the parent is @reverse, the depth is decremented by one.\n * * When @nest parents are found, the depth is decremented by the number of @nest parents.\n * If in combination with the exceptions above an intermediary array is discovered,\n * the depth is also decremented by this number of arrays.\n *\n * @param keys The current key chain.\n * @param depth The current depth.\n */\n async getPropertiesDepth(keys, depth) {\n let lastValidDepth = depth;\n for (let i = depth - 1; i > 0; i--) {\n if (typeof keys[i] !== 'number') { // Skip array keys\n const parentKey = await this.unaliasKeyword(keys[i], keys, i);\n if (parentKey === '@reverse') {\n return i;\n }\n else if (parentKey === '@nest') {\n lastValidDepth = i;\n }\n else {\n return lastValidDepth;\n }\n }\n }\n return lastValidDepth;\n }\n /**\n * Get the key for the current container entry.\n * @param key A key, can be falsy.\n * @param keys The key chain.\n * @param depth The current depth to get the key from.\n * @return Promise resolving to the key.\n * Null will be returned for @none entries, with aliasing taken into account.\n */\n async getContainerKey(key, keys, depth) {\n const keyUnaliased = await this.unaliasKeyword(key, keys, depth);\n return keyUnaliased === '@none' ? null : keyUnaliased;\n }\n}\nexports.Util = Util;\nUtil.XSD = 'http://www.w3.org/2001/XMLSchema#';\nUtil.XSD_BOOLEAN = Util.XSD + 'boolean';\nUtil.XSD_INTEGER = Util.XSD + 'integer';\nUtil.XSD_DOUBLE = Util.XSD + 'double';\nUtil.RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';\n//# sourceMappingURL=Util.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContainerHandlerIdentifier = void 0;\n/**\n * Container handler for @id.\n *\n * It assumes that the current key is the identifier of the current value.\n * This will add this value to the parent node.\n */\nclass ContainerHandlerIdentifier {\n canCombineWithGraph() {\n return true;\n }\n async handle(containers, parsingContext, util, keys, value, depth) {\n let id;\n // First check if the child node already has a defined id.\n if (parsingContext.emittedStack[depth + 1] && parsingContext.idStack[depth + 1]) {\n // Use the existing identifier\n id = parsingContext.idStack[depth + 1][0];\n }\n else {\n // Create the identifier\n const keyUnaliased = await util.getContainerKey(keys[depth], keys, depth);\n const maybeId = keyUnaliased !== null\n ? await util.resourceToTerm(await parsingContext.getContext(keys), keys[depth])\n : util.dataFactory.blankNode();\n // Do nothing if the id is invalid\n if (!maybeId) {\n parsingContext.emittedStack[depth] = false; // Don't emit the predicate owning this container.\n return;\n }\n id = maybeId;\n // Insert the id into the stack so that buffered children can make us of it.\n parsingContext.idStack[depth + 1] = [id];\n }\n // Insert the id into the stack so that parents can make use of it.\n // Insert it as an array because multiple id container entries may exist\n let ids = parsingContext.idStack[depth];\n if (!ids) {\n ids = parsingContext.idStack[depth] = [];\n }\n // Only insert the term if it does not exist yet in the array.\n if (!ids.some((term) => term.equals(id))) {\n ids.push(id);\n }\n // Flush any pending flush buffers\n if (!await parsingContext.handlePendingContainerFlushBuffers()) {\n parsingContext.emittedStack[depth] = false; // Don't emit the predicate owning this container.\n }\n }\n}\nexports.ContainerHandlerIdentifier = ContainerHandlerIdentifier;\n//# sourceMappingURL=ContainerHandlerIdentifier.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContainerHandlerIndex = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst EntryHandlerPredicate_1 = require(\"../entryhandler/EntryHandlerPredicate\");\nconst Util_1 = require(\"../Util\");\n/**\n * Container handler for @index.\n *\n * This will ignore the current key and add this entry to the parent node.\n */\nclass ContainerHandlerIndex {\n canCombineWithGraph() {\n return true;\n }\n async handle(containers, parsingContext, util, keys, value, depth) {\n if (!Array.isArray(value)) {\n const graphContainer = '@graph' in containers;\n // Check if the container is a property-based container by checking if there is a valid @index.\n const context = await parsingContext.getContext(keys);\n const indexKey = keys[depth - 1];\n const indexPropertyRaw = Util_1.Util.getContextValueIndex(context, indexKey);\n if (indexPropertyRaw) {\n // Validate the @index value\n if (jsonld_context_parser_1.Util.isPotentialKeyword(indexPropertyRaw)) {\n throw new jsonld_context_parser_1.ErrorCoded(`Keywords can not be used as @index value, got: ${indexPropertyRaw}`, jsonld_context_parser_1.ERROR_CODES.INVALID_TERM_DEFINITION);\n }\n if (typeof indexPropertyRaw !== 'string') {\n throw new jsonld_context_parser_1.ErrorCoded(`@index values must be strings, got: ${indexPropertyRaw}`, jsonld_context_parser_1.ERROR_CODES.INVALID_TERM_DEFINITION);\n }\n // When @index is used, values must be node values, unless @type: @id is defined in the context\n if (typeof value !== 'object') {\n // Error if we don't have @type: @id\n if (Util_1.Util.getContextValueType(context, indexKey) !== '@id') {\n throw new jsonld_context_parser_1.ErrorCoded(`Property-based index containers require nodes as values or strings with @type: @id, but got: ${value}`, jsonld_context_parser_1.ERROR_CODES.INVALID_VALUE_OBJECT);\n }\n // Add an @id to the stack, so our expanded @index value can make use of it\n const id = util.resourceToTerm(context, value);\n if (id) {\n parsingContext.idStack[depth + 1] = [id];\n }\n }\n // Expand the @index value\n const indexProperty = util.createVocabOrBaseTerm(context, indexPropertyRaw);\n if (indexProperty) {\n const indexValues = await util.valueToTerm(context, indexPropertyRaw, await util.getContainerKey(keys[depth], keys, depth), depth, keys);\n if (graphContainer) {\n // When we're in a graph container, attach the index to the graph identifier\n const graphId = await util.getGraphContainerValue(keys, depth + 1);\n for (const indexValue of indexValues) {\n parsingContext.emitQuad(depth, util.dataFactory.quad(graphId, indexProperty, indexValue, util.getDefaultGraph()));\n }\n }\n else {\n // Otherwise, attach the index to the node identifier\n for (const indexValue of indexValues) {\n await EntryHandlerPredicate_1.EntryHandlerPredicate.handlePredicateObject(parsingContext, util, keys, depth + 1, indexProperty, indexValue, false);\n }\n }\n }\n }\n const depthOffset = graphContainer ? 2 : 1;\n await parsingContext.newOnValueJob(keys.slice(0, keys.length - depthOffset), value, depth - depthOffset, true);\n // Flush any pending flush buffers\n await parsingContext.handlePendingContainerFlushBuffers();\n }\n parsingContext.emittedStack[depth] = false; // We have emitted a level higher\n }\n}\nexports.ContainerHandlerIndex = ContainerHandlerIndex;\n//# sourceMappingURL=ContainerHandlerIndex.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContainerHandlerLanguage = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\n/**\n * Container handler for @language.\n *\n * It assumes that the current key is the language of the current value.\n * This will add this value to the parent node.\n */\nclass ContainerHandlerLanguage {\n canCombineWithGraph() {\n return false;\n }\n async handle(containers, parsingContext, util, keys, value, depth) {\n const language = await util.getContainerKey(keys[depth], keys, depth);\n if (Array.isArray(value)) {\n // No type-checking needed, will be handled on each value when this handler is called recursively.\n value = value.map((subValue) => ({ '@value': subValue, '@language': language }));\n }\n else {\n if (typeof value !== 'string') {\n throw new jsonld_context_parser_1.ErrorCoded(`Got invalid language map value, got '${JSON.stringify(value)}', but expected string`, jsonld_context_parser_1.ERROR_CODES.INVALID_LANGUAGE_MAP_VALUE);\n }\n value = { '@value': value, '@language': language };\n }\n await parsingContext.newOnValueJob(keys.slice(0, keys.length - 1), value, depth - 1, true);\n parsingContext.emittedStack[depth] = false; // We have emitted a level higher\n }\n}\nexports.ContainerHandlerLanguage = ContainerHandlerLanguage;\n//# sourceMappingURL=ContainerHandlerLanguage.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContainerHandlerType = void 0;\nconst EntryHandlerPredicate_1 = require(\"../entryhandler/EntryHandlerPredicate\");\nconst Util_1 = require(\"../Util\");\n/**\n * Container handler for @type.\n *\n * This will add this entry to the parent node, and use the current key as an rdf:type value.\n */\nclass ContainerHandlerType {\n canCombineWithGraph() {\n return false;\n }\n async handle(containers, parsingContext, util, keys, value, depth) {\n if (!Array.isArray(value)) {\n if (typeof value === 'string') {\n // Determine the @type of the container\n const context = await parsingContext.getContext(keys);\n const containerTypeType = Util_1.Util.getContextValueType(context, keys[depth - 1]);\n // String values refer to node references\n const id = containerTypeType === '@vocab'\n ? await util.createVocabOrBaseTerm(context, value)\n : await util.resourceToTerm(context, value);\n if (id) {\n // Handle the value of this node as @id, which will also cause the predicate from above to be emitted.\n const subValue = { '@id': id.termType === 'NamedNode' ? id.value : value };\n await parsingContext.newOnValueJob(keys.slice(0, keys.length - 1), subValue, depth - 1, true);\n // Set the id in the stack so it can be used for the rdf:type handling later on\n parsingContext.idStack[depth + 1] = [id];\n }\n }\n else {\n // Other values are handled by handling them as a proper job\n // Check needed for cases where entries don't have an explicit @id\n const entryHasIdentifier = !!parsingContext.idStack[depth + 1];\n // Handle the value of this node, which will also cause the predicate from above to be emitted.\n if (!entryHasIdentifier) {\n delete parsingContext.idStack[depth]; // Force new (blank node) identifier\n }\n await parsingContext.newOnValueJob(keys.slice(0, keys.length - 1), value, depth - 1, true);\n if (!entryHasIdentifier) {\n parsingContext.idStack[depth + 1] = parsingContext.idStack[depth]; // Copy the id to the child node, for @type\n }\n }\n // Identify the type to emit.\n const keyOriginal = await util.getContainerKey(keys[depth], keys, depth);\n const type = keyOriginal !== null\n ? util.createVocabOrBaseTerm(await parsingContext.getContext(keys), keyOriginal)\n : null;\n if (type) {\n // Push the type to the stack using the rdf:type predicate\n await EntryHandlerPredicate_1.EntryHandlerPredicate.handlePredicateObject(parsingContext, util, keys, depth + 1, util.rdfType, type, false);\n }\n // Flush any pending flush buffers\n await parsingContext.handlePendingContainerFlushBuffers();\n }\n parsingContext.emittedStack[depth] = false; // Don't emit the predicate owning this container.\n }\n}\nexports.ContainerHandlerType = ContainerHandlerType;\n//# sourceMappingURL=ContainerHandlerType.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerArrayValue = void 0;\nconst Util_1 = require(\"../Util\");\n/**\n * Handles values that are part of an array.\n */\nclass EntryHandlerArrayValue {\n isPropertyHandler() {\n return false;\n }\n isStackProcessor() {\n return true;\n }\n async validate(parsingContext, util, keys, depth, inProperty) {\n return this.test(parsingContext, util, null, keys, depth);\n }\n async test(parsingContext, util, key, keys, depth) {\n return typeof keys[depth] === 'number';\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n let parentKey = await util.unaliasKeywordParent(keys, depth);\n // Check if we have an anonymous list\n if (parentKey === '@list') {\n // Our value is part of an array\n // Determine the list root key\n let listRootKey = null;\n let listRootDepth = 0;\n for (let i = depth - 2; i > 0; i--) {\n const keyOption = keys[i];\n if (typeof keyOption === 'string' || typeof keyOption === 'number') {\n listRootDepth = i;\n listRootKey = keyOption;\n break;\n }\n }\n if (listRootKey !== null) {\n // Emit the given objects as list elements\n const values = await util.valueToTerm(await parsingContext.getContext(keys), listRootKey, value, depth, keys);\n for (const object of values) {\n await this.handleListElement(parsingContext, util, object, value, depth, keys.slice(0, listRootDepth), listRootDepth);\n }\n // If no values were found, emit a falsy list element to force an empty RDF list to be emitted.\n if (values.length === 0) {\n await this.handleListElement(parsingContext, util, null, value, depth, keys.slice(0, listRootDepth), listRootDepth);\n }\n }\n }\n else if (parentKey === '@set') {\n // Our value is part of a set, so we just add it to the parent-parent\n await parsingContext.newOnValueJob(keys.slice(0, -2), value, depth - 2, false);\n }\n else if (parentKey !== undefined && parentKey !== '@type') {\n // Buffer our value using the parent key as predicate\n // Determine the first parent key that is *not* an array key\n // This is needed in case we have an @list container with nested arrays,\n // where each of them should produce nested RDF lists.\n for (let i = depth - 1; i > 0; i--) {\n if (typeof keys[i] !== 'number') {\n parentKey = await util.unaliasKeyword(keys[i], keys, i);\n break;\n }\n }\n // Check if the predicate is marked as an @list in the context\n const parentContext = await parsingContext.getContext(keys.slice(0, -1));\n if ('@list' in Util_1.Util.getContextValueContainer(parentContext, parentKey)) {\n // Our value is part of an array\n // Emit the given objects as list elements\n parsingContext.emittedStack[depth + 1] = true; // Ensure the creation of bnodes for empty nodes\n const values = await util.valueToTerm(await parsingContext.getContext(keys), parentKey, value, depth, keys);\n for (const object of values) {\n await this.handleListElement(parsingContext, util, object, value, depth, keys.slice(0, -1), depth - 1);\n }\n // If no values were found, emit a falsy list element to force an empty RDF list to be emitted.\n if (values.length === 0) {\n await this.handleListElement(parsingContext, util, null, value, depth, keys.slice(0, -1), depth - 1);\n }\n }\n else {\n // Copy the stack values up one level so that the next job can access them.\n parsingContext.shiftStack(depth, 1);\n // Execute the job one level higher\n await parsingContext.newOnValueJob(keys.slice(0, -1), value, depth - 1, false);\n // Remove any defined contexts at this level to avoid it to propagate to the next array element.\n parsingContext.contextTree.removeContext(keys.slice(0, -1));\n }\n }\n }\n async handleListElement(parsingContext, util, value, valueOriginal, depth, listRootKeys, listRootDepth) {\n // Buffer our value as an RDF list using the listRootKey as predicate\n let listPointer = parsingContext.listPointerStack[depth];\n if (valueOriginal !== null && (await util.unaliasKeywords(valueOriginal, listRootKeys, depth))['@value'] !== null) {\n if (!listPointer || !listPointer.value) {\n const linkTerm = util.dataFactory.blankNode();\n listPointer = { value: linkTerm, listRootDepth, listId: linkTerm };\n }\n else {\n // rdf:rest links are always emitted before the next element,\n // as the blank node identifier is only created at that point.\n // Because of this reason, the final rdf:nil is emitted when the stack depth is decreased.\n const newLinkTerm = util.dataFactory.blankNode();\n parsingContext.emitQuad(depth, util.dataFactory.quad(listPointer.value, util.rdfRest, newLinkTerm, util.getDefaultGraph()));\n // Update the list pointer for the next element\n listPointer.value = newLinkTerm;\n }\n // Emit a list element for the current value\n // Omit rdf:first if the value is invalid\n if (value) {\n parsingContext.emitQuad(depth, util.dataFactory.quad(listPointer.value, util.rdfFirst, value, util.getDefaultGraph()));\n }\n }\n else {\n // A falsy list element if found.\n // Mark it as an rdf:nil list until another valid list element comes in\n if (!listPointer) {\n listPointer = { listRootDepth, listId: util.rdfNil };\n }\n }\n parsingContext.listPointerStack[depth] = listPointer;\n }\n}\nexports.EntryHandlerArrayValue = EntryHandlerArrayValue;\n//# sourceMappingURL=EntryHandlerArrayValue.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerContainer = void 0;\nconst ContainerHandlerIdentifier_1 = require(\"../containerhandler/ContainerHandlerIdentifier\");\nconst ContainerHandlerIndex_1 = require(\"../containerhandler/ContainerHandlerIndex\");\nconst ContainerHandlerLanguage_1 = require(\"../containerhandler/ContainerHandlerLanguage\");\nconst ContainerHandlerType_1 = require(\"../containerhandler/ContainerHandlerType\");\nconst Util_1 = require(\"../Util\");\n/**\n * Handles values that are part of a container type (like @index),\n * as specified by {@link IContainerHandler}.\n */\nclass EntryHandlerContainer {\n /**\n * Check fit the given container is a simple @graph container.\n * Concretely, it will check if no @index or @id is active as well.\n * @param containers A container hash.\n */\n static isSimpleGraphContainer(containers) {\n return '@graph' in containers\n && (('@set' in containers && Object.keys(containers).length === 2) || Object.keys(containers).length === 1);\n }\n /**\n * Check fit the given container is a complex @graph container.\n * Concretely, it will check if @index or @id is active as well next to @graph.\n * @param containers A container hash.\n */\n static isComplexGraphContainer(containers) {\n return '@graph' in containers\n && (('@set' in containers && Object.keys(containers).length > 2)\n || (!('@set' in containers) && Object.keys(containers).length > 1));\n }\n /**\n * Create an graph container index that can be used for identifying a graph term inside the graphContainerTermStack.\n * @param containers The applicable containers.\n * @param depth The container depth.\n * @param keys The array of keys.\n * @return The graph index.\n */\n static getContainerGraphIndex(containers, depth, keys) {\n let isSimpleGraphContainer = EntryHandlerContainer.isSimpleGraphContainer(containers);\n let index = '';\n for (let i = depth; i < keys.length; i++) {\n if (!isSimpleGraphContainer || typeof keys[i] === 'number') {\n index += ':' + keys[i];\n }\n // Only allow a second 'real' key if in a non-simple graph container.\n if (!isSimpleGraphContainer && typeof keys[i] !== 'number') {\n isSimpleGraphContainer = true;\n }\n }\n return index;\n }\n /**\n * Return the applicable container type at the given depth.\n *\n * This will ignore any arrays in the key chain.\n *\n * @param {ParsingContext} parsingContext A parsing context.\n * @param {any[]} keys The array of keys.\n * @param {number} depth The current depth.\n * @return {Promise<{ containers: {[typeName: string]: boolean}, depth: number, fallback: boolean }>}\n * All applicable containers for the given depth,\n * the `depth` of the container root (can change when arrays are in the key chain),\n * and the `fallback` flag that indicates if the default container type was returned\n * (i.e., no dedicated container type is defined).\n */\n static async getContainerHandler(parsingContext, keys, depth) {\n const fallback = {\n containers: { '@set': true },\n depth,\n fallback: true,\n };\n // A flag that is enabled when @graph container should be tested in next iteration\n let checkGraphContainer = false;\n // Iterate from deeper to higher\n const context = await parsingContext.getContext(keys, 2);\n for (let i = depth - 1; i >= 0; i--) {\n if (typeof keys[i] !== 'number') { // Skip array keys\n // @graph containers without any other types are one level less deep, and require special handling\n const containersSelf = Util_1.Util.getContextValue(context, '@container', keys[i], false);\n if (containersSelf && EntryHandlerContainer.isSimpleGraphContainer(containersSelf)) {\n return {\n containers: containersSelf,\n depth: i + 1,\n fallback: false,\n };\n }\n const containersParent = Util_1.Util.getContextValue(context, '@container', keys[i - 1], false);\n if (!containersParent) { // If we have the fallback container value\n if (checkGraphContainer) {\n // Return false if we were already expecting a @graph-@id of @graph-@index container\n return fallback;\n }\n // Check parent-parent, we may be in a @graph-@id of @graph-@index container, which have two levels\n checkGraphContainer = true;\n }\n else {\n // We had an invalid container next iteration, so we now have to check if we were in an @graph container\n const graphContainer = '@graph' in containersParent;\n // We're in a regular container\n for (const containerHandleName in EntryHandlerContainer.CONTAINER_HANDLERS) {\n if (containersParent[containerHandleName]) {\n if (graphContainer) {\n // Only accept graph containers if their combined handlers can handle them.\n if (EntryHandlerContainer.CONTAINER_HANDLERS[containerHandleName].canCombineWithGraph()) {\n return {\n containers: containersParent,\n depth: i,\n fallback: false,\n };\n }\n else {\n return fallback;\n }\n }\n else {\n // Only accept if we were not expecting a @graph-@id of @graph-@index container\n if (checkGraphContainer) {\n return fallback;\n }\n else {\n return {\n containers: containersParent,\n depth: i,\n fallback: false,\n };\n }\n }\n }\n }\n // Fail if no valid container handlers were found\n return fallback;\n }\n }\n }\n return fallback;\n }\n /**\n * Check if we are handling a value at the given depth\n * that is part of something that should be handled as a container,\n * AND if this container should be buffered, so that it can be handled by a dedicated container handler.\n *\n * For instance, any container with @graph will NOT be buffered.\n *\n * This will ignore any arrays in the key chain.\n *\n * @param {ParsingContext} parsingContext A parsing context.\n * @param {any[]} keys The array of keys.\n * @param {number} depth The current depth.\n * @return {Promise} If we are in the scope of a container handler.\n */\n static async isBufferableContainerHandler(parsingContext, keys, depth) {\n const handler = await EntryHandlerContainer.getContainerHandler(parsingContext, keys, depth);\n return !handler.fallback && !('@graph' in handler.containers);\n }\n isPropertyHandler() {\n return false;\n }\n isStackProcessor() {\n return true;\n }\n async validate(parsingContext, util, keys, depth, inProperty) {\n return !!await this.test(parsingContext, util, null, keys, depth);\n }\n async test(parsingContext, util, key, keys, depth) {\n const containers = Util_1.Util.getContextValueContainer(await parsingContext.getContext(keys, 2), keys[depth - 1]);\n for (const containerName in EntryHandlerContainer.CONTAINER_HANDLERS) {\n if (containers[containerName]) {\n return {\n containers,\n handler: EntryHandlerContainer.CONTAINER_HANDLERS[containerName],\n };\n }\n }\n return null;\n }\n async handle(parsingContext, util, key, keys, value, depth, testResult) {\n return testResult.handler.handle(testResult.containers, parsingContext, util, keys, value, depth);\n }\n}\nexports.EntryHandlerContainer = EntryHandlerContainer;\nEntryHandlerContainer.CONTAINER_HANDLERS = {\n '@id': new ContainerHandlerIdentifier_1.ContainerHandlerIdentifier(),\n '@index': new ContainerHandlerIndex_1.ContainerHandlerIndex(),\n '@language': new ContainerHandlerLanguage_1.ContainerHandlerLanguage(),\n '@type': new ContainerHandlerType_1.ContainerHandlerType(),\n};\n//# sourceMappingURL=EntryHandlerContainer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerInvalidFallback = void 0;\n/**\n * A catch-all for properties, that will either emit an error or ignore,\n * depending on whether or not the `strictValues` property is set.\n */\nclass EntryHandlerInvalidFallback {\n isPropertyHandler() {\n return false;\n }\n isStackProcessor() {\n return true;\n }\n async validate(parsingContext, util, keys, depth, inProperty) {\n return false;\n }\n async test(parsingContext, util, key, keys, depth) {\n return true;\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n parsingContext.emittedStack[depth] = false;\n }\n}\nexports.EntryHandlerInvalidFallback = EntryHandlerInvalidFallback;\n//# sourceMappingURL=EntryHandlerInvalidFallback.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerPredicate = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst Util_1 = require(\"../Util\");\n/**\n * Interprets keys as predicates.\n * The most common case in JSON-LD processing.\n */\nclass EntryHandlerPredicate {\n /**\n * Handle the given predicate-object by either emitting it,\n * or by placing it in the appropriate stack for later emission when no @graph and/or @id has been defined.\n * @param {ParsingContext} parsingContext A parsing context.\n * @param {Util} util A utility instance.\n * @param {any[]} keys A stack of keys.\n * @param {number} depth The current depth.\n * @param {Term} predicate The predicate.\n * @param {Term} object The object.\n * @param {boolean} reverse If the property is reversed.\n * @return {Promise} A promise resolving when handling is done.\n */\n static async handlePredicateObject(parsingContext, util, keys, depth, predicate, object, reverse) {\n const depthProperties = await util.getPropertiesDepth(keys, depth);\n const depthOffsetGraph = await util.getDepthOffsetGraph(depth, keys);\n const depthPropertiesGraph = depth - depthOffsetGraph;\n const subjects = parsingContext.idStack[depthProperties];\n if (subjects) {\n // Emit directly if the @id was already defined\n for (const subject of subjects) {\n // Check if we're in a @graph context\n const atGraph = depthOffsetGraph >= 0;\n if (atGraph) {\n const graphs = parsingContext.idStack[depthPropertiesGraph - 1];\n if (graphs) {\n for (const graph of graphs) {\n // Emit our quad if graph @id is known\n if (reverse) {\n util.validateReverseSubject(object);\n parsingContext.emitQuad(depth, util.dataFactory.quad(object, predicate, subject, graph));\n }\n else {\n parsingContext.emitQuad(depth, util.dataFactory.quad(subject, predicate, object, graph));\n }\n }\n }\n else {\n // Buffer our triple if graph @id is not known yet.\n if (reverse) {\n util.validateReverseSubject(object);\n parsingContext.getUnidentifiedGraphBufferSafe(depthPropertiesGraph - 1).push({ subject: object, predicate, object: subject });\n }\n else {\n parsingContext.getUnidentifiedGraphBufferSafe(depthPropertiesGraph - 1)\n .push({ subject, predicate, object });\n }\n }\n }\n else {\n // Emit if no @graph was applicable\n const graph = await util.getGraphContainerValue(keys, depthProperties);\n if (reverse) {\n util.validateReverseSubject(object);\n parsingContext.emitQuad(depth, util.dataFactory.quad(object, predicate, subject, graph));\n }\n else {\n parsingContext.emitQuad(depth, util.dataFactory.quad(subject, predicate, object, graph));\n }\n }\n }\n }\n else {\n // Buffer until our @id becomes known, or we go up the stack\n if (reverse) {\n util.validateReverseSubject(object);\n }\n parsingContext.getUnidentifiedValueBufferSafe(depthProperties).push({ predicate, object, reverse });\n }\n }\n isPropertyHandler() {\n return true;\n }\n isStackProcessor() {\n return true;\n }\n async validate(parsingContext, util, keys, depth, inProperty) {\n const key = keys[depth];\n if (key) {\n const context = await parsingContext.getContext(keys);\n if (!parsingContext.jsonLiteralStack[depth] && await util.predicateToTerm(context, keys[depth])) {\n // If this valid predicate is of type @json, mark it so in the stack so that no deeper handling of nodes occurs.\n if (Util_1.Util.getContextValueType(context, key) === '@json') {\n parsingContext.jsonLiteralStack[depth + 1] = true;\n }\n return true;\n }\n }\n return false;\n }\n async test(parsingContext, util, key, keys, depth) {\n return keys[depth];\n }\n async handle(parsingContext, util, key, keys, value, depth, testResult) {\n const keyOriginal = keys[depth];\n const context = await parsingContext.getContext(keys);\n const predicate = await util.predicateToTerm(context, key);\n if (predicate) {\n const objects = await util.valueToTerm(context, key, value, depth, keys);\n if (objects.length) {\n for (let object of objects) {\n const reverse = Util_1.Util.isPropertyReverse(context, keyOriginal, await util.unaliasKeywordParent(keys, depth));\n if (value) {\n // Special case if our term was defined as an @list, but does not occur in an array,\n // In that case we just emit it as an RDF list with a single element.\n const listValueContainer = '@list' in Util_1.Util.getContextValueContainer(context, key);\n if (listValueContainer || value['@list']) {\n if (((listValueContainer && !Array.isArray(value) && !value['@list'])\n || (value['@list'] && !Array.isArray(value['@list'])))\n && object !== util.rdfNil) {\n const listPointer = util.dataFactory.blankNode();\n parsingContext.emitQuad(depth, util.dataFactory.quad(listPointer, util.rdfRest, util.rdfNil, util.getDefaultGraph()));\n parsingContext.emitQuad(depth, util.dataFactory.quad(listPointer, util.rdfFirst, object, util.getDefaultGraph()));\n object = listPointer;\n }\n // Lists are not allowed in @reverse'd properties\n if (reverse && !parsingContext.allowSubjectList) {\n throw new jsonld_context_parser_1.ErrorCoded(`Found illegal list value in subject position at ${key}`, jsonld_context_parser_1.ERROR_CODES.INVALID_REVERSE_PROPERTY_VALUE);\n }\n }\n }\n await EntryHandlerPredicate.handlePredicateObject(parsingContext, util, keys, depth, predicate, object, reverse);\n }\n }\n }\n }\n}\nexports.EntryHandlerPredicate = EntryHandlerPredicate;\n//# sourceMappingURL=EntryHandlerPredicate.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeyword = void 0;\n/**\n * An abstract keyword entry handler.\n */\nclass EntryHandlerKeyword {\n constructor(keyword) {\n this.keyword = keyword;\n }\n isPropertyHandler() {\n return false;\n }\n isStackProcessor() {\n return true;\n }\n async validate(parsingContext, util, keys, depth, inProperty) {\n return false;\n }\n async test(parsingContext, util, key, keys, depth) {\n return key === this.keyword;\n }\n}\nexports.EntryHandlerKeyword = EntryHandlerKeyword;\n//# sourceMappingURL=EntryHandlerKeyword.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeywordContext = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst EntryHandlerKeyword_1 = require(\"./EntryHandlerKeyword\");\n/**\n * Handles @context entries.\n */\nclass EntryHandlerKeywordContext extends EntryHandlerKeyword_1.EntryHandlerKeyword {\n constructor() {\n super('@context');\n }\n isStackProcessor() {\n return false;\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n // Error if an out-of-order context was found when support is not enabled.\n if (parsingContext.streamingProfile\n && (parsingContext.processingStack[depth]\n || parsingContext.processingType[depth]\n || parsingContext.idStack[depth] !== undefined)) {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded('Found an out-of-order context, while streaming is enabled.' +\n '(disable `streamingProfile`)', jsonld_context_parser_1.ERROR_CODES.INVALID_STREAMING_KEY_ORDER));\n }\n // Find the parent context to inherit from.\n // We actually request a context for the current depth (with fallback to parent)\n // because we want to take into account any property-scoped contexts that are defined for this depth.\n const parentContext = parsingContext.getContext(keys);\n // Set the context for this scope\n const context = parsingContext.parseContext(value, (await parentContext).getContextRaw());\n parsingContext.contextTree.setContext(keys.slice(0, -1), context);\n parsingContext.emitContext(value);\n await parsingContext.validateContext(await context);\n }\n}\nexports.EntryHandlerKeywordContext = EntryHandlerKeywordContext;\n//# sourceMappingURL=EntryHandlerKeywordContext.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeywordGraph = void 0;\nconst EntryHandlerKeyword_1 = require(\"./EntryHandlerKeyword\");\n/**\n * Handles @graph entries.\n */\nclass EntryHandlerKeywordGraph extends EntryHandlerKeyword_1.EntryHandlerKeyword {\n constructor() {\n super('@graph');\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n // The current identifier identifies a graph for the deeper level.\n parsingContext.graphStack[depth + 1] = true;\n }\n}\nexports.EntryHandlerKeywordGraph = EntryHandlerKeywordGraph;\n//# sourceMappingURL=EntryHandlerKeywordGraph.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeywordId = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst EntryHandlerKeyword_1 = require(\"./EntryHandlerKeyword\");\n/**\n * Handles @id entries.\n */\nclass EntryHandlerKeywordId extends EntryHandlerKeyword_1.EntryHandlerKeyword {\n constructor() {\n super('@id');\n }\n isStackProcessor() {\n return false;\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n if (typeof value !== 'string') {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found illegal @id '${value}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_ID_VALUE));\n }\n // Determine the canonical place for this id.\n // For example, @nest parents should be ignored.\n const depthProperties = await util.getPropertiesDepth(keys, depth);\n // Error if an @id for this node already existed.\n if (parsingContext.idStack[depthProperties] !== undefined) {\n if (parsingContext.idStack[depthProperties][0].listHead) {\n // Error if an @list was already defined for this node\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found illegal neighbouring entries next to @list for key: '${keys[depth - 1]}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT));\n }\n else {\n // Otherwise, the previous id was just because of an @id entry.\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found duplicate @ids '${parsingContext\n .idStack[depthProperties][0].value}' and '${value}'`, jsonld_context_parser_1.ERROR_CODES.COLLIDING_KEYWORDS));\n }\n }\n // Save our @id on the stack\n parsingContext.idStack[depthProperties] = util.nullableTermToArray(await util.resourceToTerm(await parsingContext.getContext(keys), value));\n }\n}\nexports.EntryHandlerKeywordId = EntryHandlerKeywordId;\n//# sourceMappingURL=EntryHandlerKeywordId.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeywordIncluded = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst EntryHandlerKeyword_1 = require(\"./EntryHandlerKeyword\");\n/**\n * Handles @included entries.\n */\nclass EntryHandlerKeywordIncluded extends EntryHandlerKeyword_1.EntryHandlerKeyword {\n constructor() {\n super('@included');\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n if (typeof value !== 'object') {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found illegal @included '${value}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_INCLUDED_VALUE));\n }\n const valueUnliased = await util.unaliasKeywords(value, keys, depth, await parsingContext.getContext(keys));\n if ('@value' in valueUnliased) {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found an illegal @included @value node '${JSON.stringify(value)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_INCLUDED_VALUE));\n }\n if ('@list' in valueUnliased) {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found an illegal @included @list node '${JSON.stringify(value)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_INCLUDED_VALUE));\n }\n parsingContext.emittedStack[depth] = false;\n }\n}\nexports.EntryHandlerKeywordIncluded = EntryHandlerKeywordIncluded;\n//# sourceMappingURL=EntryHandlerKeywordIncluded.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeywordNest = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst EntryHandlerKeyword_1 = require(\"./EntryHandlerKeyword\");\n/**\n * Handles @nest entries.\n */\nclass EntryHandlerKeywordNest extends EntryHandlerKeyword_1.EntryHandlerKeyword {\n constructor() {\n super('@nest');\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n if (typeof value !== 'object') {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found invalid @nest entry for '${key}': '${value}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_NEST_VALUE));\n }\n if ('@value' in await util.unaliasKeywords(value, keys, depth, await parsingContext.getContext(keys))) {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found an invalid @value node for '${key}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_NEST_VALUE));\n }\n parsingContext.emittedStack[depth] = false;\n }\n}\nexports.EntryHandlerKeywordNest = EntryHandlerKeywordNest;\n//# sourceMappingURL=EntryHandlerKeywordNest.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeywordType = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst Util_1 = require(\"../../Util\");\nconst EntryHandlerPredicate_1 = require(\"../EntryHandlerPredicate\");\nconst EntryHandlerKeyword_1 = require(\"./EntryHandlerKeyword\");\n/**\n * Handles @graph entries.\n */\nclass EntryHandlerKeywordType extends EntryHandlerKeyword_1.EntryHandlerKeyword {\n constructor() {\n super('@type');\n }\n isStackProcessor() {\n return false;\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n const keyOriginal = keys[depth];\n // The current identifier identifies an rdf:type predicate.\n // But we only emit it once the node closes,\n // as it's possible that the @type is used to identify the datatype of a literal, which we ignore here.\n const context = await parsingContext.getContext(keys);\n const predicate = util.rdfType;\n const reverse = Util_1.Util.isPropertyReverse(context, keyOriginal, await util.unaliasKeywordParent(keys, depth));\n // Handle multiple values if the value is an array\n const elements = Array.isArray(value) ? value : [value];\n for (const element of elements) {\n if (typeof element !== 'string') {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found illegal @type '${element}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_TYPE_VALUE));\n }\n const type = util.createVocabOrBaseTerm(context, element);\n if (type) {\n await EntryHandlerPredicate_1.EntryHandlerPredicate.handlePredicateObject(parsingContext, util, keys, depth, predicate, type, reverse);\n }\n }\n // Collect type-scoped contexts if they exist\n let scopedContext = Promise.resolve(context);\n let hasTypedScopedContext = false;\n for (const element of elements.sort()) { // Spec requires lexicographical ordering\n const typeContext = Util_1.Util.getContextValue(context, '@context', element, null);\n if (typeContext) {\n hasTypedScopedContext = true;\n scopedContext = scopedContext.then((c) => parsingContext.parseContext(typeContext, c.getContextRaw()));\n }\n }\n // Error if an out-of-order type-scoped context was found when support is not enabled.\n if (parsingContext.streamingProfile\n && (hasTypedScopedContext || !parsingContext.streamingProfileAllowOutOfOrderPlainType)\n && (parsingContext.processingStack[depth] || parsingContext.idStack[depth])) {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded('Found an out-of-order type-scoped context, while streaming is enabled.' +\n '(disable `streamingProfile`)', jsonld_context_parser_1.ERROR_CODES.INVALID_STREAMING_KEY_ORDER));\n }\n // If at least least one type-scoped context applies, set them in the tree.\n if (hasTypedScopedContext) {\n // Do not propagate by default\n scopedContext = scopedContext.then((c) => {\n if (!('@propagate' in c.getContextRaw())) {\n c.getContextRaw()['@propagate'] = false;\n }\n // Set the original context at this depth as a fallback\n // This is needed when a context was already defined at the given depth,\n // and this context needs to remain accessible from child nodes when propagation is disabled.\n if (c.getContextRaw()['@propagate'] === false) {\n c.getContextRaw()['@__propagateFallback'] = context.getContextRaw();\n }\n return c;\n });\n // Set the new context in the context tree\n parsingContext.contextTree.setContext(keys.slice(0, keys.length - 1), scopedContext);\n }\n // Flag that type has been processed at this depth\n parsingContext.processingType[depth] = true;\n }\n}\nexports.EntryHandlerKeywordType = EntryHandlerKeywordType;\n//# sourceMappingURL=EntryHandlerKeywordType.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeywordUnknownFallback = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\n/**\n * A catch-all for keywords, that will either emit an error or ignore,\n * depending on whether or not the `strictValues` property is set.\n */\nclass EntryHandlerKeywordUnknownFallback {\n isPropertyHandler() {\n return false;\n }\n isStackProcessor() {\n return true;\n }\n async validate(parsingContext, util, keys, depth, inProperty) {\n const key = await util.unaliasKeyword(keys[depth], keys, depth);\n if (jsonld_context_parser_1.Util.isPotentialKeyword(key)) {\n // Don't emit anything inside free-floating lists\n if (!inProperty) {\n if (key === '@list') {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n async test(parsingContext, util, key, keys, depth) {\n return jsonld_context_parser_1.Util.isPotentialKeyword(key);\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n const keywordType = EntryHandlerKeywordUnknownFallback.VALID_KEYWORDS_TYPES[key];\n if (keywordType !== undefined) {\n if (keywordType && typeof value !== keywordType.type) {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Invalid value type for '${key}' with value '${value}'`, keywordType.errorCode));\n }\n }\n else if (parsingContext.strictValues) {\n parsingContext.emitError(new Error(`Unknown keyword '${key}' with value '${value}'`));\n }\n parsingContext.emittedStack[depth] = false;\n }\n}\nexports.EntryHandlerKeywordUnknownFallback = EntryHandlerKeywordUnknownFallback;\nEntryHandlerKeywordUnknownFallback.VALID_KEYWORDS_TYPES = {\n '@index': { type: 'string', errorCode: jsonld_context_parser_1.ERROR_CODES.INVALID_INDEX_VALUE },\n '@list': null,\n '@reverse': { type: 'object', errorCode: jsonld_context_parser_1.ERROR_CODES.INVALID_REVERSE_VALUE },\n '@set': null,\n '@value': null,\n};\n//# sourceMappingURL=EntryHandlerKeywordUnknownFallback.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeywordValue = void 0;\nconst EntryHandlerKeyword_1 = require(\"./EntryHandlerKeyword\");\n/**\n * Handles @value entries.\n */\nclass EntryHandlerKeywordValue extends EntryHandlerKeyword_1.EntryHandlerKeyword {\n constructor() {\n super('@value');\n }\n async validate(parsingContext, util, keys, depth, inProperty) {\n // If this is @value, mark it so in the stack so that no deeper handling of nodes occurs.\n const key = keys[depth];\n if (key && !parsingContext.literalStack[depth] && await this.test(parsingContext, util, key, keys, depth)) {\n parsingContext.literalStack[depth] = true;\n }\n return super.validate(parsingContext, util, keys, depth, inProperty);\n }\n async test(parsingContext, util, key, keys, depth) {\n return await util.unaliasKeyword(keys[depth], keys.slice(0, keys.length - 1), depth - 1, true) === '@value';\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n // If the value is valid, indicate that we are processing a literal.\n // The actual value will be determined at the parent level when the @value is part of an object,\n // because we may want to take into account additional entries such as @language.\n // See {@link Util.valueToTerm}\n // Indicate that we are processing a literal, and that no later predicates should be parsed at this depth.\n parsingContext.literalStack[depth] = true;\n // Void any buffers that we may have accumulated up until now\n delete parsingContext.unidentifiedValuesBuffer[depth];\n delete parsingContext.unidentifiedGraphsBuffer[depth];\n // Indicate that we have not emitted at this depth\n parsingContext.emittedStack[depth] = false;\n }\n}\nexports.EntryHandlerKeywordValue = EntryHandlerKeywordValue;\n//# sourceMappingURL=EntryHandlerKeywordValue.js.map","/*global Buffer*/\n// Named constants with unique integer values\nvar C = {};\n// Tokens\nvar LEFT_BRACE = C.LEFT_BRACE = 0x1;\nvar RIGHT_BRACE = C.RIGHT_BRACE = 0x2;\nvar LEFT_BRACKET = C.LEFT_BRACKET = 0x3;\nvar RIGHT_BRACKET = C.RIGHT_BRACKET = 0x4;\nvar COLON = C.COLON = 0x5;\nvar COMMA = C.COMMA = 0x6;\nvar TRUE = C.TRUE = 0x7;\nvar FALSE = C.FALSE = 0x8;\nvar NULL = C.NULL = 0x9;\nvar STRING = C.STRING = 0xa;\nvar NUMBER = C.NUMBER = 0xb;\n// Tokenizer States\nvar START = C.START = 0x11;\nvar STOP = C.STOP = 0x12;\nvar TRUE1 = C.TRUE1 = 0x21;\nvar TRUE2 = C.TRUE2 = 0x22;\nvar TRUE3 = C.TRUE3 = 0x23;\nvar FALSE1 = C.FALSE1 = 0x31;\nvar FALSE2 = C.FALSE2 = 0x32;\nvar FALSE3 = C.FALSE3 = 0x33;\nvar FALSE4 = C.FALSE4 = 0x34;\nvar NULL1 = C.NULL1 = 0x41;\nvar NULL2 = C.NULL2 = 0x42;\nvar NULL3 = C.NULL3 = 0x43;\nvar NUMBER1 = C.NUMBER1 = 0x51;\nvar NUMBER3 = C.NUMBER3 = 0x53;\nvar STRING1 = C.STRING1 = 0x61;\nvar STRING2 = C.STRING2 = 0x62;\nvar STRING3 = C.STRING3 = 0x63;\nvar STRING4 = C.STRING4 = 0x64;\nvar STRING5 = C.STRING5 = 0x65;\nvar STRING6 = C.STRING6 = 0x66;\n// Parser States\nvar VALUE = C.VALUE = 0x71;\nvar KEY = C.KEY = 0x72;\n// Parser Modes\nvar OBJECT = C.OBJECT = 0x81;\nvar ARRAY = C.ARRAY = 0x82;\n// Character constants\nvar BACK_SLASH = \"\\\\\".charCodeAt(0);\nvar FORWARD_SLASH = \"\\/\".charCodeAt(0);\nvar BACKSPACE = \"\\b\".charCodeAt(0);\nvar FORM_FEED = \"\\f\".charCodeAt(0);\nvar NEWLINE = \"\\n\".charCodeAt(0);\nvar CARRIAGE_RETURN = \"\\r\".charCodeAt(0);\nvar TAB = \"\\t\".charCodeAt(0);\n\nvar STRING_BUFFER_SIZE = 64 * 1024;\n\nfunction Parser() {\n this.tState = START;\n this.value = undefined;\n\n this.string = undefined; // string data\n this.stringBuffer = Buffer.alloc ? Buffer.alloc(STRING_BUFFER_SIZE) : new Buffer(STRING_BUFFER_SIZE);\n this.stringBufferOffset = 0;\n this.unicode = undefined; // unicode escapes\n this.highSurrogate = undefined;\n\n this.key = undefined;\n this.mode = undefined;\n this.stack = [];\n this.state = VALUE;\n this.bytes_remaining = 0; // number of bytes remaining in multi byte utf8 char to read after split boundary\n this.bytes_in_sequence = 0; // bytes in multi byte utf8 char to read\n this.temp_buffs = { \"2\": new Buffer(2), \"3\": new Buffer(3), \"4\": new Buffer(4) }; // for rebuilding chars split before boundary is reached\n\n // Stream offset\n this.offset = -1;\n}\n\n// Slow code to string converter (only used when throwing syntax errors)\nParser.toknam = function (code) {\n var keys = Object.keys(C);\n for (var i = 0, l = keys.length; i < l; i++) {\n var key = keys[i];\n if (C[key] === code) { return key; }\n }\n return code && (\"0x\" + code.toString(16));\n};\n\nvar proto = Parser.prototype;\nproto.onError = function (err) { throw err; };\nproto.charError = function (buffer, i) {\n this.tState = STOP;\n this.onError(new Error(\"Unexpected \" + JSON.stringify(String.fromCharCode(buffer[i])) + \" at position \" + i + \" in state \" + Parser.toknam(this.tState)));\n};\nproto.appendStringChar = function (char) {\n if (this.stringBufferOffset >= STRING_BUFFER_SIZE) {\n this.string += this.stringBuffer.toString('utf8');\n this.stringBufferOffset = 0;\n }\n\n this.stringBuffer[this.stringBufferOffset++] = char;\n};\nproto.appendStringBuf = function (buf, start, end) {\n var size = buf.length;\n if (typeof start === 'number') {\n if (typeof end === 'number') {\n if (end < 0) {\n // adding a negative end decreeses the size\n size = buf.length - start + end;\n } else {\n size = end - start;\n }\n } else {\n size = buf.length - start;\n }\n }\n\n if (size < 0) {\n size = 0;\n }\n\n if (this.stringBufferOffset + size > STRING_BUFFER_SIZE) {\n this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset);\n this.stringBufferOffset = 0;\n }\n\n buf.copy(this.stringBuffer, this.stringBufferOffset, start, end);\n this.stringBufferOffset += size;\n};\nproto.write = function (buffer) {\n if (typeof buffer === \"string\") buffer = new Buffer(buffer);\n var n;\n for (var i = 0, l = buffer.length; i < l; i++) {\n if (this.tState === START){\n n = buffer[i];\n this.offset++;\n if(n === 0x7b){ this.onToken(LEFT_BRACE, \"{\"); // {\n }else if(n === 0x7d){ this.onToken(RIGHT_BRACE, \"}\"); // }\n }else if(n === 0x5b){ this.onToken(LEFT_BRACKET, \"[\"); // [\n }else if(n === 0x5d){ this.onToken(RIGHT_BRACKET, \"]\"); // ]\n }else if(n === 0x3a){ this.onToken(COLON, \":\"); // :\n }else if(n === 0x2c){ this.onToken(COMMA, \",\"); // ,\n }else if(n === 0x74){ this.tState = TRUE1; // t\n }else if(n === 0x66){ this.tState = FALSE1; // f\n }else if(n === 0x6e){ this.tState = NULL1; // n\n }else if(n === 0x22){ // \"\n this.string = \"\";\n this.stringBufferOffset = 0;\n this.tState = STRING1;\n }else if(n === 0x2d){ this.string = \"-\"; this.tState = NUMBER1; // -\n }else{\n if (n >= 0x30 && n < 0x40) { // 1-9\n this.string = String.fromCharCode(n); this.tState = NUMBER3;\n } else if (n === 0x20 || n === 0x09 || n === 0x0a || n === 0x0d) {\n // whitespace\n } else {\n return this.charError(buffer, i);\n }\n }\n }else if (this.tState === STRING1){ // After open quote\n n = buffer[i]; // get current byte from buffer\n // check for carry over of a multi byte char split between data chunks\n // & fill temp buffer it with start of this data chunk up to the boundary limit set in the last iteration\n if (this.bytes_remaining > 0) {\n for (var j = 0; j < this.bytes_remaining; j++) {\n this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence - this.bytes_remaining + j] = buffer[j];\n }\n\n this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]);\n this.bytes_in_sequence = this.bytes_remaining = 0;\n i = i + j - 1;\n } else if (this.bytes_remaining === 0 && n >= 128) { // else if no remainder bytes carried over, parse multi byte (>=128) chars one at a time\n if (n <= 193 || n > 244) {\n return this.onError(new Error(\"Invalid UTF-8 character at position \" + i + \" in state \" + Parser.toknam(this.tState)));\n }\n if ((n >= 194) && (n <= 223)) this.bytes_in_sequence = 2;\n if ((n >= 224) && (n <= 239)) this.bytes_in_sequence = 3;\n if ((n >= 240) && (n <= 244)) this.bytes_in_sequence = 4;\n if ((this.bytes_in_sequence + i) > buffer.length) { // if bytes needed to complete char fall outside buffer length, we have a boundary split\n for (var k = 0; k <= (buffer.length - 1 - i); k++) {\n this.temp_buffs[this.bytes_in_sequence][k] = buffer[i + k]; // fill temp buffer of correct size with bytes available in this chunk\n }\n this.bytes_remaining = (i + this.bytes_in_sequence) - buffer.length;\n i = buffer.length - 1;\n } else {\n this.appendStringBuf(buffer, i, i + this.bytes_in_sequence);\n i = i + this.bytes_in_sequence - 1;\n }\n } else if (n === 0x22) {\n this.tState = START;\n this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset);\n this.stringBufferOffset = 0;\n this.onToken(STRING, this.string);\n this.offset += Buffer.byteLength(this.string, 'utf8') + 1;\n this.string = undefined;\n }\n else if (n === 0x5c) {\n this.tState = STRING2;\n }\n else if (n >= 0x20) { this.appendStringChar(n); }\n else {\n return this.charError(buffer, i);\n }\n }else if (this.tState === STRING2){ // After backslash\n n = buffer[i];\n if(n === 0x22){ this.appendStringChar(n); this.tState = STRING1;\n }else if(n === 0x5c){ this.appendStringChar(BACK_SLASH); this.tState = STRING1;\n }else if(n === 0x2f){ this.appendStringChar(FORWARD_SLASH); this.tState = STRING1;\n }else if(n === 0x62){ this.appendStringChar(BACKSPACE); this.tState = STRING1;\n }else if(n === 0x66){ this.appendStringChar(FORM_FEED); this.tState = STRING1;\n }else if(n === 0x6e){ this.appendStringChar(NEWLINE); this.tState = STRING1;\n }else if(n === 0x72){ this.appendStringChar(CARRIAGE_RETURN); this.tState = STRING1;\n }else if(n === 0x74){ this.appendStringChar(TAB); this.tState = STRING1;\n }else if(n === 0x75){ this.unicode = \"\"; this.tState = STRING3;\n }else{\n return this.charError(buffer, i);\n }\n }else if (this.tState === STRING3 || this.tState === STRING4 || this.tState === STRING5 || this.tState === STRING6){ // unicode hex codes\n n = buffer[i];\n // 0-9 A-F a-f\n if ((n >= 0x30 && n < 0x40) || (n > 0x40 && n <= 0x46) || (n > 0x60 && n <= 0x66)) {\n this.unicode += String.fromCharCode(n);\n if (this.tState++ === STRING6) {\n var intVal = parseInt(this.unicode, 16);\n this.unicode = undefined;\n if (this.highSurrogate !== undefined && intVal >= 0xDC00 && intVal < (0xDFFF + 1)) { //<56320,57343> - lowSurrogate\n this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate, intVal)));\n this.highSurrogate = undefined;\n } else if (this.highSurrogate === undefined && intVal >= 0xD800 && intVal < (0xDBFF + 1)) { //<55296,56319> - highSurrogate\n this.highSurrogate = intVal;\n } else {\n if (this.highSurrogate !== undefined) {\n this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate)));\n this.highSurrogate = undefined;\n }\n this.appendStringBuf(new Buffer(String.fromCharCode(intVal)));\n }\n this.tState = STRING1;\n }\n } else {\n return this.charError(buffer, i);\n }\n } else if (this.tState === NUMBER1 || this.tState === NUMBER3) {\n n = buffer[i];\n\n switch (n) {\n case 0x30: // 0\n case 0x31: // 1\n case 0x32: // 2\n case 0x33: // 3\n case 0x34: // 4\n case 0x35: // 5\n case 0x36: // 6\n case 0x37: // 7\n case 0x38: // 8\n case 0x39: // 9\n case 0x2e: // .\n case 0x65: // e\n case 0x45: // E\n case 0x2b: // +\n case 0x2d: // -\n this.string += String.fromCharCode(n);\n this.tState = NUMBER3;\n break;\n default:\n this.tState = START;\n var result = Number(this.string);\n\n if (isNaN(result)){\n return this.charError(buffer, i);\n }\n\n if ((this.string.match(/[0-9]+/) == this.string) && (result.toString() != this.string)) {\n // Long string of digits which is an ID string and not valid and/or safe JavaScript integer Number\n this.onToken(STRING, this.string);\n } else {\n this.onToken(NUMBER, result);\n }\n\n this.offset += this.string.length - 1;\n this.string = undefined;\n i--;\n break;\n }\n }else if (this.tState === TRUE1){ // r\n if (buffer[i] === 0x72) { this.tState = TRUE2; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === TRUE2){ // u\n if (buffer[i] === 0x75) { this.tState = TRUE3; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === TRUE3){ // e\n if (buffer[i] === 0x65) { this.tState = START; this.onToken(TRUE, true); this.offset+= 3; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === FALSE1){ // a\n if (buffer[i] === 0x61) { this.tState = FALSE2; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === FALSE2){ // l\n if (buffer[i] === 0x6c) { this.tState = FALSE3; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === FALSE3){ // s\n if (buffer[i] === 0x73) { this.tState = FALSE4; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === FALSE4){ // e\n if (buffer[i] === 0x65) { this.tState = START; this.onToken(FALSE, false); this.offset+= 4; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === NULL1){ // u\n if (buffer[i] === 0x75) { this.tState = NULL2; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === NULL2){ // l\n if (buffer[i] === 0x6c) { this.tState = NULL3; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === NULL3){ // l\n if (buffer[i] === 0x6c) { this.tState = START; this.onToken(NULL, null); this.offset += 3; }\n else { return this.charError(buffer, i); }\n }\n }\n};\nproto.onToken = function (token, value) {\n // Override this to get events\n};\n\nproto.parseError = function (token, value) {\n this.tState = STOP;\n this.onError(new Error(\"Unexpected \" + Parser.toknam(token) + (value ? (\"(\" + JSON.stringify(value) + \")\") : \"\") + \" in state \" + Parser.toknam(this.state)));\n};\nproto.push = function () {\n this.stack.push({value: this.value, key: this.key, mode: this.mode});\n};\nproto.pop = function () {\n var value = this.value;\n var parent = this.stack.pop();\n this.value = parent.value;\n this.key = parent.key;\n this.mode = parent.mode;\n this.emit(value);\n if (!this.mode) { this.state = VALUE; }\n};\nproto.emit = function (value) {\n if (this.mode) { this.state = COMMA; }\n this.onValue(value);\n};\nproto.onValue = function (value) {\n // Override me\n};\nproto.onToken = function (token, value) {\n if(this.state === VALUE){\n if(token === STRING || token === NUMBER || token === TRUE || token === FALSE || token === NULL){\n if (this.value) {\n this.value[this.key] = value;\n }\n this.emit(value);\n }else if(token === LEFT_BRACE){\n this.push();\n if (this.value) {\n this.value = this.value[this.key] = {};\n } else {\n this.value = {};\n }\n this.key = undefined;\n this.state = KEY;\n this.mode = OBJECT;\n }else if(token === LEFT_BRACKET){\n this.push();\n if (this.value) {\n this.value = this.value[this.key] = [];\n } else {\n this.value = [];\n }\n this.key = 0;\n this.mode = ARRAY;\n this.state = VALUE;\n }else if(token === RIGHT_BRACE){\n if (this.mode === OBJECT) {\n this.pop();\n } else {\n return this.parseError(token, value);\n }\n }else if(token === RIGHT_BRACKET){\n if (this.mode === ARRAY) {\n this.pop();\n } else {\n return this.parseError(token, value);\n }\n }else{\n return this.parseError(token, value);\n }\n }else if(this.state === KEY){\n if (token === STRING) {\n this.key = value;\n this.state = COLON;\n } else if (token === RIGHT_BRACE) {\n this.pop();\n } else {\n return this.parseError(token, value);\n }\n }else if(this.state === COLON){\n if (token === COLON) { this.state = VALUE; }\n else { return this.parseError(token, value); }\n }else if(this.state === COMMA){\n if (token === COMMA) {\n if (this.mode === ARRAY) { this.key++; this.state = VALUE; }\n else if (this.mode === OBJECT) { this.state = KEY; }\n\n } else if (token === RIGHT_BRACKET && this.mode === ARRAY || token === RIGHT_BRACE && this.mode === OBJECT) {\n this.pop();\n } else {\n return this.parseError(token, value);\n }\n }else{\n return this.parseError(token, value);\n }\n};\n\nParser.C = C;\n\nmodule.exports = Parser;\n"],"names":["Sink","ParserStream","Parser","constructor","options","super","module","exports","rdf","JsonLdParser","Transform","relativeIriProtocol","termCleanup","factory","term","termType","value","startsWith","namedNode","slice","length","quadCleanup","cleanup","quad","subject","predicate","object","graph","input","baseIRI","context","parser","dataFactory","streamingProfile","pipe","transform","objectMode","encoding","callback","on","Object","entries","forEach","prefix","iri","emit","err","destroy","DataFactory","BlankNode","id","this","nextId","equals","other","prototype","DefaultGraph","fromTermRaw","Literal","NamedNode","Quad","Variable","blankNode","literal","languageOrDatatype","indexOf","variable","defaultGraph","defaultGraphInstance","triple","fromTerm","original","call","fromQuad","language","datatype","stringDatatype","langStringDatatype","name","Error","Impl","import","output","assign","readable","self","support","searchParams","iterable","Symbol","blob","Blob","e","formData","arrayBuffer","isDataView","obj","DataView","isPrototypeOf","viewClasses","isArrayBufferView","ArrayBuffer","isView","toString","normalizeName","String","test","TypeError","toLowerCase","normalizeValue","iteratorFor","items","iterator","next","shift","done","undefined","Headers","headers","map","append","Array","isArray","header","getOwnPropertyNames","consumed","body","bodyUsed","Promise","reject","fileReaderReady","reader","resolve","onload","result","onerror","error","readBlobAsArrayBuffer","FileReader","promise","readAsArrayBuffer","readBlobAsText","readAsText","readArrayBufferAsText","buf","view","Uint8Array","chars","i","fromCharCode","join","bufferClone","byteLength","set","buffer","Body","_initBody","_bodyInit","_bodyText","_bodyBlob","FormData","_bodyFormData","URLSearchParams","_bodyArrayBuffer","get","type","rejected","then","text","decode","json","JSON","parse","oldValue","has","hasOwnProperty","thisArg","keys","push","values","methods","normalizeMethod","method","upcased","toUpperCase","Request","url","credentials","mode","signal","referrer","form","trim","split","bytes","replace","decodeURIComponent","parseHeaders","rawHeaders","preProcessedHeaders","line","parts","key","Response","bodyInit","status","ok","statusText","clone","response","redirectStatuses","redirect","RangeError","location","DOMException","message","stack","create","fetch","init","request","aborted","xhr","XMLHttpRequest","abortXhr","abort","getAllResponseHeaders","responseURL","responseText","ontimeout","onabort","open","withCredentials","responseType","setRequestHeader","addEventListener","onreadystatechange","readyState","removeEventListener","send","polyfill","defineProperty","__createBinding","o","m","k","k2","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","__exportStar","p","ContextParser","relative_to_absolute_iri_1","ErrorCoded_1","FetchDocumentLoader_1","JsonLdContextNormalized_1","Util_1","documentLoader","FetchDocumentLoader","documentCache","validateContext","skipValidation","expandContentTypeToBase","remoteContextsDepthLimit","redirectSchemaOrgHttps","validateLanguage","strictRange","errorCode","ErrorCoded","stringify","Util","REGEX_LANGUAGE_TAG","validateDirection","strictValues","ERROR_CODES","INVALID_BASE_DIRECTION","REGEX_DIRECTION_TAG","idifyReverseTerms","isValidKeyword","INVALID_IRI_MAPPING","isPotentialKeyword","expandPrefixedTerms","contextRaw","getContextRaw","EXPAND_KEYS_BLACKLIST","isReservedInternalKeyword","keyValue","ALIAS_DOMAIN_BLACKLIST","KEYWORD_REDEFINITION","ALIAS_RANGE_BLACKLIST","getContextValueId","INVALID_KEYWORD_ALIAS","INVALID_TERM_DEFINITION","isPrefixValue","changed","expandTerm","canAddIdEntry","isValidIri","newId","expandedType","normalize","processingMode","normalizeLanguageTags","lowercase","containersToHash","newValue","containerValue","applyScopedProtected","expandOptions","isTermProtected","isSimpleTermDefinitionPrefix","validateKeywordRedefinitions","contextBefore","contextAfter","deepEqual","PROTECTED_TERM_REDEFINITION","validate","valueType","substr","INVALID_VOCAB_MAPPING","INVALID_BASE_IRI","INVALID_DEFAULT_LANGUAGE","INVALID_VERSION_VALUE","INVALID_CONTEXT_ENTRY","INVALID_PROPAGATE_VALUE","getPrefix","CYCLIC_IRI_MAPPING","isValidIriWeak","JsonLdContextNormalized","isCompactIri","objectKey","objectValue","INVALID_TYPE_MAPPING","INVALID_REVERSE_PROPERTY","CONTAINERS_1_0","INVALID_CONTAINER_MAPPING","CONTAINERS","INVALID_LANGUAGE_MAPPING","INVALID_PREFIX_VALUE","INVALID_NEST_VALUE","applyBaseEntry","inheritFromParent","parentContext","external","normalizeContextIri","contextIri","_a","parseInnerContexts","ignoreScopedContexts","ignoreProtection","ignoreRemoteScopedContexts","INVALID_SCOPED_CONTEXT","minimalProcessing","internalOptions","DEFAULT_PROCESSING_MODE","remoteContexts","CONTEXT_OVERFLOW","hasProtectedTerms","INVALID_CONTEXT_NULLIFICATION","overriddenLoad","getOverriddenLoad","parsedStringContext","load","contextIris","contexts","all","subContext","reducedContexts","reduce","accContextPromise","contextEntry","accContext","importContext","INVALID_IMPORT_VALUE","loadImportContext","defaultExpandOptions","newContext","overlappingKeys","newContextWrapped","INVALID_LOCAL_CONTEXT","cached","document","LOADING_REMOTE_CONTEXT_FAILED","INVALID_REMOTE_CONTEXT","RECURSIVE_CONTEXT_INCLUSION","importContextIri","code","http_link_header_1","fetcher","accept","mediaType","colonPos","alternateUrl","linkHeader","link","rel","uri","LOADING_DOCUMENT_FAILED","expandVocab","contextValue","validIriMapping","vocab","vocabRelative","base","potentialKeyword","contextPrefixValue","allowPrefixForcing","allowVocabRelativeToBase","compactIri","shortestPrefixing","suffix","allowPrefixNonGenDelims","separatorPos","charAt","isPrefixIriEndingWithGenDelim","keyword","KEYWORD_REGEX","prefixIri","ENDS_WITH_GEN_DELIM","Boolean","IRI_REGEX","IRI_REGEX_WEAK","VALID_KEYWORDS","object1","object2","objKeys1","objKeys2","every","value1","value2","ContextTree","subTrees","getContext","head","tail","subTree","depth","setContext","removeContext","path","jsonld_context_parser_1","stream_1","EntryHandlerArrayValue_1","EntryHandlerContainer_1","EntryHandlerInvalidFallback_1","EntryHandlerPredicate_1","EntryHandlerKeywordContext_1","EntryHandlerKeywordGraph_1","EntryHandlerKeywordId_1","EntryHandlerKeywordIncluded_1","EntryHandlerKeywordNest_1","EntryHandlerKeywordType_1","EntryHandlerKeywordUnknownFallback_1","EntryHandlerKeywordValue_1","ParsingContext_1","readableObjectMode","parsingContext","ParsingContext","util","jsonParser","contextJobs","typeJobs","contextAwaitingJobs","lastDepth","lastKeys","lastOnValueJob","attachJsonParserListeners","fromHttpResponse","endsWith","MULTIPLE_CONTEXT_LINK_HEADERS","ignoreMissingContextLinkHeader","contentType","match","exec","stream","PassThrough","parsed","data","_transform","chunk","write","newOnValueJob","lastDepthCheck","flushStacks","listPointer","listPointerStack","rdfRest","rdfNil","getDefaultGraph","listId","listHead","idStack","listRootDepth","splice","EntryHandlerContainer","isBufferableContainerHandler","pendingContainerFlushBuffers","flushBuffer","unaliasKeyword","parentKey","unaliasKeywordParent","emittedStack","handleKey","INVALID_REVERSE_PROPERTY_MAP","inProperty","validationStack","property","Math","max","validationResult","validateKey","valid","isLiteral","entryHandler","ENTRY_HANDLERS","testResult","handle","isStackProcessor","processingStack","validateValueIndexes","unaliasedKeywordCacheStack","processingType","graphStack","graphContainerTermStack","jsonLiteralStack","literalStack","subjects","valueBuffer","unidentifiedValuesBuffer","depthOffsetGraph","getDepthOffsetGraph","graphs","getGraphContainerValue","bufferedValue","reverse","emitQuad","subGraphBuffer","getUnidentifiedGraphBufferSafe","graphBuffer","unidentifiedGraphsBuffer","topLevelProperties","isPropertyHandler","onValue","fill","v","isParsingContextInner","valueJobCb","contextTree","jobs","job","executeBufferedJobs","onError","applicableTypeJobs","applicableTypeJobIds","typeJob","isPrefixArray","sortedTypeJobs","sort","job1","job2","sortedApplicableTypeJobIds","jobId","EntryHandlerArrayValue","EntryHandlerKeywordContext","EntryHandlerKeywordId","EntryHandlerKeywordIncluded","EntryHandlerKeywordGraph","EntryHandlerKeywordNest","EntryHandlerKeywordType","EntryHandlerKeywordValue","EntryHandlerKeywordUnknownFallback","EntryHandlerPredicate","EntryHandlerInvalidFallback","ContextTree_1","JsonLdParser_1","contextParser","skipContextValidation","produceGeneralizedRdf","allowSubjectList","rdfDirection","streamingProfileAllowOutOfOrderPlainType","activeProcessingMode","parseFloat","rootContext","parseContext","activeVersion","PROCESSING_MODE_CONFLICT","offset","keysOriginal","contextData","getContextPropagationAware","contextKeyEntry","scopedContext","propagate","originalDepth","hasApplicablePropertyScopedContext","lastKey","lastKeyValue","handlePendingContainerFlushBuffers","pendingFlushBuffer","emitError","emitContext","getUnidentifiedValueBufferSafe","getExpandOptions","EXPAND_OPTIONS","shiftStack","depthOffset","deeperIdStack","rdf_data_factory_1","canonicalizeJson","rdfFirst","RDF","rdfType","rdfJson","getContextValue","contextKey","fallback","entry","getContextValueContainer","getContextValueType","getContextValueLanguage","getContextValueDirection","isContextValueReverse","getContextValueIndex","isPropertyReverse","needle","haystack","indexHashes","index","existingIndexValue","CONFLICTING_INDEXES","valueToTerm","valueToJsonString","getContextSelfOrPropertyScoped","unaliasKeywords","val","valueLanguage","valueDirection","valueIndex","subValue","INVALID_VALUE_OBJECT","INVALID_VALUE_OBJECT_VALUE","INVALID_INDEX_VALUE","INVALID_LANGUAGE_TAGGED_VALUE","INVALID_LANGUAGE_TAGGED_STRING","nullableTermToArray","createLanguageDirectionLiteral","INVALID_TYPED_VALUE","typeTerm","createVocabOrBaseTerm","INVALID_SET_OR_LIST_OBJECT","listValue","graphContainerEntries","resourceToTerm","stringValueToTerm","XSD_BOOLEAN","XSD_INTEGER","XSD_DOUBLE","predicateToTerm","expanded","intToString","Number","isFinite","isInteger","toExponential","defaultDatatype","contextType","contextLanguage","contextDirection","direction","valueNode","disableCache","cachedUnaliasedKeyword","unliased","hash","newHash","containers","getContainerHandler","isComplexGraphContainer","validateReverseSubject","INVALID_REVERSE_PROPERTY_VALUE","depthContainer","graphContainerIndex","getContainerGraphIndex","graphId","keyUnaliased","getContainerKey","getPropertiesDepth","lastValidDepth","XSD","ContainerHandlerIdentifier","canCombineWithGraph","maybeId","ids","some","ContainerHandlerIndex","graphContainer","indexKey","indexPropertyRaw","indexProperty","indexValues","indexValue","handlePredicateObject","ContainerHandlerLanguage","INVALID_LANGUAGE_MAP_VALUE","ContainerHandlerType","containerTypeType","entryHasIdentifier","keyOriginal","listRootKey","keyOption","handleListElement","valueOriginal","listRootKeys","newLinkTerm","linkTerm","ContainerHandlerIdentifier_1","ContainerHandlerIndex_1","ContainerHandlerLanguage_1","ContainerHandlerType_1","isSimpleGraphContainer","checkGraphContainer","containersSelf","containersParent","containerHandleName","CONTAINER_HANDLERS","handler","containerName","depthProperties","depthPropertiesGraph","atGraph","objects","listValueContainer","EntryHandlerKeyword","EntryHandlerKeyword_1","INVALID_STREAMING_KEY_ORDER","INVALID_ID_VALUE","COLLIDING_KEYWORDS","INVALID_INCLUDED_VALUE","valueUnliased","elements","element","INVALID_TYPE_VALUE","hasTypedScopedContext","typeContext","c","keywordType","VALID_KEYWORDS_TYPES","INVALID_REVERSE_VALUE","C","LEFT_BRACE","RIGHT_BRACE","LEFT_BRACKET","RIGHT_BRACKET","COLON","COMMA","TRUE","FALSE","NULL","STRING","NUMBER","START","STOP","TRUE1","TRUE2","TRUE3","FALSE1","FALSE2","FALSE3","FALSE4","NULL1","NULL2","NULL3","NUMBER1","NUMBER3","STRING1","STRING2","STRING3","STRING4","STRING5","STRING6","VALUE","KEY","OBJECT","ARRAY","BACK_SLASH","charCodeAt","FORWARD_SLASH","BACKSPACE","FORM_FEED","NEWLINE","CARRIAGE_RETURN","TAB","STRING_BUFFER_SIZE","tState","string","stringBuffer","Buffer","alloc","stringBufferOffset","unicode","highSurrogate","state","bytes_remaining","bytes_in_sequence","temp_buffs","toknam","l","proto","charError","appendStringChar","char","appendStringBuf","start","end","size","copy","n","onToken","j","intVal","parseInt","isNaN","token","parseError","pop","parent"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"js/109.350c7c05.js","mappings":"oHAAA,MAAMA,EAAO,EAAQ,OACfC,EAAe,EAAQ,OAE7B,MAAMC,UAAeF,EACnB,WAAAG,CAAaC,GACXC,MAAMJ,EAAcG,EACtB,EAGFE,EAAOC,QAAUL,C,wBCTjB,MAAMM,EAAM,EAAQ,QACd,aAAEC,GAAiB,EAAQ,QAC3B,UAAEC,GAAc,EAAQ,OAExBC,EAAsB,QAE5B,SAASC,EAAaC,GACpB,OAAOC,GACiB,cAAlBA,EAAKC,SACA,KAGJD,EAAKE,MAAMC,WAAWN,GAKpBE,EAAQK,UAAUJ,EAAKE,MAAMG,MAAMR,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EACXmC,KAAKmvB,MAAQhD,MACR,IAAIqE,IAAUxE,EAGnB,OAAOhsB,KAAKywB,WAAWD,EAAO3yB,GAF9BmC,KAAK0wB,KAGP,MACI,GAAG1wB,KAAKmvB,QAAUhD,EAAM,CAC5B,GAAIqE,IAAUrE,EACP,OAAOnsB,KAAKywB,WAAWD,EAAO3yB,GADdmC,KAAKmvB,MAAQrB,CAEtC,KAAM,IAAG9tB,KAAKmvB,QAAU/C,EAWtB,OAAOpsB,KAAKywB,WAAWD,EAAO3yB,GAV9B,GAAI2yB,IAAUpE,EACRpsB,KAAKyI,OAASwlB,GAASjuB,KAAKuJ,MAAOvJ,KAAKmvB,MAAQrB,GAC3C9tB,KAAKyI,OAASulB,IAAUhuB,KAAKmvB,MAAQpB,OAEzC,MAAIyC,IAAUtE,GAAiBlsB,KAAKyI,OAASwlB,GAASuC,IAAUxE,GAAehsB,KAAKyI,OAASulB,GAGlG,OAAOhuB,KAAKywB,WAAWD,EAAO3yB,GAF9BmC,KAAK0wB,KAGP,CAGF,CACF,EAEA3zB,EAAO+uB,EAAIA,EAEX3uB,EAAOC,QAAUL,C","sources":["webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/index.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/lib/ParserStream.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/index.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/lib/BlankNode.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/lib/DataFactory.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/lib/DefaultGraph.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/lib/Literal.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/lib/NamedNode.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/lib/Quad.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/lib/Variable.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-jsonld/node_modules/@rdfjs/data-model/lib/fromTerm.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/sink/index.js","webpack://mobilitydcatap-ui/./node_modules/cross-fetch/dist/browser-polyfill.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-context-parser/index.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-context-parser/lib/ContextParser.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-context-parser/lib/ErrorCoded.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-context-parser/lib/FetchDocumentLoader.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-context-parser/lib/IDocumentLoader.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-context-parser/lib/JsonLdContext.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-context-parser/lib/JsonLdContextNormalized.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-context-parser/lib/Util.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/index.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/ContextTree.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/JsonLdParser.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/ParsingContext.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/Util.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/containerhandler/ContainerHandlerIdentifier.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/containerhandler/ContainerHandlerIndex.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/containerhandler/ContainerHandlerLanguage.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/containerhandler/ContainerHandlerType.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/EntryHandlerArrayValue.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/EntryHandlerContainer.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/EntryHandlerInvalidFallback.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/EntryHandlerPredicate.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeyword.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeywordContext.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeywordGraph.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeywordId.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeywordIncluded.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeywordNest.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeywordType.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeywordUnknownFallback.js","webpack://mobilitydcatap-ui/./node_modules/jsonld-streaming-parser/lib/entryhandler/keyword/EntryHandlerKeywordValue.js","webpack://mobilitydcatap-ui/./node_modules/jsonparse/jsonparse.js"],"sourcesContent":["const Sink = require('@rdfjs/sink')\nconst ParserStream = require('./lib/ParserStream')\n\nclass Parser extends Sink {\n constructor (options) {\n super(ParserStream, options)\n }\n}\n\nmodule.exports = Parser\n","const rdf = require('@rdfjs/data-model')\nconst { JsonLdParser } = require('jsonld-streaming-parser')\nconst { Transform } = require('readable-stream')\n\nconst relativeIriProtocol = 'null:'\n\nfunction termCleanup (factory) {\n return term => {\n if (term.termType !== 'NamedNode') {\n return null\n }\n\n if (!term.value.startsWith(relativeIriProtocol)) {\n return null\n }\n\n // remove dummy protocol workaround for relative IRIs\n return factory.namedNode(term.value.slice(relativeIriProtocol.length))\n }\n}\n\nfunction quadCleanup (factory) {\n const cleanup = termCleanup(factory)\n\n return quad => {\n const subject = cleanup(quad.subject)\n const predicate = cleanup(quad.predicate)\n const object = cleanup(quad.object)\n const graph = cleanup(quad.graph)\n\n if (subject || predicate || object || graph) {\n return factory.quad(\n subject || quad.subject,\n predicate || quad.predicate,\n object || quad.object,\n graph || quad.graph\n )\n }\n\n return quad\n }\n}\n\nclass ParserStream {\n constructor (input, { baseIRI = relativeIriProtocol, context = null, factory = rdf } = {}) {\n const parser = new JsonLdParser({\n baseIRI,\n context,\n dataFactory: factory,\n streamingProfile: false\n })\n\n input.pipe(parser)\n\n const cleanup = quadCleanup(factory)\n\n const transform = new Transform({\n objectMode: true,\n transform: (quad, encoding, callback) => {\n callback(null, cleanup(quad))\n }\n })\n\n parser.on('context', context => {\n Object.entries(context).forEach(([prefix, iri]) => {\n transform.emit('prefix', prefix, factory.namedNode(iri))\n })\n })\n parser.on('error', err => transform.destroy(err))\n parser.pipe(transform)\n\n return transform\n }\n}\n\nmodule.exports = ParserStream\n","const DataFactory = require('./lib/DataFactory.js')\n\nmodule.exports = DataFactory\n","class BlankNode {\n constructor (id) {\n this.value = id || ('b' + (++BlankNode.nextId))\n }\n\n equals (other) {\n return !!other && other.termType === this.termType && other.value === this.value\n }\n}\n\nBlankNode.prototype.termType = 'BlankNode'\n\nBlankNode.nextId = 0\n\nmodule.exports = BlankNode\n","const BlankNode = require('./BlankNode.js')\nconst DefaultGraph = require('./DefaultGraph.js')\nconst fromTermRaw = require('./fromTerm.js')\nconst Literal = require('./Literal.js')\nconst NamedNode = require('./NamedNode.js')\nconst Quad = require('./Quad.js')\nconst Variable = require('./Variable.js')\n\nfunction namedNode (value) {\n return new NamedNode(value)\n}\n\nfunction blankNode (value) {\n return new BlankNode(value)\n}\n\nfunction literal (value, languageOrDatatype) {\n if (typeof languageOrDatatype === 'string') {\n if (languageOrDatatype.indexOf(':') === -1) {\n return new Literal(value, languageOrDatatype)\n }\n\n return new Literal(value, null, DataFactory.namedNode(languageOrDatatype))\n }\n\n return new Literal(value, null, languageOrDatatype)\n}\n\nfunction variable (value) {\n return new Variable(value)\n}\n\nfunction defaultGraph () {\n return DataFactory.defaultGraphInstance\n}\n\nfunction triple (subject, predicate, object) {\n return DataFactory.quad(subject, predicate, object)\n}\n\nfunction quad (subject, predicate, object, graph) {\n return new Quad(subject, predicate, object, graph || DataFactory.defaultGraphInstance)\n}\n\nfunction fromTerm (original) {\n return fromTermRaw.call(DataFactory, original)\n}\n\nfunction fromQuad (original) {\n return fromTermRaw.call(DataFactory, original)\n}\n\nconst DataFactory = {\n namedNode,\n blankNode,\n literal,\n variable,\n defaultGraph,\n triple,\n quad,\n fromTerm,\n fromQuad,\n defaultGraphInstance: new DefaultGraph()\n}\n\nmodule.exports = DataFactory\n","class DefaultGraph {\n equals (other) {\n return !!other && other.termType === this.termType\n }\n}\n\nDefaultGraph.prototype.termType = 'DefaultGraph'\nDefaultGraph.prototype.value = ''\n\nmodule.exports = DefaultGraph\n","const NamedNode = require('./NamedNode.js')\n\nclass Literal {\n constructor (value, language, datatype) {\n this.value = value\n this.datatype = Literal.stringDatatype\n this.language = ''\n\n if (language) {\n this.language = language\n this.datatype = Literal.langStringDatatype\n } else if (datatype) {\n this.datatype = datatype\n }\n }\n\n equals (other) {\n return !!other && other.termType === this.termType && other.value === this.value &&\n other.language === this.language && other.datatype.equals(this.datatype)\n }\n}\n\nLiteral.prototype.termType = 'Literal'\n\nLiteral.langStringDatatype = new NamedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString')\nLiteral.stringDatatype = new NamedNode('http://www.w3.org/2001/XMLSchema#string')\n\nmodule.exports = Literal\n","class NamedNode {\n constructor (iri) {\n this.value = iri\n }\n\n equals (other) {\n return !!other && other.termType === this.termType && other.value === this.value\n }\n}\n\nNamedNode.prototype.termType = 'NamedNode'\n\nmodule.exports = NamedNode\n","const DefaultGraph = require('./DefaultGraph.js')\n\nclass Quad {\n constructor (subject, predicate, object, graph) {\n this.subject = subject\n this.predicate = predicate\n this.object = object\n\n if (graph) {\n this.graph = graph\n } else {\n this.graph = new DefaultGraph()\n }\n }\n\n equals (other) {\n // `|| !other.termType` is for backwards-compatibility with old factories without RDF* support.\n return !!other && (other.termType === 'Quad' || !other.termType) &&\n other.subject.equals(this.subject) && other.predicate.equals(this.predicate) &&\n other.object.equals(this.object) && other.graph.equals(this.graph)\n }\n}\n\nQuad.prototype.termType = 'Quad'\nQuad.prototype.value = ''\n\nmodule.exports = Quad\n","class Variable {\n constructor (name) {\n this.value = name\n }\n\n equals (other) {\n return !!other && other.termType === this.termType && other.value === this.value\n }\n}\n\nVariable.prototype.termType = 'Variable'\n\nmodule.exports = Variable\n","function fromTerm (original) {\n if (!original) {\n return null\n }\n\n if (original.termType === 'BlankNode') {\n return this.blankNode(original.value)\n }\n\n if (original.termType === 'DefaultGraph') {\n return this.defaultGraph()\n }\n\n if (original.termType === 'Literal') {\n return this.literal(original.value, original.language || this.namedNode(original.datatype.value))\n }\n\n if (original.termType === 'NamedNode') {\n return this.namedNode(original.value)\n }\n\n if (original.termType === 'Quad') {\n const subject = this.fromTerm(original.subject)\n const predicate = this.fromTerm(original.predicate)\n const object = this.fromTerm(original.object)\n const graph = this.fromTerm(original.graph)\n\n return this.quad(subject, predicate, object, graph)\n }\n\n if (original.termType === 'Variable') {\n return this.variable(original.value)\n }\n\n throw new Error(`unknown termType ${original.termType}`)\n}\n\nmodule.exports = fromTerm\n","class Sink {\n constructor (Impl, options) {\n this.Impl = Impl\n this.options = options\n }\n\n import (input, options) {\n const output = new this.Impl(input, Object.assign({}, this.options, options))\n\n input.on('end', () => {\n if (!output.readable) {\n output.emit('end')\n }\n })\n\n input.on('error', (err) => {\n output.emit('error', err)\n })\n\n return output\n }\n}\n\nmodule.exports = Sink\n","(function(self) {\n\nvar irrelevant = (function (exports) {\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob:\n 'FileReader' in self &&\n 'Blob' in self &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : 'OK';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = self.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options));\n };\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.onabort = function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n };\n\n xhr.open(request.method, request.url, true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob';\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!self.fetch) {\n self.fetch = fetch;\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n return exports;\n\n})({});\n})(typeof self !== 'undefined' ? self : this);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lib/ContextParser\"), exports);\n__exportStar(require(\"./lib/ErrorCoded\"), exports);\n__exportStar(require(\"./lib/FetchDocumentLoader\"), exports);\n__exportStar(require(\"./lib/IDocumentLoader\"), exports);\n__exportStar(require(\"./lib/JsonLdContext\"), exports);\n__exportStar(require(\"./lib/JsonLdContextNormalized\"), exports);\n__exportStar(require(\"./lib/Util\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContextParser = void 0;\nrequire(\"cross-fetch/polyfill\");\nconst relative_to_absolute_iri_1 = require(\"relative-to-absolute-iri\");\nconst ErrorCoded_1 = require(\"./ErrorCoded\");\nconst FetchDocumentLoader_1 = require(\"./FetchDocumentLoader\");\nconst JsonLdContextNormalized_1 = require(\"./JsonLdContextNormalized\");\nconst Util_1 = require(\"./Util\");\n/**\n * Parses JSON-LD contexts.\n */\nclass ContextParser {\n constructor(options) {\n options = options || {};\n this.documentLoader = options.documentLoader || new FetchDocumentLoader_1.FetchDocumentLoader();\n this.documentCache = {};\n this.validateContext = !options.skipValidation;\n this.expandContentTypeToBase = !!options.expandContentTypeToBase;\n this.remoteContextsDepthLimit = options.remoteContextsDepthLimit || 32;\n this.redirectSchemaOrgHttps = 'redirectSchemaOrgHttps' in options ? !!options.redirectSchemaOrgHttps : true;\n }\n /**\n * Validate the given @language value.\n * An error will be thrown if it is invalid.\n * @param value An @language value.\n * @param {boolean} strictRange If the string value should be strictly checked against a regex.\n * @param {string} errorCode The error code to emit on errors.\n * @return {boolean} If validation passed.\n * Can only be false if strictRange is false and the string value did not pass the regex.\n */\n static validateLanguage(value, strictRange, errorCode) {\n if (typeof value !== 'string') {\n throw new ErrorCoded_1.ErrorCoded(`The value of an '@language' must be a string, got '${JSON.stringify(value)}'`, errorCode);\n }\n if (!Util_1.Util.REGEX_LANGUAGE_TAG.test(value)) {\n if (strictRange) {\n throw new ErrorCoded_1.ErrorCoded(`The value of an '@language' must be a valid language tag, got '${JSON.stringify(value)}'`, errorCode);\n }\n else {\n return false;\n }\n }\n return true;\n }\n /**\n * Validate the given @direction value.\n * An error will be thrown if it is invalid.\n * @param value An @direction value.\n * @param {boolean} strictValues If the string value should be strictly checked against a regex.\n * @return {boolean} If validation passed.\n * Can only be false if strictRange is false and the string value did not pass the regex.\n */\n static validateDirection(value, strictValues) {\n if (typeof value !== 'string') {\n throw new ErrorCoded_1.ErrorCoded(`The value of an '@direction' must be a string, got '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_BASE_DIRECTION);\n }\n if (!Util_1.Util.REGEX_DIRECTION_TAG.test(value)) {\n if (strictValues) {\n throw new ErrorCoded_1.ErrorCoded(`The value of an '@direction' must be 'ltr' or 'rtl', got '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_BASE_DIRECTION);\n }\n else {\n return false;\n }\n }\n return true;\n }\n /**\n * Add an @id term for all @reverse terms.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n * @return {IJsonLdContextNormalizedRaw} The mutated input context.\n */\n idifyReverseTerms(context) {\n for (const key of Object.keys(context)) {\n let value = context[key];\n if (value && typeof value === 'object') {\n if (value['@reverse'] && !value['@id']) {\n if (typeof value['@reverse'] !== 'string' || Util_1.Util.isValidKeyword(value['@reverse'])) {\n throw new ErrorCoded_1.ErrorCoded(`Invalid @reverse value, must be absolute IRI or blank node: '${value['@reverse']}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n value = context[key] = Object.assign(Object.assign({}, value), { '@id': value['@reverse'] });\n value['@id'] = value['@reverse'];\n if (Util_1.Util.isPotentialKeyword(value['@reverse'])) {\n delete value['@reverse'];\n }\n else {\n value['@reverse'] = true;\n }\n }\n }\n }\n return context;\n }\n /**\n * Expand all prefixed terms in the given context.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n * @param {boolean} expandContentTypeToBase If @type inside the context may be expanded\n * via @base if @vocab is set to null.\n * @param {string[]} keys Optional set of keys from the context to expand. If left undefined, all\n * keys in the context will be expanded.\n */\n expandPrefixedTerms(context, expandContentTypeToBase, keys) {\n const contextRaw = context.getContextRaw();\n for (const key of (keys || Object.keys(contextRaw))) {\n // Only expand allowed keys\n if (Util_1.Util.EXPAND_KEYS_BLACKLIST.indexOf(key) < 0 && !Util_1.Util.isReservedInternalKeyword(key)) {\n // Error if we try to alias a keyword to something else.\n const keyValue = contextRaw[key];\n if (Util_1.Util.isPotentialKeyword(key) && Util_1.Util.ALIAS_DOMAIN_BLACKLIST.indexOf(key) >= 0) {\n if (key !== '@type' || typeof contextRaw[key] === 'object'\n && !(contextRaw[key]['@protected'] || contextRaw[key]['@container'] === '@set')) {\n throw new ErrorCoded_1.ErrorCoded(`Keywords can not be aliased to something else.\nTried mapping ${key} to ${JSON.stringify(keyValue)}`, ErrorCoded_1.ERROR_CODES.KEYWORD_REDEFINITION);\n }\n }\n // Error if we try to alias to an illegal keyword\n if (Util_1.Util.ALIAS_RANGE_BLACKLIST.indexOf(Util_1.Util.getContextValueId(keyValue)) >= 0) {\n throw new ErrorCoded_1.ErrorCoded(`Aliasing to certain keywords is not allowed.\nTried mapping ${key} to ${JSON.stringify(keyValue)}`, ErrorCoded_1.ERROR_CODES.INVALID_KEYWORD_ALIAS);\n }\n // Error if this term was marked as prefix as well\n if (keyValue && Util_1.Util.isPotentialKeyword(Util_1.Util.getContextValueId(keyValue))\n && keyValue['@prefix'] === true) {\n throw new ErrorCoded_1.ErrorCoded(`Tried to use keyword aliases as prefix: '${key}': '${JSON.stringify(keyValue)}'`, ErrorCoded_1.ERROR_CODES.INVALID_TERM_DEFINITION);\n }\n // Loop because prefixes might be nested\n while (Util_1.Util.isPrefixValue(contextRaw[key])) {\n const value = contextRaw[key];\n let changed = false;\n if (typeof value === 'string') {\n contextRaw[key] = context.expandTerm(value, true);\n changed = changed || value !== contextRaw[key];\n }\n else {\n const id = value['@id'];\n const type = value['@type'];\n // If @id is missing, don't allow @id to be added if @prefix: true and key not being a valid IRI.\n const canAddIdEntry = !('@prefix' in value) || Util_1.Util.isValidIri(key);\n if ('@id' in value) {\n // Use @id value for expansion\n if (id !== undefined && id !== null && typeof id === 'string') {\n contextRaw[key] = Object.assign(Object.assign({}, contextRaw[key]), { '@id': context.expandTerm(id, true) });\n changed = changed || id !== contextRaw[key]['@id'];\n }\n }\n else if (!Util_1.Util.isPotentialKeyword(key) && canAddIdEntry) {\n // Add an explicit @id value based on the expanded key value\n const newId = context.expandTerm(key, true);\n if (newId !== key) {\n // Don't set @id if expansion failed\n contextRaw[key] = Object.assign(Object.assign({}, contextRaw[key]), { '@id': newId });\n changed = true;\n }\n }\n if (type && typeof type === 'string' && type !== '@vocab'\n && (!value['@container'] || !value['@container']['@type'])\n && canAddIdEntry) {\n // First check @vocab, then fallback to @base\n let expandedType = context.expandTerm(type, true);\n if (expandContentTypeToBase && type === expandedType) {\n expandedType = context.expandTerm(type, false);\n }\n if (expandedType !== type) {\n changed = true;\n contextRaw[key] = Object.assign(Object.assign({}, contextRaw[key]), { '@type': expandedType });\n }\n }\n }\n if (!changed) {\n break;\n }\n }\n }\n }\n }\n /**\n * Normalize the @language entries in the given context to lowercase.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n * @param {IParseOptions} parseOptions The parsing options.\n */\n normalize(context, { processingMode, normalizeLanguageTags }) {\n // Lowercase language keys in 1.0\n if (normalizeLanguageTags || processingMode === 1.0) {\n for (const key of Object.keys(context)) {\n if (key === '@language' && typeof context[key] === 'string') {\n context[key] = context[key].toLowerCase();\n }\n else {\n const value = context[key];\n if (value && typeof value === 'object') {\n if (typeof value['@language'] === 'string') {\n const lowercase = value['@language'].toLowerCase();\n if (lowercase !== value['@language']) {\n context[key] = Object.assign(Object.assign({}, value), { '@language': lowercase });\n }\n }\n }\n }\n }\n }\n }\n /**\n * Convert all @container strings and array values to hash-based values.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n */\n containersToHash(context) {\n for (const key of Object.keys(context)) {\n const value = context[key];\n if (value && typeof value === 'object') {\n if (typeof value['@container'] === 'string') {\n context[key] = Object.assign(Object.assign({}, value), { '@container': { [value['@container']]: true } });\n }\n else if (Array.isArray(value['@container'])) {\n const newValue = {};\n for (const containerValue of value['@container']) {\n newValue[containerValue] = true;\n }\n context[key] = Object.assign(Object.assign({}, value), { '@container': newValue });\n }\n }\n }\n }\n /**\n * Normalize and apply context-level @protected terms onto each term separately.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n * @param {number} processingMode The processing mode.\n */\n applyScopedProtected(context, { processingMode }, expandOptions) {\n if (processingMode && processingMode >= 1.1) {\n if (context['@protected']) {\n for (const key of Object.keys(context)) {\n if (Util_1.Util.isReservedInternalKeyword(key)) {\n continue;\n }\n if (!Util_1.Util.isPotentialKeyword(key) && !Util_1.Util.isTermProtected(context, key)) {\n const value = context[key];\n if (value && typeof value === 'object') {\n if (!('@protected' in context[key])) {\n // Mark terms with object values as protected if they don't have an @protected: false annotation\n context[key] = Object.assign(Object.assign({}, context[key]), { '@protected': true });\n }\n }\n else {\n // Convert string-based term values to object-based values with @protected: true\n context[key] = {\n '@id': value,\n '@protected': true,\n };\n if (Util_1.Util.isSimpleTermDefinitionPrefix(value, expandOptions)) {\n context[key] = Object.assign(Object.assign({}, context[key]), { '@prefix': true });\n }\n }\n }\n }\n delete context['@protected'];\n }\n }\n }\n /**\n * Check if the given context inheritance does not contain any overrides of protected terms.\n * @param {IJsonLdContextNormalizedRaw} contextBefore The context that may contain some protected terms.\n * @param {IJsonLdContextNormalizedRaw} contextAfter A new context that is being applied on the first one.\n * @param {IExpandOptions} expandOptions Options that are needed for any expansions during this validation.\n * @param {string[]} keys Optional set of keys from the context to validate. If left undefined, all\n * keys defined in contextAfter will be checked.\n */\n validateKeywordRedefinitions(contextBefore, contextAfter, expandOptions, keys) {\n for (const key of (keys !== null && keys !== void 0 ? keys : Object.keys(contextAfter))) {\n if (Util_1.Util.isTermProtected(contextBefore, key)) {\n // The entry in the context before will always be in object-mode\n // If the new entry is in string-mode, convert it to object-mode\n // before checking if it is identical.\n if (typeof contextAfter[key] === 'string') {\n contextAfter[key] = { '@id': contextAfter[key], '@protected': true };\n }\n else {\n // We modify this deliberately,\n // as we need it for the value comparison (they must be identical modulo '@protected')),\n // and for the fact that this new value will override the first one.\n contextAfter[key] = Object.assign(Object.assign({}, contextAfter[key]), { '@protected': true });\n }\n // Error if they are not identical\n if (!Util_1.Util.deepEqual(contextBefore[key], contextAfter[key])) {\n throw new ErrorCoded_1.ErrorCoded(`Attempted to override the protected keyword ${key} from ${JSON.stringify(Util_1.Util.getContextValueId(contextBefore[key]))} to ${JSON.stringify(Util_1.Util.getContextValueId(contextAfter[key]))}`, ErrorCoded_1.ERROR_CODES.PROTECTED_TERM_REDEFINITION);\n }\n }\n }\n }\n /**\n * Validate the entries of the given context.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n * @param {IParseOptions} options The parse options.\n */\n validate(context, { processingMode }) {\n for (const key of Object.keys(context)) {\n // Ignore reserved internal keywords.\n if (Util_1.Util.isReservedInternalKeyword(key)) {\n continue;\n }\n // Do not allow empty term\n if (key === '') {\n throw new ErrorCoded_1.ErrorCoded(`The empty term is not allowed, got: '${key}': '${JSON.stringify(context[key])}'`, ErrorCoded_1.ERROR_CODES.INVALID_TERM_DEFINITION);\n }\n const value = context[key];\n const valueType = typeof value;\n // First check if the key is a keyword\n if (Util_1.Util.isPotentialKeyword(key)) {\n switch (key.substr(1)) {\n case 'vocab':\n if (value !== null && valueType !== 'string') {\n throw new ErrorCoded_1.ErrorCoded(`Found an invalid @vocab IRI: ${value}`, ErrorCoded_1.ERROR_CODES.INVALID_VOCAB_MAPPING);\n }\n break;\n case 'base':\n if (value !== null && valueType !== 'string') {\n throw new ErrorCoded_1.ErrorCoded(`Found an invalid @base IRI: ${context[key]}`, ErrorCoded_1.ERROR_CODES.INVALID_BASE_IRI);\n }\n break;\n case 'language':\n if (value !== null) {\n ContextParser.validateLanguage(value, true, ErrorCoded_1.ERROR_CODES.INVALID_DEFAULT_LANGUAGE);\n }\n break;\n case 'version':\n if (value !== null && valueType !== 'number') {\n throw new ErrorCoded_1.ErrorCoded(`Found an invalid @version number: ${value}`, ErrorCoded_1.ERROR_CODES.INVALID_VERSION_VALUE);\n }\n break;\n case 'direction':\n if (value !== null) {\n ContextParser.validateDirection(value, true);\n }\n break;\n case 'propagate':\n if (processingMode === 1.0) {\n throw new ErrorCoded_1.ErrorCoded(`Found an illegal @propagate keyword: ${value}`, ErrorCoded_1.ERROR_CODES.INVALID_CONTEXT_ENTRY);\n }\n if (value !== null && valueType !== 'boolean') {\n throw new ErrorCoded_1.ErrorCoded(`Found an invalid @propagate value: ${value}`, ErrorCoded_1.ERROR_CODES.INVALID_PROPAGATE_VALUE);\n }\n break;\n }\n // Don't allow keywords to be overridden\n if (Util_1.Util.isValidKeyword(key) && Util_1.Util.isValidKeyword(Util_1.Util.getContextValueId(value))) {\n throw new ErrorCoded_1.ErrorCoded(`Illegal keyword alias in term value, found: '${key}': '${Util_1.Util\n .getContextValueId(value)}'`, ErrorCoded_1.ERROR_CODES.KEYWORD_REDEFINITION);\n }\n continue;\n }\n // Otherwise, consider the key a term\n if (value !== null) {\n switch (valueType) {\n case 'string':\n if (Util_1.Util.getPrefix(value, context) === key) {\n throw new ErrorCoded_1.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${key}': '${JSON\n .stringify(value)}'`, ErrorCoded_1.ERROR_CODES.CYCLIC_IRI_MAPPING);\n }\n if (Util_1.Util.isValidIriWeak(key)) {\n if (value === '@type') {\n throw new ErrorCoded_1.ErrorCoded(`IRIs can not be mapped to @type, found: '${key}': '${value}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n else if (Util_1.Util.isValidIri(value) && value !== new JsonLdContextNormalized_1.JsonLdContextNormalized(context).expandTerm(key)) {\n throw new ErrorCoded_1.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${key}': '${value}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n }\n break;\n case 'object':\n if (!Util_1.Util.isCompactIri(key) && !('@id' in value)\n && (value['@type'] === '@id' ? !context['@base'] : !context['@vocab'])) {\n throw new ErrorCoded_1.ErrorCoded(`Missing @id in context entry: '${key}': '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n for (const objectKey of Object.keys(value)) {\n const objectValue = value[objectKey];\n if (!objectValue) {\n continue;\n }\n switch (objectKey) {\n case '@id':\n if (Util_1.Util.isValidKeyword(objectValue)\n && objectValue !== '@type' && objectValue !== '@id' && objectValue !== '@graph' && objectValue !== '@nest') {\n throw new ErrorCoded_1.ErrorCoded(`Illegal keyword alias in term value, found: '${key}': '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n if (Util_1.Util.isValidIriWeak(key)) {\n if (objectValue === '@type') {\n throw new ErrorCoded_1.ErrorCoded(`IRIs can not be mapped to @type, found: '${key}': '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n else if (Util_1.Util.isValidIri(objectValue)\n && objectValue !== new JsonLdContextNormalized_1.JsonLdContextNormalized(context).expandTerm(key)) {\n throw new ErrorCoded_1.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${key}': '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n }\n if (typeof objectValue !== 'string') {\n throw new ErrorCoded_1.ErrorCoded(`Detected non-string @id in context entry: '${key}': '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n if (Util_1.Util.getPrefix(objectValue, context) === key) {\n throw new ErrorCoded_1.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${key}': '${JSON\n .stringify(value)}'`, ErrorCoded_1.ERROR_CODES.CYCLIC_IRI_MAPPING);\n }\n break;\n case '@type':\n if (value['@container'] === '@type' && objectValue !== '@id' && objectValue !== '@vocab') {\n throw new ErrorCoded_1.ErrorCoded(`@container: @type only allows @type: @id or @vocab, but got: '${key}': '${objectValue}'`, ErrorCoded_1.ERROR_CODES.INVALID_TYPE_MAPPING);\n }\n if (typeof objectValue !== 'string') {\n throw new ErrorCoded_1.ErrorCoded(`The value of an '@type' must be a string, got '${JSON.stringify(valueType)}'`, ErrorCoded_1.ERROR_CODES.INVALID_TYPE_MAPPING);\n }\n if (objectValue !== '@id' && objectValue !== '@vocab'\n && (processingMode === 1.0 || objectValue !== '@json')\n && (processingMode === 1.0 || objectValue !== '@none')\n && (objectValue[0] === '_' || !Util_1.Util.isValidIri(objectValue))) {\n throw new ErrorCoded_1.ErrorCoded(`A context @type must be an absolute IRI, found: '${key}': '${objectValue}'`, ErrorCoded_1.ERROR_CODES.INVALID_TYPE_MAPPING);\n }\n break;\n case '@reverse':\n if (typeof objectValue === 'string' && value['@id'] && value['@id'] !== objectValue) {\n throw new ErrorCoded_1.ErrorCoded(`Found non-matching @id and @reverse term values in '${key}':\\\n'${objectValue}' and '${value['@id']}'`, ErrorCoded_1.ERROR_CODES.INVALID_REVERSE_PROPERTY);\n }\n if ('@nest' in value) {\n throw new ErrorCoded_1.ErrorCoded(`@nest is not allowed in the reverse property '${key}'`, ErrorCoded_1.ERROR_CODES.INVALID_REVERSE_PROPERTY);\n }\n break;\n case '@container':\n if (processingMode === 1.0) {\n if (Object.keys(objectValue).length > 1\n || Util_1.Util.CONTAINERS_1_0.indexOf(Object.keys(objectValue)[0]) < 0) {\n throw new ErrorCoded_1.ErrorCoded(`Invalid term @container for '${key}' ('${Object.keys(objectValue)}') in 1.0, \\\nmust be only one of ${Util_1.Util.CONTAINERS_1_0.join(', ')}`, ErrorCoded_1.ERROR_CODES.INVALID_CONTAINER_MAPPING);\n }\n }\n for (const containerValue of Object.keys(objectValue)) {\n if (containerValue === '@list' && value['@reverse']) {\n throw new ErrorCoded_1.ErrorCoded(`Term value can not be @container: @list and @reverse at the same time on '${key}'`, ErrorCoded_1.ERROR_CODES.INVALID_REVERSE_PROPERTY);\n }\n if (Util_1.Util.CONTAINERS.indexOf(containerValue) < 0) {\n throw new ErrorCoded_1.ErrorCoded(`Invalid term @container for '${key}' ('${containerValue}'), \\\nmust be one of ${Util_1.Util.CONTAINERS.join(', ')}`, ErrorCoded_1.ERROR_CODES.INVALID_CONTAINER_MAPPING);\n }\n }\n break;\n case '@language':\n ContextParser.validateLanguage(objectValue, true, ErrorCoded_1.ERROR_CODES.INVALID_LANGUAGE_MAPPING);\n break;\n case '@direction':\n ContextParser.validateDirection(objectValue, true);\n break;\n case '@prefix':\n if (objectValue !== null && typeof objectValue !== 'boolean') {\n throw new ErrorCoded_1.ErrorCoded(`Found an invalid term @prefix boolean in: '${key}': '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_PREFIX_VALUE);\n }\n if (!('@id' in value) && !Util_1.Util.isValidIri(key)) {\n throw new ErrorCoded_1.ErrorCoded(`Invalid @prefix definition for '${key}' ('${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_TERM_DEFINITION);\n }\n break;\n case '@index':\n if (processingMode === 1.0 || !value['@container'] || !value['@container']['@index']) {\n throw new ErrorCoded_1.ErrorCoded(`Attempt to add illegal key to value object: '${key}': '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_TERM_DEFINITION);\n }\n break;\n case '@nest':\n if (Util_1.Util.isPotentialKeyword(objectValue) && objectValue !== '@nest') {\n throw new ErrorCoded_1.ErrorCoded(`Found an invalid term @nest value in: '${key}': '${JSON.stringify(value)}'`, ErrorCoded_1.ERROR_CODES.INVALID_NEST_VALUE);\n }\n }\n }\n break;\n default:\n throw new ErrorCoded_1.ErrorCoded(`Found an invalid term value: '${key}': '${value}'`, ErrorCoded_1.ERROR_CODES.INVALID_TERM_DEFINITION);\n }\n }\n }\n }\n /**\n * Apply the @base context entry to the given context under certain circumstances.\n * @param context A context.\n * @param options Parsing options.\n * @param inheritFromParent If the @base value from the parent context can be inherited.\n * @return The given context.\n */\n applyBaseEntry(context, options, inheritFromParent) {\n // In some special cases, this can be a string, so ignore those.\n if (typeof context === 'string') {\n return context;\n }\n // Give priority to @base in the parent context\n if (inheritFromParent && !('@base' in context) && options.parentContext\n && typeof options.parentContext === 'object' && '@base' in options.parentContext) {\n context['@base'] = options.parentContext['@base'];\n if (options.parentContext['@__baseDocument']) {\n context['@__baseDocument'] = true;\n }\n }\n // Override the base IRI if provided.\n if (options.baseIRI && !options.external) {\n if (!('@base' in context)) {\n // The context base is the document base\n context['@base'] = options.baseIRI;\n context['@__baseDocument'] = true;\n }\n else if (context['@base'] !== null && typeof context['@base'] === 'string'\n && !Util_1.Util.isValidIri(context['@base'])) {\n // The context base is relative to the document base\n context['@base'] = (0, relative_to_absolute_iri_1.resolve)(context['@base'], options.parentContext && options.parentContext['@base'] || options.baseIRI);\n }\n }\n return context;\n }\n /**\n * Resolve relative context IRIs, or return full IRIs as-is.\n * @param {string} contextIri A context IRI.\n * @param {string} baseIRI A base IRI.\n * @return {string} The normalized context IRI.\n */\n normalizeContextIri(contextIri, baseIRI) {\n if (!Util_1.Util.isValidIri(contextIri)) {\n try {\n contextIri = (0, relative_to_absolute_iri_1.resolve)(contextIri, baseIRI);\n }\n catch (_a) {\n throw new Error(`Invalid context IRI: ${contextIri}`);\n }\n }\n // TODO: Temporary workaround for fixing schema.org CORS issues (https://github.com/schemaorg/schemaorg/issues/2578#issuecomment-652324465)\n if (this.redirectSchemaOrgHttps && contextIri.startsWith('http://schema.org')) {\n contextIri = 'https://schema.org/';\n }\n return contextIri;\n }\n /**\n * Parse scoped contexts in the given context.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n * @param {IParseOptions} options Parsing options.\n * @return {IJsonLdContextNormalizedRaw} The mutated input context.\n * @param {string[]} keys Optional set of keys from the context to parseInnerContexts of. If left undefined, all\n * keys in the context will be iterated over.\n */\n async parseInnerContexts(context, options, keys) {\n for (const key of (keys !== null && keys !== void 0 ? keys : Object.keys(context))) {\n const value = context[key];\n if (value && typeof value === 'object') {\n if ('@context' in value && value['@context'] !== null && !options.ignoreScopedContexts) {\n // Simulate a processing based on the parent context to check if there are any (potential errors).\n // Honestly, I find it a bit weird to do this here, as the context may be unused,\n // and the final effective context may differ based on any other embedded/scoped contexts.\n // But hey, it's part of the spec, so we have no choice...\n // https://w3c.github.io/json-ld-api/#h-note-10\n if (this.validateContext) {\n try {\n const parentContext = Object.assign(Object.assign({}, context), { [key]: Object.assign({}, context[key]) });\n delete parentContext[key]['@context'];\n await this.parse(value['@context'], Object.assign(Object.assign({}, options), { external: false, parentContext, ignoreProtection: true, ignoreRemoteScopedContexts: true, ignoreScopedContexts: true }));\n }\n catch (e) {\n throw new ErrorCoded_1.ErrorCoded(e.message, ErrorCoded_1.ERROR_CODES.INVALID_SCOPED_CONTEXT);\n }\n }\n context[key] = Object.assign(Object.assign({}, value), { '@context': (await this.parse(value['@context'], Object.assign(Object.assign({}, options), { external: false, minimalProcessing: true, ignoreRemoteScopedContexts: true, parentContext: context })))\n .getContextRaw() });\n }\n }\n }\n return context;\n }\n async parse(context, options = {}, \n // These options are only for internal use on recursive calls and should not be used by\n // libraries consuming this function\n internalOptions = {}) {\n const { baseIRI, parentContext, external, processingMode = ContextParser.DEFAULT_PROCESSING_MODE, normalizeLanguageTags, ignoreProtection, minimalProcessing, } = options;\n const remoteContexts = options.remoteContexts || {};\n // Avoid remote context overflows\n if (Object.keys(remoteContexts).length >= this.remoteContextsDepthLimit) {\n throw new ErrorCoded_1.ErrorCoded('Detected an overflow in remote context inclusions: ' + Object.keys(remoteContexts), ErrorCoded_1.ERROR_CODES.CONTEXT_OVERFLOW);\n }\n if (context === null || context === undefined) {\n // Don't allow context nullification and there are protected terms\n if (!ignoreProtection && parentContext && Util_1.Util.hasProtectedTerms(parentContext)) {\n throw new ErrorCoded_1.ErrorCoded('Illegal context nullification when terms are protected', ErrorCoded_1.ERROR_CODES.INVALID_CONTEXT_NULLIFICATION);\n }\n // Context that are explicitly set to null are empty.\n return new JsonLdContextNormalized_1.JsonLdContextNormalized(this.applyBaseEntry({}, options, false));\n }\n else if (typeof context === 'string') {\n const contextIri = this.normalizeContextIri(context, baseIRI);\n const overriddenLoad = this.getOverriddenLoad(contextIri, options);\n if (overriddenLoad) {\n return new JsonLdContextNormalized_1.JsonLdContextNormalized(overriddenLoad);\n }\n const parsedStringContext = await this.parse(await this.load(contextIri), Object.assign(Object.assign({}, options), { baseIRI: contextIri, external: true, remoteContexts: Object.assign(Object.assign({}, remoteContexts), { [contextIri]: true }) }));\n this.applyBaseEntry(parsedStringContext.getContextRaw(), options, true);\n return parsedStringContext;\n }\n else if (Array.isArray(context)) {\n // As a performance consideration, first load all external contexts in parallel.\n const contextIris = [];\n const contexts = await Promise.all(context.map((subContext, i) => {\n if (typeof subContext === 'string') {\n const contextIri = this.normalizeContextIri(subContext, baseIRI);\n contextIris[i] = contextIri;\n const overriddenLoad = this.getOverriddenLoad(contextIri, options);\n if (overriddenLoad) {\n return overriddenLoad;\n }\n return this.load(contextIri);\n }\n else {\n return subContext;\n }\n }));\n // Don't apply inheritance logic on minimal processing\n if (minimalProcessing) {\n return new JsonLdContextNormalized_1.JsonLdContextNormalized(contexts);\n }\n const reducedContexts = await contexts.reduce((accContextPromise, contextEntry, i) => accContextPromise\n .then((accContext) => this.parse(contextEntry, Object.assign(Object.assign({}, options), { baseIRI: contextIris[i] || options.baseIRI, external: !!contextIris[i] || options.external, parentContext: accContext.getContextRaw(), remoteContexts: contextIris[i] ? Object.assign(Object.assign({}, remoteContexts), { [contextIris[i]]: true }) : remoteContexts }), \n // @ts-expect-error: This third argument causes a type error because we have hidden it from consumers\n {\n skipValidation: i < contexts.length - 1,\n })), Promise.resolve(new JsonLdContextNormalized_1.JsonLdContextNormalized(parentContext || {})));\n // Override the base IRI if provided.\n this.applyBaseEntry(reducedContexts.getContextRaw(), options, true);\n return reducedContexts;\n }\n else if (typeof context === 'object') {\n if ('@context' in context) {\n return await this.parse(context['@context'], options);\n }\n // Make a deep clone of the given context, to avoid modifying it.\n context = Object.assign({}, context);\n // According to the JSON-LD spec, @base must be ignored from external contexts.\n if (external) {\n delete context['@base'];\n }\n // Override the base IRI if provided.\n this.applyBaseEntry(context, options, true);\n // Hashify container entries\n // Do this before protected term validation as that influences term format\n this.containersToHash(context);\n // Don't perform any other modifications if only minimal processing is needed.\n if (minimalProcessing) {\n return new JsonLdContextNormalized_1.JsonLdContextNormalized(context);\n }\n // In JSON-LD 1.1, load @import'ed context prior to processing.\n let importContext = {};\n if ('@import' in context) {\n if (processingMode >= 1.1) {\n // Only accept string values\n if (typeof context['@import'] !== 'string') {\n throw new ErrorCoded_1.ErrorCoded('An @import value must be a string, but got ' + typeof context['@import'], ErrorCoded_1.ERROR_CODES.INVALID_IMPORT_VALUE);\n }\n // Load context\n importContext = await this.loadImportContext(this.normalizeContextIri(context['@import'], baseIRI));\n delete context['@import'];\n }\n else {\n throw new ErrorCoded_1.ErrorCoded('Context importing is not supported in JSON-LD 1.0', ErrorCoded_1.ERROR_CODES.INVALID_CONTEXT_ENTRY);\n }\n }\n this.applyScopedProtected(importContext, { processingMode }, JsonLdContextNormalized_1.defaultExpandOptions);\n const newContext = Object.assign(importContext, context);\n // Handle terms (before protection checks)\n this.idifyReverseTerms(newContext);\n this.normalize(newContext, { processingMode, normalizeLanguageTags });\n this.applyScopedProtected(newContext, { processingMode }, JsonLdContextNormalized_1.defaultExpandOptions);\n const keys = Object.keys(newContext);\n const overlappingKeys = [];\n if (typeof parentContext === 'object') {\n // Merge different parts of the final context in order\n for (const key in parentContext) {\n if (key in newContext) {\n overlappingKeys.push(key);\n }\n else {\n newContext[key] = parentContext[key];\n }\n }\n }\n // Parse inner contexts with minimal processing\n await this.parseInnerContexts(newContext, options, keys);\n const newContextWrapped = new JsonLdContextNormalized_1.JsonLdContextNormalized(newContext);\n // In JSON-LD 1.1, @vocab can be relative to @vocab in the parent context, or a compact IRI.\n if ((newContext && newContext['@version'] || ContextParser.DEFAULT_PROCESSING_MODE) >= 1.1\n && ((context['@vocab'] && typeof context['@vocab'] === 'string') || context['@vocab'] === '')) {\n if (parentContext && '@vocab' in parentContext && context['@vocab'].indexOf(':') < 0) {\n newContext['@vocab'] = parentContext['@vocab'] + context['@vocab'];\n }\n else if (Util_1.Util.isCompactIri(context['@vocab']) || context['@vocab'] in newContext) {\n // @vocab is a compact IRI or refers exactly to a prefix\n newContext['@vocab'] = newContextWrapped.expandTerm(context['@vocab'], true);\n }\n }\n this.expandPrefixedTerms(newContextWrapped, this.expandContentTypeToBase, keys);\n // In JSON-LD 1.1, check if we are not redefining any protected keywords\n if (!ignoreProtection && parentContext && processingMode >= 1.1) {\n this.validateKeywordRedefinitions(parentContext, newContext, JsonLdContextNormalized_1.defaultExpandOptions, overlappingKeys);\n }\n if (this.validateContext && !internalOptions.skipValidation) {\n this.validate(newContext, { processingMode });\n }\n return newContextWrapped;\n }\n else {\n throw new ErrorCoded_1.ErrorCoded(`Tried parsing a context that is not a string, array or object, but got ${context}`, ErrorCoded_1.ERROR_CODES.INVALID_LOCAL_CONTEXT);\n }\n }\n /**\n * Fetch the given URL as a raw JSON-LD context.\n * @param url An URL.\n * @return A promise resolving to a raw JSON-LD context.\n */\n async load(url) {\n // First try to retrieve the context from cache\n const cached = this.documentCache[url];\n if (cached) {\n return cached;\n }\n // If not in cache, load it\n let document;\n try {\n document = await this.documentLoader.load(url);\n }\n catch (e) {\n throw new ErrorCoded_1.ErrorCoded(`Failed to load remote context ${url}: ${e.message}`, ErrorCoded_1.ERROR_CODES.LOADING_REMOTE_CONTEXT_FAILED);\n }\n // Validate the context\n if (!('@context' in document)) {\n throw new ErrorCoded_1.ErrorCoded(`Missing @context in remote context at ${url}`, ErrorCoded_1.ERROR_CODES.INVALID_REMOTE_CONTEXT);\n }\n return this.documentCache[url] = document['@context'];\n }\n /**\n * Override the given context that may be loaded.\n *\n * This will check whether or not the url is recursively being loaded.\n * @param url An URL.\n * @param options Parsing options.\n * @return An overridden context, or null.\n * Optionally an error can be thrown if a cyclic context is detected.\n */\n getOverriddenLoad(url, options) {\n if (url in (options.remoteContexts || {})) {\n if (options.ignoreRemoteScopedContexts) {\n return url;\n }\n else {\n throw new ErrorCoded_1.ErrorCoded('Detected a cyclic context inclusion of ' + url, ErrorCoded_1.ERROR_CODES.RECURSIVE_CONTEXT_INCLUSION);\n }\n }\n return null;\n }\n /**\n * Load an @import'ed context.\n * @param importContextIri The full URI of an @import value.\n */\n async loadImportContext(importContextIri) {\n // Load the context - and do a deep clone since we are about to mutate it\n let importContext = await this.load(importContextIri);\n // Require the context to be a non-array object\n if (typeof importContext !== 'object' || Array.isArray(importContext)) {\n throw new ErrorCoded_1.ErrorCoded('An imported context must be a single object: ' + importContextIri, ErrorCoded_1.ERROR_CODES.INVALID_REMOTE_CONTEXT);\n }\n // Error if the context contains another @import\n if ('@import' in importContext) {\n throw new ErrorCoded_1.ErrorCoded('An imported context can not import another context: ' + importContextIri, ErrorCoded_1.ERROR_CODES.INVALID_CONTEXT_ENTRY);\n }\n importContext = Object.assign({}, importContext);\n // Containers have to be converted into hash values the same way as for the importing context\n // Otherwise context validation will fail for container values\n this.containersToHash(importContext);\n return importContext;\n }\n}\nContextParser.DEFAULT_PROCESSING_MODE = 1.1;\nexports.ContextParser = ContextParser;\n//# sourceMappingURL=ContextParser.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ERROR_CODES = exports.ErrorCoded = void 0;\n/**\n * An error that has a certain error code.\n *\n * The error code can be any string.\n * All standardized error codes are listed in {@link ERROR_CODES}.\n */\nclass ErrorCoded extends Error {\n /* istanbul ignore next */\n constructor(message, code) {\n super(message);\n this.code = code;\n }\n}\nexports.ErrorCoded = ErrorCoded;\n/**\n * All standardized JSON-LD error codes.\n * @see https://w3c.github.io/json-ld-api/#dom-jsonlderrorcode\n */\n// tslint:disable:object-literal-sort-keys\nvar ERROR_CODES;\n(function (ERROR_CODES) {\n ERROR_CODES[\"COLLIDING_KEYWORDS\"] = \"colliding keywords\";\n ERROR_CODES[\"CONFLICTING_INDEXES\"] = \"conflicting indexes\";\n ERROR_CODES[\"CYCLIC_IRI_MAPPING\"] = \"cyclic IRI mapping\";\n ERROR_CODES[\"INVALID_ID_VALUE\"] = \"invalid @id value\";\n ERROR_CODES[\"INVALID_INDEX_VALUE\"] = \"invalid @index value\";\n ERROR_CODES[\"INVALID_NEST_VALUE\"] = \"invalid @nest value\";\n ERROR_CODES[\"INVALID_PREFIX_VALUE\"] = \"invalid @prefix value\";\n ERROR_CODES[\"INVALID_PROPAGATE_VALUE\"] = \"invalid @propagate value\";\n ERROR_CODES[\"INVALID_REVERSE_VALUE\"] = \"invalid @reverse value\";\n ERROR_CODES[\"INVALID_IMPORT_VALUE\"] = \"invalid @import value\";\n ERROR_CODES[\"INVALID_VERSION_VALUE\"] = \"invalid @version value\";\n ERROR_CODES[\"INVALID_BASE_IRI\"] = \"invalid base IRI\";\n ERROR_CODES[\"INVALID_CONTAINER_MAPPING\"] = \"invalid container mapping\";\n ERROR_CODES[\"INVALID_CONTEXT_ENTRY\"] = \"invalid context entry\";\n ERROR_CODES[\"INVALID_CONTEXT_NULLIFICATION\"] = \"invalid context nullification\";\n ERROR_CODES[\"INVALID_DEFAULT_LANGUAGE\"] = \"invalid default language\";\n ERROR_CODES[\"INVALID_INCLUDED_VALUE\"] = \"invalid @included value\";\n ERROR_CODES[\"INVALID_IRI_MAPPING\"] = \"invalid IRI mapping\";\n ERROR_CODES[\"INVALID_JSON_LITERAL\"] = \"invalid JSON literal\";\n ERROR_CODES[\"INVALID_KEYWORD_ALIAS\"] = \"invalid keyword alias\";\n ERROR_CODES[\"INVALID_LANGUAGE_MAP_VALUE\"] = \"invalid language map value\";\n ERROR_CODES[\"INVALID_LANGUAGE_MAPPING\"] = \"invalid language mapping\";\n ERROR_CODES[\"INVALID_LANGUAGE_TAGGED_STRING\"] = \"invalid language-tagged string\";\n ERROR_CODES[\"INVALID_LANGUAGE_TAGGED_VALUE\"] = \"invalid language-tagged value\";\n ERROR_CODES[\"INVALID_LOCAL_CONTEXT\"] = \"invalid local context\";\n ERROR_CODES[\"INVALID_REMOTE_CONTEXT\"] = \"invalid remote context\";\n ERROR_CODES[\"INVALID_REVERSE_PROPERTY\"] = \"invalid reverse property\";\n ERROR_CODES[\"INVALID_REVERSE_PROPERTY_MAP\"] = \"invalid reverse property map\";\n ERROR_CODES[\"INVALID_REVERSE_PROPERTY_VALUE\"] = \"invalid reverse property value\";\n ERROR_CODES[\"INVALID_SCOPED_CONTEXT\"] = \"invalid scoped context\";\n ERROR_CODES[\"INVALID_SCRIPT_ELEMENT\"] = \"invalid script element\";\n ERROR_CODES[\"INVALID_SET_OR_LIST_OBJECT\"] = \"invalid set or list object\";\n ERROR_CODES[\"INVALID_TERM_DEFINITION\"] = \"invalid term definition\";\n ERROR_CODES[\"INVALID_TYPE_MAPPING\"] = \"invalid type mapping\";\n ERROR_CODES[\"INVALID_TYPE_VALUE\"] = \"invalid type value\";\n ERROR_CODES[\"INVALID_TYPED_VALUE\"] = \"invalid typed value\";\n ERROR_CODES[\"INVALID_VALUE_OBJECT\"] = \"invalid value object\";\n ERROR_CODES[\"INVALID_VALUE_OBJECT_VALUE\"] = \"invalid value object value\";\n ERROR_CODES[\"INVALID_VOCAB_MAPPING\"] = \"invalid vocab mapping\";\n ERROR_CODES[\"IRI_CONFUSED_WITH_PREFIX\"] = \"IRI confused with prefix\";\n ERROR_CODES[\"KEYWORD_REDEFINITION\"] = \"keyword redefinition\";\n ERROR_CODES[\"LOADING_DOCUMENT_FAILED\"] = \"loading document failed\";\n ERROR_CODES[\"LOADING_REMOTE_CONTEXT_FAILED\"] = \"loading remote context failed\";\n ERROR_CODES[\"MULTIPLE_CONTEXT_LINK_HEADERS\"] = \"multiple context link headers\";\n ERROR_CODES[\"PROCESSING_MODE_CONFLICT\"] = \"processing mode conflict\";\n ERROR_CODES[\"PROTECTED_TERM_REDEFINITION\"] = \"protected term redefinition\";\n ERROR_CODES[\"CONTEXT_OVERFLOW\"] = \"context overflow\";\n ERROR_CODES[\"INVALID_BASE_DIRECTION\"] = \"invalid base direction\";\n ERROR_CODES[\"RECURSIVE_CONTEXT_INCLUSION\"] = \"recursive context inclusion\";\n ERROR_CODES[\"INVALID_STREAMING_KEY_ORDER\"] = \"invalid streaming key order\";\n /**\n * JSON-LD-star\n */\n ERROR_CODES[\"INVALID_EMBEDDED_NODE\"] = \"invalid embedded node\";\n ERROR_CODES[\"INVALID_ANNOTATION\"] = \"invalid annotation\";\n})(ERROR_CODES = exports.ERROR_CODES || (exports.ERROR_CODES = {}));\n//# sourceMappingURL=ErrorCoded.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FetchDocumentLoader = void 0;\nrequire(\"cross-fetch/polyfill\");\nconst ErrorCoded_1 = require(\"./ErrorCoded\");\nconst http_link_header_1 = require(\"http-link-header\");\nconst relative_to_absolute_iri_1 = require(\"relative-to-absolute-iri\");\n/**\n * Loads documents via the fetch API.\n */\nclass FetchDocumentLoader {\n constructor(fetcher) {\n this.fetcher = fetcher;\n }\n async load(url) {\n const response = await (this.fetcher || fetch)(url, { headers: new Headers({ accept: 'application/ld+json' }) });\n if (response.ok && response.headers) {\n let mediaType = response.headers.get('Content-Type');\n if (mediaType) {\n const colonPos = mediaType.indexOf(';');\n if (colonPos > 0) {\n mediaType = mediaType.substr(0, colonPos);\n }\n }\n if (mediaType === 'application/ld+json') {\n // Return JSON-LD if proper content type was returned\n return (await response.json());\n }\n else {\n // Check for alternate link for a non-JSON-LD response\n if (response.headers.has('Link')) {\n let alternateUrl;\n response.headers.forEach((value, key) => {\n if (key === 'link') {\n const linkHeader = (0, http_link_header_1.parse)(value);\n for (const link of linkHeader.get('type', 'application/ld+json')) {\n if (link.rel === 'alternate') {\n if (alternateUrl) {\n throw new Error('Multiple JSON-LD alternate links were found on ' + url);\n }\n alternateUrl = (0, relative_to_absolute_iri_1.resolve)(link.uri, url);\n }\n }\n }\n });\n if (alternateUrl) {\n return this.load(alternateUrl);\n }\n }\n throw new ErrorCoded_1.ErrorCoded(`Unsupported JSON-LD media type ${mediaType}`, ErrorCoded_1.ERROR_CODES.LOADING_DOCUMENT_FAILED);\n }\n }\n else {\n throw new Error(response.statusText || `Status code: ${response.status}`);\n }\n }\n}\nexports.FetchDocumentLoader = FetchDocumentLoader;\n//# sourceMappingURL=FetchDocumentLoader.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=IDocumentLoader.js.map","\"use strict\";\n// tslint:disable:max-line-length\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=JsonLdContext.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultExpandOptions = exports.JsonLdContextNormalized = void 0;\nconst relative_to_absolute_iri_1 = require(\"relative-to-absolute-iri\");\nconst ErrorCoded_1 = require(\"./ErrorCoded\");\nconst Util_1 = require(\"./Util\");\n/**\n * A class exposing operations over a normalized JSON-LD context.\n */\nclass JsonLdContextNormalized {\n constructor(contextRaw) {\n this.contextRaw = contextRaw;\n }\n /**\n * @return The raw inner context.\n */\n getContextRaw() {\n return this.contextRaw;\n }\n /**\n * Expand the term or prefix of the given term if it has one,\n * otherwise return the term as-is.\n *\n * This will try to expand the IRI as much as possible.\n *\n * Iff in vocab-mode, then other references to other terms in the context can be used,\n * such as to `myTerm`:\n * ```\n * {\n * \"myTerm\": \"http://example.org/myLongTerm\"\n * }\n * ```\n *\n * @param {string} term A term that is an URL or a prefixed URL.\n * @param {boolean} expandVocab If the term is a predicate or type and should be expanded based on @vocab,\n * otherwise it is considered a regular term that is expanded based on @base.\n * @param {IExpandOptions} options Options that define the way how expansion must be done.\n * @return {string} The expanded term, the term as-is, or null if it was explicitly disabled in the context.\n * @throws If the term is aliased to an invalid value (not a string, IRI or keyword).\n */\n expandTerm(term, expandVocab, options = exports.defaultExpandOptions) {\n const contextValue = this.contextRaw[term];\n // Immediately return if the term was disabled in the context\n if (contextValue === null || (contextValue && contextValue['@id'] === null)) {\n return null;\n }\n // Check the @id\n let validIriMapping = true;\n if (contextValue && expandVocab) {\n const value = Util_1.Util.getContextValueId(contextValue);\n if (value && value !== term) {\n if (typeof value !== 'string' || (!Util_1.Util.isValidIri(value) && !Util_1.Util.isValidKeyword(value))) {\n // Don't mark this mapping as invalid if we have an unknown keyword, but of the correct form.\n if (!Util_1.Util.isPotentialKeyword(value)) {\n validIriMapping = false;\n }\n }\n else {\n return value;\n }\n }\n }\n // Check if the term is prefixed\n const prefix = Util_1.Util.getPrefix(term, this.contextRaw);\n const vocab = this.contextRaw['@vocab'];\n const vocabRelative = (!!vocab || vocab === '') && vocab.indexOf(':') < 0;\n const base = this.contextRaw['@base'];\n const potentialKeyword = Util_1.Util.isPotentialKeyword(term);\n if (prefix) {\n const contextPrefixValue = this.contextRaw[prefix];\n const value = Util_1.Util.getContextValueId(contextPrefixValue);\n if (value) {\n if (typeof contextPrefixValue === 'string' || !options.allowPrefixForcing) {\n // If we have a simple term definition,\n // check the last character of the prefix to determine whether or not it is a prefix.\n // Validate that prefix ends with gen-delim character, unless @prefix is true\n if (!Util_1.Util.isSimpleTermDefinitionPrefix(value, options)) {\n // Treat the term as an absolute IRI\n return term;\n }\n }\n else {\n // If we have an expanded term definition, default to @prefix: false\n if (value[0] !== '_' && !potentialKeyword && !contextPrefixValue['@prefix'] && !(term in this.contextRaw)) {\n // Treat the term as an absolute IRI\n return term;\n }\n }\n return value + term.substr(prefix.length + 1);\n }\n }\n else if (expandVocab && ((vocab || vocab === '') || (options.allowVocabRelativeToBase && (base && vocabRelative)))\n && !potentialKeyword && !Util_1.Util.isCompactIri(term)) {\n if (vocabRelative) {\n if (options.allowVocabRelativeToBase) {\n return ((vocab || base) ? (0, relative_to_absolute_iri_1.resolve)(vocab, base) : '') + term;\n }\n else {\n throw new ErrorCoded_1.ErrorCoded(`Relative vocab expansion for term '${term}' with vocab '${vocab}' is not allowed.`, ErrorCoded_1.ERROR_CODES.INVALID_VOCAB_MAPPING);\n }\n }\n else {\n return vocab + term;\n }\n }\n else if (!expandVocab && base && !potentialKeyword && !Util_1.Util.isCompactIri(term)) {\n return (0, relative_to_absolute_iri_1.resolve)(term, base);\n }\n // Return the term as-is, unless we discovered an invalid IRI mapping for this term in the context earlier.\n if (validIriMapping) {\n return term;\n }\n else {\n throw new ErrorCoded_1.ErrorCoded(`Invalid IRI mapping found for context entry '${term}': '${JSON.stringify(contextValue)}'`, ErrorCoded_1.ERROR_CODES.INVALID_IRI_MAPPING);\n }\n }\n /**\n * Compact the given term using @base, @vocab, an aliased term, or a prefixed term.\n *\n * This will try to compact the IRI as much as possible.\n *\n * @param {string} iri An IRI to compact.\n * @param {boolean} vocab If the term is a predicate or type and should be compacted based on @vocab,\n * otherwise it is considered a regular term that is compacted based on @base.\n * @return {string} The compacted term or the IRI as-is.\n */\n compactIri(iri, vocab) {\n // Try @vocab compacting\n if (vocab && this.contextRaw['@vocab'] && iri.startsWith(this.contextRaw['@vocab'])) {\n return iri.substr(this.contextRaw['@vocab'].length);\n }\n // Try @base compacting\n if (!vocab && this.contextRaw['@base'] && iri.startsWith(this.contextRaw['@base'])) {\n return iri.substr(this.contextRaw['@base'].length);\n }\n // Loop over all terms in the context\n // This will try to prefix as short as possible.\n // Once a fully compacted alias is found, return immediately, as we can not go any shorter.\n const shortestPrefixing = { prefix: '', suffix: iri };\n for (const key in this.contextRaw) {\n const value = this.contextRaw[key];\n if (value && !Util_1.Util.isPotentialKeyword(key)) {\n const contextIri = Util_1.Util.getContextValueId(value);\n if (iri.startsWith(contextIri)) {\n const suffix = iri.substr(contextIri.length);\n if (!suffix) {\n if (vocab) {\n // Immediately return on compacted alias\n return key;\n }\n }\n else if (suffix.length < shortestPrefixing.suffix.length) {\n // Overwrite the shortest prefix\n shortestPrefixing.prefix = key;\n shortestPrefixing.suffix = suffix;\n }\n }\n }\n }\n // Return the shortest prefix\n if (shortestPrefixing.prefix) {\n return shortestPrefixing.prefix + ':' + shortestPrefixing.suffix;\n }\n return iri;\n }\n}\nexports.JsonLdContextNormalized = JsonLdContextNormalized;\nexports.defaultExpandOptions = {\n allowPrefixForcing: true,\n allowPrefixNonGenDelims: false,\n allowVocabRelativeToBase: true,\n};\n//# sourceMappingURL=JsonLdContextNormalized.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Util = void 0;\nclass Util {\n /**\n * Check if the given term is a valid compact IRI.\n * Otherwise, it may be an IRI.\n * @param {string} term A term.\n * @return {boolean} If it is a compact IRI.\n */\n static isCompactIri(term) {\n return term.indexOf(':') > 0 && !(term && term[0] === '#');\n }\n /**\n * Get the prefix from the given term.\n * @see https://json-ld.org/spec/latest/json-ld/#compact-iris\n * @param {string} term A term that is an URL or a prefixed URL.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n * @return {string} The prefix or null.\n */\n static getPrefix(term, context) {\n // Do not consider relative IRIs starting with a hash as compact IRIs\n if (term && term[0] === '#') {\n return null;\n }\n const separatorPos = term.indexOf(':');\n if (separatorPos >= 0) {\n // Suffix can not begin with two slashes\n if (term.length > separatorPos + 1\n && term.charAt(separatorPos + 1) === '/'\n && term.charAt(separatorPos + 2) === '/') {\n return null;\n }\n const prefix = term.substr(0, separatorPos);\n // Prefix can not be an underscore (this is a blank node)\n if (prefix === '_') {\n return null;\n }\n // Prefix must match a term in the active context\n if (context[prefix]) {\n return prefix;\n }\n }\n return null;\n }\n /**\n * From a given context entry value, get the string value, or the @id field.\n * @param contextValue A value for a term in a context.\n * @return {string} The id value, or null.\n */\n static getContextValueId(contextValue) {\n if (contextValue === null || typeof contextValue === 'string') {\n return contextValue;\n }\n const id = contextValue['@id'];\n return id ? id : null;\n }\n /**\n * Check if the given simple term definition (string-based value of a context term)\n * should be considered a prefix.\n * @param value A simple term definition value.\n * @param options Options that define the way how expansion must be done.\n */\n static isSimpleTermDefinitionPrefix(value, options) {\n return !Util.isPotentialKeyword(value)\n && (options.allowPrefixNonGenDelims || (typeof value === 'string' && (value[0] === '_' || Util.isPrefixIriEndingWithGenDelim(value))));\n }\n /**\n * Check if the given keyword is of the keyword format \"@\"1*ALPHA.\n * @param {string} keyword A potential keyword.\n * @return {boolean} If the given keyword is of the keyword format.\n */\n static isPotentialKeyword(keyword) {\n return typeof keyword === 'string' && Util.KEYWORD_REGEX.test(keyword);\n }\n /**\n * Check if the given prefix ends with a gen-delim character.\n * @param {string} prefixIri A prefix IRI.\n * @return {boolean} If the given prefix IRI is valid.\n */\n static isPrefixIriEndingWithGenDelim(prefixIri) {\n return Util.ENDS_WITH_GEN_DELIM.test(prefixIri);\n }\n /**\n * Check if the given context value can be a prefix value.\n * @param value A context value.\n * @return {boolean} If it can be a prefix value.\n */\n static isPrefixValue(value) {\n return value && (typeof value === 'string' || (value && typeof value === 'object'));\n }\n /**\n * Check if the given IRI is valid.\n * @param {string} iri A potential IRI.\n * @return {boolean} If the given IRI is valid.\n */\n static isValidIri(iri) {\n return Boolean(iri && Util.IRI_REGEX.test(iri));\n }\n /**\n * Check if the given IRI is valid, this includes the possibility of being a relative IRI.\n * @param {string} iri A potential IRI.\n * @return {boolean} If the given IRI is valid.\n */\n static isValidIriWeak(iri) {\n return !!iri && iri[0] !== ':' && Util.IRI_REGEX_WEAK.test(iri);\n }\n /**\n * Check if the given keyword is a defined according to the JSON-LD specification.\n * @param {string} keyword A potential keyword.\n * @return {boolean} If the given keyword is valid.\n */\n static isValidKeyword(keyword) {\n return Util.VALID_KEYWORDS[keyword];\n }\n /**\n * Check if the given term is protected in the context.\n * @param {IJsonLdContextNormalizedRaw} context A context.\n * @param {string} key A context term.\n * @return {boolean} If the given term has an @protected flag.\n */\n static isTermProtected(context, key) {\n const value = context[key];\n return !(typeof value === 'string') && value && value['@protected'];\n }\n /**\n * Check if the given context has at least one protected term.\n * @param context A context.\n * @return If the context has a protected term.\n */\n static hasProtectedTerms(context) {\n for (const key of Object.keys(context)) {\n if (Util.isTermProtected(context, key)) {\n return true;\n }\n }\n return false;\n }\n /**\n * Check if the given key is an internal reserved keyword.\n * @param key A context key.\n */\n static isReservedInternalKeyword(key) {\n return key.startsWith('@__');\n }\n /**\n * Check if two objects are deepEqual to on another.\n * @param object1 The first object to test.\n * @param object2 The second object to test.\n */\n static deepEqual(object1, object2) {\n const objKeys1 = Object.keys(object1);\n const objKeys2 = Object.keys(object2);\n if (objKeys1.length !== objKeys2.length)\n return false;\n return objKeys1.every((key) => {\n const value1 = object1[key];\n const value2 = object2[key];\n return (value1 === value2) || (value1 !== null &&\n value2 !== null &&\n typeof value1 === \"object\" &&\n typeof value2 === \"object\" &&\n this.deepEqual(value1, value2));\n });\n }\n ;\n}\n// Regex for valid IRIs\nUtil.IRI_REGEX = /^([A-Za-z][A-Za-z0-9+-.]*|_):[^ \"<>{}|\\\\\\[\\]`#]*(#[^#]*)?$/;\n// Weaker regex for valid IRIs, this includes relative IRIs\nUtil.IRI_REGEX_WEAK = /(?::[^:])|\\//;\n// Regex for keyword form\nUtil.KEYWORD_REGEX = /^@[a-z]+$/i;\n// Regex to see if an IRI ends with a gen-delim character (see RFC 3986)\nUtil.ENDS_WITH_GEN_DELIM = /[:/?#\\[\\]@]$/;\n// Regex for language tags\nUtil.REGEX_LANGUAGE_TAG = /^[a-zA-Z]+(-[a-zA-Z0-9]+)*$/;\n// Regex for base directions\nUtil.REGEX_DIRECTION_TAG = /^(ltr)|(rtl)$/;\n// All known valid JSON-LD keywords\n// @see https://www.w3.org/TR/json-ld11/#keywords\nUtil.VALID_KEYWORDS = {\n '@annotation': true,\n '@base': true,\n '@container': true,\n '@context': true,\n '@direction': true,\n '@graph': true,\n '@id': true,\n '@import': true,\n '@included': true,\n '@index': true,\n '@json': true,\n '@language': true,\n '@list': true,\n '@nest': true,\n '@none': true,\n '@prefix': true,\n '@propagate': true,\n '@protected': true,\n '@reverse': true,\n '@set': true,\n '@type': true,\n '@value': true,\n '@version': true,\n '@vocab': true,\n};\n// Keys in the contexts that will not be expanded based on the base IRI\nUtil.EXPAND_KEYS_BLACKLIST = [\n '@base',\n '@vocab',\n '@language',\n '@version',\n '@direction',\n];\n// Keys in the contexts that may not be aliased from\nUtil.ALIAS_DOMAIN_BLACKLIST = [\n '@container',\n '@graph',\n '@id',\n '@index',\n '@list',\n '@nest',\n '@none',\n '@prefix',\n '@reverse',\n '@set',\n '@type',\n '@value',\n '@version',\n];\n// Keys in the contexts that may not be aliased to\nUtil.ALIAS_RANGE_BLACKLIST = [\n '@context',\n '@preserve',\n];\n// All valid @container values\nUtil.CONTAINERS = [\n '@list',\n '@set',\n '@index',\n '@language',\n '@graph',\n '@id',\n '@type',\n];\n// All valid @container values under processing mode 1.0\nUtil.CONTAINERS_1_0 = [\n '@list',\n '@set',\n '@index',\n];\nexports.Util = Util;\n//# sourceMappingURL=Util.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lib/JsonLdParser\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContextTree = void 0;\n/**\n * A tree structure that holds all contexts,\n * based on their position in the JSON object.\n *\n * Positions are identified by a path of keys.\n */\nclass ContextTree {\n constructor() {\n this.subTrees = {};\n }\n getContext(keys) {\n if (keys.length > 0) {\n const [head, ...tail] = keys;\n const subTree = this.subTrees[head];\n if (subTree) {\n const subContext = subTree.getContext(tail);\n if (subContext) {\n return subContext.then(({ context, depth }) => ({ context, depth: depth + 1 }));\n }\n }\n }\n return this.context ? this.context.then((context) => ({ context, depth: 0 })) : null;\n }\n setContext(keys, context) {\n if (keys.length === 0) {\n this.context = context;\n }\n else {\n const [head, ...tail] = keys;\n let subTree = this.subTrees[head];\n if (!subTree) {\n subTree = this.subTrees[head] = new ContextTree();\n }\n subTree.setContext(tail, context);\n }\n }\n removeContext(path) {\n this.setContext(path, null);\n }\n}\nexports.ContextTree = ContextTree;\n//# sourceMappingURL=ContextTree.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.JsonLdParser = void 0;\n// tslint:disable-next-line:no-var-requires\nconst Parser = require('jsonparse');\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst stream_1 = require(\"stream\");\nconst EntryHandlerArrayValue_1 = require(\"./entryhandler/EntryHandlerArrayValue\");\nconst EntryHandlerContainer_1 = require(\"./entryhandler/EntryHandlerContainer\");\nconst EntryHandlerInvalidFallback_1 = require(\"./entryhandler/EntryHandlerInvalidFallback\");\nconst EntryHandlerPredicate_1 = require(\"./entryhandler/EntryHandlerPredicate\");\nconst EntryHandlerKeywordContext_1 = require(\"./entryhandler/keyword/EntryHandlerKeywordContext\");\nconst EntryHandlerKeywordGraph_1 = require(\"./entryhandler/keyword/EntryHandlerKeywordGraph\");\nconst EntryHandlerKeywordId_1 = require(\"./entryhandler/keyword/EntryHandlerKeywordId\");\nconst EntryHandlerKeywordIncluded_1 = require(\"./entryhandler/keyword/EntryHandlerKeywordIncluded\");\nconst EntryHandlerKeywordNest_1 = require(\"./entryhandler/keyword/EntryHandlerKeywordNest\");\nconst EntryHandlerKeywordType_1 = require(\"./entryhandler/keyword/EntryHandlerKeywordType\");\nconst EntryHandlerKeywordUnknownFallback_1 = require(\"./entryhandler/keyword/EntryHandlerKeywordUnknownFallback\");\nconst EntryHandlerKeywordValue_1 = require(\"./entryhandler/keyword/EntryHandlerKeywordValue\");\nconst ParsingContext_1 = require(\"./ParsingContext\");\nconst Util_1 = require(\"./Util\");\nconst http_link_header_1 = require(\"http-link-header\");\n/**\n * A stream transformer that parses JSON-LD (text) streams to an {@link RDF.Stream}.\n */\nclass JsonLdParser extends stream_1.Transform {\n constructor(options) {\n super({ readableObjectMode: true });\n options = options || {};\n this.options = options;\n this.parsingContext = new ParsingContext_1.ParsingContext(Object.assign({ parser: this }, options));\n this.util = new Util_1.Util({ dataFactory: options.dataFactory, parsingContext: this.parsingContext });\n this.jsonParser = new Parser();\n this.contextJobs = [];\n this.typeJobs = [];\n this.contextAwaitingJobs = [];\n this.lastDepth = 0;\n this.lastKeys = [];\n this.lastOnValueJob = Promise.resolve();\n this.attachJsonParserListeners();\n this.on('end', () => {\n if (typeof this.jsonParser.mode !== 'undefined') {\n this.emit('error', new Error('Unclosed document'));\n }\n });\n }\n /**\n * Construct a JsonLdParser from the given HTTP response.\n *\n * This will throw an error if no valid JSON response is received\n * (application/ld+json, application/json, or something+json).\n *\n * For raw JSON responses, exactly one link header pointing to a JSON-LD context is required.\n *\n * This method is not responsible for handling redirects.\n *\n * @param baseIRI The URI of the received response.\n * @param mediaType The received content type.\n * @param headers Optional HTTP headers.\n * @param options Optional parser options.\n */\n static fromHttpResponse(baseIRI, mediaType, headers, options) {\n let context;\n // Special cases when receiving something else than the JSON-LD media type\n if (mediaType !== 'application/ld+json') {\n // Only accept JSON or JSON extension types\n if (mediaType !== 'application/json' && !mediaType.endsWith('+json')) {\n throw new jsonld_context_parser_1.ErrorCoded(`Unsupported JSON-LD media type ${mediaType}`, jsonld_context_parser_1.ERROR_CODES.LOADING_DOCUMENT_FAILED);\n }\n // We need exactly one JSON-LD context in the link header\n if (headers && headers.has('Link')) {\n headers.forEach((value, key) => {\n if (key === 'link') {\n const linkHeader = http_link_header_1.parse(value);\n for (const link of linkHeader.get('rel', 'http://www.w3.org/ns/json-ld#context')) {\n if (context) {\n throw new jsonld_context_parser_1.ErrorCoded('Multiple JSON-LD context link headers were found on ' + baseIRI, jsonld_context_parser_1.ERROR_CODES.MULTIPLE_CONTEXT_LINK_HEADERS);\n }\n context = link.uri;\n }\n }\n });\n }\n if (!context && !(options === null || options === void 0 ? void 0 : options.ignoreMissingContextLinkHeader)) {\n throw new jsonld_context_parser_1.ErrorCoded(`Missing context link header for media type ${mediaType} on ${baseIRI}`, jsonld_context_parser_1.ERROR_CODES.LOADING_DOCUMENT_FAILED);\n }\n }\n // Check if the streaming profile is present\n let streamingProfile;\n if (headers && headers.has('Content-Type')) {\n const contentType = headers.get('Content-Type');\n const match = /; *profile=([^\"]*)/.exec(contentType);\n if (match && match[1] === 'http://www.w3.org/ns/json-ld#streaming') {\n streamingProfile = true;\n }\n }\n return new JsonLdParser(Object.assign({ baseIRI,\n context,\n streamingProfile }, options ? options : {}));\n }\n /**\n * Parses the given text stream into a quad stream.\n * @param {NodeJS.EventEmitter} stream A text stream.\n * @return {RDF.Stream} A quad stream.\n */\n import(stream) {\n const output = new stream_1.PassThrough({ readableObjectMode: true });\n stream.on('error', (error) => parsed.emit('error', error));\n stream.on('data', (data) => output.push(data));\n stream.on('end', () => output.push(null));\n const parsed = output.pipe(new JsonLdParser(this.options));\n return parsed;\n }\n _transform(chunk, encoding, callback) {\n this.jsonParser.write(chunk);\n this.lastOnValueJob\n .then(() => callback(), (error) => callback(error));\n }\n /**\n * Start a new job for parsing the given value.\n *\n * This will let the first valid {@link IEntryHandler} handle the entry.\n *\n * @param {any[]} keys The stack of keys.\n * @param value The value to parse.\n * @param {number} depth The depth to parse at.\n * @param {boolean} lastDepthCheck If the lastDepth check should be done for buffer draining.\n * @return {Promise} A promise resolving when the job is done.\n */\n async newOnValueJob(keys, value, depth, lastDepthCheck) {\n let flushStacks = true;\n // When we go up the stack, emit all unidentified values\n // We need to do this before the new job, because the new job may require determined values from the flushed jobs.\n if (lastDepthCheck && depth < this.lastDepth) {\n // Check if we had any RDF lists that need to be terminated with an rdf:nil\n const listPointer = this.parsingContext.listPointerStack[this.lastDepth];\n if (listPointer) {\n // Terminate the list if the had at least one value\n if (listPointer.value) {\n this.emit('data', this.util.dataFactory.quad(listPointer.value, this.util.rdfRest, this.util.rdfNil, this.util.getDefaultGraph()));\n }\n // Add the list id to the id stack, so it can be used higher up in the stack\n listPointer.listId.listHead = true;\n this.parsingContext.idStack[listPointer.listRootDepth + 1] = [listPointer.listId];\n this.parsingContext.listPointerStack.splice(this.lastDepth, 1);\n }\n // Flush the buffer for lastDepth\n // If the parent key is a special type of container, postpone flushing until that parent is handled.\n if (await EntryHandlerContainer_1.EntryHandlerContainer.isBufferableContainerHandler(this.parsingContext, this.lastKeys, this.lastDepth)) {\n this.parsingContext.pendingContainerFlushBuffers\n .push({ depth: this.lastDepth, keys: this.lastKeys.slice(0, this.lastKeys.length) });\n flushStacks = false;\n }\n else {\n await this.flushBuffer(this.lastDepth, this.lastKeys);\n }\n }\n const key = await this.util.unaliasKeyword(keys[depth], keys, depth);\n const parentKey = await this.util.unaliasKeywordParent(keys, depth);\n this.parsingContext.emittedStack[depth] = true;\n let handleKey = true;\n // Keywords inside @reverse is not allowed apart from @context\n if (jsonld_context_parser_1.Util.isValidKeyword(key) && parentKey === '@reverse' && key !== '@context') {\n this.emit('error', new jsonld_context_parser_1.ErrorCoded(`Found the @id '${value}' inside an @reverse property`, jsonld_context_parser_1.ERROR_CODES.INVALID_REVERSE_PROPERTY_MAP));\n }\n // Skip further processing if one of the parent nodes are invalid.\n // We use the validationStack to reuse validation results that were produced before with common key stacks.\n let inProperty = false;\n if (this.parsingContext.validationStack.length > 1) {\n inProperty = this.parsingContext.validationStack[this.parsingContext.validationStack.length - 1].property;\n }\n for (let i = Math.max(1, this.parsingContext.validationStack.length - 1); i < keys.length - 1; i++) {\n const validationResult = this.parsingContext.validationStack[i]\n || (this.parsingContext.validationStack[i] = await this.validateKey(keys.slice(0, i + 1), i, inProperty));\n if (!validationResult.valid) {\n this.parsingContext.emittedStack[depth] = false;\n handleKey = false;\n break;\n }\n else if (!inProperty && validationResult.property) {\n inProperty = true;\n }\n }\n // Skip further processing if this node is part of a literal\n if (this.util.isLiteral(depth)) {\n handleKey = false;\n }\n // Get handler\n if (handleKey) {\n for (const entryHandler of JsonLdParser.ENTRY_HANDLERS) {\n const testResult = await entryHandler.test(this.parsingContext, this.util, key, keys, depth);\n if (testResult) {\n // Pass processing over to the handler\n await entryHandler.handle(this.parsingContext, this.util, key, keys, value, depth, testResult);\n // Flag that this depth is processed\n if (entryHandler.isStackProcessor()) {\n this.parsingContext.processingStack[depth] = true;\n }\n break;\n }\n }\n }\n // Validate value indexes on the root.\n if (depth === 0 && Array.isArray(value)) {\n await this.util.validateValueIndexes(value);\n }\n // When we go up the stack, flush the old stack\n if (flushStacks && depth < this.lastDepth) {\n // Reset our stacks\n this.flushStacks(this.lastDepth);\n }\n this.lastDepth = depth;\n this.lastKeys = keys;\n // Clear the keyword cache at this depth, and everything underneath.\n this.parsingContext.unaliasedKeywordCacheStack.splice(depth - 1);\n }\n /**\n * Flush the processing stacks at the given depth.\n * @param {number} depth A depth.\n */\n flushStacks(depth) {\n this.parsingContext.processingStack.splice(depth, 1);\n this.parsingContext.processingType.splice(depth, 1);\n this.parsingContext.emittedStack.splice(depth, 1);\n this.parsingContext.idStack.splice(depth, 1);\n this.parsingContext.graphStack.splice(depth + 1, 1);\n this.parsingContext.graphContainerTermStack.splice(depth, 1);\n this.parsingContext.jsonLiteralStack.splice(depth, 1);\n this.parsingContext.validationStack.splice(depth - 1, 2);\n this.parsingContext.literalStack.splice(depth, this.parsingContext.literalStack.length - depth);\n // TODO: just like the literal stack, splice all other stack until the end as well?\n }\n /**\n * Flush buffers for the given depth.\n *\n * This should be called after the last entry at a given depth was processed.\n *\n * @param {number} depth A depth.\n * @param {any[]} keys A stack of keys.\n * @return {Promise} A promise resolving if flushing is done.\n */\n async flushBuffer(depth, keys) {\n let subjects = this.parsingContext.idStack[depth];\n if (!subjects) {\n subjects = this.parsingContext.idStack[depth] = [this.util.dataFactory.blankNode()];\n }\n // Flush values at this level\n const valueBuffer = this.parsingContext.unidentifiedValuesBuffer[depth];\n if (valueBuffer) {\n for (const subject of subjects) {\n const depthOffsetGraph = await this.util.getDepthOffsetGraph(depth, keys);\n const graphs = (this.parsingContext.graphStack[depth] || depthOffsetGraph >= 0)\n ? this.parsingContext.idStack[depth - depthOffsetGraph - 1]\n : [await this.util.getGraphContainerValue(keys, depth)];\n if (graphs) {\n for (const graph of graphs) {\n // Flush values to stream if the graph @id is known\n this.parsingContext.emittedStack[depth] = true;\n for (const bufferedValue of valueBuffer) {\n if (bufferedValue.reverse) {\n this.parsingContext.emitQuad(depth, this.util.dataFactory.quad(bufferedValue.object, bufferedValue.predicate, subject, graph));\n }\n else {\n this.parsingContext.emitQuad(depth, this.util.dataFactory.quad(subject, bufferedValue.predicate, bufferedValue.object, graph));\n }\n }\n }\n }\n else {\n // Place the values in the graphs buffer if the graph @id is not yet known\n const subGraphBuffer = this.parsingContext.getUnidentifiedGraphBufferSafe(depth - await this.util.getDepthOffsetGraph(depth, keys) - 1);\n for (const bufferedValue of valueBuffer) {\n if (bufferedValue.reverse) {\n subGraphBuffer.push({\n object: subject,\n predicate: bufferedValue.predicate,\n subject: bufferedValue.object,\n });\n }\n else {\n subGraphBuffer.push({\n object: bufferedValue.object,\n predicate: bufferedValue.predicate,\n subject,\n });\n }\n }\n }\n }\n this.parsingContext.unidentifiedValuesBuffer.splice(depth, 1);\n this.parsingContext.literalStack.splice(depth, 1);\n this.parsingContext.jsonLiteralStack.splice(depth, 1);\n }\n // Flush graphs at this level\n const graphBuffer = this.parsingContext.unidentifiedGraphsBuffer[depth];\n if (graphBuffer) {\n for (const subject of subjects) {\n // A @graph statement at the root without @id relates to the default graph,\n // unless there are top-level properties,\n // others relate to blank nodes.\n const graph = depth === 1 && subject.termType === 'BlankNode'\n && !this.parsingContext.topLevelProperties ? this.util.getDefaultGraph() : subject;\n this.parsingContext.emittedStack[depth] = true;\n for (const bufferedValue of graphBuffer) {\n this.parsingContext.emitQuad(depth, this.util.dataFactory.quad(bufferedValue.subject, bufferedValue.predicate, bufferedValue.object, graph));\n }\n }\n this.parsingContext.unidentifiedGraphsBuffer.splice(depth, 1);\n }\n }\n /**\n * Check if at least one {@link IEntryHandler} validates the entry to true.\n * @param {any[]} keys A stack of keys.\n * @param {number} depth A depth.\n * @param {boolean} inProperty If the current depth is part of a valid property node.\n * @return {Promise<{ valid: boolean, property: boolean }>} A promise resolving to true or false.\n */\n async validateKey(keys, depth, inProperty) {\n for (const entryHandler of JsonLdParser.ENTRY_HANDLERS) {\n if (await entryHandler.validate(this.parsingContext, this.util, keys, depth, inProperty)) {\n return { valid: true, property: inProperty || entryHandler.isPropertyHandler() };\n }\n }\n return { valid: false, property: false };\n }\n /**\n * Attach all required listeners to the JSON parser.\n *\n * This should only be called once.\n */\n attachJsonParserListeners() {\n // Listen to json parser events\n this.jsonParser.onValue = (value) => {\n const depth = this.jsonParser.stack.length;\n const keys = (new Array(depth + 1).fill(0)).map((v, i) => {\n return i === depth ? this.jsonParser.key : this.jsonParser.stack[i].key;\n });\n if (!this.isParsingContextInner(depth)) { // Don't parse inner nodes inside @context\n const valueJobCb = () => this.newOnValueJob(keys, value, depth, true);\n if (!this.parsingContext.streamingProfile\n && !this.parsingContext.contextTree.getContext(keys.slice(0, -1))) {\n // If an out-of-order context is allowed,\n // we have to buffer everything.\n // We store jobs for @context's and @type's separately,\n // because at the end, we have to process them first.\n // We also handle @type because these *could* introduce a type-scoped context.\n if (keys[depth] === '@context') {\n let jobs = this.contextJobs[depth];\n if (!jobs) {\n jobs = this.contextJobs[depth] = [];\n }\n jobs.push(valueJobCb);\n }\n else if (keys[depth] === '@type'\n || typeof keys[depth] === 'number' && keys[depth - 1] === '@type') { // Also capture @type with array values\n // Remove @type from keys, because we want it to apply to parent later on\n this.typeJobs.push({ job: valueJobCb, keys: keys.slice(0, keys.length - 1) });\n }\n else {\n this.contextAwaitingJobs.push({ job: valueJobCb, keys });\n }\n }\n else {\n // Make sure that our value jobs are chained synchronously\n this.lastOnValueJob = this.lastOnValueJob.then(valueJobCb);\n }\n // Execute all buffered jobs on deeper levels\n if (!this.parsingContext.streamingProfile && depth === 0) {\n this.lastOnValueJob = this.lastOnValueJob\n .then(() => this.executeBufferedJobs());\n }\n }\n };\n this.jsonParser.onError = (error) => {\n this.emit('error', error);\n };\n }\n /**\n * Check if the parser is currently parsing an element that is part of an @context entry.\n * @param {number} depth A depth.\n * @return {boolean} A boolean.\n */\n isParsingContextInner(depth) {\n for (let i = depth; i > 0; i--) {\n if (this.jsonParser.stack[i - 1].key === '@context') {\n return true;\n }\n }\n return false;\n }\n /**\n * Execute all buffered jobs.\n * @return {Promise} A promise resolving if all jobs are finished.\n */\n async executeBufferedJobs() {\n // Handle context jobs\n for (const jobs of this.contextJobs) {\n if (jobs) {\n for (const job of jobs) {\n await job();\n }\n }\n }\n // Clear the keyword cache.\n this.parsingContext.unaliasedKeywordCacheStack.splice(0);\n // Handle non-context jobs\n for (const job of this.contextAwaitingJobs) {\n // Check if we have a type (with possible type-scoped context) that should be handled before.\n // We check all possible parent nodes for the current job, from root to leaves.\n if (this.typeJobs.length > 0) {\n // First collect all applicable type jobs\n const applicableTypeJobs = [];\n const applicableTypeJobIds = [];\n for (let i = 0; i < this.typeJobs.length; i++) {\n const typeJob = this.typeJobs[i];\n if (Util_1.Util.isPrefixArray(typeJob.keys, job.keys)) {\n applicableTypeJobs.push(typeJob);\n applicableTypeJobIds.push(i);\n }\n }\n // Next, sort the jobs from short to long key length (to ensure types higher up in the tree to be handled first)\n const sortedTypeJobs = applicableTypeJobs.sort((job1, job2) => job1.keys.length - job2.keys.length);\n // Finally, execute the jobs in order\n for (const typeJob of sortedTypeJobs) {\n await typeJob.job();\n }\n // Remove the executed type jobs\n // Sort first, so we can efficiently splice\n const sortedApplicableTypeJobIds = applicableTypeJobIds.sort().reverse();\n for (const jobId of sortedApplicableTypeJobIds) {\n this.typeJobs.splice(jobId, 1);\n }\n }\n await job.job();\n }\n }\n}\nexports.JsonLdParser = JsonLdParser;\nJsonLdParser.DEFAULT_PROCESSING_MODE = '1.1';\nJsonLdParser.ENTRY_HANDLERS = [\n new EntryHandlerArrayValue_1.EntryHandlerArrayValue(),\n new EntryHandlerKeywordContext_1.EntryHandlerKeywordContext(),\n new EntryHandlerKeywordId_1.EntryHandlerKeywordId(),\n new EntryHandlerKeywordIncluded_1.EntryHandlerKeywordIncluded(),\n new EntryHandlerKeywordGraph_1.EntryHandlerKeywordGraph(),\n new EntryHandlerKeywordNest_1.EntryHandlerKeywordNest(),\n new EntryHandlerKeywordType_1.EntryHandlerKeywordType(),\n new EntryHandlerKeywordValue_1.EntryHandlerKeywordValue(),\n new EntryHandlerContainer_1.EntryHandlerContainer(),\n new EntryHandlerKeywordUnknownFallback_1.EntryHandlerKeywordUnknownFallback(),\n new EntryHandlerPredicate_1.EntryHandlerPredicate(),\n new EntryHandlerInvalidFallback_1.EntryHandlerInvalidFallback(),\n];\n//# sourceMappingURL=JsonLdParser.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ParsingContext = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst ErrorCoded_1 = require(\"jsonld-context-parser/lib/ErrorCoded\");\nconst ContextTree_1 = require(\"./ContextTree\");\nconst JsonLdParser_1 = require(\"./JsonLdParser\");\n/**\n * Data holder for parsing information.\n */\nclass ParsingContext {\n constructor(options) {\n // Initialize settings\n this.contextParser = new jsonld_context_parser_1.ContextParser({ documentLoader: options.documentLoader, skipValidation: options.skipContextValidation });\n this.streamingProfile = !!options.streamingProfile;\n this.baseIRI = options.baseIRI;\n this.produceGeneralizedRdf = !!options.produceGeneralizedRdf;\n this.allowSubjectList = !!options.allowSubjectList;\n this.processingMode = options.processingMode || JsonLdParser_1.JsonLdParser.DEFAULT_PROCESSING_MODE;\n this.strictValues = !!options.strictValues;\n this.validateValueIndexes = !!options.validateValueIndexes;\n this.defaultGraph = options.defaultGraph;\n this.rdfDirection = options.rdfDirection;\n this.normalizeLanguageTags = options.normalizeLanguageTags;\n this.streamingProfileAllowOutOfOrderPlainType = options.streamingProfileAllowOutOfOrderPlainType;\n this.topLevelProperties = false;\n this.activeProcessingMode = parseFloat(this.processingMode);\n // Initialize stacks\n this.processingStack = [];\n this.processingType = [];\n this.emittedStack = [];\n this.idStack = [];\n this.graphStack = [];\n this.graphContainerTermStack = [];\n this.listPointerStack = [];\n this.contextTree = new ContextTree_1.ContextTree();\n this.literalStack = [];\n this.validationStack = [];\n this.unaliasedKeywordCacheStack = [];\n this.jsonLiteralStack = [];\n this.unidentifiedValuesBuffer = [];\n this.unidentifiedGraphsBuffer = [];\n this.pendingContainerFlushBuffers = [];\n this.parser = options.parser;\n if (options.context) {\n this.rootContext = this.parseContext(options.context);\n this.rootContext.then((context) => this.validateContext(context));\n }\n else {\n this.rootContext = Promise.resolve(new jsonld_context_parser_1.JsonLdContextNormalized(this.baseIRI ? { '@base': this.baseIRI, '@__baseDocument': true } : {}));\n }\n }\n /**\n * Parse the given context with the configured options.\n * @param {JsonLdContext} context A context to parse.\n * @param {JsonLdContextNormalized} parentContext An optional parent context.\n * @param {boolean} ignoreProtection If @protected term checks should be ignored.\n * @return {Promise} A promise resolving to the parsed context.\n */\n async parseContext(context, parentContext, ignoreProtection) {\n return this.contextParser.parse(context, {\n baseIRI: this.baseIRI,\n ignoreProtection,\n normalizeLanguageTags: this.normalizeLanguageTags,\n parentContext,\n processingMode: this.activeProcessingMode,\n });\n }\n /**\n * Check if the given context is valid.\n * If not, an error will be thrown.\n * @param {JsonLdContextNormalized} context A context.\n */\n validateContext(context) {\n const activeVersion = context.getContextRaw()['@version'];\n if (activeVersion) {\n if (this.activeProcessingMode && activeVersion > this.activeProcessingMode) {\n throw new ErrorCoded_1.ErrorCoded(`Unsupported JSON-LD version '${activeVersion}' under active processing mode ${this.activeProcessingMode}.`, ErrorCoded_1.ERROR_CODES.PROCESSING_MODE_CONFLICT);\n }\n else {\n if (this.activeProcessingMode && activeVersion < this.activeProcessingMode) {\n throw new ErrorCoded_1.ErrorCoded(`Invalid JSON-LD version ${activeVersion} under active processing mode ${this.activeProcessingMode}.`, ErrorCoded_1.ERROR_CODES.INVALID_VERSION_VALUE);\n }\n this.activeProcessingMode = activeVersion;\n }\n }\n }\n /**\n * Get the context at the given path.\n * @param {keys} keys The path of keys to get the context at.\n * @param {number} offset The path offset, defaults to 1.\n * @return {Promise} A promise resolving to a context.\n */\n async getContext(keys, offset = 1) {\n const keysOriginal = keys;\n // Ignore array keys at the end\n while (typeof keys[keys.length - 1] === 'number') {\n keys = keys.slice(0, keys.length - 1);\n }\n // Handle offset on keys\n if (offset) {\n keys = keys.slice(0, -offset);\n }\n // Determine the closest context\n const contextData = await this.getContextPropagationAware(keys);\n const context = contextData.context;\n // Process property-scoped contexts (high-to-low)\n let contextRaw = context.getContextRaw();\n for (let i = contextData.depth; i < keysOriginal.length - offset; i++) {\n const key = keysOriginal[i];\n const contextKeyEntry = contextRaw[key];\n if (contextKeyEntry && typeof contextKeyEntry === 'object' && '@context' in contextKeyEntry) {\n const scopedContext = (await this.parseContext(contextKeyEntry, contextRaw, true)).getContextRaw();\n const propagate = !(key in scopedContext)\n || scopedContext[key]['@context']['@propagate']; // Propagation is true by default\n if (propagate !== false || i === keysOriginal.length - 1 - offset) {\n contextRaw = scopedContext;\n // Clean up final context\n delete contextRaw['@propagate'];\n contextRaw[key] = Object.assign({}, contextRaw[key]);\n if ('@id' in contextKeyEntry) {\n contextRaw[key]['@id'] = contextKeyEntry['@id'];\n }\n delete contextRaw[key]['@context'];\n if (propagate !== false) {\n this.contextTree.setContext(keysOriginal.slice(0, i + offset), Promise.resolve(new jsonld_context_parser_1.JsonLdContextNormalized(contextRaw)));\n }\n }\n }\n }\n return new jsonld_context_parser_1.JsonLdContextNormalized(contextRaw);\n }\n /**\n * Get the context at the given path.\n * Non-propagating contexts will be skipped,\n * unless the context at that exact depth is retrieved.\n *\n * This ONLY takes into account context propagation logic,\n * so this should usually not be called directly,\n * call {@link #getContext} instead.\n *\n * @param keys The path of keys to get the context at.\n * @return {Promise<{ context: JsonLdContextNormalized, depth: number }>} A context and its depth.\n */\n async getContextPropagationAware(keys) {\n const originalDepth = keys.length;\n let contextData = null;\n let hasApplicablePropertyScopedContext;\n do {\n hasApplicablePropertyScopedContext = false;\n if (contextData && '@__propagateFallback' in contextData.context.getContextRaw()) {\n // If a propagation fallback context has been set,\n // fallback to that context and retry for the same depth.\n contextData.context = new jsonld_context_parser_1.JsonLdContextNormalized(contextData.context.getContextRaw()['@__propagateFallback']);\n }\n else {\n if (contextData) {\n // If we had a previous iteration, jump to the parent of context depth.\n // We must do this because once we get here, last context had propagation disabled,\n // so we check its first parent instead.\n keys = keys.slice(0, contextData.depth - 1);\n }\n contextData = await this.contextTree.getContext(keys) || { context: await this.rootContext, depth: 0 };\n }\n // Allow non-propagating contexts to propagate one level deeper\n // if it defines a property-scoped context that is applicable for the current key.\n // @see https://w3c.github.io/json-ld-api/tests/toRdf-manifest#tc012\n const lastKey = keys[keys.length - 1];\n if (lastKey in contextData.context.getContextRaw()) {\n const lastKeyValue = contextData.context.getContextRaw()[lastKey];\n if (lastKeyValue && typeof lastKeyValue === 'object' && '@context' in lastKeyValue) {\n hasApplicablePropertyScopedContext = true;\n }\n }\n } while (contextData.depth > 0 // Root context has a special case\n && contextData.context.getContextRaw()['@propagate'] === false // Stop loop if propagation is true\n && contextData.depth !== originalDepth // Stop loop if requesting exact depth of non-propagating\n && !hasApplicablePropertyScopedContext);\n // Special case for root context that does not allow propagation.\n // Fallback to empty context in that case.\n if (contextData.depth === 0\n && contextData.context.getContextRaw()['@propagate'] === false\n && contextData.depth !== originalDepth) {\n contextData.context = new jsonld_context_parser_1.JsonLdContextNormalized({});\n }\n return contextData;\n }\n /**\n * Start a new job for parsing the given value.\n * @param {any[]} keys The stack of keys.\n * @param value The value to parse.\n * @param {number} depth The depth to parse at.\n * @param {boolean} lastDepthCheck If the lastDepth check should be done for buffer draining.\n * @return {Promise} A promise resolving when the job is done.\n */\n async newOnValueJob(keys, value, depth, lastDepthCheck) {\n await this.parser.newOnValueJob(keys, value, depth, lastDepthCheck);\n }\n /**\n * Flush the pending container flush buffers\n * @return {boolean} If any pending buffers were flushed.\n */\n async handlePendingContainerFlushBuffers() {\n if (this.pendingContainerFlushBuffers.length > 0) {\n for (const pendingFlushBuffer of this.pendingContainerFlushBuffers) {\n await this.parser.flushBuffer(pendingFlushBuffer.depth, pendingFlushBuffer.keys);\n this.parser.flushStacks(pendingFlushBuffer.depth);\n }\n this.pendingContainerFlushBuffers.splice(0, this.pendingContainerFlushBuffers.length);\n return true;\n }\n else {\n return false;\n }\n }\n /**\n * Emit the given quad into the output stream.\n * @param {number} depth The depth the quad was generated at.\n * @param {Quad} quad A quad to emit.\n */\n emitQuad(depth, quad) {\n if (depth === 1) {\n this.topLevelProperties = true;\n }\n this.parser.push(quad);\n }\n /**\n * Emit the given error into the output stream.\n * @param {Error} error An error to emit.\n */\n emitError(error) {\n this.parser.emit('error', error);\n }\n /**\n * Emit the given context into the output stream under the 'context' event.\n * @param {JsonLdContext} context A context to emit.\n */\n emitContext(context) {\n this.parser.emit('context', context);\n }\n /**\n * Safely get or create the depth value of {@link ParsingContext.unidentifiedValuesBuffer}.\n * @param {number} depth A depth.\n * @return {{predicate: Term; object: Term; reverse: boolean}[]} An element of\n * {@link ParsingContext.unidentifiedValuesBuffer}.\n */\n getUnidentifiedValueBufferSafe(depth) {\n let buffer = this.unidentifiedValuesBuffer[depth];\n if (!buffer) {\n buffer = [];\n this.unidentifiedValuesBuffer[depth] = buffer;\n }\n return buffer;\n }\n /**\n * Safely get or create the depth value of {@link ParsingContext.unidentifiedGraphsBuffer}.\n * @param {number} depth A depth.\n * @return {{predicate: Term; object: Term; reverse: boolean}[]} An element of\n * {@link ParsingContext.unidentifiedGraphsBuffer}.\n */\n getUnidentifiedGraphBufferSafe(depth) {\n let buffer = this.unidentifiedGraphsBuffer[depth];\n if (!buffer) {\n buffer = [];\n this.unidentifiedGraphsBuffer[depth] = buffer;\n }\n return buffer;\n }\n /**\n * @return IExpandOptions The expand options for the active processing mode.\n */\n getExpandOptions() {\n return ParsingContext.EXPAND_OPTIONS[this.activeProcessingMode];\n }\n /**\n * Shift the stack at the given offset to the given depth.\n *\n * This will override anything in the stack at `depth`,\n * and this will remove anything at `depth + depthOffset`\n *\n * @param depth The target depth.\n * @param depthOffset The origin depth, relative to `depth`.\n */\n shiftStack(depth, depthOffset) {\n // Copy the id stack value up one level so that the next job can access the id.\n const deeperIdStack = this.idStack[depth + depthOffset];\n if (deeperIdStack) {\n this.idStack[depth] = deeperIdStack;\n this.emittedStack[depth] = true;\n delete this.idStack[depth + depthOffset];\n }\n // Shorten key stack\n if (this.pendingContainerFlushBuffers.length) {\n for (const buffer of this.pendingContainerFlushBuffers) {\n if (buffer.depth >= depth + depthOffset) {\n buffer.depth -= depthOffset;\n buffer.keys.splice(depth, depthOffset);\n }\n }\n }\n // Splice stacks\n if (this.unidentifiedValuesBuffer[depth + depthOffset]) {\n this.unidentifiedValuesBuffer[depth] = this.unidentifiedValuesBuffer[depth + depthOffset];\n delete this.unidentifiedValuesBuffer[depth + depthOffset];\n }\n // TODO: also do the same for other stacks\n }\n}\nexports.ParsingContext = ParsingContext;\nParsingContext.EXPAND_OPTIONS = {\n 1.0: {\n allowPrefixForcing: false,\n allowPrefixNonGenDelims: false,\n allowVocabRelativeToBase: false,\n },\n 1.1: {\n allowPrefixForcing: true,\n allowPrefixNonGenDelims: false,\n allowVocabRelativeToBase: true,\n },\n};\n//# sourceMappingURL=ParsingContext.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Util = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst rdf_data_factory_1 = require(\"rdf-data-factory\");\nconst EntryHandlerContainer_1 = require(\"./entryhandler/EntryHandlerContainer\");\n// tslint:disable-next-line:no-var-requires\nconst canonicalizeJson = require('canonicalize');\n/**\n * Utility functions and methods.\n */\nclass Util {\n constructor(options) {\n this.parsingContext = options.parsingContext;\n this.dataFactory = options.dataFactory || new rdf_data_factory_1.DataFactory();\n this.rdfFirst = this.dataFactory.namedNode(Util.RDF + 'first');\n this.rdfRest = this.dataFactory.namedNode(Util.RDF + 'rest');\n this.rdfNil = this.dataFactory.namedNode(Util.RDF + 'nil');\n this.rdfType = this.dataFactory.namedNode(Util.RDF + 'type');\n this.rdfJson = this.dataFactory.namedNode(Util.RDF + 'JSON');\n }\n /**\n * Helper function to get the value of a context entry,\n * or fallback to a certain value.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} contextKey A pre-defined JSON-LD key in context entries.\n * @param {string} key A context entry key.\n * @param {string} fallback A fallback value for when the given contextKey\n * could not be found in the value with the given key.\n * @return {string} The value of the given contextKey in the entry behind key in the given context,\n * or the given fallback value.\n */\n static getContextValue(context, contextKey, key, fallback) {\n const entry = context.getContextRaw()[key];\n if (!entry) {\n return fallback;\n }\n const type = entry[contextKey];\n return type === undefined ? fallback : type;\n }\n /**\n * Get the container type of the given key in the context.\n *\n * Should any context-scoping bugs should occur related to this in the future,\n * it may be required to increase the offset from the depth at which the context is retrieved by one (to 2).\n * This is because containers act 2 levels deep.\n *\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key A context entry key.\n * @return {string} The container type.\n */\n static getContextValueContainer(context, key) {\n return Util.getContextValue(context, '@container', key, { '@set': true });\n }\n /**\n * Get the value type of the given key in the context.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key A context entry key.\n * @return {string} The node type.\n */\n static getContextValueType(context, key) {\n const valueType = Util.getContextValue(context, '@type', key, null);\n if (valueType === '@none') {\n return null;\n }\n return valueType;\n }\n /**\n * Get the language of the given key in the context.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key A context entry key.\n * @return {string} The node type.\n */\n static getContextValueLanguage(context, key) {\n return Util.getContextValue(context, '@language', key, context.getContextRaw()['@language'] || null);\n }\n /**\n * Get the direction of the given key in the context.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key A context entry key.\n * @return {string} The node type.\n */\n static getContextValueDirection(context, key) {\n return Util.getContextValue(context, '@direction', key, context.getContextRaw()['@direction'] || null);\n }\n /**\n * Check if the given key in the context is a reversed property.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key A context entry key.\n * @return {boolean} If the context value has a @reverse key.\n */\n static isContextValueReverse(context, key) {\n return !!Util.getContextValue(context, '@reverse', key, null);\n }\n /**\n * Get the @index of the given key in the context.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key A context entry key.\n * @return {string} The index.\n */\n static getContextValueIndex(context, key) {\n return Util.getContextValue(context, '@index', key, context.getContextRaw()['@index'] || null);\n }\n /**\n * Check if the given key refers to a reversed property.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key The property key.\n * @param {string} parentKey The parent key.\n * @return {boolean} If the property must be reversed.\n */\n static isPropertyReverse(context, key, parentKey) {\n // '!==' is needed because reversed properties in a @reverse container should cancel each other out.\n return parentKey === '@reverse' !== Util.isContextValueReverse(context, key);\n }\n /**\n * Check if the given IRI is valid.\n * @param {string} iri A potential IRI.\n * @return {boolean} If the given IRI is valid.\n */\n static isValidIri(iri) {\n return iri !== null && jsonld_context_parser_1.Util.isValidIri(iri);\n }\n /**\n * Check if the given first array (needle) is a prefix of the given second array (haystack).\n * @param needle An array to check if it is a prefix.\n * @param haystack An array to look in.\n */\n static isPrefixArray(needle, haystack) {\n if (needle.length > haystack.length) {\n return false;\n }\n for (let i = 0; i < needle.length; i++) {\n if (needle[i] !== haystack[i]) {\n return false;\n }\n }\n return true;\n }\n /**\n * Make sure that @id-@index pairs are equal over all array values.\n * Reject otherwise.\n * @param {any[]} value An array value.\n * @return {Promise} A promise rejecting if conflicts are present.\n */\n async validateValueIndexes(value) {\n if (this.parsingContext.validateValueIndexes) {\n const indexHashes = {};\n for (const entry of value) {\n if (entry && typeof entry === 'object') {\n const id = entry['@id'];\n const index = entry['@index'];\n if (id && index) {\n const existingIndexValue = indexHashes[id];\n if (existingIndexValue && existingIndexValue !== index) {\n throw new jsonld_context_parser_1.ErrorCoded(`Conflicting @index value for ${id}`, jsonld_context_parser_1.ERROR_CODES.CONFLICTING_INDEXES);\n }\n indexHashes[id] = index;\n }\n }\n }\n }\n }\n /**\n * Convert a given JSON value to an RDF term.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key The current JSON key.\n * @param value A JSON value.\n * @param {number} depth The depth the value is at.\n * @param {string[]} keys The path of keys.\n * @return {Promise} An RDF term array.\n */\n async valueToTerm(context, key, value, depth, keys) {\n // Skip further processing if we have an @type: @json\n if (Util.getContextValueType(context, key) === '@json') {\n return [this.dataFactory.literal(this.valueToJsonString(value), this.rdfJson)];\n }\n const type = typeof value;\n switch (type) {\n case 'object':\n // Skip if we have a null or undefined object\n if (value === null || value === undefined) {\n return [];\n }\n // Special case for arrays\n if (Array.isArray(value)) {\n // We handle arrays at value level so we can emit earlier, so this is handled already when we get here.\n // Empty context-based lists are emitted at this place, because our streaming algorithm doesn't detect those.\n if ('@list' in Util.getContextValueContainer(context, key)) {\n if (value.length === 0) {\n return [this.rdfNil];\n }\n else {\n return this.parsingContext.idStack[depth + 1] || [];\n }\n }\n await this.validateValueIndexes(value);\n return [];\n }\n // Handle property-scoped contexts\n context = await this.getContextSelfOrPropertyScoped(context, key);\n // Handle local context in the value\n if ('@context' in value) {\n context = await this.parsingContext.parseContext(value['@context'], (await this.parsingContext.getContext(keys, 0)).getContextRaw());\n }\n // In all other cases, we have a hash\n value = await this.unaliasKeywords(value, keys, depth, context); // Un-alias potential keywords in this hash\n if ('@value' in value) {\n let val;\n let valueLanguage;\n let valueDirection;\n let valueType;\n let valueIndex; // We don't use the index, but we need to check its type for spec-compliance\n for (key in value) {\n const subValue = value[key];\n switch (key) {\n case '@value':\n val = subValue;\n break;\n case '@language':\n valueLanguage = subValue;\n break;\n case '@direction':\n valueDirection = subValue;\n break;\n case '@type':\n valueType = subValue;\n break;\n case '@index':\n valueIndex = subValue;\n break;\n default:\n throw new jsonld_context_parser_1.ErrorCoded(`Unknown value entry '${key}' in @value: ${JSON.stringify(value)}`, jsonld_context_parser_1.ERROR_CODES.INVALID_VALUE_OBJECT);\n }\n }\n // Skip further processing if we have an @type: @json\n if (await this.unaliasKeyword(valueType, keys, depth, true, context) === '@json') {\n return [this.dataFactory.literal(this.valueToJsonString(val), this.rdfJson)];\n }\n // Validate @value\n if (val === null) {\n return [];\n }\n if (typeof val === 'object') {\n throw new jsonld_context_parser_1.ErrorCoded(`The value of an '@value' can not be an object, got '${JSON.stringify(val)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_VALUE_OBJECT_VALUE);\n }\n // Validate @index\n if (this.parsingContext.validateValueIndexes && valueIndex && typeof valueIndex !== 'string') {\n throw new jsonld_context_parser_1.ErrorCoded(`The value of an '@index' must be a string, got '${JSON.stringify(valueIndex)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_INDEX_VALUE);\n }\n // Validate @language and @direction\n if (valueLanguage) {\n if (typeof val !== 'string') {\n throw new jsonld_context_parser_1.ErrorCoded(`When an '@language' is set, the value of '@value' must be a string, got '${JSON.stringify(val)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_LANGUAGE_TAGGED_VALUE);\n }\n if (!jsonld_context_parser_1.ContextParser.validateLanguage(valueLanguage, this.parsingContext.strictValues, jsonld_context_parser_1.ERROR_CODES.INVALID_LANGUAGE_TAGGED_STRING)) {\n return [];\n }\n // Language tags are always normalized to lowercase in 1.0.\n if (this.parsingContext.normalizeLanguageTags || this.parsingContext.activeProcessingMode === 1.0) {\n valueLanguage = valueLanguage.toLowerCase();\n }\n }\n if (valueDirection) {\n if (typeof val !== 'string') {\n throw new Error(`When an '@direction' is set, the value of '@value' must be a string, got '${JSON.stringify(val)}'`);\n }\n if (!jsonld_context_parser_1.ContextParser.validateDirection(valueDirection, this.parsingContext.strictValues)) {\n return [];\n }\n }\n // Check @language and @direction\n if (valueLanguage && valueDirection && this.parsingContext.rdfDirection) {\n if (valueType) {\n throw new jsonld_context_parser_1.ErrorCoded(`Can not have '@language', '@direction' and '@type' in a value: '${JSON\n .stringify(value)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_VALUE_OBJECT);\n }\n return this.nullableTermToArray(this\n .createLanguageDirectionLiteral(depth, val, valueLanguage, valueDirection));\n }\n else if (valueLanguage) { // Check @language\n if (valueType) {\n throw new jsonld_context_parser_1.ErrorCoded(`Can not have both '@language' and '@type' in a value: '${JSON.stringify(value)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_VALUE_OBJECT);\n }\n return [this.dataFactory.literal(val, valueLanguage)];\n }\n else if (valueDirection && this.parsingContext.rdfDirection) { // Check @direction\n if (valueType) {\n throw new jsonld_context_parser_1.ErrorCoded(`Can not have both '@direction' and '@type' in a value: '${JSON.stringify(value)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_VALUE_OBJECT);\n }\n return this.nullableTermToArray(this\n .createLanguageDirectionLiteral(depth, val, valueLanguage, valueDirection));\n }\n else if (valueType) { // Validate @type\n if (typeof valueType !== 'string') {\n throw new jsonld_context_parser_1.ErrorCoded(`The value of an '@type' must be a string, got '${JSON.stringify(valueType)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_TYPED_VALUE);\n }\n const typeTerm = this.createVocabOrBaseTerm(context, valueType);\n if (!typeTerm) {\n throw new jsonld_context_parser_1.ErrorCoded(`Invalid '@type' value, got '${JSON.stringify(valueType)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_TYPED_VALUE);\n }\n if (typeTerm.termType !== 'NamedNode') {\n throw new jsonld_context_parser_1.ErrorCoded(`Illegal value type (${typeTerm.termType}): ${valueType}`, jsonld_context_parser_1.ERROR_CODES.INVALID_TYPED_VALUE);\n }\n return [this.dataFactory.literal(val, typeTerm)];\n }\n // We don't pass the context, because context-based things like @language should be ignored\n return await this.valueToTerm(new jsonld_context_parser_1.JsonLdContextNormalized({}), key, val, depth, keys);\n }\n else if ('@set' in value) {\n // No other entries are allow in this value\n if (Object.keys(value).length > 1) {\n throw new jsonld_context_parser_1.ErrorCoded(`Found illegal neighbouring entries next to @set for key: '${key}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT);\n }\n // No need to do anything here, this is handled at the deeper level.\n return [];\n }\n else if ('@list' in value) {\n // No other entries are allowed in this value\n if (Object.keys(value).length > 1) {\n throw new jsonld_context_parser_1.ErrorCoded(`Found illegal neighbouring entries next to @list for key: '${key}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT);\n }\n const listValue = value[\"@list\"];\n // We handle lists at value level so we can emit earlier, so this is handled already when we get here.\n // Empty anonymous lists are emitted at this place, because our streaming algorithm doesn't detect those.\n if (Array.isArray(listValue)) {\n if (listValue.length === 0) {\n return [this.rdfNil];\n }\n else {\n return this.parsingContext.idStack[depth + 1] || [];\n }\n }\n else {\n // We only have a single list element here, so emit this directly as single element\n return await this.valueToTerm(await this.parsingContext.getContext(keys), key, listValue, depth - 1, keys.slice(0, -1));\n }\n }\n else if ('@reverse' in value && typeof value['@reverse'] === 'boolean') {\n // We handle reverse properties at value level so we can emit earlier,\n // so this is handled already when we get here.\n return [];\n }\n else if ('@graph' in Util.getContextValueContainer(await this.parsingContext.getContext(keys), key)) {\n // We are processing a graph container\n const graphContainerEntries = this.parsingContext.graphContainerTermStack[depth + 1];\n return graphContainerEntries ? Object.values(graphContainerEntries) : [this.dataFactory.blankNode()];\n }\n else if (\"@id\" in value) {\n // Use deeper context if the value node contains other properties next to @id.\n if (Object.keys(value).length > 1) {\n context = await this.parsingContext.getContext(keys, 0);\n }\n // Handle local context in the value\n if ('@context' in value) {\n context = await this.parsingContext.parseContext(value['@context'], context.getContextRaw());\n }\n if (value[\"@type\"] === '@vocab') {\n return this.nullableTermToArray(this.createVocabOrBaseTerm(context, value[\"@id\"]));\n }\n else {\n return this.nullableTermToArray(this.resourceToTerm(context, value[\"@id\"]));\n }\n }\n else {\n // Only make a blank node if at least one triple was emitted at the value's level.\n if (this.parsingContext.emittedStack[depth + 1]\n || (value && typeof value === 'object' && Object.keys(value).length === 0)) {\n return (this.parsingContext.idStack[depth + 1]\n || (this.parsingContext.idStack[depth + 1] = [this.dataFactory.blankNode()]));\n }\n else {\n return [];\n }\n }\n case 'string':\n return this.nullableTermToArray(this.stringValueToTerm(depth, await this.getContextSelfOrPropertyScoped(context, key), key, value, null));\n case 'boolean':\n return this.nullableTermToArray(this.stringValueToTerm(depth, await this.getContextSelfOrPropertyScoped(context, key), key, Boolean(value).toString(), this.dataFactory.namedNode(Util.XSD_BOOLEAN)));\n case 'number':\n return this.nullableTermToArray(this.stringValueToTerm(depth, await this.getContextSelfOrPropertyScoped(context, key), key, value, this.dataFactory.namedNode(value % 1 === 0 && value < 1e21 ? Util.XSD_INTEGER : Util.XSD_DOUBLE)));\n default:\n this.parsingContext.emitError(new Error(`Could not determine the RDF type of a ${type}`));\n return [];\n }\n }\n /**\n * If the context defines a property-scoped context for the given key,\n * that context will be returned.\n * Otherwise, the given context will be returned as-is.\n *\n * This should be used for valueToTerm cases that are not objects.\n * @param context A context.\n * @param key A JSON key.\n */\n async getContextSelfOrPropertyScoped(context, key) {\n const contextKeyEntry = context.getContextRaw()[key];\n if (contextKeyEntry && typeof contextKeyEntry === 'object' && '@context' in contextKeyEntry) {\n context = await this.parsingContext.parseContext(contextKeyEntry, context.getContextRaw(), true);\n }\n return context;\n }\n /**\n * If the given term is null, return an empty array, otherwise return an array with the single given term.\n * @param term A term.\n */\n nullableTermToArray(term) {\n return term ? [term] : [];\n }\n /**\n * Convert a given JSON key to an RDF predicate term,\n * based on @vocab.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param key A JSON key.\n * @return {RDF.NamedNode} An RDF named node.\n */\n predicateToTerm(context, key) {\n const expanded = context.expandTerm(key, true, this.parsingContext.getExpandOptions());\n // Immediately return if the predicate was disabled in the context\n if (!expanded) {\n return null;\n }\n // Check if the predicate is a blank node\n if (expanded[0] === '_' && expanded[1] === ':') {\n if (this.parsingContext.produceGeneralizedRdf) {\n return this.dataFactory.blankNode(expanded.substr(2));\n }\n else {\n return null;\n }\n }\n // Check if the predicate is a valid IRI\n if (Util.isValidIri(expanded)) {\n return this.dataFactory.namedNode(expanded);\n }\n else {\n if (expanded && this.parsingContext.strictValues) {\n this.parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Invalid predicate IRI: ${expanded}`, jsonld_context_parser_1.ERROR_CODES.INVALID_IRI_MAPPING));\n }\n else {\n return null;\n }\n }\n return null;\n }\n /**\n * Convert a given JSON key to an RDF resource term or blank node,\n * based on @base.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param key A JSON key.\n * @return {RDF.NamedNode} An RDF named node or null.\n */\n resourceToTerm(context, key) {\n if (key.startsWith('_:')) {\n return this.dataFactory.blankNode(key.substr(2));\n }\n const iri = context.expandTerm(key, false, this.parsingContext.getExpandOptions());\n if (!Util.isValidIri(iri)) {\n if (iri && this.parsingContext.strictValues) {\n this.parsingContext.emitError(new Error(`Invalid resource IRI: ${iri}`));\n }\n else {\n return null;\n }\n }\n return this.dataFactory.namedNode(iri);\n }\n /**\n * Convert a given JSON key to an RDF resource term.\n * It will do this based on the @vocab,\n * and fallback to @base.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param key A JSON key.\n * @return {RDF.NamedNode} An RDF named node or null.\n */\n createVocabOrBaseTerm(context, key) {\n if (key.startsWith('_:')) {\n return this.dataFactory.blankNode(key.substr(2));\n }\n const expandOptions = this.parsingContext.getExpandOptions();\n let expanded = context.expandTerm(key, true, expandOptions);\n if (expanded === key) {\n expanded = context.expandTerm(key, false, expandOptions);\n }\n if (!Util.isValidIri(expanded)) {\n if (expanded && this.parsingContext.strictValues && !expanded.startsWith('@')) {\n this.parsingContext.emitError(new Error(`Invalid term IRI: ${expanded}`));\n }\n else {\n return null;\n }\n }\n return this.dataFactory.namedNode(expanded);\n }\n /**\n * Ensure that the given value becomes a string.\n * @param {string | number} value A string or number.\n * @param {NamedNode} datatype The intended datatype.\n * @return {string} The returned string.\n */\n intToString(value, datatype) {\n if (typeof value === 'number') {\n if (Number.isFinite(value)) {\n const isInteger = value % 1 === 0;\n if (isInteger && (!datatype || datatype.value !== Util.XSD_DOUBLE)) {\n return Number(value).toString();\n }\n else {\n return value.toExponential(15).replace(/(\\d)0*e\\+?/, '$1E');\n }\n }\n else {\n return value > 0 ? 'INF' : '-INF';\n }\n }\n else {\n return value;\n }\n }\n /**\n * Convert a given JSON string value to an RDF term.\n * @param {number} depth The current stack depth.\n * @param {JsonLdContextNormalized} context A JSON-LD context.\n * @param {string} key The current JSON key.\n * @param {string} value A JSON value.\n * @param {NamedNode} defaultDatatype The default datatype for the given value.\n * @return {RDF.Term} An RDF term or null.\n */\n stringValueToTerm(depth, context, key, value, defaultDatatype) {\n // Check the datatype from the context\n const contextType = Util.getContextValueType(context, key);\n if (contextType) {\n if (contextType === '@id') {\n if (!defaultDatatype) {\n return this.resourceToTerm(context, this.intToString(value, defaultDatatype));\n }\n }\n else if (contextType === '@vocab') {\n if (!defaultDatatype) {\n return this.createVocabOrBaseTerm(context, this.intToString(value, defaultDatatype));\n }\n }\n else {\n defaultDatatype = this.dataFactory.namedNode(contextType);\n }\n }\n // If we don't find such a datatype, check the language from the context\n if (!defaultDatatype) {\n const contextLanguage = Util.getContextValueLanguage(context, key);\n const contextDirection = Util.getContextValueDirection(context, key);\n if (contextDirection && this.parsingContext.rdfDirection) {\n return this.createLanguageDirectionLiteral(depth, this.intToString(value, defaultDatatype), contextLanguage, contextDirection);\n }\n else {\n return this.dataFactory.literal(this.intToString(value, defaultDatatype), contextLanguage);\n }\n }\n // If all else fails, make a literal based on the default content type\n return this.dataFactory.literal(this.intToString(value, defaultDatatype), defaultDatatype);\n }\n /**\n * Create a literal for the given value with the given language and direction.\n * Auxiliary quads may be emitted.\n * @param {number} depth The current stack depth.\n * @param {string} value A string value.\n * @param {string} language A language tag.\n * @param {string} direction A direction.\n * @return {Term} An RDF term.\n */\n createLanguageDirectionLiteral(depth, value, language, direction) {\n if (this.parsingContext.rdfDirection === 'i18n-datatype') {\n // Create a datatyped literal, by encoding the language and direction into https://www.w3.org/ns/i18n#.\n if (!language) {\n language = '';\n }\n return this.dataFactory.literal(value, this.dataFactory.namedNode(`https://www.w3.org/ns/i18n#${language}_${direction}`));\n }\n else {\n // Reify the literal.\n const valueNode = this.dataFactory.blankNode();\n const graph = this.getDefaultGraph();\n this.parsingContext.emitQuad(depth, this.dataFactory.quad(valueNode, this.dataFactory.namedNode(Util.RDF + 'value'), this.dataFactory.literal(value), graph));\n if (language) {\n this.parsingContext.emitQuad(depth, this.dataFactory.quad(valueNode, this.dataFactory.namedNode(Util.RDF + 'language'), this.dataFactory.literal(language), graph));\n }\n this.parsingContext.emitQuad(depth, this.dataFactory.quad(valueNode, this.dataFactory.namedNode(Util.RDF + 'direction'), this.dataFactory.literal(direction), graph));\n return valueNode;\n }\n }\n /**\n * Stringify the given JSON object to a canonical JSON string.\n * @param value Any valid JSON value.\n * @return {string} A canonical JSON string.\n */\n valueToJsonString(value) {\n return canonicalizeJson(value);\n }\n /**\n * If the key is not a keyword, try to check if it is an alias for a keyword,\n * and if so, un-alias it.\n * @param {string} key A key, can be falsy.\n * @param {string[]} keys The path of keys.\n * @param {number} depth The depth to\n * @param {boolean} disableCache If the cache should be disabled\n * @param {JsonLdContextNormalized} context A context to unalias with,\n * will fallback to retrieving the context for the given keys.\n * @return {Promise} A promise resolving to the key itself, or another key.\n */\n async unaliasKeyword(key, keys, depth, disableCache, context) {\n // Numbers can not be an alias\n if (Number.isInteger(key)) {\n return key;\n }\n // Try to grab from cache if it was already un-aliased before.\n if (!disableCache) {\n const cachedUnaliasedKeyword = this.parsingContext.unaliasedKeywordCacheStack[depth];\n if (cachedUnaliasedKeyword) {\n return cachedUnaliasedKeyword;\n }\n }\n if (!jsonld_context_parser_1.Util.isPotentialKeyword(key)) {\n context = context || await this.parsingContext.getContext(keys);\n let unliased = context.getContextRaw()[key];\n if (unliased && typeof unliased === 'object') {\n unliased = unliased['@id'];\n }\n if (jsonld_context_parser_1.Util.isValidKeyword(unliased)) {\n key = unliased;\n }\n }\n return disableCache ? key : (this.parsingContext.unaliasedKeywordCacheStack[depth] = key);\n }\n /**\n * Unalias the keyword of the parent.\n * This adds a safety check if no parent exist.\n * @param {any[]} keys A stack of keys.\n * @param {number} depth The current depth.\n * @return {Promise} A promise resolving to the parent key, or another key.\n */\n async unaliasKeywordParent(keys, depth) {\n return await this.unaliasKeyword(depth > 0 && keys[depth - 1], keys, depth - 1);\n }\n /**\n * Un-alias all keywords in the given hash.\n * @param {{[p: string]: any}} hash A hash object.\n * @param {string[]} keys The path of keys.\n * @param {number} depth The depth.\n * @param {JsonLdContextNormalized} context A context to unalias with,\n * will fallback to retrieving the context for the given keys.\n * @return {Promise<{[p: string]: any}>} A promise resolving to the new hash.\n */\n async unaliasKeywords(hash, keys, depth, context) {\n const newHash = {};\n for (const key in hash) {\n newHash[await this.unaliasKeyword(key, keys, depth + 1, true, context)] = hash[key];\n }\n return newHash;\n }\n /**\n * Check if we are processing a literal (including JSON literals) at the given depth.\n * This will also check higher levels,\n * because if a parent is a literal,\n * then the deeper levels are definitely a literal as well.\n * @param {number} depth The depth.\n * @return {boolean} If we are processing a literal.\n */\n isLiteral(depth) {\n for (let i = depth; i >= 0; i--) {\n if (this.parsingContext.literalStack[i] || this.parsingContext.jsonLiteralStack[i]) {\n return true;\n }\n }\n return false;\n }\n /**\n * Check how many parents should be skipped for checking the @graph for the given node.\n *\n * @param {number} depth The depth of the node.\n * @param {any[]} keys An array of keys.\n * @return {number} The graph depth offset.\n */\n async getDepthOffsetGraph(depth, keys) {\n for (let i = depth - 1; i > 0; i--) {\n if (await this.unaliasKeyword(keys[i], keys, i) === '@graph') {\n // Skip further processing if we are already in an @graph-@id or @graph-@index container\n const containers = (await EntryHandlerContainer_1.EntryHandlerContainer.getContainerHandler(this.parsingContext, keys, i)).containers;\n if (EntryHandlerContainer_1.EntryHandlerContainer.isComplexGraphContainer(containers)) {\n return -1;\n }\n return depth - i - 1;\n }\n }\n return -1;\n }\n /**\n * Check if the given subject is of a valid type.\n * This should be called when applying @reverse'd properties.\n * @param {Term} subject A subject.\n */\n validateReverseSubject(subject) {\n if (subject.termType === 'Literal') {\n throw new jsonld_context_parser_1.ErrorCoded(`Found illegal literal in subject position: ${subject.value}`, jsonld_context_parser_1.ERROR_CODES.INVALID_REVERSE_PROPERTY_VALUE);\n }\n }\n /**\n * Get the default graph.\n * @return {Term} An RDF term.\n */\n getDefaultGraph() {\n return this.parsingContext.defaultGraph || this.dataFactory.defaultGraph();\n }\n /**\n * Get the current graph, while taking into account a graph that can be defined via @container: @graph.\n * If not within a graph container, the default graph will be returned.\n * @param keys The current keys.\n * @param depth The current depth.\n */\n async getGraphContainerValue(keys, depth) {\n // Default to default graph\n let graph = this.getDefaultGraph();\n // Check if we are in an @container: @graph.\n const { containers, depth: depthContainer } = await EntryHandlerContainer_1.EntryHandlerContainer\n .getContainerHandler(this.parsingContext, keys, depth);\n if ('@graph' in containers) {\n // Get the graph from the stack.\n const graphContainerIndex = EntryHandlerContainer_1.EntryHandlerContainer.getContainerGraphIndex(containers, depthContainer, keys);\n const entry = this.parsingContext.graphContainerTermStack[depthContainer];\n graph = entry ? entry[graphContainerIndex] : null;\n // Set the graph in the stack if none has been set yet.\n if (!graph) {\n let graphId = null;\n if ('@id' in containers) {\n const keyUnaliased = await this.getContainerKey(keys[depthContainer], keys, depthContainer);\n if (keyUnaliased !== null) {\n graphId = await this.resourceToTerm(await this.parsingContext.getContext(keys), keyUnaliased);\n }\n }\n if (!graphId) {\n graphId = this.dataFactory.blankNode();\n }\n if (!this.parsingContext.graphContainerTermStack[depthContainer]) {\n this.parsingContext.graphContainerTermStack[depthContainer] = {};\n }\n graph = this.parsingContext.graphContainerTermStack[depthContainer][graphContainerIndex] = graphId;\n }\n }\n return graph;\n }\n /**\n * Get the properties depth for retrieving properties.\n *\n * Typically, the properties depth will be identical to the given depth.\n *\n * The following exceptions apply:\n * * When the parent is @reverse, the depth is decremented by one.\n * * When @nest parents are found, the depth is decremented by the number of @nest parents.\n * If in combination with the exceptions above an intermediary array is discovered,\n * the depth is also decremented by this number of arrays.\n *\n * @param keys The current key chain.\n * @param depth The current depth.\n */\n async getPropertiesDepth(keys, depth) {\n let lastValidDepth = depth;\n for (let i = depth - 1; i > 0; i--) {\n if (typeof keys[i] !== 'number') { // Skip array keys\n const parentKey = await this.unaliasKeyword(keys[i], keys, i);\n if (parentKey === '@reverse') {\n return i;\n }\n else if (parentKey === '@nest') {\n lastValidDepth = i;\n }\n else {\n return lastValidDepth;\n }\n }\n }\n return lastValidDepth;\n }\n /**\n * Get the key for the current container entry.\n * @param key A key, can be falsy.\n * @param keys The key chain.\n * @param depth The current depth to get the key from.\n * @return Promise resolving to the key.\n * Null will be returned for @none entries, with aliasing taken into account.\n */\n async getContainerKey(key, keys, depth) {\n const keyUnaliased = await this.unaliasKeyword(key, keys, depth);\n return keyUnaliased === '@none' ? null : keyUnaliased;\n }\n}\nexports.Util = Util;\nUtil.XSD = 'http://www.w3.org/2001/XMLSchema#';\nUtil.XSD_BOOLEAN = Util.XSD + 'boolean';\nUtil.XSD_INTEGER = Util.XSD + 'integer';\nUtil.XSD_DOUBLE = Util.XSD + 'double';\nUtil.RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';\n//# sourceMappingURL=Util.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContainerHandlerIdentifier = void 0;\n/**\n * Container handler for @id.\n *\n * It assumes that the current key is the identifier of the current value.\n * This will add this value to the parent node.\n */\nclass ContainerHandlerIdentifier {\n canCombineWithGraph() {\n return true;\n }\n async handle(containers, parsingContext, util, keys, value, depth) {\n let id;\n // First check if the child node already has a defined id.\n if (parsingContext.emittedStack[depth + 1] && parsingContext.idStack[depth + 1]) {\n // Use the existing identifier\n id = parsingContext.idStack[depth + 1][0];\n }\n else {\n // Create the identifier\n const keyUnaliased = await util.getContainerKey(keys[depth], keys, depth);\n const maybeId = keyUnaliased !== null\n ? await util.resourceToTerm(await parsingContext.getContext(keys), keys[depth])\n : util.dataFactory.blankNode();\n // Do nothing if the id is invalid\n if (!maybeId) {\n parsingContext.emittedStack[depth] = false; // Don't emit the predicate owning this container.\n return;\n }\n id = maybeId;\n // Insert the id into the stack so that buffered children can make us of it.\n parsingContext.idStack[depth + 1] = [id];\n }\n // Insert the id into the stack so that parents can make use of it.\n // Insert it as an array because multiple id container entries may exist\n let ids = parsingContext.idStack[depth];\n if (!ids) {\n ids = parsingContext.idStack[depth] = [];\n }\n // Only insert the term if it does not exist yet in the array.\n if (!ids.some((term) => term.equals(id))) {\n ids.push(id);\n }\n // Flush any pending flush buffers\n if (!await parsingContext.handlePendingContainerFlushBuffers()) {\n parsingContext.emittedStack[depth] = false; // Don't emit the predicate owning this container.\n }\n }\n}\nexports.ContainerHandlerIdentifier = ContainerHandlerIdentifier;\n//# sourceMappingURL=ContainerHandlerIdentifier.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContainerHandlerIndex = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst EntryHandlerPredicate_1 = require(\"../entryhandler/EntryHandlerPredicate\");\nconst Util_1 = require(\"../Util\");\n/**\n * Container handler for @index.\n *\n * This will ignore the current key and add this entry to the parent node.\n */\nclass ContainerHandlerIndex {\n canCombineWithGraph() {\n return true;\n }\n async handle(containers, parsingContext, util, keys, value, depth) {\n if (!Array.isArray(value)) {\n const graphContainer = '@graph' in containers;\n // Check if the container is a property-based container by checking if there is a valid @index.\n const context = await parsingContext.getContext(keys);\n const indexKey = keys[depth - 1];\n const indexPropertyRaw = Util_1.Util.getContextValueIndex(context, indexKey);\n if (indexPropertyRaw) {\n // Validate the @index value\n if (jsonld_context_parser_1.Util.isPotentialKeyword(indexPropertyRaw)) {\n throw new jsonld_context_parser_1.ErrorCoded(`Keywords can not be used as @index value, got: ${indexPropertyRaw}`, jsonld_context_parser_1.ERROR_CODES.INVALID_TERM_DEFINITION);\n }\n if (typeof indexPropertyRaw !== 'string') {\n throw new jsonld_context_parser_1.ErrorCoded(`@index values must be strings, got: ${indexPropertyRaw}`, jsonld_context_parser_1.ERROR_CODES.INVALID_TERM_DEFINITION);\n }\n // When @index is used, values must be node values, unless @type: @id is defined in the context\n if (typeof value !== 'object') {\n // Error if we don't have @type: @id\n if (Util_1.Util.getContextValueType(context, indexKey) !== '@id') {\n throw new jsonld_context_parser_1.ErrorCoded(`Property-based index containers require nodes as values or strings with @type: @id, but got: ${value}`, jsonld_context_parser_1.ERROR_CODES.INVALID_VALUE_OBJECT);\n }\n // Add an @id to the stack, so our expanded @index value can make use of it\n const id = util.resourceToTerm(context, value);\n if (id) {\n parsingContext.idStack[depth + 1] = [id];\n }\n }\n // Expand the @index value\n const indexProperty = util.createVocabOrBaseTerm(context, indexPropertyRaw);\n if (indexProperty) {\n const indexValues = await util.valueToTerm(context, indexPropertyRaw, await util.getContainerKey(keys[depth], keys, depth), depth, keys);\n if (graphContainer) {\n // When we're in a graph container, attach the index to the graph identifier\n const graphId = await util.getGraphContainerValue(keys, depth + 1);\n for (const indexValue of indexValues) {\n parsingContext.emitQuad(depth, util.dataFactory.quad(graphId, indexProperty, indexValue, util.getDefaultGraph()));\n }\n }\n else {\n // Otherwise, attach the index to the node identifier\n for (const indexValue of indexValues) {\n await EntryHandlerPredicate_1.EntryHandlerPredicate.handlePredicateObject(parsingContext, util, keys, depth + 1, indexProperty, indexValue, false);\n }\n }\n }\n }\n const depthOffset = graphContainer ? 2 : 1;\n await parsingContext.newOnValueJob(keys.slice(0, keys.length - depthOffset), value, depth - depthOffset, true);\n // Flush any pending flush buffers\n await parsingContext.handlePendingContainerFlushBuffers();\n }\n parsingContext.emittedStack[depth] = false; // We have emitted a level higher\n }\n}\nexports.ContainerHandlerIndex = ContainerHandlerIndex;\n//# sourceMappingURL=ContainerHandlerIndex.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContainerHandlerLanguage = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\n/**\n * Container handler for @language.\n *\n * It assumes that the current key is the language of the current value.\n * This will add this value to the parent node.\n */\nclass ContainerHandlerLanguage {\n canCombineWithGraph() {\n return false;\n }\n async handle(containers, parsingContext, util, keys, value, depth) {\n const language = await util.getContainerKey(keys[depth], keys, depth);\n if (Array.isArray(value)) {\n // No type-checking needed, will be handled on each value when this handler is called recursively.\n value = value.map((subValue) => ({ '@value': subValue, '@language': language }));\n }\n else {\n if (typeof value !== 'string') {\n throw new jsonld_context_parser_1.ErrorCoded(`Got invalid language map value, got '${JSON.stringify(value)}', but expected string`, jsonld_context_parser_1.ERROR_CODES.INVALID_LANGUAGE_MAP_VALUE);\n }\n value = { '@value': value, '@language': language };\n }\n await parsingContext.newOnValueJob(keys.slice(0, keys.length - 1), value, depth - 1, true);\n parsingContext.emittedStack[depth] = false; // We have emitted a level higher\n }\n}\nexports.ContainerHandlerLanguage = ContainerHandlerLanguage;\n//# sourceMappingURL=ContainerHandlerLanguage.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContainerHandlerType = void 0;\nconst EntryHandlerPredicate_1 = require(\"../entryhandler/EntryHandlerPredicate\");\nconst Util_1 = require(\"../Util\");\n/**\n * Container handler for @type.\n *\n * This will add this entry to the parent node, and use the current key as an rdf:type value.\n */\nclass ContainerHandlerType {\n canCombineWithGraph() {\n return false;\n }\n async handle(containers, parsingContext, util, keys, value, depth) {\n if (!Array.isArray(value)) {\n if (typeof value === 'string') {\n // Determine the @type of the container\n const context = await parsingContext.getContext(keys);\n const containerTypeType = Util_1.Util.getContextValueType(context, keys[depth - 1]);\n // String values refer to node references\n const id = containerTypeType === '@vocab'\n ? await util.createVocabOrBaseTerm(context, value)\n : await util.resourceToTerm(context, value);\n if (id) {\n // Handle the value of this node as @id, which will also cause the predicate from above to be emitted.\n const subValue = { '@id': id.termType === 'NamedNode' ? id.value : value };\n await parsingContext.newOnValueJob(keys.slice(0, keys.length - 1), subValue, depth - 1, true);\n // Set the id in the stack so it can be used for the rdf:type handling later on\n parsingContext.idStack[depth + 1] = [id];\n }\n }\n else {\n // Other values are handled by handling them as a proper job\n // Check needed for cases where entries don't have an explicit @id\n const entryHasIdentifier = !!parsingContext.idStack[depth + 1];\n // Handle the value of this node, which will also cause the predicate from above to be emitted.\n if (!entryHasIdentifier) {\n delete parsingContext.idStack[depth]; // Force new (blank node) identifier\n }\n await parsingContext.newOnValueJob(keys.slice(0, keys.length - 1), value, depth - 1, true);\n if (!entryHasIdentifier) {\n parsingContext.idStack[depth + 1] = parsingContext.idStack[depth]; // Copy the id to the child node, for @type\n }\n }\n // Identify the type to emit.\n const keyOriginal = await util.getContainerKey(keys[depth], keys, depth);\n const type = keyOriginal !== null\n ? util.createVocabOrBaseTerm(await parsingContext.getContext(keys), keyOriginal)\n : null;\n if (type) {\n // Push the type to the stack using the rdf:type predicate\n await EntryHandlerPredicate_1.EntryHandlerPredicate.handlePredicateObject(parsingContext, util, keys, depth + 1, util.rdfType, type, false);\n }\n // Flush any pending flush buffers\n await parsingContext.handlePendingContainerFlushBuffers();\n }\n parsingContext.emittedStack[depth] = false; // Don't emit the predicate owning this container.\n }\n}\nexports.ContainerHandlerType = ContainerHandlerType;\n//# sourceMappingURL=ContainerHandlerType.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerArrayValue = void 0;\nconst Util_1 = require(\"../Util\");\n/**\n * Handles values that are part of an array.\n */\nclass EntryHandlerArrayValue {\n isPropertyHandler() {\n return false;\n }\n isStackProcessor() {\n return true;\n }\n async validate(parsingContext, util, keys, depth, inProperty) {\n return this.test(parsingContext, util, null, keys, depth);\n }\n async test(parsingContext, util, key, keys, depth) {\n return typeof keys[depth] === 'number';\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n let parentKey = await util.unaliasKeywordParent(keys, depth);\n // Check if we have an anonymous list\n if (parentKey === '@list') {\n // Our value is part of an array\n // Determine the list root key\n let listRootKey = null;\n let listRootDepth = 0;\n for (let i = depth - 2; i > 0; i--) {\n const keyOption = keys[i];\n if (typeof keyOption === 'string' || typeof keyOption === 'number') {\n listRootDepth = i;\n listRootKey = keyOption;\n break;\n }\n }\n if (listRootKey !== null) {\n // Emit the given objects as list elements\n const values = await util.valueToTerm(await parsingContext.getContext(keys), listRootKey, value, depth, keys);\n for (const object of values) {\n await this.handleListElement(parsingContext, util, object, value, depth, keys.slice(0, listRootDepth), listRootDepth);\n }\n // If no values were found, emit a falsy list element to force an empty RDF list to be emitted.\n if (values.length === 0) {\n await this.handleListElement(parsingContext, util, null, value, depth, keys.slice(0, listRootDepth), listRootDepth);\n }\n }\n }\n else if (parentKey === '@set') {\n // Our value is part of a set, so we just add it to the parent-parent\n await parsingContext.newOnValueJob(keys.slice(0, -2), value, depth - 2, false);\n }\n else if (parentKey !== undefined && parentKey !== '@type') {\n // Buffer our value using the parent key as predicate\n // Determine the first parent key that is *not* an array key\n // This is needed in case we have an @list container with nested arrays,\n // where each of them should produce nested RDF lists.\n for (let i = depth - 1; i > 0; i--) {\n if (typeof keys[i] !== 'number') {\n parentKey = await util.unaliasKeyword(keys[i], keys, i);\n break;\n }\n }\n // Check if the predicate is marked as an @list in the context\n const parentContext = await parsingContext.getContext(keys.slice(0, -1));\n if ('@list' in Util_1.Util.getContextValueContainer(parentContext, parentKey)) {\n // Our value is part of an array\n // Emit the given objects as list elements\n parsingContext.emittedStack[depth + 1] = true; // Ensure the creation of bnodes for empty nodes\n const values = await util.valueToTerm(await parsingContext.getContext(keys), parentKey, value, depth, keys);\n for (const object of values) {\n await this.handleListElement(parsingContext, util, object, value, depth, keys.slice(0, -1), depth - 1);\n }\n // If no values were found, emit a falsy list element to force an empty RDF list to be emitted.\n if (values.length === 0) {\n await this.handleListElement(parsingContext, util, null, value, depth, keys.slice(0, -1), depth - 1);\n }\n }\n else {\n // Copy the stack values up one level so that the next job can access them.\n parsingContext.shiftStack(depth, 1);\n // Execute the job one level higher\n await parsingContext.newOnValueJob(keys.slice(0, -1), value, depth - 1, false);\n // Remove any defined contexts at this level to avoid it to propagate to the next array element.\n parsingContext.contextTree.removeContext(keys.slice(0, -1));\n }\n }\n }\n async handleListElement(parsingContext, util, value, valueOriginal, depth, listRootKeys, listRootDepth) {\n // Buffer our value as an RDF list using the listRootKey as predicate\n let listPointer = parsingContext.listPointerStack[depth];\n if (valueOriginal !== null && (await util.unaliasKeywords(valueOriginal, listRootKeys, depth))['@value'] !== null) {\n if (!listPointer || !listPointer.value) {\n const linkTerm = util.dataFactory.blankNode();\n listPointer = { value: linkTerm, listRootDepth, listId: linkTerm };\n }\n else {\n // rdf:rest links are always emitted before the next element,\n // as the blank node identifier is only created at that point.\n // Because of this reason, the final rdf:nil is emitted when the stack depth is decreased.\n const newLinkTerm = util.dataFactory.blankNode();\n parsingContext.emitQuad(depth, util.dataFactory.quad(listPointer.value, util.rdfRest, newLinkTerm, util.getDefaultGraph()));\n // Update the list pointer for the next element\n listPointer.value = newLinkTerm;\n }\n // Emit a list element for the current value\n // Omit rdf:first if the value is invalid\n if (value) {\n parsingContext.emitQuad(depth, util.dataFactory.quad(listPointer.value, util.rdfFirst, value, util.getDefaultGraph()));\n }\n }\n else {\n // A falsy list element if found.\n // Mark it as an rdf:nil list until another valid list element comes in\n if (!listPointer) {\n listPointer = { listRootDepth, listId: util.rdfNil };\n }\n }\n parsingContext.listPointerStack[depth] = listPointer;\n }\n}\nexports.EntryHandlerArrayValue = EntryHandlerArrayValue;\n//# sourceMappingURL=EntryHandlerArrayValue.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerContainer = void 0;\nconst ContainerHandlerIdentifier_1 = require(\"../containerhandler/ContainerHandlerIdentifier\");\nconst ContainerHandlerIndex_1 = require(\"../containerhandler/ContainerHandlerIndex\");\nconst ContainerHandlerLanguage_1 = require(\"../containerhandler/ContainerHandlerLanguage\");\nconst ContainerHandlerType_1 = require(\"../containerhandler/ContainerHandlerType\");\nconst Util_1 = require(\"../Util\");\n/**\n * Handles values that are part of a container type (like @index),\n * as specified by {@link IContainerHandler}.\n */\nclass EntryHandlerContainer {\n /**\n * Check fit the given container is a simple @graph container.\n * Concretely, it will check if no @index or @id is active as well.\n * @param containers A container hash.\n */\n static isSimpleGraphContainer(containers) {\n return '@graph' in containers\n && (('@set' in containers && Object.keys(containers).length === 2) || Object.keys(containers).length === 1);\n }\n /**\n * Check fit the given container is a complex @graph container.\n * Concretely, it will check if @index or @id is active as well next to @graph.\n * @param containers A container hash.\n */\n static isComplexGraphContainer(containers) {\n return '@graph' in containers\n && (('@set' in containers && Object.keys(containers).length > 2)\n || (!('@set' in containers) && Object.keys(containers).length > 1));\n }\n /**\n * Create an graph container index that can be used for identifying a graph term inside the graphContainerTermStack.\n * @param containers The applicable containers.\n * @param depth The container depth.\n * @param keys The array of keys.\n * @return The graph index.\n */\n static getContainerGraphIndex(containers, depth, keys) {\n let isSimpleGraphContainer = EntryHandlerContainer.isSimpleGraphContainer(containers);\n let index = '';\n for (let i = depth; i < keys.length; i++) {\n if (!isSimpleGraphContainer || typeof keys[i] === 'number') {\n index += ':' + keys[i];\n }\n // Only allow a second 'real' key if in a non-simple graph container.\n if (!isSimpleGraphContainer && typeof keys[i] !== 'number') {\n isSimpleGraphContainer = true;\n }\n }\n return index;\n }\n /**\n * Return the applicable container type at the given depth.\n *\n * This will ignore any arrays in the key chain.\n *\n * @param {ParsingContext} parsingContext A parsing context.\n * @param {any[]} keys The array of keys.\n * @param {number} depth The current depth.\n * @return {Promise<{ containers: {[typeName: string]: boolean}, depth: number, fallback: boolean }>}\n * All applicable containers for the given depth,\n * the `depth` of the container root (can change when arrays are in the key chain),\n * and the `fallback` flag that indicates if the default container type was returned\n * (i.e., no dedicated container type is defined).\n */\n static async getContainerHandler(parsingContext, keys, depth) {\n const fallback = {\n containers: { '@set': true },\n depth,\n fallback: true,\n };\n // A flag that is enabled when @graph container should be tested in next iteration\n let checkGraphContainer = false;\n // Iterate from deeper to higher\n const context = await parsingContext.getContext(keys, 2);\n for (let i = depth - 1; i >= 0; i--) {\n if (typeof keys[i] !== 'number') { // Skip array keys\n // @graph containers without any other types are one level less deep, and require special handling\n const containersSelf = Util_1.Util.getContextValue(context, '@container', keys[i], false);\n if (containersSelf && EntryHandlerContainer.isSimpleGraphContainer(containersSelf)) {\n return {\n containers: containersSelf,\n depth: i + 1,\n fallback: false,\n };\n }\n const containersParent = Util_1.Util.getContextValue(context, '@container', keys[i - 1], false);\n if (!containersParent) { // If we have the fallback container value\n if (checkGraphContainer) {\n // Return false if we were already expecting a @graph-@id of @graph-@index container\n return fallback;\n }\n // Check parent-parent, we may be in a @graph-@id of @graph-@index container, which have two levels\n checkGraphContainer = true;\n }\n else {\n // We had an invalid container next iteration, so we now have to check if we were in an @graph container\n const graphContainer = '@graph' in containersParent;\n // We're in a regular container\n for (const containerHandleName in EntryHandlerContainer.CONTAINER_HANDLERS) {\n if (containersParent[containerHandleName]) {\n if (graphContainer) {\n // Only accept graph containers if their combined handlers can handle them.\n if (EntryHandlerContainer.CONTAINER_HANDLERS[containerHandleName].canCombineWithGraph()) {\n return {\n containers: containersParent,\n depth: i,\n fallback: false,\n };\n }\n else {\n return fallback;\n }\n }\n else {\n // Only accept if we were not expecting a @graph-@id of @graph-@index container\n if (checkGraphContainer) {\n return fallback;\n }\n else {\n return {\n containers: containersParent,\n depth: i,\n fallback: false,\n };\n }\n }\n }\n }\n // Fail if no valid container handlers were found\n return fallback;\n }\n }\n }\n return fallback;\n }\n /**\n * Check if we are handling a value at the given depth\n * that is part of something that should be handled as a container,\n * AND if this container should be buffered, so that it can be handled by a dedicated container handler.\n *\n * For instance, any container with @graph will NOT be buffered.\n *\n * This will ignore any arrays in the key chain.\n *\n * @param {ParsingContext} parsingContext A parsing context.\n * @param {any[]} keys The array of keys.\n * @param {number} depth The current depth.\n * @return {Promise} If we are in the scope of a container handler.\n */\n static async isBufferableContainerHandler(parsingContext, keys, depth) {\n const handler = await EntryHandlerContainer.getContainerHandler(parsingContext, keys, depth);\n return !handler.fallback && !('@graph' in handler.containers);\n }\n isPropertyHandler() {\n return false;\n }\n isStackProcessor() {\n return true;\n }\n async validate(parsingContext, util, keys, depth, inProperty) {\n return !!await this.test(parsingContext, util, null, keys, depth);\n }\n async test(parsingContext, util, key, keys, depth) {\n const containers = Util_1.Util.getContextValueContainer(await parsingContext.getContext(keys, 2), keys[depth - 1]);\n for (const containerName in EntryHandlerContainer.CONTAINER_HANDLERS) {\n if (containers[containerName]) {\n return {\n containers,\n handler: EntryHandlerContainer.CONTAINER_HANDLERS[containerName],\n };\n }\n }\n return null;\n }\n async handle(parsingContext, util, key, keys, value, depth, testResult) {\n return testResult.handler.handle(testResult.containers, parsingContext, util, keys, value, depth);\n }\n}\nexports.EntryHandlerContainer = EntryHandlerContainer;\nEntryHandlerContainer.CONTAINER_HANDLERS = {\n '@id': new ContainerHandlerIdentifier_1.ContainerHandlerIdentifier(),\n '@index': new ContainerHandlerIndex_1.ContainerHandlerIndex(),\n '@language': new ContainerHandlerLanguage_1.ContainerHandlerLanguage(),\n '@type': new ContainerHandlerType_1.ContainerHandlerType(),\n};\n//# sourceMappingURL=EntryHandlerContainer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerInvalidFallback = void 0;\n/**\n * A catch-all for properties, that will either emit an error or ignore,\n * depending on whether or not the `strictValues` property is set.\n */\nclass EntryHandlerInvalidFallback {\n isPropertyHandler() {\n return false;\n }\n isStackProcessor() {\n return true;\n }\n async validate(parsingContext, util, keys, depth, inProperty) {\n return false;\n }\n async test(parsingContext, util, key, keys, depth) {\n return true;\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n parsingContext.emittedStack[depth] = false;\n }\n}\nexports.EntryHandlerInvalidFallback = EntryHandlerInvalidFallback;\n//# sourceMappingURL=EntryHandlerInvalidFallback.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerPredicate = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst Util_1 = require(\"../Util\");\n/**\n * Interprets keys as predicates.\n * The most common case in JSON-LD processing.\n */\nclass EntryHandlerPredicate {\n /**\n * Handle the given predicate-object by either emitting it,\n * or by placing it in the appropriate stack for later emission when no @graph and/or @id has been defined.\n * @param {ParsingContext} parsingContext A parsing context.\n * @param {Util} util A utility instance.\n * @param {any[]} keys A stack of keys.\n * @param {number} depth The current depth.\n * @param {Term} predicate The predicate.\n * @param {Term} object The object.\n * @param {boolean} reverse If the property is reversed.\n * @return {Promise} A promise resolving when handling is done.\n */\n static async handlePredicateObject(parsingContext, util, keys, depth, predicate, object, reverse) {\n const depthProperties = await util.getPropertiesDepth(keys, depth);\n const depthOffsetGraph = await util.getDepthOffsetGraph(depth, keys);\n const depthPropertiesGraph = depth - depthOffsetGraph;\n const subjects = parsingContext.idStack[depthProperties];\n if (subjects) {\n // Emit directly if the @id was already defined\n for (const subject of subjects) {\n // Check if we're in a @graph context\n const atGraph = depthOffsetGraph >= 0;\n if (atGraph) {\n const graphs = parsingContext.idStack[depthPropertiesGraph - 1];\n if (graphs) {\n for (const graph of graphs) {\n // Emit our quad if graph @id is known\n if (reverse) {\n util.validateReverseSubject(object);\n parsingContext.emitQuad(depth, util.dataFactory.quad(object, predicate, subject, graph));\n }\n else {\n parsingContext.emitQuad(depth, util.dataFactory.quad(subject, predicate, object, graph));\n }\n }\n }\n else {\n // Buffer our triple if graph @id is not known yet.\n if (reverse) {\n util.validateReverseSubject(object);\n parsingContext.getUnidentifiedGraphBufferSafe(depthPropertiesGraph - 1).push({ subject: object, predicate, object: subject });\n }\n else {\n parsingContext.getUnidentifiedGraphBufferSafe(depthPropertiesGraph - 1)\n .push({ subject, predicate, object });\n }\n }\n }\n else {\n // Emit if no @graph was applicable\n const graph = await util.getGraphContainerValue(keys, depthProperties);\n if (reverse) {\n util.validateReverseSubject(object);\n parsingContext.emitQuad(depth, util.dataFactory.quad(object, predicate, subject, graph));\n }\n else {\n parsingContext.emitQuad(depth, util.dataFactory.quad(subject, predicate, object, graph));\n }\n }\n }\n }\n else {\n // Buffer until our @id becomes known, or we go up the stack\n if (reverse) {\n util.validateReverseSubject(object);\n }\n parsingContext.getUnidentifiedValueBufferSafe(depthProperties).push({ predicate, object, reverse });\n }\n }\n isPropertyHandler() {\n return true;\n }\n isStackProcessor() {\n return true;\n }\n async validate(parsingContext, util, keys, depth, inProperty) {\n const key = keys[depth];\n if (key) {\n const context = await parsingContext.getContext(keys);\n if (!parsingContext.jsonLiteralStack[depth] && await util.predicateToTerm(context, keys[depth])) {\n // If this valid predicate is of type @json, mark it so in the stack so that no deeper handling of nodes occurs.\n if (Util_1.Util.getContextValueType(context, key) === '@json') {\n parsingContext.jsonLiteralStack[depth + 1] = true;\n }\n return true;\n }\n }\n return false;\n }\n async test(parsingContext, util, key, keys, depth) {\n return keys[depth];\n }\n async handle(parsingContext, util, key, keys, value, depth, testResult) {\n const keyOriginal = keys[depth];\n const context = await parsingContext.getContext(keys);\n const predicate = await util.predicateToTerm(context, key);\n if (predicate) {\n const objects = await util.valueToTerm(context, key, value, depth, keys);\n if (objects.length) {\n for (let object of objects) {\n const reverse = Util_1.Util.isPropertyReverse(context, keyOriginal, await util.unaliasKeywordParent(keys, depth));\n if (value) {\n // Special case if our term was defined as an @list, but does not occur in an array,\n // In that case we just emit it as an RDF list with a single element.\n const listValueContainer = '@list' in Util_1.Util.getContextValueContainer(context, key);\n if (listValueContainer || value['@list']) {\n if (((listValueContainer && !Array.isArray(value) && !value['@list'])\n || (value['@list'] && !Array.isArray(value['@list'])))\n && object !== util.rdfNil) {\n const listPointer = util.dataFactory.blankNode();\n parsingContext.emitQuad(depth, util.dataFactory.quad(listPointer, util.rdfRest, util.rdfNil, util.getDefaultGraph()));\n parsingContext.emitQuad(depth, util.dataFactory.quad(listPointer, util.rdfFirst, object, util.getDefaultGraph()));\n object = listPointer;\n }\n // Lists are not allowed in @reverse'd properties\n if (reverse && !parsingContext.allowSubjectList) {\n throw new jsonld_context_parser_1.ErrorCoded(`Found illegal list value in subject position at ${key}`, jsonld_context_parser_1.ERROR_CODES.INVALID_REVERSE_PROPERTY_VALUE);\n }\n }\n }\n await EntryHandlerPredicate.handlePredicateObject(parsingContext, util, keys, depth, predicate, object, reverse);\n }\n }\n }\n }\n}\nexports.EntryHandlerPredicate = EntryHandlerPredicate;\n//# sourceMappingURL=EntryHandlerPredicate.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeyword = void 0;\n/**\n * An abstract keyword entry handler.\n */\nclass EntryHandlerKeyword {\n constructor(keyword) {\n this.keyword = keyword;\n }\n isPropertyHandler() {\n return false;\n }\n isStackProcessor() {\n return true;\n }\n async validate(parsingContext, util, keys, depth, inProperty) {\n return false;\n }\n async test(parsingContext, util, key, keys, depth) {\n return key === this.keyword;\n }\n}\nexports.EntryHandlerKeyword = EntryHandlerKeyword;\n//# sourceMappingURL=EntryHandlerKeyword.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeywordContext = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst EntryHandlerKeyword_1 = require(\"./EntryHandlerKeyword\");\n/**\n * Handles @context entries.\n */\nclass EntryHandlerKeywordContext extends EntryHandlerKeyword_1.EntryHandlerKeyword {\n constructor() {\n super('@context');\n }\n isStackProcessor() {\n return false;\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n // Error if an out-of-order context was found when support is not enabled.\n if (parsingContext.streamingProfile\n && (parsingContext.processingStack[depth]\n || parsingContext.processingType[depth]\n || parsingContext.idStack[depth] !== undefined)) {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded('Found an out-of-order context, while streaming is enabled.' +\n '(disable `streamingProfile`)', jsonld_context_parser_1.ERROR_CODES.INVALID_STREAMING_KEY_ORDER));\n }\n // Find the parent context to inherit from.\n // We actually request a context for the current depth (with fallback to parent)\n // because we want to take into account any property-scoped contexts that are defined for this depth.\n const parentContext = parsingContext.getContext(keys);\n // Set the context for this scope\n const context = parsingContext.parseContext(value, (await parentContext).getContextRaw());\n parsingContext.contextTree.setContext(keys.slice(0, -1), context);\n parsingContext.emitContext(value);\n await parsingContext.validateContext(await context);\n }\n}\nexports.EntryHandlerKeywordContext = EntryHandlerKeywordContext;\n//# sourceMappingURL=EntryHandlerKeywordContext.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeywordGraph = void 0;\nconst EntryHandlerKeyword_1 = require(\"./EntryHandlerKeyword\");\n/**\n * Handles @graph entries.\n */\nclass EntryHandlerKeywordGraph extends EntryHandlerKeyword_1.EntryHandlerKeyword {\n constructor() {\n super('@graph');\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n // The current identifier identifies a graph for the deeper level.\n parsingContext.graphStack[depth + 1] = true;\n }\n}\nexports.EntryHandlerKeywordGraph = EntryHandlerKeywordGraph;\n//# sourceMappingURL=EntryHandlerKeywordGraph.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeywordId = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst EntryHandlerKeyword_1 = require(\"./EntryHandlerKeyword\");\n/**\n * Handles @id entries.\n */\nclass EntryHandlerKeywordId extends EntryHandlerKeyword_1.EntryHandlerKeyword {\n constructor() {\n super('@id');\n }\n isStackProcessor() {\n return false;\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n if (typeof value !== 'string') {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found illegal @id '${value}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_ID_VALUE));\n }\n // Determine the canonical place for this id.\n // For example, @nest parents should be ignored.\n const depthProperties = await util.getPropertiesDepth(keys, depth);\n // Error if an @id for this node already existed.\n if (parsingContext.idStack[depthProperties] !== undefined) {\n if (parsingContext.idStack[depthProperties][0].listHead) {\n // Error if an @list was already defined for this node\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found illegal neighbouring entries next to @list for key: '${keys[depth - 1]}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT));\n }\n else {\n // Otherwise, the previous id was just because of an @id entry.\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found duplicate @ids '${parsingContext\n .idStack[depthProperties][0].value}' and '${value}'`, jsonld_context_parser_1.ERROR_CODES.COLLIDING_KEYWORDS));\n }\n }\n // Save our @id on the stack\n parsingContext.idStack[depthProperties] = util.nullableTermToArray(await util.resourceToTerm(await parsingContext.getContext(keys), value));\n }\n}\nexports.EntryHandlerKeywordId = EntryHandlerKeywordId;\n//# sourceMappingURL=EntryHandlerKeywordId.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeywordIncluded = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst EntryHandlerKeyword_1 = require(\"./EntryHandlerKeyword\");\n/**\n * Handles @included entries.\n */\nclass EntryHandlerKeywordIncluded extends EntryHandlerKeyword_1.EntryHandlerKeyword {\n constructor() {\n super('@included');\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n if (typeof value !== 'object') {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found illegal @included '${value}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_INCLUDED_VALUE));\n }\n const valueUnliased = await util.unaliasKeywords(value, keys, depth, await parsingContext.getContext(keys));\n if ('@value' in valueUnliased) {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found an illegal @included @value node '${JSON.stringify(value)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_INCLUDED_VALUE));\n }\n if ('@list' in valueUnliased) {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found an illegal @included @list node '${JSON.stringify(value)}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_INCLUDED_VALUE));\n }\n parsingContext.emittedStack[depth] = false;\n }\n}\nexports.EntryHandlerKeywordIncluded = EntryHandlerKeywordIncluded;\n//# sourceMappingURL=EntryHandlerKeywordIncluded.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeywordNest = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst EntryHandlerKeyword_1 = require(\"./EntryHandlerKeyword\");\n/**\n * Handles @nest entries.\n */\nclass EntryHandlerKeywordNest extends EntryHandlerKeyword_1.EntryHandlerKeyword {\n constructor() {\n super('@nest');\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n if (typeof value !== 'object') {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found invalid @nest entry for '${key}': '${value}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_NEST_VALUE));\n }\n if ('@value' in await util.unaliasKeywords(value, keys, depth, await parsingContext.getContext(keys))) {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found an invalid @value node for '${key}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_NEST_VALUE));\n }\n parsingContext.emittedStack[depth] = false;\n }\n}\nexports.EntryHandlerKeywordNest = EntryHandlerKeywordNest;\n//# sourceMappingURL=EntryHandlerKeywordNest.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeywordType = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\nconst Util_1 = require(\"../../Util\");\nconst EntryHandlerPredicate_1 = require(\"../EntryHandlerPredicate\");\nconst EntryHandlerKeyword_1 = require(\"./EntryHandlerKeyword\");\n/**\n * Handles @graph entries.\n */\nclass EntryHandlerKeywordType extends EntryHandlerKeyword_1.EntryHandlerKeyword {\n constructor() {\n super('@type');\n }\n isStackProcessor() {\n return false;\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n const keyOriginal = keys[depth];\n // The current identifier identifies an rdf:type predicate.\n // But we only emit it once the node closes,\n // as it's possible that the @type is used to identify the datatype of a literal, which we ignore here.\n const context = await parsingContext.getContext(keys);\n const predicate = util.rdfType;\n const reverse = Util_1.Util.isPropertyReverse(context, keyOriginal, await util.unaliasKeywordParent(keys, depth));\n // Handle multiple values if the value is an array\n const elements = Array.isArray(value) ? value : [value];\n for (const element of elements) {\n if (typeof element !== 'string') {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Found illegal @type '${element}'`, jsonld_context_parser_1.ERROR_CODES.INVALID_TYPE_VALUE));\n }\n const type = util.createVocabOrBaseTerm(context, element);\n if (type) {\n await EntryHandlerPredicate_1.EntryHandlerPredicate.handlePredicateObject(parsingContext, util, keys, depth, predicate, type, reverse);\n }\n }\n // Collect type-scoped contexts if they exist\n let scopedContext = Promise.resolve(context);\n let hasTypedScopedContext = false;\n for (const element of elements.sort()) { // Spec requires lexicographical ordering\n const typeContext = Util_1.Util.getContextValue(context, '@context', element, null);\n if (typeContext) {\n hasTypedScopedContext = true;\n scopedContext = scopedContext.then((c) => parsingContext.parseContext(typeContext, c.getContextRaw()));\n }\n }\n // Error if an out-of-order type-scoped context was found when support is not enabled.\n if (parsingContext.streamingProfile\n && (hasTypedScopedContext || !parsingContext.streamingProfileAllowOutOfOrderPlainType)\n && (parsingContext.processingStack[depth] || parsingContext.idStack[depth])) {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded('Found an out-of-order type-scoped context, while streaming is enabled.' +\n '(disable `streamingProfile`)', jsonld_context_parser_1.ERROR_CODES.INVALID_STREAMING_KEY_ORDER));\n }\n // If at least least one type-scoped context applies, set them in the tree.\n if (hasTypedScopedContext) {\n // Do not propagate by default\n scopedContext = scopedContext.then((c) => {\n if (!('@propagate' in c.getContextRaw())) {\n c.getContextRaw()['@propagate'] = false;\n }\n // Set the original context at this depth as a fallback\n // This is needed when a context was already defined at the given depth,\n // and this context needs to remain accessible from child nodes when propagation is disabled.\n if (c.getContextRaw()['@propagate'] === false) {\n c.getContextRaw()['@__propagateFallback'] = context.getContextRaw();\n }\n return c;\n });\n // Set the new context in the context tree\n parsingContext.contextTree.setContext(keys.slice(0, keys.length - 1), scopedContext);\n }\n // Flag that type has been processed at this depth\n parsingContext.processingType[depth] = true;\n }\n}\nexports.EntryHandlerKeywordType = EntryHandlerKeywordType;\n//# sourceMappingURL=EntryHandlerKeywordType.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeywordUnknownFallback = void 0;\nconst jsonld_context_parser_1 = require(\"jsonld-context-parser\");\n/**\n * A catch-all for keywords, that will either emit an error or ignore,\n * depending on whether or not the `strictValues` property is set.\n */\nclass EntryHandlerKeywordUnknownFallback {\n isPropertyHandler() {\n return false;\n }\n isStackProcessor() {\n return true;\n }\n async validate(parsingContext, util, keys, depth, inProperty) {\n const key = await util.unaliasKeyword(keys[depth], keys, depth);\n if (jsonld_context_parser_1.Util.isPotentialKeyword(key)) {\n // Don't emit anything inside free-floating lists\n if (!inProperty) {\n if (key === '@list') {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n async test(parsingContext, util, key, keys, depth) {\n return jsonld_context_parser_1.Util.isPotentialKeyword(key);\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n const keywordType = EntryHandlerKeywordUnknownFallback.VALID_KEYWORDS_TYPES[key];\n if (keywordType !== undefined) {\n if (keywordType && typeof value !== keywordType.type) {\n parsingContext.emitError(new jsonld_context_parser_1.ErrorCoded(`Invalid value type for '${key}' with value '${value}'`, keywordType.errorCode));\n }\n }\n else if (parsingContext.strictValues) {\n parsingContext.emitError(new Error(`Unknown keyword '${key}' with value '${value}'`));\n }\n parsingContext.emittedStack[depth] = false;\n }\n}\nexports.EntryHandlerKeywordUnknownFallback = EntryHandlerKeywordUnknownFallback;\nEntryHandlerKeywordUnknownFallback.VALID_KEYWORDS_TYPES = {\n '@index': { type: 'string', errorCode: jsonld_context_parser_1.ERROR_CODES.INVALID_INDEX_VALUE },\n '@list': null,\n '@reverse': { type: 'object', errorCode: jsonld_context_parser_1.ERROR_CODES.INVALID_REVERSE_VALUE },\n '@set': null,\n '@value': null,\n};\n//# sourceMappingURL=EntryHandlerKeywordUnknownFallback.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EntryHandlerKeywordValue = void 0;\nconst EntryHandlerKeyword_1 = require(\"./EntryHandlerKeyword\");\n/**\n * Handles @value entries.\n */\nclass EntryHandlerKeywordValue extends EntryHandlerKeyword_1.EntryHandlerKeyword {\n constructor() {\n super('@value');\n }\n async validate(parsingContext, util, keys, depth, inProperty) {\n // If this is @value, mark it so in the stack so that no deeper handling of nodes occurs.\n const key = keys[depth];\n if (key && !parsingContext.literalStack[depth] && await this.test(parsingContext, util, key, keys, depth)) {\n parsingContext.literalStack[depth] = true;\n }\n return super.validate(parsingContext, util, keys, depth, inProperty);\n }\n async test(parsingContext, util, key, keys, depth) {\n return await util.unaliasKeyword(keys[depth], keys.slice(0, keys.length - 1), depth - 1, true) === '@value';\n }\n async handle(parsingContext, util, key, keys, value, depth) {\n // If the value is valid, indicate that we are processing a literal.\n // The actual value will be determined at the parent level when the @value is part of an object,\n // because we may want to take into account additional entries such as @language.\n // See {@link Util.valueToTerm}\n // Indicate that we are processing a literal, and that no later predicates should be parsed at this depth.\n parsingContext.literalStack[depth] = true;\n // Void any buffers that we may have accumulated up until now\n delete parsingContext.unidentifiedValuesBuffer[depth];\n delete parsingContext.unidentifiedGraphsBuffer[depth];\n // Indicate that we have not emitted at this depth\n parsingContext.emittedStack[depth] = false;\n }\n}\nexports.EntryHandlerKeywordValue = EntryHandlerKeywordValue;\n//# sourceMappingURL=EntryHandlerKeywordValue.js.map","/*global Buffer*/\n// Named constants with unique integer values\nvar C = {};\n// Tokens\nvar LEFT_BRACE = C.LEFT_BRACE = 0x1;\nvar RIGHT_BRACE = C.RIGHT_BRACE = 0x2;\nvar LEFT_BRACKET = C.LEFT_BRACKET = 0x3;\nvar RIGHT_BRACKET = C.RIGHT_BRACKET = 0x4;\nvar COLON = C.COLON = 0x5;\nvar COMMA = C.COMMA = 0x6;\nvar TRUE = C.TRUE = 0x7;\nvar FALSE = C.FALSE = 0x8;\nvar NULL = C.NULL = 0x9;\nvar STRING = C.STRING = 0xa;\nvar NUMBER = C.NUMBER = 0xb;\n// Tokenizer States\nvar START = C.START = 0x11;\nvar STOP = C.STOP = 0x12;\nvar TRUE1 = C.TRUE1 = 0x21;\nvar TRUE2 = C.TRUE2 = 0x22;\nvar TRUE3 = C.TRUE3 = 0x23;\nvar FALSE1 = C.FALSE1 = 0x31;\nvar FALSE2 = C.FALSE2 = 0x32;\nvar FALSE3 = C.FALSE3 = 0x33;\nvar FALSE4 = C.FALSE4 = 0x34;\nvar NULL1 = C.NULL1 = 0x41;\nvar NULL2 = C.NULL2 = 0x42;\nvar NULL3 = C.NULL3 = 0x43;\nvar NUMBER1 = C.NUMBER1 = 0x51;\nvar NUMBER3 = C.NUMBER3 = 0x53;\nvar STRING1 = C.STRING1 = 0x61;\nvar STRING2 = C.STRING2 = 0x62;\nvar STRING3 = C.STRING3 = 0x63;\nvar STRING4 = C.STRING4 = 0x64;\nvar STRING5 = C.STRING5 = 0x65;\nvar STRING6 = C.STRING6 = 0x66;\n// Parser States\nvar VALUE = C.VALUE = 0x71;\nvar KEY = C.KEY = 0x72;\n// Parser Modes\nvar OBJECT = C.OBJECT = 0x81;\nvar ARRAY = C.ARRAY = 0x82;\n// Character constants\nvar BACK_SLASH = \"\\\\\".charCodeAt(0);\nvar FORWARD_SLASH = \"\\/\".charCodeAt(0);\nvar BACKSPACE = \"\\b\".charCodeAt(0);\nvar FORM_FEED = \"\\f\".charCodeAt(0);\nvar NEWLINE = \"\\n\".charCodeAt(0);\nvar CARRIAGE_RETURN = \"\\r\".charCodeAt(0);\nvar TAB = \"\\t\".charCodeAt(0);\n\nvar STRING_BUFFER_SIZE = 64 * 1024;\n\nfunction Parser() {\n this.tState = START;\n this.value = undefined;\n\n this.string = undefined; // string data\n this.stringBuffer = Buffer.alloc ? Buffer.alloc(STRING_BUFFER_SIZE) : new Buffer(STRING_BUFFER_SIZE);\n this.stringBufferOffset = 0;\n this.unicode = undefined; // unicode escapes\n this.highSurrogate = undefined;\n\n this.key = undefined;\n this.mode = undefined;\n this.stack = [];\n this.state = VALUE;\n this.bytes_remaining = 0; // number of bytes remaining in multi byte utf8 char to read after split boundary\n this.bytes_in_sequence = 0; // bytes in multi byte utf8 char to read\n this.temp_buffs = { \"2\": new Buffer(2), \"3\": new Buffer(3), \"4\": new Buffer(4) }; // for rebuilding chars split before boundary is reached\n\n // Stream offset\n this.offset = -1;\n}\n\n// Slow code to string converter (only used when throwing syntax errors)\nParser.toknam = function (code) {\n var keys = Object.keys(C);\n for (var i = 0, l = keys.length; i < l; i++) {\n var key = keys[i];\n if (C[key] === code) { return key; }\n }\n return code && (\"0x\" + code.toString(16));\n};\n\nvar proto = Parser.prototype;\nproto.onError = function (err) { throw err; };\nproto.charError = function (buffer, i) {\n this.tState = STOP;\n this.onError(new Error(\"Unexpected \" + JSON.stringify(String.fromCharCode(buffer[i])) + \" at position \" + i + \" in state \" + Parser.toknam(this.tState)));\n};\nproto.appendStringChar = function (char) {\n if (this.stringBufferOffset >= STRING_BUFFER_SIZE) {\n this.string += this.stringBuffer.toString('utf8');\n this.stringBufferOffset = 0;\n }\n\n this.stringBuffer[this.stringBufferOffset++] = char;\n};\nproto.appendStringBuf = function (buf, start, end) {\n var size = buf.length;\n if (typeof start === 'number') {\n if (typeof end === 'number') {\n if (end < 0) {\n // adding a negative end decreeses the size\n size = buf.length - start + end;\n } else {\n size = end - start;\n }\n } else {\n size = buf.length - start;\n }\n }\n\n if (size < 0) {\n size = 0;\n }\n\n if (this.stringBufferOffset + size > STRING_BUFFER_SIZE) {\n this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset);\n this.stringBufferOffset = 0;\n }\n\n buf.copy(this.stringBuffer, this.stringBufferOffset, start, end);\n this.stringBufferOffset += size;\n};\nproto.write = function (buffer) {\n if (typeof buffer === \"string\") buffer = new Buffer(buffer);\n var n;\n for (var i = 0, l = buffer.length; i < l; i++) {\n if (this.tState === START){\n n = buffer[i];\n this.offset++;\n if(n === 0x7b){ this.onToken(LEFT_BRACE, \"{\"); // {\n }else if(n === 0x7d){ this.onToken(RIGHT_BRACE, \"}\"); // }\n }else if(n === 0x5b){ this.onToken(LEFT_BRACKET, \"[\"); // [\n }else if(n === 0x5d){ this.onToken(RIGHT_BRACKET, \"]\"); // ]\n }else if(n === 0x3a){ this.onToken(COLON, \":\"); // :\n }else if(n === 0x2c){ this.onToken(COMMA, \",\"); // ,\n }else if(n === 0x74){ this.tState = TRUE1; // t\n }else if(n === 0x66){ this.tState = FALSE1; // f\n }else if(n === 0x6e){ this.tState = NULL1; // n\n }else if(n === 0x22){ // \"\n this.string = \"\";\n this.stringBufferOffset = 0;\n this.tState = STRING1;\n }else if(n === 0x2d){ this.string = \"-\"; this.tState = NUMBER1; // -\n }else{\n if (n >= 0x30 && n < 0x40) { // 1-9\n this.string = String.fromCharCode(n); this.tState = NUMBER3;\n } else if (n === 0x20 || n === 0x09 || n === 0x0a || n === 0x0d) {\n // whitespace\n } else {\n return this.charError(buffer, i);\n }\n }\n }else if (this.tState === STRING1){ // After open quote\n n = buffer[i]; // get current byte from buffer\n // check for carry over of a multi byte char split between data chunks\n // & fill temp buffer it with start of this data chunk up to the boundary limit set in the last iteration\n if (this.bytes_remaining > 0) {\n for (var j = 0; j < this.bytes_remaining; j++) {\n this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence - this.bytes_remaining + j] = buffer[j];\n }\n\n this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]);\n this.bytes_in_sequence = this.bytes_remaining = 0;\n i = i + j - 1;\n } else if (this.bytes_remaining === 0 && n >= 128) { // else if no remainder bytes carried over, parse multi byte (>=128) chars one at a time\n if (n <= 193 || n > 244) {\n return this.onError(new Error(\"Invalid UTF-8 character at position \" + i + \" in state \" + Parser.toknam(this.tState)));\n }\n if ((n >= 194) && (n <= 223)) this.bytes_in_sequence = 2;\n if ((n >= 224) && (n <= 239)) this.bytes_in_sequence = 3;\n if ((n >= 240) && (n <= 244)) this.bytes_in_sequence = 4;\n if ((this.bytes_in_sequence + i) > buffer.length) { // if bytes needed to complete char fall outside buffer length, we have a boundary split\n for (var k = 0; k <= (buffer.length - 1 - i); k++) {\n this.temp_buffs[this.bytes_in_sequence][k] = buffer[i + k]; // fill temp buffer of correct size with bytes available in this chunk\n }\n this.bytes_remaining = (i + this.bytes_in_sequence) - buffer.length;\n i = buffer.length - 1;\n } else {\n this.appendStringBuf(buffer, i, i + this.bytes_in_sequence);\n i = i + this.bytes_in_sequence - 1;\n }\n } else if (n === 0x22) {\n this.tState = START;\n this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset);\n this.stringBufferOffset = 0;\n this.onToken(STRING, this.string);\n this.offset += Buffer.byteLength(this.string, 'utf8') + 1;\n this.string = undefined;\n }\n else if (n === 0x5c) {\n this.tState = STRING2;\n }\n else if (n >= 0x20) { this.appendStringChar(n); }\n else {\n return this.charError(buffer, i);\n }\n }else if (this.tState === STRING2){ // After backslash\n n = buffer[i];\n if(n === 0x22){ this.appendStringChar(n); this.tState = STRING1;\n }else if(n === 0x5c){ this.appendStringChar(BACK_SLASH); this.tState = STRING1;\n }else if(n === 0x2f){ this.appendStringChar(FORWARD_SLASH); this.tState = STRING1;\n }else if(n === 0x62){ this.appendStringChar(BACKSPACE); this.tState = STRING1;\n }else if(n === 0x66){ this.appendStringChar(FORM_FEED); this.tState = STRING1;\n }else if(n === 0x6e){ this.appendStringChar(NEWLINE); this.tState = STRING1;\n }else if(n === 0x72){ this.appendStringChar(CARRIAGE_RETURN); this.tState = STRING1;\n }else if(n === 0x74){ this.appendStringChar(TAB); this.tState = STRING1;\n }else if(n === 0x75){ this.unicode = \"\"; this.tState = STRING3;\n }else{\n return this.charError(buffer, i);\n }\n }else if (this.tState === STRING3 || this.tState === STRING4 || this.tState === STRING5 || this.tState === STRING6){ // unicode hex codes\n n = buffer[i];\n // 0-9 A-F a-f\n if ((n >= 0x30 && n < 0x40) || (n > 0x40 && n <= 0x46) || (n > 0x60 && n <= 0x66)) {\n this.unicode += String.fromCharCode(n);\n if (this.tState++ === STRING6) {\n var intVal = parseInt(this.unicode, 16);\n this.unicode = undefined;\n if (this.highSurrogate !== undefined && intVal >= 0xDC00 && intVal < (0xDFFF + 1)) { //<56320,57343> - lowSurrogate\n this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate, intVal)));\n this.highSurrogate = undefined;\n } else if (this.highSurrogate === undefined && intVal >= 0xD800 && intVal < (0xDBFF + 1)) { //<55296,56319> - highSurrogate\n this.highSurrogate = intVal;\n } else {\n if (this.highSurrogate !== undefined) {\n this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate)));\n this.highSurrogate = undefined;\n }\n this.appendStringBuf(new Buffer(String.fromCharCode(intVal)));\n }\n this.tState = STRING1;\n }\n } else {\n return this.charError(buffer, i);\n }\n } else if (this.tState === NUMBER1 || this.tState === NUMBER3) {\n n = buffer[i];\n\n switch (n) {\n case 0x30: // 0\n case 0x31: // 1\n case 0x32: // 2\n case 0x33: // 3\n case 0x34: // 4\n case 0x35: // 5\n case 0x36: // 6\n case 0x37: // 7\n case 0x38: // 8\n case 0x39: // 9\n case 0x2e: // .\n case 0x65: // e\n case 0x45: // E\n case 0x2b: // +\n case 0x2d: // -\n this.string += String.fromCharCode(n);\n this.tState = NUMBER3;\n break;\n default:\n this.tState = START;\n var result = Number(this.string);\n\n if (isNaN(result)){\n return this.charError(buffer, i);\n }\n\n if ((this.string.match(/[0-9]+/) == this.string) && (result.toString() != this.string)) {\n // Long string of digits which is an ID string and not valid and/or safe JavaScript integer Number\n this.onToken(STRING, this.string);\n } else {\n this.onToken(NUMBER, result);\n }\n\n this.offset += this.string.length - 1;\n this.string = undefined;\n i--;\n break;\n }\n }else if (this.tState === TRUE1){ // r\n if (buffer[i] === 0x72) { this.tState = TRUE2; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === TRUE2){ // u\n if (buffer[i] === 0x75) { this.tState = TRUE3; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === TRUE3){ // e\n if (buffer[i] === 0x65) { this.tState = START; this.onToken(TRUE, true); this.offset+= 3; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === FALSE1){ // a\n if (buffer[i] === 0x61) { this.tState = FALSE2; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === FALSE2){ // l\n if (buffer[i] === 0x6c) { this.tState = FALSE3; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === FALSE3){ // s\n if (buffer[i] === 0x73) { this.tState = FALSE4; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === FALSE4){ // e\n if (buffer[i] === 0x65) { this.tState = START; this.onToken(FALSE, false); this.offset+= 4; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === NULL1){ // u\n if (buffer[i] === 0x75) { this.tState = NULL2; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === NULL2){ // l\n if (buffer[i] === 0x6c) { this.tState = NULL3; }\n else { return this.charError(buffer, i); }\n }else if (this.tState === NULL3){ // l\n if (buffer[i] === 0x6c) { this.tState = START; this.onToken(NULL, null); this.offset += 3; }\n else { return this.charError(buffer, i); }\n }\n }\n};\nproto.onToken = function (token, value) {\n // Override this to get events\n};\n\nproto.parseError = function (token, value) {\n this.tState = STOP;\n this.onError(new Error(\"Unexpected \" + Parser.toknam(token) + (value ? (\"(\" + JSON.stringify(value) + \")\") : \"\") + \" in state \" + Parser.toknam(this.state)));\n};\nproto.push = function () {\n this.stack.push({value: this.value, key: this.key, mode: this.mode});\n};\nproto.pop = function () {\n var value = this.value;\n var parent = this.stack.pop();\n this.value = parent.value;\n this.key = parent.key;\n this.mode = parent.mode;\n this.emit(value);\n if (!this.mode) { this.state = VALUE; }\n};\nproto.emit = function (value) {\n if (this.mode) { this.state = COMMA; }\n this.onValue(value);\n};\nproto.onValue = function (value) {\n // Override me\n};\nproto.onToken = function (token, value) {\n if(this.state === VALUE){\n if(token === STRING || token === NUMBER || token === TRUE || token === FALSE || token === NULL){\n if (this.value) {\n this.value[this.key] = value;\n }\n this.emit(value);\n }else if(token === LEFT_BRACE){\n this.push();\n if (this.value) {\n this.value = this.value[this.key] = {};\n } else {\n this.value = {};\n }\n this.key = undefined;\n this.state = KEY;\n this.mode = OBJECT;\n }else if(token === LEFT_BRACKET){\n this.push();\n if (this.value) {\n this.value = this.value[this.key] = [];\n } else {\n this.value = [];\n }\n this.key = 0;\n this.mode = ARRAY;\n this.state = VALUE;\n }else if(token === RIGHT_BRACE){\n if (this.mode === OBJECT) {\n this.pop();\n } else {\n return this.parseError(token, value);\n }\n }else if(token === RIGHT_BRACKET){\n if (this.mode === ARRAY) {\n this.pop();\n } else {\n return this.parseError(token, value);\n }\n }else{\n return this.parseError(token, value);\n }\n }else if(this.state === KEY){\n if (token === STRING) {\n this.key = value;\n this.state = COLON;\n } else if (token === RIGHT_BRACE) {\n this.pop();\n } else {\n return this.parseError(token, value);\n }\n }else if(this.state === COLON){\n if (token === COLON) { this.state = VALUE; }\n else { return this.parseError(token, value); }\n }else if(this.state === COMMA){\n if (token === COMMA) {\n if (this.mode === ARRAY) { this.key++; this.state = VALUE; }\n else if (this.mode === OBJECT) { this.state = KEY; }\n\n } else if (token === RIGHT_BRACKET && this.mode === ARRAY || token === RIGHT_BRACE && this.mode === OBJECT) {\n this.pop();\n } else {\n return this.parseError(token, value);\n }\n }else{\n return this.parseError(token, value);\n }\n};\n\nParser.C = C;\n\nmodule.exports = Parser;\n"],"names":["Sink","ParserStream","Parser","constructor","options","super","module","exports","rdf","JsonLdParser","Transform","relativeIriProtocol","termCleanup","factory","term","termType","value","startsWith","namedNode","slice","length","quadCleanup","cleanup","quad","subject","predicate","object","graph","input","baseIRI","context","parser","dataFactory","streamingProfile","pipe","transform","objectMode","encoding","callback","on","Object","entries","forEach","prefix","iri","emit","err","destroy","DataFactory","BlankNode","id","this","nextId","equals","other","prototype","DefaultGraph","fromTermRaw","Literal","NamedNode","Quad","Variable","blankNode","literal","languageOrDatatype","indexOf","variable","defaultGraph","defaultGraphInstance","triple","fromTerm","original","call","fromQuad","language","datatype","stringDatatype","langStringDatatype","name","Error","Impl","import","output","assign","readable","self","support","searchParams","iterable","Symbol","blob","Blob","e","formData","arrayBuffer","isDataView","obj","DataView","isPrototypeOf","viewClasses","isArrayBufferView","ArrayBuffer","isView","toString","normalizeName","String","test","TypeError","toLowerCase","normalizeValue","iteratorFor","items","iterator","next","shift","done","undefined","Headers","headers","map","append","Array","isArray","header","getOwnPropertyNames","consumed","body","bodyUsed","Promise","reject","fileReaderReady","reader","resolve","onload","result","onerror","error","readBlobAsArrayBuffer","FileReader","promise","readAsArrayBuffer","readBlobAsText","readAsText","readArrayBufferAsText","buf","view","Uint8Array","chars","i","fromCharCode","join","bufferClone","byteLength","set","buffer","Body","_initBody","_bodyInit","_bodyText","_bodyBlob","FormData","_bodyFormData","URLSearchParams","_bodyArrayBuffer","get","type","rejected","then","text","decode","json","JSON","parse","oldValue","has","hasOwnProperty","thisArg","keys","push","values","methods","normalizeMethod","method","upcased","toUpperCase","Request","url","credentials","mode","signal","referrer","form","trim","split","bytes","replace","decodeURIComponent","parseHeaders","rawHeaders","preProcessedHeaders","line","parts","key","Response","bodyInit","status","ok","statusText","clone","response","redirectStatuses","redirect","RangeError","location","DOMException","message","stack","create","fetch","init","request","aborted","xhr","XMLHttpRequest","abortXhr","abort","getAllResponseHeaders","responseURL","responseText","ontimeout","onabort","open","withCredentials","responseType","setRequestHeader","addEventListener","onreadystatechange","readyState","removeEventListener","send","polyfill","defineProperty","__createBinding","o","m","k","k2","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","__exportStar","p","ContextParser","relative_to_absolute_iri_1","ErrorCoded_1","FetchDocumentLoader_1","JsonLdContextNormalized_1","Util_1","documentLoader","FetchDocumentLoader","documentCache","validateContext","skipValidation","expandContentTypeToBase","remoteContextsDepthLimit","redirectSchemaOrgHttps","validateLanguage","strictRange","errorCode","ErrorCoded","stringify","Util","REGEX_LANGUAGE_TAG","validateDirection","strictValues","ERROR_CODES","INVALID_BASE_DIRECTION","REGEX_DIRECTION_TAG","idifyReverseTerms","isValidKeyword","INVALID_IRI_MAPPING","isPotentialKeyword","expandPrefixedTerms","contextRaw","getContextRaw","EXPAND_KEYS_BLACKLIST","isReservedInternalKeyword","keyValue","ALIAS_DOMAIN_BLACKLIST","KEYWORD_REDEFINITION","ALIAS_RANGE_BLACKLIST","getContextValueId","INVALID_KEYWORD_ALIAS","INVALID_TERM_DEFINITION","isPrefixValue","changed","expandTerm","canAddIdEntry","isValidIri","newId","expandedType","normalize","processingMode","normalizeLanguageTags","lowercase","containersToHash","newValue","containerValue","applyScopedProtected","expandOptions","isTermProtected","isSimpleTermDefinitionPrefix","validateKeywordRedefinitions","contextBefore","contextAfter","deepEqual","PROTECTED_TERM_REDEFINITION","validate","valueType","substr","INVALID_VOCAB_MAPPING","INVALID_BASE_IRI","INVALID_DEFAULT_LANGUAGE","INVALID_VERSION_VALUE","INVALID_CONTEXT_ENTRY","INVALID_PROPAGATE_VALUE","getPrefix","CYCLIC_IRI_MAPPING","isValidIriWeak","JsonLdContextNormalized","isCompactIri","objectKey","objectValue","INVALID_TYPE_MAPPING","INVALID_REVERSE_PROPERTY","CONTAINERS_1_0","INVALID_CONTAINER_MAPPING","CONTAINERS","INVALID_LANGUAGE_MAPPING","INVALID_PREFIX_VALUE","INVALID_NEST_VALUE","applyBaseEntry","inheritFromParent","parentContext","external","normalizeContextIri","contextIri","_a","parseInnerContexts","ignoreScopedContexts","ignoreProtection","ignoreRemoteScopedContexts","INVALID_SCOPED_CONTEXT","minimalProcessing","internalOptions","DEFAULT_PROCESSING_MODE","remoteContexts","CONTEXT_OVERFLOW","hasProtectedTerms","INVALID_CONTEXT_NULLIFICATION","overriddenLoad","getOverriddenLoad","parsedStringContext","load","contextIris","contexts","all","subContext","reducedContexts","reduce","accContextPromise","contextEntry","accContext","importContext","INVALID_IMPORT_VALUE","loadImportContext","defaultExpandOptions","newContext","overlappingKeys","newContextWrapped","INVALID_LOCAL_CONTEXT","cached","document","LOADING_REMOTE_CONTEXT_FAILED","INVALID_REMOTE_CONTEXT","RECURSIVE_CONTEXT_INCLUSION","importContextIri","code","http_link_header_1","fetcher","accept","mediaType","colonPos","alternateUrl","linkHeader","link","rel","uri","LOADING_DOCUMENT_FAILED","expandVocab","contextValue","validIriMapping","vocab","vocabRelative","base","potentialKeyword","contextPrefixValue","allowPrefixForcing","allowVocabRelativeToBase","compactIri","shortestPrefixing","suffix","allowPrefixNonGenDelims","separatorPos","charAt","isPrefixIriEndingWithGenDelim","keyword","KEYWORD_REGEX","prefixIri","ENDS_WITH_GEN_DELIM","Boolean","IRI_REGEX","IRI_REGEX_WEAK","VALID_KEYWORDS","object1","object2","objKeys1","objKeys2","every","value1","value2","ContextTree","subTrees","getContext","head","tail","subTree","depth","setContext","removeContext","path","jsonld_context_parser_1","stream_1","EntryHandlerArrayValue_1","EntryHandlerContainer_1","EntryHandlerInvalidFallback_1","EntryHandlerPredicate_1","EntryHandlerKeywordContext_1","EntryHandlerKeywordGraph_1","EntryHandlerKeywordId_1","EntryHandlerKeywordIncluded_1","EntryHandlerKeywordNest_1","EntryHandlerKeywordType_1","EntryHandlerKeywordUnknownFallback_1","EntryHandlerKeywordValue_1","ParsingContext_1","readableObjectMode","parsingContext","ParsingContext","util","jsonParser","contextJobs","typeJobs","contextAwaitingJobs","lastDepth","lastKeys","lastOnValueJob","attachJsonParserListeners","fromHttpResponse","endsWith","MULTIPLE_CONTEXT_LINK_HEADERS","ignoreMissingContextLinkHeader","contentType","match","exec","stream","PassThrough","parsed","data","_transform","chunk","write","newOnValueJob","lastDepthCheck","flushStacks","listPointer","listPointerStack","rdfRest","rdfNil","getDefaultGraph","listId","listHead","idStack","listRootDepth","splice","EntryHandlerContainer","isBufferableContainerHandler","pendingContainerFlushBuffers","flushBuffer","unaliasKeyword","parentKey","unaliasKeywordParent","emittedStack","handleKey","INVALID_REVERSE_PROPERTY_MAP","inProperty","validationStack","property","Math","max","validationResult","validateKey","valid","isLiteral","entryHandler","ENTRY_HANDLERS","testResult","handle","isStackProcessor","processingStack","validateValueIndexes","unaliasedKeywordCacheStack","processingType","graphStack","graphContainerTermStack","jsonLiteralStack","literalStack","subjects","valueBuffer","unidentifiedValuesBuffer","depthOffsetGraph","getDepthOffsetGraph","graphs","getGraphContainerValue","bufferedValue","reverse","emitQuad","subGraphBuffer","getUnidentifiedGraphBufferSafe","graphBuffer","unidentifiedGraphsBuffer","topLevelProperties","isPropertyHandler","onValue","fill","v","isParsingContextInner","valueJobCb","contextTree","jobs","job","executeBufferedJobs","onError","applicableTypeJobs","applicableTypeJobIds","typeJob","isPrefixArray","sortedTypeJobs","sort","job1","job2","sortedApplicableTypeJobIds","jobId","EntryHandlerArrayValue","EntryHandlerKeywordContext","EntryHandlerKeywordId","EntryHandlerKeywordIncluded","EntryHandlerKeywordGraph","EntryHandlerKeywordNest","EntryHandlerKeywordType","EntryHandlerKeywordValue","EntryHandlerKeywordUnknownFallback","EntryHandlerPredicate","EntryHandlerInvalidFallback","ContextTree_1","JsonLdParser_1","contextParser","skipContextValidation","produceGeneralizedRdf","allowSubjectList","rdfDirection","streamingProfileAllowOutOfOrderPlainType","activeProcessingMode","parseFloat","rootContext","parseContext","activeVersion","PROCESSING_MODE_CONFLICT","offset","keysOriginal","contextData","getContextPropagationAware","contextKeyEntry","scopedContext","propagate","originalDepth","hasApplicablePropertyScopedContext","lastKey","lastKeyValue","handlePendingContainerFlushBuffers","pendingFlushBuffer","emitError","emitContext","getUnidentifiedValueBufferSafe","getExpandOptions","EXPAND_OPTIONS","shiftStack","depthOffset","deeperIdStack","rdf_data_factory_1","canonicalizeJson","rdfFirst","RDF","rdfType","rdfJson","getContextValue","contextKey","fallback","entry","getContextValueContainer","getContextValueType","getContextValueLanguage","getContextValueDirection","isContextValueReverse","getContextValueIndex","isPropertyReverse","needle","haystack","indexHashes","index","existingIndexValue","CONFLICTING_INDEXES","valueToTerm","valueToJsonString","getContextSelfOrPropertyScoped","unaliasKeywords","val","valueLanguage","valueDirection","valueIndex","subValue","INVALID_VALUE_OBJECT","INVALID_VALUE_OBJECT_VALUE","INVALID_INDEX_VALUE","INVALID_LANGUAGE_TAGGED_VALUE","INVALID_LANGUAGE_TAGGED_STRING","nullableTermToArray","createLanguageDirectionLiteral","INVALID_TYPED_VALUE","typeTerm","createVocabOrBaseTerm","INVALID_SET_OR_LIST_OBJECT","listValue","graphContainerEntries","resourceToTerm","stringValueToTerm","XSD_BOOLEAN","XSD_INTEGER","XSD_DOUBLE","predicateToTerm","expanded","intToString","Number","isFinite","isInteger","toExponential","defaultDatatype","contextType","contextLanguage","contextDirection","direction","valueNode","disableCache","cachedUnaliasedKeyword","unliased","hash","newHash","containers","getContainerHandler","isComplexGraphContainer","validateReverseSubject","INVALID_REVERSE_PROPERTY_VALUE","depthContainer","graphContainerIndex","getContainerGraphIndex","graphId","keyUnaliased","getContainerKey","getPropertiesDepth","lastValidDepth","XSD","ContainerHandlerIdentifier","canCombineWithGraph","maybeId","ids","some","ContainerHandlerIndex","graphContainer","indexKey","indexPropertyRaw","indexProperty","indexValues","indexValue","handlePredicateObject","ContainerHandlerLanguage","INVALID_LANGUAGE_MAP_VALUE","ContainerHandlerType","containerTypeType","entryHasIdentifier","keyOriginal","listRootKey","keyOption","handleListElement","valueOriginal","listRootKeys","newLinkTerm","linkTerm","ContainerHandlerIdentifier_1","ContainerHandlerIndex_1","ContainerHandlerLanguage_1","ContainerHandlerType_1","isSimpleGraphContainer","checkGraphContainer","containersSelf","containersParent","containerHandleName","CONTAINER_HANDLERS","handler","containerName","depthProperties","depthPropertiesGraph","atGraph","objects","listValueContainer","EntryHandlerKeyword","EntryHandlerKeyword_1","INVALID_STREAMING_KEY_ORDER","INVALID_ID_VALUE","COLLIDING_KEYWORDS","INVALID_INCLUDED_VALUE","valueUnliased","elements","element","INVALID_TYPE_VALUE","hasTypedScopedContext","typeContext","c","keywordType","VALID_KEYWORDS_TYPES","INVALID_REVERSE_VALUE","C","LEFT_BRACE","RIGHT_BRACE","LEFT_BRACKET","RIGHT_BRACKET","COLON","COMMA","TRUE","FALSE","NULL","STRING","NUMBER","START","STOP","TRUE1","TRUE2","TRUE3","FALSE1","FALSE2","FALSE3","FALSE4","NULL1","NULL2","NULL3","NUMBER1","NUMBER3","STRING1","STRING2","STRING3","STRING4","STRING5","STRING6","VALUE","KEY","OBJECT","ARRAY","BACK_SLASH","charCodeAt","FORWARD_SLASH","BACKSPACE","FORM_FEED","NEWLINE","CARRIAGE_RETURN","TAB","STRING_BUFFER_SIZE","tState","string","stringBuffer","Buffer","alloc","stringBufferOffset","unicode","highSurrogate","state","bytes_remaining","bytes_in_sequence","temp_buffs","toknam","l","proto","charError","appendStringChar","char","appendStringBuf","start","end","size","copy","n","onToken","j","intVal","parseInt","isNaN","token","parseError","pop","parent"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/13.6c9a5db4.js b/dist/js/13.06cd2e07.js similarity index 99% rename from dist/js/13.6c9a5db4.js rename to dist/js/13.06cd2e07.js index 20f0389..91687fb 100644 --- a/dist/js/13.6c9a5db4.js +++ b/dist/js/13.06cd2e07.js @@ -23,4 +23,4 @@ Object.defineProperty(e,"__esModule",{value:!0}),e.CHAR="-퟿-�𐀀-􏿿", * @copyright Louis-Dominique Dubeau */ Object.defineProperty(e,"__esModule",{value:!0}),e.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",e.NC_NAME_CHAR="-"+e.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",e.NC_NAME_START_CHAR_RE=new RegExp("^["+e.NC_NAME_START_CHAR+"]$","u"),e.NC_NAME_CHAR_RE=new RegExp("^["+e.NC_NAME_CHAR+"]$","u"),e.NC_NAME_RE=new RegExp("^["+e.NC_NAME_START_CHAR+"]["+e.NC_NAME_CHAR+"]*$","u"),e.isNCNameStartChar=i,e.isNCNameChar=s},17013:function(t,e,i){i.r(e);var s=i(24353);class a extends s.RdfXmlParser{constructor({factory:t,...e}={}){super({...e,dataFactory:t})}}e["default"]=a}}]); -//# sourceMappingURL=13.6c9a5db4.js.map \ No newline at end of file +//# sourceMappingURL=13.06cd2e07.js.map \ No newline at end of file diff --git a/dist/js/13.6c9a5db4.js.map b/dist/js/13.06cd2e07.js.map similarity index 99% rename from dist/js/13.6c9a5db4.js.map rename to dist/js/13.06cd2e07.js.map index 6b499b2..cb170f8 100644 --- a/dist/js/13.6c9a5db4.js.map +++ b/dist/js/13.06cd2e07.js.map @@ -1 +1 @@ -{"version":3,"file":"js/13.6c9a5db4.js","mappings":"iIACAA,OAAOC,eAAeC,EAAS,aAAc,CAAEC,OAAO,IACtDD,EAAQE,YAAcF,EAAQG,YAAS,EACvC,MAAMC,EAAM,EAAQ,OACdC,EAAM,EAAQ,OACdC,EAAQ,EAAQ,OACtB,IAAIC,EAAMH,EAAIG,IACVC,EAAWJ,EAAIK,OACfC,EAAkBN,EAAIM,gBACtBC,EAAaP,EAAIO,WACjBC,EAASR,EAAIQ,OACbC,EAAUT,EAAIS,QACdC,EAAWT,EAAII,OACfM,EAAoBT,EAAMS,kBAC1BC,EAAeV,EAAMU,aACrBC,EAAaX,EAAMW,WACvB,MAAMC,EAA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AAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAWA,GAAK,MAC9B,CASA,SAASjF,EAAaiF,GAClB,OAAOlF,EAAkBkF,IACd,KAANA,GACS,KAANA,GACCA,GAAK,IAAQA,GAAK,IACb,MAANA,GACCA,GAAK,KAAUA,GAAK,KACpBA,GAAK,MAAUA,GAAK,IACjC;;;;;;;;AAtDAnG,OAAOC,eAAeC,EAAS,aAAc,CAAEC,OAAO,IAKtDD,EAAQyjB,mBAAqB,gDAC7BzjB,EAAQ0jB,aAAe,IAAM1jB,EAAQyjB,mBAAqB,cAI1DzjB,EAAQ2jB,sBAAwB,IAAIpB,OAAO,KAAOviB,EAAQyjB,mBAAqB,KAAM,KACrFzjB,EAAQ4jB,gBAAkB,IAAIrB,OAAO,KAAOviB,EAAQ0jB,aAAe,KAAM,KACzE1jB,EAAQiB,WAAa,IAAIshB,OAAO,KAAOviB,EAAQyjB,mBAAqB,KAAOzjB,EAAQ0jB,aAAe,MAAO,KA0BzG1jB,EAAQe,kBAAoBA,EAiB5Bf,EAAQgB,aAAeA,C,8CC9DvB,MAAM6iB,UAA2B,EAAAzN,aAC7B,WAAA5N,EAAY,QAAEsb,KAAYlN,GAAS,CAAC,GAChCV,MAAM,IAAKU,EAAMK,YAAa6M,GAClC,EAEJ,c","sources":["webpack://mobilitydcatap-ui/./node_modules/@rubensworks/saxes/saxes.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/rdfxml-streaming-parser/index.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/rdfxml-streaming-parser/lib/ParseError.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/rdfxml-streaming-parser/lib/RdfXmlParser.js","webpack://mobilitydcatap-ui/./node_modules/rdf-data-factory/index.js","webpack://mobilitydcatap-ui/./node_modules/rdf-data-factory/lib/BlankNode.js","webpack://mobilitydcatap-ui/./node_modules/rdf-data-factory/lib/DataFactory.js","webpack://mobilitydcatap-ui/./node_modules/rdf-data-factory/lib/DefaultGraph.js","webpack://mobilitydcatap-ui/./node_modules/rdf-data-factory/lib/Literal.js","webpack://mobilitydcatap-ui/./node_modules/rdf-data-factory/lib/NamedNode.js","webpack://mobilitydcatap-ui/./node_modules/rdf-data-factory/lib/Quad.js","webpack://mobilitydcatap-ui/./node_modules/rdf-data-factory/lib/Variable.js","webpack://mobilitydcatap-ui/./node_modules/relative-to-absolute-iri/index.js","webpack://mobilitydcatap-ui/./node_modules/relative-to-absolute-iri/lib/Resolve.js","webpack://mobilitydcatap-ui/./node_modules/validate-iri/index.js","webpack://mobilitydcatap-ui/./node_modules/validate-iri/lib/Validate.js","webpack://mobilitydcatap-ui/./node_modules/xmlchars/xml/1.0/ed5.js","webpack://mobilitydcatap-ui/./node_modules/xmlchars/xml/1.1/ed2.js","webpack://mobilitydcatap-ui/./node_modules/xmlchars/xmlns/1.0/ed3.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/lib/CustomRdfXmlParser.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SaxesParser = exports.EVENTS = void 0;\nconst ed5 = require(\"xmlchars/xml/1.0/ed5\");\nconst ed2 = require(\"xmlchars/xml/1.1/ed2\");\nconst NSed3 = require(\"xmlchars/xmlns/1.0/ed3\");\nvar isS = ed5.isS;\nvar isChar10 = ed5.isChar;\nvar isNameStartChar = ed5.isNameStartChar;\nvar isNameChar = ed5.isNameChar;\nvar S_LIST = ed5.S_LIST;\nvar NAME_RE = ed5.NAME_RE;\nvar isChar11 = ed2.isChar;\nvar isNCNameStartChar = NSed3.isNCNameStartChar;\nvar isNCNameChar = NSed3.isNCNameChar;\nvar NC_NAME_RE = NSed3.NC_NAME_RE;\nconst XML_NAMESPACE = \"http://www.w3.org/XML/1998/namespace\";\nconst XMLNS_NAMESPACE = \"http://www.w3.org/2000/xmlns/\";\nconst rootNS = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment\n __proto__: null,\n xml: XML_NAMESPACE,\n xmlns: XMLNS_NAMESPACE,\n};\nconst XML_ENTITIES = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment\n __proto__: null,\n amp: \"&\",\n gt: \">\",\n lt: \"<\",\n quot: \"\\\"\",\n apos: \"'\",\n};\n// EOC: end-of-chunk\nconst EOC = -1;\nconst NL_LIKE = -2;\nconst S_BEGIN = 0; // Initial state.\nconst S_BEGIN_WHITESPACE = 1; // leading whitespace\nconst S_DOCTYPE = 2; // \nconst TAB = 9;\nconst NL = 0xA;\nconst CR = 0xD;\nconst SPACE = 0x20;\nconst BANG = 0x21;\nconst DQUOTE = 0x22;\nconst AMP = 0x26;\nconst SQUOTE = 0x27;\nconst MINUS = 0x2D;\nconst FORWARD_SLASH = 0x2F;\nconst SEMICOLON = 0x3B;\nconst LESS = 0x3C;\nconst EQUAL = 0x3D;\nconst GREATER = 0x3E;\nconst QUESTION = 0x3F;\nconst OPEN_BRACKET = 0x5B;\nconst CLOSE_BRACKET = 0x5D;\nconst NEL = 0x85;\nconst LS = 0x2028; // Line Separator\nconst isQuote = (c) => c === DQUOTE || c === SQUOTE;\nconst QUOTES = [DQUOTE, SQUOTE];\nconst DOCTYPE_TERMINATOR = [...QUOTES, OPEN_BRACKET, GREATER];\nconst DTD_TERMINATOR = [...QUOTES, LESS, CLOSE_BRACKET];\nconst XML_DECL_NAME_TERMINATOR = [EQUAL, QUESTION, ...S_LIST];\nconst ATTRIB_VALUE_UNQUOTED_TERMINATOR = [...S_LIST, GREATER, AMP, LESS];\nfunction nsPairCheck(parser, prefix, uri) {\n switch (prefix) {\n case \"xml\":\n if (uri !== XML_NAMESPACE) {\n parser.fail(`xml prefix must be bound to ${XML_NAMESPACE}.`);\n }\n break;\n case \"xmlns\":\n if (uri !== XMLNS_NAMESPACE) {\n parser.fail(`xmlns prefix must be bound to ${XMLNS_NAMESPACE}.`);\n }\n break;\n default:\n }\n switch (uri) {\n case XMLNS_NAMESPACE:\n parser.fail(prefix === \"\" ?\n `the default namespace may not be set to ${uri}.` :\n `may not assign a prefix (even \"xmlns\") to the URI \\\n${XMLNS_NAMESPACE}.`);\n break;\n case XML_NAMESPACE:\n switch (prefix) {\n case \"xml\":\n // Assinging the XML namespace to \"xml\" is fine.\n break;\n case \"\":\n parser.fail(`the default namespace may not be set to ${uri}.`);\n break;\n default:\n parser.fail(\"may not assign the xml namespace to another prefix.\");\n }\n break;\n default:\n }\n}\nfunction nsMappingCheck(parser, mapping) {\n for (const local of Object.keys(mapping)) {\n nsPairCheck(parser, local, mapping[local]);\n }\n}\nconst isNCName = (name) => NC_NAME_RE.test(name);\nconst isName = (name) => NAME_RE.test(name);\nconst FORBIDDEN_START = 0;\nconst FORBIDDEN_BRACKET = 1;\nconst FORBIDDEN_BRACKET_BRACKET = 2;\n/**\n * The list of supported events.\n */\nexports.EVENTS = [\n \"xmldecl\",\n \"text\",\n \"processinginstruction\",\n \"doctype\",\n \"comment\",\n \"opentagstart\",\n \"attribute\",\n \"opentag\",\n \"closetag\",\n \"cdata\",\n \"error\",\n \"end\",\n \"ready\",\n];\nconst EVENT_NAME_TO_HANDLER_NAME = {\n xmldecl: \"xmldeclHandler\",\n text: \"textHandler\",\n processinginstruction: \"piHandler\",\n doctype: \"doctypeHandler\",\n comment: \"commentHandler\",\n opentagstart: \"openTagStartHandler\",\n attribute: \"attributeHandler\",\n opentag: \"openTagHandler\",\n closetag: \"closeTagHandler\",\n cdata: \"cdataHandler\",\n error: \"errorHandler\",\n end: \"endHandler\",\n ready: \"readyHandler\",\n};\n// eslint-disable-next-line @typescript-eslint/ban-types\nclass SaxesParser {\n /**\n * Indicates whether or not the parser is closed. If ``true``, wait for\n * the ``ready`` event to write again.\n */\n get closed() {\n return this._closed;\n }\n /**\n * @param opt The parser options.\n */\n constructor(opt) {\n this.opt = opt !== null && opt !== void 0 ? opt : {};\n this.fragmentOpt = !!this.opt.fragment;\n const xmlnsOpt = this.xmlnsOpt = !!this.opt.xmlns;\n this.trackPosition = this.opt.position !== false;\n this.fileName = this.opt.fileName;\n if (xmlnsOpt) {\n // This is the function we use to perform name checks on PIs and entities.\n // When namespaces are used, colons are not allowed in PI target names or\n // entity names. So the check depends on whether namespaces are used. See:\n //\n // https://www.w3.org/XML/xml-names-19990114-errata.html\n // NE08\n //\n this.nameStartCheck = isNCNameStartChar;\n this.nameCheck = isNCNameChar;\n this.isName = isNCName;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.processAttribs = this.processAttribsNS;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.pushAttrib = this.pushAttribNS;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment\n this.ns = Object.assign({ __proto__: null }, rootNS);\n const additional = this.opt.additionalNamespaces;\n if (additional != null) {\n nsMappingCheck(this, additional);\n Object.assign(this.ns, additional);\n }\n }\n else {\n this.nameStartCheck = isNameStartChar;\n this.nameCheck = isNameChar;\n this.isName = isName;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.processAttribs = this.processAttribsPlain;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.pushAttrib = this.pushAttribPlain;\n }\n //\n // The order of the members in this table needs to correspond to the state\n // numbers given to the states that correspond to the methods being recorded\n // here.\n //\n this.stateTable = [\n /* eslint-disable @typescript-eslint/unbound-method */\n this.sBegin,\n this.sBeginWhitespace,\n this.sDoctype,\n this.sDoctypeQuote,\n this.sDTD,\n this.sDTDQuoted,\n this.sDTDOpenWaka,\n this.sDTDOpenWakaBang,\n this.sDTDComment,\n this.sDTDCommentEnding,\n this.sDTDCommentEnded,\n this.sDTDPI,\n this.sDTDPIEnding,\n this.sText,\n this.sEntity,\n this.sOpenWaka,\n this.sOpenWakaBang,\n this.sComment,\n this.sCommentEnding,\n this.sCommentEnded,\n this.sCData,\n this.sCDataEnding,\n this.sCDataEnding2,\n this.sPIFirstChar,\n this.sPIRest,\n this.sPIBody,\n this.sPIEnding,\n this.sXMLDeclNameStart,\n this.sXMLDeclName,\n this.sXMLDeclEq,\n this.sXMLDeclValueStart,\n this.sXMLDeclValue,\n this.sXMLDeclSeparator,\n this.sXMLDeclEnding,\n this.sOpenTag,\n this.sOpenTagSlash,\n this.sAttrib,\n this.sAttribName,\n this.sAttribNameSawWhite,\n this.sAttribValue,\n this.sAttribValueQuoted,\n this.sAttribValueClosed,\n this.sAttribValueUnquoted,\n this.sCloseTag,\n this.sCloseTagSawWhite,\n /* eslint-enable @typescript-eslint/unbound-method */\n ];\n this._init();\n }\n _init() {\n var _a;\n this.openWakaBang = \"\";\n this.text = \"\";\n this.name = \"\";\n this.piTarget = \"\";\n this.entity = \"\";\n this.q = null;\n this.tags = [];\n this.tag = null;\n this.topNS = null;\n this.chunk = \"\";\n this.chunkPosition = 0;\n this.i = 0;\n this.prevI = 0;\n this.carriedFromPrevious = undefined;\n this.forbiddenState = FORBIDDEN_START;\n this.attribList = [];\n // The logic is organized so as to minimize the need to check\n // this.opt.fragment while parsing.\n const { fragmentOpt } = this;\n this.state = fragmentOpt ? S_TEXT : S_BEGIN;\n // We want these to be all true if we are dealing with a fragment.\n this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot =\n this.sawRoot = fragmentOpt;\n // An XML declaration is intially possible only when parsing whole\n // documents.\n this.xmlDeclPossible = !fragmentOpt;\n this.xmlDeclExpects = [\"version\"];\n this.entityReturnState = undefined;\n let { defaultXMLVersion } = this.opt;\n if (defaultXMLVersion === undefined) {\n if (this.opt.forceXMLVersion === true) {\n throw new Error(\"forceXMLVersion set but defaultXMLVersion is not set\");\n }\n defaultXMLVersion = \"1.0\";\n }\n this.setXMLVersion(defaultXMLVersion);\n this.positionAtNewLine = 0;\n this.doctype = false;\n this._closed = false;\n this.xmlDecl = {\n version: undefined,\n encoding: undefined,\n standalone: undefined,\n };\n this.line = 1;\n this.column = 0;\n this.ENTITIES = Object.create(XML_ENTITIES);\n (_a = this.readyHandler) === null || _a === void 0 ? void 0 : _a.call(this);\n }\n /**\n * The stream position the parser is currently looking at. This field is\n * zero-based.\n *\n * This field is not based on counting Unicode characters but is to be\n * interpreted as a plain index into a JavaScript string.\n */\n get position() {\n return this.chunkPosition + this.i;\n }\n /**\n * The column number of the next character to be read by the parser. *\n * This field is zero-based. (The first column in a line is 0.)\n *\n * This field reports the index at which the next character would be in the\n * line if the line were represented as a JavaScript string. Note that this\n * *can* be different to a count based on the number of *Unicode characters*\n * due to how JavaScript handles astral plane characters.\n *\n * See [[column]] for a number that corresponds to a count of Unicode\n * characters.\n */\n get columnIndex() {\n return this.position - this.positionAtNewLine;\n }\n /**\n * Set an event listener on an event. The parser supports one handler per\n * event type. If you try to set an event handler over an existing handler,\n * the old handler is silently overwritten.\n *\n * @param name The event to listen to.\n *\n * @param handler The handler to set.\n */\n on(name, handler) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n this[EVENT_NAME_TO_HANDLER_NAME[name]] = handler;\n }\n /**\n * Unset an event handler.\n *\n * @parma name The event to stop listening to.\n */\n off(name) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n this[EVENT_NAME_TO_HANDLER_NAME[name]] = undefined;\n }\n /**\n * Make an error object. The error object will have a message that contains\n * the ``fileName`` option passed at the creation of the parser. If position\n * tracking was turned on, it will also have line and column number\n * information.\n *\n * @param message The message describing the error to report.\n *\n * @returns An error object with a properly formatted message.\n */\n makeError(message) {\n var _a;\n let msg = (_a = this.fileName) !== null && _a !== void 0 ? _a : \"\";\n if (this.trackPosition) {\n if (msg.length > 0) {\n msg += \":\";\n }\n msg += `${this.line}:${this.column}`;\n }\n if (msg.length > 0) {\n msg += \": \";\n }\n return new Error(msg + message);\n }\n /**\n * Report a parsing error. This method is made public so that client code may\n * check for issues that are outside the scope of this project and can report\n * errors.\n *\n * @param message The error to report.\n *\n * @returns this\n */\n fail(message) {\n const err = this.makeError(message);\n const handler = this.errorHandler;\n if (handler === undefined) {\n throw err;\n }\n else {\n handler(err);\n }\n return this;\n }\n /**\n * Write a XML data to the parser.\n *\n * @param chunk The XML data to write.\n *\n * @returns this\n */\n // We do need object for the type here. Yes, it often causes problems\n // but not in this case.\n write(chunk) {\n if (this.closed) {\n return this.fail(\"cannot write after close; assign an onready handler.\");\n }\n let end = false;\n if (chunk === null) {\n // We cannot return immediately because carriedFromPrevious may need\n // processing.\n end = true;\n chunk = \"\";\n }\n else if (typeof chunk === \"object\") {\n chunk = chunk.toString();\n }\n // We checked if performing a pre-decomposition of the string into an array\n // of single complete characters (``Array.from(chunk)``) would be faster\n // than the current repeated calls to ``charCodeAt``. As of August 2018, it\n // isn't. (There may be Node-specific code that would perform faster than\n // ``Array.from`` but don't want to be dependent on Node.)\n if (this.carriedFromPrevious !== undefined) {\n // The previous chunk had char we must carry over.\n chunk = `${this.carriedFromPrevious}${chunk}`;\n this.carriedFromPrevious = undefined;\n }\n let limit = chunk.length;\n const lastCode = chunk.charCodeAt(limit - 1);\n if (!end &&\n // A trailing CR or surrogate must be carried over to the next\n // chunk.\n (lastCode === CR || (lastCode >= 0xD800 && lastCode <= 0xDBFF))) {\n // The chunk ends with a character that must be carried over. We cannot\n // know how to handle it until we get the next chunk or the end of the\n // stream. So save it for later.\n this.carriedFromPrevious = chunk[limit - 1];\n limit--;\n chunk = chunk.slice(0, limit);\n }\n const { stateTable } = this;\n this.chunk = chunk;\n this.i = 0;\n while (this.i < limit) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument\n stateTable[this.state].call(this);\n }\n this.chunkPosition += limit;\n return end ? this.end() : this;\n }\n /**\n * Close the current stream. Perform final well-formedness checks and reset\n * the parser tstate.\n *\n * @returns this\n */\n close() {\n return this.write(null);\n }\n /**\n * Get a single code point out of the current chunk. This updates the current\n * position if we do position tracking.\n *\n * This is the algorithm to use for XML 1.0.\n *\n * @returns The character read.\n */\n getCode10() {\n const { chunk, i } = this;\n this.prevI = i;\n // Yes, we do this instead of doing this.i++. Doing it this way, we do not\n // read this.i again, which is a bit faster.\n this.i = i + 1;\n if (i >= chunk.length) {\n return EOC;\n }\n // Using charCodeAt and handling the surrogates ourselves is faster\n // than using codePointAt.\n const code = chunk.charCodeAt(i);\n this.column++;\n if (code < 0xD800) {\n if (code >= SPACE || code === TAB) {\n return code;\n }\n switch (code) {\n case NL:\n this.line++;\n this.column = 0;\n this.positionAtNewLine = this.position;\n return NL;\n case CR:\n // We may get NaN if we read past the end of the chunk, which is fine.\n if (chunk.charCodeAt(i + 1) === NL) {\n // A \\r\\n sequence is converted to \\n so we have to skip over the\n // next character. We already know it has a size of 1 so ++ is fine\n // here.\n this.i = i + 2;\n }\n // Otherwise, a \\r is just converted to \\n, so we don't have to skip\n // ahead.\n // In either case, \\r becomes \\n.\n this.line++;\n this.column = 0;\n this.positionAtNewLine = this.position;\n return NL_LIKE;\n default:\n // If we get here, then code < SPACE and it is not NL CR or TAB.\n this.fail(\"disallowed character.\");\n return code;\n }\n }\n if (code > 0xDBFF) {\n // This is a specialized version of isChar10 that takes into account\n // that in this context code > 0xDBFF and code <= 0xFFFF. So it does not\n // test cases that don't need testing.\n if (!(code >= 0xE000 && code <= 0xFFFD)) {\n this.fail(\"disallowed character.\");\n }\n return code;\n }\n const final = 0x10000 + ((code - 0xD800) * 0x400) +\n (chunk.charCodeAt(i + 1) - 0xDC00);\n this.i = i + 2;\n // This is a specialized version of isChar10 that takes into account that in\n // this context necessarily final >= 0x10000.\n if (final > 0x10FFFF) {\n this.fail(\"disallowed character.\");\n }\n return final;\n }\n /**\n * Get a single code point out of the current chunk. This updates the current\n * position if we do position tracking.\n *\n * This is the algorithm to use for XML 1.1.\n *\n * @returns {number} The character read.\n */\n getCode11() {\n const { chunk, i } = this;\n this.prevI = i;\n // Yes, we do this instead of doing this.i++. Doing it this way, we do not\n // read this.i again, which is a bit faster.\n this.i = i + 1;\n if (i >= chunk.length) {\n return EOC;\n }\n // Using charCodeAt and handling the surrogates ourselves is faster\n // than using codePointAt.\n const code = chunk.charCodeAt(i);\n this.column++;\n if (code < 0xD800) {\n if ((code > 0x1F && code < 0x7F) || (code > 0x9F && code !== LS) ||\n code === TAB) {\n return code;\n }\n switch (code) {\n case NL: // 0xA\n this.line++;\n this.column = 0;\n this.positionAtNewLine = this.position;\n return NL;\n case CR: { // 0xD\n // We may get NaN if we read past the end of the chunk, which is\n // fine.\n const next = chunk.charCodeAt(i + 1);\n if (next === NL || next === NEL) {\n // A CR NL or CR NEL sequence is converted to NL so we have to skip\n // over the next character. We already know it has a size of 1.\n this.i = i + 2;\n }\n // Otherwise, a CR is just converted to NL, no skip.\n }\n /* yes, fall through */\n case NEL: // 0x85\n case LS: // Ox2028\n this.line++;\n this.column = 0;\n this.positionAtNewLine = this.position;\n return NL_LIKE;\n default:\n this.fail(\"disallowed character.\");\n return code;\n }\n }\n if (code > 0xDBFF) {\n // This is a specialized version of isCharAndNotRestricted that takes into\n // account that in this context code > 0xDBFF and code <= 0xFFFF. So it\n // does not test cases that don't need testing.\n if (!(code >= 0xE000 && code <= 0xFFFD)) {\n this.fail(\"disallowed character.\");\n }\n return code;\n }\n const final = 0x10000 + ((code - 0xD800) * 0x400) +\n (chunk.charCodeAt(i + 1) - 0xDC00);\n this.i = i + 2;\n // This is a specialized version of isCharAndNotRestricted that takes into\n // account that in this context necessarily final >= 0x10000.\n if (final > 0x10FFFF) {\n this.fail(\"disallowed character.\");\n }\n return final;\n }\n /**\n * Like ``getCode`` but with the return value normalized so that ``NL`` is\n * returned for ``NL_LIKE``.\n */\n getCodeNorm() {\n const c = this.getCode();\n return c === NL_LIKE ? NL : c;\n }\n unget() {\n this.i = this.prevI;\n this.column--;\n }\n /**\n * Capture characters into a buffer until encountering one of a set of\n * characters.\n *\n * @param chars An array of codepoints. Encountering a character in the array\n * ends the capture. (``chars`` may safely contain ``NL``.)\n *\n * @return The character code that made the capture end, or ``EOC`` if we hit\n * the end of the chunk. The return value cannot be NL_LIKE: NL is returned\n * instead.\n */\n captureTo(chars) {\n let { i: start } = this;\n const { chunk } = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const c = this.getCode();\n const isNLLike = c === NL_LIKE;\n const final = isNLLike ? NL : c;\n if (final === EOC || chars.includes(final)) {\n this.text += chunk.slice(start, this.prevI);\n return final;\n }\n if (isNLLike) {\n this.text += `${chunk.slice(start, this.prevI)}\\n`;\n start = this.i;\n }\n }\n }\n /**\n * Capture characters into a buffer until encountering a character.\n *\n * @param char The codepoint that ends the capture. **NOTE ``char`` MAY NOT\n * CONTAIN ``NL``.** Passing ``NL`` will result in buggy behavior.\n *\n * @return ``true`` if we ran into the character. Otherwise, we ran into the\n * end of the current chunk.\n */\n captureToChar(char) {\n let { i: start } = this;\n const { chunk } = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n let c = this.getCode();\n switch (c) {\n case NL_LIKE:\n this.text += `${chunk.slice(start, this.prevI)}\\n`;\n start = this.i;\n c = NL;\n break;\n case EOC:\n this.text += chunk.slice(start);\n return false;\n default:\n }\n if (c === char) {\n this.text += chunk.slice(start, this.prevI);\n return true;\n }\n }\n }\n /**\n * Capture characters that satisfy ``isNameChar`` into the ``name`` field of\n * this parser.\n *\n * @return The character code that made the test fail, or ``EOC`` if we hit\n * the end of the chunk. The return value cannot be NL_LIKE: NL is returned\n * instead.\n */\n captureNameChars() {\n const { chunk, i: start } = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const c = this.getCode();\n if (c === EOC) {\n this.name += chunk.slice(start);\n return EOC;\n }\n // NL is not a name char so we don't have to test specifically for it.\n if (!isNameChar(c)) {\n this.name += chunk.slice(start, this.prevI);\n return c === NL_LIKE ? NL : c;\n }\n }\n }\n /**\n * Skip white spaces.\n *\n * @return The character that ended the skip, or ``EOC`` if we hit\n * the end of the chunk. The return value cannot be NL_LIKE: NL is returned\n * instead.\n */\n skipSpaces() {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const c = this.getCodeNorm();\n if (c === EOC || !isS(c)) {\n return c;\n }\n }\n }\n setXMLVersion(version) {\n this.currentXMLVersion = version;\n /* eslint-disable @typescript-eslint/unbound-method */\n if (version === \"1.0\") {\n this.isChar = isChar10;\n this.getCode = this.getCode10;\n }\n else {\n this.isChar = isChar11;\n this.getCode = this.getCode11;\n }\n /* eslint-enable @typescript-eslint/unbound-method */\n }\n // STATE ENGINE METHODS\n // This needs to be a state separate from S_BEGIN_WHITESPACE because we want\n // to be sure never to come back to this state later.\n sBegin() {\n // We are essentially peeking at the first character of the chunk. Since\n // S_BEGIN can be in effect only when we start working on the first chunk,\n // the index at which we must look is necessarily 0. Note also that the\n // following test does not depend on decoding surrogates.\n // If the initial character is 0xFEFF, ignore it.\n if (this.chunk.charCodeAt(0) === 0xFEFF) {\n this.i++;\n this.column++;\n }\n this.state = S_BEGIN_WHITESPACE;\n }\n sBeginWhitespace() {\n // We need to know whether we've encountered spaces or not because as soon\n // as we run into a space, an XML declaration is no longer possible. Rather\n // than slow down skipSpaces even in places where we don't care whether it\n // skipped anything or not, we check whether prevI is equal to the value of\n // i from before we skip spaces.\n const iBefore = this.i;\n const c = this.skipSpaces();\n if (this.prevI !== iBefore) {\n this.xmlDeclPossible = false;\n }\n switch (c) {\n case LESS:\n this.state = S_OPEN_WAKA;\n // We could naively call closeText but in this state, it is not normal\n // to have text be filled with any data.\n if (this.text.length !== 0) {\n throw new Error(\"no-empty text at start\");\n }\n break;\n case EOC:\n break;\n default:\n this.unget();\n this.state = S_TEXT;\n this.xmlDeclPossible = false;\n }\n }\n sDoctype() {\n var _a;\n const c = this.captureTo(DOCTYPE_TERMINATOR);\n switch (c) {\n case GREATER: {\n (_a = this.doctypeHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);\n this.text = \"\";\n this.state = S_TEXT;\n this.doctype = true; // just remember that we saw it.\n break;\n }\n case EOC:\n break;\n default:\n this.text += String.fromCodePoint(c);\n if (c === OPEN_BRACKET) {\n this.state = S_DTD;\n }\n else if (isQuote(c)) {\n this.state = S_DOCTYPE_QUOTE;\n this.q = c;\n }\n }\n }\n sDoctypeQuote() {\n const q = this.q;\n if (this.captureToChar(q)) {\n this.text += String.fromCodePoint(q);\n this.q = null;\n this.state = S_DOCTYPE;\n }\n }\n sDTD() {\n const c = this.captureTo(DTD_TERMINATOR);\n if (c === EOC) {\n return;\n }\n this.text += String.fromCodePoint(c);\n if (c === CLOSE_BRACKET) {\n this.state = S_DOCTYPE;\n }\n else if (c === LESS) {\n this.state = S_DTD_OPEN_WAKA;\n }\n else if (isQuote(c)) {\n this.state = S_DTD_QUOTED;\n this.q = c;\n }\n }\n sDTDQuoted() {\n const q = this.q;\n if (this.captureToChar(q)) {\n this.text += String.fromCodePoint(q);\n this.state = S_DTD;\n this.q = null;\n }\n }\n sDTDOpenWaka() {\n const c = this.getCodeNorm();\n this.text += String.fromCodePoint(c);\n switch (c) {\n case BANG:\n this.state = S_DTD_OPEN_WAKA_BANG;\n this.openWakaBang = \"\";\n break;\n case QUESTION:\n this.state = S_DTD_PI;\n break;\n default:\n this.state = S_DTD;\n }\n }\n sDTDOpenWakaBang() {\n const char = String.fromCodePoint(this.getCodeNorm());\n const owb = this.openWakaBang += char;\n this.text += char;\n if (owb !== \"-\") {\n this.state = owb === \"--\" ? S_DTD_COMMENT : S_DTD;\n this.openWakaBang = \"\";\n }\n }\n sDTDComment() {\n if (this.captureToChar(MINUS)) {\n this.text += \"-\";\n this.state = S_DTD_COMMENT_ENDING;\n }\n }\n sDTDCommentEnding() {\n const c = this.getCodeNorm();\n this.text += String.fromCodePoint(c);\n this.state = c === MINUS ? S_DTD_COMMENT_ENDED : S_DTD_COMMENT;\n }\n sDTDCommentEnded() {\n const c = this.getCodeNorm();\n this.text += String.fromCodePoint(c);\n if (c === GREATER) {\n this.state = S_DTD;\n }\n else {\n this.fail(\"malformed comment.\");\n // will be recorded as\n // a comment of \" blah -- bloo \"\n this.state = S_DTD_COMMENT;\n }\n }\n sDTDPI() {\n if (this.captureToChar(QUESTION)) {\n this.text += \"?\";\n this.state = S_DTD_PI_ENDING;\n }\n }\n sDTDPIEnding() {\n const c = this.getCodeNorm();\n this.text += String.fromCodePoint(c);\n if (c === GREATER) {\n this.state = S_DTD;\n }\n }\n sText() {\n //\n // We did try a version of saxes where the S_TEXT state was split in two\n // states: one for text inside the root element, and one for text\n // outside. This was avoiding having to test this.tags.length to decide\n // what implementation to actually use.\n //\n // Peformance testing on gigabyte-size files did not show any advantage to\n // using the two states solution instead of the current one. Conversely, it\n // made the code a bit more complicated elsewhere. For instance, a comment\n // can appear before the root element so when a comment ended it was\n // necessary to determine whether to return to the S_TEXT state or to the\n // new text-outside-root state.\n //\n if (this.tags.length !== 0) {\n this.handleTextInRoot();\n }\n else {\n this.handleTextOutsideRoot();\n }\n }\n sEntity() {\n // This is essentially a specialized version of captureToChar(SEMICOLON...)\n let { i: start } = this;\n const { chunk } = this;\n // eslint-disable-next-line no-labels, no-restricted-syntax\n loop: \n // eslint-disable-next-line no-constant-condition\n while (true) {\n switch (this.getCode()) {\n case NL_LIKE:\n this.entity += `${chunk.slice(start, this.prevI)}\\n`;\n start = this.i;\n break;\n case SEMICOLON: {\n const { entityReturnState } = this;\n const entity = this.entity + chunk.slice(start, this.prevI);\n this.state = entityReturnState;\n let parsed;\n if (entity === \"\") {\n this.fail(\"empty entity name.\");\n parsed = \"&;\";\n }\n else {\n parsed = this.parseEntity(entity);\n this.entity = \"\";\n }\n if (entityReturnState !== S_TEXT || this.textHandler !== undefined) {\n this.text += parsed;\n }\n // eslint-disable-next-line no-labels\n break loop;\n }\n case EOC:\n this.entity += chunk.slice(start);\n // eslint-disable-next-line no-labels\n break loop;\n default:\n }\n }\n }\n sOpenWaka() {\n // Reminder: a state handler is called with at least one character\n // available in the current chunk. So the first call to get code inside of\n // a state handler cannot return ``EOC``. That's why we don't test\n // for it.\n const c = this.getCode();\n // either a /, ?, !, or text is coming next.\n if (isNameStartChar(c)) {\n this.state = S_OPEN_TAG;\n this.unget();\n this.xmlDeclPossible = false;\n }\n else {\n switch (c) {\n case FORWARD_SLASH:\n this.state = S_CLOSE_TAG;\n this.xmlDeclPossible = false;\n break;\n case BANG:\n this.state = S_OPEN_WAKA_BANG;\n this.openWakaBang = \"\";\n this.xmlDeclPossible = false;\n break;\n case QUESTION:\n this.state = S_PI_FIRST_CHAR;\n break;\n default:\n this.fail(\"disallowed character in tag name\");\n this.state = S_TEXT;\n this.xmlDeclPossible = false;\n }\n }\n }\n sOpenWakaBang() {\n this.openWakaBang += String.fromCodePoint(this.getCodeNorm());\n switch (this.openWakaBang) {\n case \"[CDATA[\":\n if (!this.sawRoot && !this.reportedTextBeforeRoot) {\n this.fail(\"text data outside of root node.\");\n this.reportedTextBeforeRoot = true;\n }\n if (this.closedRoot && !this.reportedTextAfterRoot) {\n this.fail(\"text data outside of root node.\");\n this.reportedTextAfterRoot = true;\n }\n this.state = S_CDATA;\n this.openWakaBang = \"\";\n break;\n case \"--\":\n this.state = S_COMMENT;\n this.openWakaBang = \"\";\n break;\n case \"DOCTYPE\":\n this.state = S_DOCTYPE;\n if (this.doctype || this.sawRoot) {\n this.fail(\"inappropriately located doctype declaration.\");\n }\n this.openWakaBang = \"\";\n break;\n default:\n // 7 happens to be the maximum length of the string that can possibly\n // match one of the cases above.\n if (this.openWakaBang.length >= 7) {\n this.fail(\"incorrect syntax.\");\n }\n }\n }\n sComment() {\n if (this.captureToChar(MINUS)) {\n this.state = S_COMMENT_ENDING;\n }\n }\n sCommentEnding() {\n var _a;\n const c = this.getCodeNorm();\n if (c === MINUS) {\n this.state = S_COMMENT_ENDED;\n (_a = this.commentHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);\n this.text = \"\";\n }\n else {\n this.text += `-${String.fromCodePoint(c)}`;\n this.state = S_COMMENT;\n }\n }\n sCommentEnded() {\n const c = this.getCodeNorm();\n if (c !== GREATER) {\n this.fail(\"malformed comment.\");\n // will be recorded as\n // a comment of \" blah -- bloo \"\n this.text += `--${String.fromCodePoint(c)}`;\n this.state = S_COMMENT;\n }\n else {\n this.state = S_TEXT;\n }\n }\n sCData() {\n if (this.captureToChar(CLOSE_BRACKET)) {\n this.state = S_CDATA_ENDING;\n }\n }\n sCDataEnding() {\n const c = this.getCodeNorm();\n if (c === CLOSE_BRACKET) {\n this.state = S_CDATA_ENDING_2;\n }\n else {\n this.text += `]${String.fromCodePoint(c)}`;\n this.state = S_CDATA;\n }\n }\n sCDataEnding2() {\n var _a;\n const c = this.getCodeNorm();\n switch (c) {\n case GREATER: {\n (_a = this.cdataHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);\n this.text = \"\";\n this.state = S_TEXT;\n break;\n }\n case CLOSE_BRACKET:\n this.text += \"]\";\n break;\n default:\n this.text += `]]${String.fromCodePoint(c)}`;\n this.state = S_CDATA;\n }\n }\n // We need this separate state to check the first character fo the pi target\n // with this.nameStartCheck which allows less characters than this.nameCheck.\n sPIFirstChar() {\n const c = this.getCodeNorm();\n // This is first because in the case where the file is well-formed this is\n // the branch taken. We optimize for well-formedness.\n if (this.nameStartCheck(c)) {\n this.piTarget += String.fromCodePoint(c);\n this.state = S_PI_REST;\n }\n else if (c === QUESTION || isS(c)) {\n this.fail(\"processing instruction without a target.\");\n this.state = c === QUESTION ? S_PI_ENDING : S_PI_BODY;\n }\n else {\n this.fail(\"disallowed character in processing instruction name.\");\n this.piTarget += String.fromCodePoint(c);\n this.state = S_PI_REST;\n }\n }\n sPIRest() {\n // Capture characters into a piTarget while ``this.nameCheck`` run on the\n // character read returns true.\n const { chunk, i: start } = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const c = this.getCodeNorm();\n if (c === EOC) {\n this.piTarget += chunk.slice(start);\n return;\n }\n // NL cannot satisfy this.nameCheck so we don't have to test specifically\n // for it.\n if (!this.nameCheck(c)) {\n this.piTarget += chunk.slice(start, this.prevI);\n const isQuestion = c === QUESTION;\n if (isQuestion || isS(c)) {\n if (this.piTarget === \"xml\") {\n if (!this.xmlDeclPossible) {\n this.fail(\"an XML declaration must be at the start of the document.\");\n }\n this.state = isQuestion ? S_XML_DECL_ENDING : S_XML_DECL_NAME_START;\n }\n else {\n this.state = isQuestion ? S_PI_ENDING : S_PI_BODY;\n }\n }\n else {\n this.fail(\"disallowed character in processing instruction name.\");\n this.piTarget += String.fromCodePoint(c);\n }\n break;\n }\n }\n }\n sPIBody() {\n if (this.text.length === 0) {\n const c = this.getCodeNorm();\n if (c === QUESTION) {\n this.state = S_PI_ENDING;\n }\n else if (!isS(c)) {\n this.text = String.fromCodePoint(c);\n }\n }\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n else if (this.captureToChar(QUESTION)) {\n this.state = S_PI_ENDING;\n }\n }\n sPIEnding() {\n var _a;\n const c = this.getCodeNorm();\n if (c === GREATER) {\n const { piTarget } = this;\n if (piTarget.toLowerCase() === \"xml\") {\n this.fail(\"the XML declaration must appear at the start of the document.\");\n }\n (_a = this.piHandler) === null || _a === void 0 ? void 0 : _a.call(this, {\n target: piTarget,\n body: this.text,\n });\n this.piTarget = this.text = \"\";\n this.state = S_TEXT;\n }\n else if (c === QUESTION) {\n // We ran into ?? as part of a processing instruction. We initially took\n // the first ? as a sign that the PI was ending, but it is not. So we have\n // to add it to the body but we take the new ? as a sign that the PI is\n // ending.\n this.text += \"?\";\n }\n else {\n this.text += `?${String.fromCodePoint(c)}`;\n this.state = S_PI_BODY;\n }\n this.xmlDeclPossible = false;\n }\n sXMLDeclNameStart() {\n const c = this.skipSpaces();\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n // It is valid to go to S_XML_DECL_ENDING from this state.\n this.state = S_XML_DECL_ENDING;\n return;\n }\n if (c !== EOC) {\n this.state = S_XML_DECL_NAME;\n this.name = String.fromCodePoint(c);\n }\n }\n sXMLDeclName() {\n const c = this.captureTo(XML_DECL_NAME_TERMINATOR);\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n this.state = S_XML_DECL_ENDING;\n this.name += this.text;\n this.text = \"\";\n this.fail(\"XML declaration is incomplete.\");\n return;\n }\n if (!(isS(c) || c === EQUAL)) {\n return;\n }\n this.name += this.text;\n this.text = \"\";\n if (!this.xmlDeclExpects.includes(this.name)) {\n switch (this.name.length) {\n case 0:\n this.fail(\"did not expect any more name/value pairs.\");\n break;\n case 1:\n this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);\n break;\n default:\n this.fail(`expected one of ${this.xmlDeclExpects.join(\", \")}`);\n }\n }\n this.state = c === EQUAL ? S_XML_DECL_VALUE_START : S_XML_DECL_EQ;\n }\n sXMLDeclEq() {\n const c = this.getCodeNorm();\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n this.state = S_XML_DECL_ENDING;\n this.fail(\"XML declaration is incomplete.\");\n return;\n }\n if (isS(c)) {\n return;\n }\n if (c !== EQUAL) {\n this.fail(\"value required.\");\n }\n this.state = S_XML_DECL_VALUE_START;\n }\n sXMLDeclValueStart() {\n const c = this.getCodeNorm();\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n this.state = S_XML_DECL_ENDING;\n this.fail(\"XML declaration is incomplete.\");\n return;\n }\n if (isS(c)) {\n return;\n }\n if (!isQuote(c)) {\n this.fail(\"value must be quoted.\");\n this.q = SPACE;\n }\n else {\n this.q = c;\n }\n this.state = S_XML_DECL_VALUE;\n }\n sXMLDeclValue() {\n const c = this.captureTo([this.q, QUESTION]);\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n this.state = S_XML_DECL_ENDING;\n this.text = \"\";\n this.fail(\"XML declaration is incomplete.\");\n return;\n }\n if (c === EOC) {\n return;\n }\n const value = this.text;\n this.text = \"\";\n switch (this.name) {\n case \"version\": {\n this.xmlDeclExpects = [\"encoding\", \"standalone\"];\n const version = value;\n this.xmlDecl.version = version;\n // This is the test specified by XML 1.0 but it is fine for XML 1.1.\n if (!/^1\\.[0-9]+$/.test(version)) {\n this.fail(\"version number must match /^1\\\\.[0-9]+$/.\");\n }\n // When forceXMLVersion is set, the XML declaration is ignored.\n else if (!this.opt.forceXMLVersion) {\n this.setXMLVersion(version);\n }\n break;\n }\n case \"encoding\":\n if (!/^[A-Za-z][A-Za-z0-9._-]*$/.test(value)) {\n this.fail(\"encoding value must match \\\n/^[A-Za-z0-9][A-Za-z0-9._-]*$/.\");\n }\n this.xmlDeclExpects = [\"standalone\"];\n this.xmlDecl.encoding = value;\n break;\n case \"standalone\":\n if (value !== \"yes\" && value !== \"no\") {\n this.fail(\"standalone value must match \\\"yes\\\" or \\\"no\\\".\");\n }\n this.xmlDeclExpects = [];\n this.xmlDecl.standalone = value;\n break;\n default:\n // We don't need to raise an error here since we've already raised one\n // when checking what name was expected.\n }\n this.name = \"\";\n this.state = S_XML_DECL_SEPARATOR;\n }\n sXMLDeclSeparator() {\n const c = this.getCodeNorm();\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n // It is valid to go to S_XML_DECL_ENDING from this state.\n this.state = S_XML_DECL_ENDING;\n return;\n }\n if (!isS(c)) {\n this.fail(\"whitespace required.\");\n this.unget();\n }\n this.state = S_XML_DECL_NAME_START;\n }\n sXMLDeclEnding() {\n var _a;\n const c = this.getCodeNorm();\n if (c === GREATER) {\n if (this.piTarget !== \"xml\") {\n this.fail(\"processing instructions are not allowed before root.\");\n }\n else if (this.name !== \"version\" &&\n this.xmlDeclExpects.includes(\"version\")) {\n this.fail(\"XML declaration must contain a version.\");\n }\n (_a = this.xmldeclHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.xmlDecl);\n this.name = \"\";\n this.piTarget = this.text = \"\";\n this.state = S_TEXT;\n }\n else {\n // We got here because the previous character was a ?, but the question\n // mark character is not valid inside any of the XML declaration\n // name/value pairs.\n this.fail(\"The character ? is disallowed anywhere in XML declarations.\");\n }\n this.xmlDeclPossible = false;\n }\n sOpenTag() {\n var _a;\n const c = this.captureNameChars();\n if (c === EOC) {\n return;\n }\n const tag = this.tag = {\n name: this.name,\n attributes: Object.create(null),\n };\n this.name = \"\";\n if (this.xmlnsOpt) {\n this.topNS = tag.ns = Object.create(null);\n }\n (_a = this.openTagStartHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);\n this.sawRoot = true;\n if (!this.fragmentOpt && this.closedRoot) {\n this.fail(\"documents may contain only one root.\");\n }\n switch (c) {\n case GREATER:\n this.openTag();\n break;\n case FORWARD_SLASH:\n this.state = S_OPEN_TAG_SLASH;\n break;\n default:\n if (!isS(c)) {\n this.fail(\"disallowed character in tag name.\");\n }\n this.state = S_ATTRIB;\n }\n }\n sOpenTagSlash() {\n if (this.getCode() === GREATER) {\n this.openSelfClosingTag();\n }\n else {\n this.fail(\"forward-slash in opening tag not followed by >.\");\n this.state = S_ATTRIB;\n }\n }\n sAttrib() {\n const c = this.skipSpaces();\n if (c === EOC) {\n return;\n }\n if (isNameStartChar(c)) {\n this.unget();\n this.state = S_ATTRIB_NAME;\n }\n else if (c === GREATER) {\n this.openTag();\n }\n else if (c === FORWARD_SLASH) {\n this.state = S_OPEN_TAG_SLASH;\n }\n else {\n this.fail(\"disallowed character in attribute name.\");\n }\n }\n sAttribName() {\n const c = this.captureNameChars();\n if (c === EQUAL) {\n this.state = S_ATTRIB_VALUE;\n }\n else if (isS(c)) {\n this.state = S_ATTRIB_NAME_SAW_WHITE;\n }\n else if (c === GREATER) {\n this.fail(\"attribute without value.\");\n this.pushAttrib(this.name, this.name);\n this.name = this.text = \"\";\n this.openTag();\n }\n else if (c !== EOC) {\n this.fail(\"disallowed character in attribute name.\");\n }\n }\n sAttribNameSawWhite() {\n const c = this.skipSpaces();\n switch (c) {\n case EOC:\n return;\n case EQUAL:\n this.state = S_ATTRIB_VALUE;\n break;\n default:\n this.fail(\"attribute without value.\");\n // Should we do this???\n // this.tag.attributes[this.name] = \"\";\n this.text = \"\";\n this.name = \"\";\n if (c === GREATER) {\n this.openTag();\n }\n else if (isNameStartChar(c)) {\n this.unget();\n this.state = S_ATTRIB_NAME;\n }\n else {\n this.fail(\"disallowed character in attribute name.\");\n this.state = S_ATTRIB;\n }\n }\n }\n sAttribValue() {\n const c = this.getCodeNorm();\n if (isQuote(c)) {\n this.q = c;\n this.state = S_ATTRIB_VALUE_QUOTED;\n }\n else if (!isS(c)) {\n this.fail(\"unquoted attribute value.\");\n this.state = S_ATTRIB_VALUE_UNQUOTED;\n this.unget();\n }\n }\n sAttribValueQuoted() {\n // We deliberately do not use captureTo here. The specialized code we use\n // here is faster than using captureTo.\n const { q, chunk } = this;\n let { i: start } = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n switch (this.getCode()) {\n case q:\n this.pushAttrib(this.name, this.text + chunk.slice(start, this.prevI));\n this.name = this.text = \"\";\n this.q = null;\n this.state = S_ATTRIB_VALUE_CLOSED;\n return;\n case AMP:\n this.text += chunk.slice(start, this.prevI);\n this.state = S_ENTITY;\n this.entityReturnState = S_ATTRIB_VALUE_QUOTED;\n return;\n case NL:\n case NL_LIKE:\n case TAB:\n this.text += `${chunk.slice(start, this.prevI)} `;\n start = this.i;\n break;\n case LESS:\n this.text += chunk.slice(start, this.prevI);\n this.fail(\"disallowed character.\");\n return;\n case EOC:\n this.text += chunk.slice(start);\n return;\n default:\n }\n }\n }\n sAttribValueClosed() {\n const c = this.getCodeNorm();\n if (isS(c)) {\n this.state = S_ATTRIB;\n }\n else if (c === GREATER) {\n this.openTag();\n }\n else if (c === FORWARD_SLASH) {\n this.state = S_OPEN_TAG_SLASH;\n }\n else if (isNameStartChar(c)) {\n this.fail(\"no whitespace between attributes.\");\n this.unget();\n this.state = S_ATTRIB_NAME;\n }\n else {\n this.fail(\"disallowed character in attribute name.\");\n }\n }\n sAttribValueUnquoted() {\n // We don't do anything regarding EOL or space handling for unquoted\n // attributes. We already have failed by the time we get here, and the\n // contract that saxes upholds states that upon failure, it is not safe to\n // rely on the data passed to event handlers (other than\n // ``onerror``). Passing \"bad\" data is not a problem.\n const c = this.captureTo(ATTRIB_VALUE_UNQUOTED_TERMINATOR);\n switch (c) {\n case AMP:\n this.state = S_ENTITY;\n this.entityReturnState = S_ATTRIB_VALUE_UNQUOTED;\n break;\n case LESS:\n this.fail(\"disallowed character.\");\n break;\n case EOC:\n break;\n default:\n if (this.text.includes(\"]]>\")) {\n this.fail(\"the string \\\"]]>\\\" is disallowed in char data.\");\n }\n this.pushAttrib(this.name, this.text);\n this.name = this.text = \"\";\n if (c === GREATER) {\n this.openTag();\n }\n else {\n this.state = S_ATTRIB;\n }\n }\n }\n sCloseTag() {\n const c = this.captureNameChars();\n if (c === GREATER) {\n this.closeTag();\n }\n else if (isS(c)) {\n this.state = S_CLOSE_TAG_SAW_WHITE;\n }\n else if (c !== EOC) {\n this.fail(\"disallowed character in closing tag.\");\n }\n }\n sCloseTagSawWhite() {\n switch (this.skipSpaces()) {\n case GREATER:\n this.closeTag();\n break;\n case EOC:\n break;\n default:\n this.fail(\"disallowed character in closing tag.\");\n }\n }\n // END OF STATE ENGINE METHODS\n handleTextInRoot() {\n // This is essentially a specialized version of captureTo which is optimized\n // for performing the ]]> check. A previous version of this code, checked\n // ``this.text`` for the presence of ]]>. It simplified the code but was\n // very costly when character data contained a lot of entities to be parsed.\n //\n // Since we are using a specialized loop, we also keep track of the presence\n // of ]]> in text data. The sequence ]]> is forbidden to appear as-is.\n //\n let { i: start, forbiddenState } = this;\n const { chunk, textHandler: handler } = this;\n // eslint-disable-next-line no-labels, no-restricted-syntax\n scanLoop: \n // eslint-disable-next-line no-constant-condition\n while (true) {\n switch (this.getCode()) {\n case LESS: {\n this.state = S_OPEN_WAKA;\n if (handler !== undefined) {\n const { text } = this;\n const slice = chunk.slice(start, this.prevI);\n if (text.length !== 0) {\n handler(text + slice);\n this.text = \"\";\n }\n else if (slice.length !== 0) {\n handler(slice);\n }\n }\n forbiddenState = FORBIDDEN_START;\n // eslint-disable-next-line no-labels\n break scanLoop;\n }\n case AMP:\n this.state = S_ENTITY;\n this.entityReturnState = S_TEXT;\n if (handler !== undefined) {\n this.text += chunk.slice(start, this.prevI);\n }\n forbiddenState = FORBIDDEN_START;\n // eslint-disable-next-line no-labels\n break scanLoop;\n case CLOSE_BRACKET:\n switch (forbiddenState) {\n case FORBIDDEN_START:\n forbiddenState = FORBIDDEN_BRACKET;\n break;\n case FORBIDDEN_BRACKET:\n forbiddenState = FORBIDDEN_BRACKET_BRACKET;\n break;\n case FORBIDDEN_BRACKET_BRACKET:\n break;\n default:\n throw new Error(\"impossible state\");\n }\n break;\n case GREATER:\n if (forbiddenState === FORBIDDEN_BRACKET_BRACKET) {\n this.fail(\"the string \\\"]]>\\\" is disallowed in char data.\");\n }\n forbiddenState = FORBIDDEN_START;\n break;\n case NL_LIKE:\n if (handler !== undefined) {\n this.text += `${chunk.slice(start, this.prevI)}\\n`;\n }\n start = this.i;\n forbiddenState = FORBIDDEN_START;\n break;\n case EOC:\n if (handler !== undefined) {\n this.text += chunk.slice(start);\n }\n // eslint-disable-next-line no-labels\n break scanLoop;\n default:\n forbiddenState = FORBIDDEN_START;\n }\n }\n this.forbiddenState = forbiddenState;\n }\n handleTextOutsideRoot() {\n // This is essentially a specialized version of captureTo which is optimized\n // for a specialized task. We keep track of the presence of non-space\n // characters in the text since these are errors when appearing outside the\n // document root element.\n let { i: start } = this;\n const { chunk, textHandler: handler } = this;\n let nonSpace = false;\n // eslint-disable-next-line no-labels, no-restricted-syntax\n outRootLoop: \n // eslint-disable-next-line no-constant-condition\n while (true) {\n const code = this.getCode();\n switch (code) {\n case LESS: {\n this.state = S_OPEN_WAKA;\n if (handler !== undefined) {\n const { text } = this;\n const slice = chunk.slice(start, this.prevI);\n if (text.length !== 0) {\n handler(text + slice);\n this.text = \"\";\n }\n else if (slice.length !== 0) {\n handler(slice);\n }\n }\n // eslint-disable-next-line no-labels\n break outRootLoop;\n }\n case AMP:\n this.state = S_ENTITY;\n this.entityReturnState = S_TEXT;\n if (handler !== undefined) {\n this.text += chunk.slice(start, this.prevI);\n }\n nonSpace = true;\n // eslint-disable-next-line no-labels\n break outRootLoop;\n case NL_LIKE:\n if (handler !== undefined) {\n this.text += `${chunk.slice(start, this.prevI)}\\n`;\n }\n start = this.i;\n break;\n case EOC:\n if (handler !== undefined) {\n this.text += chunk.slice(start);\n }\n // eslint-disable-next-line no-labels\n break outRootLoop;\n default:\n if (!isS(code)) {\n nonSpace = true;\n }\n }\n }\n if (!nonSpace) {\n return;\n }\n // We use the reportedTextBeforeRoot and reportedTextAfterRoot flags\n // to avoid reporting errors for every single character that is out of\n // place.\n if (!this.sawRoot && !this.reportedTextBeforeRoot) {\n this.fail(\"text data outside of root node.\");\n this.reportedTextBeforeRoot = true;\n }\n if (this.closedRoot && !this.reportedTextAfterRoot) {\n this.fail(\"text data outside of root node.\");\n this.reportedTextAfterRoot = true;\n }\n }\n pushAttribNS(name, value) {\n var _a;\n const { prefix, local } = this.qname(name);\n const attr = { name, prefix, local, value };\n this.attribList.push(attr);\n (_a = this.attributeHandler) === null || _a === void 0 ? void 0 : _a.call(this, attr);\n if (prefix === \"xmlns\") {\n const trimmed = value.trim();\n if (this.currentXMLVersion === \"1.0\" && trimmed === \"\") {\n this.fail(\"invalid attempt to undefine prefix in XML 1.0\");\n }\n this.topNS[local] = trimmed;\n nsPairCheck(this, local, trimmed);\n }\n else if (name === \"xmlns\") {\n const trimmed = value.trim();\n this.topNS[\"\"] = trimmed;\n nsPairCheck(this, \"\", trimmed);\n }\n }\n pushAttribPlain(name, value) {\n var _a;\n const attr = { name, value };\n this.attribList.push(attr);\n (_a = this.attributeHandler) === null || _a === void 0 ? void 0 : _a.call(this, attr);\n }\n /**\n * End parsing. This performs final well-formedness checks and resets the\n * parser to a clean state.\n *\n * @returns this\n */\n end() {\n var _a, _b;\n if (!this.sawRoot) {\n this.fail(\"document must contain a root element.\");\n }\n const { tags } = this;\n while (tags.length > 0) {\n const tag = tags.pop();\n this.fail(`unclosed tag: ${tag.name}`);\n }\n if ((this.state !== S_BEGIN) && (this.state !== S_TEXT)) {\n this.fail(\"unexpected end.\");\n }\n const { text } = this;\n if (text.length !== 0) {\n (_a = this.textHandler) === null || _a === void 0 ? void 0 : _a.call(this, text);\n this.text = \"\";\n }\n this._closed = true;\n (_b = this.endHandler) === null || _b === void 0 ? void 0 : _b.call(this);\n this._init();\n return this;\n }\n /**\n * Resolve a namespace prefix.\n *\n * @param prefix The prefix to resolve.\n *\n * @returns The namespace URI or ``undefined`` if the prefix is not defined.\n */\n resolve(prefix) {\n var _a, _b;\n let uri = this.topNS[prefix];\n if (uri !== undefined) {\n return uri;\n }\n const { tags } = this;\n for (let index = tags.length - 1; index >= 0; index--) {\n uri = tags[index].ns[prefix];\n if (uri !== undefined) {\n return uri;\n }\n }\n uri = this.ns[prefix];\n if (uri !== undefined) {\n return uri;\n }\n return (_b = (_a = this.opt).resolvePrefix) === null || _b === void 0 ? void 0 : _b.call(_a, prefix);\n }\n /**\n * Parse a qname into its prefix and local name parts.\n *\n * @param name The name to parse\n *\n * @returns\n */\n qname(name) {\n // This is faster than using name.split(\":\").\n const colon = name.indexOf(\":\");\n if (colon === -1) {\n return { prefix: \"\", local: name };\n }\n const local = name.slice(colon + 1);\n const prefix = name.slice(0, colon);\n if (prefix === \"\" || local === \"\" || local.includes(\":\")) {\n this.fail(`malformed name: ${name}.`);\n }\n return { prefix, local };\n }\n processAttribsNS() {\n var _a;\n const { attribList } = this;\n const tag = this.tag;\n {\n // add namespace info to tag\n const { prefix, local } = this.qname(tag.name);\n tag.prefix = prefix;\n tag.local = local;\n const uri = tag.uri = (_a = this.resolve(prefix)) !== null && _a !== void 0 ? _a : \"\";\n if (prefix !== \"\") {\n if (prefix === \"xmlns\") {\n this.fail(\"tags may not have \\\"xmlns\\\" as prefix.\");\n }\n if (uri === \"\") {\n this.fail(`unbound namespace prefix: ${JSON.stringify(prefix)}.`);\n tag.uri = prefix;\n }\n }\n }\n if (attribList.length === 0) {\n return;\n }\n const { attributes } = tag;\n const seen = new Set();\n // Note: do not apply default ns to attributes:\n // http://www.w3.org/TR/REC-xml-names/#defaulting\n for (const attr of attribList) {\n const { name, prefix, local } = attr;\n let uri;\n let eqname;\n if (prefix === \"\") {\n uri = name === \"xmlns\" ? XMLNS_NAMESPACE : \"\";\n eqname = name;\n }\n else {\n uri = this.resolve(prefix);\n // if there's any attributes with an undefined namespace,\n // then fail on them now.\n if (uri === undefined) {\n this.fail(`unbound namespace prefix: ${JSON.stringify(prefix)}.`);\n uri = prefix;\n }\n eqname = `{${uri}}${local}`;\n }\n if (seen.has(eqname)) {\n this.fail(`duplicate attribute: ${eqname}.`);\n }\n seen.add(eqname);\n attr.uri = uri;\n attributes[name] = attr;\n }\n this.attribList = [];\n }\n processAttribsPlain() {\n const { attribList } = this;\n // eslint-disable-next-line prefer-destructuring\n const attributes = this.tag.attributes;\n for (const { name, value } of attribList) {\n if (attributes[name] !== undefined) {\n this.fail(`duplicate attribute: ${name}.`);\n }\n attributes[name] = value;\n }\n this.attribList = [];\n }\n /**\n * Handle a complete open tag. This parser code calls this once it has seen\n * the whole tag. This method checks for well-formeness and then emits\n * ``onopentag``.\n */\n openTag() {\n var _a;\n this.processAttribs();\n const { tags } = this;\n const tag = this.tag;\n tag.isSelfClosing = false;\n // There cannot be any pending text here due to the onopentagstart that was\n // necessarily emitted before we get here. So we do not check text.\n (_a = this.openTagHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);\n tags.push(tag);\n this.state = S_TEXT;\n this.name = \"\";\n }\n /**\n * Handle a complete self-closing tag. This parser code calls this once it has\n * seen the whole tag. This method checks for well-formeness and then emits\n * ``onopentag`` and ``onclosetag``.\n */\n openSelfClosingTag() {\n var _a, _b, _c;\n this.processAttribs();\n const { tags } = this;\n const tag = this.tag;\n tag.isSelfClosing = true;\n // There cannot be any pending text here due to the onopentagstart that was\n // necessarily emitted before we get here. So we do not check text.\n (_a = this.openTagHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);\n (_b = this.closeTagHandler) === null || _b === void 0 ? void 0 : _b.call(this, tag);\n const top = this.tag = (_c = tags[tags.length - 1]) !== null && _c !== void 0 ? _c : null;\n if (top === null) {\n this.closedRoot = true;\n }\n this.state = S_TEXT;\n this.name = \"\";\n }\n /**\n * Handle a complete close tag. This parser code calls this once it has seen\n * the whole tag. This method checks for well-formeness and then emits\n * ``onclosetag``.\n */\n closeTag() {\n const { tags, name } = this;\n // Our state after this will be S_TEXT, no matter what, and we can clear\n // tagName now.\n this.state = S_TEXT;\n this.name = \"\";\n if (name === \"\") {\n this.fail(\"weird empty close tag.\");\n this.text += \"\";\n return;\n }\n const handler = this.closeTagHandler;\n let l = tags.length;\n while (l-- > 0) {\n const tag = this.tag = tags.pop();\n this.topNS = tag.ns;\n handler === null || handler === void 0 ? void 0 : handler(tag);\n if (tag.name === name) {\n break;\n }\n this.fail(\"unexpected close tag.\");\n }\n if (l === 0) {\n this.closedRoot = true;\n }\n else if (l < 0) {\n this.fail(`unmatched closing tag: ${name}.`);\n this.text += ``;\n }\n }\n /**\n * Resolves an entity. Makes any necessary well-formedness checks.\n *\n * @param entity The entity to resolve.\n *\n * @returns The parsed entity.\n */\n parseEntity(entity) {\n // startsWith would be significantly slower for this test.\n if (entity[0] !== \"#\") {\n const defined = this.ENTITIES[entity];\n if (defined !== undefined) {\n return defined;\n }\n this.fail(this.isName(entity) ? \"undefined entity.\" :\n \"disallowed character in entity name.\");\n return `&${entity};`;\n }\n let num = NaN;\n if (entity[1] === \"x\" && /^#x[0-9a-f]+$/i.test(entity)) {\n num = parseInt(entity.slice(2), 16);\n }\n else if (/^#[0-9]+$/.test(entity)) {\n num = parseInt(entity.slice(1), 10);\n }\n // The character reference is required to match the CHAR production.\n if (!this.isChar(num)) {\n this.fail(\"malformed character entity.\");\n return `&${entity};`;\n }\n return String.fromCodePoint(num);\n }\n}\nexports.SaxesParser = SaxesParser;\n//# sourceMappingURL=saxes.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lib/RdfXmlParser\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ParseError = void 0;\n/**\n * An error that includes line and column in the error message.\n */\nclass ParseError extends Error {\n constructor(parser, message) {\n const saxParser = parser.saxParser;\n super(parser.trackPosition ? `Line ${saxParser.line} column ${saxParser.column + 1}: ${message}` : message);\n }\n}\nexports.ParseError = ParseError;\n//# sourceMappingURL=ParseError.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ParseType = exports.RdfXmlParser = void 0;\nconst relative_to_absolute_iri_1 = require(\"relative-to-absolute-iri\");\nconst saxes_1 = require(\"@rubensworks/saxes\");\nconst readable_stream_1 = require(\"readable-stream\");\nconst ParseError_1 = require(\"./ParseError\");\nconst rdf_data_factory_1 = require(\"rdf-data-factory\");\nconst validate_iri_1 = require(\"validate-iri\");\nclass RdfXmlParser extends readable_stream_1.Transform {\n constructor(args) {\n super({ readableObjectMode: true });\n this.activeTagStack = [];\n this.nodeIds = {};\n if (args) {\n Object.assign(this, args);\n this.options = args;\n }\n if (!this.dataFactory) {\n this.dataFactory = new rdf_data_factory_1.DataFactory();\n }\n if (!this.baseIRI) {\n this.baseIRI = '';\n }\n if (!this.defaultGraph) {\n this.defaultGraph = this.dataFactory.defaultGraph();\n }\n if (this.validateUri !== false) {\n this.validateUri = true;\n }\n if (!this.iriValidationStrategy) {\n this.iriValidationStrategy = this.validateUri ? validate_iri_1.IriValidationStrategy.Pragmatic : validate_iri_1.IriValidationStrategy.None;\n }\n this.saxParser = new saxes_1.SaxesParser({ xmlns: true, position: this.trackPosition });\n this.attachSaxListeners();\n }\n /**\n * Parses the given text stream into a quad stream.\n * @param {NodeJS.EventEmitter} stream A text stream.\n * @return {RDF.Stream} A quad stream.\n */\n import(stream) {\n const output = new readable_stream_1.PassThrough({ readableObjectMode: true });\n stream.on('error', (error) => parsed.emit('error', error));\n stream.on('data', (data) => output.push(data));\n stream.on('end', () => output.push(null));\n const parsed = output.pipe(new RdfXmlParser(this.options));\n return parsed;\n }\n _transform(chunk, encoding, callback) {\n try {\n this.saxParser.write(chunk);\n }\n catch (e) {\n return callback(e);\n }\n callback();\n }\n /**\n * Create a new parse error instance.\n * @param {string} message An error message.\n * @return {Error} An error instance.\n */\n newParseError(message) {\n return new ParseError_1.ParseError(this, message);\n }\n /**\n * Convert the given value to a IRI by taking into account the baseIRI.\n *\n * This will follow the RDF/XML spec for converting values with baseIRIs to a IRI.\n *\n * @param {string} value The value to convert to an IRI.\n * @param {IActiveTag} activeTag The active tag.\n * @return {NamedNode} an IRI.\n */\n valueToUri(value, activeTag) {\n return this.uriToNamedNode((0, relative_to_absolute_iri_1.resolve)(value, activeTag.baseIRI));\n }\n /**\n * Convert the given value URI string to a named node.\n *\n * This throw an error if the URI is invalid.\n *\n * @param {string} uri A URI string.\n * @return {NamedNode} a named node.\n */\n uriToNamedNode(uri) {\n // Validate URI\n const uriValidationResult = (0, validate_iri_1.validateIri)(uri, this.iriValidationStrategy);\n if (uriValidationResult instanceof Error) {\n throw this.newParseError(uriValidationResult.message);\n }\n return this.dataFactory.namedNode(uri);\n }\n /**\n * Validate the given value as an NCName: https://www.w3.org/TR/xml-names/#NT-NCName\n * If it is invalid, an error will thrown emitted.\n * @param {string} value A value.\n */\n validateNcname(value) {\n // Validate term as an NCName: https://www.w3.org/TR/xml-names/#NT-NCName\n if (!RdfXmlParser.NCNAME_MATCHER.test(value)) {\n throw this.newParseError(`Not a valid NCName: ${value}`);\n }\n }\n attachSaxListeners() {\n this.saxParser.on('error', (error) => this.emit('error', error));\n this.saxParser.on('opentag', this.onTag.bind(this));\n this.saxParser.on('text', this.onText.bind(this));\n this.saxParser.on('cdata', this.onText.bind(this));\n this.saxParser.on('closetag', this.onCloseTag.bind(this));\n this.saxParser.on('doctype', this.onDoctype.bind(this));\n }\n /**\n * Handle the given tag.\n * @param {SaxesTagNS} tag A SAX tag.\n */\n onTag(tag) {\n // Get parent tag\n const parentTag = this.activeTagStack.length\n ? this.activeTagStack[this.activeTagStack.length - 1] : null;\n let currentParseType = ParseType.RESOURCE;\n if (parentTag) {\n parentTag.hadChildren = true;\n currentParseType = parentTag.childrenParseType;\n }\n // Check if this tag needs to be converted to a string\n if (parentTag && parentTag.childrenStringTags) {\n // Convert this tag to a string\n const tagName = tag.name;\n let attributes = '';\n for (const attributeKey in tag.attributes) {\n attributes += ` ${attributeKey}=\"${tag.attributes[attributeKey].value}\"`;\n }\n const tagContents = `${tagName}${attributes}`;\n const tagString = `<${tagContents}>`;\n parentTag.childrenStringTags.push(tagString);\n // Inherit the array, so that deeper tags are appended to this same array\n const stringActiveTag = { childrenStringTags: parentTag.childrenStringTags };\n stringActiveTag.childrenStringEmitClosingTag = ``;\n this.activeTagStack.push(stringActiveTag);\n // Halt any further processing\n return;\n }\n const activeTag = {};\n if (parentTag) {\n // Inherit language scope and baseIRI from parent\n activeTag.language = parentTag.language;\n activeTag.baseIRI = parentTag.baseIRI;\n }\n else {\n activeTag.baseIRI = this.baseIRI;\n }\n this.activeTagStack.push(activeTag);\n if (currentParseType === ParseType.RESOURCE) {\n this.onTagResource(tag, activeTag, parentTag, !parentTag);\n }\n else { // currentParseType === ParseType.PROPERTY\n this.onTagProperty(tag, activeTag, parentTag);\n }\n }\n /**\n * Handle the given node element in resource-mode.\n * @param {SaxesTagNS} tag A SAX tag.\n * @param {IActiveTag} activeTag The currently active tag.\n * @param {IActiveTag} parentTag The parent tag or null.\n * @param {boolean} rootTag If we are currently processing the root tag.\n */\n onTagResource(tag, activeTag, parentTag, rootTag) {\n activeTag.childrenParseType = ParseType.PROPERTY;\n // Assume that the current node is a _typed_ node (2.13), unless we find an rdf:Description as node name\n let typedNode = true;\n if (tag.uri === RdfXmlParser.RDF) {\n // Check forbidden property element names\n if (!rootTag && RdfXmlParser.FORBIDDEN_NODE_ELEMENTS.indexOf(tag.local) >= 0) {\n throw this.newParseError(`Illegal node element name: ${tag.local}`);\n }\n switch (tag.local) {\n case 'RDF':\n // Tags under must always be resources\n activeTag.childrenParseType = ParseType.RESOURCE;\n case 'Description':\n typedNode = false;\n }\n }\n const predicates = [];\n const objects = [];\n // Collect all attributes as triples\n // Assign subject value only after all attributes have been processed, because baseIRI may change the final val\n let activeSubjectValue = null;\n let claimSubjectNodeId = false;\n let subjectValueBlank = false;\n let explicitType = null;\n for (const attributeKey in tag.attributes) {\n const attribute = tag.attributes[attributeKey];\n if (parentTag && attribute.uri === RdfXmlParser.RDF) {\n switch (attribute.local) {\n case 'about':\n if (activeSubjectValue) {\n throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, \\\nwhile ${attribute.value} and ${activeSubjectValue} where found.`);\n }\n activeSubjectValue = attribute.value;\n continue;\n case 'ID':\n if (activeSubjectValue) {\n throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, \\\nwhile ${attribute.value} and ${activeSubjectValue} where found.`);\n }\n this.validateNcname(attribute.value);\n activeSubjectValue = '#' + attribute.value;\n claimSubjectNodeId = true;\n continue;\n case 'nodeID':\n if (activeSubjectValue) {\n throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, \\\nwhile ${attribute.value} and ${activeSubjectValue} where found.`);\n }\n this.validateNcname(attribute.value);\n activeSubjectValue = attribute.value;\n subjectValueBlank = true;\n continue;\n case 'bagID':\n throw this.newParseError(`rdf:bagID is not supported.`);\n case 'type':\n // Emit the rdf:type later as named node instead of the default literal\n explicitType = attribute.value;\n continue;\n case 'aboutEach':\n throw this.newParseError(`rdf:aboutEach is not supported.`);\n case 'aboutEachPrefix':\n throw this.newParseError(`rdf:aboutEachPrefix is not supported.`);\n case 'li':\n throw this.newParseError(`rdf:li on node elements are not supported.`);\n }\n }\n else if (attribute.uri === RdfXmlParser.XML) {\n if (attribute.local === 'lang') {\n activeTag.language = attribute.value === '' ? null : attribute.value.toLowerCase();\n continue;\n }\n else if (attribute.local === 'base') {\n // SAX Parser does not expand xml:base, based on DOCTYPE, so we have to do it manually\n activeTag.baseIRI = (0, relative_to_absolute_iri_1.resolve)(attribute.value, activeTag.baseIRI);\n continue;\n }\n }\n // Interpret attributes at this point as properties on this node,\n // but we ignore attributes that have no prefix or known expanded URI\n if (attribute.prefix !== 'xml' && attribute.prefix !== 'xmlns'\n && (attribute.prefix !== '' || attribute.local !== 'xmlns')\n && attribute.uri) {\n predicates.push(this.uriToNamedNode(attribute.uri + attribute.local));\n objects.push(attribute.value);\n }\n }\n // Create the subject value _after_ all attributes have been processed\n if (activeSubjectValue !== null) {\n activeTag.subject = subjectValueBlank\n ? this.dataFactory.blankNode(activeSubjectValue) : this.valueToUri(activeSubjectValue, activeTag);\n if (claimSubjectNodeId) {\n this.claimNodeId(activeTag.subject);\n }\n }\n // Force the creation of a subject if it doesn't exist yet\n if (!activeTag.subject) {\n activeTag.subject = this.dataFactory.blankNode();\n }\n // Emit the type if we're at a typed node\n if (typedNode) {\n const type = this.uriToNamedNode(tag.uri + tag.local);\n this.emitTriple(activeTag.subject, this.dataFactory.namedNode(RdfXmlParser.RDF + 'type'), type, parentTag ? parentTag.reifiedStatementId : null);\n }\n if (parentTag) {\n // If the parent tag defined a predicate, add the current tag as property value\n if (parentTag.predicate) {\n if (parentTag.childrenCollectionSubject) {\n // RDF:List-based properties\n const linkTerm = this.dataFactory.blankNode();\n // Emit

OR \n this.emitTriple(parentTag.childrenCollectionSubject, parentTag.childrenCollectionPredicate, linkTerm, parentTag.reifiedStatementId);\n // Emit value\n this.emitTriple(linkTerm, this.dataFactory.namedNode(RdfXmlParser.RDF + 'first'), activeTag.subject, activeTag.reifiedStatementId);\n // Store in the parent node\n parentTag.childrenCollectionSubject = linkTerm;\n parentTag.childrenCollectionPredicate = this.dataFactory.namedNode(RdfXmlParser.RDF + 'rest');\n }\n else { // !parentTag.predicateEmitted\n // Set-based properties\n this.emitTriple(parentTag.subject, parentTag.predicate, activeTag.subject, parentTag.reifiedStatementId);\n // Emit pending properties on the parent tag that had no defined subject yet.\n for (let i = 0; i < parentTag.predicateSubPredicates.length; i++) {\n this.emitTriple(activeTag.subject, parentTag.predicateSubPredicates[i], parentTag.predicateSubObjects[i], null);\n }\n // Cleanup so we don't emit them again when the parent tag is closed\n parentTag.predicateSubPredicates = [];\n parentTag.predicateSubObjects = [];\n parentTag.predicateEmitted = true;\n }\n }\n // Emit all collected triples\n for (let i = 0; i < predicates.length; i++) {\n const object = this.dataFactory.literal(objects[i], activeTag.datatype || activeTag.language);\n this.emitTriple(activeTag.subject, predicates[i], object, parentTag.reifiedStatementId);\n }\n // Emit the rdf:type as named node instead of literal\n if (explicitType) {\n this.emitTriple(activeTag.subject, this.dataFactory.namedNode(RdfXmlParser.RDF + 'type'), this.uriToNamedNode(explicitType), null);\n }\n }\n }\n /**\n * Handle the given property element in property-mode.\n * @param {SaxesTagNS} tag A SAX tag.\n * @param {IActiveTag} activeTag The currently active tag.\n * @param {IActiveTag} parentTag The parent tag or null.\n */\n onTagProperty(tag, activeTag, parentTag) {\n activeTag.childrenParseType = ParseType.RESOURCE;\n activeTag.subject = parentTag.subject; // Inherit parent subject\n if (tag.uri === RdfXmlParser.RDF && tag.local === 'li') {\n // Convert rdf:li to rdf:_x\n if (!parentTag.listItemCounter) {\n parentTag.listItemCounter = 1;\n }\n activeTag.predicate = this.uriToNamedNode(tag.uri + '_' + parentTag.listItemCounter++);\n }\n else {\n activeTag.predicate = this.uriToNamedNode(tag.uri + tag.local);\n }\n // Check forbidden property element names\n if (tag.uri === RdfXmlParser.RDF\n && RdfXmlParser.FORBIDDEN_PROPERTY_ELEMENTS.indexOf(tag.local) >= 0) {\n throw this.newParseError(`Illegal property element name: ${tag.local}`);\n }\n activeTag.predicateSubPredicates = [];\n activeTag.predicateSubObjects = [];\n let parseType = false;\n let attributedProperty = false;\n // Collect all attributes as triples\n // Assign subject value only after all attributes have been processed, because baseIRI may change the final val\n let activeSubSubjectValue = null;\n let subSubjectValueBlank = true;\n const predicates = [];\n const objects = [];\n for (const propertyAttributeKey in tag.attributes) {\n const propertyAttribute = tag.attributes[propertyAttributeKey];\n if (propertyAttribute.uri === RdfXmlParser.RDF) {\n switch (propertyAttribute.local) {\n case 'resource':\n if (activeSubSubjectValue) {\n throw this.newParseError(`Found both rdf:resource (${propertyAttribute.value}) and rdf:nodeID (${activeSubSubjectValue}).`);\n }\n if (parseType) {\n throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${propertyAttribute.value})`);\n }\n activeTag.hadChildren = true;\n activeSubSubjectValue = propertyAttribute.value;\n subSubjectValueBlank = false;\n continue;\n case 'datatype':\n if (attributedProperty) {\n throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${propertyAttribute.value}).`);\n }\n if (parseType) {\n throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${propertyAttribute.value})`);\n }\n activeTag.datatype = this.valueToUri(propertyAttribute.value, activeTag);\n continue;\n case 'nodeID':\n if (attributedProperty) {\n throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${propertyAttribute.value}).`);\n }\n if (activeTag.hadChildren) {\n throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${propertyAttribute.value}).`);\n }\n if (parseType) {\n throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${propertyAttribute.value})`);\n }\n this.validateNcname(propertyAttribute.value);\n activeTag.hadChildren = true;\n activeSubSubjectValue = propertyAttribute.value;\n subSubjectValueBlank = true;\n continue;\n case 'bagID':\n throw this.newParseError(`rdf:bagID is not supported.`);\n case 'parseType':\n // Validation\n if (attributedProperty) {\n throw this.newParseError(`rdf:parseType is not allowed when non-rdf:* property attributes are present`);\n }\n if (activeTag.datatype) {\n throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${activeTag.datatype.value})`);\n }\n if (activeSubSubjectValue) {\n throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${activeSubSubjectValue})`);\n }\n if (propertyAttribute.value === 'Resource') {\n parseType = true;\n activeTag.childrenParseType = ParseType.PROPERTY;\n // Turn this property element into a node element\n const nestedBNode = this.dataFactory.blankNode();\n this.emitTriple(activeTag.subject, activeTag.predicate, nestedBNode, activeTag.reifiedStatementId);\n activeTag.subject = nestedBNode;\n activeTag.predicate = null;\n }\n else if (propertyAttribute.value === 'Collection') {\n parseType = true;\n // Interpret children as being part of an rdf:List\n activeTag.hadChildren = true;\n activeTag.childrenCollectionSubject = activeTag.subject;\n activeTag.childrenCollectionPredicate = activeTag.predicate;\n subSubjectValueBlank = false;\n }\n else if (propertyAttribute.value === 'Literal') {\n parseType = true;\n // Interpret children as being part of a literal string\n activeTag.childrenTagsToString = true;\n activeTag.childrenStringTags = [];\n }\n continue;\n case 'ID':\n this.validateNcname(propertyAttribute.value);\n activeTag.reifiedStatementId = this.valueToUri('#' + propertyAttribute.value, activeTag);\n this.claimNodeId(activeTag.reifiedStatementId);\n continue;\n }\n }\n else if (propertyAttribute.uri === RdfXmlParser.XML && propertyAttribute.local === 'lang') {\n activeTag.language = propertyAttribute.value === ''\n ? null : propertyAttribute.value.toLowerCase();\n continue;\n }\n // Interpret attributes at this point as properties via implicit blank nodes on the property,\n // but we ignore attributes that have no prefix or known expanded URI\n if (propertyAttribute.prefix !== 'xml' && propertyAttribute.prefix !== 'xmlns'\n && (propertyAttribute.prefix !== '' || propertyAttribute.local !== 'xmlns')\n && propertyAttribute.uri) {\n if (parseType || activeTag.datatype) {\n throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${propertyAttribute.value}`);\n }\n activeTag.hadChildren = true;\n attributedProperty = true;\n predicates.push(this.uriToNamedNode(propertyAttribute.uri + propertyAttribute.local));\n objects.push(this.dataFactory.literal(propertyAttribute.value, activeTag.datatype || activeTag.language));\n }\n }\n // Create the subject value _after_ all attributes have been processed\n if (activeSubSubjectValue !== null) {\n const subjectParent = activeTag.subject;\n activeTag.subject = subSubjectValueBlank\n ? this.dataFactory.blankNode(activeSubSubjectValue) : this.valueToUri(activeSubSubjectValue, activeTag);\n this.emitTriple(subjectParent, activeTag.predicate, activeTag.subject, activeTag.reifiedStatementId);\n // Emit our buffered triples\n for (let i = 0; i < predicates.length; i++) {\n this.emitTriple(activeTag.subject, predicates[i], objects[i], null);\n }\n activeTag.predicateEmitted = true;\n }\n else if (subSubjectValueBlank) {\n // The current property element has no defined subject\n // Let's buffer the properties until the child node defines a subject,\n // or if the tag closes.\n activeTag.predicateSubPredicates = predicates;\n activeTag.predicateSubObjects = objects;\n activeTag.predicateEmitted = false;\n }\n }\n /**\n * Emit the given triple to the stream.\n * @param {Term} subject A subject term.\n * @param {Term} predicate A predicate term.\n * @param {Term} object An object term.\n * @param {Term} statementId An optional resource that identifies the triple.\n * If truthy, then the given triple will also be emitted reified.\n */\n emitTriple(subject, predicate, object, statementId) {\n this.push(this.dataFactory.quad(subject, predicate, object, this.defaultGraph));\n // Reify triple\n if (statementId) {\n this.push(this.dataFactory.quad(statementId, this.dataFactory.namedNode(RdfXmlParser.RDF + 'type'), this.dataFactory.namedNode(RdfXmlParser.RDF + 'Statement'), this.defaultGraph));\n this.push(this.dataFactory.quad(statementId, this.dataFactory.namedNode(RdfXmlParser.RDF + 'subject'), subject, this.defaultGraph));\n this.push(this.dataFactory.quad(statementId, this.dataFactory.namedNode(RdfXmlParser.RDF + 'predicate'), predicate, this.defaultGraph));\n this.push(this.dataFactory.quad(statementId, this.dataFactory.namedNode(RdfXmlParser.RDF + 'object'), object, this.defaultGraph));\n }\n }\n /**\n * Register the given term as a node ID.\n * If one was already registered, this will emit an error.\n *\n * This is used to check duplicate occurrences of rdf:ID in scope of the baseIRI.\n * @param {Term} term An RDF term.\n */\n claimNodeId(term) {\n if (!this.allowDuplicateRdfIds) {\n if (this.nodeIds[term.value]) {\n throw this.newParseError(`Found multiple occurrences of rdf:ID='${term.value}'.`);\n }\n this.nodeIds[term.value] = true;\n }\n }\n /**\n * Handle the given text string.\n * @param {string} text A parsed text string.\n */\n onText(text) {\n const activeTag = this.activeTagStack.length\n ? this.activeTagStack[this.activeTagStack.length - 1] : null;\n if (activeTag) {\n if (activeTag.childrenStringTags) {\n activeTag.childrenStringTags.push(text);\n }\n else if (activeTag.predicate) {\n activeTag.text = text;\n }\n }\n }\n /**\n * Handle the closing of the last tag.\n */\n onCloseTag() {\n const poppedTag = this.activeTagStack.pop();\n // If we were converting a tag to a string, and the tag was not self-closing, close it here.\n if (poppedTag.childrenStringEmitClosingTag) {\n poppedTag.childrenStringTags.push(poppedTag.childrenStringEmitClosingTag);\n }\n // Set the literal value if we were collecting XML tags to string\n if (poppedTag.childrenTagsToString) {\n poppedTag.datatype = this.dataFactory.namedNode(RdfXmlParser.RDF + 'XMLLiteral');\n poppedTag.text = poppedTag.childrenStringTags.join('');\n poppedTag.hadChildren = false; // Force a literal triple to be emitted hereafter\n }\n if (poppedTag.childrenCollectionSubject) {\n // Terminate the rdf:List\n this.emitTriple(poppedTag.childrenCollectionSubject, poppedTag.childrenCollectionPredicate, this.dataFactory.namedNode(RdfXmlParser.RDF + 'nil'), poppedTag.reifiedStatementId);\n }\n else if (poppedTag.predicate) {\n if (!poppedTag.hadChildren && poppedTag.childrenParseType !== ParseType.PROPERTY) {\n // Property element contains text\n this.emitTriple(poppedTag.subject, poppedTag.predicate, this.dataFactory.literal(poppedTag.text || '', poppedTag.datatype || poppedTag.language), poppedTag.reifiedStatementId);\n }\n else if (!poppedTag.predicateEmitted) {\n // Emit remaining properties on an anonymous property element\n const subject = this.dataFactory.blankNode();\n this.emitTriple(poppedTag.subject, poppedTag.predicate, subject, poppedTag.reifiedStatementId);\n for (let i = 0; i < poppedTag.predicateSubPredicates.length; i++) {\n this.emitTriple(subject, poppedTag.predicateSubPredicates[i], poppedTag.predicateSubObjects[i], null);\n }\n }\n }\n }\n /**\n * Fetch local DOCTYPE ENTITY's and make the parser recognise them.\n * @param {string} doctype The read doctype.\n */\n onDoctype(doctype) {\n doctype.replace(//g, (match, prefix, uri) => {\n this.saxParser.ENTITIES[prefix] = uri;\n return '';\n });\n }\n}\nexports.RdfXmlParser = RdfXmlParser;\nRdfXmlParser.MIME_TYPE = 'application/rdf+xml';\nRdfXmlParser.RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';\nRdfXmlParser.XML = 'http://www.w3.org/XML/1998/namespace';\nRdfXmlParser.FORBIDDEN_NODE_ELEMENTS = [\n 'RDF',\n 'ID',\n 'about',\n 'bagID',\n 'parseType',\n 'resource',\n 'nodeID',\n 'li',\n 'aboutEach',\n 'aboutEachPrefix',\n];\nRdfXmlParser.FORBIDDEN_PROPERTY_ELEMENTS = [\n 'Description',\n 'RDF',\n 'ID',\n 'about',\n 'bagID',\n 'parseType',\n 'resource',\n 'nodeID',\n 'aboutEach',\n 'aboutEachPrefix',\n];\n// tslint:disable-next-line:max-line-length\nRdfXmlParser.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;\nvar ParseType;\n(function (ParseType) {\n ParseType[ParseType[\"RESOURCE\"] = 0] = \"RESOURCE\";\n ParseType[ParseType[\"PROPERTY\"] = 1] = \"PROPERTY\";\n})(ParseType || (exports.ParseType = ParseType = {}));\n//# sourceMappingURL=RdfXmlParser.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lib/BlankNode\"), exports);\n__exportStar(require(\"./lib/DataFactory\"), exports);\n__exportStar(require(\"./lib/DefaultGraph\"), exports);\n__exportStar(require(\"./lib/Literal\"), exports);\n__exportStar(require(\"./lib/NamedNode\"), exports);\n__exportStar(require(\"./lib/Quad\"), exports);\n__exportStar(require(\"./lib/Variable\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BlankNode = void 0;\n/**\n * A term that represents an RDF blank node with a label.\n */\nclass BlankNode {\n constructor(value) {\n this.termType = 'BlankNode';\n this.value = value;\n }\n equals(other) {\n return !!other && other.termType === 'BlankNode' && other.value === this.value;\n }\n}\nexports.BlankNode = BlankNode;\n//# sourceMappingURL=BlankNode.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DataFactory = void 0;\nconst BlankNode_1 = require(\"./BlankNode\");\nconst DefaultGraph_1 = require(\"./DefaultGraph\");\nconst Literal_1 = require(\"./Literal\");\nconst NamedNode_1 = require(\"./NamedNode\");\nconst Quad_1 = require(\"./Quad\");\nconst Variable_1 = require(\"./Variable\");\nlet dataFactoryCounter = 0;\n/**\n * A factory for instantiating RDF terms and quads.\n */\nclass DataFactory {\n constructor(options) {\n this.blankNodeCounter = 0;\n options = options || {};\n this.blankNodePrefix = options.blankNodePrefix || `df_${dataFactoryCounter++}_`;\n }\n /**\n * @param value The IRI for the named node.\n * @return A new instance of NamedNode.\n * @see NamedNode\n */\n namedNode(value) {\n return new NamedNode_1.NamedNode(value);\n }\n /**\n * @param value The optional blank node identifier.\n * @return A new instance of BlankNode.\n * If the `value` parameter is undefined a new identifier\n * for the blank node is generated for each call.\n * @see BlankNode\n */\n blankNode(value) {\n return new BlankNode_1.BlankNode(value || `${this.blankNodePrefix}${this.blankNodeCounter++}`);\n }\n /**\n * @param value The literal value.\n * @param languageOrDatatype The optional language or datatype.\n * If `languageOrDatatype` is a NamedNode,\n * then it is used for the value of `NamedNode.datatype`.\n * Otherwise `languageOrDatatype` is used for the value\n * of `NamedNode.language`.\n * @return A new instance of Literal.\n * @see Literal\n */\n literal(value, languageOrDatatype) {\n return new Literal_1.Literal(value, languageOrDatatype);\n }\n /**\n * This method is optional.\n * @param value The variable name\n * @return A new instance of Variable.\n * @see Variable\n */\n variable(value) {\n return new Variable_1.Variable(value);\n }\n /**\n * @return An instance of DefaultGraph.\n */\n defaultGraph() {\n return DefaultGraph_1.DefaultGraph.INSTANCE;\n }\n /**\n * @param subject The quad subject term.\n * @param predicate The quad predicate term.\n * @param object The quad object term.\n * @param graph The quad graph term.\n * @return A new instance of Quad.\n * @see Quad\n */\n quad(subject, predicate, object, graph) {\n return new Quad_1.Quad(subject, predicate, object, graph || this.defaultGraph());\n }\n /**\n * Create a deep copy of the given term using this data factory.\n * @param original An RDF term.\n * @return A deep copy of the given term.\n */\n fromTerm(original) {\n // TODO: remove nasty any casts when this TS bug has been fixed:\n // https://github.com/microsoft/TypeScript/issues/26933\n switch (original.termType) {\n case 'NamedNode':\n return this.namedNode(original.value);\n case 'BlankNode':\n return this.blankNode(original.value);\n case 'Literal':\n if (original.language) {\n return this.literal(original.value, original.language);\n }\n if (!original.datatype.equals(Literal_1.Literal.XSD_STRING)) {\n return this.literal(original.value, this.fromTerm(original.datatype));\n }\n return this.literal(original.value);\n case 'Variable':\n return this.variable(original.value);\n case 'DefaultGraph':\n return this.defaultGraph();\n case 'Quad':\n return this.quad(this.fromTerm(original.subject), this.fromTerm(original.predicate), this.fromTerm(original.object), this.fromTerm(original.graph));\n }\n }\n /**\n * Create a deep copy of the given quad using this data factory.\n * @param original An RDF quad.\n * @return A deep copy of the given quad.\n */\n fromQuad(original) {\n return this.fromTerm(original);\n }\n /**\n * Reset the internal blank node counter.\n */\n resetBlankNodeCounter() {\n this.blankNodeCounter = 0;\n }\n}\nexports.DataFactory = DataFactory;\n//# sourceMappingURL=DataFactory.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultGraph = void 0;\n/**\n * A singleton term instance that represents the default graph.\n * It's only allowed to assign a DefaultGraph to the .graph property of a Quad.\n */\nclass DefaultGraph {\n constructor() {\n this.termType = 'DefaultGraph';\n this.value = '';\n // Private constructor\n }\n equals(other) {\n return !!other && other.termType === 'DefaultGraph';\n }\n}\nexports.DefaultGraph = DefaultGraph;\nDefaultGraph.INSTANCE = new DefaultGraph();\n//# sourceMappingURL=DefaultGraph.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Literal = void 0;\nconst NamedNode_1 = require(\"./NamedNode\");\n/**\n * A term that represents an RDF literal, containing a string with an optional language tag or datatype.\n */\nclass Literal {\n constructor(value, languageOrDatatype) {\n this.termType = 'Literal';\n this.value = value;\n if (typeof languageOrDatatype === 'string') {\n this.language = languageOrDatatype;\n this.datatype = Literal.RDF_LANGUAGE_STRING;\n }\n else if (languageOrDatatype) {\n this.language = '';\n this.datatype = languageOrDatatype;\n }\n else {\n this.language = '';\n this.datatype = Literal.XSD_STRING;\n }\n }\n equals(other) {\n return !!other && other.termType === 'Literal' && other.value === this.value &&\n other.language === this.language && this.datatype.equals(other.datatype);\n }\n}\nexports.Literal = Literal;\nLiteral.RDF_LANGUAGE_STRING = new NamedNode_1.NamedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString');\nLiteral.XSD_STRING = new NamedNode_1.NamedNode('http://www.w3.org/2001/XMLSchema#string');\n//# sourceMappingURL=Literal.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NamedNode = void 0;\n/**\n * A term that contains an IRI.\n */\nclass NamedNode {\n constructor(value) {\n this.termType = 'NamedNode';\n this.value = value;\n }\n equals(other) {\n return !!other && other.termType === 'NamedNode' && other.value === this.value;\n }\n}\nexports.NamedNode = NamedNode;\n//# sourceMappingURL=NamedNode.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Quad = void 0;\n/**\n * An instance of DefaultGraph represents the default graph.\n * It's only allowed to assign a DefaultGraph to the .graph property of a Quad.\n */\nclass Quad {\n constructor(subject, predicate, object, graph) {\n this.termType = 'Quad';\n this.value = '';\n this.subject = subject;\n this.predicate = predicate;\n this.object = object;\n this.graph = graph;\n }\n equals(other) {\n // `|| !other.termType` is for backwards-compatibility with old factories without RDF* support.\n return !!other && (other.termType === 'Quad' || !other.termType) &&\n this.subject.equals(other.subject) &&\n this.predicate.equals(other.predicate) &&\n this.object.equals(other.object) &&\n this.graph.equals(other.graph);\n }\n}\nexports.Quad = Quad;\n//# sourceMappingURL=Quad.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Variable = void 0;\n/**\n * A term that represents a variable.\n */\nclass Variable {\n constructor(value) {\n this.termType = 'Variable';\n this.value = value;\n }\n equals(other) {\n return !!other && other.termType === 'Variable' && other.value === this.value;\n }\n}\nexports.Variable = Variable;\n//# sourceMappingURL=Variable.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lib/Resolve\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.removeDotSegmentsOfPath = exports.removeDotSegments = exports.resolve = void 0;\n/**\n * Convert the given relative IRI to an absolute IRI\n * by taking into account the given optional baseIRI.\n *\n * @param {string} relativeIRI The relative IRI to convert to an absolute IRI.\n * @param {string} baseIRI The optional base IRI.\n * @return {string} an absolute IRI.\n */\nfunction resolve(relativeIRI, baseIRI) {\n baseIRI = baseIRI || '';\n const baseFragmentPos = baseIRI.indexOf('#');\n // Ignore any fragments in the base IRI\n if (baseFragmentPos > 0) {\n baseIRI = baseIRI.substr(0, baseFragmentPos);\n }\n // Convert empty value directly to base IRI\n if (!relativeIRI.length) {\n // At this point, the baseIRI MUST be absolute, otherwise we error\n if (baseIRI.indexOf(':') < 0) {\n throw new Error(`Found invalid baseIRI '${baseIRI}' for value '${relativeIRI}'`);\n }\n return baseIRI;\n }\n // If the value starts with a query character, concat directly (but strip the existing query)\n if (relativeIRI.startsWith('?')) {\n const baseQueryPos = baseIRI.indexOf('?');\n if (baseQueryPos > 0) {\n baseIRI = baseIRI.substr(0, baseQueryPos);\n }\n return baseIRI + relativeIRI;\n }\n // If the value starts with a fragment character, concat directly\n if (relativeIRI.startsWith('#')) {\n return baseIRI + relativeIRI;\n }\n // Ignore baseIRI if it is empty\n if (!baseIRI.length) {\n const relativeColonPos = relativeIRI.indexOf(':');\n if (relativeColonPos < 0) {\n throw new Error(`Found invalid relative IRI '${relativeIRI}' for a missing baseIRI`);\n }\n return removeDotSegmentsOfPath(relativeIRI, relativeColonPos);\n }\n // Ignore baseIRI if the value is absolute\n const valueColonPos = relativeIRI.indexOf(':');\n if (valueColonPos >= 0) {\n return removeDotSegmentsOfPath(relativeIRI, valueColonPos);\n }\n // At this point, the baseIRI MUST be absolute, otherwise we error\n const baseColonPos = baseIRI.indexOf(':');\n if (baseColonPos < 0) {\n throw new Error(`Found invalid baseIRI '${baseIRI}' for value '${relativeIRI}'`);\n }\n const baseIRIScheme = baseIRI.substr(0, baseColonPos + 1);\n // Inherit the baseIRI scheme if the value starts with '//'\n if (relativeIRI.indexOf('//') === 0) {\n return baseIRIScheme + removeDotSegmentsOfPath(relativeIRI, valueColonPos);\n }\n // Check cases where '://' occurs in the baseIRI, and where there is no '/' after a ':' anymore.\n let baseSlashAfterColonPos;\n if (baseIRI.indexOf('//', baseColonPos) === baseColonPos + 1) {\n // If there is no additional '/' after the '//'.\n baseSlashAfterColonPos = baseIRI.indexOf('/', baseColonPos + 3);\n if (baseSlashAfterColonPos < 0) {\n // If something other than a '/' follows the '://', append the value after a '/',\n // otherwise, prefix the value with only the baseIRI scheme.\n if (baseIRI.length > baseColonPos + 3) {\n return baseIRI + '/' + removeDotSegmentsOfPath(relativeIRI, valueColonPos);\n }\n else {\n return baseIRIScheme + removeDotSegmentsOfPath(relativeIRI, valueColonPos);\n }\n }\n }\n else {\n // If there is not even a single '/' after the ':'\n baseSlashAfterColonPos = baseIRI.indexOf('/', baseColonPos + 1);\n if (baseSlashAfterColonPos < 0) {\n // If we don't have a '/' after the ':',\n // prefix the value with only the baseIRI scheme.\n return baseIRIScheme + removeDotSegmentsOfPath(relativeIRI, valueColonPos);\n }\n }\n // If the value starts with a '/', then prefix it with everything before the first effective slash of the base IRI.\n if (relativeIRI.indexOf('/') === 0) {\n return baseIRI.substr(0, baseSlashAfterColonPos) + removeDotSegments(relativeIRI);\n }\n let baseIRIPath = baseIRI.substr(baseSlashAfterColonPos);\n const baseIRILastSlashPos = baseIRIPath.lastIndexOf('/');\n // Ignore everything after the last '/' in the baseIRI path\n if (baseIRILastSlashPos >= 0 && baseIRILastSlashPos < baseIRIPath.length - 1) {\n baseIRIPath = baseIRIPath.substr(0, baseIRILastSlashPos + 1);\n // Also remove the first character of the relative path if it starts with '.' (and not '..' or './')\n // This change is only allowed if there is something else following the path\n if (relativeIRI[0] === '.' && relativeIRI[1] !== '.' && relativeIRI[1] !== '/' && relativeIRI[2]) {\n relativeIRI = relativeIRI.substr(1);\n }\n }\n // Prefix the value with the baseIRI path where\n relativeIRI = baseIRIPath + relativeIRI;\n // Remove dot segment from the IRI\n relativeIRI = removeDotSegments(relativeIRI);\n // Prefix our transformed value with the part of the baseIRI until the first '/' after the first ':'.\n return baseIRI.substr(0, baseSlashAfterColonPos) + relativeIRI;\n}\nexports.resolve = resolve;\n/**\n * Remove dot segments from the given path,\n * as described in https://www.ietf.org/rfc/rfc3986.txt (page 32).\n * @param {string} path An IRI path.\n * @return {string} A path, will always start with a '/'.\n */\nfunction removeDotSegments(path) {\n // Prepare a buffer with segments between each '/.\n // Each segment represents an array of characters.\n const segmentBuffers = [];\n let i = 0;\n while (i < path.length) {\n // Remove '/.' or '/..'\n switch (path[i]) {\n case '/':\n if (path[i + 1] === '.') {\n if (path[i + 2] === '.') {\n // Start a new segment if we find an invalid character after the '.'\n if (!isCharacterAllowedAfterRelativePathSegment(path[i + 3])) {\n segmentBuffers.push([]);\n i++;\n break;\n }\n // Go to parent directory,\n // so we remove a parent segment\n segmentBuffers.pop();\n // Ensure that we end with a slash if there is a trailing '/..'\n if (!path[i + 3]) {\n segmentBuffers.push([]);\n }\n i += 3;\n }\n else {\n // Start a new segment if we find an invalid character after the '.'\n if (!isCharacterAllowedAfterRelativePathSegment(path[i + 2])) {\n segmentBuffers.push([]);\n i++;\n break;\n }\n // Ensure that we end with a slash if there is a trailing '/.'\n if (!path[i + 2]) {\n segmentBuffers.push([]);\n }\n // Go to the current directory,\n // so we do nothing\n i += 2;\n }\n }\n else {\n // Start a new segment\n segmentBuffers.push([]);\n i++;\n }\n break;\n case '#':\n case '?':\n // Query and fragment string should be appended unchanged\n if (!segmentBuffers.length) {\n segmentBuffers.push([]);\n }\n segmentBuffers[segmentBuffers.length - 1].push(path.substr(i));\n // Break the while loop\n i = path.length;\n break;\n default:\n // Not a special character, just append it to our buffer\n if (!segmentBuffers.length) {\n segmentBuffers.push([]);\n }\n segmentBuffers[segmentBuffers.length - 1].push(path[i]);\n i++;\n break;\n }\n }\n return '/' + segmentBuffers.map((buffer) => buffer.join('')).join('/');\n}\nexports.removeDotSegments = removeDotSegments;\n/**\n * Removes dot segments of the given IRI.\n * @param {string} iri An IRI (or part of IRI).\n * @param {number} colonPosition The position of the first ':' in the IRI.\n * @return {string} The IRI where dot segments were removed.\n */\nfunction removeDotSegmentsOfPath(iri, colonPosition) {\n // Determine where we should start looking for the first '/' that indicates the start of the path\n let searchOffset = colonPosition + 1;\n if (colonPosition >= 0) {\n if (iri[colonPosition + 1] === '/' && iri[colonPosition + 2] === '/') {\n searchOffset = colonPosition + 3;\n }\n }\n else {\n if (iri[0] === '/' && iri[1] === '/') {\n searchOffset = 2;\n }\n }\n // Determine the path\n const pathSeparator = iri.indexOf('/', searchOffset);\n if (pathSeparator < 0) {\n return iri;\n }\n const base = iri.substr(0, pathSeparator);\n const path = iri.substr(pathSeparator);\n // Remove dot segments from the path\n return base + removeDotSegments(path);\n}\nexports.removeDotSegmentsOfPath = removeDotSegmentsOfPath;\nfunction isCharacterAllowedAfterRelativePathSegment(character) {\n return !character || character === '#' || character === '?' || character === '/';\n}\n//# sourceMappingURL=Resolve.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lib/Validate\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateIri = exports.IriValidationStrategy = void 0;\nfunction buildAbsoluteIriRfc3987Regex() {\n // The syntax is defined in https://www.rfc-editor.org/rfc/rfc3987#section-2.2\n // Rules are defined in reversed order\n const sub_delims_raw = `!$&'()*+,;=`;\n const sub_delims = `[${sub_delims_raw}]`;\n const pct_encoded = `%[a-fA-F0-9]{2}`;\n const dec_octet = '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';\n const ipv4address = `${dec_octet}\\\\.${dec_octet}\\\\.${dec_octet}\\\\.${dec_octet}`;\n const h16 = `[a-fA-F0-9]{1,4}`;\n const ls32 = `(${h16}:${h16}|${ipv4address})`;\n const ipv6address = `((${h16}:){6}${ls32}|::(${h16}:){5}${ls32}|(${h16})?::(${h16}:){4}${ls32}|((${h16}:){0,1}${h16})?::(${h16}:){3}${ls32}|((${h16}:){0,2}${h16})?::(${h16}:){2}${ls32}|((${h16}:){0,3}${h16})?::${h16}:${ls32}|((${h16}:){0,4}${h16})?::${ls32}|((${h16}:){0,5}${h16})?::${h16}|((${h16}:){0,6}${h16})?::)`;\n const ipvfuture = `v[a-fA-F0-9]+\\\\.(${sub_delims}|${sub_delims}|\":)+`;\n const ip_literal = `\\\\[(${ipv6address}|${ipvfuture})\\\\]`;\n const port = `[0-9]*`;\n const scheme = `[a-zA-Z][a-zA-Z0-9+\\\\-.]*`;\n const iprivate_raw = `\\u{E000}-\\u{F8FF}\\u{F0000}-\\u{FFFFD}\\u{100000}-\\u{10FFFD}`;\n const iprivate = `[${iprivate_raw}]`;\n const ucschar_raw = `\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}`;\n const iunreserved_raw = `a-zA-Z0-9\\\\-._~${ucschar_raw}`;\n const iunreserved = `[${iunreserved_raw}]`;\n const ipchar = `(${iunreserved}|${pct_encoded}|${sub_delims}|[:@])*`;\n const ifragment = `(${ipchar}|[\\\\/?])*`;\n const iquery = `(${ipchar}|${iprivate}|[\\\\/?])*`;\n const isegment_nz = `(${ipchar})+`;\n const isegment = `(${ipchar})*`;\n const ipath_empty = '';\n const ipath_rootless = `${isegment_nz}(\\\\/${isegment})*`;\n const ipath_absolute = `\\\\/(${isegment_nz}(\\\\/${isegment})*)?`;\n const ipath_abempty = `(\\\\/${isegment})*`;\n const ireg_name = `(${iunreserved}|${pct_encoded}|${sub_delims})*`;\n const ihost = `(${ip_literal}|${ipv4address}|${ireg_name})`;\n const iuserinfo = `(${iunreserved}|${pct_encoded}|${sub_delims}|:)*`;\n const iauthority = `(${iuserinfo}@)?${ihost}(:${port})?`;\n const ihier_part = `(\\\\/\\\\/${iauthority}${ipath_abempty}|${ipath_absolute}|${ipath_rootless}|${ipath_empty})`;\n const iri = `^${scheme}:${ihier_part}(\\\\?${iquery})?(#${ifragment})?$`;\n return new RegExp(iri, 'u');\n}\nconst STRICT_IRI_REGEX = buildAbsoluteIriRfc3987Regex();\n// eslint-disable-next-line no-control-regex\nconst PRAGMATIC_IRI_REGEX = /^[A-Za-z][\\d+-.A-Za-z]*:[^\\u0000-\\u0020\"<>\\\\^`{|}]*$/u;\n/**\n * Possible ways of validating an IRI\n */\nvar IriValidationStrategy;\n(function (IriValidationStrategy) {\n /**\n * Validates the IRI according to RFC 3987.\n */\n IriValidationStrategy[\"Strict\"] = \"strict\";\n /**\n * Validates that the IRI has a valid scheme and does not contain any character forbidden by the Turtle specification.\n */\n IriValidationStrategy[\"Pragmatic\"] = \"pragmatic\";\n /**\n * Does not validate the IRI at all.\n */\n IriValidationStrategy[\"None\"] = \"none\";\n})(IriValidationStrategy = exports.IriValidationStrategy || (exports.IriValidationStrategy = {}));\n/**\n * Validate a given IRI according to the given strategy.\n *\n * By default the IRI is fully validated according to RFC 3987.\n * But it is possible to do a lighter a faster validation using the \"pragmatic\" strategy.\n *\n * @param {string} iri a string that may be an IRI.\n * @param {IriValidationStrategy} strategy IRI validation strategy.\n * @return {Error | undefined} An error if the IRI is invalid, or undefined if it is valid.\n */\nfunction validateIri(iri, strategy = IriValidationStrategy.Strict) {\n switch (strategy) {\n case IriValidationStrategy.Strict:\n return STRICT_IRI_REGEX.test(iri) ? undefined : new Error(`Invalid IRI according to RFC 3987: '${iri}'`);\n case IriValidationStrategy.Pragmatic:\n return PRAGMATIC_IRI_REGEX.test(iri) ? undefined : new Error(`Invalid IRI according to RDF Turtle: '${iri}'`);\n case IriValidationStrategy.None:\n return undefined;\n default:\n return new Error(`Not supported validation strategy \"${strategy}\"`);\n }\n}\nexports.validateIri = validateIri;\n//# sourceMappingURL=Validate.js.map","\"use strict\";\n/**\n * Character classes and associated utilities for the 5th edition of XML 1.0.\n *\n * @author Louis-Dominique Dubeau\n * @license MIT\n * @copyright Louis-Dominique Dubeau\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//\n// Fragments.\n//\nexports.CHAR = \"\\t\\n\\r -\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\";\nexports.S = \" \\t\\r\\n\";\n// tslint:disable-next-line:max-line-length\nexports.NAME_START_CHAR = \":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\\uD800\\uDC00-\\uDB7F\\uDFFF\";\nexports.NAME_CHAR = \"-\" + exports.NAME_START_CHAR + \".0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040\";\n//\n// Regular expressions.\n//\nexports.CHAR_RE = new RegExp(\"^[\" + exports.CHAR + \"]$\", \"u\");\nexports.S_RE = new RegExp(\"^[\" + exports.S + \"]+$\", \"u\");\nexports.NAME_START_CHAR_RE = new RegExp(\"^[\" + exports.NAME_START_CHAR + \"]$\", \"u\");\nexports.NAME_CHAR_RE = new RegExp(\"^[\" + exports.NAME_CHAR + \"]$\", \"u\");\nexports.NAME_RE = new RegExp(\"^[\" + exports.NAME_START_CHAR + \"][\" + exports.NAME_CHAR + \"]*$\", \"u\");\nexports.NMTOKEN_RE = new RegExp(\"^[\" + exports.NAME_CHAR + \"]+$\", \"u\");\nvar TAB = 9;\nvar NL = 0xA;\nvar CR = 0xD;\nvar SPACE = 0x20;\n//\n// Lists.\n//\n/** All characters in the ``S`` production. */\nexports.S_LIST = [SPACE, NL, CR, TAB];\n/**\n * Determines whether a codepoint matches the ``CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``CHAR``.\n */\nfunction isChar(c) {\n return (c >= SPACE && c <= 0xD7FF) ||\n c === NL || c === CR || c === TAB ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}\nexports.isChar = isChar;\n/**\n * Determines whether a codepoint matches the ``S`` (space) production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``S``.\n */\nfunction isS(c) {\n return c === SPACE || c === NL || c === CR || c === TAB;\n}\nexports.isS = isS;\n/**\n * Determines whether a codepoint matches the ``NAME_START_CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``NAME_START_CHAR``.\n */\nfunction isNameStartChar(c) {\n return ((c >= 0x41 && c <= 0x5A) ||\n (c >= 0x61 && c <= 0x7A) ||\n c === 0x3A ||\n c === 0x5F ||\n c === 0x200C ||\n c === 0x200D ||\n (c >= 0xC0 && c <= 0xD6) ||\n (c >= 0xD8 && c <= 0xF6) ||\n (c >= 0x00F8 && c <= 0x02FF) ||\n (c >= 0x0370 && c <= 0x037D) ||\n (c >= 0x037F && c <= 0x1FFF) ||\n (c >= 0x2070 && c <= 0x218F) ||\n (c >= 0x2C00 && c <= 0x2FEF) ||\n (c >= 0x3001 && c <= 0xD7FF) ||\n (c >= 0xF900 && c <= 0xFDCF) ||\n (c >= 0xFDF0 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0xEFFFF));\n}\nexports.isNameStartChar = isNameStartChar;\n/**\n * Determines whether a codepoint matches the ``NAME_CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``NAME_CHAR``.\n */\nfunction isNameChar(c) {\n return isNameStartChar(c) ||\n (c >= 0x30 && c <= 0x39) ||\n c === 0x2D ||\n c === 0x2E ||\n c === 0xB7 ||\n (c >= 0x0300 && c <= 0x036F) ||\n (c >= 0x203F && c <= 0x2040);\n}\nexports.isNameChar = isNameChar;\n//# sourceMappingURL=ed5.js.map","\"use strict\";\n/**\n * Character classes and associated utilities for the 2nd edition of XML 1.1.\n *\n * @author Louis-Dominique Dubeau\n * @license MIT\n * @copyright Louis-Dominique Dubeau\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//\n// Fragments.\n//\nexports.CHAR = \"\\u0001-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\";\nexports.RESTRICTED_CHAR = \"\\u0001-\\u0008\\u000B\\u000C\\u000E-\\u001F\\u007F-\\u0084\\u0086-\\u009F\";\nexports.S = \" \\t\\r\\n\";\n// tslint:disable-next-line:max-line-length\nexports.NAME_START_CHAR = \":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\\uD800\\uDC00-\\uDB7F\\uDFFF\";\nexports.NAME_CHAR = \"-\" + exports.NAME_START_CHAR + \".0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040\";\n//\n// Regular expressions.\n//\nexports.CHAR_RE = new RegExp(\"^[\" + exports.CHAR + \"]$\", \"u\");\nexports.RESTRICTED_CHAR_RE = new RegExp(\"^[\" + exports.RESTRICTED_CHAR + \"]$\", \"u\");\nexports.S_RE = new RegExp(\"^[\" + exports.S + \"]+$\", \"u\");\nexports.NAME_START_CHAR_RE = new RegExp(\"^[\" + exports.NAME_START_CHAR + \"]$\", \"u\");\nexports.NAME_CHAR_RE = new RegExp(\"^[\" + exports.NAME_CHAR + \"]$\", \"u\");\nexports.NAME_RE = new RegExp(\"^[\" + exports.NAME_START_CHAR + \"][\" + exports.NAME_CHAR + \"]*$\", \"u\");\nexports.NMTOKEN_RE = new RegExp(\"^[\" + exports.NAME_CHAR + \"]+$\", \"u\");\nvar TAB = 9;\nvar NL = 0xA;\nvar CR = 0xD;\nvar SPACE = 0x20;\n//\n// Lists.\n//\n/** All characters in the ``S`` production. */\nexports.S_LIST = [SPACE, NL, CR, TAB];\n/**\n * Determines whether a codepoint matches the ``CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``CHAR``.\n */\nfunction isChar(c) {\n return (c >= 0x0001 && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}\nexports.isChar = isChar;\n/**\n * Determines whether a codepoint matches the ``RESTRICTED_CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``RESTRICTED_CHAR``.\n */\nfunction isRestrictedChar(c) {\n return (c >= 0x1 && c <= 0x8) ||\n c === 0xB ||\n c === 0xC ||\n (c >= 0xE && c <= 0x1F) ||\n (c >= 0x7F && c <= 0x84) ||\n (c >= 0x86 && c <= 0x9F);\n}\nexports.isRestrictedChar = isRestrictedChar;\n/**\n * Determines whether a codepoint matches the ``CHAR`` production and does not\n * match the ``RESTRICTED_CHAR`` production. ``isCharAndNotRestricted(x)`` is\n * equivalent to ``isChar(x) && !isRestrictedChar(x)``. This function is faster\n * than running the two-call equivalent.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``CHAR`` and does not match\n * ``RESTRICTED_CHAR``.\n */\nfunction isCharAndNotRestricted(c) {\n return (c === 0x9) ||\n (c === 0xA) ||\n (c === 0xD) ||\n (c > 0x1F && c < 0x7F) ||\n (c === 0x85) ||\n (c > 0x9F && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}\nexports.isCharAndNotRestricted = isCharAndNotRestricted;\n/**\n * Determines whether a codepoint matches the ``S`` (space) production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``S``.\n */\nfunction isS(c) {\n return c === SPACE || c === NL || c === CR || c === TAB;\n}\nexports.isS = isS;\n/**\n * Determines whether a codepoint matches the ``NAME_START_CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``NAME_START_CHAR``.\n */\n// tslint:disable-next-line:cyclomatic-complexity\nfunction isNameStartChar(c) {\n return ((c >= 0x41 && c <= 0x5A) ||\n (c >= 0x61 && c <= 0x7A) ||\n c === 0x3A ||\n c === 0x5F ||\n c === 0x200C ||\n c === 0x200D ||\n (c >= 0xC0 && c <= 0xD6) ||\n (c >= 0xD8 && c <= 0xF6) ||\n (c >= 0x00F8 && c <= 0x02FF) ||\n (c >= 0x0370 && c <= 0x037D) ||\n (c >= 0x037F && c <= 0x1FFF) ||\n (c >= 0x2070 && c <= 0x218F) ||\n (c >= 0x2C00 && c <= 0x2FEF) ||\n (c >= 0x3001 && c <= 0xD7FF) ||\n (c >= 0xF900 && c <= 0xFDCF) ||\n (c >= 0xFDF0 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0xEFFFF));\n}\nexports.isNameStartChar = isNameStartChar;\n/**\n * Determines whether a codepoint matches the ``NAME_CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``NAME_CHAR``.\n */\nfunction isNameChar(c) {\n return isNameStartChar(c) ||\n (c >= 0x30 && c <= 0x39) ||\n c === 0x2D ||\n c === 0x2E ||\n c === 0xB7 ||\n (c >= 0x0300 && c <= 0x036F) ||\n (c >= 0x203F && c <= 0x2040);\n}\nexports.isNameChar = isNameChar;\n//# sourceMappingURL=ed2.js.map","\"use strict\";\n/**\n * Character class utilities for XML NS 1.0 edition 3.\n *\n * @author Louis-Dominique Dubeau\n * @license MIT\n * @copyright Louis-Dominique Dubeau\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//\n// Fragments.\n//\n// tslint:disable-next-line:max-line-length\nexports.NC_NAME_START_CHAR = \"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\\uD800\\uDC00-\\uDB7F\\uDFFF\";\nexports.NC_NAME_CHAR = \"-\" + exports.NC_NAME_START_CHAR + \".0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040\";\n//\n// Regular expressions.\n//\nexports.NC_NAME_START_CHAR_RE = new RegExp(\"^[\" + exports.NC_NAME_START_CHAR + \"]$\", \"u\");\nexports.NC_NAME_CHAR_RE = new RegExp(\"^[\" + exports.NC_NAME_CHAR + \"]$\", \"u\");\nexports.NC_NAME_RE = new RegExp(\"^[\" + exports.NC_NAME_START_CHAR + \"][\" + exports.NC_NAME_CHAR + \"]*$\", \"u\");\n/**\n * Determines whether a codepoint matches [[NC_NAME_START_CHAR]].\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches.\n */\n// tslint:disable-next-line:cyclomatic-complexity\nfunction isNCNameStartChar(c) {\n return ((c >= 0x41 && c <= 0x5A) ||\n c === 0x5F ||\n (c >= 0x61 && c <= 0x7A) ||\n (c >= 0xC0 && c <= 0xD6) ||\n (c >= 0xD8 && c <= 0xF6) ||\n (c >= 0x00F8 && c <= 0x02FF) ||\n (c >= 0x0370 && c <= 0x037D) ||\n (c >= 0x037F && c <= 0x1FFF) ||\n (c >= 0x200C && c <= 0x200D) ||\n (c >= 0x2070 && c <= 0x218F) ||\n (c >= 0x2C00 && c <= 0x2FEF) ||\n (c >= 0x3001 && c <= 0xD7FF) ||\n (c >= 0xF900 && c <= 0xFDCF) ||\n (c >= 0xFDF0 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0xEFFFF));\n}\nexports.isNCNameStartChar = isNCNameStartChar;\n/**\n * Determines whether a codepoint matches [[NC_NAME_CHAR]].\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches.\n */\nfunction isNCNameChar(c) {\n return isNCNameStartChar(c) ||\n (c === 0x2D ||\n c === 0x2E ||\n (c >= 0x30 && c <= 0x39) ||\n c === 0x00B7 ||\n (c >= 0x0300 && c <= 0x036F) ||\n (c >= 0x203F && c <= 0x2040));\n}\nexports.isNCNameChar = isNCNameChar;\n//# sourceMappingURL=ed3.js.map","import { RdfXmlParser } from 'rdfxml-streaming-parser';\nclass CustomRdfXmlParser extends RdfXmlParser {\n constructor({ factory, ...args } = {}) {\n super({ ...args, dataFactory: factory });\n }\n}\nexport default CustomRdfXmlParser;\n"],"names":["Object","defineProperty","exports","value","SaxesParser","EVENTS","ed5","ed2","NSed3","isS","isChar10","isChar","isNameStartChar","isNameChar","S_LIST","NAME_RE","isChar11","isNCNameStartChar","isNCNameChar","NC_NAME_RE","XML_NAMESPACE","XMLNS_NAMESPACE","rootNS","__proto__","xml","xmlns","XML_ENTITIES","amp","gt","lt","quot","apos","EOC","NL_LIKE","S_BEGIN","S_BEGIN_WHITESPACE","S_DOCTYPE","S_DOCTYPE_QUOTE","S_DTD","S_DTD_QUOTED","S_DTD_OPEN_WAKA","S_DTD_OPEN_WAKA_BANG","S_DTD_COMMENT","S_DTD_COMMENT_ENDING","S_DTD_COMMENT_ENDED","S_DTD_PI","S_DTD_PI_ENDING","S_TEXT","S_ENTITY","S_OPEN_WAKA","S_OPEN_WAKA_BANG","S_COMMENT","S_COMMENT_ENDING","S_COMMENT_ENDED","S_CDATA","S_CDATA_ENDING","S_CDATA_ENDING_2","S_PI_FIRST_CHAR","S_PI_REST","S_PI_BODY","S_PI_ENDING","S_XML_DECL_NAME_START","S_XML_DECL_NAME","S_XML_DECL_EQ","S_XML_DECL_VALUE_START","S_XML_DECL_VALUE","S_XML_DECL_SEPARATOR","S_XML_DECL_ENDING","S_OPEN_TAG","S_OPEN_TAG_SLASH","S_ATTRIB","S_ATTRIB_NAME","S_ATTRIB_NAME_SAW_WHITE","S_ATTRIB_VALUE","S_ATTRIB_VALUE_QUOTED","S_ATTRIB_VALUE_CLOSED","S_ATTRIB_VALUE_UNQUOTED","S_CLOSE_TAG","S_CLOSE_TAG_SAW_WHITE","TAB","NL","CR","SPACE","BANG","DQUOTE","AMP","SQUOTE","MINUS","FORWARD_SLASH","SEMICOLON","LESS","EQUAL","GREATER","QUESTION","OPEN_BRACKET","CLOSE_BRACKET","NEL","LS","isQuote","c","QUOTES","DOCTYPE_TERMINATOR","DTD_TERMINATOR","XML_DECL_NAME_TERMINATOR","ATTRIB_VALUE_UNQUOTED_TERMINATOR","nsPairCheck","parser","prefix","uri","fail","nsMappingCheck","mapping","local","keys","isNCName","name","test","isName","FORBIDDEN_START","FORBIDDEN_BRACKET","FORBIDDEN_BRACKET_BRACKET","EVENT_NAME_TO_HANDLER_NAME","xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready","closed","this","_closed","constructor","opt","fragmentOpt","fragment","xmlnsOpt","trackPosition","position","fileName","nameStartCheck","nameCheck","processAttribs","processAttribsNS","pushAttrib","pushAttribNS","ns","assign","additional","additionalNamespaces","processAttribsPlain","pushAttribPlain","stateTable","sBegin","sBeginWhitespace","sDoctype","sDoctypeQuote","sDTD","sDTDQuoted","sDTDOpenWaka","sDTDOpenWakaBang","sDTDComment","sDTDCommentEnding","sDTDCommentEnded","sDTDPI","sDTDPIEnding","sText","sEntity","sOpenWaka","sOpenWakaBang","sComment","sCommentEnding","sCommentEnded","sCData","sCDataEnding","sCDataEnding2","sPIFirstChar","sPIRest","sPIBody","sPIEnding","sXMLDeclNameStart","sXMLDeclName","sXMLDeclEq","sXMLDeclValueStart","sXMLDeclValue","sXMLDeclSeparator","sXMLDeclEnding","sOpenTag","sOpenTagSlash","sAttrib","sAttribName","sAttribNameSawWhite","sAttribValue","sAttribValueQuoted","sAttribValueClosed","sAttribValueUnquoted","sCloseTag","sCloseTagSawWhite","_init","_a","openWakaBang","piTarget","entity","q","tags","tag","topNS","chunk","chunkPosition","i","prevI","carriedFromPrevious","undefined","forbiddenState","attribList","state","reportedTextBeforeRoot","reportedTextAfterRoot","closedRoot","sawRoot","xmlDeclPossible","xmlDeclExpects","entityReturnState","defaultXMLVersion","forceXMLVersion","Error","setXMLVersion","positionAtNewLine","xmlDecl","version","encoding","standalone","line","column","ENTITIES","create","readyHandler","call","columnIndex","on","handler","off","makeError","message","msg","length","err","errorHandler","write","toString","limit","lastCode","charCodeAt","slice","close","getCode10","code","final","getCode11","next","getCodeNorm","getCode","unget","captureTo","chars","start","isNLLike","includes","captureToChar","char","captureNameChars","skipSpaces","currentXMLVersion","iBefore","doctypeHandler","String","fromCodePoint","owb","handleTextInRoot","handleTextOutsideRoot","loop","parsed","parseEntity","textHandler","commentHandler","cdataHandler","isQuestion","toLowerCase","piHandler","target","body","join","xmldeclHandler","attributes","openTagStartHandler","openTag","openSelfClosingTag","closeTag","scanLoop","nonSpace","outRootLoop","qname","attr","push","attributeHandler","trimmed","trim","_b","pop","endHandler","resolve","index","resolvePrefix","colon","indexOf","JSON","stringify","seen","Set","eqname","has","add","isSelfClosing","openTagHandler","_c","closeTagHandler","top","l","defined","num","NaN","parseInt","__createBinding","o","m","k","k2","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","__exportStar","p","prototype","hasOwnProperty","ParseError","saxParser","super","ParseType","RdfXmlParser","relative_to_absolute_iri_1","saxes_1","readable_stream_1","ParseError_1","rdf_data_factory_1","validate_iri_1","Transform","args","readableObjectMode","activeTagStack","nodeIds","options","dataFactory","DataFactory","baseIRI","defaultGraph","validateUri","iriValidationStrategy","IriValidationStrategy","Pragmatic","None","attachSaxListeners","import","stream","output","PassThrough","emit","data","pipe","_transform","callback","e","newParseError","valueToUri","activeTag","uriToNamedNode","uriValidationResult","validateIri","namedNode","validateNcname","NCNAME_MATCHER","onTag","bind","onText","onCloseTag","onDoctype","parentTag","currentParseType","RESOURCE","hadChildren","childrenParseType","childrenStringTags","tagName","attributeKey","tagContents","tagString","stringActiveTag","childrenStringEmitClosingTag","language","onTagResource","onTagProperty","rootTag","PROPERTY","typedNode","RDF","FORBIDDEN_NODE_ELEMENTS","predicates","objects","activeSubjectValue","claimSubjectNodeId","subjectValueBlank","explicitType","XML","subject","blankNode","claimNodeId","type","emitTriple","reifiedStatementId","predicate","childrenCollectionSubject","linkTerm","childrenCollectionPredicate","predicateSubPredicates","predicateSubObjects","predicateEmitted","object","literal","datatype","listItemCounter","FORBIDDEN_PROPERTY_ELEMENTS","parseType","attributedProperty","activeSubSubjectValue","subSubjectValueBlank","propertyAttributeKey","propertyAttribute","nestedBNode","childrenTagsToString","subjectParent","statementId","quad","term","allowDuplicateRdfIds","poppedTag","replace","match","MIME_TYPE","BlankNode","termType","equals","other","BlankNode_1","DefaultGraph_1","Literal_1","NamedNode_1","Quad_1","Variable_1","dataFactoryCounter","blankNodeCounter","blankNodePrefix","NamedNode","languageOrDatatype","Literal","variable","Variable","DefaultGraph","INSTANCE","graph","Quad","fromTerm","original","XSD_STRING","fromQuad","resetBlankNodeCounter","RDF_LANGUAGE_STRING","relativeIRI","baseFragmentPos","substr","startsWith","baseQueryPos","relativeColonPos","removeDotSegmentsOfPath","valueColonPos","baseColonPos","baseIRIScheme","baseSlashAfterColonPos","removeDotSegments","baseIRIPath","baseIRILastSlashPos","lastIndexOf","path","segmentBuffers","isCharacterAllowedAfterRelativePathSegment","map","buffer","iri","colonPosition","searchOffset","pathSeparator","base","character","buildAbsoluteIriRfc3987Regex","sub_delims_raw","sub_delims","pct_encoded","dec_octet","ipv4address","h16","ls32","ipv6address","ipvfuture","ip_literal","port","scheme","iprivate_raw","iprivate","ucschar_raw","iunreserved_raw","iunreserved","ipchar","ifragment","iquery","isegment_nz","isegment","ipath_empty","ipath_rootless","ipath_absolute","ipath_abempty","ireg_name","ihost","iuserinfo","iauthority","ihier_part","RegExp","STRICT_IRI_REGEX","PRAGMATIC_IRI_REGEX","strategy","Strict","CHAR","S","NAME_START_CHAR","NAME_CHAR","CHAR_RE","S_RE","NAME_START_CHAR_RE","NAME_CHAR_RE","NMTOKEN_RE","RESTRICTED_CHAR","RESTRICTED_CHAR_RE","isRestrictedChar","isCharAndNotRestricted","NC_NAME_START_CHAR","NC_NAME_CHAR","NC_NAME_START_CHAR_RE","NC_NAME_CHAR_RE","CustomRdfXmlParser","factory"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"js/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MAAM,IAAKU,EAAMK,YAAa6M,GAClC,EAEJ,c","sources":["webpack://mobilitydcatap-ui/./node_modules/@rubensworks/saxes/saxes.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/rdfxml-streaming-parser/index.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/rdfxml-streaming-parser/lib/ParseError.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/rdfxml-streaming-parser/lib/RdfXmlParser.js","webpack://mobilitydcatap-ui/./node_modules/rdf-data-factory/index.js","webpack://mobilitydcatap-ui/./node_modules/rdf-data-factory/lib/BlankNode.js","webpack://mobilitydcatap-ui/./node_modules/rdf-data-factory/lib/DataFactory.js","webpack://mobilitydcatap-ui/./node_modules/rdf-data-factory/lib/DefaultGraph.js","webpack://mobilitydcatap-ui/./node_modules/rdf-data-factory/lib/Literal.js","webpack://mobilitydcatap-ui/./node_modules/rdf-data-factory/lib/NamedNode.js","webpack://mobilitydcatap-ui/./node_modules/rdf-data-factory/lib/Quad.js","webpack://mobilitydcatap-ui/./node_modules/rdf-data-factory/lib/Variable.js","webpack://mobilitydcatap-ui/./node_modules/relative-to-absolute-iri/index.js","webpack://mobilitydcatap-ui/./node_modules/relative-to-absolute-iri/lib/Resolve.js","webpack://mobilitydcatap-ui/./node_modules/validate-iri/index.js","webpack://mobilitydcatap-ui/./node_modules/validate-iri/lib/Validate.js","webpack://mobilitydcatap-ui/./node_modules/xmlchars/xml/1.0/ed5.js","webpack://mobilitydcatap-ui/./node_modules/xmlchars/xml/1.1/ed2.js","webpack://mobilitydcatap-ui/./node_modules/xmlchars/xmlns/1.0/ed3.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/lib/CustomRdfXmlParser.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SaxesParser = exports.EVENTS = void 0;\nconst ed5 = require(\"xmlchars/xml/1.0/ed5\");\nconst ed2 = require(\"xmlchars/xml/1.1/ed2\");\nconst NSed3 = require(\"xmlchars/xmlns/1.0/ed3\");\nvar isS = ed5.isS;\nvar isChar10 = ed5.isChar;\nvar isNameStartChar = ed5.isNameStartChar;\nvar isNameChar = ed5.isNameChar;\nvar S_LIST = ed5.S_LIST;\nvar NAME_RE = ed5.NAME_RE;\nvar isChar11 = ed2.isChar;\nvar isNCNameStartChar = NSed3.isNCNameStartChar;\nvar isNCNameChar = NSed3.isNCNameChar;\nvar NC_NAME_RE = NSed3.NC_NAME_RE;\nconst XML_NAMESPACE = \"http://www.w3.org/XML/1998/namespace\";\nconst XMLNS_NAMESPACE = \"http://www.w3.org/2000/xmlns/\";\nconst rootNS = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment\n __proto__: null,\n xml: XML_NAMESPACE,\n xmlns: XMLNS_NAMESPACE,\n};\nconst XML_ENTITIES = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment\n __proto__: null,\n amp: \"&\",\n gt: \">\",\n lt: \"<\",\n quot: \"\\\"\",\n apos: \"'\",\n};\n// EOC: end-of-chunk\nconst EOC = -1;\nconst NL_LIKE = -2;\nconst S_BEGIN = 0; // Initial state.\nconst S_BEGIN_WHITESPACE = 1; // leading whitespace\nconst S_DOCTYPE = 2; // \nconst TAB = 9;\nconst NL = 0xA;\nconst CR = 0xD;\nconst SPACE = 0x20;\nconst BANG = 0x21;\nconst DQUOTE = 0x22;\nconst AMP = 0x26;\nconst SQUOTE = 0x27;\nconst MINUS = 0x2D;\nconst FORWARD_SLASH = 0x2F;\nconst SEMICOLON = 0x3B;\nconst LESS = 0x3C;\nconst EQUAL = 0x3D;\nconst GREATER = 0x3E;\nconst QUESTION = 0x3F;\nconst OPEN_BRACKET = 0x5B;\nconst CLOSE_BRACKET = 0x5D;\nconst NEL = 0x85;\nconst LS = 0x2028; // Line Separator\nconst isQuote = (c) => c === DQUOTE || c === SQUOTE;\nconst QUOTES = [DQUOTE, SQUOTE];\nconst DOCTYPE_TERMINATOR = [...QUOTES, OPEN_BRACKET, GREATER];\nconst DTD_TERMINATOR = [...QUOTES, LESS, CLOSE_BRACKET];\nconst XML_DECL_NAME_TERMINATOR = [EQUAL, QUESTION, ...S_LIST];\nconst ATTRIB_VALUE_UNQUOTED_TERMINATOR = [...S_LIST, GREATER, AMP, LESS];\nfunction nsPairCheck(parser, prefix, uri) {\n switch (prefix) {\n case \"xml\":\n if (uri !== XML_NAMESPACE) {\n parser.fail(`xml prefix must be bound to ${XML_NAMESPACE}.`);\n }\n break;\n case \"xmlns\":\n if (uri !== XMLNS_NAMESPACE) {\n parser.fail(`xmlns prefix must be bound to ${XMLNS_NAMESPACE}.`);\n }\n break;\n default:\n }\n switch (uri) {\n case XMLNS_NAMESPACE:\n parser.fail(prefix === \"\" ?\n `the default namespace may not be set to ${uri}.` :\n `may not assign a prefix (even \"xmlns\") to the URI \\\n${XMLNS_NAMESPACE}.`);\n break;\n case XML_NAMESPACE:\n switch (prefix) {\n case \"xml\":\n // Assinging the XML namespace to \"xml\" is fine.\n break;\n case \"\":\n parser.fail(`the default namespace may not be set to ${uri}.`);\n break;\n default:\n parser.fail(\"may not assign the xml namespace to another prefix.\");\n }\n break;\n default:\n }\n}\nfunction nsMappingCheck(parser, mapping) {\n for (const local of Object.keys(mapping)) {\n nsPairCheck(parser, local, mapping[local]);\n }\n}\nconst isNCName = (name) => NC_NAME_RE.test(name);\nconst isName = (name) => NAME_RE.test(name);\nconst FORBIDDEN_START = 0;\nconst FORBIDDEN_BRACKET = 1;\nconst FORBIDDEN_BRACKET_BRACKET = 2;\n/**\n * The list of supported events.\n */\nexports.EVENTS = [\n \"xmldecl\",\n \"text\",\n \"processinginstruction\",\n \"doctype\",\n \"comment\",\n \"opentagstart\",\n \"attribute\",\n \"opentag\",\n \"closetag\",\n \"cdata\",\n \"error\",\n \"end\",\n \"ready\",\n];\nconst EVENT_NAME_TO_HANDLER_NAME = {\n xmldecl: \"xmldeclHandler\",\n text: \"textHandler\",\n processinginstruction: \"piHandler\",\n doctype: \"doctypeHandler\",\n comment: \"commentHandler\",\n opentagstart: \"openTagStartHandler\",\n attribute: \"attributeHandler\",\n opentag: \"openTagHandler\",\n closetag: \"closeTagHandler\",\n cdata: \"cdataHandler\",\n error: \"errorHandler\",\n end: \"endHandler\",\n ready: \"readyHandler\",\n};\n// eslint-disable-next-line @typescript-eslint/ban-types\nclass SaxesParser {\n /**\n * Indicates whether or not the parser is closed. If ``true``, wait for\n * the ``ready`` event to write again.\n */\n get closed() {\n return this._closed;\n }\n /**\n * @param opt The parser options.\n */\n constructor(opt) {\n this.opt = opt !== null && opt !== void 0 ? opt : {};\n this.fragmentOpt = !!this.opt.fragment;\n const xmlnsOpt = this.xmlnsOpt = !!this.opt.xmlns;\n this.trackPosition = this.opt.position !== false;\n this.fileName = this.opt.fileName;\n if (xmlnsOpt) {\n // This is the function we use to perform name checks on PIs and entities.\n // When namespaces are used, colons are not allowed in PI target names or\n // entity names. So the check depends on whether namespaces are used. See:\n //\n // https://www.w3.org/XML/xml-names-19990114-errata.html\n // NE08\n //\n this.nameStartCheck = isNCNameStartChar;\n this.nameCheck = isNCNameChar;\n this.isName = isNCName;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.processAttribs = this.processAttribsNS;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.pushAttrib = this.pushAttribNS;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment\n this.ns = Object.assign({ __proto__: null }, rootNS);\n const additional = this.opt.additionalNamespaces;\n if (additional != null) {\n nsMappingCheck(this, additional);\n Object.assign(this.ns, additional);\n }\n }\n else {\n this.nameStartCheck = isNameStartChar;\n this.nameCheck = isNameChar;\n this.isName = isName;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.processAttribs = this.processAttribsPlain;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.pushAttrib = this.pushAttribPlain;\n }\n //\n // The order of the members in this table needs to correspond to the state\n // numbers given to the states that correspond to the methods being recorded\n // here.\n //\n this.stateTable = [\n /* eslint-disable @typescript-eslint/unbound-method */\n this.sBegin,\n this.sBeginWhitespace,\n this.sDoctype,\n this.sDoctypeQuote,\n this.sDTD,\n this.sDTDQuoted,\n this.sDTDOpenWaka,\n this.sDTDOpenWakaBang,\n this.sDTDComment,\n this.sDTDCommentEnding,\n this.sDTDCommentEnded,\n this.sDTDPI,\n this.sDTDPIEnding,\n this.sText,\n this.sEntity,\n this.sOpenWaka,\n this.sOpenWakaBang,\n this.sComment,\n this.sCommentEnding,\n this.sCommentEnded,\n this.sCData,\n this.sCDataEnding,\n this.sCDataEnding2,\n this.sPIFirstChar,\n this.sPIRest,\n this.sPIBody,\n this.sPIEnding,\n this.sXMLDeclNameStart,\n this.sXMLDeclName,\n this.sXMLDeclEq,\n this.sXMLDeclValueStart,\n this.sXMLDeclValue,\n this.sXMLDeclSeparator,\n this.sXMLDeclEnding,\n this.sOpenTag,\n this.sOpenTagSlash,\n this.sAttrib,\n this.sAttribName,\n this.sAttribNameSawWhite,\n this.sAttribValue,\n this.sAttribValueQuoted,\n this.sAttribValueClosed,\n this.sAttribValueUnquoted,\n this.sCloseTag,\n this.sCloseTagSawWhite,\n /* eslint-enable @typescript-eslint/unbound-method */\n ];\n this._init();\n }\n _init() {\n var _a;\n this.openWakaBang = \"\";\n this.text = \"\";\n this.name = \"\";\n this.piTarget = \"\";\n this.entity = \"\";\n this.q = null;\n this.tags = [];\n this.tag = null;\n this.topNS = null;\n this.chunk = \"\";\n this.chunkPosition = 0;\n this.i = 0;\n this.prevI = 0;\n this.carriedFromPrevious = undefined;\n this.forbiddenState = FORBIDDEN_START;\n this.attribList = [];\n // The logic is organized so as to minimize the need to check\n // this.opt.fragment while parsing.\n const { fragmentOpt } = this;\n this.state = fragmentOpt ? S_TEXT : S_BEGIN;\n // We want these to be all true if we are dealing with a fragment.\n this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot =\n this.sawRoot = fragmentOpt;\n // An XML declaration is intially possible only when parsing whole\n // documents.\n this.xmlDeclPossible = !fragmentOpt;\n this.xmlDeclExpects = [\"version\"];\n this.entityReturnState = undefined;\n let { defaultXMLVersion } = this.opt;\n if (defaultXMLVersion === undefined) {\n if (this.opt.forceXMLVersion === true) {\n throw new Error(\"forceXMLVersion set but defaultXMLVersion is not set\");\n }\n defaultXMLVersion = \"1.0\";\n }\n this.setXMLVersion(defaultXMLVersion);\n this.positionAtNewLine = 0;\n this.doctype = false;\n this._closed = false;\n this.xmlDecl = {\n version: undefined,\n encoding: undefined,\n standalone: undefined,\n };\n this.line = 1;\n this.column = 0;\n this.ENTITIES = Object.create(XML_ENTITIES);\n (_a = this.readyHandler) === null || _a === void 0 ? void 0 : _a.call(this);\n }\n /**\n * The stream position the parser is currently looking at. This field is\n * zero-based.\n *\n * This field is not based on counting Unicode characters but is to be\n * interpreted as a plain index into a JavaScript string.\n */\n get position() {\n return this.chunkPosition + this.i;\n }\n /**\n * The column number of the next character to be read by the parser. *\n * This field is zero-based. (The first column in a line is 0.)\n *\n * This field reports the index at which the next character would be in the\n * line if the line were represented as a JavaScript string. Note that this\n * *can* be different to a count based on the number of *Unicode characters*\n * due to how JavaScript handles astral plane characters.\n *\n * See [[column]] for a number that corresponds to a count of Unicode\n * characters.\n */\n get columnIndex() {\n return this.position - this.positionAtNewLine;\n }\n /**\n * Set an event listener on an event. The parser supports one handler per\n * event type. If you try to set an event handler over an existing handler,\n * the old handler is silently overwritten.\n *\n * @param name The event to listen to.\n *\n * @param handler The handler to set.\n */\n on(name, handler) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n this[EVENT_NAME_TO_HANDLER_NAME[name]] = handler;\n }\n /**\n * Unset an event handler.\n *\n * @parma name The event to stop listening to.\n */\n off(name) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n this[EVENT_NAME_TO_HANDLER_NAME[name]] = undefined;\n }\n /**\n * Make an error object. The error object will have a message that contains\n * the ``fileName`` option passed at the creation of the parser. If position\n * tracking was turned on, it will also have line and column number\n * information.\n *\n * @param message The message describing the error to report.\n *\n * @returns An error object with a properly formatted message.\n */\n makeError(message) {\n var _a;\n let msg = (_a = this.fileName) !== null && _a !== void 0 ? _a : \"\";\n if (this.trackPosition) {\n if (msg.length > 0) {\n msg += \":\";\n }\n msg += `${this.line}:${this.column}`;\n }\n if (msg.length > 0) {\n msg += \": \";\n }\n return new Error(msg + message);\n }\n /**\n * Report a parsing error. This method is made public so that client code may\n * check for issues that are outside the scope of this project and can report\n * errors.\n *\n * @param message The error to report.\n *\n * @returns this\n */\n fail(message) {\n const err = this.makeError(message);\n const handler = this.errorHandler;\n if (handler === undefined) {\n throw err;\n }\n else {\n handler(err);\n }\n return this;\n }\n /**\n * Write a XML data to the parser.\n *\n * @param chunk The XML data to write.\n *\n * @returns this\n */\n // We do need object for the type here. Yes, it often causes problems\n // but not in this case.\n write(chunk) {\n if (this.closed) {\n return this.fail(\"cannot write after close; assign an onready handler.\");\n }\n let end = false;\n if (chunk === null) {\n // We cannot return immediately because carriedFromPrevious may need\n // processing.\n end = true;\n chunk = \"\";\n }\n else if (typeof chunk === \"object\") {\n chunk = chunk.toString();\n }\n // We checked if performing a pre-decomposition of the string into an array\n // of single complete characters (``Array.from(chunk)``) would be faster\n // than the current repeated calls to ``charCodeAt``. As of August 2018, it\n // isn't. (There may be Node-specific code that would perform faster than\n // ``Array.from`` but don't want to be dependent on Node.)\n if (this.carriedFromPrevious !== undefined) {\n // The previous chunk had char we must carry over.\n chunk = `${this.carriedFromPrevious}${chunk}`;\n this.carriedFromPrevious = undefined;\n }\n let limit = chunk.length;\n const lastCode = chunk.charCodeAt(limit - 1);\n if (!end &&\n // A trailing CR or surrogate must be carried over to the next\n // chunk.\n (lastCode === CR || (lastCode >= 0xD800 && lastCode <= 0xDBFF))) {\n // The chunk ends with a character that must be carried over. We cannot\n // know how to handle it until we get the next chunk or the end of the\n // stream. So save it for later.\n this.carriedFromPrevious = chunk[limit - 1];\n limit--;\n chunk = chunk.slice(0, limit);\n }\n const { stateTable } = this;\n this.chunk = chunk;\n this.i = 0;\n while (this.i < limit) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument\n stateTable[this.state].call(this);\n }\n this.chunkPosition += limit;\n return end ? this.end() : this;\n }\n /**\n * Close the current stream. Perform final well-formedness checks and reset\n * the parser tstate.\n *\n * @returns this\n */\n close() {\n return this.write(null);\n }\n /**\n * Get a single code point out of the current chunk. This updates the current\n * position if we do position tracking.\n *\n * This is the algorithm to use for XML 1.0.\n *\n * @returns The character read.\n */\n getCode10() {\n const { chunk, i } = this;\n this.prevI = i;\n // Yes, we do this instead of doing this.i++. Doing it this way, we do not\n // read this.i again, which is a bit faster.\n this.i = i + 1;\n if (i >= chunk.length) {\n return EOC;\n }\n // Using charCodeAt and handling the surrogates ourselves is faster\n // than using codePointAt.\n const code = chunk.charCodeAt(i);\n this.column++;\n if (code < 0xD800) {\n if (code >= SPACE || code === TAB) {\n return code;\n }\n switch (code) {\n case NL:\n this.line++;\n this.column = 0;\n this.positionAtNewLine = this.position;\n return NL;\n case CR:\n // We may get NaN if we read past the end of the chunk, which is fine.\n if (chunk.charCodeAt(i + 1) === NL) {\n // A \\r\\n sequence is converted to \\n so we have to skip over the\n // next character. We already know it has a size of 1 so ++ is fine\n // here.\n this.i = i + 2;\n }\n // Otherwise, a \\r is just converted to \\n, so we don't have to skip\n // ahead.\n // In either case, \\r becomes \\n.\n this.line++;\n this.column = 0;\n this.positionAtNewLine = this.position;\n return NL_LIKE;\n default:\n // If we get here, then code < SPACE and it is not NL CR or TAB.\n this.fail(\"disallowed character.\");\n return code;\n }\n }\n if (code > 0xDBFF) {\n // This is a specialized version of isChar10 that takes into account\n // that in this context code > 0xDBFF and code <= 0xFFFF. So it does not\n // test cases that don't need testing.\n if (!(code >= 0xE000 && code <= 0xFFFD)) {\n this.fail(\"disallowed character.\");\n }\n return code;\n }\n const final = 0x10000 + ((code - 0xD800) * 0x400) +\n (chunk.charCodeAt(i + 1) - 0xDC00);\n this.i = i + 2;\n // This is a specialized version of isChar10 that takes into account that in\n // this context necessarily final >= 0x10000.\n if (final > 0x10FFFF) {\n this.fail(\"disallowed character.\");\n }\n return final;\n }\n /**\n * Get a single code point out of the current chunk. This updates the current\n * position if we do position tracking.\n *\n * This is the algorithm to use for XML 1.1.\n *\n * @returns {number} The character read.\n */\n getCode11() {\n const { chunk, i } = this;\n this.prevI = i;\n // Yes, we do this instead of doing this.i++. Doing it this way, we do not\n // read this.i again, which is a bit faster.\n this.i = i + 1;\n if (i >= chunk.length) {\n return EOC;\n }\n // Using charCodeAt and handling the surrogates ourselves is faster\n // than using codePointAt.\n const code = chunk.charCodeAt(i);\n this.column++;\n if (code < 0xD800) {\n if ((code > 0x1F && code < 0x7F) || (code > 0x9F && code !== LS) ||\n code === TAB) {\n return code;\n }\n switch (code) {\n case NL: // 0xA\n this.line++;\n this.column = 0;\n this.positionAtNewLine = this.position;\n return NL;\n case CR: { // 0xD\n // We may get NaN if we read past the end of the chunk, which is\n // fine.\n const next = chunk.charCodeAt(i + 1);\n if (next === NL || next === NEL) {\n // A CR NL or CR NEL sequence is converted to NL so we have to skip\n // over the next character. We already know it has a size of 1.\n this.i = i + 2;\n }\n // Otherwise, a CR is just converted to NL, no skip.\n }\n /* yes, fall through */\n case NEL: // 0x85\n case LS: // Ox2028\n this.line++;\n this.column = 0;\n this.positionAtNewLine = this.position;\n return NL_LIKE;\n default:\n this.fail(\"disallowed character.\");\n return code;\n }\n }\n if (code > 0xDBFF) {\n // This is a specialized version of isCharAndNotRestricted that takes into\n // account that in this context code > 0xDBFF and code <= 0xFFFF. So it\n // does not test cases that don't need testing.\n if (!(code >= 0xE000 && code <= 0xFFFD)) {\n this.fail(\"disallowed character.\");\n }\n return code;\n }\n const final = 0x10000 + ((code - 0xD800) * 0x400) +\n (chunk.charCodeAt(i + 1) - 0xDC00);\n this.i = i + 2;\n // This is a specialized version of isCharAndNotRestricted that takes into\n // account that in this context necessarily final >= 0x10000.\n if (final > 0x10FFFF) {\n this.fail(\"disallowed character.\");\n }\n return final;\n }\n /**\n * Like ``getCode`` but with the return value normalized so that ``NL`` is\n * returned for ``NL_LIKE``.\n */\n getCodeNorm() {\n const c = this.getCode();\n return c === NL_LIKE ? NL : c;\n }\n unget() {\n this.i = this.prevI;\n this.column--;\n }\n /**\n * Capture characters into a buffer until encountering one of a set of\n * characters.\n *\n * @param chars An array of codepoints. Encountering a character in the array\n * ends the capture. (``chars`` may safely contain ``NL``.)\n *\n * @return The character code that made the capture end, or ``EOC`` if we hit\n * the end of the chunk. The return value cannot be NL_LIKE: NL is returned\n * instead.\n */\n captureTo(chars) {\n let { i: start } = this;\n const { chunk } = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const c = this.getCode();\n const isNLLike = c === NL_LIKE;\n const final = isNLLike ? NL : c;\n if (final === EOC || chars.includes(final)) {\n this.text += chunk.slice(start, this.prevI);\n return final;\n }\n if (isNLLike) {\n this.text += `${chunk.slice(start, this.prevI)}\\n`;\n start = this.i;\n }\n }\n }\n /**\n * Capture characters into a buffer until encountering a character.\n *\n * @param char The codepoint that ends the capture. **NOTE ``char`` MAY NOT\n * CONTAIN ``NL``.** Passing ``NL`` will result in buggy behavior.\n *\n * @return ``true`` if we ran into the character. Otherwise, we ran into the\n * end of the current chunk.\n */\n captureToChar(char) {\n let { i: start } = this;\n const { chunk } = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n let c = this.getCode();\n switch (c) {\n case NL_LIKE:\n this.text += `${chunk.slice(start, this.prevI)}\\n`;\n start = this.i;\n c = NL;\n break;\n case EOC:\n this.text += chunk.slice(start);\n return false;\n default:\n }\n if (c === char) {\n this.text += chunk.slice(start, this.prevI);\n return true;\n }\n }\n }\n /**\n * Capture characters that satisfy ``isNameChar`` into the ``name`` field of\n * this parser.\n *\n * @return The character code that made the test fail, or ``EOC`` if we hit\n * the end of the chunk. The return value cannot be NL_LIKE: NL is returned\n * instead.\n */\n captureNameChars() {\n const { chunk, i: start } = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const c = this.getCode();\n if (c === EOC) {\n this.name += chunk.slice(start);\n return EOC;\n }\n // NL is not a name char so we don't have to test specifically for it.\n if (!isNameChar(c)) {\n this.name += chunk.slice(start, this.prevI);\n return c === NL_LIKE ? NL : c;\n }\n }\n }\n /**\n * Skip white spaces.\n *\n * @return The character that ended the skip, or ``EOC`` if we hit\n * the end of the chunk. The return value cannot be NL_LIKE: NL is returned\n * instead.\n */\n skipSpaces() {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const c = this.getCodeNorm();\n if (c === EOC || !isS(c)) {\n return c;\n }\n }\n }\n setXMLVersion(version) {\n this.currentXMLVersion = version;\n /* eslint-disable @typescript-eslint/unbound-method */\n if (version === \"1.0\") {\n this.isChar = isChar10;\n this.getCode = this.getCode10;\n }\n else {\n this.isChar = isChar11;\n this.getCode = this.getCode11;\n }\n /* eslint-enable @typescript-eslint/unbound-method */\n }\n // STATE ENGINE METHODS\n // This needs to be a state separate from S_BEGIN_WHITESPACE because we want\n // to be sure never to come back to this state later.\n sBegin() {\n // We are essentially peeking at the first character of the chunk. Since\n // S_BEGIN can be in effect only when we start working on the first chunk,\n // the index at which we must look is necessarily 0. Note also that the\n // following test does not depend on decoding surrogates.\n // If the initial character is 0xFEFF, ignore it.\n if (this.chunk.charCodeAt(0) === 0xFEFF) {\n this.i++;\n this.column++;\n }\n this.state = S_BEGIN_WHITESPACE;\n }\n sBeginWhitespace() {\n // We need to know whether we've encountered spaces or not because as soon\n // as we run into a space, an XML declaration is no longer possible. Rather\n // than slow down skipSpaces even in places where we don't care whether it\n // skipped anything or not, we check whether prevI is equal to the value of\n // i from before we skip spaces.\n const iBefore = this.i;\n const c = this.skipSpaces();\n if (this.prevI !== iBefore) {\n this.xmlDeclPossible = false;\n }\n switch (c) {\n case LESS:\n this.state = S_OPEN_WAKA;\n // We could naively call closeText but in this state, it is not normal\n // to have text be filled with any data.\n if (this.text.length !== 0) {\n throw new Error(\"no-empty text at start\");\n }\n break;\n case EOC:\n break;\n default:\n this.unget();\n this.state = S_TEXT;\n this.xmlDeclPossible = false;\n }\n }\n sDoctype() {\n var _a;\n const c = this.captureTo(DOCTYPE_TERMINATOR);\n switch (c) {\n case GREATER: {\n (_a = this.doctypeHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);\n this.text = \"\";\n this.state = S_TEXT;\n this.doctype = true; // just remember that we saw it.\n break;\n }\n case EOC:\n break;\n default:\n this.text += String.fromCodePoint(c);\n if (c === OPEN_BRACKET) {\n this.state = S_DTD;\n }\n else if (isQuote(c)) {\n this.state = S_DOCTYPE_QUOTE;\n this.q = c;\n }\n }\n }\n sDoctypeQuote() {\n const q = this.q;\n if (this.captureToChar(q)) {\n this.text += String.fromCodePoint(q);\n this.q = null;\n this.state = S_DOCTYPE;\n }\n }\n sDTD() {\n const c = this.captureTo(DTD_TERMINATOR);\n if (c === EOC) {\n return;\n }\n this.text += String.fromCodePoint(c);\n if (c === CLOSE_BRACKET) {\n this.state = S_DOCTYPE;\n }\n else if (c === LESS) {\n this.state = S_DTD_OPEN_WAKA;\n }\n else if (isQuote(c)) {\n this.state = S_DTD_QUOTED;\n this.q = c;\n }\n }\n sDTDQuoted() {\n const q = this.q;\n if (this.captureToChar(q)) {\n this.text += String.fromCodePoint(q);\n this.state = S_DTD;\n this.q = null;\n }\n }\n sDTDOpenWaka() {\n const c = this.getCodeNorm();\n this.text += String.fromCodePoint(c);\n switch (c) {\n case BANG:\n this.state = S_DTD_OPEN_WAKA_BANG;\n this.openWakaBang = \"\";\n break;\n case QUESTION:\n this.state = S_DTD_PI;\n break;\n default:\n this.state = S_DTD;\n }\n }\n sDTDOpenWakaBang() {\n const char = String.fromCodePoint(this.getCodeNorm());\n const owb = this.openWakaBang += char;\n this.text += char;\n if (owb !== \"-\") {\n this.state = owb === \"--\" ? S_DTD_COMMENT : S_DTD;\n this.openWakaBang = \"\";\n }\n }\n sDTDComment() {\n if (this.captureToChar(MINUS)) {\n this.text += \"-\";\n this.state = S_DTD_COMMENT_ENDING;\n }\n }\n sDTDCommentEnding() {\n const c = this.getCodeNorm();\n this.text += String.fromCodePoint(c);\n this.state = c === MINUS ? S_DTD_COMMENT_ENDED : S_DTD_COMMENT;\n }\n sDTDCommentEnded() {\n const c = this.getCodeNorm();\n this.text += String.fromCodePoint(c);\n if (c === GREATER) {\n this.state = S_DTD;\n }\n else {\n this.fail(\"malformed comment.\");\n // will be recorded as\n // a comment of \" blah -- bloo \"\n this.state = S_DTD_COMMENT;\n }\n }\n sDTDPI() {\n if (this.captureToChar(QUESTION)) {\n this.text += \"?\";\n this.state = S_DTD_PI_ENDING;\n }\n }\n sDTDPIEnding() {\n const c = this.getCodeNorm();\n this.text += String.fromCodePoint(c);\n if (c === GREATER) {\n this.state = S_DTD;\n }\n }\n sText() {\n //\n // We did try a version of saxes where the S_TEXT state was split in two\n // states: one for text inside the root element, and one for text\n // outside. This was avoiding having to test this.tags.length to decide\n // what implementation to actually use.\n //\n // Peformance testing on gigabyte-size files did not show any advantage to\n // using the two states solution instead of the current one. Conversely, it\n // made the code a bit more complicated elsewhere. For instance, a comment\n // can appear before the root element so when a comment ended it was\n // necessary to determine whether to return to the S_TEXT state or to the\n // new text-outside-root state.\n //\n if (this.tags.length !== 0) {\n this.handleTextInRoot();\n }\n else {\n this.handleTextOutsideRoot();\n }\n }\n sEntity() {\n // This is essentially a specialized version of captureToChar(SEMICOLON...)\n let { i: start } = this;\n const { chunk } = this;\n // eslint-disable-next-line no-labels, no-restricted-syntax\n loop: \n // eslint-disable-next-line no-constant-condition\n while (true) {\n switch (this.getCode()) {\n case NL_LIKE:\n this.entity += `${chunk.slice(start, this.prevI)}\\n`;\n start = this.i;\n break;\n case SEMICOLON: {\n const { entityReturnState } = this;\n const entity = this.entity + chunk.slice(start, this.prevI);\n this.state = entityReturnState;\n let parsed;\n if (entity === \"\") {\n this.fail(\"empty entity name.\");\n parsed = \"&;\";\n }\n else {\n parsed = this.parseEntity(entity);\n this.entity = \"\";\n }\n if (entityReturnState !== S_TEXT || this.textHandler !== undefined) {\n this.text += parsed;\n }\n // eslint-disable-next-line no-labels\n break loop;\n }\n case EOC:\n this.entity += chunk.slice(start);\n // eslint-disable-next-line no-labels\n break loop;\n default:\n }\n }\n }\n sOpenWaka() {\n // Reminder: a state handler is called with at least one character\n // available in the current chunk. So the first call to get code inside of\n // a state handler cannot return ``EOC``. That's why we don't test\n // for it.\n const c = this.getCode();\n // either a /, ?, !, or text is coming next.\n if (isNameStartChar(c)) {\n this.state = S_OPEN_TAG;\n this.unget();\n this.xmlDeclPossible = false;\n }\n else {\n switch (c) {\n case FORWARD_SLASH:\n this.state = S_CLOSE_TAG;\n this.xmlDeclPossible = false;\n break;\n case BANG:\n this.state = S_OPEN_WAKA_BANG;\n this.openWakaBang = \"\";\n this.xmlDeclPossible = false;\n break;\n case QUESTION:\n this.state = S_PI_FIRST_CHAR;\n break;\n default:\n this.fail(\"disallowed character in tag name\");\n this.state = S_TEXT;\n this.xmlDeclPossible = false;\n }\n }\n }\n sOpenWakaBang() {\n this.openWakaBang += String.fromCodePoint(this.getCodeNorm());\n switch (this.openWakaBang) {\n case \"[CDATA[\":\n if (!this.sawRoot && !this.reportedTextBeforeRoot) {\n this.fail(\"text data outside of root node.\");\n this.reportedTextBeforeRoot = true;\n }\n if (this.closedRoot && !this.reportedTextAfterRoot) {\n this.fail(\"text data outside of root node.\");\n this.reportedTextAfterRoot = true;\n }\n this.state = S_CDATA;\n this.openWakaBang = \"\";\n break;\n case \"--\":\n this.state = S_COMMENT;\n this.openWakaBang = \"\";\n break;\n case \"DOCTYPE\":\n this.state = S_DOCTYPE;\n if (this.doctype || this.sawRoot) {\n this.fail(\"inappropriately located doctype declaration.\");\n }\n this.openWakaBang = \"\";\n break;\n default:\n // 7 happens to be the maximum length of the string that can possibly\n // match one of the cases above.\n if (this.openWakaBang.length >= 7) {\n this.fail(\"incorrect syntax.\");\n }\n }\n }\n sComment() {\n if (this.captureToChar(MINUS)) {\n this.state = S_COMMENT_ENDING;\n }\n }\n sCommentEnding() {\n var _a;\n const c = this.getCodeNorm();\n if (c === MINUS) {\n this.state = S_COMMENT_ENDED;\n (_a = this.commentHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);\n this.text = \"\";\n }\n else {\n this.text += `-${String.fromCodePoint(c)}`;\n this.state = S_COMMENT;\n }\n }\n sCommentEnded() {\n const c = this.getCodeNorm();\n if (c !== GREATER) {\n this.fail(\"malformed comment.\");\n // will be recorded as\n // a comment of \" blah -- bloo \"\n this.text += `--${String.fromCodePoint(c)}`;\n this.state = S_COMMENT;\n }\n else {\n this.state = S_TEXT;\n }\n }\n sCData() {\n if (this.captureToChar(CLOSE_BRACKET)) {\n this.state = S_CDATA_ENDING;\n }\n }\n sCDataEnding() {\n const c = this.getCodeNorm();\n if (c === CLOSE_BRACKET) {\n this.state = S_CDATA_ENDING_2;\n }\n else {\n this.text += `]${String.fromCodePoint(c)}`;\n this.state = S_CDATA;\n }\n }\n sCDataEnding2() {\n var _a;\n const c = this.getCodeNorm();\n switch (c) {\n case GREATER: {\n (_a = this.cdataHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);\n this.text = \"\";\n this.state = S_TEXT;\n break;\n }\n case CLOSE_BRACKET:\n this.text += \"]\";\n break;\n default:\n this.text += `]]${String.fromCodePoint(c)}`;\n this.state = S_CDATA;\n }\n }\n // We need this separate state to check the first character fo the pi target\n // with this.nameStartCheck which allows less characters than this.nameCheck.\n sPIFirstChar() {\n const c = this.getCodeNorm();\n // This is first because in the case where the file is well-formed this is\n // the branch taken. We optimize for well-formedness.\n if (this.nameStartCheck(c)) {\n this.piTarget += String.fromCodePoint(c);\n this.state = S_PI_REST;\n }\n else if (c === QUESTION || isS(c)) {\n this.fail(\"processing instruction without a target.\");\n this.state = c === QUESTION ? S_PI_ENDING : S_PI_BODY;\n }\n else {\n this.fail(\"disallowed character in processing instruction name.\");\n this.piTarget += String.fromCodePoint(c);\n this.state = S_PI_REST;\n }\n }\n sPIRest() {\n // Capture characters into a piTarget while ``this.nameCheck`` run on the\n // character read returns true.\n const { chunk, i: start } = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const c = this.getCodeNorm();\n if (c === EOC) {\n this.piTarget += chunk.slice(start);\n return;\n }\n // NL cannot satisfy this.nameCheck so we don't have to test specifically\n // for it.\n if (!this.nameCheck(c)) {\n this.piTarget += chunk.slice(start, this.prevI);\n const isQuestion = c === QUESTION;\n if (isQuestion || isS(c)) {\n if (this.piTarget === \"xml\") {\n if (!this.xmlDeclPossible) {\n this.fail(\"an XML declaration must be at the start of the document.\");\n }\n this.state = isQuestion ? S_XML_DECL_ENDING : S_XML_DECL_NAME_START;\n }\n else {\n this.state = isQuestion ? S_PI_ENDING : S_PI_BODY;\n }\n }\n else {\n this.fail(\"disallowed character in processing instruction name.\");\n this.piTarget += String.fromCodePoint(c);\n }\n break;\n }\n }\n }\n sPIBody() {\n if (this.text.length === 0) {\n const c = this.getCodeNorm();\n if (c === QUESTION) {\n this.state = S_PI_ENDING;\n }\n else if (!isS(c)) {\n this.text = String.fromCodePoint(c);\n }\n }\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n else if (this.captureToChar(QUESTION)) {\n this.state = S_PI_ENDING;\n }\n }\n sPIEnding() {\n var _a;\n const c = this.getCodeNorm();\n if (c === GREATER) {\n const { piTarget } = this;\n if (piTarget.toLowerCase() === \"xml\") {\n this.fail(\"the XML declaration must appear at the start of the document.\");\n }\n (_a = this.piHandler) === null || _a === void 0 ? void 0 : _a.call(this, {\n target: piTarget,\n body: this.text,\n });\n this.piTarget = this.text = \"\";\n this.state = S_TEXT;\n }\n else if (c === QUESTION) {\n // We ran into ?? as part of a processing instruction. We initially took\n // the first ? as a sign that the PI was ending, but it is not. So we have\n // to add it to the body but we take the new ? as a sign that the PI is\n // ending.\n this.text += \"?\";\n }\n else {\n this.text += `?${String.fromCodePoint(c)}`;\n this.state = S_PI_BODY;\n }\n this.xmlDeclPossible = false;\n }\n sXMLDeclNameStart() {\n const c = this.skipSpaces();\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n // It is valid to go to S_XML_DECL_ENDING from this state.\n this.state = S_XML_DECL_ENDING;\n return;\n }\n if (c !== EOC) {\n this.state = S_XML_DECL_NAME;\n this.name = String.fromCodePoint(c);\n }\n }\n sXMLDeclName() {\n const c = this.captureTo(XML_DECL_NAME_TERMINATOR);\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n this.state = S_XML_DECL_ENDING;\n this.name += this.text;\n this.text = \"\";\n this.fail(\"XML declaration is incomplete.\");\n return;\n }\n if (!(isS(c) || c === EQUAL)) {\n return;\n }\n this.name += this.text;\n this.text = \"\";\n if (!this.xmlDeclExpects.includes(this.name)) {\n switch (this.name.length) {\n case 0:\n this.fail(\"did not expect any more name/value pairs.\");\n break;\n case 1:\n this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);\n break;\n default:\n this.fail(`expected one of ${this.xmlDeclExpects.join(\", \")}`);\n }\n }\n this.state = c === EQUAL ? S_XML_DECL_VALUE_START : S_XML_DECL_EQ;\n }\n sXMLDeclEq() {\n const c = this.getCodeNorm();\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n this.state = S_XML_DECL_ENDING;\n this.fail(\"XML declaration is incomplete.\");\n return;\n }\n if (isS(c)) {\n return;\n }\n if (c !== EQUAL) {\n this.fail(\"value required.\");\n }\n this.state = S_XML_DECL_VALUE_START;\n }\n sXMLDeclValueStart() {\n const c = this.getCodeNorm();\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n this.state = S_XML_DECL_ENDING;\n this.fail(\"XML declaration is incomplete.\");\n return;\n }\n if (isS(c)) {\n return;\n }\n if (!isQuote(c)) {\n this.fail(\"value must be quoted.\");\n this.q = SPACE;\n }\n else {\n this.q = c;\n }\n this.state = S_XML_DECL_VALUE;\n }\n sXMLDeclValue() {\n const c = this.captureTo([this.q, QUESTION]);\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n this.state = S_XML_DECL_ENDING;\n this.text = \"\";\n this.fail(\"XML declaration is incomplete.\");\n return;\n }\n if (c === EOC) {\n return;\n }\n const value = this.text;\n this.text = \"\";\n switch (this.name) {\n case \"version\": {\n this.xmlDeclExpects = [\"encoding\", \"standalone\"];\n const version = value;\n this.xmlDecl.version = version;\n // This is the test specified by XML 1.0 but it is fine for XML 1.1.\n if (!/^1\\.[0-9]+$/.test(version)) {\n this.fail(\"version number must match /^1\\\\.[0-9]+$/.\");\n }\n // When forceXMLVersion is set, the XML declaration is ignored.\n else if (!this.opt.forceXMLVersion) {\n this.setXMLVersion(version);\n }\n break;\n }\n case \"encoding\":\n if (!/^[A-Za-z][A-Za-z0-9._-]*$/.test(value)) {\n this.fail(\"encoding value must match \\\n/^[A-Za-z0-9][A-Za-z0-9._-]*$/.\");\n }\n this.xmlDeclExpects = [\"standalone\"];\n this.xmlDecl.encoding = value;\n break;\n case \"standalone\":\n if (value !== \"yes\" && value !== \"no\") {\n this.fail(\"standalone value must match \\\"yes\\\" or \\\"no\\\".\");\n }\n this.xmlDeclExpects = [];\n this.xmlDecl.standalone = value;\n break;\n default:\n // We don't need to raise an error here since we've already raised one\n // when checking what name was expected.\n }\n this.name = \"\";\n this.state = S_XML_DECL_SEPARATOR;\n }\n sXMLDeclSeparator() {\n const c = this.getCodeNorm();\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n // It is valid to go to S_XML_DECL_ENDING from this state.\n this.state = S_XML_DECL_ENDING;\n return;\n }\n if (!isS(c)) {\n this.fail(\"whitespace required.\");\n this.unget();\n }\n this.state = S_XML_DECL_NAME_START;\n }\n sXMLDeclEnding() {\n var _a;\n const c = this.getCodeNorm();\n if (c === GREATER) {\n if (this.piTarget !== \"xml\") {\n this.fail(\"processing instructions are not allowed before root.\");\n }\n else if (this.name !== \"version\" &&\n this.xmlDeclExpects.includes(\"version\")) {\n this.fail(\"XML declaration must contain a version.\");\n }\n (_a = this.xmldeclHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.xmlDecl);\n this.name = \"\";\n this.piTarget = this.text = \"\";\n this.state = S_TEXT;\n }\n else {\n // We got here because the previous character was a ?, but the question\n // mark character is not valid inside any of the XML declaration\n // name/value pairs.\n this.fail(\"The character ? is disallowed anywhere in XML declarations.\");\n }\n this.xmlDeclPossible = false;\n }\n sOpenTag() {\n var _a;\n const c = this.captureNameChars();\n if (c === EOC) {\n return;\n }\n const tag = this.tag = {\n name: this.name,\n attributes: Object.create(null),\n };\n this.name = \"\";\n if (this.xmlnsOpt) {\n this.topNS = tag.ns = Object.create(null);\n }\n (_a = this.openTagStartHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);\n this.sawRoot = true;\n if (!this.fragmentOpt && this.closedRoot) {\n this.fail(\"documents may contain only one root.\");\n }\n switch (c) {\n case GREATER:\n this.openTag();\n break;\n case FORWARD_SLASH:\n this.state = S_OPEN_TAG_SLASH;\n break;\n default:\n if (!isS(c)) {\n this.fail(\"disallowed character in tag name.\");\n }\n this.state = S_ATTRIB;\n }\n }\n sOpenTagSlash() {\n if (this.getCode() === GREATER) {\n this.openSelfClosingTag();\n }\n else {\n this.fail(\"forward-slash in opening tag not followed by >.\");\n this.state = S_ATTRIB;\n }\n }\n sAttrib() {\n const c = this.skipSpaces();\n if (c === EOC) {\n return;\n }\n if (isNameStartChar(c)) {\n this.unget();\n this.state = S_ATTRIB_NAME;\n }\n else if (c === GREATER) {\n this.openTag();\n }\n else if (c === FORWARD_SLASH) {\n this.state = S_OPEN_TAG_SLASH;\n }\n else {\n this.fail(\"disallowed character in attribute name.\");\n }\n }\n sAttribName() {\n const c = this.captureNameChars();\n if (c === EQUAL) {\n this.state = S_ATTRIB_VALUE;\n }\n else if (isS(c)) {\n this.state = S_ATTRIB_NAME_SAW_WHITE;\n }\n else if (c === GREATER) {\n this.fail(\"attribute without value.\");\n this.pushAttrib(this.name, this.name);\n this.name = this.text = \"\";\n this.openTag();\n }\n else if (c !== EOC) {\n this.fail(\"disallowed character in attribute name.\");\n }\n }\n sAttribNameSawWhite() {\n const c = this.skipSpaces();\n switch (c) {\n case EOC:\n return;\n case EQUAL:\n this.state = S_ATTRIB_VALUE;\n break;\n default:\n this.fail(\"attribute without value.\");\n // Should we do this???\n // this.tag.attributes[this.name] = \"\";\n this.text = \"\";\n this.name = \"\";\n if (c === GREATER) {\n this.openTag();\n }\n else if (isNameStartChar(c)) {\n this.unget();\n this.state = S_ATTRIB_NAME;\n }\n else {\n this.fail(\"disallowed character in attribute name.\");\n this.state = S_ATTRIB;\n }\n }\n }\n sAttribValue() {\n const c = this.getCodeNorm();\n if (isQuote(c)) {\n this.q = c;\n this.state = S_ATTRIB_VALUE_QUOTED;\n }\n else if (!isS(c)) {\n this.fail(\"unquoted attribute value.\");\n this.state = S_ATTRIB_VALUE_UNQUOTED;\n this.unget();\n }\n }\n sAttribValueQuoted() {\n // We deliberately do not use captureTo here. The specialized code we use\n // here is faster than using captureTo.\n const { q, chunk } = this;\n let { i: start } = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n switch (this.getCode()) {\n case q:\n this.pushAttrib(this.name, this.text + chunk.slice(start, this.prevI));\n this.name = this.text = \"\";\n this.q = null;\n this.state = S_ATTRIB_VALUE_CLOSED;\n return;\n case AMP:\n this.text += chunk.slice(start, this.prevI);\n this.state = S_ENTITY;\n this.entityReturnState = S_ATTRIB_VALUE_QUOTED;\n return;\n case NL:\n case NL_LIKE:\n case TAB:\n this.text += `${chunk.slice(start, this.prevI)} `;\n start = this.i;\n break;\n case LESS:\n this.text += chunk.slice(start, this.prevI);\n this.fail(\"disallowed character.\");\n return;\n case EOC:\n this.text += chunk.slice(start);\n return;\n default:\n }\n }\n }\n sAttribValueClosed() {\n const c = this.getCodeNorm();\n if (isS(c)) {\n this.state = S_ATTRIB;\n }\n else if (c === GREATER) {\n this.openTag();\n }\n else if (c === FORWARD_SLASH) {\n this.state = S_OPEN_TAG_SLASH;\n }\n else if (isNameStartChar(c)) {\n this.fail(\"no whitespace between attributes.\");\n this.unget();\n this.state = S_ATTRIB_NAME;\n }\n else {\n this.fail(\"disallowed character in attribute name.\");\n }\n }\n sAttribValueUnquoted() {\n // We don't do anything regarding EOL or space handling for unquoted\n // attributes. We already have failed by the time we get here, and the\n // contract that saxes upholds states that upon failure, it is not safe to\n // rely on the data passed to event handlers (other than\n // ``onerror``). Passing \"bad\" data is not a problem.\n const c = this.captureTo(ATTRIB_VALUE_UNQUOTED_TERMINATOR);\n switch (c) {\n case AMP:\n this.state = S_ENTITY;\n this.entityReturnState = S_ATTRIB_VALUE_UNQUOTED;\n break;\n case LESS:\n this.fail(\"disallowed character.\");\n break;\n case EOC:\n break;\n default:\n if (this.text.includes(\"]]>\")) {\n this.fail(\"the string \\\"]]>\\\" is disallowed in char data.\");\n }\n this.pushAttrib(this.name, this.text);\n this.name = this.text = \"\";\n if (c === GREATER) {\n this.openTag();\n }\n else {\n this.state = S_ATTRIB;\n }\n }\n }\n sCloseTag() {\n const c = this.captureNameChars();\n if (c === GREATER) {\n this.closeTag();\n }\n else if (isS(c)) {\n this.state = S_CLOSE_TAG_SAW_WHITE;\n }\n else if (c !== EOC) {\n this.fail(\"disallowed character in closing tag.\");\n }\n }\n sCloseTagSawWhite() {\n switch (this.skipSpaces()) {\n case GREATER:\n this.closeTag();\n break;\n case EOC:\n break;\n default:\n this.fail(\"disallowed character in closing tag.\");\n }\n }\n // END OF STATE ENGINE METHODS\n handleTextInRoot() {\n // This is essentially a specialized version of captureTo which is optimized\n // for performing the ]]> check. A previous version of this code, checked\n // ``this.text`` for the presence of ]]>. It simplified the code but was\n // very costly when character data contained a lot of entities to be parsed.\n //\n // Since we are using a specialized loop, we also keep track of the presence\n // of ]]> in text data. The sequence ]]> is forbidden to appear as-is.\n //\n let { i: start, forbiddenState } = this;\n const { chunk, textHandler: handler } = this;\n // eslint-disable-next-line no-labels, no-restricted-syntax\n scanLoop: \n // eslint-disable-next-line no-constant-condition\n while (true) {\n switch (this.getCode()) {\n case LESS: {\n this.state = S_OPEN_WAKA;\n if (handler !== undefined) {\n const { text } = this;\n const slice = chunk.slice(start, this.prevI);\n if (text.length !== 0) {\n handler(text + slice);\n this.text = \"\";\n }\n else if (slice.length !== 0) {\n handler(slice);\n }\n }\n forbiddenState = FORBIDDEN_START;\n // eslint-disable-next-line no-labels\n break scanLoop;\n }\n case AMP:\n this.state = S_ENTITY;\n this.entityReturnState = S_TEXT;\n if (handler !== undefined) {\n this.text += chunk.slice(start, this.prevI);\n }\n forbiddenState = FORBIDDEN_START;\n // eslint-disable-next-line no-labels\n break scanLoop;\n case CLOSE_BRACKET:\n switch (forbiddenState) {\n case FORBIDDEN_START:\n forbiddenState = FORBIDDEN_BRACKET;\n break;\n case FORBIDDEN_BRACKET:\n forbiddenState = FORBIDDEN_BRACKET_BRACKET;\n break;\n case FORBIDDEN_BRACKET_BRACKET:\n break;\n default:\n throw new Error(\"impossible state\");\n }\n break;\n case GREATER:\n if (forbiddenState === FORBIDDEN_BRACKET_BRACKET) {\n this.fail(\"the string \\\"]]>\\\" is disallowed in char data.\");\n }\n forbiddenState = FORBIDDEN_START;\n break;\n case NL_LIKE:\n if (handler !== undefined) {\n this.text += `${chunk.slice(start, this.prevI)}\\n`;\n }\n start = this.i;\n forbiddenState = FORBIDDEN_START;\n break;\n case EOC:\n if (handler !== undefined) {\n this.text += chunk.slice(start);\n }\n // eslint-disable-next-line no-labels\n break scanLoop;\n default:\n forbiddenState = FORBIDDEN_START;\n }\n }\n this.forbiddenState = forbiddenState;\n }\n handleTextOutsideRoot() {\n // This is essentially a specialized version of captureTo which is optimized\n // for a specialized task. We keep track of the presence of non-space\n // characters in the text since these are errors when appearing outside the\n // document root element.\n let { i: start } = this;\n const { chunk, textHandler: handler } = this;\n let nonSpace = false;\n // eslint-disable-next-line no-labels, no-restricted-syntax\n outRootLoop: \n // eslint-disable-next-line no-constant-condition\n while (true) {\n const code = this.getCode();\n switch (code) {\n case LESS: {\n this.state = S_OPEN_WAKA;\n if (handler !== undefined) {\n const { text } = this;\n const slice = chunk.slice(start, this.prevI);\n if (text.length !== 0) {\n handler(text + slice);\n this.text = \"\";\n }\n else if (slice.length !== 0) {\n handler(slice);\n }\n }\n // eslint-disable-next-line no-labels\n break outRootLoop;\n }\n case AMP:\n this.state = S_ENTITY;\n this.entityReturnState = S_TEXT;\n if (handler !== undefined) {\n this.text += chunk.slice(start, this.prevI);\n }\n nonSpace = true;\n // eslint-disable-next-line no-labels\n break outRootLoop;\n case NL_LIKE:\n if (handler !== undefined) {\n this.text += `${chunk.slice(start, this.prevI)}\\n`;\n }\n start = this.i;\n break;\n case EOC:\n if (handler !== undefined) {\n this.text += chunk.slice(start);\n }\n // eslint-disable-next-line no-labels\n break outRootLoop;\n default:\n if (!isS(code)) {\n nonSpace = true;\n }\n }\n }\n if (!nonSpace) {\n return;\n }\n // We use the reportedTextBeforeRoot and reportedTextAfterRoot flags\n // to avoid reporting errors for every single character that is out of\n // place.\n if (!this.sawRoot && !this.reportedTextBeforeRoot) {\n this.fail(\"text data outside of root node.\");\n this.reportedTextBeforeRoot = true;\n }\n if (this.closedRoot && !this.reportedTextAfterRoot) {\n this.fail(\"text data outside of root node.\");\n this.reportedTextAfterRoot = true;\n }\n }\n pushAttribNS(name, value) {\n var _a;\n const { prefix, local } = this.qname(name);\n const attr = { name, prefix, local, value };\n this.attribList.push(attr);\n (_a = this.attributeHandler) === null || _a === void 0 ? void 0 : _a.call(this, attr);\n if (prefix === \"xmlns\") {\n const trimmed = value.trim();\n if (this.currentXMLVersion === \"1.0\" && trimmed === \"\") {\n this.fail(\"invalid attempt to undefine prefix in XML 1.0\");\n }\n this.topNS[local] = trimmed;\n nsPairCheck(this, local, trimmed);\n }\n else if (name === \"xmlns\") {\n const trimmed = value.trim();\n this.topNS[\"\"] = trimmed;\n nsPairCheck(this, \"\", trimmed);\n }\n }\n pushAttribPlain(name, value) {\n var _a;\n const attr = { name, value };\n this.attribList.push(attr);\n (_a = this.attributeHandler) === null || _a === void 0 ? void 0 : _a.call(this, attr);\n }\n /**\n * End parsing. This performs final well-formedness checks and resets the\n * parser to a clean state.\n *\n * @returns this\n */\n end() {\n var _a, _b;\n if (!this.sawRoot) {\n this.fail(\"document must contain a root element.\");\n }\n const { tags } = this;\n while (tags.length > 0) {\n const tag = tags.pop();\n this.fail(`unclosed tag: ${tag.name}`);\n }\n if ((this.state !== S_BEGIN) && (this.state !== S_TEXT)) {\n this.fail(\"unexpected end.\");\n }\n const { text } = this;\n if (text.length !== 0) {\n (_a = this.textHandler) === null || _a === void 0 ? void 0 : _a.call(this, text);\n this.text = \"\";\n }\n this._closed = true;\n (_b = this.endHandler) === null || _b === void 0 ? void 0 : _b.call(this);\n this._init();\n return this;\n }\n /**\n * Resolve a namespace prefix.\n *\n * @param prefix The prefix to resolve.\n *\n * @returns The namespace URI or ``undefined`` if the prefix is not defined.\n */\n resolve(prefix) {\n var _a, _b;\n let uri = this.topNS[prefix];\n if (uri !== undefined) {\n return uri;\n }\n const { tags } = this;\n for (let index = tags.length - 1; index >= 0; index--) {\n uri = tags[index].ns[prefix];\n if (uri !== undefined) {\n return uri;\n }\n }\n uri = this.ns[prefix];\n if (uri !== undefined) {\n return uri;\n }\n return (_b = (_a = this.opt).resolvePrefix) === null || _b === void 0 ? void 0 : _b.call(_a, prefix);\n }\n /**\n * Parse a qname into its prefix and local name parts.\n *\n * @param name The name to parse\n *\n * @returns\n */\n qname(name) {\n // This is faster than using name.split(\":\").\n const colon = name.indexOf(\":\");\n if (colon === -1) {\n return { prefix: \"\", local: name };\n }\n const local = name.slice(colon + 1);\n const prefix = name.slice(0, colon);\n if (prefix === \"\" || local === \"\" || local.includes(\":\")) {\n this.fail(`malformed name: ${name}.`);\n }\n return { prefix, local };\n }\n processAttribsNS() {\n var _a;\n const { attribList } = this;\n const tag = this.tag;\n {\n // add namespace info to tag\n const { prefix, local } = this.qname(tag.name);\n tag.prefix = prefix;\n tag.local = local;\n const uri = tag.uri = (_a = this.resolve(prefix)) !== null && _a !== void 0 ? _a : \"\";\n if (prefix !== \"\") {\n if (prefix === \"xmlns\") {\n this.fail(\"tags may not have \\\"xmlns\\\" as prefix.\");\n }\n if (uri === \"\") {\n this.fail(`unbound namespace prefix: ${JSON.stringify(prefix)}.`);\n tag.uri = prefix;\n }\n }\n }\n if (attribList.length === 0) {\n return;\n }\n const { attributes } = tag;\n const seen = new Set();\n // Note: do not apply default ns to attributes:\n // http://www.w3.org/TR/REC-xml-names/#defaulting\n for (const attr of attribList) {\n const { name, prefix, local } = attr;\n let uri;\n let eqname;\n if (prefix === \"\") {\n uri = name === \"xmlns\" ? XMLNS_NAMESPACE : \"\";\n eqname = name;\n }\n else {\n uri = this.resolve(prefix);\n // if there's any attributes with an undefined namespace,\n // then fail on them now.\n if (uri === undefined) {\n this.fail(`unbound namespace prefix: ${JSON.stringify(prefix)}.`);\n uri = prefix;\n }\n eqname = `{${uri}}${local}`;\n }\n if (seen.has(eqname)) {\n this.fail(`duplicate attribute: ${eqname}.`);\n }\n seen.add(eqname);\n attr.uri = uri;\n attributes[name] = attr;\n }\n this.attribList = [];\n }\n processAttribsPlain() {\n const { attribList } = this;\n // eslint-disable-next-line prefer-destructuring\n const attributes = this.tag.attributes;\n for (const { name, value } of attribList) {\n if (attributes[name] !== undefined) {\n this.fail(`duplicate attribute: ${name}.`);\n }\n attributes[name] = value;\n }\n this.attribList = [];\n }\n /**\n * Handle a complete open tag. This parser code calls this once it has seen\n * the whole tag. This method checks for well-formeness and then emits\n * ``onopentag``.\n */\n openTag() {\n var _a;\n this.processAttribs();\n const { tags } = this;\n const tag = this.tag;\n tag.isSelfClosing = false;\n // There cannot be any pending text here due to the onopentagstart that was\n // necessarily emitted before we get here. So we do not check text.\n (_a = this.openTagHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);\n tags.push(tag);\n this.state = S_TEXT;\n this.name = \"\";\n }\n /**\n * Handle a complete self-closing tag. This parser code calls this once it has\n * seen the whole tag. This method checks for well-formeness and then emits\n * ``onopentag`` and ``onclosetag``.\n */\n openSelfClosingTag() {\n var _a, _b, _c;\n this.processAttribs();\n const { tags } = this;\n const tag = this.tag;\n tag.isSelfClosing = true;\n // There cannot be any pending text here due to the onopentagstart that was\n // necessarily emitted before we get here. So we do not check text.\n (_a = this.openTagHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);\n (_b = this.closeTagHandler) === null || _b === void 0 ? void 0 : _b.call(this, tag);\n const top = this.tag = (_c = tags[tags.length - 1]) !== null && _c !== void 0 ? _c : null;\n if (top === null) {\n this.closedRoot = true;\n }\n this.state = S_TEXT;\n this.name = \"\";\n }\n /**\n * Handle a complete close tag. This parser code calls this once it has seen\n * the whole tag. This method checks for well-formeness and then emits\n * ``onclosetag``.\n */\n closeTag() {\n const { tags, name } = this;\n // Our state after this will be S_TEXT, no matter what, and we can clear\n // tagName now.\n this.state = S_TEXT;\n this.name = \"\";\n if (name === \"\") {\n this.fail(\"weird empty close tag.\");\n this.text += \"\";\n return;\n }\n const handler = this.closeTagHandler;\n let l = tags.length;\n while (l-- > 0) {\n const tag = this.tag = tags.pop();\n this.topNS = tag.ns;\n handler === null || handler === void 0 ? void 0 : handler(tag);\n if (tag.name === name) {\n break;\n }\n this.fail(\"unexpected close tag.\");\n }\n if (l === 0) {\n this.closedRoot = true;\n }\n else if (l < 0) {\n this.fail(`unmatched closing tag: ${name}.`);\n this.text += ``;\n }\n }\n /**\n * Resolves an entity. Makes any necessary well-formedness checks.\n *\n * @param entity The entity to resolve.\n *\n * @returns The parsed entity.\n */\n parseEntity(entity) {\n // startsWith would be significantly slower for this test.\n if (entity[0] !== \"#\") {\n const defined = this.ENTITIES[entity];\n if (defined !== undefined) {\n return defined;\n }\n this.fail(this.isName(entity) ? \"undefined entity.\" :\n \"disallowed character in entity name.\");\n return `&${entity};`;\n }\n let num = NaN;\n if (entity[1] === \"x\" && /^#x[0-9a-f]+$/i.test(entity)) {\n num = parseInt(entity.slice(2), 16);\n }\n else if (/^#[0-9]+$/.test(entity)) {\n num = parseInt(entity.slice(1), 10);\n }\n // The character reference is required to match the CHAR production.\n if (!this.isChar(num)) {\n this.fail(\"malformed character entity.\");\n return `&${entity};`;\n }\n return String.fromCodePoint(num);\n }\n}\nexports.SaxesParser = SaxesParser;\n//# sourceMappingURL=saxes.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lib/RdfXmlParser\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ParseError = void 0;\n/**\n * An error that includes line and column in the error message.\n */\nclass ParseError extends Error {\n constructor(parser, message) {\n const saxParser = parser.saxParser;\n super(parser.trackPosition ? `Line ${saxParser.line} column ${saxParser.column + 1}: ${message}` : message);\n }\n}\nexports.ParseError = ParseError;\n//# sourceMappingURL=ParseError.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ParseType = exports.RdfXmlParser = void 0;\nconst relative_to_absolute_iri_1 = require(\"relative-to-absolute-iri\");\nconst saxes_1 = require(\"@rubensworks/saxes\");\nconst readable_stream_1 = require(\"readable-stream\");\nconst ParseError_1 = require(\"./ParseError\");\nconst rdf_data_factory_1 = require(\"rdf-data-factory\");\nconst validate_iri_1 = require(\"validate-iri\");\nclass RdfXmlParser extends readable_stream_1.Transform {\n constructor(args) {\n super({ readableObjectMode: true });\n this.activeTagStack = [];\n this.nodeIds = {};\n if (args) {\n Object.assign(this, args);\n this.options = args;\n }\n if (!this.dataFactory) {\n this.dataFactory = new rdf_data_factory_1.DataFactory();\n }\n if (!this.baseIRI) {\n this.baseIRI = '';\n }\n if (!this.defaultGraph) {\n this.defaultGraph = this.dataFactory.defaultGraph();\n }\n if (this.validateUri !== false) {\n this.validateUri = true;\n }\n if (!this.iriValidationStrategy) {\n this.iriValidationStrategy = this.validateUri ? validate_iri_1.IriValidationStrategy.Pragmatic : validate_iri_1.IriValidationStrategy.None;\n }\n this.saxParser = new saxes_1.SaxesParser({ xmlns: true, position: this.trackPosition });\n this.attachSaxListeners();\n }\n /**\n * Parses the given text stream into a quad stream.\n * @param {NodeJS.EventEmitter} stream A text stream.\n * @return {RDF.Stream} A quad stream.\n */\n import(stream) {\n const output = new readable_stream_1.PassThrough({ readableObjectMode: true });\n stream.on('error', (error) => parsed.emit('error', error));\n stream.on('data', (data) => output.push(data));\n stream.on('end', () => output.push(null));\n const parsed = output.pipe(new RdfXmlParser(this.options));\n return parsed;\n }\n _transform(chunk, encoding, callback) {\n try {\n this.saxParser.write(chunk);\n }\n catch (e) {\n return callback(e);\n }\n callback();\n }\n /**\n * Create a new parse error instance.\n * @param {string} message An error message.\n * @return {Error} An error instance.\n */\n newParseError(message) {\n return new ParseError_1.ParseError(this, message);\n }\n /**\n * Convert the given value to a IRI by taking into account the baseIRI.\n *\n * This will follow the RDF/XML spec for converting values with baseIRIs to a IRI.\n *\n * @param {string} value The value to convert to an IRI.\n * @param {IActiveTag} activeTag The active tag.\n * @return {NamedNode} an IRI.\n */\n valueToUri(value, activeTag) {\n return this.uriToNamedNode((0, relative_to_absolute_iri_1.resolve)(value, activeTag.baseIRI));\n }\n /**\n * Convert the given value URI string to a named node.\n *\n * This throw an error if the URI is invalid.\n *\n * @param {string} uri A URI string.\n * @return {NamedNode} a named node.\n */\n uriToNamedNode(uri) {\n // Validate URI\n const uriValidationResult = (0, validate_iri_1.validateIri)(uri, this.iriValidationStrategy);\n if (uriValidationResult instanceof Error) {\n throw this.newParseError(uriValidationResult.message);\n }\n return this.dataFactory.namedNode(uri);\n }\n /**\n * Validate the given value as an NCName: https://www.w3.org/TR/xml-names/#NT-NCName\n * If it is invalid, an error will thrown emitted.\n * @param {string} value A value.\n */\n validateNcname(value) {\n // Validate term as an NCName: https://www.w3.org/TR/xml-names/#NT-NCName\n if (!RdfXmlParser.NCNAME_MATCHER.test(value)) {\n throw this.newParseError(`Not a valid NCName: ${value}`);\n }\n }\n attachSaxListeners() {\n this.saxParser.on('error', (error) => this.emit('error', error));\n this.saxParser.on('opentag', this.onTag.bind(this));\n this.saxParser.on('text', this.onText.bind(this));\n this.saxParser.on('cdata', this.onText.bind(this));\n this.saxParser.on('closetag', this.onCloseTag.bind(this));\n this.saxParser.on('doctype', this.onDoctype.bind(this));\n }\n /**\n * Handle the given tag.\n * @param {SaxesTagNS} tag A SAX tag.\n */\n onTag(tag) {\n // Get parent tag\n const parentTag = this.activeTagStack.length\n ? this.activeTagStack[this.activeTagStack.length - 1] : null;\n let currentParseType = ParseType.RESOURCE;\n if (parentTag) {\n parentTag.hadChildren = true;\n currentParseType = parentTag.childrenParseType;\n }\n // Check if this tag needs to be converted to a string\n if (parentTag && parentTag.childrenStringTags) {\n // Convert this tag to a string\n const tagName = tag.name;\n let attributes = '';\n for (const attributeKey in tag.attributes) {\n attributes += ` ${attributeKey}=\"${tag.attributes[attributeKey].value}\"`;\n }\n const tagContents = `${tagName}${attributes}`;\n const tagString = `<${tagContents}>`;\n parentTag.childrenStringTags.push(tagString);\n // Inherit the array, so that deeper tags are appended to this same array\n const stringActiveTag = { childrenStringTags: parentTag.childrenStringTags };\n stringActiveTag.childrenStringEmitClosingTag = ``;\n this.activeTagStack.push(stringActiveTag);\n // Halt any further processing\n return;\n }\n const activeTag = {};\n if (parentTag) {\n // Inherit language scope and baseIRI from parent\n activeTag.language = parentTag.language;\n activeTag.baseIRI = parentTag.baseIRI;\n }\n else {\n activeTag.baseIRI = this.baseIRI;\n }\n this.activeTagStack.push(activeTag);\n if (currentParseType === ParseType.RESOURCE) {\n this.onTagResource(tag, activeTag, parentTag, !parentTag);\n }\n else { // currentParseType === ParseType.PROPERTY\n this.onTagProperty(tag, activeTag, parentTag);\n }\n }\n /**\n * Handle the given node element in resource-mode.\n * @param {SaxesTagNS} tag A SAX tag.\n * @param {IActiveTag} activeTag The currently active tag.\n * @param {IActiveTag} parentTag The parent tag or null.\n * @param {boolean} rootTag If we are currently processing the root tag.\n */\n onTagResource(tag, activeTag, parentTag, rootTag) {\n activeTag.childrenParseType = ParseType.PROPERTY;\n // Assume that the current node is a _typed_ node (2.13), unless we find an rdf:Description as node name\n let typedNode = true;\n if (tag.uri === RdfXmlParser.RDF) {\n // Check forbidden property element names\n if (!rootTag && RdfXmlParser.FORBIDDEN_NODE_ELEMENTS.indexOf(tag.local) >= 0) {\n throw this.newParseError(`Illegal node element name: ${tag.local}`);\n }\n switch (tag.local) {\n case 'RDF':\n // Tags under must always be resources\n activeTag.childrenParseType = ParseType.RESOURCE;\n case 'Description':\n typedNode = false;\n }\n }\n const predicates = [];\n const objects = [];\n // Collect all attributes as triples\n // Assign subject value only after all attributes have been processed, because baseIRI may change the final val\n let activeSubjectValue = null;\n let claimSubjectNodeId = false;\n let subjectValueBlank = false;\n let explicitType = null;\n for (const attributeKey in tag.attributes) {\n const attribute = tag.attributes[attributeKey];\n if (parentTag && attribute.uri === RdfXmlParser.RDF) {\n switch (attribute.local) {\n case 'about':\n if (activeSubjectValue) {\n throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, \\\nwhile ${attribute.value} and ${activeSubjectValue} where found.`);\n }\n activeSubjectValue = attribute.value;\n continue;\n case 'ID':\n if (activeSubjectValue) {\n throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, \\\nwhile ${attribute.value} and ${activeSubjectValue} where found.`);\n }\n this.validateNcname(attribute.value);\n activeSubjectValue = '#' + attribute.value;\n claimSubjectNodeId = true;\n continue;\n case 'nodeID':\n if (activeSubjectValue) {\n throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, \\\nwhile ${attribute.value} and ${activeSubjectValue} where found.`);\n }\n this.validateNcname(attribute.value);\n activeSubjectValue = attribute.value;\n subjectValueBlank = true;\n continue;\n case 'bagID':\n throw this.newParseError(`rdf:bagID is not supported.`);\n case 'type':\n // Emit the rdf:type later as named node instead of the default literal\n explicitType = attribute.value;\n continue;\n case 'aboutEach':\n throw this.newParseError(`rdf:aboutEach is not supported.`);\n case 'aboutEachPrefix':\n throw this.newParseError(`rdf:aboutEachPrefix is not supported.`);\n case 'li':\n throw this.newParseError(`rdf:li on node elements are not supported.`);\n }\n }\n else if (attribute.uri === RdfXmlParser.XML) {\n if (attribute.local === 'lang') {\n activeTag.language = attribute.value === '' ? null : attribute.value.toLowerCase();\n continue;\n }\n else if (attribute.local === 'base') {\n // SAX Parser does not expand xml:base, based on DOCTYPE, so we have to do it manually\n activeTag.baseIRI = (0, relative_to_absolute_iri_1.resolve)(attribute.value, activeTag.baseIRI);\n continue;\n }\n }\n // Interpret attributes at this point as properties on this node,\n // but we ignore attributes that have no prefix or known expanded URI\n if (attribute.prefix !== 'xml' && attribute.prefix !== 'xmlns'\n && (attribute.prefix !== '' || attribute.local !== 'xmlns')\n && attribute.uri) {\n predicates.push(this.uriToNamedNode(attribute.uri + attribute.local));\n objects.push(attribute.value);\n }\n }\n // Create the subject value _after_ all attributes have been processed\n if (activeSubjectValue !== null) {\n activeTag.subject = subjectValueBlank\n ? this.dataFactory.blankNode(activeSubjectValue) : this.valueToUri(activeSubjectValue, activeTag);\n if (claimSubjectNodeId) {\n this.claimNodeId(activeTag.subject);\n }\n }\n // Force the creation of a subject if it doesn't exist yet\n if (!activeTag.subject) {\n activeTag.subject = this.dataFactory.blankNode();\n }\n // Emit the type if we're at a typed node\n if (typedNode) {\n const type = this.uriToNamedNode(tag.uri + tag.local);\n this.emitTriple(activeTag.subject, this.dataFactory.namedNode(RdfXmlParser.RDF + 'type'), type, parentTag ? parentTag.reifiedStatementId : null);\n }\n if (parentTag) {\n // If the parent tag defined a predicate, add the current tag as property value\n if (parentTag.predicate) {\n if (parentTag.childrenCollectionSubject) {\n // RDF:List-based properties\n const linkTerm = this.dataFactory.blankNode();\n // Emit

OR \n this.emitTriple(parentTag.childrenCollectionSubject, parentTag.childrenCollectionPredicate, linkTerm, parentTag.reifiedStatementId);\n // Emit value\n this.emitTriple(linkTerm, this.dataFactory.namedNode(RdfXmlParser.RDF + 'first'), activeTag.subject, activeTag.reifiedStatementId);\n // Store in the parent node\n parentTag.childrenCollectionSubject = linkTerm;\n parentTag.childrenCollectionPredicate = this.dataFactory.namedNode(RdfXmlParser.RDF + 'rest');\n }\n else { // !parentTag.predicateEmitted\n // Set-based properties\n this.emitTriple(parentTag.subject, parentTag.predicate, activeTag.subject, parentTag.reifiedStatementId);\n // Emit pending properties on the parent tag that had no defined subject yet.\n for (let i = 0; i < parentTag.predicateSubPredicates.length; i++) {\n this.emitTriple(activeTag.subject, parentTag.predicateSubPredicates[i], parentTag.predicateSubObjects[i], null);\n }\n // Cleanup so we don't emit them again when the parent tag is closed\n parentTag.predicateSubPredicates = [];\n parentTag.predicateSubObjects = [];\n parentTag.predicateEmitted = true;\n }\n }\n // Emit all collected triples\n for (let i = 0; i < predicates.length; i++) {\n const object = this.dataFactory.literal(objects[i], activeTag.datatype || activeTag.language);\n this.emitTriple(activeTag.subject, predicates[i], object, parentTag.reifiedStatementId);\n }\n // Emit the rdf:type as named node instead of literal\n if (explicitType) {\n this.emitTriple(activeTag.subject, this.dataFactory.namedNode(RdfXmlParser.RDF + 'type'), this.uriToNamedNode(explicitType), null);\n }\n }\n }\n /**\n * Handle the given property element in property-mode.\n * @param {SaxesTagNS} tag A SAX tag.\n * @param {IActiveTag} activeTag The currently active tag.\n * @param {IActiveTag} parentTag The parent tag or null.\n */\n onTagProperty(tag, activeTag, parentTag) {\n activeTag.childrenParseType = ParseType.RESOURCE;\n activeTag.subject = parentTag.subject; // Inherit parent subject\n if (tag.uri === RdfXmlParser.RDF && tag.local === 'li') {\n // Convert rdf:li to rdf:_x\n if (!parentTag.listItemCounter) {\n parentTag.listItemCounter = 1;\n }\n activeTag.predicate = this.uriToNamedNode(tag.uri + '_' + parentTag.listItemCounter++);\n }\n else {\n activeTag.predicate = this.uriToNamedNode(tag.uri + tag.local);\n }\n // Check forbidden property element names\n if (tag.uri === RdfXmlParser.RDF\n && RdfXmlParser.FORBIDDEN_PROPERTY_ELEMENTS.indexOf(tag.local) >= 0) {\n throw this.newParseError(`Illegal property element name: ${tag.local}`);\n }\n activeTag.predicateSubPredicates = [];\n activeTag.predicateSubObjects = [];\n let parseType = false;\n let attributedProperty = false;\n // Collect all attributes as triples\n // Assign subject value only after all attributes have been processed, because baseIRI may change the final val\n let activeSubSubjectValue = null;\n let subSubjectValueBlank = true;\n const predicates = [];\n const objects = [];\n for (const propertyAttributeKey in tag.attributes) {\n const propertyAttribute = tag.attributes[propertyAttributeKey];\n if (propertyAttribute.uri === RdfXmlParser.RDF) {\n switch (propertyAttribute.local) {\n case 'resource':\n if (activeSubSubjectValue) {\n throw this.newParseError(`Found both rdf:resource (${propertyAttribute.value}) and rdf:nodeID (${activeSubSubjectValue}).`);\n }\n if (parseType) {\n throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${propertyAttribute.value})`);\n }\n activeTag.hadChildren = true;\n activeSubSubjectValue = propertyAttribute.value;\n subSubjectValueBlank = false;\n continue;\n case 'datatype':\n if (attributedProperty) {\n throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${propertyAttribute.value}).`);\n }\n if (parseType) {\n throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${propertyAttribute.value})`);\n }\n activeTag.datatype = this.valueToUri(propertyAttribute.value, activeTag);\n continue;\n case 'nodeID':\n if (attributedProperty) {\n throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${propertyAttribute.value}).`);\n }\n if (activeTag.hadChildren) {\n throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${propertyAttribute.value}).`);\n }\n if (parseType) {\n throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${propertyAttribute.value})`);\n }\n this.validateNcname(propertyAttribute.value);\n activeTag.hadChildren = true;\n activeSubSubjectValue = propertyAttribute.value;\n subSubjectValueBlank = true;\n continue;\n case 'bagID':\n throw this.newParseError(`rdf:bagID is not supported.`);\n case 'parseType':\n // Validation\n if (attributedProperty) {\n throw this.newParseError(`rdf:parseType is not allowed when non-rdf:* property attributes are present`);\n }\n if (activeTag.datatype) {\n throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${activeTag.datatype.value})`);\n }\n if (activeSubSubjectValue) {\n throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${activeSubSubjectValue})`);\n }\n if (propertyAttribute.value === 'Resource') {\n parseType = true;\n activeTag.childrenParseType = ParseType.PROPERTY;\n // Turn this property element into a node element\n const nestedBNode = this.dataFactory.blankNode();\n this.emitTriple(activeTag.subject, activeTag.predicate, nestedBNode, activeTag.reifiedStatementId);\n activeTag.subject = nestedBNode;\n activeTag.predicate = null;\n }\n else if (propertyAttribute.value === 'Collection') {\n parseType = true;\n // Interpret children as being part of an rdf:List\n activeTag.hadChildren = true;\n activeTag.childrenCollectionSubject = activeTag.subject;\n activeTag.childrenCollectionPredicate = activeTag.predicate;\n subSubjectValueBlank = false;\n }\n else if (propertyAttribute.value === 'Literal') {\n parseType = true;\n // Interpret children as being part of a literal string\n activeTag.childrenTagsToString = true;\n activeTag.childrenStringTags = [];\n }\n continue;\n case 'ID':\n this.validateNcname(propertyAttribute.value);\n activeTag.reifiedStatementId = this.valueToUri('#' + propertyAttribute.value, activeTag);\n this.claimNodeId(activeTag.reifiedStatementId);\n continue;\n }\n }\n else if (propertyAttribute.uri === RdfXmlParser.XML && propertyAttribute.local === 'lang') {\n activeTag.language = propertyAttribute.value === ''\n ? null : propertyAttribute.value.toLowerCase();\n continue;\n }\n // Interpret attributes at this point as properties via implicit blank nodes on the property,\n // but we ignore attributes that have no prefix or known expanded URI\n if (propertyAttribute.prefix !== 'xml' && propertyAttribute.prefix !== 'xmlns'\n && (propertyAttribute.prefix !== '' || propertyAttribute.local !== 'xmlns')\n && propertyAttribute.uri) {\n if (parseType || activeTag.datatype) {\n throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${propertyAttribute.value}`);\n }\n activeTag.hadChildren = true;\n attributedProperty = true;\n predicates.push(this.uriToNamedNode(propertyAttribute.uri + propertyAttribute.local));\n objects.push(this.dataFactory.literal(propertyAttribute.value, activeTag.datatype || activeTag.language));\n }\n }\n // Create the subject value _after_ all attributes have been processed\n if (activeSubSubjectValue !== null) {\n const subjectParent = activeTag.subject;\n activeTag.subject = subSubjectValueBlank\n ? this.dataFactory.blankNode(activeSubSubjectValue) : this.valueToUri(activeSubSubjectValue, activeTag);\n this.emitTriple(subjectParent, activeTag.predicate, activeTag.subject, activeTag.reifiedStatementId);\n // Emit our buffered triples\n for (let i = 0; i < predicates.length; i++) {\n this.emitTriple(activeTag.subject, predicates[i], objects[i], null);\n }\n activeTag.predicateEmitted = true;\n }\n else if (subSubjectValueBlank) {\n // The current property element has no defined subject\n // Let's buffer the properties until the child node defines a subject,\n // or if the tag closes.\n activeTag.predicateSubPredicates = predicates;\n activeTag.predicateSubObjects = objects;\n activeTag.predicateEmitted = false;\n }\n }\n /**\n * Emit the given triple to the stream.\n * @param {Term} subject A subject term.\n * @param {Term} predicate A predicate term.\n * @param {Term} object An object term.\n * @param {Term} statementId An optional resource that identifies the triple.\n * If truthy, then the given triple will also be emitted reified.\n */\n emitTriple(subject, predicate, object, statementId) {\n this.push(this.dataFactory.quad(subject, predicate, object, this.defaultGraph));\n // Reify triple\n if (statementId) {\n this.push(this.dataFactory.quad(statementId, this.dataFactory.namedNode(RdfXmlParser.RDF + 'type'), this.dataFactory.namedNode(RdfXmlParser.RDF + 'Statement'), this.defaultGraph));\n this.push(this.dataFactory.quad(statementId, this.dataFactory.namedNode(RdfXmlParser.RDF + 'subject'), subject, this.defaultGraph));\n this.push(this.dataFactory.quad(statementId, this.dataFactory.namedNode(RdfXmlParser.RDF + 'predicate'), predicate, this.defaultGraph));\n this.push(this.dataFactory.quad(statementId, this.dataFactory.namedNode(RdfXmlParser.RDF + 'object'), object, this.defaultGraph));\n }\n }\n /**\n * Register the given term as a node ID.\n * If one was already registered, this will emit an error.\n *\n * This is used to check duplicate occurrences of rdf:ID in scope of the baseIRI.\n * @param {Term} term An RDF term.\n */\n claimNodeId(term) {\n if (!this.allowDuplicateRdfIds) {\n if (this.nodeIds[term.value]) {\n throw this.newParseError(`Found multiple occurrences of rdf:ID='${term.value}'.`);\n }\n this.nodeIds[term.value] = true;\n }\n }\n /**\n * Handle the given text string.\n * @param {string} text A parsed text string.\n */\n onText(text) {\n const activeTag = this.activeTagStack.length\n ? this.activeTagStack[this.activeTagStack.length - 1] : null;\n if (activeTag) {\n if (activeTag.childrenStringTags) {\n activeTag.childrenStringTags.push(text);\n }\n else if (activeTag.predicate) {\n activeTag.text = text;\n }\n }\n }\n /**\n * Handle the closing of the last tag.\n */\n onCloseTag() {\n const poppedTag = this.activeTagStack.pop();\n // If we were converting a tag to a string, and the tag was not self-closing, close it here.\n if (poppedTag.childrenStringEmitClosingTag) {\n poppedTag.childrenStringTags.push(poppedTag.childrenStringEmitClosingTag);\n }\n // Set the literal value if we were collecting XML tags to string\n if (poppedTag.childrenTagsToString) {\n poppedTag.datatype = this.dataFactory.namedNode(RdfXmlParser.RDF + 'XMLLiteral');\n poppedTag.text = poppedTag.childrenStringTags.join('');\n poppedTag.hadChildren = false; // Force a literal triple to be emitted hereafter\n }\n if (poppedTag.childrenCollectionSubject) {\n // Terminate the rdf:List\n this.emitTriple(poppedTag.childrenCollectionSubject, poppedTag.childrenCollectionPredicate, this.dataFactory.namedNode(RdfXmlParser.RDF + 'nil'), poppedTag.reifiedStatementId);\n }\n else if (poppedTag.predicate) {\n if (!poppedTag.hadChildren && poppedTag.childrenParseType !== ParseType.PROPERTY) {\n // Property element contains text\n this.emitTriple(poppedTag.subject, poppedTag.predicate, this.dataFactory.literal(poppedTag.text || '', poppedTag.datatype || poppedTag.language), poppedTag.reifiedStatementId);\n }\n else if (!poppedTag.predicateEmitted) {\n // Emit remaining properties on an anonymous property element\n const subject = this.dataFactory.blankNode();\n this.emitTriple(poppedTag.subject, poppedTag.predicate, subject, poppedTag.reifiedStatementId);\n for (let i = 0; i < poppedTag.predicateSubPredicates.length; i++) {\n this.emitTriple(subject, poppedTag.predicateSubPredicates[i], poppedTag.predicateSubObjects[i], null);\n }\n }\n }\n }\n /**\n * Fetch local DOCTYPE ENTITY's and make the parser recognise them.\n * @param {string} doctype The read doctype.\n */\n onDoctype(doctype) {\n doctype.replace(//g, (match, prefix, uri) => {\n this.saxParser.ENTITIES[prefix] = uri;\n return '';\n });\n }\n}\nexports.RdfXmlParser = RdfXmlParser;\nRdfXmlParser.MIME_TYPE = 'application/rdf+xml';\nRdfXmlParser.RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';\nRdfXmlParser.XML = 'http://www.w3.org/XML/1998/namespace';\nRdfXmlParser.FORBIDDEN_NODE_ELEMENTS = [\n 'RDF',\n 'ID',\n 'about',\n 'bagID',\n 'parseType',\n 'resource',\n 'nodeID',\n 'li',\n 'aboutEach',\n 'aboutEachPrefix',\n];\nRdfXmlParser.FORBIDDEN_PROPERTY_ELEMENTS = [\n 'Description',\n 'RDF',\n 'ID',\n 'about',\n 'bagID',\n 'parseType',\n 'resource',\n 'nodeID',\n 'aboutEach',\n 'aboutEachPrefix',\n];\n// tslint:disable-next-line:max-line-length\nRdfXmlParser.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;\nvar ParseType;\n(function (ParseType) {\n ParseType[ParseType[\"RESOURCE\"] = 0] = \"RESOURCE\";\n ParseType[ParseType[\"PROPERTY\"] = 1] = \"PROPERTY\";\n})(ParseType || (exports.ParseType = ParseType = {}));\n//# sourceMappingURL=RdfXmlParser.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lib/BlankNode\"), exports);\n__exportStar(require(\"./lib/DataFactory\"), exports);\n__exportStar(require(\"./lib/DefaultGraph\"), exports);\n__exportStar(require(\"./lib/Literal\"), exports);\n__exportStar(require(\"./lib/NamedNode\"), exports);\n__exportStar(require(\"./lib/Quad\"), exports);\n__exportStar(require(\"./lib/Variable\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BlankNode = void 0;\n/**\n * A term that represents an RDF blank node with a label.\n */\nclass BlankNode {\n constructor(value) {\n this.termType = 'BlankNode';\n this.value = value;\n }\n equals(other) {\n return !!other && other.termType === 'BlankNode' && other.value === this.value;\n }\n}\nexports.BlankNode = BlankNode;\n//# sourceMappingURL=BlankNode.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DataFactory = void 0;\nconst BlankNode_1 = require(\"./BlankNode\");\nconst DefaultGraph_1 = require(\"./DefaultGraph\");\nconst Literal_1 = require(\"./Literal\");\nconst NamedNode_1 = require(\"./NamedNode\");\nconst Quad_1 = require(\"./Quad\");\nconst Variable_1 = require(\"./Variable\");\nlet dataFactoryCounter = 0;\n/**\n * A factory for instantiating RDF terms and quads.\n */\nclass DataFactory {\n constructor(options) {\n this.blankNodeCounter = 0;\n options = options || {};\n this.blankNodePrefix = options.blankNodePrefix || `df_${dataFactoryCounter++}_`;\n }\n /**\n * @param value The IRI for the named node.\n * @return A new instance of NamedNode.\n * @see NamedNode\n */\n namedNode(value) {\n return new NamedNode_1.NamedNode(value);\n }\n /**\n * @param value The optional blank node identifier.\n * @return A new instance of BlankNode.\n * If the `value` parameter is undefined a new identifier\n * for the blank node is generated for each call.\n * @see BlankNode\n */\n blankNode(value) {\n return new BlankNode_1.BlankNode(value || `${this.blankNodePrefix}${this.blankNodeCounter++}`);\n }\n /**\n * @param value The literal value.\n * @param languageOrDatatype The optional language or datatype.\n * If `languageOrDatatype` is a NamedNode,\n * then it is used for the value of `NamedNode.datatype`.\n * Otherwise `languageOrDatatype` is used for the value\n * of `NamedNode.language`.\n * @return A new instance of Literal.\n * @see Literal\n */\n literal(value, languageOrDatatype) {\n return new Literal_1.Literal(value, languageOrDatatype);\n }\n /**\n * This method is optional.\n * @param value The variable name\n * @return A new instance of Variable.\n * @see Variable\n */\n variable(value) {\n return new Variable_1.Variable(value);\n }\n /**\n * @return An instance of DefaultGraph.\n */\n defaultGraph() {\n return DefaultGraph_1.DefaultGraph.INSTANCE;\n }\n /**\n * @param subject The quad subject term.\n * @param predicate The quad predicate term.\n * @param object The quad object term.\n * @param graph The quad graph term.\n * @return A new instance of Quad.\n * @see Quad\n */\n quad(subject, predicate, object, graph) {\n return new Quad_1.Quad(subject, predicate, object, graph || this.defaultGraph());\n }\n /**\n * Create a deep copy of the given term using this data factory.\n * @param original An RDF term.\n * @return A deep copy of the given term.\n */\n fromTerm(original) {\n // TODO: remove nasty any casts when this TS bug has been fixed:\n // https://github.com/microsoft/TypeScript/issues/26933\n switch (original.termType) {\n case 'NamedNode':\n return this.namedNode(original.value);\n case 'BlankNode':\n return this.blankNode(original.value);\n case 'Literal':\n if (original.language) {\n return this.literal(original.value, original.language);\n }\n if (!original.datatype.equals(Literal_1.Literal.XSD_STRING)) {\n return this.literal(original.value, this.fromTerm(original.datatype));\n }\n return this.literal(original.value);\n case 'Variable':\n return this.variable(original.value);\n case 'DefaultGraph':\n return this.defaultGraph();\n case 'Quad':\n return this.quad(this.fromTerm(original.subject), this.fromTerm(original.predicate), this.fromTerm(original.object), this.fromTerm(original.graph));\n }\n }\n /**\n * Create a deep copy of the given quad using this data factory.\n * @param original An RDF quad.\n * @return A deep copy of the given quad.\n */\n fromQuad(original) {\n return this.fromTerm(original);\n }\n /**\n * Reset the internal blank node counter.\n */\n resetBlankNodeCounter() {\n this.blankNodeCounter = 0;\n }\n}\nexports.DataFactory = DataFactory;\n//# sourceMappingURL=DataFactory.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultGraph = void 0;\n/**\n * A singleton term instance that represents the default graph.\n * It's only allowed to assign a DefaultGraph to the .graph property of a Quad.\n */\nclass DefaultGraph {\n constructor() {\n this.termType = 'DefaultGraph';\n this.value = '';\n // Private constructor\n }\n equals(other) {\n return !!other && other.termType === 'DefaultGraph';\n }\n}\nexports.DefaultGraph = DefaultGraph;\nDefaultGraph.INSTANCE = new DefaultGraph();\n//# sourceMappingURL=DefaultGraph.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Literal = void 0;\nconst NamedNode_1 = require(\"./NamedNode\");\n/**\n * A term that represents an RDF literal, containing a string with an optional language tag or datatype.\n */\nclass Literal {\n constructor(value, languageOrDatatype) {\n this.termType = 'Literal';\n this.value = value;\n if (typeof languageOrDatatype === 'string') {\n this.language = languageOrDatatype;\n this.datatype = Literal.RDF_LANGUAGE_STRING;\n }\n else if (languageOrDatatype) {\n this.language = '';\n this.datatype = languageOrDatatype;\n }\n else {\n this.language = '';\n this.datatype = Literal.XSD_STRING;\n }\n }\n equals(other) {\n return !!other && other.termType === 'Literal' && other.value === this.value &&\n other.language === this.language && this.datatype.equals(other.datatype);\n }\n}\nexports.Literal = Literal;\nLiteral.RDF_LANGUAGE_STRING = new NamedNode_1.NamedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString');\nLiteral.XSD_STRING = new NamedNode_1.NamedNode('http://www.w3.org/2001/XMLSchema#string');\n//# sourceMappingURL=Literal.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NamedNode = void 0;\n/**\n * A term that contains an IRI.\n */\nclass NamedNode {\n constructor(value) {\n this.termType = 'NamedNode';\n this.value = value;\n }\n equals(other) {\n return !!other && other.termType === 'NamedNode' && other.value === this.value;\n }\n}\nexports.NamedNode = NamedNode;\n//# sourceMappingURL=NamedNode.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Quad = void 0;\n/**\n * An instance of DefaultGraph represents the default graph.\n * It's only allowed to assign a DefaultGraph to the .graph property of a Quad.\n */\nclass Quad {\n constructor(subject, predicate, object, graph) {\n this.termType = 'Quad';\n this.value = '';\n this.subject = subject;\n this.predicate = predicate;\n this.object = object;\n this.graph = graph;\n }\n equals(other) {\n // `|| !other.termType` is for backwards-compatibility with old factories without RDF* support.\n return !!other && (other.termType === 'Quad' || !other.termType) &&\n this.subject.equals(other.subject) &&\n this.predicate.equals(other.predicate) &&\n this.object.equals(other.object) &&\n this.graph.equals(other.graph);\n }\n}\nexports.Quad = Quad;\n//# sourceMappingURL=Quad.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Variable = void 0;\n/**\n * A term that represents a variable.\n */\nclass Variable {\n constructor(value) {\n this.termType = 'Variable';\n this.value = value;\n }\n equals(other) {\n return !!other && other.termType === 'Variable' && other.value === this.value;\n }\n}\nexports.Variable = Variable;\n//# sourceMappingURL=Variable.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lib/Resolve\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.removeDotSegmentsOfPath = exports.removeDotSegments = exports.resolve = void 0;\n/**\n * Convert the given relative IRI to an absolute IRI\n * by taking into account the given optional baseIRI.\n *\n * @param {string} relativeIRI The relative IRI to convert to an absolute IRI.\n * @param {string} baseIRI The optional base IRI.\n * @return {string} an absolute IRI.\n */\nfunction resolve(relativeIRI, baseIRI) {\n baseIRI = baseIRI || '';\n const baseFragmentPos = baseIRI.indexOf('#');\n // Ignore any fragments in the base IRI\n if (baseFragmentPos > 0) {\n baseIRI = baseIRI.substr(0, baseFragmentPos);\n }\n // Convert empty value directly to base IRI\n if (!relativeIRI.length) {\n // At this point, the baseIRI MUST be absolute, otherwise we error\n if (baseIRI.indexOf(':') < 0) {\n throw new Error(`Found invalid baseIRI '${baseIRI}' for value '${relativeIRI}'`);\n }\n return baseIRI;\n }\n // If the value starts with a query character, concat directly (but strip the existing query)\n if (relativeIRI.startsWith('?')) {\n const baseQueryPos = baseIRI.indexOf('?');\n if (baseQueryPos > 0) {\n baseIRI = baseIRI.substr(0, baseQueryPos);\n }\n return baseIRI + relativeIRI;\n }\n // If the value starts with a fragment character, concat directly\n if (relativeIRI.startsWith('#')) {\n return baseIRI + relativeIRI;\n }\n // Ignore baseIRI if it is empty\n if (!baseIRI.length) {\n const relativeColonPos = relativeIRI.indexOf(':');\n if (relativeColonPos < 0) {\n throw new Error(`Found invalid relative IRI '${relativeIRI}' for a missing baseIRI`);\n }\n return removeDotSegmentsOfPath(relativeIRI, relativeColonPos);\n }\n // Ignore baseIRI if the value is absolute\n const valueColonPos = relativeIRI.indexOf(':');\n if (valueColonPos >= 0) {\n return removeDotSegmentsOfPath(relativeIRI, valueColonPos);\n }\n // At this point, the baseIRI MUST be absolute, otherwise we error\n const baseColonPos = baseIRI.indexOf(':');\n if (baseColonPos < 0) {\n throw new Error(`Found invalid baseIRI '${baseIRI}' for value '${relativeIRI}'`);\n }\n const baseIRIScheme = baseIRI.substr(0, baseColonPos + 1);\n // Inherit the baseIRI scheme if the value starts with '//'\n if (relativeIRI.indexOf('//') === 0) {\n return baseIRIScheme + removeDotSegmentsOfPath(relativeIRI, valueColonPos);\n }\n // Check cases where '://' occurs in the baseIRI, and where there is no '/' after a ':' anymore.\n let baseSlashAfterColonPos;\n if (baseIRI.indexOf('//', baseColonPos) === baseColonPos + 1) {\n // If there is no additional '/' after the '//'.\n baseSlashAfterColonPos = baseIRI.indexOf('/', baseColonPos + 3);\n if (baseSlashAfterColonPos < 0) {\n // If something other than a '/' follows the '://', append the value after a '/',\n // otherwise, prefix the value with only the baseIRI scheme.\n if (baseIRI.length > baseColonPos + 3) {\n return baseIRI + '/' + removeDotSegmentsOfPath(relativeIRI, valueColonPos);\n }\n else {\n return baseIRIScheme + removeDotSegmentsOfPath(relativeIRI, valueColonPos);\n }\n }\n }\n else {\n // If there is not even a single '/' after the ':'\n baseSlashAfterColonPos = baseIRI.indexOf('/', baseColonPos + 1);\n if (baseSlashAfterColonPos < 0) {\n // If we don't have a '/' after the ':',\n // prefix the value with only the baseIRI scheme.\n return baseIRIScheme + removeDotSegmentsOfPath(relativeIRI, valueColonPos);\n }\n }\n // If the value starts with a '/', then prefix it with everything before the first effective slash of the base IRI.\n if (relativeIRI.indexOf('/') === 0) {\n return baseIRI.substr(0, baseSlashAfterColonPos) + removeDotSegments(relativeIRI);\n }\n let baseIRIPath = baseIRI.substr(baseSlashAfterColonPos);\n const baseIRILastSlashPos = baseIRIPath.lastIndexOf('/');\n // Ignore everything after the last '/' in the baseIRI path\n if (baseIRILastSlashPos >= 0 && baseIRILastSlashPos < baseIRIPath.length - 1) {\n baseIRIPath = baseIRIPath.substr(0, baseIRILastSlashPos + 1);\n // Also remove the first character of the relative path if it starts with '.' (and not '..' or './')\n // This change is only allowed if there is something else following the path\n if (relativeIRI[0] === '.' && relativeIRI[1] !== '.' && relativeIRI[1] !== '/' && relativeIRI[2]) {\n relativeIRI = relativeIRI.substr(1);\n }\n }\n // Prefix the value with the baseIRI path where\n relativeIRI = baseIRIPath + relativeIRI;\n // Remove dot segment from the IRI\n relativeIRI = removeDotSegments(relativeIRI);\n // Prefix our transformed value with the part of the baseIRI until the first '/' after the first ':'.\n return baseIRI.substr(0, baseSlashAfterColonPos) + relativeIRI;\n}\nexports.resolve = resolve;\n/**\n * Remove dot segments from the given path,\n * as described in https://www.ietf.org/rfc/rfc3986.txt (page 32).\n * @param {string} path An IRI path.\n * @return {string} A path, will always start with a '/'.\n */\nfunction removeDotSegments(path) {\n // Prepare a buffer with segments between each '/.\n // Each segment represents an array of characters.\n const segmentBuffers = [];\n let i = 0;\n while (i < path.length) {\n // Remove '/.' or '/..'\n switch (path[i]) {\n case '/':\n if (path[i + 1] === '.') {\n if (path[i + 2] === '.') {\n // Start a new segment if we find an invalid character after the '.'\n if (!isCharacterAllowedAfterRelativePathSegment(path[i + 3])) {\n segmentBuffers.push([]);\n i++;\n break;\n }\n // Go to parent directory,\n // so we remove a parent segment\n segmentBuffers.pop();\n // Ensure that we end with a slash if there is a trailing '/..'\n if (!path[i + 3]) {\n segmentBuffers.push([]);\n }\n i += 3;\n }\n else {\n // Start a new segment if we find an invalid character after the '.'\n if (!isCharacterAllowedAfterRelativePathSegment(path[i + 2])) {\n segmentBuffers.push([]);\n i++;\n break;\n }\n // Ensure that we end with a slash if there is a trailing '/.'\n if (!path[i + 2]) {\n segmentBuffers.push([]);\n }\n // Go to the current directory,\n // so we do nothing\n i += 2;\n }\n }\n else {\n // Start a new segment\n segmentBuffers.push([]);\n i++;\n }\n break;\n case '#':\n case '?':\n // Query and fragment string should be appended unchanged\n if (!segmentBuffers.length) {\n segmentBuffers.push([]);\n }\n segmentBuffers[segmentBuffers.length - 1].push(path.substr(i));\n // Break the while loop\n i = path.length;\n break;\n default:\n // Not a special character, just append it to our buffer\n if (!segmentBuffers.length) {\n segmentBuffers.push([]);\n }\n segmentBuffers[segmentBuffers.length - 1].push(path[i]);\n i++;\n break;\n }\n }\n return '/' + segmentBuffers.map((buffer) => buffer.join('')).join('/');\n}\nexports.removeDotSegments = removeDotSegments;\n/**\n * Removes dot segments of the given IRI.\n * @param {string} iri An IRI (or part of IRI).\n * @param {number} colonPosition The position of the first ':' in the IRI.\n * @return {string} The IRI where dot segments were removed.\n */\nfunction removeDotSegmentsOfPath(iri, colonPosition) {\n // Determine where we should start looking for the first '/' that indicates the start of the path\n let searchOffset = colonPosition + 1;\n if (colonPosition >= 0) {\n if (iri[colonPosition + 1] === '/' && iri[colonPosition + 2] === '/') {\n searchOffset = colonPosition + 3;\n }\n }\n else {\n if (iri[0] === '/' && iri[1] === '/') {\n searchOffset = 2;\n }\n }\n // Determine the path\n const pathSeparator = iri.indexOf('/', searchOffset);\n if (pathSeparator < 0) {\n return iri;\n }\n const base = iri.substr(0, pathSeparator);\n const path = iri.substr(pathSeparator);\n // Remove dot segments from the path\n return base + removeDotSegments(path);\n}\nexports.removeDotSegmentsOfPath = removeDotSegmentsOfPath;\nfunction isCharacterAllowedAfterRelativePathSegment(character) {\n return !character || character === '#' || character === '?' || character === '/';\n}\n//# sourceMappingURL=Resolve.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lib/Validate\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateIri = exports.IriValidationStrategy = void 0;\nfunction buildAbsoluteIriRfc3987Regex() {\n // The syntax is defined in https://www.rfc-editor.org/rfc/rfc3987#section-2.2\n // Rules are defined in reversed order\n const sub_delims_raw = `!$&'()*+,;=`;\n const sub_delims = `[${sub_delims_raw}]`;\n const pct_encoded = `%[a-fA-F0-9]{2}`;\n const dec_octet = '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';\n const ipv4address = `${dec_octet}\\\\.${dec_octet}\\\\.${dec_octet}\\\\.${dec_octet}`;\n const h16 = `[a-fA-F0-9]{1,4}`;\n const ls32 = `(${h16}:${h16}|${ipv4address})`;\n const ipv6address = `((${h16}:){6}${ls32}|::(${h16}:){5}${ls32}|(${h16})?::(${h16}:){4}${ls32}|((${h16}:){0,1}${h16})?::(${h16}:){3}${ls32}|((${h16}:){0,2}${h16})?::(${h16}:){2}${ls32}|((${h16}:){0,3}${h16})?::${h16}:${ls32}|((${h16}:){0,4}${h16})?::${ls32}|((${h16}:){0,5}${h16})?::${h16}|((${h16}:){0,6}${h16})?::)`;\n const ipvfuture = `v[a-fA-F0-9]+\\\\.(${sub_delims}|${sub_delims}|\":)+`;\n const ip_literal = `\\\\[(${ipv6address}|${ipvfuture})\\\\]`;\n const port = `[0-9]*`;\n const scheme = `[a-zA-Z][a-zA-Z0-9+\\\\-.]*`;\n const iprivate_raw = `\\u{E000}-\\u{F8FF}\\u{F0000}-\\u{FFFFD}\\u{100000}-\\u{10FFFD}`;\n const iprivate = `[${iprivate_raw}]`;\n const ucschar_raw = `\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}`;\n const iunreserved_raw = `a-zA-Z0-9\\\\-._~${ucschar_raw}`;\n const iunreserved = `[${iunreserved_raw}]`;\n const ipchar = `(${iunreserved}|${pct_encoded}|${sub_delims}|[:@])*`;\n const ifragment = `(${ipchar}|[\\\\/?])*`;\n const iquery = `(${ipchar}|${iprivate}|[\\\\/?])*`;\n const isegment_nz = `(${ipchar})+`;\n const isegment = `(${ipchar})*`;\n const ipath_empty = '';\n const ipath_rootless = `${isegment_nz}(\\\\/${isegment})*`;\n const ipath_absolute = `\\\\/(${isegment_nz}(\\\\/${isegment})*)?`;\n const ipath_abempty = `(\\\\/${isegment})*`;\n const ireg_name = `(${iunreserved}|${pct_encoded}|${sub_delims})*`;\n const ihost = `(${ip_literal}|${ipv4address}|${ireg_name})`;\n const iuserinfo = `(${iunreserved}|${pct_encoded}|${sub_delims}|:)*`;\n const iauthority = `(${iuserinfo}@)?${ihost}(:${port})?`;\n const ihier_part = `(\\\\/\\\\/${iauthority}${ipath_abempty}|${ipath_absolute}|${ipath_rootless}|${ipath_empty})`;\n const iri = `^${scheme}:${ihier_part}(\\\\?${iquery})?(#${ifragment})?$`;\n return new RegExp(iri, 'u');\n}\nconst STRICT_IRI_REGEX = buildAbsoluteIriRfc3987Regex();\n// eslint-disable-next-line no-control-regex\nconst PRAGMATIC_IRI_REGEX = /^[A-Za-z][\\d+-.A-Za-z]*:[^\\u0000-\\u0020\"<>\\\\^`{|}]*$/u;\n/**\n * Possible ways of validating an IRI\n */\nvar IriValidationStrategy;\n(function (IriValidationStrategy) {\n /**\n * Validates the IRI according to RFC 3987.\n */\n IriValidationStrategy[\"Strict\"] = \"strict\";\n /**\n * Validates that the IRI has a valid scheme and does not contain any character forbidden by the Turtle specification.\n */\n IriValidationStrategy[\"Pragmatic\"] = \"pragmatic\";\n /**\n * Does not validate the IRI at all.\n */\n IriValidationStrategy[\"None\"] = \"none\";\n})(IriValidationStrategy = exports.IriValidationStrategy || (exports.IriValidationStrategy = {}));\n/**\n * Validate a given IRI according to the given strategy.\n *\n * By default the IRI is fully validated according to RFC 3987.\n * But it is possible to do a lighter a faster validation using the \"pragmatic\" strategy.\n *\n * @param {string} iri a string that may be an IRI.\n * @param {IriValidationStrategy} strategy IRI validation strategy.\n * @return {Error | undefined} An error if the IRI is invalid, or undefined if it is valid.\n */\nfunction validateIri(iri, strategy = IriValidationStrategy.Strict) {\n switch (strategy) {\n case IriValidationStrategy.Strict:\n return STRICT_IRI_REGEX.test(iri) ? undefined : new Error(`Invalid IRI according to RFC 3987: '${iri}'`);\n case IriValidationStrategy.Pragmatic:\n return PRAGMATIC_IRI_REGEX.test(iri) ? undefined : new Error(`Invalid IRI according to RDF Turtle: '${iri}'`);\n case IriValidationStrategy.None:\n return undefined;\n default:\n return new Error(`Not supported validation strategy \"${strategy}\"`);\n }\n}\nexports.validateIri = validateIri;\n//# sourceMappingURL=Validate.js.map","\"use strict\";\n/**\n * Character classes and associated utilities for the 5th edition of XML 1.0.\n *\n * @author Louis-Dominique Dubeau\n * @license MIT\n * @copyright Louis-Dominique Dubeau\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//\n// Fragments.\n//\nexports.CHAR = \"\\t\\n\\r -\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\";\nexports.S = \" \\t\\r\\n\";\n// tslint:disable-next-line:max-line-length\nexports.NAME_START_CHAR = \":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\\uD800\\uDC00-\\uDB7F\\uDFFF\";\nexports.NAME_CHAR = \"-\" + exports.NAME_START_CHAR + \".0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040\";\n//\n// Regular expressions.\n//\nexports.CHAR_RE = new RegExp(\"^[\" + exports.CHAR + \"]$\", \"u\");\nexports.S_RE = new RegExp(\"^[\" + exports.S + \"]+$\", \"u\");\nexports.NAME_START_CHAR_RE = new RegExp(\"^[\" + exports.NAME_START_CHAR + \"]$\", \"u\");\nexports.NAME_CHAR_RE = new RegExp(\"^[\" + exports.NAME_CHAR + \"]$\", \"u\");\nexports.NAME_RE = new RegExp(\"^[\" + exports.NAME_START_CHAR + \"][\" + exports.NAME_CHAR + \"]*$\", \"u\");\nexports.NMTOKEN_RE = new RegExp(\"^[\" + exports.NAME_CHAR + \"]+$\", \"u\");\nvar TAB = 9;\nvar NL = 0xA;\nvar CR = 0xD;\nvar SPACE = 0x20;\n//\n// Lists.\n//\n/** All characters in the ``S`` production. */\nexports.S_LIST = [SPACE, NL, CR, TAB];\n/**\n * Determines whether a codepoint matches the ``CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``CHAR``.\n */\nfunction isChar(c) {\n return (c >= SPACE && c <= 0xD7FF) ||\n c === NL || c === CR || c === TAB ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}\nexports.isChar = isChar;\n/**\n * Determines whether a codepoint matches the ``S`` (space) production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``S``.\n */\nfunction isS(c) {\n return c === SPACE || c === NL || c === CR || c === TAB;\n}\nexports.isS = isS;\n/**\n * Determines whether a codepoint matches the ``NAME_START_CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``NAME_START_CHAR``.\n */\nfunction isNameStartChar(c) {\n return ((c >= 0x41 && c <= 0x5A) ||\n (c >= 0x61 && c <= 0x7A) ||\n c === 0x3A ||\n c === 0x5F ||\n c === 0x200C ||\n c === 0x200D ||\n (c >= 0xC0 && c <= 0xD6) ||\n (c >= 0xD8 && c <= 0xF6) ||\n (c >= 0x00F8 && c <= 0x02FF) ||\n (c >= 0x0370 && c <= 0x037D) ||\n (c >= 0x037F && c <= 0x1FFF) ||\n (c >= 0x2070 && c <= 0x218F) ||\n (c >= 0x2C00 && c <= 0x2FEF) ||\n (c >= 0x3001 && c <= 0xD7FF) ||\n (c >= 0xF900 && c <= 0xFDCF) ||\n (c >= 0xFDF0 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0xEFFFF));\n}\nexports.isNameStartChar = isNameStartChar;\n/**\n * Determines whether a codepoint matches the ``NAME_CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``NAME_CHAR``.\n */\nfunction isNameChar(c) {\n return isNameStartChar(c) ||\n (c >= 0x30 && c <= 0x39) ||\n c === 0x2D ||\n c === 0x2E ||\n c === 0xB7 ||\n (c >= 0x0300 && c <= 0x036F) ||\n (c >= 0x203F && c <= 0x2040);\n}\nexports.isNameChar = isNameChar;\n//# sourceMappingURL=ed5.js.map","\"use strict\";\n/**\n * Character classes and associated utilities for the 2nd edition of XML 1.1.\n *\n * @author Louis-Dominique Dubeau\n * @license MIT\n * @copyright Louis-Dominique Dubeau\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//\n// Fragments.\n//\nexports.CHAR = \"\\u0001-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\";\nexports.RESTRICTED_CHAR = \"\\u0001-\\u0008\\u000B\\u000C\\u000E-\\u001F\\u007F-\\u0084\\u0086-\\u009F\";\nexports.S = \" \\t\\r\\n\";\n// tslint:disable-next-line:max-line-length\nexports.NAME_START_CHAR = \":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\\uD800\\uDC00-\\uDB7F\\uDFFF\";\nexports.NAME_CHAR = \"-\" + exports.NAME_START_CHAR + \".0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040\";\n//\n// Regular expressions.\n//\nexports.CHAR_RE = new RegExp(\"^[\" + exports.CHAR + \"]$\", \"u\");\nexports.RESTRICTED_CHAR_RE = new RegExp(\"^[\" + exports.RESTRICTED_CHAR + \"]$\", \"u\");\nexports.S_RE = new RegExp(\"^[\" + exports.S + \"]+$\", \"u\");\nexports.NAME_START_CHAR_RE = new RegExp(\"^[\" + exports.NAME_START_CHAR + \"]$\", \"u\");\nexports.NAME_CHAR_RE = new RegExp(\"^[\" + exports.NAME_CHAR + \"]$\", \"u\");\nexports.NAME_RE = new RegExp(\"^[\" + exports.NAME_START_CHAR + \"][\" + exports.NAME_CHAR + \"]*$\", \"u\");\nexports.NMTOKEN_RE = new RegExp(\"^[\" + exports.NAME_CHAR + \"]+$\", \"u\");\nvar TAB = 9;\nvar NL = 0xA;\nvar CR = 0xD;\nvar SPACE = 0x20;\n//\n// Lists.\n//\n/** All characters in the ``S`` production. */\nexports.S_LIST = [SPACE, NL, CR, TAB];\n/**\n * Determines whether a codepoint matches the ``CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``CHAR``.\n */\nfunction isChar(c) {\n return (c >= 0x0001 && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}\nexports.isChar = isChar;\n/**\n * Determines whether a codepoint matches the ``RESTRICTED_CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``RESTRICTED_CHAR``.\n */\nfunction isRestrictedChar(c) {\n return (c >= 0x1 && c <= 0x8) ||\n c === 0xB ||\n c === 0xC ||\n (c >= 0xE && c <= 0x1F) ||\n (c >= 0x7F && c <= 0x84) ||\n (c >= 0x86 && c <= 0x9F);\n}\nexports.isRestrictedChar = isRestrictedChar;\n/**\n * Determines whether a codepoint matches the ``CHAR`` production and does not\n * match the ``RESTRICTED_CHAR`` production. ``isCharAndNotRestricted(x)`` is\n * equivalent to ``isChar(x) && !isRestrictedChar(x)``. This function is faster\n * than running the two-call equivalent.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``CHAR`` and does not match\n * ``RESTRICTED_CHAR``.\n */\nfunction isCharAndNotRestricted(c) {\n return (c === 0x9) ||\n (c === 0xA) ||\n (c === 0xD) ||\n (c > 0x1F && c < 0x7F) ||\n (c === 0x85) ||\n (c > 0x9F && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}\nexports.isCharAndNotRestricted = isCharAndNotRestricted;\n/**\n * Determines whether a codepoint matches the ``S`` (space) production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``S``.\n */\nfunction isS(c) {\n return c === SPACE || c === NL || c === CR || c === TAB;\n}\nexports.isS = isS;\n/**\n * Determines whether a codepoint matches the ``NAME_START_CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``NAME_START_CHAR``.\n */\n// tslint:disable-next-line:cyclomatic-complexity\nfunction isNameStartChar(c) {\n return ((c >= 0x41 && c <= 0x5A) ||\n (c >= 0x61 && c <= 0x7A) ||\n c === 0x3A ||\n c === 0x5F ||\n c === 0x200C ||\n c === 0x200D ||\n (c >= 0xC0 && c <= 0xD6) ||\n (c >= 0xD8 && c <= 0xF6) ||\n (c >= 0x00F8 && c <= 0x02FF) ||\n (c >= 0x0370 && c <= 0x037D) ||\n (c >= 0x037F && c <= 0x1FFF) ||\n (c >= 0x2070 && c <= 0x218F) ||\n (c >= 0x2C00 && c <= 0x2FEF) ||\n (c >= 0x3001 && c <= 0xD7FF) ||\n (c >= 0xF900 && c <= 0xFDCF) ||\n (c >= 0xFDF0 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0xEFFFF));\n}\nexports.isNameStartChar = isNameStartChar;\n/**\n * Determines whether a codepoint matches the ``NAME_CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``NAME_CHAR``.\n */\nfunction isNameChar(c) {\n return isNameStartChar(c) ||\n (c >= 0x30 && c <= 0x39) ||\n c === 0x2D ||\n c === 0x2E ||\n c === 0xB7 ||\n (c >= 0x0300 && c <= 0x036F) ||\n (c >= 0x203F && c <= 0x2040);\n}\nexports.isNameChar = isNameChar;\n//# sourceMappingURL=ed2.js.map","\"use strict\";\n/**\n * Character class utilities for XML NS 1.0 edition 3.\n *\n * @author Louis-Dominique Dubeau\n * @license MIT\n * @copyright Louis-Dominique Dubeau\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//\n// Fragments.\n//\n// tslint:disable-next-line:max-line-length\nexports.NC_NAME_START_CHAR = \"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\\uD800\\uDC00-\\uDB7F\\uDFFF\";\nexports.NC_NAME_CHAR = \"-\" + exports.NC_NAME_START_CHAR + \".0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040\";\n//\n// Regular expressions.\n//\nexports.NC_NAME_START_CHAR_RE = new RegExp(\"^[\" + exports.NC_NAME_START_CHAR + \"]$\", \"u\");\nexports.NC_NAME_CHAR_RE = new RegExp(\"^[\" + exports.NC_NAME_CHAR + \"]$\", \"u\");\nexports.NC_NAME_RE = new RegExp(\"^[\" + exports.NC_NAME_START_CHAR + \"][\" + exports.NC_NAME_CHAR + \"]*$\", \"u\");\n/**\n * Determines whether a codepoint matches [[NC_NAME_START_CHAR]].\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches.\n */\n// tslint:disable-next-line:cyclomatic-complexity\nfunction isNCNameStartChar(c) {\n return ((c >= 0x41 && c <= 0x5A) ||\n c === 0x5F ||\n (c >= 0x61 && c <= 0x7A) ||\n (c >= 0xC0 && c <= 0xD6) ||\n (c >= 0xD8 && c <= 0xF6) ||\n (c >= 0x00F8 && c <= 0x02FF) ||\n (c >= 0x0370 && c <= 0x037D) ||\n (c >= 0x037F && c <= 0x1FFF) ||\n (c >= 0x200C && c <= 0x200D) ||\n (c >= 0x2070 && c <= 0x218F) ||\n (c >= 0x2C00 && c <= 0x2FEF) ||\n (c >= 0x3001 && c <= 0xD7FF) ||\n (c >= 0xF900 && c <= 0xFDCF) ||\n (c >= 0xFDF0 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0xEFFFF));\n}\nexports.isNCNameStartChar = isNCNameStartChar;\n/**\n * Determines whether a codepoint matches [[NC_NAME_CHAR]].\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches.\n */\nfunction isNCNameChar(c) {\n return isNCNameStartChar(c) ||\n (c === 0x2D ||\n c === 0x2E ||\n (c >= 0x30 && c <= 0x39) ||\n c === 0x00B7 ||\n (c >= 0x0300 && c <= 0x036F) ||\n (c >= 0x203F && c <= 0x2040));\n}\nexports.isNCNameChar = isNCNameChar;\n//# sourceMappingURL=ed3.js.map","import { RdfXmlParser } from 'rdfxml-streaming-parser';\nclass CustomRdfXmlParser extends RdfXmlParser {\n constructor({ factory, ...args } = {}) {\n super({ ...args, dataFactory: factory });\n }\n}\nexport default CustomRdfXmlParser;\n"],"names":["Object","defineProperty","exports","value","SaxesParser","EVENTS","ed5","ed2","NSed3","isS","isChar10","isChar","isNameStartChar","isNameChar","S_LIST","NAME_RE","isChar11","isNCNameStartChar","isNCNameChar","NC_NAME_RE","XML_NAMESPACE","XMLNS_NAMESPACE","rootNS","__proto__","xml","xmlns","XML_ENTITIES","amp","gt","lt","quot","apos","EOC","NL_LIKE","S_BEGIN","S_BEGIN_WHITESPACE","S_DOCTYPE","S_DOCTYPE_QUOTE","S_DTD","S_DTD_QUOTED","S_DTD_OPEN_WAKA","S_DTD_OPEN_WAKA_BANG","S_DTD_COMMENT","S_DTD_COMMENT_ENDING","S_DTD_COMMENT_ENDED","S_DTD_PI","S_DTD_PI_ENDING","S_TEXT","S_ENTITY","S_OPEN_WAKA","S_OPEN_WAKA_BANG","S_COMMENT","S_COMMENT_ENDING","S_COMMENT_ENDED","S_CDATA","S_CDATA_ENDING","S_CDATA_ENDING_2","S_PI_FIRST_CHAR","S_PI_REST","S_PI_BODY","S_PI_ENDING","S_XML_DECL_NAME_START","S_XML_DECL_NAME","S_XML_DECL_EQ","S_XML_DECL_VALUE_START","S_XML_DECL_VALUE","S_XML_DECL_SEPARATOR","S_XML_DECL_ENDING","S_OPEN_TAG","S_OPEN_TAG_SLASH","S_ATTRIB","S_ATTRIB_NAME","S_ATTRIB_NAME_SAW_WHITE","S_ATTRIB_VALUE","S_ATTRIB_VALUE_QUOTED","S_ATTRIB_VALUE_CLOSED","S_ATTRIB_VALUE_UNQUOTED","S_CLOSE_TAG","S_CLOSE_TAG_SAW_WHITE","TAB","NL","CR","SPACE","BANG","DQUOTE","AMP","SQUOTE","MINUS","FORWARD_SLASH","SEMICOLON","LESS","EQUAL","GREATER","QUESTION","OPEN_BRACKET","CLOSE_BRACKET","NEL","LS","isQuote","c","QUOTES","DOCTYPE_TERMINATOR","DTD_TERMINATOR","XML_DECL_NAME_TERMINATOR","ATTRIB_VALUE_UNQUOTED_TERMINATOR","nsPairCheck","parser","prefix","uri","fail","nsMappingCheck","mapping","local","keys","isNCName","name","test","isName","FORBIDDEN_START","FORBIDDEN_BRACKET","FORBIDDEN_BRACKET_BRACKET","EVENT_NAME_TO_HANDLER_NAME","xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready","closed","this","_closed","constructor","opt","fragmentOpt","fragment","xmlnsOpt","trackPosition","position","fileName","nameStartCheck","nameCheck","processAttribs","processAttribsNS","pushAttrib","pushAttribNS","ns","assign","additional","additionalNamespaces","processAttribsPlain","pushAttribPlain","stateTable","sBegin","sBeginWhitespace","sDoctype","sDoctypeQuote","sDTD","sDTDQuoted","sDTDOpenWaka","sDTDOpenWakaBang","sDTDComment","sDTDCommentEnding","sDTDCommentEnded","sDTDPI","sDTDPIEnding","sText","sEntity","sOpenWaka","sOpenWakaBang","sComment","sCommentEnding","sCommentEnded","sCData","sCDataEnding","sCDataEnding2","sPIFirstChar","sPIRest","sPIBody","sPIEnding","sXMLDeclNameStart","sXMLDeclName","sXMLDeclEq","sXMLDeclValueStart","sXMLDeclValue","sXMLDeclSeparator","sXMLDeclEnding","sOpenTag","sOpenTagSlash","sAttrib","sAttribName","sAttribNameSawWhite","sAttribValue","sAttribValueQuoted","sAttribValueClosed","sAttribValueUnquoted","sCloseTag","sCloseTagSawWhite","_init","_a","openWakaBang","piTarget","entity","q","tags","tag","topNS","chunk","chunkPosition","i","prevI","carriedFromPrevious","undefined","forbiddenState","attribList","state","reportedTextBeforeRoot","reportedTextAfterRoot","closedRoot","sawRoot","xmlDeclPossible","xmlDeclExpects","entityReturnState","defaultXMLVersion","forceXMLVersion","Error","setXMLVersion","positionAtNewLine","xmlDecl","version","encoding","standalone","line","column","ENTITIES","create","readyHandler","call","columnIndex","on","handler","off","makeError","message","msg","length","err","errorHandler","write","toString","limit","lastCode","charCodeAt","slice","close","getCode10","code","final","getCode11","next","getCodeNorm","getCode","unget","captureTo","chars","start","isNLLike","includes","captureToChar","char","captureNameChars","skipSpaces","currentXMLVersion","iBefore","doctypeHandler","String","fromCodePoint","owb","handleTextInRoot","handleTextOutsideRoot","loop","parsed","parseEntity","textHandler","commentHandler","cdataHandler","isQuestion","toLowerCase","piHandler","target","body","join","xmldeclHandler","attributes","openTagStartHandler","openTag","openSelfClosingTag","closeTag","scanLoop","nonSpace","outRootLoop","qname","attr","push","attributeHandler","trimmed","trim","_b","pop","endHandler","resolve","index","resolvePrefix","colon","indexOf","JSON","stringify","seen","Set","eqname","has","add","isSelfClosing","openTagHandler","_c","closeTagHandler","top","l","defined","num","NaN","parseInt","__createBinding","o","m","k","k2","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","__exportStar","p","prototype","hasOwnProperty","ParseError","saxParser","super","ParseType","RdfXmlParser","relative_to_absolute_iri_1","saxes_1","readable_stream_1","ParseError_1","rdf_data_factory_1","validate_iri_1","Transform","args","readableObjectMode","activeTagStack","nodeIds","options","dataFactory","DataFactory","baseIRI","defaultGraph","validateUri","iriValidationStrategy","IriValidationStrategy","Pragmatic","None","attachSaxListeners","import","stream","output","PassThrough","emit","data","pipe","_transform","callback","e","newParseError","valueToUri","activeTag","uriToNamedNode","uriValidationResult","validateIri","namedNode","validateNcname","NCNAME_MATCHER","onTag","bind","onText","onCloseTag","onDoctype","parentTag","currentParseType","RESOURCE","hadChildren","childrenParseType","childrenStringTags","tagName","attributeKey","tagContents","tagString","stringActiveTag","childrenStringEmitClosingTag","language","onTagResource","onTagProperty","rootTag","PROPERTY","typedNode","RDF","FORBIDDEN_NODE_ELEMENTS","predicates","objects","activeSubjectValue","claimSubjectNodeId","subjectValueBlank","explicitType","XML","subject","blankNode","claimNodeId","type","emitTriple","reifiedStatementId","predicate","childrenCollectionSubject","linkTerm","childrenCollectionPredicate","predicateSubPredicates","predicateSubObjects","predicateEmitted","object","literal","datatype","listItemCounter","FORBIDDEN_PROPERTY_ELEMENTS","parseType","attributedProperty","activeSubSubjectValue","subSubjectValueBlank","propertyAttributeKey","propertyAttribute","nestedBNode","childrenTagsToString","subjectParent","statementId","quad","term","allowDuplicateRdfIds","poppedTag","replace","match","MIME_TYPE","BlankNode","termType","equals","other","BlankNode_1","DefaultGraph_1","Literal_1","NamedNode_1","Quad_1","Variable_1","dataFactoryCounter","blankNodeCounter","blankNodePrefix","NamedNode","languageOrDatatype","Literal","variable","Variable","DefaultGraph","INSTANCE","graph","Quad","fromTerm","original","XSD_STRING","fromQuad","resetBlankNodeCounter","RDF_LANGUAGE_STRING","relativeIRI","baseFragmentPos","substr","startsWith","baseQueryPos","relativeColonPos","removeDotSegmentsOfPath","valueColonPos","baseColonPos","baseIRIScheme","baseSlashAfterColonPos","removeDotSegments","baseIRIPath","baseIRILastSlashPos","lastIndexOf","path","segmentBuffers","isCharacterAllowedAfterRelativePathSegment","map","buffer","iri","colonPosition","searchOffset","pathSeparator","base","character","buildAbsoluteIriRfc3987Regex","sub_delims_raw","sub_delims","pct_encoded","dec_octet","ipv4address","h16","ls32","ipv6address","ipvfuture","ip_literal","port","scheme","iprivate_raw","iprivate","ucschar_raw","iunreserved_raw","iunreserved","ipchar","ifragment","iquery","isegment_nz","isegment","ipath_empty","ipath_rootless","ipath_absolute","ipath_abempty","ireg_name","ihost","iuserinfo","iauthority","ihier_part","RegExp","STRICT_IRI_REGEX","PRAGMATIC_IRI_REGEX","strategy","Strict","CHAR","S","NAME_START_CHAR","NAME_CHAR","CHAR_RE","S_RE","NAME_START_CHAR_RE","NAME_CHAR_RE","NMTOKEN_RE","RESTRICTED_CHAR","RESTRICTED_CHAR_RE","isRestrictedChar","isCharAndNotRestricted","NC_NAME_START_CHAR","NC_NAME_CHAR","NC_NAME_START_CHAR_RE","NC_NAME_CHAR_RE","CustomRdfXmlParser","factory"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/148.55fc6e6c.js b/dist/js/148.2b6347d2.js similarity index 96% rename from dist/js/148.55fc6e6c.js rename to dist/js/148.2b6347d2.js index 35ce6c1..1dcd991 100644 --- a/dist/js/148.55fc6e6c.js +++ b/dist/js/148.2b6347d2.js @@ -1,2 +1,2 @@ "use strict";(self["webpackChunkmobilitydcatap_ui"]=self["webpackChunkmobilitydcatap_ui"]||[]).push([[148],{97148:function(t,e,n){n.r(e),n.d(e,{default:function(){return d}});var r=n(86397),a=n(65804),i=n(46674),o=n(66731);class s{constructor(t,{baseIRI:e="",factory:n=a.A,...r}={}){const s={blankNode:n.blankNode.bind(n),defaultGraph:n.defaultGraph.bind(n),literal:n.literal.bind(n),namedNode:n.namedNode.bind(n),quad:n.quad.bind(n)},c=new o.A({baseIRI:e,factory:s,...r});return t.pipe(c),(0,i.A)(c)}}var c=s;class u extends r.A{constructor(t){super(c,t)}}var d=u},86397:function(t,e){class n{constructor(t,e){this.Impl=t,this.options=e}import(t,e){const n=new this.Impl(t,{...this.options,...e});return t.on("end",(()=>{n.readable||n.emit("end")})),t.on("error",(t=>{n.emit("error",t)})),n}}e.A=n},46674:function(t,e){const n=new Set(["_write","_writableState","writable"]);function r(t){return new Proxy(t,{has(t,e){return!n.has(e)&&Reflect.has(...arguments)},get(t,e){if(n.has(e))return;const r=Reflect.get(...arguments);return r&&"function"===typeof r.bind?r.bind(t):r},set(t,e,r){if(!n.has(e))return Reflect.set(...arguments)}})}e.A=r}}]); -//# sourceMappingURL=148.55fc6e6c.js.map \ No newline at end of file +//# sourceMappingURL=148.2b6347d2.js.map \ No newline at end of file diff --git a/dist/js/148.55fc6e6c.js.map b/dist/js/148.2b6347d2.js.map similarity index 98% rename from dist/js/148.55fc6e6c.js.map rename to dist/js/148.2b6347d2.js.map index 9c901dc..733d62a 100644 --- a/dist/js/148.55fc6e6c.js.map +++ b/dist/js/148.2b6347d2.js.map @@ -1 +1 @@ -{"version":3,"file":"js/148.55fc6e6c.js","mappings":"+NAIA,MAAMA,EACJ,WAAAC,CAAaC,GAAO,QAAEC,EAAU,GAAE,QAAEC,EAAU,OAAQC,GAAS,CAAC,GAC9D,MAAMC,EAAe,CACnBC,UAAWH,EAAQG,UAAUC,KAAKJ,GAClCK,aAAcL,EAAQK,aAAaD,KAAKJ,GACxCM,QAASN,EAAQM,QAAQF,KAAKJ,GAC9BO,UAAWP,EAAQO,UAAUH,KAAKJ,GAClCQ,KAAMR,EAAQQ,KAAKJ,KAAKJ,IAGpBS,EAAS,IAAI,IAAa,CAAEV,UAASC,QAASE,KAAiBD,IAIrE,OAFAH,EAAMY,KAAKD,IAEJ,OAAWA,EACpB,EAGF,QCnBA,MAAME,UAAe,IACnB,WAAAd,CAAae,GACXC,MAAM,EAAcD,EACtB,EAGF,O,sBCTA,MAAME,EACJ,WAAAjB,CAAakB,EAAMH,GACjBI,KAAKD,KAAOA,EACZC,KAAKJ,QAAUA,CACjB,CAEA,MAAAK,CAAQnB,EAAOc,GACb,MAAMM,EAAS,IAAIF,KAAKD,KAAKjB,EAAO,IAAKkB,KAAKJ,WAAYA,IAY1D,OAVAd,EAAMqB,GAAG,OAAO,KACTD,EAAOE,UACVF,EAAOG,KAAK,MACd,IAGFvB,EAAMqB,GAAG,SAASG,IAChBJ,EAAOG,KAAK,QAASC,EAAG,IAGnBJ,CACT,EAGF,K,sBCvBA,MAAMK,EAAY,IAAIC,IAAI,CAAC,SAAU,iBAAkB,aAEvD,SAASJ,EAAUK,GACjB,OAAO,IAAIC,MAAMD,EAAQ,CACvB,GAAAE,CAAKC,EAAQC,GACX,OAAIN,EAAUI,IAAIE,IAIXC,QAAQH,OAAOI,UACxB,EACA,GAAAC,CAAKJ,EAAQC,GACX,GAAIN,EAAUI,IAAIE,GAChB,OAGF,MAAMI,EAASH,QAAQE,OAAOD,WAE9B,OAAIE,GAAiC,oBAAhBA,EAAO7B,KACnB6B,EAAO7B,KAAKwB,GAGdK,CACT,EACA,GAAAC,CAAKN,EAAQC,EAAKM,GAChB,IAAIZ,EAAUI,IAAIE,GAIlB,OAAOC,QAAQI,OAAOH,UACxB,GAEJ,CAEA,K","sources":["webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/parser-n3/lib/ParserStream.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/parser-n3/index.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/sink/index.js","webpack://mobilitydcatap-ui/./node_modules/duplex-to/readable.js"],"sourcesContent":["import rdf from '@rdfjs/data-model'\nimport toReadable from 'duplex-to/readable.js'\nimport { StreamParser } from 'n3'\n\nclass ParserStream {\n constructor (input, { baseIRI = '', factory = rdf, ...rest } = {}) {\n const boundFactory = {\n blankNode: factory.blankNode.bind(factory),\n defaultGraph: factory.defaultGraph.bind(factory),\n literal: factory.literal.bind(factory),\n namedNode: factory.namedNode.bind(factory),\n quad: factory.quad.bind(factory)\n }\n\n const parser = new StreamParser({ baseIRI, factory: boundFactory, ...rest })\n\n input.pipe(parser)\n\n return toReadable(parser)\n }\n}\n\nexport default ParserStream\n","import Sink from '@rdfjs/sink'\nimport ParserStream from './lib/ParserStream.js'\n\nclass Parser extends Sink {\n constructor (options) {\n super(ParserStream, options)\n }\n}\n\nexport default Parser\n","class Sink {\n constructor (Impl, options) {\n this.Impl = Impl\n this.options = options\n }\n\n import (input, options) {\n const output = new this.Impl(input, { ...this.options, ...options })\n\n input.on('end', () => {\n if (!output.readable) {\n output.emit('end')\n }\n })\n\n input.on('error', err => {\n output.emit('error', err)\n })\n\n return output\n }\n}\n\nexport default Sink\n","const blackList = new Set(['_write', '_writableState', 'writable'])\n\nfunction readable (duplex) {\n return new Proxy(duplex, {\n has (target, key) {\n if (blackList.has(key)) {\n return false\n }\n\n return Reflect.has(...arguments)\n },\n get (target, key) {\n if (blackList.has(key)) {\n return undefined\n }\n\n const result = Reflect.get(...arguments)\n\n if (result && typeof result.bind === 'function') {\n return result.bind(target)\n }\n\n return result\n },\n set (target, key, value) {\n if (blackList.has(key)) {\n return undefined\n }\n\n return Reflect.set(...arguments)\n }\n })\n}\n\nexport default readable\n"],"names":["ParserStream","constructor","input","baseIRI","factory","rest","boundFactory","blankNode","bind","defaultGraph","literal","namedNode","quad","parser","pipe","Parser","options","super","Sink","Impl","this","import","output","on","readable","emit","err","blackList","Set","duplex","Proxy","has","target","key","Reflect","arguments","get","result","set","value"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"js/148.2b6347d2.js","mappings":"+NAIA,MAAMA,EACJ,WAAAC,CAAaC,GAAO,QAAEC,EAAU,GAAE,QAAEC,EAAU,OAAQC,GAAS,CAAC,GAC9D,MAAMC,EAAe,CACnBC,UAAWH,EAAQG,UAAUC,KAAKJ,GAClCK,aAAcL,EAAQK,aAAaD,KAAKJ,GACxCM,QAASN,EAAQM,QAAQF,KAAKJ,GAC9BO,UAAWP,EAAQO,UAAUH,KAAKJ,GAClCQ,KAAMR,EAAQQ,KAAKJ,KAAKJ,IAGpBS,EAAS,IAAI,IAAa,CAAEV,UAASC,QAASE,KAAiBD,IAIrE,OAFAH,EAAMY,KAAKD,IAEJ,OAAWA,EACpB,EAGF,QCnBA,MAAME,UAAe,IACnB,WAAAd,CAAae,GACXC,MAAM,EAAcD,EACtB,EAGF,O,sBCTA,MAAME,EACJ,WAAAjB,CAAakB,EAAMH,GACjBI,KAAKD,KAAOA,EACZC,KAAKJ,QAAUA,CACjB,CAEA,MAAAK,CAAQnB,EAAOc,GACb,MAAMM,EAAS,IAAIF,KAAKD,KAAKjB,EAAO,IAAKkB,KAAKJ,WAAYA,IAY1D,OAVAd,EAAMqB,GAAG,OAAO,KACTD,EAAOE,UACVF,EAAOG,KAAK,MACd,IAGFvB,EAAMqB,GAAG,SAASG,IAChBJ,EAAOG,KAAK,QAASC,EAAG,IAGnBJ,CACT,EAGF,K,sBCvBA,MAAMK,EAAY,IAAIC,IAAI,CAAC,SAAU,iBAAkB,aAEvD,SAASJ,EAAUK,GACjB,OAAO,IAAIC,MAAMD,EAAQ,CACvB,GAAAE,CAAKC,EAAQC,GACX,OAAIN,EAAUI,IAAIE,IAIXC,QAAQH,OAAOI,UACxB,EACA,GAAAC,CAAKJ,EAAQC,GACX,GAAIN,EAAUI,IAAIE,GAChB,OAGF,MAAMI,EAASH,QAAQE,OAAOD,WAE9B,OAAIE,GAAiC,oBAAhBA,EAAO7B,KACnB6B,EAAO7B,KAAKwB,GAGdK,CACT,EACA,GAAAC,CAAKN,EAAQC,EAAKM,GAChB,IAAIZ,EAAUI,IAAIE,GAIlB,OAAOC,QAAQI,OAAOH,UACxB,GAEJ,CAEA,K","sources":["webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/parser-n3/lib/ParserStream.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/parser-n3/index.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/sink/index.js","webpack://mobilitydcatap-ui/./node_modules/duplex-to/readable.js"],"sourcesContent":["import rdf from '@rdfjs/data-model'\nimport toReadable from 'duplex-to/readable.js'\nimport { StreamParser } from 'n3'\n\nclass ParserStream {\n constructor (input, { baseIRI = '', factory = rdf, ...rest } = {}) {\n const boundFactory = {\n blankNode: factory.blankNode.bind(factory),\n defaultGraph: factory.defaultGraph.bind(factory),\n literal: factory.literal.bind(factory),\n namedNode: factory.namedNode.bind(factory),\n quad: factory.quad.bind(factory)\n }\n\n const parser = new StreamParser({ baseIRI, factory: boundFactory, ...rest })\n\n input.pipe(parser)\n\n return toReadable(parser)\n }\n}\n\nexport default ParserStream\n","import Sink from '@rdfjs/sink'\nimport ParserStream from './lib/ParserStream.js'\n\nclass Parser extends Sink {\n constructor (options) {\n super(ParserStream, options)\n }\n}\n\nexport default Parser\n","class Sink {\n constructor (Impl, options) {\n this.Impl = Impl\n this.options = options\n }\n\n import (input, options) {\n const output = new this.Impl(input, { ...this.options, ...options })\n\n input.on('end', () => {\n if (!output.readable) {\n output.emit('end')\n }\n })\n\n input.on('error', err => {\n output.emit('error', err)\n })\n\n return output\n }\n}\n\nexport default Sink\n","const blackList = new Set(['_write', '_writableState', 'writable'])\n\nfunction readable (duplex) {\n return new Proxy(duplex, {\n has (target, key) {\n if (blackList.has(key)) {\n return false\n }\n\n return Reflect.has(...arguments)\n },\n get (target, key) {\n if (blackList.has(key)) {\n return undefined\n }\n\n const result = Reflect.get(...arguments)\n\n if (result && typeof result.bind === 'function') {\n return result.bind(target)\n }\n\n return result\n },\n set (target, key, value) {\n if (blackList.has(key)) {\n return undefined\n }\n\n return Reflect.set(...arguments)\n }\n })\n}\n\nexport default readable\n"],"names":["ParserStream","constructor","input","baseIRI","factory","rest","boundFactory","blankNode","bind","defaultGraph","literal","namedNode","quad","parser","pipe","Parser","options","super","Sink","Impl","this","import","output","on","readable","emit","err","blackList","Set","duplex","Proxy","has","target","key","Reflect","arguments","get","result","set","value"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/200.944c37a3.js b/dist/js/200.4dc78eed.js similarity index 99% rename from dist/js/200.944c37a3.js rename to dist/js/200.4dc78eed.js index aa686d1..50206fc 100644 --- a/dist/js/200.944c37a3.js +++ b/dist/js/200.4dc78eed.js @@ -1,2 +1,2 @@ (self["webpackChunkmobilitydcatap_ui"]=self["webpackChunkmobilitydcatap_ui"]||[]).push([[200],{34200:function(e,t,i){if("function"!==typeof queueMicrotask){let e=Promise.resolve();try{queueMicrotask=t=>e.then(t).catch((e=>setTimeout((()=>{throw e}),0)))}catch(u){}}const r=i(76063),s=i(95049),_=/^([A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\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\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\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}.]*[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\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,f=1,n=2,c=4;class o extends s{constructor(e={}){super(e);let{prefixes:t={},lists:i=null,debug:s=!1,style:o=null}=e;if(Object.assign(this,{_b_debug:s,_s_indent:"\t",_b_simplify_default_graph:!1,_xc_directives:0,_s_token_prefix:"@prefix"}),o){o.indent&&(this._s_indent=o.indent.replace(/[^\s]/g,""));let e=o.directives||o.directives;if(e)switch(e){case"sparql":this._xc_directives=f,this._s_token_prefix="prefix";break;case"Sparql":this._xc_directives=f|n,this._s_token_prefix="Prefix";break;case"SPARQL":this._xc_directives=f|c,this._s_token_prefix="PREFIX";break;case"turtle":break;case"Turtle":this._xc_directives=n,this._s_token_prefix="@Prefix";break;case"TURTLE":this._xc_directives=c,this._s_token_prefix="@PREFIX";break;default:throw new Error(`Value not understood for 'directives' option: ${e}`)}}i&&(this._serialize_list_object=function(e,t){let i=this._transcode_list(e);return this._encode_objects(i,t)});let u=this._s_token_prefix,a=this._xc_directives&f?"\n":" .\n",l="";try{for(let e in t){if(!_.test(e))throw new Error(`Invlalid prefix id for text/turtle RDF serialization format: '${e}'`);l+=`${u} ${e}: ${r.namedNode(t[e]).verbose()}${a}`}}catch(h){queueMicrotask((()=>{this.emit("error",h)}))}l&&this.push(l)}_serialize_prefixes(e){let t=2===this._xc_state?"\n\n":"";this._xc_state=0,this._h_prefixes={...this._h_prefixes};let i=this._s_token_prefix,s=this._xc_directives&f?"\n":" .\n";for(let f in e){if(!_.test(f))throw new Error(`Invlalid prefix id for text/turtle RDF serialization format: '${f}'`);t+=`${i} ${f}: ${r.namedNode(e[f]).verbose()}${s}`,this._h_prefixes[f]=e[f]}return r.cache_prefixes(this._h_prefixes),t}_serialize_c3(e){let{_h_prefixes:t,_s_indent:i}=this,s=2!==this._xc_state?"\n":"";this._xc_state=2;let _="",f=null;for(let n in e){if("`"===n[0]){let t=this._apply_directive(n,e[n]);t.write&&(s+=_+t.write,_=""),t.exit&&(f=t.exit);continue}let c=s.length;s+=_+r.c1_node(n,t).terse(t)+" ";let o="",u="",a=e[n],l=s.length,h=!0,d=null;for(let e in a){if("`"===e[0]){let t=this._apply_directive(e,a[e]);t.write&&(s+=(o?u:"\n")+i+t.write,u="",o=i),t.exit&&(d=t.exit);continue}let _=a[e],f=this._encode_objects(_);if(!f)continue;if(h=!1,"_"===e[0]&&":"===e[1])throw new Error(`Cannot use blank node in predicate position of c3 hash; subject:'${n}', predicate:'${e}'`);let c=r.c1_named_node(e,t),l=c.isRdfTypeAlias?"a":c.terse(t);s+=u+o+l+" "+f,this._xc_state=2,u=" ;\n",o=i,d&&d()}h?s=s.slice(0,c)+s.slice(l):(_="\n",s+=`${u?" ":o}.\n`,f&&f())}return s+="\n",s}_encode_objects(e,t=1){let{_h_prefixes:i,_s_indent:s,_hm_coercions:_}=this;switch(typeof e){case"string":return r.c1(e,i).terse(i);case"number":return r.number(e).terse(i);case"boolean":return r.boolean(e).terse(i);case"object":if(null===e)throw new Error("Refusing to serialize null value given as an object of quad");if(Array.isArray(e)||e instanceof Set){let i="",r="";for(let s of e)Array.isArray(s)?i+=r+this._serialize_list_object(s,t):i+=r+this._encode_objects(s,t),r=", ";return i}if(Object===e.constructor){let _="[",f=!0,n=null;for(let c in e)if(f=!1,_+="\n"+s.repeat(1+t),"`"!==c[0])_+=r.c1(c,i).terse(i)+" "+this._encode_objects(e[c],t+1)+" ;";else{let t=this._apply_directive(c,e[c]);t.write&&(_+=t.write),t.exit&&(n=t.exit)}return _+=(f?"":"\n"+s.repeat(t))+"]",n&&n(),_}if(_.has(e.constructor)){let r=_.get(e.constructor).apply(this,[e,t]);return r.terse(i)}if(e.isGraphyTerm)return e.terse(i);if(e.termType)return r.from.term(e).terse(i);default:throw new Error(`Bad type for RDF object: [${typeof e}] ${e?e.constructor:e}`)}}_serialize_collection_object(e,t){let i=this._s_indent,r="(";for(let s of e){let e="";e=Array.isArray(s)?this._serialize_collection_object(s,t+1):this._encode_objects(s,t+1),r+="\n"+i.repeat(1+t)+e}return e.length&&(r+="\n"+i.repeat(t)),r+=")",r}_serialize_quad(e){let t=this._h_prefixes,i=r.from.quad(e);this._s_push+=(2!==this._xc_state?"\n":"")+i.subject.terse(t)+" "+i.predicate.terse(t)+" "+i.object.terse(t)+" .\n\n",this._xc_state=2}}Object.assign(o.prototype,{anonymous_blank_nodes:!0,_serialize_c3r:o.prototype._serialize_c3,_serialize_c4r:o.prototype._serialize_c4,_serialize_comment:s.prototype._serialize_hash_comment,_serialize_list_object:o.prototype._serialize_collection_object}),e.exports=function(e){return new o(e)}}}]); -//# sourceMappingURL=200.944c37a3.js.map \ No newline at end of file +//# sourceMappingURL=200.4dc78eed.js.map \ No newline at end of file diff --git a/dist/js/200.944c37a3.js.map b/dist/js/200.4dc78eed.js.map similarity index 99% rename from dist/js/200.944c37a3.js.map rename to dist/js/200.4dc78eed.js.map index fc6589c..065f16b 100644 --- a/dist/js/200.944c37a3.js.map +++ b/dist/js/200.4dc78eed.js.map @@ -1 +1 @@ -{"version":3,"file":"js/200.944c37a3.js","mappings":"qHAMC,GAAG,oBAAsBA,eAAgB,CAExC,IAAIC,EAAaC,QAAQC,UAGzB,IAECH,eAAiBI,GAAMH,EAAWI,KAAKD,GACrCE,OAAMC,GAAcC,YAAW,KAC/B,MAAMD,CAAU,GACd,IACL,CAEA,MAAME,GAAW,CAClB,CAKD,MAAMC,EAAU,EAAQ,OAClBC,EAAW,EAAQ,OAGnBC,EAAmC,4qBAGnCC,EAA4B,EAC5BC,EAA4B,EAC5BC,EAA2B,EAIjC,MAAMC,UAAsBL,EAC3B,WAAAM,CAAYC,EAAU,CAAC,GACtBC,MAAMD,GAEN,IACCE,SAAUC,EAAW,CAAC,EACtBC,MAAOC,EAAS,KAChBC,MAAOC,GAAQ,EACfC,MAAOC,EAAS,MACbT,EAYJ,GAVAU,OAAOC,OAAOC,KAAM,CACnBC,SAAUN,EACVO,UAAW,KACXC,2BAA2B,EAC3BC,eAAgB,EAChBC,gBAAiB,YAKfR,EAAU,CAETA,EAASS,SACXN,KAAKE,UAAYL,EAASS,OAAOC,QAAQ,SAAU,KAIpD,IAAIC,EAAeX,EAASY,YAAcZ,EAASY,WACnD,GAAGD,EACF,OAAOA,GACN,IAAK,SACJR,KAAKI,eAAiBrB,EACtBiB,KAAKK,gBAAkB,SACvB,MAGD,IAAK,SACJL,KAAKI,eAAiBrB,EAA4BC,EAClDgB,KAAKK,gBAAkB,SACvB,MAGD,IAAK,SACJL,KAAKI,eAAiBrB,EAA4BE,EAClDe,KAAKK,gBAAkB,SACvB,MAGD,IAAK,SACJ,MAGD,IAAK,SACJL,KAAKI,eAAiBpB,EACtBgB,KAAKK,gBAAkB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3G,EAAcyG,UAAU5D,cACxC+D,eAAgB5G,EAAcyG,UAAUI,cACxCC,mBAAoBnH,EAAS8G,UAAUM,wBACvCtF,uBAAwBzB,EAAcyG,UAAUX,+BAGjDkB,EAAOC,QAAU,SAAS/G,GACzB,OAAO,IAAIF,EAAcE,EAC1B,C","sources":["webpack://mobilitydcatap-ui/./node_modules/@graphy/content.ttl.write/main.js"],"sourcesContent":["\n\n\n// queueMicrotask shim\n{\n\t// not defined or not a function\n\tif('function' !== typeof queueMicrotask) {\n\t\t// create resolved promise\n\t\tlet dp_resolve = Promise.resolve();\n\n\t\t// try to redefine\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-global-assign\n\t\t\tqueueMicrotask = fk => dp_resolve.then(fk)\n\t\t\t\t.catch(e_callback => setTimeout(() => {\n\t\t\t\t\tthrow e_callback;\n\t\t\t\t}, 0));\n\t\t}\n\t\t// oh well, at least we tried\n\t\tcatch(e_define) {}\n\t}\n}\n\n\n\nconst factory = require('@graphy/core.data.factory');\nconst Writable = require('@graphy/core.class.writable');\n\n// eslint-disable-next-line no-misleading-character-class\nconst RT_PREFIXED_NAME_NAMESPACE_VALID = /^([A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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}.]*[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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;\nconst N_MAX_STRING_BUFFER = 1 << 12;\n\nconst XC_DIRECTIVES_TYPE_SPARQL = 0b001;\nconst XC_DIRECTIVES_CASE_PASCAL = 0b010;\nconst XC_DIRECTIVES_CASE_UPPER = 0b100;\n\n\n\nclass Turtle_Writer extends Writable {\n\tconstructor(gc_writer={}) {\n\t\tsuper(gc_writer);\n\n\t\tlet {\n\t\t\tprefixes: h_prefixes={},\n\t\t\tlists: gc_lists=null,\n\t\t\tdebug: b_debug=false,\n\t\t\tstyle: gc_style=null,\n\t\t} = gc_writer;\n\n\t\tObject.assign(this, {\n\t\t\t_b_debug: b_debug,\n\t\t\t_s_indent: '\\t',\n\t\t\t_b_simplify_default_graph: false,\n\t\t\t_xc_directives: 0,\n\t\t\t_s_token_prefix: '@prefix',\n\t\t});\n\n\n\t\t// style config\n\t\tif(gc_style) {\n\t\t\t// indent\n\t\t\tif(gc_style.indent) {\n\t\t\t\tthis._s_indent = gc_style.indent.replace(/[^\\s]/g, '');\n\t\t\t}\n\n\t\t\t// use sparql directives\n\t\t\tlet z_directives = gc_style.directives || gc_style.directives;\n\t\t\tif(z_directives) {\n\t\t\t\tswitch(z_directives) {\n\t\t\t\t\tcase 'sparql': {\n\t\t\t\t\t\tthis._xc_directives = XC_DIRECTIVES_TYPE_SPARQL;\n\t\t\t\t\t\tthis._s_token_prefix = 'prefix';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'Sparql': {\n\t\t\t\t\t\tthis._xc_directives = XC_DIRECTIVES_TYPE_SPARQL | XC_DIRECTIVES_CASE_PASCAL;\n\t\t\t\t\t\tthis._s_token_prefix = 'Prefix';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'SPARQL': {\n\t\t\t\t\t\tthis._xc_directives = XC_DIRECTIVES_TYPE_SPARQL | XC_DIRECTIVES_CASE_UPPER;\n\t\t\t\t\t\tthis._s_token_prefix = 'PREFIX';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'turtle': {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'Turtle': {\n\t\t\t\t\t\tthis._xc_directives = XC_DIRECTIVES_CASE_PASCAL;\n\t\t\t\t\t\tthis._s_token_prefix = '@Prefix';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'TURTLE': {\n\t\t\t\t\t\tthis._xc_directives = XC_DIRECTIVES_CASE_UPPER;\n\t\t\t\t\t\tthis._s_token_prefix = '@PREFIX';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tthrow new Error(`Value not understood for 'directives' option: ${z_directives}`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\n\t\t// custom list keys\n\t\tif(gc_lists) {\n\t\t\t// serialize list object\n\t\t\tthis._serialize_list_object = function(a_list, n_nest_level) {\n\t\t\t\t// transcode list object\n\t\t\t\tlet hc2_transcoded = this._transcode_list(a_list);\n\n\t\t\t\t// serialize object\n\t\t\t\treturn this._encode_objects(hc2_transcoded, n_nest_level);\n\t\t\t};\n\t\t}\n\n\t\t// serialize initial prefix mappings\n\t\tlet s_token_prefix = this._s_token_prefix;\n\t\tlet s_prefix_eol = (this._xc_directives & XC_DIRECTIVES_TYPE_SPARQL)? '\\n': ' .\\n';\n\t\tlet s_prefixes = '';\n\t\ttry {\n\t\t\t// each user-defined prefix\n\t\t\tfor(let s_prefix_id in h_prefixes) {\n\t\t\t\t// invalid prefix id\n\t\t\t\tif(!RT_PREFIXED_NAME_NAMESPACE_VALID.test(s_prefix_id)) {\n\t\t\t\t\tthrow new Error(`Invlalid prefix id for text/turtle RDF serialization format: '${s_prefix_id}'`);\n\t\t\t\t}\n\n\t\t\t\t// append to string\n\t\t\t\ts_prefixes += `${s_token_prefix} ${s_prefix_id}: ${factory.namedNode(h_prefixes[s_prefix_id]).verbose()}${s_prefix_eol}`;\n\t\t\t}\n\t\t}\n\t\t// serialization error\n\t\tcatch(e_serialize) {\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tthis.emit('error', e_serialize);\n\t\t\t});\n\t\t}\n\n\t\t// push prefixes\n\t\tif(s_prefixes) this.push(s_prefixes);\n\t}\n\n\t// serialize prefixes\n\t_serialize_prefixes(h_prefixes) {\n\t\t// build prefixes string\n\t\tlet s_prefixes = (2 === this._xc_state)? '\\n\\n': '';\n\n\t\t// update state\n\t\tthis._xc_state = 0;\n\n\t\t// clone prefixes\n\t\tthis._h_prefixes = {...this._h_prefixes};\n\n\t\t// ref prefix token\n\t\tlet s_token_prefix = this._s_token_prefix;\n\n\t\t// prep eol string\n\t\tlet s_prefix_eol = (this._xc_directives & XC_DIRECTIVES_TYPE_SPARQL)? '\\n': ' .\\n';\n\n\t\t// each user-defined prefix\n\t\tfor(let s_prefix_id in h_prefixes) {\n\t\t\t// invalid prefix id\n\t\t\tif(!RT_PREFIXED_NAME_NAMESPACE_VALID.test(s_prefix_id)) {\n\t\t\t\tthrow new Error(`Invlalid prefix id for text/turtle RDF serialization format: '${s_prefix_id}'`);\n\t\t\t}\n\n\t\t\t// append to string\n\t\t\ts_prefixes += `${s_token_prefix} ${s_prefix_id}: ${factory.namedNode(h_prefixes[s_prefix_id]).verbose()}${s_prefix_eol}`;\n\n\t\t\t// set prefix\n\t\t\tthis._h_prefixes[s_prefix_id] = h_prefixes[s_prefix_id];\n\t\t}\n\n\t\t// recache\n\t\tfactory.cache_prefixes(this._h_prefixes);\n\n\t\t// return prefix string\n\t\treturn s_prefixes;\n\t}\n\n\n\n\t// serialize c3 hash\n\t_serialize_c3(hc3_triples) {\n\t\tlet {\n\t\t\t_h_prefixes: h_prefixes,\n\t\t\t_s_indent: s_indent,\n\n\t\t} = this;\n\t\t// break line if non-data state\n\t\tlet s_write = 2 !== this._xc_state? '\\n': '';\n\t\t// update state\n\t\tthis._xc_state = 2;\n\n\t\t// triple delimiter\n\t\tlet s_delim_triples = '';\n\t\t// subject exit listener\n\t\tlet f_exit_subject = null;\n\t\t// each subject\n\t\tfor(let sc1_subject in hc3_triples) {\n\t\t\t// directive\n\t\t\tif('`' === sc1_subject[0]) {\n\t\t\t\tlet g_apply = this._apply_directive(sc1_subject, hc3_triples[sc1_subject]);\n\t\t\t\t// write data\n\t\t\t\tif(g_apply.write) {\n\t\t\t\t\ts_write += s_delim_triples+g_apply.write;\n\t\t\t\t\t// do not break next line\n\t\t\t\t\ts_delim_triples = '';\n\t\t\t\t}\n\t\t\t\t// save exit listener\n\t\t\t\tif(g_apply.exit) f_exit_subject = g_apply.exit;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// position before subject\n\t\t\tlet i_triples = s_write.length;\n\t\t\t// serialize subject\n\t\t\ts_write += s_delim_triples+factory.c1_node(sc1_subject, h_prefixes).terse(h_prefixes)+' ';\n\t\t\t// pair indent & terminator\n\t\t\tlet s_indent_pairs = '';\n\t\t\tlet s_term_pairs = '';\n\t\t\t// ref pairs\n\t\t\tlet hc2_pairs = hc3_triples[sc1_subject];\n\t\t\t// position before pairs\n\t\t\tlet i_pairs = s_write.length;\n\t\t\t// were objects written?\n\t\t\tlet b_empty = true;\n\t\t\t// predicate exit listener\n\t\t\tlet f_exit_predicate = null;\n\t\t\t// each predicate\n\t\t\tfor(let sc1_predicate in hc2_pairs) {\n\t\t\t\t// directive\n\t\t\t\tif('`' === sc1_predicate[0]) {\n\t\t\t\t\t// apply directive\n\t\t\t\t\tlet g_apply = this._apply_directive(sc1_predicate, hc2_pairs[sc1_predicate]);\n\t\t\t\t\t// write data\n\t\t\t\t\tif(g_apply.write) {\n\t\t\t\t\t\t// break line\n\t\t\t\t\t\ts_write += (s_indent_pairs? s_term_pairs: '\\n')+s_indent+g_apply.write;\n\t\t\t\t\t\t// pair already terminated\n\t\t\t\t\t\ts_term_pairs = '';\n\t\t\t\t\t\t// indent next pair\n\t\t\t\t\t\ts_indent_pairs = s_indent;\n\t\t\t\t\t}\n\t\t\t\t\t// save exit listener\n\t\t\t\t\tif(g_apply.exit) f_exit_predicate = g_apply.exit;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// ref objects\n\t\t\t\tlet z_objects = hc2_pairs[sc1_predicate];\n\t\t\t\t// serialize objects\n\t\t\t\tlet st_objects = this._encode_objects(z_objects);\n\t\t\t\t// no objects; skip pair\n\t\t\t\tif(!st_objects) continue;\n\t\t\t\t// not empty\n\t\t\t\tb_empty = false;\n\t\t\t\t// cannot use blank node in predicate position\n\t\t\t\tif('_' === sc1_predicate[0] && ':' === sc1_predicate[1]) {\n\t\t\t\t\tthrow new Error(`Cannot use blank node in predicate position of c3 hash; subject:'${sc1_subject}', predicate:'${sc1_predicate}'`);\n\t\t\t\t}\n\t\t\t\t// create predicate\n\t\t\t\tlet kt_predicate = factory.c1_named_node(sc1_predicate, h_prefixes);\n\t\t\t\t// tersify rdf:type\n\t\t\t\tlet st_predicate = kt_predicate.isRdfTypeAlias? 'a': kt_predicate.terse(h_prefixes);\n\t\t\t\t// serialize predicate and object(s)\n\t\t\t\ts_write += s_term_pairs+s_indent_pairs+st_predicate+' '+st_objects;\n\t\t\t\t// update state\n\t\t\t\tthis._xc_state = 2;\n\t\t\t\t\t// // string buffer became too large\n\t\t\t\t\t// if(s_write.length >= N_MAX_STRING_BUFFER) {\n\t\t\t\t\t// \tdebugger;\n\t\t\t\t\t// }\n\t\t\t\t// terminate next pair\n\t\t\t\ts_term_pairs = ' ;\\n';\n\t\t\t\t// indent next pair\n\t\t\t\ts_indent_pairs = s_indent;\n\t\t\t\t// call exit predicate listener\n\t\t\t\tif(f_exit_predicate) f_exit_predicate();\n\t\t\t}\n\t\t\t// empty triples; cut out\n\t\t\tif(b_empty) {\n\t\t\t\ts_write = s_write.slice(0, i_triples)+s_write.slice(i_pairs);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// delimit triple(s)\n\t\t\ts_delim_triples = '\\n';\n\t\t\t// close triple\n\t\t\ts_write += `${s_term_pairs? ' ': s_indent_pairs}.\\n`; //\n\t\t\t// call exit subject listener\n\t\t\tif(f_exit_subject) f_exit_subject();\n\t\t}\n\n\t\ts_write += '\\n';\n\t\treturn s_write;\n\t}\n\n\n\t// write objects\n\t_encode_objects(z_objects, n_nest_level=1) {\n\t\tlet {\n\t\t\t_h_prefixes: h_prefixes,\n\t\t\t_s_indent: s_indent,\n\t\t\t_hm_coercions: hm_coercions,\n\t\t} = this;\n\n\t\t// deduce object value type\n\t\tswitch(typeof z_objects) {\n\t\t\t// concise-term string\n\t\t\tcase 'string': return factory.c1(z_objects, h_prefixes).terse(h_prefixes);\n\n\t\t\t// numeric type\n\t\t\tcase 'number': return factory.number(z_objects).terse(h_prefixes);\n\n\t\t\t// boolean type\n\t\t\tcase 'boolean': return factory.boolean(z_objects).terse(h_prefixes);\n\n\t\t\t// object\n\t\t\tcase 'object': {\n\t\t\t\t// null; reject\n\t\t\t\tif(null === z_objects) throw new Error('Refusing to serialize null value given as an object of quad');\n\n\t\t\t\t// array, list of objects\n\t\t\t\tif(Array.isArray(z_objects) || z_objects instanceof Set) {\n\t\t\t\t\tlet s_write = '';\n\n\t\t\t\t\t// object terminator\n\t\t\t\t\tlet s_term_object = '';\n\n\t\t\t\t\t// each object\n\t\t\t\t\tfor(let z_item of z_objects) {\n\t\t\t\t\t\t// item is an array; serialize list\n\t\t\t\t\t\tif(Array.isArray(z_item)) {\n\t\t\t\t\t\t\ts_write += s_term_object + this._serialize_list_object(z_item, n_nest_level);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// non-array\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// recurse on item\n\t\t\t\t\t\t\ts_write += s_term_object + this._encode_objects(z_item, n_nest_level);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// terminate next object\n\t\t\t\t\t\ts_term_object = ', ';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn s_write;\n\t\t\t\t}\n\t\t\t\t// plain object, blank node\n\t\t\t\telse if(Object === z_objects.constructor) {\n\t\t\t\t\t// open blank node block\n\t\t\t\t\tlet s_write = '[';\n\n\t\t\t\t\t// whether the block is empty\n\t\t\t\t\tlet b_empty = true;\n\n\t\t\t\t\t// object exit listener\n\t\t\t\t\tlet f_exit_object = null;\n\n\t\t\t\t\t// each pair\n\t\t\t\t\tfor(let sc1_predicate in z_objects) {\n\t\t\t\t\t\t// block is not empty\n\t\t\t\t\t\tb_empty = false;\n\n\t\t\t\t\t\t// terminate previous pair\n\t\t\t\t\t\ts_write += '\\n'+s_indent.repeat(1+n_nest_level);\n\n\t\t\t\t\t\t// directive; serialize it\n\t\t\t\t\t\tif('`' === sc1_predicate[0]) {\n\t\t\t\t\t\t\tlet g_apply = this._apply_directive(sc1_predicate, z_objects[sc1_predicate]);\n\n\t\t\t\t\t\t\t// write data\n\t\t\t\t\t\t\tif(g_apply.write) s_write += g_apply.write;\n\n\t\t\t\t\t\t\t// save exit listener\n\t\t\t\t\t\t\tif(g_apply.exit) f_exit_object = g_apply.exit;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// write predicate and object(s)\n\t\t\t\t\t\ts_write += factory.c1(sc1_predicate, h_prefixes).terse(h_prefixes) + ' '\n\t\t\t\t\t\t\t+ this._encode_objects(z_objects[sc1_predicate], n_nest_level+1) +' ;';\n\t\t\t\t\t}\n\n\t\t\t\t\t// close blank node block\n\t\t\t\t\ts_write += (b_empty? '': '\\n'+s_indent.repeat(n_nest_level))+']';\n\n\t\t\t\t\t// call exit object listener\n\t\t\t\t\tif(f_exit_object) f_exit_object();\n\n\t\t\t\t\t// serialize current predicate to blank node\n\t\t\t\t\treturn s_write;\n\t\t\t\t}\n\t\t\t\t// coercable instance\n\t\t\t\telse if(hm_coercions.has(z_objects.constructor)) {\n\t\t\t\t\t// convert javascript object to term object\n\t\t\t\t\tlet kt_converted = hm_coercions.get(z_objects.constructor).apply(this, [z_objects, n_nest_level]);\n\n\t\t\t\t\t// serialize\n\t\t\t\t\treturn kt_converted.terse(h_prefixes);\n\t\t\t\t}\n\t\t\t\t// graphy term\n\t\t\t\telse if(z_objects.isGraphyTerm) {\n\t\t\t\t\treturn z_objects.terse(h_prefixes);\n\t\t\t\t}\n\t\t\t\t// RDFJS term\n\t\t\t\telse if(z_objects.termType) {\n\t\t\t\t\treturn factory.from.term(z_objects).terse(h_prefixes);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// fallthrough: other\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(`Bad type for RDF object: [${typeof z_objects}] ${z_objects? z_objects.constructor: z_objects}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// serialize collection object\n\t_serialize_collection_object(a_collection, n_nest_level) {\n\t\tlet s_indent = this._s_indent;\n\n\t\t// open collection block\n\t\tlet s_write = '(';\n\n\t\t// each item\n\t\tfor(let z_item of a_collection) {\n\t\t\tlet s_objects = '';\n\n\t\t\t// item is array; serialize as sub-collection\n\t\t\tif(Array.isArray(z_item)) {\n\t\t\t\ts_objects = this._serialize_collection_object(z_item, n_nest_level+1);\n\t\t\t}\n\t\t\t// non-array item\n\t\t\telse {\n\t\t\t\ts_objects = this._encode_objects(z_item, n_nest_level+1);\n\t\t\t}\n\n\t\t\t// serialize collection\n\t\t\ts_write += '\\n'+s_indent.repeat(1+n_nest_level)+s_objects;\n\t\t}\n\n\t\t// break line if anything was written (including comments)\n\t\tif(a_collection.length) s_write += '\\n'+s_indent.repeat(n_nest_level);\n\n\t\t// close collection block\n\t\ts_write += ')';\n\n\t\treturn s_write;\n\t}\n\n\t// rdfjs quad\n\t_serialize_quad(g_quad) {\n\t\tlet h_prefixes = this._h_prefixes;\n\t\tlet kq_quad = factory.from.quad(g_quad);\n\n\n\t\t// serialize quad\n\t\tthis._s_push += (2 !== this._xc_state? '\\n': '')\n\t\t\t\t\t\t+kq_quad.subject.terse(h_prefixes)+' '\n\t\t\t+kq_quad.predicate.terse(h_prefixes)+' '\n\t\t\t+kq_quad.object.terse(h_prefixes)+' .\\n\\n';\n\n\n\t\t// update state\n\t\tthis._xc_state = 2;\n\t}\n}\n\nObject.assign(Turtle_Writer.prototype, {\n\tanonymous_blank_nodes: true,\n\t_serialize_c3r: Turtle_Writer.prototype._serialize_c3,\n\t_serialize_c4r: Turtle_Writer.prototype._serialize_c4,\n\t_serialize_comment: Writable.prototype._serialize_hash_comment,\n\t_serialize_list_object: Turtle_Writer.prototype._serialize_collection_object,\n});\n\nmodule.exports = function(gc_writer) {\n\treturn new Turtle_Writer(gc_writer);\n};\n"],"names":["queueMicrotask","dp_resolve","Promise","resolve","fk","then","catch","e_callback","setTimeout","e_define","factory","Writable","RT_PREFIXED_NAME_NAMESPACE_VALID","XC_DIRECTIVES_TYPE_SPARQL","XC_DIRECTIVES_CASE_PASCAL","XC_DIRECTIVES_CASE_UPPER","Turtle_Writer","constructor","gc_writer","super","prefixes","h_prefixes","lists","gc_lists","debug","b_debug","style","gc_style","Object","assign","this","_b_debug","_s_indent","_b_simplify_default_graph","_xc_directives","_s_token_prefix","indent","replace","z_directives","directives","Error","_serialize_list_object","a_list","n_nest_level","hc2_transcoded","_transcode_list","_encode_objects","s_token_prefix","s_prefix_eol","s_prefixes","s_prefix_id","test","namedNode","verbose","e_serialize","emit","push","_serialize_prefixes","_xc_state","_h_prefixes","cache_prefixes","_serialize_c3","hc3_triples","s_indent","s_write","s_delim_triples","f_exit_subject","sc1_subject","g_apply","_apply_directive","write","exit","i_triples","length","c1_node","terse","s_indent_pairs","s_term_pairs","hc2_pairs","i_pairs","b_empty","f_exit_predicate","sc1_predicate","z_objects","st_objects","kt_predicate","c1_named_node","st_predicate","isRdfTypeAlias","slice","_hm_coercions","hm_coercions","c1","number","boolean","Array","isArray","Set","s_term_object","z_item","f_exit_object","repeat","has","kt_converted","get","apply","isGraphyTerm","termType","from","term","_serialize_collection_object","a_collection","s_objects","_serialize_quad","g_quad","kq_quad","quad","_s_push","subject","predicate","object","prototype","anonymous_blank_nodes","_serialize_c3r","_serialize_c4r","_serialize_c4","_serialize_comment","_serialize_hash_comment","module","exports"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"js/200.4dc78eed.js","mappings":"qHAMC,GAAG,oBAAsBA,eAAgB,CAExC,IAAIC,EAAaC,QAAQC,UAGzB,IAECH,eAAiBI,GAAMH,EAAWI,KAAKD,GACrCE,OAAMC,GAAcC,YAAW,KAC/B,MAAMD,CAAU,GACd,IACL,CAEA,MAAME,GAAW,CAClB,CAKD,MAAMC,EAAU,EAAQ,OAClBC,EAAW,EAAQ,OAGnBC,EAAmC,4qBAGnCC,EAA4B,EAC5BC,EAA4B,EAC5BC,EAA2B,EAIjC,MAAMC,UAAsBL,EAC3B,WAAAM,CAAYC,EAAU,CAAC,GACtBC,MAAMD,GAEN,IACCE,SAAUC,EAAW,CAAC,EACtBC,MAAOC,EAAS,KAChBC,MAAOC,GAAQ,EACfC,MAAOC,EAAS,MACbT,EAYJ,GAVAU,OAAOC,OAAOC,KAAM,CACnBC,SAAUN,EACVO,UAAW,KACXC,2BAA2B,EAC3BC,eAAgB,EAChBC,gBAAiB,YAKfR,EAAU,CAETA,EAASS,SACXN,KAAKE,UAAYL,EAASS,OAAOC,QAAQ,SAAU,KAIpD,IAAIC,EAAeX,EAASY,YAAcZ,EAASY,WACnD,GAAGD,EACF,OAAOA,GACN,IAAK,SACJR,KAAKI,eAAiBrB,EACtBiB,KAAKK,gBAAkB,SACvB,MAGD,IAAK,SACJL,KAAKI,eAAiBrB,EAA4BC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D,GAAY,IACrC8F,EAAQI,UAAU5C,MAAMtD,GAAY,IACpC8F,EAAQK,OAAO7C,MAAMtD,GAAY,SAInCS,KAAK4B,UAAY,CAClB,EAGD9B,OAAOC,OAAOb,EAAcyG,UAAW,CACtCC,uBAAuB,EACvBC,eAAgB3G,EAAcyG,UAAU5D,cACxC+D,eAAgB5G,EAAcyG,UAAUI,cACxCC,mBAAoBnH,EAAS8G,UAAUM,wBACvCtF,uBAAwBzB,EAAcyG,UAAUX,+BAGjDkB,EAAOC,QAAU,SAAS/G,GACzB,OAAO,IAAIF,EAAcE,EAC1B,C","sources":["webpack://mobilitydcatap-ui/./node_modules/@graphy/content.ttl.write/main.js"],"sourcesContent":["\n\n\n// queueMicrotask shim\n{\n\t// not defined or not a function\n\tif('function' !== typeof queueMicrotask) {\n\t\t// create resolved promise\n\t\tlet dp_resolve = Promise.resolve();\n\n\t\t// try to redefine\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-global-assign\n\t\t\tqueueMicrotask = fk => dp_resolve.then(fk)\n\t\t\t\t.catch(e_callback => setTimeout(() => {\n\t\t\t\t\tthrow e_callback;\n\t\t\t\t}, 0));\n\t\t}\n\t\t// oh well, at least we tried\n\t\tcatch(e_define) {}\n\t}\n}\n\n\n\nconst factory = require('@graphy/core.data.factory');\nconst Writable = require('@graphy/core.class.writable');\n\n// eslint-disable-next-line no-misleading-character-class\nconst RT_PREFIXED_NAME_NAMESPACE_VALID = /^([A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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}.]*[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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;\nconst N_MAX_STRING_BUFFER = 1 << 12;\n\nconst XC_DIRECTIVES_TYPE_SPARQL = 0b001;\nconst XC_DIRECTIVES_CASE_PASCAL = 0b010;\nconst XC_DIRECTIVES_CASE_UPPER = 0b100;\n\n\n\nclass Turtle_Writer extends Writable {\n\tconstructor(gc_writer={}) {\n\t\tsuper(gc_writer);\n\n\t\tlet {\n\t\t\tprefixes: h_prefixes={},\n\t\t\tlists: gc_lists=null,\n\t\t\tdebug: b_debug=false,\n\t\t\tstyle: gc_style=null,\n\t\t} = gc_writer;\n\n\t\tObject.assign(this, {\n\t\t\t_b_debug: b_debug,\n\t\t\t_s_indent: '\\t',\n\t\t\t_b_simplify_default_graph: false,\n\t\t\t_xc_directives: 0,\n\t\t\t_s_token_prefix: '@prefix',\n\t\t});\n\n\n\t\t// style config\n\t\tif(gc_style) {\n\t\t\t// indent\n\t\t\tif(gc_style.indent) {\n\t\t\t\tthis._s_indent = gc_style.indent.replace(/[^\\s]/g, '');\n\t\t\t}\n\n\t\t\t// use sparql directives\n\t\t\tlet z_directives = gc_style.directives || gc_style.directives;\n\t\t\tif(z_directives) {\n\t\t\t\tswitch(z_directives) {\n\t\t\t\t\tcase 'sparql': {\n\t\t\t\t\t\tthis._xc_directives = XC_DIRECTIVES_TYPE_SPARQL;\n\t\t\t\t\t\tthis._s_token_prefix = 'prefix';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'Sparql': {\n\t\t\t\t\t\tthis._xc_directives = XC_DIRECTIVES_TYPE_SPARQL | XC_DIRECTIVES_CASE_PASCAL;\n\t\t\t\t\t\tthis._s_token_prefix = 'Prefix';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'SPARQL': {\n\t\t\t\t\t\tthis._xc_directives = XC_DIRECTIVES_TYPE_SPARQL | XC_DIRECTIVES_CASE_UPPER;\n\t\t\t\t\t\tthis._s_token_prefix = 'PREFIX';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'turtle': {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'Turtle': {\n\t\t\t\t\t\tthis._xc_directives = XC_DIRECTIVES_CASE_PASCAL;\n\t\t\t\t\t\tthis._s_token_prefix = '@Prefix';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'TURTLE': {\n\t\t\t\t\t\tthis._xc_directives = XC_DIRECTIVES_CASE_UPPER;\n\t\t\t\t\t\tthis._s_token_prefix = '@PREFIX';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tthrow new Error(`Value not understood for 'directives' option: ${z_directives}`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\n\t\t// custom list keys\n\t\tif(gc_lists) {\n\t\t\t// serialize list object\n\t\t\tthis._serialize_list_object = function(a_list, n_nest_level) {\n\t\t\t\t// transcode list object\n\t\t\t\tlet hc2_transcoded = this._transcode_list(a_list);\n\n\t\t\t\t// serialize object\n\t\t\t\treturn this._encode_objects(hc2_transcoded, n_nest_level);\n\t\t\t};\n\t\t}\n\n\t\t// serialize initial prefix mappings\n\t\tlet s_token_prefix = this._s_token_prefix;\n\t\tlet s_prefix_eol = (this._xc_directives & XC_DIRECTIVES_TYPE_SPARQL)? '\\n': ' .\\n';\n\t\tlet s_prefixes = '';\n\t\ttry {\n\t\t\t// each user-defined prefix\n\t\t\tfor(let s_prefix_id in h_prefixes) {\n\t\t\t\t// invalid prefix id\n\t\t\t\tif(!RT_PREFIXED_NAME_NAMESPACE_VALID.test(s_prefix_id)) {\n\t\t\t\t\tthrow new Error(`Invlalid prefix id for text/turtle RDF serialization format: '${s_prefix_id}'`);\n\t\t\t\t}\n\n\t\t\t\t// append to string\n\t\t\t\ts_prefixes += `${s_token_prefix} ${s_prefix_id}: ${factory.namedNode(h_prefixes[s_prefix_id]).verbose()}${s_prefix_eol}`;\n\t\t\t}\n\t\t}\n\t\t// serialization error\n\t\tcatch(e_serialize) {\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tthis.emit('error', e_serialize);\n\t\t\t});\n\t\t}\n\n\t\t// push prefixes\n\t\tif(s_prefixes) this.push(s_prefixes);\n\t}\n\n\t// serialize prefixes\n\t_serialize_prefixes(h_prefixes) {\n\t\t// build prefixes string\n\t\tlet s_prefixes = (2 === this._xc_state)? '\\n\\n': '';\n\n\t\t// update state\n\t\tthis._xc_state = 0;\n\n\t\t// clone prefixes\n\t\tthis._h_prefixes = {...this._h_prefixes};\n\n\t\t// ref prefix token\n\t\tlet s_token_prefix = this._s_token_prefix;\n\n\t\t// prep eol string\n\t\tlet s_prefix_eol = (this._xc_directives & XC_DIRECTIVES_TYPE_SPARQL)? '\\n': ' .\\n';\n\n\t\t// each user-defined prefix\n\t\tfor(let s_prefix_id in h_prefixes) {\n\t\t\t// invalid prefix id\n\t\t\tif(!RT_PREFIXED_NAME_NAMESPACE_VALID.test(s_prefix_id)) {\n\t\t\t\tthrow new Error(`Invlalid prefix id for text/turtle RDF serialization format: '${s_prefix_id}'`);\n\t\t\t}\n\n\t\t\t// append to string\n\t\t\ts_prefixes += `${s_token_prefix} ${s_prefix_id}: ${factory.namedNode(h_prefixes[s_prefix_id]).verbose()}${s_prefix_eol}`;\n\n\t\t\t// set prefix\n\t\t\tthis._h_prefixes[s_prefix_id] = h_prefixes[s_prefix_id];\n\t\t}\n\n\t\t// recache\n\t\tfactory.cache_prefixes(this._h_prefixes);\n\n\t\t// return prefix string\n\t\treturn s_prefixes;\n\t}\n\n\n\n\t// serialize c3 hash\n\t_serialize_c3(hc3_triples) {\n\t\tlet {\n\t\t\t_h_prefixes: h_prefixes,\n\t\t\t_s_indent: s_indent,\n\n\t\t} = this;\n\t\t// break line if non-data state\n\t\tlet s_write = 2 !== this._xc_state? '\\n': '';\n\t\t// update state\n\t\tthis._xc_state = 2;\n\n\t\t// triple delimiter\n\t\tlet s_delim_triples = '';\n\t\t// subject exit listener\n\t\tlet f_exit_subject = null;\n\t\t// each subject\n\t\tfor(let sc1_subject in hc3_triples) {\n\t\t\t// directive\n\t\t\tif('`' === sc1_subject[0]) {\n\t\t\t\tlet g_apply = this._apply_directive(sc1_subject, hc3_triples[sc1_subject]);\n\t\t\t\t// write data\n\t\t\t\tif(g_apply.write) {\n\t\t\t\t\ts_write += s_delim_triples+g_apply.write;\n\t\t\t\t\t// do not break next line\n\t\t\t\t\ts_delim_triples = '';\n\t\t\t\t}\n\t\t\t\t// save exit listener\n\t\t\t\tif(g_apply.exit) f_exit_subject = g_apply.exit;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// position before subject\n\t\t\tlet i_triples = s_write.length;\n\t\t\t// serialize subject\n\t\t\ts_write += s_delim_triples+factory.c1_node(sc1_subject, h_prefixes).terse(h_prefixes)+' ';\n\t\t\t// pair indent & terminator\n\t\t\tlet s_indent_pairs = '';\n\t\t\tlet s_term_pairs = '';\n\t\t\t// ref pairs\n\t\t\tlet hc2_pairs = hc3_triples[sc1_subject];\n\t\t\t// position before pairs\n\t\t\tlet i_pairs = s_write.length;\n\t\t\t// were objects written?\n\t\t\tlet b_empty = true;\n\t\t\t// predicate exit listener\n\t\t\tlet f_exit_predicate = null;\n\t\t\t// each predicate\n\t\t\tfor(let sc1_predicate in hc2_pairs) {\n\t\t\t\t// directive\n\t\t\t\tif('`' === sc1_predicate[0]) {\n\t\t\t\t\t// apply directive\n\t\t\t\t\tlet g_apply = this._apply_directive(sc1_predicate, hc2_pairs[sc1_predicate]);\n\t\t\t\t\t// write data\n\t\t\t\t\tif(g_apply.write) {\n\t\t\t\t\t\t// break line\n\t\t\t\t\t\ts_write += (s_indent_pairs? s_term_pairs: '\\n')+s_indent+g_apply.write;\n\t\t\t\t\t\t// pair already terminated\n\t\t\t\t\t\ts_term_pairs = '';\n\t\t\t\t\t\t// indent next pair\n\t\t\t\t\t\ts_indent_pairs = s_indent;\n\t\t\t\t\t}\n\t\t\t\t\t// save exit listener\n\t\t\t\t\tif(g_apply.exit) f_exit_predicate = g_apply.exit;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// ref objects\n\t\t\t\tlet z_objects = hc2_pairs[sc1_predicate];\n\t\t\t\t// serialize objects\n\t\t\t\tlet st_objects = this._encode_objects(z_objects);\n\t\t\t\t// no objects; skip pair\n\t\t\t\tif(!st_objects) continue;\n\t\t\t\t// not empty\n\t\t\t\tb_empty = false;\n\t\t\t\t// cannot use blank node in predicate position\n\t\t\t\tif('_' === sc1_predicate[0] && ':' === sc1_predicate[1]) {\n\t\t\t\t\tthrow new Error(`Cannot use blank node in predicate position of c3 hash; subject:'${sc1_subject}', predicate:'${sc1_predicate}'`);\n\t\t\t\t}\n\t\t\t\t// create predicate\n\t\t\t\tlet kt_predicate = factory.c1_named_node(sc1_predicate, h_prefixes);\n\t\t\t\t// tersify rdf:type\n\t\t\t\tlet st_predicate = kt_predicate.isRdfTypeAlias? 'a': kt_predicate.terse(h_prefixes);\n\t\t\t\t// serialize predicate and object(s)\n\t\t\t\ts_write += s_term_pairs+s_indent_pairs+st_predicate+' '+st_objects;\n\t\t\t\t// update state\n\t\t\t\tthis._xc_state = 2;\n\t\t\t\t\t// // string buffer became too large\n\t\t\t\t\t// if(s_write.length >= N_MAX_STRING_BUFFER) {\n\t\t\t\t\t// \tdebugger;\n\t\t\t\t\t// }\n\t\t\t\t// terminate next pair\n\t\t\t\ts_term_pairs = ' ;\\n';\n\t\t\t\t// indent next pair\n\t\t\t\ts_indent_pairs = s_indent;\n\t\t\t\t// call exit predicate listener\n\t\t\t\tif(f_exit_predicate) f_exit_predicate();\n\t\t\t}\n\t\t\t// empty triples; cut out\n\t\t\tif(b_empty) {\n\t\t\t\ts_write = s_write.slice(0, i_triples)+s_write.slice(i_pairs);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// delimit triple(s)\n\t\t\ts_delim_triples = '\\n';\n\t\t\t// close triple\n\t\t\ts_write += `${s_term_pairs? ' ': s_indent_pairs}.\\n`; //\n\t\t\t// call exit subject listener\n\t\t\tif(f_exit_subject) f_exit_subject();\n\t\t}\n\n\t\ts_write += '\\n';\n\t\treturn s_write;\n\t}\n\n\n\t// write objects\n\t_encode_objects(z_objects, n_nest_level=1) {\n\t\tlet {\n\t\t\t_h_prefixes: h_prefixes,\n\t\t\t_s_indent: s_indent,\n\t\t\t_hm_coercions: hm_coercions,\n\t\t} = this;\n\n\t\t// deduce object value type\n\t\tswitch(typeof z_objects) {\n\t\t\t// concise-term string\n\t\t\tcase 'string': return factory.c1(z_objects, h_prefixes).terse(h_prefixes);\n\n\t\t\t// numeric type\n\t\t\tcase 'number': return factory.number(z_objects).terse(h_prefixes);\n\n\t\t\t// boolean type\n\t\t\tcase 'boolean': return factory.boolean(z_objects).terse(h_prefixes);\n\n\t\t\t// object\n\t\t\tcase 'object': {\n\t\t\t\t// null; reject\n\t\t\t\tif(null === z_objects) throw new Error('Refusing to serialize null value given as an object of quad');\n\n\t\t\t\t// array, list of objects\n\t\t\t\tif(Array.isArray(z_objects) || z_objects instanceof Set) {\n\t\t\t\t\tlet s_write = '';\n\n\t\t\t\t\t// object terminator\n\t\t\t\t\tlet s_term_object = '';\n\n\t\t\t\t\t// each object\n\t\t\t\t\tfor(let z_item of z_objects) {\n\t\t\t\t\t\t// item is an array; serialize list\n\t\t\t\t\t\tif(Array.isArray(z_item)) {\n\t\t\t\t\t\t\ts_write += s_term_object + this._serialize_list_object(z_item, n_nest_level);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// non-array\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// recurse on item\n\t\t\t\t\t\t\ts_write += s_term_object + this._encode_objects(z_item, n_nest_level);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// terminate next object\n\t\t\t\t\t\ts_term_object = ', ';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn s_write;\n\t\t\t\t}\n\t\t\t\t// plain object, blank node\n\t\t\t\telse if(Object === z_objects.constructor) {\n\t\t\t\t\t// open blank node block\n\t\t\t\t\tlet s_write = '[';\n\n\t\t\t\t\t// whether the block is empty\n\t\t\t\t\tlet b_empty = true;\n\n\t\t\t\t\t// object exit listener\n\t\t\t\t\tlet f_exit_object = null;\n\n\t\t\t\t\t// each pair\n\t\t\t\t\tfor(let sc1_predicate in z_objects) {\n\t\t\t\t\t\t// block is not empty\n\t\t\t\t\t\tb_empty = false;\n\n\t\t\t\t\t\t// terminate previous pair\n\t\t\t\t\t\ts_write += '\\n'+s_indent.repeat(1+n_nest_level);\n\n\t\t\t\t\t\t// directive; serialize it\n\t\t\t\t\t\tif('`' === sc1_predicate[0]) {\n\t\t\t\t\t\t\tlet g_apply = this._apply_directive(sc1_predicate, z_objects[sc1_predicate]);\n\n\t\t\t\t\t\t\t// write data\n\t\t\t\t\t\t\tif(g_apply.write) s_write += g_apply.write;\n\n\t\t\t\t\t\t\t// save exit listener\n\t\t\t\t\t\t\tif(g_apply.exit) f_exit_object = g_apply.exit;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// write predicate and object(s)\n\t\t\t\t\t\ts_write += factory.c1(sc1_predicate, h_prefixes).terse(h_prefixes) + ' '\n\t\t\t\t\t\t\t+ this._encode_objects(z_objects[sc1_predicate], n_nest_level+1) +' ;';\n\t\t\t\t\t}\n\n\t\t\t\t\t// close blank node block\n\t\t\t\t\ts_write += (b_empty? '': '\\n'+s_indent.repeat(n_nest_level))+']';\n\n\t\t\t\t\t// call exit object listener\n\t\t\t\t\tif(f_exit_object) f_exit_object();\n\n\t\t\t\t\t// serialize current predicate to blank node\n\t\t\t\t\treturn s_write;\n\t\t\t\t}\n\t\t\t\t// coercable instance\n\t\t\t\telse if(hm_coercions.has(z_objects.constructor)) {\n\t\t\t\t\t// convert javascript object to term object\n\t\t\t\t\tlet kt_converted = hm_coercions.get(z_objects.constructor).apply(this, [z_objects, n_nest_level]);\n\n\t\t\t\t\t// serialize\n\t\t\t\t\treturn kt_converted.terse(h_prefixes);\n\t\t\t\t}\n\t\t\t\t// graphy term\n\t\t\t\telse if(z_objects.isGraphyTerm) {\n\t\t\t\t\treturn z_objects.terse(h_prefixes);\n\t\t\t\t}\n\t\t\t\t// RDFJS term\n\t\t\t\telse if(z_objects.termType) {\n\t\t\t\t\treturn factory.from.term(z_objects).terse(h_prefixes);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// fallthrough: other\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(`Bad type for RDF object: [${typeof z_objects}] ${z_objects? z_objects.constructor: z_objects}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// serialize collection object\n\t_serialize_collection_object(a_collection, n_nest_level) {\n\t\tlet s_indent = this._s_indent;\n\n\t\t// open collection block\n\t\tlet s_write = '(';\n\n\t\t// each item\n\t\tfor(let z_item of a_collection) {\n\t\t\tlet s_objects = '';\n\n\t\t\t// item is array; serialize as sub-collection\n\t\t\tif(Array.isArray(z_item)) {\n\t\t\t\ts_objects = this._serialize_collection_object(z_item, n_nest_level+1);\n\t\t\t}\n\t\t\t// non-array item\n\t\t\telse {\n\t\t\t\ts_objects = this._encode_objects(z_item, n_nest_level+1);\n\t\t\t}\n\n\t\t\t// serialize collection\n\t\t\ts_write += '\\n'+s_indent.repeat(1+n_nest_level)+s_objects;\n\t\t}\n\n\t\t// break line if anything was written (including comments)\n\t\tif(a_collection.length) s_write += '\\n'+s_indent.repeat(n_nest_level);\n\n\t\t// close collection block\n\t\ts_write += ')';\n\n\t\treturn s_write;\n\t}\n\n\t// rdfjs quad\n\t_serialize_quad(g_quad) {\n\t\tlet h_prefixes = this._h_prefixes;\n\t\tlet kq_quad = factory.from.quad(g_quad);\n\n\n\t\t// serialize quad\n\t\tthis._s_push += (2 !== this._xc_state? '\\n': '')\n\t\t\t\t\t\t+kq_quad.subject.terse(h_prefixes)+' '\n\t\t\t+kq_quad.predicate.terse(h_prefixes)+' '\n\t\t\t+kq_quad.object.terse(h_prefixes)+' .\\n\\n';\n\n\n\t\t// update state\n\t\tthis._xc_state = 2;\n\t}\n}\n\nObject.assign(Turtle_Writer.prototype, {\n\tanonymous_blank_nodes: true,\n\t_serialize_c3r: Turtle_Writer.prototype._serialize_c3,\n\t_serialize_c4r: Turtle_Writer.prototype._serialize_c4,\n\t_serialize_comment: Writable.prototype._serialize_hash_comment,\n\t_serialize_list_object: Turtle_Writer.prototype._serialize_collection_object,\n});\n\nmodule.exports = function(gc_writer) {\n\treturn new Turtle_Writer(gc_writer);\n};\n"],"names":["queueMicrotask","dp_resolve","Promise","resolve","fk","then","catch","e_callback","setTimeout","e_define","factory","Writable","RT_PREFIXED_NAME_NAMESPACE_VALID","XC_DIRECTIVES_TYPE_SPARQL","XC_DIRECTIVES_CASE_PASCAL","XC_DIRECTIVES_CASE_UPPER","Turtle_Writer","constructor","gc_writer","super","prefixes","h_prefixes","lists","gc_lists","debug","b_debug","style","gc_style","Object","assign","this","_b_debug","_s_indent","_b_simplify_default_graph","_xc_directives","_s_token_prefix","indent","replace","z_directives","directives","Error","_serialize_list_object","a_list","n_nest_level","hc2_transcoded","_transcode_list","_encode_objects","s_token_prefix","s_prefix_eol","s_prefixes","s_prefix_id","test","namedNode","verbose","e_serialize","emit","push","_serialize_prefixes","_xc_state","_h_prefixes","cache_prefixes","_serialize_c3","hc3_triples","s_indent","s_write","s_delim_triples","f_exit_subject","sc1_subject","g_apply","_apply_directive","write","exit","i_triples","length","c1_node","terse","s_indent_pairs","s_term_pairs","hc2_pairs","i_pairs","b_empty","f_exit_predicate","sc1_predicate","z_objects","st_objects","kt_predicate","c1_named_node","st_predicate","isRdfTypeAlias","slice","_hm_coercions","hm_coercions","c1","number","boolean","Array","isArray","Set","s_term_object","z_item","f_exit_object","repeat","has","kt_converted","get","apply","isGraphyTerm","termType","from","term","_serialize_collection_object","a_collection","s_objects","_serialize_quad","g_quad","kq_quad","quad","_s_push","subject","predicate","object","prototype","anonymous_blank_nodes","_serialize_c3r","_serialize_c4r","_serialize_c4","_serialize_comment","_serialize_hash_comment","module","exports"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/208.65de7a32.js b/dist/js/208.65de7a32.js new file mode 100644 index 0000000..a9298cb --- /dev/null +++ b/dist/js/208.65de7a32.js @@ -0,0 +1,2 @@ +(self["webpackChunkmobilitydcatap_ui"]=self["webpackChunkmobilitydcatap_ui"]||[]).push([[208],{92208:function(e,t,r){const i=r(77761),s=r(19488);class n extends s{constructor(e){super(i,e)}}e.exports=n},77761:function(e,t,r){const i=r(44564),s=r(59080),{finished:n}=r(28399),o=r(75984);class a extends o{constructor(e,{baseIRI:t="",factory:r=s}={}){const o=new i.StreamParser({baseIRI:t,factory:r});super(o,{objectMode:!0}),o.on("prefix",((e,t)=>{this.emit("prefix",e,t)})),o.on("error",(e=>{this.destroy(e)})),n(this,(()=>{o.end()})),e.pipe(o)}}e.exports=a},59080:function(e,t,r){const i=r(90690);e.exports=i},86534:function(e){class t{constructor(e){this.value=e||"b"+ ++t.nextId}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}t.prototype.termType="BlankNode",t.nextId=0,e.exports=t},90690:function(e,t,r){const i=r(86534),s=r(597),n=r(94648),o=r(89999),a=r(83753),u=r(2781),c=r(27722);function h(e){return new a(e)}function l(e){return new i(e)}function d(e,t){return"string"===typeof t?-1===t.indexOf(":")?new o(e,t):new o(e,null,j.namedNode(t)):new o(e,null,t)}function f(e){return new c(e)}function p(){return j.defaultGraphInstance}function _(e,t,r){return j.quad(e,t,r)}function m(e,t,r,i){return new u(e,t,r,i||j.defaultGraphInstance)}function b(e){return n.call(j,e)}function y(e){return n.call(j,e)}const j={namedNode:h,blankNode:l,literal:d,variable:f,defaultGraph:p,triple:_,quad:m,fromTerm:b,fromQuad:y,defaultGraphInstance:new s};e.exports=j},597:function(e){class t{equals(e){return!!e&&e.termType===this.termType}}t.prototype.termType="DefaultGraph",t.prototype.value="",e.exports=t},89999:function(e,t,r){const i=r(83753);class s{constructor(e,t,r){this.value=e,this.datatype=s.stringDatatype,this.language="",t?(this.language=t,this.datatype=s.langStringDatatype):r&&(this.datatype=r)}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}s.prototype.termType="Literal",s.langStringDatatype=new i("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),s.stringDatatype=new i("http://www.w3.org/2001/XMLSchema#string"),e.exports=s},83753:function(e){class t{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}t.prototype.termType="NamedNode",e.exports=t},2781:function(e,t,r){const i=r(597);class s{constructor(e,t,r,s){this.subject=e,this.predicate=t,this.object=r,this.graph=s||new i}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}}s.prototype.termType="Quad",s.prototype.value="",e.exports=s},27722:function(e){class t{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}t.prototype.termType="Variable",e.exports=t},94648:function(e){function t(e){if(!e)return null;if("BlankNode"===e.termType)return this.blankNode(e.value);if("DefaultGraph"===e.termType)return this.defaultGraph();if("Literal"===e.termType)return this.literal(e.value,e.language||this.namedNode(e.datatype.value));if("NamedNode"===e.termType)return this.namedNode(e.value);if("Quad"===e.termType){const t=this.fromTerm(e.subject),r=this.fromTerm(e.predicate),i=this.fromTerm(e.object),s=this.fromTerm(e.graph);return this.quad(t,r,i,s)}if("Variable"===e.termType)return this.variable(e.value);throw new Error(`unknown termType ${e.termType}`)}e.exports=t},19488:function(e){class t{constructor(e,t){this.Impl=e,this.options=t}import(e,t){const r=new this.Impl(e,Object.assign({},this.options,t));return e.on("end",(()=>{r.readable||r.emit("end")})),e.on("error",(e=>{r.emit("error",e)})),r}}e.exports=t},44564:function(e,t,r){"use strict";r.r(t),r.d(t,{BlankNode:function(){return a.PB},DataFactory:function(){return a.Ay},DefaultGraph:function(){return a.yV},EntityIndex:function(){return k},Lexer:function(){return s.A},Literal:function(){return a.uS},NamedNode:function(){return a.Yo},Parser:function(){return n.A},Quad:function(){return a.kO},Reasoner:function(){return F},Store:function(){return q},StoreFactory:function(){return B},StreamParser:function(){return E.A},StreamWriter:function(){return L},Term:function(){return a.x1},Triple:function(){return a.n7},Util:function(){return i},Variable:function(){return a.rT},Writer:function(){return x},default:function(){return D},getRulesFromDataset:function(){return G},termFromId:function(){return a.iN},termToId:function(){return a.FL}});var i={};r.r(i),r.d(i,{inDefaultGraph:function(){return f},isBlankNode:function(){return c},isDefaultGraph:function(){return d},isLiteral:function(){return h},isNamedNode:function(){return u},isVariable:function(){return l},prefix:function(){return p},prefixes:function(){return _}});var s=r(3524),n=r(33291),o=r(65852),a=r(28612);function u(e){return!!e&&"NamedNode"===e.termType}function c(e){return!!e&&"BlankNode"===e.termType}function h(e){return!!e&&"Literal"===e.termType}function l(e){return!!e&&"Variable"===e.termType}function d(e){return!!e&&"DefaultGraph"===e.termType}function f(e){return d(e.graph)}function p(e,t){return _({"":e.value||e},t)("")}function _(e,t){const r=Object.create(null);for(const s in e)i(s,e[s]);function i(e,i){if("string"===typeof i){const s=Object.create(null);r[e]=e=>s[e]||(s[e]=t.namedNode(i+e))}else if(!(e in r))throw new Error(`Unknown prefix: ${e}`);return r[e]}return t=t||a.Ay,i}const m=a.Ay.defaultGraph(),{rdf:b,xsd:y}=o.A,j=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,I=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,g={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class v extends a.x1{equals(e){return e===this}}class x{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,i){e+=t,i&&i()},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=m,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseMatcher=new RegExp(`^${T(t.baseIRI)}${t.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=t.baseIRI.length))}get _inDefaultGraph(){return m.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,r,i,s){try{i.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(m.equals(i)?"":`${this._encodeIriOrBlank(i)} {\n`)),this._graph=i,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(r)}`,s):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,s):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,s)}catch(n){s&&s(n)}}_writeQuadLine(e,t,r,i,s){delete this._prefixMatch,this._write(this.quadToString(e,t,r,i),s)}quadToString(e,t,r,i){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(r)}${i&&i.value?` ${this._encodeIriOrBlank(i)} .\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._baseMatcher&&this._baseMatcher.test(t)&&(t=t.substr(this._baseLength)),j.test(t)&&(t=t.replace(I,w));const r=this._prefixRegex.exec(t);return r?r[1]?this._prefixIRIs[r[1]]+r[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(j.test(t)&&(t=t.replace(I,w)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===y.string)return`"${t}"`}else switch(e.datatype.value){case y.string:return`"${t}"`;case y.boolean:if("true"===t||"false"===t)return t;break;case y.integer:if(/^[+-]?\d+$/.test(t))return t;break;case y.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case y.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t;break}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===b.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:i}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(r)}${d(i)?"":` ${this._encodeIriOrBlank(i)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,r,i,s){void 0===r?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"===typeof i?this._writeQuad(e,t,r,m,i):this._writeQuad(e,t,r,i||m,s)}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=T(e,/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([_a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(r?"\n":"",t)}blank(e,t){let r,i,s=e;switch(void 0===e?s=[]:e.termType?s=[{predicate:e,object:t}]:"length"in e||(s=[e]),i=s.length){case 0:return new v("[]");case 1:if(r=s[0],!(r.object instanceof v))return new v(`[ ${this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)} ]`);default:let t="[";for(let n=0;n{t=null,e(r,i)});if(this._endStream)try{return this._outputStream.end(t)}catch(r){}t&&t()}}function w(e){let t=g[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}function T(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}var N=r(85721);const $=Symbol("iter");function S(e,t,r=4){if(0===r)return Object.assign(e,t);for(const i in t)e[i]=S(e[i]||Object.create(null),t[i],r-1);return e}function Q(e,t,r=4){let i=!1;for(const s in e)if(s in t){const n=0===r?null:Q(e[s],t[s],r-1);if(!1!==n)i=i||Object.create(null),i[s]=n;else if(3===r)return!1}return i}function O(e,t,r=4){let i=!1;for(const s in e)if(s in t){if(0!==r){const n=O(e[s],t[s],r-1);if(!1!==n)i=i||Object.create(null),i[s]=n;else if(3===r)return!1}}else i=i||Object.create(null),i[s]=0===r?null:S({},e[s],r-1);return i}class k{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||a.Ay}_termFromId(e){if("."===e[0]){const t=this._entities,r=e.split("."),i=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}return(0,a.iN)(e,this._factory)}_termToNumericId(e){if("Quad"===e.termType){const t=this._termToNumericId(e.subject),r=this._termToNumericId(e.predicate),i=this._termToNumericId(e.object);let s;return t&&r&&i&&(d(e.graph)||(s=this._termToNumericId(e.graph)))&&this._ids[s?`.${t}.${r}.${i}.${s}`:`.${t}.${r}.${i}`]}return this._ids[(0,a.FL)(e)]}_termToNewNumericId(e){const t=e&&"Quad"===e.termType?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${d(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:(0,a.FL)(e);return this._ids[t]||(this._ids[this._entities[++this._id]=t]=this._id)}createBlankNode(e){let t,r;if(e){t=e=`_:${e}`,r=1;while(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 q{constructor(e,t){this._size=0,this._graphs=Object.create(null),t||!e||e[0]||(t=e,e=null),t=t||{},this._factory=t.factory||a.Ay,this._entityIndex=t.entityIndex||new k({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.addQuads(e)}get size(){let e=this._size;if(null!==e)return e;e=0;const t=this._graphs;let r,i;for(const s in t)for(const n in r=t[s].subjects)for(const t in i=r[n])e+=Object.keys(i[t]).length;return this._size=e}_addToIndex(e,t,r,i){const s=e[t]||(e[t]={}),n=s[r]||(s[r]={}),o=i in n;return o||(n[i]=null),!o}_removeFromIndex(e,t,r,i){const s=e[t],n=s[r];delete n[i];for(const o in n)return;delete s[r];for(const o in s)return;delete e[t]}*_findInIndex(e,t,r,i,s,n,o,a){let u,c,h;const l=this._entities,d=this._termFromId(l[a]),f={subject:null,predicate:null,object:null};t&&((u=e,e={})[t]=u[t]);for(const p in e)if(c=e[p]){f[s]=this._termFromId(l[p]),r&&((u=c,c={})[r]=u[r]);for(const e in c)if(h=c[e]){f[n]=this._termFromId(l[e]);const t=i?i in h?[i]:[]:Object.keys(h);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,i){t||(i=e.graph,r=e.object,t=e.predicate,e=e.subject),i=i?this._termToNewNumericId(i):1;let s=this._graphs[i];return s||(s=this._graphs[i]={subjects:{},predicates:{},objects:{}},Object.freeze(s)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),r=this._termToNewNumericId(r),!!this._addToIndex(s.subjects,e,t,r)&&(this._addToIndex(s.predicates,t,r,e),this._addToIndex(s.objects,r,e,t),this._size=null,!0)}addQuads(e){for(let t=0;t{this.addQuad(e)})),e}removeQuad(e,t,r,i){t||({subject:e,predicate:t,object:r,graph:i}=e),i=i?this._termToNumericId(i):1;const s=this._graphs;let n,o,a;if(!(e=e&&this._termToNumericId(e))||!(t=t&&this._termToNumericId(t))||!(r=r&&this._termToNumericId(r))||!(n=s[i])||!(o=n.subjects[e])||!(a=o[t])||!(r in a))return!1;for(e in this._removeFromIndex(n.subjects,e,t,r),this._removeFromIndex(n.predicates,t,r,e),this._removeFromIndex(n.objects,r,e,t),null!==this._size&&this._size--,n.subjects)return!0;return delete s[i],!0}removeQuads(e){for(let t=0;t{this.removeQuad(e)})),e}removeMatches(e,t,r,i){const s=new N.Readable({objectMode:!0}),n=this.readQuads(e,t,r,i);return s._read=e=>{while(--e>=0){const{done:e,value:t}=n.next();if(e)return void s.push(null);s.push(t)}},this.remove(s)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,r,i){return[...this.readQuads(e,t,r,i)]}*readQuads(e,t,r,i){const s=this._getGraphs(i);let n,o,a,u;if(!(e&&!(o=this._termToNumericId(e))||t&&!(a=this._termToNumericId(t))||r&&!(u=this._termToNumericId(r))))for(const c in s)(n=s[c])&&(o?u?yield*this._findInIndex(n.objects,u,o,a,"object","subject","predicate",c):yield*this._findInIndex(n.subjects,o,a,null,"subject","predicate","object",c):a?yield*this._findInIndex(n.predicates,a,u,null,"predicate","object","subject",c):u?yield*this._findInIndex(n.objects,u,null,null,"object","subject","predicate",c):yield*this._findInIndex(n.subjects,null,null,null,"subject","predicate","object",c))}match(e,t,r,i){return new P(this,e,t,r,i,{entityIndex:this._entityIndex})}countQuads(e,t,r,i){const s=this._getGraphs(i);let n,o,a,u,c=0;if(e&&!(o=this._termToNumericId(e))||t&&!(a=this._termToNumericId(t))||r&&!(u=this._termToNumericId(r)))return 0;for(const h in s)(n=s[h])&&(c+=e?r?this._countInIndex(n.objects,u,o,a):this._countInIndex(n.subjects,o,a,u):t?this._countInIndex(n.predicates,a,u,o):this._countInIndex(n.objects,u,o,a));return c}forEach(e,t,r,i,s){this.some((t=>(e(t,this),!1)),t,r,i,s)}every(e,t,r,i,s){return!this.some((t=>!e(t,this)),t,r,i,s)}some(e,t,r,i,s){for(const n of this.readQuads(t,r,i,s))if(e(n))return!0;return!1}getSubjects(e,t,r){const i=[];return this.forSubjects((e=>{i.push(e)}),e,t,r),i}forSubjects(e,t,r,i){const s=this._getGraphs(i);let n,o,a;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||r&&!(a=this._termToNumericId(r))))for(i in s)(n=s[i])&&(o?a?this._loopBy2Keys(n.predicates,o,a,e):this._loopByKey1(n.subjects,o,e):a?this._loopByKey0(n.objects,a,e):this._loop(n.subjects,e))}getPredicates(e,t,r){const i=[];return this.forPredicates((e=>{i.push(e)}),e,t,r),i}forPredicates(e,t,r,i){const s=this._getGraphs(i);let n,o,a;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||r&&!(a=this._termToNumericId(r))))for(i in s)(n=s[i])&&(o?a?this._loopBy2Keys(n.objects,a,o,e):this._loopByKey0(n.subjects,o,e):a?this._loopByKey1(n.predicates,a,e):this._loop(n.predicates,e))}getObjects(e,t,r){const i=[];return this.forObjects((e=>{i.push(e)}),e,t,r),i}forObjects(e,t,r,i){const s=this._getGraphs(i);let n,o,a;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||r&&!(a=this._termToNumericId(r))))for(i in s)(n=s[i])&&(o?a?this._loopBy2Keys(n.subjects,o,a,e):this._loopByKey1(n.objects,o,e):a?this._loopByKey0(n.predicates,a,e):this._loop(n.objects,e))}getGraphs(e,t,r){const i=[];return this.forGraphs((e=>{i.push(e)}),e,t,r),i}forGraphs(e,t,r,i){for(const s in this._graphs)this.some((t=>(e(t.graph),!0)),t,r,i,this._termFromId(this._entities[s]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const r={},i=t?()=>!0:(e,t)=>{throw new Error(`${e.value} ${t}`)},s=this.getQuads(null,o.A.rdf.rest,o.A.rdf.nil,null),n=e?[...s]:[];return s.forEach((t=>{const s=[];let a,u,c=!1;const h=t.graph;let l=t.subject;while(l&&!c){const e=this.getQuads(null,null,l,null),t=this.getQuads(l,null,null,null);let r,d=null,f=null,p=null;for(let s=0;sthis.has(e)));const t=this._graphs,r=e._graphs;let i,s,n,o,a;for(const u in r){if(!(i=t[u]))return!1;i=i.subjects;for(const e in s=r[u].subjects){if(!(n=i[e]))return!1;for(const t in o=s[e]){if(!(a=n[t]))return!1;for(const e in o[t])if(!(e in a))return!1}}}return!0}deleteMatches(e,t,r,i){for(const s of this.match(e,t,r,i))this.removeQuad(s);return this}difference(e){if(e&&e instanceof P&&(e=e.filtered),e===this)return new q({entityIndex:this._entityIndex});if(e instanceof q&&e._entityIndex===this._entityIndex){const t=new q({entityIndex:this._entityIndex}),r=O(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 P&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new q({entityIndex:this._entityIndex});for(const r of this)e(r,this)&&t.add(r);return t}intersection(e){if(e instanceof P&&(e=e.filtered),e===this){const e=new q({entityIndex:this._entityIndex});return e._graphs=S(Object.create(null),this._graphs),e._size=this._size,e}if(e instanceof q&&this._entityIndex===e._entityIndex){const t=new q({entityIndex:this._entityIndex}),r=Q(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 q({entityIndex:this._entityIndex});for(const r of this)t.add(e(r,this));return t}reduce(e,t){const r=this.readQuads();let i=void 0===t?r.next().value:t;for(const s of r)i=e(i,s,this);return i}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return(new x).quadsToString(this)}union(e){const t=new q({entityIndex:this._entityIndex});return t._graphs=S(Object.create(null),this._graphs),t._size=this._size,t.addAll(e),t}*[Symbol.iterator](){yield*this.readQuads()}}function A(e,t,r=0){const i=t[r];if(i&&!(i in e))return!1;let s=!1;for(const n in i?{[i]:e[i]}:e){const i=2===r?null:A(e[n],t,r+1);!1!==i&&(s=s||Object.create(null),s[n]=i)}return s}class P extends N.Readable{constructor(e,t,r,i,s,n){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:r,object:i,graph:s,options:n})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:r,predicate:i,subject:s}=this,n=this._filtered=new q({factory:e._factory,entityIndex:this.options.entityIndex});let o,a,u;if(s&&!(o=n._termToNumericId(s))||i&&!(a=n._termToNumericId(i))||r&&!(u=n._termToNumericId(r)))return n;const c=e._getGraphs(t);for(const h in c){let e,t,r;!o&&a?(t=A(c[h].predicates,[a,u,o]))&&(e=A(c[h].subjects,[o,a,u]),r=A(c[h].objects,[u,o,a])):u?(r=A(c[h].objects,[u,o,a]))&&(e=A(c[h].subjects,[o,a,u]),t=A(c[h].predicates,[a,u,o])):(e=A(c[h].subjects,[o,a,u]))&&(t=A(c[h].predicates,[a,u,o]),r=A(c[h].objects,[u,o,a])),e&&(n._graphs[h]={subjects:e,predicates:t,objects:r})}n._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[$]&&(this[$]=this[Symbol.iterator]());const t=this[$];while(--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,i){return this.filtered.deleteMatches(e,t,r,i)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,t,r,i,s){return this.filtered.every(e,t,r,i,s)}filter(e){return this.filtered.filter(e)}forEach(e,t,r,i,s){return this.filtered.forEach(e,t,r,i,s)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,t,r,i,s){return this.filtered.some(e,t,r,i,s)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(e)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,t){return this.filtered.reduce(e,t)}toString(){return(new x).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,i){return new P(this.filtered,e,t,r,i,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}class B{dataset(e){return new q(e)}}function G(e){const t=[];for(const{subject:r,object:i}of e.match(null,a.Ay.namedNode("http://www.w3.org/2000/10/swap/log#implies"),null,a.Ay.defaultGraph())){const s=[...e.match(null,null,null,r)],n=[...e.match(null,null,null,i)];t.push({premise:s,conclusion:n})}return t}class F{constructor(e){this._store=e}_add(e,t,r,i,s){this._store._addToIndex(i.subjects,e,t,r)&&(this._store._addToIndex(i.predicates,t,r,e),this._store._addToIndex(i.objects,r,e,t),s())}_evaluatePremise(e,t,r,i=0){let s,n,o,a,u;const[c,h,l]=e.premise[i].value,d=t[e.premise[i].content],f=!(o=c.value);for(o in f?d:{[o]:d[o]})if(a=d[o]){for(o in f&&(c.value=Number(o)),s=!(o=h.value),s?a:{[o]:a[o]})if(u=a[o]){for(o in s&&(h.value=Number(o)),n=!(o=l.value),n?u:{[o]:u[o]})n&&(l.value=Number(o)),i===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,i+1);n&&(l.value=null)}s&&(h.value=null)}f&&(c.value=null)}_evaluateRules(e,t,r){for(let i=0;i{r.push([e.subject.value,e.predicate.value,e.object.value,t])}))}const s=e=>{e.forEach((e=>{this._add(e.subject.value,e.predicate.value,e.object.value,t,(()=>{i(e)}))}))};let n;this._evaluateRules(e,t,i);while(void 0!==(n=r.pop())){const[e,r,o,a]=n,u=a.basePremise.subject.value;u||(a.basePremise.subject.value=e);const c=a.basePremise.predicate.value;c||(a.basePremise.predicate.value=r);const h=a.basePremise.object.value;h||(a.basePremise.object.value=o),0===a.premise.length?s(a.conclusion):this._evaluatePremise(a,t,i),u||(a.basePremise.subject.value=null),c||(a.basePremise.predicate.value=null),h||(a.basePremise.object.value=null)}}_createRule({premise:e,conclusion:t}){const r={},i=e=>"Variable"===e.termType?r[e.value]=r[e.value]||{}:{value:this._store._termToNewNumericId(e)},s=e=>({subject:i(e.subject),predicate:i(e.predicate),object:i(e.object)});return{premise:e.map((e=>s(e))),conclusion:t.map((e=>s(e))),variables:Object.values(r)}}reason(e){Array.isArray(e)||(e=G(e)),e=e.map((e=>this._createRule(e)));for(const r of e)for(const t of e)for(let e=0;e{e.value=null}))}}for(const r of e){const e=new Set;r.premise=r.premise.map((t=>R(t,e)))}const t=this._store._getGraphs();for(const r in t)this._reasonGraphNaive(e,t[r]);this._store._size=null}}function R({subject:e,predicate:t,object:r},i){const s=e.value||i.has(e)||(i.add(e),!1),n=t.value||i.has(t)||(i.add(t),!1),o=r.value||i.has(r)||(i.add(r),!1);return!s&&n?{content:"predicates",value:[t,r,e]}:o?{content:"objects",value:[r,e,t]}:{content:"subjects",value:[e,t,r]}}function z(e,t){return null===e.value&&(e.value=t.value),e.value===t.value}var E=r(66731);class L extends N.Transform{constructor(e){super({encoding:"utf8",writableObjectMode:!0});const t=this._writer=new x({write:(e,t,r)=>{this.push(e),r&&r()},end:e=>{this.push(null),e&&e()}},e);this._transform=(e,r,i)=>{t.addQuad(e,i)},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}}var D={Lexer:s.A,Parser:n.A,Writer:x,Store:q,StoreFactory:B,EntityIndex:k,StreamParser:E.A,StreamWriter:L,Util:i,Reasoner:F,DataFactory:a.Ay,Term:a.x1,NamedNode:a.Yo,Literal:a.uS,BlankNode:a.PB,Variable:a.rT,DefaultGraph:a.yV,Quad:a.kO,Triple:a.n7,termFromId:a.iN,termToId:a.FL}},75984:function(e,t,r){const{finished:i,Readable:s}=r(28399);function n(){return new Promise((e=>setTimeout(e,0)))}class o extends s{constructor(e,{end:t=!0,map:r,...i}={}){super({read:o.readFrom(e,{end:t,map:r}),...i})}static readFrom(e,{end:t=!0,map:r=e=>e}={}){let s=!1;i(e,(()=>{s=!0}));const o=async function(){while(1){const i=e.read();if(i){if(!this.push(r(i)))return!1}else{if(s&&t&&this.push(null),s)return!0;await n()}}};return o}}e.exports=o}}]); +//# sourceMappingURL=208.65de7a32.js.map \ No newline at end of file diff --git a/dist/js/208.65de7a32.js.map b/dist/js/208.65de7a32.js.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0P,GAAa,EAAQ,OAEvC,SAAS2I,IACP,OAAO,IAAIC,SAAQC,GAAWC,WAAWD,EAAS,IACpD,CAEA,MAAMtY,UAA2ByP,EAC/B,WAAAjQ,CAAaS,GAAO,IAAEa,GAAM,EAAI,IAAEqS,KAAQqF,GAAS,CAAC,GAClD9Y,MAAM,CACJ+Y,KAAMzY,EAAmB0Y,SAASzY,EAAO,CAAEa,MAAKqS,WAC7CqF,GAEP,CAEA,eAAOE,CAAUzY,GAAO,IAAEa,GAAM,EAAI,IAAEqS,EAAM2D,GAAKA,GAAM,CAAC,GACtD,IAAInR,GAAO,EAEX5F,EAASE,GAAO,KACd0F,GAAO,KAGT,MAAM8S,EAAOE,iBACX,MAAO,EAAM,CACX,MAAMlT,EAAQxF,EAAMwY,OAEpB,GAAKhT,GAWH,IAAK/E,KAAKkP,KAAKuD,EAAI1N,IACjB,OAAO,MAZC,CAKV,GAJIE,GAAQ7E,GACVJ,KAAKkP,KAAK,MAGRjK,EACF,OAAO,QAGHyS,GACR,CAKF,CACF,EAEA,OAAOK,CACT,EAGF9Y,EAAOC,QAAUI,C","sources":["webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/index.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/lib/ParserStream.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/index.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/lib/BlankNode.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/lib/DataFactory.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/lib/DefaultGraph.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/lib/Literal.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/lib/NamedNode.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/lib/Quad.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/lib/Variable.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/lib/fromTerm.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/sink/index.js","webpack://mobilitydcatap-ui/./node_modules/n3/src/N3Util.js","webpack://mobilitydcatap-ui/./node_modules/n3/src/N3Writer.js","webpack://mobilitydcatap-ui/./node_modules/n3/src/N3Store.js","webpack://mobilitydcatap-ui/./node_modules/n3/src/N3StoreFactory.js","webpack://mobilitydcatap-ui/./node_modules/n3/src/N3Reasoner.js","webpack://mobilitydcatap-ui/./node_modules/n3/src/N3StreamWriter.js","webpack://mobilitydcatap-ui/./node_modules/n3/src/index.js","webpack://mobilitydcatap-ui/./node_modules/readable-to-readable/index.js"],"sourcesContent":["const ParserStream = require('./lib/ParserStream')\nconst Sink = require('@rdfjs/sink')\n\nclass Parser extends Sink {\n constructor (options) {\n super(ParserStream, options)\n }\n}\n\nmodule.exports = Parser\n","const N3 = require('n3')\nconst rdf = require('@rdfjs/data-model')\nconst { finished } = require('readable-stream')\nconst ReadableToReadable = require('readable-to-readable')\n\nclass ParserStream extends ReadableToReadable {\n constructor (input, { baseIRI = '', factory = rdf } = {}) {\n const parser = new N3.StreamParser({ baseIRI, factory })\n\n super(parser, { objectMode: true })\n\n parser.on('prefix', (prefix, term) => {\n this.emit('prefix', prefix, term)\n })\n\n parser.on('error', err => {\n this.destroy(err)\n })\n\n finished(this, () => {\n parser.end()\n })\n\n input.pipe(parser)\n }\n}\n\nmodule.exports = ParserStream\n","const DataFactory = require('./lib/DataFactory.js')\n\nmodule.exports = DataFactory\n","class BlankNode {\n constructor (id) {\n this.value = id || ('b' + (++BlankNode.nextId))\n }\n\n equals (other) {\n return !!other && other.termType === this.termType && other.value === this.value\n }\n}\n\nBlankNode.prototype.termType = 'BlankNode'\n\nBlankNode.nextId = 0\n\nmodule.exports = BlankNode\n","const BlankNode = require('./BlankNode.js')\nconst DefaultGraph = require('./DefaultGraph.js')\nconst fromTermRaw = require('./fromTerm.js')\nconst Literal = require('./Literal.js')\nconst NamedNode = require('./NamedNode.js')\nconst Quad = require('./Quad.js')\nconst Variable = require('./Variable.js')\n\nfunction namedNode (value) {\n return new NamedNode(value)\n}\n\nfunction blankNode (value) {\n return new BlankNode(value)\n}\n\nfunction literal (value, languageOrDatatype) {\n if (typeof languageOrDatatype === 'string') {\n if (languageOrDatatype.indexOf(':') === -1) {\n return new Literal(value, languageOrDatatype)\n }\n\n return new Literal(value, null, DataFactory.namedNode(languageOrDatatype))\n }\n\n return new Literal(value, null, languageOrDatatype)\n}\n\nfunction variable (value) {\n return new Variable(value)\n}\n\nfunction defaultGraph () {\n return DataFactory.defaultGraphInstance\n}\n\nfunction triple (subject, predicate, object) {\n return DataFactory.quad(subject, predicate, object)\n}\n\nfunction quad (subject, predicate, object, graph) {\n return new Quad(subject, predicate, object, graph || DataFactory.defaultGraphInstance)\n}\n\nfunction fromTerm (original) {\n return fromTermRaw.call(DataFactory, original)\n}\n\nfunction fromQuad (original) {\n return fromTermRaw.call(DataFactory, original)\n}\n\nconst DataFactory = {\n namedNode,\n blankNode,\n literal,\n variable,\n defaultGraph,\n triple,\n quad,\n fromTerm,\n fromQuad,\n defaultGraphInstance: new DefaultGraph()\n}\n\nmodule.exports = DataFactory\n","class DefaultGraph {\n equals (other) {\n return !!other && other.termType === this.termType\n }\n}\n\nDefaultGraph.prototype.termType = 'DefaultGraph'\nDefaultGraph.prototype.value = ''\n\nmodule.exports = DefaultGraph\n","const NamedNode = require('./NamedNode.js')\n\nclass Literal {\n constructor (value, language, datatype) {\n this.value = value\n this.datatype = Literal.stringDatatype\n this.language = ''\n\n if (language) {\n this.language = language\n this.datatype = Literal.langStringDatatype\n } else if (datatype) {\n this.datatype = datatype\n }\n }\n\n equals (other) {\n return !!other && other.termType === this.termType && other.value === this.value &&\n other.language === this.language && other.datatype.equals(this.datatype)\n }\n}\n\nLiteral.prototype.termType = 'Literal'\n\nLiteral.langStringDatatype = new NamedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString')\nLiteral.stringDatatype = new NamedNode('http://www.w3.org/2001/XMLSchema#string')\n\nmodule.exports = Literal\n","class NamedNode {\n constructor (iri) {\n this.value = iri\n }\n\n equals (other) {\n return !!other && other.termType === this.termType && other.value === this.value\n }\n}\n\nNamedNode.prototype.termType = 'NamedNode'\n\nmodule.exports = NamedNode\n","const DefaultGraph = require('./DefaultGraph.js')\n\nclass Quad {\n constructor (subject, predicate, object, graph) {\n this.subject = subject\n this.predicate = predicate\n this.object = object\n\n if (graph) {\n this.graph = graph\n } else {\n this.graph = new DefaultGraph()\n }\n }\n\n equals (other) {\n // `|| !other.termType` is for backwards-compatibility with old factories without RDF* support.\n return !!other && (other.termType === 'Quad' || !other.termType) &&\n other.subject.equals(this.subject) && other.predicate.equals(this.predicate) &&\n other.object.equals(this.object) && other.graph.equals(this.graph)\n }\n}\n\nQuad.prototype.termType = 'Quad'\nQuad.prototype.value = ''\n\nmodule.exports = Quad\n","class Variable {\n constructor (name) {\n this.value = name\n }\n\n equals (other) {\n return !!other && other.termType === this.termType && other.value === this.value\n }\n}\n\nVariable.prototype.termType = 'Variable'\n\nmodule.exports = Variable\n","function fromTerm (original) {\n if (!original) {\n return null\n }\n\n if (original.termType === 'BlankNode') {\n return this.blankNode(original.value)\n }\n\n if (original.termType === 'DefaultGraph') {\n return this.defaultGraph()\n }\n\n if (original.termType === 'Literal') {\n return this.literal(original.value, original.language || this.namedNode(original.datatype.value))\n }\n\n if (original.termType === 'NamedNode') {\n return this.namedNode(original.value)\n }\n\n if (original.termType === 'Quad') {\n const subject = this.fromTerm(original.subject)\n const predicate = this.fromTerm(original.predicate)\n const object = this.fromTerm(original.object)\n const graph = this.fromTerm(original.graph)\n\n return this.quad(subject, predicate, object, graph)\n }\n\n if (original.termType === 'Variable') {\n return this.variable(original.value)\n }\n\n throw new Error(`unknown termType ${original.termType}`)\n}\n\nmodule.exports = fromTerm\n","class Sink {\n constructor (Impl, options) {\n this.Impl = Impl\n this.options = options\n }\n\n import (input, options) {\n const output = new this.Impl(input, Object.assign({}, this.options, options))\n\n input.on('end', () => {\n if (!output.readable) {\n output.emit('end')\n }\n })\n\n input.on('error', (err) => {\n output.emit('error', err)\n })\n\n return output\n }\n}\n\nmodule.exports = Sink\n","// **N3Util** provides N3 utility functions.\n\nimport N3DataFactory from './N3DataFactory';\n\n// Tests whether the given term represents an IRI\nexport function isNamedNode(term) {\n return !!term && term.termType === 'NamedNode';\n}\n\n// Tests whether the given term represents a blank node\nexport function isBlankNode(term) {\n return !!term && term.termType === 'BlankNode';\n}\n\n// Tests whether the given term represents a literal\nexport function isLiteral(term) {\n return !!term && term.termType === 'Literal';\n}\n\n// Tests whether the given term represents a variable\nexport function isVariable(term) {\n return !!term && term.termType === 'Variable';\n}\n\n// Tests whether the given term represents the default graph\nexport function isDefaultGraph(term) {\n return !!term && term.termType === 'DefaultGraph';\n}\n\n// Tests whether the given quad is in the default graph\nexport function inDefaultGraph(quad) {\n return isDefaultGraph(quad.graph);\n}\n\n// Creates a function that prepends the given IRI to a local name\nexport function prefix(iri, factory) {\n return prefixes({ '': iri.value || iri }, factory)('');\n}\n\n// Creates a function that allows registering and expanding prefixes\nexport function prefixes(defaultPrefixes, factory) {\n // Add all of the default prefixes\n const prefixes = Object.create(null);\n for (const prefix in defaultPrefixes)\n processPrefix(prefix, defaultPrefixes[prefix]);\n // Set the default factory if none was specified\n factory = factory || N3DataFactory;\n\n // Registers a new prefix (if an IRI was specified)\n // or retrieves a function that expands an existing prefix (if no IRI was specified)\n function processPrefix(prefix, iri) {\n // Create a new prefix if an IRI is specified or the prefix doesn't exist\n if (typeof iri === 'string') {\n // Create a function that expands the prefix\n const cache = Object.create(null);\n prefixes[prefix] = local => {\n return cache[local] || (cache[local] = factory.namedNode(iri + local));\n };\n }\n else if (!(prefix in prefixes)) {\n throw new Error(`Unknown prefix: ${prefix}`);\n }\n return prefixes[prefix];\n }\n return processPrefix;\n}\n","// **N3Writer** writes N3 documents.\nimport namespaces from './IRIs';\nimport { default as N3DataFactory, Term } from './N3DataFactory';\nimport { isDefaultGraph } from './N3Util';\n\nconst DEFAULTGRAPH = N3DataFactory.defaultGraph();\n\nconst { rdf, xsd } = namespaces;\n\n// Characters in literals that require escaping\nconst escape = /[\"\\\\\\t\\n\\r\\b\\f\\u0000-\\u0019\\ud800-\\udbff]/,\n escapeAll = /[\"\\\\\\t\\n\\r\\b\\f\\u0000-\\u0019]|[\\ud800-\\udbff][\\udc00-\\udfff]/g,\n escapedCharacters = {\n '\\\\': '\\\\\\\\', '\"': '\\\\\"', '\\t': '\\\\t',\n '\\n': '\\\\n', '\\r': '\\\\r', '\\b': '\\\\b', '\\f': '\\\\f',\n };\n\n// ## Placeholder class to represent already pretty-printed terms\nclass SerializedTerm extends Term {\n // Pretty-printed nodes are not equal to any other node\n // (e.g., [] does not equal [])\n equals(other) {\n return other === this;\n }\n}\n\n// ## Constructor\nexport default class N3Writer {\n constructor(outputStream, options) {\n // ### `_prefixRegex` matches a prefixed name or IRI that begins with one of the added prefixes\n this._prefixRegex = /$0^/;\n\n // Shift arguments if the first argument is not a stream\n if (outputStream && typeof outputStream.write !== 'function')\n options = outputStream, outputStream = null;\n options = options || {};\n this._lists = options.lists;\n\n // If no output stream given, send the output as string through the end callback\n if (!outputStream) {\n let output = '';\n this._outputStream = {\n write(chunk, encoding, done) { output += chunk; done && done(); },\n end: done => { done && done(null, output); },\n };\n this._endStream = true;\n }\n else {\n this._outputStream = outputStream;\n this._endStream = options.end === undefined ? true : !!options.end;\n }\n\n // Initialize writer, depending on the format\n this._subject = null;\n if (!(/triple|quad/i).test(options.format)) {\n this._lineMode = false;\n this._graph = DEFAULTGRAPH;\n this._prefixIRIs = Object.create(null);\n options.prefixes && this.addPrefixes(options.prefixes);\n if (options.baseIRI) {\n this._baseMatcher = new RegExp(`^${escapeRegex(options.baseIRI)\n }${options.baseIRI.endsWith('/') ? '' : '[#?]'}`);\n this._baseLength = options.baseIRI.length;\n }\n }\n else {\n this._lineMode = true;\n this._writeQuad = this._writeQuadLine;\n }\n }\n\n // ## Private methods\n\n // ### Whether the current graph is the default graph\n get _inDefaultGraph() {\n return DEFAULTGRAPH.equals(this._graph);\n }\n\n // ### `_write` writes the argument to the output stream\n _write(string, callback) {\n this._outputStream.write(string, 'utf8', callback);\n }\n\n // ### `_writeQuad` writes the quad to the output stream\n _writeQuad(subject, predicate, object, graph, done) {\n try {\n // Write the graph's label if it has changed\n if (!graph.equals(this._graph)) {\n // Close the previous graph and start the new one\n this._write((this._subject === null ? '' : (this._inDefaultGraph ? '.\\n' : '\\n}\\n')) +\n (DEFAULTGRAPH.equals(graph) ? '' : `${this._encodeIriOrBlank(graph)} {\\n`));\n this._graph = graph;\n this._subject = null;\n }\n // Don't repeat the subject if it's the same\n if (subject.equals(this._subject)) {\n // Don't repeat the predicate if it's the same\n if (predicate.equals(this._predicate))\n this._write(`, ${this._encodeObject(object)}`, done);\n // Same subject, different predicate\n else\n this._write(`;\\n ${\n this._encodePredicate(this._predicate = predicate)} ${\n this._encodeObject(object)}`, done);\n }\n // Different subject; write the whole quad\n else\n this._write(`${(this._subject === null ? '' : '.\\n') +\n this._encodeSubject(this._subject = subject)} ${\n this._encodePredicate(this._predicate = predicate)} ${\n this._encodeObject(object)}`, done);\n }\n catch (error) { done && done(error); }\n }\n\n // ### `_writeQuadLine` writes the quad to the output stream as a single line\n _writeQuadLine(subject, predicate, object, graph, done) {\n // Write the quad without prefixes\n delete this._prefixMatch;\n this._write(this.quadToString(subject, predicate, object, graph), done);\n }\n\n // ### `quadToString` serializes a quad as a string\n quadToString(subject, predicate, object, graph) {\n return `${this._encodeSubject(subject)} ${\n this._encodeIriOrBlank(predicate)} ${\n this._encodeObject(object)\n }${graph && graph.value ? ` ${this._encodeIriOrBlank(graph)} .\\n` : ' .\\n'}`;\n }\n\n // ### `quadsToString` serializes an array of quads as a string\n quadsToString(quads) {\n let quadsString = '';\n for (const quad of quads)\n quadsString += this.quadToString(quad.subject, quad.predicate, quad.object, quad.graph);\n return quadsString;\n }\n\n // ### `_encodeSubject` represents a subject\n _encodeSubject(entity) {\n return entity.termType === 'Quad' ?\n this._encodeQuad(entity) : this._encodeIriOrBlank(entity);\n }\n\n // ### `_encodeIriOrBlank` represents an IRI or blank node\n _encodeIriOrBlank(entity) {\n // A blank node or list is represented as-is\n if (entity.termType !== 'NamedNode') {\n // If it is a list head, pretty-print it\n if (this._lists && (entity.value in this._lists))\n entity = this.list(this._lists[entity.value]);\n return 'id' in entity ? entity.id : `_:${entity.value}`;\n }\n let iri = entity.value;\n // Use relative IRIs if requested and possible\n if (this._baseMatcher && this._baseMatcher.test(iri))\n iri = iri.substr(this._baseLength);\n // Escape special characters\n if (escape.test(iri))\n iri = iri.replace(escapeAll, characterReplacer);\n // Try to represent the IRI as prefixed name\n const prefixMatch = this._prefixRegex.exec(iri);\n return !prefixMatch ? `<${iri}>` :\n (!prefixMatch[1] ? iri : this._prefixIRIs[prefixMatch[1]] + prefixMatch[2]);\n }\n\n // ### `_encodeLiteral` represents a literal\n _encodeLiteral(literal) {\n // Escape special characters\n let value = literal.value;\n if (escape.test(value))\n value = value.replace(escapeAll, characterReplacer);\n\n // Write a language-tagged literal\n if (literal.language)\n return `\"${value}\"@${literal.language}`;\n\n // Write dedicated literals per data type\n if (this._lineMode) {\n // Only abbreviate strings in N-Triples or N-Quads\n if (literal.datatype.value === xsd.string)\n return `\"${value}\"`;\n }\n else {\n // Use common datatype abbreviations in Turtle or TriG\n switch (literal.datatype.value) {\n case xsd.string:\n return `\"${value}\"`;\n case xsd.boolean:\n if (value === 'true' || value === 'false')\n return value;\n break;\n case xsd.integer:\n if (/^[+-]?\\d+$/.test(value))\n return value;\n break;\n case xsd.decimal:\n if (/^[+-]?\\d*\\.\\d+$/.test(value))\n return value;\n break;\n case xsd.double:\n if (/^[+-]?(?:\\d+\\.\\d*|\\.?\\d+)[eE][+-]?\\d+$/.test(value))\n return value;\n break;\n }\n }\n\n // Write a regular datatyped literal\n return `\"${value}\"^^${this._encodeIriOrBlank(literal.datatype)}`;\n }\n\n // ### `_encodePredicate` represents a predicate\n _encodePredicate(predicate) {\n return predicate.value === rdf.type ? 'a' : this._encodeIriOrBlank(predicate);\n }\n\n // ### `_encodeObject` represents an object\n _encodeObject(object) {\n switch (object.termType) {\n case 'Quad':\n return this._encodeQuad(object);\n case 'Literal':\n return this._encodeLiteral(object);\n default:\n return this._encodeIriOrBlank(object);\n }\n }\n\n // ### `_encodeQuad` encodes an RDF-star quad\n _encodeQuad({ subject, predicate, object, graph }) {\n return `<<${\n this._encodeSubject(subject)} ${\n this._encodePredicate(predicate)} ${\n this._encodeObject(object)}${\n isDefaultGraph(graph) ? '' : ` ${this._encodeIriOrBlank(graph)}`}>>`;\n }\n\n // ### `_blockedWrite` replaces `_write` after the writer has been closed\n _blockedWrite() {\n throw new Error('Cannot write because the writer has been closed.');\n }\n\n // ### `addQuad` adds the quad to the output stream\n addQuad(subject, predicate, object, graph, done) {\n // The quad was given as an object, so shift parameters\n if (object === undefined)\n this._writeQuad(subject.subject, subject.predicate, subject.object, subject.graph, predicate);\n // The optional `graph` parameter was not provided\n else if (typeof graph === 'function')\n this._writeQuad(subject, predicate, object, DEFAULTGRAPH, graph);\n // The `graph` parameter was provided\n else\n this._writeQuad(subject, predicate, object, graph || DEFAULTGRAPH, done);\n }\n\n // ### `addQuads` adds the quads to the output stream\n addQuads(quads) {\n for (let i = 0; i < quads.length; i++)\n this.addQuad(quads[i]);\n }\n\n // ### `addPrefix` adds the prefix to the output stream\n addPrefix(prefix, iri, done) {\n const prefixes = {};\n prefixes[prefix] = iri;\n this.addPrefixes(prefixes, done);\n }\n\n // ### `addPrefixes` adds the prefixes to the output stream\n addPrefixes(prefixes, done) {\n // Ignore prefixes if not supported by the serialization\n if (!this._prefixIRIs)\n return done && done();\n\n // Write all new prefixes\n let hasPrefixes = false;\n for (let prefix in prefixes) {\n let iri = prefixes[prefix];\n if (typeof iri !== 'string')\n iri = iri.value;\n hasPrefixes = true;\n // Finish a possible pending quad\n if (this._subject !== null) {\n this._write(this._inDefaultGraph ? '.\\n' : '\\n}\\n');\n this._subject = null, this._graph = '';\n }\n // Store and write the prefix\n this._prefixIRIs[iri] = (prefix += ':');\n this._write(`@prefix ${prefix} <${iri}>.\\n`);\n }\n // Recreate the prefix matcher\n if (hasPrefixes) {\n let IRIlist = '', prefixList = '';\n for (const prefixIRI in this._prefixIRIs) {\n IRIlist += IRIlist ? `|${prefixIRI}` : prefixIRI;\n prefixList += (prefixList ? '|' : '') + this._prefixIRIs[prefixIRI];\n }\n IRIlist = escapeRegex(IRIlist, /[\\]\\/\\(\\)\\*\\+\\?\\.\\\\\\$]/g, '\\\\$&');\n this._prefixRegex = new RegExp(`^(?:${prefixList})[^\\/]*$|` +\n `^(${IRIlist})([_a-zA-Z][\\\\-_a-zA-Z0-9]*)$`);\n }\n // End a prefix block with a newline\n this._write(hasPrefixes ? '\\n' : '', done);\n }\n\n // ### `blank` creates a blank node with the given content\n blank(predicate, object) {\n let children = predicate, child, length;\n // Empty blank node\n if (predicate === undefined)\n children = [];\n // Blank node passed as blank(Term(\"predicate\"), Term(\"object\"))\n else if (predicate.termType)\n children = [{ predicate: predicate, object: object }];\n // Blank node passed as blank({ predicate: predicate, object: object })\n else if (!('length' in predicate))\n children = [predicate];\n\n switch (length = children.length) {\n // Generate an empty blank node\n case 0:\n return new SerializedTerm('[]');\n // Generate a non-nested one-triple blank node\n case 1:\n child = children[0];\n if (!(child.object instanceof SerializedTerm))\n return new SerializedTerm(`[ ${this._encodePredicate(child.predicate)} ${\n this._encodeObject(child.object)} ]`);\n // Generate a multi-triple or nested blank node\n default:\n let contents = '[';\n // Write all triples in order\n for (let i = 0; i < length; i++) {\n child = children[i];\n // Write only the object is the predicate is the same as the previous\n if (child.predicate.equals(predicate))\n contents += `, ${this._encodeObject(child.object)}`;\n // Otherwise, write the predicate and the object\n else {\n contents += `${(i ? ';\\n ' : '\\n ') +\n this._encodePredicate(child.predicate)} ${\n this._encodeObject(child.object)}`;\n predicate = child.predicate;\n }\n }\n return new SerializedTerm(`${contents}\\n]`);\n }\n }\n\n // ### `list` creates a list node with the given content\n list(elements) {\n const length = elements && elements.length || 0, contents = new Array(length);\n for (let i = 0; i < length; i++)\n contents[i] = this._encodeObject(elements[i]);\n return new SerializedTerm(`(${contents.join(' ')})`);\n }\n\n // ### `end` signals the end of the output stream\n end(done) {\n // Finish a possible pending quad\n if (this._subject !== null) {\n this._write(this._inDefaultGraph ? '.\\n' : '\\n}\\n');\n this._subject = null;\n }\n // Disallow further writing\n this._write = this._blockedWrite;\n\n // Try to end the underlying stream, ensuring done is called exactly one time\n let singleDone = done && ((error, result) => { singleDone = null, done(error, result); });\n if (this._endStream) {\n try { return this._outputStream.end(singleDone); }\n catch (error) { /* error closing stream */ }\n }\n singleDone && singleDone();\n }\n}\n\n// Replaces a character by its escaped version\nfunction characterReplacer(character) {\n // Replace a single character by its escaped version\n let result = escapedCharacters[character];\n if (result === undefined) {\n // Replace a single character with its 4-bit unicode escape sequence\n if (character.length === 1) {\n result = character.charCodeAt(0).toString(16);\n result = '\\\\u0000'.substr(0, 6 - result.length) + result;\n }\n // Replace a surrogate pair with its 8-bit unicode escape sequence\n else {\n result = ((character.charCodeAt(0) - 0xD800) * 0x400 +\n character.charCodeAt(1) + 0x2400).toString(16);\n result = '\\\\U00000000'.substr(0, 10 - result.length) + result;\n }\n }\n return result;\n}\n\nfunction escapeRegex(regex) {\n return regex.replace(/[\\]\\/\\(\\)\\*\\+\\?\\.\\\\\\$]/g, '\\\\$&');\n}\n","// **N3Store** objects store N3 quads by graph in memory.\nimport { Readable } from 'readable-stream';\nimport { default as N3DataFactory, termToId, termFromId } from './N3DataFactory';\nimport namespaces from './IRIs';\nimport { isDefaultGraph } from './N3Util';\nimport N3Writer from './N3Writer';\n\nconst ITERATOR = Symbol('iter');\n\nfunction merge(target, source, depth = 4) {\n if (depth === 0)\n return Object.assign(target, source);\n\n for (const key in source)\n target[key] = merge(target[key] || Object.create(null), source[key], depth - 1);\n\n return target;\n}\n\n/**\n * Determines the intersection of the `_graphs` index s1 and s2.\n * s1 and s2 *must* belong to Stores that share an `_entityIndex`.\n *\n * False is returned when there is no intersection; this should\n * *not* be set as the value for an index.\n */\nfunction intersect(s1, s2, depth = 4) {\n let target = false;\n\n for (const key in s1) {\n if (key in s2) {\n const intersection = depth === 0 ? null : intersect(s1[key], s2[key], depth - 1);\n if (intersection !== false) {\n target = target || Object.create(null);\n target[key] = intersection;\n }\n // Depth 3 is the 'subjects', 'predicates' and 'objects' keys.\n // If the 'subjects' index is empty, so will the 'predicates' and 'objects' index.\n else if (depth === 3) {\n return false;\n }\n }\n }\n\n return target;\n}\n\n/**\n * Determines the difference of the `_graphs` index s1 and s2.\n * s1 and s2 *must* belong to Stores that share an `_entityIndex`.\n *\n * False is returned when there is no difference; this should\n * *not* be set as the value for an index.\n */\nfunction difference(s1, s2, depth = 4) {\n let target = false;\n\n for (const key in s1) {\n // When the key is not in the index, then none of the triples defined by s1[key] are\n // in s2 and so we want to copy them over to the resultant store.\n if (!(key in s2)) {\n target = target || Object.create(null);\n target[key] = depth === 0 ? null : merge({}, s1[key], depth - 1);\n }\n else if (depth !== 0) {\n const diff = difference(s1[key], s2[key], depth - 1);\n if (diff !== false) {\n target = target || Object.create(null);\n target[key] = diff;\n }\n // Depth 3 is the 'subjects', 'predicates' and 'objects' keys.\n // If the 'subjects' index is empty, so will the 'predicates' and 'objects' index.\n else if (depth === 3) {\n return false;\n }\n }\n }\n\n return target;\n}\n\n// ## Constructor\nexport class N3EntityIndex {\n constructor(options = {}) {\n this._id = 1;\n // `_ids` maps entities such as `http://xmlns.com/foaf/0.1/name` to numbers,\n // saving memory by using only numbers as keys in `_graphs`\n this._ids = Object.create(null);\n this._ids[''] = 1;\n // inverse of `_ids`\n this._entities = Object.create(null);\n this._entities[1] = '';\n // `_blankNodeIndex` is the index of the last automatically named blank node\n this._blankNodeIndex = 0;\n this._factory = options.factory || N3DataFactory;\n }\n\n _termFromId(id) {\n if (id[0] === '.') {\n const entities = this._entities;\n const terms = id.split('.');\n const q = this._factory.quad(\n this._termFromId(entities[terms[1]]),\n this._termFromId(entities[terms[2]]),\n this._termFromId(entities[terms[3]]),\n terms[4] && this._termFromId(entities[terms[4]]),\n );\n return q;\n }\n return termFromId(id, this._factory);\n }\n\n _termToNumericId(term) {\n if (term.termType === 'Quad') {\n const s = this._termToNumericId(term.subject),\n p = this._termToNumericId(term.predicate),\n o = this._termToNumericId(term.object);\n let g;\n\n return s && p && o && (isDefaultGraph(term.graph) || (g = this._termToNumericId(term.graph))) &&\n this._ids[g ? `.${s}.${p}.${o}.${g}` : `.${s}.${p}.${o}`];\n }\n return this._ids[termToId(term)];\n }\n\n _termToNewNumericId(term) {\n // This assumes that no graph term is present - we may wish to error if there is one\n const str = term && term.termType === 'Quad' ?\n `.${this._termToNewNumericId(term.subject)}.${this._termToNewNumericId(term.predicate)}.${this._termToNewNumericId(term.object)}${\n isDefaultGraph(term.graph) ? '' : `.${this._termToNewNumericId(term.graph)}`\n }`\n : termToId(term);\n\n return this._ids[str] || (this._ids[this._entities[++this._id] = str] = this._id);\n }\n\n createBlankNode(suggestedName) {\n let name, index;\n // Generate a name based on the suggested name\n if (suggestedName) {\n name = suggestedName = `_:${suggestedName}`, index = 1;\n while (this._ids[name])\n name = suggestedName + index++;\n }\n // Generate a generic blank node name\n else {\n do { name = `_:b${this._blankNodeIndex++}`; }\n while (this._ids[name]);\n }\n // Add the blank node to the entities, avoiding the generation of duplicates\n this._ids[name] = ++this._id;\n this._entities[this._id] = name;\n return this._factory.blankNode(name.substr(2));\n }\n}\n\n// ## Constructor\nexport default class N3Store {\n constructor(quads, options) {\n // The number of quads is initially zero\n this._size = 0;\n // `_graphs` contains subject, predicate, and object indexes per graph\n this._graphs = Object.create(null);\n\n // Shift parameters if `quads` is not given\n if (!options && quads && !quads[0])\n options = quads, quads = null;\n options = options || {};\n this._factory = options.factory || N3DataFactory;\n this._entityIndex = options.entityIndex || new N3EntityIndex({ factory: this._factory });\n this._entities = this._entityIndex._entities;\n this._termFromId = this._entityIndex._termFromId.bind(this._entityIndex);\n this._termToNumericId = this._entityIndex._termToNumericId.bind(this._entityIndex);\n this._termToNewNumericId = this._entityIndex._termToNewNumericId.bind(this._entityIndex);\n\n // Add quads if passed\n if (quads)\n this.addQuads(quads);\n }\n\n // ## Public properties\n\n // ### `size` returns the number of quads in the store\n get size() {\n // Return the quad count if if was cached\n let size = this._size;\n if (size !== null)\n return size;\n\n // Calculate the number of quads by counting to the deepest level\n size = 0;\n const graphs = this._graphs;\n let subjects, subject;\n for (const graphKey in graphs)\n for (const subjectKey in (subjects = graphs[graphKey].subjects))\n for (const predicateKey in (subject = subjects[subjectKey]))\n size += Object.keys(subject[predicateKey]).length;\n return this._size = size;\n }\n\n // ## Private methods\n\n // ### `_addToIndex` adds a quad to a three-layered index.\n // Returns if the index has changed, if the entry did not already exist.\n _addToIndex(index0, key0, key1, key2) {\n // Create layers as necessary\n const index1 = index0[key0] || (index0[key0] = {});\n const index2 = index1[key1] || (index1[key1] = {});\n // Setting the key to _any_ value signals the presence of the quad\n const existed = key2 in index2;\n if (!existed)\n index2[key2] = null;\n return !existed;\n }\n\n // ### `_removeFromIndex` removes a quad from a three-layered index\n _removeFromIndex(index0, key0, key1, key2) {\n // Remove the quad from the index\n const index1 = index0[key0], index2 = index1[key1];\n delete index2[key2];\n\n // Remove intermediary index layers if they are empty\n for (const key in index2) return;\n delete index1[key1];\n for (const key in index1) return;\n delete index0[key0];\n }\n\n // ### `_findInIndex` finds a set of quads in a three-layered index.\n // The index base is `index0` and the keys at each level are `key0`, `key1`, and `key2`.\n // Any of these keys can be undefined, which is interpreted as a wildcard.\n // `name0`, `name1`, and `name2` are the names of the keys at each level,\n // used when reconstructing the resulting quad\n // (for instance: _subject_, _predicate_, and _object_).\n // Finally, `graphId` will be the graph of the created quads.\n *_findInIndex(index0, key0, key1, key2, name0, name1, name2, graphId) {\n let tmp, index1, index2;\n const entityKeys = this._entities;\n const graph = this._termFromId(entityKeys[graphId]);\n const parts = { subject: null, predicate: null, object: null };\n\n // If a key is specified, use only that part of index 0.\n if (key0) (tmp = index0, index0 = {})[key0] = tmp[key0];\n for (const value0 in index0) {\n if (index1 = index0[value0]) {\n parts[name0] = this._termFromId(entityKeys[value0]);\n // If a key is specified, use only that part of index 1.\n if (key1) (tmp = index1, index1 = {})[key1] = tmp[key1];\n for (const value1 in index1) {\n if (index2 = index1[value1]) {\n parts[name1] = this._termFromId(entityKeys[value1]);\n // If a key is specified, use only that part of index 2, if it exists.\n const values = key2 ? (key2 in index2 ? [key2] : []) : Object.keys(index2);\n // Create quads for all items found in index 2.\n for (let l = 0; l < values.length; l++) {\n parts[name2] = this._termFromId(entityKeys[values[l]]);\n yield this._factory.quad(parts.subject, parts.predicate, parts.object, graph);\n }\n }\n }\n }\n }\n }\n\n // ### `_loop` executes the callback on all keys of index 0\n _loop(index0, callback) {\n for (const key0 in index0)\n callback(key0);\n }\n\n // ### `_loopByKey0` executes the callback on all keys of a certain entry in index 0\n _loopByKey0(index0, key0, callback) {\n let index1, key1;\n if (index1 = index0[key0]) {\n for (key1 in index1)\n callback(key1);\n }\n }\n\n // ### `_loopByKey1` executes the callback on given keys of all entries in index 0\n _loopByKey1(index0, key1, callback) {\n let key0, index1;\n for (key0 in index0) {\n index1 = index0[key0];\n if (index1[key1])\n callback(key0);\n }\n }\n\n // ### `_loopBy2Keys` executes the callback on given keys of certain entries in index 2\n _loopBy2Keys(index0, key0, key1, callback) {\n let index1, index2, key2;\n if ((index1 = index0[key0]) && (index2 = index1[key1])) {\n for (key2 in index2)\n callback(key2);\n }\n }\n\n // ### `_countInIndex` counts matching quads in a three-layered index.\n // The index base is `index0` and the keys at each level are `key0`, `key1`, and `key2`.\n // Any of these keys can be undefined, which is interpreted as a wildcard.\n _countInIndex(index0, key0, key1, key2) {\n let count = 0, tmp, index1, index2;\n\n // If a key is specified, count only that part of index 0\n if (key0) (tmp = index0, index0 = {})[key0] = tmp[key0];\n for (const value0 in index0) {\n if (index1 = index0[value0]) {\n // If a key is specified, count only that part of index 1\n if (key1) (tmp = index1, index1 = {})[key1] = tmp[key1];\n for (const value1 in index1) {\n if (index2 = index1[value1]) {\n // If a key is specified, count the quad if it exists\n if (key2) (key2 in index2) && count++;\n // Otherwise, count all quads\n else count += Object.keys(index2).length;\n }\n }\n }\n }\n return count;\n }\n\n // ### `_getGraphs` returns an array with the given graph,\n // or all graphs if the argument is null or undefined.\n _getGraphs(graph) {\n graph = graph === '' ? 1 : (graph && (this._termToNumericId(graph) || -1));\n return typeof graph !== 'number' ? this._graphs : { [graph]: this._graphs[graph] };\n }\n\n // ### `_uniqueEntities` returns a function that accepts an entity ID\n // and passes the corresponding entity to callback if it hasn't occurred before.\n _uniqueEntities(callback) {\n const uniqueIds = Object.create(null);\n return id => {\n if (!(id in uniqueIds)) {\n uniqueIds[id] = true;\n callback(this._termFromId(this._entities[id], this._factory));\n }\n };\n }\n\n // ## Public methods\n\n // ### `add` adds the specified quad to the dataset.\n // Returns the dataset instance it was called on.\n // Existing quads, as defined in Quad.equals, will be ignored.\n add(quad) {\n this.addQuad(quad);\n return this;\n }\n\n // ### `addQuad` adds a new quad to the store.\n // Returns if the quad index has changed, if the quad did not already exist.\n addQuad(subject, predicate, object, graph) {\n // Shift arguments if a quad object is given instead of components\n if (!predicate)\n graph = subject.graph, object = subject.object,\n predicate = subject.predicate, subject = subject.subject;\n\n // Convert terms to internal string representation\n graph = graph ? this._termToNewNumericId(graph) : 1;\n\n // Find the graph that will contain the triple\n let graphItem = this._graphs[graph];\n // Create the graph if it doesn't exist yet\n if (!graphItem) {\n graphItem = this._graphs[graph] = { subjects: {}, predicates: {}, objects: {} };\n // Freezing a graph helps subsequent `add` performance,\n // and properties will never be modified anyway\n Object.freeze(graphItem);\n }\n\n // Since entities can often be long IRIs, we avoid storing them in every index.\n // Instead, we have a separate index that maps entities to numbers,\n // which are then used as keys in the other indexes.\n subject = this._termToNewNumericId(subject);\n predicate = this._termToNewNumericId(predicate);\n object = this._termToNewNumericId(object);\n\n if (!this._addToIndex(graphItem.subjects, subject, predicate, object))\n return false;\n this._addToIndex(graphItem.predicates, predicate, object, subject);\n this._addToIndex(graphItem.objects, object, subject, predicate);\n\n // The cached quad count is now invalid\n this._size = null;\n return true;\n }\n\n // ### `addQuads` adds multiple quads to the store\n addQuads(quads) {\n for (let i = 0; i < quads.length; i++)\n this.addQuad(quads[i]);\n }\n\n // ### `delete` removes the specified quad from the dataset.\n // Returns the dataset instance it was called on.\n delete(quad) {\n this.removeQuad(quad);\n return this;\n }\n\n // ### `has` determines whether a dataset includes a certain quad or quad pattern.\n has(subjectOrQuad, predicate, object, graph) {\n if (subjectOrQuad && subjectOrQuad.subject)\n ({ subject: subjectOrQuad, predicate, object, graph } = subjectOrQuad);\n return !this.readQuads(subjectOrQuad, predicate, object, graph).next().done;\n }\n\n // ### `import` adds a stream of quads to the store\n import(stream) {\n stream.on('data', quad => { this.addQuad(quad); });\n return stream;\n }\n\n // ### `removeQuad` removes a quad from the store if it exists\n removeQuad(subject, predicate, object, graph) {\n // Shift arguments if a quad object is given instead of components\n if (!predicate)\n ({ subject, predicate, object, graph } = subject);\n // Convert terms to internal string representation\n graph = graph ? this._termToNumericId(graph) : 1;\n\n // Find internal identifiers for all components\n // and verify the quad exists.\n const graphs = this._graphs;\n let graphItem, subjects, predicates;\n if (!(subject = subject && this._termToNumericId(subject)) || !(predicate = predicate && this._termToNumericId(predicate)) ||\n !(object = object && this._termToNumericId(object)) || !(graphItem = graphs[graph]) ||\n !(subjects = graphItem.subjects[subject]) ||\n !(predicates = subjects[predicate]) ||\n !(object in predicates))\n return false;\n\n // Remove it from all indexes\n this._removeFromIndex(graphItem.subjects, subject, predicate, object);\n this._removeFromIndex(graphItem.predicates, predicate, object, subject);\n this._removeFromIndex(graphItem.objects, object, subject, predicate);\n if (this._size !== null) this._size--;\n\n // Remove the graph if it is empty\n for (subject in graphItem.subjects) return true;\n delete graphs[graph];\n return true;\n }\n\n // ### `removeQuads` removes multiple quads from the store\n removeQuads(quads) {\n for (let i = 0; i < quads.length; i++)\n this.removeQuad(quads[i]);\n }\n\n // ### `remove` removes a stream of quads from the store\n remove(stream) {\n stream.on('data', quad => { this.removeQuad(quad); });\n return stream;\n }\n\n // ### `removeMatches` removes all matching quads from the store\n // Setting any field to `undefined` or `null` indicates a wildcard.\n removeMatches(subject, predicate, object, graph) {\n const stream = new Readable({ objectMode: true });\n\n const iterable = this.readQuads(subject, predicate, object, graph);\n stream._read = size => {\n while (--size >= 0) {\n const { done, value } = iterable.next();\n if (done) {\n stream.push(null);\n return;\n }\n stream.push(value);\n }\n };\n\n return this.remove(stream);\n }\n\n // ### `deleteGraph` removes all triples with the given graph from the store\n deleteGraph(graph) {\n return this.removeMatches(null, null, null, graph);\n }\n\n // ### `getQuads` returns an array of quads matching a pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n getQuads(subject, predicate, object, graph) {\n return [...this.readQuads(subject, predicate, object, graph)];\n }\n\n /**\n * `readQuads` returns a generator of quads matching a pattern.\n * Setting any field to `undefined` or `null` indicates a wildcard.\n * @deprecated Use `match` instead.\n */\n *readQuads(subject, predicate, object, graph) {\n const graphs = this._getGraphs(graph);\n let content, subjectId, predicateId, objectId;\n\n // Translate IRIs to internal index keys.\n if (subject && !(subjectId = this._termToNumericId(subject)) ||\n predicate && !(predicateId = this._termToNumericId(predicate)) ||\n object && !(objectId = this._termToNumericId(object)))\n return;\n\n for (const graphId in graphs) {\n // Only if the specified graph contains triples, there can be results\n if (content = graphs[graphId]) {\n // Choose the optimal index, based on what fields are present\n if (subjectId) {\n if (objectId)\n // If subject and object are given, the object index will be the fastest\n yield* this._findInIndex(content.objects, objectId, subjectId, predicateId,\n 'object', 'subject', 'predicate', graphId);\n else\n // If only subject and possibly predicate are given, the subject index will be the fastest\n yield* this._findInIndex(content.subjects, subjectId, predicateId, null,\n 'subject', 'predicate', 'object', graphId);\n }\n else if (predicateId)\n // If only predicate and possibly object are given, the predicate index will be the fastest\n yield* this._findInIndex(content.predicates, predicateId, objectId, null,\n 'predicate', 'object', 'subject', graphId);\n else if (objectId)\n // If only object is given, the object index will be the fastest\n yield* this._findInIndex(content.objects, objectId, null, null,\n 'object', 'subject', 'predicate', graphId);\n else\n // If nothing is given, iterate subjects and predicates first\n yield* this._findInIndex(content.subjects, null, null, null,\n 'subject', 'predicate', 'object', graphId);\n }\n }\n }\n\n // ### `match` returns a new dataset that is comprised of all quads in the current instance matching the given arguments.\n // The logic described in Quad Matching is applied for each quad in this dataset to check if it should be included in the output dataset.\n // Note: This method always returns a new DatasetCore, even if that dataset contains no quads.\n // Note: Since a DatasetCore is an unordered set, the order of the quads within the returned sequence is arbitrary.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n // For backwards compatibility, the object return also implements the Readable stream interface.\n match(subject, predicate, object, graph) {\n return new DatasetCoreAndReadableStream(this, subject, predicate, object, graph, { entityIndex: this._entityIndex });\n }\n\n // ### `countQuads` returns the number of quads matching a pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n countQuads(subject, predicate, object, graph) {\n const graphs = this._getGraphs(graph);\n let count = 0, content, subjectId, predicateId, objectId;\n\n // Translate IRIs to internal index keys.\n if (subject && !(subjectId = this._termToNumericId(subject)) ||\n predicate && !(predicateId = this._termToNumericId(predicate)) ||\n object && !(objectId = this._termToNumericId(object)))\n return 0;\n\n for (const graphId in graphs) {\n // Only if the specified graph contains triples, there can be results\n if (content = graphs[graphId]) {\n // Choose the optimal index, based on what fields are present\n if (subject) {\n if (object)\n // If subject and object are given, the object index will be the fastest\n count += this._countInIndex(content.objects, objectId, subjectId, predicateId);\n else\n // If only subject and possibly predicate are given, the subject index will be the fastest\n count += this._countInIndex(content.subjects, subjectId, predicateId, objectId);\n }\n else if (predicate) {\n // If only predicate and possibly object are given, the predicate index will be the fastest\n count += this._countInIndex(content.predicates, predicateId, objectId, subjectId);\n }\n else {\n // If only object is possibly given, the object index will be the fastest\n count += this._countInIndex(content.objects, objectId, subjectId, predicateId);\n }\n }\n }\n return count;\n }\n\n // ### `forEach` executes the callback on all quads.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n forEach(callback, subject, predicate, object, graph) {\n this.some(quad => {\n callback(quad, this);\n return false;\n }, subject, predicate, object, graph);\n }\n\n // ### `every` executes the callback on all quads,\n // and returns `true` if it returns truthy for all them.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n every(callback, subject, predicate, object, graph) {\n return !this.some(quad => !callback(quad, this), subject, predicate, object, graph);\n }\n\n // ### `some` executes the callback on all quads,\n // and returns `true` if it returns truthy for any of them.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n some(callback, subject, predicate, object, graph) {\n for (const quad of this.readQuads(subject, predicate, object, graph))\n if (callback(quad))\n return true;\n return false;\n }\n\n // ### `getSubjects` returns all subjects that match the pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n getSubjects(predicate, object, graph) {\n const results = [];\n this.forSubjects(s => { results.push(s); }, predicate, object, graph);\n return results;\n }\n\n // ### `forSubjects` executes the callback on all subjects that match the pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n forSubjects(callback, predicate, object, graph) {\n const graphs = this._getGraphs(graph);\n let content, predicateId, objectId;\n callback = this._uniqueEntities(callback);\n\n // Translate IRIs to internal index keys.\n if (predicate && !(predicateId = this._termToNumericId(predicate)) ||\n object && !(objectId = this._termToNumericId(object)))\n return;\n\n for (graph in graphs) {\n // Only if the specified graph contains triples, there can be results\n if (content = graphs[graph]) {\n // Choose optimal index based on which fields are wildcards\n if (predicateId) {\n if (objectId)\n // If predicate and object are given, the POS index is best.\n this._loopBy2Keys(content.predicates, predicateId, objectId, callback);\n else\n // If only predicate is given, the SPO index is best.\n this._loopByKey1(content.subjects, predicateId, callback);\n }\n else if (objectId)\n // If only object is given, the OSP index is best.\n this._loopByKey0(content.objects, objectId, callback);\n else\n // If no params given, iterate all the subjects\n this._loop(content.subjects, callback);\n }\n }\n }\n\n // ### `getPredicates` returns all predicates that match the pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n getPredicates(subject, object, graph) {\n const results = [];\n this.forPredicates(p => { results.push(p); }, subject, object, graph);\n return results;\n }\n\n // ### `forPredicates` executes the callback on all predicates that match the pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n forPredicates(callback, subject, object, graph) {\n const graphs = this._getGraphs(graph);\n let content, subjectId, objectId;\n callback = this._uniqueEntities(callback);\n\n // Translate IRIs to internal index keys.\n if (subject && !(subjectId = this._termToNumericId(subject)) ||\n object && !(objectId = this._termToNumericId(object)))\n return;\n\n for (graph in graphs) {\n // Only if the specified graph contains triples, there can be results\n if (content = graphs[graph]) {\n // Choose optimal index based on which fields are wildcards\n if (subjectId) {\n if (objectId)\n // If subject and object are given, the OSP index is best.\n this._loopBy2Keys(content.objects, objectId, subjectId, callback);\n else\n // If only subject is given, the SPO index is best.\n this._loopByKey0(content.subjects, subjectId, callback);\n }\n else if (objectId)\n // If only object is given, the POS index is best.\n this._loopByKey1(content.predicates, objectId, callback);\n else\n // If no params given, iterate all the predicates.\n this._loop(content.predicates, callback);\n }\n }\n }\n\n // ### `getObjects` returns all objects that match the pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n getObjects(subject, predicate, graph) {\n const results = [];\n this.forObjects(o => { results.push(o); }, subject, predicate, graph);\n return results;\n }\n\n // ### `forObjects` executes the callback on all objects that match the pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n forObjects(callback, subject, predicate, graph) {\n const graphs = this._getGraphs(graph);\n let content, subjectId, predicateId;\n callback = this._uniqueEntities(callback);\n\n // Translate IRIs to internal index keys.\n if (subject && !(subjectId = this._termToNumericId(subject)) ||\n predicate && !(predicateId = this._termToNumericId(predicate)))\n return;\n\n for (graph in graphs) {\n // Only if the specified graph contains triples, there can be results\n if (content = graphs[graph]) {\n // Choose optimal index based on which fields are wildcards\n if (subjectId) {\n if (predicateId)\n // If subject and predicate are given, the SPO index is best.\n this._loopBy2Keys(content.subjects, subjectId, predicateId, callback);\n else\n // If only subject is given, the OSP index is best.\n this._loopByKey1(content.objects, subjectId, callback);\n }\n else if (predicateId)\n // If only predicate is given, the POS index is best.\n this._loopByKey0(content.predicates, predicateId, callback);\n else\n // If no params given, iterate all the objects.\n this._loop(content.objects, callback);\n }\n }\n }\n\n // ### `getGraphs` returns all graphs that match the pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n getGraphs(subject, predicate, object) {\n const results = [];\n this.forGraphs(g => { results.push(g); }, subject, predicate, object);\n return results;\n }\n\n // ### `forGraphs` executes the callback on all graphs that match the pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n forGraphs(callback, subject, predicate, object) {\n for (const graph in this._graphs) {\n this.some(quad => {\n callback(quad.graph);\n return true; // Halt iteration of some()\n }, subject, predicate, object, this._termFromId(this._entities[graph]));\n }\n }\n\n // ### `createBlankNode` creates a new blank node, returning its name\n createBlankNode(suggestedName) {\n return this._entityIndex.createBlankNode(suggestedName);\n }\n\n // ### `extractLists` finds and removes all list triples\n // and returns the items per list.\n extractLists({ remove = false, ignoreErrors = false } = {}) {\n const lists = {}; // has scalar keys so could be a simple Object\n const onError = ignoreErrors ? (() => true) :\n ((node, message) => { throw new Error(`${node.value} ${message}`); });\n\n // Traverse each list from its tail\n const tails = this.getQuads(null, namespaces.rdf.rest, namespaces.rdf.nil, null);\n const toRemove = remove ? [...tails] : [];\n tails.forEach(tailQuad => {\n const items = []; // the members found as objects of rdf:first quads\n let malformed = false; // signals whether the current list is malformed\n let head; // the head of the list (_:b1 in above example)\n let headPos; // set to subject or object when head is set\n const graph = tailQuad.graph; // make sure list is in exactly one graph\n\n // Traverse the list from tail to end\n let current = tailQuad.subject;\n while (current && !malformed) {\n const objectQuads = this.getQuads(null, null, current, null);\n const subjectQuads = this.getQuads(current, null, null, null);\n let quad, first = null, rest = null, parent = null;\n\n // Find the first and rest of this list node\n for (let i = 0; i < subjectQuads.length && !malformed; i++) {\n quad = subjectQuads[i];\n if (!quad.graph.equals(graph))\n malformed = onError(current, 'not confined to single graph');\n else if (head)\n malformed = onError(current, 'has non-list arcs out');\n\n // one rdf:first\n else if (quad.predicate.value === namespaces.rdf.first) {\n if (first)\n malformed = onError(current, 'has multiple rdf:first arcs');\n else\n toRemove.push(first = quad);\n }\n\n // one rdf:rest\n else if (quad.predicate.value === namespaces.rdf.rest) {\n if (rest)\n malformed = onError(current, 'has multiple rdf:rest arcs');\n else\n toRemove.push(rest = quad);\n }\n\n // alien triple\n else if (objectQuads.length)\n malformed = onError(current, 'can\\'t be subject and object');\n else {\n head = quad; // e.g. { (1 2 3) :p :o }\n headPos = 'subject';\n }\n }\n\n // { :s :p (1 2) } arrives here with no head\n // { (1 2) :p :o } arrives here with head set to the list.\n for (let i = 0; i < objectQuads.length && !malformed; ++i) {\n quad = objectQuads[i];\n if (head)\n malformed = onError(current, 'can\\'t have coreferences');\n // one rdf:rest\n else if (quad.predicate.value === namespaces.rdf.rest) {\n if (parent)\n malformed = onError(current, 'has incoming rdf:rest arcs');\n else\n parent = quad;\n }\n else {\n head = quad; // e.g. { :s :p (1 2) }\n headPos = 'object';\n }\n }\n\n // Store the list item and continue with parent\n if (!first)\n malformed = onError(current, 'has no list head');\n else\n items.unshift(first.object);\n current = parent && parent.subject;\n }\n\n // Don't remove any quads if the list is malformed\n if (malformed)\n remove = false;\n // Store the list under the value of its head\n else if (head)\n lists[head[headPos].value] = items;\n });\n\n // Remove list quads if requested\n if (remove)\n this.removeQuads(toRemove);\n return lists;\n }\n\n /**\n * Returns `true` if the current dataset is a superset of the given dataset; in other words, returns `true` if\n * the given dataset is a subset of, i.e., is contained within, the current dataset.\n *\n * Blank Nodes will be normalized.\n */\n addAll(quads) {\n if (quads instanceof DatasetCoreAndReadableStream)\n quads = quads.filtered;\n\n if (Array.isArray(quads))\n this.addQuads(quads);\n else if (quads instanceof N3Store && quads._entityIndex === this._entityIndex) {\n if (quads._size !== 0) {\n this._graphs = merge(this._graphs, quads._graphs);\n this._size = null; // Invalidate the cached size\n }\n }\n else {\n for (const quad of quads)\n this.add(quad);\n }\n return this;\n }\n\n /**\n * Returns `true` if the current dataset is a superset of the given dataset; in other words, returns `true` if\n * the given dataset is a subset of, i.e., is contained within, the current dataset.\n *\n * Blank Nodes will be normalized.\n */\n contains(other) {\n if (other instanceof DatasetCoreAndReadableStream)\n other = other.filtered;\n\n if (other === this)\n return true;\n\n if (!(other instanceof N3Store) || this._entityIndex !== other._entityIndex)\n return other.every(quad => this.has(quad));\n\n const g1 = this._graphs, g2 = other._graphs;\n let s1, s2, p1, p2, o1;\n for (const graph in g2) {\n if (!(s1 = g1[graph])) return false;\n s1 = s1.subjects;\n for (const subject in (s2 = g2[graph].subjects)) {\n if (!(p1 = s1[subject])) return false;\n for (const predicate in (p2 = s2[subject])) {\n if (!(o1 = p1[predicate])) return false;\n for (const object in p2[predicate])\n if (!(object in o1)) return false;\n }\n }\n }\n return true;\n }\n\n /**\n * This method removes the quads in the current dataset that match the given arguments.\n *\n * The logic described in {@link https://rdf.js.org/dataset-spec/#quad-matching|Quad Matching} is applied for each\n * quad in this dataset, to select the quads which will be deleted.\n *\n * @param subject The optional exact subject to match.\n * @param predicate The optional exact predicate to match.\n * @param object The optional exact object to match.\n * @param graph The optional exact graph to match.\n */\n deleteMatches(subject, predicate, object, graph) {\n for (const quad of this.match(subject, predicate, object, graph))\n this.removeQuad(quad);\n return this;\n }\n\n /**\n * Returns a new dataset that contains all quads from the current dataset that are not included in the given dataset.\n */\n difference(other) {\n if (other && other instanceof DatasetCoreAndReadableStream)\n other = other.filtered;\n\n if (other === this)\n return new N3Store({ entityIndex: this._entityIndex });\n\n if ((other instanceof N3Store) && other._entityIndex === this._entityIndex) {\n const store = new N3Store({ entityIndex: this._entityIndex });\n const graphs = difference(this._graphs, other._graphs);\n if (graphs) {\n store._graphs = graphs;\n store._size = null;\n }\n return store;\n }\n\n return this.filter(quad => !other.has(quad));\n }\n\n /**\n * Returns true if the current dataset contains the same graph structure as the given dataset.\n *\n * Blank Nodes will be normalized.\n */\n equals(other) {\n if (other instanceof DatasetCoreAndReadableStream)\n other = other.filtered;\n\n return other === this || (this.size === other.size && this.contains(other));\n }\n\n /**\n * Creates a new dataset with all the quads that pass the test implemented by the provided `iteratee`.\n *\n * This method is aligned with Array.prototype.filter() in ECMAScript-262.\n */\n filter(iteratee) {\n const store = new N3Store({ entityIndex: this._entityIndex });\n for (const quad of this)\n if (iteratee(quad, this))\n store.add(quad);\n return store;\n }\n\n /**\n * Returns a new dataset containing all quads from the current dataset that are also included in the given dataset.\n */\n intersection(other) {\n if (other instanceof DatasetCoreAndReadableStream)\n other = other.filtered;\n\n if (other === this) {\n const store = new N3Store({ entityIndex: this._entityIndex });\n store._graphs = merge(Object.create(null), this._graphs);\n store._size = this._size;\n return store;\n }\n else if ((other instanceof N3Store) && this._entityIndex === other._entityIndex) {\n const store = new N3Store({ entityIndex: this._entityIndex });\n const graphs = intersect(other._graphs, this._graphs);\n if (graphs) {\n store._graphs = graphs;\n store._size = null;\n }\n return store;\n }\n\n return this.filter(quad => other.has(quad));\n }\n\n /**\n * Returns a new dataset containing all quads returned by applying `iteratee` to each quad in the current dataset.\n */\n map(iteratee) {\n const store = new N3Store({ entityIndex: this._entityIndex });\n for (const quad of this)\n store.add(iteratee(quad, this));\n return store;\n }\n\n /**\n * This method calls the `iteratee` method on each `quad` of the `Dataset`. The first time the `iteratee` method\n * is called, the `accumulator` value is the `initialValue`, or, if not given, equals the first quad of the `Dataset`.\n * The return value of each call to the `iteratee` method is used as the `accumulator` value for the next call.\n *\n * This method returns the return value of the last `iteratee` call.\n *\n * This method is aligned with `Array.prototype.reduce()` in ECMAScript-262.\n */\n reduce(callback, initialValue) {\n const iter = this.readQuads();\n let accumulator = initialValue === undefined ? iter.next().value : initialValue;\n for (const quad of iter)\n accumulator = callback(accumulator, quad, this);\n return accumulator;\n }\n\n /**\n * Returns the set of quads within the dataset as a host-language-native sequence, for example an `Array` in\n * ECMAScript-262.\n *\n * Since a `Dataset` is an unordered set, the order of the quads within the returned sequence is arbitrary.\n */\n toArray() {\n return this.getQuads();\n }\n\n /**\n * Returns an N-Quads string representation of the dataset, preprocessed with the\n * {@link https://json-ld.github.io/normalization/spec/|RDF Dataset Normalization} algorithm.\n */\n toCanonical() {\n throw new Error('not implemented');\n }\n\n /**\n * Returns a stream that contains all quads of the dataset.\n */\n toStream() {\n return this.match();\n }\n\n /**\n * Returns an N-Quads string representation of the dataset.\n *\n * No prior normalization is required, therefore the results for the same quads may vary depending on the `Dataset`\n * implementation.\n */\n toString() {\n return (new N3Writer()).quadsToString(this);\n }\n\n /**\n * Returns a new `Dataset` that is a concatenation of this dataset and the quads given as an argument.\n */\n union(quads) {\n const store = new N3Store({ entityIndex: this._entityIndex });\n store._graphs = merge(Object.create(null), this._graphs);\n store._size = this._size;\n\n store.addAll(quads);\n return store;\n }\n\n // ### Store is an iterable.\n // Can be used where iterables are expected: for...of loops, array spread operator,\n // `yield*`, and destructuring assignment (order is not guaranteed).\n *[Symbol.iterator]() {\n yield* this.readQuads();\n }\n}\n\n/**\n * Returns a subset of the `index` with that part of the index\n * matching the `ids` array. `ids` contains 3 elements that are\n * either numerical ids; or `null`.\n *\n * `false` is returned when there are no matching indices; this should\n * *not* be set as the value for an index.\n */\nfunction indexMatch(index, ids, depth = 0) {\n const ind = ids[depth];\n if (ind && !(ind in index))\n return false;\n\n let target = false;\n for (const key in (ind ? { [ind]: index[ind] } : index)) {\n const result = depth === 2 ? null : indexMatch(index[key], ids, depth + 1);\n\n if (result !== false) {\n target = target || Object.create(null);\n target[key] = result;\n }\n }\n return target;\n}\n\n/**\n * A class that implements both DatasetCore and Readable.\n */\nclass DatasetCoreAndReadableStream extends Readable {\n constructor(n3Store, subject, predicate, object, graph, options) {\n super({ objectMode: true });\n Object.assign(this, { n3Store, subject, predicate, object, graph, options });\n }\n\n get filtered() {\n if (!this._filtered) {\n const { n3Store, graph, object, predicate, subject } = this;\n const newStore = this._filtered = new N3Store({ factory: n3Store._factory, entityIndex: this.options.entityIndex });\n\n let subjectId, predicateId, objectId;\n\n // Translate IRIs to internal index keys.\n if (subject && !(subjectId = newStore._termToNumericId(subject)) ||\n predicate && !(predicateId = newStore._termToNumericId(predicate)) ||\n object && !(objectId = newStore._termToNumericId(object)))\n return newStore;\n\n const graphs = n3Store._getGraphs(graph);\n for (const graphKey in graphs) {\n let subjects, predicates, objects;\n\n if (!subjectId && predicateId) {\n if (predicates = indexMatch(graphs[graphKey].predicates, [predicateId, objectId, subjectId])) {\n subjects = indexMatch(graphs[graphKey].subjects, [subjectId, predicateId, objectId]);\n objects = indexMatch(graphs[graphKey].objects, [objectId, subjectId, predicateId]);\n }\n }\n else if (objectId) {\n if (objects = indexMatch(graphs[graphKey].objects, [objectId, subjectId, predicateId])) {\n subjects = indexMatch(graphs[graphKey].subjects, [subjectId, predicateId, objectId]);\n predicates = indexMatch(graphs[graphKey].predicates, [predicateId, objectId, subjectId]);\n }\n }\n else if (subjects = indexMatch(graphs[graphKey].subjects, [subjectId, predicateId, objectId])) {\n predicates = indexMatch(graphs[graphKey].predicates, [predicateId, objectId, subjectId]);\n objects = indexMatch(graphs[graphKey].objects, [objectId, subjectId, predicateId]);\n }\n\n if (subjects)\n newStore._graphs[graphKey] = { subjects, predicates, objects };\n }\n newStore._size = null;\n }\n return this._filtered;\n }\n\n get size() {\n return this.filtered.size;\n }\n\n _read(size) {\n if (size > 0 && !this[ITERATOR])\n this[ITERATOR] = this[Symbol.iterator]();\n const iterable = this[ITERATOR];\n while (--size >= 0) {\n const { done, value } = iterable.next();\n if (done) {\n this.push(null);\n return;\n }\n this.push(value);\n }\n }\n\n addAll(quads) {\n return this.filtered.addAll(quads);\n }\n\n contains(other) {\n return this.filtered.contains(other);\n }\n\n deleteMatches(subject, predicate, object, graph) {\n return this.filtered.deleteMatches(subject, predicate, object, graph);\n }\n\n difference(other) {\n return this.filtered.difference(other);\n }\n\n equals(other) {\n return this.filtered.equals(other);\n }\n\n every(callback, subject, predicate, object, graph) {\n return this.filtered.every(callback, subject, predicate, object, graph);\n }\n\n filter(iteratee) {\n return this.filtered.filter(iteratee);\n }\n\n forEach(callback, subject, predicate, object, graph) {\n return this.filtered.forEach(callback, subject, predicate, object, graph);\n }\n\n import(stream) {\n return this.filtered.import(stream);\n }\n\n intersection(other) {\n return this.filtered.intersection(other);\n }\n\n map(iteratee) {\n return this.filtered.map(iteratee);\n }\n\n some(callback, subject, predicate, object, graph) {\n return this.filtered.some(callback, subject, predicate, object, graph);\n }\n\n toCanonical() {\n return this.filtered.toCanonical();\n }\n\n toStream() {\n return this._filtered ?\n this._filtered.toStream()\n : this.n3Store.match(this.subject, this.predicate, this.object, this.graph);\n }\n\n union(quads) {\n return this._filtered ?\n this._filtered.union(quads)\n : this.n3Store.match(this.subject, this.predicate, this.object, this.graph).addAll(quads);\n }\n\n toArray() {\n return this._filtered ? this._filtered.toArray() : this.n3Store.getQuads(this.subject, this.predicate, this.object, this.graph);\n }\n\n reduce(callback, initialValue) {\n return this.filtered.reduce(callback, initialValue);\n }\n\n toString() {\n return (new N3Writer()).quadsToString(this);\n }\n\n add(quad) {\n return this.filtered.add(quad);\n }\n\n delete(quad) {\n return this.filtered.delete(quad);\n }\n\n has(quad) {\n return this.filtered.has(quad);\n }\n\n match(subject, predicate, object, graph) {\n return new DatasetCoreAndReadableStream(this.filtered, subject, predicate, object, graph, this.options);\n }\n\n *[Symbol.iterator]() {\n yield* this._filtered || this.n3Store.readQuads(this.subject, this.predicate, this.object, this.graph);\n }\n}\n","import N3Store from './N3Store';\n\nexport default class N3DatasetCoreFactory {\n dataset(quads) {\n return new N3Store(quads);\n }\n}\n","import DF from './N3DataFactory';\n\n/**\n * Gets rules from a dataset. This will only collect horn rules declared using log:implies.\n */\nexport function getRulesFromDataset(dataset) {\n const rules = [];\n for (const { subject, object } of dataset.match(null, DF.namedNode('http://www.w3.org/2000/10/swap/log#implies'), null, DF.defaultGraph())) {\n const premise = [...dataset.match(null, null, null, subject)];\n const conclusion = [...dataset.match(null, null, null, object)];\n rules.push({ premise, conclusion });\n }\n return rules;\n}\n\nexport default class N3Reasoner {\n constructor(store) {\n this._store = store;\n }\n\n _add(subject, predicate, object, graphItem, cb) {\n // Only add to the remaining indexes if there is not already a value in the index\n if (!this._store._addToIndex(graphItem.subjects, subject, predicate, object)) return;\n this._store._addToIndex(graphItem.predicates, predicate, object, subject);\n this._store._addToIndex(graphItem.objects, object, subject, predicate);\n cb();\n }\n\n // eslint-disable-next-line no-warning-comments\n _evaluatePremise(rule, content, cb, i = 0) {\n let v1, v2, value, index1, index2;\n const [val0, val1, val2] = rule.premise[i].value, index = content[rule.premise[i].content];\n const v0 = !(value = val0.value);\n for (value in v0 ? index : { [value]: index[value] }) {\n if (index1 = index[value]) {\n if (v0) val0.value = Number(value);\n v1 = !(value = val1.value);\n for (value in v1 ? index1 : { [value]: index1[value] }) {\n if (index2 = index1[value]) {\n if (v1) val1.value = Number(value);\n v2 = !(value = val2.value);\n for (value in v2 ? index2 : { [value]: index2[value] }) {\n if (v2) val2.value = Number(value);\n\n if (i === rule.premise.length - 1)\n rule.conclusion.forEach(c => {\n // eslint-disable-next-line max-nested-callbacks\n this._add(c.subject.value, c.predicate.value, c.object.value, content, () => { cb(c); });\n });\n else\n this._evaluatePremise(rule, content, cb, i + 1);\n }\n if (v2) val2.value = null;\n }\n }\n if (v1) val1.value = null;\n }\n }\n if (v0) val0.value = null;\n }\n\n _evaluateRules(rules, content, cb) {\n for (let i = 0; i < rules.length; i++) {\n this._evaluatePremise(rules[i], content, cb);\n }\n }\n\n // A naive reasoning algorithm where rules are just applied by repeatedly applying rules\n // until no more evaluations are made\n _reasonGraphNaive(rules, content) {\n const newRules = [];\n\n function addRule(conclusion) {\n if (conclusion.next)\n conclusion.next.forEach(rule => {\n newRules.push([conclusion.subject.value, conclusion.predicate.value, conclusion.object.value, rule]);\n });\n }\n\n // eslint-disable-next-line func-style\n const addConclusions = conclusion => {\n conclusion.forEach(c => {\n // eslint-disable-next-line max-nested-callbacks\n this._add(c.subject.value, c.predicate.value, c.object.value, content, () => { addRule(c); });\n });\n };\n\n this._evaluateRules(rules, content, addRule);\n\n let r;\n while ((r = newRules.pop()) !== undefined) {\n const [subject, predicate, object, rule] = r;\n const v1 = rule.basePremise.subject.value;\n if (!v1) rule.basePremise.subject.value = subject;\n const v2 = rule.basePremise.predicate.value;\n if (!v2) rule.basePremise.predicate.value = predicate;\n const v3 = rule.basePremise.object.value;\n if (!v3) rule.basePremise.object.value = object;\n\n if (rule.premise.length === 0) {\n addConclusions(rule.conclusion);\n }\n else {\n this._evaluatePremise(rule, content, addRule);\n }\n\n if (!v1) rule.basePremise.subject.value = null;\n if (!v2) rule.basePremise.predicate.value = null;\n if (!v3) rule.basePremise.object.value = null;\n }\n }\n\n _createRule({ premise, conclusion }) {\n const varMapping = {};\n\n const toId = value => value.termType === 'Variable' ?\n // If the term is a variable, then create an empty object that values can be placed into\n (varMapping[value.value] = varMapping[value.value] || {}) :\n // If the term is not a variable, then set the ID value\n { value: this._store._termToNewNumericId(value) };\n\n // eslint-disable-next-line func-style\n const t = term => ({ subject: toId(term.subject), predicate: toId(term.predicate), object: toId(term.object) });\n\n return {\n premise: premise.map(p => t(p)),\n conclusion: conclusion.map(p => t(p)),\n variables: Object.values(varMapping),\n };\n }\n\n reason(rules) {\n if (!Array.isArray(rules)) {\n rules = getRulesFromDataset(rules);\n }\n rules = rules.map(rule => this._createRule(rule));\n\n for (const r1 of rules) {\n for (const r2 of rules) {\n for (let i = 0; i < r2.premise.length; i++) {\n const p = r2.premise[i];\n for (const c of r1.conclusion) {\n if (termEq(p.subject, c.subject) && termEq(p.predicate, c.predicate) && termEq(p.object, c.object)) {\n const set = new Set();\n\n const premise = [];\n\n // Since these *will* be substituted when we apply the rule,\n // we need to do this, so that we index correctly in the subsequent section\n p.subject.value = p.subject.value || 1;\n p.object.value = p.object.value || 1;\n p.predicate.value = p.predicate.value || 1;\n\n for (let j = 0; j < r2.premise.length; j++) {\n if (j !== i) {\n premise.push(getIndex(r2.premise[j], set));\n }\n }\n\n // eslint-disable-next-line no-warning-comments\n // TODO: Create new rule, with new indexing\n // Future, 'collapse' the next statements when they share a premise/base-premise\n (c.next = c.next || []).push({\n premise,\n conclusion: r2.conclusion,\n // This is a single premise of the form { subject, predicate, object },\n // which we can use to instantiate the rule using the new data that was emitted\n basePremise: p,\n });\n }\n r2.variables.forEach(v => { v.value = null; });\n }\n }\n }\n }\n\n for (const rule of rules) {\n const set = new Set();\n rule.premise = rule.premise.map(p => getIndex(p, set));\n }\n\n const graphs = this._store._getGraphs();\n for (const graphId in graphs) {\n this._reasonGraphNaive(rules, graphs[graphId]);\n }\n\n this._store._size = null;\n }\n}\n\nfunction getIndex({ subject, predicate, object }, set) {\n const s = subject.value || set.has(subject) || (set.add(subject), false);\n const p = predicate.value || set.has(predicate) || (set.add(predicate), false);\n const o = object.value || set.has(object) || (set.add(object), false);\n\n return (!s && p) ? { content: 'predicates', value: [predicate, object, subject] } :\n o ? { content: 'objects', value: [object, subject, predicate] } :\n { content: 'subjects', value: [subject, predicate, object] };\n}\n\nfunction termEq(t1, t2) {\n if (t1.value === null) {\n t1.value = t2.value;\n }\n return t1.value === t2.value;\n}\n","// **N3StreamWriter** serializes a quad stream into a text stream.\nimport { Transform } from 'readable-stream';\nimport N3Writer from './N3Writer';\n\n// ## Constructor\nexport default class N3StreamWriter extends Transform {\n constructor(options) {\n super({ encoding: 'utf8', writableObjectMode: true });\n\n // Set up writer with a dummy stream object\n const writer = this._writer = new N3Writer({\n write: (quad, encoding, callback) => { this.push(quad); callback && callback(); },\n end: callback => { this.push(null); callback && callback(); },\n }, options);\n\n // Implement Transform methods on top of writer\n this._transform = (quad, encoding, done) => { writer.addQuad(quad, done); };\n this._flush = done => { writer.end(done); };\n }\n\n// ### Serializes a stream of quads\n import(stream) {\n stream.on('data', quad => { this.write(quad); });\n stream.on('end', () => { this.end(); });\n stream.on('error', error => { this.emit('error', error); });\n stream.on('prefix', (prefix, iri) => { this._writer.addPrefix(prefix, iri); });\n return this;\n }\n}\n","import Lexer from './N3Lexer';\nimport Parser from './N3Parser';\nimport Writer from './N3Writer';\nimport Store, { N3EntityIndex as EntityIndex } from './N3Store';\nimport StoreFactory from './N3StoreFactory';\nimport Reasoner, { getRulesFromDataset } from './N3Reasoner';\nimport StreamParser from './N3StreamParser';\nimport StreamWriter from './N3StreamWriter';\nimport * as Util from './N3Util';\n\nimport {\n default as DataFactory,\n\n Term,\n NamedNode,\n Literal,\n BlankNode,\n Variable,\n DefaultGraph,\n Quad,\n Triple,\n\n termFromId,\n termToId,\n} from './N3DataFactory';\n\n// Named exports\nexport {\n Lexer,\n Parser,\n Writer,\n Store,\n StoreFactory,\n EntityIndex,\n StreamParser,\n StreamWriter,\n Util,\n Reasoner,\n\n DataFactory,\n\n Term,\n NamedNode,\n Literal,\n BlankNode,\n Variable,\n DefaultGraph,\n Quad,\n Triple,\n\n termFromId,\n termToId,\n getRulesFromDataset,\n};\n\n// Export all named exports as a default object for backward compatibility\nexport default {\n Lexer,\n Parser,\n Writer,\n Store,\n StoreFactory,\n EntityIndex,\n StreamParser,\n StreamWriter,\n Util,\n Reasoner,\n\n DataFactory,\n\n Term,\n NamedNode,\n Literal,\n BlankNode,\n Variable,\n DefaultGraph,\n Quad,\n Triple,\n\n termFromId,\n termToId,\n};\n","const { finished, Readable } = require('readable-stream')\n\nfunction nextLoop () {\n return new Promise(resolve => setTimeout(resolve, 0))\n}\n\nclass ReadableToReadable extends Readable {\n constructor (input, { end = true, map, ...args } = {}) {\n super({\n read: ReadableToReadable.readFrom(input, { end, map }),\n ...args\n })\n }\n\n static readFrom (input, { end = true, map = v => v } = {}) {\n let done = false\n\n finished(input, () => {\n done = true\n })\n\n const read = async function () {\n while (true) {\n const chunk = input.read()\n\n if (!chunk) {\n if (done && end) {\n this.push(null)\n }\n\n if (done) {\n return true\n }\n\n await nextLoop()\n } else {\n if (!this.push(map(chunk))) {\n return false\n }\n }\n }\n }\n\n return read\n }\n}\n\nmodule.exports = ReadableToReadable\n"],"names":["ParserStream","Sink","Parser","constructor","options","super","module","exports","N3","rdf","finished","ReadableToReadable","input","baseIRI","factory","parser","StreamParser","objectMode","on","prefix","term","this","emit","err","destroy","end","pipe","DataFactory","BlankNode","id","value","nextId","equals","other","termType","prototype","DefaultGraph","fromTermRaw","Literal","NamedNode","Quad","Variable","namedNode","blankNode","literal","languageOrDatatype","indexOf","variable","defaultGraph","defaultGraphInstance","triple","subject","predicate","object","quad","graph","fromTerm","original","call","fromQuad","language","datatype","stringDatatype","langStringDatatype","iri","name","Error","Impl","import","output","Object","assign","readable","isNamedNode","isBlankNode","isLiteral","isVariable","isDefaultGraph","inDefaultGraph","prefixes","defaultPrefixes","create","processPrefix","cache","local","N3DataFactory","DEFAULTGRAPH","xsd","escapeAll","escapedCharacters","SerializedTerm","N3Writer","outputStream","_prefixRegex","write","_lists","lists","_outputStream","_endStream","undefined","chunk","encoding","done","_subject","test","format","_lineMode","_writeQuad","_writeQuadLine","_graph","_prefixIRIs","addPrefixes","_baseMatcher","RegExp","escapeRegex","endsWith","_baseLength","length","_inDefaultGraph","_write","string","callback","_encodeIriOrBlank","_predicate","_encodeObject","_encodePredicate","_encodeSubject","error","_prefixMatch","quadToString","quadsToString","quads","quadsString","entity","_encodeQuad","list","substr","replace","characterReplacer","prefixMatch","exec","_encodeLiteral","boolean","integer","decimal","double","type","_blockedWrite","addQuad","addQuads","i","addPrefix","hasPrefixes","IRIlist","prefixList","prefixIRI","blank","child","children","contents","elements","Array","join","singleDone","result","character","charCodeAt","toString","regex","ITERATOR","Symbol","merge","target","source","depth","key","intersect","s1","s2","intersection","difference","diff","N3EntityIndex","_id","_ids","_entities","_blankNodeIndex","_factory","_termFromId","entities","terms","split","q","_termToNumericId","s","p","o","g","_termToNewNumericId","str","createBlankNode","suggestedName","index","N3Store","_size","_graphs","_entityIndex","entityIndex","bind","size","graphs","subjects","graphKey","subjectKey","predicateKey","keys","_addToIndex","index0","key0","key1","key2","index1","index2","existed","_removeFromIndex","_findInIndex","name0","name1","name2","graphId","tmp","entityKeys","parts","value0","value1","values","l","_loop","_loopByKey0","_loopByKey1","_loopBy2Keys","_countInIndex","count","_getGraphs","_uniqueEntities","uniqueIds","add","graphItem","predicates","objects","freeze","removeQuad","has","subjectOrQuad","readQuads","next","stream","removeQuads","remove","removeMatches","Readable","iterable","_read","push","deleteGraph","getQuads","content","subjectId","predicateId","objectId","match","DatasetCoreAndReadableStream","countQuads","forEach","some","every","getSubjects","results","forSubjects","getPredicates","forPredicates","getObjects","forObjects","getGraphs","forGraphs","extractLists","ignoreErrors","onError","node","message","tails","rest","nil","toRemove","tailQuad","items","head","headPos","malformed","current","objectQuads","subjectQuads","first","parent","unshift","addAll","filtered","isArray","contains","g1","g2","p1","p2","o1","deleteMatches","store","filter","iteratee","map","reduce","initialValue","iter","accumulator","toArray","toCanonical","toStream","union","iterator","indexMatch","ids","ind","n3Store","_filtered","newStore","delete","N3DatasetCoreFactory","dataset","getRulesFromDataset","rules","premise","conclusion","N3Reasoner","_store","_add","cb","_evaluatePremise","rule","v1","v2","val0","val1","val2","v0","Number","c","_evaluateRules","_reasonGraphNaive","newRules","addRule","addConclusions","r","pop","basePremise","v3","_createRule","varMapping","toId","t","variables","reason","r1","r2","termEq","set","Set","j","getIndex","v","t1","t2","N3StreamWriter","Transform","writableObjectMode","writer","_writer","_transform","_flush","Lexer","Writer","Store","StoreFactory","EntityIndex","StreamWriter","Util","Reasoner","Term","Triple","termFromId","termToId","nextLoop","Promise","resolve","setTimeout","args","read","readFrom","async"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/208.e089da2b.js b/dist/js/208.e089da2b.js deleted file mode 100644 index be37074..0000000 --- a/dist/js/208.e089da2b.js +++ /dev/null @@ -1,2 +0,0 @@ -(self["webpackChunkmobilitydcatap_ui"]=self["webpackChunkmobilitydcatap_ui"]||[]).push([[208],{92208:function(e,t,r){const n=r(77761),a=r(19488);class s extends a{constructor(e){super(n,e)}}e.exports=s},77761:function(e,t,r){const n=r(44564),a=r(59080),{finished:s}=r(28399),o=r(75984);class u extends o{constructor(e,{baseIRI:t="",factory:r=a}={}){const o=new n.StreamParser({baseIRI:t,factory:r});super(o,{objectMode:!0}),o.on("prefix",((e,t)=>{this.emit("prefix",e,t)})),o.on("error",(e=>{this.destroy(e)})),s(this,(()=>{o.end()})),e.pipe(o)}}e.exports=u},59080:function(e,t,r){const n=r(90690);e.exports=n},86534:function(e){class t{constructor(e){this.value=e||"b"+ ++t.nextId}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}t.prototype.termType="BlankNode",t.nextId=0,e.exports=t},90690:function(e,t,r){const n=r(86534),a=r(597),s=r(94648),o=r(89999),u=r(83753),i=r(2781),p=r(27722);function c(e){return new u(e)}function l(e){return new n(e)}function h(e,t){return"string"===typeof t?-1===t.indexOf(":")?new o(e,t):new o(e,null,g.namedNode(t)):new o(e,null,t)}function d(e){return new p(e)}function m(){return g.defaultGraphInstance}function f(e,t,r){return g.quad(e,t,r)}function y(e,t,r,n){return new i(e,t,r,n||g.defaultGraphInstance)}function T(e){return s.call(g,e)}function w(e){return s.call(g,e)}const g={namedNode:c,blankNode:l,literal:h,variable:d,defaultGraph:m,triple:f,quad:y,fromTerm:T,fromQuad:w,defaultGraphInstance:new a};e.exports=g},597:function(e){class t{equals(e){return!!e&&e.termType===this.termType}}t.prototype.termType="DefaultGraph",t.prototype.value="",e.exports=t},89999:function(e,t,r){const n=r(83753);class a{constructor(e,t,r){this.value=e,this.datatype=a.stringDatatype,this.language="",t?(this.language=t,this.datatype=a.langStringDatatype):r&&(this.datatype=r)}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}a.prototype.termType="Literal",a.langStringDatatype=new n("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),a.stringDatatype=new n("http://www.w3.org/2001/XMLSchema#string"),e.exports=a},83753:function(e){class t{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}t.prototype.termType="NamedNode",e.exports=t},2781:function(e,t,r){const n=r(597);class a{constructor(e,t,r,a){this.subject=e,this.predicate=t,this.object=r,this.graph=a||new n}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}}a.prototype.termType="Quad",a.prototype.value="",e.exports=a},27722:function(e){class t{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}t.prototype.termType="Variable",e.exports=t},94648:function(e){function t(e){if(!e)return null;if("BlankNode"===e.termType)return this.blankNode(e.value);if("DefaultGraph"===e.termType)return this.defaultGraph();if("Literal"===e.termType)return this.literal(e.value,e.language||this.namedNode(e.datatype.value));if("NamedNode"===e.termType)return this.namedNode(e.value);if("Quad"===e.termType){const t=this.fromTerm(e.subject),r=this.fromTerm(e.predicate),n=this.fromTerm(e.object),a=this.fromTerm(e.graph);return this.quad(t,r,n,a)}if("Variable"===e.termType)return this.variable(e.value);throw new Error(`unknown termType ${e.termType}`)}e.exports=t},19488:function(e){class t{constructor(e,t){this.Impl=e,this.options=t}import(e,t){const r=new this.Impl(e,Object.assign({},this.options,t));return e.on("end",(()=>{r.readable||r.emit("end")})),e.on("error",(e=>{r.emit("error",e)})),r}}e.exports=t},75984:function(e,t,r){const{finished:n,Readable:a}=r(28399);function s(){return new Promise((e=>setTimeout(e,0)))}class o extends a{constructor(e,{end:t=!0,map:r,...n}={}){super({read:o.readFrom(e,{end:t,map:r}),...n})}static readFrom(e,{end:t=!0,map:r=e=>e}={}){let a=!1;n(e,(()=>{a=!0}));const o=async function(){while(1){const n=e.read();if(n){if(!this.push(r(n)))return!1}else{if(a&&t&&this.push(null),a)return!0;await s()}}};return o}}e.exports=o}}]); -//# sourceMappingURL=208.e089da2b.js.map \ No newline at end of file diff --git a/dist/js/208.e089da2b.js.map b/dist/js/208.e089da2b.js.map deleted file mode 100644 index c61d1b8..0000000 --- a/dist/js/208.e089da2b.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"js/208.e089da2b.js","mappings":"qHAAA,MAAMA,EAAe,EAAQ,OACvBC,EAAO,EAAQ,OAErB,MAAMC,UAAeD,EACnB,WAAAE,CAAaC,GACXC,MAAML,EAAcI,EACtB,EAGFE,EAAOC,QAAUL,C,wBCTjB,MAAMM,EAAK,EAAQ,OACbC,EAAM,EAAQ,QACd,SAAEC,GAAa,EAAQ,OACvBC,EAAqB,EAAQ,OAEnC,MAAMX,UAAqBW,EACzB,WAAAR,CAAaS,GAAO,QAAEC,EAAU,GAAE,QAAEC,EAAUL,GAAQ,CAAC,GACrD,MAAMM,EAAS,IAAIP,EAAGQ,aAAa,CAAEH,UAASC,YAE9CT,MAAMU,EAAQ,CAAEE,YAAY,IAE5BF,EAAOG,GAAG,UAAU,CAACC,EAAQC,KAC3BC,KAAKC,KAAK,SAAUH,EAAQC,EAAI,IAGlCL,EAAOG,GAAG,SAASK,IACjBF,KAAKG,QAAQD,EAAG,IAGlBb,EAASW,MAAM,KACbN,EAAOU,KAAI,IAGbb,EAAMc,KAAKX,EACb,EAGFT,EAAOC,QAAUP,C,wBC3BjB,MAAM2B,EAAc,EAAQ,OAE5BrB,EAAOC,QAAUoB,C,oBCFjB,MAAMC,EACJ,WAAAzB,CAAa0B,GACXR,KAAKS,MAAQD,GAAO,OAASD,EAAUG,MACzC,CAEA,MAAAC,CAAQC,GACN,QAASA,GAASA,EAAMC,WAAab,KAAKa,UAAYD,EAAMH,QAAUT,KAAKS,KAC7E,EAGFF,EAAUO,UAAUD,SAAW,YAE/BN,EAAUG,OAAS,EAEnBzB,EAAOC,QAAUqB,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G,UACVH,EAAO/C,KAAK,MACd,IAGFV,EAAMM,GAAG,SAAUK,IACjB8C,EAAO/C,KAAK,QAASC,EAAG,IAGnB8C,CACT,EAGF/D,EAAOC,QAAUN,C,wBCvBjB,MAAM,SAAES,EAAQ,SAAE+D,GAAa,EAAQ,OAEvC,SAASC,IACP,OAAO,IAAIC,SAAQC,GAAWC,WAAWD,EAAS,IACpD,CAEA,MAAMjE,UAA2B8D,EAC/B,WAAAtE,CAAaS,GAAO,IAAEa,GAAM,EAAI,IAAEqD,KAAQC,GAAS,CAAC,GAClD1E,MAAM,CACJ2E,KAAMrE,EAAmBsE,SAASrE,EAAO,CAAEa,MAAKqD,WAC7CC,GAEP,CAEA,eAAOE,CAAUrE,GAAO,IAAEa,GAAM,EAAI,IAAEqD,EAAMI,GAAKA,GAAM,CAAC,GACtD,IAAIC,GAAO,EAEXzE,EAASE,GAAO,KACduE,GAAO,KAGT,MAAMH,EAAOI,iBACX,MAAO,EAAM,CACX,MAAMC,EAAQzE,EAAMoE,OAEpB,GAAKK,GAWH,IAAKhE,KAAKiE,KAAKR,EAAIO,IACjB,OAAO,MAZC,CAKV,GAJIF,GAAQ1D,GACVJ,KAAKiE,KAAK,MAGRH,EACF,OAAO,QAGHT,GACR,CAKF,CACF,EAEA,OAAOM,CACT,EAGF1E,EAAOC,QAAUI,C","sources":["webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/index.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/lib/ParserStream.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/index.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/lib/BlankNode.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/lib/DataFactory.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/lib/DefaultGraph.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/lib/Literal.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/lib/NamedNode.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/lib/Quad.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/lib/Variable.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/parser-n3/node_modules/@rdfjs/data-model/lib/fromTerm.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/sink/index.js","webpack://mobilitydcatap-ui/./node_modules/readable-to-readable/index.js"],"sourcesContent":["const ParserStream = require('./lib/ParserStream')\nconst Sink = require('@rdfjs/sink')\n\nclass Parser extends Sink {\n constructor (options) {\n super(ParserStream, options)\n }\n}\n\nmodule.exports = Parser\n","const N3 = require('n3')\nconst rdf = require('@rdfjs/data-model')\nconst { finished } = require('readable-stream')\nconst ReadableToReadable = require('readable-to-readable')\n\nclass ParserStream extends ReadableToReadable {\n constructor (input, { baseIRI = '', factory = rdf } = {}) {\n const parser = new N3.StreamParser({ baseIRI, factory })\n\n super(parser, { objectMode: true })\n\n parser.on('prefix', (prefix, term) => {\n this.emit('prefix', prefix, term)\n })\n\n parser.on('error', err => {\n this.destroy(err)\n })\n\n finished(this, () => {\n parser.end()\n })\n\n input.pipe(parser)\n }\n}\n\nmodule.exports = ParserStream\n","const DataFactory = require('./lib/DataFactory.js')\n\nmodule.exports = DataFactory\n","class BlankNode {\n constructor (id) {\n this.value = id || ('b' + (++BlankNode.nextId))\n }\n\n equals (other) {\n return !!other && other.termType === this.termType && other.value === this.value\n }\n}\n\nBlankNode.prototype.termType = 'BlankNode'\n\nBlankNode.nextId = 0\n\nmodule.exports = BlankNode\n","const BlankNode = require('./BlankNode.js')\nconst DefaultGraph = require('./DefaultGraph.js')\nconst fromTermRaw = require('./fromTerm.js')\nconst Literal = require('./Literal.js')\nconst NamedNode = require('./NamedNode.js')\nconst Quad = require('./Quad.js')\nconst Variable = require('./Variable.js')\n\nfunction namedNode (value) {\n return new NamedNode(value)\n}\n\nfunction blankNode (value) {\n return new BlankNode(value)\n}\n\nfunction literal (value, languageOrDatatype) {\n if (typeof languageOrDatatype === 'string') {\n if (languageOrDatatype.indexOf(':') === -1) {\n return new Literal(value, languageOrDatatype)\n }\n\n return new Literal(value, null, DataFactory.namedNode(languageOrDatatype))\n }\n\n return new Literal(value, null, languageOrDatatype)\n}\n\nfunction variable (value) {\n return new Variable(value)\n}\n\nfunction defaultGraph () {\n return DataFactory.defaultGraphInstance\n}\n\nfunction triple (subject, predicate, object) {\n return DataFactory.quad(subject, predicate, object)\n}\n\nfunction quad (subject, predicate, object, graph) {\n return new Quad(subject, predicate, object, graph || DataFactory.defaultGraphInstance)\n}\n\nfunction fromTerm (original) {\n return fromTermRaw.call(DataFactory, original)\n}\n\nfunction fromQuad (original) {\n return fromTermRaw.call(DataFactory, original)\n}\n\nconst DataFactory = {\n namedNode,\n blankNode,\n literal,\n variable,\n defaultGraph,\n triple,\n quad,\n fromTerm,\n fromQuad,\n defaultGraphInstance: new DefaultGraph()\n}\n\nmodule.exports = DataFactory\n","class DefaultGraph {\n equals (other) {\n return !!other && other.termType === this.termType\n }\n}\n\nDefaultGraph.prototype.termType = 'DefaultGraph'\nDefaultGraph.prototype.value = ''\n\nmodule.exports = DefaultGraph\n","const NamedNode = require('./NamedNode.js')\n\nclass Literal {\n constructor (value, language, datatype) {\n this.value = value\n this.datatype = Literal.stringDatatype\n this.language = ''\n\n if (language) {\n this.language = language\n this.datatype = Literal.langStringDatatype\n } else if (datatype) {\n this.datatype = datatype\n }\n }\n\n equals (other) {\n return !!other && other.termType === this.termType && other.value === this.value &&\n other.language === this.language && other.datatype.equals(this.datatype)\n }\n}\n\nLiteral.prototype.termType = 'Literal'\n\nLiteral.langStringDatatype = new NamedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString')\nLiteral.stringDatatype = new NamedNode('http://www.w3.org/2001/XMLSchema#string')\n\nmodule.exports = Literal\n","class NamedNode {\n constructor (iri) {\n this.value = iri\n }\n\n equals (other) {\n return !!other && other.termType === this.termType && other.value === this.value\n }\n}\n\nNamedNode.prototype.termType = 'NamedNode'\n\nmodule.exports = NamedNode\n","const DefaultGraph = require('./DefaultGraph.js')\n\nclass Quad {\n constructor (subject, predicate, object, graph) {\n this.subject = subject\n this.predicate = predicate\n this.object = object\n\n if (graph) {\n this.graph = graph\n } else {\n this.graph = new DefaultGraph()\n }\n }\n\n equals (other) {\n // `|| !other.termType` is for backwards-compatibility with old factories without RDF* support.\n return !!other && (other.termType === 'Quad' || !other.termType) &&\n other.subject.equals(this.subject) && other.predicate.equals(this.predicate) &&\n other.object.equals(this.object) && other.graph.equals(this.graph)\n }\n}\n\nQuad.prototype.termType = 'Quad'\nQuad.prototype.value = ''\n\nmodule.exports = Quad\n","class Variable {\n constructor (name) {\n this.value = name\n }\n\n equals (other) {\n return !!other && other.termType === this.termType && other.value === this.value\n }\n}\n\nVariable.prototype.termType = 'Variable'\n\nmodule.exports = Variable\n","function fromTerm (original) {\n if (!original) {\n return null\n }\n\n if (original.termType === 'BlankNode') {\n return this.blankNode(original.value)\n }\n\n if (original.termType === 'DefaultGraph') {\n return this.defaultGraph()\n }\n\n if (original.termType === 'Literal') {\n return this.literal(original.value, original.language || this.namedNode(original.datatype.value))\n }\n\n if (original.termType === 'NamedNode') {\n return this.namedNode(original.value)\n }\n\n if (original.termType === 'Quad') {\n const subject = this.fromTerm(original.subject)\n const predicate = this.fromTerm(original.predicate)\n const object = this.fromTerm(original.object)\n const graph = this.fromTerm(original.graph)\n\n return this.quad(subject, predicate, object, graph)\n }\n\n if (original.termType === 'Variable') {\n return this.variable(original.value)\n }\n\n throw new Error(`unknown termType ${original.termType}`)\n}\n\nmodule.exports = fromTerm\n","class Sink {\n constructor (Impl, options) {\n this.Impl = Impl\n this.options = options\n }\n\n import (input, options) {\n const output = new this.Impl(input, Object.assign({}, this.options, options))\n\n input.on('end', () => {\n if (!output.readable) {\n output.emit('end')\n }\n })\n\n input.on('error', (err) => {\n output.emit('error', err)\n })\n\n return output\n }\n}\n\nmodule.exports = Sink\n","const { finished, Readable } = require('readable-stream')\n\nfunction nextLoop () {\n return new Promise(resolve => setTimeout(resolve, 0))\n}\n\nclass ReadableToReadable extends Readable {\n constructor (input, { end = true, map, ...args } = {}) {\n super({\n read: ReadableToReadable.readFrom(input, { end, map }),\n ...args\n })\n }\n\n static readFrom (input, { end = true, map = v => v } = {}) {\n let done = false\n\n finished(input, () => {\n done = true\n })\n\n const read = async function () {\n while (true) {\n const chunk = input.read()\n\n if (!chunk) {\n if (done && end) {\n this.push(null)\n }\n\n if (done) {\n return true\n }\n\n await nextLoop()\n } else {\n if (!this.push(map(chunk))) {\n return false\n }\n }\n }\n }\n\n return read\n }\n}\n\nmodule.exports = ReadableToReadable\n"],"names":["ParserStream","Sink","Parser","constructor","options","super","module","exports","N3","rdf","finished","ReadableToReadable","input","baseIRI","factory","parser","StreamParser","objectMode","on","prefix","term","this","emit","err","destroy","end","pipe","DataFactory","BlankNode","id","value","nextId","equals","other","termType","prototype","DefaultGraph","fromTermRaw","Literal","NamedNode","Quad","Variable","namedNode","blankNode","literal","languageOrDatatype","indexOf","variable","defaultGraph","defaultGraphInstance","triple","subject","predicate","object","quad","graph","fromTerm","original","call","fromQuad","language","datatype","stringDatatype","langStringDatatype","iri","name","Error","Impl","import","output","Object","assign","readable","Readable","nextLoop","Promise","resolve","setTimeout","map","args","read","readFrom","v","done","async","chunk","push"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/236.aff9ab69.js b/dist/js/236.207c840f.js similarity index 99% rename from dist/js/236.aff9ab69.js rename to dist/js/236.207c840f.js index 578ee01..5d0950c 100644 --- a/dist/js/236.aff9ab69.js +++ b/dist/js/236.207c840f.js @@ -1,2 +1,2 @@ (self["webpackChunkmobilitydcatap_ui"]=self["webpackChunkmobilitydcatap_ui"]||[]).push([[236],{21236:function(t,e,s){if("function"!==typeof queueMicrotask){let t=Promise.resolve();try{queueMicrotask=e=>t.then(e).catch((t=>setTimeout((()=>{throw t}),0)))}catch(O){}}const i=s(41476),r=s(76063),n=/^[a-z][a-z0-9+\-.]*:(?:[^\0-\x20<>"{}|^`\\]|\\u[A-Fa-f0-9]{4}|\\U[A-Fa-f0-9]{8})*$/,a=/^[a-z][a-z0-9+\-.]*:[^\0-\x20<>"{}|^`]*$/,o=/^([^\0-\x20<>"{}|^`\\]|\\u[A-Fa-f0-9]{4}|\\U[A-Fa-f0-9]{8})*$/,l=/^([^\0-\x20<>"{}|^`])*$/,h=/\\u([0-9A-Fa-f]{4})|\\U([0-9A-Fa-f]{8})/g,_=(t,e,s)=>String.fromCodePoint(parseInt(e||s,16)),c=/\s*(?:#[^\n]*\n\s*)*\s*/y,u=/\s*(#[^\n]*\n\s*)*\s*/y,d=/[\\]/,f=/[^\n]+\n/y,p=/^(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\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])(?:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\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}.])*[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\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,m=/^[a-z]+(-[a-z0-9]+)*$/,g=/[ \t]*/y,x=/@([A-Za-z]+(?:-[A-Za-z0-9-]+)*)(?:\s+|(?=[.,;\])#]))/y,b=/<([^>]*)>\s*/y,w=(t,e,s,i,r,n)=>{if(e)switch(e){case"t":return"\t";case"n":return"\n";case"r":return"\r";case"f":return"\f";case"b":return"\b";default:console.assert(`bad regex escape char mapping: '${e}'`)}else{if(s)return s;if(i)return String.fromCodePoint(parseInt(i,16));if(r)return String.fromCodePoint(parseInt(r,16));if(n)throw"\\"===n[0]?new Error(`expected string_literal but invalid escape sequence within contents: '${n}'. failed to parse a valid token`):new Error(`expected string_literal but invalid whitespace character within contents: ${JSON.stringify(n)}. failed to parse a valid token`);console.assert("unexpected no match branch in escape sequence replace callback")}},y=/(?:\\(?:([tnrfb])|([\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|([\r\n]|\\.))/g,k=/(?:\\(?:([tnrfb])|([\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|([\r\n]|\\[^uU]|\\u[^]{4}|\\U[^]{8}))/g,j=t=>t.replace(y,w),I=t=>{let e=v.exec(t);if(e){let s=e.index;return[t.slice(0,s).replace(k,w),t.slice(s)]}return[t.replace(k,w),""]},[v,E]=(()=>{function t(t){let e=RegExp.prototype.exec.call(this,t);if(e){let t=e[0].length-e[1].length;e.index+=t,e[0]=e[0].slice(t)}return e}let e=(()=>{try{new RegExp("(?(e.exec=s,e)}return t=>t()})();return[e((()=>new RegExp("(?new RegExp('(?]*)>|_:([^\x20\t<]+))[\x20\t]*<([^\\>]*)>[\x20\t]*(?:(?:(<[^\\>]*)>|_:([^\x20\t<]+))[\x20\t]*(?:<([^\\>]*)>|_:([^\x20\t<]+)|)[\x20\t]*\.\s*(#[^\n]*\n\s*|\n\s*)+|"([^"\\]*)(?:(")(?:\^\^<([^\\>]*)>|@([^\x20\t.]+)|)[\x20\t]*(?:<([^\\>]*)>|_:([^\x20\t<]+)|)[\x20\t]*\.\s*(#[^\n]*\n\s*|\n\s*)+)?)/y,$=/(?:<([^>]*)>|_:([^\x20\t<]+))[\x20\t]*<([^>]*)>[\x20\t]*(?:(?:(<[^>]*)>|_:([^\x20\t<]+))[\x20\t]*(?:<([^>]*)>|_:([^\x20\t<]+)|)[\x20\t]*\.\s*(#[^\n]*\n\s*|\n\s*)+|"((?:[^"\\]|\\.)*)(?:(")(?:\^\^<([^>]*)>|@([^\x20\t.]+)|)[\x20\t]*(?:<([^>]*)>|_:([^\x20\t<]+)|)[\x20\t]*\.\s*(#[^\n]*\n\s*|\n\s*)+)?)/y,A=/_:([^\x20\t<]+)/y;class q extends i.Transform{constructor(t){super({decodeStrings:!1,writableObjectMode:!1,readableObjectMode:!0,flush:t.flush,transform:t.transform}),this.on("pipe",(t=>{this._ds_input=t,"function"===typeof t.setEncoding&&t.setEncoding("utf8")}))}pipe(t){let e=t;return e._writableState.objectMode?t.isGraphyWritable&&(t=i.quads_to_writable()):t=i.quads_to_json(),t!==e?(super.pipe(t),t.pipe(e)):super.pipe(e)}}class F{constructor(t){let{input:e=null,relax:s=!1,debug:i=!1}=t,h=t.allow_relative_iris||t.allowRelativeIRIs||t.allowRelativeIris||!1,_=this._dc_factory=r.adopt(t.dataFactory||t.data_factory||r.unfiltered),d=this._f_quad=_.quad;Object.assign(this,{s:t.prepend||"",n:0,_b_debug:i,_b_relax:s,_b_destroyed:!1,_b_trim_start:!0,_f_state:this.statement,_kt_subject:null,_kt_predicate:null,_kt_object:null,_s_literal:""}),this._kt_default_graph=_.defaultGraph(),this._kt_rdfs_lang_string=_.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString");let f=this._r_clean=c;t.relaxed&&console.warn(new Error("no such option 'relaxed'; did you mean 'relax' ?").stack.replace(/^Error:/,"Warning:")),"validate"in t&&console.warn(new Error("option 'validate' has been removed and validation is now on by default. Use 'relax' option if you wish to disable validation.").stack.replace(/^Error:/,"Warning:"));let g,x=_.namedNode,b=_.blankNode,w=_.languagedLiteral,y=h?o:n,k=h?l:a,j=this;Object.assign(this,s?{create_named_node:x,create_named_node_escapeless:x,create_blank_node:b,create_languaged_literal:w}:{create_named_node(t){return y.test(t)?x(t):j._error(`invalid IRI: "${t}"`)},create_named_node_escapeless(t){return k.test(t)?x(t):j._error(`invalid IRI: "${t}"`)},create_blank_node(t){return p.test(t)?b(t):j._error(`Invalid blank node label: "${t}"`)},create_languaged_literal(t,e){return m.test(e)?w(t,e):j._error(`Invalid literal language tag: ${e}`)}});let I=!1;if(g=this.transform=new q({transform:(t,e,s)=>{I||(g.emit("ready"),I=!1);let i=this.s+=t;if(this._b_trim_start){f.lastIndex=0;let t=f.exec(i);this.emit_comments&&this.emit_comments(t[1]),this.i=f.lastIndex}else this.i=0;this.n=i.length;try{this.parse(!0)}catch(r){return g.destroy(r)}g.emit("progress",t.length),s()},flush:t=>{if(this.s.length){if(this.s+="\n",this._b_trim_start){f.lastIndex=0;let t=f.exec(this.s);this.emit_comments&&this.emit_comments(t[1]),this.i=f.lastIndex}else this.i=0;try{this.parse()}catch(e){return g.demolish(e)}if(this.s.length)return g.demolish(new Error(`parsing error occurred in state: statement\n ${this.s.substr(0,50)}\n ^ starting here`))}if(this._f_state!==this.statement)return g.demolish(new Error(`parsing error occurred in state: ${this._f_state.name}\n ${this.s.substr(0,50)}\n ^ starting here`));this.s=null,g.emit("progress",0),g.emit("eof"),t()}}),g._destroy=(...t)=>{this.destroy(...t)},this._f_data_quad=(t,e,s,i)=>g.push(d(t,e,s,i)),g.on("newListener",(t=>{"comment"===t&&(f=u,this.emit_comments=t=>{if(!t)return;let e=t.slice(1).replace(/\n\s+$/,"").split(/\n+\s*#/g);for(let s of e)g.emit("comment",s)})})),this.bind(t),e)if(e.stream){let t=e.stream;queueMicrotask((()=>{t.pipe(g)}))}else{if("string"!==typeof e.string)throw new TypeError(`Invalid argument for input parameter: ${"object"===typeof e?JSON.stringify(e):e}`);{let t=e.string;queueMicrotask((()=>{g.end(t,"utf8")}))}}g._graphy_reader=this}_error(t){throw this._b_destroyed=!0,new Error(t)}bind(t){let e=this.transform;t.error&&e.on("error",t.error),t.comment&&e.on("comment",t.comment),t.read&&e.once("read",t.read),t.progress&&e.on("progress",t.progress),t.eof&&e.once("eof",t.eof),t.end&&e.once("end",t.end),t.finish&&e.once("finish",t.finish),t.data&&e.on("data",t.data)}parse(){let t=this._f_state();while("function"===typeof t)t=t.apply(this)}statement(){let t=this.s,e=(this.n,this.i),s=this._f_data_quad,i=this.create_named_node,r=this.create_named_node_escapeless,n=this.create_languaged_literal,a=this.create_blank_node,o=this._dc_factory.simpleLiteral,l=this._dc_factory.datatypedLiteral,c=this._kt_default_graph;for(;;){S.lastIndex=e;let u=S.exec(t);if(u){let i;e=S.lastIndex;let h=!1;if(u[4]){let t=u[4].slice(1);i=r(t)}else if(u[5])i=a(u[5]);else{h=!0;let s=u[9];if(!u[10]){this._s_literal=s,this.i=e;{let t=u[1];this._kt_subject=t||"string"===typeof t?r(t):a(u[2])}this._kt_predicate=r(u[3]);let i=this.strlit_contents();if(i&&this.statement!==i)return i;{let s=this._r_clean;s.lastIndex=this.i;let i=s.exec(t);this.emit_comments&&this.emit_comments(i[1]),e=s.lastIndex;continue}}if(u[11]){let t=this.create_named_node_escapeless(u[11]);i=l(s,t)}else if(u[12]){let t=u[12].toLowerCase();i=n(s,t)}else i=o(s)}let _,d=c;if(h){let t=u[13];t||"string"===typeof t?d=r(t):u[14]&&(d=a(u[14]))}else{let t=u[6];t||"string"===typeof t?d=r(t):u[7]&&(d=a(u[7]))}{let t=u[1];_=t||"string"===typeof t?r(t):a(u[2])}let f=u[3];s(_,r(f),i,d),this.emit_comments&&this.emit_comments(u[8]||u[15])}else{$.lastIndex=e;let r=$.exec(t);if(r){let u;e=$.lastIndex;let f=!1;if(r[4]){let t=r[4].slice(1);u=i(d.test(t)?t.replace(h,_):t)}else if(r[5])u=a(d.test(r[5])?r[5].replace(h,_):r[5]);else{f=!0;let s=r[9];if(!r[10]){this._s_literal=s,this.i=e;{let t=r[1];this._kt_subject=t||"string"===typeof t?i(d.test(t)?t.replace(h,_):t):a(r[2])}this._kt_predicate=i(d.test(r[3])?r[3].replace(h,_):r[3]);let n=this.strlit_contents();if(n&&this.statement!==n)return n;{let s=this._r_clean;s.lastIndex=this.i;let i=s.exec(t);this.emit_comments&&this.emit_comments(i[1]),e=s.lastIndex;continue}}if(s=j(s),r[11]){let t=this.create_named_node(r[11]);u=l(s,t)}else if(r[12]){let t=r[12].toLowerCase();u=n(s,t)}else u=o(s)}let p,m=c;if(f){let t=r[13];t||"string"===typeof t?m=i(d.test(t)?t.replace(h,_):t):r[14]&&(m=a(r[14]))}else{let t=r[6];t||"string"===typeof t?m=i(d.test(t)?t.replace(h,_):t):r[7]&&(m=a(r[7]))}{let t=r[1];p=t||"string"===typeof t?i(d.test(t)?t.replace(h,_):t):a(r[2])}let g=r[3];s(p,i(d.test(g)?g.replace(h,_):g),u,m),this.emit_comments&&this.emit_comments(r[8]||r[15])}else{if(f.lastIndex=e,!f.exec(t))break;e=f.lastIndex,this._error(`Failed to read statement:\n\`${t.substr(e,80).replace(/\n/g,"⏎")} [...]\`\n ^ starting here`)}}}return this.s=t.substr(e),this._f_state=this.statement,1}strlit_contents(){let{s:t,n:e,i:s}=this;E.lastIndex=s;let i=E.exec(t);if(i){let e=i.index,r=t.slice(s,e);return this._s_literal+=j(r),this.i=e+i[0].length,this._b_trim_start=!0,this.datatype_or_langtag()||this.statement}{let i=t.slice(s),[r,n]=I(i);this._s_literal+=r,this.i=s=e-n.length,this._b_trim_start=!1}return sthis.max_token_length?this.parse_error("strlit_contents"):(this._f_state=this.strlit_contents,this.s=t.slice(s),this.eos&&this.eos(),1)}datatype_or_langtag(){let{s:t,n:e,i:s}=this,i=t[s];while(sthis.max_token_length?this.parse_error("datatype_or_langtag"):(this._f_state=this.datatype_or_langtag,this.s=t.slice(s),this.eos&&this.eos(),1)}statement_term(){let{s:t,n:e,i:s}=this,i=t.indexOf(".",s);return i>-1?(this._b_trim_start=!0,this.i=i+1,this.statement):(/^\s*$/.test(t.slice(s))||this.parse_error("statement_term"),this._b_trim_start=!1,this._f_state=this.statement_term,this.s=t.slice(s),this.eos&&this.eos(),1)}post_object(){let{s:t,n:e,i:s}=this;if(g.lastIndex=s,g.exec(t),s=g.lastIndex,s>=e)return this._f_state=this.post_object,this.s=t.slice(s),this.eos&&this.eos(),1;switch(t[s]){case".":return this.i=s+1,this._f_data_quad(this._kt_subject,this._kt_predicate,this._kt_object,this._kt_default_graph),this.statement;case"<":case"_":return this.i=s,this.graph();default:this.i=s,this.parse_error("post_object")}}graph(){let{s:t,n:e,i:s}=this;b.lastIndex=s;let i=b.exec(t);if(i){this.i=b.lastIndex;let t=this.create_named_node(i[1]);return this._f_data_quad(this._kt_subject,this._kt_predicate,this._kt_object,t),this.statement_term()}{A.lastIndex=s;let e=A.exec(t);if(e){this.i=A.lastIndex;let t=this._dc_factory.blankNode(e[1]);return this._f_data_quad(this._kt_subject,this._kt_predicate,this._kt_object,t),this.statement_term()}}return this._f_state=this.graph,this.s=t.slice(s),this.eos&&this.eos(),1}parse_error(t){return this._error(`Failed to read ${t}:\n\`${this.s.substr(this.i,80).replace(/\n/g,"⏎")} [...]\`\n ^ starting here`)}destroy(t){this._f_data_quad=()=>{},!t&&this._ds_input&&this._ds_input.destroy(t),this.transform.demolish(t)}}t.exports=function(...t){let e={};if(t.length){let s=t[0];if(s&&s.input&&"undefined"===typeof s.input.string&&!s.input.stream&&(s=s.input),"string"===typeof s)e.input={string:s};else if(null===s)e.input=null;else if("function"===typeof s.setEncoding)e.input={stream:s};else{if("function"===typeof s.pipeTo)throw new TypeError("Sorry, WHATWG streams are currently not supported :(");if(!s||"object"!==typeof s||"[object Object]"!==Object.prototype.toString.call(s))throw new TypeError(`unexpected input type: ${s}`);if(e=s,t.length>1)throw new TypeError(`unexpected argument(s) after config struct: ${t.slice(1)}`)}if(t.length>1&&(Object.assign(e,t[1]),t.length>2))throw new TypeError(`unexpected argument(s) after input and config struct: ${t.slice(2)}`)}return new F(e).transform}},41476:function(t,e,s){var i=s(48287)["Buffer"],r=s(65606);const n=s(28399);class a extends n.Readable{constructor(t={}){if(super(t),t.iterator)throw new Error("readable stream iterator shortcut not yet implemented")}until(t,e){return new Promise(((s,i)=>{this.on("error",(t=>{i(t)})),e?this.once(t,((...t)=>{s(this,...t)})):this.once(t,s)}))}bucket(t="utf8"){let e=this._readableState;return e.objectMode?new Promise(((t,e)=>{let s=[];this.pipe(new n.Writable({write(t,e,i){s.push(t),i()},writev(t,e){s.push(...t),e()}})).on("error",(t=>{e(t)})).on("finish",(()=>{t(s)}))})):"utf8"===t||"utf-8"===t?new Promise(((e,s)=>{let i="";this.setEncoding(t),this.pipe(new n.Writable({decodeStrings:!1,write(t,e,s){i+=t,s()},writev(t,e){i+=t.join(""),e()}})).on("error",(t=>{s(t)})).on("finish",(()=>{e(i)}))})):"buffer"===t?new Promise(((t,e)=>{let s=i.from([]);this.pipe(new n.Writable({decodeStrings:!0,write(t,e,r){s=i.concat([s,t],s.length+t.length),r()}})).on("error",(t=>{e(t)})).on("finish",(()=>{t(s)}))})):void 0}}class o extends n.Writable{until(t,e){return new Promise(((s,i)=>{this.on("error",(t=>{i(t)})),e?this.once(t,((...t)=>{s(this,...t)})):this.once(t,s)}))}import(t){return t.on("data",(t=>this.write(t))).on("end",(()=>this.end())).on("error",(t=>this.emit("error",t))),this}}class l extends n.Duplex{until(t,e){return new Promise(((s,i)=>{this.on("error",(t=>{i(t)})),e?this.once(t,((...t)=>{s(this,...t)})):this.once(t,s)}))}bucket(t="utf8"){let e=this._readableState;return e.objectMode?new Promise(((t,e)=>{let s=[];this.pipe(new n.Writable({write(t,e,i){s.push(t),i()},writev(t,e){s.push(...t),e()}})).on("error",(t=>{e(t)})).on("finish",(()=>{t(s)}))})):"utf8"===t||"utf-8"===t?new Promise(((e,s)=>{let i="";this.setEncoding(t),this.pipe(new n.Writable({decodeStrings:!1,write(t,e,s){i+=t,s()},writev(t,e){i+=t.join(""),e()}})).on("error",(t=>{s(t)})).on("finish",(()=>{e(i)}))})):"buffer"===t?new Promise(((t,e)=>{let s=i.from([]);this.pipe(new n.Writable({decodeStrings:!0,write(t,e,r){s=i.concat([s,t],s.length+t.length),r()}})).on("error",(t=>{e(t)})).on("finish",(()=>{t(s)}))})):void 0}}class h extends n.Transform{until(t,e){return new Promise(((s,i)=>{this.on("error",(t=>{i(t)})),e?this.once(t,((...t)=>{s(this,...t)})):this.once(t,s)}))}bucket(t="utf8"){let e=this._readableState;return e.objectMode?new Promise(((t,e)=>{let s=[];this.pipe(new n.Writable({write(t,e,i){s.push(t),i()},writev(t,e){s.push(...t),e()}})).on("error",(t=>{e(t)})).on("finish",(()=>{t(s)}))})):"utf8"===t||"utf-8"===t?new Promise(((e,s)=>{let i="";this.setEncoding(t),this.pipe(new n.Writable({decodeStrings:!1,write(t,e,s){i+=t,s()},writev(t,e){i+=t.join(""),e()}})).on("error",(t=>{s(t)})).on("finish",(()=>{e(i)}))})):"buffer"===t?new Promise(((t,e)=>{let s=i.from([]);this.pipe(new n.Writable({decodeStrings:!0,write(t,e,r){s=i.concat([s,t],s.length+t.length),r()}})).on("error",(t=>{e(t)})).on("finish",(()=>{t(s)}))})):void 0}import(t){return t.on("data",(t=>this.write(t))).on("end",(()=>this.end())).on("error",(t=>this.emit("error",t))),this}demolish(t){if(this.push=t=>{if(null!==t)throw new Error("[ERR_STREAM_DESTROYED]: Cannot push after stream was destroyed")},this.emit=function(t,...e){"end"!==t&&Object.getPrototypeOf(this).emit.apply(this,[t,...e])},t)return n.Transform.prototype.destroy.call(this,t)}}const _=new Function("try {return this===global;}catch(e){return false;}")(),[c,u]=(()=>"undefined"===typeof r?[!0,!1]:r.browser?[!0,!0]:"undefined"===r.versions||"undefined"===r.versions.node?[!0,!1]:[!1,!1])();(u||_&&+/^v(\d+)/.exec(r.version)[1]<10)&&(h.prototype.destroy=l.prototype.destroy=function(t,e){this._readableState.destroyed=!0,this._writableState.destroyed=!0;let s=()=>{this._writableState.emitClose&&this._readableState.emitClose&&this.emit("close")};return this._destroy(t||null,(t=>{!e&&t?(r.nextTick((()=>{this.emit("error",t),s()})),this._writableState.errorEmitted=!0):(r.nextTick(s),e&&e(t))})),this},h.prototype._destroy=l.prototype._destroy=(t,e)=>e(t));class d extends h{constructor(t={}){super({...t,writableObjectMode:!0,readableObjectMode:!0}),this._as_inputs=new Set,this.on("pipe",(t=>{this._as_inputs.add(t),t.on("prefix",((...t)=>{this.emit("prefix",...t)})).on("comment",((...t)=>{this.emit("comment",...t)}))})),this.on("unpipe",(t=>{this._as_inputs.delete(t)}))}_destroy(){for(let t of this._as_inputs)t.destroy()}}class f extends d{_transform(t,e,s){s(null,JSON.stringify(t.isolate())+"\n")}}class p extends d{_transform(t,e,s){s(null,{type:"quad",value:t})}}h.QuadsToOther=d,t.exports={...n,Readable:a,Writable:o,Duplex:l,Transform:h,QuadsToOther:d,quads_to_json(){return new f},quads_to_writable(){return new p},source(t,e=null){return e||"string"!==typeof t||(e="utf8"),new a({objectMode:!e&&"string"!==typeof t&&!i.isBuffer(t),read(){this.push(t,e),this.push(null)}})}}}}]); -//# sourceMappingURL=236.aff9ab69.js.map \ No newline at end of file +//# sourceMappingURL=236.207c840f.js.map \ No newline at end of file diff --git a/dist/js/236.aff9ab69.js.map b/dist/js/236.207c840f.js.map similarity index 99% rename from dist/js/236.aff9ab69.js.map rename to dist/js/236.207c840f.js.map index dffa888..918232c 100644 --- a/dist/js/236.aff9ab69.js.map +++ b/dist/js/236.207c840f.js.map @@ -1 +1 @@ -{"version":3,"file":"js/236.aff9ab69.js","mappings":"qHAMC,GAAG,oBAAsBA,eAAgB,CAExC,IAAIC,EAAaC,QAAQC,UAGzB,IAECH,eAAiBI,GAAMH,EAAWI,KAAKD,GACrCE,OAAMC,GAAc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C,UAAAQ,CAAWC,EAAQhJ,EAAYiJ,GAC9BA,EAAa,KAAMtQ,KAAKC,UAAUoQ,EAAOE,WAAW,KACrD,EAGD,MAAMC,UAA0BZ,EAC/B,UAAAQ,CAAWC,EAAQhJ,EAAYiJ,GAC9BA,EAAa,KAAM,CAClBG,KAAM,OACNC,MAAOL,GAET,EAGDpO,EAAU2N,aAAeA,EAEzBxD,EAAOC,QAAU,IACbnO,EACHuO,WACAc,WACAkB,SACAxM,YAEA2N,eAGA,aAAAvM,GACC,OAAO,IAAI8M,CACZ,EAGA,iBAAA/M,GACC,OAAO,IAAIoN,CACZ,EAGA,MAAAG,CAAOC,EAAQvJ,EAAW,MAKzB,OAHIA,GAAc,kBAAoBuJ,IAAQvJ,EAAa,QAGpD,IAAIoF,EAAS,CACnBvJ,YAAamE,GAAc,kBAAoBuJ,IAAW1C,EAAO2C,SAASD,GAE1E,IAAApH,GACCnI,KAAKqH,KAAKkI,EAAQvJ,GAClBhG,KAAKqH,KAAK,KACX,GAEF,E","sources":["webpack://mobilitydcatap-ui/./node_modules/@graphy/content.nq.read/main.js","webpack://mobilitydcatap-ui/./node_modules/@graphy/core.iso.stream/main.js"],"sourcesContent":["\n\n\n// queueMicrotask shim\n{\n\t// not defined or not a function\n\tif('function' !== typeof queueMicrotask) {\n\t\t// create resolved promise\n\t\tlet dp_resolve = Promise.resolve();\n\n\t\t// try to redefine\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-global-assign\n\t\t\tqueueMicrotask = fk => dp_resolve.then(fk)\n\t\t\t\t.catch(e_callback => setTimeout(() => {\n\t\t\t\t\tthrow e_callback;\n\t\t\t\t}, 0));\n\t\t}\n\t\t// oh well, at least we tried\n\t\tcatch(e_define) {}\n\t}\n}\n\n\n\nconst stream = require('@graphy/core.iso.stream');\nconst factory = require('@graphy/core.data.factory');\n\nconst RT_ABSOLUTE_IRI_VALID = /^[a-z][a-z0-9+\\-.]*:(?:[^\\0-\\x20<>\"{}|^`\\\\]|\\\\u[A-Fa-f0-9]{4}|\\\\U[A-Fa-f0-9]{8})*$/;\nconst RT_ABSOLUTE_IRI_ESCAPELESS_VALID = /^[a-z][a-z0-9+\\-.]*:[^\\0-\\x20<>\"{}|^`]*$/;\nconst RT_NAMED_NODE_VALID = /^([^\\0-\\x20<>\"{}|^`\\\\]|\\\\u[A-Fa-f0-9]{4}|\\\\U[A-Fa-f0-9]{8})*$/;\nconst RT_NAMED_NODE_ESCAPELESS_VALID = /^([^\\0-\\x20<>\"{}|^`])*$/;\n\nconst R_UNICODE_ANY = /\\\\u([0-9A-Fa-f]{4})|\\\\U([0-9A-Fa-f]{8})/g;\n\nconst F_REPLACE_UNICODE_ANY = \t(s_, s_4, s_8) => String.fromCodePoint(parseInt(s_4 || s_8, 16));\n\n\nconst R_CLEAN = /\\s*(?:#[^\\n]*\\n\\s*)*\\s*/y;\nconst R_CLEAN_COMMENTS = /\\s*(#[^\\n]*\\n\\s*)*\\s*/y;\nconst RT_HAS_ESCAPES = /[\\\\]/;\nconst R_EOL = /[^\\n]+\\n/y;\n\n// eslint-disable-next-line no-misleading-character-class\nconst RT_BLANK_NODE_LABEL_VALID = /^(?:[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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])(?:(?:[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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}.])*[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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;\nconst RT_LANGUAGE_VALID = /^[a-z]+(-[a-z0-9]+)*$/;\n\nconst R_WS = /\\s*/y;\nconst R_HWS = /[ \\t]*/y;\nconst R_LANGTAG = /@([A-Za-z]+(?:-[A-Za-z0-9-]+)*)(?:\\s+|(?=[.,;\\])#]))/y;\n\nconst R_IRIREF = /<([^>]*)>\\s*/y;\n\n\n\nconst F_REPLACE_STRLIT_CONTENTS = (s_, s_whitespace, s_auto, s_4, s_8, s_invalid) => {\n\tif(s_whitespace) {\n\t\tswitch(s_whitespace) {\n\t\t\tcase 't': return '\\t';\n\t\t\tcase 'n': return '\\n';\n\t\t\tcase 'r': return '\\r';\n\t\t\tcase 'f': return '\\f';\n\t\t\tcase 'b': return '\\b';\n\t\t\tdefault: {\n\t\t\t\tconsole.assert(`bad regex escape char mapping: '${s_whitespace}'`);\n\t\t\t}\n\t\t}\n\t}\n\telse if(s_auto) {\n\t\treturn s_auto;\n\t}\n\telse if(s_4) {\n\t\treturn String.fromCodePoint(parseInt(s_4, 16));\n\t}\n\telse if(s_8) {\n\t\treturn String.fromCodePoint(parseInt(s_8, 16));\n\t}\n\telse if(s_invalid) {\n\t\t// pointless escape\n\t\tif('\\\\' === s_invalid[0]) {\n\t\t\t\t// // relaxed\n\t\t\t\t// return s_invalid[1];\n\t\t\t// if relaxed then return s_invalid, otherwise throw:\n\t\t\tthrow new Error(`expected string_literal but invalid escape sequence within contents: '${s_invalid}'. failed to parse a valid token`);\n\t\t}\n\t\t// bad character\n\t\telse {\n\t\t\tthrow new Error(`expected string_literal but invalid whitespace character within contents: ${JSON.stringify(s_invalid)}. failed to parse a valid token`);\n\t\t}\n\t}\n\telse {\n\t\tconsole.assert(`unexpected no match branch in escape sequence replace callback`);\n\t}\n};\n\n\nconst R_STRLIT_SHORT_CONTENTS_ESCAPES_HARD = /(?:\\\\(?:([tnrfb])|([\\\\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|([\\r\\n]|\\\\.))/g;\nconst R_STRLIT_SHORT_CONTENTS_ESCAPES_SOFT = /(?:\\\\(?:([tnrfb])|([\\\\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|([\\r\\n]|\\\\[^uU]|\\\\u[^]{4}|\\\\U[^]{8}))/g;\n\nconst unescape_literal_short_hard = s_literal => s_literal\n\t.replace(R_STRLIT_SHORT_CONTENTS_ESCAPES_HARD, F_REPLACE_STRLIT_CONTENTS);\n\nconst unescape_literal_short_soft = (s_literal) => {\n\tlet m_incomplete = R_STRLIT_ESCAPE_INCOMPLETE.exec(s_literal);\n\n\t// incomplete escape\n\tif(m_incomplete) {\n\t\tlet i_safe = m_incomplete.index;\n\n\t\t// rewind\n\t\treturn [\n\t\t\ts_literal.slice(0, i_safe)\n\t\t\t\t.replace(R_STRLIT_SHORT_CONTENTS_ESCAPES_SOFT, F_REPLACE_STRLIT_CONTENTS),\n\t\t\ts_literal.slice(i_safe),\n\t\t];\n\t}\n\t// done\n\telse {\n\t\treturn [\n\t\t\ts_literal\n\t\t\t\t.replace(R_STRLIT_SHORT_CONTENTS_ESCAPES_SOFT, F_REPLACE_STRLIT_CONTENTS),\n\t\t\t'',\n\t\t];\n\t}\n};\n\n// lookbehind regexes\nconst [\n\tR_STRLIT_ESCAPE_INCOMPLETE,\n\tR_STRLIT_SHORT_DOUBLE_TERM,\n] = (() => {\n\tfunction RegExp_$lookbehind_polyfill(s_input) {\n\t\tlet m_match = RegExp.prototype.exec.call(this, s_input);\n\n\t\tif(m_match) {\n\t\t\tlet i_start = m_match[0].length - m_match[1].length;\n\t\t\tm_match.index += i_start;\n\t\t\tm_match[0] = m_match[0].slice(i_start);\n\t\t}\n\n\t\treturn m_match;\n\t}\n\tlet mk_lookbehind_regex = (() => {\n\t\ttry {\n\t\t\tnew RegExp('(? {\n\t\t\t\tr_polyfill.exec = f_polyfill;\n\t\t\t\treturn r_polyfill;\n\t\t\t};\n\t\t}\n\t\treturn f_lookbehind => f_lookbehind();\n\t})();\n\treturn [\n\t\t// R_STRLIT_ESCAPE_INCOMPLETE\n\t\tmk_lookbehind_regex(\n\t\t\t() => new RegExp('(? new RegExp('(?]*)>|_:([^\\x20\\t<]+))[\\x20\\t]*<([^\\\\>]*)>[\\x20\\t]*(?:(?:(<[^\\\\>]*)>|_:([^\\x20\\t<]+))[\\x20\\t]*(?:<([^\\\\>]*)>|_:([^\\x20\\t<]+)|)[\\x20\\t]*\\.\\s*(#[^\\n]*\\n\\s*|\\n\\s*)+|\"([^\"\\\\]*)(?:(\")(?:\\^\\^<([^\\\\>]*)>|@([^\\x20\\t.]+)|)[\\x20\\t]*(?:<([^\\\\>]*)>|_:([^\\x20\\t<]+)|)[\\x20\\t]*\\.\\s*(#[^\\n]*\\n\\s*|\\n\\s*)+)?)/y;\nconst R_QUAD = /(?:<([^>]*)>|_:([^\\x20\\t<]+))[\\x20\\t]*<([^>]*)>[\\x20\\t]*(?:(?:(<[^>]*)>|_:([^\\x20\\t<]+))[\\x20\\t]*(?:<([^>]*)>|_:([^\\x20\\t<]+)|)[\\x20\\t]*\\.\\s*(#[^\\n]*\\n\\s*|\\n\\s*)+|\"((?:[^\"\\\\]|\\\\.)*)(?:(\")(?:\\^\\^<([^>]*)>|@([^\\x20\\t.]+)|)[\\x20\\t]*(?:<([^>]*)>|_:([^\\x20\\t<]+)|)[\\x20\\t]*\\.\\s*(#[^\\n]*\\n\\s*|\\n\\s*)+)?)/y;\nconst R_BLANK_NODE = /_:([^\\x20\\t<]+)/y;\n\n\n\nclass NQuads_Reader extends stream.Transform {\n\tconstructor(g_impls) {\n\t\tsuper({\n\t\t\t// do not decode strings into buffers\n\t\t\tdecodeStrings: false,\n\n\t\t\t// accept strings as input on writable side\n\t\t\twritableObjectMode: false,\n\n\t\t\t// output quad objects on readable side\n\t\t\treadableObjectMode: true,\n\n\t\t\t// implementations\n\t\t\tflush: g_impls.flush,\n\t\t\ttransform: g_impls.transform,\n\t\t});\n\n\t\t// when the writable side is piped into\n\t\tthis.on('pipe', (ds_input) => {\n\t\t\tthis._ds_input = ds_input;\n\n\t\t\t// input stream has encoding option; ensure stream encoding is utf8\n\t\t\tif('function' === typeof ds_input.setEncoding) {\n\t\t\t\tds_input.setEncoding('utf8');\n\t\t\t}\n\t\t});\n\t}\n\n\t// intercept pipe\n\tpipe(ds_out) {\n\t\tlet ds_dst = ds_out;\n\n\t\t// non-object mode\n\t\tif(!ds_dst._writableState.objectMode) {\n\t\t\t// transform to JSON\n\t\t\tds_out = stream.quads_to_json();\n\t\t}\n\t\t// yet object mode and graphy writable\n\t\telse if(ds_out.isGraphyWritable) {\n\t\t\t// transform to quad-stream\n\t\t\tds_out = stream.quads_to_writable();\n\t\t}\n\n\t\t// interim stream created\n\t\tif(ds_out !== ds_dst) {\n\t\t\t// forward output to super\n\t\t\tsuper.pipe(ds_out);\n\n\t\t\t// pipe outpu to destination\n\t\t\treturn ds_out.pipe(ds_dst);\n\t\t}\n\t\t// forward as-is to super\n\t\telse {\n\t\t\treturn super.pipe(ds_dst);\n\t\t}\n\t}\n}\n\nclass Reader {\n\tconstructor(g_config) {\n\t\tlet {\n\t\t\t// input medium\n\t\t\tinput: g_input=null,\n\n\t\t\t// relax validation\n\t\t\trelax: b_relax=false,\n\n\t\t\t// debug\n\t\t\tdebug: b_debug=false,\n\t\t} = g_config;\n\n\t\t// allow relative iris flag\n\t\tlet b_allow_relative_iris = g_config.allow_relative_iris || g_config.allowRelativeIRIs || g_config.allowRelativeIris || false;\n\n\t\t// adopt factory\n\t\tlet dc_factory = this._dc_factory = factory.adopt(g_config.dataFactory || g_config.data_factory || factory.unfiltered);\n\n\t\tlet f_quad = this._f_quad = dc_factory.quad;\n\n\t\t// fields\n\t\tObject.assign(this, {\n\t\t\t// string buffer, accept left-over string from previous data chunk\n\t\t\ts: g_config.prepend || '',\n\n\t\t\t// string buffer length\n\t\t\tn: 0,\n\n\t\t\t_b_debug: b_debug,\n\n\t\t\t_b_relax: b_relax,\n\n\t\t\t_b_destroyed: false,\n\n\t\t\t_b_trim_start: true,\n\n\t\t\t_f_state: this.statement,\n\n\t\t\t_kt_subject: null,\n\t\t\t_kt_predicate: null,\n\t\t\t_kt_object: null,\n\n\t\t\t_s_literal: '',\n\t\t});\n\n\t\tthis._kt_default_graph = dc_factory.defaultGraph();\n\t\tthis._kt_rdfs_lang_string = dc_factory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString');\n\n\t\t// clean regex\n\t\tlet r_clean = this._r_clean = R_CLEAN;\n\n\t\tif(g_config.relaxed) {\n\t\t\tconsole.warn((new Error(`no such option 'relaxed'; did you mean 'relax' ?`)).stack.replace(/^Error:/, 'Warning:'));\n\t\t}\n\t\tif('validate' in g_config) {\n\t\t\tconsole.warn((new Error(`option 'validate' has been removed and validation is now on by default. Use 'relax' option if you wish to disable validation.`)).stack.replace(/^Error:/, 'Warning:'));\n\t\t}\n\n\t\tlet namedNode = dc_factory.namedNode;\n\t\tlet blankNode = dc_factory.blankNode;\n\t\tlet languagedLiteral = dc_factory.languagedLiteral;\n\n\t\t// test for valid named node\n\t\tlet rt_named_node_valid = b_allow_relative_iris? RT_NAMED_NODE_VALID: RT_ABSOLUTE_IRI_VALID;\n\n\t\t// test for valid named node escapeless\n\t\tlet rt_named_node_valid_escapeless = b_allow_relative_iris? RT_NAMED_NODE_ESCAPELESS_VALID: RT_ABSOLUTE_IRI_ESCAPELESS_VALID;\n\n\t\t// validation\n\t\tlet k_self = this;\n\t\tObject.assign(this, !b_relax\n\t\t\t? {\n\t\t\t\tcreate_named_node(p_iri) {\n\t\t\t\t\tif(!rt_named_node_valid.test(p_iri)) return k_self._error(`invalid IRI: \"${p_iri}\"`);\n\t\t\t\t\treturn namedNode(p_iri);\n\t\t\t\t},\n\n\t\t\t\tcreate_named_node_escapeless(p_iri) {\n\t\t\t\t\tif(!rt_named_node_valid_escapeless.test(p_iri)) return k_self._error(`invalid IRI: \"${p_iri}\"`);\n\t\t\t\t\treturn namedNode(p_iri);\n\t\t\t\t},\n\n\t\t\t\tcreate_blank_node(s_label) {\n\t\t\t\t\tif(!RT_BLANK_NODE_LABEL_VALID.test(s_label)) return k_self._error(`Invalid blank node label: \"${s_label}\"`);\n\t\t\t\t\treturn blankNode(s_label);\n\t\t\t\t},\n\n\t\t\t\tcreate_languaged_literal(s_contents, s_language) {\n\t\t\t\t\tif(!RT_LANGUAGE_VALID.test(s_language)) {\n\t\t\t\t\t\treturn k_self._error(`Invalid literal language tag: ${s_language}`);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn languagedLiteral(s_contents, s_language);\n\t\t\t\t},\n\t\t\t}\n\t\t\t: {\n\t\t\t\tcreate_named_node: namedNode,\n\n\t\t\t\tcreate_named_node_escapeless: namedNode,\n\n\t\t\t\tcreate_blank_node: blankNode,\n\n\t\t\t\tcreate_languaged_literal: languagedLiteral,\n\t\t\t});\n\n\t\t// transform stream\n\t\tlet ds_transform;\n\n\t\t// whether or not data has been received before\n\t\tlet b_init = false;\n\n\t\t// create transform\n\t\tds_transform = this.transform = new NQuads_Reader({\n\t\t\t// on data event\n\t\t\ttransform: (s_chunk, s_encoding, fk_chunk) => {\n\t\t\t\t// first transform\n\t\t\t\tif(!b_init) {\n\t\t\t\t\t// notify that data will begin\n\t\t\t\t\tds_transform.emit('ready');\n\n\t\t\t\t\t// do not emit 'ready' event again\n\t\t\t\t\tb_init = false;\n\t\t\t\t}\n\n\t\t\t\t// concatenate current chunk to previous chunk\n\t\t\t\tlet s = this.s += s_chunk;\n\n\t\t\t\t// remove whitespace & comments from beginning\n\t\t\t\tif(this._b_trim_start) {\n\t\t\t\t\tr_clean.lastIndex = 0;\n\t\t\t\t\tlet m_clean = r_clean.exec(s);\n\t\t\t\t\tif(this.emit_comments) {\n\t\t\t\t\t\tthis.emit_comments(m_clean[1]);\n\t\t\t\t\t}\n\n\t\t\t\t\t// update index and prepare to match statement\n\t\t\t\t\tthis.i = r_clean.lastIndex;\n\t\t\t\t}\n\t\t\t\t// do not remove whitespace; reset index\n\t\t\t\telse {\n\t\t\t\t\tthis.i = 0;\n\t\t\t\t}\n\n\t\t\t\t// cache chunk length\n\t\t\t\tthis.n = s.length;\n\n\t\t\t\t// resume parsing\n\t\t\t\ttry {\n\t\t\t\t\tthis.parse(true);\n\t\t\t\t}\n\t\t\t\t// read error occurred; emit and destroy stream\n\t\t\t\tcatch(e_read) {\n\t\t\t\t\treturn ds_transform.destroy(e_read);\n\t\t\t\t}\n\n\t\t\t\t// emit progress event updates\n\t\t\t\tds_transform.emit('progress', s_chunk.length);\n\n\t\t\t\t// done transforming this chunk\n\t\t\t\tfk_chunk();\n\t\t\t},\n\n\t\t\t// once there's no more data to consume, invoke eof\n\t\t\tflush: (fk_flush) => {\n\t\t\t\t// there is still unparsed data\n\t\t\t\tif(this.s.length) {\n\t\t\t\t\t// append newline to end so we can match token\n\t\t\t\t\tthis.s += '\\n';\n\n\t\t\t\t\t// remove whitespace & comments from beginning\n\t\t\t\t\tif(this._b_trim_start) {\n\t\t\t\t\t\tr_clean.lastIndex = 0;\n\t\t\t\t\t\tlet m_clean = r_clean.exec(this.s);\n\t\t\t\t\t\tif(this.emit_comments) {\n\t\t\t\t\t\t\tthis.emit_comments(m_clean[1]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// update index and prepare to match statement\n\t\t\t\t\t\tthis.i = r_clean.lastIndex;\n\t\t\t\t\t}\n\t\t\t\t\t// do not remove whitespace; reset index\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.i = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t// parse\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.parse();\n\t\t\t\t\t}\n\t\t\t\t\t// read error occurred; pass to flush errback and exit method\n\t\t\t\t\tcatch(e_read) {\n\t\t\t\t\t\t// destroying during flush means overriding push\n\t\t\t\t\t\treturn ds_transform.demolish(e_read);\n\t\t\t\t\t}\n\n\t\t\t\t\t// still unparsed characters; pass to flush errback and exit method\n\t\t\t\t\tif(this.s.length) {\n\t\t\t\t\t\treturn ds_transform.demolish(new Error(`parsing error occurred in state: statement\\n ${this.s.substr(0, 50)}\\n ^ starting here`));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// invalid state\n\t\t\t\tif(this._f_state !== this.statement) {\n\t\t\t\t\treturn ds_transform.demolish(new Error(`parsing error occurred in state: ${this._f_state.name}\\n ${this.s.substr(0, 50)}\\n ^ starting here`));\n\t\t\t\t}\n\n\t\t\t\t// make buffer's alloc eligible for gc\n\t\t\t\tthis.s = null;\n\n\t\t\t\t// final progress update: no additional bytes were read\n\t\t\t\tds_transform.emit('progress', 0);\n\n\t\t\t\t// call end event listener\n\t\t\t\tds_transform.emit('eof');\n\n\t\t\t\t// done flushing, close read stream\n\t\t\t\tfk_flush();\n\t\t\t},\n\t\t});\n\n\t\t// destroy\n\t\tds_transform._destroy = (...a_args) => {\n\t\t\tthis.destroy(...a_args);\n\t\t};\n\n\t\t// data quad\n\t\tthis._f_data_quad = (kt_subject, kt_predicate, kt_object, kt_graph) => ds_transform.push(f_quad(kt_subject, kt_predicate, kt_object, kt_graph));\n\n\t\t// new listener added\n\t\tds_transform.on('newListener', (s_event) => {\n\t\t\t// comment\n\t\t\tif('comment' === s_event) {\n\t\t\t\tr_clean = R_CLEAN_COMMENTS;\n\t\t\t\tthis.emit_comments = (s_captured) => {\n\t\t\t\t\tif(!s_captured) return;\n\t\t\t\t\tlet a_comments = s_captured.slice(1).replace(/\\n\\s+$/, '').split(/\\n+\\s*#/g);\n\n\t\t\t\t\tfor(let s_comment of a_comments) {\n\t\t\t\t\t\tds_transform.emit('comment', s_comment);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\n\t\t// bind events to transform stream\n\t\tthis.bind(g_config);\n\n\t\t// input given\n\t\tif(g_input) {\n\t\t\t// input is stream\n\t\t\tif(g_input.stream) {\n\t\t\t\tlet ds_input = g_input.stream;\n\n\t\t\t\t// go async so caller has chance to bind event listeners\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tds_input.pipe(ds_transform);\n\t\t\t\t});\n\t\t\t}\n\t\t\t// string\n\t\t\telse if('string' === typeof g_input.string) {\n\t\t\t\tlet s_input = g_input.string;\n\n\t\t\t\t// go async so caller has chance to bind event listeners\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tds_transform.end(s_input, 'utf8');\n\t\t\t\t});\n\t\t\t}\n\t\t\t// invalid arg\n\t\t\telse {\n\t\t\t\tthrow new TypeError(`Invalid argument for input parameter: ${'object' === typeof g_input? JSON.stringify(g_input): g_input}`);\n\t\t\t}\n\t\t}\n\n\t\tds_transform._graphy_reader = this;\n\t}\n\n\t_error(s_message) {\n\t\tthis._b_destroyed = true;\n\t\tthrow new Error(s_message);\n\t}\n\n\n\n\tbind(g_config) {\n\t\tlet ds_transform = this.transform;\n\t\tif(g_config.error) ds_transform.on('error', g_config.error);\n\t\tif(g_config.comment) ds_transform.on('comment', g_config.comment);\n\t\tif(g_config.read) ds_transform.once('read', g_config.read);\n\t\tif(g_config.progress) ds_transform.on('progress', g_config.progress);\n\t\tif(g_config.eof) ds_transform.once('eof', g_config.eof);\n\t\tif(g_config.end) ds_transform.once('end', g_config.end);\n\t\tif(g_config.finish) ds_transform.once('finish', g_config.finish);\n\t\tif(g_config.data) ds_transform.on('data', g_config.data);\n\t}\n\n\t// begin parsing, keep applying until no more stack bail-outs\n\tparse() {\n\t\tlet f_sync = this._f_state();\n\t\twhile('function' === typeof f_sync) {\n\t\t\tf_sync = f_sync.apply(this);\n\t\t}\n\t}\n\n\tstatement() {\n\t\tlet s = this.s;\n\t\tlet n = this.n;\n\t\tlet i = this.i;\n\t\tlet f_data_quad = this._f_data_quad;\n\t\tlet create_named_node = this.create_named_node;\n\t\tlet create_named_node_escapeless = this.create_named_node_escapeless;\n\t\tlet create_languaged_literal = this.create_languaged_literal;\n\t\tlet create_blank_node = this.create_blank_node;\n\t\tlet simpleLiteral = this._dc_factory.simpleLiteral;\n\t\tlet datatypedLiteral = this._dc_factory.datatypedLiteral;\n\t\tlet kt_default_graph = this._kt_default_graph;\n\n\t\t// match triples/quads\n\t\tfor(;;) {\n\t\t\t// prepare sticky regex index\n\t\t\tR_QUAD_ESCAPELESS_SP.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_statement_e_sp = R_QUAD_ESCAPELESS_SP.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_statement_e_sp) {\n\t\t\t\t// advance index\n\t\t\t\ti = R_QUAD_ESCAPELESS_SP.lastIndex;\n\n\t\t\t\t// prep object term\n\t\t\t\tlet kt_object;\n\t\t\t\t// where to find the graph component\n\t\t\t\tlet b_graph_late = false;\n\n\t\t\t\t// object term type is named node\n\t\t\t\tif(m_statement_e_sp[4]) {\n\t\t\t\t\tlet p_object = m_statement_e_sp[4].slice(1);\n\t\t\t\t\tkt_object = create_named_node_escapeless(p_object);\n\t\t\t\t}\n\t\t\t\t// object term type is blank node\n\t\t\t\telse if(m_statement_e_sp[5]) {\n\t\t\t\t\tkt_object = create_blank_node(m_statement_e_sp[5]);\n\t\t\t\t}\n\t\t\t\t// object term type is literal\n\t\t\t\telse {\n\t\t\t\t\t// graph is in late capture group\n\t\t\t\t\tb_graph_late = true;\n\n\t\t\t\t\t// contents\n\t\t\t\t\tlet s_contents = m_statement_e_sp[9];\n\t\t\t\t\t// string terminator\n\t\t\t\t\tif(m_statement_e_sp[10]) {\n\t\t\t\t\t\t// datatype is present\n\t\t\t\t\t\tif(m_statement_e_sp[11]) {\n\t\t\t\t\t\t\t// create datatype term\n\t\t\t\t\t\t\tlet kt_datatype = this.create_named_node_escapeless(m_statement_e_sp[11]);\n\t\t\t\t\t\t\t// create object term\n\t\t\t\t\t\t\tkt_object = datatypedLiteral(s_contents, kt_datatype);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// language tag is present\n\t\t\t\t\t\telse if(m_statement_e_sp[12]) {\n\t\t\t\t\t\t\t// normalize language\n\t\t\t\t\t\t\tlet s_language = m_statement_e_sp[12].toLowerCase();\n\t\t\t\t\t\t\t// create object term\n\t\t\t\t\t\t\tkt_object = create_languaged_literal(s_contents, s_language);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// simple literal\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tkt_object = simpleLiteral(s_contents);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// no string terminator\n\t\t\t\t\telse {\n\t\t\t\t\t\t// save contents\n\t\t\t\t\t\tthis._s_literal = s_contents;\n\t\t\t\t\t\t// update index\n\t\t\t\t\t\tthis.i = i;\n\t\t\t\t\t\t// save subject\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlet s_subject = m_statement_e_sp[1];\n\t\t\t\t\t\t\t// named node\n\t\t\t\t\t\t\tif(s_subject || 'string' === typeof s_subject) {\n\t\t\t\t\t\t\t\tthis._kt_subject = create_named_node_escapeless(s_subject);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// blank node\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tthis._kt_subject = create_blank_node(m_statement_e_sp[2]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// save predicate\n\t\t\t\t\t\tthis._kt_predicate = create_named_node_escapeless(m_statement_e_sp[3]);\n\t\t\t\t\t\t// parse contents\n\t\t\t\t\t\tlet z_bail = this.strlit_contents();\n\t\t\t\t\t\t// bail out of stack\n\t\t\t\t\t\tif(z_bail && this.statement !== z_bail) {\n\t\t\t\t\t\t\treturn z_bail;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// statement completed\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// clean\n\t\t\t\t\t\t\tlet r_clean = this._r_clean;\n\t\t\t\t\t\t\tr_clean.lastIndex = this.i;\n\t\t\t\t\t\t\tlet m_clean = r_clean.exec(s);\n\t\t\t\t\t\t\tif(this.emit_comments) {\n\t\t\t\t\t\t\t\tthis.emit_comments(m_clean[1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// update local index and prepare to match next statement\n\t\t\t\t\t\t\ti = r_clean.lastIndex;\n\t\t\t\t\t\t\t// resume\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet kt_graph = kt_default_graph;\n\n\t\t\t\t// graph after literal\n\t\t\t\tif(b_graph_late) {\n\t\t\t\t\t// ref capture group\n\t\t\t\t\tlet s_graph = m_statement_e_sp[13];\n\n\t\t\t\t\t// named node\n\t\t\t\t\tif(s_graph || 'string' === typeof s_graph) {\n\t\t\t\t\t\tkt_graph = create_named_node_escapeless(s_graph);\n\t\t\t\t\t}\n\t\t\t\t\t// blank node\n\t\t\t\t\telse if(m_statement_e_sp[14]) {\n\t\t\t\t\t\tkt_graph = create_blank_node(m_statement_e_sp[14]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// graph after node\n\t\t\t\telse {\n\t\t\t\t\t// ref capture group\n\t\t\t\t\tlet s_graph = m_statement_e_sp[6];\n\n\t\t\t\t\t// named node\n\t\t\t\t\tif(s_graph || 'string' === typeof s_graph) {\n\t\t\t\t\t\tkt_graph = create_named_node_escapeless(s_graph);\n\t\t\t\t\t}\n\t\t\t\t\t// blank node\n\t\t\t\t\telse if(m_statement_e_sp[7]) {\n\t\t\t\t\t\tkt_graph = create_blank_node(m_statement_e_sp[7]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet kt_subject;\n\t\t\t\t{\n\t\t\t\t\tlet s_subject = m_statement_e_sp[1];\n\t\t\t\t\t// named node\n\t\t\t\t\tif(s_subject || 'string' === typeof s_subject) {\n\t\t\t\t\t\tkt_subject = create_named_node_escapeless(s_subject);\n\t\t\t\t\t}\n\t\t\t\t\t// blank node\n\t\t\t\t\telse {\n\t\t\t\t\t\tkt_subject = create_blank_node(m_statement_e_sp[2]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet s_predicate = m_statement_e_sp[3];\n\t\t\t\t// emit data event\n\t\t\t\tf_data_quad(\n\t\t\t\t\tkt_subject,\n\t\t\t\t\tcreate_named_node_escapeless(s_predicate),\n\t\t\t\t\tkt_object,\n\t\t\t\t\tkt_graph,\n\t\t\t\t);\n\t\t\t\t// comments\n\t\t\t\tif(this.emit_comments) {\n\t\t\t\t\tthis.emit_comments(m_statement_e_sp[8] || m_statement_e_sp[15]);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_QUAD.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_statement = R_QUAD.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_statement) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = R_QUAD.lastIndex;\n\n\t\t\t\t\t// prep object term\n\t\t\t\t\tlet kt_object;\n\t\t\t\t\t// where to find the graph component\n\t\t\t\t\tlet b_graph_late = false;\n\n\t\t\t\t\t// object term type is named node\n\t\t\t\t\tif(m_statement[4]) {\n\t\t\t\t\t\tlet p_object = m_statement[4].slice(1);\n\t\t\t\t\t\tkt_object = create_named_node(RT_HAS_ESCAPES.test(p_object)? p_object.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY): p_object);\n\t\t\t\t\t}\n\t\t\t\t\t// object term type is blank node\n\t\t\t\t\telse if(m_statement[5]) {\n\t\t\t\t\t\tkt_object = create_blank_node(RT_HAS_ESCAPES.test(m_statement[5])? m_statement[5].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY): m_statement[5]);\n\t\t\t\t\t}\n\t\t\t\t\t// object term type is literal\n\t\t\t\t\telse {\n\t\t\t\t\t\t// graph is in late capture group\n\t\t\t\t\t\tb_graph_late = true;\n\n\t\t\t\t\t\t// contents\n\t\t\t\t\t\tlet s_contents = m_statement[9];\n\t\t\t\t\t\t// string terminator\n\t\t\t\t\t\tif(m_statement[10]) {\n\t\t\t\t\t\t\t// unescape contents\n\t\t\t\t\t\t\ts_contents = unescape_literal_short_hard(s_contents);\n\n\t\t\t\t\t\t\t// datatype is present\n\t\t\t\t\t\t\tif(m_statement[11]) {\n\t\t\t\t\t\t\t\t// create datatype term\n\t\t\t\t\t\t\t\tlet kt_datatype = this.create_named_node(m_statement[11]);\n\t\t\t\t\t\t\t\t// create object term\n\t\t\t\t\t\t\t\tkt_object = datatypedLiteral(s_contents, kt_datatype);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// language tag is present\n\t\t\t\t\t\t\telse if(m_statement[12]) {\n\t\t\t\t\t\t\t\t// normalize language\n\t\t\t\t\t\t\t\tlet s_language = m_statement[12].toLowerCase();\n\t\t\t\t\t\t\t\t// create object term\n\t\t\t\t\t\t\t\tkt_object = create_languaged_literal(s_contents, s_language);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// simple literal\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tkt_object = simpleLiteral(s_contents);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// no string terminator\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// save contents\n\t\t\t\t\t\t\tthis._s_literal = s_contents;\n\t\t\t\t\t\t\t// update index\n\t\t\t\t\t\t\tthis.i = i;\n\t\t\t\t\t\t\t// save subject\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlet s_subject = m_statement[1];\n\t\t\t\t\t\t\t\t// named node\n\t\t\t\t\t\t\t\tif(s_subject || 'string' === typeof s_subject) {\n\t\t\t\t\t\t\t\t\tthis._kt_subject = create_named_node(RT_HAS_ESCAPES.test(s_subject)? s_subject.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY): s_subject);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// blank node\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tthis._kt_subject = create_blank_node(m_statement[2]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// save predicate\n\t\t\t\t\t\t\tthis._kt_predicate = create_named_node(RT_HAS_ESCAPES.test(m_statement[3])? m_statement[3].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY): m_statement[3]);\n\t\t\t\t\t\t\t// parse contents\n\t\t\t\t\t\t\tlet z_bail = this.strlit_contents();\n\t\t\t\t\t\t\t// bail out of stack\n\t\t\t\t\t\t\tif(z_bail && this.statement !== z_bail) {\n\t\t\t\t\t\t\t\treturn z_bail;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// statement completed\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// clean\n\t\t\t\t\t\t\t\tlet r_clean = this._r_clean;\n\t\t\t\t\t\t\t\tr_clean.lastIndex = this.i;\n\t\t\t\t\t\t\t\tlet m_clean = r_clean.exec(s);\n\t\t\t\t\t\t\t\tif(this.emit_comments) {\n\t\t\t\t\t\t\t\t\tthis.emit_comments(m_clean[1]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// update local index and prepare to match next statement\n\t\t\t\t\t\t\t\ti = r_clean.lastIndex;\n\t\t\t\t\t\t\t\t// resume\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlet kt_graph = kt_default_graph;\n\n\t\t\t\t\t// graph after literal\n\t\t\t\t\tif(b_graph_late) {\n\t\t\t\t\t\t// ref capture group\n\t\t\t\t\t\tlet s_graph = m_statement[13];\n\n\t\t\t\t\t\t// named node\n\t\t\t\t\t\tif(s_graph || 'string' === typeof s_graph) {\n\t\t\t\t\t\t\tkt_graph = create_named_node(RT_HAS_ESCAPES.test(s_graph)? s_graph.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY): s_graph);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// blank node\n\t\t\t\t\t\telse if(m_statement[14]) {\n\t\t\t\t\t\t\tkt_graph = create_blank_node(m_statement[14]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// graph after node\n\t\t\t\t\telse {\n\t\t\t\t\t\t// ref capture group\n\t\t\t\t\t\tlet s_graph = m_statement[6];\n\n\t\t\t\t\t\t// named node\n\t\t\t\t\t\tif(s_graph || 'string' === typeof s_graph) {\n\t\t\t\t\t\t\tkt_graph = create_named_node(RT_HAS_ESCAPES.test(s_graph)? s_graph.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY): s_graph);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// blank node\n\t\t\t\t\t\telse if(m_statement[7]) {\n\t\t\t\t\t\t\tkt_graph = create_blank_node(m_statement[7]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tlet kt_subject;\n\t\t\t\t\t{\n\t\t\t\t\t\tlet s_subject = m_statement[1];\n\t\t\t\t\t\t// named node\n\t\t\t\t\t\tif(s_subject || 'string' === typeof s_subject) {\n\t\t\t\t\t\t\tkt_subject = create_named_node(RT_HAS_ESCAPES.test(s_subject)? s_subject.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY): s_subject);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// blank node\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tkt_subject = create_blank_node(m_statement[2]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlet s_predicate = m_statement[3];\n\t\t\t\t\t// emit data event\n\t\t\t\t\tf_data_quad(\n\t\t\t\t\t\tkt_subject,\n\t\t\t\t\t\tcreate_named_node(RT_HAS_ESCAPES.test(s_predicate)? s_predicate.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY): s_predicate),\n\t\t\t\t\t\tkt_object,\n\t\t\t\t\t\tkt_graph,\n\t\t\t\t\t);\n\t\t\t\t\t// comments\n\t\t\t\t\tif(this.emit_comments) {\n\t\t\t\t\t\tthis.emit_comments(m_statement[8] || m_statement[15]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_EOL.lastIndex = i;\n\n\t\t\t\t\tif(R_EOL.exec(s)) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\ti = R_EOL.lastIndex;\n\t\t\t\t\t\tthis._error(`Failed to read statement:\\n\\`${s.substr(i, 80).replace(/\\n/g, '\\u23CE')} [...]\\`\\n ^ starting here`);\n\n\t\t\t\t\t// match counter: 2\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\t\t} // end of while\n\n\t\t// update unparsed data string\n\t\tthis.s = s.substr(i);\n\n\t\t// resume here\n\t\tthis._f_state = this.statement;\n\n\t\t// exit\n\t\treturn 1;\n\t}\n\n\n\tstrlit_contents() {\n\t\tlet {s, n, i} = this;\n\n\t\t// try to find end\n\t\tR_STRLIT_SHORT_DOUBLE_TERM.lastIndex = i;\n\t\tlet m_term = R_STRLIT_SHORT_DOUBLE_TERM.exec(s);\n\n\t\t// end is in this chunk\n\t\tif(m_term) {\n\t\t\t// index of terminator\n\t\t\tlet i_term = m_term.index;\n\n\t\t\t// extract dirty potion\n\t\t\tlet s_dirty = s.slice(i, i_term);\n\n\t\t\t// clean and save\n\t\t\tthis._s_literal += unescape_literal_short_hard(s_dirty);\n\n\t\t\t// advance index beyond terminator\n\t\t\tthis.i = i_term + m_term[0].length;\n\n\t\t\t// resume eating whitespace at start of next chunk\n\t\t\tthis._b_trim_start = true;\n\n\t\t\t// proceed with datatype_or_lang, then bail out of stack or resume parsing\n\t\t\treturn this.datatype_or_langtag() || this.statement;\n\t\t}\n\t\t// end is not in this chunk\n\t\telse {\n\t\t\t// extract whole portion\n\t\t\tlet s_dirty = s.slice(i);\n\n\t\t\t// unescape to clean part\n\t\t\tlet [s_clean, s_incomplete] = unescape_literal_short_soft(s_dirty);\n\n\t\t\t// save\n\t\t\tthis._s_literal += s_clean;\n\n\t\t\t// set unparsed index\n\t\t\tthis.i = i = n - s_incomplete.length;\n\n\t\t\t// do not eat whitespace at start of next chunk\n\t\t\tthis._b_trim_start = false;\n\t\t}\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('strlit_contents');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// resume here\n\t\tthis._f_state = this.strlit_contents;\n\n\t\t// store what is unparsed\n\t\tthis.s = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn 1;\n\t}\n\n\n\n\t// parse state for datatype_or_langtag\n\tdatatype_or_langtag() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// ref character\n\t\tlet x = s[i];\n\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// datatype\n\t\t\tif('^' === x) {\n\t\t\t\t// enough to speculate datatype\n\t\t\t\tif((i+2) < n) {\n\t\t\t\t\t// correct token\n\t\t\t\t\tif('^' === s[i+1]) {\n\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\tR_IRIREF.lastIndex = i + 2;\n\n\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\tlet m_iriref = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\tif(m_iriref) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\n\t\t\t\t\t\t\t// prepare iri\n\t\t\t\t\t\t\tlet p_datatype = m_iriref[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\n\t\t\t\t\t\t\t// create datatype term\n\t\t\t\t\t\t\tlet kt_datatype = this.create_named_node(p_datatype);\n\n\t\t\t\t\t\t\t// create object term\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.datatypedLiteral(this._s_literal, kt_datatype);\n\n\t\t\t\t\t\t\t// free literal string\n\t\t\t\t\t\t\tthis._s_literal = '';\n\n\t\t\t\t\t\t\t// graph state\n\t\t\t\t\t\t\treturn this.post_object();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// failed to match; try again next chunk\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// invalid\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis._error(`Failed to read token after literal:\\n\\`${s.substr(i+1, 80).replace(/\\n/g, '\\u23CE')} [...]\\`\\n ^ starting here`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// not enough to speculate; try again next chunk\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// language tag\n\t\t\telse if('@' === x) {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_LANGTAG.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_langtag = R_LANGTAG.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_langtag) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_LANGTAG.lastIndex;\n\n\t\t\t\t\t// use direct factory method since regex is validation\n\t\t\t\t\tthis._kt_object = this._dc_factory.languagedLiteral(this._s_literal, m_langtag[1]);\n\n\t\t\t\t\t// free literal string\n\t\t\t\t\tthis._s_literal = '';\n\n\t\t\t\t\t// graph state\n\t\t\t\t\treturn this.post_object();\n\t\t\t\t}\n\t\t\t\t// interrupted by eos; try again next chunk\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// graph component\n\t\t\telse if('<' === x || '_' === x) {\n\t\t\t\t// save simple literal\n\t\t\t\tthis._kt_object = this._dc_factory.simpleLiteral(this._s_literal);\n\n\t\t\t\t// free literal string\n\t\t\t\tthis._s_literal = '';\n\n\t\t\t\t// continue parsing graph component\n\t\t\t\treturn this.graph();\n\t\t\t}\n\t\t\t// triple terminator\n\t\t\telse if('.' === x) {\n\t\t\t\t// save simple literal\n\t\t\t\tlet kt_object = this._dc_factory.simpleLiteral(this._s_literal);\n\n\t\t\t\t// free literal string\n\t\t\t\tthis._s_literal = '';\n\n\t\t\t\t// advance index beyond terminator\n\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t// emit data event\n\t\t\t\tthis._f_data_quad(this._kt_subject, this._kt_predicate, kt_object, this._kt_default_graph);\n\n\t\t\t\t// reset state\n\t\t\t\treturn this.statement;\n\n\t\t\t\t// // consume whitespace (and incidentally reset index)\n\t\t\t\t// R_WS.lastIndex = i + 1;\n\t\t\t\t// R_WS.exec(s);\n\t\t\t\t// this.i = R_WS.lastIndex;\n\n\t\t\t\t// // done\n\t\t\t\t// return;\n\t\t\t}\n\t\t\t// other\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// ran out of characters\n\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('datatype_or_langtag');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// resume here\n\t\tthis._f_state = this.datatype_or_langtag;\n\n\t\t// store what is unparsed\n\t\tthis.s = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn 1;\n\t}\n\n\tstatement_term() {\n\t\tlet {s, n, i} = this;\n\n\t\t// find full stop\n\t\tlet i_stop = s.indexOf('.', i);\n\n\t\t// found\n\t\tif(i_stop > -1) {\n\t\t\t// consume whitespace again\n\t\t\tthis._b_trim_start = true;\n\n\t\t\t// advance beyond token\n\t\t\tthis.i = i_stop + 1;\n\n\t\t\t// reset state\n\t\t\treturn this.statement;\n\t\t}\n\t\t// anything other than whitespace\n\t\telse if(!/^\\s*$/.test(s.slice(i))) {\n\t\t\tthis.parse_error('statement_term');\n\t\t}\n\n\t\t// do not consume whitespace\n\t\tthis._b_trim_start = false;\n\n\t\t// resume here\n\t\tthis._f_state = this.statement_term;\n\n\t\t// store what is unparsed\n\t\tthis.s = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn 1;\n\t}\n\n\tpost_object() {\n\t\tlet {s, n, i} = this;\n\n\t\t// eat horizontal whitespace\n\t\tR_HWS.lastIndex = i;\n\t\tR_HWS.exec(s);\n\t\ti = R_HWS.lastIndex;\n\n\t\t// ran out of characters\n\t\tif(i >= n) {\n\t\t\t// resume here\n\t\t\tthis._f_state = this.post_object;\n\n\t\t\t// store what is unparsed\n\t\t\tthis.s = s.slice(i);\n\n\t\t\t// if we're not parsing a stream, then this is an error\n\t\t\tif(this.eos) this.eos();\n\t\t\treturn 1;\n\t\t}\n\n\t\t// depending on char\n\t\tswitch(s[i]) {\n\t\t\t// statement term\n\t\t\tcase '.': {\n\t\t\t\t// advance index beyond terminator\n\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t// emit data event\n\t\t\t\tthis._f_data_quad(this._kt_subject, this._kt_predicate, this._kt_object, this._kt_default_graph);\n\n\t\t\t\t// reset state\n\t\t\t\treturn this.statement;\n\t\t\t}\n\n\t\t\t// graph\n\t\t\tcase '<':\n\t\t\tcase '_': {\n\t\t\t\t// save index\n\t\t\t\tthis.i = i;\n\n\t\t\t\t// consume graph component\n\t\t\t\treturn this.graph();\n\t\t\t}\n\n\t\t\t// invalid\n\t\t\tdefault: {\n\t\t\t\t// save index\n\t\t\t\tthis.i = i;\n\n\t\t\t\t// emit parsing error\n\t\t\t\tthis.parse_error('post_object');\n\t\t\t}\n\t\t}\n\t}\n\n\tgraph() {\n\t\tlet {s, n, i} = this;\n\n\n\t\t// prepare sticky regex index\n\t\tR_IRIREF.lastIndex = i;\n\t\t// execute regex\n\t\tlet m_iriref = R_IRIREF.exec(s);\n\n\t\t// regex was a match\n\t\tif(m_iriref) {\n\t\t\t// advance index\n\t\t\tthis.i = R_IRIREF.lastIndex;\n\t\t\t// create graph term\n\t\t\tlet kt_graph = this.create_named_node(m_iriref[1]);\n\n\t\t\t// emit data event\n\t\t\tthis._f_data_quad(this._kt_subject, this._kt_predicate, this._kt_object, kt_graph);\n\n\t\t\t// complete with statement_term\n\t\t\treturn this.statement_term();\n\t\t}\n\t\telse {\n\t\t\t// prepare sticky regex index\n\t\t\tR_BLANK_NODE.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_blank = R_BLANK_NODE.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_blank) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_BLANK_NODE.lastIndex;\n\t\t\t\t// create graph term\n\t\t\t\tlet kt_graph = this._dc_factory.blankNode(m_blank[1]);\n\n\t\t\t\t// emit data event\n\t\t\t\tthis._f_data_quad(this._kt_subject, this._kt_predicate, this._kt_object, kt_graph);\n\n\t\t\t\t// complete with statement_term\n\t\t\t\treturn this.statement_term();\n\t\t\t}\n\t\t} // brace #1\n\n\n\t\t// resume here\n\t\tthis._f_state = this.graph;\n\n\t\t// store what is unparsed\n\t\tthis.s = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn 1;\n\t}\n\n\tparse_error(s_state) {\n\t\treturn this._error(`Failed to read ${s_state}:\\n\\`${this.s.substr(this.i, 80).replace(/\\n/g, '\\u23CE')} [...]\\`\\n ^ starting here`);\n\t}\n\n\tdestroy(e_destroy) {\n\t\tthis._f_data_quad = () => {};\n\n\t\tif(!e_destroy && this._ds_input) {\n\t\t\tthis._ds_input.destroy(e_destroy);\n\t\t}\n\n\t\tthis.transform.demolish(e_destroy);\n\t}\n}\n\n\nmodule.exports = function(...a_args) {\n\tlet g_config = {};\n\n\t// at least one argument\n\tif(a_args.length) {\n\t\tlet z_arg_0 = a_args[0];\n\n\t\t// input given unspecified\n\t\tif(z_arg_0 && z_arg_0.input && 'undefined' === typeof z_arg_0.input.string && !z_arg_0.input.stream) {\n\t\t\tz_arg_0 = z_arg_0.input;\n\t\t}\n\n\t\t// string\n\t\tif('string' === typeof z_arg_0) {\n\t\t\tg_config.input = {string:z_arg_0};\n\t\t}\n\t\t// null\n\t\telse if(null === z_arg_0) {\n\t\t\tg_config.input = null;\n\t\t}\n\t\t// node stream\n\t\telse if('function' === typeof z_arg_0.setEncoding) {\n\t\t\tg_config.input = {stream:z_arg_0};\n\t\t}\n\t\t// whatwg stream\n\t\telse if('function' === typeof z_arg_0.pipeTo) {\n\t\t\tthrow new TypeError(`Sorry, WHATWG streams are currently not supported :(`);\n\t\t// g_config.input = {stream:z_arg_0};\n\t\t}\n\t\t// config struct\n\t\telse if(z_arg_0 && 'object' === typeof z_arg_0 && '[object Object]' === Object.prototype.toString.call(z_arg_0)) {\n\t\t\tg_config = z_arg_0;\n\n\t\t\t// more args; invalid\n\t\t\tif(a_args.length > 1) {\n\t\t\t\tthrow new TypeError(`unexpected argument(s) after config struct: ${a_args.slice(1)}`);\n\t\t\t}\n\t\t}\n\t\t// unknown\n\t\telse {\n\t\t\tthrow new TypeError(`unexpected input type: ${z_arg_0}`);\n\t\t}\n\n\t\t// more args\n\t\tif(a_args.length > 1) {\n\t\t\t// copy onto struct\n\t\t\tObject.assign(g_config, a_args[1]);\n\n\t\t\t// more args\n\t\t\tif(a_args.length > 2) {\n\t\t\t\tthrow new TypeError(`unexpected argument(s) after input and config struct: ${a_args.slice(2)}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// create reader, return transform stream\n\treturn (new Reader(g_config)).transform;\n};\n","const stream = require('readable-stream');\n\n\n\nclass Readable extends stream.Readable {\n\tconstructor(gc_readable={}) {\n\t\tsuper(gc_readable);\n\n\t\t// use iterator\n\t\tif(gc_readable.iterator) {\n\t\t\tthrow new Error('readable stream iterator shortcut not yet implemented');\n\t\t}\n\t}\n\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass Writable extends stream.Writable {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\t// rdfjs impl\n\timport(ds_source) {\n\t\tds_source\n\t\t\t.on('data', w_chunk => this.write(w_chunk))\n\t\t\t.on('end', () => this.end())\n\t\t\t.on('error', e_read => this.emit('error', e_read));\n\n\t\treturn this;\n\t}\n}\n\nclass Duplex extends stream.Duplex {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass Transform extends stream.Transform {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\n\t// rdfjs impl\n\timport(ds_source) {\n\t\tds_source\n\t\t\t.on('data', w_chunk => this.write(w_chunk))\n\t\t\t.on('end', () => this.end())\n\t\t\t.on('error', e_read => this.emit('error', e_read));\n\n\t\treturn this;\n\t}\n\n\tdemolish(e_destroy) {\n\t\t// do not allow to push\n\t\tthis.push = (z_chunk) => {\n\t\t\t// ignore eof signals from node core\n\t\t\tif(null === z_chunk) return;\n\n\t\t\t// anything else is bad\n\t\t\tthrow new Error(`[ERR_STREAM_DESTROYED]: Cannot push after stream was destroyed`);\n\t\t};\n\n\t\t// do not allow to emit 'end'\n\t\tthis.emit = function(s_event, ...a_args) {\n\t\t\tif('end' === s_event) return;\n\n\t\t\tObject.getPrototypeOf(this).emit.apply(this, [s_event, ...a_args]);\n\t\t};\n\n\t\t// an error was given, destroy the stream as well\n\t\tif(e_destroy) {\n\t\t\treturn stream.Transform.prototype.destroy.call(this, e_destroy);\n\t\t}\n\t}\n}\n\n// eslint-disable-next-line no-new-func\nconst b_is_node = (new Function(/* syntax: js */ `try {return this===global;}catch(e){return false;}`))();\n\n// deduce the runtime environment\nconst [B_BROWSER, B_BROWSERIFY] = (() => 'undefined' === typeof process\n\t? [true, false]\n\t: (process.browser\n\t\t? [true, true]\n\t\t: ('undefined' === process.versions || 'undefined' === process.versions.node\n\t\t\t? [true, false]\n\t\t\t: [false, false])))();\n\n// node.js or browserify; patch for node < v10\nif(B_BROWSERIFY || (b_is_node && (+(/^v(\\d+)/.exec(process.version)[1])) < 10)) {\n\t// override destroy methods\n\tTransform.prototype.destroy = Duplex.prototype.destroy = function(e_destroy, fke_destroy) {\n\t\tthis._readableState.destroyed = true;\n\t\tthis._writableState.destroyed = true;\n\n\t\tlet f_emit_close = () => {\n\t\t\tif(!this._writableState.emitClose) return;\n\t\t\tif(!this._readableState.emitClose) return;\n\t\t\tthis.emit('close');\n\t\t};\n\n\t\tthis._destroy(e_destroy || null, (e_destroy_re) => {\n\t\t\tif(!fke_destroy && e_destroy_re) {\n\t\t\t\tprocess.nextTick(() => {\n\t\t\t\t\tthis.emit('error', e_destroy_re);\n\t\t\t\t\tf_emit_close();\n\t\t\t\t});\n\t\t\t\tthis._writableState.errorEmitted = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tprocess.nextTick(f_emit_close);\n\t\t\t\tif(fke_destroy) fke_destroy(e_destroy_re);\n\t\t\t}\n\t\t});\n\n\t\treturn this;\n\t};\n\n\t// override default _destroy implementations\n\tTransform.prototype._destroy = Duplex.prototype._destroy = (e_destroy, fke_destroy) => fke_destroy(e_destroy);\n}\n\nclass QuadsToOther extends Transform {\n\tconstructor(gc_transform={}) {\n\t\tsuper({\n\t\t\t...gc_transform,\n\t\t\twritableObjectMode: true,\n\t\t\treadableObjectMode: true,\n\t\t});\n\n\t\tthis._as_inputs = new Set();\n\n\t\t// forward prefix and comment events\n\t\tthis.on('pipe', (ds_src) => {\n\t\t\tthis._as_inputs.add(ds_src);\n\n\t\t\tds_src\n\t\t\t\t.on('prefix', (...a_args) => {\n\t\t\t\t\tthis.emit('prefix', ...a_args);\n\t\t\t\t})\n\t\t\t\t.on('comment', (...a_args) => {\n\t\t\t\t\tthis.emit('comment', ...a_args);\n\t\t\t\t});\n\t\t});\n\n\t\tthis.on('unpipe', (ds_src) => {\n\t\t\tthis._as_inputs.delete(ds_src);\n\t\t});\n\t}\n\n\t_destroy() {\n\t\tfor(let ds_input of this._as_inputs) {\n\t\t\tds_input.destroy();\n\t\t}\n\t}\n}\n\nclass Quads_To_JSON_Transform extends QuadsToOther {\n\t// serializse json\n\t_transform(g_quad, s_encoding, fk_transform) {\n\t\tfk_transform(null, JSON.stringify(g_quad.isolate())+'\\n');\n\t}\n}\n\nclass Quads_To_Writable extends QuadsToOther {\n\t_transform(g_quad, s_encoding, fk_transform) {\n\t\tfk_transform(null, {\n\t\t\ttype: 'quad',\n\t\t\tvalue: g_quad,\n\t\t});\n\t}\n}\n\nTransform.QuadsToOther = QuadsToOther;\n\nmodule.exports = {\n\t...stream,\n\tReadable,\n\tWritable,\n\tDuplex,\n\tTransform,\n\n\tQuadsToOther,\n\n\t// create a transform from quad objects into JSON strings for trivial serialization\n\tquads_to_json() {\n\t\treturn new Quads_To_JSON_Transform();\n\t},\n\n\t// create a transform from quad objects into writable data events\n\tquads_to_writable() {\n\t\treturn new Quads_To_Writable();\n\t},\n\n\t// create a simple, single-event readable stream\n\tsource(w_push, s_encoding=null) {\n\t\t// encoding not explicit, string given; assume utf8\n\t\tif(!s_encoding && 'string' === typeof w_push) s_encoding = 'utf8';\n\n\t\t// readable\n\t\treturn new Readable({\n\t\t\tobjectMode: !s_encoding && 'string' !== typeof w_push && !Buffer.isBuffer(w_push),\n\n\t\t\tread() {\n\t\t\t\tthis.push(w_push, s_encoding);\n\t\t\t\tthis.push(null);\n\t\t\t},\n\t\t});\n\t},\n};\n"],"names":["queueMicrotask","dp_resolve","Promise","resolve","fk","then","catch","e_callback","setTimeout","e_define","stream","factory","RT_ABSOLUTE_IRI_VALID","RT_ABSOLUTE_IRI_ESCAPELESS_VALID","RT_NAMED_NODE_VALID","RT_NAMED_NODE_ESCAPELESS_VALID","R_UNICODE_ANY","F_REPLACE_UNICODE_ANY","s_","s_4","s_8","String","fromCodePoint","parseInt","R_CLEAN","R_CLEAN_COMMENTS","RT_HAS_ESCAPES","R_EOL","RT_BLANK_NODE_LABEL_VALID","RT_LANGUAGE_VALID","R_HWS","R_LANGTAG","R_IRIREF","F_REPLACE_STRLIT_CONTENTS","s_whitespace","s_auto","s_invalid","console","assert","Error","JSON","stringify","R_STRLIT_SHORT_CONTENTS_ESCAPES_HARD","R_STRLIT_SHORT_CONTENTS_ESCAPES_SOFT","unescape_literal_short_hard","s_literal","replace","unescape_literal_short_soft","m_incomplete","R_STRLIT_ESCAPE_INCOMPLETE","exec","i_safe","index","slice","R_STRLIT_SHORT_DOUBLE_TERM","RegExp_$lookbehind_polyfill","s_input","m_match","RegExp","prototype","call","this","i_start","length","mk_lookbehind_regex","e_compile","f_lookbehind","r_polyfill","f_polyfill","R_QUAD_ESCAPELESS_SP","R_QUAD","R_BLANK_NODE","NQuads_Reader","Transform","constructor","g_impls","super","decodeStrings","writableObjectMode","readableObjectMode","flush","transform","on","ds_input","_ds_input","setEncoding","pipe","ds_out","ds_dst","_writableState","objectMode","isGraphyWritable","quads_to_writable","quads_to_json","Reader","g_config","input","g_input","relax","b_relax","debug","b_debug","b_allow_relative_iris","allow_relative_iris","allowRelativeIRIs","allowRelativeIris","dc_factory","_dc_factory","adopt","dataFactory","data_factory","unfiltered","f_quad","_f_quad","quad","Object","assign","s","prepend","n","_b_debug","_b_relax","_b_destroyed","_b_trim_start","_f_state","statement","_kt_subject","_kt_predicate","_kt_object","_s_literal","_kt_default_graph","defaultGraph","_kt_rdfs_lang_string","namedNode","r_clean","_r_clean","relaxed","warn","stack","ds_transform","blankNode","languagedLiteral","rt_named_node_valid","rt_named_node_valid_escapeless","k_self","create_named_node","create_named_node_escapeless","create_blank_node","create_languaged_literal","p_iri","test","_error","s_label","s_contents","s_language","b_init","s_chunk","s_encoding","fk_chunk","emit","lastIndex","m_clean","emit_comments","i","parse","e_read","destroy","fk_flush","demolish","substr","name","_destroy","a_args","_f_data_quad","kt_subject","kt_predicate","kt_object","kt_graph","push","s_event","s_captured","a_comments","split","s_comment","bind","string","TypeError","end","_graphy_reader","s_message","error","comment","read","once","progress","eof","finish","data","f_sync","apply","f_data_quad","simpleLiteral","datatypedLiteral","kt_default_graph","m_statement_e_sp","b_graph_late","p_object","s_subject","z_bail","strlit_contents","kt_datatype","toLowerCase","s_graph","s_predicate","m_statement","m_term","i_term","s_dirty","datatype_or_langtag","s_clean","s_incomplete","max_token_length","parse_error","eos","x","m_langtag","post_object","graph","m_iriref","p_datatype","statement_term","i_stop","indexOf","m_blank","s_state","e_destroy","module","exports","z_arg_0","pipeTo","toString","Readable","gc_readable","iterator","until","b_return_stream","fk_until","fe_until","e_stream","bucket","g_readable","_readableState","fk_bucket","fe_bucket","a_data","Writable","write","w_event","s_write_encoding","fk_write","writev","a_chunks","fk_writev","s_data","join","ab_data","Buffer","from","ab_chunk","concat","import","ds_source","w_chunk","Duplex","z_chunk","getPrototypeOf","b_is_node","Function","B_BROWSER","B_BROWSERIFY","process","browser","versions","node","version","fke_destroy","destroyed","f_emit_close","emitClose","e_destroy_re","nextTick","errorEmitted","QuadsToOther","gc_transform","_as_inputs","Set","ds_src","add","delete","Quads_To_JSON_Transform","_transform","g_quad","fk_transform","isolate","Quads_To_Writable","type","value","source","w_push","isBuffer"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"js/236.207c840f.js","mappings":"qHAMC,GAAG,oBAAsBA,eAAgB,CAExC,IAAIC,EAAaC,QAAQC,UAGzB,IAECH,eAAiBI,GAAMH,EAAWI,KAAKD,GACrCE,OAAMC,GAAcC,YAAW,KAC/B,MAAMD,CAAU,GACd,IACL,CAEA,MAAME,GAAW,CAClB,CAKD,MAAMC,EAAS,EAAQ,OACjBC,EAAU,EAAQ,OAElBC,EAAwB,qFACxBC,EAAmC,2CACnCC,EAAsB,gEACtBC,EAAiC,0BAEjCC,EAAgB,2CAEhBC,EAAyB,CAACC,EAAIC,EAAKC,IAAQC,OAAOC,cAAcC,SAASJ,GAAOC,EAAK,KAGrFI,EAAU,2BACVC,EAAmB,yBACnBC,EAAiB,OACjBC,EAAQ,YAGRC,EAA4B,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Z,EAGA,iBAAA/M,GACC,OAAO,IAAIoN,CACZ,EAGA,MAAAG,CAAOC,EAAQvJ,EAAW,MAKzB,OAHIA,GAAc,kBAAoBuJ,IAAQvJ,EAAa,QAGpD,IAAIoF,EAAS,CACnBvJ,YAAamE,GAAc,kBAAoBuJ,IAAW1C,EAAO2C,SAASD,GAE1E,IAAApH,GACCnI,KAAKqH,KAAKkI,EAAQvJ,GAClBhG,KAAKqH,KAAK,KACX,GAEF,E","sources":["webpack://mobilitydcatap-ui/./node_modules/@graphy/content.nq.read/main.js","webpack://mobilitydcatap-ui/./node_modules/@graphy/core.iso.stream/main.js"],"sourcesContent":["\n\n\n// queueMicrotask shim\n{\n\t// not defined or not a function\n\tif('function' !== typeof queueMicrotask) {\n\t\t// create resolved promise\n\t\tlet dp_resolve = Promise.resolve();\n\n\t\t// try to redefine\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-global-assign\n\t\t\tqueueMicrotask = fk => dp_resolve.then(fk)\n\t\t\t\t.catch(e_callback => setTimeout(() => {\n\t\t\t\t\tthrow e_callback;\n\t\t\t\t}, 0));\n\t\t}\n\t\t// oh well, at least we tried\n\t\tcatch(e_define) {}\n\t}\n}\n\n\n\nconst stream = require('@graphy/core.iso.stream');\nconst factory = require('@graphy/core.data.factory');\n\nconst RT_ABSOLUTE_IRI_VALID = /^[a-z][a-z0-9+\\-.]*:(?:[^\\0-\\x20<>\"{}|^`\\\\]|\\\\u[A-Fa-f0-9]{4}|\\\\U[A-Fa-f0-9]{8})*$/;\nconst RT_ABSOLUTE_IRI_ESCAPELESS_VALID = /^[a-z][a-z0-9+\\-.]*:[^\\0-\\x20<>\"{}|^`]*$/;\nconst RT_NAMED_NODE_VALID = /^([^\\0-\\x20<>\"{}|^`\\\\]|\\\\u[A-Fa-f0-9]{4}|\\\\U[A-Fa-f0-9]{8})*$/;\nconst RT_NAMED_NODE_ESCAPELESS_VALID = /^([^\\0-\\x20<>\"{}|^`])*$/;\n\nconst R_UNICODE_ANY = /\\\\u([0-9A-Fa-f]{4})|\\\\U([0-9A-Fa-f]{8})/g;\n\nconst F_REPLACE_UNICODE_ANY = \t(s_, s_4, s_8) => String.fromCodePoint(parseInt(s_4 || s_8, 16));\n\n\nconst R_CLEAN = /\\s*(?:#[^\\n]*\\n\\s*)*\\s*/y;\nconst R_CLEAN_COMMENTS = /\\s*(#[^\\n]*\\n\\s*)*\\s*/y;\nconst RT_HAS_ESCAPES = /[\\\\]/;\nconst R_EOL = /[^\\n]+\\n/y;\n\n// eslint-disable-next-line no-misleading-character-class\nconst RT_BLANK_NODE_LABEL_VALID = /^(?:[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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])(?:(?:[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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}.])*[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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;\nconst RT_LANGUAGE_VALID = /^[a-z]+(-[a-z0-9]+)*$/;\n\nconst R_WS = /\\s*/y;\nconst R_HWS = /[ \\t]*/y;\nconst R_LANGTAG = /@([A-Za-z]+(?:-[A-Za-z0-9-]+)*)(?:\\s+|(?=[.,;\\])#]))/y;\n\nconst R_IRIREF = /<([^>]*)>\\s*/y;\n\n\n\nconst F_REPLACE_STRLIT_CONTENTS = (s_, s_whitespace, s_auto, s_4, s_8, s_invalid) => {\n\tif(s_whitespace) {\n\t\tswitch(s_whitespace) {\n\t\t\tcase 't': return '\\t';\n\t\t\tcase 'n': return '\\n';\n\t\t\tcase 'r': return '\\r';\n\t\t\tcase 'f': return '\\f';\n\t\t\tcase 'b': return '\\b';\n\t\t\tdefault: {\n\t\t\t\tconsole.assert(`bad regex escape char mapping: '${s_whitespace}'`);\n\t\t\t}\n\t\t}\n\t}\n\telse if(s_auto) {\n\t\treturn s_auto;\n\t}\n\telse if(s_4) {\n\t\treturn String.fromCodePoint(parseInt(s_4, 16));\n\t}\n\telse if(s_8) {\n\t\treturn String.fromCodePoint(parseInt(s_8, 16));\n\t}\n\telse if(s_invalid) {\n\t\t// pointless escape\n\t\tif('\\\\' === s_invalid[0]) {\n\t\t\t\t// // relaxed\n\t\t\t\t// return s_invalid[1];\n\t\t\t// if relaxed then return s_invalid, otherwise throw:\n\t\t\tthrow new Error(`expected string_literal but invalid escape sequence within contents: '${s_invalid}'. failed to parse a valid token`);\n\t\t}\n\t\t// bad character\n\t\telse {\n\t\t\tthrow new Error(`expected string_literal but invalid whitespace character within contents: ${JSON.stringify(s_invalid)}. failed to parse a valid token`);\n\t\t}\n\t}\n\telse {\n\t\tconsole.assert(`unexpected no match branch in escape sequence replace callback`);\n\t}\n};\n\n\nconst R_STRLIT_SHORT_CONTENTS_ESCAPES_HARD = /(?:\\\\(?:([tnrfb])|([\\\\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|([\\r\\n]|\\\\.))/g;\nconst R_STRLIT_SHORT_CONTENTS_ESCAPES_SOFT = /(?:\\\\(?:([tnrfb])|([\\\\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|([\\r\\n]|\\\\[^uU]|\\\\u[^]{4}|\\\\U[^]{8}))/g;\n\nconst unescape_literal_short_hard = s_literal => s_literal\n\t.replace(R_STRLIT_SHORT_CONTENTS_ESCAPES_HARD, F_REPLACE_STRLIT_CONTENTS);\n\nconst unescape_literal_short_soft = (s_literal) => {\n\tlet m_incomplete = R_STRLIT_ESCAPE_INCOMPLETE.exec(s_literal);\n\n\t// incomplete escape\n\tif(m_incomplete) {\n\t\tlet i_safe = m_incomplete.index;\n\n\t\t// rewind\n\t\treturn [\n\t\t\ts_literal.slice(0, i_safe)\n\t\t\t\t.replace(R_STRLIT_SHORT_CONTENTS_ESCAPES_SOFT, F_REPLACE_STRLIT_CONTENTS),\n\t\t\ts_literal.slice(i_safe),\n\t\t];\n\t}\n\t// done\n\telse {\n\t\treturn [\n\t\t\ts_literal\n\t\t\t\t.replace(R_STRLIT_SHORT_CONTENTS_ESCAPES_SOFT, F_REPLACE_STRLIT_CONTENTS),\n\t\t\t'',\n\t\t];\n\t}\n};\n\n// lookbehind regexes\nconst [\n\tR_STRLIT_ESCAPE_INCOMPLETE,\n\tR_STRLIT_SHORT_DOUBLE_TERM,\n] = (() => {\n\tfunction RegExp_$lookbehind_polyfill(s_input) {\n\t\tlet m_match = RegExp.prototype.exec.call(this, s_input);\n\n\t\tif(m_match) {\n\t\t\tlet i_start = m_match[0].length - m_match[1].length;\n\t\t\tm_match.index += i_start;\n\t\t\tm_match[0] = m_match[0].slice(i_start);\n\t\t}\n\n\t\treturn m_match;\n\t}\n\tlet mk_lookbehind_regex = (() => {\n\t\ttry {\n\t\t\tnew RegExp('(? {\n\t\t\t\tr_polyfill.exec = f_polyfill;\n\t\t\t\treturn r_polyfill;\n\t\t\t};\n\t\t}\n\t\treturn f_lookbehind => f_lookbehind();\n\t})();\n\treturn [\n\t\t// R_STRLIT_ESCAPE_INCOMPLETE\n\t\tmk_lookbehind_regex(\n\t\t\t() => new RegExp('(? new RegExp('(?]*)>|_:([^\\x20\\t<]+))[\\x20\\t]*<([^\\\\>]*)>[\\x20\\t]*(?:(?:(<[^\\\\>]*)>|_:([^\\x20\\t<]+))[\\x20\\t]*(?:<([^\\\\>]*)>|_:([^\\x20\\t<]+)|)[\\x20\\t]*\\.\\s*(#[^\\n]*\\n\\s*|\\n\\s*)+|\"([^\"\\\\]*)(?:(\")(?:\\^\\^<([^\\\\>]*)>|@([^\\x20\\t.]+)|)[\\x20\\t]*(?:<([^\\\\>]*)>|_:([^\\x20\\t<]+)|)[\\x20\\t]*\\.\\s*(#[^\\n]*\\n\\s*|\\n\\s*)+)?)/y;\nconst R_QUAD = /(?:<([^>]*)>|_:([^\\x20\\t<]+))[\\x20\\t]*<([^>]*)>[\\x20\\t]*(?:(?:(<[^>]*)>|_:([^\\x20\\t<]+))[\\x20\\t]*(?:<([^>]*)>|_:([^\\x20\\t<]+)|)[\\x20\\t]*\\.\\s*(#[^\\n]*\\n\\s*|\\n\\s*)+|\"((?:[^\"\\\\]|\\\\.)*)(?:(\")(?:\\^\\^<([^>]*)>|@([^\\x20\\t.]+)|)[\\x20\\t]*(?:<([^>]*)>|_:([^\\x20\\t<]+)|)[\\x20\\t]*\\.\\s*(#[^\\n]*\\n\\s*|\\n\\s*)+)?)/y;\nconst R_BLANK_NODE = /_:([^\\x20\\t<]+)/y;\n\n\n\nclass NQuads_Reader extends stream.Transform {\n\tconstructor(g_impls) {\n\t\tsuper({\n\t\t\t// do not decode strings into buffers\n\t\t\tdecodeStrings: false,\n\n\t\t\t// accept strings as input on writable side\n\t\t\twritableObjectMode: false,\n\n\t\t\t// output quad objects on readable side\n\t\t\treadableObjectMode: true,\n\n\t\t\t// implementations\n\t\t\tflush: g_impls.flush,\n\t\t\ttransform: g_impls.transform,\n\t\t});\n\n\t\t// when the writable side is piped into\n\t\tthis.on('pipe', (ds_input) => {\n\t\t\tthis._ds_input = ds_input;\n\n\t\t\t// input stream has encoding option; ensure stream encoding is utf8\n\t\t\tif('function' === typeof ds_input.setEncoding) {\n\t\t\t\tds_input.setEncoding('utf8');\n\t\t\t}\n\t\t});\n\t}\n\n\t// intercept pipe\n\tpipe(ds_out) {\n\t\tlet ds_dst = ds_out;\n\n\t\t// non-object mode\n\t\tif(!ds_dst._writableState.objectMode) {\n\t\t\t// transform to JSON\n\t\t\tds_out = stream.quads_to_json();\n\t\t}\n\t\t// yet object mode and graphy writable\n\t\telse if(ds_out.isGraphyWritable) {\n\t\t\t// transform to quad-stream\n\t\t\tds_out = stream.quads_to_writable();\n\t\t}\n\n\t\t// interim stream created\n\t\tif(ds_out !== ds_dst) {\n\t\t\t// forward output to super\n\t\t\tsuper.pipe(ds_out);\n\n\t\t\t// pipe outpu to destination\n\t\t\treturn ds_out.pipe(ds_dst);\n\t\t}\n\t\t// forward as-is to super\n\t\telse {\n\t\t\treturn super.pipe(ds_dst);\n\t\t}\n\t}\n}\n\nclass Reader {\n\tconstructor(g_config) {\n\t\tlet {\n\t\t\t// input medium\n\t\t\tinput: g_input=null,\n\n\t\t\t// relax validation\n\t\t\trelax: b_relax=false,\n\n\t\t\t// debug\n\t\t\tdebug: b_debug=false,\n\t\t} = g_config;\n\n\t\t// allow relative iris flag\n\t\tlet b_allow_relative_iris = g_config.allow_relative_iris || g_config.allowRelativeIRIs || g_config.allowRelativeIris || false;\n\n\t\t// adopt factory\n\t\tlet dc_factory = this._dc_factory = factory.adopt(g_config.dataFactory || g_config.data_factory || factory.unfiltered);\n\n\t\tlet f_quad = this._f_quad = dc_factory.quad;\n\n\t\t// fields\n\t\tObject.assign(this, {\n\t\t\t// string buffer, accept left-over string from previous data chunk\n\t\t\ts: g_config.prepend || '',\n\n\t\t\t// string buffer length\n\t\t\tn: 0,\n\n\t\t\t_b_debug: b_debug,\n\n\t\t\t_b_relax: b_relax,\n\n\t\t\t_b_destroyed: false,\n\n\t\t\t_b_trim_start: true,\n\n\t\t\t_f_state: this.statement,\n\n\t\t\t_kt_subject: null,\n\t\t\t_kt_predicate: null,\n\t\t\t_kt_object: null,\n\n\t\t\t_s_literal: '',\n\t\t});\n\n\t\tthis._kt_default_graph = dc_factory.defaultGraph();\n\t\tthis._kt_rdfs_lang_string = dc_factory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString');\n\n\t\t// clean regex\n\t\tlet r_clean = this._r_clean = R_CLEAN;\n\n\t\tif(g_config.relaxed) {\n\t\t\tconsole.warn((new Error(`no such option 'relaxed'; did you mean 'relax' ?`)).stack.replace(/^Error:/, 'Warning:'));\n\t\t}\n\t\tif('validate' in g_config) {\n\t\t\tconsole.warn((new Error(`option 'validate' has been removed and validation is now on by default. Use 'relax' option if you wish to disable validation.`)).stack.replace(/^Error:/, 'Warning:'));\n\t\t}\n\n\t\tlet namedNode = dc_factory.namedNode;\n\t\tlet blankNode = dc_factory.blankNode;\n\t\tlet languagedLiteral = dc_factory.languagedLiteral;\n\n\t\t// test for valid named node\n\t\tlet rt_named_node_valid = b_allow_relative_iris? RT_NAMED_NODE_VALID: RT_ABSOLUTE_IRI_VALID;\n\n\t\t// test for valid named node escapeless\n\t\tlet rt_named_node_valid_escapeless = b_allow_relative_iris? RT_NAMED_NODE_ESCAPELESS_VALID: RT_ABSOLUTE_IRI_ESCAPELESS_VALID;\n\n\t\t// validation\n\t\tlet k_self = this;\n\t\tObject.assign(this, !b_relax\n\t\t\t? {\n\t\t\t\tcreate_named_node(p_iri) {\n\t\t\t\t\tif(!rt_named_node_valid.test(p_iri)) return k_self._error(`invalid IRI: \"${p_iri}\"`);\n\t\t\t\t\treturn namedNode(p_iri);\n\t\t\t\t},\n\n\t\t\t\tcreate_named_node_escapeless(p_iri) {\n\t\t\t\t\tif(!rt_named_node_valid_escapeless.test(p_iri)) return k_self._error(`invalid IRI: \"${p_iri}\"`);\n\t\t\t\t\treturn namedNode(p_iri);\n\t\t\t\t},\n\n\t\t\t\tcreate_blank_node(s_label) {\n\t\t\t\t\tif(!RT_BLANK_NODE_LABEL_VALID.test(s_label)) return k_self._error(`Invalid blank node label: \"${s_label}\"`);\n\t\t\t\t\treturn blankNode(s_label);\n\t\t\t\t},\n\n\t\t\t\tcreate_languaged_literal(s_contents, s_language) {\n\t\t\t\t\tif(!RT_LANGUAGE_VALID.test(s_language)) {\n\t\t\t\t\t\treturn k_self._error(`Invalid literal language tag: ${s_language}`);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn languagedLiteral(s_contents, s_language);\n\t\t\t\t},\n\t\t\t}\n\t\t\t: {\n\t\t\t\tcreate_named_node: namedNode,\n\n\t\t\t\tcreate_named_node_escapeless: namedNode,\n\n\t\t\t\tcreate_blank_node: blankNode,\n\n\t\t\t\tcreate_languaged_literal: languagedLiteral,\n\t\t\t});\n\n\t\t// transform stream\n\t\tlet ds_transform;\n\n\t\t// whether or not data has been received before\n\t\tlet b_init = false;\n\n\t\t// create transform\n\t\tds_transform = this.transform = new NQuads_Reader({\n\t\t\t// on data event\n\t\t\ttransform: (s_chunk, s_encoding, fk_chunk) => {\n\t\t\t\t// first transform\n\t\t\t\tif(!b_init) {\n\t\t\t\t\t// notify that data will begin\n\t\t\t\t\tds_transform.emit('ready');\n\n\t\t\t\t\t// do not emit 'ready' event again\n\t\t\t\t\tb_init = false;\n\t\t\t\t}\n\n\t\t\t\t// concatenate current chunk to previous chunk\n\t\t\t\tlet s = this.s += s_chunk;\n\n\t\t\t\t// remove whitespace & comments from beginning\n\t\t\t\tif(this._b_trim_start) {\n\t\t\t\t\tr_clean.lastIndex = 0;\n\t\t\t\t\tlet m_clean = r_clean.exec(s);\n\t\t\t\t\tif(this.emit_comments) {\n\t\t\t\t\t\tthis.emit_comments(m_clean[1]);\n\t\t\t\t\t}\n\n\t\t\t\t\t// update index and prepare to match statement\n\t\t\t\t\tthis.i = r_clean.lastIndex;\n\t\t\t\t}\n\t\t\t\t// do not remove whitespace; reset index\n\t\t\t\telse {\n\t\t\t\t\tthis.i = 0;\n\t\t\t\t}\n\n\t\t\t\t// cache chunk length\n\t\t\t\tthis.n = s.length;\n\n\t\t\t\t// resume parsing\n\t\t\t\ttry {\n\t\t\t\t\tthis.parse(true);\n\t\t\t\t}\n\t\t\t\t// read error occurred; emit and destroy stream\n\t\t\t\tcatch(e_read) {\n\t\t\t\t\treturn ds_transform.destroy(e_read);\n\t\t\t\t}\n\n\t\t\t\t// emit progress event updates\n\t\t\t\tds_transform.emit('progress', s_chunk.length);\n\n\t\t\t\t// done transforming this chunk\n\t\t\t\tfk_chunk();\n\t\t\t},\n\n\t\t\t// once there's no more data to consume, invoke eof\n\t\t\tflush: (fk_flush) => {\n\t\t\t\t// there is still unparsed data\n\t\t\t\tif(this.s.length) {\n\t\t\t\t\t// append newline to end so we can match token\n\t\t\t\t\tthis.s += '\\n';\n\n\t\t\t\t\t// remove whitespace & comments from beginning\n\t\t\t\t\tif(this._b_trim_start) {\n\t\t\t\t\t\tr_clean.lastIndex = 0;\n\t\t\t\t\t\tlet m_clean = r_clean.exec(this.s);\n\t\t\t\t\t\tif(this.emit_comments) {\n\t\t\t\t\t\t\tthis.emit_comments(m_clean[1]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// update index and prepare to match statement\n\t\t\t\t\t\tthis.i = r_clean.lastIndex;\n\t\t\t\t\t}\n\t\t\t\t\t// do not remove whitespace; reset index\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.i = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t// parse\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.parse();\n\t\t\t\t\t}\n\t\t\t\t\t// read error occurred; pass to flush errback and exit method\n\t\t\t\t\tcatch(e_read) {\n\t\t\t\t\t\t// destroying during flush means overriding push\n\t\t\t\t\t\treturn ds_transform.demolish(e_read);\n\t\t\t\t\t}\n\n\t\t\t\t\t// still unparsed characters; pass to flush errback and exit method\n\t\t\t\t\tif(this.s.length) {\n\t\t\t\t\t\treturn ds_transform.demolish(new Error(`parsing error occurred in state: statement\\n ${this.s.substr(0, 50)}\\n ^ starting here`));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// invalid state\n\t\t\t\tif(this._f_state !== this.statement) {\n\t\t\t\t\treturn ds_transform.demolish(new Error(`parsing error occurred in state: ${this._f_state.name}\\n ${this.s.substr(0, 50)}\\n ^ starting here`));\n\t\t\t\t}\n\n\t\t\t\t// make buffer's alloc eligible for gc\n\t\t\t\tthis.s = null;\n\n\t\t\t\t// final progress update: no additional bytes were read\n\t\t\t\tds_transform.emit('progress', 0);\n\n\t\t\t\t// call end event listener\n\t\t\t\tds_transform.emit('eof');\n\n\t\t\t\t// done flushing, close read stream\n\t\t\t\tfk_flush();\n\t\t\t},\n\t\t});\n\n\t\t// destroy\n\t\tds_transform._destroy = (...a_args) => {\n\t\t\tthis.destroy(...a_args);\n\t\t};\n\n\t\t// data quad\n\t\tthis._f_data_quad = (kt_subject, kt_predicate, kt_object, kt_graph) => ds_transform.push(f_quad(kt_subject, kt_predicate, kt_object, kt_graph));\n\n\t\t// new listener added\n\t\tds_transform.on('newListener', (s_event) => {\n\t\t\t// comment\n\t\t\tif('comment' === s_event) {\n\t\t\t\tr_clean = R_CLEAN_COMMENTS;\n\t\t\t\tthis.emit_comments = (s_captured) => {\n\t\t\t\t\tif(!s_captured) return;\n\t\t\t\t\tlet a_comments = s_captured.slice(1).replace(/\\n\\s+$/, '').split(/\\n+\\s*#/g);\n\n\t\t\t\t\tfor(let s_comment of a_comments) {\n\t\t\t\t\t\tds_transform.emit('comment', s_comment);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\n\t\t// bind events to transform stream\n\t\tthis.bind(g_config);\n\n\t\t// input given\n\t\tif(g_input) {\n\t\t\t// input is stream\n\t\t\tif(g_input.stream) {\n\t\t\t\tlet ds_input = g_input.stream;\n\n\t\t\t\t// go async so caller has chance to bind event listeners\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tds_input.pipe(ds_transform);\n\t\t\t\t});\n\t\t\t}\n\t\t\t// string\n\t\t\telse if('string' === typeof g_input.string) {\n\t\t\t\tlet s_input = g_input.string;\n\n\t\t\t\t// go async so caller has chance to bind event listeners\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tds_transform.end(s_input, 'utf8');\n\t\t\t\t});\n\t\t\t}\n\t\t\t// invalid arg\n\t\t\telse {\n\t\t\t\tthrow new TypeError(`Invalid argument for input parameter: ${'object' === typeof g_input? JSON.stringify(g_input): g_input}`);\n\t\t\t}\n\t\t}\n\n\t\tds_transform._graphy_reader = this;\n\t}\n\n\t_error(s_message) {\n\t\tthis._b_destroyed = true;\n\t\tthrow new Error(s_message);\n\t}\n\n\n\n\tbind(g_config) {\n\t\tlet ds_transform = this.transform;\n\t\tif(g_config.error) ds_transform.on('error', g_config.error);\n\t\tif(g_config.comment) ds_transform.on('comment', g_config.comment);\n\t\tif(g_config.read) ds_transform.once('read', g_config.read);\n\t\tif(g_config.progress) ds_transform.on('progress', g_config.progress);\n\t\tif(g_config.eof) ds_transform.once('eof', g_config.eof);\n\t\tif(g_config.end) ds_transform.once('end', g_config.end);\n\t\tif(g_config.finish) ds_transform.once('finish', g_config.finish);\n\t\tif(g_config.data) ds_transform.on('data', g_config.data);\n\t}\n\n\t// begin parsing, keep applying until no more stack bail-outs\n\tparse() {\n\t\tlet f_sync = this._f_state();\n\t\twhile('function' === typeof f_sync) {\n\t\t\tf_sync = f_sync.apply(this);\n\t\t}\n\t}\n\n\tstatement() {\n\t\tlet s = this.s;\n\t\tlet n = this.n;\n\t\tlet i = this.i;\n\t\tlet f_data_quad = this._f_data_quad;\n\t\tlet create_named_node = this.create_named_node;\n\t\tlet create_named_node_escapeless = this.create_named_node_escapeless;\n\t\tlet create_languaged_literal = this.create_languaged_literal;\n\t\tlet create_blank_node = this.create_blank_node;\n\t\tlet simpleLiteral = this._dc_factory.simpleLiteral;\n\t\tlet datatypedLiteral = this._dc_factory.datatypedLiteral;\n\t\tlet kt_default_graph = this._kt_default_graph;\n\n\t\t// match triples/quads\n\t\tfor(;;) {\n\t\t\t// prepare sticky regex index\n\t\t\tR_QUAD_ESCAPELESS_SP.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_statement_e_sp = R_QUAD_ESCAPELESS_SP.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_statement_e_sp) {\n\t\t\t\t// advance index\n\t\t\t\ti = R_QUAD_ESCAPELESS_SP.lastIndex;\n\n\t\t\t\t// prep object term\n\t\t\t\tlet kt_object;\n\t\t\t\t// where to find the graph component\n\t\t\t\tlet b_graph_late = false;\n\n\t\t\t\t// object term type is named node\n\t\t\t\tif(m_statement_e_sp[4]) {\n\t\t\t\t\tlet p_object = m_statement_e_sp[4].slice(1);\n\t\t\t\t\tkt_object = create_named_node_escapeless(p_object);\n\t\t\t\t}\n\t\t\t\t// object term type is blank node\n\t\t\t\telse if(m_statement_e_sp[5]) {\n\t\t\t\t\tkt_object = create_blank_node(m_statement_e_sp[5]);\n\t\t\t\t}\n\t\t\t\t// object term type is literal\n\t\t\t\telse {\n\t\t\t\t\t// graph is in late capture group\n\t\t\t\t\tb_graph_late = true;\n\n\t\t\t\t\t// contents\n\t\t\t\t\tlet s_contents = m_statement_e_sp[9];\n\t\t\t\t\t// string terminator\n\t\t\t\t\tif(m_statement_e_sp[10]) {\n\t\t\t\t\t\t// datatype is present\n\t\t\t\t\t\tif(m_statement_e_sp[11]) {\n\t\t\t\t\t\t\t// create datatype term\n\t\t\t\t\t\t\tlet kt_datatype = this.create_named_node_escapeless(m_statement_e_sp[11]);\n\t\t\t\t\t\t\t// create object term\n\t\t\t\t\t\t\tkt_object = datatypedLiteral(s_contents, kt_datatype);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// language tag is present\n\t\t\t\t\t\telse if(m_statement_e_sp[12]) {\n\t\t\t\t\t\t\t// normalize language\n\t\t\t\t\t\t\tlet s_language = m_statement_e_sp[12].toLowerCase();\n\t\t\t\t\t\t\t// create object term\n\t\t\t\t\t\t\tkt_object = create_languaged_literal(s_contents, s_language);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// simple literal\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tkt_object = simpleLiteral(s_contents);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// no string terminator\n\t\t\t\t\telse {\n\t\t\t\t\t\t// save contents\n\t\t\t\t\t\tthis._s_literal = s_contents;\n\t\t\t\t\t\t// update index\n\t\t\t\t\t\tthis.i = i;\n\t\t\t\t\t\t// save subject\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlet s_subject = m_statement_e_sp[1];\n\t\t\t\t\t\t\t// named node\n\t\t\t\t\t\t\tif(s_subject || 'string' === typeof s_subject) {\n\t\t\t\t\t\t\t\tthis._kt_subject = create_named_node_escapeless(s_subject);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// blank node\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tthis._kt_subject = create_blank_node(m_statement_e_sp[2]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// save predicate\n\t\t\t\t\t\tthis._kt_predicate = create_named_node_escapeless(m_statement_e_sp[3]);\n\t\t\t\t\t\t// parse contents\n\t\t\t\t\t\tlet z_bail = this.strlit_contents();\n\t\t\t\t\t\t// bail out of stack\n\t\t\t\t\t\tif(z_bail && this.statement !== z_bail) {\n\t\t\t\t\t\t\treturn z_bail;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// statement completed\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// clean\n\t\t\t\t\t\t\tlet r_clean = this._r_clean;\n\t\t\t\t\t\t\tr_clean.lastIndex = this.i;\n\t\t\t\t\t\t\tlet m_clean = r_clean.exec(s);\n\t\t\t\t\t\t\tif(this.emit_comments) {\n\t\t\t\t\t\t\t\tthis.emit_comments(m_clean[1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// update local index and prepare to match next statement\n\t\t\t\t\t\t\ti = r_clean.lastIndex;\n\t\t\t\t\t\t\t// resume\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet kt_graph = kt_default_graph;\n\n\t\t\t\t// graph after literal\n\t\t\t\tif(b_graph_late) {\n\t\t\t\t\t// ref capture group\n\t\t\t\t\tlet s_graph = m_statement_e_sp[13];\n\n\t\t\t\t\t// named node\n\t\t\t\t\tif(s_graph || 'string' === typeof s_graph) {\n\t\t\t\t\t\tkt_graph = create_named_node_escapeless(s_graph);\n\t\t\t\t\t}\n\t\t\t\t\t// blank node\n\t\t\t\t\telse if(m_statement_e_sp[14]) {\n\t\t\t\t\t\tkt_graph = create_blank_node(m_statement_e_sp[14]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// graph after node\n\t\t\t\telse {\n\t\t\t\t\t// ref capture group\n\t\t\t\t\tlet s_graph = m_statement_e_sp[6];\n\n\t\t\t\t\t// named node\n\t\t\t\t\tif(s_graph || 'string' === typeof s_graph) {\n\t\t\t\t\t\tkt_graph = create_named_node_escapeless(s_graph);\n\t\t\t\t\t}\n\t\t\t\t\t// blank node\n\t\t\t\t\telse if(m_statement_e_sp[7]) {\n\t\t\t\t\t\tkt_graph = create_blank_node(m_statement_e_sp[7]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet kt_subject;\n\t\t\t\t{\n\t\t\t\t\tlet s_subject = m_statement_e_sp[1];\n\t\t\t\t\t// named node\n\t\t\t\t\tif(s_subject || 'string' === typeof s_subject) {\n\t\t\t\t\t\tkt_subject = create_named_node_escapeless(s_subject);\n\t\t\t\t\t}\n\t\t\t\t\t// blank node\n\t\t\t\t\telse {\n\t\t\t\t\t\tkt_subject = create_blank_node(m_statement_e_sp[2]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet s_predicate = m_statement_e_sp[3];\n\t\t\t\t// emit data event\n\t\t\t\tf_data_quad(\n\t\t\t\t\tkt_subject,\n\t\t\t\t\tcreate_named_node_escapeless(s_predicate),\n\t\t\t\t\tkt_object,\n\t\t\t\t\tkt_graph,\n\t\t\t\t);\n\t\t\t\t// comments\n\t\t\t\tif(this.emit_comments) {\n\t\t\t\t\tthis.emit_comments(m_statement_e_sp[8] || m_statement_e_sp[15]);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_QUAD.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_statement = R_QUAD.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_statement) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = R_QUAD.lastIndex;\n\n\t\t\t\t\t// prep object term\n\t\t\t\t\tlet kt_object;\n\t\t\t\t\t// where to find the graph component\n\t\t\t\t\tlet b_graph_late = false;\n\n\t\t\t\t\t// object term type is named node\n\t\t\t\t\tif(m_statement[4]) {\n\t\t\t\t\t\tlet p_object = m_statement[4].slice(1);\n\t\t\t\t\t\tkt_object = create_named_node(RT_HAS_ESCAPES.test(p_object)? p_object.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY): p_object);\n\t\t\t\t\t}\n\t\t\t\t\t// object term type is blank node\n\t\t\t\t\telse if(m_statement[5]) {\n\t\t\t\t\t\tkt_object = create_blank_node(RT_HAS_ESCAPES.test(m_statement[5])? m_statement[5].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY): m_statement[5]);\n\t\t\t\t\t}\n\t\t\t\t\t// object term type is literal\n\t\t\t\t\telse {\n\t\t\t\t\t\t// graph is in late capture group\n\t\t\t\t\t\tb_graph_late = true;\n\n\t\t\t\t\t\t// contents\n\t\t\t\t\t\tlet s_contents = m_statement[9];\n\t\t\t\t\t\t// string terminator\n\t\t\t\t\t\tif(m_statement[10]) {\n\t\t\t\t\t\t\t// unescape contents\n\t\t\t\t\t\t\ts_contents = unescape_literal_short_hard(s_contents);\n\n\t\t\t\t\t\t\t// datatype is present\n\t\t\t\t\t\t\tif(m_statement[11]) {\n\t\t\t\t\t\t\t\t// create datatype term\n\t\t\t\t\t\t\t\tlet kt_datatype = this.create_named_node(m_statement[11]);\n\t\t\t\t\t\t\t\t// create object term\n\t\t\t\t\t\t\t\tkt_object = datatypedLiteral(s_contents, kt_datatype);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// language tag is present\n\t\t\t\t\t\t\telse if(m_statement[12]) {\n\t\t\t\t\t\t\t\t// normalize language\n\t\t\t\t\t\t\t\tlet s_language = m_statement[12].toLowerCase();\n\t\t\t\t\t\t\t\t// create object term\n\t\t\t\t\t\t\t\tkt_object = create_languaged_literal(s_contents, s_language);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// simple literal\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tkt_object = simpleLiteral(s_contents);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// no string terminator\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// save contents\n\t\t\t\t\t\t\tthis._s_literal = s_contents;\n\t\t\t\t\t\t\t// update index\n\t\t\t\t\t\t\tthis.i = i;\n\t\t\t\t\t\t\t// save subject\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlet s_subject = m_statement[1];\n\t\t\t\t\t\t\t\t// named node\n\t\t\t\t\t\t\t\tif(s_subject || 'string' === typeof s_subject) {\n\t\t\t\t\t\t\t\t\tthis._kt_subject = create_named_node(RT_HAS_ESCAPES.test(s_subject)? s_subject.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY): s_subject);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// blank node\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tthis._kt_subject = create_blank_node(m_statement[2]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// save predicate\n\t\t\t\t\t\t\tthis._kt_predicate = create_named_node(RT_HAS_ESCAPES.test(m_statement[3])? m_statement[3].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY): m_statement[3]);\n\t\t\t\t\t\t\t// parse contents\n\t\t\t\t\t\t\tlet z_bail = this.strlit_contents();\n\t\t\t\t\t\t\t// bail out of stack\n\t\t\t\t\t\t\tif(z_bail && this.statement !== z_bail) {\n\t\t\t\t\t\t\t\treturn z_bail;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// statement completed\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// clean\n\t\t\t\t\t\t\t\tlet r_clean = this._r_clean;\n\t\t\t\t\t\t\t\tr_clean.lastIndex = this.i;\n\t\t\t\t\t\t\t\tlet m_clean = r_clean.exec(s);\n\t\t\t\t\t\t\t\tif(this.emit_comments) {\n\t\t\t\t\t\t\t\t\tthis.emit_comments(m_clean[1]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// update local index and prepare to match next statement\n\t\t\t\t\t\t\t\ti = r_clean.lastIndex;\n\t\t\t\t\t\t\t\t// resume\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlet kt_graph = kt_default_graph;\n\n\t\t\t\t\t// graph after literal\n\t\t\t\t\tif(b_graph_late) {\n\t\t\t\t\t\t// ref capture group\n\t\t\t\t\t\tlet s_graph = m_statement[13];\n\n\t\t\t\t\t\t// named node\n\t\t\t\t\t\tif(s_graph || 'string' === typeof s_graph) {\n\t\t\t\t\t\t\tkt_graph = create_named_node(RT_HAS_ESCAPES.test(s_graph)? s_graph.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY): s_graph);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// blank node\n\t\t\t\t\t\telse if(m_statement[14]) {\n\t\t\t\t\t\t\tkt_graph = create_blank_node(m_statement[14]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// graph after node\n\t\t\t\t\telse {\n\t\t\t\t\t\t// ref capture group\n\t\t\t\t\t\tlet s_graph = m_statement[6];\n\n\t\t\t\t\t\t// named node\n\t\t\t\t\t\tif(s_graph || 'string' === typeof s_graph) {\n\t\t\t\t\t\t\tkt_graph = create_named_node(RT_HAS_ESCAPES.test(s_graph)? s_graph.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY): s_graph);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// blank node\n\t\t\t\t\t\telse if(m_statement[7]) {\n\t\t\t\t\t\t\tkt_graph = create_blank_node(m_statement[7]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tlet kt_subject;\n\t\t\t\t\t{\n\t\t\t\t\t\tlet s_subject = m_statement[1];\n\t\t\t\t\t\t// named node\n\t\t\t\t\t\tif(s_subject || 'string' === typeof s_subject) {\n\t\t\t\t\t\t\tkt_subject = create_named_node(RT_HAS_ESCAPES.test(s_subject)? s_subject.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY): s_subject);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// blank node\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tkt_subject = create_blank_node(m_statement[2]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlet s_predicate = m_statement[3];\n\t\t\t\t\t// emit data event\n\t\t\t\t\tf_data_quad(\n\t\t\t\t\t\tkt_subject,\n\t\t\t\t\t\tcreate_named_node(RT_HAS_ESCAPES.test(s_predicate)? s_predicate.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY): s_predicate),\n\t\t\t\t\t\tkt_object,\n\t\t\t\t\t\tkt_graph,\n\t\t\t\t\t);\n\t\t\t\t\t// comments\n\t\t\t\t\tif(this.emit_comments) {\n\t\t\t\t\t\tthis.emit_comments(m_statement[8] || m_statement[15]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_EOL.lastIndex = i;\n\n\t\t\t\t\tif(R_EOL.exec(s)) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\ti = R_EOL.lastIndex;\n\t\t\t\t\t\tthis._error(`Failed to read statement:\\n\\`${s.substr(i, 80).replace(/\\n/g, '\\u23CE')} [...]\\`\\n ^ starting here`);\n\n\t\t\t\t\t// match counter: 2\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\t\t} // end of while\n\n\t\t// update unparsed data string\n\t\tthis.s = s.substr(i);\n\n\t\t// resume here\n\t\tthis._f_state = this.statement;\n\n\t\t// exit\n\t\treturn 1;\n\t}\n\n\n\tstrlit_contents() {\n\t\tlet {s, n, i} = this;\n\n\t\t// try to find end\n\t\tR_STRLIT_SHORT_DOUBLE_TERM.lastIndex = i;\n\t\tlet m_term = R_STRLIT_SHORT_DOUBLE_TERM.exec(s);\n\n\t\t// end is in this chunk\n\t\tif(m_term) {\n\t\t\t// index of terminator\n\t\t\tlet i_term = m_term.index;\n\n\t\t\t// extract dirty potion\n\t\t\tlet s_dirty = s.slice(i, i_term);\n\n\t\t\t// clean and save\n\t\t\tthis._s_literal += unescape_literal_short_hard(s_dirty);\n\n\t\t\t// advance index beyond terminator\n\t\t\tthis.i = i_term + m_term[0].length;\n\n\t\t\t// resume eating whitespace at start of next chunk\n\t\t\tthis._b_trim_start = true;\n\n\t\t\t// proceed with datatype_or_lang, then bail out of stack or resume parsing\n\t\t\treturn this.datatype_or_langtag() || this.statement;\n\t\t}\n\t\t// end is not in this chunk\n\t\telse {\n\t\t\t// extract whole portion\n\t\t\tlet s_dirty = s.slice(i);\n\n\t\t\t// unescape to clean part\n\t\t\tlet [s_clean, s_incomplete] = unescape_literal_short_soft(s_dirty);\n\n\t\t\t// save\n\t\t\tthis._s_literal += s_clean;\n\n\t\t\t// set unparsed index\n\t\t\tthis.i = i = n - s_incomplete.length;\n\n\t\t\t// do not eat whitespace at start of next chunk\n\t\t\tthis._b_trim_start = false;\n\t\t}\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('strlit_contents');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// resume here\n\t\tthis._f_state = this.strlit_contents;\n\n\t\t// store what is unparsed\n\t\tthis.s = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn 1;\n\t}\n\n\n\n\t// parse state for datatype_or_langtag\n\tdatatype_or_langtag() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// ref character\n\t\tlet x = s[i];\n\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// datatype\n\t\t\tif('^' === x) {\n\t\t\t\t// enough to speculate datatype\n\t\t\t\tif((i+2) < n) {\n\t\t\t\t\t// correct token\n\t\t\t\t\tif('^' === s[i+1]) {\n\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\tR_IRIREF.lastIndex = i + 2;\n\n\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\tlet m_iriref = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\tif(m_iriref) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\n\t\t\t\t\t\t\t// prepare iri\n\t\t\t\t\t\t\tlet p_datatype = m_iriref[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\n\t\t\t\t\t\t\t// create datatype term\n\t\t\t\t\t\t\tlet kt_datatype = this.create_named_node(p_datatype);\n\n\t\t\t\t\t\t\t// create object term\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.datatypedLiteral(this._s_literal, kt_datatype);\n\n\t\t\t\t\t\t\t// free literal string\n\t\t\t\t\t\t\tthis._s_literal = '';\n\n\t\t\t\t\t\t\t// graph state\n\t\t\t\t\t\t\treturn this.post_object();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// failed to match; try again next chunk\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// invalid\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis._error(`Failed to read token after literal:\\n\\`${s.substr(i+1, 80).replace(/\\n/g, '\\u23CE')} [...]\\`\\n ^ starting here`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// not enough to speculate; try again next chunk\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// language tag\n\t\t\telse if('@' === x) {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_LANGTAG.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_langtag = R_LANGTAG.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_langtag) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_LANGTAG.lastIndex;\n\n\t\t\t\t\t// use direct factory method since regex is validation\n\t\t\t\t\tthis._kt_object = this._dc_factory.languagedLiteral(this._s_literal, m_langtag[1]);\n\n\t\t\t\t\t// free literal string\n\t\t\t\t\tthis._s_literal = '';\n\n\t\t\t\t\t// graph state\n\t\t\t\t\treturn this.post_object();\n\t\t\t\t}\n\t\t\t\t// interrupted by eos; try again next chunk\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// graph component\n\t\t\telse if('<' === x || '_' === x) {\n\t\t\t\t// save simple literal\n\t\t\t\tthis._kt_object = this._dc_factory.simpleLiteral(this._s_literal);\n\n\t\t\t\t// free literal string\n\t\t\t\tthis._s_literal = '';\n\n\t\t\t\t// continue parsing graph component\n\t\t\t\treturn this.graph();\n\t\t\t}\n\t\t\t// triple terminator\n\t\t\telse if('.' === x) {\n\t\t\t\t// save simple literal\n\t\t\t\tlet kt_object = this._dc_factory.simpleLiteral(this._s_literal);\n\n\t\t\t\t// free literal string\n\t\t\t\tthis._s_literal = '';\n\n\t\t\t\t// advance index beyond terminator\n\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t// emit data event\n\t\t\t\tthis._f_data_quad(this._kt_subject, this._kt_predicate, kt_object, this._kt_default_graph);\n\n\t\t\t\t// reset state\n\t\t\t\treturn this.statement;\n\n\t\t\t\t// // consume whitespace (and incidentally reset index)\n\t\t\t\t// R_WS.lastIndex = i + 1;\n\t\t\t\t// R_WS.exec(s);\n\t\t\t\t// this.i = R_WS.lastIndex;\n\n\t\t\t\t// // done\n\t\t\t\t// return;\n\t\t\t}\n\t\t\t// other\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// ran out of characters\n\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('datatype_or_langtag');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// resume here\n\t\tthis._f_state = this.datatype_or_langtag;\n\n\t\t// store what is unparsed\n\t\tthis.s = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn 1;\n\t}\n\n\tstatement_term() {\n\t\tlet {s, n, i} = this;\n\n\t\t// find full stop\n\t\tlet i_stop = s.indexOf('.', i);\n\n\t\t// found\n\t\tif(i_stop > -1) {\n\t\t\t// consume whitespace again\n\t\t\tthis._b_trim_start = true;\n\n\t\t\t// advance beyond token\n\t\t\tthis.i = i_stop + 1;\n\n\t\t\t// reset state\n\t\t\treturn this.statement;\n\t\t}\n\t\t// anything other than whitespace\n\t\telse if(!/^\\s*$/.test(s.slice(i))) {\n\t\t\tthis.parse_error('statement_term');\n\t\t}\n\n\t\t// do not consume whitespace\n\t\tthis._b_trim_start = false;\n\n\t\t// resume here\n\t\tthis._f_state = this.statement_term;\n\n\t\t// store what is unparsed\n\t\tthis.s = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn 1;\n\t}\n\n\tpost_object() {\n\t\tlet {s, n, i} = this;\n\n\t\t// eat horizontal whitespace\n\t\tR_HWS.lastIndex = i;\n\t\tR_HWS.exec(s);\n\t\ti = R_HWS.lastIndex;\n\n\t\t// ran out of characters\n\t\tif(i >= n) {\n\t\t\t// resume here\n\t\t\tthis._f_state = this.post_object;\n\n\t\t\t// store what is unparsed\n\t\t\tthis.s = s.slice(i);\n\n\t\t\t// if we're not parsing a stream, then this is an error\n\t\t\tif(this.eos) this.eos();\n\t\t\treturn 1;\n\t\t}\n\n\t\t// depending on char\n\t\tswitch(s[i]) {\n\t\t\t// statement term\n\t\t\tcase '.': {\n\t\t\t\t// advance index beyond terminator\n\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t// emit data event\n\t\t\t\tthis._f_data_quad(this._kt_subject, this._kt_predicate, this._kt_object, this._kt_default_graph);\n\n\t\t\t\t// reset state\n\t\t\t\treturn this.statement;\n\t\t\t}\n\n\t\t\t// graph\n\t\t\tcase '<':\n\t\t\tcase '_': {\n\t\t\t\t// save index\n\t\t\t\tthis.i = i;\n\n\t\t\t\t// consume graph component\n\t\t\t\treturn this.graph();\n\t\t\t}\n\n\t\t\t// invalid\n\t\t\tdefault: {\n\t\t\t\t// save index\n\t\t\t\tthis.i = i;\n\n\t\t\t\t// emit parsing error\n\t\t\t\tthis.parse_error('post_object');\n\t\t\t}\n\t\t}\n\t}\n\n\tgraph() {\n\t\tlet {s, n, i} = this;\n\n\n\t\t// prepare sticky regex index\n\t\tR_IRIREF.lastIndex = i;\n\t\t// execute regex\n\t\tlet m_iriref = R_IRIREF.exec(s);\n\n\t\t// regex was a match\n\t\tif(m_iriref) {\n\t\t\t// advance index\n\t\t\tthis.i = R_IRIREF.lastIndex;\n\t\t\t// create graph term\n\t\t\tlet kt_graph = this.create_named_node(m_iriref[1]);\n\n\t\t\t// emit data event\n\t\t\tthis._f_data_quad(this._kt_subject, this._kt_predicate, this._kt_object, kt_graph);\n\n\t\t\t// complete with statement_term\n\t\t\treturn this.statement_term();\n\t\t}\n\t\telse {\n\t\t\t// prepare sticky regex index\n\t\t\tR_BLANK_NODE.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_blank = R_BLANK_NODE.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_blank) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_BLANK_NODE.lastIndex;\n\t\t\t\t// create graph term\n\t\t\t\tlet kt_graph = this._dc_factory.blankNode(m_blank[1]);\n\n\t\t\t\t// emit data event\n\t\t\t\tthis._f_data_quad(this._kt_subject, this._kt_predicate, this._kt_object, kt_graph);\n\n\t\t\t\t// complete with statement_term\n\t\t\t\treturn this.statement_term();\n\t\t\t}\n\t\t} // brace #1\n\n\n\t\t// resume here\n\t\tthis._f_state = this.graph;\n\n\t\t// store what is unparsed\n\t\tthis.s = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn 1;\n\t}\n\n\tparse_error(s_state) {\n\t\treturn this._error(`Failed to read ${s_state}:\\n\\`${this.s.substr(this.i, 80).replace(/\\n/g, '\\u23CE')} [...]\\`\\n ^ starting here`);\n\t}\n\n\tdestroy(e_destroy) {\n\t\tthis._f_data_quad = () => {};\n\n\t\tif(!e_destroy && this._ds_input) {\n\t\t\tthis._ds_input.destroy(e_destroy);\n\t\t}\n\n\t\tthis.transform.demolish(e_destroy);\n\t}\n}\n\n\nmodule.exports = function(...a_args) {\n\tlet g_config = {};\n\n\t// at least one argument\n\tif(a_args.length) {\n\t\tlet z_arg_0 = a_args[0];\n\n\t\t// input given unspecified\n\t\tif(z_arg_0 && z_arg_0.input && 'undefined' === typeof z_arg_0.input.string && !z_arg_0.input.stream) {\n\t\t\tz_arg_0 = z_arg_0.input;\n\t\t}\n\n\t\t// string\n\t\tif('string' === typeof z_arg_0) {\n\t\t\tg_config.input = {string:z_arg_0};\n\t\t}\n\t\t// null\n\t\telse if(null === z_arg_0) {\n\t\t\tg_config.input = null;\n\t\t}\n\t\t// node stream\n\t\telse if('function' === typeof z_arg_0.setEncoding) {\n\t\t\tg_config.input = {stream:z_arg_0};\n\t\t}\n\t\t// whatwg stream\n\t\telse if('function' === typeof z_arg_0.pipeTo) {\n\t\t\tthrow new TypeError(`Sorry, WHATWG streams are currently not supported :(`);\n\t\t// g_config.input = {stream:z_arg_0};\n\t\t}\n\t\t// config struct\n\t\telse if(z_arg_0 && 'object' === typeof z_arg_0 && '[object Object]' === Object.prototype.toString.call(z_arg_0)) {\n\t\t\tg_config = z_arg_0;\n\n\t\t\t// more args; invalid\n\t\t\tif(a_args.length > 1) {\n\t\t\t\tthrow new TypeError(`unexpected argument(s) after config struct: ${a_args.slice(1)}`);\n\t\t\t}\n\t\t}\n\t\t// unknown\n\t\telse {\n\t\t\tthrow new TypeError(`unexpected input type: ${z_arg_0}`);\n\t\t}\n\n\t\t// more args\n\t\tif(a_args.length > 1) {\n\t\t\t// copy onto struct\n\t\t\tObject.assign(g_config, a_args[1]);\n\n\t\t\t// more args\n\t\t\tif(a_args.length > 2) {\n\t\t\t\tthrow new TypeError(`unexpected argument(s) after input and config struct: ${a_args.slice(2)}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// create reader, return transform stream\n\treturn (new Reader(g_config)).transform;\n};\n","const stream = require('readable-stream');\n\n\n\nclass Readable extends stream.Readable {\n\tconstructor(gc_readable={}) {\n\t\tsuper(gc_readable);\n\n\t\t// use iterator\n\t\tif(gc_readable.iterator) {\n\t\t\tthrow new Error('readable stream iterator shortcut not yet implemented');\n\t\t}\n\t}\n\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass Writable extends stream.Writable {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\t// rdfjs impl\n\timport(ds_source) {\n\t\tds_source\n\t\t\t.on('data', w_chunk => this.write(w_chunk))\n\t\t\t.on('end', () => this.end())\n\t\t\t.on('error', e_read => this.emit('error', e_read));\n\n\t\treturn this;\n\t}\n}\n\nclass Duplex extends stream.Duplex {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass Transform extends stream.Transform {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\n\t// rdfjs impl\n\timport(ds_source) {\n\t\tds_source\n\t\t\t.on('data', w_chunk => this.write(w_chunk))\n\t\t\t.on('end', () => this.end())\n\t\t\t.on('error', e_read => this.emit('error', e_read));\n\n\t\treturn this;\n\t}\n\n\tdemolish(e_destroy) {\n\t\t// do not allow to push\n\t\tthis.push = (z_chunk) => {\n\t\t\t// ignore eof signals from node core\n\t\t\tif(null === z_chunk) return;\n\n\t\t\t// anything else is bad\n\t\t\tthrow new Error(`[ERR_STREAM_DESTROYED]: Cannot push after stream was destroyed`);\n\t\t};\n\n\t\t// do not allow to emit 'end'\n\t\tthis.emit = function(s_event, ...a_args) {\n\t\t\tif('end' === s_event) return;\n\n\t\t\tObject.getPrototypeOf(this).emit.apply(this, [s_event, ...a_args]);\n\t\t};\n\n\t\t// an error was given, destroy the stream as well\n\t\tif(e_destroy) {\n\t\t\treturn stream.Transform.prototype.destroy.call(this, e_destroy);\n\t\t}\n\t}\n}\n\n// eslint-disable-next-line no-new-func\nconst b_is_node = (new Function(/* syntax: js */ `try {return this===global;}catch(e){return false;}`))();\n\n// deduce the runtime environment\nconst [B_BROWSER, B_BROWSERIFY] = (() => 'undefined' === typeof process\n\t? [true, false]\n\t: (process.browser\n\t\t? [true, true]\n\t\t: ('undefined' === process.versions || 'undefined' === process.versions.node\n\t\t\t? [true, false]\n\t\t\t: [false, false])))();\n\n// node.js or browserify; patch for node < v10\nif(B_BROWSERIFY || (b_is_node && (+(/^v(\\d+)/.exec(process.version)[1])) < 10)) {\n\t// override destroy methods\n\tTransform.prototype.destroy = Duplex.prototype.destroy = function(e_destroy, fke_destroy) {\n\t\tthis._readableState.destroyed = true;\n\t\tthis._writableState.destroyed = true;\n\n\t\tlet f_emit_close = () => {\n\t\t\tif(!this._writableState.emitClose) return;\n\t\t\tif(!this._readableState.emitClose) return;\n\t\t\tthis.emit('close');\n\t\t};\n\n\t\tthis._destroy(e_destroy || null, (e_destroy_re) => {\n\t\t\tif(!fke_destroy && e_destroy_re) {\n\t\t\t\tprocess.nextTick(() => {\n\t\t\t\t\tthis.emit('error', e_destroy_re);\n\t\t\t\t\tf_emit_close();\n\t\t\t\t});\n\t\t\t\tthis._writableState.errorEmitted = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tprocess.nextTick(f_emit_close);\n\t\t\t\tif(fke_destroy) fke_destroy(e_destroy_re);\n\t\t\t}\n\t\t});\n\n\t\treturn this;\n\t};\n\n\t// override default _destroy implementations\n\tTransform.prototype._destroy = Duplex.prototype._destroy = (e_destroy, fke_destroy) => fke_destroy(e_destroy);\n}\n\nclass QuadsToOther extends Transform {\n\tconstructor(gc_transform={}) {\n\t\tsuper({\n\t\t\t...gc_transform,\n\t\t\twritableObjectMode: true,\n\t\t\treadableObjectMode: true,\n\t\t});\n\n\t\tthis._as_inputs = new Set();\n\n\t\t// forward prefix and comment events\n\t\tthis.on('pipe', (ds_src) => {\n\t\t\tthis._as_inputs.add(ds_src);\n\n\t\t\tds_src\n\t\t\t\t.on('prefix', (...a_args) => {\n\t\t\t\t\tthis.emit('prefix', ...a_args);\n\t\t\t\t})\n\t\t\t\t.on('comment', (...a_args) => {\n\t\t\t\t\tthis.emit('comment', ...a_args);\n\t\t\t\t});\n\t\t});\n\n\t\tthis.on('unpipe', (ds_src) => {\n\t\t\tthis._as_inputs.delete(ds_src);\n\t\t});\n\t}\n\n\t_destroy() {\n\t\tfor(let ds_input of this._as_inputs) {\n\t\t\tds_input.destroy();\n\t\t}\n\t}\n}\n\nclass Quads_To_JSON_Transform extends QuadsToOther {\n\t// serializse json\n\t_transform(g_quad, s_encoding, fk_transform) {\n\t\tfk_transform(null, JSON.stringify(g_quad.isolate())+'\\n');\n\t}\n}\n\nclass Quads_To_Writable extends QuadsToOther {\n\t_transform(g_quad, s_encoding, fk_transform) {\n\t\tfk_transform(null, {\n\t\t\ttype: 'quad',\n\t\t\tvalue: g_quad,\n\t\t});\n\t}\n}\n\nTransform.QuadsToOther = QuadsToOther;\n\nmodule.exports = {\n\t...stream,\n\tReadable,\n\tWritable,\n\tDuplex,\n\tTransform,\n\n\tQuadsToOther,\n\n\t// create a transform from quad objects into JSON strings for trivial serialization\n\tquads_to_json() {\n\t\treturn new Quads_To_JSON_Transform();\n\t},\n\n\t// create a transform from quad objects into writable data events\n\tquads_to_writable() {\n\t\treturn new Quads_To_Writable();\n\t},\n\n\t// create a simple, single-event readable stream\n\tsource(w_push, s_encoding=null) {\n\t\t// encoding not explicit, string given; assume utf8\n\t\tif(!s_encoding && 'string' === typeof w_push) s_encoding = 'utf8';\n\n\t\t// readable\n\t\treturn new Readable({\n\t\t\tobjectMode: !s_encoding && 'string' !== typeof w_push && !Buffer.isBuffer(w_push),\n\n\t\t\tread() {\n\t\t\t\tthis.push(w_push, s_encoding);\n\t\t\t\tthis.push(null);\n\t\t\t},\n\t\t});\n\t},\n};\n"],"names":["queueMicrotask","dp_resolve","Promise","resolve","fk","then","catch","e_callback","setTimeout","e_define","stream","factory","RT_ABSOLUTE_IRI_VALID","RT_ABSOLUTE_IRI_ESCAPELESS_VALID","RT_NAMED_NODE_VALID","RT_NAMED_NODE_ESCAPELESS_VALID","R_UNICODE_ANY","F_REPLACE_UNICODE_ANY","s_","s_4","s_8","String","fromCodePoint","parseInt","R_CLEAN","R_CLEAN_COMMENTS","RT_HAS_ESCAPES","R_EOL","RT_BLANK_NODE_LABEL_VALID","RT_LANGUAGE_VALID","R_HWS","R_LANGTAG","R_IRIREF","F_REPLACE_STRLIT_CONTENTS","s_whitespace","s_auto","s_invalid","console","assert","Error","JSON","stringify","R_STRLIT_SHORT_CONTENTS_ESCAPES_HARD","R_STRLIT_SHORT_CONTENTS_ESCAPES_SOFT","unescape_literal_short_hard","s_literal","replace","unescape_literal_short_soft","m_incomplete","R_STRLIT_ESCAPE_INCOMPLETE","exec","i_safe","index","slice","R_STRLIT_SHORT_DOUBLE_TERM","RegExp_$lookbehind_polyfill","s_input","m_match","RegExp","prototype","call","this","i_start","length","mk_lookbehind_regex","e_compile","f_lookbehind","r_polyfill","f_polyfill","R_QUAD_ESCAPELESS_SP","R_QUAD","R_BLANK_NODE","NQuads_Reader","Transform","constructor","g_impls","super","decodeStrings","writableObjectMode","readableObjectMode","flush","transform","on","ds_input","_ds_input","setEncoding","pipe","ds_out","ds_dst","_writableState","objectMode","isGraphyWritable","quads_to_writable","quads_to_json","Reader","g_config","input","g_input","relax","b_relax","debug","b_debug","b_allow_relative_iris","allow_relative_iris","allowRelativeIRIs","allowRelativeIris","dc_factory","_dc_factory","adopt","dataFactory","data_factory","unfiltered","f_quad","_f_quad","quad","Object","assign","s","prepend","n","_b_debug","_b_relax","_b_destroyed","_b_trim_start","_f_state","statement","_kt_subject","_kt_predicate","_kt_object","_s_literal","_kt_default_graph","defaultGraph","_kt_rdfs_lang_string","namedNode","r_clean","_r_clean","relaxed","warn","stack","ds_transform","blankNode","languagedLiteral","rt_named_node_valid","rt_named_node_valid_escapeless","k_self","create_named_node","create_named_node_escapeless","create_blank_node","create_languaged_literal","p_iri","test","_error","s_label","s_contents","s_language","b_init","s_chunk","s_encoding","fk_chunk","emit","lastIndex","m_clean","emit_comments","i","parse","e_read","destroy","fk_flush","demolish","substr","name","_destroy","a_args","_f_data_quad","kt_subject","kt_predicate","kt_object","kt_graph","push","s_event","s_captured","a_comments","split","s_comment","bind","string","TypeError","end","_graphy_reader","s_message","error","comment","read","once","progress","eof","finish","data","f_sync","apply","f_data_quad","simpleLiteral","datatypedLiteral","kt_default_graph","m_statement_e_sp","b_graph_late","p_object","s_subject","z_bail","strlit_contents","kt_datatype","toLowerCase","s_graph","s_predicate","m_statement","m_term","i_term","s_dirty","datatype_or_langtag","s_clean","s_incomplete","max_token_length","parse_error","eos","x","m_langtag","post_object","graph","m_iriref","p_datatype","statement_term","i_stop","indexOf","m_blank","s_state","e_destroy","module","exports","z_arg_0","pipeTo","toString","Readable","gc_readable","iterator","until","b_return_stream","fk_until","fe_until","e_stream","bucket","g_readable","_readableState","fk_bucket","fe_bucket","a_data","Writable","write","w_event","s_write_encoding","fk_write","writev","a_chunks","fk_writev","s_data","join","ab_data","Buffer","from","ab_chunk","concat","import","ds_source","w_chunk","Duplex","z_chunk","getPrototypeOf","b_is_node","Function","B_BROWSER","B_BROWSERIFY","process","browser","versions","node","version","fke_destroy","destroyed","f_emit_close","emitClose","e_destroy_re","nextTick","errorEmitted","QuadsToOther","gc_transform","_as_inputs","Set","ds_src","add","delete","Quads_To_JSON_Transform","_transform","g_quad","fk_transform","isolate","Quads_To_Writable","type","value","source","w_push","isBuffer"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/420.14eb6617.js b/dist/js/420.fb240bdb.js similarity index 97% rename from dist/js/420.14eb6617.js rename to dist/js/420.fb240bdb.js index 52f7612..a02b308 100644 --- a/dist/js/420.14eb6617.js +++ b/dist/js/420.fb240bdb.js @@ -1,2 +1,2 @@ (self["webpackChunkmobilitydcatap_ui"]=self["webpackChunkmobilitydcatap_ui"]||[]).push([[420],{46420:function(t,e,s){const r=s(69162),a=s(19488);class n extends a{constructor(t){super(r,t)}}t.exports=n},86505:function(t){class e{constructor(t){this.stream=t,this.array=[]}push(t){this.array.push(t)}end(){this.stream.push(this.array),this.stream.push(null)}}t.exports=e},69162:function(t,e,s){const r=s(28399),a=s(86505),n=s(85863);class i extends r{constructor(t,{encoding:e="object"}={}){if(super({objectMode:!0,read:()=>{}}),"object"===e&&(this.encoder=new a(this)),"string"===e&&(this.encoder=new n(this)),!this.encoder)throw new Error(`unknown encoding: ${e}`);t.on("data",(t=>{const e={};let s=e;"DefaultGraph"!==t.graph.termType&&(e["@id"]=t.graph.value,e["@graph"]={},s=e["@graph"]),s["@id"]=i.subjectValue(t.subject),"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===t.predicate.value?s["@type"]=i.subjectValue(t.object):s[t.predicate.value]=i.objectValue(t.object),this.encoder.push(e)})),t.on("end",(()=>this.encoder.end())),t.on("error",(t=>this.emit("error",t)))}static subjectValue(t){return"BlankNode"===t.termType?"_:"+t.value:t.value}static objectValue(t){return"NamedNode"===t.termType?{"@id":t.value}:"BlankNode"===t.termType?{"@id":"_:"+t.value}:t.language?{"@language":t.language,"@value":t.value}:t.datatype&&"http://www.w3.org/2001/XMLSchema#string"!==t.datatype.value?{"@type":t.datatype.value,"@value":t.value}:t.value}}t.exports=i},85863:function(t){class e{constructor(t){this.stream=t,this.first=!0,this.stream.push("[")}push(t){this.first?this.first=!1:this.stream.push(","),this.stream.push(JSON.stringify(t))}end(){this.stream.push("]"),this.stream.push(null)}}t.exports=e},19488:function(t){class e{constructor(t,e){this.Impl=t,this.options=e}import(t,e){const s=new this.Impl(t,Object.assign({},this.options,e));return t.on("end",(()=>{s.readable||s.emit("end")})),t.on("error",(t=>{s.emit("error",t)})),s}}t.exports=e}}]); -//# sourceMappingURL=420.14eb6617.js.map \ No newline at end of file +//# sourceMappingURL=420.fb240bdb.js.map \ No newline at end of file diff --git a/dist/js/420.14eb6617.js.map b/dist/js/420.fb240bdb.js.map similarity index 99% rename from dist/js/420.14eb6617.js.map rename to dist/js/420.fb240bdb.js.map index a8ba836..920c6e5 100644 --- a/dist/js/420.14eb6617.js.map +++ b/dist/js/420.fb240bdb.js.map @@ -1 +1 @@ -{"version":3,"file":"js/420.14eb6617.js","mappings":"qHAAA,MAAMA,EAAmB,EAAQ,OAC3BC,EAAO,EAAQ,OAErB,MAAMC,UAAmBD,EACvB,WAAAE,CAAaC,GACXC,MAAML,EAAkBI,EAC1B,EAGFE,EAAOC,QAAUL,C,oBCTjB,MAAMM,EACJ,WAAAL,CAAaM,GACXC,KAAKD,OAASA,EACdC,KAAKC,MAAQ,EACf,CAEA,IAAAC,CAAMC,GACJH,KAAKC,MAAMC,KAAKC,EAClB,CAEA,GAAAC,GACEJ,KAAKD,OAAOG,KAAKF,KAAKC,OACtBD,KAAKD,OAAOG,KAAK,KACnB,EAGFN,EAAOC,QAAUC,C,wBChBjB,MAAMO,EAA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DI,EAAOJ,KAElB,EAGFtB,EAAOC,QAAUP,C,oBCxEjB,MAAMgB,EACJ,WAAAb,CAAaM,GACXC,KAAKD,OAASA,EACdC,KAAK4B,OAAQ,EAEb5B,KAAKD,OAAOG,KAAK,IACnB,CAEA,IAAAA,CAAMC,GACAH,KAAK4B,MACP5B,KAAK4B,OAAQ,EAEb5B,KAAKD,OAAOG,KAAK,KAGnBF,KAAKD,OAAOG,KAAK2B,KAAKC,UAAU3B,GAClC,CAEA,GAAAC,GACEJ,KAAKD,OAAOG,KAAK,KACjBF,KAAKD,OAAOG,KAAK,KACnB,EAGFN,EAAOC,QAAUS,C,oBCxBjB,MAAMf,EACJ,WAAAE,CAAasC,EAAMrC,GACjBM,KAAK+B,KAAOA,EACZ/B,KAAKN,QAAUA,CACjB,CAEA,MAAAsC,CAAQzB,EAAOb,GACb,MAAMuC,EAAS,IAAIjC,KAAK+B,KAAKxB,EAAO2B,OAAOC,OAAO,CAAC,EAAGnC,KAAKN,QAASA,IAYpE,OAVAa,EAAMM,GAAG,OAAO,KACToB,EAAOG,UACVH,EAAOR,KAAK,MACd,IAGFlB,EAAMM,GAAG,SAAUW,IACjBS,EAAOR,KAAK,QAASD,EAAG,IAGnBS,CACT,EAGFrC,EAAOC,QAAUN,C","sources":["webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld/index.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld/lib/ObjectEncoder.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld/lib/SerializerStream.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld/lib/StringEncoder.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/sink/index.js"],"sourcesContent":["const SerializerStream = require('./lib/SerializerStream')\nconst Sink = require('@rdfjs/sink')\n\nclass Serializer extends Sink {\n constructor (options) {\n super(SerializerStream, options)\n }\n}\n\nmodule.exports = Serializer\n","class ObjectEncoder {\n constructor (stream) {\n this.stream = stream\n this.array = []\n }\n\n push (jsonld) {\n this.array.push(jsonld)\n }\n\n end () {\n this.stream.push(this.array)\n this.stream.push(null)\n }\n}\n\nmodule.exports = ObjectEncoder\n","const Readable = require('readable-stream')\nconst ObjectEncoder = require('./ObjectEncoder')\nconst StringEncoder = require('./StringEncoder')\n\nclass SerializerStream extends Readable {\n constructor (input, { encoding = 'object' } = {}) {\n super({\n objectMode: true,\n read: () => {}\n })\n\n if (encoding === 'object') {\n this.encoder = new ObjectEncoder(this)\n }\n\n if (encoding === 'string') {\n this.encoder = new StringEncoder(this)\n }\n\n if (!this.encoder) {\n throw new Error(`unknown encoding: ${encoding}`)\n }\n\n input.on('data', quad => {\n const jsonld = {}\n let triple = jsonld\n\n if (quad.graph.termType !== 'DefaultGraph') {\n jsonld['@id'] = quad.graph.value\n jsonld['@graph'] = {}\n triple = jsonld['@graph']\n }\n\n triple['@id'] = SerializerStream.subjectValue(quad.subject)\n\n if (quad.predicate.value === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type') {\n triple['@type'] = SerializerStream.subjectValue(quad.object)\n } else {\n triple[quad.predicate.value] = SerializerStream.objectValue(quad.object)\n }\n\n this.encoder.push(jsonld)\n })\n\n input.on('end', () => this.encoder.end())\n\n input.on('error', err => this.emit('error', err))\n }\n\n static subjectValue (subject) {\n return subject.termType === 'BlankNode' ? '_:' + subject.value : subject.value\n }\n\n static objectValue (object) {\n if (object.termType === 'NamedNode') {\n return { '@id': object.value }\n }\n\n if (object.termType === 'BlankNode') {\n return { '@id': '_:' + object.value }\n }\n\n if (object.language) {\n return { '@language': object.language, '@value': object.value }\n } else if (object.datatype && object.datatype.value !== 'http://www.w3.org/2001/XMLSchema#string') {\n return { '@type': object.datatype.value, '@value': object.value }\n } else {\n return object.value\n }\n }\n}\n\nmodule.exports = SerializerStream\n","class StringEncoder {\n constructor (stream) {\n this.stream = stream\n this.first = true\n\n this.stream.push('[')\n }\n\n push (jsonld) {\n if (this.first) {\n this.first = false\n } else {\n this.stream.push(',')\n }\n\n this.stream.push(JSON.stringify(jsonld))\n }\n\n end () {\n this.stream.push(']')\n this.stream.push(null)\n }\n}\n\nmodule.exports = StringEncoder\n","class Sink {\n constructor (Impl, options) {\n this.Impl = Impl\n this.options = options\n }\n\n import (input, options) {\n const output = new this.Impl(input, Object.assign({}, this.options, options))\n\n input.on('end', () => {\n if (!output.readable) {\n output.emit('end')\n }\n })\n\n input.on('error', (err) => {\n output.emit('error', err)\n })\n\n return output\n }\n}\n\nmodule.exports = Sink\n"],"names":["SerializerStream","Sink","Serializer","constructor","options","super","module","exports","ObjectEncoder","stream","this","array","push","jsonld","end","Readable","StringEncoder","input","encoding","objectMode","read","encoder","Error","on","quad","triple","graph","termType","value","subjectValue","subject","predicate","object","objectValue","err","emit","language","datatype","first","JSON","stringify","Impl","import","output","Object","assign","readable"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"js/420.fb240bdb.js","mappings":"qHAAA,MAAMA,EAAmB,EAAQ,OAC3BC,EAAO,EAAQ,OAErB,MAAMC,UAAmBD,EACvB,WAAAE,CAAaC,GACXC,MAAML,EAAkBI,EAC1B,EAGFE,EAAOC,QAAUL,C,oBCTjB,MAAMM,EACJ,WAAAL,CAAaM,GACXC,KAAKD,OAASA,EACdC,KAAKC,MAAQ,EACf,CAEA,IAAAC,CAAMC,GACJH,KAAKC,MAAMC,KAAKC,EAClB,CAEA,GAAAC,GACEJ,KAAKD,OAAOG,KAAKF,KAAKC,OACtBD,KAAKD,OAAOG,KAAK,KACnB,EAGFN,EAAOC,QAAUC,C,wBChBjB,MAAMO,EAAW,EAAQ,OACnBP,EAAgB,EAAQ,OACxBQ,EAAgB,EAAQ,OAE9B,MAAMhB,UAAyBe,EAC7B,WAAAZ,CAAac,GAAO,SAAEC,EAAW,UAAa,CAAC,GAc7C,GAbAb,MAAM,CACJc,YAAY,EACZC,KAAM,SAGS,WAAbF,IACFR,KAAKW,QAAU,IAAIb,EAAcE,OAGlB,WAAbQ,IACFR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,KAGnBF,KAAKD,OAAOG,KAAK2B,KAAKC,UAAU3B,GAClC,CAEA,GAAAC,GACEJ,KAAKD,OAAOG,KAAK,KACjBF,KAAKD,OAAOG,KAAK,KACnB,EAGFN,EAAOC,QAAUS,C,oBCxBjB,MAAMf,EACJ,WAAAE,CAAasC,EAAMrC,GACjBM,KAAK+B,KAAOA,EACZ/B,KAAKN,QAAUA,CACjB,CAEA,MAAAsC,CAAQzB,EAAOb,GACb,MAAMuC,EAAS,IAAIjC,KAAK+B,KAAKxB,EAAO2B,OAAOC,OAAO,CAAC,EAAGnC,KAAKN,QAASA,IAYpE,OAVAa,EAAMM,GAAG,OAAO,KACToB,EAAOG,UACVH,EAAOR,KAAK,MACd,IAGFlB,EAAMM,GAAG,SAAUW,IACjBS,EAAOR,KAAK,QAASD,EAAG,IAGnBS,CACT,EAGFrC,EAAOC,QAAUN,C","sources":["webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld/index.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld/lib/ObjectEncoder.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld/lib/SerializerStream.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld/lib/StringEncoder.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/sink/index.js"],"sourcesContent":["const SerializerStream = require('./lib/SerializerStream')\nconst Sink = require('@rdfjs/sink')\n\nclass Serializer extends Sink {\n constructor (options) {\n super(SerializerStream, options)\n }\n}\n\nmodule.exports = Serializer\n","class ObjectEncoder {\n constructor (stream) {\n this.stream = stream\n this.array = []\n }\n\n push (jsonld) {\n this.array.push(jsonld)\n }\n\n end () {\n this.stream.push(this.array)\n this.stream.push(null)\n }\n}\n\nmodule.exports = ObjectEncoder\n","const Readable = require('readable-stream')\nconst ObjectEncoder = require('./ObjectEncoder')\nconst StringEncoder = require('./StringEncoder')\n\nclass SerializerStream extends Readable {\n constructor (input, { encoding = 'object' } = {}) {\n super({\n objectMode: true,\n read: () => {}\n })\n\n if (encoding === 'object') {\n this.encoder = new ObjectEncoder(this)\n }\n\n if (encoding === 'string') {\n this.encoder = new StringEncoder(this)\n }\n\n if (!this.encoder) {\n throw new Error(`unknown encoding: ${encoding}`)\n }\n\n input.on('data', quad => {\n const jsonld = {}\n let triple = jsonld\n\n if (quad.graph.termType !== 'DefaultGraph') {\n jsonld['@id'] = quad.graph.value\n jsonld['@graph'] = {}\n triple = jsonld['@graph']\n }\n\n triple['@id'] = SerializerStream.subjectValue(quad.subject)\n\n if (quad.predicate.value === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type') {\n triple['@type'] = SerializerStream.subjectValue(quad.object)\n } else {\n triple[quad.predicate.value] = SerializerStream.objectValue(quad.object)\n }\n\n this.encoder.push(jsonld)\n })\n\n input.on('end', () => this.encoder.end())\n\n input.on('error', err => this.emit('error', err))\n }\n\n static subjectValue (subject) {\n return subject.termType === 'BlankNode' ? '_:' + subject.value : subject.value\n }\n\n static objectValue (object) {\n if (object.termType === 'NamedNode') {\n return { '@id': object.value }\n }\n\n if (object.termType === 'BlankNode') {\n return { '@id': '_:' + object.value }\n }\n\n if (object.language) {\n return { '@language': object.language, '@value': object.value }\n } else if (object.datatype && object.datatype.value !== 'http://www.w3.org/2001/XMLSchema#string') {\n return { '@type': object.datatype.value, '@value': object.value }\n } else {\n return object.value\n }\n }\n}\n\nmodule.exports = SerializerStream\n","class StringEncoder {\n constructor (stream) {\n this.stream = stream\n this.first = true\n\n this.stream.push('[')\n }\n\n push (jsonld) {\n if (this.first) {\n this.first = false\n } else {\n this.stream.push(',')\n }\n\n this.stream.push(JSON.stringify(jsonld))\n }\n\n end () {\n this.stream.push(']')\n this.stream.push(null)\n }\n}\n\nmodule.exports = StringEncoder\n","class Sink {\n constructor (Impl, options) {\n this.Impl = Impl\n this.options = options\n }\n\n import (input, options) {\n const output = new this.Impl(input, Object.assign({}, this.options, options))\n\n input.on('end', () => {\n if (!output.readable) {\n output.emit('end')\n }\n })\n\n input.on('error', (err) => {\n output.emit('error', err)\n })\n\n return output\n }\n}\n\nmodule.exports = Sink\n"],"names":["SerializerStream","Sink","Serializer","constructor","options","super","module","exports","ObjectEncoder","stream","this","array","push","jsonld","end","Readable","StringEncoder","input","encoding","objectMode","read","encoder","Error","on","quad","triple","graph","termType","value","subjectValue","subject","predicate","object","objectValue","err","emit","language","datatype","first","JSON","stringify","Impl","import","output","Object","assign","readable"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/43.d0b4a88a.js b/dist/js/43.fb5b896b.js similarity index 98% rename from dist/js/43.d0b4a88a.js rename to dist/js/43.fb5b896b.js index fad44af..699120f 100644 --- a/dist/js/43.d0b4a88a.js +++ b/dist/js/43.fb5b896b.js @@ -1,2 +1,2 @@ "use strict";(self["webpackChunkmobilitydcatap_ui"]=self["webpackChunkmobilitydcatap_ui"]||[]).push([[43],{8043:function(t,r,e){e.r(r),e.d(r,{default:function(){return R}});var n=e(86397);function u(t){return"_:"+t.value}var a=u;function o(t,r){return[...t].map((t=>r(t))).join("\n")+"\n"}var i=o;function c(){return""}var s=c;function f(t){return"<"+t.value+">"}var l=f;const p=/["\\\\\n\r]/,d=/["\\\\\n\r]/g,m={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function w(t){return m[t]}function h(t){return p.test(t)?t.replace(d,w):t}function v(t){const r=h(t.value);return"http://www.w3.org/2001/XMLSchema#string"===t.datatype.value?'"'+r+'"':"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"===t.datatype.value?'"'+r+'"@'+t.language:'"'+r+'"^^'+l(t.datatype)}var y=v;function b(t,r){const e=r(t.subject),n=r(t.predicate),u=r(t.object),a=r(t.graph);return`${e} ${n} ${u} ${a?a+" ":""}.`}var g=b;function T(t){return"?"+t.value}var j=T;function k(t){if(!t)return null;if("BlankNode"===t.termType)return a(t);if("DefaultGraph"===t.termType)return s();if("Literal"===t.termType)return y(t);if("NamedNode"===t.termType)return l(t);if("Quad"===t.termType||t.subject&&t.predicate&&t.object&&t.graph)return g(t,k);if("Variable"===t.termType)return j(t);if(t[Symbol.iterator])return i(t,k);throw new Error(`unknown termType ${t.termType}`)}var $=k,S=e(46674),_=e(14088);class A{constructor(t){const r=new _.Transform({objectMode:!0,transform:(t,r,e)=>{e(null,`${$(t)}\n`)}});return t.pipe(r),(0,S.A)(r)}}var x=A;class N extends n.A{constructor(){super(x)}}var R=N},86397:function(t,r){class e{constructor(t,r){this.Impl=t,this.options=r}import(t,r){const e=new this.Impl(t,{...this.options,...r});return t.on("end",(()=>{e.readable||e.emit("end")})),t.on("error",(t=>{e.emit("error",t)})),e}}r.A=e},46674:function(t,r){const e=new Set(["_write","_writableState","writable"]);function n(t){return new Proxy(t,{has(t,r){return!e.has(r)&&Reflect.has(...arguments)},get(t,r){if(e.has(r))return;const n=Reflect.get(...arguments);return n&&"function"===typeof n.bind?n.bind(t):n},set(t,r,n){if(!e.has(r))return Reflect.set(...arguments)}})}r.A=n}}]); -//# sourceMappingURL=43.d0b4a88a.js.map \ No newline at end of file +//# sourceMappingURL=43.fb5b896b.js.map \ No newline at end of file diff --git a/dist/js/43.d0b4a88a.js.map b/dist/js/43.fb5b896b.js.map similarity index 99% rename from dist/js/43.d0b4a88a.js.map rename to dist/js/43.fb5b896b.js.map index d260403..f45765b 100644 --- a/dist/js/43.d0b4a88a.js.map +++ b/dist/js/43.fb5b896b.js.map @@ -1 +1 @@ -{"version":3,"file":"js/43.d0b4a88a.js","mappings":"4LAAA,SAASA,EAAWA,GAClB,MAAO,KAAOA,EAAUC,KAC1B,CAEA,QCJA,SAASC,EAASA,EAASC,GACzB,MAAO,IAAID,GAASE,KAAIC,GAAQF,EAAKE,KAAOC,KAAK,MAAQ,IAC3D,CAEA,QCJA,SAASC,IACP,MAAO,EACT,CAEA,QCJA,SAASC,EAAWA,GAClB,MAAO,IAAMA,EAAUP,MAAQ,GACjC,CAEA,QCFA,MAAMQ,EAAa,cACbC,EAAgB,eAEhBC,E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,sBCzCA,MAAMI,EACJ,WAAAC,CAAaC,GACX,MAAMC,EAAS,IAAI,EAAAC,UAAU,CAC3BC,YAAY,EACZC,UAAW,CAACpC,EAAMqC,EAAUC,KAC1BA,EAAS,KAAM,GAAG,EAAKtC,OAAS,IAMpC,OAFAgC,EAAMO,KAAKN,IAEJ,OAAWA,EACpB,EAGF,QChBA,MAAMO,UAAmB,IACvB,WAAAT,GACEU,MAAM,EACR,EAGF,O,sBCTA,MAAMC,EACJ,WAAAX,CAAaY,EAAMC,GACjBC,KAAKF,KAAOA,EACZE,KAAKD,QAAUA,CACjB,CAEA,MAAAE,CAAQd,EAAOY,GACb,MAAMG,EAAS,IAAIF,KAAKF,KAAKX,EAAO,IAAKa,KAAKD,WAAYA,IAY1D,OAVAZ,EAAMgB,GAAG,OAAO,KACTD,EAAOE,UACVF,EAAOG,KAAK,MACd,IAGFlB,EAAMgB,GAAG,SAASG,IAChBJ,EAAOG,KAAK,QAASC,EAAG,IAGnBJ,CACT,EAGF,K,sBCvBA,MAAMK,EAAY,IAAIC,IAAI,CAAC,SAAU,iBAAkB,aAEvD,SAASJ,EAAUK,GACjB,OAAO,IAAIC,MAAMD,EAAQ,CACvB,GAAAE,CAAKC,EAAQC,GACX,OAAIN,EAAUI,IAAIE,IAIXC,QAAQH,OAAOI,UACxB,EACA,GAAAC,CAAKJ,EAAQC,GACX,GAAIN,EAAUI,IAAIE,GAChB,OAGF,MAAMI,EAASH,QAAQE,OAAOD,WAE9B,OAAIE,GAAiC,oBAAhBA,EAAOC,KACnBD,EAAOC,KAAKN,GAGdK,CACT,EACA,GAAAE,CAAKP,EAAQC,EAAK9D,GAChB,IAAIwD,EAAUI,IAAIE,GAIlB,OAAOC,QAAQK,OAAOJ,UACxB,GAEJ,CAEA,K","sources":["webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/to-ntriples/lib/blankNode.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/to-ntriples/lib/dataset.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/to-ntriples/lib/defaultGraph.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/to-ntriples/lib/namedNode.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/to-ntriples/lib/literal.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/to-ntriples/lib/quad.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/to-ntriples/lib/variable.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/to-ntriples/index.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/serializer-ntriples/lib/SerializerStream.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/serializer-ntriples/index.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/sink/index.js","webpack://mobilitydcatap-ui/./node_modules/duplex-to/readable.js"],"sourcesContent":["function blankNode (blankNode) {\n return '_:' + blankNode.value // TODO: escape special chars\n}\n\nexport default blankNode\n","function dataset (dataset, toNT) {\n return [...dataset].map(quad => toNT(quad)).join('\\n') + '\\n'\n}\n\nexport default dataset\n","function defaultGraph () {\n return ''\n}\n\nexport default defaultGraph\n","function namedNode (namedNode) {\n return '<' + namedNode.value + '>'\n}\n\nexport default namedNode\n","import namedNode from './namedNode.js'\n\nconst echarRegEx = /[\"\\\\\\\\\\n\\r]/\nconst echarRegExAll = /[\"\\\\\\\\\\n\\r]/g\n\nconst echarReplacement = {\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\',\n '\\n': '\\\\n',\n '\\r': '\\\\r'\n}\n\nfunction echarReplacer (char) {\n return echarReplacement[char]\n}\n\nfunction escapeValue (value) {\n if (echarRegEx.test(value)) {\n return value.replace(echarRegExAll, echarReplacer)\n }\n\n return value\n}\n\nfunction literal (literal) {\n const escapedValue = escapeValue(literal.value)\n\n if (literal.datatype.value === 'http://www.w3.org/2001/XMLSchema#string') {\n return '\"' + escapedValue + '\"'\n }\n\n if (literal.datatype.value === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#langString') {\n return '\"' + escapedValue + '\"@' + literal.language\n }\n\n return '\"' + escapedValue + '\"^^' + namedNode(literal.datatype)\n}\n\nexport default literal\n","function quad (quad, toNT) {\n const subjectString = toNT(quad.subject)\n const predicateString = toNT(quad.predicate)\n const objectString = toNT(quad.object)\n const graphString = toNT(quad.graph)\n\n return `${subjectString} ${predicateString} ${objectString} ${graphString ? graphString + ' ' : ''}.`\n}\n\nexport default quad\n","function variable (variable) {\n return '?' + variable.value\n}\n\nexport default variable\n","import blankNode from './lib/blankNode.js'\nimport dataset from './lib/dataset.js'\nimport defaultGraph from './lib/defaultGraph.js'\nimport literal from './lib/literal.js'\nimport namedNode from './lib/namedNode.js'\nimport quad from './lib/quad.js'\nimport variable from './lib/variable.js'\n\nfunction toNT (term) {\n if (!term) {\n return null\n }\n\n if (term.termType === 'BlankNode') {\n return blankNode(term)\n }\n\n if (term.termType === 'DefaultGraph') {\n return defaultGraph()\n }\n\n if (term.termType === 'Literal') {\n return literal(term)\n }\n\n if (term.termType === 'NamedNode') {\n return namedNode(term)\n }\n\n // legacy quad support without .termType\n if (term.termType === 'Quad' || (term.subject && term.predicate && term.object && term.graph)) {\n return quad(term, toNT)\n }\n\n if (term.termType === 'Variable') {\n return variable(term)\n }\n\n if (term[Symbol.iterator]) {\n return dataset(term, toNT)\n }\n\n throw new Error(`unknown termType ${term.termType}`)\n}\n\nexport default toNT\n","import toNT from '@rdfjs/to-ntriples'\nimport toReadable from 'duplex-to/readable.js'\nimport { Transform } from 'readable-stream'\n\nclass SerializerStream {\n constructor (input) {\n const stream = new Transform({\n objectMode: true,\n transform: (quad, encoding, callback) => {\n callback(null, `${toNT(quad)}\\n`)\n }\n })\n\n input.pipe(stream)\n\n return toReadable(stream)\n }\n}\n\nexport default SerializerStream\n","import Sink from '@rdfjs/sink'\nimport SerializerStream from './lib/SerializerStream.js'\n\nclass Serializer extends Sink {\n constructor () {\n super(SerializerStream)\n }\n}\n\nexport default Serializer\n","class Sink {\n constructor (Impl, options) {\n this.Impl = Impl\n this.options = options\n }\n\n import (input, options) {\n const output = new this.Impl(input, { ...this.options, ...options })\n\n input.on('end', () => {\n if (!output.readable) {\n output.emit('end')\n }\n })\n\n input.on('error', err => {\n output.emit('error', err)\n })\n\n return output\n }\n}\n\nexport default Sink\n","const blackList = new Set(['_write', '_writableState', 'writable'])\n\nfunction readable (duplex) {\n return new Proxy(duplex, {\n has (target, key) {\n if (blackList.has(key)) {\n return false\n }\n\n return Reflect.has(...arguments)\n },\n get (target, key) {\n if (blackList.has(key)) {\n return undefined\n }\n\n const result = Reflect.get(...arguments)\n\n if (result && typeof result.bind === 'function') {\n return result.bind(target)\n }\n\n return result\n },\n set (target, key, value) {\n if (blackList.has(key)) {\n return undefined\n }\n\n return Reflect.set(...arguments)\n }\n })\n}\n\nexport default readable\n"],"names":["blankNode","value","dataset","toNT","map","quad","join","defaultGraph","namedNode","echarRegEx","echarRegExAll","echarReplacement","echarReplacer","char","escapeValue","test","replace","literal","escapedValue","datatype","language","subjectString","subject","predicateString","predicate","objectString","object","graphString","graph","variable","term","termType","Symbol","iterator","Error","SerializerStream","constructor","input","stream","Transform","objectMode","transform","encoding","callback","pipe","Serializer","super","Sink","Impl","options","this","import","output","on","readable","emit","err","blackList","Set","duplex","Proxy","has","target","key","Reflect","arguments","get","result","bind","set"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"js/43.fb5b896b.js","mappings":"4LAAA,SAASA,EAAWA,GAClB,MAAO,KAAOA,EAAUC,KAC1B,CAEA,QCJA,SAASC,EAASA,EAASC,GACzB,MAAO,IAAID,GAASE,KAAIC,GAAQF,EAAKE,KAA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,QAAQK,OAAOJ,UACxB,GAEJ,CAEA,K","sources":["webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/to-ntriples/lib/blankNode.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/to-ntriples/lib/dataset.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/to-ntriples/lib/defaultGraph.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/to-ntriples/lib/namedNode.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/to-ntriples/lib/literal.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/to-ntriples/lib/quad.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/to-ntriples/lib/variable.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/to-ntriples/index.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/serializer-ntriples/lib/SerializerStream.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/serializer-ntriples/index.js","webpack://mobilitydcatap-ui/./node_modules/@zazuko/formats-lazy/node_modules/@rdfjs/sink/index.js","webpack://mobilitydcatap-ui/./node_modules/duplex-to/readable.js"],"sourcesContent":["function blankNode (blankNode) {\n return '_:' + blankNode.value // TODO: escape special chars\n}\n\nexport default blankNode\n","function dataset (dataset, toNT) {\n return [...dataset].map(quad => toNT(quad)).join('\\n') + '\\n'\n}\n\nexport default dataset\n","function defaultGraph () {\n return ''\n}\n\nexport default defaultGraph\n","function namedNode (namedNode) {\n return '<' + namedNode.value + '>'\n}\n\nexport default namedNode\n","import namedNode from './namedNode.js'\n\nconst echarRegEx = /[\"\\\\\\\\\\n\\r]/\nconst echarRegExAll = /[\"\\\\\\\\\\n\\r]/g\n\nconst echarReplacement = {\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\',\n '\\n': '\\\\n',\n '\\r': '\\\\r'\n}\n\nfunction echarReplacer (char) {\n return echarReplacement[char]\n}\n\nfunction escapeValue (value) {\n if (echarRegEx.test(value)) {\n return value.replace(echarRegExAll, echarReplacer)\n }\n\n return value\n}\n\nfunction literal (literal) {\n const escapedValue = escapeValue(literal.value)\n\n if (literal.datatype.value === 'http://www.w3.org/2001/XMLSchema#string') {\n return '\"' + escapedValue + '\"'\n }\n\n if (literal.datatype.value === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#langString') {\n return '\"' + escapedValue + '\"@' + literal.language\n }\n\n return '\"' + escapedValue + '\"^^' + namedNode(literal.datatype)\n}\n\nexport default literal\n","function quad (quad, toNT) {\n const subjectString = toNT(quad.subject)\n const predicateString = toNT(quad.predicate)\n const objectString = toNT(quad.object)\n const graphString = toNT(quad.graph)\n\n return `${subjectString} ${predicateString} ${objectString} ${graphString ? graphString + ' ' : ''}.`\n}\n\nexport default quad\n","function variable (variable) {\n return '?' + variable.value\n}\n\nexport default variable\n","import blankNode from './lib/blankNode.js'\nimport dataset from './lib/dataset.js'\nimport defaultGraph from './lib/defaultGraph.js'\nimport literal from './lib/literal.js'\nimport namedNode from './lib/namedNode.js'\nimport quad from './lib/quad.js'\nimport variable from './lib/variable.js'\n\nfunction toNT (term) {\n if (!term) {\n return null\n }\n\n if (term.termType === 'BlankNode') {\n return blankNode(term)\n }\n\n if (term.termType === 'DefaultGraph') {\n return defaultGraph()\n }\n\n if (term.termType === 'Literal') {\n return literal(term)\n }\n\n if (term.termType === 'NamedNode') {\n return namedNode(term)\n }\n\n // legacy quad support without .termType\n if (term.termType === 'Quad' || (term.subject && term.predicate && term.object && term.graph)) {\n return quad(term, toNT)\n }\n\n if (term.termType === 'Variable') {\n return variable(term)\n }\n\n if (term[Symbol.iterator]) {\n return dataset(term, toNT)\n }\n\n throw new Error(`unknown termType ${term.termType}`)\n}\n\nexport default toNT\n","import toNT from '@rdfjs/to-ntriples'\nimport toReadable from 'duplex-to/readable.js'\nimport { Transform } from 'readable-stream'\n\nclass SerializerStream {\n constructor (input) {\n const stream = new Transform({\n objectMode: true,\n transform: (quad, encoding, callback) => {\n callback(null, `${toNT(quad)}\\n`)\n }\n })\n\n input.pipe(stream)\n\n return toReadable(stream)\n }\n}\n\nexport default SerializerStream\n","import Sink from '@rdfjs/sink'\nimport SerializerStream from './lib/SerializerStream.js'\n\nclass Serializer extends Sink {\n constructor () {\n super(SerializerStream)\n }\n}\n\nexport default Serializer\n","class Sink {\n constructor (Impl, options) {\n this.Impl = Impl\n this.options = options\n }\n\n import (input, options) {\n const output = new this.Impl(input, { ...this.options, ...options })\n\n input.on('end', () => {\n if (!output.readable) {\n output.emit('end')\n }\n })\n\n input.on('error', err => {\n output.emit('error', err)\n })\n\n return output\n }\n}\n\nexport default Sink\n","const blackList = new Set(['_write', '_writableState', 'writable'])\n\nfunction readable (duplex) {\n return new Proxy(duplex, {\n has (target, key) {\n if (blackList.has(key)) {\n return false\n }\n\n return Reflect.has(...arguments)\n },\n get (target, key) {\n if (blackList.has(key)) {\n return undefined\n }\n\n const result = Reflect.get(...arguments)\n\n if (result && typeof result.bind === 'function') {\n return result.bind(target)\n }\n\n return result\n },\n set (target, key, value) {\n if (blackList.has(key)) {\n return undefined\n }\n\n return Reflect.set(...arguments)\n }\n })\n}\n\nexport default readable\n"],"names":["blankNode","value","dataset","toNT","map","quad","join","defaultGraph","namedNode","echarRegEx","echarRegExAll","echarReplacement","echarReplacer","char","escapeValue","test","replace","literal","escapedValue","datatype","language","subjectString","subject","predicateString","predicate","objectString","object","graphString","graph","variable","term","termType","Symbol","iterator","Error","SerializerStream","constructor","input","stream","Transform","objectMode","transform","encoding","callback","pipe","Serializer","super","Sink","Impl","options","this","import","output","on","readable","emit","err","blackList","Set","duplex","Proxy","has","target","key","Reflect","arguments","get","result","bind","set"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/49.11942c3a.js b/dist/js/49.f2c20221.js similarity index 99% rename from dist/js/49.11942c3a.js rename to dist/js/49.f2c20221.js index ac53c8c..0462fa9 100644 --- a/dist/js/49.11942c3a.js +++ b/dist/js/49.f2c20221.js @@ -1,2 +1,2 @@ (self["webpackChunkmobilitydcatap_ui"]=self["webpackChunkmobilitydcatap_ui"]||[]).push([[49],{47328:function(e,t,r){if("function"!==typeof queueMicrotask){let e=Promise.resolve();try{queueMicrotask=t=>e.then(t).catch((e=>setTimeout((()=>{throw e}),0)))}catch(a){}}const i=r(76063),s=r(41476),n=32768;class o extends s.Transform{static _flush_buffer(e){e._s_push&&(e.push(e._s_push),e._s_push="")}constructor(e={}){super({writableObjectMode:!0,readableObjectMode:!1});let{prefixes:t={}}=e;this._s_push="",this._n_max_buffer=e.max_buffer||e.maxBuffer||n,this._h_prefixes=i.cache_prefixes(t||{}),this.on("pipe",(e=>{e.on("prefix",((e,t)=>{this.write({type:"prefixes",value:{[e]:t}})})),e.on("comment",(e=>{this.write({type:"comment",value:e})}))})),e.close&&this.once("close",e.close),e.drain&&this.on("drain",e.drain),e.error&&this.on("error",e.error),e.finish&&this.once("finish",e.finish),e.data&&this.on("data",e.data),e.end&&this.once("end",e.end),e.warning&&this.on("warning",e.warning)}_serialize_hash_comment(e){return"# "+e.replace(/\n/g,"\n# ")+"\n"}_serialize_newlines(e=1){return"\n".repeat(e)}_serialize_c4r(e){let t=this._h_prefixes,r=[],s="";for(let i in e)"*"!==i&&r.push(i),s+=this._serialize_c3r(e[i]);if(r.length){let e=`Destination format does not support quads; an implicit union into the default graph was performed on the quads contained in graphs: ${r.map((e=>i.c1(e,t).verbose())).join(", ")}`;this.emit("warning",e)||console.warn(e)}return s}_serialize_c3(){throw new Error(`Write event type 'c3' not supported by ${this.constructor.name}`)}_serialize_c4(){throw new Error(`Write event type 'c4' not supported by ${this.constructor.name}`)}_serialize_c3r(){throw new Error(`Write event type 'c3r' should have been implemented by subclass ${this.constructor.name}`)}_serialize_quad(){throw new Error(`Write event type 'quad' should have been implemented by subclass ${this.constructor.name}`)}_serialize_comment(){}_update_prefixes(e,t=!1){let r={...this._h_prefixes,...e};this._h_prefixes=i.cachePrefixes(r||{},t)}_transform(e,t,r){let i;try{i=this.serialize(e)}catch(s){return r(s),s}if(i)o._flush_buffer(this),this.push(i);else{let e=this._s_push.length;e>this._n_max_buffer?o._flush_buffer(this):e&&queueMicrotask((()=>o._flush_buffer(this)))}r()}_queue(e){this._s_push+=e,this._s_push.length>this._n_max_buffer?o._flush_buffer(this):queueMicrotask((()=>o._flush_buffer(this)))}serialize(e){switch(e.type){case void 0:return this._serialize_quad(e);case"c3r":return this._serialize_c3r(e.value);case"c4r":return this._serialize_c4r(e.value);case"array":{let t="";for(let r of e.value){let e=this.serialize(r);e?t+=e:this._s_push&&(t+=this._s_push,this._s_push="")}return t}case"quad":return this._serialize_quad(e.value);case"c3":return this._serialize_c3(e.value);case"c4":return this._serialize_c4(e.value);case"prefixes":return this._serialize_prefixes(e.value);case"comment":return this._serialize_comment(e.value);case"newline":case"newlines":return this._serialize_newlines(e.value);default:throw new Error(`no such writable data event type for RDF stream: '${e.type}'`)}}rinse(){this._reset(),o._flush_buffer(this)}_flush(){o._flush_buffer(this),this.push(null)}}Object.assign(o.prototype,{isGraphyWritable:!0,_serialize_prefixes:o.prototype._update_prefixes}),e.exports=o},95049:function(e,t,r){const i=r(76063),s=r(47328),n=/^`\[[^\]]+\](.*)$/,o=new Map([[Date,e=>i.dateTime(e)],[Number,e=>i.number(e)]]);class a extends s{constructor(e={}){super(e);let{lists:t=null}=e,r=o;if(e.coercions){r=new Map(r);for(let[t,i]of e.coercions)r.set(t,i)}let i={first:">http://www.w3.org/1999/02/22-rdf-syntax-ns#first",rest:">http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",nil:">http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"};if(t){let{first:e=null,rest:r=null,nil:s=null}=t;e&&(i.first=e),r&&(i.rest=r),s&&(i.nil=s)}Object.assign(this,{_xc_state:0,_hm_coercions:r,_g_lists:i})}_serialize_comment(e,t){let r="";if(2!==this._xc_state&&(r+="\n",this._xc_state=2),t&&t.width){let r=t.width,i=[];while(e.length>r){let t=e.slice(0,r+1),s=/^(.*[^\s])\s+/.exec(t);if(s){let t=s[1];i.push(t),e=e.slice(t.length).replace(/^\s+/,"")}else i.push(e.slice(0,r)),e=e.slice(r)}e=i.join("\n")}return r+(super._serialize_comment(e)||"")}_transcode_list(e,t=this._g_lists){if(e.length){let r=e[0],i=r;return Array.isArray(r)&&(i=this._transcode_list(r,t)),{[t.first]:i,[t.rest]:1===e.length?t.nil:this._transcode_list(e.slice(1),t)}}return t.nil}_apply_directive(e,t){let r,i=n.exec(e);if(!i)throw new Error(`Invalid writable data event directive string: "${e}"`);try{r=JSON.parse(i[1])}catch(o){throw new Error(`Unable to parse JSON in writable data event directive: "${i[1]}"`)}let s=r.type;switch(s){case"comment":if(this._serialize_comment)return{write:this._serialize_comment(t+"",r)};break;case"newlines":if(this._serialize_newlines)return{write:this._serialize_newlines(t)};break;case"config":switch(r.value){case"lists":{let e=this._a_list_serializers;e.push(this._serialize_list_object);let r=this._g_lists,i={first:t.first||r.first,rest:t.rest||r.rest,nil:t.nil||r.nil};return this._serialize_list_object=function(e,t){let r=this._transcode_list(e,i);return this._encode_objects(r,t)},{exit:()=>{this._serialize_list_object=e.pop()}}}default:throw new Error(`No such config key '${r.value}'`)}default:throw new Error(`Invalid writable data event directive type: '${s}'`)}return{}}_serialize_c4(e){let t=this._h_prefixes,r=[],s="";for(let i in e)"*"!==i&&r.push(i),s+=this._serialize_c3(e[i]);if(r.length){let e=`Destination format does not support quads; an implicit union into the default graph was performed on the quads contained in graphs: ${r.map((e=>i.c1(e,t).verbose())).join(", ")}`;this.emit("warning",e)||console.warn(e)}return s}}e.exports=a},41476:function(e,t,r){var i=r(48287)["Buffer"],s=r(65606);const n=r(28399);class o extends n.Readable{constructor(e={}){if(super(e),e.iterator)throw new Error("readable stream iterator shortcut not yet implemented")}until(e,t){return new Promise(((r,i)=>{this.on("error",(e=>{i(e)})),t?this.once(e,((...e)=>{r(this,...e)})):this.once(e,r)}))}bucket(e="utf8"){let t=this._readableState;return t.objectMode?new Promise(((e,t)=>{let r=[];this.pipe(new n.Writable({write(e,t,i){r.push(e),i()},writev(e,t){r.push(...e),t()}})).on("error",(e=>{t(e)})).on("finish",(()=>{e(r)}))})):"utf8"===e||"utf-8"===e?new Promise(((t,r)=>{let i="";this.setEncoding(e),this.pipe(new n.Writable({decodeStrings:!1,write(e,t,r){i+=e,r()},writev(e,t){i+=e.join(""),t()}})).on("error",(e=>{r(e)})).on("finish",(()=>{t(i)}))})):"buffer"===e?new Promise(((e,t)=>{let r=i.from([]);this.pipe(new n.Writable({decodeStrings:!0,write(e,t,s){r=i.concat([r,e],r.length+e.length),s()}})).on("error",(e=>{t(e)})).on("finish",(()=>{e(r)}))})):void 0}}class a extends n.Writable{until(e,t){return new Promise(((r,i)=>{this.on("error",(e=>{i(e)})),t?this.once(e,((...e)=>{r(this,...e)})):this.once(e,r)}))}import(e){return e.on("data",(e=>this.write(e))).on("end",(()=>this.end())).on("error",(e=>this.emit("error",e))),this}}class l extends n.Duplex{until(e,t){return new Promise(((r,i)=>{this.on("error",(e=>{i(e)})),t?this.once(e,((...e)=>{r(this,...e)})):this.once(e,r)}))}bucket(e="utf8"){let t=this._readableState;return t.objectMode?new Promise(((e,t)=>{let r=[];this.pipe(new n.Writable({write(e,t,i){r.push(e),i()},writev(e,t){r.push(...e),t()}})).on("error",(e=>{t(e)})).on("finish",(()=>{e(r)}))})):"utf8"===e||"utf-8"===e?new Promise(((t,r)=>{let i="";this.setEncoding(e),this.pipe(new n.Writable({decodeStrings:!1,write(e,t,r){i+=e,r()},writev(e,t){i+=e.join(""),t()}})).on("error",(e=>{r(e)})).on("finish",(()=>{t(i)}))})):"buffer"===e?new Promise(((e,t)=>{let r=i.from([]);this.pipe(new n.Writable({decodeStrings:!0,write(e,t,s){r=i.concat([r,e],r.length+e.length),s()}})).on("error",(e=>{t(e)})).on("finish",(()=>{e(r)}))})):void 0}}class h extends n.Transform{until(e,t){return new Promise(((r,i)=>{this.on("error",(e=>{i(e)})),t?this.once(e,((...e)=>{r(this,...e)})):this.once(e,r)}))}bucket(e="utf8"){let t=this._readableState;return t.objectMode?new Promise(((e,t)=>{let r=[];this.pipe(new n.Writable({write(e,t,i){r.push(e),i()},writev(e,t){r.push(...e),t()}})).on("error",(e=>{t(e)})).on("finish",(()=>{e(r)}))})):"utf8"===e||"utf-8"===e?new Promise(((t,r)=>{let i="";this.setEncoding(e),this.pipe(new n.Writable({decodeStrings:!1,write(e,t,r){i+=e,r()},writev(e,t){i+=e.join(""),t()}})).on("error",(e=>{r(e)})).on("finish",(()=>{t(i)}))})):"buffer"===e?new Promise(((e,t)=>{let r=i.from([]);this.pipe(new n.Writable({decodeStrings:!0,write(e,t,s){r=i.concat([r,e],r.length+e.length),s()}})).on("error",(e=>{t(e)})).on("finish",(()=>{e(r)}))})):void 0}import(e){return e.on("data",(e=>this.write(e))).on("end",(()=>this.end())).on("error",(e=>this.emit("error",e))),this}demolish(e){if(this.push=e=>{if(null!==e)throw new Error("[ERR_STREAM_DESTROYED]: Cannot push after stream was destroyed")},this.emit=function(e,...t){"end"!==e&&Object.getPrototypeOf(this).emit.apply(this,[e,...t])},e)return n.Transform.prototype.destroy.call(this,e)}}const u=new Function("try {return this===global;}catch(e){return false;}")(),[c,_]=(()=>"undefined"===typeof s?[!0,!1]:s.browser?[!0,!0]:"undefined"===s.versions||"undefined"===s.versions.node?[!0,!1]:[!1,!1])();(_||u&&+/^v(\d+)/.exec(s.version)[1]<10)&&(h.prototype.destroy=l.prototype.destroy=function(e,t){this._readableState.destroyed=!0,this._writableState.destroyed=!0;let r=()=>{this._writableState.emitClose&&this._readableState.emitClose&&this.emit("close")};return this._destroy(e||null,(e=>{!t&&e?(s.nextTick((()=>{this.emit("error",e),r()})),this._writableState.errorEmitted=!0):(s.nextTick(r),t&&t(e))})),this},h.prototype._destroy=l.prototype._destroy=(e,t)=>t(e));class f extends h{constructor(e={}){super({...e,writableObjectMode:!0,readableObjectMode:!0}),this._as_inputs=new Set,this.on("pipe",(e=>{this._as_inputs.add(e),e.on("prefix",((...e)=>{this.emit("prefix",...e)})).on("comment",((...e)=>{this.emit("comment",...e)}))})),this.on("unpipe",(e=>{this._as_inputs.delete(e)}))}_destroy(){for(let e of this._as_inputs)e.destroy()}}class p extends f{_transform(e,t,r){r(null,JSON.stringify(e.isolate())+"\n")}}class d extends f{_transform(e,t,r){r(null,{type:"quad",value:e})}}h.QuadsToOther=f,e.exports={...n,Readable:o,Writable:a,Duplex:l,Transform:h,QuadsToOther:f,quads_to_json(){return new p},quads_to_writable(){return new d},source(e,t=null){return t||"string"!==typeof e||(t="utf8"),new o({objectMode:!t&&"string"!==typeof e&&!i.isBuffer(e),read(){this.push(e,t),this.push(null)}})}}}}]); -//# sourceMappingURL=49.11942c3a.js.map \ No newline at end of file +//# sourceMappingURL=49.f2c20221.js.map \ No newline at end of file diff --git a/dist/js/49.11942c3a.js.map b/dist/js/49.f2c20221.js.map similarity index 99% rename from dist/js/49.11942c3a.js.map rename to dist/js/49.f2c20221.js.map index b85b8b8..26b824d 100644 --- a/dist/js/49.11942c3a.js.map +++ b/dist/js/49.f2c20221.js.map @@ -1 +1 @@ -{"version":3,"file":"js/49.11942c3a.js","mappings":"oHAMC,GAAG,oBAAsBA,eAAgB,CAExC,IAAIC,EAAaC,QAAQC,UAGzB,IAECH,eAAiBI,GAAMH,EAAWI,KAAKD,GACrCE,OAAMC,GAAcC,YAAW,KAC/B,MAAMD,CAAU,GACd,IACL,CAEA,MAAME,GAAW,CAClB,CAID,MAAMC,EAAU,EAAQ,OAClBC,EAAS,EAAQ,OAIjBC,EAAuB,MAG7B,MAAMC,UAAkBF,EAAOG,UAE9B,oBAAOC,CAAcC,GAEhBA,EAAOC,UAGXD,EAAOE,KAAKF,EAAOC,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W0J,EAAQxJ,EAAYyJ,GAC9BA,EAAa,KAAMvF,KAAKwF,UAAUF,EAAOG,WAAW,KACrD,EAGD,MAAMC,UAA0BZ,EAC/B,UAAAlJ,CAAW0J,EAAQxJ,EAAYyJ,GAC9BA,EAAa,KAAM,CAClBrM,KAAM,OACNC,MAAOmM,GAET,EAGD3N,EAAUmN,aAAeA,EAEzB9H,EAAOC,QAAU,IACbzF,EACHuJ,WACApD,WACAyF,SACAzL,YAEAmN,eAGA,aAAAa,GACC,OAAO,IAAIN,CACZ,EAGA,iBAAAO,GACC,OAAO,IAAIF,CACZ,EAGA,MAAAG,CAAOC,EAAQhK,EAAW,MAKzB,OAHIA,GAAc,kBAAoBgK,IAAQhK,EAAa,QAGpD,IAAIiF,EAAS,CACnBa,YAAa9F,GAAc,kBAAoBgK,IAAWlD,EAAOmD,SAASD,GAE1E,IAAAE,GACCzN,KAAKR,KAAK+N,EAAQhK,GAClBvD,KAAKR,KAAK,KACX,GAEF,E","sources":["webpack://mobilitydcatap-ui/./node_modules/@graphy/core.class.scribable/main.js","webpack://mobilitydcatap-ui/./node_modules/@graphy/core.class.writable/main.js","webpack://mobilitydcatap-ui/./node_modules/@graphy/core.iso.stream/main.js"],"sourcesContent":["\n\n\n// queueMicrotask shim\n{\n\t// not defined or not a function\n\tif('function' !== typeof queueMicrotask) {\n\t\t// create resolved promise\n\t\tlet dp_resolve = Promise.resolve();\n\n\t\t// try to redefine\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-global-assign\n\t\t\tqueueMicrotask = fk => dp_resolve.then(fk)\n\t\t\t\t.catch(e_callback => setTimeout(() => {\n\t\t\t\t\tthrow e_callback;\n\t\t\t\t}, 0));\n\t\t}\n\t\t// oh well, at least we tried\n\t\tcatch(e_define) {}\n\t}\n}\n\n\nconst factory = require('@graphy/core.data.factory');\nconst stream = require('@graphy/core.iso.stream');\n\n\n// max string buffer size\nconst N_DEFAULT_MAX_BUFFER = 1 << 15; // 32 KiB\n\n\nclass Scribable extends stream.Transform {\n\t// flush buffer\n\tstatic _flush_buffer(k_self) {\n\t\t// no buffer; exit\n\t\tif(!k_self._s_push) return;\n\n\t\t// push buffer to stream\n\t\tk_self.push(k_self._s_push);\n\n\t\t// reset buffer\n\t\tk_self._s_push = '';\n\t}\n\n\tconstructor(gc_scribable={}) {\n\t\tsuper({\n\t\t\twritableObjectMode: true,\n\t\t\treadableObjectMode: false,\n\t\t});\n\n\t\tlet {\n\t\t\tprefixes: h_prefixes={},\n\t\t} = gc_scribable;\n\n\t\t// internal buffer\n\t\tthis._s_push = '';\n\n\t\t// max buffer length\n\t\tthis._n_max_buffer = gc_scribable.max_buffer || gc_scribable.maxBuffer || N_DEFAULT_MAX_BUFFER;\n\n\t\t// prefixes\n\t\tthis._h_prefixes = factory.cache_prefixes(h_prefixes || {});\n\n\t\t// on new source(s)\n\t\tthis.on('pipe', (ds_src) => {\n\t\t\t// listen for prefix events\n\t\t\tds_src.on('prefix', (s_prefix_id, p_iri) => {\n\t\t\t\tthis.write({\n\t\t\t\t\ttype: 'prefixes',\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\t[s_prefix_id]: p_iri,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// listen for comment events\n\t\t\tds_src.on('comment', (s_comment) => {\n\t\t\t\tthis.write({\n\t\t\t\t\ttype: 'comment',\n\t\t\t\t\tvalue: s_comment,\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\t// bind event listeners\n\t\tif(gc_scribable.close) this.once('close', gc_scribable.close);\n\t\tif(gc_scribable.drain) this.on('drain', gc_scribable.drain);\n\t\tif(gc_scribable.error) this.on('error', gc_scribable.error);\n\t\tif(gc_scribable.finish) this.once('finish', gc_scribable.finish);\n\t\tif(gc_scribable.data) this.on('data', gc_scribable.data);\n\t\tif(gc_scribable.end) this.once('end', gc_scribable.end);\n\t\tif(gc_scribable.warning) this.on('warning', gc_scribable.warning);\n\t}\n\n\t_serialize_hash_comment(s_comment) {\n\t\treturn '# '+s_comment.replace(/\\n/g, '\\n# ')+'\\n';\n\t}\n\n\t_serialize_newlines(n_newlines=1) {\n\t\treturn '\\n'.repeat(n_newlines);\n\t}\n\n\t_serialize_c4r(hc4r_quads) {\n\t\tlet h_prefixes = this._h_prefixes;\n\t\tlet a_unions = [];\n\t\tlet s_write = '';\n\n\t\t// each graph in quads hash\n\t\tfor(let sc1_graph in hc4r_quads) {\n\t\t\t// non-default graph; union from dataset\n\t\t\tif('*' !== sc1_graph) a_unions.push(sc1_graph);\n\n\t\t\t// add all quads from graph\n\t\t\ts_write += this._serialize_c3r(hc4r_quads[sc1_graph]);\n\t\t}\n\n\t\t// a union was performed\n\t\tif(a_unions.length) {\n\t\t\t// warn about implicit union\n\t\t\tlet s_warning = `Destination format does not support quads; an implicit union into the default graph was performed on the quads contained in graphs: ${a_unions.map(sc1 => factory.c1(sc1, h_prefixes).verbose()).join(', ')}`;\n\n\t\t\t// emit warning, wasn't listened to; force thru warn/stderr channel\n\t\t\tif(!this.emit('warning', s_warning)) {\n\t\t\t\tconsole.warn(s_warning);\n\t\t\t}\n\t\t}\n\n\t\treturn s_write;\n\t}\n\n\n\t_serialize_c3() {\n\t\tthrow new Error(`Write event type 'c3' not supported by ${this.constructor.name}`);\n\t}\n\n\t_serialize_c4() {\n\t\tthrow new Error(`Write event type 'c4' not supported by ${this.constructor.name}`);\n\t}\n\n\n\n\t_serialize_c3r() {\n\t\tthrow new Error(`Write event type 'c3r' should have been implemented by subclass ${this.constructor.name}`);\n\t}\n\n\t_serialize_quad() {\n\t\tthrow new Error(`Write event type 'quad' should have been implemented by subclass ${this.constructor.name}`);\n\t}\n\n\n\t// ignorable events\n\t_serialize_comment() {} // eslint-disable-line class-methods-use-this\n\n\t// update prefix mappings\n\t_update_prefixes(h_prefixes_in, b_terse=false) {\n\t\t// merge prefixes\n\t\tlet h_prefixes = {\n\t\t\t...this._h_prefixes,\n\t\t\t...h_prefixes_in,\n\t\t};\n\n\t\t// recache prefixes\n\t\tthis._h_prefixes = factory.cachePrefixes(h_prefixes || {}, b_terse);\n\t}\n\n\t// implement stream.Transform\n\t_transform(g_event, s_encoding, fke_transform) {\n\t\tlet w_write;\n\n\t\t// try to serialize input value\n\t\ttry {\n\t\t\tw_write = this.serialize(g_event);\n\t\t}\n\t\t// serialization error\n\t\tcatch(e_serialize) {\n\t\t\t// report error\n\t\t\tfke_transform(e_serialize);\n\n\t\t\t// bail on transform\n\t\t\treturn e_serialize;\n\t\t}\n\n\t\t// data to push\n\t\tif(w_write) {\n\t\t\t// flush internal buffer\n\t\t\tScribable._flush_buffer(this);\n\n\t\t\t// push data to stream\n\t\t\tthis.push(w_write);\n\t\t}\n\t\t// nothing returned from serialization\n\t\telse {\n\t\t\tlet nl_push = this._s_push.length;\n\n\t\t\t// internal buffer high water mark\n\t\t\tif(nl_push > this._n_max_buffer) {\n\t\t\t\tScribable._flush_buffer(this);\n\t\t\t}\n\t\t\t// allow buffer to build\n\t\t\telse if(nl_push) {\n\t\t\t\t// do not worry about clearing timeouts\n\t\t\t\tqueueMicrotask(() => Scribable._flush_buffer(this));\n\t\t\t}\n\t\t}\n\n\t\t// callback\n\t\tfke_transform();\n\t}\n\n\t// queue data to be pushed later\n\t_queue(s_push) {\n\t\tthis._s_push += s_push;\n\n\t\t// internal buffer high water mark\n\t\tif(this._s_push.length > this._n_max_buffer) {\n\t\t\tScribable._flush_buffer(this);\n\t\t}\n\t\telse {\n\t\t\t// do not worry about clearing timeouts\n\t\t\tqueueMicrotask(() => Scribable._flush_buffer(this));\n\t\t}\n\t}\n\n\t// route event object to serialization method\n\tserialize(g_event) {\n\t\tswitch(g_event.type) {\n\t\t\t// rdfjs quad\n\t\t\t// eslint-disable-next-line no-undefined\n\t\t\tcase undefined: return this._serialize_quad(g_event);\n\n\t\t\t// concise triple struct strict-mode\n\t\t\tcase 'c3r': return this._serialize_c3r(g_event.value);\n\n\t\t\t// concise quad struct strict-mode\n\t\t\tcase 'c4r': return this._serialize_c4r(g_event.value);\n\n\t\t\t// array of events\n\t\t\tcase 'array': {\n\t\t\t\t// string building\n\t\t\t\tlet s_write = '';\n\n\t\t\t\t// each subevent\n\t\t\t\tfor(let g_sub of g_event.value) {\n\t\t\t\t\t// build serialization string\n\t\t\t\t\tlet s_push = this.serialize(g_sub);\n\n\t\t\t\t\t// something to push\n\t\t\t\t\tif(s_push) {\n\t\t\t\t\t\ts_write += s_push;\n\t\t\t\t\t}\n\t\t\t\t\t// push was queued\n\t\t\t\t\telse if(this._s_push) {\n\t\t\t\t\t\t// concat to write\n\t\t\t\t\t\ts_write += this._s_push;\n\n\t\t\t\t\t\t// reset push\n\t\t\t\t\t\tthis._s_push = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// all done\n\t\t\t\treturn s_write;\n\t\t\t}\n\n\t\t\t// quad\n\t\t\tcase 'quad': return this._serialize_quad(g_event.value);\n\n\t\t\t// concise triple struct\n\t\t\tcase 'c3': return this._serialize_c3(g_event.value);\n\n\t\t\t// concise quad struct\n\t\t\tcase 'c4': return this._serialize_c4(g_event.value);\n\n\t\t\t// prefixes\n\t\t\tcase 'prefixes': {\n\t\t\t\treturn this._serialize_prefixes(g_event.value);\n\t\t\t}\n\n\t\t\t// comment\n\t\t\tcase 'comment': {\n\t\t\t\treturn this._serialize_comment(g_event.value);\n\t\t\t}\n\n\t\t\t// newline(s)\n\t\t\tcase 'newline':\n\t\t\tcase 'newlines': {\n\t\t\t\treturn this._serialize_newlines(g_event.value);\n\t\t\t}\n\n\t\t\t// no such event type\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(`no such writable data event type for RDF stream: '${g_event.type}'`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// rinse off buffer to writable\n\trinse() {\n\t\tthis._reset();\n\t\tScribable._flush_buffer(this);\n\t}\n\n\t_flush() {\n\t\t// flush buffer\n\t\tScribable._flush_buffer(this);\n\n\t\t// eof\n\t\tthis.push(null);\n\t}\n}\n\nObject.assign(Scribable.prototype, {\n\tisGraphyWritable: true,\n\t_serialize_prefixes: Scribable.prototype._update_prefixes,\n});\n\nmodule.exports = Scribable;\n","\n\n\nconst factory = require('@graphy/core.data.factory');\nconst Scribable = require('@graphy/core.class.scribable');\n\nconst R_DIRECTIVE_CONTENTS = /^`\\[[^\\]]+\\](.*)$/;\n\nconst HM_COERCIONS_DEFAULT = new Map([\n\t[Date, dt => factory.dateTime(dt)],\n\t[Number, x => factory.number(x)],\n]);\n\nclass Writable extends Scribable {\n\tconstructor(gc_writable={}) {\n\t\tsuper(gc_writable);\n\n\t\tlet {\n\t\t\tlists: gc_lists=null,\n\t\t} = gc_writable;\n\n\t\t// start with default coercions map\n\t\tlet hm_coercions = HM_COERCIONS_DEFAULT;\n\n\t\t// user is overriding coercions\n\t\tif(gc_writable.coercions) {\n\t\t\t// copy default map\n\t\t\thm_coercions = new Map(hm_coercions);\n\n\t\t\t// add each entry from user-defined map\n\t\t\tfor(let [dc_type, f_transform] of gc_writable.coercions) {\n\t\t\t\thm_coercions.set(dc_type, f_transform);\n\t\t\t}\n\t\t}\n\n\t\t// lists\n\t\tlet g_lists = {\n\t\t\tfirst: '>http://www.w3.org/1999/02/22-rdf-syntax-ns#first',\n\t\t\trest: '>http://www.w3.org/1999/02/22-rdf-syntax-ns#rest',\n\t\t\tnil: '>http://www.w3.org/1999/02/22-rdf-syntax-ns#nil',\n\t\t};\n\n\t\t// custom transcoder\n\t\tif(gc_lists) {\n\t\t\tlet {\n\t\t\t\tfirst: sc1_first=null,\n\t\t\t\trest: sc1_rest=null,\n\t\t\t\tnil: sc1_nil=null,\n\t\t\t} = gc_lists;\n\n\t\t\tif(sc1_first) g_lists.first = sc1_first;\n\t\t\tif(sc1_rest) g_lists.rest = sc1_rest;\n\t\t\tif(sc1_nil) g_lists.nil = sc1_nil;\n\t\t}\n\n\t\tObject.assign(this, {\n\t\t\t_xc_state: 0,\n\t\t\t_hm_coercions: hm_coercions,\n\t\t\t_g_lists: g_lists,\n\t\t});\n\t}\n\n\t// serialize comment\n\t_serialize_comment(s_comment, g_directive) {\n\t\tlet s_write = '';\n\n\t\t// non-data state\n\t\tif(2 !== this._xc_state) {\n\t\t\t// break line\n\t\t\ts_write += '\\n';\n\n\t\t\t// update state\n\t\t\tthis._xc_state = 2;\n\t\t}\n\n\t\t// comment width\n\t\tif(g_directive && g_directive.width) {\n\t\t\tlet n_width = g_directive.width;\n\n\t\t\tlet a_lines = [];\n\n\t\t\twhile(s_comment.length > n_width) {\n\t\t\t\tlet s_line = s_comment.slice(0, n_width+1);\n\n\t\t\t\tlet m_line = /^(.*[^\\s])\\s+/.exec(s_line);\n\n\t\t\t\tif(m_line) {\n\t\t\t\t\tlet s_push = m_line[1];\n\t\t\t\t\ta_lines.push(s_push);\n\t\t\t\t\ts_comment = s_comment.slice(s_push.length).replace(/^\\s+/, '');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ta_lines.push(s_comment.slice(0, n_width));\n\t\t\t\t\ts_comment = s_comment.slice(n_width);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ts_comment = a_lines.join('\\n');\n\t\t}\n\n\t\treturn s_write+(super._serialize_comment(s_comment) || '');\n\t}\n\n\n\t// transcode list into concise-pairs hash\n\t_transcode_list(a_list, g_lists=this._g_lists) {\n\t\t// empty list\n\t\tif(!a_list.length) {\n\t\t\treturn g_lists.nil;\n\t\t}\n\t\t// non-empty list\n\t\telse {\n\t\t\tlet z_item = a_list[0];\n\t\t\tlet w_first = z_item;\n\n\t\t\t// item is nested list; transcode\n\t\t\tif(Array.isArray(z_item)) {\n\t\t\t\tw_first = this._transcode_list(z_item, g_lists); // eslint-disable-line no-invalid-this\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t// first item\n\t\t\t\t[g_lists.first]: w_first,\n\n\t\t\t\t// rest of items\n\t\t\t\t[g_lists.rest]: 1 === a_list.length\n\t\t\t\t\t? g_lists.nil\n\t\t\t\t\t: this._transcode_list(a_list.slice(1), g_lists), // eslint-disable-line no-invalid-this\n\t\t\t};\n\t\t}\n\t}\n\n\t// serialize a writable data event directive\n\t_apply_directive(sc1_directive, w_value) {\n\t\t// directive contents\n\t\tlet m_directive = R_DIRECTIVE_CONTENTS.exec(sc1_directive);\n\t\tif(!m_directive) {\n\t\t\tthrow new Error(`Invalid writable data event directive string: \"${sc1_directive}\"`);\n\t\t}\n\n\t\t// parse as JSON\n\t\tlet g_directive;\n\t\ttry {\n\t\t\tg_directive = JSON.parse(m_directive[1]);\n\t\t}\n\t\tcatch(e_parse) {\n\t\t\tthrow new Error(`Unable to parse JSON in writable data event directive: \"${m_directive[1]}\"`);\n\t\t}\n\n\t\t// directive type\n\t\tlet s_type = g_directive.type;\n\n\t\t// deduce directive type\n\t\tswitch(s_type) {\n\t\t\t// comment\n\t\t\tcase 'comment': {\n\t\t\t\t// serializer supports commenting; serialize comment\n\t\t\t\tif(this._serialize_comment) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\twrite: this._serialize_comment(w_value+'', g_directive),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// newlines\n\t\t\tcase 'newlines': {\n\t\t\t\t// serializer supports newlines; serialize newlines\n\t\t\t\tif(this._serialize_newlines) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\twrite: this._serialize_newlines(w_value),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// config\n\t\t\tcase 'config': {\n\t\t\t\tswitch(g_directive.value) {\n\t\t\t\t\t// list config\n\t\t\t\t\tcase 'lists': {\n\t\t\t\t\t\t// ref stack of list serializers\n\t\t\t\t\t\tlet a_list_serializers = this._a_list_serializers;\n\n\t\t\t\t\t\t// push current method to stack\n\t\t\t\t\t\ta_list_serializers.push(this._serialize_list_object);\n\n\t\t\t\t\t\t// inherit unspecified keys from parent\n\t\t\t\t\t\tlet g_list_default = this._g_lists;\n\n\t\t\t\t\t\t// build list config\n\t\t\t\t\t\tlet g_lists = {\n\t\t\t\t\t\t\tfirst: w_value.first || g_list_default.first,\n\t\t\t\t\t\t\trest: w_value.rest || g_list_default.rest,\n\t\t\t\t\t\t\tnil: w_value.nil || g_list_default.nil,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// redefine list object serialization\n\t\t\t\t\t\tthis._serialize_list_object = function(a_list, n_nest_level) {\n\t\t\t\t\t\t\t// transcode list object\n\t\t\t\t\t\t\tlet hc2_transcoded = this._transcode_list(a_list, g_lists);\n\n\t\t\t\t\t\t\t// serialize object\n\t\t\t\t\t\t\treturn this._encode_objects(hc2_transcoded, n_nest_level);\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// return local directive instructions\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\texit: () => {\n\t\t\t\t\t\t\t\tthis._serialize_list_object = a_list_serializers.pop();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\t// no such key\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tthrow new Error(`No such config key '${g_directive.value}'`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// other\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(`Invalid writable data event directive type: '${s_type}'`);\n\t\t\t}\n\t\t}\n\n\t\t// nothing\n\t\treturn {};\n\t}\n\n\t// if not overriden by subclass, serialize quads in default graph\n\t_serialize_c4(hc4_quads) {\n\t\tlet h_prefixes = this._h_prefixes;\n\t\tlet a_unions = [];\n\t\tlet s_write = '';\n\n\t\t// each graph in quads hash\n\t\tfor(let sv1_graph in hc4_quads) {\n\t\t\t// non-default graph; union from dataset\n\t\t\tif('*' !== sv1_graph) a_unions.push(sv1_graph);\n\n\t\t\t// add all quads from graph\n\t\t\ts_write += this._serialize_c3(hc4_quads[sv1_graph]);\n\t\t}\n\n\t\t// a union was performed\n\t\tif(a_unions.length) {\n\t\t\t// warn about implicit union\n\t\t\tlet s_warning = `Destination format does not support quads; an implicit union into the default graph was performed on the quads contained in graphs: ${a_unions.map(sc1 => factory.c1(sc1, h_prefixes).verbose()).join(', ')}`;\n\n\t\t\t// emit warning, wasn't listened to; force thru warn/stderr channel\n\t\t\tif(!this.emit('warning', s_warning)) {\n\t\t\t\tconsole.warn(s_warning);\n\t\t\t}\n\t\t}\n\n\t\treturn s_write;\n\t}\n}\n\nmodule.exports = Writable;\n","const stream = require('readable-stream');\n\n\n\nclass Readable extends stream.Readable {\n\tconstructor(gc_readable={}) {\n\t\tsuper(gc_readable);\n\n\t\t// use iterator\n\t\tif(gc_readable.iterator) {\n\t\t\tthrow new Error('readable stream iterator shortcut not yet implemented');\n\t\t}\n\t}\n\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass Writable extends stream.Writable {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\t// rdfjs impl\n\timport(ds_source) {\n\t\tds_source\n\t\t\t.on('data', w_chunk => this.write(w_chunk))\n\t\t\t.on('end', () => this.end())\n\t\t\t.on('error', e_read => this.emit('error', e_read));\n\n\t\treturn this;\n\t}\n}\n\nclass Duplex extends stream.Duplex {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass Transform extends stream.Transform {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\n\t// rdfjs impl\n\timport(ds_source) {\n\t\tds_source\n\t\t\t.on('data', w_chunk => this.write(w_chunk))\n\t\t\t.on('end', () => this.end())\n\t\t\t.on('error', e_read => this.emit('error', e_read));\n\n\t\treturn this;\n\t}\n\n\tdemolish(e_destroy) {\n\t\t// do not allow to push\n\t\tthis.push = (z_chunk) => {\n\t\t\t// ignore eof signals from node core\n\t\t\tif(null === z_chunk) return;\n\n\t\t\t// anything else is bad\n\t\t\tthrow new Error(`[ERR_STREAM_DESTROYED]: Cannot push after stream was destroyed`);\n\t\t};\n\n\t\t// do not allow to emit 'end'\n\t\tthis.emit = function(s_event, ...a_args) {\n\t\t\tif('end' === s_event) return;\n\n\t\t\tObject.getPrototypeOf(this).emit.apply(this, [s_event, ...a_args]);\n\t\t};\n\n\t\t// an error was given, destroy the stream as well\n\t\tif(e_destroy) {\n\t\t\treturn stream.Transform.prototype.destroy.call(this, e_destroy);\n\t\t}\n\t}\n}\n\n// eslint-disable-next-line no-new-func\nconst b_is_node = (new Function(/* syntax: js */ `try {return this===global;}catch(e){return false;}`))();\n\n// deduce the runtime environment\nconst [B_BROWSER, B_BROWSERIFY] = (() => 'undefined' === typeof process\n\t? [true, false]\n\t: (process.browser\n\t\t? [true, true]\n\t\t: ('undefined' === process.versions || 'undefined' === process.versions.node\n\t\t\t? [true, false]\n\t\t\t: [false, false])))();\n\n// node.js or browserify; patch for node < v10\nif(B_BROWSERIFY || (b_is_node && (+(/^v(\\d+)/.exec(process.version)[1])) < 10)) {\n\t// override destroy methods\n\tTransform.prototype.destroy = Duplex.prototype.destroy = function(e_destroy, fke_destroy) {\n\t\tthis._readableState.destroyed = true;\n\t\tthis._writableState.destroyed = true;\n\n\t\tlet f_emit_close = () => {\n\t\t\tif(!this._writableState.emitClose) return;\n\t\t\tif(!this._readableState.emitClose) return;\n\t\t\tthis.emit('close');\n\t\t};\n\n\t\tthis._destroy(e_destroy || null, (e_destroy_re) => {\n\t\t\tif(!fke_destroy && e_destroy_re) {\n\t\t\t\tprocess.nextTick(() => {\n\t\t\t\t\tthis.emit('error', e_destroy_re);\n\t\t\t\t\tf_emit_close();\n\t\t\t\t});\n\t\t\t\tthis._writableState.errorEmitted = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tprocess.nextTick(f_emit_close);\n\t\t\t\tif(fke_destroy) fke_destroy(e_destroy_re);\n\t\t\t}\n\t\t});\n\n\t\treturn this;\n\t};\n\n\t// override default _destroy implementations\n\tTransform.prototype._destroy = Duplex.prototype._destroy = (e_destroy, fke_destroy) => fke_destroy(e_destroy);\n}\n\nclass QuadsToOther extends Transform {\n\tconstructor(gc_transform={}) {\n\t\tsuper({\n\t\t\t...gc_transform,\n\t\t\twritableObjectMode: true,\n\t\t\treadableObjectMode: true,\n\t\t});\n\n\t\tthis._as_inputs = new Set();\n\n\t\t// forward prefix and comment events\n\t\tthis.on('pipe', (ds_src) => {\n\t\t\tthis._as_inputs.add(ds_src);\n\n\t\t\tds_src\n\t\t\t\t.on('prefix', (...a_args) => {\n\t\t\t\t\tthis.emit('prefix', ...a_args);\n\t\t\t\t})\n\t\t\t\t.on('comment', (...a_args) => {\n\t\t\t\t\tthis.emit('comment', ...a_args);\n\t\t\t\t});\n\t\t});\n\n\t\tthis.on('unpipe', (ds_src) => {\n\t\t\tthis._as_inputs.delete(ds_src);\n\t\t});\n\t}\n\n\t_destroy() {\n\t\tfor(let ds_input of this._as_inputs) {\n\t\t\tds_input.destroy();\n\t\t}\n\t}\n}\n\nclass Quads_To_JSON_Transform extends QuadsToOther {\n\t// serializse json\n\t_transform(g_quad, s_encoding, fk_transform) {\n\t\tfk_transform(null, JSON.stringify(g_quad.isolate())+'\\n');\n\t}\n}\n\nclass Quads_To_Writable extends QuadsToOther {\n\t_transform(g_quad, s_encoding, fk_transform) {\n\t\tfk_transform(null, {\n\t\t\ttype: 'quad',\n\t\t\tvalue: g_quad,\n\t\t});\n\t}\n}\n\nTransform.QuadsToOther = QuadsToOther;\n\nmodule.exports = {\n\t...stream,\n\tReadable,\n\tWritable,\n\tDuplex,\n\tTransform,\n\n\tQuadsToOther,\n\n\t// create a transform from quad objects into JSON strings for trivial serialization\n\tquads_to_json() {\n\t\treturn new Quads_To_JSON_Transform();\n\t},\n\n\t// create a transform from quad objects into writable data events\n\tquads_to_writable() {\n\t\treturn new Quads_To_Writable();\n\t},\n\n\t// create a simple, single-event readable stream\n\tsource(w_push, s_encoding=null) {\n\t\t// encoding not explicit, string given; assume utf8\n\t\tif(!s_encoding && 'string' === typeof w_push) s_encoding = 'utf8';\n\n\t\t// readable\n\t\treturn new Readable({\n\t\t\tobjectMode: !s_encoding && 'string' !== typeof w_push && !Buffer.isBuffer(w_push),\n\n\t\t\tread() {\n\t\t\t\tthis.push(w_push, s_encoding);\n\t\t\t\tthis.push(null);\n\t\t\t},\n\t\t});\n\t},\n};\n"],"names":["queueMicrotask","dp_resolve","Promise","resolve","fk","then","catch","e_callback","setTimeout","e_define","factory","stream","N_DEFAULT_MAX_BUFFER","Scribable","Transform","_flush_buffer","k_self","_s_push","push","constructor","gc_scribable","super","writableObjectMode","readableObjectMode","prefixes","h_prefixes","this","_n_max_buffer","max_buffer","maxBuffer","_h_prefixes","cache_prefixes","on","ds_src","s_prefix_id","p_iri","write","type","value","s_comment","close","once","drain","error","finish","data","end","warning","_serialize_hash_comment","replace","_serialize_newlines","n_newlines","repeat","_serialize_c4r","hc4r_quads","a_unions","s_write","sc1_graph","_serialize_c3r","length","s_warning","map","sc1","c1","verbose","join","emit","console","warn","_serialize_c3","Error","name","_serialize_c4","_serialize_quad","_serialize_comment","_update_prefixes","h_prefixes_in","b_terse","cachePrefixes","_transform","g_event","s_encoding","fke_transform","w_write","serialize","e_serialize","nl_push","_queue","s_push","undefined","g_sub","_serialize_prefixes","rinse","_reset","_flush","Object","assign","prototype","isGraphyWritable","module","exports","R_DIRECTIVE_CONTENTS","HM_COERCIONS_DEFAULT","Map","Date","dt","dateTime","Number","x","number","Writable","gc_writable","lists","gc_lists","hm_coercions","coercions","dc_type","f_transform","set","g_lists","first","rest","nil","sc1_first","sc1_rest","sc1_nil","_xc_state","_hm_coercions","_g_lists","g_directive","width","n_width","a_lines","s_line","slice","m_line","exec","_transcode_list","a_list","z_item","w_first","Array","isArray","_apply_directive","sc1_directive","w_value","m_directive","JSON","parse","e_parse","s_type","a_list_serializers","_a_list_serializers","_serialize_list_object","g_list_default","n_nest_level","hc2_transcoded","_encode_objects","exit","pop","hc4_quads","sv1_graph","Readable","gc_readable","iterator","until","s_event","b_return_stream","fk_until","fe_until","e_stream","a_args","bucket","g_readable","_readableState","objectMode","fk_bucket","fe_bucket","a_data","pipe","w_event","s_write_encoding","fk_write","writev","a_chunks","fk_writev","s_data","setEncoding","decodeStrings","s_chunk","ab_data","Buffer","from","ab_chunk","concat","import","ds_source","w_chunk","e_read","Duplex","demolish","e_destroy","z_chunk","getPrototypeOf","apply","destroy","call","b_is_node","Function","B_BROWSER","B_BROWSERIFY","process","browser","versions","node","version","fke_destroy","destroyed","_writableState","f_emit_close","emitClose","_destroy","e_destroy_re","nextTick","errorEmitted","QuadsToOther","gc_transform","_as_inputs","Set","add","delete","ds_input","Quads_To_JSON_Transform","g_quad","fk_transform","stringify","isolate","Quads_To_Writable","quads_to_json","quads_to_writable","source","w_push","isBuffer","read"],"sourceRoot":""} \ No new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KM,GAAG,QAASC,IAChBP,KAAKyM,WAAWE,IAAIpM,GAEpBA,EACED,GAAG,UAAU,IAAI2I,KACjBjJ,KAAKwC,KAAK,YAAayG,EAAO,IAE9B3I,GAAG,WAAW,IAAI2I,KAClBjJ,KAAKwC,KAAK,aAAcyG,EAAO,GAC9B,IAGJjJ,KAAKM,GAAG,UAAWC,IAClBP,KAAKyM,WAAWG,OAAOrM,EAAO,GAEhC,CAEA,QAAA4L,GACC,IAAI,IAAIU,KAAY7M,KAAKyM,WACxBI,EAAS1B,SAEX,EAGD,MAAM2B,UAAgCP,EAErC,UAAAlJ,CAAW0J,EAAQxJ,EAAYyJ,GAC9BA,EAAa,KAAMvF,KAAKwF,UAAUF,EAAOG,WAAW,KACrD,EAGD,MAAMC,UAA0BZ,EAC/B,UAAAlJ,CAAW0J,EAAQxJ,EAAYyJ,GAC9BA,EAAa,KAAM,CAClBrM,KAAM,OACNC,MAAOmM,GAET,EAGD3N,EAAUmN,aAAeA,EAEzB9H,EAAOC,QAAU,IACbzF,EACHuJ,WACApD,WACAyF,SACAzL,YAEAmN,eAGA,aAAAa,GACC,OAAO,IAAIN,CACZ,EAGA,iBAAAO,GACC,OAAO,IAAIF,CACZ,EAGA,MAAAG,CAAOC,EAAQhK,EAAW,MAKzB,OAHIA,GAAc,kBAAoBgK,IAAQhK,EAAa,QAGpD,IAAIiF,EAAS,CACnBa,YAAa9F,GAAc,kBAAoBgK,IAAWlD,EAAOmD,SAASD,GAE1E,IAAAE,GACCzN,KAAKR,KAAK+N,EAAQhK,GAClBvD,KAAKR,KAAK,KACX,GAEF,E","sources":["webpack://mobilitydcatap-ui/./node_modules/@graphy/core.class.scribable/main.js","webpack://mobilitydcatap-ui/./node_modules/@graphy/core.class.writable/main.js","webpack://mobilitydcatap-ui/./node_modules/@graphy/core.iso.stream/main.js"],"sourcesContent":["\n\n\n// queueMicrotask shim\n{\n\t// not defined or not a function\n\tif('function' !== typeof queueMicrotask) {\n\t\t// create resolved promise\n\t\tlet dp_resolve = Promise.resolve();\n\n\t\t// try to redefine\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-global-assign\n\t\t\tqueueMicrotask = fk => dp_resolve.then(fk)\n\t\t\t\t.catch(e_callback => setTimeout(() => {\n\t\t\t\t\tthrow e_callback;\n\t\t\t\t}, 0));\n\t\t}\n\t\t// oh well, at least we tried\n\t\tcatch(e_define) {}\n\t}\n}\n\n\nconst factory = require('@graphy/core.data.factory');\nconst stream = require('@graphy/core.iso.stream');\n\n\n// max string buffer size\nconst N_DEFAULT_MAX_BUFFER = 1 << 15; // 32 KiB\n\n\nclass Scribable extends stream.Transform {\n\t// flush buffer\n\tstatic _flush_buffer(k_self) {\n\t\t// no buffer; exit\n\t\tif(!k_self._s_push) return;\n\n\t\t// push buffer to stream\n\t\tk_self.push(k_self._s_push);\n\n\t\t// reset buffer\n\t\tk_self._s_push = '';\n\t}\n\n\tconstructor(gc_scribable={}) {\n\t\tsuper({\n\t\t\twritableObjectMode: true,\n\t\t\treadableObjectMode: false,\n\t\t});\n\n\t\tlet {\n\t\t\tprefixes: h_prefixes={},\n\t\t} = gc_scribable;\n\n\t\t// internal buffer\n\t\tthis._s_push = '';\n\n\t\t// max buffer length\n\t\tthis._n_max_buffer = gc_scribable.max_buffer || gc_scribable.maxBuffer || N_DEFAULT_MAX_BUFFER;\n\n\t\t// prefixes\n\t\tthis._h_prefixes = factory.cache_prefixes(h_prefixes || {});\n\n\t\t// on new source(s)\n\t\tthis.on('pipe', (ds_src) => {\n\t\t\t// listen for prefix events\n\t\t\tds_src.on('prefix', (s_prefix_id, p_iri) => {\n\t\t\t\tthis.write({\n\t\t\t\t\ttype: 'prefixes',\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\t[s_prefix_id]: p_iri,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// listen for comment events\n\t\t\tds_src.on('comment', (s_comment) => {\n\t\t\t\tthis.write({\n\t\t\t\t\ttype: 'comment',\n\t\t\t\t\tvalue: s_comment,\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\t// bind event listeners\n\t\tif(gc_scribable.close) this.once('close', gc_scribable.close);\n\t\tif(gc_scribable.drain) this.on('drain', gc_scribable.drain);\n\t\tif(gc_scribable.error) this.on('error', gc_scribable.error);\n\t\tif(gc_scribable.finish) this.once('finish', gc_scribable.finish);\n\t\tif(gc_scribable.data) this.on('data', gc_scribable.data);\n\t\tif(gc_scribable.end) this.once('end', gc_scribable.end);\n\t\tif(gc_scribable.warning) this.on('warning', gc_scribable.warning);\n\t}\n\n\t_serialize_hash_comment(s_comment) {\n\t\treturn '# '+s_comment.replace(/\\n/g, '\\n# ')+'\\n';\n\t}\n\n\t_serialize_newlines(n_newlines=1) {\n\t\treturn '\\n'.repeat(n_newlines);\n\t}\n\n\t_serialize_c4r(hc4r_quads) {\n\t\tlet h_prefixes = this._h_prefixes;\n\t\tlet a_unions = [];\n\t\tlet s_write = '';\n\n\t\t// each graph in quads hash\n\t\tfor(let sc1_graph in hc4r_quads) {\n\t\t\t// non-default graph; union from dataset\n\t\t\tif('*' !== sc1_graph) a_unions.push(sc1_graph);\n\n\t\t\t// add all quads from graph\n\t\t\ts_write += this._serialize_c3r(hc4r_quads[sc1_graph]);\n\t\t}\n\n\t\t// a union was performed\n\t\tif(a_unions.length) {\n\t\t\t// warn about implicit union\n\t\t\tlet s_warning = `Destination format does not support quads; an implicit union into the default graph was performed on the quads contained in graphs: ${a_unions.map(sc1 => factory.c1(sc1, h_prefixes).verbose()).join(', ')}`;\n\n\t\t\t// emit warning, wasn't listened to; force thru warn/stderr channel\n\t\t\tif(!this.emit('warning', s_warning)) {\n\t\t\t\tconsole.warn(s_warning);\n\t\t\t}\n\t\t}\n\n\t\treturn s_write;\n\t}\n\n\n\t_serialize_c3() {\n\t\tthrow new Error(`Write event type 'c3' not supported by ${this.constructor.name}`);\n\t}\n\n\t_serialize_c4() {\n\t\tthrow new Error(`Write event type 'c4' not supported by ${this.constructor.name}`);\n\t}\n\n\n\n\t_serialize_c3r() {\n\t\tthrow new Error(`Write event type 'c3r' should have been implemented by subclass ${this.constructor.name}`);\n\t}\n\n\t_serialize_quad() {\n\t\tthrow new Error(`Write event type 'quad' should have been implemented by subclass ${this.constructor.name}`);\n\t}\n\n\n\t// ignorable events\n\t_serialize_comment() {} // eslint-disable-line class-methods-use-this\n\n\t// update prefix mappings\n\t_update_prefixes(h_prefixes_in, b_terse=false) {\n\t\t// merge prefixes\n\t\tlet h_prefixes = {\n\t\t\t...this._h_prefixes,\n\t\t\t...h_prefixes_in,\n\t\t};\n\n\t\t// recache prefixes\n\t\tthis._h_prefixes = factory.cachePrefixes(h_prefixes || {}, b_terse);\n\t}\n\n\t// implement stream.Transform\n\t_transform(g_event, s_encoding, fke_transform) {\n\t\tlet w_write;\n\n\t\t// try to serialize input value\n\t\ttry {\n\t\t\tw_write = this.serialize(g_event);\n\t\t}\n\t\t// serialization error\n\t\tcatch(e_serialize) {\n\t\t\t// report error\n\t\t\tfke_transform(e_serialize);\n\n\t\t\t// bail on transform\n\t\t\treturn e_serialize;\n\t\t}\n\n\t\t// data to push\n\t\tif(w_write) {\n\t\t\t// flush internal buffer\n\t\t\tScribable._flush_buffer(this);\n\n\t\t\t// push data to stream\n\t\t\tthis.push(w_write);\n\t\t}\n\t\t// nothing returned from serialization\n\t\telse {\n\t\t\tlet nl_push = this._s_push.length;\n\n\t\t\t// internal buffer high water mark\n\t\t\tif(nl_push > this._n_max_buffer) {\n\t\t\t\tScribable._flush_buffer(this);\n\t\t\t}\n\t\t\t// allow buffer to build\n\t\t\telse if(nl_push) {\n\t\t\t\t// do not worry about clearing timeouts\n\t\t\t\tqueueMicrotask(() => Scribable._flush_buffer(this));\n\t\t\t}\n\t\t}\n\n\t\t// callback\n\t\tfke_transform();\n\t}\n\n\t// queue data to be pushed later\n\t_queue(s_push) {\n\t\tthis._s_push += s_push;\n\n\t\t// internal buffer high water mark\n\t\tif(this._s_push.length > this._n_max_buffer) {\n\t\t\tScribable._flush_buffer(this);\n\t\t}\n\t\telse {\n\t\t\t// do not worry about clearing timeouts\n\t\t\tqueueMicrotask(() => Scribable._flush_buffer(this));\n\t\t}\n\t}\n\n\t// route event object to serialization method\n\tserialize(g_event) {\n\t\tswitch(g_event.type) {\n\t\t\t// rdfjs quad\n\t\t\t// eslint-disable-next-line no-undefined\n\t\t\tcase undefined: return this._serialize_quad(g_event);\n\n\t\t\t// concise triple struct strict-mode\n\t\t\tcase 'c3r': return this._serialize_c3r(g_event.value);\n\n\t\t\t// concise quad struct strict-mode\n\t\t\tcase 'c4r': return this._serialize_c4r(g_event.value);\n\n\t\t\t// array of events\n\t\t\tcase 'array': {\n\t\t\t\t// string building\n\t\t\t\tlet s_write = '';\n\n\t\t\t\t// each subevent\n\t\t\t\tfor(let g_sub of g_event.value) {\n\t\t\t\t\t// build serialization string\n\t\t\t\t\tlet s_push = this.serialize(g_sub);\n\n\t\t\t\t\t// something to push\n\t\t\t\t\tif(s_push) {\n\t\t\t\t\t\ts_write += s_push;\n\t\t\t\t\t}\n\t\t\t\t\t// push was queued\n\t\t\t\t\telse if(this._s_push) {\n\t\t\t\t\t\t// concat to write\n\t\t\t\t\t\ts_write += this._s_push;\n\n\t\t\t\t\t\t// reset push\n\t\t\t\t\t\tthis._s_push = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// all done\n\t\t\t\treturn s_write;\n\t\t\t}\n\n\t\t\t// quad\n\t\t\tcase 'quad': return this._serialize_quad(g_event.value);\n\n\t\t\t// concise triple struct\n\t\t\tcase 'c3': return this._serialize_c3(g_event.value);\n\n\t\t\t// concise quad struct\n\t\t\tcase 'c4': return this._serialize_c4(g_event.value);\n\n\t\t\t// prefixes\n\t\t\tcase 'prefixes': {\n\t\t\t\treturn this._serialize_prefixes(g_event.value);\n\t\t\t}\n\n\t\t\t// comment\n\t\t\tcase 'comment': {\n\t\t\t\treturn this._serialize_comment(g_event.value);\n\t\t\t}\n\n\t\t\t// newline(s)\n\t\t\tcase 'newline':\n\t\t\tcase 'newlines': {\n\t\t\t\treturn this._serialize_newlines(g_event.value);\n\t\t\t}\n\n\t\t\t// no such event type\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(`no such writable data event type for RDF stream: '${g_event.type}'`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// rinse off buffer to writable\n\trinse() {\n\t\tthis._reset();\n\t\tScribable._flush_buffer(this);\n\t}\n\n\t_flush() {\n\t\t// flush buffer\n\t\tScribable._flush_buffer(this);\n\n\t\t// eof\n\t\tthis.push(null);\n\t}\n}\n\nObject.assign(Scribable.prototype, {\n\tisGraphyWritable: true,\n\t_serialize_prefixes: Scribable.prototype._update_prefixes,\n});\n\nmodule.exports = Scribable;\n","\n\n\nconst factory = require('@graphy/core.data.factory');\nconst Scribable = require('@graphy/core.class.scribable');\n\nconst R_DIRECTIVE_CONTENTS = /^`\\[[^\\]]+\\](.*)$/;\n\nconst HM_COERCIONS_DEFAULT = new Map([\n\t[Date, dt => factory.dateTime(dt)],\n\t[Number, x => factory.number(x)],\n]);\n\nclass Writable extends Scribable {\n\tconstructor(gc_writable={}) {\n\t\tsuper(gc_writable);\n\n\t\tlet {\n\t\t\tlists: gc_lists=null,\n\t\t} = gc_writable;\n\n\t\t// start with default coercions map\n\t\tlet hm_coercions = HM_COERCIONS_DEFAULT;\n\n\t\t// user is overriding coercions\n\t\tif(gc_writable.coercions) {\n\t\t\t// copy default map\n\t\t\thm_coercions = new Map(hm_coercions);\n\n\t\t\t// add each entry from user-defined map\n\t\t\tfor(let [dc_type, f_transform] of gc_writable.coercions) {\n\t\t\t\thm_coercions.set(dc_type, f_transform);\n\t\t\t}\n\t\t}\n\n\t\t// lists\n\t\tlet g_lists = {\n\t\t\tfirst: '>http://www.w3.org/1999/02/22-rdf-syntax-ns#first',\n\t\t\trest: '>http://www.w3.org/1999/02/22-rdf-syntax-ns#rest',\n\t\t\tnil: '>http://www.w3.org/1999/02/22-rdf-syntax-ns#nil',\n\t\t};\n\n\t\t// custom transcoder\n\t\tif(gc_lists) {\n\t\t\tlet {\n\t\t\t\tfirst: sc1_first=null,\n\t\t\t\trest: sc1_rest=null,\n\t\t\t\tnil: sc1_nil=null,\n\t\t\t} = gc_lists;\n\n\t\t\tif(sc1_first) g_lists.first = sc1_first;\n\t\t\tif(sc1_rest) g_lists.rest = sc1_rest;\n\t\t\tif(sc1_nil) g_lists.nil = sc1_nil;\n\t\t}\n\n\t\tObject.assign(this, {\n\t\t\t_xc_state: 0,\n\t\t\t_hm_coercions: hm_coercions,\n\t\t\t_g_lists: g_lists,\n\t\t});\n\t}\n\n\t// serialize comment\n\t_serialize_comment(s_comment, g_directive) {\n\t\tlet s_write = '';\n\n\t\t// non-data state\n\t\tif(2 !== this._xc_state) {\n\t\t\t// break line\n\t\t\ts_write += '\\n';\n\n\t\t\t// update state\n\t\t\tthis._xc_state = 2;\n\t\t}\n\n\t\t// comment width\n\t\tif(g_directive && g_directive.width) {\n\t\t\tlet n_width = g_directive.width;\n\n\t\t\tlet a_lines = [];\n\n\t\t\twhile(s_comment.length > n_width) {\n\t\t\t\tlet s_line = s_comment.slice(0, n_width+1);\n\n\t\t\t\tlet m_line = /^(.*[^\\s])\\s+/.exec(s_line);\n\n\t\t\t\tif(m_line) {\n\t\t\t\t\tlet s_push = m_line[1];\n\t\t\t\t\ta_lines.push(s_push);\n\t\t\t\t\ts_comment = s_comment.slice(s_push.length).replace(/^\\s+/, '');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ta_lines.push(s_comment.slice(0, n_width));\n\t\t\t\t\ts_comment = s_comment.slice(n_width);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ts_comment = a_lines.join('\\n');\n\t\t}\n\n\t\treturn s_write+(super._serialize_comment(s_comment) || '');\n\t}\n\n\n\t// transcode list into concise-pairs hash\n\t_transcode_list(a_list, g_lists=this._g_lists) {\n\t\t// empty list\n\t\tif(!a_list.length) {\n\t\t\treturn g_lists.nil;\n\t\t}\n\t\t// non-empty list\n\t\telse {\n\t\t\tlet z_item = a_list[0];\n\t\t\tlet w_first = z_item;\n\n\t\t\t// item is nested list; transcode\n\t\t\tif(Array.isArray(z_item)) {\n\t\t\t\tw_first = this._transcode_list(z_item, g_lists); // eslint-disable-line no-invalid-this\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t// first item\n\t\t\t\t[g_lists.first]: w_first,\n\n\t\t\t\t// rest of items\n\t\t\t\t[g_lists.rest]: 1 === a_list.length\n\t\t\t\t\t? g_lists.nil\n\t\t\t\t\t: this._transcode_list(a_list.slice(1), g_lists), // eslint-disable-line no-invalid-this\n\t\t\t};\n\t\t}\n\t}\n\n\t// serialize a writable data event directive\n\t_apply_directive(sc1_directive, w_value) {\n\t\t// directive contents\n\t\tlet m_directive = R_DIRECTIVE_CONTENTS.exec(sc1_directive);\n\t\tif(!m_directive) {\n\t\t\tthrow new Error(`Invalid writable data event directive string: \"${sc1_directive}\"`);\n\t\t}\n\n\t\t// parse as JSON\n\t\tlet g_directive;\n\t\ttry {\n\t\t\tg_directive = JSON.parse(m_directive[1]);\n\t\t}\n\t\tcatch(e_parse) {\n\t\t\tthrow new Error(`Unable to parse JSON in writable data event directive: \"${m_directive[1]}\"`);\n\t\t}\n\n\t\t// directive type\n\t\tlet s_type = g_directive.type;\n\n\t\t// deduce directive type\n\t\tswitch(s_type) {\n\t\t\t// comment\n\t\t\tcase 'comment': {\n\t\t\t\t// serializer supports commenting; serialize comment\n\t\t\t\tif(this._serialize_comment) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\twrite: this._serialize_comment(w_value+'', g_directive),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// newlines\n\t\t\tcase 'newlines': {\n\t\t\t\t// serializer supports newlines; serialize newlines\n\t\t\t\tif(this._serialize_newlines) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\twrite: this._serialize_newlines(w_value),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// config\n\t\t\tcase 'config': {\n\t\t\t\tswitch(g_directive.value) {\n\t\t\t\t\t// list config\n\t\t\t\t\tcase 'lists': {\n\t\t\t\t\t\t// ref stack of list serializers\n\t\t\t\t\t\tlet a_list_serializers = this._a_list_serializers;\n\n\t\t\t\t\t\t// push current method to stack\n\t\t\t\t\t\ta_list_serializers.push(this._serialize_list_object);\n\n\t\t\t\t\t\t// inherit unspecified keys from parent\n\t\t\t\t\t\tlet g_list_default = this._g_lists;\n\n\t\t\t\t\t\t// build list config\n\t\t\t\t\t\tlet g_lists = {\n\t\t\t\t\t\t\tfirst: w_value.first || g_list_default.first,\n\t\t\t\t\t\t\trest: w_value.rest || g_list_default.rest,\n\t\t\t\t\t\t\tnil: w_value.nil || g_list_default.nil,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// redefine list object serialization\n\t\t\t\t\t\tthis._serialize_list_object = function(a_list, n_nest_level) {\n\t\t\t\t\t\t\t// transcode list object\n\t\t\t\t\t\t\tlet hc2_transcoded = this._transcode_list(a_list, g_lists);\n\n\t\t\t\t\t\t\t// serialize object\n\t\t\t\t\t\t\treturn this._encode_objects(hc2_transcoded, n_nest_level);\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// return local directive instructions\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\texit: () => {\n\t\t\t\t\t\t\t\tthis._serialize_list_object = a_list_serializers.pop();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\t// no such key\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tthrow new Error(`No such config key '${g_directive.value}'`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// other\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(`Invalid writable data event directive type: '${s_type}'`);\n\t\t\t}\n\t\t}\n\n\t\t// nothing\n\t\treturn {};\n\t}\n\n\t// if not overriden by subclass, serialize quads in default graph\n\t_serialize_c4(hc4_quads) {\n\t\tlet h_prefixes = this._h_prefixes;\n\t\tlet a_unions = [];\n\t\tlet s_write = '';\n\n\t\t// each graph in quads hash\n\t\tfor(let sv1_graph in hc4_quads) {\n\t\t\t// non-default graph; union from dataset\n\t\t\tif('*' !== sv1_graph) a_unions.push(sv1_graph);\n\n\t\t\t// add all quads from graph\n\t\t\ts_write += this._serialize_c3(hc4_quads[sv1_graph]);\n\t\t}\n\n\t\t// a union was performed\n\t\tif(a_unions.length) {\n\t\t\t// warn about implicit union\n\t\t\tlet s_warning = `Destination format does not support quads; an implicit union into the default graph was performed on the quads contained in graphs: ${a_unions.map(sc1 => factory.c1(sc1, h_prefixes).verbose()).join(', ')}`;\n\n\t\t\t// emit warning, wasn't listened to; force thru warn/stderr channel\n\t\t\tif(!this.emit('warning', s_warning)) {\n\t\t\t\tconsole.warn(s_warning);\n\t\t\t}\n\t\t}\n\n\t\treturn s_write;\n\t}\n}\n\nmodule.exports = Writable;\n","const stream = require('readable-stream');\n\n\n\nclass Readable extends stream.Readable {\n\tconstructor(gc_readable={}) {\n\t\tsuper(gc_readable);\n\n\t\t// use iterator\n\t\tif(gc_readable.iterator) {\n\t\t\tthrow new Error('readable stream iterator shortcut not yet implemented');\n\t\t}\n\t}\n\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass Writable extends stream.Writable {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\t// rdfjs impl\n\timport(ds_source) {\n\t\tds_source\n\t\t\t.on('data', w_chunk => this.write(w_chunk))\n\t\t\t.on('end', () => this.end())\n\t\t\t.on('error', e_read => this.emit('error', e_read));\n\n\t\treturn this;\n\t}\n}\n\nclass Duplex extends stream.Duplex {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass Transform extends stream.Transform {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\n\t// rdfjs impl\n\timport(ds_source) {\n\t\tds_source\n\t\t\t.on('data', w_chunk => this.write(w_chunk))\n\t\t\t.on('end', () => this.end())\n\t\t\t.on('error', e_read => this.emit('error', e_read));\n\n\t\treturn this;\n\t}\n\n\tdemolish(e_destroy) {\n\t\t// do not allow to push\n\t\tthis.push = (z_chunk) => {\n\t\t\t// ignore eof signals from node core\n\t\t\tif(null === z_chunk) return;\n\n\t\t\t// anything else is bad\n\t\t\tthrow new Error(`[ERR_STREAM_DESTROYED]: Cannot push after stream was destroyed`);\n\t\t};\n\n\t\t// do not allow to emit 'end'\n\t\tthis.emit = function(s_event, ...a_args) {\n\t\t\tif('end' === s_event) return;\n\n\t\t\tObject.getPrototypeOf(this).emit.apply(this, [s_event, ...a_args]);\n\t\t};\n\n\t\t// an error was given, destroy the stream as well\n\t\tif(e_destroy) {\n\t\t\treturn stream.Transform.prototype.destroy.call(this, e_destroy);\n\t\t}\n\t}\n}\n\n// eslint-disable-next-line no-new-func\nconst b_is_node = (new Function(/* syntax: js */ `try {return this===global;}catch(e){return false;}`))();\n\n// deduce the runtime environment\nconst [B_BROWSER, B_BROWSERIFY] = (() => 'undefined' === typeof process\n\t? [true, false]\n\t: (process.browser\n\t\t? [true, true]\n\t\t: ('undefined' === process.versions || 'undefined' === process.versions.node\n\t\t\t? [true, false]\n\t\t\t: [false, false])))();\n\n// node.js or browserify; patch for node < v10\nif(B_BROWSERIFY || (b_is_node && (+(/^v(\\d+)/.exec(process.version)[1])) < 10)) {\n\t// override destroy methods\n\tTransform.prototype.destroy = Duplex.prototype.destroy = function(e_destroy, fke_destroy) {\n\t\tthis._readableState.destroyed = true;\n\t\tthis._writableState.destroyed = true;\n\n\t\tlet f_emit_close = () => {\n\t\t\tif(!this._writableState.emitClose) return;\n\t\t\tif(!this._readableState.emitClose) return;\n\t\t\tthis.emit('close');\n\t\t};\n\n\t\tthis._destroy(e_destroy || null, (e_destroy_re) => {\n\t\t\tif(!fke_destroy && e_destroy_re) {\n\t\t\t\tprocess.nextTick(() => {\n\t\t\t\t\tthis.emit('error', e_destroy_re);\n\t\t\t\t\tf_emit_close();\n\t\t\t\t});\n\t\t\t\tthis._writableState.errorEmitted = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tprocess.nextTick(f_emit_close);\n\t\t\t\tif(fke_destroy) fke_destroy(e_destroy_re);\n\t\t\t}\n\t\t});\n\n\t\treturn this;\n\t};\n\n\t// override default _destroy implementations\n\tTransform.prototype._destroy = Duplex.prototype._destroy = (e_destroy, fke_destroy) => fke_destroy(e_destroy);\n}\n\nclass QuadsToOther extends Transform {\n\tconstructor(gc_transform={}) {\n\t\tsuper({\n\t\t\t...gc_transform,\n\t\t\twritableObjectMode: true,\n\t\t\treadableObjectMode: true,\n\t\t});\n\n\t\tthis._as_inputs = new Set();\n\n\t\t// forward prefix and comment events\n\t\tthis.on('pipe', (ds_src) => {\n\t\t\tthis._as_inputs.add(ds_src);\n\n\t\t\tds_src\n\t\t\t\t.on('prefix', (...a_args) => {\n\t\t\t\t\tthis.emit('prefix', ...a_args);\n\t\t\t\t})\n\t\t\t\t.on('comment', (...a_args) => {\n\t\t\t\t\tthis.emit('comment', ...a_args);\n\t\t\t\t});\n\t\t});\n\n\t\tthis.on('unpipe', (ds_src) => {\n\t\t\tthis._as_inputs.delete(ds_src);\n\t\t});\n\t}\n\n\t_destroy() {\n\t\tfor(let ds_input of this._as_inputs) {\n\t\t\tds_input.destroy();\n\t\t}\n\t}\n}\n\nclass Quads_To_JSON_Transform extends QuadsToOther {\n\t// serializse json\n\t_transform(g_quad, s_encoding, fk_transform) {\n\t\tfk_transform(null, JSON.stringify(g_quad.isolate())+'\\n');\n\t}\n}\n\nclass Quads_To_Writable extends QuadsToOther {\n\t_transform(g_quad, s_encoding, fk_transform) {\n\t\tfk_transform(null, {\n\t\t\ttype: 'quad',\n\t\t\tvalue: g_quad,\n\t\t});\n\t}\n}\n\nTransform.QuadsToOther = QuadsToOther;\n\nmodule.exports = {\n\t...stream,\n\tReadable,\n\tWritable,\n\tDuplex,\n\tTransform,\n\n\tQuadsToOther,\n\n\t// create a transform from quad objects into JSON strings for trivial serialization\n\tquads_to_json() {\n\t\treturn new Quads_To_JSON_Transform();\n\t},\n\n\t// create a transform from quad objects into writable data events\n\tquads_to_writable() {\n\t\treturn new Quads_To_Writable();\n\t},\n\n\t// create a simple, single-event readable stream\n\tsource(w_push, s_encoding=null) {\n\t\t// encoding not explicit, string given; assume utf8\n\t\tif(!s_encoding && 'string' === typeof w_push) s_encoding = 'utf8';\n\n\t\t// readable\n\t\treturn new Readable({\n\t\t\tobjectMode: !s_encoding && 'string' !== typeof w_push && !Buffer.isBuffer(w_push),\n\n\t\t\tread() {\n\t\t\t\tthis.push(w_push, s_encoding);\n\t\t\t\tthis.push(null);\n\t\t\t},\n\t\t});\n\t},\n};\n"],"names":["queueMicrotask","dp_resolve","Promise","resolve","fk","then","catch","e_callback","setTimeout","e_define","factory","stream","N_DEFAULT_MAX_BUFFER","Scribable","Transform","_flush_buffer","k_self","_s_push","push","constructor","gc_scribable","super","writableObjectMode","readableObjectMode","prefixes","h_prefixes","this","_n_max_buffer","max_buffer","maxBuffer","_h_prefixes","cache_prefixes","on","ds_src","s_prefix_id","p_iri","write","type","value","s_comment","close","once","drain","error","finish","data","end","warning","_serialize_hash_comment","replace","_serialize_newlines","n_newlines","repeat","_serialize_c4r","hc4r_quads","a_unions","s_write","sc1_graph","_serialize_c3r","length","s_warning","map","sc1","c1","verbose","join","emit","console","warn","_serialize_c3","Error","name","_serialize_c4","_serialize_quad","_serialize_comment","_update_prefixes","h_prefixes_in","b_terse","cachePrefixes","_transform","g_event","s_encoding","fke_transform","w_write","serialize","e_serialize","nl_push","_queue","s_push","undefined","g_sub","_serialize_prefixes","rinse","_reset","_flush","Object","assign","prototype","isGraphyWritable","module","exports","R_DIRECTIVE_CONTENTS","HM_COERCIONS_DEFAULT","Map","Date","dt","dateTime","Number","x","number","Writable","gc_writable","lists","gc_lists","hm_coercions","coercions","dc_type","f_transform","set","g_lists","first","rest","nil","sc1_first","sc1_rest","sc1_nil","_xc_state","_hm_coercions","_g_lists","g_directive","width","n_width","a_lines","s_line","slice","m_line","exec","_transcode_list","a_list","z_item","w_first","Array","isArray","_apply_directive","sc1_directive","w_value","m_directive","JSON","parse","e_parse","s_type","a_list_serializers","_a_list_serializers","_serialize_list_object","g_list_default","n_nest_level","hc2_transcoded","_encode_objects","exit","pop","hc4_quads","sv1_graph","Readable","gc_readable","iterator","until","s_event","b_return_stream","fk_until","fe_until","e_stream","a_args","bucket","g_readable","_readableState","objectMode","fk_bucket","fe_bucket","a_data","pipe","w_event","s_write_encoding","fk_write","writev","a_chunks","fk_writev","s_data","setEncoding","decodeStrings","s_chunk","ab_data","Buffer","from","ab_chunk","concat","import","ds_source","w_chunk","e_read","Duplex","demolish","e_destroy","z_chunk","getPrototypeOf","apply","destroy","call","b_is_node","Function","B_BROWSER","B_BROWSERIFY","process","browser","versions","node","version","fke_destroy","destroyed","_writableState","f_emit_close","emitClose","_destroy","e_destroy_re","nextTick","errorEmitted","QuadsToOther","gc_transform","_as_inputs","Set","add","delete","ds_input","Quads_To_JSON_Transform","g_quad","fk_transform","stringify","isolate","Quads_To_Writable","quads_to_json","quads_to_writable","source","w_push","isBuffer","read"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/55.a9b33011.js b/dist/js/55.d111b5d7.js similarity index 99% rename from dist/js/55.a9b33011.js rename to dist/js/55.d111b5d7.js index dbadbf7..c80fc04 100644 --- a/dist/js/55.a9b33011.js +++ b/dist/js/55.d111b5d7.js @@ -1,2 +1,2 @@ (self["webpackChunkmobilitydcatap_ui"]=self["webpackChunkmobilitydcatap_ui"]||[]).push([[55],{35055:function(t,e,s){var i=s(48287)["Buffer"];if("function"!==typeof queueMicrotask){let t=Promise.resolve();try{queueMicrotask=e=>t.then(e).catch((t=>setTimeout((()=>{throw t}),0)))}catch(It){}}const r=s(46579),_=s(83141),n=s(41476),h=s(76063),a=t=>h.quad(t._kt_subject,t._kt_predicate,t._kt_object,t._kt_graph),l=/^([A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\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\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\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}.]*[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\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,o=/^([A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\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]|%[A-Fa-f0-9]{2}|\\[_~.\-!$&'()*+,;=/?#@%])(([A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\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}.:]|%[A-Fa-f0-9]{2}|\\[_~.\-!$&'()*+,;=/?#@%])*([A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\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}:]|%[A-Fa-f0-9]{2}|\\[_~.\-!$&'()*+,;=/?#@%]))?$/u,c=/^[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\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]([A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\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}.]*[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\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,f=/^([^\0-\x20<>"{}|^`\\]|\\u[A-Fa-f0-9]{4}|\\U[A-Fa-f0-9]{8})*$/,u=/^([^\0-\x20<>"{}|^`])*$/,d=/\\u([0-9A-Fa-f]{4})|\\U([0-9A-Fa-f]{8})/g,p=(t,e,s)=>String.fromCodePoint(parseInt(e||s,16)),x=Object.prototype.hasOwnProperty,b=/([A-Za-z][A-Za-z0-9_-]*)?:([A-Za-z_0-9:][A-Za-z0-9_:-]*)(?:\s+|(?=\.?[<[("';,)\]#{}]|\.[\s\0]))/y,m=/([^\s#@<[("':_{}][^\s#@<[("':{}]*)?:((?:[^\s#@<[("'.;,{})\]\\](?:[^\s#@<[("';,{})\]\\]*[^\s#@<[("'.;,{})\]\\])?)?)(?:\s+|(?=\.?[<[("';,)\]#{}]|\.[\s\0]))/y,k=/([^\s#@<[("':_{}][^\s#@<[("':{}]*)?:((?:(?:[^\s#@<[("'.;,{})\]\\]|\\(?:%[0-9A-Fa-f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s*\{\s*/iy,P=/(?:graph)?\s*\[\s*\]\s*\{\s*/iy,z=/(?:graph)?\s*<([^>]*)>\s*\{\s*/iy,Z=/graph(?:\s+|(?=[#<[{]))/iy,W=/(#[^\n]*\n\s*)+/y,N=/^[A-Za-z][A-Za-z0-9.\-+]*:/,L=/^((([A-Za-z0-9.\-+]*:\/)?\/[^/>]*)?(\/(?:[^/>]*\/)*)?[^>]*)$/,C=/\[\s*\]\s*/y,J=/\[(?:\s+|(?=[^\]]))/y,D=/\(\s*/y,B=/\]\s*/y,G=/\{\s*/y,Q=/\}\s*/y,H=/\.\s*/y,V=/[\\"\r\n]/g,X=/[\\'\r\n]/g,Y=/"{1,2}$/g,K=/'{1,2}$/g,tt=/(\\|""")/g,et=/(\\|''')/g,st=(t,e,s,i,r,_)=>{if(e)switch(e){case"t":return"\t";case"n":return"\n";case"r":return"\r";case"f":return"\f";case"b":return"\b";default:console.assert(`bad regex escape char mapping: '${e}'`)}else{if(s)return s;if(i)return String.fromCodePoint(parseInt(i,16));if(r)return String.fromCodePoint(parseInt(r,16));if(_)throw"\\"===_[0]?new Error(`expected string_literal but invalid escape sequence within contents: '${_}'. failed to parse a valid token`):new Error(`expected string_literal but invalid whitespace character within contents: ${JSON.stringify(_)}. failed to parse a valid token`);console.assert("unexpected no match branch in escape sequence replace callback")}},it=/(?:\\(?:([tnrfb])|([\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|([\r\n]|\\.))/g,rt=/(?:\\(?:([tnrfb])|([\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|([\r\n]|\\[^uU]|\\u[^]{4}|\\U[^]{8}))/g,_t=t=>t.replace(it,st),nt=t=>{let e=ct.exec(t);if(e){let s=e.index;return[t.slice(0,s).replace(rt,st),t.slice(s)]}return[t.replace(rt,st),""]},ht=/(?:\\(?:([tnrfb])|([\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|(\\.))/g,at=/(?:\\(?:([tnrfb])|([\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|(\\[^uU]|\\u[^]{4}|\\U[^]{8}))/g,lt=t=>t.replace(ht,st),ot=t=>{let e=ct.exec(t);if(e){let s=e.index;return[t.slice(0,s).replace(at,st),t.slice(s)]}return[t.replace(at,st),""]},[ct,ft,ut,dt,pt]=(()=>{function t(t){let e=RegExp.prototype.exec.call(this,t);if(e){let t=e[0].length-e[1].length;e.index+=t,e[0]=e[0].slice(t)}return e}let e=(()=>{try{new RegExp("(?(e.exec=s,e)}return t=>t()})();return[e((()=>new RegExp("(?new RegExp('(?new RegExp("(?new RegExp('(?new RegExp("(?(m.lastIndex=e,[m.exec(t),m.lastIndex]),bt=(t,e)=>(k.lastIndex=e,[k.exec(t),k.lastIndex]);function mt(t,e,s,i){let r=Math.min(e,Math.abs(e-15)),_=t.s;return t.error(`\n\`${_.substr(r,r+90).replace(/[\n\t]/g," ")}\`\n ${" ".repeat(e-r)}^\nexpected ${s} ${i||""}. failed to parse a valid token starting at ${_[e]?'"'+_[e]+'"':"<>"}`)}class kt extends n.Transform{constructor(t){super({decodeStrings:!1,writableObjectMode:!1,readableObjectMode:!0,flush:t.flush,transform:t.transform})}pipe(t){let e=t;return e._writableState.objectMode?t.isGraphyWritable&&(t=n.quads_to_writable()):t=n.quads_to_json(),t!==e?(super.pipe(t),t.pipe(e)):super.pipe(e)}}class gt{constructor(t={}){let{input:e=null,state:s={}}=t,{blank_node_index:r=0,prefixes:n={},labels:l={}}=s,d=h.adopt(t.dataFactory||t.data_factory||h.unfiltered),p=d.defaultGraph();d!==h.unfiltered&&(p=Object.create(p));let x=d.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),m=d.blankNode,k=d.namedNode;if(this.emit_data=h.unfiltered===d?function(){I.push(a(this))}:function(){let t=d.quad(this._kt_subject,this._kt_predicate,this._kt_object,this._kt_graph);I.push(t)},Object.assign(this,{i:0,s:"",n:0,pre:t.prepend||"",_b_debug:t.debug||!1,_b_relax:t.relax||!1,_dc_factory:d,_f_state:this.block,_h_prefixes:n,_b_destroyed:!1,_s_base_url:"",_s_base_url_scheme:"",_s_base_url_root:"",_s_base_url_path:"",_kt_subject:null,_kt_predicate:x,_kt_object:null,_kt_graph:p,_s_literal:"",_kt_rdf_type:d.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),_kt_rdf_first:x,_kt_rdf_rest:d.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"),_kt_rdf_nil:d.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"),_kt_default_graph:p,_a_nested:[],_h_labels:l,event:this.emit,data:this.emit_data,restore_data:this.emit_data,_a_queue_event:[],_b_expecting_full_stop:!1,_s_temp_prefix_id:null,_b_trim_start:!0,anonymous_blank_node:t=>m(t,!0),next_label(){let t="";do{t="g"+r++}while(this._h_labels[t]);return this._h_labels[t]=2,t},eos:null,after_end_of_statement:this.post_object,_n_max_token_length:t.max_token_length||t.maxTokenLength||2048,_n_max_string_length:t.max_string_length||t.maxStringLength||1/0,_b_byte_tracking:t.byte_tracking||t.byteTracking||!1,_nb_seen:0,_nb_last:0,_nb_curr:0}),t.relaxed&&console.warn(new Error("no such option 'relaxed'; did you mean 'relax' ?").stack.replace(/^Error:/,"Warning:")),"validate"in t&&console.warn(new Error("option 'validate' has been deprecated. Validation is now enabled by default. Use the 'relax' option if you wish to disable validation.").stack.replace(/^Error:/,"Warning:")),Object.assign(this,t.relax?{blank_node(t){let e=this._h_labels[t];return e?1===e||(t=2===e?this._h_labels[t]=this.next_label():this._h_labels[t]):this._h_labels[t]=1,m(t)},check_named_node:k,check_named_node_escapeless:k,match_prefixed_name_escapeless:xt,match_prefixed_name:bt}:{blank_node(t){if(!c.test(t))return this.error(`invalid blank node label: "${t}"`);let e=this._h_labels[t];return e?1===e||(t=2===e?this._h_labels[t]=this.next_label():this._h_labels[t]):this._h_labels[t]=1,m(t)},check_named_node(t){return f.test(t)?k(t):this.error(`invalid IRI: "${t}"`)},check_named_node_escapeless(t){return u.test(t)?k(t):this.error(`invalid IRI: "${t}"`)},match_prefixed_name_quick(t,e){return b.lastIndex=e,[b.exec(t),b.lastIndex]},match_prefixed_name_escapeless(t,e){let[s,i]=xt(t,e);if(!s||o.test(s[2])||!s[2])return[s,i];this.error(`invalid prefixed name local name: "${s[2]}:"`)},match_prefixed_name(t,e){let[s,i]=bt(t,e);if(!s||o.test(s[2]))return[s,i];this.error(`invalid prefixed name local name: "${s[2]}:"`)}}),this.named_node=k,this.prefixed_name=function(t,e){return k(n[t]+e)},"string"===typeof t.base)throw new TypeError(`invalid type 'string' was given for 'base' event listener: '${t.base}'\ndid you mean to use the 'base_uri' key instead?`);let g=t.base_uri||t.baseUri||t.baseURI||t.base_iri||t.baseIri||t.baseIRI;if(g){let t=L.exec(g);this._s_base_url=t[1],this._s_base_url_root=t[2]||"",this._s_base_url_scheme=t[3]||"",this._s_base_url_path=t[4]||""}else if(t.base_url||t.baseUrl||t.baseURL)throw new Error(`invalid option: .base${t.base_url?"_url":t.baseUrl?"Url":t.baseURL?"URL":""}; use the '.base_uri' key instead`);let I=this.transform=new kt({transform:(t,e,s)=>{let i=this.s=this.pre+t;this.n=i.length,this._b_trim_start?(F.lastIndex=0,F.exec(i),this.i=F.lastIndex):this.i=0,this.safe_parse(!0)&&(I.emit("progress",t.length),s())},flush:t=>{try{this.eof(1)}catch(e){return void this.destroy(e)}t()}});if(I.on("pipe",(t=>{this._ds_input=t;let e=this._b_byte_tracking;if(e||"function"!==typeof t.setEncoding){let t=I.write,s=new _.StringDecoder("utf8"),r=(e,s,r)=>{let _=i.from(e,"utf8").length;return this._nb_seen+=_,this._nb_last=_,t.call(I,e,s,r)},n=(e,i,r)=>{let _=this._nb_last=e.length;return this._nb_seen+=_,t.call(I,s.write(e),i,r)},h=(e,i,r)=>t.call(I,s.write(e),i,r);I.write=function(s,i,_){return null!==s?(I.write="string"===typeof s?e?r:t:e?n:h,I.write(s,i,_)):t.call(I,s,i,_)},e&&(this.emit_data=this.data=this.restore_data=function(){let t=this._dc_factory.quad(this._kt_subject,this._kt_predicate,this._kt_object,this._kt_graph),e=i.from(this.s.slice(this.i)).length,s=this._nb_seen-e;t.byteRange=[this._nb_curr,s],this._nb_curr=s,this.transform.push(t)})}else t.setEncoding("utf8")})),I.on("newListener",(t=>{"comment"===t&&(this.emit_comments=t=>{let e=t.slice(1).replace(/\n\s+$/,"").split(/\n+\s*#/g);for(let s of e)I.emit("comment",s)})})),I._destroy=(...t)=>{this.destroy(...t)},this.bind(t),e)if(e.stream){let t=e.stream;queueMicrotask((()=>{t.pipe(I)}))}else{if("string"!==typeof e.string)throw new TypeError(`Invalid argument for input parameter: ${"object"===typeof e?JSON.stringify(e):e}`);{let t=e.string;queueMicrotask((()=>{I.end(t,"utf8")}))}}}safe_parse(){try{let t=this._f_state();while("function"===typeof t)t=t.apply(this)}catch(t){return this.destroy(t),!1}return!0}emit(t,...e){this.transform.emit(t,...e)}queue(t,...e){this._a_queue_event.push({event:t,args:e})}error(t){throw new Error(t)}parse_error(t,e=!1){let s=this.i,i=Math.min(s,Math.abs(s-15)),r=this.s;return this.error(`\n\`${r.substr(i,i+90).replace(/[\n\t]/g," ")}\`\n ${" ".repeat(s-i)}^\nexpected ${t} ${e?"but encountered <>":""}. failed to parse a valid token starting at ${r[s]?'"'+r[s]+'"':"<>"}`)}info_error(t){let e=this.i,s=Math.min(e,Math.abs(e-15)),i=this.s;this.error(`\n\`${i.substr(s,s+90).replace(/[\n\t]/g," ")}\`\n ${" ".repeat(e-s)}^\n`+t)}eof(){if(this._a_queue_event.length){let t=this._a_queue_event;while(t.length){let e=t.shift();this[e.event](e.data)}}if(this.block!==this._f_state&&(this.s+="\0",this.n=this.s.length,this.safe_parse())){if(null===this.s)return;if(this.block!==this._f_state)return this.parse_error(this._f_state.name,!0)}if(this.ie&&(this.i=e=W.lastIndex,this.emit_comments&&this.emit_comments(s[0])),ethis.max_token_length)return this.parse_error("statement");this._f_state=this.statement,this.pre=t.slice(s),this.eos&&this.eos()}block(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("block");this._f_state=this.block,this.pre=t.slice(s),this.eos&&this.eos()}graph_or_subject(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("graph_or_subject");this._f_state=this.graph_or_subject,this.pre=t.slice(s),this.eos&&this.eos()}graph_or_subject_property_list(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("graph_or_subject_property_list");this._f_state=this.graph_or_subject_property_list,this.pre=t.slice(s),this.eos&&this.eos()}graph_or_subject_anon(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("graph_or_subject_anon");this._f_state=this.graph_or_subject_anon,this.pre=t.slice(s),this.eos&&this.eos()}graph_keyword(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("graph_keyword");this._f_state=this.graph_keyword,this.pre=t.slice(s),this.eos&&this.eos()}graph_post_name(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("graph_post_name");this._f_state=this.graph_post_name,this.pre=t.slice(s),this.eos&&this.eos()}pairs(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("pairs");this._f_state=this.pairs,this.pre=t.slice(s),this.eos&&this.eos()}object_list(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("object_list");this._f_state=this.object_list,this.pre=t.slice(s),this.eos&&this.eos()}string_literal_short_double(){let{s:t,n:e,i:s}=this;t:while(sthis.max_token_length)return this.parse_error("string_literal_short_double");this._f_state=this.string_literal_short_double,this.pre=t.slice(s),this.eos&&this.eos()}string_literal_short_single(){let{s:t,n:e,i:s}=this;t:while(sthis.max_token_length)return this.parse_error("string_literal_short_single");this._f_state=this.string_literal_short_single,this.pre=t.slice(s),this.eos&&this.eos()}string_literal_long_double(){let{s:t,n:e,i:s}=this;t:while(sthis.max_token_length)return this.parse_error("string_literal_long_double");this._f_state=this.string_literal_long_double,this.pre=t.slice(s),this.eos&&this.eos()}string_literal_long_single(){let{s:t,n:e,i:s}=this;t:while(sthis.max_token_length)return this.parse_error("string_literal_long_single");this._f_state=this.string_literal_long_single,this.pre=t.slice(s),this.eos&&this.eos()}string_literal(){let{s:t,n:e,i:s}=this;while(sthis.max_string_length)return this.parse_error("string_literal");this._f_state=this.string_literal,this.pre=t.slice(s),this.eos&&this.eos()}datatype_or_langtag(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("datatype_or_langtag");this._f_state=this.datatype_or_langtag,this.pre=t.slice(s),this.eos&&this.eos()}datatype(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("datatype");this._f_state=this.datatype,this.pre=t.slice(s),this.eos&&this.eos()}post_object(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("post_object");this._f_state=this.post_object,this.pre=t.slice(s),this.eos&&this.eos()}base_iri(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("base_iri");this._f_state=this.base_iri,this.pre=t.slice(s),this.eos&&this.eos()}prefix_id(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("prefix_id");this._f_state=this.prefix_id,this.pre=t.slice(s),this.eos&&this.eos()}prefix_iri(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("prefix_iri");this._f_state=this.prefix_iri,this.pre=t.slice(s),this.eos&&this.eos()}full_stop(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("full_stop");this._f_state=this.full_stop,this.pre=t.slice(s),this.eos&&this.eos()}collection_subject(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("collection_subject");this._f_state=this.collection_subject,this.pre=t.slice(s),this.eos&&this.eos()}collection_object(){let{s:t,n:e,i:s}=this;while(sthis.max_token_length)return this.parse_error("collection_object");this._f_state=this.collection_object,this.pre=t.slice(s),this.eos&&this.eos()}destroy(t){this.post_blank_subject=()=>{},this.statement=()=>{},this.block=()=>{},this.graph_or_subject=()=>{},this.graph_or_subject_property_list=()=>{},this.graph_or_subject_anon=()=>{},this.graph_keyword=()=>{},this.graph_post_name=()=>{},this.pairs=()=>{},this.object_list=()=>{},this.string_literal_short_double=()=>{},this.string_literal_short_single=()=>{},this.string_literal_long_double=()=>{},this.string_literal_long_single=()=>{},this.string_literal=()=>{},this.datatype_or_langtag=()=>{},this.datatype=()=>{},this.post_object=()=>{},this.base_iri=()=>{},this.prefix_id=()=>{},this.prefix_iri=()=>{},this.full_stop=()=>{},this.collection_subject=()=>{},this.collection_object=()=>{},this.eof=()=>{this.s=null},this._b_destroyed=!0,!t&&this._ds_input&&this._ds_input.destroy(t),this.transform.demolish(t)}}t.exports=function(...t){let e={};if(t.length){let s=t[0];if(s&&s.input&&"undefined"===typeof s.input.string&&!s.input.stream&&(s=s.input),"string"===typeof s)e.input={string:s};else if(null===s)e.input=null;else if("function"===typeof s.setEncoding)e.input={stream:s};else{if("function"===typeof s.pipeTo)throw new TypeError("Sorry, WHATWG streams are currently not supported :(");if(!s||"object"!==typeof s||"[object Object]"!==Object.prototype.toString.call(s))throw new TypeError(`unexpected input type: ${s}`);if(e=s,t.length>1)throw new TypeError(`unexpected argument(s) after config struct: ${t.slice(1)}`)}if(t.length>1&&(Object.assign(e,t[1]),t.length>2))throw new TypeError(`unexpected argument(s) after input and config struct: ${t.slice(2)}`)}return new gt(e).transform}},41476:function(t,e,s){var i=s(48287)["Buffer"],r=s(65606);const _=s(28399);class n extends _.Readable{constructor(t={}){if(super(t),t.iterator)throw new Error("readable stream iterator shortcut not yet implemented")}until(t,e){return new Promise(((s,i)=>{this.on("error",(t=>{i(t)})),e?this.once(t,((...t)=>{s(this,...t)})):this.once(t,s)}))}bucket(t="utf8"){let e=this._readableState;return e.objectMode?new Promise(((t,e)=>{let s=[];this.pipe(new _.Writable({write(t,e,i){s.push(t),i()},writev(t,e){s.push(...t),e()}})).on("error",(t=>{e(t)})).on("finish",(()=>{t(s)}))})):"utf8"===t||"utf-8"===t?new Promise(((e,s)=>{let i="";this.setEncoding(t),this.pipe(new _.Writable({decodeStrings:!1,write(t,e,s){i+=t,s()},writev(t,e){i+=t.join(""),e()}})).on("error",(t=>{s(t)})).on("finish",(()=>{e(i)}))})):"buffer"===t?new Promise(((t,e)=>{let s=i.from([]);this.pipe(new _.Writable({decodeStrings:!0,write(t,e,r){s=i.concat([s,t],s.length+t.length),r()}})).on("error",(t=>{e(t)})).on("finish",(()=>{t(s)}))})):void 0}}class h extends _.Writable{until(t,e){return new Promise(((s,i)=>{this.on("error",(t=>{i(t)})),e?this.once(t,((...t)=>{s(this,...t)})):this.once(t,s)}))}import(t){return t.on("data",(t=>this.write(t))).on("end",(()=>this.end())).on("error",(t=>this.emit("error",t))),this}}class a extends _.Duplex{until(t,e){return new Promise(((s,i)=>{this.on("error",(t=>{i(t)})),e?this.once(t,((...t)=>{s(this,...t)})):this.once(t,s)}))}bucket(t="utf8"){let e=this._readableState;return e.objectMode?new Promise(((t,e)=>{let s=[];this.pipe(new _.Writable({write(t,e,i){s.push(t),i()},writev(t,e){s.push(...t),e()}})).on("error",(t=>{e(t)})).on("finish",(()=>{t(s)}))})):"utf8"===t||"utf-8"===t?new Promise(((e,s)=>{let i="";this.setEncoding(t),this.pipe(new _.Writable({decodeStrings:!1,write(t,e,s){i+=t,s()},writev(t,e){i+=t.join(""),e()}})).on("error",(t=>{s(t)})).on("finish",(()=>{e(i)}))})):"buffer"===t?new Promise(((t,e)=>{let s=i.from([]);this.pipe(new _.Writable({decodeStrings:!0,write(t,e,r){s=i.concat([s,t],s.length+t.length),r()}})).on("error",(t=>{e(t)})).on("finish",(()=>{t(s)}))})):void 0}}class l extends _.Transform{until(t,e){return new Promise(((s,i)=>{this.on("error",(t=>{i(t)})),e?this.once(t,((...t)=>{s(this,...t)})):this.once(t,s)}))}bucket(t="utf8"){let e=this._readableState;return e.objectMode?new Promise(((t,e)=>{let s=[];this.pipe(new _.Writable({write(t,e,i){s.push(t),i()},writev(t,e){s.push(...t),e()}})).on("error",(t=>{e(t)})).on("finish",(()=>{t(s)}))})):"utf8"===t||"utf-8"===t?new Promise(((e,s)=>{let i="";this.setEncoding(t),this.pipe(new _.Writable({decodeStrings:!1,write(t,e,s){i+=t,s()},writev(t,e){i+=t.join(""),e()}})).on("error",(t=>{s(t)})).on("finish",(()=>{e(i)}))})):"buffer"===t?new Promise(((t,e)=>{let s=i.from([]);this.pipe(new _.Writable({decodeStrings:!0,write(t,e,r){s=i.concat([s,t],s.length+t.length),r()}})).on("error",(t=>{e(t)})).on("finish",(()=>{t(s)}))})):void 0}import(t){return t.on("data",(t=>this.write(t))).on("end",(()=>this.end())).on("error",(t=>this.emit("error",t))),this}demolish(t){if(this.push=t=>{if(null!==t)throw new Error("[ERR_STREAM_DESTROYED]: Cannot push after stream was destroyed")},this.emit=function(t,...e){"end"!==t&&Object.getPrototypeOf(this).emit.apply(this,[t,...e])},t)return _.Transform.prototype.destroy.call(this,t)}}const o=new Function("try {return this===global;}catch(e){return false;}")(),[c,f]=(()=>"undefined"===typeof r?[!0,!1]:r.browser?[!0,!0]:"undefined"===r.versions||"undefined"===r.versions.node?[!0,!1]:[!1,!1])();(f||o&&+/^v(\d+)/.exec(r.version)[1]<10)&&(l.prototype.destroy=a.prototype.destroy=function(t,e){this._readableState.destroyed=!0,this._writableState.destroyed=!0;let s=()=>{this._writableState.emitClose&&this._readableState.emitClose&&this.emit("close")};return this._destroy(t||null,(t=>{!e&&t?(r.nextTick((()=>{this.emit("error",t),s()})),this._writableState.errorEmitted=!0):(r.nextTick(s),e&&e(t))})),this},l.prototype._destroy=a.prototype._destroy=(t,e)=>e(t));class u extends l{constructor(t={}){super({...t,writableObjectMode:!0,readableObjectMode:!0}),this._as_inputs=new Set,this.on("pipe",(t=>{this._as_inputs.add(t),t.on("prefix",((...t)=>{this.emit("prefix",...t)})).on("comment",((...t)=>{this.emit("comment",...t)}))})),this.on("unpipe",(t=>{this._as_inputs.delete(t)}))}_destroy(){for(let t of this._as_inputs)t.destroy()}}class d extends u{_transform(t,e,s){s(null,JSON.stringify(t.isolate())+"\n")}}class p extends u{_transform(t,e,s){s(null,{type:"quad",value:t})}}l.QuadsToOther=u,t.exports={..._,Readable:n,Writable:h,Duplex:a,Transform:l,QuadsToOther:u,quads_to_json(){return new d},quads_to_writable(){return new p},source(t,e=null){return e||"string"!==typeof t||(e="utf8"),new n({objectMode:!e&&"string"!==typeof t&&!i.isBuffer(t),read(){this.push(t,e),this.push(null)}})}}}}]); -//# sourceMappingURL=55.a9b33011.js.map \ No newline at end of file +//# sourceMappingURL=55.d111b5d7.js.map \ No newline at end of file diff --git a/dist/js/55.a9b33011.js.map b/dist/js/55.d111b5d7.js.map similarity index 99% rename from dist/js/55.a9b33011.js.map rename to dist/js/55.d111b5d7.js.map index 735606b..6d33197 100644 --- a/dist/js/55.a9b33011.js.map +++ b/dist/js/55.d111b5d7.js.map @@ -1 +1 @@ -{"version":3,"file":"js/55.a9b33011.js","mappings":"6IAMC,GAAG,oBAAsBA,eAAgB,CAExC,IAAIC,EAAaC,QAAQC,UAGzB,IAECH,eAAiBI,GAAMH,EAAWI,KAAKD,GACrCE,OAAMC,GAAcC,YAAW,KAC/B,MAAMD,CAAU,GACd,IACL,CAEA,MAAME,IAAW,CAClB,CAKD,MAAMC,EAAM,EAAQ,OACdC,EAAiB,EAAQ,OAEzBC,EAAS,EAAQ,OACjBC,EAAU,EAAQ,OAClBC,EAAOC,GAAKF,EAAQC,KAAKC,EAAEC,YAAaD,EAAEE,cAAeF,EAAEG,WAAYH,EAAEI,WAGzEC,EAAmC,4qBAEnCC,EAAoC,ozBAEpCC,EAAsB,6qBACtBC,EAAsB,gEACtBC,EAAiC,0BAIjCC,EAAgB,2CAEhBC,EAAyB,CAACC,EAAIC,EAAKC,IAAQC,OAAOC,cAAcC,SAASJ,GAAOC,EAAK,KAErFI,EAAQC,OAAOC,UAAUC,eAIzBC,EAAwB,mGAGxBC,EAA6B,6JA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AS,CACnBrS,YAAamH,GAAc,kBAAoB8O,IAAW3N,EAAO4N,SAASD,GAE1E,IAAApL,GACCnN,KAAKmE,KAAKoU,EAAQ9O,GAClBzJ,KAAKmE,KAAK,KACX,GAEF,E","sources":["webpack://mobilitydcatap-ui/./node_modules/@graphy/content.trig.read/main.js","webpack://mobilitydcatap-ui/./node_modules/@graphy/core.iso.stream/main.js"],"sourcesContent":["\n\n\n// queueMicrotask shim\n{\n\t// not defined or not a function\n\tif('function' !== typeof queueMicrotask) {\n\t\t// create resolved promise\n\t\tlet dp_resolve = Promise.resolve();\n\n\t\t// try to redefine\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-global-assign\n\t\t\tqueueMicrotask = fk => dp_resolve.then(fk)\n\t\t\t\t.catch(e_callback => setTimeout(() => {\n\t\t\t\t\tthrow e_callback;\n\t\t\t\t}, 0));\n\t\t}\n\t\t// oh well, at least we tried\n\t\tcatch(e_define) {}\n\t}\n}\n\n\n\nconst uri = require('uri-js');\nconst string_decoder = require('string_decoder');\n\nconst stream = require('@graphy/core.iso.stream');\nconst factory = require('@graphy/core.data.factory');\nconst quad = k => factory.quad(k._kt_subject, k._kt_predicate, k._kt_object, k._kt_graph);\n\n// eslint-disable-next-line no-misleading-character-class\nconst RT_PREFIXED_NAME_NAMESPACE_VALID = /^([A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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}.]*[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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;\n// eslint-disable-next-line no-misleading-character-class\nconst RT_PREFIXED_NAME_LOCAL_NAME_VALID = /^([A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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]|%[A-Fa-f0-9]{2}|\\\\[_~.\\-!$&'()*+,;=/?#@%])(([A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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}.:]|%[A-Fa-f0-9]{2}|\\\\[_~.\\-!$&'()*+,;=/?#@%])*([A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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}:]|%[A-Fa-f0-9]{2}|\\\\[_~.\\-!$&'()*+,;=/?#@%]))?$/u;\n// eslint-disable-next-line no-misleading-character-class\nconst RT_BLANK_NODE_VALID = /^[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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]([A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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}.]*[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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;\nconst RT_NAMED_NODE_VALID = /^([^\\0-\\x20<>\"{}|^`\\\\]|\\\\u[A-Fa-f0-9]{4}|\\\\U[A-Fa-f0-9]{8})*$/;\nconst RT_NAMED_NODE_ESCAPELESS_VALID = /^([^\\0-\\x20<>\"{}|^`])*$/;\n\nconst RT_LITERAL_CONTENTS_VALID = /^(?:[^\\\\]|\\\\[tbnrf\"'\\\\]|\\\\u[A-Fa-f0-9]{4}|\\\\U[A-Fa-f0-9]{8})*$/;\n\nconst R_UNICODE_ANY = /\\\\u([0-9A-Fa-f]{4})|\\\\U([0-9A-Fa-f]{8})/g;\n\nconst F_REPLACE_UNICODE_ANY = \t(s_, s_4, s_8) => String.fromCodePoint(parseInt(s_4 || s_8, 16));\n\nconst OPHOP = Object.prototype.hasOwnProperty;\n\n\n\nconst R_PREFIXED_NAME_QUICK = /([A-Za-z][A-Za-z0-9_-]*)?:([A-Za-z_0-9:][A-Za-z0-9_:-]*)(?:\\s+|(?=\\.?[<[(\"';,)\\]#{}]|\\.[\\s\\0]))/y;\n\n\nconst R_PREFIXED_NAME_ESCAPELESS = /([^\\s#@<[(\"':_{}][^\\s#@<[(\"':{}]*)?:((?:[^\\s#@<[(\"'.;,{})\\]\\\\](?:[^\\s#@<[(\"';,{})\\]\\\\]*[^\\s#@<[(\"'.;,{})\\]\\\\])?)?)(?:\\s+|(?=\\.?[<[(\"';,)\\]#{}]|\\.[\\s\\0]))/y;\n\n\n\nconst R_PREFIXED_NAME = /([^\\s#@<[(\"':_{}][^\\s#@<[(\"':{}]*)?:((?:(?:[^\\s#@<[(\"'.;,{})\\]\\\\]|\\\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\\s\"]))(?:(?:[^\\s#@<[(\"';,{})\\]\\\\]|\\\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\\s\"]))*(?:[^\\s#@<[(\"'.;,{})\\]\\\\]|\\\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\\s\"])))?)?)(?:\\s+|(?=\\.?[<[(\"';,)\\]#{}]|\\.[\\s\\0]))/y;\n\nconst R_PN_LOCAL_ESCAPES = /\\\\(.)/g;\n\n\nconst R_BLANK_NODE_LABEL = /_:(.(?:[^\\s:<;,)\\]#}]*[^\\s:<.;,)\\]#}])?)(?:\\s+|(?=[<:{,;\\])#]))/y;\nconst R_BLANK_NODE_LABEL_TERMINAL = /_:(.(?:[^\\s:<;,)\\]#}]*[^\\s:<.;,)\\]#}])?)(?:\\s+|(?=\\.?[<:{,;\\])#])|(?=\\.[\\s@#<({[}]))/y;\n\nconst R_IRIREF_ESCAPELESS = /<([^\\\\>]*)>\\s*/y;\nconst R_IRIREF = /<([^>]*)>\\s*/y;\n\nconst R_NUMERIC_LITERAL = /([+-]?(?:[0-9]+(\\.[0-9]+)?|(\\.[0-9]+))(\\.?[eE][+-]?[0-9]+)?)(?:\\s+|(?=\\.[^eE0-9]|[;,)\\]]))/y;\nconst R_BOOLEAN_LITERAL = /(?:(true|TRUE)|false|FALSE)\\s*/y;\nconst R_A = /a(?:\\s+|(?=[[(\"'<#]))/y;\n\nconst R_DOUBLE_CARET = /\\^\\^/y;\nconst R_WS = /\\s*/y;\nconst R_LANGTAG = /@([A-Za-z]+(?:-[A-Za-z0-9-]+)*)(?:\\s+|(?=[.},;\\])#]))/y;\n\nconst R_PREFIX_KEYWORD = /(?:(@prefix)|[pP][rR][eE][fF][iI][xX])\\s*/y;\nconst R_PREFIX_ID = /([^#:]*):\\s*/iy;\nconst R_BASE_KEYWORD = /(?:(@base)|[bB][aA][sS][eE])\\s*/y;\n\nconst R_GRAPH_IRI_ESCAPELESS = /(?:graph)?\\s*<([^\\\\>]*)>\\s*\\{\\s*/iy;\nconst R_GRAPH_PREFIXED_NAME = /(?:graph)?\\s*([^\\s#@<[(\"':_{}][^\\s#@<[(\"':{}]*)?:((?:(?:[^\\s#@<[(\"'.;,{})\\]\\\\]|\\\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\\s\"]))(?:(?:[^\\s#@<[(\"';,{})\\]\\\\]|\\\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\\s\"]))*(?:[^\\s#@<[(\"'.;,{})\\]\\\\]|\\\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\\s\"])))?)?)\\s*\\{\\s*/iy;\nconst R_GRAPH_LABELED_BLANK_NODE = /(?:graph)?\\s*_:(.(?:[^\\s:<;,)\\]#}]*[^\\s:<.;,)\\]#}])?)\\s*\\{\\s*/iy;\nconst R_GRAPH_ANONYMOUS_BLANK_NODE = /(?:graph)?\\s*\\[\\s*\\]\\s*\\{\\s*/iy;\nconst R_GRAPH_IRI = /(?:graph)?\\s*<([^>]*)>\\s*\\{\\s*/iy;\nconst R_GRAPH = /graph(?:\\s+|(?=[#<[{]))/iy;\n\nconst R_COMMENT = /(#[^\\n]*\\n\\s*)+/y;\n\nconst RT_IRI_ABSOLUTE = /^[A-Za-z][A-Za-z0-9.\\-+]*:/;\nconst R_RELATIVE_URI = /^(\\/[^?#]+)([?#].*)?$/;\nconst R_BASE_IRI = /^((([A-Za-z0-9.\\-+]*:\\/)?\\/[^/>]*)?(\\/(?:[^/>]*\\/)*)?[^>]*)$/;\n\nconst R_ANONYMOUS_BLANK_NODE = /\\[\\s*\\]\\s*/y;\nconst R_CHAR_BLANK_NODE = /\\[(?:\\s+|(?=[^\\]]))/y;\nconst R_CHAR_COLLECTION = /\\(\\s*/y;\n\nconst R_CHAR_KET = /\\]\\s*/y;\n\nconst R_CHAR_OPEN = /\\{\\s*/y;\nconst R_CHAR_CLOSE = /\\}\\s*/y;\n\nconst R_CHAR_STOP = /\\.\\s*/y;\n\n\n\nconst R_STRLIT_SHORT_DOUBLE_BREAK = /[\\\\\"\\r\\n]/g;\nconst R_STRLIT_SHORT_SINGLE_BREAK = /[\\\\'\\r\\n]/g;\n\nconst R_STRLIT_LONG_DOUBLE_UNFINISHED_TERM = /\"{1,2}$/g;\nconst R_STRLIT_LONG_SINGLE_UNFINISHED_TERM = /'{1,2}$/g;\n\nconst R_STRLIT_LONG_DOUBLE_BREAK = /(\\\\|\"\"\")/g;\nconst R_STRLIT_LONG_SINGLE_BREAK = /(\\\\|''')/g;\n\n\nconst F_REPLACE_STRLIT_CONTENTS = (s_, s_whitespace, s_auto, s_4, s_8, s_invalid) => {\n\tif(s_whitespace) {\n\t\tswitch(s_whitespace) {\n\t\t\tcase 't': return '\\t';\n\t\t\tcase 'n': return '\\n';\n\t\t\tcase 'r': return '\\r';\n\t\t\tcase 'f': return '\\f';\n\t\t\tcase 'b': return '\\b';\n\t\t\tdefault: {\n\t\t\t\tconsole.assert(`bad regex escape char mapping: '${s_whitespace}'`);\n\t\t\t}\n\t\t}\n\t}\n\telse if(s_auto) {\n\t\treturn s_auto;\n\t}\n\telse if(s_4) {\n\t\treturn String.fromCodePoint(parseInt(s_4, 16));\n\t}\n\telse if(s_8) {\n\t\treturn String.fromCodePoint(parseInt(s_8, 16));\n\t}\n\telse if(s_invalid) {\n\t\t// pointless escape\n\t\tif('\\\\' === s_invalid[0]) {\n\t\t\t\t// // relaxed\n\t\t\t\t// return s_invalid[1];\n\t\t\t// if relaxed then return s_invalid, otherwise throw:\n\t\t\tthrow new Error(`expected string_literal but invalid escape sequence within contents: '${s_invalid}'. failed to parse a valid token`);\n\t\t}\n\t\t// bad character\n\t\telse {\n\t\t\tthrow new Error(`expected string_literal but invalid whitespace character within contents: ${JSON.stringify(s_invalid)}. failed to parse a valid token`);\n\t\t}\n\t}\n\telse {\n\t\tconsole.assert(`unexpected no match branch in escape sequence replace callback`);\n\t}\n};\n\n\nconst R_STRLIT_SHORT_CONTENTS_ESCAPES_HARD = /(?:\\\\(?:([tnrfb])|([\\\\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|([\\r\\n]|\\\\.))/g;\nconst R_STRLIT_SHORT_CONTENTS_ESCAPES_SOFT = /(?:\\\\(?:([tnrfb])|([\\\\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|([\\r\\n]|\\\\[^uU]|\\\\u[^]{4}|\\\\U[^]{8}))/g;\n\nconst unescape_literal_short_hard = s_literal => s_literal\n\t.replace(R_STRLIT_SHORT_CONTENTS_ESCAPES_HARD, F_REPLACE_STRLIT_CONTENTS);\n\nconst unescape_literal_short_soft = (s_literal) => {\n\tlet m_incomplete = R_STRLIT_ESCAPE_INCOMPLETE.exec(s_literal);\n\n\t// incomplete escape\n\tif(m_incomplete) {\n\t\tlet i_safe = m_incomplete.index;\n\n\t\t// rewind\n\t\treturn [\n\t\t\ts_literal.slice(0, i_safe)\n\t\t\t\t.replace(R_STRLIT_SHORT_CONTENTS_ESCAPES_SOFT, F_REPLACE_STRLIT_CONTENTS),\n\t\t\ts_literal.slice(i_safe),\n\t\t];\n\t}\n\t// done\n\telse {\n\t\treturn [\n\t\t\ts_literal\n\t\t\t\t.replace(R_STRLIT_SHORT_CONTENTS_ESCAPES_SOFT, F_REPLACE_STRLIT_CONTENTS),\n\t\t\t'',\n\t\t];\n\t}\n};\n\n\nconst R_STRLIT_LONG_CONTENTS_ESCAPES_HARD = /(?:\\\\(?:([tnrfb])|([\\\\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|(\\\\.))/g;\nconst R_STRLIT_LONG_CONTENTS_ESCAPES_SOFT = /(?:\\\\(?:([tnrfb])|([\\\\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|(\\\\[^uU]|\\\\u[^]{4}|\\\\U[^]{8}))/g;\n\nconst unescape_literal_long_hard = s_literal => s_literal\n\t.replace(R_STRLIT_LONG_CONTENTS_ESCAPES_HARD, F_REPLACE_STRLIT_CONTENTS);\n\nconst unescape_literal_long_soft = (s_literal) => {\n\tlet m_incomplete = R_STRLIT_ESCAPE_INCOMPLETE.exec(s_literal);\n\n\t// incomplete escape\n\tif(m_incomplete) {\n\t\tlet i_safe = m_incomplete.index;\n\n\t\t// rewind\n\t\treturn [\n\t\t\ts_literal.slice(0, i_safe)\n\t\t\t\t.replace(R_STRLIT_LONG_CONTENTS_ESCAPES_SOFT, F_REPLACE_STRLIT_CONTENTS),\n\t\t\ts_literal.slice(i_safe),\n\t\t];\n\t}\n\t// done\n\telse {\n\t\treturn [\n\t\t\ts_literal\n\t\t\t\t.replace(R_STRLIT_LONG_CONTENTS_ESCAPES_SOFT, F_REPLACE_STRLIT_CONTENTS),\n\t\t\t'',\n\t\t];\n\t}\n};\n\n// lookbehind regexes\nconst [\n\tR_STRLIT_ESCAPE_INCOMPLETE,\n\tR_STRLIT_SHORT_DOUBLE_TERM,\n\tR_STRLIT_SHORT_SINGLE_TERM,\n\tR_STRLIT_LONG_DOUBLE_TERM,\n\tR_STRLIT_LONG_SINGLE_TERM,\n] = (() => {\n\tfunction RegExp_$lookbehind_polyfill(s_input) {\n\t\tlet m_match = RegExp.prototype.exec.call(this, s_input);\n\n\t\tif(m_match) {\n\t\t\tlet i_start = m_match[0].length - m_match[1].length;\n\t\t\tm_match.index += i_start;\n\t\t\tm_match[0] = m_match[0].slice(i_start);\n\t\t}\n\n\t\treturn m_match;\n\t}\n\tlet mk_lookbehind_regex = (() => {\n\t\ttry {\n\t\t\tnew RegExp('(? {\n\t\t\t\tr_polyfill.exec = f_polyfill;\n\t\t\t\treturn r_polyfill;\n\t\t\t};\n\t\t}\n\t\treturn f_lookbehind => f_lookbehind();\n\t})();\n\treturn [\n\t\t// R_STRLIT_ESCAPE_INCOMPLETE\n\t\tmk_lookbehind_regex(\n\t\t\t() => new RegExp('(? new RegExp('(? new RegExp('(? new RegExp('(? new RegExp('(? {\n\tR_PREFIXED_NAME_QUICK.lastIndex = i;\n\treturn [R_PREFIXED_NAME_QUICK.exec(s), R_PREFIXED_NAME_QUICK.lastIndex];\n};\n\nconst match_prefixed_name_escapeless = (s, i) => {\n\tR_PREFIXED_NAME_ESCAPELESS.lastIndex = i;\n\treturn [R_PREFIXED_NAME_ESCAPELESS.exec(s), R_PREFIXED_NAME_ESCAPELESS.lastIndex];\n};\n\nconst match_prefixed_name = (s, i) => {\n\tR_PREFIXED_NAME.lastIndex = i;\n\treturn [R_PREFIXED_NAME.exec(s), R_PREFIXED_NAME.lastIndex];\n};\n\n\n\nfunction Reader$syntax_error(k_self, i, si_state, s_info) {\n\tlet i_off = Math.min(i, Math.abs(i-15));\n\n\tlet s = k_self.s;\n\n\treturn k_self.error(`\\n\\`${s.substr(i_off, i_off+90).replace(/[\\n\\t]/g, ' ')}\\`\\n`\n\t\t+` ${' '.repeat(i-i_off)}^\\n`\n\t\t+`expected ${si_state} ${s_info || ''}. failed to parse a valid token starting at ${s[i]? '\"'+s[i]+'\"': '<>'}`);\n}\n\n\n\nclass TriG_Reader extends stream.Transform {\n\tconstructor(g_impls) {\n\t\tsuper({\n\t\t\t// do not decode strings into buffers\n\t\t\tdecodeStrings: false,\n\n\t\t\t// accept strings as input on writable side\n\t\t\twritableObjectMode: false,\n\n\t\t\t// output quad objects on readable side\n\t\t\treadableObjectMode: true,\n\n\t\t\t// implementations\n\t\t\tflush: g_impls.flush,\n\t\t\ttransform: g_impls.transform,\n\t\t});\n\t}\n\n\t// intercept pipe\n\tpipe(ds_out) {\n\t\tlet ds_dst = ds_out;\n\n\t\t// non-object mode\n\t\tif(!ds_dst._writableState.objectMode) {\n\t\t\t// transform to JSON\n\t\t\tds_out = stream.quads_to_json();\n\t\t}\n\t\t// yet object mode and graphy writable\n\t\telse if(ds_out.isGraphyWritable) {\n\t\t\t// transform to writable data events\n\t\t\tds_out = stream.quads_to_writable();\n\t\t}\n\n\t\t// interim stream created\n\t\tif(ds_out !== ds_dst) {\n\t\t\t// forward output to super\n\t\t\tsuper.pipe(ds_out);\n\n\t\t\t// pipe outpu to destination\n\t\t\treturn ds_out.pipe(ds_dst);\n\t\t}\n\t\t// forward as-is to super\n\t\telse {\n\t\t\treturn super.pipe(ds_dst);\n\t\t}\n\t}\n}\n\n\nclass Reader {\n\tconstructor(g_config={}) {\n\t\t// impl-specific configs\n\t\tlet {\n\t\t\t// input medium\n\t\t\tinput: g_input=null,\n\n\t\t\t// a state to inherit\n\t\t\tstate: g_state={},\n\t\t} = g_config;\n\n\t\t// inherit state from creator\n\t\tlet {\n\t\t\t// index for anonymous blank node labels\n\t\t\tblank_node_index: i_anon=0,\n\n\t\t\t// prefix map\n\t\t\tprefixes: h_prefixes={},\n\n\t\t\t// blank node label map\n\t\t\tlabels: h_labels={},\n\t\t} = g_state;\n\n\n\t\tlet dc_factory = factory.adopt(g_config.dataFactory || g_config.data_factory || factory.unfiltered);\n\n\t\tlet kt_default_graph = dc_factory.defaultGraph();\n\n\t\t// if data factory is not graphy, it might be returning the same object on each call to .defaultGraph()\n\t\tif(dc_factory !== factory.unfiltered) {\n\t\t\t// do not trust it, create a new object\n\t\t\tkt_default_graph = Object.create(kt_default_graph);\n\t\t}\n\n\t\tlet kt_rdf_first = dc_factory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#first');\n\n\t\tlet blankNode = dc_factory.blankNode;\n\t\tlet namedNode = dc_factory.namedNode;\n\n\t\tthis.emit_data = factory.unfiltered === dc_factory\n\t\t\t? function() {\n\t\t\t\tds_transform.push(quad(this));\n\t\t\t}\n\t\t\t: function() {\n\t\t\t\tlet g_quad = dc_factory.quad(this._kt_subject, this._kt_predicate, this._kt_object, this._kt_graph);\n\t\t\t\tds_transform.push(g_quad);\n\t\t\t};\n\n\t\t// fields\n\t\tObject.assign(this, {\n\t\t\t// read index\n\t\t\ti: 0,\n\n\t\t\t// string buffer\n\t\t\ts: '',\n\n\t\t\t// string buffer length\n\t\t\tn: 0,\n\n\t\t\t// left-over string from previous data chunk\n\t\t\tpre: g_config.prepend || '',\n\n\t\t\t// debug state\n\t\t\t_b_debug: g_config.debug || false,\n\n\t\t\t// relax\n\t\t\t_b_relax: g_config.relax || false,\n\n\t\t\t// factory\n\t\t\t_dc_factory: dc_factory,\n\n\t\t\t// current reader state\n\t\t\t_f_state: this.block,\n\n\t\t\t// map of current prefix ids => iris\n\t\t\t_h_prefixes: h_prefixes,\n\n\n\t\t\t// reader was destroyed by an error\n\t\t\t_b_destroyed: false,\n\n\t\t\t// current @base url\n\t\t\t_s_base_url: '',\n\t\t\t_s_base_url_scheme: '',\n\t\t\t_s_base_url_root: '',\n\t\t\t_s_base_url_path: '',\n\n\t\t\t// current data\n\t\t\t_kt_subject: null,\n\t\t\t_kt_predicate: kt_rdf_first,\n\t\t\t_kt_object: null,\n\t\t\t_kt_graph: kt_default_graph,\n\t\t\t_s_literal: '',\n\n\t\t\t// static terms\n\t\t\t_kt_rdf_type: dc_factory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'),\n\t\t\t_kt_rdf_first: kt_rdf_first,\n\t\t\t_kt_rdf_rest: dc_factory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#rest'),\n\t\t\t_kt_rdf_nil: dc_factory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'),\n\t\t\t_kt_default_graph: kt_default_graph,\n\n\t\t\t// queue of nested subject, predicate, state for blanknodes and collections\n\t\t\t_a_nested: [],\n\n\t\t\t// hash to keep track of all blank node labels in use\n\t\t\t_h_labels: h_labels,\n\n\t\t\t// event routing\n\t\t\tevent: this.emit,\n\t\t\tdata: this.emit_data,\n\n\t\t\t// for restoring the original event callback when resuming paused stream\n\t\t\trestore_data: this.emit_data,\n\n\t\t\t// keep a queue of data events to hold onto until stream resumes (only happens in rare conditions)\n\t\t\t_a_queue_event: [],\n\n\t\t\t// helper states\n\t\t\t_b_expecting_full_stop: false,\n\t\t\t_s_temp_prefix_id: null,\n\t\t\t_b_trim_start: true,\n\n\t\t\tanonymous_blank_node: s_label => blankNode(s_label, true),\n\n\t\t\t// finds the next non-conflicting blank node label\n\t\t\tnext_label() {\n\t\t\t\tlet s_label = '';\n\t\t\t\tdo {\n\t\t\t\t\ts_label = 'g'+(i_anon++);\n\t\t\t\t} while(this._h_labels[s_label]);\n\n\t\t\t\t// claim this label, and remember that we invented it\n\t\t\t\tthis._h_labels[s_label] = 2;\n\n\t\t\t\t// return the label\n\t\t\t\treturn s_label;\n\t\t\t},\n\n\t\t\t// what to do when reach eos\n\t\t\teos: null,\n\n\t\t\t// which state to go to after end of statement\n\t\t\tafter_end_of_statement: this.post_object,\n\n\t\t\t// maximum length of a token: defaults to 2048 => http://stackoverflow.com/a/417184/1641160\n\t\t\t_n_max_token_length: g_config.max_token_length || g_config.maxTokenLength || 2048,\n\n\t\t\t// maximum length of a string (overrides max_token_length): defaults to Infinity\n\t\t\t_n_max_string_length: g_config.max_string_length || g_config.maxStringLength || Infinity,\n\n\t\t\t// byte tracking\n\t\t\t_b_byte_tracking: g_config.byte_tracking || g_config.byteTracking || false,\n\t\t\t_nb_seen: 0,\n\t\t\t_nb_last: 0,\n\t\t\t_nb_curr: 0,\n\t\t});\n\n\t\tif(g_config.relaxed) {\n\t\t\tconsole.warn((new Error(`no such option 'relaxed'; did you mean 'relax' ?`)).stack.replace(/^Error:/, 'Warning:'));\n\t\t}\n\t\tif('validate' in g_config) {\n\t\t\tconsole.warn((new Error(`option 'validate' has been deprecated. Validation is now enabled by default. Use the 'relax' option if you wish to disable validation.`)).stack.replace(/^Error:/, 'Warning:'));\n\t\t}\n\n\n\n\t\t// term constructors\n\t\tObject.assign(this, !g_config.relax\n\t\t\t? {\n\t\t\t\tblank_node(s_label) {\n\t\t\t\t\t// test valid blank node label\n\t\t\t\t\tif(!RT_BLANK_NODE_VALID.test(s_label)) return this.error(`invalid blank node label: \"${s_label}\"`);\n\n\t\t\t\t\t// not first time use of label\n\t\t\t\t\tlet z_label_state = this._h_labels[s_label];\n\t\t\t\t\tif(z_label_state) {\n\t\t\t\t\t\t// label was used previously by document and has no conflict\n\t\t\t\t\t\tif(1 === z_label_state) {} // eslint-disable-line no-empty\n\t\t\t\t\t\t// label is in use by invention, this would cause a conflict\n\t\t\t\t\t\telse if(2 === z_label_state) {\n\t\t\t\t\t\t\t// so create a redirect mapping for this actual label & use it instead\n\t\t\t\t\t\t\ts_label = this._h_labels[s_label] = this.next_label();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// label already has a redirect mapping\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// use redirected label\n\t\t\t\t\t\t\ts_label = this._h_labels[s_label];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// first time use of label\n\t\t\t\t\telse {\n\t\t\t\t\t\t// store label in hash so we avoid future collisions\n\t\t\t\t\t\tthis._h_labels[s_label] = 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t// make term\n\t\t\t\t\treturn blankNode(s_label);\n\t\t\t\t},\n\n\t\t\t\tcheck_named_node(p_iri) {\n\t\t\t\t\tif(!RT_NAMED_NODE_VALID.test(p_iri)) return this.error(`invalid IRI: \"${p_iri}\"`);\n\t\t\t\t\treturn namedNode(p_iri);\n\t\t\t\t},\n\n\t\t\t\tcheck_named_node_escapeless(p_iri) {\n\t\t\t\t\tif(!RT_NAMED_NODE_ESCAPELESS_VALID.test(p_iri)) return this.error(`invalid IRI: \"${p_iri}\"`);\n\t\t\t\t\treturn namedNode(p_iri);\n\t\t\t\t},\n\n\t\t\t\tmatch_prefixed_name_quick(s, i) {\n\t\t\t\t\tR_PREFIXED_NAME_QUICK.lastIndex = i;\n\t\t\t\t\treturn [R_PREFIXED_NAME_QUICK.exec(s), R_PREFIXED_NAME_QUICK.lastIndex];\n\t\t\t\t},\n\n\t\t\t\tmatch_prefixed_name_escapeless(s, i) {\n\t\t\t\t\tlet [m_prefixed_name_e, im_prefixed_name_e] = match_prefixed_name_escapeless(s, i);\n\t\t\t\t\tif(m_prefixed_name_e) {\n\t\t\t\t\t\t// invalid local name\n\t\t\t\t\t\tif(!RT_PREFIXED_NAME_LOCAL_NAME_VALID.test(m_prefixed_name_e[2]) && m_prefixed_name_e[2]) {\n\t\t\t\t\t\t\tthis.error(`invalid prefixed name local name: \"${m_prefixed_name_e[2]}:\"`);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [m_prefixed_name_e, im_prefixed_name_e];\n\t\t\t\t},\n\n\t\t\t\tmatch_prefixed_name(s, i) {\n\t\t\t\t\tlet [m_prefixed_name, im_prefixed_name] = match_prefixed_name(s, i);\n\t\t\t\t\tif(m_prefixed_name) {\n\t\t\t\t\t\t// invalid local name\n\t\t\t\t\t\tif(!RT_PREFIXED_NAME_LOCAL_NAME_VALID.test(m_prefixed_name[2])) {\n\t\t\t\t\t\t\tthis.error(`invalid prefixed name local name: \"${m_prefixed_name[2]}:\"`);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [m_prefixed_name, im_prefixed_name];\n\t\t\t\t},\n\t\t\t}\n\t\t\t: {\n\t\t\t\t// term constructors\n\t\t\t\tblank_node(s_label) {\n\t\t\t\t\t// not first time use of label\n\t\t\t\t\tlet z_label_state = this._h_labels[s_label];\n\t\t\t\t\tif(z_label_state) {\n\t\t\t\t\t\t// label was used previously by document and has no conflict\n\t\t\t\t\t\tif(1 === z_label_state) {} // eslint-disable-line no-empty\n\t\t\t\t\t\t// label is in use by invention, this would cause a conflict\n\t\t\t\t\t\telse if(2 === z_label_state) {\n\t\t\t\t\t\t\t// so create a redirect mapping for this actual label & use it instead\n\t\t\t\t\t\t\ts_label = this._h_labels[s_label] = this.next_label();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// label already has a redirect mapping\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// use redirected label\n\t\t\t\t\t\t\ts_label = this._h_labels[s_label];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// first time use of label\n\t\t\t\t\telse {\n\t\t\t\t\t\t// store label in hash so we avoid future collisions\n\t\t\t\t\t\tthis._h_labels[s_label] = 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t// make term\n\t\t\t\t\treturn blankNode(s_label);\n\t\t\t\t},\n\n\t\t\t\tcheck_named_node: namedNode,\n\n\t\t\t\tcheck_named_node_escapeless: namedNode,\n\n\t\t\t\tmatch_prefixed_name_escapeless,\n\n\t\t\t\tmatch_prefixed_name,\n\t\t\t});\n\n\n\t\tthis.named_node = namedNode;\n\n\t\tthis.prefixed_name = function(si_prefix, s_suffix) {\n\t\t\treturn namedNode(h_prefixes[si_prefix] + s_suffix);\n\t\t};\n\n\n\t\t// oops -- user passed string into `base`\n\t\tif('string' === typeof g_config.base) {\n\t\t\tthrow new TypeError(`invalid type 'string' was given for 'base' event listener: '${g_config.base}'\\n`\n\t\t\t\t+`did you mean to use the 'base_uri' key instead?`);\n\t\t}\n\n\t\t// base uri\n\t\tlet p_set_base_uri = g_config.base_uri || g_config.baseUri || g_config.baseURI || g_config.base_iri || g_config.baseIri || g_config.baseIRI;\n\t\tif(p_set_base_uri) {\n\t\t\tlet m_base_iri = R_BASE_IRI.exec(p_set_base_uri);\n\t\t\tthis._s_base_url = m_base_iri[1];\n\t\t\tthis._s_base_url_root = m_base_iri[2] || '';\n\t\t\tthis._s_base_url_scheme = m_base_iri[3] || '';\n\t\t\tthis._s_base_url_path = m_base_iri[4] || '';\n\t\t}\n\t\t// not set; 'url' variant is\n\t\telse if(g_config.base_url || g_config.baseUrl || g_config.baseURL) {\n\t\t\tthrow new Error(`invalid option: .base${g_config.base_url? '_url': g_config.baseUrl? 'Url': g_config.baseURL? 'URL': ''}; use the '.base_uri' key instead`);\n\t\t}\n\n\t\t// transform stream\n\t\tlet ds_transform = this.transform = new TriG_Reader({\n\t\t\t// on data event\n\t\t\ttransform: (s_chunk, s_encoding, fke_chunk) => {\n\t\t\t\t// concatenate current chunk to previous chunk\n\t\t\t\tlet s = this.s = this.pre + s_chunk;\n\n\t\t\t\t// cache chunk length\n\t\t\t\tthis.n = s.length;\n\n\t\t\t\t// eat whitespace before token and reset index\n\t\t\t\tif(this._b_trim_start) {\n\t\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\tR_WS.lastIndex = 0;\n\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\tthis.i = R_WS.lastIndex;\n\t\t\t\t}\n\t\t\t\t// do not eat whitespace; start at beginning\n\t\t\t\telse {\n\t\t\t\t\tthis.i = 0;\n\t\t\t\t}\n\n\t\t\t\t// resume parsing; no errors\n\t\t\t\tif(this.safe_parse(true)) {\n\t\t\t\t\t// emit progress event updates\n\t\t\t\t\tds_transform.emit('progress', s_chunk.length);\n\n\t\t\t\t\t// done transforming this chunk\n\t\t\t\t\tfke_chunk();\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// once there's no more data to consume, invoke eof\n\t\t\tflush: (fke_flush) => {\n\t\t\t\t// now that input stream has ended, clean up remainder\n\t\t\t\ttry {\n\t\t\t\t\tthis.eof(1);\n\t\t\t\t}\n\t\t\t\t// read error occurred\n\t\t\t\tcatch(e_eof) {\n\t\t\t\t\t// destroy self and stream\n\t\t\t\t\tthis.destroy(e_eof);\n\n\t\t\t\t\t// exit gracefully\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// no errors. done flushing, close read stream\n\t\t\t\tfke_flush();\n\t\t\t},\n\t\t});\n\n\t\t// when the writable side is piped into\n\t\tds_transform.on('pipe', (ds_input) => {\n\t\t\tthis._ds_input = ds_input;\n\n\t\t\tlet b_byte_tracking = this._b_byte_tracking;\n\n\t\t\t// byte-tracking is disable & input stream has encoding option; ensure stream encoding is utf8\n\t\t\tif(!b_byte_tracking && 'function' === typeof ds_input.setEncoding) {\n\t\t\t\tds_input.setEncoding('utf8');\n\t\t\t}\n\t\t\t// set decoding on write\n\t\t\telse {\n\t\t\t\tlet f_write = ds_transform.write;\n\t\t\t\tlet d_decoder = new string_decoder.StringDecoder('utf8');\n\n\t\t\t\tlet f_write_track = (s_chunk, s_encoding, fk_write) => {\n\t\t\t\t\t// TODO: optimize by testing for multibyte chars and using string length instead?\n\t\t\t\t\tlet nb_chunk = Buffer.from(s_chunk, 'utf8').length;\n\t\t\t\t\tthis._nb_seen += nb_chunk;\n\t\t\t\t\tthis._nb_last = nb_chunk;\n\t\t\t\t\treturn f_write.call(ds_transform, s_chunk, s_encoding, fk_write);\n\t\t\t\t};\n\n\t\t\t\tlet f_decode_write_track = (ab_chunk, s_encoding, fk_write) => {\n\t\t\t\t\tlet nb_chunk = this._nb_last = ab_chunk.length;\n\t\t\t\t\tthis._nb_seen += nb_chunk;\n\t\t\t\t\treturn f_write.call(ds_transform, d_decoder.write(ab_chunk), s_encoding, fk_write);\n\t\t\t\t};\n\n\t\t\t\tlet f_decode_write = (ab_chunk, s_encoding, fk_write) => f_write.call(ds_transform, d_decoder.write(ab_chunk), s_encoding, fk_write);\n\n\t\t\t\tds_transform.write = function(z_chunk, s_encoding, fk_write) {\n\t\t\t\t\t// not null\n\t\t\t\t\tif(null !== z_chunk) {\n\t\t\t\t\t\t// chunk is string; adapt by resetting method to original\n\t\t\t\t\t\tif('string' === typeof z_chunk) {\n\t\t\t\t\t\t\tds_transform.write = b_byte_tracking? f_write_track: f_write;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// chunk is buffer; adapt by setting decoder write method\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tds_transform.write = b_byte_tracking? f_decode_write_track: f_decode_write;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// use set method\n\t\t\t\t\t\treturn ds_transform.write(z_chunk, s_encoding, fk_write);\n\t\t\t\t\t}\n\n\t\t\t\t\t// null, use parent\n\t\t\t\t\treturn f_write.call(ds_transform, z_chunk, s_encoding, fk_write);\n\t\t\t\t};\n\n\t\t\t\t// byte tracking is enabled\n\t\t\t\tif(b_byte_tracking) {\n\t\t\t\t\t// overwrite emit_data method\n\t\t\t\t\tthis.emit_data = this.data = this.restore_data = function() {\n\t\t\t\t\t\tlet g_quad = this._dc_factory.quad(this._kt_subject, this._kt_predicate, this._kt_object, this._kt_graph);\n\t\t\t\t\t\tlet nb_post = Buffer.from(this.s.slice(this.i)).length;\n\t\t\t\t\t\tlet ib_post = this._nb_seen - nb_post;\n\t\t\t\t\t\tg_quad.byteRange = [this._nb_curr, ib_post];\n\t\t\t\t\t\tthis._nb_curr = ib_post;\n\t\t\t\t\t\tthis.transform.push(g_quad);\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// new listener added\n\t\tds_transform.on('newListener', (s_event) => {\n\t\t\t// comment\n\t\t\tif('comment' === s_event) {\n\t\t\t\tthis.emit_comments = (s_captured) => {\n\t\t\t\t\tlet a_comments = s_captured.slice(1).replace(/\\n\\s+$/, '').split(/\\n+\\s*#/g);\n\n\t\t\t\t\tfor(let s_comment of a_comments) {\n\t\t\t\t\t\tds_transform.emit('comment', s_comment);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\n\t\t// destroy\n\t\tds_transform._destroy = (...a_args) => {\n\t\t\tthis.destroy(...a_args);\n\t\t};\n\n\t\t// bind events to transform stream\n\t\tthis.bind(g_config);\n\n\t\t// input given\n\t\tif(g_input) {\n\t\t\t// input is stream\n\t\t\tif(g_input.stream) {\n\t\t\t\tlet ds_input = g_input.stream;\n\n\t\t\t\t// go async so caller has chance to bind event listeners\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tds_input.pipe(ds_transform);\n\t\t\t\t});\n\t\t\t}\n\t\t\t// string\n\t\t\telse if('string' === typeof g_input.string) {\n\t\t\t\tlet s_input = g_input.string;\n\n\t\t\t\t// go async so caller has chance to bind event listeners\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tds_transform.end(s_input, 'utf8');\n\t\t\t\t});\n\t\t\t}\n\t\t\t// invalid arg\n\t\t\telse {\n\t\t\t\tthrow new TypeError(`Invalid argument for input parameter: ${'object' === typeof g_input? JSON.stringify(g_input): g_input}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// begin parsing, keep applying until no more stack bail-outs\n\tsafe_parse() {\n\t\ttry {\n\t\t\tlet f_sync = this._f_state();\n\t\t\twhile('function' === typeof f_sync) {\n\t\t\t\tf_sync = f_sync.apply(this);\n\t\t\t}\n\t\t}\n\t\t// read error occurred\n\t\tcatch(e_read) {\n\t\t\t// destroy self and stream\n\t\t\tthis.destroy(e_read);\n\n\t\t\t// failure\n\t\t\treturn false;\n\t\t}\n\n\t\t// okay\n\t\treturn true;\n\t}\n\n\n\temit(s_event, ...a_args) {\n\t\tthis.transform.emit(s_event, ...a_args);\n\t}\n\n\tqueue(s_event, ...a_args) {\n\t\tthis._a_queue_event.push({\n\t\t\tevent: s_event,\n\t\t\targs: a_args,\n\t\t});\n\t}\n\n\terror(s_message) {\n\t\t// bail out\n\t\tthrow new Error(s_message);\n\t}\n\n\t// parse_error (not meant to be an event callback)\n\tparse_error(s_expected, b_eof=false) {\n\t\tlet i = this.i;\n\n\t\tlet i_off = Math.min(i, Math.abs(i-15));\n\n\t\tlet s = this.s;\n\n\t\treturn this.error(`\\n\\`${s.substr(i_off, i_off+90).replace(/[\\n\\t]/g, ' ')}\\`\\n`\n\t\t\t+` ${' '.repeat(i-i_off)}^\\n`\n\t\t\t+`expected ${s_expected} ${b_eof? 'but encountered <>': ''}. failed to parse a valid token starting at ${s[i]? '\"'+s[i]+'\"': '<>'}`);\n\t}\n\n\tinfo_error(s_message) {\n\t\tlet i = this.i;\n\n\t\tlet i_off = Math.min(i, Math.abs(i-15));\n\n\t\tlet s = this.s;\n\n\t\tthis.error(`\\n\\`${s.substr(i_off, i_off+90).replace(/[\\n\\t]/g, ' ')}\\`\\n`\n\t\t\t+` ${' '.repeat(i-i_off)}^\\n`\n\t\t\t+s_message);\n\t}\n\n\t// end of file\n\teof() {\n\t\t// there are events queued\n\t\tif(this._a_queue_event.length) {\n\t\t\tlet a_queue = this._a_queue_event;\n\n\t\t\t// drain event queue\n\t\t\twhile(a_queue.length) {\n\t\t\t\t// remove event from front of queue\n\t\t\t\tlet h_event = a_queue.shift();\n\n\t\t\t\t// make event callback\n\t\t\t\tthis[h_event.event](h_event.data);\n\t\t\t}\n\t\t}\n\n\t\t// invalid parsing state\n\t\tif(this.block !== this._f_state) {\n\t\t\t// append EOF char\n\t\t\tthis.s += '\\0';\n\n\t\t\t// exit \"flowing\" mode\n\t\t\tthis.n = this.s.length;\n\n\t\t\t// resume parsing; no errors\n\t\t\tif(this.safe_parse()) {\n\t\t\t\t// eof has occurred under safe parse\n\t\t\t\tif(null === this.s) return;\n\n\t\t\t\t// still invalid parsing state\n\t\t\t\tif(this.block !== this._f_state) {\n\t\t\t\t\treturn this.parse_error(this._f_state.name, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// there are still unparsed characters\n\t\tif(this.i < this.n) {\n\t\t\t// consume whitespace and comments\n\t\t\tlet s = this.s;\n\t\t\tlet i = this.i;\n\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\tR_WS.lastIndex = i;\n\t\t\tR_WS.exec(s);\n\t\t\ti = R_WS.lastIndex;\n\t\t\tR_COMMENT.lastIndex = i;\n\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t// advance beyond comment\n\t\t\tif(R_COMMENT.lastIndex > i) {\n\t\t\t\tthis.i = i = R_COMMENT.lastIndex;\n\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t}\n\n\t\t\t// still unparsed characters\n\t\t\tif(i < this.n) {\n\t\t\t\t// not EOF\n\t\t\t\tif(!(i === this.n - 1 && '\\0' === s[i])) {\n\t\t\t\t\t// bad input; parse error\n\t\t\t\t\treturn this.parse_error(this._f_state.name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// make buffer's alloc eligible for gc\n\t\tthis.s = null;\n\n\t\t// transform stream\n\t\tlet ds_transform = this.transform;\n\n\t\t// final progress update: no additional bytes were read\n\t\tds_transform.emit('progress', 0);\n\n\t\t// call end event listener\n\t\tds_transform.emit('eof', this._h_prefixes);\n\n\t\t// close write stream (EOF-signaling)\n\t\tds_transform.push(null);\n\t}\n\n\n\n\t// bind event listeners to transform stream\n\tbind(g_config) {\n\t\tlet ds_transform = this.transform;\n\t\tif(g_config.base) ds_transform.on('base', g_config.base);\n\t\tif(g_config.prefix) ds_transform.on('prefix', g_config.prefix);\n\t\tif(g_config.enter) ds_transform.on('enter', g_config.enter);\n\t\tif(g_config.exit) ds_transform.on('exit', g_config.exit);\n\t\tif(g_config.comment) ds_transform.on('comment', g_config.comment);\n\t\tif(g_config.error) ds_transform.on('error', g_config.error);\n\t\tif(g_config.read) ds_transform.once('read', g_config.read);\n\t\tif(g_config.progress) ds_transform.on('progress', g_config.progress);\n\t\tif(g_config.eof) ds_transform.once('eof', g_config.eof);\n\t\tif(g_config.end) ds_transform.once('end', g_config.end);\n\t\tif(g_config.finish) ds_transform.once('finish', g_config.finish);\n\t\tif(g_config.data) ds_transform.on('data', g_config.data);\n\t}\n\n\t// after a blank node subject (either property-list or colleciton)\n\tpost_blank_subject() {\n\t\tlet {s, i} = this;\n\t\tif('.' === s[i]) {\n\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\tR_WS.lastIndex = i+1;\n\t\t\tR_WS.exec(s);\n\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t// not inside block\n\t\t\tif(this._kt_default_graph === this._kt_graph) {\n\t\t\t\treturn this.block();\n\t\t\t}\n\t\t\t// inside block\n\t\t\telse {\n\t\t\t\treturn this.statement();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// prepare sticky regex index\n\t\t\tR_CHAR_CLOSE.lastIndex = i;\n\n\t\t\tif(R_CHAR_CLOSE.exec(s)) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_CHAR_CLOSE.lastIndex;\n\t\t\t\t// empty collection\n\t\t\t\tif(this._kt_rdf_nil.equals(this._kt_subject)) {\n\t\t\t\t\treturn this.error('empty collection');\n\t\t\t\t}\n\n\t\t\t\t// emit graph_close event\n\t\t\t\tthis.emit('exit', this._kt_graph);\n\n\t\t\t\t// reset graph\n\t\t\t\tthis._kt_graph = this._kt_default_graph;\n\n\t\t\t\t// goto block state\n\t\t\t\treturn this.block();\n\t\t\t}\n\t\t} // brace #1\n\n\t\treturn this.pairs();\n\t}\n\n\n\n\t// parse state for statement\n\tstatement() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n// prefixed name quick\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_PREFIXED_NAME_QUICK.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_pnq_subject = R_PREFIXED_NAME_QUICK.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_pnq_subject) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_PREFIXED_NAME_QUICK.lastIndex;\n\t\t\t\t// check valid prefix\n\t\t\t\tlet s_prefix_id = m_pnq_subject[1] || '';\n\t\t\t\t// invalid prefix\n\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t// commit subject iri from resolve prefixed name\n\t\t\t\tthis._kt_subject = this.prefixed_name(s_prefix_id, m_pnq_subject[2]);\n\n\t\t\t\t// predicate-object pairs state\n\t\t\t\treturn this.pairs();\n\n\t\t\t// iriref\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_iriref_e_subject = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_iriref_e_subject) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_IRIREF_ESCAPELESS.lastIndex;\n\n\t\t\t\t\t// ref iri\n\t\t\t\t\tlet s_iri = m_iriref_e_subject[1];\n\t\t\t\t\t// absolute iri\n\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t// set subject\n\t\t\t\t\t\tthis._kt_subject = this.check_named_node_escapeless(s_iri);\n\t\t\t\t\t}\n\t\t\t\t\t// relative iri\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis._kt_subject = this.check_named_node_escapeless(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t}\n\n\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\treturn this.pairs();\n\n\n\n\t\t\t\t// prefixed name\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// try match\n\t\t\t\t\tlet aw_valid_this_match_prefixed_name_escapeless = this.match_prefixed_name_escapeless(s, i);\n\t\t\t\t\t// stack bail out\n\t\t\t\t\tif(!aw_valid_this_match_prefixed_name_escapeless) return true;\n\t\t\t\t\tlet [m_prefixed_named_e_subject, im_prefixed_named_e_subject] = aw_valid_this_match_prefixed_name_escapeless;\n\t\t\t\t\tif(m_prefixed_named_e_subject) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\tthis.i = im_prefixed_named_e_subject;\n\n\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_e_subject[1] || '';\n\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t// make subject key\n\t\t\t\t\t\tthis._kt_subject = this.prefixed_name(s_prefix_id, m_prefixed_named_e_subject[2]);\n\n\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\treturn this.pairs();\n\n\t\t\t\t\t// blank node label\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\tR_BLANK_NODE_LABEL.lastIndex = i;\n\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\tlet m_blank_node_label_subject = R_BLANK_NODE_LABEL.exec(s);\n\n\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\tif(m_blank_node_label_subject) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\tthis.i = R_BLANK_NODE_LABEL.lastIndex;\n\t\t\t\t\t\t\t// extract label\n\t\t\t\t\t\t\tlet s_label = m_blank_node_label_subject[1];\n\n\t\t\t\t\t\t\t// make subject key\n\t\t\t\t\t\t\tthis._kt_subject = this.blank_node(s_label);\n\n\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\treturn this.pairs();\n\n\t\t\t\t\t\t// anonymous blank node subject\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\tR_ANONYMOUS_BLANK_NODE.lastIndex = i;\n\n\t\t\t\t\t\t\tif(R_ANONYMOUS_BLANK_NODE.exec(s)) {\n\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\tthis.i = R_ANONYMOUS_BLANK_NODE.lastIndex;\n\t\t\t\t\t\t\t\t// set new blank node as subject\n\t\t\t\t\t\t\t\tthis._kt_subject = this.anonymous_blank_node(this.next_label());\n\n\t\t\t\t\t\t\t\t// goto pairs state for inside property list\n\t\t\t\t\t\t\t\treturn this.pairs();\n\n\t\t\t\t\t\t\t// anonymous blank node property list subject\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\tR_CHAR_BLANK_NODE.lastIndex = i;\n\n\t\t\t\t\t\t\t\tif(R_CHAR_BLANK_NODE.exec(s)) {\n\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\tthis.i = R_CHAR_BLANK_NODE.lastIndex;\n\t\t\t\t\t\t\t\t\t// enter blank node\n\t\t\t\t\t\t\t\t\tthis._kt_subject = this.anonymous_blank_node(this.next_label());\n\n\t\t\t\t\t\t\t\t\t// how to resume when we pop state\n\t\t\t\t\t\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'post_blank_subject']);\n\n\t\t\t\t\t\t\t\t\t// goto pairs state for inside property list\n\t\t\t\t\t\t\t\t\treturn this.pairs();\n\n\t\t\t\t\t\t\t\t// rdf collection\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\tR_CHAR_COLLECTION.lastIndex = i;\n\n\t\t\t\t\t\t\t\t\tif(R_CHAR_COLLECTION.exec(s)) {\n\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\tthis.i = R_CHAR_COLLECTION.lastIndex;\n\t\t\t\t\t\t\t\t\t\t// indicate that collection subject should emit an initial statement\n\t\t\t\t\t\t\t\t\t\tthis._kt_subject = null;\n\n// (don't push state, we don't have a subject yet)\n\n\t\t\t\t\t\t\t\t\t\t// goto collection-subject state\n\t\t\t\t\t\t\t\t\t\treturn this.collection_subject();\n\n\n\t\t\t\t\t\t\t\t\t// closing graph '}'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\tR_CHAR_CLOSE.lastIndex = i;\n\n\t\t\t\t\t\t\t\t\t\tif(R_CHAR_CLOSE.exec(s)) {\n\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\tthis.i = R_CHAR_CLOSE.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t// emit graph_close event\n\t\t\t\t\t\t\t\t\t\t\tthis.emit('exit', this._kt_graph);\n\n\t\t\t\t\t\t\t\t\t\t\t// reset graph\n\t\t\t\t\t\t\t\t\t\t\tthis._kt_graph = this._kt_default_graph;\n\n\t\t\t\t\t\t\t\t\t\t\t// goto block state\n\t\t\t\t\t\t\t\t\t\t\treturn this.block();\n\n\t\t\t\t\t\t\t\t\t\t// iriref\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\t\tlet m_iriref_subject = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\t\tif(m_iriref_subject) {\n\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\n\t\t\t\t\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\t\t\t\t\tlet s_iri = m_iriref_subject[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// set subject\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.check_named_node(s_iri);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.check_named_node(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\t\t\t\t\t\treturn this.pairs();\n\n\t\t\t\t\t\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name = this.match_prefixed_name(s, i);\n\t\t\t\t\t\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name) return true;\n\t\t\t\t\t\t\t\t\t\t\t\tlet [m_prefixed_named_subject, im_prefixed_named_subject] = aw_valid_this_match_prefixed_name;\n\t\t\t\t\t\t\t\t\t\t\t\tif(m_prefixed_named_subject) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = im_prefixed_named_subject;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_subject[1] || '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// escape local escapes\n\t\t\t\t\t\t\t\t\t\t\t\t\tlet s_suffix = m_prefixed_named_subject[2]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.replace(R_PN_LOCAL_ESCAPES, '$1');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// make subject key\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.prefixed_name(s_prefix_id, s_suffix);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.pairs();\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t// comment\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t// not iriref, not prefixed name, not blank node label, not prefix id, not base\n\t\t\t// match counter: 10\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t} // brace #10\n\t\t\t\t\t\t\t\t\t\t\t} // brace #9\n\t\t\t\t\t\t\t\t\t\t} // brace #8\n\t\t\t\t\t\t\t\t\t} // brace #7\n\t\t\t\t\t\t\t\t} // brace #6\n\t\t\t\t\t\t\t} // brace #5\n\t\t\t\t\t\t} // brace #4\n\t\t\t\t\t} // brace #3\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('statement');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.statement;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for block\n\tblock() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// prepare sticky regex index\n\t\t\tR_GRAPH_IRI_ESCAPELESS.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_graph_iriref_e_graph = R_GRAPH_IRI_ESCAPELESS.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_graph_iriref_e_graph) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_GRAPH_IRI_ESCAPELESS.lastIndex;\n\n\t\t\t\t// ref iri\n\t\t\t\tlet s_iri = m_graph_iriref_e_graph[1];\n\t\t\t\t// absolute iri\n\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t// set graph\n\t\t\t\t\tthis._kt_graph = this.check_named_node_escapeless(s_iri);\n\t\t\t\t}\n\t\t\t\t// relative iri\n\t\t\t\telse {\n\t\t\t\t\tthis._kt_graph = this.check_named_node_escapeless(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t}\n\n\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t// statement state\n\t\t\t\treturn this.statement();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_GRAPH_PREFIXED_NAME.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_graph_prefixed_name = R_GRAPH_PREFIXED_NAME.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_graph_prefixed_name) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_GRAPH_PREFIXED_NAME.lastIndex;\n\t\t\t\t\t// check valid prefix\n\t\t\t\t\tlet s_prefix_id = m_graph_prefixed_name[1] || '';\n\t\t\t\t\t// invalid prefix\n\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t// make subject key\n\t\t\t\t\tthis._kt_graph = this.prefixed_name(s_prefix_id, m_graph_prefixed_name[2]);\n\n\t\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t\t// statement state\n\t\t\t\t\treturn this.statement();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_CHAR_OPEN.lastIndex = i;\n\n\t\t\t\t\tif(R_CHAR_OPEN.exec(s)) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\tthis.i = R_CHAR_OPEN.lastIndex;\n\t\t\t\t\t\t// make new default graph\n\t\t\t\t\t\tthis._kt_graph = this._dc_factory.defaultGraph();\n\n\t\t\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t\t\t// goto statement state\n\t\t\t\t\t\treturn this.statement();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\tR_GRAPH_ANONYMOUS_BLANK_NODE.lastIndex = i;\n\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\tlet m_graph_anonymous_blank_node = R_GRAPH_ANONYMOUS_BLANK_NODE.exec(s);\n\n\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\tif(m_graph_anonymous_blank_node) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\tthis.i = R_GRAPH_ANONYMOUS_BLANK_NODE.lastIndex;\n\t\t\t\t\t\t\t// make new label & set graph to blank node\n\t\t\t\t\t\t\tthis._kt_graph = this.anonymous_blank_node(this.next_label());\n\n\t\t\t\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t\t\t\t// statement state\n\t\t\t\t\t\t\treturn this.statement();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\tR_GRAPH_LABELED_BLANK_NODE.lastIndex = i;\n\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\tlet m_graph_labeled_blank_node = R_GRAPH_LABELED_BLANK_NODE.exec(s);\n\n\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\tif(m_graph_labeled_blank_node) {\n\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\tthis.i = R_GRAPH_LABELED_BLANK_NODE.lastIndex;\n\t\t\t\t\t\t\t\tlet s_label = m_graph_labeled_blank_node[1];\n\n\t\t\t\t\t\t\t\tthis._kt_graph = this.blank_node(s_label);\n\n\t\t\t\t\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t\t\t\t\t// statement state\n\t\t\t\t\t\t\t\treturn this.statement();\n\n\t\t\t\t\t\t\t// iriref\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\tlet m_iriref_e_graph_subject = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\tif(m_iriref_e_graph_subject) {\n\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\tthis.i = R_IRIREF_ESCAPELESS.lastIndex;\n\n\t\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\t\tlet s_iri = m_iriref_e_graph_subject[1];\n\t\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t\t// set subject\n\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.check_named_node_escapeless(s_iri);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.check_named_node_escapeless(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// graph or subject\n\t\t\t\t\t\t\t\t\treturn this.graph_or_subject();\n\n\n\n\t\t\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name_escapeless = this.match_prefixed_name_escapeless(s, i);\n\t\t\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name_escapeless) return true;\n\t\t\t\t\t\t\t\t\tlet [m_prefixed_named_e_subject, im_prefixed_named_e_subject] = aw_valid_this_match_prefixed_name_escapeless;\n\t\t\t\t\t\t\t\t\tif(m_prefixed_named_e_subject) {\n\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\tthis.i = im_prefixed_named_e_subject;\n\n\t\t\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_e_subject[1] || '';\n\t\t\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t\t\t// make subject key\n\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.prefixed_name(s_prefix_id, m_prefixed_named_e_subject[2]);\n\n\t\t\t\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\t\t\t\treturn this.graph_or_subject();\n\n\t\t\t\t\t\t\t\t\t// blank node label\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\tR_BLANK_NODE_LABEL.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\tlet m_blank_node_label_subject = R_BLANK_NODE_LABEL.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\tif(m_blank_node_label_subject) {\n\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\tthis.i = R_BLANK_NODE_LABEL.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t// extract label\n\t\t\t\t\t\t\t\t\t\t\tlet s_label = m_blank_node_label_subject[1];\n\n\t\t\t\t\t\t\t\t\t\t\t// make subject key\n\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.blank_node(s_label);\n\n\t\t\t\t\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\t\t\t\t\treturn this.graph_or_subject();\n\n\t\t\t\t\t\t\t\t\t\t// anonymous blank node subject\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\tR_ANONYMOUS_BLANK_NODE.lastIndex = i;\n\n\t\t\t\t\t\t\t\t\t\t\tif(R_ANONYMOUS_BLANK_NODE.exec(s)) {\n\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_ANONYMOUS_BLANK_NODE.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t// set new blank node as subject\n\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.anonymous_blank_node(this.next_label());\n\n\t\t\t\t\t\t\t\t\t\t\t\t// goto pairs state for inside property list\n\t\t\t\t\t\t\t\t\t\t\t\treturn this.graph_or_subject();\n\n\t\t\t\t\t\t\t\t\t\t\t// anonymous blank node property list subject\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\tR_CHAR_BLANK_NODE.lastIndex = i;\n\n\t\t\t\t\t\t\t\t\t\t\t\tif(R_CHAR_BLANK_NODE.exec(s)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_CHAR_BLANK_NODE.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// enter blank node\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.anonymous_blank_node(this.next_label());\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// how to resume when we pop state\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'post_blank_subject']);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// goto pairs state for inside property list\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.graph_or_subject_property_list();\n\n\t\t\t\t\t\t\t\t\t\t\t\t// rdf collection\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\t\tR_CHAR_COLLECTION.lastIndex = i;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(R_CHAR_COLLECTION.exec(s)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_CHAR_COLLECTION.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// indicate that collection subject should emit an initial statement\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = null;\n\n// (don't push state, we don't have a subject yet)\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// goto collection-subject state\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.collection_subject();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// prefix with interupt (e.g., a comment)\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tR_PREFIX_KEYWORD.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet m_prefix_keyword = R_PREFIX_KEYWORD.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(m_prefix_keyword) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_PREFIX_KEYWORD.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// save whether or not to expect a full stop\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._b_expecting_full_stop = !!m_prefix_keyword[1];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// goto prefix state\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.prefix_id();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// base with interupt (e.g., a comment)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tR_BASE_KEYWORD.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet m_base_keyword = R_BASE_KEYWORD.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(m_base_keyword) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_BASE_KEYWORD.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// save whether or not to expect a full stop\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._b_expecting_full_stop = !!m_base_keyword[1];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// goto base state\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.base_iri();\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// iriref\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet m_iriref_subject = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(m_iriref_subject) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet s_iri = m_iriref_subject[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// set subject\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.check_named_node(s_iri);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.check_named_node(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.graph_or_subject();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name = this.match_prefixed_name(s, i);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name) return true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet [m_prefixed_named_subject, im_prefixed_named_subject] = aw_valid_this_match_prefixed_name;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(m_prefixed_named_subject) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = im_prefixed_named_subject;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_subject[1] || '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// escape local escapes\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet s_suffix = m_prefixed_named_subject[2]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.replace(R_PN_LOCAL_ESCAPES, '$1');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// make subject key\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.prefixed_name(s_prefix_id, s_suffix);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.graph_or_subject();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tR_GRAPH_IRI.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet m_graph_iriref_graph = R_GRAPH_IRI.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(m_graph_iriref_graph) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_GRAPH_IRI.lastIndex;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet s_iri = m_graph_iriref_graph[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// set graph\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_graph = this.check_named_node(s_iri);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_graph = this.check_named_node(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// statement state\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.statement();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// comment\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tR_GRAPH.lastIndex = i;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(R_GRAPH.exec(s)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_GRAPH.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.graph_keyword();\n\n\t\t\t\t// not iriref, not prefixed name, not blank node label, not prefix id, not base\n\t\t\t\t// match counter: 17\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} // brace #17\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} // brace #16\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} // brace #15\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} // brace #14\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} // brace #13\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} // brace #12\n\t\t\t\t\t\t\t\t\t\t\t\t\t} // brace #11\n\t\t\t\t\t\t\t\t\t\t\t\t} // brace #10\n\t\t\t\t\t\t\t\t\t\t\t} // brace #9\n\t\t\t\t\t\t\t\t\t\t} // brace #8\n\t\t\t\t\t\t\t\t\t} // brace #7\n\t\t\t\t\t\t\t\t} // brace #6\n\t\t\t\t\t\t\t} // brace #5\n\t\t\t\t\t\t} // brace #4\n\t\t\t\t\t} // brace #3\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('block');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.block;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for graph_or_subject\n\tgraph_or_subject() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\tlet x = s[i];\n\n\t\t\tif('{' === x) {\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\tR_WS.exec(s);\n\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t// shift placeholder subject\n\t\t\t\tthis._kt_graph = this._kt_subject;\n\n\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t// reset subject in case of collections\n\t\t\t\tthis._kt_subject = null;\n\n\t\t\t\t// statement state\n\t\t\t\treturn this.statement();\n\n\t\t\t// non-comment\n\t\t\t}\n\t\t\telse if('#' !== x) {\n\t\t\t\treturn this.pairs();\n\n\t\t\t// comment\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_comment) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// match counter: 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('graph_or_subject');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.graph_or_subject;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for graph_or_subject_property_list\n\tgraph_or_subject_property_list() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\tlet x = s[i];\n\n\t\t\tif(']' === x) {\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\tR_WS.exec(s);\n\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t// next state\n\t\t\t\treturn this.graph_or_subject_anon();\n\n\t\t\t// non-comment\n\t\t\t}\n\t\t\telse if('#' !== x) {\n\t\t\t\treturn this.pairs();\n\n\t\t\t// comment\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_comment) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// match counter: 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('graph_or_subject_property_list');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.graph_or_subject_property_list;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for graph_or_subject_anon\n\tgraph_or_subject_anon() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\tlet x = s[i];\n\n\t\t\tif('{' === x) {\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\tR_WS.exec(s);\n\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t// shift placeholder subject\n\t\t\t\tthis._kt_graph = this._kt_subject;\n\n\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t// reset subject in case of collections\n\t\t\t\tthis._kt_subject = null;\n\n\t\t\t\t// pop dummy state\n\t\t\t\tthis._a_nested.pop();\n\n\t\t\t\t// statement state\n\t\t\t\treturn this.statement();\n\n\t\t\t// non-comment\n\t\t\t}\n\t\t\telse if('#' !== x) {\n\t\t\t\treturn this.pairs();\n\n\t\t\t// comment\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_comment) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// match counter: 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('graph_or_subject_anon');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.graph_or_subject_anon;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for graph_keyword\n\tgraph_keyword() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// prefixed name\n\t\t\t// try match\n\t\t\tlet aw_valid_this_match_prefixed_name_escapeless = this.match_prefixed_name_escapeless(s, i);\n\t\t\t// stack bail out\n\t\t\tif(!aw_valid_this_match_prefixed_name_escapeless) return true;\n\t\t\tlet [m_prefixed_named_e_graph, im_prefixed_named_e_graph] = aw_valid_this_match_prefixed_name_escapeless;\n\t\t\tif(m_prefixed_named_e_graph) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = im_prefixed_named_e_graph;\n\n\t\t\t\t// check valid prefix\n\t\t\t\tlet s_prefix_id = m_prefixed_named_e_graph[1] || '';\n\t\t\t\t// invalid prefix\n\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t// make subject key\n\t\t\t\tthis._kt_graph = this.prefixed_name(s_prefix_id, m_prefixed_named_e_graph[2]);\n\n\t\t\t\t// predicate-object pairs state\n\t\t\t\treturn this.graph_post_name();\n\n\t\t\t// iriref\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_iriref_e_graph = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_iriref_e_graph) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_IRIREF_ESCAPELESS.lastIndex;\n\n\t\t\t\t\t// ref iri\n\t\t\t\t\tlet s_iri = m_iriref_e_graph[1];\n\t\t\t\t\t// absolute iri\n\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t// set graph\n\t\t\t\t\t\tthis._kt_graph = this.check_named_node_escapeless(s_iri);\n\t\t\t\t\t}\n\t\t\t\t\t// relative iri\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis._kt_graph = this.check_named_node_escapeless(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t}\n\n\t\t\t\t\t// graph\n\t\t\t\t\treturn this.graph_post_name();\n\n\t\t\t\t// blank node label\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_BLANK_NODE_LABEL.lastIndex = i;\n\t\t\t\t\t// execute regex\n\t\t\t\t\tlet m_blank_node_label_graph = R_BLANK_NODE_LABEL.exec(s);\n\n\t\t\t\t\t// regex was a match\n\t\t\t\t\tif(m_blank_node_label_graph) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\tthis.i = R_BLANK_NODE_LABEL.lastIndex;\n\t\t\t\t\t\t// extract label\n\t\t\t\t\t\tlet s_label = m_blank_node_label_graph[1];\n\n\t\t\t\t\t\t// make graph key\n\t\t\t\t\t\tthis._kt_graph = this.blank_node(s_label);\n\n\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\treturn this.graph_post_name();\n\n\t\t\t\t\t// anonymous blank node graph\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\tR_ANONYMOUS_BLANK_NODE.lastIndex = i;\n\n\t\t\t\t\t\tif(R_ANONYMOUS_BLANK_NODE.exec(s)) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\tthis.i = R_ANONYMOUS_BLANK_NODE.lastIndex;\n\t\t\t\t\t\t\t// set new blank node as graph\n\t\t\t\t\t\t\tthis._kt_graph = this.anonymous_blank_node(this.next_label());\n\n\t\t\t\t\t\t\t// goto pairs state for inside property list\n\t\t\t\t\t\t\treturn this.graph_post_name();\n\n\t\t\t\t\t\t// iriref\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\tlet m_iriref_graph = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\tif(m_iriref_graph) {\n\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\n\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\tlet s_iri = m_iriref_graph[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t// set graph\n\t\t\t\t\t\t\t\t\tthis._kt_graph = this.check_named_node(s_iri);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tthis._kt_graph = this.check_named_node(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\t\treturn this.graph_post_name();\n\n\t\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name = this.match_prefixed_name(s, i);\n\t\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name) return true;\n\t\t\t\t\t\t\t\tlet [m_prefixed_named_graph, im_prefixed_named_graph] = aw_valid_this_match_prefixed_name;\n\t\t\t\t\t\t\t\tif(m_prefixed_named_graph) {\n\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\tthis.i = im_prefixed_named_graph;\n\t\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_graph[1] || '';\n\t\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t\t// escape local escapes\n\t\t\t\t\t\t\t\t\tlet s_suffix = m_prefixed_named_graph[2]\n\t\t\t\t\t\t\t\t\t\t.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY)\n\t\t\t\t\t\t\t\t\t\t.replace(R_PN_LOCAL_ESCAPES, '$1');\n\n\t\t\t\t\t\t\t\t\t// make subject key\n\t\t\t\t\t\t\t\t\tthis._kt_graph = this.prefixed_name(s_prefix_id, s_suffix);\n\n\t\t\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\t\t\treturn this.graph_post_name();\n\n\t\t\t\t\t\t\t\t// comment\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t// not iriref, not prefixed name, not blank node label, not prefix id, not base\n\t\t\t\t// match counter: 6\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} // brace #6\n\t\t\t\t\t\t\t} // brace #5\n\t\t\t\t\t\t} // brace #4\n\t\t\t\t\t} // brace #3\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('graph_keyword');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.graph_keyword;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for graph_post_name\n\tgraph_post_name() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\tlet x = s[i];\n\n\t\t\tif('{' === x) {\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\tR_WS.exec(s);\n\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t// statement state\n\t\t\t\treturn this.statement();\n\n\t\t\t// comment\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_comment) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// match counter: 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('graph_post_name');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.graph_post_name;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for pairs\n\tpairs() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n// benchmarks indicate: regex for end of blank node property list faster than ch\n\n\n// iriref\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_iriref_e_predicate = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_iriref_e_predicate) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_IRIREF_ESCAPELESS.lastIndex;\n\n\t\t\t\t// ref iri\n\t\t\t\tlet s_iri = m_iriref_e_predicate[1];\n\t\t\t\t// absolute iri\n\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t// set predicate\n\t\t\t\t\tthis._kt_predicate = this.check_named_node_escapeless(s_iri);\n\t\t\t\t}\n\t\t\t\t// relative iri\n\t\t\t\telse {\n\t\t\t\t\tthis._kt_predicate = this.check_named_node_escapeless(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t}\n\n\t\t\t\t// object-list state\n\t\t\t\treturn this.object_list();\n\n\t\t\t// prefixed name\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// try match\n\t\t\t\tlet aw_valid_this_match_prefixed_name_escapeless = this.match_prefixed_name_escapeless(s, i);\n\t\t\t\t// stack bail out\n\t\t\t\tif(!aw_valid_this_match_prefixed_name_escapeless) return true;\n\t\t\t\tlet [m_prefixed_named_e_predicate, im_prefixed_named_e_predicate] = aw_valid_this_match_prefixed_name_escapeless;\n\t\t\t\tif(m_prefixed_named_e_predicate) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = im_prefixed_named_e_predicate;\n\t\t\t\t\t// check valid prefix\n\t\t\t\t\tlet s_prefix_id = m_prefixed_named_e_predicate[1] || '';\n\t\t\t\t\t// invalid prefix\n\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t// make predicate key\n\t\t\t\t\tthis._kt_predicate = this.prefixed_name(s_prefix_id, m_prefixed_named_e_predicate[2]);\n\n\t\t\t\t\t// object-list state\n\t\t\t\t\treturn this.object_list();\n\n\t\t\t\t// 'a'\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_A.lastIndex = i;\n\n\t\t\t\t\tif(R_A.exec(s)) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\tthis.i = R_A.lastIndex;\n\t\t\t\t\t\t// make predicate key\n\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_type;\n\n\t\t\t\t\t\t// object-list state\n\t\t\t\t\t\treturn this.object_list();\n\n\t\t\t\t\t// ']' end of blank node property list\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\tR_CHAR_KET.lastIndex = i;\n\n\t\t\t\t\t\tif(R_CHAR_KET.exec(s)) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\tthis.i = R_CHAR_KET.lastIndex;\n\t\t\t\t\t\t\tlet s_resume_state;\n\t\t\t\t\t\t\t[this._kt_subject, this._kt_predicate, s_resume_state] = this._a_nested.pop();\n\t\t\t\t\t\t\treturn this[s_resume_state]();\n\n\t\t\t\t\t\t// iriref\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\tlet m_iriref_predicate = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\tif(m_iriref_predicate) {\n\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\n\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\tlet s_iri = m_iriref_predicate[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t// set predicate\n\t\t\t\t\t\t\t\t\tthis._kt_predicate = this.check_named_node(s_iri);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tthis._kt_predicate = this.check_named_node(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// object-list state\n\t\t\t\t\t\t\t\treturn this.object_list();\n\n\t\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name = this.match_prefixed_name(s, i);\n\t\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name) return true;\n\t\t\t\t\t\t\t\tlet [m_prefixed_named_predicate, im_prefixed_named_predicate] = aw_valid_this_match_prefixed_name;\n\t\t\t\t\t\t\t\tif(m_prefixed_named_predicate) {\n\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\tthis.i = im_prefixed_named_predicate;\n\t\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_predicate[1] || '';\n\t\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t\t// escape local escapes\n\t\t\t\t\t\t\t\t\tlet s_suffix = m_prefixed_named_predicate[2]\n\t\t\t\t\t\t\t\t\t\t.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY)\n\t\t\t\t\t\t\t\t\t\t.replace(R_PN_LOCAL_ESCAPES, '$1');\n\n\t\t\t\t\t\t\t\t\t// make predicate key\n\t\t\t\t\t\t\t\t\tthis._kt_predicate = this.prefixed_name(s_prefix_id, s_suffix);\n\n\t\t\t\t\t\t\t\t\t// object-list state\n\t\t\t\t\t\t\t\t\treturn this.object_list();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t// not iriref, not prefixed name, not 'a'\n\t\t\t// match counter: 6\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} // brace #6\n\t\t\t\t\t\t\t} // brace #5\n\t\t\t\t\t\t} // brace #4\n\t\t\t\t\t} // brace #3\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('pairs');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.pairs;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for object_list\n\tobject_list() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// ref char\n\t\t\tlet x = s[i];\n\n\t\t\t// string literal * double\n\t\t\tif('\"' === x) {\n\t\t\t\t// enough chars to deduce type\n\t\t\t\tif((i+2) < n) {\n\t\t\t\t\t// long type\n\t\t\t\t\tif('\"' === s[i+1] && '\"' === s[i+2]) {\n\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\tthis.i = i + 3;\n\n\t\t\t\t\t\t// read contents\n\t\t\t\t\t\treturn this.string_literal_long_double();\n\t\t\t\t\t}\n\t\t\t\t\t// not long type\n\t\t\t\t\telse {\n\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t\t\t// read contents\n\t\t\t\t\t\treturn this.string_literal_short_double();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// enough chars to eliminate long type\n\t\t\t\telse if((i+1) < n && '\"' !== s[i+1]) {\n\t\t\t\t\t// advance index beyond token\n\t\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t\t// read contents\n\t\t\t\t\treturn this.string_literal_short_double();\n\t\t\t\t}\n\t\t\t\t// not enough chars to deduce type; retry next chunk\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t// prefixed name quick\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_PREFIXED_NAME_QUICK.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_pnq_object = R_PREFIXED_NAME_QUICK.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_pnq_object) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_PREFIXED_NAME_QUICK.lastIndex;\n\t\t\t\t\t// check valid prefix\n\t\t\t\t\tlet s_prefix_id = m_pnq_object[1] || '';\n\t\t\t\t\t// invalid prefix\n\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t// commit object iri from resolve prefixed name\n\t\t\t\t\tthis._kt_object = this.prefixed_name(s_prefix_id, m_pnq_object[2]);\n\n\t\t\t\t// iriref\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t\t\t// execute regex\n\t\t\t\t\tlet m_iriref_e_object = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t\t\t// regex was a match\n\t\t\t\t\tif(m_iriref_e_object) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\tthis.i = R_IRIREF_ESCAPELESS.lastIndex;\n\n\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\tlet s_iri = m_iriref_e_object[1];\n\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t// set object\n\t\t\t\t\t\t\tthis._kt_object = this.check_named_node_escapeless(s_iri);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis._kt_object = this.check_named_node_escapeless(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// prefixed name\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// try match\n\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name_escapeless = this.match_prefixed_name_escapeless(s, i);\n\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name_escapeless) return true;\n\t\t\t\t\t\tlet [m_prefixed_named_e_object, im_prefixed_named_e_object] = aw_valid_this_match_prefixed_name_escapeless;\n\t\t\t\t\t\tif(m_prefixed_named_e_object) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\tthis.i = im_prefixed_named_e_object;\n\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_e_object[1] || '';\n\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t// commit object iri from resolve prefixed name\n\t\t\t\t\t\t\tthis._kt_object = this.prefixed_name(s_prefix_id, m_prefixed_named_e_object[2]);\n\n\t\t\t\t\t\t// string literal * single\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \tif('\\'' === x) {\n\t\t\t\t\t\t\t// enough chars to deduce type\n\t\t\t\t\t\t\tif((i+2) < n) {\n\t\t\t\t\t\t\t\t// long type\n\t\t\t\t\t\t\t\tif(\"'\" === s[i+1] && \"'\" === s[i+2]) {\n\t\t\t\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\t\t\t\tthis.i = i + 3;\n\n\t\t\t\t\t\t\t\t\t// read contents\n\t\t\t\t\t\t\t\t\treturn this.string_literal_long_single();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// not long type\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t\t\t\t\t\t// read contents\n\t\t\t\t\t\t\t\t\treturn this.string_literal_short_single();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// enough chars to eliminate long type\n\t\t\t\t\t\t\telse if((i+1) < n && \"'\" !== s[i+1]) {\n\t\t\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t\t\t\t\t// read contents\n\t\t\t\t\t\t\t\treturn this.string_literal_short_single();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// not enough chars to deduce type; retry next chunk\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// numeric literal\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\tR_NUMERIC_LITERAL.lastIndex = i;\n\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\tlet m_numeric_literal = R_NUMERIC_LITERAL.exec(s);\n\n\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\tif(m_numeric_literal) {\n\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\tthis.i = R_NUMERIC_LITERAL.lastIndex;\n\t\t\t\t\t\t\t\t// it has exponent term, xsd:double\n\t\t\t\t\t\t\t\tif(m_numeric_literal[4]) {\n\t\t\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.double(m_numeric_literal[1]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// contains decimal point, xsd:decimal\n\t\t\t\t\t\t\t\telse if(m_numeric_literal[2] || m_numeric_literal[3]) {\n\t\t\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.decimal(m_numeric_literal[1]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// otherwise, it is an integer\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.integer(m_numeric_literal[1]);\n\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t// boolean literal\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\tR_BOOLEAN_LITERAL.lastIndex = i;\n\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\tlet m_boolean_literal = R_BOOLEAN_LITERAL.exec(s);\n\n\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\tif(m_boolean_literal) {\n\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\tthis.i = R_BOOLEAN_LITERAL.lastIndex;\n\t\t\t\t\t\t\t\t\t// make literal\n\t\t\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.boolean(!!m_boolean_literal[1]);\n\n\n\t\t\t\t\t\t\t\t// blank node property list\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse \tif('[' === x) {\n\t\t\t\t// advance index to next token\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t\t\t\t\t\t// make object\n\t\t\t\t\t\t\t\t\tlet kt_blank_node = this._kt_object = this.anonymous_blank_node(this.next_label());\n\n\t\t\t\t\t\t\t\t\t// emit statement event\n\t\t\t\t\t\t\t\t\tthis.data();\n\n\n\t\t\t\t\t\t\t\t\t// push state to stack\n\t\t\t\t\t\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'post_object']);\n\n\t\t\t\t\t\t\t\t\t// set new subject\n\t\t\t\t\t\t\t\t\tthis._kt_subject = kt_blank_node;\n\n\t\t\t\t\t\t\t\t\t// goto parsing pairs state\n\t\t\t\t\t\t\t\t\treturn this.pairs();\n\n\t\t\t\t\t\t\t\t// labeled blank node\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\tR_BLANK_NODE_LABEL_TERMINAL.lastIndex = i;\n\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\tlet m_blank_node_label_object = R_BLANK_NODE_LABEL_TERMINAL.exec(s);\n\n\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\tif(m_blank_node_label_object) {\n\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\tthis.i = R_BLANK_NODE_LABEL_TERMINAL.lastIndex;\n\t\t\t\t\t\t\t\t\t\t// ref blank node label\n\t\t\t\t\t\t\t\t\t\tlet s_label = m_blank_node_label_object[1];\n\n\t\t\t\t\t\t\t\t\t\t// make object\n\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.blank_node(s_label);\n\n\t\t\t\t\t\t\t\t\t// collection\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse \tif('(' === x) {\n\t\t\t\t// advance index to next token\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\t\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\t\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\t\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t\t\t\t\t\t\t// state to resume after collection ends\n\t\t\t\t\t\t\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'post_object']);\n\n\t\t\t\t\t\t\t\t\t\t// goto collection-object state\n\t\t\t\t\t\t\t\t\t\treturn this.collection_object();\n\n\t\t\t\t\t\t\t\t\t// iriref\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\tlet m_iriref_object = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\tif(m_iriref_object) {\n\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\n\t\t\t\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\t\t\t\tlet s_iri = m_iriref_object[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t\t\t\t// set object\n\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.check_named_node(s_iri);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.check_named_node(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name = this.match_prefixed_name(s, i);\n\t\t\t\t\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name) return true;\n\t\t\t\t\t\t\t\t\t\t\tlet [m_prefixed_named_object, im_prefixed_named_object] = aw_valid_this_match_prefixed_name;\n\t\t\t\t\t\t\t\t\t\t\tif(m_prefixed_named_object) {\n\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\tthis.i = im_prefixed_named_object;\n\t\t\t\t\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_object[1] || '';\n\t\t\t\t\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t// escape local escapes\n\t\t\t\t\t\t\t\t\t\t\t\tlet s_suffix = m_prefixed_named_object[2]\n\t\t\t\t\t\t\t\t\t\t\t\t\t.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.replace(R_PN_LOCAL_ESCAPES, '$1');\n\n\t\t\t\t\t\t\t\t\t\t\t\t// commit object iri from resolve prefixed name\n\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.prefixed_name(s_prefix_id, s_suffix);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t// not iriref, not prefixed name, not string literal, not numeric literal, not boolean literal, not blank node property list, not collection\n\t\t\t// match counter: 9\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} // brace #9\n\t\t\t\t\t\t\t\t\t\t} // brace #8\n\t\t\t\t\t\t\t\t\t} // brace #7\n\t\t\t\t\t\t\t\t} // brace #6\n\t\t\t\t\t\t\t} // brace #5\n\t\t\t\t\t\t} // brace #4\n\t\t\t\t\t} // brace #3\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\n\n\t\t\t// fall through for cases that did not change state on their own\n\t\t\t// at this point, a new statement has been parsed\n\t\t\tthis.data();\n\n\n\t\t\t// goto next parsing state; bail out of stack\n\t\t\treturn this.after_end_of_statement;\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('object_list');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.object_list;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for string_literal_short_double\n\tstring_literal_short_double() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\tstring_literal_short_double: while(i < n) { // eslint-disable-line no-unmodified-loop-condition\n// something breaks string in this chunk\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_STRLIT_SHORT_DOUBLE_BREAK.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_break = R_STRLIT_SHORT_DOUBLE_BREAK.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_break) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_STRLIT_SHORT_DOUBLE_BREAK.lastIndex;\n\t\t\t\t// index of break\n\t\t\t\tlet i_break = m_break.index;\n\n\t\t\t\t// add to contents\n\t\t\t\tthis._s_literal += s.slice(i, i_break);\n\n\t\t\t\t// depending on char\n\t\t\t\tswitch(s[i_break]) {\n\t\t\t\t\t// terminator\n\t\t\t\t\tcase '\"': {\n\t\t\t\t\t// advance index to next token beyond delimiter\n\t\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\tR_WS.lastIndex = i_break + 1;\n\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t\t\t// resume eating whitespace at start of next chunk\n\t\t\t\t\t\tthis._b_trim_start = true;\n\n\t\t\t\t\t\t// consume rest\n\t\t\t\t\t\treturn this.datatype_or_langtag();\n\t\t\t\t\t}\n\n\t\t\t\t\t// escape\n\t\t\t\t\tcase '\\\\': {\n\t\t\t\t\t\t// try to find end\n\t\t\t\t\t\tR_STRLIT_SHORT_DOUBLE_TERM.lastIndex = i_break;\n\t\t\t\t\t\tlet m_term = R_STRLIT_SHORT_DOUBLE_TERM.exec(s);\n\n\t\t\t\t\t\t// end is in this chunk\n\t\t\t\t\t\tif(m_term) {\n\t\t\t\t\t\t\t// index of terminator\n\t\t\t\t\t\t\tlet i_term = m_term.index;\n\n\t\t\t\t\t\t\t// extract dirty potion\n\t\t\t\t\t\t\tlet s_dirty = s.slice(i_break, i_term);\n\n\t\t\t\t\t\t\t// clean and save\n\t\t\t\t\t\t\tthis._s_literal += unescape_literal_short_hard(s_dirty);\n\n\t\t\t\t\t\t\t// advance index beyond terminator\n\t\t\t\t\t\t\tthis.i = i_term + m_term[0].length;\n\n\t\t\t\t\t\t\t// resume eating whitespace at start of next chunk\n\t\t\t\t\t\t\tthis._b_trim_start = true;\n\n\t\t\t\t\t\t\t// consume rest\n\t\t\t\t\t\t\treturn this.datatype_or_langtag();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// end is not in this chunk\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// extract whole portion\n\t\t\t\t\t\t\tlet s_dirty = s.slice(i_break);\n\n\t\t\t\t\t\t\t// unescape to clean part\n\t\t\t\t\t\t\tlet [s_clean, s_incomplete] = unescape_literal_short_soft(s_dirty);\n\n\t\t\t\t\t\t\t// save\n\t\t\t\t\t\t\tthis._s_literal += s_clean;\n\n\t\t\t\t\t\t\t// set unparsed index\n\t\t\t\t\t\t\ti = n - s_incomplete.length;\n\n\t\t\t\t\t\t\t// reached eos; pause normally\n\t\t\t\t\t\t\tbreak string_literal_short_double;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// invalid '\\n'\n\t\t\t\t\tcase '\\n': {\n\t\t\t\t\t\treturn this.info_error(`expected string_literal_short_double but invalid line feed character '\\\\n' (newline) within contents. failed to parse a valid token`);\n\t\t\t\t\t}\n\n\t\t\t\t\t// invalid '\\r'\n\t\t\t\t\tcase '\\r': {\n\t\t\t\t\t\treturn this.info_error(`expected string_literal_short_double but invalid form feed character '\\\\r' (carriage return) within contents. failed to parse a valid token`);\n\t\t\t\t\t}\n\n\t\t\t\t\t// invalid\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tconsole.assert(`Unhandle invalid character ${JSON.stringify(s[i_break])} case for string_literal_short_double`);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t// no terminator and nothing to escape\n\t\t// match counter: 0\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// save\n\t\t\t\tthis._s_literal += i? s.slice(i): s;\n\n\t\t\t\t// set unparsed index\n\t\t\t\ti = n;\n\n\t\t\t\t// reached eos; pause normally\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// do not eat whitespace at start of next chunk\n\t\tthis._b_trim_start = false;\n\n\t// ran out of characters\n\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('string_literal_short_double');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.string_literal_short_double;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for string_literal_short_single\n\tstring_literal_short_single() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\tstring_literal_short_single: while(i < n) { // eslint-disable-line no-unmodified-loop-condition\n// something breaks string in this chunk\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_STRLIT_SHORT_SINGLE_BREAK.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_break = R_STRLIT_SHORT_SINGLE_BREAK.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_break) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_STRLIT_SHORT_SINGLE_BREAK.lastIndex;\n\t\t\t\t// index of break\n\t\t\t\tlet i_break = m_break.index;\n\n\t\t\t\t// add to contents\n\t\t\t\tthis._s_literal += s.slice(i, i_break);\n\n\t\t\t\t// depending on char\n\t\t\t\tswitch(s[i_break]) {\n\t\t\t\t\t// terminator\n\t\t\t\t\tcase \"'\": {\n\t\t\t\t\t// advance index to next token beyond delimiter\n\t\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\tR_WS.lastIndex = i_break + 1;\n\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t\t\t// resume eating whitespace at start of next chunk\n\t\t\t\t\t\tthis._b_trim_start = true;\n\n\t\t\t\t\t\t// consume rest\n\t\t\t\t\t\treturn this.datatype_or_langtag();\n\t\t\t\t\t}\n\n\t\t\t\t\t// escape\n\t\t\t\t\tcase '\\\\': {\n\t\t\t\t\t\t// try to find end\n\t\t\t\t\t\tR_STRLIT_SHORT_SINGLE_TERM.lastIndex = i_break;\n\t\t\t\t\t\tlet m_term = R_STRLIT_SHORT_SINGLE_TERM.exec(s);\n\n\t\t\t\t\t\t// end is in this chunk\n\t\t\t\t\t\tif(m_term) {\n\t\t\t\t\t\t\t// index of terminator\n\t\t\t\t\t\t\tlet i_term = m_term.index;\n\n\t\t\t\t\t\t\t// extract dirty potion\n\t\t\t\t\t\t\tlet s_dirty = s.slice(i_break, i_term);\n\n\t\t\t\t\t\t\t// clean and save\n\t\t\t\t\t\t\tthis._s_literal += unescape_literal_short_hard(s_dirty);\n\n\t\t\t\t\t\t\t// advance index beyond terminator\n\t\t\t\t\t\t\tthis.i = i_term + m_term[0].length;\n\n\t\t\t\t\t\t\t// resume eating whitespace at start of next chunk\n\t\t\t\t\t\t\tthis._b_trim_start = true;\n\n\t\t\t\t\t\t\t// consume rest\n\t\t\t\t\t\t\treturn this.datatype_or_langtag();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// end is not in this chunk\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// extract whole portion\n\t\t\t\t\t\t\tlet s_dirty = s.slice(i_break);\n\n\t\t\t\t\t\t\t// unescape to clean part\n\t\t\t\t\t\t\tlet [s_clean, s_incomplete] = unescape_literal_short_soft(s_dirty);\n\n\t\t\t\t\t\t\t// save\n\t\t\t\t\t\t\tthis._s_literal += s_clean;\n\n\t\t\t\t\t\t\t// set unparsed index\n\t\t\t\t\t\t\ti = n - s_incomplete.length;\n\n\t\t\t\t\t\t\t// reached eos; pause normally\n\t\t\t\t\t\t\tbreak string_literal_short_single;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// invalid '\\n'\n\t\t\t\t\tcase '\\n': {\n\t\t\t\t\t\treturn this.info_error(`expected string_literal_short_single but invalid line feed character '\\\\n' (newline) within contents. failed to parse a valid token`);\n\t\t\t\t\t}\n\n\t\t\t\t\t// invalid '\\r'\n\t\t\t\t\tcase '\\r': {\n\t\t\t\t\t\treturn this.info_error(`expected string_literal_short_single but invalid form feed character '\\\\r' (carriage return) within contents. failed to parse a valid token`);\n\t\t\t\t\t}\n\n\t\t\t\t\t// invalid\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tconsole.assert(`Unhandle invalid character ${JSON.stringify(s[i_break])} case for string_literal_short_single`);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t// no terminator and nothing to escape\n\t\t// match counter: 0\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// save\n\t\t\t\tthis._s_literal += i? s.slice(i): s;\n\n\t\t\t\t// set unparsed index\n\t\t\t\ti = n;\n\n\t\t\t\t// reached eos; pause normally\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// do not eat whitespace at start of next chunk\n\t\tthis._b_trim_start = false;\n\n\t// ran out of characters\n\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('string_literal_short_single');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.string_literal_short_single;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for string_literal_long_double\n\tstring_literal_long_double() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\tstring_literal_long_double: while(i < n) { // eslint-disable-line no-unmodified-loop-condition\n// something breaks string in this chunk\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_STRLIT_LONG_DOUBLE_BREAK.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_break = R_STRLIT_LONG_DOUBLE_BREAK.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_break) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_STRLIT_LONG_DOUBLE_BREAK.lastIndex;\n\t\t\t\t// index of break\n\t\t\t\tlet i_break = m_break.index;\n\n\t\t\t\t// add to contents\n\t\t\t\tthis._s_literal += s.slice(i, i_break);\n\n\t\t\t\t// depending on char\n\t\t\t\tswitch(s[i_break]) {\n\t\t\t\t\t// terminator\n\t\t\t\t\tcase '\"': {\n\t\t\t\t\t// advance index to next token beyond delimiter\n\t\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\tR_WS.lastIndex = i_break + 3;\n\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t\t\t// resume eating whitespace at start of next chunk\n\t\t\t\t\t\tthis._b_trim_start = true;\n\n\t\t\t\t\t\t// consume rest\n\t\t\t\t\t\treturn this.datatype_or_langtag();\n\t\t\t\t\t}\n\n\t\t\t\t\t// escape\n\t\t\t\t\tcase '\\\\': {\n\t\t\t\t\t\t// try to find end\n\t\t\t\t\t\tR_STRLIT_LONG_DOUBLE_TERM.lastIndex = i_break;\n\t\t\t\t\t\tlet m_term = R_STRLIT_LONG_DOUBLE_TERM.exec(s);\n\n\t\t\t\t\t\t// end is in this chunk\n\t\t\t\t\t\tif(m_term) {\n\t\t\t\t\t\t\t// index of terminator\n\t\t\t\t\t\t\tlet i_term = m_term.index;\n\n\t\t\t\t\t\t\t// extract dirty potion\n\t\t\t\t\t\t\tlet s_dirty = s.slice(i_break, i_term);\n\n\t\t\t\t\t\t\t// clean and save\n\t\t\t\t\t\t\tthis._s_literal += unescape_literal_long_hard(s_dirty);\n\n\t\t\t\t\t\t\t// advance index beyond terminator\n\t\t\t\t\t\t\tthis.i = i_term + m_term[0].length;\n\n\t\t\t\t\t\t\t// resume eating whitespace at start of next chunk\n\t\t\t\t\t\t\tthis._b_trim_start = true;\n\n\t\t\t\t\t\t\t// consume rest\n\t\t\t\t\t\t\treturn this.datatype_or_langtag();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// end is not in this chunk\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// extract whole portion\n\t\t\t\t\t\t\tlet s_dirty = s.slice(i_break);\n\n\t\t\t\t\t\t\t// unescape to clean part\n\t\t\t\t\t\t\tlet [s_clean, s_incomplete] = unescape_literal_long_soft(s_dirty);\n\n\t\t\t\t\t\t\t// save\n\t\t\t\t\t\t\tthis._s_literal += s_clean;\n\n\t\t\t\t\t\t\t// set unparsed index\n\t\t\t\t\t\t\ti = n - s_incomplete.length;\n\n\t\t\t\t\t\t\t// reached eos; pause normally\n\t\t\t\t\t\t\tbreak string_literal_long_double;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// invalid\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tconsole.assert(`Unhandle invalid character ${JSON.stringify(s[i_break])} case for string_literal_long_double`);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t// no terminator and nothing to escape\n\t\t// match counter: 0\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// could be unfinished terminator\n\t\t\t\tR_STRLIT_LONG_DOUBLE_UNFINISHED_TERM.lastIndex = i;\n\t\t\t\tlet m_unfinished = R_STRLIT_LONG_DOUBLE_UNFINISHED_TERM.exec(s);\n\n\t\t\t\t// unfinished terminator\n\t\t\t\tif(m_unfinished) {\n\t\t\t\t\t// save valid portion\n\t\t\t\t\tthis._s_literal += s.slice(i, m_unfinished.index);\n\n\t\t\t\t\t// set unparsed index\n\t\t\t\t\ti = m_unfinished.index;\n\t\t\t\t}\n\t\t\t\t// not unfinished\n\t\t\t\telse {\n\t\t\t\t\t// save\n\t\t\t\t\tthis._s_literal += i? s.slice(i): s;\n\n\t\t\t\t\t// set unparsed index\n\t\t\t\t\ti = n;\n\t\t\t\t}\n\n\t\t\t\t// reached eos; pause normally\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// do not eat whitespace at start of next chunk\n\t\tthis._b_trim_start = false;\n\n\t// ran out of characters\n\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('string_literal_long_double');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.string_literal_long_double;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for string_literal_long_single\n\tstring_literal_long_single() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\tstring_literal_long_single: while(i < n) { // eslint-disable-line no-unmodified-loop-condition\n// something breaks string in this chunk\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_STRLIT_LONG_SINGLE_BREAK.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_break = R_STRLIT_LONG_SINGLE_BREAK.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_break) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_STRLIT_LONG_SINGLE_BREAK.lastIndex;\n\t\t\t\t// index of break\n\t\t\t\tlet i_break = m_break.index;\n\n\t\t\t\t// add to contents\n\t\t\t\tthis._s_literal += s.slice(i, i_break);\n\n\t\t\t\t// depending on char\n\t\t\t\tswitch(s[i_break]) {\n\t\t\t\t\t// terminator\n\t\t\t\t\tcase \"'\": {\n\t\t\t\t\t// advance index to next token beyond delimiter\n\t\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\tR_WS.lastIndex = i_break + 3;\n\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t\t\t// resume eating whitespace at start of next chunk\n\t\t\t\t\t\tthis._b_trim_start = true;\n\n\t\t\t\t\t\t// consume rest\n\t\t\t\t\t\treturn this.datatype_or_langtag();\n\t\t\t\t\t}\n\n\t\t\t\t\t// escape\n\t\t\t\t\tcase '\\\\': {\n\t\t\t\t\t\t// try to find end\n\t\t\t\t\t\tR_STRLIT_LONG_SINGLE_TERM.lastIndex = i_break;\n\t\t\t\t\t\tlet m_term = R_STRLIT_LONG_SINGLE_TERM.exec(s);\n\n\t\t\t\t\t\t// end is in this chunk\n\t\t\t\t\t\tif(m_term) {\n\t\t\t\t\t\t\t// index of terminator\n\t\t\t\t\t\t\tlet i_term = m_term.index;\n\n\t\t\t\t\t\t\t// extract dirty potion\n\t\t\t\t\t\t\tlet s_dirty = s.slice(i_break, i_term);\n\n\t\t\t\t\t\t\t// clean and save\n\t\t\t\t\t\t\tthis._s_literal += unescape_literal_long_hard(s_dirty);\n\n\t\t\t\t\t\t\t// advance index beyond terminator\n\t\t\t\t\t\t\tthis.i = i_term + m_term[0].length;\n\n\t\t\t\t\t\t\t// resume eating whitespace at start of next chunk\n\t\t\t\t\t\t\tthis._b_trim_start = true;\n\n\t\t\t\t\t\t\t// consume rest\n\t\t\t\t\t\t\treturn this.datatype_or_langtag();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// end is not in this chunk\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// extract whole portion\n\t\t\t\t\t\t\tlet s_dirty = s.slice(i_break);\n\n\t\t\t\t\t\t\t// unescape to clean part\n\t\t\t\t\t\t\tlet [s_clean, s_incomplete] = unescape_literal_long_soft(s_dirty);\n\n\t\t\t\t\t\t\t// save\n\t\t\t\t\t\t\tthis._s_literal += s_clean;\n\n\t\t\t\t\t\t\t// set unparsed index\n\t\t\t\t\t\t\ti = n - s_incomplete.length;\n\n\t\t\t\t\t\t\t// reached eos; pause normally\n\t\t\t\t\t\t\tbreak string_literal_long_single;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// invalid\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tconsole.assert(`Unhandle invalid character ${JSON.stringify(s[i_break])} case for string_literal_long_single`);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t// no terminator and nothing to escape\n\t\t// match counter: 0\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// could be unfinished terminator\n\t\t\t\tR_STRLIT_LONG_SINGLE_UNFINISHED_TERM.lastIndex = i;\n\t\t\t\tlet m_unfinished = R_STRLIT_LONG_SINGLE_UNFINISHED_TERM.exec(s);\n\n\t\t\t\t// unfinished terminator\n\t\t\t\tif(m_unfinished) {\n\t\t\t\t\t// save valid portion\n\t\t\t\t\tthis._s_literal += s.slice(i, m_unfinished.index);\n\n\t\t\t\t\t// set unparsed index\n\t\t\t\t\ti = m_unfinished.index;\n\t\t\t\t}\n\t\t\t\t// not unfinished\n\t\t\t\telse {\n\t\t\t\t\t// save\n\t\t\t\t\tthis._s_literal += i? s.slice(i): s;\n\n\t\t\t\t\t// set unparsed index\n\t\t\t\t\ti = n;\n\t\t\t\t}\n\n\t\t\t\t// reached eos; pause normally\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// do not eat whitespace at start of next chunk\n\t\tthis._b_trim_start = false;\n\n\t// ran out of characters\n\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('string_literal_long_single');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.string_literal_long_single;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for string_literal\n\tstring_literal() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// ref character\n\t\t\tlet x = s[i];\n\n\t\t\t// string literal * double\n\t\t\tif('\"' === x) {\n\t\t\t\t// enough chars to deduce type\n\t\t\t\tif((i+2) < n) {\n\t\t\t\t\t// long type\n\t\t\t\t\tif('\"' === s[i+1] && '\"' === s[i+2]) {\n\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\tthis.i = i + 3;\n\n\t\t\t\t\t\t// read contents\n\t\t\t\t\t\treturn this.string_literal_long_double();\n\t\t\t\t\t}\n\t\t\t\t\t// not long type\n\t\t\t\t\telse {\n\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t\t\t// read contents\n\t\t\t\t\t\treturn this.string_literal_short_double();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// enough chars to eliminate long type\n\t\t\t\telse if((i+1) < n && '\"' !== s[i+1]) {\n\t\t\t\t\t// advance index beyond token\n\t\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t\t// read contents\n\t\t\t\t\treturn this.string_literal_short_double();\n\t\t\t\t}\n\t\t\t\t// not enough chars to deduce type; retry next chunk\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t// string literal * single\n\t\t\t}\n\t\t\telse \tif('\\'' === x) {\n\t\t\t\t// enough chars to deduce type\n\t\t\t\tif((i+2) < n) {\n\t\t\t\t\t// long type\n\t\t\t\t\tif(\"'\" === s[i+1] && \"'\" === s[i+2]) {\n\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\tthis.i = i + 3;\n\n\t\t\t\t\t\t// read contents\n\t\t\t\t\t\treturn this.string_literal_long_single();\n\t\t\t\t\t}\n\t\t\t\t\t// not long type\n\t\t\t\t\telse {\n\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t\t\t// read contents\n\t\t\t\t\t\treturn this.string_literal_short_single();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// enough chars to eliminate long type\n\t\t\t\telse if((i+1) < n && \"'\" !== s[i+1]) {\n\t\t\t\t\t// advance index beyond token\n\t\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t\t// read contents\n\t\t\t\t\treturn this.string_literal_short_single();\n\t\t\t\t}\n\t\t\t\t// not enough chars to deduce type; retry next chunk\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t// not string literal long single quote, not string literal single quote\n\t\t\t// match counter: 0\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_string_length) {\n\t\t\t\t\treturn this.parse_error('string_literal');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.string_literal;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for datatype_or_langtag\n\tdatatype_or_langtag() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// ref character\n\t\t\tlet x = s[i];\n\n\t\t\t// next token indicates datatype or langtag\n\t\t\tif('^' === x || '@' === x) {\n// '^^' datatype\n\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_DOUBLE_CARET.lastIndex = i;\n\n\t\t\t\tif(R_DOUBLE_CARET.exec(s)) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_DOUBLE_CARET.lastIndex;\n\t\t\t\t\treturn this.datatype();\n\n\t\t\t\t// '@' language tag\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_LANGTAG.lastIndex = i;\n\t\t\t\t\t// execute regex\n\t\t\t\t\tlet m_langtag = R_LANGTAG.exec(s);\n\n\t\t\t\t\t// regex was a match\n\t\t\t\t\tif(m_langtag) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\tthis.i = R_LANGTAG.lastIndex;\n\t\t\t\t\t\tthis._kt_object = this._dc_factory.languagedLiteral(this._s_literal, m_langtag[1]);\n\n\t\t\t\t\t\t// reset literal\n\t\t\t\t\t\tthis._s_literal = '';\n\n\t\t\t\t// next token definitely datatype or langtag, we are just being interrupted by eos\n\t\t\t\t// match counter: 1\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} // brace #1\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_comment) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// match counter: 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis._kt_object = this._dc_factory.simpleLiteral(this._s_literal);\n\n\t\t\t\t\t// reset literal\n\t\t\t\t\tthis._s_literal = '';\n\n\t\t\t\t// not datatype, not language tag => that's okay! those are optional\n\t\t\t\t}\n\t\t\t} // brace #1\n\n\n\t\t\t// goto end of statement state\n\t\t\t// at this point, a new statement has been parsed\n\t\t\tthis.data();\n\n\n\t\t\t// goto next parsing state; bail out of stack\n\t\t\treturn this.after_end_of_statement;\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('datatype_or_langtag');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.datatype_or_langtag;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for datatype\n\tdatatype() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\tlet kt_datatype = null;\n\n// prefixed name quick\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_PREFIXED_NAME_QUICK.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_pnq_datatype = R_PREFIXED_NAME_QUICK.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_pnq_datatype) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_PREFIXED_NAME_QUICK.lastIndex;\n\t\t\t\t// check valid prefix\n\t\t\t\tlet s_prefix_id = m_pnq_datatype[1] || '';\n\t\t\t\t// invalid prefix\n\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t// commit object iri from resolve prefixed name\n\t\t\t\tkt_datatype = this.prefixed_name(s_prefix_id, m_pnq_datatype[2]);\n\n\t\t\t// iriref\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_iriref_e_datatype = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_iriref_e_datatype) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_IRIREF_ESCAPELESS.lastIndex;\n\t\t\t\t\tlet p_datatype;\n\n\t\t\t\t\t// ref iri\n\t\t\t\t\tlet s_iri = m_iriref_e_datatype[1];\n\t\t\t\t\t// absolute iri\n\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t// set p_datatype\n\t\t\t\t\t\tp_datatype = s_iri;\n\t\t\t\t\t}\n\t\t\t\t\t// relative iri\n\t\t\t\t\telse {\n\t\t\t\t\t\tp_datatype = uri.resolve(this._s_base_url, s_iri);\n\t\t\t\t\t}\n\n\t\t\t\t\tkt_datatype = this.check_named_node_escapeless(p_datatype);\n\n\t\t\t\t// prefixed name\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// try match\n\t\t\t\t\tlet aw_valid_this_match_prefixed_name_escapeless = this.match_prefixed_name_escapeless(s, i);\n\t\t\t\t\t// stack bail out\n\t\t\t\t\tif(!aw_valid_this_match_prefixed_name_escapeless) return true;\n\t\t\t\t\tlet [m_prefixed_named_e_datatype, im_prefixed_named_e_datatype] = aw_valid_this_match_prefixed_name_escapeless;\n\t\t\t\t\tif(m_prefixed_named_e_datatype) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\tthis.i = im_prefixed_named_e_datatype;\n\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_e_datatype[1] || '';\n\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\tkt_datatype = this.prefixed_name(s_prefix_id, m_prefixed_named_e_datatype[2]);\n\n\t\t\t\t\t// iriref\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\tlet m_iriref_datatype = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\tif(m_iriref_datatype) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\t\t\t\t\t\t\tlet p_datatype;\n\n\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\tlet s_iri = m_iriref_e_datatype[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t// set p_datatype\n\t\t\t\t\t\t\t\tp_datatype = s_iri;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tp_datatype = uri.resolve(this._s_base_url, s_iri);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tkt_datatype = this.check_named_node(p_datatype);\n\n\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name = this.match_prefixed_name(s, i);\n\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name) return true;\n\t\t\t\t\t\t\tlet [m_prefixed_named_datatype, im_prefixed_named_datatype] = aw_valid_this_match_prefixed_name;\n\t\t\t\t\t\t\tif(m_prefixed_named_datatype) {\n\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\tthis.i = im_prefixed_named_datatype;\n\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_datatype[1] || '';\n\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t// escape local escapes\n\t\t\t\t\t\t\t\tlet s_suffix = m_prefixed_named_datatype[2]\n\t\t\t\t\t\t\t\t\t.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY)\n\t\t\t\t\t\t\t\t\t.replace(R_PN_LOCAL_ESCAPES, '$1');\n\n\t\t\t\t\t\t\t\t// set literal datatype\n\t\t\t\t\t\t\t\tkt_datatype = this.prefixed_name(s_prefix_id, s_suffix);\n\n\t\t\t// not iriref, not prefixed name\n\t\t\t// match counter: 4\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // brace #4\n\t\t\t\t\t} // brace #3\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\n\n\t\t\tthis._kt_object = this._dc_factory.datatypedLiteral(this._s_literal, kt_datatype);\n\n\t\t\t// reset literal\n\t\t\tthis._s_literal = '';\n\n\t\t\t// goto end of statement state\n\t\t\t// at this point, a new statement has been parsed\n\t\t\tthis.data();\n\n\n\t\t\t// goto next parsing state; bail out of stack\n\t\t\treturn this.after_end_of_statement;\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('datatype');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.datatype;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for post_object\n\tpost_object() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\tlet i_reset = i;\n\n\t\t\t// benchmarks confirm: character ref faster than regexes in this context\n\t\t\tlet x = s[i];\n\n\t\t\t// advance index to next token beyond delimiter\n\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\tR_WS.lastIndex = i+1;\n\t\t\tR_WS.exec(s);\n\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t// ',' more objects\n\t\t\tif(',' === x) {\n\t\t\t\treturn this.object_list();\n\n\t\t\t// ';' more predicate-object pairs\n\t\t\t}\n\t\t\telse \tif(';' === x) {\n\t\t\t\tfor(;;) {\n\t\t\t\t\t// next token is end of outer section\n\t\t\t\t\tlet s_peek = s[this.i];\n\t\t\t\t\tif('.' === s_peek || ']' === s_peek || ';' === s_peek || '}' === s_peek) {\n\t\t\t\t\t\t// goto post_object state\n\t\t\t\t\t\treturn this.post_object();\n\t\t\t\t\t}\n\t\t\t\t\t// comment\n\t\t\t\t\telse if('#' === s_peek) {\n\t\t\t\t\t\t// comment\n\t\t\t\t\t\ti = this.i;\n\n\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\tthis.i = R_COMMENT.lastIndex;\n\t\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t\t// retry\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t// no eol to close comment (yet)\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// already consumed\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// eos\n\t\t\t\t\telse if(this.i === n) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// something else\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn this.pairs();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// rather than pushing a dedicated state, just try again next chunk\n\t\t\t\ti = i_reset;\n\t\t\t\tbreak;\n\n\t\t\t// '.' end of statement\n\t\t\t}\n\t\t\telse \tif('.' === x) {\n\t\t\t\t// assert not nested\n\t\t\t\tif(this._a_nested.length) {\n\t\t\t\t\t// reset index to that character\n\t\t\t\t\tthis.i = i;\n\n\t\t\t\t\t// emit parse error\n\t\t\t\t\treturn this.parse_error('end_of_property_list');\n\t\t\t\t}\n\n\t\t\t\treturn (this._kt_default_graph === this._kt_graph)? this.block(): this.statement();\n\n\t\t\t// ']' end of property-object pairs\n\t\t\t}\n\t\t\telse \tif(']' === x) {\n\t\t\t\tlet s_resume_state;\n\t\t\t\t[this._kt_subject, this._kt_predicate, s_resume_state] = this._a_nested.pop();\n\t\t\t\treturn this[s_resume_state]();\n\n\t\t\t// ')' end of collection\n\t\t\t}\n\t\t\telse \tif(')' === x) {\n\t\t\t\t// should not be here\n\t\t\t\treturn Reader$syntax_error(this, i, 'post_object', 'but encountered end of collection');\n\n\t\t\t// closing graph '}'\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_CHAR_CLOSE.lastIndex = i;\n\n\t\t\t\tif(R_CHAR_CLOSE.exec(s)) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_CHAR_CLOSE.lastIndex;\n\t\t\t\t\t// emit graph_close event\n\t\t\t\t\tthis.emit('exit', this._kt_graph);\n\n\t\t\t\t\t// reset graph\n\t\t\t\t\tthis._kt_graph = this._kt_default_graph;\n\n\t\t\t\t\treturn this.block();\n\n\t\t\t\t// comment\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t// execute regex\n\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t// regex was a match\n\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t// do not change state\n\t\t\t\t\t\tcontinue;\n\n\t\t\t// comment interrupted by eos?\n\t\t\t// match counter: 2\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('post_object');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.post_object;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for base_iri\n\tbase_iri() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n// prefix id\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_iriref_e_base = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_iriref_e_base) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_IRIREF_ESCAPELESS.lastIndex;\n\n\t\t\t\t// ref iri\n\t\t\t\tlet s_iri = m_iriref_e_base[1];\n\t\t\t\t// absolute iri\n\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t// set base_url\n\t\t\t\t\tthis._s_base_url = s_iri;\n\t\t\t\t}\n\t\t\t\t// relative iri\n\t\t\t\telse {\n\t\t\t\t\tthis._s_base_url = uri.resolve(this._s_base_url, s_iri);\n\t\t\t\t}\t\tlet m_base_iri = R_BASE_IRI.exec(this._s_base_url);\n\t\t\t\tthis._s_base_url = m_base_iri[1];\n\t\t\t\tthis._s_base_url_root = m_base_iri[2] || '';\n\t\t\t\tthis._s_base_url_scheme = m_base_iri[3] || '';\n\t\t\t\tthis._s_base_url_path = m_base_iri[4] || '';\n\n\n\t\t\t\t// emit base event\n\t\t\t\tthis.emit('base', this._s_base_url);\n\n\t\t\t\tif(this._b_expecting_full_stop) {\n\t\t\t\t\t// change state\n\t\t\t\t\treturn this.full_stop();\n\t\t\t\t}\n\n\t\t\t\t// goto prefix iri state\n\t\t\t\treturn this.block();\n\n\t\t\t// prefix id\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_iriref_base = R_IRIREF.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_iriref_base) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\n\t\t\t\t\t// ref iri\n\t\t\t\t\tlet s_iri = m_iriref_base[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t// absolute iri\n\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t// set base_url\n\t\t\t\t\t\tthis._s_base_url = s_iri;\n\t\t\t\t\t}\n\t\t\t\t\t// relative iri\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis._s_base_url = uri.resolve(this._s_base_url, s_iri);\n\t\t\t\t\t}\t\tlet m_base_iri = R_BASE_IRI.exec(this._s_base_url);\n\t\t\t\t\tthis._s_base_url = m_base_iri[1];\n\t\t\t\t\tthis._s_base_url_root = m_base_iri[2] || '';\n\t\t\t\t\tthis._s_base_url_scheme = m_base_iri[3] || '';\n\t\t\t\t\tthis._s_base_url_path = m_base_iri[4] || '';\n\n\n\t\t\t\t\t// emit base event\n\t\t\t\t\tthis.emit('base', this._s_base_url);\n\n\t\t\t\t\tif(this._b_expecting_full_stop) {\n\t\t\t\t\t\t// change state\n\t\t\t\t\t\treturn this.full_stop();\n\t\t\t\t\t}\n\n\t\t\t\t\t// goto prefix iri state\n\t\t\t\t\treturn this.block();\n\n\t\t\t\t// for poorly-placed comments\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t// execute regex\n\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t// regex was a match\n\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t// do not change state\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t// match counter: 2\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('base_iri');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.base_iri;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for prefix_id\n\tprefix_id() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n// prefix id\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_PREFIX_ID.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_prefix_id = R_PREFIX_ID.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_prefix_id) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_PREFIX_ID.lastIndex;\n\t\t\t\t// set temp prefix id\n\t\t\t\tthis._s_temp_prefix_id = m_prefix_id[1];\n\n\t\t\t\t// goto prefix iri state\n\t\t\t\treturn this.prefix_iri();\n\n\t\t\t// for poorly-placed comments\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_comment) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t// do not change state\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// match counter: 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('prefix_id');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.prefix_id;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for prefix_iri\n\tprefix_iri() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\tlet h_prefixes = this._h_prefixes;\n\t\t\tlet s_prefix_id = this._s_temp_prefix_id;\n\t\t\tlet p_prefix_iri;\n\n// prefix iri\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_iriref_e_prefix = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_iriref_e_prefix) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_IRIREF_ESCAPELESS.lastIndex;\n\n\t\t\t\t// ref iri\n\t\t\t\tlet s_iri = m_iriref_e_prefix[1];\n\t\t\t\t// absolute iri\n\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t// set p_prefix_iri\n\t\t\t\t\tp_prefix_iri = s_iri;\n\t\t\t\t}\n\t\t\t\t// relative iri\n\t\t\t\telse {\n\t\t\t\t\tp_prefix_iri = uri.resolve(this._s_base_url, s_iri);\n\t\t\t\t}\n\n\t\t\t\tlet b_relax = this._b_relax;\n\n// existing mapping\n\n\t\t\t\tif(s_prefix_id in h_prefixes) {\n\t\t\t\t\t// doesn't match existing\n\t\t\t\t\tif(p_prefix_iri !== h_prefixes[s_prefix_id]) {\n\t\t\t\t\t\t// emit change event\n\t\t\t\t\t\tif(this.prefix_change) {\n\t\t\t\t\t\t\tthis.prefix_change(s_prefix_id, h_prefixes[s_prefix_id], p_prefix_iri);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// update prefix\n\t\t\t\t\t\th_prefixes[s_prefix_id] = p_prefix_iri;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// first mapping\n\t\t\t\telse {\n\t\t\t\t\t// check namespace, invalid\n\t\t\t\t\tif(!b_relax && !RT_PREFIXED_NAME_NAMESPACE_VALID.test(s_prefix_id)) {\n\t\t\t\t\t\treturn this.error(`Invalid namespace for prefixed name: \"${s_prefix_id}:\"`);\n\t\t\t\t\t}\n\n\t\t\t\t\t// set prefix\n\t\t\t\t\th_prefixes[s_prefix_id] = p_prefix_iri;\n\t\t\t\t}\n\n\t\t\t\t// check iri, invalid\n\t\t\t\tif(!b_relax && !RT_NAMED_NODE_VALID.test(p_prefix_iri)) {\n\t\t\t\t\treturn this.error(`Invalid IRI found in prefix delcaration: \"${s_iri}\"`);\n\t\t\t\t}\n\n\t\t\t\t// emit prefix event\n\t\t\t\tthis.event('prefix', s_prefix_id, p_prefix_iri);\n\n\t\t\t\tif(this._b_expecting_full_stop) {\n\t\t\t\t\t// change state\n\t\t\t\t\treturn this.full_stop();\n\t\t\t\t}\n\n\t\t\t\t// goto statement state\n\t\t\t\treturn this.block();\n\n\t\t\t// prefix iri\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_iriref_prefix = R_IRIREF.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_iriref_prefix) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\n\t\t\t\t\t// ref iri\n\t\t\t\t\tlet s_iri = m_iriref_prefix[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t// absolute iri\n\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t// set p_prefix_iri\n\t\t\t\t\t\tp_prefix_iri = s_iri;\n\t\t\t\t\t}\n\t\t\t\t\t// relative iri\n\t\t\t\t\telse {\n\t\t\t\t\t\tp_prefix_iri = uri.resolve(this._s_base_url, s_iri);\n\t\t\t\t\t}\n\n\t\t\t\t\tlet b_relax = this._b_relax;\n\n// existing mapping\n\n\t\t\t\t\tif(s_prefix_id in h_prefixes) {\n\t\t\t\t\t\t// doesn't match existing\n\t\t\t\t\t\tif(p_prefix_iri !== h_prefixes[s_prefix_id]) {\n\t\t\t\t\t\t\t// emit change event\n\t\t\t\t\t\t\tif(this.prefix_change) {\n\t\t\t\t\t\t\t\tthis.prefix_change(s_prefix_id, h_prefixes[s_prefix_id], p_prefix_iri);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// update prefix\n\t\t\t\t\t\t\th_prefixes[s_prefix_id] = p_prefix_iri;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// first mapping\n\t\t\t\t\telse {\n\t\t\t\t\t\t// check namespace, invalid\n\t\t\t\t\t\tif(!b_relax && !RT_PREFIXED_NAME_NAMESPACE_VALID.test(s_prefix_id)) {\n\t\t\t\t\t\t\treturn this.error(`Invalid namespace for prefixed name: \"${s_prefix_id}:\"`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// set prefix\n\t\t\t\t\t\th_prefixes[s_prefix_id] = p_prefix_iri;\n\t\t\t\t\t}\n\n\t\t\t\t\t// check iri, invalid\n\t\t\t\t\tif(!b_relax && !RT_NAMED_NODE_VALID.test(p_prefix_iri)) {\n\t\t\t\t\t\treturn this.error(`Invalid IRI found in prefix delcaration: \"${s_iri}\"`);\n\t\t\t\t\t}\n\n\t\t\t\t\t// emit prefix event\n\t\t\t\t\tthis.event('prefix', s_prefix_id, p_prefix_iri);\n\n\t\t\t\t\tif(this._b_expecting_full_stop) {\n\t\t\t\t\t\t// change state\n\t\t\t\t\t\treturn this.full_stop();\n\t\t\t\t\t}\n\n\t\t\t\t\t// goto statement state\n\t\t\t\t\treturn this.block();\n\n\t\t\t\t// for poorly-placed comments\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t// execute regex\n\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t// regex was a match\n\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t// do not change state\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t// match counter: 2\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('prefix_iri');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.prefix_iri;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n// in case eos happens twice during prefix / base (extremely unlikely)\n\n\n\t// parse state for full_stop\n\tfull_stop() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// prepare sticky regex index\n\t\t\tR_CHAR_STOP.lastIndex = i;\n\n\t\t\tif(R_CHAR_STOP.exec(s)) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_CHAR_STOP.lastIndex;\n\t\t\t\t// resume statement\n\t\t\t\treturn this.block();\n\n\t\t\t// poorly-placed comment\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_comment) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t// try again\n\t\t\t\t\tcontinue;\n\n\t\t\t// possibly interrupted by eos\n\t\t\t// match counter: 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('full_stop');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.full_stop;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for collection_subject\n\tcollection_subject() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// ref char\n\t\t\tlet x = s[i];\n\n\t\t\t// end of collection\n\t\t\tif(')' === x) {\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\tR_WS.exec(s);\n\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t// no items in collection subject\n\t\t\t\tif(null === this._kt_subject) {\n\t\t\t\t\t// prepare subject\n\t\t\t\t\tthis._kt_subject = this._kt_rdf_nil;\n\n\t\t\t\t\t// state was never pushed to stack, jump to post_subject state\n\t\t\t\t\treturn this.post_blank_subject();\n\t\t\t\t}\n// otherwise, there must be items in collection\n\n\t\t\t\t// commit collection end\n\t\t\t\tthis._kt_object = this._kt_rdf_nil;\n\t\t\t\tthis.data();\n\n\n\t\t\t\t// restore state from stack\n\t\t\t\tlet s_resume_state;\n\t\t\t\t[this._kt_subject, this._kt_predicate, s_resume_state] = this._a_nested.pop();\n\t\t\t\treturn this[s_resume_state]();\n\t\t\t}\n\n\n\n\t\t\t// otherwise, pre-emptively secure the next blank node label\n\t\t\tlet s_pointer_label;\n\n\t\t\t// very first collection object\n\t\t\tlet b_pushed = false;\n\t\t\tif(null === this._kt_subject) {\n\t\t\t\t// set quasi subject (really for resume state)\n\t\t\t\ts_pointer_label = this.next_label();\n\t\t\t\tthis._kt_subject = this.anonymous_blank_node(s_pointer_label);\n\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'pairs']);\n\t\t\t\t// reset subject for later conditional branch\n\t\t\t\tthis._kt_subject = null;\n\t\t\t\tb_pushed = true;\n\t\t\t}\n\n// iriref\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_iriref_e_object = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_iriref_e_object) {\n\t\t\t\t// advance index\n\t\t\t\ti = R_IRIREF_ESCAPELESS.lastIndex;\n\n\t\t\t\t// ref iri\n\t\t\t\tlet s_iri = m_iriref_e_object[1];\n\t\t\t\t// absolute iri\n\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t// set object\n\t\t\t\t\tthis._kt_object = this.check_named_node_escapeless(s_iri);\n\t\t\t\t}\n\t\t\t\t// relative iri\n\t\t\t\telse {\n\t\t\t\t\tthis._kt_object = this.check_named_node_escapeless(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t}\n\n\t\t\t// prefixed name\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// try match\n\t\t\t\tlet aw_valid_this_match_prefixed_name_escapeless = this.match_prefixed_name_escapeless(s, i);\n\t\t\t\t// stack bail out\n\t\t\t\tif(!aw_valid_this_match_prefixed_name_escapeless) return true;\n\t\t\t\tlet [m_prefixed_named_e_object, im_prefixed_named_e_object] = aw_valid_this_match_prefixed_name_escapeless;\n\t\t\t\tif(m_prefixed_named_e_object) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = im_prefixed_named_e_object;\n\t\t\t\t\t// check valid prefix\n\t\t\t\t\tlet s_prefix_id = m_prefixed_named_e_object[1] || '';\n\t\t\t\t\t// invalid prefix\n\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t// commit object iri from resolve prefixed name\n\t\t\t\t\tthis._kt_object = this.prefixed_name(s_prefix_id, m_prefixed_named_e_object[2]);\n\n\t\t\t\t// string literal\n\t\t\t\t}\n\t\t\t\telse \tif('\"' === x || '\\'' === x) {\n\t\t\t\t\t// first item in list\n\t\t\t\t\tif(null === this._kt_subject) {\n\t\t\t\t\t\ts_pointer_label = this.next_label();\n\t\t\t\t\t\tthis._kt_subject = this.anonymous_blank_node(s_pointer_label);\n\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\t\t\t\t\t}\n\t\t\t\t\t// not first item in list\n\t\t\t\t\telse {\n\t\t\t\t\t\t// make nest list item\n\t\t\t\t\t\ts_pointer_label = this.next_label();\n\t\t\t\t\t\tlet kt_blank_node = this._kt_object = this.anonymous_blank_node(s_pointer_label);\n\t\t\t\t\t\tthis.data();\n\n\n\t\t\t\t\t\t// setup for object literal\n\t\t\t\t\t\tthis._kt_subject = kt_blank_node;\n\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\t\t\t\t\t}\n\n\t\t\t\t\t// how to resume collection subject state after object literal\n\t\t\t\t\tthis.after_end_of_statement = function() {\n\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_rest;\n\t\t\t\t\t\tthis.after_end_of_statement = this.post_object;\n\t\t\t\t\t\treturn this.collection_subject();\n\t\t\t\t\t};\n\t\t\t\t\treturn this.string_literal();\n\n\t\t\t\t// numeric literal\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_NUMERIC_LITERAL.lastIndex = i;\n\t\t\t\t\t// execute regex\n\t\t\t\t\tlet m_numeric_literal = R_NUMERIC_LITERAL.exec(s);\n\n\t\t\t\t\t// regex was a match\n\t\t\t\t\tif(m_numeric_literal) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\ti = R_NUMERIC_LITERAL.lastIndex;\n\t\t\t\t\t\t// it has exponent term, xsd:double\n\t\t\t\t\t\tif(m_numeric_literal[4]) {\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.double(m_numeric_literal[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// contains decimal point, xsd:decimal\n\t\t\t\t\t\telse if(m_numeric_literal[2] || m_numeric_literal[3]) {\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.decimal(m_numeric_literal[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// otherwise, it is an integer\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.integer(m_numeric_literal[1]);\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t// boolean literal\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\tR_BOOLEAN_LITERAL.lastIndex = i;\n\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\tlet m_boolean_literal = R_BOOLEAN_LITERAL.exec(s);\n\n\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\tif(m_boolean_literal) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\ti = R_BOOLEAN_LITERAL.lastIndex;\n\t\t\t\t\t\t\t// make literal\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.boolean(!!m_boolean_literal[1]);\n\n\t\t\t\t\t\t// blank node property list\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \tif('[' === x) {\n\t\t\t\t// advance index to next token\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t\t\t\t// this blank node is just the next item in the list\n\t\t\t\t\t\t\ts_pointer_label = this.next_label();\n\t\t\t\t\t\t\tlet kt_blank_node;\n\t\t\t\t\t\t\tif(null !== this._kt_subject) {\n\t\t\t\t\t\t\t\tkt_blank_node = this._kt_object = this.anonymous_blank_node(s_pointer_label);\n\t\t\t\t\t\t\t\tthis.data();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// subject needs to be set\n\t\t\t\t\t\t\tthis._kt_subject = kt_blank_node || this.anonymous_blank_node(s_pointer_label);\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\t\t\t\t\t\t\tlet s_label = this.next_label();\n\t\t\t\t\t\t\tkt_blank_node = this._kt_object = this.anonymous_blank_node(s_label);\n\t\t\t\t\t\t\tthis.data();\n\n\n\t\t\t\t\t\t\t// when resume\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_rest;\n\n\t\t\t\t\t\t\t// push state\n\t\t\t\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'collection_subject']);\n\n\t\t\t\t\t\t\t// prepare next triple\n\t\t\t\t\t\t\tthis._kt_subject = kt_blank_node;\n\n\t\t\t\t\t\t\t// goto parsing pairs state\n\t\t\t\t\t\t\treturn this.pairs();\n\n\t\t\t\t\t\t// new collection\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \tif('(' === x) {\n\t\t\t\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\t\ti = R_WS.lastIndex;\n\n\t\t\t\t\t\t\t// empty collection\n\t\t\t\t\t\t\tif(')' === s[i]) {\n\t\t\t\t\t\t\t\tthis.i = i;\n\t\t\t\t\t\t\t\tthis._kt_subject = this._a_nested[this._a_nested.length-1][0];\n\t\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\t\t\t\t\t\t\t\tthis._a_nested.push([\n\t\t\t\t\t\t\t\t\tthis._kt_subject,\n\t\t\t\t\t\t\t\t\tthis._kt_rdf_rest,\n\t\t\t\t\t\t\t\t\t'collection_subject',\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t\treturn this.collection_object();\n\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t// commit list item pointer\n\t\t\t\t\t\t\ts_pointer_label = this.next_label();\n\t\t\t\t\t\t\tlet kt_blank_node = this._kt_object = this.anonymous_blank_node(s_pointer_label);\n\t\t\t\t\t\t\tthis.data();\n\n\n\t\t\t\t\t\t\t// add this list as an item to the outer list\n\t\t\t\t\t\t\tthis._kt_subject = kt_blank_node;\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_rest;\n\t\t\t\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'collection_object']);\n\n\t\t\t\t\t\t\t// prepare next triple\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\n\n\n\t\t\t\t\t\t\t// flowing\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t// labeled blank node\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\tR_BLANK_NODE_LABEL.lastIndex = i;\n\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\tlet m_blank_node_label_object = R_BLANK_NODE_LABEL.exec(s);\n\n\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\tif(m_blank_node_label_object) {\n\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\ti = R_BLANK_NODE_LABEL.lastIndex;\n\t\t\t\t\t\t\t\t// ref blank node label\n\t\t\t\t\t\t\t\tlet s_label = m_blank_node_label_object[1];\n\n\t\t\t\t\t\t\t\t// make object\n\t\t\t\t\t\t\t\tthis._kt_object = this.blank_node(s_label);\n\n\t\t\t\t\t\t\t// iriref\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\tlet m_iriref_object = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\tif(m_iriref_object) {\n\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\ti = R_IRIREF.lastIndex;\n\n\t\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\t\tlet s_iri = m_iriref_object[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t\t// set object\n\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.check_named_node(s_iri);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.check_named_node(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name = this.match_prefixed_name(s, i);\n\t\t\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name) return true;\n\t\t\t\t\t\t\t\t\tlet [m_prefixed_named_object, im_prefixed_named_object] = aw_valid_this_match_prefixed_name;\n\t\t\t\t\t\t\t\t\tif(m_prefixed_named_object) {\n\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\ti = im_prefixed_named_object;\n\t\t\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_object[1] || '';\n\t\t\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t\t\t// escape local escapes\n\t\t\t\t\t\t\t\t\t\tlet s_suffix = m_prefixed_named_object[2]\n\t\t\t\t\t\t\t\t\t\t\t.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY)\n\t\t\t\t\t\t\t\t\t\t\t.replace(R_PN_LOCAL_ESCAPES, '$1');\n\n\t\t\t\t\t\t\t\t\t\t// commit object iri from resolve prefixed name\n\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.prefixed_name(s_prefix_id, s_suffix);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t// not iriref, not prefixed name, not string literal, not numeric literal, not boolean literal, not blank node property list, not collection\n\t\t\t// match counter: 7\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t// ran out of characters after pushing state, pop it\n\t\t\t\t\t\t\t\t\t\t\tif(b_pushed) this._a_nested.pop();\n\n\t\t\t\t\t\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} // brace #7\n\t\t\t\t\t\t\t\t} // brace #6\n\t\t\t\t\t\t\t} // brace #5\n\t\t\t\t\t\t} // brace #4\n\t\t\t\t\t} // brace #3\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\n\n\t\t\tlet kt_blank_node_outer;\n\t\t\tif(!s_pointer_label) s_pointer_label = this.next_label();\n\n\t\t\t// not the very first item of collection subject\n\t\t\tif(this._kt_subject !== null) {\n\t\t\t\t// ref object\n\t\t\t\tlet w_object = this._kt_object;\n\n\t\t\t\t// create blanknode to embed list\n\t\t\t\tkt_blank_node_outer = this._kt_object = this.anonymous_blank_node(s_pointer_label);\n\n\t\t\t\t// emit statement that functions as collection's head \"pointer\"\n\t\t\t\tthis.data();\n\n\n\t\t\t\t// swap back object\n\t\t\t\tthis._kt_object = w_object;\n\t\t\t}\n\n\t\t\t// emit statement that is item\n\t\t\tthis._kt_subject = kt_blank_node_outer || this.anonymous_blank_node(s_pointer_label);\n\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\t\t\tthis.data();\n\n\n\t\t\t// prepare next predicate\n\t\t\tthis._kt_predicate = this._kt_rdf_rest;\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('collection_subject');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.collection_subject;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for collection_object\n\tcollection_object() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// ref char\n\t\t\tlet x = s[i];\n\n\t\t\t// end of collection\n\t\t\tif(')' === x) {\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\tR_WS.exec(s);\n\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t// make & emit collection's tail \"pointer\"\n\t\t\t\tthis._kt_object = this._kt_rdf_nil;\n\t\t\t\tthis.data();\n\n\n\t\t\t\t// restore previous state\n\t\t\t\tlet s_resume_state;\n\t\t\t\t[this._kt_subject, this._kt_predicate, s_resume_state] = this._a_nested.pop();\n\t\t\t\treturn this[s_resume_state]();\n\t\t\t}\n\n\n\n\t\t\t// otherwise, pre-emptively secure the next blank node label\n\t\t\tlet s_pointer_label;\n\n// iriref\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_iriref_e_object = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_iriref_e_object) {\n\t\t\t\t// advance index\n\t\t\t\ti = R_IRIREF_ESCAPELESS.lastIndex;\n// commit object iri as is\n\n\t\t\t\t// ref iri\n\t\t\t\tlet s_iri = m_iriref_e_object[1];\n\t\t\t\t// absolute iri\n\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t// set object\n\t\t\t\t\tthis._kt_object = this.check_named_node_escapeless(s_iri);\n\t\t\t\t}\n\t\t\t\t// relative iri\n\t\t\t\telse {\n\t\t\t\t\tthis._kt_object = this.check_named_node_escapeless(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t}\n\n\t\t\t// prefixed name\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// try match\n\t\t\t\tlet aw_valid_this_match_prefixed_name_escapeless = this.match_prefixed_name_escapeless(s, i);\n\t\t\t\t// stack bail out\n\t\t\t\tif(!aw_valid_this_match_prefixed_name_escapeless) return true;\n\t\t\t\tlet [m_prefixed_named_e_object, im_prefixed_named_e_object] = aw_valid_this_match_prefixed_name_escapeless;\n\t\t\t\tif(m_prefixed_named_e_object) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = im_prefixed_named_e_object;\n\t\t\t\t\t// check valid prefix\n\t\t\t\t\tlet s_prefix_id = m_prefixed_named_e_object[1] || '';\n\t\t\t\t\t// invalid prefix\n\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t// commit object iri from resolve prefixed name\n\t\t\t\t\tthis._kt_object = this.prefixed_name(s_prefix_id, m_prefixed_named_e_object[2]);\n\n\t\t\t\t// string literal\n\t\t\t\t}\n\t\t\t\telse \tif('\"' === x || '\\'' === x) {\n\t\t\t\t\t// update index before changing states\n\t\t\t\t\tthis.i = i;\n\n\t\t\t\t\t// create blanknode to embed list\n\t\t\t\t\tlet kt_blank_node = this._kt_object = this.anonymous_blank_node(this.next_label());\n\n\t\t\t\t\t// emit statement that functions as collection's head \"pointer\"\n\t\t\t\t\tthis.data();\n\n\n\t\t\t\t\t// prepare statement that is item\n\t\t\t\t\tthis._kt_subject = kt_blank_node;\n\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\n\t\t\t\t\tthis.after_end_of_statement = function() {\n\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_rest;\n\t\t\t\t\t\tthis.after_end_of_statement = this.post_object;\n\t\t\t\t\t\treturn this.collection_object();\n\t\t\t\t\t};\n\t\t\t\t\treturn this.string_literal();\n\n\t\t\t\t// numeric literal\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_NUMERIC_LITERAL.lastIndex = i;\n\t\t\t\t\t// execute regex\n\t\t\t\t\tlet m_numeric_literal = R_NUMERIC_LITERAL.exec(s);\n\n\t\t\t\t\t// regex was a match\n\t\t\t\t\tif(m_numeric_literal) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\ti = R_NUMERIC_LITERAL.lastIndex;\n\t\t\t\t\t\t// it has exponent term, xsd:double\n\t\t\t\t\t\tif(m_numeric_literal[4]) {\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.double(m_numeric_literal[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// contains decimal point, xsd:decimal\n\t\t\t\t\t\telse if(m_numeric_literal[2] || m_numeric_literal[3]) {\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.decimal(m_numeric_literal[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// otherwise, it is an integer\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.integer(m_numeric_literal[1]);\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t// boolean literal\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\tR_BOOLEAN_LITERAL.lastIndex = i;\n\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\tlet m_boolean_literal = R_BOOLEAN_LITERAL.exec(s);\n\n\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\tif(m_boolean_literal) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\ti = R_BOOLEAN_LITERAL.lastIndex;\n\t\t\t\t\t\t\t// make literal\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.boolean(!!m_boolean_literal[1]);\n\n\t\t\t\t\t\t// blank node property list\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \tif('[' === x) {\n\t\t\t\t// advance index to next token\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t\t\t\t// commit head of list pointer\n\t\t\t\t\t\t\tlet kt_blank_node = this._kt_object = this.anonymous_blank_node(this.next_label());\n\t\t\t\t\t\t\tthis.data();\n\n\n\t\t\t\t\t\t\t// setup state to resume and push\n\t\t\t\t\t\t\tthis._kt_subject = kt_blank_node;\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_rest;\n\t\t\t\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'collection_object']);\n\n\t\t\t\t\t\t\t// enter blank node\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\t\t\t\t\t\t\tkt_blank_node = this._kt_object = this.anonymous_blank_node(this.next_label());\n\t\t\t\t\t\t\tthis.data();\n\n\n\t\t\t\t\t\t\t// prepare next triple\n\t\t\t\t\t\t\tthis._kt_subject = kt_blank_node;\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\n\t\t\t\t\t\t\t// goto parsing pairs state\n\t\t\t\t\t\t\treturn this.pairs();\n\n\t\t\t\t\t\t// new collection\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \tif('(' === x) {\n\t\t\t\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\t\ti = R_WS.lastIndex;\n\n\t\t\t\t\t\t\t// commit list item pointer\n\t\t\t\t\t\t\ts_pointer_label = this.next_label();\n\t\t\t\t\t\t\tlet kt_blank_node = this._kt_object = this.anonymous_blank_node(s_pointer_label);\n\t\t\t\t\t\t\tif(null === this._kt_subject) {\n\t\t\t\t\t\t\t\tlet a_recent = this._a_nested[this._a_nested.length-1];\n\t\t\t\t\t\t\t\tthis._kt_subject = a_recent[0];\n\t\t\t\t\t\t\t\tthis._kt_predicate = a_recent[1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.data();\n\n\n\t\t\t\t\t\t\t// add this list as an item to the outer list\n\t\t\t\t\t\t\tthis._kt_subject = kt_blank_node;\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_rest;\n\t\t\t\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'collection_object']);\n\n\t\t\t\t\t\t\t// prepare next triple\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\n\t\t\t\t\t\t\t// flowing\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t// labeled blank node\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\tR_BLANK_NODE_LABEL.lastIndex = i;\n\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\tlet m_blank_node_label_object = R_BLANK_NODE_LABEL.exec(s);\n\n\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\tif(m_blank_node_label_object) {\n\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\ti = R_BLANK_NODE_LABEL.lastIndex;\n\t\t\t\t\t\t\t\t// ref blank node label\n\t\t\t\t\t\t\t\tlet s_label = m_blank_node_label_object[1];\n\n\t\t\t\t\t\t\t\t// make collection pointer label first\n\t\t\t\t\t\t\t\ts_pointer_label = this.next_label();\n\n\t\t\t\t\t\t\t\t// make object\n\t\t\t\t\t\t\t\tthis._kt_object = this.blank_node(s_label);\n\n\t\t\t\t\t\t\t// iriref\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\tlet m_iriref_object = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\tif(m_iriref_object) {\n\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\ti = R_IRIREF.lastIndex;\n// commit object iri as is\n\n\t\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\t\tlet s_iri = m_iriref_object[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t\t// set object\n\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.check_named_node(s_iri);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.check_named_node(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name = this.match_prefixed_name(s, i);\n\t\t\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name) return true;\n\t\t\t\t\t\t\t\t\tlet [m_prefixed_named_object, im_prefixed_named_object] = aw_valid_this_match_prefixed_name;\n\t\t\t\t\t\t\t\t\tif(m_prefixed_named_object) {\n\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\ti = im_prefixed_named_object;\n\t\t\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_object[1] || '';\n\t\t\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t\t\t// escape local escapes\n\t\t\t\t\t\t\t\t\t\tlet s_suffix = m_prefixed_named_object[2]\n\t\t\t\t\t\t\t\t\t\t\t.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY)\n\t\t\t\t\t\t\t\t\t\t\t.replace(R_PN_LOCAL_ESCAPES, '$1');\n\n\t\t\t\t\t\t\t\t\t\t// commit object iri from resolve prefixed name\n\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.prefixed_name(s_prefix_id, s_suffix);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t// not iriref, not prefixed name, not string literal, not numeric literal, not boolean literal, not blank node property list, not collection\n\t\t\t// match counter: 7\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} // brace #7\n\t\t\t\t\t\t\t\t} // brace #6\n\t\t\t\t\t\t\t} // brace #5\n\t\t\t\t\t\t} // brace #4\n\t\t\t\t\t} // brace #3\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\n\n\n\t\t\t// ref object\n\t\t\tlet w_object = this._kt_object;\n\n\t\t\t// create blanknode to embed list\n\t\t\tif(!s_pointer_label) s_pointer_label = this.next_label();\n\t\t\tlet kt_blank_node_outer = this._kt_object = this.anonymous_blank_node(s_pointer_label);\n\n\t\t\t// emit statement that functions as collection's head \"pointer\"\n\t\t\tthis.data();\n\n\n\t\t\t// emit statement that is item\n\t\t\tthis._kt_subject = kt_blank_node_outer;\n\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\t\t\tthis._kt_object = w_object;\n\t\t\tthis.data();\n\n\n\t\t\t// prepare next predicate\n\t\t\tthis._kt_predicate = this._kt_rdf_rest;\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('collection_object');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.collection_object;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\tdestroy(e_destroy) {\n\t\tthis.post_blank_subject = () => {};\n\n\t\tthis.statement = () => {};\n\n\t\tthis.block = () => {};\n\n\t\tthis.graph_or_subject = () => {};\n\n\t\tthis.graph_or_subject_property_list = () => {};\n\n\t\tthis.graph_or_subject_anon = () => {};\n\n\t\tthis.graph_keyword = () => {};\n\n\t\tthis.graph_post_name = () => {};\n\n\t\tthis.pairs = () => {};\n\n\t\tthis.object_list = () => {};\n\n\t\tthis.string_literal_short_double = () => {};\n\n\t\tthis.string_literal_short_single = () => {};\n\n\t\tthis.string_literal_long_double = () => {};\n\n\t\tthis.string_literal_long_single = () => {};\n\n\t\tthis.string_literal = () => {};\n\n\t\tthis.datatype_or_langtag = () => {};\n\n\t\tthis.datatype = () => {};\n\n\t\tthis.post_object = () => {};\n\n\t\tthis.base_iri = () => {};\n\n\t\tthis.prefix_id = () => {};\n\n\t\tthis.prefix_iri = () => {};\n\n\t\tthis.full_stop = () => {};\n\n\t\tthis.collection_subject = () => {};\n\n\t\tthis.collection_object = () => {};\n\n\n\t\tthis.eof = () => {\n\t\t\tthis.s = null;\n\t\t};\n\n\t\tthis._b_destroyed = true;\n\n\t\t// propagate input destroy\n\t\tif(!e_destroy && this._ds_input) {\n\t\t\tthis._ds_input.destroy(e_destroy);\n\t\t}\n\n\t\tthis.transform.demolish(e_destroy);\n\t}\n}\n\nmodule.exports = function(...a_args) {\n\tlet g_config = {};\n\n\t// at least one argument\n\tif(a_args.length) {\n\t\tlet z_arg_0 = a_args[0];\n\n\t\t// input given unspecified\n\t\tif(z_arg_0 && z_arg_0.input && 'undefined' === typeof z_arg_0.input.string && !z_arg_0.input.stream) {\n\t\t\tz_arg_0 = z_arg_0.input;\n\t\t}\n\n\t\t// string\n\t\tif('string' === typeof z_arg_0) {\n\t\t\tg_config.input = {string:z_arg_0};\n\t\t}\n\t\t// null\n\t\telse if(null === z_arg_0) {\n\t\t\tg_config.input = null;\n\t\t}\n\t\t// node stream\n\t\telse if('function' === typeof z_arg_0.setEncoding) {\n\t\t\tg_config.input = {stream:z_arg_0};\n\t\t}\n\t\t// whatwg stream\n\t\telse if('function' === typeof z_arg_0.pipeTo) {\n\t\t\tthrow new TypeError(`Sorry, WHATWG streams are currently not supported :(`);\n\t\t// g_config.input = {stream:z_arg_0};\n\t\t}\n\t\t// config struct\n\t\telse if(z_arg_0 && 'object' === typeof z_arg_0 && '[object Object]' === Object.prototype.toString.call(z_arg_0)) {\n\t\t\tg_config = z_arg_0;\n\n\t\t\t// more args; invalid\n\t\t\tif(a_args.length > 1) {\n\t\t\t\tthrow new TypeError(`unexpected argument(s) after config struct: ${a_args.slice(1)}`);\n\t\t\t}\n\t\t}\n\t\t// unknown\n\t\telse {\n\t\t\tthrow new TypeError(`unexpected input type: ${z_arg_0}`);\n\t\t}\n\n\t\t// more args\n\t\tif(a_args.length > 1) {\n\t\t\t// copy onto struct\n\t\t\tObject.assign(g_config, a_args[1]);\n\n\t\t\t// more args\n\t\t\tif(a_args.length > 2) {\n\t\t\t\tthrow new TypeError(`unexpected argument(s) after input and config struct: ${a_args.slice(2)}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// create reader, return transform stream\n\treturn (new Reader(g_config)).transform;\n};\n","const stream = require('readable-stream');\n\n\n\nclass Readable extends stream.Readable {\n\tconstructor(gc_readable={}) {\n\t\tsuper(gc_readable);\n\n\t\t// use iterator\n\t\tif(gc_readable.iterator) {\n\t\t\tthrow new Error('readable stream iterator shortcut not yet implemented');\n\t\t}\n\t}\n\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass Writable extends stream.Writable {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\t// rdfjs impl\n\timport(ds_source) {\n\t\tds_source\n\t\t\t.on('data', w_chunk => this.write(w_chunk))\n\t\t\t.on('end', () => this.end())\n\t\t\t.on('error', e_read => this.emit('error', e_read));\n\n\t\treturn this;\n\t}\n}\n\nclass Duplex extends stream.Duplex {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass Transform extends stream.Transform {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\n\t// rdfjs impl\n\timport(ds_source) {\n\t\tds_source\n\t\t\t.on('data', w_chunk => this.write(w_chunk))\n\t\t\t.on('end', () => this.end())\n\t\t\t.on('error', e_read => this.emit('error', e_read));\n\n\t\treturn this;\n\t}\n\n\tdemolish(e_destroy) {\n\t\t// do not allow to push\n\t\tthis.push = (z_chunk) => {\n\t\t\t// ignore eof signals from node core\n\t\t\tif(null === z_chunk) return;\n\n\t\t\t// anything else is bad\n\t\t\tthrow new Error(`[ERR_STREAM_DESTROYED]: Cannot push after stream was destroyed`);\n\t\t};\n\n\t\t// do not allow to emit 'end'\n\t\tthis.emit = function(s_event, ...a_args) {\n\t\t\tif('end' === s_event) return;\n\n\t\t\tObject.getPrototypeOf(this).emit.apply(this, [s_event, ...a_args]);\n\t\t};\n\n\t\t// an error was given, destroy the stream as well\n\t\tif(e_destroy) {\n\t\t\treturn stream.Transform.prototype.destroy.call(this, e_destroy);\n\t\t}\n\t}\n}\n\n// eslint-disable-next-line no-new-func\nconst b_is_node = (new Function(/* syntax: js */ `try {return this===global;}catch(e){return false;}`))();\n\n// deduce the runtime environment\nconst [B_BROWSER, B_BROWSERIFY] = (() => 'undefined' === typeof process\n\t? [true, false]\n\t: (process.browser\n\t\t? [true, true]\n\t\t: ('undefined' === process.versions || 'undefined' === process.versions.node\n\t\t\t? [true, false]\n\t\t\t: [false, false])))();\n\n// node.js or browserify; patch for node < v10\nif(B_BROWSERIFY || (b_is_node && (+(/^v(\\d+)/.exec(process.version)[1])) < 10)) {\n\t// override destroy methods\n\tTransform.prototype.destroy = Duplex.prototype.destroy = function(e_destroy, fke_destroy) {\n\t\tthis._readableState.destroyed = true;\n\t\tthis._writableState.destroyed = true;\n\n\t\tlet f_emit_close = () => {\n\t\t\tif(!this._writableState.emitClose) return;\n\t\t\tif(!this._readableState.emitClose) return;\n\t\t\tthis.emit('close');\n\t\t};\n\n\t\tthis._destroy(e_destroy || null, (e_destroy_re) => {\n\t\t\tif(!fke_destroy && e_destroy_re) {\n\t\t\t\tprocess.nextTick(() => {\n\t\t\t\t\tthis.emit('error', e_destroy_re);\n\t\t\t\t\tf_emit_close();\n\t\t\t\t});\n\t\t\t\tthis._writableState.errorEmitted = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tprocess.nextTick(f_emit_close);\n\t\t\t\tif(fke_destroy) fke_destroy(e_destroy_re);\n\t\t\t}\n\t\t});\n\n\t\treturn this;\n\t};\n\n\t// override default _destroy implementations\n\tTransform.prototype._destroy = Duplex.prototype._destroy = (e_destroy, fke_destroy) => fke_destroy(e_destroy);\n}\n\nclass QuadsToOther extends Transform {\n\tconstructor(gc_transform={}) {\n\t\tsuper({\n\t\t\t...gc_transform,\n\t\t\twritableObjectMode: true,\n\t\t\treadableObjectMode: true,\n\t\t});\n\n\t\tthis._as_inputs = new Set();\n\n\t\t// forward prefix and comment events\n\t\tthis.on('pipe', (ds_src) => {\n\t\t\tthis._as_inputs.add(ds_src);\n\n\t\t\tds_src\n\t\t\t\t.on('prefix', (...a_args) => {\n\t\t\t\t\tthis.emit('prefix', ...a_args);\n\t\t\t\t})\n\t\t\t\t.on('comment', (...a_args) => {\n\t\t\t\t\tthis.emit('comment', ...a_args);\n\t\t\t\t});\n\t\t});\n\n\t\tthis.on('unpipe', (ds_src) => {\n\t\t\tthis._as_inputs.delete(ds_src);\n\t\t});\n\t}\n\n\t_destroy() {\n\t\tfor(let ds_input of this._as_inputs) {\n\t\t\tds_input.destroy();\n\t\t}\n\t}\n}\n\nclass Quads_To_JSON_Transform extends QuadsToOther {\n\t// serializse json\n\t_transform(g_quad, s_encoding, fk_transform) {\n\t\tfk_transform(null, JSON.stringify(g_quad.isolate())+'\\n');\n\t}\n}\n\nclass Quads_To_Writable extends QuadsToOther {\n\t_transform(g_quad, s_encoding, fk_transform) {\n\t\tfk_transform(null, {\n\t\t\ttype: 'quad',\n\t\t\tvalue: g_quad,\n\t\t});\n\t}\n}\n\nTransform.QuadsToOther = QuadsToOther;\n\nmodule.exports = {\n\t...stream,\n\tReadable,\n\tWritable,\n\tDuplex,\n\tTransform,\n\n\tQuadsToOther,\n\n\t// create a transform from quad objects into JSON strings for trivial serialization\n\tquads_to_json() {\n\t\treturn new Quads_To_JSON_Transform();\n\t},\n\n\t// create a transform from quad objects into writable data events\n\tquads_to_writable() {\n\t\treturn new Quads_To_Writable();\n\t},\n\n\t// create a simple, single-event readable stream\n\tsource(w_push, s_encoding=null) {\n\t\t// encoding not explicit, string given; assume utf8\n\t\tif(!s_encoding && 'string' === typeof w_push) s_encoding = 'utf8';\n\n\t\t// readable\n\t\treturn new Readable({\n\t\t\tobjectMode: !s_encoding && 'string' !== typeof w_push && !Buffer.isBuffer(w_push),\n\n\t\t\tread() {\n\t\t\t\tthis.push(w_push, s_encoding);\n\t\t\t\tthis.push(null);\n\t\t\t},\n\t\t});\n\t},\n};\n"],"names":["queueMicrotask","dp_resolve","Promise","resolve","fk","then","catch","e_callback","setTimeout","e_define","uri","string_decoder","stream","factory","quad","k","_kt_subject","_kt_predicate","_kt_object","_kt_graph","RT_PREFIXED_NAME_NAMESPACE_VALID","RT_PREFIXED_NAME_LOCAL_NAME_VALID","RT_BLANK_NODE_VALID","RT_NAMED_NODE_VALID","RT_NAMED_NODE_ESCAPELESS_VALID","R_UNICODE_ANY","F_REPLACE_UNICODE_ANY","s_","s_4","s_8","String","fromCodePoint","parseInt","OPHOP","Object","prototype","hasOwnProperty","R_PREFIXED_NAME_QUICK","R_PREFIXED_NAME_ESCAPELESS","R_PREFIXED_NAME","R_PN_LOCAL_ESCAPES","R_BLANK_NODE_LABEL","R_BLANK_NODE_LABEL_TERMINAL","R_IRIREF_ESCAPELESS","R_IRIREF","R_NUMERIC_LITERAL","R_BOOLEAN_LITERAL","R_A","R_DOUBLE_CARET","R_WS","R_LANGTAG","R_PREFIX_KEYWORD","R_PREFIX_ID","R_BASE_KEYWORD","R_GRAPH_IRI_ESCAPELESS","R_GRAPH_PREFIXED_NAME","R_GRAPH_LABELED_BLANK_NODE","R_GRAPH_ANONYMOUS_BLANK_NODE","R_GRAPH_IRI","R_GRAPH","R_COMMENT","RT_IRI_ABSOLUTE","R_BASE_IRI","R_ANONYMOUS_BLANK_NODE","R_CHAR_BLANK_NODE","R_CHAR_COLLECTION","R_CHAR_KET","R_CHAR_OPEN","R_CHAR_CLOSE","R_CHAR_STOP","R_STRLIT_SHORT_DOUBLE_BREAK","R_STRLIT_SHORT_SINGLE_BREAK","R_STRLIT_LONG_DOUBLE_UNFINISHED_TERM","R_STRLIT_LONG_SINGLE_UNFINISHED_TERM","R_STRLIT_LONG_DOUBLE_BREAK","R_STRLIT_LONG_SINGLE_BREAK","F_REPLACE_STRLIT_CONTENTS","s_whitespace","s_auto","s_invalid","console","assert","Error","JSON","stringify","R_STRLIT_SHORT_CONTENTS_ESCAPES_HARD","R_STRLIT_SHORT_CONTENTS_ESCAPES_SOFT","unescape_literal_short_hard","s_literal","replace","unescape_literal_short_soft","m_incomplete","R_STRLIT_ESCAPE_INCOMPLETE","exec","i_safe","index","slice","R_STRLIT_LONG_CONTENTS_ESCAPES_HARD","R_STRLIT_LONG_CONTENTS_ESCAPES_SOFT","unescape_literal_long_hard","unescape_literal_long_soft","R_STRLIT_SHORT_DOUBLE_TERM","R_STRLIT_SHORT_SINGLE_TERM","R_STRLIT_LONG_DOUBLE_TERM","R_STRLIT_LONG_SINGLE_TERM","RegExp_$lookbehind_polyfill","s_input","m_match","RegExp","call","this","i_start","length","mk_lookbehind_regex","e_compile","f_lookbehind","r_polyfill","f_polyfill","match_prefixed_name_escapeless","s","i","lastIndex","match_prefixed_name","Reader$syntax_error","k_self","si_state","s_info","i_off","Math","min","abs","error","substr","repeat","TriG_Reader","Transform","constructor","g_impls","super","decodeStrings","writableObjectMode","readableObjectMode","flush","transform","pipe","ds_out","ds_dst","_writableState","objectMode","isGraphyWritable","quads_to_writable","quads_to_json","Reader","g_config","input","g_input","state","g_state","blank_node_index","i_anon","prefixes","h_prefixes","labels","h_labels","dc_factory","adopt","dataFactory","data_factory","unfiltered","kt_default_graph","defaultGraph","create","kt_rdf_first","namedNode","blankNode","emit_data","ds_transform","push","g_quad","assign","n","pre","prepend","_b_debug","debug","_b_relax","relax","_dc_factory","_f_state","block","_h_prefixes","_b_destroyed","_s_base_url","_s_base_url_scheme","_s_base_url_root","_s_base_url_path","_s_literal","_kt_rdf_type","_kt_rdf_first","_kt_rdf_rest","_kt_rdf_nil","_kt_default_graph","_a_nested","_h_labels","event","emit","data","restore_data","_a_queue_event","_b_expecting_full_stop","_s_temp_prefix_id","_b_trim_start","anonymous_blank_node","s_label","next_label","eos","after_end_of_statement","post_object","_n_max_token_length","max_token_length","maxTokenLength","_n_max_string_length","max_string_length","maxStringLength","Infinity","_b_byte_tracking","byte_tracking","byteTracking","_nb_seen","_nb_last","_nb_curr","relaxed","warn","stack","blank_node","z_label_state","check_named_node","check_named_node_escapeless","test","p_iri","match_prefixed_name_quick","m_prefixed_name_e","im_prefixed_name_e","m_prefixed_name","im_prefixed_name","named_node","prefixed_name","si_prefix","s_suffix","base","TypeError","p_set_base_uri","base_uri","baseUri","baseURI","base_iri","baseIri","baseIRI","m_base_iri","base_url","baseUrl","baseURL","s_chunk","s_encoding","fke_chunk","safe_parse","fke_flush","eof","e_eof","destroy","on","ds_input","_ds_input","b_byte_tracking","setEncoding","f_write","write","d_decoder","StringDecoder","f_write_track","fk_write","nb_chunk","Buffer","from","f_decode_write_track","ab_chunk","f_decode_write","z_chunk","nb_post","ib_post","byteRange","s_event","emit_comments","s_captured","a_comments","split","s_comment","_destroy","a_args","bind","string","end","f_sync","apply","e_read","queue","args","s_message","parse_error","s_expected","b_eof","info_error","a_queue","h_event","shift","name","m_comment","prefix","enter","exit","comment","read","once","progress","finish","post_blank_subject","statement","equals","pairs","m_pnq_subject","s_prefix_id","m_iriref_e_subject","s_iri","aw_valid_this_match_prefixed_name_escapeless","m_prefixed_named_e_subject","im_prefixed_named_e_subject","m_blank_node_label_subject","collection_subject","m_iriref_subject","aw_valid_this_match_prefixed_name","m_prefixed_named_subject","im_prefixed_named_subject","m_graph_iriref_e_graph","m_graph_prefixed_name","m_graph_anonymous_blank_node","m_graph_labeled_blank_node","m_iriref_e_graph_subject","graph_or_subject","graph_or_subject_property_list","m_prefix_keyword","prefix_id","m_base_keyword","m_graph_iriref_graph","graph_keyword","x","graph_or_subject_anon","pop","m_prefixed_named_e_graph","im_prefixed_named_e_graph","graph_post_name","m_iriref_e_graph","m_blank_node_label_graph","m_iriref_graph","m_prefixed_named_graph","im_prefixed_named_graph","m_iriref_e_predicate","object_list","m_prefixed_named_e_predicate","im_prefixed_named_e_predicate","s_resume_state","m_iriref_predicate","m_prefixed_named_predicate","im_prefixed_named_predicate","string_literal_long_double","string_literal_short_double","m_pnq_object","m_iriref_e_object","m_prefixed_named_e_object","im_prefixed_named_e_object","string_literal_long_single","string_literal_short_single","m_numeric_literal","double","decimal","integer","m_boolean_literal","boolean","kt_blank_node","m_blank_node_label_object","collection_object","m_iriref_object","m_prefixed_named_object","im_prefixed_named_object","m_break","i_break","datatype_or_langtag","m_term","i_term","s_dirty","s_clean","s_incomplete","m_unfinished","string_literal","datatype","m_langtag","languagedLiteral","simpleLiteral","kt_datatype","m_pnq_datatype","m_iriref_e_datatype","p_datatype","m_prefixed_named_e_datatype","im_prefixed_named_e_datatype","m_iriref_datatype","m_prefixed_named_datatype","im_prefixed_named_datatype","datatypedLiteral","i_reset","s_peek","m_iriref_e_base","full_stop","m_iriref_base","m_prefix_id","prefix_iri","p_prefix_iri","m_iriref_e_prefix","b_relax","prefix_change","m_iriref_prefix","s_pointer_label","b_pushed","kt_blank_node_outer","w_object","a_recent","e_destroy","demolish","module","exports","z_arg_0","pipeTo","toString","Readable","gc_readable","iterator","until","b_return_stream","fk_until","fe_until","e_stream","bucket","g_readable","_readableState","fk_bucket","fe_bucket","a_data","Writable","w_event","s_write_encoding","writev","a_chunks","fk_writev","s_data","join","ab_data","concat","import","ds_source","w_chunk","Duplex","getPrototypeOf","b_is_node","Function","B_BROWSER","B_BROWSERIFY","process","browser","versions","node","version","fke_destroy","destroyed","f_emit_close","emitClose","e_destroy_re","nextTick","errorEmitted","QuadsToOther","gc_transform","_as_inputs","Set","ds_src","add","delete","Quads_To_JSON_Transform","_transform","fk_transform","isolate","Quads_To_Writable","type","value","source","w_push","isBuffer"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"js/55.d111b5d7.js","mappings":"6IAMC,GAAG,oBAAsBA,eAAgB,CAExC,IAAIC,EAAaC,QAAQC,UAGzB,IAECH,eAAiBI,GAAMH,EAAWI,KAAKD,GACrCE,OAAMC,GAAcC,YAAW,KAC/B,MAAMD,CAAU,GACd,IACL,CAEA,MAAME,IAAW,CAClB,CAKD,MAAMC,EAAM,EAAQ,OACdC,EAAiB,EAAQ,OAEzBC,EAAS,EAAQ,OACjBC,EAAU,EAAQ,OAClBC,EAAOC,GAAKF,EAAQC,KAAKC,EAAEC,YAAaD,EAAEE,cAAeF,EAAEG,WAAYH,EAAEI,WAGzEC,EAAmC,4qBAEnCC,EAAoC,ozBAEpCC,EAAsB,6qBACtBC,EAAsB,gEACtBC,EAAiC,0BAIjCC,EAAgB,2CAEhBC,EAAyB,CAACC,EAAIC,EAAKC,IAAQC,OAAOC,cAAcC,SAASJ,GAAOC,EAAK,KAErFI,EAAQC,OAAOC,UAAUC,e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,IAAQ9O,EAAa,QAGpD,IAAIkL,EAAS,CACnBrS,YAAamH,GAAc,kBAAoB8O,IAAW3N,EAAO4N,SAASD,GAE1E,IAAApL,GACCnN,KAAKmE,KAAKoU,EAAQ9O,GAClBzJ,KAAKmE,KAAK,KACX,GAEF,E","sources":["webpack://mobilitydcatap-ui/./node_modules/@graphy/content.trig.read/main.js","webpack://mobilitydcatap-ui/./node_modules/@graphy/core.iso.stream/main.js"],"sourcesContent":["\n\n\n// queueMicrotask shim\n{\n\t// not defined or not a function\n\tif('function' !== typeof queueMicrotask) {\n\t\t// create resolved promise\n\t\tlet dp_resolve = Promise.resolve();\n\n\t\t// try to redefine\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-global-assign\n\t\t\tqueueMicrotask = fk => dp_resolve.then(fk)\n\t\t\t\t.catch(e_callback => setTimeout(() => {\n\t\t\t\t\tthrow e_callback;\n\t\t\t\t}, 0));\n\t\t}\n\t\t// oh well, at least we tried\n\t\tcatch(e_define) {}\n\t}\n}\n\n\n\nconst uri = require('uri-js');\nconst string_decoder = require('string_decoder');\n\nconst stream = require('@graphy/core.iso.stream');\nconst factory = require('@graphy/core.data.factory');\nconst quad = k => factory.quad(k._kt_subject, k._kt_predicate, k._kt_object, k._kt_graph);\n\n// eslint-disable-next-line no-misleading-character-class\nconst RT_PREFIXED_NAME_NAMESPACE_VALID = /^([A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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}.]*[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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;\n// eslint-disable-next-line no-misleading-character-class\nconst RT_PREFIXED_NAME_LOCAL_NAME_VALID = /^([A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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]|%[A-Fa-f0-9]{2}|\\\\[_~.\\-!$&'()*+,;=/?#@%])(([A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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}.:]|%[A-Fa-f0-9]{2}|\\\\[_~.\\-!$&'()*+,;=/?#@%])*([A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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}:]|%[A-Fa-f0-9]{2}|\\\\[_~.\\-!$&'()*+,;=/?#@%]))?$/u;\n// eslint-disable-next-line no-misleading-character-class\nconst RT_BLANK_NODE_VALID = /^[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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]([A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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}.]*[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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;\nconst RT_NAMED_NODE_VALID = /^([^\\0-\\x20<>\"{}|^`\\\\]|\\\\u[A-Fa-f0-9]{4}|\\\\U[A-Fa-f0-9]{8})*$/;\nconst RT_NAMED_NODE_ESCAPELESS_VALID = /^([^\\0-\\x20<>\"{}|^`])*$/;\n\nconst RT_LITERAL_CONTENTS_VALID = /^(?:[^\\\\]|\\\\[tbnrf\"'\\\\]|\\\\u[A-Fa-f0-9]{4}|\\\\U[A-Fa-f0-9]{8})*$/;\n\nconst R_UNICODE_ANY = /\\\\u([0-9A-Fa-f]{4})|\\\\U([0-9A-Fa-f]{8})/g;\n\nconst F_REPLACE_UNICODE_ANY = \t(s_, s_4, s_8) => String.fromCodePoint(parseInt(s_4 || s_8, 16));\n\nconst OPHOP = Object.prototype.hasOwnProperty;\n\n\n\nconst R_PREFIXED_NAME_QUICK = /([A-Za-z][A-Za-z0-9_-]*)?:([A-Za-z_0-9:][A-Za-z0-9_:-]*)(?:\\s+|(?=\\.?[<[(\"';,)\\]#{}]|\\.[\\s\\0]))/y;\n\n\nconst R_PREFIXED_NAME_ESCAPELESS = /([^\\s#@<[(\"':_{}][^\\s#@<[(\"':{}]*)?:((?:[^\\s#@<[(\"'.;,{})\\]\\\\](?:[^\\s#@<[(\"';,{})\\]\\\\]*[^\\s#@<[(\"'.;,{})\\]\\\\])?)?)(?:\\s+|(?=\\.?[<[(\"';,)\\]#{}]|\\.[\\s\\0]))/y;\n\n\n\nconst R_PREFIXED_NAME = /([^\\s#@<[(\"':_{}][^\\s#@<[(\"':{}]*)?:((?:(?:[^\\s#@<[(\"'.;,{})\\]\\\\]|\\\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\\s\"]))(?:(?:[^\\s#@<[(\"';,{})\\]\\\\]|\\\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\\s\"]))*(?:[^\\s#@<[(\"'.;,{})\\]\\\\]|\\\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\\s\"])))?)?)(?:\\s+|(?=\\.?[<[(\"';,)\\]#{}]|\\.[\\s\\0]))/y;\n\nconst R_PN_LOCAL_ESCAPES = /\\\\(.)/g;\n\n\nconst R_BLANK_NODE_LABEL = /_:(.(?:[^\\s:<;,)\\]#}]*[^\\s:<.;,)\\]#}])?)(?:\\s+|(?=[<:{,;\\])#]))/y;\nconst R_BLANK_NODE_LABEL_TERMINAL = /_:(.(?:[^\\s:<;,)\\]#}]*[^\\s:<.;,)\\]#}])?)(?:\\s+|(?=\\.?[<:{,;\\])#])|(?=\\.[\\s@#<({[}]))/y;\n\nconst R_IRIREF_ESCAPELESS = /<([^\\\\>]*)>\\s*/y;\nconst R_IRIREF = /<([^>]*)>\\s*/y;\n\nconst R_NUMERIC_LITERAL = /([+-]?(?:[0-9]+(\\.[0-9]+)?|(\\.[0-9]+))(\\.?[eE][+-]?[0-9]+)?)(?:\\s+|(?=\\.[^eE0-9]|[;,)\\]]))/y;\nconst R_BOOLEAN_LITERAL = /(?:(true|TRUE)|false|FALSE)\\s*/y;\nconst R_A = /a(?:\\s+|(?=[[(\"'<#]))/y;\n\nconst R_DOUBLE_CARET = /\\^\\^/y;\nconst R_WS = /\\s*/y;\nconst R_LANGTAG = /@([A-Za-z]+(?:-[A-Za-z0-9-]+)*)(?:\\s+|(?=[.},;\\])#]))/y;\n\nconst R_PREFIX_KEYWORD = /(?:(@prefix)|[pP][rR][eE][fF][iI][xX])\\s*/y;\nconst R_PREFIX_ID = /([^#:]*):\\s*/iy;\nconst R_BASE_KEYWORD = /(?:(@base)|[bB][aA][sS][eE])\\s*/y;\n\nconst R_GRAPH_IRI_ESCAPELESS = /(?:graph)?\\s*<([^\\\\>]*)>\\s*\\{\\s*/iy;\nconst R_GRAPH_PREFIXED_NAME = /(?:graph)?\\s*([^\\s#@<[(\"':_{}][^\\s#@<[(\"':{}]*)?:((?:(?:[^\\s#@<[(\"'.;,{})\\]\\\\]|\\\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\\s\"]))(?:(?:[^\\s#@<[(\"';,{})\\]\\\\]|\\\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\\s\"]))*(?:[^\\s#@<[(\"'.;,{})\\]\\\\]|\\\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\\s\"])))?)?)\\s*\\{\\s*/iy;\nconst R_GRAPH_LABELED_BLANK_NODE = /(?:graph)?\\s*_:(.(?:[^\\s:<;,)\\]#}]*[^\\s:<.;,)\\]#}])?)\\s*\\{\\s*/iy;\nconst R_GRAPH_ANONYMOUS_BLANK_NODE = /(?:graph)?\\s*\\[\\s*\\]\\s*\\{\\s*/iy;\nconst R_GRAPH_IRI = /(?:graph)?\\s*<([^>]*)>\\s*\\{\\s*/iy;\nconst R_GRAPH = /graph(?:\\s+|(?=[#<[{]))/iy;\n\nconst R_COMMENT = /(#[^\\n]*\\n\\s*)+/y;\n\nconst RT_IRI_ABSOLUTE = /^[A-Za-z][A-Za-z0-9.\\-+]*:/;\nconst R_RELATIVE_URI = /^(\\/[^?#]+)([?#].*)?$/;\nconst R_BASE_IRI = /^((([A-Za-z0-9.\\-+]*:\\/)?\\/[^/>]*)?(\\/(?:[^/>]*\\/)*)?[^>]*)$/;\n\nconst R_ANONYMOUS_BLANK_NODE = /\\[\\s*\\]\\s*/y;\nconst R_CHAR_BLANK_NODE = /\\[(?:\\s+|(?=[^\\]]))/y;\nconst R_CHAR_COLLECTION = /\\(\\s*/y;\n\nconst R_CHAR_KET = /\\]\\s*/y;\n\nconst R_CHAR_OPEN = /\\{\\s*/y;\nconst R_CHAR_CLOSE = /\\}\\s*/y;\n\nconst R_CHAR_STOP = /\\.\\s*/y;\n\n\n\nconst R_STRLIT_SHORT_DOUBLE_BREAK = /[\\\\\"\\r\\n]/g;\nconst R_STRLIT_SHORT_SINGLE_BREAK = /[\\\\'\\r\\n]/g;\n\nconst R_STRLIT_LONG_DOUBLE_UNFINISHED_TERM = /\"{1,2}$/g;\nconst R_STRLIT_LONG_SINGLE_UNFINISHED_TERM = /'{1,2}$/g;\n\nconst R_STRLIT_LONG_DOUBLE_BREAK = /(\\\\|\"\"\")/g;\nconst R_STRLIT_LONG_SINGLE_BREAK = /(\\\\|''')/g;\n\n\nconst F_REPLACE_STRLIT_CONTENTS = (s_, s_whitespace, s_auto, s_4, s_8, s_invalid) => {\n\tif(s_whitespace) {\n\t\tswitch(s_whitespace) {\n\t\t\tcase 't': return '\\t';\n\t\t\tcase 'n': return '\\n';\n\t\t\tcase 'r': return '\\r';\n\t\t\tcase 'f': return '\\f';\n\t\t\tcase 'b': return '\\b';\n\t\t\tdefault: {\n\t\t\t\tconsole.assert(`bad regex escape char mapping: '${s_whitespace}'`);\n\t\t\t}\n\t\t}\n\t}\n\telse if(s_auto) {\n\t\treturn s_auto;\n\t}\n\telse if(s_4) {\n\t\treturn String.fromCodePoint(parseInt(s_4, 16));\n\t}\n\telse if(s_8) {\n\t\treturn String.fromCodePoint(parseInt(s_8, 16));\n\t}\n\telse if(s_invalid) {\n\t\t// pointless escape\n\t\tif('\\\\' === s_invalid[0]) {\n\t\t\t\t// // relaxed\n\t\t\t\t// return s_invalid[1];\n\t\t\t// if relaxed then return s_invalid, otherwise throw:\n\t\t\tthrow new Error(`expected string_literal but invalid escape sequence within contents: '${s_invalid}'. failed to parse a valid token`);\n\t\t}\n\t\t// bad character\n\t\telse {\n\t\t\tthrow new Error(`expected string_literal but invalid whitespace character within contents: ${JSON.stringify(s_invalid)}. failed to parse a valid token`);\n\t\t}\n\t}\n\telse {\n\t\tconsole.assert(`unexpected no match branch in escape sequence replace callback`);\n\t}\n};\n\n\nconst R_STRLIT_SHORT_CONTENTS_ESCAPES_HARD = /(?:\\\\(?:([tnrfb])|([\\\\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|([\\r\\n]|\\\\.))/g;\nconst R_STRLIT_SHORT_CONTENTS_ESCAPES_SOFT = /(?:\\\\(?:([tnrfb])|([\\\\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|([\\r\\n]|\\\\[^uU]|\\\\u[^]{4}|\\\\U[^]{8}))/g;\n\nconst unescape_literal_short_hard = s_literal => s_literal\n\t.replace(R_STRLIT_SHORT_CONTENTS_ESCAPES_HARD, F_REPLACE_STRLIT_CONTENTS);\n\nconst unescape_literal_short_soft = (s_literal) => {\n\tlet m_incomplete = R_STRLIT_ESCAPE_INCOMPLETE.exec(s_literal);\n\n\t// incomplete escape\n\tif(m_incomplete) {\n\t\tlet i_safe = m_incomplete.index;\n\n\t\t// rewind\n\t\treturn [\n\t\t\ts_literal.slice(0, i_safe)\n\t\t\t\t.replace(R_STRLIT_SHORT_CONTENTS_ESCAPES_SOFT, F_REPLACE_STRLIT_CONTENTS),\n\t\t\ts_literal.slice(i_safe),\n\t\t];\n\t}\n\t// done\n\telse {\n\t\treturn [\n\t\t\ts_literal\n\t\t\t\t.replace(R_STRLIT_SHORT_CONTENTS_ESCAPES_SOFT, F_REPLACE_STRLIT_CONTENTS),\n\t\t\t'',\n\t\t];\n\t}\n};\n\n\nconst R_STRLIT_LONG_CONTENTS_ESCAPES_HARD = /(?:\\\\(?:([tnrfb])|([\\\\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|(\\\\.))/g;\nconst R_STRLIT_LONG_CONTENTS_ESCAPES_SOFT = /(?:\\\\(?:([tnrfb])|([\\\\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|(\\\\[^uU]|\\\\u[^]{4}|\\\\U[^]{8}))/g;\n\nconst unescape_literal_long_hard = s_literal => s_literal\n\t.replace(R_STRLIT_LONG_CONTENTS_ESCAPES_HARD, F_REPLACE_STRLIT_CONTENTS);\n\nconst unescape_literal_long_soft = (s_literal) => {\n\tlet m_incomplete = R_STRLIT_ESCAPE_INCOMPLETE.exec(s_literal);\n\n\t// incomplete escape\n\tif(m_incomplete) {\n\t\tlet i_safe = m_incomplete.index;\n\n\t\t// rewind\n\t\treturn [\n\t\t\ts_literal.slice(0, i_safe)\n\t\t\t\t.replace(R_STRLIT_LONG_CONTENTS_ESCAPES_SOFT, F_REPLACE_STRLIT_CONTENTS),\n\t\t\ts_literal.slice(i_safe),\n\t\t];\n\t}\n\t// done\n\telse {\n\t\treturn [\n\t\t\ts_literal\n\t\t\t\t.replace(R_STRLIT_LONG_CONTENTS_ESCAPES_SOFT, F_REPLACE_STRLIT_CONTENTS),\n\t\t\t'',\n\t\t];\n\t}\n};\n\n// lookbehind regexes\nconst [\n\tR_STRLIT_ESCAPE_INCOMPLETE,\n\tR_STRLIT_SHORT_DOUBLE_TERM,\n\tR_STRLIT_SHORT_SINGLE_TERM,\n\tR_STRLIT_LONG_DOUBLE_TERM,\n\tR_STRLIT_LONG_SINGLE_TERM,\n] = (() => {\n\tfunction RegExp_$lookbehind_polyfill(s_input) {\n\t\tlet m_match = RegExp.prototype.exec.call(this, s_input);\n\n\t\tif(m_match) {\n\t\t\tlet i_start = m_match[0].length - m_match[1].length;\n\t\t\tm_match.index += i_start;\n\t\t\tm_match[0] = m_match[0].slice(i_start);\n\t\t}\n\n\t\treturn m_match;\n\t}\n\tlet mk_lookbehind_regex = (() => {\n\t\ttry {\n\t\t\tnew RegExp('(? {\n\t\t\t\tr_polyfill.exec = f_polyfill;\n\t\t\t\treturn r_polyfill;\n\t\t\t};\n\t\t}\n\t\treturn f_lookbehind => f_lookbehind();\n\t})();\n\treturn [\n\t\t// R_STRLIT_ESCAPE_INCOMPLETE\n\t\tmk_lookbehind_regex(\n\t\t\t() => new RegExp('(? new RegExp('(? new RegExp('(? new RegExp('(? new RegExp('(? {\n\tR_PREFIXED_NAME_QUICK.lastIndex = i;\n\treturn [R_PREFIXED_NAME_QUICK.exec(s), R_PREFIXED_NAME_QUICK.lastIndex];\n};\n\nconst match_prefixed_name_escapeless = (s, i) => {\n\tR_PREFIXED_NAME_ESCAPELESS.lastIndex = i;\n\treturn [R_PREFIXED_NAME_ESCAPELESS.exec(s), R_PREFIXED_NAME_ESCAPELESS.lastIndex];\n};\n\nconst match_prefixed_name = (s, i) => {\n\tR_PREFIXED_NAME.lastIndex = i;\n\treturn [R_PREFIXED_NAME.exec(s), R_PREFIXED_NAME.lastIndex];\n};\n\n\n\nfunction Reader$syntax_error(k_self, i, si_state, s_info) {\n\tlet i_off = Math.min(i, Math.abs(i-15));\n\n\tlet s = k_self.s;\n\n\treturn k_self.error(`\\n\\`${s.substr(i_off, i_off+90).replace(/[\\n\\t]/g, ' ')}\\`\\n`\n\t\t+` ${' '.repeat(i-i_off)}^\\n`\n\t\t+`expected ${si_state} ${s_info || ''}. failed to parse a valid token starting at ${s[i]? '\"'+s[i]+'\"': '<>'}`);\n}\n\n\n\nclass TriG_Reader extends stream.Transform {\n\tconstructor(g_impls) {\n\t\tsuper({\n\t\t\t// do not decode strings into buffers\n\t\t\tdecodeStrings: false,\n\n\t\t\t// accept strings as input on writable side\n\t\t\twritableObjectMode: false,\n\n\t\t\t// output quad objects on readable side\n\t\t\treadableObjectMode: true,\n\n\t\t\t// implementations\n\t\t\tflush: g_impls.flush,\n\t\t\ttransform: g_impls.transform,\n\t\t});\n\t}\n\n\t// intercept pipe\n\tpipe(ds_out) {\n\t\tlet ds_dst = ds_out;\n\n\t\t// non-object mode\n\t\tif(!ds_dst._writableState.objectMode) {\n\t\t\t// transform to JSON\n\t\t\tds_out = stream.quads_to_json();\n\t\t}\n\t\t// yet object mode and graphy writable\n\t\telse if(ds_out.isGraphyWritable) {\n\t\t\t// transform to writable data events\n\t\t\tds_out = stream.quads_to_writable();\n\t\t}\n\n\t\t// interim stream created\n\t\tif(ds_out !== ds_dst) {\n\t\t\t// forward output to super\n\t\t\tsuper.pipe(ds_out);\n\n\t\t\t// pipe outpu to destination\n\t\t\treturn ds_out.pipe(ds_dst);\n\t\t}\n\t\t// forward as-is to super\n\t\telse {\n\t\t\treturn super.pipe(ds_dst);\n\t\t}\n\t}\n}\n\n\nclass Reader {\n\tconstructor(g_config={}) {\n\t\t// impl-specific configs\n\t\tlet {\n\t\t\t// input medium\n\t\t\tinput: g_input=null,\n\n\t\t\t// a state to inherit\n\t\t\tstate: g_state={},\n\t\t} = g_config;\n\n\t\t// inherit state from creator\n\t\tlet {\n\t\t\t// index for anonymous blank node labels\n\t\t\tblank_node_index: i_anon=0,\n\n\t\t\t// prefix map\n\t\t\tprefixes: h_prefixes={},\n\n\t\t\t// blank node label map\n\t\t\tlabels: h_labels={},\n\t\t} = g_state;\n\n\n\t\tlet dc_factory = factory.adopt(g_config.dataFactory || g_config.data_factory || factory.unfiltered);\n\n\t\tlet kt_default_graph = dc_factory.defaultGraph();\n\n\t\t// if data factory is not graphy, it might be returning the same object on each call to .defaultGraph()\n\t\tif(dc_factory !== factory.unfiltered) {\n\t\t\t// do not trust it, create a new object\n\t\t\tkt_default_graph = Object.create(kt_default_graph);\n\t\t}\n\n\t\tlet kt_rdf_first = dc_factory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#first');\n\n\t\tlet blankNode = dc_factory.blankNode;\n\t\tlet namedNode = dc_factory.namedNode;\n\n\t\tthis.emit_data = factory.unfiltered === dc_factory\n\t\t\t? function() {\n\t\t\t\tds_transform.push(quad(this));\n\t\t\t}\n\t\t\t: function() {\n\t\t\t\tlet g_quad = dc_factory.quad(this._kt_subject, this._kt_predicate, this._kt_object, this._kt_graph);\n\t\t\t\tds_transform.push(g_quad);\n\t\t\t};\n\n\t\t// fields\n\t\tObject.assign(this, {\n\t\t\t// read index\n\t\t\ti: 0,\n\n\t\t\t// string buffer\n\t\t\ts: '',\n\n\t\t\t// string buffer length\n\t\t\tn: 0,\n\n\t\t\t// left-over string from previous data chunk\n\t\t\tpre: g_config.prepend || '',\n\n\t\t\t// debug state\n\t\t\t_b_debug: g_config.debug || false,\n\n\t\t\t// relax\n\t\t\t_b_relax: g_config.relax || false,\n\n\t\t\t// factory\n\t\t\t_dc_factory: dc_factory,\n\n\t\t\t// current reader state\n\t\t\t_f_state: this.block,\n\n\t\t\t// map of current prefix ids => iris\n\t\t\t_h_prefixes: h_prefixes,\n\n\n\t\t\t// reader was destroyed by an error\n\t\t\t_b_destroyed: false,\n\n\t\t\t// current @base url\n\t\t\t_s_base_url: '',\n\t\t\t_s_base_url_scheme: '',\n\t\t\t_s_base_url_root: '',\n\t\t\t_s_base_url_path: '',\n\n\t\t\t// current data\n\t\t\t_kt_subject: null,\n\t\t\t_kt_predicate: kt_rdf_first,\n\t\t\t_kt_object: null,\n\t\t\t_kt_graph: kt_default_graph,\n\t\t\t_s_literal: '',\n\n\t\t\t// static terms\n\t\t\t_kt_rdf_type: dc_factory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'),\n\t\t\t_kt_rdf_first: kt_rdf_first,\n\t\t\t_kt_rdf_rest: dc_factory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#rest'),\n\t\t\t_kt_rdf_nil: dc_factory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'),\n\t\t\t_kt_default_graph: kt_default_graph,\n\n\t\t\t// queue of nested subject, predicate, state for blanknodes and collections\n\t\t\t_a_nested: [],\n\n\t\t\t// hash to keep track of all blank node labels in use\n\t\t\t_h_labels: h_labels,\n\n\t\t\t// event routing\n\t\t\tevent: this.emit,\n\t\t\tdata: this.emit_data,\n\n\t\t\t// for restoring the original event callback when resuming paused stream\n\t\t\trestore_data: this.emit_data,\n\n\t\t\t// keep a queue of data events to hold onto until stream resumes (only happens in rare conditions)\n\t\t\t_a_queue_event: [],\n\n\t\t\t// helper states\n\t\t\t_b_expecting_full_stop: false,\n\t\t\t_s_temp_prefix_id: null,\n\t\t\t_b_trim_start: true,\n\n\t\t\tanonymous_blank_node: s_label => blankNode(s_label, true),\n\n\t\t\t// finds the next non-conflicting blank node label\n\t\t\tnext_label() {\n\t\t\t\tlet s_label = '';\n\t\t\t\tdo {\n\t\t\t\t\ts_label = 'g'+(i_anon++);\n\t\t\t\t} while(this._h_labels[s_label]);\n\n\t\t\t\t// claim this label, and remember that we invented it\n\t\t\t\tthis._h_labels[s_label] = 2;\n\n\t\t\t\t// return the label\n\t\t\t\treturn s_label;\n\t\t\t},\n\n\t\t\t// what to do when reach eos\n\t\t\teos: null,\n\n\t\t\t// which state to go to after end of statement\n\t\t\tafter_end_of_statement: this.post_object,\n\n\t\t\t// maximum length of a token: defaults to 2048 => http://stackoverflow.com/a/417184/1641160\n\t\t\t_n_max_token_length: g_config.max_token_length || g_config.maxTokenLength || 2048,\n\n\t\t\t// maximum length of a string (overrides max_token_length): defaults to Infinity\n\t\t\t_n_max_string_length: g_config.max_string_length || g_config.maxStringLength || Infinity,\n\n\t\t\t// byte tracking\n\t\t\t_b_byte_tracking: g_config.byte_tracking || g_config.byteTracking || false,\n\t\t\t_nb_seen: 0,\n\t\t\t_nb_last: 0,\n\t\t\t_nb_curr: 0,\n\t\t});\n\n\t\tif(g_config.relaxed) {\n\t\t\tconsole.warn((new Error(`no such option 'relaxed'; did you mean 'relax' ?`)).stack.replace(/^Error:/, 'Warning:'));\n\t\t}\n\t\tif('validate' in g_config) {\n\t\t\tconsole.warn((new Error(`option 'validate' has been deprecated. Validation is now enabled by default. Use the 'relax' option if you wish to disable validation.`)).stack.replace(/^Error:/, 'Warning:'));\n\t\t}\n\n\n\n\t\t// term constructors\n\t\tObject.assign(this, !g_config.relax\n\t\t\t? {\n\t\t\t\tblank_node(s_label) {\n\t\t\t\t\t// test valid blank node label\n\t\t\t\t\tif(!RT_BLANK_NODE_VALID.test(s_label)) return this.error(`invalid blank node label: \"${s_label}\"`);\n\n\t\t\t\t\t// not first time use of label\n\t\t\t\t\tlet z_label_state = this._h_labels[s_label];\n\t\t\t\t\tif(z_label_state) {\n\t\t\t\t\t\t// label was used previously by document and has no conflict\n\t\t\t\t\t\tif(1 === z_label_state) {} // eslint-disable-line no-empty\n\t\t\t\t\t\t// label is in use by invention, this would cause a conflict\n\t\t\t\t\t\telse if(2 === z_label_state) {\n\t\t\t\t\t\t\t// so create a redirect mapping for this actual label & use it instead\n\t\t\t\t\t\t\ts_label = this._h_labels[s_label] = this.next_label();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// label already has a redirect mapping\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// use redirected label\n\t\t\t\t\t\t\ts_label = this._h_labels[s_label];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// first time use of label\n\t\t\t\t\telse {\n\t\t\t\t\t\t// store label in hash so we avoid future collisions\n\t\t\t\t\t\tthis._h_labels[s_label] = 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t// make term\n\t\t\t\t\treturn blankNode(s_label);\n\t\t\t\t},\n\n\t\t\t\tcheck_named_node(p_iri) {\n\t\t\t\t\tif(!RT_NAMED_NODE_VALID.test(p_iri)) return this.error(`invalid IRI: \"${p_iri}\"`);\n\t\t\t\t\treturn namedNode(p_iri);\n\t\t\t\t},\n\n\t\t\t\tcheck_named_node_escapeless(p_iri) {\n\t\t\t\t\tif(!RT_NAMED_NODE_ESCAPELESS_VALID.test(p_iri)) return this.error(`invalid IRI: \"${p_iri}\"`);\n\t\t\t\t\treturn namedNode(p_iri);\n\t\t\t\t},\n\n\t\t\t\tmatch_prefixed_name_quick(s, i) {\n\t\t\t\t\tR_PREFIXED_NAME_QUICK.lastIndex = i;\n\t\t\t\t\treturn [R_PREFIXED_NAME_QUICK.exec(s), R_PREFIXED_NAME_QUICK.lastIndex];\n\t\t\t\t},\n\n\t\t\t\tmatch_prefixed_name_escapeless(s, i) {\n\t\t\t\t\tlet [m_prefixed_name_e, im_prefixed_name_e] = match_prefixed_name_escapeless(s, i);\n\t\t\t\t\tif(m_prefixed_name_e) {\n\t\t\t\t\t\t// invalid local name\n\t\t\t\t\t\tif(!RT_PREFIXED_NAME_LOCAL_NAME_VALID.test(m_prefixed_name_e[2]) && m_prefixed_name_e[2]) {\n\t\t\t\t\t\t\tthis.error(`invalid prefixed name local name: \"${m_prefixed_name_e[2]}:\"`);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [m_prefixed_name_e, im_prefixed_name_e];\n\t\t\t\t},\n\n\t\t\t\tmatch_prefixed_name(s, i) {\n\t\t\t\t\tlet [m_prefixed_name, im_prefixed_name] = match_prefixed_name(s, i);\n\t\t\t\t\tif(m_prefixed_name) {\n\t\t\t\t\t\t// invalid local name\n\t\t\t\t\t\tif(!RT_PREFIXED_NAME_LOCAL_NAME_VALID.test(m_prefixed_name[2])) {\n\t\t\t\t\t\t\tthis.error(`invalid prefixed name local name: \"${m_prefixed_name[2]}:\"`);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [m_prefixed_name, im_prefixed_name];\n\t\t\t\t},\n\t\t\t}\n\t\t\t: {\n\t\t\t\t// term constructors\n\t\t\t\tblank_node(s_label) {\n\t\t\t\t\t// not first time use of label\n\t\t\t\t\tlet z_label_state = this._h_labels[s_label];\n\t\t\t\t\tif(z_label_state) {\n\t\t\t\t\t\t// label was used previously by document and has no conflict\n\t\t\t\t\t\tif(1 === z_label_state) {} // eslint-disable-line no-empty\n\t\t\t\t\t\t// label is in use by invention, this would cause a conflict\n\t\t\t\t\t\telse if(2 === z_label_state) {\n\t\t\t\t\t\t\t// so create a redirect mapping for this actual label & use it instead\n\t\t\t\t\t\t\ts_label = this._h_labels[s_label] = this.next_label();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// label already has a redirect mapping\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// use redirected label\n\t\t\t\t\t\t\ts_label = this._h_labels[s_label];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// first time use of label\n\t\t\t\t\telse {\n\t\t\t\t\t\t// store label in hash so we avoid future collisions\n\t\t\t\t\t\tthis._h_labels[s_label] = 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t// make term\n\t\t\t\t\treturn blankNode(s_label);\n\t\t\t\t},\n\n\t\t\t\tcheck_named_node: namedNode,\n\n\t\t\t\tcheck_named_node_escapeless: namedNode,\n\n\t\t\t\tmatch_prefixed_name_escapeless,\n\n\t\t\t\tmatch_prefixed_name,\n\t\t\t});\n\n\n\t\tthis.named_node = namedNode;\n\n\t\tthis.prefixed_name = function(si_prefix, s_suffix) {\n\t\t\treturn namedNode(h_prefixes[si_prefix] + s_suffix);\n\t\t};\n\n\n\t\t// oops -- user passed string into `base`\n\t\tif('string' === typeof g_config.base) {\n\t\t\tthrow new TypeError(`invalid type 'string' was given for 'base' event listener: '${g_config.base}'\\n`\n\t\t\t\t+`did you mean to use the 'base_uri' key instead?`);\n\t\t}\n\n\t\t// base uri\n\t\tlet p_set_base_uri = g_config.base_uri || g_config.baseUri || g_config.baseURI || g_config.base_iri || g_config.baseIri || g_config.baseIRI;\n\t\tif(p_set_base_uri) {\n\t\t\tlet m_base_iri = R_BASE_IRI.exec(p_set_base_uri);\n\t\t\tthis._s_base_url = m_base_iri[1];\n\t\t\tthis._s_base_url_root = m_base_iri[2] || '';\n\t\t\tthis._s_base_url_scheme = m_base_iri[3] || '';\n\t\t\tthis._s_base_url_path = m_base_iri[4] || '';\n\t\t}\n\t\t// not set; 'url' variant is\n\t\telse if(g_config.base_url || g_config.baseUrl || g_config.baseURL) {\n\t\t\tthrow new Error(`invalid option: .base${g_config.base_url? '_url': g_config.baseUrl? 'Url': g_config.baseURL? 'URL': ''}; use the '.base_uri' key instead`);\n\t\t}\n\n\t\t// transform stream\n\t\tlet ds_transform = this.transform = new TriG_Reader({\n\t\t\t// on data event\n\t\t\ttransform: (s_chunk, s_encoding, fke_chunk) => {\n\t\t\t\t// concatenate current chunk to previous chunk\n\t\t\t\tlet s = this.s = this.pre + s_chunk;\n\n\t\t\t\t// cache chunk length\n\t\t\t\tthis.n = s.length;\n\n\t\t\t\t// eat whitespace before token and reset index\n\t\t\t\tif(this._b_trim_start) {\n\t\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\tR_WS.lastIndex = 0;\n\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\tthis.i = R_WS.lastIndex;\n\t\t\t\t}\n\t\t\t\t// do not eat whitespace; start at beginning\n\t\t\t\telse {\n\t\t\t\t\tthis.i = 0;\n\t\t\t\t}\n\n\t\t\t\t// resume parsing; no errors\n\t\t\t\tif(this.safe_parse(true)) {\n\t\t\t\t\t// emit progress event updates\n\t\t\t\t\tds_transform.emit('progress', s_chunk.length);\n\n\t\t\t\t\t// done transforming this chunk\n\t\t\t\t\tfke_chunk();\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// once there's no more data to consume, invoke eof\n\t\t\tflush: (fke_flush) => {\n\t\t\t\t// now that input stream has ended, clean up remainder\n\t\t\t\ttry {\n\t\t\t\t\tthis.eof(1);\n\t\t\t\t}\n\t\t\t\t// read error occurred\n\t\t\t\tcatch(e_eof) {\n\t\t\t\t\t// destroy self and stream\n\t\t\t\t\tthis.destroy(e_eof);\n\n\t\t\t\t\t// exit gracefully\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// no errors. done flushing, close read stream\n\t\t\t\tfke_flush();\n\t\t\t},\n\t\t});\n\n\t\t// when the writable side is piped into\n\t\tds_transform.on('pipe', (ds_input) => {\n\t\t\tthis._ds_input = ds_input;\n\n\t\t\tlet b_byte_tracking = this._b_byte_tracking;\n\n\t\t\t// byte-tracking is disable & input stream has encoding option; ensure stream encoding is utf8\n\t\t\tif(!b_byte_tracking && 'function' === typeof ds_input.setEncoding) {\n\t\t\t\tds_input.setEncoding('utf8');\n\t\t\t}\n\t\t\t// set decoding on write\n\t\t\telse {\n\t\t\t\tlet f_write = ds_transform.write;\n\t\t\t\tlet d_decoder = new string_decoder.StringDecoder('utf8');\n\n\t\t\t\tlet f_write_track = (s_chunk, s_encoding, fk_write) => {\n\t\t\t\t\t// TODO: optimize by testing for multibyte chars and using string length instead?\n\t\t\t\t\tlet nb_chunk = Buffer.from(s_chunk, 'utf8').length;\n\t\t\t\t\tthis._nb_seen += nb_chunk;\n\t\t\t\t\tthis._nb_last = nb_chunk;\n\t\t\t\t\treturn f_write.call(ds_transform, s_chunk, s_encoding, fk_write);\n\t\t\t\t};\n\n\t\t\t\tlet f_decode_write_track = (ab_chunk, s_encoding, fk_write) => {\n\t\t\t\t\tlet nb_chunk = this._nb_last = ab_chunk.length;\n\t\t\t\t\tthis._nb_seen += nb_chunk;\n\t\t\t\t\treturn f_write.call(ds_transform, d_decoder.write(ab_chunk), s_encoding, fk_write);\n\t\t\t\t};\n\n\t\t\t\tlet f_decode_write = (ab_chunk, s_encoding, fk_write) => f_write.call(ds_transform, d_decoder.write(ab_chunk), s_encoding, fk_write);\n\n\t\t\t\tds_transform.write = function(z_chunk, s_encoding, fk_write) {\n\t\t\t\t\t// not null\n\t\t\t\t\tif(null !== z_chunk) {\n\t\t\t\t\t\t// chunk is string; adapt by resetting method to original\n\t\t\t\t\t\tif('string' === typeof z_chunk) {\n\t\t\t\t\t\t\tds_transform.write = b_byte_tracking? f_write_track: f_write;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// chunk is buffer; adapt by setting decoder write method\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tds_transform.write = b_byte_tracking? f_decode_write_track: f_decode_write;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// use set method\n\t\t\t\t\t\treturn ds_transform.write(z_chunk, s_encoding, fk_write);\n\t\t\t\t\t}\n\n\t\t\t\t\t// null, use parent\n\t\t\t\t\treturn f_write.call(ds_transform, z_chunk, s_encoding, fk_write);\n\t\t\t\t};\n\n\t\t\t\t// byte tracking is enabled\n\t\t\t\tif(b_byte_tracking) {\n\t\t\t\t\t// overwrite emit_data method\n\t\t\t\t\tthis.emit_data = this.data = this.restore_data = function() {\n\t\t\t\t\t\tlet g_quad = this._dc_factory.quad(this._kt_subject, this._kt_predicate, this._kt_object, this._kt_graph);\n\t\t\t\t\t\tlet nb_post = Buffer.from(this.s.slice(this.i)).length;\n\t\t\t\t\t\tlet ib_post = this._nb_seen - nb_post;\n\t\t\t\t\t\tg_quad.byteRange = [this._nb_curr, ib_post];\n\t\t\t\t\t\tthis._nb_curr = ib_post;\n\t\t\t\t\t\tthis.transform.push(g_quad);\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// new listener added\n\t\tds_transform.on('newListener', (s_event) => {\n\t\t\t// comment\n\t\t\tif('comment' === s_event) {\n\t\t\t\tthis.emit_comments = (s_captured) => {\n\t\t\t\t\tlet a_comments = s_captured.slice(1).replace(/\\n\\s+$/, '').split(/\\n+\\s*#/g);\n\n\t\t\t\t\tfor(let s_comment of a_comments) {\n\t\t\t\t\t\tds_transform.emit('comment', s_comment);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\n\t\t// destroy\n\t\tds_transform._destroy = (...a_args) => {\n\t\t\tthis.destroy(...a_args);\n\t\t};\n\n\t\t// bind events to transform stream\n\t\tthis.bind(g_config);\n\n\t\t// input given\n\t\tif(g_input) {\n\t\t\t// input is stream\n\t\t\tif(g_input.stream) {\n\t\t\t\tlet ds_input = g_input.stream;\n\n\t\t\t\t// go async so caller has chance to bind event listeners\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tds_input.pipe(ds_transform);\n\t\t\t\t});\n\t\t\t}\n\t\t\t// string\n\t\t\telse if('string' === typeof g_input.string) {\n\t\t\t\tlet s_input = g_input.string;\n\n\t\t\t\t// go async so caller has chance to bind event listeners\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tds_transform.end(s_input, 'utf8');\n\t\t\t\t});\n\t\t\t}\n\t\t\t// invalid arg\n\t\t\telse {\n\t\t\t\tthrow new TypeError(`Invalid argument for input parameter: ${'object' === typeof g_input? JSON.stringify(g_input): g_input}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// begin parsing, keep applying until no more stack bail-outs\n\tsafe_parse() {\n\t\ttry {\n\t\t\tlet f_sync = this._f_state();\n\t\t\twhile('function' === typeof f_sync) {\n\t\t\t\tf_sync = f_sync.apply(this);\n\t\t\t}\n\t\t}\n\t\t// read error occurred\n\t\tcatch(e_read) {\n\t\t\t// destroy self and stream\n\t\t\tthis.destroy(e_read);\n\n\t\t\t// failure\n\t\t\treturn false;\n\t\t}\n\n\t\t// okay\n\t\treturn true;\n\t}\n\n\n\temit(s_event, ...a_args) {\n\t\tthis.transform.emit(s_event, ...a_args);\n\t}\n\n\tqueue(s_event, ...a_args) {\n\t\tthis._a_queue_event.push({\n\t\t\tevent: s_event,\n\t\t\targs: a_args,\n\t\t});\n\t}\n\n\terror(s_message) {\n\t\t// bail out\n\t\tthrow new Error(s_message);\n\t}\n\n\t// parse_error (not meant to be an event callback)\n\tparse_error(s_expected, b_eof=false) {\n\t\tlet i = this.i;\n\n\t\tlet i_off = Math.min(i, Math.abs(i-15));\n\n\t\tlet s = this.s;\n\n\t\treturn this.error(`\\n\\`${s.substr(i_off, i_off+90).replace(/[\\n\\t]/g, ' ')}\\`\\n`\n\t\t\t+` ${' '.repeat(i-i_off)}^\\n`\n\t\t\t+`expected ${s_expected} ${b_eof? 'but encountered <>': ''}. failed to parse a valid token starting at ${s[i]? '\"'+s[i]+'\"': '<>'}`);\n\t}\n\n\tinfo_error(s_message) {\n\t\tlet i = this.i;\n\n\t\tlet i_off = Math.min(i, Math.abs(i-15));\n\n\t\tlet s = this.s;\n\n\t\tthis.error(`\\n\\`${s.substr(i_off, i_off+90).replace(/[\\n\\t]/g, ' ')}\\`\\n`\n\t\t\t+` ${' '.repeat(i-i_off)}^\\n`\n\t\t\t+s_message);\n\t}\n\n\t// end of file\n\teof() {\n\t\t// there are events queued\n\t\tif(this._a_queue_event.length) {\n\t\t\tlet a_queue = this._a_queue_event;\n\n\t\t\t// drain event queue\n\t\t\twhile(a_queue.length) {\n\t\t\t\t// remove event from front of queue\n\t\t\t\tlet h_event = a_queue.shift();\n\n\t\t\t\t// make event callback\n\t\t\t\tthis[h_event.event](h_event.data);\n\t\t\t}\n\t\t}\n\n\t\t// invalid parsing state\n\t\tif(this.block !== this._f_state) {\n\t\t\t// append EOF char\n\t\t\tthis.s += '\\0';\n\n\t\t\t// exit \"flowing\" mode\n\t\t\tthis.n = this.s.length;\n\n\t\t\t// resume parsing; no errors\n\t\t\tif(this.safe_parse()) {\n\t\t\t\t// eof has occurred under safe parse\n\t\t\t\tif(null === this.s) return;\n\n\t\t\t\t// still invalid parsing state\n\t\t\t\tif(this.block !== this._f_state) {\n\t\t\t\t\treturn this.parse_error(this._f_state.name, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// there are still unparsed characters\n\t\tif(this.i < this.n) {\n\t\t\t// consume whitespace and comments\n\t\t\tlet s = this.s;\n\t\t\tlet i = this.i;\n\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\tR_WS.lastIndex = i;\n\t\t\tR_WS.exec(s);\n\t\t\ti = R_WS.lastIndex;\n\t\t\tR_COMMENT.lastIndex = i;\n\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t// advance beyond comment\n\t\t\tif(R_COMMENT.lastIndex > i) {\n\t\t\t\tthis.i = i = R_COMMENT.lastIndex;\n\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t}\n\n\t\t\t// still unparsed characters\n\t\t\tif(i < this.n) {\n\t\t\t\t// not EOF\n\t\t\t\tif(!(i === this.n - 1 && '\\0' === s[i])) {\n\t\t\t\t\t// bad input; parse error\n\t\t\t\t\treturn this.parse_error(this._f_state.name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// make buffer's alloc eligible for gc\n\t\tthis.s = null;\n\n\t\t// transform stream\n\t\tlet ds_transform = this.transform;\n\n\t\t// final progress update: no additional bytes were read\n\t\tds_transform.emit('progress', 0);\n\n\t\t// call end event listener\n\t\tds_transform.emit('eof', this._h_prefixes);\n\n\t\t// close write stream (EOF-signaling)\n\t\tds_transform.push(null);\n\t}\n\n\n\n\t// bind event listeners to transform stream\n\tbind(g_config) {\n\t\tlet ds_transform = this.transform;\n\t\tif(g_config.base) ds_transform.on('base', g_config.base);\n\t\tif(g_config.prefix) ds_transform.on('prefix', g_config.prefix);\n\t\tif(g_config.enter) ds_transform.on('enter', g_config.enter);\n\t\tif(g_config.exit) ds_transform.on('exit', g_config.exit);\n\t\tif(g_config.comment) ds_transform.on('comment', g_config.comment);\n\t\tif(g_config.error) ds_transform.on('error', g_config.error);\n\t\tif(g_config.read) ds_transform.once('read', g_config.read);\n\t\tif(g_config.progress) ds_transform.on('progress', g_config.progress);\n\t\tif(g_config.eof) ds_transform.once('eof', g_config.eof);\n\t\tif(g_config.end) ds_transform.once('end', g_config.end);\n\t\tif(g_config.finish) ds_transform.once('finish', g_config.finish);\n\t\tif(g_config.data) ds_transform.on('data', g_config.data);\n\t}\n\n\t// after a blank node subject (either property-list or colleciton)\n\tpost_blank_subject() {\n\t\tlet {s, i} = this;\n\t\tif('.' === s[i]) {\n\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\tR_WS.lastIndex = i+1;\n\t\t\tR_WS.exec(s);\n\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t// not inside block\n\t\t\tif(this._kt_default_graph === this._kt_graph) {\n\t\t\t\treturn this.block();\n\t\t\t}\n\t\t\t// inside block\n\t\t\telse {\n\t\t\t\treturn this.statement();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// prepare sticky regex index\n\t\t\tR_CHAR_CLOSE.lastIndex = i;\n\n\t\t\tif(R_CHAR_CLOSE.exec(s)) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_CHAR_CLOSE.lastIndex;\n\t\t\t\t// empty collection\n\t\t\t\tif(this._kt_rdf_nil.equals(this._kt_subject)) {\n\t\t\t\t\treturn this.error('empty collection');\n\t\t\t\t}\n\n\t\t\t\t// emit graph_close event\n\t\t\t\tthis.emit('exit', this._kt_graph);\n\n\t\t\t\t// reset graph\n\t\t\t\tthis._kt_graph = this._kt_default_graph;\n\n\t\t\t\t// goto block state\n\t\t\t\treturn this.block();\n\t\t\t}\n\t\t} // brace #1\n\n\t\treturn this.pairs();\n\t}\n\n\n\n\t// parse state for statement\n\tstatement() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n// prefixed name quick\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_PREFIXED_NAME_QUICK.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_pnq_subject = R_PREFIXED_NAME_QUICK.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_pnq_subject) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_PREFIXED_NAME_QUICK.lastIndex;\n\t\t\t\t// check valid prefix\n\t\t\t\tlet s_prefix_id = m_pnq_subject[1] || '';\n\t\t\t\t// invalid prefix\n\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t// commit subject iri from resolve prefixed name\n\t\t\t\tthis._kt_subject = this.prefixed_name(s_prefix_id, m_pnq_subject[2]);\n\n\t\t\t\t// predicate-object pairs state\n\t\t\t\treturn this.pairs();\n\n\t\t\t// iriref\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_iriref_e_subject = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_iriref_e_subject) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_IRIREF_ESCAPELESS.lastIndex;\n\n\t\t\t\t\t// ref iri\n\t\t\t\t\tlet s_iri = m_iriref_e_subject[1];\n\t\t\t\t\t// absolute iri\n\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t// set subject\n\t\t\t\t\t\tthis._kt_subject = this.check_named_node_escapeless(s_iri);\n\t\t\t\t\t}\n\t\t\t\t\t// relative iri\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis._kt_subject = this.check_named_node_escapeless(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t}\n\n\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\treturn this.pairs();\n\n\n\n\t\t\t\t// prefixed name\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// try match\n\t\t\t\t\tlet aw_valid_this_match_prefixed_name_escapeless = this.match_prefixed_name_escapeless(s, i);\n\t\t\t\t\t// stack bail out\n\t\t\t\t\tif(!aw_valid_this_match_prefixed_name_escapeless) return true;\n\t\t\t\t\tlet [m_prefixed_named_e_subject, im_prefixed_named_e_subject] = aw_valid_this_match_prefixed_name_escapeless;\n\t\t\t\t\tif(m_prefixed_named_e_subject) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\tthis.i = im_prefixed_named_e_subject;\n\n\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_e_subject[1] || '';\n\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t// make subject key\n\t\t\t\t\t\tthis._kt_subject = this.prefixed_name(s_prefix_id, m_prefixed_named_e_subject[2]);\n\n\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\treturn this.pairs();\n\n\t\t\t\t\t// blank node label\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\tR_BLANK_NODE_LABEL.lastIndex = i;\n\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\tlet m_blank_node_label_subject = R_BLANK_NODE_LABEL.exec(s);\n\n\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\tif(m_blank_node_label_subject) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\tthis.i = R_BLANK_NODE_LABEL.lastIndex;\n\t\t\t\t\t\t\t// extract label\n\t\t\t\t\t\t\tlet s_label = m_blank_node_label_subject[1];\n\n\t\t\t\t\t\t\t// make subject key\n\t\t\t\t\t\t\tthis._kt_subject = this.blank_node(s_label);\n\n\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\treturn this.pairs();\n\n\t\t\t\t\t\t// anonymous blank node subject\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\tR_ANONYMOUS_BLANK_NODE.lastIndex = i;\n\n\t\t\t\t\t\t\tif(R_ANONYMOUS_BLANK_NODE.exec(s)) {\n\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\tthis.i = R_ANONYMOUS_BLANK_NODE.lastIndex;\n\t\t\t\t\t\t\t\t// set new blank node as subject\n\t\t\t\t\t\t\t\tthis._kt_subject = this.anonymous_blank_node(this.next_label());\n\n\t\t\t\t\t\t\t\t// goto pairs state for inside property list\n\t\t\t\t\t\t\t\treturn this.pairs();\n\n\t\t\t\t\t\t\t// anonymous blank node property list subject\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\tR_CHAR_BLANK_NODE.lastIndex = i;\n\n\t\t\t\t\t\t\t\tif(R_CHAR_BLANK_NODE.exec(s)) {\n\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\tthis.i = R_CHAR_BLANK_NODE.lastIndex;\n\t\t\t\t\t\t\t\t\t// enter blank node\n\t\t\t\t\t\t\t\t\tthis._kt_subject = this.anonymous_blank_node(this.next_label());\n\n\t\t\t\t\t\t\t\t\t// how to resume when we pop state\n\t\t\t\t\t\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'post_blank_subject']);\n\n\t\t\t\t\t\t\t\t\t// goto pairs state for inside property list\n\t\t\t\t\t\t\t\t\treturn this.pairs();\n\n\t\t\t\t\t\t\t\t// rdf collection\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\tR_CHAR_COLLECTION.lastIndex = i;\n\n\t\t\t\t\t\t\t\t\tif(R_CHAR_COLLECTION.exec(s)) {\n\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\tthis.i = R_CHAR_COLLECTION.lastIndex;\n\t\t\t\t\t\t\t\t\t\t// indicate that collection subject should emit an initial statement\n\t\t\t\t\t\t\t\t\t\tthis._kt_subject = null;\n\n// (don't push state, we don't have a subject yet)\n\n\t\t\t\t\t\t\t\t\t\t// goto collection-subject state\n\t\t\t\t\t\t\t\t\t\treturn this.collection_subject();\n\n\n\t\t\t\t\t\t\t\t\t// closing graph '}'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\tR_CHAR_CLOSE.lastIndex = i;\n\n\t\t\t\t\t\t\t\t\t\tif(R_CHAR_CLOSE.exec(s)) {\n\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\tthis.i = R_CHAR_CLOSE.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t// emit graph_close event\n\t\t\t\t\t\t\t\t\t\t\tthis.emit('exit', this._kt_graph);\n\n\t\t\t\t\t\t\t\t\t\t\t// reset graph\n\t\t\t\t\t\t\t\t\t\t\tthis._kt_graph = this._kt_default_graph;\n\n\t\t\t\t\t\t\t\t\t\t\t// goto block state\n\t\t\t\t\t\t\t\t\t\t\treturn this.block();\n\n\t\t\t\t\t\t\t\t\t\t// iriref\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\t\tlet m_iriref_subject = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\t\tif(m_iriref_subject) {\n\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\n\t\t\t\t\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\t\t\t\t\tlet s_iri = m_iriref_subject[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// set subject\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.check_named_node(s_iri);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.check_named_node(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\t\t\t\t\t\treturn this.pairs();\n\n\t\t\t\t\t\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name = this.match_prefixed_name(s, i);\n\t\t\t\t\t\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name) return true;\n\t\t\t\t\t\t\t\t\t\t\t\tlet [m_prefixed_named_subject, im_prefixed_named_subject] = aw_valid_this_match_prefixed_name;\n\t\t\t\t\t\t\t\t\t\t\t\tif(m_prefixed_named_subject) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = im_prefixed_named_subject;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_subject[1] || '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// escape local escapes\n\t\t\t\t\t\t\t\t\t\t\t\t\tlet s_suffix = m_prefixed_named_subject[2]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.replace(R_PN_LOCAL_ESCAPES, '$1');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// make subject key\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.prefixed_name(s_prefix_id, s_suffix);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.pairs();\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t// comment\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t// not iriref, not prefixed name, not blank node label, not prefix id, not base\n\t\t\t// match counter: 10\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t} // brace #10\n\t\t\t\t\t\t\t\t\t\t\t} // brace #9\n\t\t\t\t\t\t\t\t\t\t} // brace #8\n\t\t\t\t\t\t\t\t\t} // brace #7\n\t\t\t\t\t\t\t\t} // brace #6\n\t\t\t\t\t\t\t} // brace #5\n\t\t\t\t\t\t} // brace #4\n\t\t\t\t\t} // brace #3\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('statement');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.statement;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for block\n\tblock() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// prepare sticky regex index\n\t\t\tR_GRAPH_IRI_ESCAPELESS.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_graph_iriref_e_graph = R_GRAPH_IRI_ESCAPELESS.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_graph_iriref_e_graph) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_GRAPH_IRI_ESCAPELESS.lastIndex;\n\n\t\t\t\t// ref iri\n\t\t\t\tlet s_iri = m_graph_iriref_e_graph[1];\n\t\t\t\t// absolute iri\n\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t// set graph\n\t\t\t\t\tthis._kt_graph = this.check_named_node_escapeless(s_iri);\n\t\t\t\t}\n\t\t\t\t// relative iri\n\t\t\t\telse {\n\t\t\t\t\tthis._kt_graph = this.check_named_node_escapeless(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t}\n\n\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t// statement state\n\t\t\t\treturn this.statement();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_GRAPH_PREFIXED_NAME.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_graph_prefixed_name = R_GRAPH_PREFIXED_NAME.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_graph_prefixed_name) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_GRAPH_PREFIXED_NAME.lastIndex;\n\t\t\t\t\t// check valid prefix\n\t\t\t\t\tlet s_prefix_id = m_graph_prefixed_name[1] || '';\n\t\t\t\t\t// invalid prefix\n\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t// make subject key\n\t\t\t\t\tthis._kt_graph = this.prefixed_name(s_prefix_id, m_graph_prefixed_name[2]);\n\n\t\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t\t// statement state\n\t\t\t\t\treturn this.statement();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_CHAR_OPEN.lastIndex = i;\n\n\t\t\t\t\tif(R_CHAR_OPEN.exec(s)) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\tthis.i = R_CHAR_OPEN.lastIndex;\n\t\t\t\t\t\t// make new default graph\n\t\t\t\t\t\tthis._kt_graph = this._dc_factory.defaultGraph();\n\n\t\t\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t\t\t// goto statement state\n\t\t\t\t\t\treturn this.statement();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\tR_GRAPH_ANONYMOUS_BLANK_NODE.lastIndex = i;\n\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\tlet m_graph_anonymous_blank_node = R_GRAPH_ANONYMOUS_BLANK_NODE.exec(s);\n\n\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\tif(m_graph_anonymous_blank_node) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\tthis.i = R_GRAPH_ANONYMOUS_BLANK_NODE.lastIndex;\n\t\t\t\t\t\t\t// make new label & set graph to blank node\n\t\t\t\t\t\t\tthis._kt_graph = this.anonymous_blank_node(this.next_label());\n\n\t\t\t\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t\t\t\t// statement state\n\t\t\t\t\t\t\treturn this.statement();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\tR_GRAPH_LABELED_BLANK_NODE.lastIndex = i;\n\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\tlet m_graph_labeled_blank_node = R_GRAPH_LABELED_BLANK_NODE.exec(s);\n\n\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\tif(m_graph_labeled_blank_node) {\n\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\tthis.i = R_GRAPH_LABELED_BLANK_NODE.lastIndex;\n\t\t\t\t\t\t\t\tlet s_label = m_graph_labeled_blank_node[1];\n\n\t\t\t\t\t\t\t\tthis._kt_graph = this.blank_node(s_label);\n\n\t\t\t\t\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t\t\t\t\t// statement state\n\t\t\t\t\t\t\t\treturn this.statement();\n\n\t\t\t\t\t\t\t// iriref\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\tlet m_iriref_e_graph_subject = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\tif(m_iriref_e_graph_subject) {\n\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\tthis.i = R_IRIREF_ESCAPELESS.lastIndex;\n\n\t\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\t\tlet s_iri = m_iriref_e_graph_subject[1];\n\t\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t\t// set subject\n\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.check_named_node_escapeless(s_iri);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.check_named_node_escapeless(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// graph or subject\n\t\t\t\t\t\t\t\t\treturn this.graph_or_subject();\n\n\n\n\t\t\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name_escapeless = this.match_prefixed_name_escapeless(s, i);\n\t\t\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name_escapeless) return true;\n\t\t\t\t\t\t\t\t\tlet [m_prefixed_named_e_subject, im_prefixed_named_e_subject] = aw_valid_this_match_prefixed_name_escapeless;\n\t\t\t\t\t\t\t\t\tif(m_prefixed_named_e_subject) {\n\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\tthis.i = im_prefixed_named_e_subject;\n\n\t\t\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_e_subject[1] || '';\n\t\t\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t\t\t// make subject key\n\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.prefixed_name(s_prefix_id, m_prefixed_named_e_subject[2]);\n\n\t\t\t\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\t\t\t\treturn this.graph_or_subject();\n\n\t\t\t\t\t\t\t\t\t// blank node label\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\tR_BLANK_NODE_LABEL.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\tlet m_blank_node_label_subject = R_BLANK_NODE_LABEL.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\tif(m_blank_node_label_subject) {\n\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\tthis.i = R_BLANK_NODE_LABEL.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t// extract label\n\t\t\t\t\t\t\t\t\t\t\tlet s_label = m_blank_node_label_subject[1];\n\n\t\t\t\t\t\t\t\t\t\t\t// make subject key\n\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.blank_node(s_label);\n\n\t\t\t\t\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\t\t\t\t\treturn this.graph_or_subject();\n\n\t\t\t\t\t\t\t\t\t\t// anonymous blank node subject\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\tR_ANONYMOUS_BLANK_NODE.lastIndex = i;\n\n\t\t\t\t\t\t\t\t\t\t\tif(R_ANONYMOUS_BLANK_NODE.exec(s)) {\n\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_ANONYMOUS_BLANK_NODE.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t// set new blank node as subject\n\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.anonymous_blank_node(this.next_label());\n\n\t\t\t\t\t\t\t\t\t\t\t\t// goto pairs state for inside property list\n\t\t\t\t\t\t\t\t\t\t\t\treturn this.graph_or_subject();\n\n\t\t\t\t\t\t\t\t\t\t\t// anonymous blank node property list subject\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\tR_CHAR_BLANK_NODE.lastIndex = i;\n\n\t\t\t\t\t\t\t\t\t\t\t\tif(R_CHAR_BLANK_NODE.exec(s)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_CHAR_BLANK_NODE.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// enter blank node\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.anonymous_blank_node(this.next_label());\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// how to resume when we pop state\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'post_blank_subject']);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// goto pairs state for inside property list\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.graph_or_subject_property_list();\n\n\t\t\t\t\t\t\t\t\t\t\t\t// rdf collection\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\t\tR_CHAR_COLLECTION.lastIndex = i;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(R_CHAR_COLLECTION.exec(s)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_CHAR_COLLECTION.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// indicate that collection subject should emit an initial statement\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = null;\n\n// (don't push state, we don't have a subject yet)\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// goto collection-subject state\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.collection_subject();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// prefix with interupt (e.g., a comment)\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tR_PREFIX_KEYWORD.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet m_prefix_keyword = R_PREFIX_KEYWORD.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(m_prefix_keyword) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_PREFIX_KEYWORD.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// save whether or not to expect a full stop\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._b_expecting_full_stop = !!m_prefix_keyword[1];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// goto prefix state\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.prefix_id();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// base with interupt (e.g., a comment)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tR_BASE_KEYWORD.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet m_base_keyword = R_BASE_KEYWORD.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(m_base_keyword) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_BASE_KEYWORD.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// save whether or not to expect a full stop\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._b_expecting_full_stop = !!m_base_keyword[1];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// goto base state\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.base_iri();\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// iriref\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet m_iriref_subject = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(m_iriref_subject) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet s_iri = m_iriref_subject[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// set subject\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.check_named_node(s_iri);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.check_named_node(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.graph_or_subject();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name = this.match_prefixed_name(s, i);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name) return true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet [m_prefixed_named_subject, im_prefixed_named_subject] = aw_valid_this_match_prefixed_name;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(m_prefixed_named_subject) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = im_prefixed_named_subject;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_subject[1] || '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// escape local escapes\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet s_suffix = m_prefixed_named_subject[2]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.replace(R_PN_LOCAL_ESCAPES, '$1');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// make subject key\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_subject = this.prefixed_name(s_prefix_id, s_suffix);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.graph_or_subject();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tR_GRAPH_IRI.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet m_graph_iriref_graph = R_GRAPH_IRI.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(m_graph_iriref_graph) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_GRAPH_IRI.lastIndex;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet s_iri = m_graph_iriref_graph[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// set graph\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_graph = this.check_named_node(s_iri);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_graph = this.check_named_node(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// statement state\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.statement();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// comment\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tR_GRAPH.lastIndex = i;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(R_GRAPH.exec(s)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.i = R_GRAPH.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn this.graph_keyword();\n\n\t\t\t\t// not iriref, not prefixed name, not blank node label, not prefix id, not base\n\t\t\t\t// match counter: 17\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} // brace #17\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} // brace #16\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} // brace #15\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} // brace #14\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} // brace #13\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} // brace #12\n\t\t\t\t\t\t\t\t\t\t\t\t\t} // brace #11\n\t\t\t\t\t\t\t\t\t\t\t\t} // brace #10\n\t\t\t\t\t\t\t\t\t\t\t} // brace #9\n\t\t\t\t\t\t\t\t\t\t} // brace #8\n\t\t\t\t\t\t\t\t\t} // brace #7\n\t\t\t\t\t\t\t\t} // brace #6\n\t\t\t\t\t\t\t} // brace #5\n\t\t\t\t\t\t} // brace #4\n\t\t\t\t\t} // brace #3\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('block');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.block;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for graph_or_subject\n\tgraph_or_subject() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\tlet x = s[i];\n\n\t\t\tif('{' === x) {\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\tR_WS.exec(s);\n\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t// shift placeholder subject\n\t\t\t\tthis._kt_graph = this._kt_subject;\n\n\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t// reset subject in case of collections\n\t\t\t\tthis._kt_subject = null;\n\n\t\t\t\t// statement state\n\t\t\t\treturn this.statement();\n\n\t\t\t// non-comment\n\t\t\t}\n\t\t\telse if('#' !== x) {\n\t\t\t\treturn this.pairs();\n\n\t\t\t// comment\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_comment) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// match counter: 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('graph_or_subject');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.graph_or_subject;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for graph_or_subject_property_list\n\tgraph_or_subject_property_list() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\tlet x = s[i];\n\n\t\t\tif(']' === x) {\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\tR_WS.exec(s);\n\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t// next state\n\t\t\t\treturn this.graph_or_subject_anon();\n\n\t\t\t// non-comment\n\t\t\t}\n\t\t\telse if('#' !== x) {\n\t\t\t\treturn this.pairs();\n\n\t\t\t// comment\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_comment) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// match counter: 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('graph_or_subject_property_list');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.graph_or_subject_property_list;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for graph_or_subject_anon\n\tgraph_or_subject_anon() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\tlet x = s[i];\n\n\t\t\tif('{' === x) {\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\tR_WS.exec(s);\n\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t// shift placeholder subject\n\t\t\t\tthis._kt_graph = this._kt_subject;\n\n\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t// reset subject in case of collections\n\t\t\t\tthis._kt_subject = null;\n\n\t\t\t\t// pop dummy state\n\t\t\t\tthis._a_nested.pop();\n\n\t\t\t\t// statement state\n\t\t\t\treturn this.statement();\n\n\t\t\t// non-comment\n\t\t\t}\n\t\t\telse if('#' !== x) {\n\t\t\t\treturn this.pairs();\n\n\t\t\t// comment\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_comment) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// match counter: 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('graph_or_subject_anon');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.graph_or_subject_anon;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for graph_keyword\n\tgraph_keyword() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// prefixed name\n\t\t\t// try match\n\t\t\tlet aw_valid_this_match_prefixed_name_escapeless = this.match_prefixed_name_escapeless(s, i);\n\t\t\t// stack bail out\n\t\t\tif(!aw_valid_this_match_prefixed_name_escapeless) return true;\n\t\t\tlet [m_prefixed_named_e_graph, im_prefixed_named_e_graph] = aw_valid_this_match_prefixed_name_escapeless;\n\t\t\tif(m_prefixed_named_e_graph) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = im_prefixed_named_e_graph;\n\n\t\t\t\t// check valid prefix\n\t\t\t\tlet s_prefix_id = m_prefixed_named_e_graph[1] || '';\n\t\t\t\t// invalid prefix\n\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t// make subject key\n\t\t\t\tthis._kt_graph = this.prefixed_name(s_prefix_id, m_prefixed_named_e_graph[2]);\n\n\t\t\t\t// predicate-object pairs state\n\t\t\t\treturn this.graph_post_name();\n\n\t\t\t// iriref\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_iriref_e_graph = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_iriref_e_graph) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_IRIREF_ESCAPELESS.lastIndex;\n\n\t\t\t\t\t// ref iri\n\t\t\t\t\tlet s_iri = m_iriref_e_graph[1];\n\t\t\t\t\t// absolute iri\n\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t// set graph\n\t\t\t\t\t\tthis._kt_graph = this.check_named_node_escapeless(s_iri);\n\t\t\t\t\t}\n\t\t\t\t\t// relative iri\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis._kt_graph = this.check_named_node_escapeless(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t}\n\n\t\t\t\t\t// graph\n\t\t\t\t\treturn this.graph_post_name();\n\n\t\t\t\t// blank node label\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_BLANK_NODE_LABEL.lastIndex = i;\n\t\t\t\t\t// execute regex\n\t\t\t\t\tlet m_blank_node_label_graph = R_BLANK_NODE_LABEL.exec(s);\n\n\t\t\t\t\t// regex was a match\n\t\t\t\t\tif(m_blank_node_label_graph) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\tthis.i = R_BLANK_NODE_LABEL.lastIndex;\n\t\t\t\t\t\t// extract label\n\t\t\t\t\t\tlet s_label = m_blank_node_label_graph[1];\n\n\t\t\t\t\t\t// make graph key\n\t\t\t\t\t\tthis._kt_graph = this.blank_node(s_label);\n\n\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\treturn this.graph_post_name();\n\n\t\t\t\t\t// anonymous blank node graph\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\tR_ANONYMOUS_BLANK_NODE.lastIndex = i;\n\n\t\t\t\t\t\tif(R_ANONYMOUS_BLANK_NODE.exec(s)) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\tthis.i = R_ANONYMOUS_BLANK_NODE.lastIndex;\n\t\t\t\t\t\t\t// set new blank node as graph\n\t\t\t\t\t\t\tthis._kt_graph = this.anonymous_blank_node(this.next_label());\n\n\t\t\t\t\t\t\t// goto pairs state for inside property list\n\t\t\t\t\t\t\treturn this.graph_post_name();\n\n\t\t\t\t\t\t// iriref\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\tlet m_iriref_graph = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\tif(m_iriref_graph) {\n\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\n\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\tlet s_iri = m_iriref_graph[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t// set graph\n\t\t\t\t\t\t\t\t\tthis._kt_graph = this.check_named_node(s_iri);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tthis._kt_graph = this.check_named_node(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\t\treturn this.graph_post_name();\n\n\t\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name = this.match_prefixed_name(s, i);\n\t\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name) return true;\n\t\t\t\t\t\t\t\tlet [m_prefixed_named_graph, im_prefixed_named_graph] = aw_valid_this_match_prefixed_name;\n\t\t\t\t\t\t\t\tif(m_prefixed_named_graph) {\n\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\tthis.i = im_prefixed_named_graph;\n\t\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_graph[1] || '';\n\t\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t\t// escape local escapes\n\t\t\t\t\t\t\t\t\tlet s_suffix = m_prefixed_named_graph[2]\n\t\t\t\t\t\t\t\t\t\t.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY)\n\t\t\t\t\t\t\t\t\t\t.replace(R_PN_LOCAL_ESCAPES, '$1');\n\n\t\t\t\t\t\t\t\t\t// make subject key\n\t\t\t\t\t\t\t\t\tthis._kt_graph = this.prefixed_name(s_prefix_id, s_suffix);\n\n\t\t\t\t\t\t\t\t\t// predicate-object pairs state\n\t\t\t\t\t\t\t\t\treturn this.graph_post_name();\n\n\t\t\t\t\t\t\t\t// comment\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t// not iriref, not prefixed name, not blank node label, not prefix id, not base\n\t\t\t\t// match counter: 6\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} // brace #6\n\t\t\t\t\t\t\t} // brace #5\n\t\t\t\t\t\t} // brace #4\n\t\t\t\t\t} // brace #3\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('graph_keyword');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.graph_keyword;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for graph_post_name\n\tgraph_post_name() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\tlet x = s[i];\n\n\t\t\tif('{' === x) {\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\tR_WS.exec(s);\n\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\tthis.emit('enter', this._kt_graph);\n\n\t\t\t\t// statement state\n\t\t\t\treturn this.statement();\n\n\t\t\t// comment\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_comment) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// match counter: 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('graph_post_name');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.graph_post_name;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for pairs\n\tpairs() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n// benchmarks indicate: regex for end of blank node property list faster than ch\n\n\n// iriref\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_iriref_e_predicate = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_iriref_e_predicate) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_IRIREF_ESCAPELESS.lastIndex;\n\n\t\t\t\t// ref iri\n\t\t\t\tlet s_iri = m_iriref_e_predicate[1];\n\t\t\t\t// absolute iri\n\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t// set predicate\n\t\t\t\t\tthis._kt_predicate = this.check_named_node_escapeless(s_iri);\n\t\t\t\t}\n\t\t\t\t// relative iri\n\t\t\t\telse {\n\t\t\t\t\tthis._kt_predicate = this.check_named_node_escapeless(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t}\n\n\t\t\t\t// object-list state\n\t\t\t\treturn this.object_list();\n\n\t\t\t// prefixed name\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// try match\n\t\t\t\tlet aw_valid_this_match_prefixed_name_escapeless = this.match_prefixed_name_escapeless(s, i);\n\t\t\t\t// stack bail out\n\t\t\t\tif(!aw_valid_this_match_prefixed_name_escapeless) return true;\n\t\t\t\tlet [m_prefixed_named_e_predicate, im_prefixed_named_e_predicate] = aw_valid_this_match_prefixed_name_escapeless;\n\t\t\t\tif(m_prefixed_named_e_predicate) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = im_prefixed_named_e_predicate;\n\t\t\t\t\t// check valid prefix\n\t\t\t\t\tlet s_prefix_id = m_prefixed_named_e_predicate[1] || '';\n\t\t\t\t\t// invalid prefix\n\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t// make predicate key\n\t\t\t\t\tthis._kt_predicate = this.prefixed_name(s_prefix_id, m_prefixed_named_e_predicate[2]);\n\n\t\t\t\t\t// object-list state\n\t\t\t\t\treturn this.object_list();\n\n\t\t\t\t// 'a'\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_A.lastIndex = i;\n\n\t\t\t\t\tif(R_A.exec(s)) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\tthis.i = R_A.lastIndex;\n\t\t\t\t\t\t// make predicate key\n\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_type;\n\n\t\t\t\t\t\t// object-list state\n\t\t\t\t\t\treturn this.object_list();\n\n\t\t\t\t\t// ']' end of blank node property list\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\tR_CHAR_KET.lastIndex = i;\n\n\t\t\t\t\t\tif(R_CHAR_KET.exec(s)) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\tthis.i = R_CHAR_KET.lastIndex;\n\t\t\t\t\t\t\tlet s_resume_state;\n\t\t\t\t\t\t\t[this._kt_subject, this._kt_predicate, s_resume_state] = this._a_nested.pop();\n\t\t\t\t\t\t\treturn this[s_resume_state]();\n\n\t\t\t\t\t\t// iriref\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\tlet m_iriref_predicate = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\tif(m_iriref_predicate) {\n\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\n\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\tlet s_iri = m_iriref_predicate[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t// set predicate\n\t\t\t\t\t\t\t\t\tthis._kt_predicate = this.check_named_node(s_iri);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tthis._kt_predicate = this.check_named_node(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// object-list state\n\t\t\t\t\t\t\t\treturn this.object_list();\n\n\t\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name = this.match_prefixed_name(s, i);\n\t\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name) return true;\n\t\t\t\t\t\t\t\tlet [m_prefixed_named_predicate, im_prefixed_named_predicate] = aw_valid_this_match_prefixed_name;\n\t\t\t\t\t\t\t\tif(m_prefixed_named_predicate) {\n\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\tthis.i = im_prefixed_named_predicate;\n\t\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_predicate[1] || '';\n\t\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t\t// escape local escapes\n\t\t\t\t\t\t\t\t\tlet s_suffix = m_prefixed_named_predicate[2]\n\t\t\t\t\t\t\t\t\t\t.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY)\n\t\t\t\t\t\t\t\t\t\t.replace(R_PN_LOCAL_ESCAPES, '$1');\n\n\t\t\t\t\t\t\t\t\t// make predicate key\n\t\t\t\t\t\t\t\t\tthis._kt_predicate = this.prefixed_name(s_prefix_id, s_suffix);\n\n\t\t\t\t\t\t\t\t\t// object-list state\n\t\t\t\t\t\t\t\t\treturn this.object_list();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t// not iriref, not prefixed name, not 'a'\n\t\t\t// match counter: 6\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} // brace #6\n\t\t\t\t\t\t\t} // brace #5\n\t\t\t\t\t\t} // brace #4\n\t\t\t\t\t} // brace #3\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('pairs');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.pairs;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for object_list\n\tobject_list() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// ref char\n\t\t\tlet x = s[i];\n\n\t\t\t// string literal * double\n\t\t\tif('\"' === x) {\n\t\t\t\t// enough chars to deduce type\n\t\t\t\tif((i+2) < n) {\n\t\t\t\t\t// long type\n\t\t\t\t\tif('\"' === s[i+1] && '\"' === s[i+2]) {\n\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\tthis.i = i + 3;\n\n\t\t\t\t\t\t// read contents\n\t\t\t\t\t\treturn this.string_literal_long_double();\n\t\t\t\t\t}\n\t\t\t\t\t// not long type\n\t\t\t\t\telse {\n\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t\t\t// read contents\n\t\t\t\t\t\treturn this.string_literal_short_double();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// enough chars to eliminate long type\n\t\t\t\telse if((i+1) < n && '\"' !== s[i+1]) {\n\t\t\t\t\t// advance index beyond token\n\t\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t\t// read contents\n\t\t\t\t\treturn this.string_literal_short_double();\n\t\t\t\t}\n\t\t\t\t// not enough chars to deduce type; retry next chunk\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t// prefixed name quick\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_PREFIXED_NAME_QUICK.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_pnq_object = R_PREFIXED_NAME_QUICK.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_pnq_object) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_PREFIXED_NAME_QUICK.lastIndex;\n\t\t\t\t\t// check valid prefix\n\t\t\t\t\tlet s_prefix_id = m_pnq_object[1] || '';\n\t\t\t\t\t// invalid prefix\n\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t// commit object iri from resolve prefixed name\n\t\t\t\t\tthis._kt_object = this.prefixed_name(s_prefix_id, m_pnq_object[2]);\n\n\t\t\t\t// iriref\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t\t\t// execute regex\n\t\t\t\t\tlet m_iriref_e_object = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t\t\t// regex was a match\n\t\t\t\t\tif(m_iriref_e_object) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\tthis.i = R_IRIREF_ESCAPELESS.lastIndex;\n\n\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\tlet s_iri = m_iriref_e_object[1];\n\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t// set object\n\t\t\t\t\t\t\tthis._kt_object = this.check_named_node_escapeless(s_iri);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis._kt_object = this.check_named_node_escapeless(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// prefixed name\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// try match\n\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name_escapeless = this.match_prefixed_name_escapeless(s, i);\n\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name_escapeless) return true;\n\t\t\t\t\t\tlet [m_prefixed_named_e_object, im_prefixed_named_e_object] = aw_valid_this_match_prefixed_name_escapeless;\n\t\t\t\t\t\tif(m_prefixed_named_e_object) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\tthis.i = im_prefixed_named_e_object;\n\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_e_object[1] || '';\n\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t// commit object iri from resolve prefixed name\n\t\t\t\t\t\t\tthis._kt_object = this.prefixed_name(s_prefix_id, m_prefixed_named_e_object[2]);\n\n\t\t\t\t\t\t// string literal * single\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \tif('\\'' === x) {\n\t\t\t\t\t\t\t// enough chars to deduce type\n\t\t\t\t\t\t\tif((i+2) < n) {\n\t\t\t\t\t\t\t\t// long type\n\t\t\t\t\t\t\t\tif(\"'\" === s[i+1] && \"'\" === s[i+2]) {\n\t\t\t\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\t\t\t\tthis.i = i + 3;\n\n\t\t\t\t\t\t\t\t\t// read contents\n\t\t\t\t\t\t\t\t\treturn this.string_literal_long_single();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// not long type\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t\t\t\t\t\t// read contents\n\t\t\t\t\t\t\t\t\treturn this.string_literal_short_single();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// enough chars to eliminate long type\n\t\t\t\t\t\t\telse if((i+1) < n && \"'\" !== s[i+1]) {\n\t\t\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t\t\t\t\t// read contents\n\t\t\t\t\t\t\t\treturn this.string_literal_short_single();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// not enough chars to deduce type; retry next chunk\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// numeric literal\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\tR_NUMERIC_LITERAL.lastIndex = i;\n\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\tlet m_numeric_literal = R_NUMERIC_LITERAL.exec(s);\n\n\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\tif(m_numeric_literal) {\n\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\tthis.i = R_NUMERIC_LITERAL.lastIndex;\n\t\t\t\t\t\t\t\t// it has exponent term, xsd:double\n\t\t\t\t\t\t\t\tif(m_numeric_literal[4]) {\n\t\t\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.double(m_numeric_literal[1]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// contains decimal point, xsd:decimal\n\t\t\t\t\t\t\t\telse if(m_numeric_literal[2] || m_numeric_literal[3]) {\n\t\t\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.decimal(m_numeric_literal[1]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// otherwise, it is an integer\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.integer(m_numeric_literal[1]);\n\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t// boolean literal\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\tR_BOOLEAN_LITERAL.lastIndex = i;\n\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\tlet m_boolean_literal = R_BOOLEAN_LITERAL.exec(s);\n\n\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\tif(m_boolean_literal) {\n\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\tthis.i = R_BOOLEAN_LITERAL.lastIndex;\n\t\t\t\t\t\t\t\t\t// make literal\n\t\t\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.boolean(!!m_boolean_literal[1]);\n\n\n\t\t\t\t\t\t\t\t// blank node property list\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse \tif('[' === x) {\n\t\t\t\t// advance index to next token\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t\t\t\t\t\t// make object\n\t\t\t\t\t\t\t\t\tlet kt_blank_node = this._kt_object = this.anonymous_blank_node(this.next_label());\n\n\t\t\t\t\t\t\t\t\t// emit statement event\n\t\t\t\t\t\t\t\t\tthis.data();\n\n\n\t\t\t\t\t\t\t\t\t// push state to stack\n\t\t\t\t\t\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'post_object']);\n\n\t\t\t\t\t\t\t\t\t// set new subject\n\t\t\t\t\t\t\t\t\tthis._kt_subject = kt_blank_node;\n\n\t\t\t\t\t\t\t\t\t// goto parsing pairs state\n\t\t\t\t\t\t\t\t\treturn this.pairs();\n\n\t\t\t\t\t\t\t\t// labeled blank node\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\tR_BLANK_NODE_LABEL_TERMINAL.lastIndex = i;\n\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\tlet m_blank_node_label_object = R_BLANK_NODE_LABEL_TERMINAL.exec(s);\n\n\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\tif(m_blank_node_label_object) {\n\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\tthis.i = R_BLANK_NODE_LABEL_TERMINAL.lastIndex;\n\t\t\t\t\t\t\t\t\t\t// ref blank node label\n\t\t\t\t\t\t\t\t\t\tlet s_label = m_blank_node_label_object[1];\n\n\t\t\t\t\t\t\t\t\t\t// make object\n\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.blank_node(s_label);\n\n\t\t\t\t\t\t\t\t\t// collection\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse \tif('(' === x) {\n\t\t\t\t// advance index to next token\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\t\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\t\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\t\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t\t\t\t\t\t\t// state to resume after collection ends\n\t\t\t\t\t\t\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'post_object']);\n\n\t\t\t\t\t\t\t\t\t\t// goto collection-object state\n\t\t\t\t\t\t\t\t\t\treturn this.collection_object();\n\n\t\t\t\t\t\t\t\t\t// iriref\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\tlet m_iriref_object = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\tif(m_iriref_object) {\n\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\n\t\t\t\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\t\t\t\tlet s_iri = m_iriref_object[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t\t\t\t// set object\n\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.check_named_node(s_iri);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.check_named_node(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name = this.match_prefixed_name(s, i);\n\t\t\t\t\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name) return true;\n\t\t\t\t\t\t\t\t\t\t\tlet [m_prefixed_named_object, im_prefixed_named_object] = aw_valid_this_match_prefixed_name;\n\t\t\t\t\t\t\t\t\t\t\tif(m_prefixed_named_object) {\n\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\tthis.i = im_prefixed_named_object;\n\t\t\t\t\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_object[1] || '';\n\t\t\t\t\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t// escape local escapes\n\t\t\t\t\t\t\t\t\t\t\t\tlet s_suffix = m_prefixed_named_object[2]\n\t\t\t\t\t\t\t\t\t\t\t\t\t.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.replace(R_PN_LOCAL_ESCAPES, '$1');\n\n\t\t\t\t\t\t\t\t\t\t\t\t// commit object iri from resolve prefixed name\n\t\t\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.prefixed_name(s_prefix_id, s_suffix);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t// not iriref, not prefixed name, not string literal, not numeric literal, not boolean literal, not blank node property list, not collection\n\t\t\t// match counter: 9\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} // brace #9\n\t\t\t\t\t\t\t\t\t\t} // brace #8\n\t\t\t\t\t\t\t\t\t} // brace #7\n\t\t\t\t\t\t\t\t} // brace #6\n\t\t\t\t\t\t\t} // brace #5\n\t\t\t\t\t\t} // brace #4\n\t\t\t\t\t} // brace #3\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\n\n\t\t\t// fall through for cases that did not change state on their own\n\t\t\t// at this point, a new statement has been parsed\n\t\t\tthis.data();\n\n\n\t\t\t// goto next parsing state; bail out of stack\n\t\t\treturn this.after_end_of_statement;\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('object_list');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.object_list;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for string_literal_short_double\n\tstring_literal_short_double() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\tstring_literal_short_double: while(i < n) { // eslint-disable-line no-unmodified-loop-condition\n// something breaks string in this chunk\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_STRLIT_SHORT_DOUBLE_BREAK.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_break = R_STRLIT_SHORT_DOUBLE_BREAK.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_break) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_STRLIT_SHORT_DOUBLE_BREAK.lastIndex;\n\t\t\t\t// index of break\n\t\t\t\tlet i_break = m_break.index;\n\n\t\t\t\t// add to contents\n\t\t\t\tthis._s_literal += s.slice(i, i_break);\n\n\t\t\t\t// depending on char\n\t\t\t\tswitch(s[i_break]) {\n\t\t\t\t\t// terminator\n\t\t\t\t\tcase '\"': {\n\t\t\t\t\t// advance index to next token beyond delimiter\n\t\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\tR_WS.lastIndex = i_break + 1;\n\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t\t\t// resume eating whitespace at start of next chunk\n\t\t\t\t\t\tthis._b_trim_start = true;\n\n\t\t\t\t\t\t// consume rest\n\t\t\t\t\t\treturn this.datatype_or_langtag();\n\t\t\t\t\t}\n\n\t\t\t\t\t// escape\n\t\t\t\t\tcase '\\\\': {\n\t\t\t\t\t\t// try to find end\n\t\t\t\t\t\tR_STRLIT_SHORT_DOUBLE_TERM.lastIndex = i_break;\n\t\t\t\t\t\tlet m_term = R_STRLIT_SHORT_DOUBLE_TERM.exec(s);\n\n\t\t\t\t\t\t// end is in this chunk\n\t\t\t\t\t\tif(m_term) {\n\t\t\t\t\t\t\t// index of terminator\n\t\t\t\t\t\t\tlet i_term = m_term.index;\n\n\t\t\t\t\t\t\t// extract dirty potion\n\t\t\t\t\t\t\tlet s_dirty = s.slice(i_break, i_term);\n\n\t\t\t\t\t\t\t// clean and save\n\t\t\t\t\t\t\tthis._s_literal += unescape_literal_short_hard(s_dirty);\n\n\t\t\t\t\t\t\t// advance index beyond terminator\n\t\t\t\t\t\t\tthis.i = i_term + m_term[0].length;\n\n\t\t\t\t\t\t\t// resume eating whitespace at start of next chunk\n\t\t\t\t\t\t\tthis._b_trim_start = true;\n\n\t\t\t\t\t\t\t// consume rest\n\t\t\t\t\t\t\treturn this.datatype_or_langtag();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// end is not in this chunk\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// extract whole portion\n\t\t\t\t\t\t\tlet s_dirty = s.slice(i_break);\n\n\t\t\t\t\t\t\t// unescape to clean part\n\t\t\t\t\t\t\tlet [s_clean, s_incomplete] = unescape_literal_short_soft(s_dirty);\n\n\t\t\t\t\t\t\t// save\n\t\t\t\t\t\t\tthis._s_literal += s_clean;\n\n\t\t\t\t\t\t\t// set unparsed index\n\t\t\t\t\t\t\ti = n - s_incomplete.length;\n\n\t\t\t\t\t\t\t// reached eos; pause normally\n\t\t\t\t\t\t\tbreak string_literal_short_double;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// invalid '\\n'\n\t\t\t\t\tcase '\\n': {\n\t\t\t\t\t\treturn this.info_error(`expected string_literal_short_double but invalid line feed character '\\\\n' (newline) within contents. failed to parse a valid token`);\n\t\t\t\t\t}\n\n\t\t\t\t\t// invalid '\\r'\n\t\t\t\t\tcase '\\r': {\n\t\t\t\t\t\treturn this.info_error(`expected string_literal_short_double but invalid form feed character '\\\\r' (carriage return) within contents. failed to parse a valid token`);\n\t\t\t\t\t}\n\n\t\t\t\t\t// invalid\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tconsole.assert(`Unhandle invalid character ${JSON.stringify(s[i_break])} case for string_literal_short_double`);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t// no terminator and nothing to escape\n\t\t// match counter: 0\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// save\n\t\t\t\tthis._s_literal += i? s.slice(i): s;\n\n\t\t\t\t// set unparsed index\n\t\t\t\ti = n;\n\n\t\t\t\t// reached eos; pause normally\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// do not eat whitespace at start of next chunk\n\t\tthis._b_trim_start = false;\n\n\t// ran out of characters\n\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('string_literal_short_double');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.string_literal_short_double;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for string_literal_short_single\n\tstring_literal_short_single() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\tstring_literal_short_single: while(i < n) { // eslint-disable-line no-unmodified-loop-condition\n// something breaks string in this chunk\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_STRLIT_SHORT_SINGLE_BREAK.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_break = R_STRLIT_SHORT_SINGLE_BREAK.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_break) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_STRLIT_SHORT_SINGLE_BREAK.lastIndex;\n\t\t\t\t// index of break\n\t\t\t\tlet i_break = m_break.index;\n\n\t\t\t\t// add to contents\n\t\t\t\tthis._s_literal += s.slice(i, i_break);\n\n\t\t\t\t// depending on char\n\t\t\t\tswitch(s[i_break]) {\n\t\t\t\t\t// terminator\n\t\t\t\t\tcase \"'\": {\n\t\t\t\t\t// advance index to next token beyond delimiter\n\t\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\tR_WS.lastIndex = i_break + 1;\n\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t\t\t// resume eating whitespace at start of next chunk\n\t\t\t\t\t\tthis._b_trim_start = true;\n\n\t\t\t\t\t\t// consume rest\n\t\t\t\t\t\treturn this.datatype_or_langtag();\n\t\t\t\t\t}\n\n\t\t\t\t\t// escape\n\t\t\t\t\tcase '\\\\': {\n\t\t\t\t\t\t// try to find end\n\t\t\t\t\t\tR_STRLIT_SHORT_SINGLE_TERM.lastIndex = i_break;\n\t\t\t\t\t\tlet m_term = R_STRLIT_SHORT_SINGLE_TERM.exec(s);\n\n\t\t\t\t\t\t// end is in this chunk\n\t\t\t\t\t\tif(m_term) {\n\t\t\t\t\t\t\t// index of terminator\n\t\t\t\t\t\t\tlet i_term = m_term.index;\n\n\t\t\t\t\t\t\t// extract dirty potion\n\t\t\t\t\t\t\tlet s_dirty = s.slice(i_break, i_term);\n\n\t\t\t\t\t\t\t// clean and save\n\t\t\t\t\t\t\tthis._s_literal += unescape_literal_short_hard(s_dirty);\n\n\t\t\t\t\t\t\t// advance index beyond terminator\n\t\t\t\t\t\t\tthis.i = i_term + m_term[0].length;\n\n\t\t\t\t\t\t\t// resume eating whitespace at start of next chunk\n\t\t\t\t\t\t\tthis._b_trim_start = true;\n\n\t\t\t\t\t\t\t// consume rest\n\t\t\t\t\t\t\treturn this.datatype_or_langtag();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// end is not in this chunk\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// extract whole portion\n\t\t\t\t\t\t\tlet s_dirty = s.slice(i_break);\n\n\t\t\t\t\t\t\t// unescape to clean part\n\t\t\t\t\t\t\tlet [s_clean, s_incomplete] = unescape_literal_short_soft(s_dirty);\n\n\t\t\t\t\t\t\t// save\n\t\t\t\t\t\t\tthis._s_literal += s_clean;\n\n\t\t\t\t\t\t\t// set unparsed index\n\t\t\t\t\t\t\ti = n - s_incomplete.length;\n\n\t\t\t\t\t\t\t// reached eos; pause normally\n\t\t\t\t\t\t\tbreak string_literal_short_single;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// invalid '\\n'\n\t\t\t\t\tcase '\\n': {\n\t\t\t\t\t\treturn this.info_error(`expected string_literal_short_single but invalid line feed character '\\\\n' (newline) within contents. failed to parse a valid token`);\n\t\t\t\t\t}\n\n\t\t\t\t\t// invalid '\\r'\n\t\t\t\t\tcase '\\r': {\n\t\t\t\t\t\treturn this.info_error(`expected string_literal_short_single but invalid form feed character '\\\\r' (carriage return) within contents. failed to parse a valid token`);\n\t\t\t\t\t}\n\n\t\t\t\t\t// invalid\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tconsole.assert(`Unhandle invalid character ${JSON.stringify(s[i_break])} case for string_literal_short_single`);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t// no terminator and nothing to escape\n\t\t// match counter: 0\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// save\n\t\t\t\tthis._s_literal += i? s.slice(i): s;\n\n\t\t\t\t// set unparsed index\n\t\t\t\ti = n;\n\n\t\t\t\t// reached eos; pause normally\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// do not eat whitespace at start of next chunk\n\t\tthis._b_trim_start = false;\n\n\t// ran out of characters\n\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('string_literal_short_single');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.string_literal_short_single;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for string_literal_long_double\n\tstring_literal_long_double() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\tstring_literal_long_double: while(i < n) { // eslint-disable-line no-unmodified-loop-condition\n// something breaks string in this chunk\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_STRLIT_LONG_DOUBLE_BREAK.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_break = R_STRLIT_LONG_DOUBLE_BREAK.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_break) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_STRLIT_LONG_DOUBLE_BREAK.lastIndex;\n\t\t\t\t// index of break\n\t\t\t\tlet i_break = m_break.index;\n\n\t\t\t\t// add to contents\n\t\t\t\tthis._s_literal += s.slice(i, i_break);\n\n\t\t\t\t// depending on char\n\t\t\t\tswitch(s[i_break]) {\n\t\t\t\t\t// terminator\n\t\t\t\t\tcase '\"': {\n\t\t\t\t\t// advance index to next token beyond delimiter\n\t\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\tR_WS.lastIndex = i_break + 3;\n\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t\t\t// resume eating whitespace at start of next chunk\n\t\t\t\t\t\tthis._b_trim_start = true;\n\n\t\t\t\t\t\t// consume rest\n\t\t\t\t\t\treturn this.datatype_or_langtag();\n\t\t\t\t\t}\n\n\t\t\t\t\t// escape\n\t\t\t\t\tcase '\\\\': {\n\t\t\t\t\t\t// try to find end\n\t\t\t\t\t\tR_STRLIT_LONG_DOUBLE_TERM.lastIndex = i_break;\n\t\t\t\t\t\tlet m_term = R_STRLIT_LONG_DOUBLE_TERM.exec(s);\n\n\t\t\t\t\t\t// end is in this chunk\n\t\t\t\t\t\tif(m_term) {\n\t\t\t\t\t\t\t// index of terminator\n\t\t\t\t\t\t\tlet i_term = m_term.index;\n\n\t\t\t\t\t\t\t// extract dirty potion\n\t\t\t\t\t\t\tlet s_dirty = s.slice(i_break, i_term);\n\n\t\t\t\t\t\t\t// clean and save\n\t\t\t\t\t\t\tthis._s_literal += unescape_literal_long_hard(s_dirty);\n\n\t\t\t\t\t\t\t// advance index beyond terminator\n\t\t\t\t\t\t\tthis.i = i_term + m_term[0].length;\n\n\t\t\t\t\t\t\t// resume eating whitespace at start of next chunk\n\t\t\t\t\t\t\tthis._b_trim_start = true;\n\n\t\t\t\t\t\t\t// consume rest\n\t\t\t\t\t\t\treturn this.datatype_or_langtag();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// end is not in this chunk\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// extract whole portion\n\t\t\t\t\t\t\tlet s_dirty = s.slice(i_break);\n\n\t\t\t\t\t\t\t// unescape to clean part\n\t\t\t\t\t\t\tlet [s_clean, s_incomplete] = unescape_literal_long_soft(s_dirty);\n\n\t\t\t\t\t\t\t// save\n\t\t\t\t\t\t\tthis._s_literal += s_clean;\n\n\t\t\t\t\t\t\t// set unparsed index\n\t\t\t\t\t\t\ti = n - s_incomplete.length;\n\n\t\t\t\t\t\t\t// reached eos; pause normally\n\t\t\t\t\t\t\tbreak string_literal_long_double;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// invalid\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tconsole.assert(`Unhandle invalid character ${JSON.stringify(s[i_break])} case for string_literal_long_double`);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t// no terminator and nothing to escape\n\t\t// match counter: 0\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// could be unfinished terminator\n\t\t\t\tR_STRLIT_LONG_DOUBLE_UNFINISHED_TERM.lastIndex = i;\n\t\t\t\tlet m_unfinished = R_STRLIT_LONG_DOUBLE_UNFINISHED_TERM.exec(s);\n\n\t\t\t\t// unfinished terminator\n\t\t\t\tif(m_unfinished) {\n\t\t\t\t\t// save valid portion\n\t\t\t\t\tthis._s_literal += s.slice(i, m_unfinished.index);\n\n\t\t\t\t\t// set unparsed index\n\t\t\t\t\ti = m_unfinished.index;\n\t\t\t\t}\n\t\t\t\t// not unfinished\n\t\t\t\telse {\n\t\t\t\t\t// save\n\t\t\t\t\tthis._s_literal += i? s.slice(i): s;\n\n\t\t\t\t\t// set unparsed index\n\t\t\t\t\ti = n;\n\t\t\t\t}\n\n\t\t\t\t// reached eos; pause normally\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// do not eat whitespace at start of next chunk\n\t\tthis._b_trim_start = false;\n\n\t// ran out of characters\n\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('string_literal_long_double');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.string_literal_long_double;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for string_literal_long_single\n\tstring_literal_long_single() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\tstring_literal_long_single: while(i < n) { // eslint-disable-line no-unmodified-loop-condition\n// something breaks string in this chunk\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_STRLIT_LONG_SINGLE_BREAK.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_break = R_STRLIT_LONG_SINGLE_BREAK.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_break) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_STRLIT_LONG_SINGLE_BREAK.lastIndex;\n\t\t\t\t// index of break\n\t\t\t\tlet i_break = m_break.index;\n\n\t\t\t\t// add to contents\n\t\t\t\tthis._s_literal += s.slice(i, i_break);\n\n\t\t\t\t// depending on char\n\t\t\t\tswitch(s[i_break]) {\n\t\t\t\t\t// terminator\n\t\t\t\t\tcase \"'\": {\n\t\t\t\t\t// advance index to next token beyond delimiter\n\t\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\tR_WS.lastIndex = i_break + 3;\n\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t\t\t// resume eating whitespace at start of next chunk\n\t\t\t\t\t\tthis._b_trim_start = true;\n\n\t\t\t\t\t\t// consume rest\n\t\t\t\t\t\treturn this.datatype_or_langtag();\n\t\t\t\t\t}\n\n\t\t\t\t\t// escape\n\t\t\t\t\tcase '\\\\': {\n\t\t\t\t\t\t// try to find end\n\t\t\t\t\t\tR_STRLIT_LONG_SINGLE_TERM.lastIndex = i_break;\n\t\t\t\t\t\tlet m_term = R_STRLIT_LONG_SINGLE_TERM.exec(s);\n\n\t\t\t\t\t\t// end is in this chunk\n\t\t\t\t\t\tif(m_term) {\n\t\t\t\t\t\t\t// index of terminator\n\t\t\t\t\t\t\tlet i_term = m_term.index;\n\n\t\t\t\t\t\t\t// extract dirty potion\n\t\t\t\t\t\t\tlet s_dirty = s.slice(i_break, i_term);\n\n\t\t\t\t\t\t\t// clean and save\n\t\t\t\t\t\t\tthis._s_literal += unescape_literal_long_hard(s_dirty);\n\n\t\t\t\t\t\t\t// advance index beyond terminator\n\t\t\t\t\t\t\tthis.i = i_term + m_term[0].length;\n\n\t\t\t\t\t\t\t// resume eating whitespace at start of next chunk\n\t\t\t\t\t\t\tthis._b_trim_start = true;\n\n\t\t\t\t\t\t\t// consume rest\n\t\t\t\t\t\t\treturn this.datatype_or_langtag();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// end is not in this chunk\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// extract whole portion\n\t\t\t\t\t\t\tlet s_dirty = s.slice(i_break);\n\n\t\t\t\t\t\t\t// unescape to clean part\n\t\t\t\t\t\t\tlet [s_clean, s_incomplete] = unescape_literal_long_soft(s_dirty);\n\n\t\t\t\t\t\t\t// save\n\t\t\t\t\t\t\tthis._s_literal += s_clean;\n\n\t\t\t\t\t\t\t// set unparsed index\n\t\t\t\t\t\t\ti = n - s_incomplete.length;\n\n\t\t\t\t\t\t\t// reached eos; pause normally\n\t\t\t\t\t\t\tbreak string_literal_long_single;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// invalid\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tconsole.assert(`Unhandle invalid character ${JSON.stringify(s[i_break])} case for string_literal_long_single`);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t// no terminator and nothing to escape\n\t\t// match counter: 0\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// could be unfinished terminator\n\t\t\t\tR_STRLIT_LONG_SINGLE_UNFINISHED_TERM.lastIndex = i;\n\t\t\t\tlet m_unfinished = R_STRLIT_LONG_SINGLE_UNFINISHED_TERM.exec(s);\n\n\t\t\t\t// unfinished terminator\n\t\t\t\tif(m_unfinished) {\n\t\t\t\t\t// save valid portion\n\t\t\t\t\tthis._s_literal += s.slice(i, m_unfinished.index);\n\n\t\t\t\t\t// set unparsed index\n\t\t\t\t\ti = m_unfinished.index;\n\t\t\t\t}\n\t\t\t\t// not unfinished\n\t\t\t\telse {\n\t\t\t\t\t// save\n\t\t\t\t\tthis._s_literal += i? s.slice(i): s;\n\n\t\t\t\t\t// set unparsed index\n\t\t\t\t\ti = n;\n\t\t\t\t}\n\n\t\t\t\t// reached eos; pause normally\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// do not eat whitespace at start of next chunk\n\t\tthis._b_trim_start = false;\n\n\t// ran out of characters\n\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('string_literal_long_single');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.string_literal_long_single;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for string_literal\n\tstring_literal() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// ref character\n\t\t\tlet x = s[i];\n\n\t\t\t// string literal * double\n\t\t\tif('\"' === x) {\n\t\t\t\t// enough chars to deduce type\n\t\t\t\tif((i+2) < n) {\n\t\t\t\t\t// long type\n\t\t\t\t\tif('\"' === s[i+1] && '\"' === s[i+2]) {\n\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\tthis.i = i + 3;\n\n\t\t\t\t\t\t// read contents\n\t\t\t\t\t\treturn this.string_literal_long_double();\n\t\t\t\t\t}\n\t\t\t\t\t// not long type\n\t\t\t\t\telse {\n\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t\t\t// read contents\n\t\t\t\t\t\treturn this.string_literal_short_double();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// enough chars to eliminate long type\n\t\t\t\telse if((i+1) < n && '\"' !== s[i+1]) {\n\t\t\t\t\t// advance index beyond token\n\t\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t\t// read contents\n\t\t\t\t\treturn this.string_literal_short_double();\n\t\t\t\t}\n\t\t\t\t// not enough chars to deduce type; retry next chunk\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t// string literal * single\n\t\t\t}\n\t\t\telse \tif('\\'' === x) {\n\t\t\t\t// enough chars to deduce type\n\t\t\t\tif((i+2) < n) {\n\t\t\t\t\t// long type\n\t\t\t\t\tif(\"'\" === s[i+1] && \"'\" === s[i+2]) {\n\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\tthis.i = i + 3;\n\n\t\t\t\t\t\t// read contents\n\t\t\t\t\t\treturn this.string_literal_long_single();\n\t\t\t\t\t}\n\t\t\t\t\t// not long type\n\t\t\t\t\telse {\n\t\t\t\t\t\t// advance index beyond token\n\t\t\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t\t\t// read contents\n\t\t\t\t\t\treturn this.string_literal_short_single();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// enough chars to eliminate long type\n\t\t\t\telse if((i+1) < n && \"'\" !== s[i+1]) {\n\t\t\t\t\t// advance index beyond token\n\t\t\t\t\tthis.i = i + 1;\n\n\t\t\t\t\t// read contents\n\t\t\t\t\treturn this.string_literal_short_single();\n\t\t\t\t}\n\t\t\t\t// not enough chars to deduce type; retry next chunk\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t// not string literal long single quote, not string literal single quote\n\t\t\t// match counter: 0\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_string_length) {\n\t\t\t\t\treturn this.parse_error('string_literal');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.string_literal;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for datatype_or_langtag\n\tdatatype_or_langtag() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// ref character\n\t\t\tlet x = s[i];\n\n\t\t\t// next token indicates datatype or langtag\n\t\t\tif('^' === x || '@' === x) {\n// '^^' datatype\n\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_DOUBLE_CARET.lastIndex = i;\n\n\t\t\t\tif(R_DOUBLE_CARET.exec(s)) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_DOUBLE_CARET.lastIndex;\n\t\t\t\t\treturn this.datatype();\n\n\t\t\t\t// '@' language tag\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_LANGTAG.lastIndex = i;\n\t\t\t\t\t// execute regex\n\t\t\t\t\tlet m_langtag = R_LANGTAG.exec(s);\n\n\t\t\t\t\t// regex was a match\n\t\t\t\t\tif(m_langtag) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\tthis.i = R_LANGTAG.lastIndex;\n\t\t\t\t\t\tthis._kt_object = this._dc_factory.languagedLiteral(this._s_literal, m_langtag[1]);\n\n\t\t\t\t\t\t// reset literal\n\t\t\t\t\t\tthis._s_literal = '';\n\n\t\t\t\t// next token definitely datatype or langtag, we are just being interrupted by eos\n\t\t\t\t// match counter: 1\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} // brace #1\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_comment) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// match counter: 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis._kt_object = this._dc_factory.simpleLiteral(this._s_literal);\n\n\t\t\t\t\t// reset literal\n\t\t\t\t\tthis._s_literal = '';\n\n\t\t\t\t// not datatype, not language tag => that's okay! those are optional\n\t\t\t\t}\n\t\t\t} // brace #1\n\n\n\t\t\t// goto end of statement state\n\t\t\t// at this point, a new statement has been parsed\n\t\t\tthis.data();\n\n\n\t\t\t// goto next parsing state; bail out of stack\n\t\t\treturn this.after_end_of_statement;\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('datatype_or_langtag');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.datatype_or_langtag;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for datatype\n\tdatatype() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\tlet kt_datatype = null;\n\n// prefixed name quick\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_PREFIXED_NAME_QUICK.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_pnq_datatype = R_PREFIXED_NAME_QUICK.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_pnq_datatype) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_PREFIXED_NAME_QUICK.lastIndex;\n\t\t\t\t// check valid prefix\n\t\t\t\tlet s_prefix_id = m_pnq_datatype[1] || '';\n\t\t\t\t// invalid prefix\n\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t// commit object iri from resolve prefixed name\n\t\t\t\tkt_datatype = this.prefixed_name(s_prefix_id, m_pnq_datatype[2]);\n\n\t\t\t// iriref\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_iriref_e_datatype = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_iriref_e_datatype) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_IRIREF_ESCAPELESS.lastIndex;\n\t\t\t\t\tlet p_datatype;\n\n\t\t\t\t\t// ref iri\n\t\t\t\t\tlet s_iri = m_iriref_e_datatype[1];\n\t\t\t\t\t// absolute iri\n\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t// set p_datatype\n\t\t\t\t\t\tp_datatype = s_iri;\n\t\t\t\t\t}\n\t\t\t\t\t// relative iri\n\t\t\t\t\telse {\n\t\t\t\t\t\tp_datatype = uri.resolve(this._s_base_url, s_iri);\n\t\t\t\t\t}\n\n\t\t\t\t\tkt_datatype = this.check_named_node_escapeless(p_datatype);\n\n\t\t\t\t// prefixed name\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// try match\n\t\t\t\t\tlet aw_valid_this_match_prefixed_name_escapeless = this.match_prefixed_name_escapeless(s, i);\n\t\t\t\t\t// stack bail out\n\t\t\t\t\tif(!aw_valid_this_match_prefixed_name_escapeless) return true;\n\t\t\t\t\tlet [m_prefixed_named_e_datatype, im_prefixed_named_e_datatype] = aw_valid_this_match_prefixed_name_escapeless;\n\t\t\t\t\tif(m_prefixed_named_e_datatype) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\tthis.i = im_prefixed_named_e_datatype;\n\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_e_datatype[1] || '';\n\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\tkt_datatype = this.prefixed_name(s_prefix_id, m_prefixed_named_e_datatype[2]);\n\n\t\t\t\t\t// iriref\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\tlet m_iriref_datatype = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\tif(m_iriref_datatype) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\t\t\t\t\t\t\tlet p_datatype;\n\n\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\tlet s_iri = m_iriref_e_datatype[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t// set p_datatype\n\t\t\t\t\t\t\t\tp_datatype = s_iri;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tp_datatype = uri.resolve(this._s_base_url, s_iri);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tkt_datatype = this.check_named_node(p_datatype);\n\n\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name = this.match_prefixed_name(s, i);\n\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name) return true;\n\t\t\t\t\t\t\tlet [m_prefixed_named_datatype, im_prefixed_named_datatype] = aw_valid_this_match_prefixed_name;\n\t\t\t\t\t\t\tif(m_prefixed_named_datatype) {\n\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\tthis.i = im_prefixed_named_datatype;\n\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_datatype[1] || '';\n\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t// escape local escapes\n\t\t\t\t\t\t\t\tlet s_suffix = m_prefixed_named_datatype[2]\n\t\t\t\t\t\t\t\t\t.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY)\n\t\t\t\t\t\t\t\t\t.replace(R_PN_LOCAL_ESCAPES, '$1');\n\n\t\t\t\t\t\t\t\t// set literal datatype\n\t\t\t\t\t\t\t\tkt_datatype = this.prefixed_name(s_prefix_id, s_suffix);\n\n\t\t\t// not iriref, not prefixed name\n\t\t\t// match counter: 4\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // brace #4\n\t\t\t\t\t} // brace #3\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\n\n\t\t\tthis._kt_object = this._dc_factory.datatypedLiteral(this._s_literal, kt_datatype);\n\n\t\t\t// reset literal\n\t\t\tthis._s_literal = '';\n\n\t\t\t// goto end of statement state\n\t\t\t// at this point, a new statement has been parsed\n\t\t\tthis.data();\n\n\n\t\t\t// goto next parsing state; bail out of stack\n\t\t\treturn this.after_end_of_statement;\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('datatype');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.datatype;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for post_object\n\tpost_object() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\tlet i_reset = i;\n\n\t\t\t// benchmarks confirm: character ref faster than regexes in this context\n\t\t\tlet x = s[i];\n\n\t\t\t// advance index to next token beyond delimiter\n\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\tR_WS.lastIndex = i+1;\n\t\t\tR_WS.exec(s);\n\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t// ',' more objects\n\t\t\tif(',' === x) {\n\t\t\t\treturn this.object_list();\n\n\t\t\t// ';' more predicate-object pairs\n\t\t\t}\n\t\t\telse \tif(';' === x) {\n\t\t\t\tfor(;;) {\n\t\t\t\t\t// next token is end of outer section\n\t\t\t\t\tlet s_peek = s[this.i];\n\t\t\t\t\tif('.' === s_peek || ']' === s_peek || ';' === s_peek || '}' === s_peek) {\n\t\t\t\t\t\t// goto post_object state\n\t\t\t\t\t\treturn this.post_object();\n\t\t\t\t\t}\n\t\t\t\t\t// comment\n\t\t\t\t\telse if('#' === s_peek) {\n\t\t\t\t\t\t// comment\n\t\t\t\t\t\ti = this.i;\n\n\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\tthis.i = R_COMMENT.lastIndex;\n\t\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t\t// retry\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t// no eol to close comment (yet)\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// already consumed\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// eos\n\t\t\t\t\telse if(this.i === n) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// something else\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn this.pairs();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// rather than pushing a dedicated state, just try again next chunk\n\t\t\t\ti = i_reset;\n\t\t\t\tbreak;\n\n\t\t\t// '.' end of statement\n\t\t\t}\n\t\t\telse \tif('.' === x) {\n\t\t\t\t// assert not nested\n\t\t\t\tif(this._a_nested.length) {\n\t\t\t\t\t// reset index to that character\n\t\t\t\t\tthis.i = i;\n\n\t\t\t\t\t// emit parse error\n\t\t\t\t\treturn this.parse_error('end_of_property_list');\n\t\t\t\t}\n\n\t\t\t\treturn (this._kt_default_graph === this._kt_graph)? this.block(): this.statement();\n\n\t\t\t// ']' end of property-object pairs\n\t\t\t}\n\t\t\telse \tif(']' === x) {\n\t\t\t\tlet s_resume_state;\n\t\t\t\t[this._kt_subject, this._kt_predicate, s_resume_state] = this._a_nested.pop();\n\t\t\t\treturn this[s_resume_state]();\n\n\t\t\t// ')' end of collection\n\t\t\t}\n\t\t\telse \tif(')' === x) {\n\t\t\t\t// should not be here\n\t\t\t\treturn Reader$syntax_error(this, i, 'post_object', 'but encountered end of collection');\n\n\t\t\t// closing graph '}'\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_CHAR_CLOSE.lastIndex = i;\n\n\t\t\t\tif(R_CHAR_CLOSE.exec(s)) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_CHAR_CLOSE.lastIndex;\n\t\t\t\t\t// emit graph_close event\n\t\t\t\t\tthis.emit('exit', this._kt_graph);\n\n\t\t\t\t\t// reset graph\n\t\t\t\t\tthis._kt_graph = this._kt_default_graph;\n\n\t\t\t\t\treturn this.block();\n\n\t\t\t\t// comment\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t// execute regex\n\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t// regex was a match\n\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t// do not change state\n\t\t\t\t\t\tcontinue;\n\n\t\t\t// comment interrupted by eos?\n\t\t\t// match counter: 2\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('post_object');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.post_object;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for base_iri\n\tbase_iri() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n// prefix id\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_iriref_e_base = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_iriref_e_base) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_IRIREF_ESCAPELESS.lastIndex;\n\n\t\t\t\t// ref iri\n\t\t\t\tlet s_iri = m_iriref_e_base[1];\n\t\t\t\t// absolute iri\n\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t// set base_url\n\t\t\t\t\tthis._s_base_url = s_iri;\n\t\t\t\t}\n\t\t\t\t// relative iri\n\t\t\t\telse {\n\t\t\t\t\tthis._s_base_url = uri.resolve(this._s_base_url, s_iri);\n\t\t\t\t}\t\tlet m_base_iri = R_BASE_IRI.exec(this._s_base_url);\n\t\t\t\tthis._s_base_url = m_base_iri[1];\n\t\t\t\tthis._s_base_url_root = m_base_iri[2] || '';\n\t\t\t\tthis._s_base_url_scheme = m_base_iri[3] || '';\n\t\t\t\tthis._s_base_url_path = m_base_iri[4] || '';\n\n\n\t\t\t\t// emit base event\n\t\t\t\tthis.emit('base', this._s_base_url);\n\n\t\t\t\tif(this._b_expecting_full_stop) {\n\t\t\t\t\t// change state\n\t\t\t\t\treturn this.full_stop();\n\t\t\t\t}\n\n\t\t\t\t// goto prefix iri state\n\t\t\t\treturn this.block();\n\n\t\t\t// prefix id\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_iriref_base = R_IRIREF.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_iriref_base) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\n\t\t\t\t\t// ref iri\n\t\t\t\t\tlet s_iri = m_iriref_base[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t// absolute iri\n\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t// set base_url\n\t\t\t\t\t\tthis._s_base_url = s_iri;\n\t\t\t\t\t}\n\t\t\t\t\t// relative iri\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis._s_base_url = uri.resolve(this._s_base_url, s_iri);\n\t\t\t\t\t}\t\tlet m_base_iri = R_BASE_IRI.exec(this._s_base_url);\n\t\t\t\t\tthis._s_base_url = m_base_iri[1];\n\t\t\t\t\tthis._s_base_url_root = m_base_iri[2] || '';\n\t\t\t\t\tthis._s_base_url_scheme = m_base_iri[3] || '';\n\t\t\t\t\tthis._s_base_url_path = m_base_iri[4] || '';\n\n\n\t\t\t\t\t// emit base event\n\t\t\t\t\tthis.emit('base', this._s_base_url);\n\n\t\t\t\t\tif(this._b_expecting_full_stop) {\n\t\t\t\t\t\t// change state\n\t\t\t\t\t\treturn this.full_stop();\n\t\t\t\t\t}\n\n\t\t\t\t\t// goto prefix iri state\n\t\t\t\t\treturn this.block();\n\n\t\t\t\t// for poorly-placed comments\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t// execute regex\n\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t// regex was a match\n\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t// do not change state\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t// match counter: 2\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('base_iri');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.base_iri;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for prefix_id\n\tprefix_id() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n// prefix id\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_PREFIX_ID.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_prefix_id = R_PREFIX_ID.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_prefix_id) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_PREFIX_ID.lastIndex;\n\t\t\t\t// set temp prefix id\n\t\t\t\tthis._s_temp_prefix_id = m_prefix_id[1];\n\n\t\t\t\t// goto prefix iri state\n\t\t\t\treturn this.prefix_iri();\n\n\t\t\t// for poorly-placed comments\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_comment) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t// do not change state\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// match counter: 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('prefix_id');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.prefix_id;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for prefix_iri\n\tprefix_iri() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\tlet h_prefixes = this._h_prefixes;\n\t\t\tlet s_prefix_id = this._s_temp_prefix_id;\n\t\t\tlet p_prefix_iri;\n\n// prefix iri\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_iriref_e_prefix = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_iriref_e_prefix) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_IRIREF_ESCAPELESS.lastIndex;\n\n\t\t\t\t// ref iri\n\t\t\t\tlet s_iri = m_iriref_e_prefix[1];\n\t\t\t\t// absolute iri\n\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t// set p_prefix_iri\n\t\t\t\t\tp_prefix_iri = s_iri;\n\t\t\t\t}\n\t\t\t\t// relative iri\n\t\t\t\telse {\n\t\t\t\t\tp_prefix_iri = uri.resolve(this._s_base_url, s_iri);\n\t\t\t\t}\n\n\t\t\t\tlet b_relax = this._b_relax;\n\n// existing mapping\n\n\t\t\t\tif(s_prefix_id in h_prefixes) {\n\t\t\t\t\t// doesn't match existing\n\t\t\t\t\tif(p_prefix_iri !== h_prefixes[s_prefix_id]) {\n\t\t\t\t\t\t// emit change event\n\t\t\t\t\t\tif(this.prefix_change) {\n\t\t\t\t\t\t\tthis.prefix_change(s_prefix_id, h_prefixes[s_prefix_id], p_prefix_iri);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// update prefix\n\t\t\t\t\t\th_prefixes[s_prefix_id] = p_prefix_iri;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// first mapping\n\t\t\t\telse {\n\t\t\t\t\t// check namespace, invalid\n\t\t\t\t\tif(!b_relax && !RT_PREFIXED_NAME_NAMESPACE_VALID.test(s_prefix_id)) {\n\t\t\t\t\t\treturn this.error(`Invalid namespace for prefixed name: \"${s_prefix_id}:\"`);\n\t\t\t\t\t}\n\n\t\t\t\t\t// set prefix\n\t\t\t\t\th_prefixes[s_prefix_id] = p_prefix_iri;\n\t\t\t\t}\n\n\t\t\t\t// check iri, invalid\n\t\t\t\tif(!b_relax && !RT_NAMED_NODE_VALID.test(p_prefix_iri)) {\n\t\t\t\t\treturn this.error(`Invalid IRI found in prefix delcaration: \"${s_iri}\"`);\n\t\t\t\t}\n\n\t\t\t\t// emit prefix event\n\t\t\t\tthis.event('prefix', s_prefix_id, p_prefix_iri);\n\n\t\t\t\tif(this._b_expecting_full_stop) {\n\t\t\t\t\t// change state\n\t\t\t\t\treturn this.full_stop();\n\t\t\t\t}\n\n\t\t\t\t// goto statement state\n\t\t\t\treturn this.block();\n\n\t\t\t// prefix iri\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_iriref_prefix = R_IRIREF.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_iriref_prefix) {\n\t\t\t\t\t// advance index\n\t\t\t\t\tthis.i = R_IRIREF.lastIndex;\n\n\t\t\t\t\t// ref iri\n\t\t\t\t\tlet s_iri = m_iriref_prefix[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t// absolute iri\n\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t// set p_prefix_iri\n\t\t\t\t\t\tp_prefix_iri = s_iri;\n\t\t\t\t\t}\n\t\t\t\t\t// relative iri\n\t\t\t\t\telse {\n\t\t\t\t\t\tp_prefix_iri = uri.resolve(this._s_base_url, s_iri);\n\t\t\t\t\t}\n\n\t\t\t\t\tlet b_relax = this._b_relax;\n\n// existing mapping\n\n\t\t\t\t\tif(s_prefix_id in h_prefixes) {\n\t\t\t\t\t\t// doesn't match existing\n\t\t\t\t\t\tif(p_prefix_iri !== h_prefixes[s_prefix_id]) {\n\t\t\t\t\t\t\t// emit change event\n\t\t\t\t\t\t\tif(this.prefix_change) {\n\t\t\t\t\t\t\t\tthis.prefix_change(s_prefix_id, h_prefixes[s_prefix_id], p_prefix_iri);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// update prefix\n\t\t\t\t\t\t\th_prefixes[s_prefix_id] = p_prefix_iri;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// first mapping\n\t\t\t\t\telse {\n\t\t\t\t\t\t// check namespace, invalid\n\t\t\t\t\t\tif(!b_relax && !RT_PREFIXED_NAME_NAMESPACE_VALID.test(s_prefix_id)) {\n\t\t\t\t\t\t\treturn this.error(`Invalid namespace for prefixed name: \"${s_prefix_id}:\"`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// set prefix\n\t\t\t\t\t\th_prefixes[s_prefix_id] = p_prefix_iri;\n\t\t\t\t\t}\n\n\t\t\t\t\t// check iri, invalid\n\t\t\t\t\tif(!b_relax && !RT_NAMED_NODE_VALID.test(p_prefix_iri)) {\n\t\t\t\t\t\treturn this.error(`Invalid IRI found in prefix delcaration: \"${s_iri}\"`);\n\t\t\t\t\t}\n\n\t\t\t\t\t// emit prefix event\n\t\t\t\t\tthis.event('prefix', s_prefix_id, p_prefix_iri);\n\n\t\t\t\t\tif(this._b_expecting_full_stop) {\n\t\t\t\t\t\t// change state\n\t\t\t\t\t\treturn this.full_stop();\n\t\t\t\t\t}\n\n\t\t\t\t\t// goto statement state\n\t\t\t\t\treturn this.block();\n\n\t\t\t\t// for poorly-placed comments\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t// execute regex\n\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t// regex was a match\n\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t// do not change state\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t// match counter: 2\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('prefix_iri');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.prefix_iri;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n// in case eos happens twice during prefix / base (extremely unlikely)\n\n\n\t// parse state for full_stop\n\tfull_stop() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// prepare sticky regex index\n\t\t\tR_CHAR_STOP.lastIndex = i;\n\n\t\t\tif(R_CHAR_STOP.exec(s)) {\n\t\t\t\t// advance index\n\t\t\t\tthis.i = R_CHAR_STOP.lastIndex;\n\t\t\t\t// resume statement\n\t\t\t\treturn this.block();\n\n\t\t\t// poorly-placed comment\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// prepare sticky regex index\n\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t// execute regex\n\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t// regex was a match\n\t\t\t\tif(m_comment) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t// try again\n\t\t\t\t\tcontinue;\n\n\t\t\t// possibly interrupted by eos\n\t\t\t// match counter: 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} // brace #1\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('full_stop');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.full_stop;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for collection_subject\n\tcollection_subject() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// ref char\n\t\t\tlet x = s[i];\n\n\t\t\t// end of collection\n\t\t\tif(')' === x) {\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\tR_WS.exec(s);\n\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t// no items in collection subject\n\t\t\t\tif(null === this._kt_subject) {\n\t\t\t\t\t// prepare subject\n\t\t\t\t\tthis._kt_subject = this._kt_rdf_nil;\n\n\t\t\t\t\t// state was never pushed to stack, jump to post_subject state\n\t\t\t\t\treturn this.post_blank_subject();\n\t\t\t\t}\n// otherwise, there must be items in collection\n\n\t\t\t\t// commit collection end\n\t\t\t\tthis._kt_object = this._kt_rdf_nil;\n\t\t\t\tthis.data();\n\n\n\t\t\t\t// restore state from stack\n\t\t\t\tlet s_resume_state;\n\t\t\t\t[this._kt_subject, this._kt_predicate, s_resume_state] = this._a_nested.pop();\n\t\t\t\treturn this[s_resume_state]();\n\t\t\t}\n\n\n\n\t\t\t// otherwise, pre-emptively secure the next blank node label\n\t\t\tlet s_pointer_label;\n\n\t\t\t// very first collection object\n\t\t\tlet b_pushed = false;\n\t\t\tif(null === this._kt_subject) {\n\t\t\t\t// set quasi subject (really for resume state)\n\t\t\t\ts_pointer_label = this.next_label();\n\t\t\t\tthis._kt_subject = this.anonymous_blank_node(s_pointer_label);\n\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'pairs']);\n\t\t\t\t// reset subject for later conditional branch\n\t\t\t\tthis._kt_subject = null;\n\t\t\t\tb_pushed = true;\n\t\t\t}\n\n// iriref\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_iriref_e_object = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_iriref_e_object) {\n\t\t\t\t// advance index\n\t\t\t\ti = R_IRIREF_ESCAPELESS.lastIndex;\n\n\t\t\t\t// ref iri\n\t\t\t\tlet s_iri = m_iriref_e_object[1];\n\t\t\t\t// absolute iri\n\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t// set object\n\t\t\t\t\tthis._kt_object = this.check_named_node_escapeless(s_iri);\n\t\t\t\t}\n\t\t\t\t// relative iri\n\t\t\t\telse {\n\t\t\t\t\tthis._kt_object = this.check_named_node_escapeless(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t}\n\n\t\t\t// prefixed name\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// try match\n\t\t\t\tlet aw_valid_this_match_prefixed_name_escapeless = this.match_prefixed_name_escapeless(s, i);\n\t\t\t\t// stack bail out\n\t\t\t\tif(!aw_valid_this_match_prefixed_name_escapeless) return true;\n\t\t\t\tlet [m_prefixed_named_e_object, im_prefixed_named_e_object] = aw_valid_this_match_prefixed_name_escapeless;\n\t\t\t\tif(m_prefixed_named_e_object) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = im_prefixed_named_e_object;\n\t\t\t\t\t// check valid prefix\n\t\t\t\t\tlet s_prefix_id = m_prefixed_named_e_object[1] || '';\n\t\t\t\t\t// invalid prefix\n\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t// commit object iri from resolve prefixed name\n\t\t\t\t\tthis._kt_object = this.prefixed_name(s_prefix_id, m_prefixed_named_e_object[2]);\n\n\t\t\t\t// string literal\n\t\t\t\t}\n\t\t\t\telse \tif('\"' === x || '\\'' === x) {\n\t\t\t\t\t// first item in list\n\t\t\t\t\tif(null === this._kt_subject) {\n\t\t\t\t\t\ts_pointer_label = this.next_label();\n\t\t\t\t\t\tthis._kt_subject = this.anonymous_blank_node(s_pointer_label);\n\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\t\t\t\t\t}\n\t\t\t\t\t// not first item in list\n\t\t\t\t\telse {\n\t\t\t\t\t\t// make nest list item\n\t\t\t\t\t\ts_pointer_label = this.next_label();\n\t\t\t\t\t\tlet kt_blank_node = this._kt_object = this.anonymous_blank_node(s_pointer_label);\n\t\t\t\t\t\tthis.data();\n\n\n\t\t\t\t\t\t// setup for object literal\n\t\t\t\t\t\tthis._kt_subject = kt_blank_node;\n\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\t\t\t\t\t}\n\n\t\t\t\t\t// how to resume collection subject state after object literal\n\t\t\t\t\tthis.after_end_of_statement = function() {\n\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_rest;\n\t\t\t\t\t\tthis.after_end_of_statement = this.post_object;\n\t\t\t\t\t\treturn this.collection_subject();\n\t\t\t\t\t};\n\t\t\t\t\treturn this.string_literal();\n\n\t\t\t\t// numeric literal\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_NUMERIC_LITERAL.lastIndex = i;\n\t\t\t\t\t// execute regex\n\t\t\t\t\tlet m_numeric_literal = R_NUMERIC_LITERAL.exec(s);\n\n\t\t\t\t\t// regex was a match\n\t\t\t\t\tif(m_numeric_literal) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\ti = R_NUMERIC_LITERAL.lastIndex;\n\t\t\t\t\t\t// it has exponent term, xsd:double\n\t\t\t\t\t\tif(m_numeric_literal[4]) {\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.double(m_numeric_literal[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// contains decimal point, xsd:decimal\n\t\t\t\t\t\telse if(m_numeric_literal[2] || m_numeric_literal[3]) {\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.decimal(m_numeric_literal[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// otherwise, it is an integer\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.integer(m_numeric_literal[1]);\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t// boolean literal\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\tR_BOOLEAN_LITERAL.lastIndex = i;\n\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\tlet m_boolean_literal = R_BOOLEAN_LITERAL.exec(s);\n\n\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\tif(m_boolean_literal) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\ti = R_BOOLEAN_LITERAL.lastIndex;\n\t\t\t\t\t\t\t// make literal\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.boolean(!!m_boolean_literal[1]);\n\n\t\t\t\t\t\t// blank node property list\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \tif('[' === x) {\n\t\t\t\t// advance index to next token\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t\t\t\t// this blank node is just the next item in the list\n\t\t\t\t\t\t\ts_pointer_label = this.next_label();\n\t\t\t\t\t\t\tlet kt_blank_node;\n\t\t\t\t\t\t\tif(null !== this._kt_subject) {\n\t\t\t\t\t\t\t\tkt_blank_node = this._kt_object = this.anonymous_blank_node(s_pointer_label);\n\t\t\t\t\t\t\t\tthis.data();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// subject needs to be set\n\t\t\t\t\t\t\tthis._kt_subject = kt_blank_node || this.anonymous_blank_node(s_pointer_label);\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\t\t\t\t\t\t\tlet s_label = this.next_label();\n\t\t\t\t\t\t\tkt_blank_node = this._kt_object = this.anonymous_blank_node(s_label);\n\t\t\t\t\t\t\tthis.data();\n\n\n\t\t\t\t\t\t\t// when resume\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_rest;\n\n\t\t\t\t\t\t\t// push state\n\t\t\t\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'collection_subject']);\n\n\t\t\t\t\t\t\t// prepare next triple\n\t\t\t\t\t\t\tthis._kt_subject = kt_blank_node;\n\n\t\t\t\t\t\t\t// goto parsing pairs state\n\t\t\t\t\t\t\treturn this.pairs();\n\n\t\t\t\t\t\t// new collection\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \tif('(' === x) {\n\t\t\t\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\t\ti = R_WS.lastIndex;\n\n\t\t\t\t\t\t\t// empty collection\n\t\t\t\t\t\t\tif(')' === s[i]) {\n\t\t\t\t\t\t\t\tthis.i = i;\n\t\t\t\t\t\t\t\tthis._kt_subject = this._a_nested[this._a_nested.length-1][0];\n\t\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\t\t\t\t\t\t\t\tthis._a_nested.push([\n\t\t\t\t\t\t\t\t\tthis._kt_subject,\n\t\t\t\t\t\t\t\t\tthis._kt_rdf_rest,\n\t\t\t\t\t\t\t\t\t'collection_subject',\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t\treturn this.collection_object();\n\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t// commit list item pointer\n\t\t\t\t\t\t\ts_pointer_label = this.next_label();\n\t\t\t\t\t\t\tlet kt_blank_node = this._kt_object = this.anonymous_blank_node(s_pointer_label);\n\t\t\t\t\t\t\tthis.data();\n\n\n\t\t\t\t\t\t\t// add this list as an item to the outer list\n\t\t\t\t\t\t\tthis._kt_subject = kt_blank_node;\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_rest;\n\t\t\t\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'collection_object']);\n\n\t\t\t\t\t\t\t// prepare next triple\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\n\n\n\t\t\t\t\t\t\t// flowing\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t// labeled blank node\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\tR_BLANK_NODE_LABEL.lastIndex = i;\n\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\tlet m_blank_node_label_object = R_BLANK_NODE_LABEL.exec(s);\n\n\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\tif(m_blank_node_label_object) {\n\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\ti = R_BLANK_NODE_LABEL.lastIndex;\n\t\t\t\t\t\t\t\t// ref blank node label\n\t\t\t\t\t\t\t\tlet s_label = m_blank_node_label_object[1];\n\n\t\t\t\t\t\t\t\t// make object\n\t\t\t\t\t\t\t\tthis._kt_object = this.blank_node(s_label);\n\n\t\t\t\t\t\t\t// iriref\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\tlet m_iriref_object = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\tif(m_iriref_object) {\n\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\ti = R_IRIREF.lastIndex;\n\n\t\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\t\tlet s_iri = m_iriref_object[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t\t// set object\n\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.check_named_node(s_iri);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.check_named_node(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name = this.match_prefixed_name(s, i);\n\t\t\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name) return true;\n\t\t\t\t\t\t\t\t\tlet [m_prefixed_named_object, im_prefixed_named_object] = aw_valid_this_match_prefixed_name;\n\t\t\t\t\t\t\t\t\tif(m_prefixed_named_object) {\n\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\ti = im_prefixed_named_object;\n\t\t\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_object[1] || '';\n\t\t\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t\t\t// escape local escapes\n\t\t\t\t\t\t\t\t\t\tlet s_suffix = m_prefixed_named_object[2]\n\t\t\t\t\t\t\t\t\t\t\t.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY)\n\t\t\t\t\t\t\t\t\t\t\t.replace(R_PN_LOCAL_ESCAPES, '$1');\n\n\t\t\t\t\t\t\t\t\t\t// commit object iri from resolve prefixed name\n\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.prefixed_name(s_prefix_id, s_suffix);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t// not iriref, not prefixed name, not string literal, not numeric literal, not boolean literal, not blank node property list, not collection\n\t\t\t// match counter: 7\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t// ran out of characters after pushing state, pop it\n\t\t\t\t\t\t\t\t\t\t\tif(b_pushed) this._a_nested.pop();\n\n\t\t\t\t\t\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} // brace #7\n\t\t\t\t\t\t\t\t} // brace #6\n\t\t\t\t\t\t\t} // brace #5\n\t\t\t\t\t\t} // brace #4\n\t\t\t\t\t} // brace #3\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\n\n\t\t\tlet kt_blank_node_outer;\n\t\t\tif(!s_pointer_label) s_pointer_label = this.next_label();\n\n\t\t\t// not the very first item of collection subject\n\t\t\tif(this._kt_subject !== null) {\n\t\t\t\t// ref object\n\t\t\t\tlet w_object = this._kt_object;\n\n\t\t\t\t// create blanknode to embed list\n\t\t\t\tkt_blank_node_outer = this._kt_object = this.anonymous_blank_node(s_pointer_label);\n\n\t\t\t\t// emit statement that functions as collection's head \"pointer\"\n\t\t\t\tthis.data();\n\n\n\t\t\t\t// swap back object\n\t\t\t\tthis._kt_object = w_object;\n\t\t\t}\n\n\t\t\t// emit statement that is item\n\t\t\tthis._kt_subject = kt_blank_node_outer || this.anonymous_blank_node(s_pointer_label);\n\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\t\t\tthis.data();\n\n\n\t\t\t// prepare next predicate\n\t\t\tthis._kt_predicate = this._kt_rdf_rest;\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('collection_subject');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.collection_subject;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\n\t// parse state for collection_object\n\tcollection_object() {\n\t\t// destruct chunk, length, and index\n\t\tlet {s, n, i} = this;\n\n\t\t// start labeled loop, run while there are characters\n\t\twhile(i < n) { // eslint-disable-line no-unmodified-loop-condition\n\t\t\t// ref char\n\t\t\tlet x = s[i];\n\n\t\t\t// end of collection\n\t\t\tif(')' === x) {\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\tR_WS.exec(s);\n\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t// make & emit collection's tail \"pointer\"\n\t\t\t\tthis._kt_object = this._kt_rdf_nil;\n\t\t\t\tthis.data();\n\n\n\t\t\t\t// restore previous state\n\t\t\t\tlet s_resume_state;\n\t\t\t\t[this._kt_subject, this._kt_predicate, s_resume_state] = this._a_nested.pop();\n\t\t\t\treturn this[s_resume_state]();\n\t\t\t}\n\n\n\n\t\t\t// otherwise, pre-emptively secure the next blank node label\n\t\t\tlet s_pointer_label;\n\n// iriref\n\n\t\t\t// prepare sticky regex index\n\t\t\tR_IRIREF_ESCAPELESS.lastIndex = i;\n\t\t\t// execute regex\n\t\t\tlet m_iriref_e_object = R_IRIREF_ESCAPELESS.exec(s);\n\n\t\t\t// regex was a match\n\t\t\tif(m_iriref_e_object) {\n\t\t\t\t// advance index\n\t\t\t\ti = R_IRIREF_ESCAPELESS.lastIndex;\n// commit object iri as is\n\n\t\t\t\t// ref iri\n\t\t\t\tlet s_iri = m_iriref_e_object[1];\n\t\t\t\t// absolute iri\n\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t// set object\n\t\t\t\t\tthis._kt_object = this.check_named_node_escapeless(s_iri);\n\t\t\t\t}\n\t\t\t\t// relative iri\n\t\t\t\telse {\n\t\t\t\t\tthis._kt_object = this.check_named_node_escapeless(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t}\n\n\t\t\t// prefixed name\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// try match\n\t\t\t\tlet aw_valid_this_match_prefixed_name_escapeless = this.match_prefixed_name_escapeless(s, i);\n\t\t\t\t// stack bail out\n\t\t\t\tif(!aw_valid_this_match_prefixed_name_escapeless) return true;\n\t\t\t\tlet [m_prefixed_named_e_object, im_prefixed_named_e_object] = aw_valid_this_match_prefixed_name_escapeless;\n\t\t\t\tif(m_prefixed_named_e_object) {\n\t\t\t\t\t// advance index\n\t\t\t\t\ti = im_prefixed_named_e_object;\n\t\t\t\t\t// check valid prefix\n\t\t\t\t\tlet s_prefix_id = m_prefixed_named_e_object[1] || '';\n\t\t\t\t\t// invalid prefix\n\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t// commit object iri from resolve prefixed name\n\t\t\t\t\tthis._kt_object = this.prefixed_name(s_prefix_id, m_prefixed_named_e_object[2]);\n\n\t\t\t\t// string literal\n\t\t\t\t}\n\t\t\t\telse \tif('\"' === x || '\\'' === x) {\n\t\t\t\t\t// update index before changing states\n\t\t\t\t\tthis.i = i;\n\n\t\t\t\t\t// create blanknode to embed list\n\t\t\t\t\tlet kt_blank_node = this._kt_object = this.anonymous_blank_node(this.next_label());\n\n\t\t\t\t\t// emit statement that functions as collection's head \"pointer\"\n\t\t\t\t\tthis.data();\n\n\n\t\t\t\t\t// prepare statement that is item\n\t\t\t\t\tthis._kt_subject = kt_blank_node;\n\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\n\t\t\t\t\tthis.after_end_of_statement = function() {\n\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_rest;\n\t\t\t\t\t\tthis.after_end_of_statement = this.post_object;\n\t\t\t\t\t\treturn this.collection_object();\n\t\t\t\t\t};\n\t\t\t\t\treturn this.string_literal();\n\n\t\t\t\t// numeric literal\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\tR_NUMERIC_LITERAL.lastIndex = i;\n\t\t\t\t\t// execute regex\n\t\t\t\t\tlet m_numeric_literal = R_NUMERIC_LITERAL.exec(s);\n\n\t\t\t\t\t// regex was a match\n\t\t\t\t\tif(m_numeric_literal) {\n\t\t\t\t\t\t// advance index\n\t\t\t\t\t\ti = R_NUMERIC_LITERAL.lastIndex;\n\t\t\t\t\t\t// it has exponent term, xsd:double\n\t\t\t\t\t\tif(m_numeric_literal[4]) {\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.double(m_numeric_literal[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// contains decimal point, xsd:decimal\n\t\t\t\t\t\telse if(m_numeric_literal[2] || m_numeric_literal[3]) {\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.decimal(m_numeric_literal[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// otherwise, it is an integer\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.integer(m_numeric_literal[1]);\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t// boolean literal\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\tR_BOOLEAN_LITERAL.lastIndex = i;\n\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\tlet m_boolean_literal = R_BOOLEAN_LITERAL.exec(s);\n\n\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\tif(m_boolean_literal) {\n\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\ti = R_BOOLEAN_LITERAL.lastIndex;\n\t\t\t\t\t\t\t// make literal\n\t\t\t\t\t\t\tthis._kt_object = this._dc_factory.boolean(!!m_boolean_literal[1]);\n\n\t\t\t\t\t\t// blank node property list\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \tif('[' === x) {\n\t\t\t\t// advance index to next token\n\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\t\tthis.i = R_WS.lastIndex;\n\n\t\t\t\t\t\t\t// commit head of list pointer\n\t\t\t\t\t\t\tlet kt_blank_node = this._kt_object = this.anonymous_blank_node(this.next_label());\n\t\t\t\t\t\t\tthis.data();\n\n\n\t\t\t\t\t\t\t// setup state to resume and push\n\t\t\t\t\t\t\tthis._kt_subject = kt_blank_node;\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_rest;\n\t\t\t\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'collection_object']);\n\n\t\t\t\t\t\t\t// enter blank node\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\t\t\t\t\t\t\tkt_blank_node = this._kt_object = this.anonymous_blank_node(this.next_label());\n\t\t\t\t\t\t\tthis.data();\n\n\n\t\t\t\t\t\t\t// prepare next triple\n\t\t\t\t\t\t\tthis._kt_subject = kt_blank_node;\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\n\t\t\t\t\t\t\t// goto parsing pairs state\n\t\t\t\t\t\t\treturn this.pairs();\n\n\t\t\t\t\t\t// new collection\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \tif('(' === x) {\n\t\t\t\t\t\t\t// consume whitespace (and incidentally reset index)\n\t\t\t\t\t\t\tR_WS.lastIndex = i+1;\n\t\t\t\t\t\t\tR_WS.exec(s);\n\t\t\t\t\t\t\ti = R_WS.lastIndex;\n\n\t\t\t\t\t\t\t// commit list item pointer\n\t\t\t\t\t\t\ts_pointer_label = this.next_label();\n\t\t\t\t\t\t\tlet kt_blank_node = this._kt_object = this.anonymous_blank_node(s_pointer_label);\n\t\t\t\t\t\t\tif(null === this._kt_subject) {\n\t\t\t\t\t\t\t\tlet a_recent = this._a_nested[this._a_nested.length-1];\n\t\t\t\t\t\t\t\tthis._kt_subject = a_recent[0];\n\t\t\t\t\t\t\t\tthis._kt_predicate = a_recent[1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.data();\n\n\n\t\t\t\t\t\t\t// add this list as an item to the outer list\n\t\t\t\t\t\t\tthis._kt_subject = kt_blank_node;\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_rest;\n\t\t\t\t\t\t\tthis._a_nested.push([this._kt_subject, this._kt_predicate, 'collection_object']);\n\n\t\t\t\t\t\t\t// prepare next triple\n\t\t\t\t\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\n\t\t\t\t\t\t\t// flowing\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t// labeled blank node\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\tR_BLANK_NODE_LABEL.lastIndex = i;\n\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\tlet m_blank_node_label_object = R_BLANK_NODE_LABEL.exec(s);\n\n\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\tif(m_blank_node_label_object) {\n\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\ti = R_BLANK_NODE_LABEL.lastIndex;\n\t\t\t\t\t\t\t\t// ref blank node label\n\t\t\t\t\t\t\t\tlet s_label = m_blank_node_label_object[1];\n\n\t\t\t\t\t\t\t\t// make collection pointer label first\n\t\t\t\t\t\t\t\ts_pointer_label = this.next_label();\n\n\t\t\t\t\t\t\t\t// make object\n\t\t\t\t\t\t\t\tthis._kt_object = this.blank_node(s_label);\n\n\t\t\t\t\t\t\t// iriref\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\tR_IRIREF.lastIndex = i;\n\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\tlet m_iriref_object = R_IRIREF.exec(s);\n\n\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\tif(m_iriref_object) {\n\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\ti = R_IRIREF.lastIndex;\n// commit object iri as is\n\n\t\t\t\t\t\t\t\t\t// ref iri\n\t\t\t\t\t\t\t\t\tlet s_iri = m_iriref_object[1].replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY);\n\t\t\t\t\t\t\t\t\t// absolute iri\n\t\t\t\t\t\t\t\t\tif(!this._s_base_url || RT_IRI_ABSOLUTE.test(s_iri)) {\n\t\t\t\t\t\t\t\t\t\t// set object\n\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.check_named_node(s_iri);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// relative iri\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.check_named_node(uri.resolve(this._s_base_url, s_iri));\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// prefixed name\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// try match\n\t\t\t\t\t\t\t\t\tlet aw_valid_this_match_prefixed_name = this.match_prefixed_name(s, i);\n\t\t\t\t\t\t\t\t\t// stack bail out\n\t\t\t\t\t\t\t\t\tif(!aw_valid_this_match_prefixed_name) return true;\n\t\t\t\t\t\t\t\t\tlet [m_prefixed_named_object, im_prefixed_named_object] = aw_valid_this_match_prefixed_name;\n\t\t\t\t\t\t\t\t\tif(m_prefixed_named_object) {\n\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\ti = im_prefixed_named_object;\n\t\t\t\t\t\t\t\t\t\t// check valid prefix\n\t\t\t\t\t\t\t\t\t\tlet s_prefix_id = m_prefixed_named_object[1] || '';\n\t\t\t\t\t\t\t\t\t\t// invalid prefix\n\t\t\t\t\t\t\t\t\t\tif(!OPHOP.call(this._h_prefixes, s_prefix_id)) return this.error(`no such prefix \"${s_prefix_id}\"`);\n\n\n\t\t\t\t\t\t\t\t\t\t// escape local escapes\n\t\t\t\t\t\t\t\t\t\tlet s_suffix = m_prefixed_named_object[2]\n\t\t\t\t\t\t\t\t\t\t\t.replace(R_UNICODE_ANY, F_REPLACE_UNICODE_ANY)\n\t\t\t\t\t\t\t\t\t\t\t.replace(R_PN_LOCAL_ESCAPES, '$1');\n\n\t\t\t\t\t\t\t\t\t\t// commit object iri from resolve prefixed name\n\t\t\t\t\t\t\t\t\t\tthis._kt_object = this.prefixed_name(s_prefix_id, s_suffix);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t// prepare sticky regex index\n\t\t\t\t\t\t\t\t\t\tR_COMMENT.lastIndex = i;\n\t\t\t\t\t\t\t\t\t\t// execute regex\n\t\t\t\t\t\t\t\t\t\tlet m_comment = R_COMMENT.exec(s);\n\n\t\t\t\t\t\t\t\t\t\t// regex was a match\n\t\t\t\t\t\t\t\t\t\tif(m_comment) {\n\t\t\t\t\t\t\t\t\t\t\t// advance index\n\t\t\t\t\t\t\t\t\t\t\ti = R_COMMENT.lastIndex;\n\t\t\t\t\t\t\t\t\t\t\tif(this.emit_comments) this.emit_comments(m_comment[0]);\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t// not iriref, not prefixed name, not string literal, not numeric literal, not boolean literal, not blank node property list, not collection\n\t\t\t// match counter: 7\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t// break loop to retry on next chunk if eos\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} // brace #7\n\t\t\t\t\t\t\t\t} // brace #6\n\t\t\t\t\t\t\t} // brace #5\n\t\t\t\t\t\t} // brace #4\n\t\t\t\t\t} // brace #3\n\t\t\t\t} // brace #2\n\t\t\t} // brace #1\n\n\n\n\t\t\t// ref object\n\t\t\tlet w_object = this._kt_object;\n\n\t\t\t// create blanknode to embed list\n\t\t\tif(!s_pointer_label) s_pointer_label = this.next_label();\n\t\t\tlet kt_blank_node_outer = this._kt_object = this.anonymous_blank_node(s_pointer_label);\n\n\t\t\t// emit statement that functions as collection's head \"pointer\"\n\t\t\tthis.data();\n\n\n\t\t\t// emit statement that is item\n\t\t\tthis._kt_subject = kt_blank_node_outer;\n\t\t\tthis._kt_predicate = this._kt_rdf_first;\n\t\t\tthis._kt_object = w_object;\n\t\t\tthis.data();\n\n\n\t\t\t// prepare next predicate\n\t\t\tthis._kt_predicate = this._kt_rdf_rest;\n\t\t}\n\n\t\t\t\t// ran out of characters\n\t\t\t\t// update index value\n\t\tthis.i = i;\n\n\t\t// not yet eos\n\t\tif(i < this.n) {\n\t\t\t// expected token was not found\n\t\t\tif(0 === i) {\n\t\t\t\t// we've exceeded the maximum token length\n\t\t\t\tif(this.n > this.max_token_length) {\n\t\t\t\t\treturn this.parse_error('collection_object');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save state before pausing\n\t\tthis._f_state = this.collection_object;\n\n\t\t// store what is unparsed\n\t\tthis.pre = s.slice(i);\n\n\t\t// if we're not parsing a stream, then this is an error\n\t\tif(this.eos) this.eos();\n\t\treturn;\n\t}\n\n\n\tdestroy(e_destroy) {\n\t\tthis.post_blank_subject = () => {};\n\n\t\tthis.statement = () => {};\n\n\t\tthis.block = () => {};\n\n\t\tthis.graph_or_subject = () => {};\n\n\t\tthis.graph_or_subject_property_list = () => {};\n\n\t\tthis.graph_or_subject_anon = () => {};\n\n\t\tthis.graph_keyword = () => {};\n\n\t\tthis.graph_post_name = () => {};\n\n\t\tthis.pairs = () => {};\n\n\t\tthis.object_list = () => {};\n\n\t\tthis.string_literal_short_double = () => {};\n\n\t\tthis.string_literal_short_single = () => {};\n\n\t\tthis.string_literal_long_double = () => {};\n\n\t\tthis.string_literal_long_single = () => {};\n\n\t\tthis.string_literal = () => {};\n\n\t\tthis.datatype_or_langtag = () => {};\n\n\t\tthis.datatype = () => {};\n\n\t\tthis.post_object = () => {};\n\n\t\tthis.base_iri = () => {};\n\n\t\tthis.prefix_id = () => {};\n\n\t\tthis.prefix_iri = () => {};\n\n\t\tthis.full_stop = () => {};\n\n\t\tthis.collection_subject = () => {};\n\n\t\tthis.collection_object = () => {};\n\n\n\t\tthis.eof = () => {\n\t\t\tthis.s = null;\n\t\t};\n\n\t\tthis._b_destroyed = true;\n\n\t\t// propagate input destroy\n\t\tif(!e_destroy && this._ds_input) {\n\t\t\tthis._ds_input.destroy(e_destroy);\n\t\t}\n\n\t\tthis.transform.demolish(e_destroy);\n\t}\n}\n\nmodule.exports = function(...a_args) {\n\tlet g_config = {};\n\n\t// at least one argument\n\tif(a_args.length) {\n\t\tlet z_arg_0 = a_args[0];\n\n\t\t// input given unspecified\n\t\tif(z_arg_0 && z_arg_0.input && 'undefined' === typeof z_arg_0.input.string && !z_arg_0.input.stream) {\n\t\t\tz_arg_0 = z_arg_0.input;\n\t\t}\n\n\t\t// string\n\t\tif('string' === typeof z_arg_0) {\n\t\t\tg_config.input = {string:z_arg_0};\n\t\t}\n\t\t// null\n\t\telse if(null === z_arg_0) {\n\t\t\tg_config.input = null;\n\t\t}\n\t\t// node stream\n\t\telse if('function' === typeof z_arg_0.setEncoding) {\n\t\t\tg_config.input = {stream:z_arg_0};\n\t\t}\n\t\t// whatwg stream\n\t\telse if('function' === typeof z_arg_0.pipeTo) {\n\t\t\tthrow new TypeError(`Sorry, WHATWG streams are currently not supported :(`);\n\t\t// g_config.input = {stream:z_arg_0};\n\t\t}\n\t\t// config struct\n\t\telse if(z_arg_0 && 'object' === typeof z_arg_0 && '[object Object]' === Object.prototype.toString.call(z_arg_0)) {\n\t\t\tg_config = z_arg_0;\n\n\t\t\t// more args; invalid\n\t\t\tif(a_args.length > 1) {\n\t\t\t\tthrow new TypeError(`unexpected argument(s) after config struct: ${a_args.slice(1)}`);\n\t\t\t}\n\t\t}\n\t\t// unknown\n\t\telse {\n\t\t\tthrow new TypeError(`unexpected input type: ${z_arg_0}`);\n\t\t}\n\n\t\t// more args\n\t\tif(a_args.length > 1) {\n\t\t\t// copy onto struct\n\t\t\tObject.assign(g_config, a_args[1]);\n\n\t\t\t// more args\n\t\t\tif(a_args.length > 2) {\n\t\t\t\tthrow new TypeError(`unexpected argument(s) after input and config struct: ${a_args.slice(2)}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// create reader, return transform stream\n\treturn (new Reader(g_config)).transform;\n};\n","const stream = require('readable-stream');\n\n\n\nclass Readable extends stream.Readable {\n\tconstructor(gc_readable={}) {\n\t\tsuper(gc_readable);\n\n\t\t// use iterator\n\t\tif(gc_readable.iterator) {\n\t\t\tthrow new Error('readable stream iterator shortcut not yet implemented');\n\t\t}\n\t}\n\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass Writable extends stream.Writable {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\t// rdfjs impl\n\timport(ds_source) {\n\t\tds_source\n\t\t\t.on('data', w_chunk => this.write(w_chunk))\n\t\t\t.on('end', () => this.end())\n\t\t\t.on('error', e_read => this.emit('error', e_read));\n\n\t\treturn this;\n\t}\n}\n\nclass Duplex extends stream.Duplex {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass Transform extends stream.Transform {\n\tuntil(s_event, b_return_stream) {\n\t\treturn new Promise((fk_until, fe_until) => {\n\t\t\t// convert error to rejected promise\n\t\t\tthis.on('error', (e_stream) => {\n\t\t\t\tfe_until(e_stream);\n\t\t\t});\n\n\t\t\t// special cases returns `this`\n\t\t\tif(b_return_stream) {\n\t\t\t\tthis.once(s_event, (...a_args) => {\n\t\t\t\t\tfk_until(this, ...a_args);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.once(s_event, fk_until);\n\t\t\t}\n\t\t});\n\t}\n\n\tbucket(s_encoding='utf8') {\n\t\tlet g_readable = this._readableState;\n\n\t\t// object mode\n\t\tif(g_readable.objectMode) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet a_data = [];\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\twrite(w_event, s_write_encoding, fk_write) {\n\t\t\t\t\t\ta_data.push(w_event);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ta_data.push(...a_chunks);\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(a_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// utf8-encoded strings\n\t\telse if('utf8' === s_encoding || 'utf-8' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet s_data = '';\n\n\t\t\t\t// set encoding\n\t\t\t\tthis.setEncoding(s_encoding);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: false,\n\n\t\t\t\t\twrite(s_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\ts_data += s_chunk;\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\n\t\t\t\t\twritev(a_chunks, fk_writev) {\n\t\t\t\t\t\ts_data += a_chunks.join('');\n\t\t\t\t\t\tfk_writev();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(s_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t// buffer\n\t\telse if('buffer' === s_encoding) {\n\t\t\t// async operation\n\t\t\treturn new Promise((fk_bucket, fe_bucket) => {\n\t\t\t\tlet ab_data = Buffer.from([]);\n\n\t\t\t\t// pipe to writable\n\t\t\t\tthis.pipe(new stream.Writable({\n\t\t\t\t\tdecodeStrings: true,\n\n\t\t\t\t\twrite(ab_chunk, s_write_encoding, fk_write) {\n\t\t\t\t\t\tab_data = Buffer.concat([ab_data, ab_chunk], ab_data.length+ab_chunk.length);\n\t\t\t\t\t\tfk_write();\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t\t\t\t// error\n\t\t\t\t\t.on('error', (e_stream) => {\n\t\t\t\t\t\tfe_bucket(e_stream);\n\t\t\t\t\t})\n\t\t\t\t\t// wait for it to finish\n\t\t\t\t\t.on('finish', () => {\n\t\t\t\t\t\tfk_bucket(ab_data);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\n\t// rdfjs impl\n\timport(ds_source) {\n\t\tds_source\n\t\t\t.on('data', w_chunk => this.write(w_chunk))\n\t\t\t.on('end', () => this.end())\n\t\t\t.on('error', e_read => this.emit('error', e_read));\n\n\t\treturn this;\n\t}\n\n\tdemolish(e_destroy) {\n\t\t// do not allow to push\n\t\tthis.push = (z_chunk) => {\n\t\t\t// ignore eof signals from node core\n\t\t\tif(null === z_chunk) return;\n\n\t\t\t// anything else is bad\n\t\t\tthrow new Error(`[ERR_STREAM_DESTROYED]: Cannot push after stream was destroyed`);\n\t\t};\n\n\t\t// do not allow to emit 'end'\n\t\tthis.emit = function(s_event, ...a_args) {\n\t\t\tif('end' === s_event) return;\n\n\t\t\tObject.getPrototypeOf(this).emit.apply(this, [s_event, ...a_args]);\n\t\t};\n\n\t\t// an error was given, destroy the stream as well\n\t\tif(e_destroy) {\n\t\t\treturn stream.Transform.prototype.destroy.call(this, e_destroy);\n\t\t}\n\t}\n}\n\n// eslint-disable-next-line no-new-func\nconst b_is_node = (new Function(/* syntax: js */ `try {return this===global;}catch(e){return false;}`))();\n\n// deduce the runtime environment\nconst [B_BROWSER, B_BROWSERIFY] = (() => 'undefined' === typeof process\n\t? [true, false]\n\t: (process.browser\n\t\t? [true, true]\n\t\t: ('undefined' === process.versions || 'undefined' === process.versions.node\n\t\t\t? [true, false]\n\t\t\t: [false, false])))();\n\n// node.js or browserify; patch for node < v10\nif(B_BROWSERIFY || (b_is_node && (+(/^v(\\d+)/.exec(process.version)[1])) < 10)) {\n\t// override destroy methods\n\tTransform.prototype.destroy = Duplex.prototype.destroy = function(e_destroy, fke_destroy) {\n\t\tthis._readableState.destroyed = true;\n\t\tthis._writableState.destroyed = true;\n\n\t\tlet f_emit_close = () => {\n\t\t\tif(!this._writableState.emitClose) return;\n\t\t\tif(!this._readableState.emitClose) return;\n\t\t\tthis.emit('close');\n\t\t};\n\n\t\tthis._destroy(e_destroy || null, (e_destroy_re) => {\n\t\t\tif(!fke_destroy && e_destroy_re) {\n\t\t\t\tprocess.nextTick(() => {\n\t\t\t\t\tthis.emit('error', e_destroy_re);\n\t\t\t\t\tf_emit_close();\n\t\t\t\t});\n\t\t\t\tthis._writableState.errorEmitted = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tprocess.nextTick(f_emit_close);\n\t\t\t\tif(fke_destroy) fke_destroy(e_destroy_re);\n\t\t\t}\n\t\t});\n\n\t\treturn this;\n\t};\n\n\t// override default _destroy implementations\n\tTransform.prototype._destroy = Duplex.prototype._destroy = (e_destroy, fke_destroy) => fke_destroy(e_destroy);\n}\n\nclass QuadsToOther extends Transform {\n\tconstructor(gc_transform={}) {\n\t\tsuper({\n\t\t\t...gc_transform,\n\t\t\twritableObjectMode: true,\n\t\t\treadableObjectMode: true,\n\t\t});\n\n\t\tthis._as_inputs = new Set();\n\n\t\t// forward prefix and comment events\n\t\tthis.on('pipe', (ds_src) => {\n\t\t\tthis._as_inputs.add(ds_src);\n\n\t\t\tds_src\n\t\t\t\t.on('prefix', (...a_args) => {\n\t\t\t\t\tthis.emit('prefix', ...a_args);\n\t\t\t\t})\n\t\t\t\t.on('comment', (...a_args) => {\n\t\t\t\t\tthis.emit('comment', ...a_args);\n\t\t\t\t});\n\t\t});\n\n\t\tthis.on('unpipe', (ds_src) => {\n\t\t\tthis._as_inputs.delete(ds_src);\n\t\t});\n\t}\n\n\t_destroy() {\n\t\tfor(let ds_input of this._as_inputs) {\n\t\t\tds_input.destroy();\n\t\t}\n\t}\n}\n\nclass Quads_To_JSON_Transform extends QuadsToOther {\n\t// serializse json\n\t_transform(g_quad, s_encoding, fk_transform) {\n\t\tfk_transform(null, JSON.stringify(g_quad.isolate())+'\\n');\n\t}\n}\n\nclass Quads_To_Writable extends QuadsToOther {\n\t_transform(g_quad, s_encoding, fk_transform) {\n\t\tfk_transform(null, {\n\t\t\ttype: 'quad',\n\t\t\tvalue: g_quad,\n\t\t});\n\t}\n}\n\nTransform.QuadsToOther = QuadsToOther;\n\nmodule.exports = {\n\t...stream,\n\tReadable,\n\tWritable,\n\tDuplex,\n\tTransform,\n\n\tQuadsToOther,\n\n\t// create a transform from quad objects into JSON strings for trivial serialization\n\tquads_to_json() {\n\t\treturn new Quads_To_JSON_Transform();\n\t},\n\n\t// create a transform from quad objects into writable data events\n\tquads_to_writable() {\n\t\treturn new Quads_To_Writable();\n\t},\n\n\t// create a simple, single-event readable stream\n\tsource(w_push, s_encoding=null) {\n\t\t// encoding not explicit, string given; assume utf8\n\t\tif(!s_encoding && 'string' === typeof w_push) s_encoding = 'utf8';\n\n\t\t// readable\n\t\treturn new Readable({\n\t\t\tobjectMode: !s_encoding && 'string' !== typeof w_push && !Buffer.isBuffer(w_push),\n\n\t\t\tread() {\n\t\t\t\tthis.push(w_push, s_encoding);\n\t\t\t\tthis.push(null);\n\t\t\t},\n\t\t});\n\t},\n};\n"],"names":["queueMicrotask","dp_resolve","Promise","resolve","fk","then","catch","e_callback","setTimeout","e_define","uri","string_decoder","stream","factory","quad","k","_kt_subject","_kt_predicate","_kt_object","_kt_graph","RT_PREFIXED_NAME_NAMESPACE_VALID","RT_PREFIXED_NAME_LOCAL_NAME_VALID","RT_BLANK_NODE_VALID","RT_NAMED_NODE_VALID","RT_NAMED_NODE_ESCAPELESS_VALID","R_UNICODE_ANY","F_REPLACE_UNICODE_ANY","s_","s_4","s_8","String","fromCodePoint","parseInt","OPHOP","Object","prototype","hasOwnProperty","R_PREFIXED_NAME_QUICK","R_PREFIXED_NAME_ESCAPELESS","R_PREFIXED_NAME","R_PN_LOCAL_ESCAPES","R_BLANK_NODE_LABEL","R_BLANK_NODE_LABEL_TERMINAL","R_IRIREF_ESCAPELESS","R_IRIREF","R_NUMERIC_LITERAL","R_BOOLEAN_LITERAL","R_A","R_DOUBLE_CARET","R_WS","R_LANGTAG","R_PREFIX_KEYWORD","R_PREFIX_ID","R_BASE_KEYWORD","R_GRAPH_IRI_ESCAPELESS","R_GRAPH_PREFIXED_NAME","R_GRAPH_LABELED_BLANK_NODE","R_GRAPH_ANONYMOUS_BLANK_NODE","R_GRAPH_IRI","R_GRAPH","R_COMMENT","RT_IRI_ABSOLUTE","R_BASE_IRI","R_ANONYMOUS_BLANK_NODE","R_CHAR_BLANK_NODE","R_CHAR_COLLECTION","R_CHAR_KET","R_CHAR_OPEN","R_CHAR_CLOSE","R_CHAR_STOP","R_STRLIT_SHORT_DOUBLE_BREAK","R_STRLIT_SHORT_SINGLE_BREAK","R_STRLIT_LONG_DOUBLE_UNFINISHED_TERM","R_STRLIT_LONG_SINGLE_UNFINISHED_TERM","R_STRLIT_LONG_DOUBLE_BREAK","R_STRLIT_LONG_SINGLE_BREAK","F_REPLACE_STRLIT_CONTENTS","s_whitespace","s_auto","s_invalid","console","assert","Error","JSON","stringify","R_STRLIT_SHORT_CONTENTS_ESCAPES_HARD","R_STRLIT_SHORT_CONTENTS_ESCAPES_SOFT","unescape_literal_short_hard","s_literal","replace","unescape_literal_short_soft","m_incomplete","R_STRLIT_ESCAPE_INCOMPLETE","exec","i_safe","index","slice","R_STRLIT_LONG_CONTENTS_ESCAPES_HARD","R_STRLIT_LONG_CONTENTS_ESCAPES_SOFT","unescape_literal_long_hard","unescape_literal_long_soft","R_STRLIT_SHORT_DOUBLE_TERM","R_STRLIT_SHORT_SINGLE_TERM","R_STRLIT_LONG_DOUBLE_TERM","R_STRLIT_LONG_SINGLE_TERM","RegExp_$lookbehind_polyfill","s_input","m_match","RegExp","call","this","i_start","length","mk_lookbehind_regex","e_compile","f_lookbehind","r_polyfill","f_polyfill","match_prefixed_name_escapeless","s","i","lastIndex","match_prefixed_name","Reader$syntax_error","k_self","si_state","s_info","i_off","Math","min","abs","error","substr","repeat","TriG_Reader","Transform","constructor","g_impls","super","decodeStrings","writableObjectMode","readableObjectMode","flush","transform","pipe","ds_out","ds_dst","_writableState","objectMode","isGraphyWritable","quads_to_writable","quads_to_json","Reader","g_config","input","g_input","state","g_state","blank_node_index","i_anon","prefixes","h_prefixes","labels","h_labels","dc_factory","adopt","dataFactory","data_factory","unfiltered","kt_default_graph","defaultGraph","create","kt_rdf_first","namedNode","blankNode","emit_data","ds_transform","push","g_quad","assign","n","pre","prepend","_b_debug","debug","_b_relax","relax","_dc_factory","_f_state","block","_h_prefixes","_b_destroyed","_s_base_url","_s_base_url_scheme","_s_base_url_root","_s_base_url_path","_s_literal","_kt_rdf_type","_kt_rdf_first","_kt_rdf_rest","_kt_rdf_nil","_kt_default_graph","_a_nested","_h_labels","event","emit","data","restore_data","_a_queue_event","_b_expecting_full_stop","_s_temp_prefix_id","_b_trim_start","anonymous_blank_node","s_label","next_label","eos","after_end_of_statement","post_object","_n_max_token_length","max_token_length","maxTokenLength","_n_max_string_length","max_string_length","maxStringLength","Infinity","_b_byte_tracking","byte_tracking","byteTracking","_nb_seen","_nb_last","_nb_curr","relaxed","warn","stack","blank_node","z_label_state","check_named_node","check_named_node_escapeless","test","p_iri","match_prefixed_name_quick","m_prefixed_name_e","im_prefixed_name_e","m_prefixed_name","im_prefixed_name","named_node","prefixed_name","si_prefix","s_suffix","base","TypeError","p_set_base_uri","base_uri","baseUri","baseURI","base_iri","baseIri","baseIRI","m_base_iri","base_url","baseUrl","baseURL","s_chunk","s_encoding","fke_chunk","safe_parse","fke_flush","eof","e_eof","destroy","on","ds_input","_ds_input","b_byte_tracking","setEncoding","f_write","write","d_decoder","StringDecoder","f_write_track","fk_write","nb_chunk","Buffer","from","f_decode_write_track","ab_chunk","f_decode_write","z_chunk","nb_post","ib_post","byteRange","s_event","emit_comments","s_captured","a_comments","split","s_comment","_destroy","a_args","bind","string","end","f_sync","apply","e_read","queue","args","s_message","parse_error","s_expected","b_eof","info_error","a_queue","h_event","shift","name","m_comment","prefix","enter","exit","comment","read","once","progress","finish","post_blank_subject","statement","equals","pairs","m_pnq_subject","s_prefix_id","m_iriref_e_subject","s_iri","aw_valid_this_match_prefixed_name_escapeless","m_prefixed_named_e_subject","im_prefixed_named_e_subject","m_blank_node_label_subject","collection_subject","m_iriref_subject","aw_valid_this_match_prefixed_name","m_prefixed_named_subject","im_prefixed_named_subject","m_graph_iriref_e_graph","m_graph_prefixed_name","m_graph_anonymous_blank_node","m_graph_labeled_blank_node","m_iriref_e_graph_subject","graph_or_subject","graph_or_subject_property_list","m_prefix_keyword","prefix_id","m_base_keyword","m_graph_iriref_graph","graph_keyword","x","graph_or_subject_anon","pop","m_prefixed_named_e_graph","im_prefixed_named_e_graph","graph_post_name","m_iriref_e_graph","m_blank_node_label_graph","m_iriref_graph","m_prefixed_named_graph","im_prefixed_named_graph","m_iriref_e_predicate","object_list","m_prefixed_named_e_predicate","im_prefixed_named_e_predicate","s_resume_state","m_iriref_predicate","m_prefixed_named_predicate","im_prefixed_named_predicate","string_literal_long_double","string_literal_short_double","m_pnq_object","m_iriref_e_object","m_prefixed_named_e_object","im_prefixed_named_e_object","string_literal_long_single","string_literal_short_single","m_numeric_literal","double","decimal","integer","m_boolean_literal","boolean","kt_blank_node","m_blank_node_label_object","collection_object","m_iriref_object","m_prefixed_named_object","im_prefixed_named_object","m_break","i_break","datatype_or_langtag","m_term","i_term","s_dirty","s_clean","s_incomplete","m_unfinished","string_literal","datatype","m_langtag","languagedLiteral","simpleLiteral","kt_datatype","m_pnq_datatype","m_iriref_e_datatype","p_datatype","m_prefixed_named_e_datatype","im_prefixed_named_e_datatype","m_iriref_datatype","m_prefixed_named_datatype","im_prefixed_named_datatype","datatypedLiteral","i_reset","s_peek","m_iriref_e_base","full_stop","m_iriref_base","m_prefix_id","prefix_iri","p_prefix_iri","m_iriref_e_prefix","b_relax","prefix_change","m_iriref_prefix","s_pointer_label","b_pushed","kt_blank_node_outer","w_object","a_recent","e_destroy","demolish","module","exports","z_arg_0","pipeTo","toString","Readable","gc_readable","iterator","until","b_return_stream","fk_until","fe_until","e_stream","bucket","g_readable","_readableState","fk_bucket","fe_bucket","a_data","Writable","w_event","s_write_encoding","writev","a_chunks","fk_writev","s_data","join","ab_data","concat","import","ds_source","w_chunk","Duplex","getPrototypeOf","b_is_node","Function","B_BROWSER","B_BROWSERIFY","process","browser","versions","node","version","fke_destroy","destroyed","f_emit_close","emitClose","e_destroy_re","nextTick","errorEmitted","QuadsToOther","gc_transform","_as_inputs","Set","ds_src","add","delete","Quads_To_JSON_Transform","_transform","fk_transform","isolate","Quads_To_Writable","type","value","source","w_push","isBuffer"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/564.9497f0a9.js b/dist/js/564.9497f0a9.js deleted file mode 100644 index c8461d5..0000000 --- a/dist/js/564.9497f0a9.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self["webpackChunkmobilitydcatap_ui"]=self["webpackChunkmobilitydcatap_ui"]||[]).push([[564],{44564:function(e,t,r){r.r(t),r.d(t,{BlankNode:function(){return u.PB},DataFactory:function(){return u.Ay},DefaultGraph:function(){return u.yV},EntityIndex:function(){return A},Lexer:function(){return s.A},Literal:function(){return u.uS},NamedNode:function(){return u.Yo},Parser:function(){return n.A},Quad:function(){return u.kO},Reasoner:function(){return q},Store:function(){return k},StoreFactory:function(){return F},StreamParser:function(){return E.A},StreamWriter:function(){return L},Term:function(){return u.x1},Triple:function(){return u.n7},Util:function(){return i},Variable:function(){return u.rT},Writer:function(){return x},default:function(){return M},getRulesFromDataset:function(){return G},termFromId:function(){return u.iN},termToId:function(){return u.FL}});var i={};r.r(i),r.d(i,{inDefaultGraph:function(){return f},isBlankNode:function(){return c},isDefaultGraph:function(){return l},isLiteral:function(){return h},isNamedNode:function(){return a},isVariable:function(){return d},prefix:function(){return _},prefixes:function(){return p}});var s=r(3524),n=r(33291),o=r(65852),u=r(28612);function a(e){return!!e&&"NamedNode"===e.termType}function c(e){return!!e&&"BlankNode"===e.termType}function h(e){return!!e&&"Literal"===e.termType}function d(e){return!!e&&"Variable"===e.termType}function l(e){return!!e&&"DefaultGraph"===e.termType}function f(e){return l(e.graph)}function _(e,t){return p({"":e.value||e},t)("")}function p(e,t){const r=Object.create(null);for(const s in e)i(s,e[s]);function i(e,i){if("string"===typeof i){const s=Object.create(null);r[e]=e=>s[e]||(s[e]=t.namedNode(i+e))}else if(!(e in r))throw new Error(`Unknown prefix: ${e}`);return r[e]}return t=t||u.Ay,i}const b=u.Ay.defaultGraph(),{rdf:m,xsd:j}=o.A,I=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,y=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,g={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class v extends u.x1{equals(e){return e===this}}class x{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,i){e+=t,i&&i()},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=b,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseMatcher=new RegExp(`^${N(t.baseIRI)}${t.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=t.baseIRI.length))}get _inDefaultGraph(){return b.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,r,i,s){try{i.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(b.equals(i)?"":`${this._encodeIriOrBlank(i)} {\n`)),this._graph=i,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(r)}`,s):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,s):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,s)}catch(n){s&&s(n)}}_writeQuadLine(e,t,r,i,s){delete this._prefixMatch,this._write(this.quadToString(e,t,r,i),s)}quadToString(e,t,r,i){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(r)}${i&&i.value?` ${this._encodeIriOrBlank(i)} .\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._baseMatcher&&this._baseMatcher.test(t)&&(t=t.substr(this._baseLength)),I.test(t)&&(t=t.replace(y,w));const r=this._prefixRegex.exec(t);return r?r[1]?this._prefixIRIs[r[1]]+r[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(I.test(t)&&(t=t.replace(y,w)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===j.string)return`"${t}"`}else switch(e.datatype.value){case j.string:return`"${t}"`;case j.boolean:if("true"===t||"false"===t)return t;break;case j.integer:if(/^[+-]?\d+$/.test(t))return t;break;case j.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case j.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t;break}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===m.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:i}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(r)}${l(i)?"":` ${this._encodeIriOrBlank(i)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,r,i,s){void 0===r?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"===typeof i?this._writeQuad(e,t,r,b,i):this._writeQuad(e,t,r,i||b,s)}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=N(e,/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([_a-zA-Z0-9][\\-_a-zA-Z0-9]*)$`)}this._write(r?"\n":"",t)}blank(e,t){let r,i,s=e;switch(void 0===e?s=[]:e.termType?s=[{predicate:e,object:t}]:"length"in e||(s=[e]),i=s.length){case 0:return new v("[]");case 1:if(r=s[0],!(r.object instanceof v))return new v(`[ ${this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)} ]`);default:let t="[";for(let n=0;n{t=null,e(r,i)});if(this._endStream)try{return this._outputStream.end(t)}catch(r){}t&&t()}}function w(e){let t=g[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}function N(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}var T=r(85721);const $=Symbol("iter");function Q(e,t,r=4){if(0===r)return Object.assign(e,t);for(const i in t)e[i]=Q(e[i]||Object.create(null),t[i],r-1);return e}function S(e,t,r=4){let i=!1;for(const s in e)if(s in t){const n=0===r?null:S(e[s],t[s],r-1);if(!1!==n)i=i||Object.create(null),i[s]=n;else if(3===r)return!1}return i}function O(e,t,r=4){let i=!1;for(const s in e)if(s in t){if(0!==r){const n=O(e[s],t[s],r-1);if(!1!==n)i=i||Object.create(null),i[s]=n;else if(3===r)return!1}}else i=i||Object.create(null),i[s]=0===r?null:Q({},e[s],r-1);return i}class A{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||u.Ay}_termFromId(e){if("."===e[0]){const t=this._entities,r=e.split("."),i=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}return(0,u.iN)(e,this._factory)}_termToNumericId(e){if("Quad"===e.termType){const t=this._termToNumericId(e.subject),r=this._termToNumericId(e.predicate),i=this._termToNumericId(e.object);let s;return t&&r&&i&&(l(e.graph)||(s=this._termToNumericId(e.graph)))&&this._ids[s?`.${t}.${r}.${i}.${s}`:`.${t}.${r}.${i}`]}return this._ids[(0,u.FL)(e)]}_termToNewNumericId(e){const t=e&&"Quad"===e.termType?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${l(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:(0,u.FL)(e);return this._ids[t]||(this._ids[this._entities[++this._id]=t]=this._id)}createBlankNode(e){let t,r;if(e){t=e=`_:${e}`,r=1;while(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 k{constructor(e,t){this._size=0,this._graphs=Object.create(null),t||!e||e[0]||(t=e,e=null),t=t||{},this._factory=t.factory||u.Ay,this._entityIndex=t.entityIndex||new A({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.addQuads(e)}get size(){let e=this._size;if(null!==e)return e;e=0;const t=this._graphs;let r,i;for(const s in t)for(const n in r=t[s].subjects)for(const t in i=r[n])e+=Object.keys(i[t]).length;return this._size=e}_addToIndex(e,t,r,i){const s=e[t]||(e[t]={}),n=s[r]||(s[r]={}),o=i in n;return o||(n[i]=null),!o}_removeFromIndex(e,t,r,i){const s=e[t],n=s[r];delete n[i];for(const o in n)return;delete s[r];for(const o in s)return;delete e[t]}*_findInIndex(e,t,r,i,s,n,o,u){let a,c,h;const d=this._entities,l=this._termFromId(d[u]),f={subject:null,predicate:null,object:null};t&&((a=e,e={})[t]=a[t]);for(const _ in e)if(c=e[_]){f[s]=this._termFromId(d[_]),r&&((a=c,c={})[r]=a[r]);for(const e in c)if(h=c[e]){f[n]=this._termFromId(d[e]);const t=i?i in h?[i]:[]:Object.keys(h);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,i){t||(i=e.graph,r=e.object,t=e.predicate,e=e.subject),i=i?this._termToNewNumericId(i):1;let s=this._graphs[i];return s||(s=this._graphs[i]={subjects:{},predicates:{},objects:{}},Object.freeze(s)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),r=this._termToNewNumericId(r),!!this._addToIndex(s.subjects,e,t,r)&&(this._addToIndex(s.predicates,t,r,e),this._addToIndex(s.objects,r,e,t),this._size=null,!0)}addQuads(e){for(let t=0;t{this.addQuad(e)})),e}removeQuad(e,t,r,i){t||({subject:e,predicate:t,object:r,graph:i}=e),i=i?this._termToNumericId(i):1;const s=this._graphs;let n,o,u;if(!(e=e&&this._termToNumericId(e))||!(t=t&&this._termToNumericId(t))||!(r=r&&this._termToNumericId(r))||!(n=s[i])||!(o=n.subjects[e])||!(u=o[t])||!(r in u))return!1;for(e in this._removeFromIndex(n.subjects,e,t,r),this._removeFromIndex(n.predicates,t,r,e),this._removeFromIndex(n.objects,r,e,t),null!==this._size&&this._size--,n.subjects)return!0;return delete s[i],!0}removeQuads(e){for(let t=0;t{this.removeQuad(e)})),e}removeMatches(e,t,r,i){const s=new T.Readable({objectMode:!0}),n=this.readQuads(e,t,r,i);return s._read=e=>{while(--e>=0){const{done:e,value:t}=n.next();if(e)return void s.push(null);s.push(t)}},this.remove(s)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,r,i){return[...this.readQuads(e,t,r,i)]}*readQuads(e,t,r,i){const s=this._getGraphs(i);let n,o,u,a;if(!(e&&!(o=this._termToNumericId(e))||t&&!(u=this._termToNumericId(t))||r&&!(a=this._termToNumericId(r))))for(const c in s)(n=s[c])&&(o?a?yield*this._findInIndex(n.objects,a,o,u,"object","subject","predicate",c):yield*this._findInIndex(n.subjects,o,u,null,"subject","predicate","object",c):u?yield*this._findInIndex(n.predicates,u,a,null,"predicate","object","subject",c):a?yield*this._findInIndex(n.objects,a,null,null,"object","subject","predicate",c):yield*this._findInIndex(n.subjects,null,null,null,"subject","predicate","object",c))}match(e,t,r,i){return new B(this,e,t,r,i,{entityIndex:this._entityIndex})}countQuads(e,t,r,i){const s=this._getGraphs(i);let n,o,u,a,c=0;if(e&&!(o=this._termToNumericId(e))||t&&!(u=this._termToNumericId(t))||r&&!(a=this._termToNumericId(r)))return 0;for(const h in s)(n=s[h])&&(c+=e?r?this._countInIndex(n.objects,a,o,u):this._countInIndex(n.subjects,o,u,a):t?this._countInIndex(n.predicates,u,a,o):this._countInIndex(n.objects,a,o,u));return c}forEach(e,t,r,i,s){this.some((t=>(e(t,this),!1)),t,r,i,s)}every(e,t,r,i,s){return!this.some((t=>!e(t,this)),t,r,i,s)}some(e,t,r,i,s){for(const n of this.readQuads(t,r,i,s))if(e(n))return!0;return!1}getSubjects(e,t,r){const i=[];return this.forSubjects((e=>{i.push(e)}),e,t,r),i}forSubjects(e,t,r,i){const s=this._getGraphs(i);let n,o,u;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||r&&!(u=this._termToNumericId(r))))for(i in s)(n=s[i])&&(o?u?this._loopBy2Keys(n.predicates,o,u,e):this._loopByKey1(n.subjects,o,e):u?this._loopByKey0(n.objects,u,e):this._loop(n.subjects,e))}getPredicates(e,t,r){const i=[];return this.forPredicates((e=>{i.push(e)}),e,t,r),i}forPredicates(e,t,r,i){const s=this._getGraphs(i);let n,o,u;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||r&&!(u=this._termToNumericId(r))))for(i in s)(n=s[i])&&(o?u?this._loopBy2Keys(n.objects,u,o,e):this._loopByKey0(n.subjects,o,e):u?this._loopByKey1(n.predicates,u,e):this._loop(n.predicates,e))}getObjects(e,t,r){const i=[];return this.forObjects((e=>{i.push(e)}),e,t,r),i}forObjects(e,t,r,i){const s=this._getGraphs(i);let n,o,u;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||r&&!(u=this._termToNumericId(r))))for(i in s)(n=s[i])&&(o?u?this._loopBy2Keys(n.subjects,o,u,e):this._loopByKey1(n.objects,o,e):u?this._loopByKey0(n.predicates,u,e):this._loop(n.objects,e))}getGraphs(e,t,r){const i=[];return this.forGraphs((e=>{i.push(e)}),e,t,r),i}forGraphs(e,t,r,i){for(const s in this._graphs)this.some((t=>(e(t.graph),!0)),t,r,i,this._termFromId(this._entities[s]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const r={},i=t?()=>!0:(e,t)=>{throw new Error(`${e.value} ${t}`)},s=this.getQuads(null,o.A.rdf.rest,o.A.rdf.nil,null),n=e?[...s]:[];return s.forEach((t=>{const s=[];let u,a,c=!1;const h=t.graph;let d=t.subject;while(d&&!c){const e=this.getQuads(null,null,d,null),t=this.getQuads(d,null,null,null);let r,l=null,f=null,_=null;for(let s=0;sthis.has(e)));const t=this._graphs,r=e._graphs;let i,s,n,o,u;for(const a in r){if(!(i=t[a]))return!1;i=i.subjects;for(const e in s=r[a].subjects){if(!(n=i[e]))return!1;for(const t in o=s[e]){if(!(u=n[t]))return!1;for(const e in o[t])if(!(e in u))return!1}}}return!0}deleteMatches(e,t,r,i){for(const s of this.match(e,t,r,i))this.removeQuad(s);return this}difference(e){if(e&&e instanceof B&&(e=e.filtered),e===this)return new k({entityIndex:this._entityIndex});if(e instanceof k&&e._entityIndex===this._entityIndex){const t=new k({entityIndex:this._entityIndex}),r=O(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 B&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new k({entityIndex:this._entityIndex});for(const r of this)e(r,this)&&t.add(r);return t}intersection(e){if(e instanceof B&&(e=e.filtered),e===this){const e=new k({entityIndex:this._entityIndex});return e._graphs=Q(Object.create(null),this._graphs),e._size=this._size,e}if(e instanceof k&&this._entityIndex===e._entityIndex){const t=new k({entityIndex:this._entityIndex}),r=S(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 k({entityIndex:this._entityIndex});for(const r of this)t.add(e(r,this));return t}reduce(e,t){const r=this.readQuads();let i=void 0===t?r.next().value:t;for(const s of r)i=e(i,s,this);return i}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return(new x).quadsToString(this)}union(e){const t=new k({entityIndex:this._entityIndex});return t._graphs=Q(Object.create(null),this._graphs),t._size=this._size,t.addAll(e),t}*[Symbol.iterator](){yield*this.readQuads()}}function P(e,t,r=0){const i=t[r];if(i&&!(i in e))return!1;let s=!1;for(const n in i?{[i]:e[i]}:e){const i=2===r?null:P(e[n],t,r+1);!1!==i&&(s=s||Object.create(null),s[n]=i)}return s}class B extends T.Readable{constructor(e,t,r,i,s,n){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:r,object:i,graph:s,options:n})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:r,predicate:i,subject:s}=this,n=this._filtered=new k({factory:e._factory,entityIndex:this.options.entityIndex});let o,u,a;if(s&&!(o=n._termToNumericId(s))||i&&!(u=n._termToNumericId(i))||r&&!(a=n._termToNumericId(r)))return n;const c=e._getGraphs(t);for(const h in c){let e,t,r;!o&&u?(t=P(c[h].predicates,[u,a,o]))&&(e=P(c[h].subjects,[o,u,a]),r=P(c[h].objects,[a,o,u])):a?(r=P(c[h].objects,[a,o,u]))&&(e=P(c[h].subjects,[o,u,a]),t=P(c[h].predicates,[u,a,o])):(e=P(c[h].subjects,[o,u,a]))&&(t=P(c[h].predicates,[u,a,o]),r=P(c[h].objects,[a,o,u])),e&&(n._graphs[h]={subjects:e,predicates:t,objects:r})}n._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[$]&&(this[$]=this[Symbol.iterator]());const t=this[$];while(--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,i){return this.filtered.deleteMatches(e,t,r,i)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,t,r,i,s){return this.filtered.every(e,t,r,i,s)}filter(e){return this.filtered.filter(e)}forEach(e,t,r,i,s){return this.filtered.forEach(e,t,r,i,s)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,t,r,i,s){return this.filtered.some(e,t,r,i,s)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(e)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,t){return this.filtered.reduce(e,t)}toString(){return(new x).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,i){return new B(this.filtered,e,t,r,i,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}class F{dataset(e){return new k(e)}}function G(e){const t=[];for(const{subject:r,object:i}of e.match(null,u.Ay.namedNode("http://www.w3.org/2000/10/swap/log#implies"),null,u.Ay.defaultGraph())){const s=[...e.match(null,null,null,r)],n=[...e.match(null,null,null,i)];t.push({premise:s,conclusion:n})}return t}class q{constructor(e){this._store=e}_add(e,t,r,i,s){this._store._addToIndex(i.subjects,e,t,r)&&(this._store._addToIndex(i.predicates,t,r,e),this._store._addToIndex(i.objects,r,e,t),s())}_evaluatePremise(e,t,r,i=0){let s,n,o,u,a;const[c,h,d]=e.premise[i].value,l=t[e.premise[i].content],f=!(o=c.value);for(o in f?l:{[o]:l[o]})if(u=l[o]){for(o in f&&(c.value=Number(o)),s=!(o=h.value),s?u:{[o]:u[o]})if(a=u[o]){for(o in s&&(h.value=Number(o)),n=!(o=d.value),n?a:{[o]:a[o]})n&&(d.value=Number(o)),i===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,i+1);n&&(d.value=null)}s&&(h.value=null)}f&&(c.value=null)}_evaluateRules(e,t,r){for(let i=0;i{r.push([e.subject.value,e.predicate.value,e.object.value,t])}))}const s=e=>{e.forEach((e=>{this._add(e.subject.value,e.predicate.value,e.object.value,t,(()=>{i(e)}))}))};let n;this._evaluateRules(e,t,i);while(void 0!==(n=r.pop())){const[e,r,o,u]=n,a=u.basePremise.subject.value;a||(u.basePremise.subject.value=e);const c=u.basePremise.predicate.value;c||(u.basePremise.predicate.value=r);const h=u.basePremise.object.value;h||(u.basePremise.object.value=o),0===u.premise.length?s(u.conclusion):this._evaluatePremise(u,t,i),a||(u.basePremise.subject.value=null),c||(u.basePremise.predicate.value=null),h||(u.basePremise.object.value=null)}}_createRule({premise:e,conclusion:t}){const r={},i=e=>"Variable"===e.termType?r[e.value]=r[e.value]||{}:{value:this._store._termToNewNumericId(e)},s=e=>({subject:i(e.subject),predicate:i(e.predicate),object:i(e.object)});return{premise:e.map((e=>s(e))),conclusion:t.map((e=>s(e))),variables:Object.values(r)}}reason(e){Array.isArray(e)||(e=G(e)),e=e.map((e=>this._createRule(e)));for(const r of e)for(const t of e)for(let e=0;e{e.value=null}))}}for(const r of e){const e=new Set;r.premise=r.premise.map((t=>z(t,e)))}const t=this._store._getGraphs();for(const r in t)this._reasonGraphNaive(e,t[r]);this._store._size=null}}function z({subject:e,predicate:t,object:r},i){const s=e.value||i.has(e)||(i.add(e),!1),n=t.value||i.has(t)||(i.add(t),!1),o=r.value||i.has(r)||(i.add(r),!1);return!s&&n?{content:"predicates",value:[t,r,e]}:o?{content:"objects",value:[r,e,t]}:{content:"subjects",value:[e,t,r]}}function R(e,t){return null===e.value&&(e.value=t.value),e.value===t.value}var E=r(66731);class L extends T.Transform{constructor(e){super({encoding:"utf8",writableObjectMode:!0});const t=this._writer=new x({write:(e,t,r)=>{this.push(e),r&&r()},end:e=>{this.push(null),e&&e()}},e);this._transform=(e,r,i)=>{t.addQuad(e,i)},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}}var M={Lexer:s.A,Parser:n.A,Writer:x,Store:k,StoreFactory:F,EntityIndex:A,StreamParser:E.A,StreamWriter:L,Util:i,Reasoner:q,DataFactory:u.Ay,Term:u.x1,NamedNode:u.Yo,Literal:u.uS,BlankNode:u.PB,Variable:u.rT,DefaultGraph:u.yV,Quad:u.kO,Triple:u.n7,termFromId:u.iN,termToId:u.FL}}}]); -//# sourceMappingURL=564.9497f0a9.js.map \ No newline at end of file diff --git a/dist/js/564.9497f0a9.js.map b/dist/js/564.9497f0a9.js.map deleted file mode 100644 index bad9b0c..0000000 --- a/dist/js/564.9497f0a9.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"js/564.9497f0a9.js","mappings":"isCAKO,SAASA,EAAYC,GAC1B,QAASA,GAA0B,cAAlBA,EAAKC,QACxB,CAGO,SAASC,EAAYF,GAC1B,QAASA,GAA0B,cAAlBA,EAAKC,QACxB,CAGO,SAASE,EAAUH,GACxB,QAASA,GAA0B,YAAlBA,EAAKC,QACxB,CAGO,SAASG,EAAWJ,GACzB,QAASA,GAA0B,aAAlBA,EAAKC,QACxB,CAGO,SAASI,EAAeL,GAC7B,QAASA,GAA0B,iBAAlBA,EAAKC,QACxB,CAGO,SAASK,EAAeC,GAC7B,OAAOF,EAAeE,EAAKC,MAC7B,CAGO,SAASC,EAAOC,EAAKC,GAC1B,OAAOC,EAAS,CAAE,GAAIF,EAAIG,OAASH,GAAOC,EAAnCC,CAA4C,GACrD,CAGO,SAASA,EAASE,EAAiBH,GAExC,MAAMC,EAAWG,OAAOC,OAAO,MAC/B,IAAK,MAAMP,KAAUK,EACnBG,EAAcR,EAAQK,EAAgBL,IAMxC,SAASQ,EAAcR,EAAQC,GAE7B,GAAmB,kBAARA,EAAkB,CAE3B,MAAMQ,EAAQH,OAAOC,OAAO,MAC5BJ,EAASH,GAAUU,GACVD,EAAMC,KAAWD,EAAMC,GAASR,EAAQS,UAAUV,EAAMS,GAEnE,MACK,KAAMV,KAAUG,GACnB,MAAM,IAAIS,MAAM,mBAAmBZ,KAErC,OAAOG,EAASH,EAClB,CACA,OAlBAE,EAAUA,GAAWW,EAAA,GAkBdL,CACT,CC5DA,MAAMM,EAAeD,EAAA,GAAcE,gBAE7B,IAAEC,EAAG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,IACNC,OAAM,EACNC,MAAK,EACLC,aAAY,EACZC,YAAW,EACXC,aAAY,IACZC,aAAY,EACZC,KAAI,EACJC,SAAQ,EAERC,YAAW,KAEXC,KAAI,KACJC,UAAS,KACTC,QAAO,KACPC,UAAS,KACTC,SAAQ,KACRC,aAAY,KACZC,KAAI,KACJC,OAAM,KAENC,WAAU,KACVC,SAAQ,K","sources":["webpack://mobilitydcatap-ui/./node_modules/n3/src/N3Util.js","webpack://mobilitydcatap-ui/./node_modules/n3/src/N3Writer.js","webpack://mobilitydcatap-ui/./node_modules/n3/src/N3Store.js","webpack://mobilitydcatap-ui/./node_modules/n3/src/N3StoreFactory.js","webpack://mobilitydcatap-ui/./node_modules/n3/src/N3Reasoner.js","webpack://mobilitydcatap-ui/./node_modules/n3/src/N3StreamWriter.js","webpack://mobilitydcatap-ui/./node_modules/n3/src/index.js"],"sourcesContent":["// **N3Util** provides N3 utility functions.\n\nimport N3DataFactory from './N3DataFactory';\n\n// Tests whether the given term represents an IRI\nexport function isNamedNode(term) {\n return !!term && term.termType === 'NamedNode';\n}\n\n// Tests whether the given term represents a blank node\nexport function isBlankNode(term) {\n return !!term && term.termType === 'BlankNode';\n}\n\n// Tests whether the given term represents a literal\nexport function isLiteral(term) {\n return !!term && term.termType === 'Literal';\n}\n\n// Tests whether the given term represents a variable\nexport function isVariable(term) {\n return !!term && term.termType === 'Variable';\n}\n\n// Tests whether the given term represents the default graph\nexport function isDefaultGraph(term) {\n return !!term && term.termType === 'DefaultGraph';\n}\n\n// Tests whether the given quad is in the default graph\nexport function inDefaultGraph(quad) {\n return isDefaultGraph(quad.graph);\n}\n\n// Creates a function that prepends the given IRI to a local name\nexport function prefix(iri, factory) {\n return prefixes({ '': iri.value || iri }, factory)('');\n}\n\n// Creates a function that allows registering and expanding prefixes\nexport function prefixes(defaultPrefixes, factory) {\n // Add all of the default prefixes\n const prefixes = Object.create(null);\n for (const prefix in defaultPrefixes)\n processPrefix(prefix, defaultPrefixes[prefix]);\n // Set the default factory if none was specified\n factory = factory || N3DataFactory;\n\n // Registers a new prefix (if an IRI was specified)\n // or retrieves a function that expands an existing prefix (if no IRI was specified)\n function processPrefix(prefix, iri) {\n // Create a new prefix if an IRI is specified or the prefix doesn't exist\n if (typeof iri === 'string') {\n // Create a function that expands the prefix\n const cache = Object.create(null);\n prefixes[prefix] = local => {\n return cache[local] || (cache[local] = factory.namedNode(iri + local));\n };\n }\n else if (!(prefix in prefixes)) {\n throw new Error(`Unknown prefix: ${prefix}`);\n }\n return prefixes[prefix];\n }\n return processPrefix;\n}\n","// **N3Writer** writes N3 documents.\nimport namespaces from './IRIs';\nimport { default as N3DataFactory, Term } from './N3DataFactory';\nimport { isDefaultGraph } from './N3Util';\n\nconst DEFAULTGRAPH = N3DataFactory.defaultGraph();\n\nconst { rdf, xsd } = namespaces;\n\n// Characters in literals that require escaping\nconst escape = /[\"\\\\\\t\\n\\r\\b\\f\\u0000-\\u0019\\ud800-\\udbff]/,\n escapeAll = /[\"\\\\\\t\\n\\r\\b\\f\\u0000-\\u0019]|[\\ud800-\\udbff][\\udc00-\\udfff]/g,\n escapedCharacters = {\n '\\\\': '\\\\\\\\', '\"': '\\\\\"', '\\t': '\\\\t',\n '\\n': '\\\\n', '\\r': '\\\\r', '\\b': '\\\\b', '\\f': '\\\\f',\n };\n\n// ## Placeholder class to represent already pretty-printed terms\nclass SerializedTerm extends Term {\n // Pretty-printed nodes are not equal to any other node\n // (e.g., [] does not equal [])\n equals(other) {\n return other === this;\n }\n}\n\n// ## Constructor\nexport default class N3Writer {\n constructor(outputStream, options) {\n // ### `_prefixRegex` matches a prefixed name or IRI that begins with one of the added prefixes\n this._prefixRegex = /$0^/;\n\n // Shift arguments if the first argument is not a stream\n if (outputStream && typeof outputStream.write !== 'function')\n options = outputStream, outputStream = null;\n options = options || {};\n this._lists = options.lists;\n\n // If no output stream given, send the output as string through the end callback\n if (!outputStream) {\n let output = '';\n this._outputStream = {\n write(chunk, encoding, done) { output += chunk; done && done(); },\n end: done => { done && done(null, output); },\n };\n this._endStream = true;\n }\n else {\n this._outputStream = outputStream;\n this._endStream = options.end === undefined ? true : !!options.end;\n }\n\n // Initialize writer, depending on the format\n this._subject = null;\n if (!(/triple|quad/i).test(options.format)) {\n this._lineMode = false;\n this._graph = DEFAULTGRAPH;\n this._prefixIRIs = Object.create(null);\n options.prefixes && this.addPrefixes(options.prefixes);\n if (options.baseIRI) {\n this._baseMatcher = new RegExp(`^${escapeRegex(options.baseIRI)\n }${options.baseIRI.endsWith('/') ? '' : '[#?]'}`);\n this._baseLength = options.baseIRI.length;\n }\n }\n else {\n this._lineMode = true;\n this._writeQuad = this._writeQuadLine;\n }\n }\n\n // ## Private methods\n\n // ### Whether the current graph is the default graph\n get _inDefaultGraph() {\n return DEFAULTGRAPH.equals(this._graph);\n }\n\n // ### `_write` writes the argument to the output stream\n _write(string, callback) {\n this._outputStream.write(string, 'utf8', callback);\n }\n\n // ### `_writeQuad` writes the quad to the output stream\n _writeQuad(subject, predicate, object, graph, done) {\n try {\n // Write the graph's label if it has changed\n if (!graph.equals(this._graph)) {\n // Close the previous graph and start the new one\n this._write((this._subject === null ? '' : (this._inDefaultGraph ? '.\\n' : '\\n}\\n')) +\n (DEFAULTGRAPH.equals(graph) ? '' : `${this._encodeIriOrBlank(graph)} {\\n`));\n this._graph = graph;\n this._subject = null;\n }\n // Don't repeat the subject if it's the same\n if (subject.equals(this._subject)) {\n // Don't repeat the predicate if it's the same\n if (predicate.equals(this._predicate))\n this._write(`, ${this._encodeObject(object)}`, done);\n // Same subject, different predicate\n else\n this._write(`;\\n ${\n this._encodePredicate(this._predicate = predicate)} ${\n this._encodeObject(object)}`, done);\n }\n // Different subject; write the whole quad\n else\n this._write(`${(this._subject === null ? '' : '.\\n') +\n this._encodeSubject(this._subject = subject)} ${\n this._encodePredicate(this._predicate = predicate)} ${\n this._encodeObject(object)}`, done);\n }\n catch (error) { done && done(error); }\n }\n\n // ### `_writeQuadLine` writes the quad to the output stream as a single line\n _writeQuadLine(subject, predicate, object, graph, done) {\n // Write the quad without prefixes\n delete this._prefixMatch;\n this._write(this.quadToString(subject, predicate, object, graph), done);\n }\n\n // ### `quadToString` serializes a quad as a string\n quadToString(subject, predicate, object, graph) {\n return `${this._encodeSubject(subject)} ${\n this._encodeIriOrBlank(predicate)} ${\n this._encodeObject(object)\n }${graph && graph.value ? ` ${this._encodeIriOrBlank(graph)} .\\n` : ' .\\n'}`;\n }\n\n // ### `quadsToString` serializes an array of quads as a string\n quadsToString(quads) {\n let quadsString = '';\n for (const quad of quads)\n quadsString += this.quadToString(quad.subject, quad.predicate, quad.object, quad.graph);\n return quadsString;\n }\n\n // ### `_encodeSubject` represents a subject\n _encodeSubject(entity) {\n return entity.termType === 'Quad' ?\n this._encodeQuad(entity) : this._encodeIriOrBlank(entity);\n }\n\n // ### `_encodeIriOrBlank` represents an IRI or blank node\n _encodeIriOrBlank(entity) {\n // A blank node or list is represented as-is\n if (entity.termType !== 'NamedNode') {\n // If it is a list head, pretty-print it\n if (this._lists && (entity.value in this._lists))\n entity = this.list(this._lists[entity.value]);\n return 'id' in entity ? entity.id : `_:${entity.value}`;\n }\n let iri = entity.value;\n // Use relative IRIs if requested and possible\n if (this._baseMatcher && this._baseMatcher.test(iri))\n iri = iri.substr(this._baseLength);\n // Escape special characters\n if (escape.test(iri))\n iri = iri.replace(escapeAll, characterReplacer);\n // Try to represent the IRI as prefixed name\n const prefixMatch = this._prefixRegex.exec(iri);\n return !prefixMatch ? `<${iri}>` :\n (!prefixMatch[1] ? iri : this._prefixIRIs[prefixMatch[1]] + prefixMatch[2]);\n }\n\n // ### `_encodeLiteral` represents a literal\n _encodeLiteral(literal) {\n // Escape special characters\n let value = literal.value;\n if (escape.test(value))\n value = value.replace(escapeAll, characterReplacer);\n\n // Write a language-tagged literal\n if (literal.language)\n return `\"${value}\"@${literal.language}`;\n\n // Write dedicated literals per data type\n if (this._lineMode) {\n // Only abbreviate strings in N-Triples or N-Quads\n if (literal.datatype.value === xsd.string)\n return `\"${value}\"`;\n }\n else {\n // Use common datatype abbreviations in Turtle or TriG\n switch (literal.datatype.value) {\n case xsd.string:\n return `\"${value}\"`;\n case xsd.boolean:\n if (value === 'true' || value === 'false')\n return value;\n break;\n case xsd.integer:\n if (/^[+-]?\\d+$/.test(value))\n return value;\n break;\n case xsd.decimal:\n if (/^[+-]?\\d*\\.\\d+$/.test(value))\n return value;\n break;\n case xsd.double:\n if (/^[+-]?(?:\\d+\\.\\d*|\\.?\\d+)[eE][+-]?\\d+$/.test(value))\n return value;\n break;\n }\n }\n\n // Write a regular datatyped literal\n return `\"${value}\"^^${this._encodeIriOrBlank(literal.datatype)}`;\n }\n\n // ### `_encodePredicate` represents a predicate\n _encodePredicate(predicate) {\n return predicate.value === rdf.type ? 'a' : this._encodeIriOrBlank(predicate);\n }\n\n // ### `_encodeObject` represents an object\n _encodeObject(object) {\n switch (object.termType) {\n case 'Quad':\n return this._encodeQuad(object);\n case 'Literal':\n return this._encodeLiteral(object);\n default:\n return this._encodeIriOrBlank(object);\n }\n }\n\n // ### `_encodeQuad` encodes an RDF-star quad\n _encodeQuad({ subject, predicate, object, graph }) {\n return `<<${\n this._encodeSubject(subject)} ${\n this._encodePredicate(predicate)} ${\n this._encodeObject(object)}${\n isDefaultGraph(graph) ? '' : ` ${this._encodeIriOrBlank(graph)}`}>>`;\n }\n\n // ### `_blockedWrite` replaces `_write` after the writer has been closed\n _blockedWrite() {\n throw new Error('Cannot write because the writer has been closed.');\n }\n\n // ### `addQuad` adds the quad to the output stream\n addQuad(subject, predicate, object, graph, done) {\n // The quad was given as an object, so shift parameters\n if (object === undefined)\n this._writeQuad(subject.subject, subject.predicate, subject.object, subject.graph, predicate);\n // The optional `graph` parameter was not provided\n else if (typeof graph === 'function')\n this._writeQuad(subject, predicate, object, DEFAULTGRAPH, graph);\n // The `graph` parameter was provided\n else\n this._writeQuad(subject, predicate, object, graph || DEFAULTGRAPH, done);\n }\n\n // ### `addQuads` adds the quads to the output stream\n addQuads(quads) {\n for (let i = 0; i < quads.length; i++)\n this.addQuad(quads[i]);\n }\n\n // ### `addPrefix` adds the prefix to the output stream\n addPrefix(prefix, iri, done) {\n const prefixes = {};\n prefixes[prefix] = iri;\n this.addPrefixes(prefixes, done);\n }\n\n // ### `addPrefixes` adds the prefixes to the output stream\n addPrefixes(prefixes, done) {\n // Ignore prefixes if not supported by the serialization\n if (!this._prefixIRIs)\n return done && done();\n\n // Write all new prefixes\n let hasPrefixes = false;\n for (let prefix in prefixes) {\n let iri = prefixes[prefix];\n if (typeof iri !== 'string')\n iri = iri.value;\n hasPrefixes = true;\n // Finish a possible pending quad\n if (this._subject !== null) {\n this._write(this._inDefaultGraph ? '.\\n' : '\\n}\\n');\n this._subject = null, this._graph = '';\n }\n // Store and write the prefix\n this._prefixIRIs[iri] = (prefix += ':');\n this._write(`@prefix ${prefix} <${iri}>.\\n`);\n }\n // Recreate the prefix matcher\n if (hasPrefixes) {\n let IRIlist = '', prefixList = '';\n for (const prefixIRI in this._prefixIRIs) {\n IRIlist += IRIlist ? `|${prefixIRI}` : prefixIRI;\n prefixList += (prefixList ? '|' : '') + this._prefixIRIs[prefixIRI];\n }\n IRIlist = escapeRegex(IRIlist, /[\\]\\/\\(\\)\\*\\+\\?\\.\\\\\\$]/g, '\\\\$&');\n this._prefixRegex = new RegExp(`^(?:${prefixList})[^\\/]*$|` +\n `^(${IRIlist})([_a-zA-Z0-9][\\\\-_a-zA-Z0-9]*)$`);\n }\n // End a prefix block with a newline\n this._write(hasPrefixes ? '\\n' : '', done);\n }\n\n // ### `blank` creates a blank node with the given content\n blank(predicate, object) {\n let children = predicate, child, length;\n // Empty blank node\n if (predicate === undefined)\n children = [];\n // Blank node passed as blank(Term(\"predicate\"), Term(\"object\"))\n else if (predicate.termType)\n children = [{ predicate: predicate, object: object }];\n // Blank node passed as blank({ predicate: predicate, object: object })\n else if (!('length' in predicate))\n children = [predicate];\n\n switch (length = children.length) {\n // Generate an empty blank node\n case 0:\n return new SerializedTerm('[]');\n // Generate a non-nested one-triple blank node\n case 1:\n child = children[0];\n if (!(child.object instanceof SerializedTerm))\n return new SerializedTerm(`[ ${this._encodePredicate(child.predicate)} ${\n this._encodeObject(child.object)} ]`);\n // Generate a multi-triple or nested blank node\n default:\n let contents = '[';\n // Write all triples in order\n for (let i = 0; i < length; i++) {\n child = children[i];\n // Write only the object is the predicate is the same as the previous\n if (child.predicate.equals(predicate))\n contents += `, ${this._encodeObject(child.object)}`;\n // Otherwise, write the predicate and the object\n else {\n contents += `${(i ? ';\\n ' : '\\n ') +\n this._encodePredicate(child.predicate)} ${\n this._encodeObject(child.object)}`;\n predicate = child.predicate;\n }\n }\n return new SerializedTerm(`${contents}\\n]`);\n }\n }\n\n // ### `list` creates a list node with the given content\n list(elements) {\n const length = elements && elements.length || 0, contents = new Array(length);\n for (let i = 0; i < length; i++)\n contents[i] = this._encodeObject(elements[i]);\n return new SerializedTerm(`(${contents.join(' ')})`);\n }\n\n // ### `end` signals the end of the output stream\n end(done) {\n // Finish a possible pending quad\n if (this._subject !== null) {\n this._write(this._inDefaultGraph ? '.\\n' : '\\n}\\n');\n this._subject = null;\n }\n // Disallow further writing\n this._write = this._blockedWrite;\n\n // Try to end the underlying stream, ensuring done is called exactly one time\n let singleDone = done && ((error, result) => { singleDone = null, done(error, result); });\n if (this._endStream) {\n try { return this._outputStream.end(singleDone); }\n catch (error) { /* error closing stream */ }\n }\n singleDone && singleDone();\n }\n}\n\n// Replaces a character by its escaped version\nfunction characterReplacer(character) {\n // Replace a single character by its escaped version\n let result = escapedCharacters[character];\n if (result === undefined) {\n // Replace a single character with its 4-bit unicode escape sequence\n if (character.length === 1) {\n result = character.charCodeAt(0).toString(16);\n result = '\\\\u0000'.substr(0, 6 - result.length) + result;\n }\n // Replace a surrogate pair with its 8-bit unicode escape sequence\n else {\n result = ((character.charCodeAt(0) - 0xD800) * 0x400 +\n character.charCodeAt(1) + 0x2400).toString(16);\n result = '\\\\U00000000'.substr(0, 10 - result.length) + result;\n }\n }\n return result;\n}\n\nfunction escapeRegex(regex) {\n return regex.replace(/[\\]\\/\\(\\)\\*\\+\\?\\.\\\\\\$]/g, '\\\\$&');\n}\n","// **N3Store** objects store N3 quads by graph in memory.\nimport { Readable } from 'readable-stream';\nimport { default as N3DataFactory, termToId, termFromId } from './N3DataFactory';\nimport namespaces from './IRIs';\nimport { isDefaultGraph } from './N3Util';\nimport N3Writer from './N3Writer';\n\nconst ITERATOR = Symbol('iter');\n\nfunction merge(target, source, depth = 4) {\n if (depth === 0)\n return Object.assign(target, source);\n\n for (const key in source)\n target[key] = merge(target[key] || Object.create(null), source[key], depth - 1);\n\n return target;\n}\n\n/**\n * Determines the intersection of the `_graphs` index s1 and s2.\n * s1 and s2 *must* belong to Stores that share an `_entityIndex`.\n *\n * False is returned when there is no intersection; this should\n * *not* be set as the value for an index.\n */\nfunction intersect(s1, s2, depth = 4) {\n let target = false;\n\n for (const key in s1) {\n if (key in s2) {\n const intersection = depth === 0 ? null : intersect(s1[key], s2[key], depth - 1);\n if (intersection !== false) {\n target = target || Object.create(null);\n target[key] = intersection;\n }\n // Depth 3 is the 'subjects', 'predicates' and 'objects' keys.\n // If the 'subjects' index is empty, so will the 'predicates' and 'objects' index.\n else if (depth === 3) {\n return false;\n }\n }\n }\n\n return target;\n}\n\n/**\n * Determines the difference of the `_graphs` index s1 and s2.\n * s1 and s2 *must* belong to Stores that share an `_entityIndex`.\n *\n * False is returned when there is no difference; this should\n * *not* be set as the value for an index.\n */\nfunction difference(s1, s2, depth = 4) {\n let target = false;\n\n for (const key in s1) {\n // When the key is not in the index, then none of the triples defined by s1[key] are\n // in s2 and so we want to copy them over to the resultant store.\n if (!(key in s2)) {\n target = target || Object.create(null);\n target[key] = depth === 0 ? null : merge({}, s1[key], depth - 1);\n }\n else if (depth !== 0) {\n const diff = difference(s1[key], s2[key], depth - 1);\n if (diff !== false) {\n target = target || Object.create(null);\n target[key] = diff;\n }\n // Depth 3 is the 'subjects', 'predicates' and 'objects' keys.\n // If the 'subjects' index is empty, so will the 'predicates' and 'objects' index.\n else if (depth === 3) {\n return false;\n }\n }\n }\n\n return target;\n}\n\n// ## Constructor\nexport class N3EntityIndex {\n constructor(options = {}) {\n this._id = 1;\n // `_ids` maps entities such as `http://xmlns.com/foaf/0.1/name` to numbers,\n // saving memory by using only numbers as keys in `_graphs`\n this._ids = Object.create(null);\n this._ids[''] = 1;\n // inverse of `_ids`\n this._entities = Object.create(null);\n this._entities[1] = '';\n // `_blankNodeIndex` is the index of the last automatically named blank node\n this._blankNodeIndex = 0;\n this._factory = options.factory || N3DataFactory;\n }\n\n _termFromId(id) {\n if (id[0] === '.') {\n const entities = this._entities;\n const terms = id.split('.');\n const q = this._factory.quad(\n this._termFromId(entities[terms[1]]),\n this._termFromId(entities[terms[2]]),\n this._termFromId(entities[terms[3]]),\n terms[4] && this._termFromId(entities[terms[4]]),\n );\n return q;\n }\n return termFromId(id, this._factory);\n }\n\n _termToNumericId(term) {\n if (term.termType === 'Quad') {\n const s = this._termToNumericId(term.subject),\n p = this._termToNumericId(term.predicate),\n o = this._termToNumericId(term.object);\n let g;\n\n return s && p && o && (isDefaultGraph(term.graph) || (g = this._termToNumericId(term.graph))) &&\n this._ids[g ? `.${s}.${p}.${o}.${g}` : `.${s}.${p}.${o}`];\n }\n return this._ids[termToId(term)];\n }\n\n _termToNewNumericId(term) {\n // This assumes that no graph term is present - we may wish to error if there is one\n const str = term && term.termType === 'Quad' ?\n `.${this._termToNewNumericId(term.subject)}.${this._termToNewNumericId(term.predicate)}.${this._termToNewNumericId(term.object)}${\n isDefaultGraph(term.graph) ? '' : `.${this._termToNewNumericId(term.graph)}`\n }`\n : termToId(term);\n\n return this._ids[str] || (this._ids[this._entities[++this._id] = str] = this._id);\n }\n\n createBlankNode(suggestedName) {\n let name, index;\n // Generate a name based on the suggested name\n if (suggestedName) {\n name = suggestedName = `_:${suggestedName}`, index = 1;\n while (this._ids[name])\n name = suggestedName + index++;\n }\n // Generate a generic blank node name\n else {\n do { name = `_:b${this._blankNodeIndex++}`; }\n while (this._ids[name]);\n }\n // Add the blank node to the entities, avoiding the generation of duplicates\n this._ids[name] = ++this._id;\n this._entities[this._id] = name;\n return this._factory.blankNode(name.substr(2));\n }\n}\n\n// ## Constructor\nexport default class N3Store {\n constructor(quads, options) {\n // The number of quads is initially zero\n this._size = 0;\n // `_graphs` contains subject, predicate, and object indexes per graph\n this._graphs = Object.create(null);\n\n // Shift parameters if `quads` is not given\n if (!options && quads && !quads[0])\n options = quads, quads = null;\n options = options || {};\n this._factory = options.factory || N3DataFactory;\n this._entityIndex = options.entityIndex || new N3EntityIndex({ factory: this._factory });\n this._entities = this._entityIndex._entities;\n this._termFromId = this._entityIndex._termFromId.bind(this._entityIndex);\n this._termToNumericId = this._entityIndex._termToNumericId.bind(this._entityIndex);\n this._termToNewNumericId = this._entityIndex._termToNewNumericId.bind(this._entityIndex);\n\n // Add quads if passed\n if (quads)\n this.addQuads(quads);\n }\n\n // ## Public properties\n\n // ### `size` returns the number of quads in the store\n get size() {\n // Return the quad count if if was cached\n let size = this._size;\n if (size !== null)\n return size;\n\n // Calculate the number of quads by counting to the deepest level\n size = 0;\n const graphs = this._graphs;\n let subjects, subject;\n for (const graphKey in graphs)\n for (const subjectKey in (subjects = graphs[graphKey].subjects))\n for (const predicateKey in (subject = subjects[subjectKey]))\n size += Object.keys(subject[predicateKey]).length;\n return this._size = size;\n }\n\n // ## Private methods\n\n // ### `_addToIndex` adds a quad to a three-layered index.\n // Returns if the index has changed, if the entry did not already exist.\n _addToIndex(index0, key0, key1, key2) {\n // Create layers as necessary\n const index1 = index0[key0] || (index0[key0] = {});\n const index2 = index1[key1] || (index1[key1] = {});\n // Setting the key to _any_ value signals the presence of the quad\n const existed = key2 in index2;\n if (!existed)\n index2[key2] = null;\n return !existed;\n }\n\n // ### `_removeFromIndex` removes a quad from a three-layered index\n _removeFromIndex(index0, key0, key1, key2) {\n // Remove the quad from the index\n const index1 = index0[key0], index2 = index1[key1];\n delete index2[key2];\n\n // Remove intermediary index layers if they are empty\n for (const key in index2) return;\n delete index1[key1];\n for (const key in index1) return;\n delete index0[key0];\n }\n\n // ### `_findInIndex` finds a set of quads in a three-layered index.\n // The index base is `index0` and the keys at each level are `key0`, `key1`, and `key2`.\n // Any of these keys can be undefined, which is interpreted as a wildcard.\n // `name0`, `name1`, and `name2` are the names of the keys at each level,\n // used when reconstructing the resulting quad\n // (for instance: _subject_, _predicate_, and _object_).\n // Finally, `graphId` will be the graph of the created quads.\n *_findInIndex(index0, key0, key1, key2, name0, name1, name2, graphId) {\n let tmp, index1, index2;\n const entityKeys = this._entities;\n const graph = this._termFromId(entityKeys[graphId]);\n const parts = { subject: null, predicate: null, object: null };\n\n // If a key is specified, use only that part of index 0.\n if (key0) (tmp = index0, index0 = {})[key0] = tmp[key0];\n for (const value0 in index0) {\n if (index1 = index0[value0]) {\n parts[name0] = this._termFromId(entityKeys[value0]);\n // If a key is specified, use only that part of index 1.\n if (key1) (tmp = index1, index1 = {})[key1] = tmp[key1];\n for (const value1 in index1) {\n if (index2 = index1[value1]) {\n parts[name1] = this._termFromId(entityKeys[value1]);\n // If a key is specified, use only that part of index 2, if it exists.\n const values = key2 ? (key2 in index2 ? [key2] : []) : Object.keys(index2);\n // Create quads for all items found in index 2.\n for (let l = 0; l < values.length; l++) {\n parts[name2] = this._termFromId(entityKeys[values[l]]);\n yield this._factory.quad(parts.subject, parts.predicate, parts.object, graph);\n }\n }\n }\n }\n }\n }\n\n // ### `_loop` executes the callback on all keys of index 0\n _loop(index0, callback) {\n for (const key0 in index0)\n callback(key0);\n }\n\n // ### `_loopByKey0` executes the callback on all keys of a certain entry in index 0\n _loopByKey0(index0, key0, callback) {\n let index1, key1;\n if (index1 = index0[key0]) {\n for (key1 in index1)\n callback(key1);\n }\n }\n\n // ### `_loopByKey1` executes the callback on given keys of all entries in index 0\n _loopByKey1(index0, key1, callback) {\n let key0, index1;\n for (key0 in index0) {\n index1 = index0[key0];\n if (index1[key1])\n callback(key0);\n }\n }\n\n // ### `_loopBy2Keys` executes the callback on given keys of certain entries in index 2\n _loopBy2Keys(index0, key0, key1, callback) {\n let index1, index2, key2;\n if ((index1 = index0[key0]) && (index2 = index1[key1])) {\n for (key2 in index2)\n callback(key2);\n }\n }\n\n // ### `_countInIndex` counts matching quads in a three-layered index.\n // The index base is `index0` and the keys at each level are `key0`, `key1`, and `key2`.\n // Any of these keys can be undefined, which is interpreted as a wildcard.\n _countInIndex(index0, key0, key1, key2) {\n let count = 0, tmp, index1, index2;\n\n // If a key is specified, count only that part of index 0\n if (key0) (tmp = index0, index0 = {})[key0] = tmp[key0];\n for (const value0 in index0) {\n if (index1 = index0[value0]) {\n // If a key is specified, count only that part of index 1\n if (key1) (tmp = index1, index1 = {})[key1] = tmp[key1];\n for (const value1 in index1) {\n if (index2 = index1[value1]) {\n // If a key is specified, count the quad if it exists\n if (key2) (key2 in index2) && count++;\n // Otherwise, count all quads\n else count += Object.keys(index2).length;\n }\n }\n }\n }\n return count;\n }\n\n // ### `_getGraphs` returns an array with the given graph,\n // or all graphs if the argument is null or undefined.\n _getGraphs(graph) {\n graph = graph === '' ? 1 : (graph && (this._termToNumericId(graph) || -1));\n return typeof graph !== 'number' ? this._graphs : { [graph]: this._graphs[graph] };\n }\n\n // ### `_uniqueEntities` returns a function that accepts an entity ID\n // and passes the corresponding entity to callback if it hasn't occurred before.\n _uniqueEntities(callback) {\n const uniqueIds = Object.create(null);\n return id => {\n if (!(id in uniqueIds)) {\n uniqueIds[id] = true;\n callback(this._termFromId(this._entities[id], this._factory));\n }\n };\n }\n\n // ## Public methods\n\n // ### `add` adds the specified quad to the dataset.\n // Returns the dataset instance it was called on.\n // Existing quads, as defined in Quad.equals, will be ignored.\n add(quad) {\n this.addQuad(quad);\n return this;\n }\n\n // ### `addQuad` adds a new quad to the store.\n // Returns if the quad index has changed, if the quad did not already exist.\n addQuad(subject, predicate, object, graph) {\n // Shift arguments if a quad object is given instead of components\n if (!predicate)\n graph = subject.graph, object = subject.object,\n predicate = subject.predicate, subject = subject.subject;\n\n // Convert terms to internal string representation\n graph = graph ? this._termToNewNumericId(graph) : 1;\n\n // Find the graph that will contain the triple\n let graphItem = this._graphs[graph];\n // Create the graph if it doesn't exist yet\n if (!graphItem) {\n graphItem = this._graphs[graph] = { subjects: {}, predicates: {}, objects: {} };\n // Freezing a graph helps subsequent `add` performance,\n // and properties will never be modified anyway\n Object.freeze(graphItem);\n }\n\n // Since entities can often be long IRIs, we avoid storing them in every index.\n // Instead, we have a separate index that maps entities to numbers,\n // which are then used as keys in the other indexes.\n subject = this._termToNewNumericId(subject);\n predicate = this._termToNewNumericId(predicate);\n object = this._termToNewNumericId(object);\n\n if (!this._addToIndex(graphItem.subjects, subject, predicate, object))\n return false;\n this._addToIndex(graphItem.predicates, predicate, object, subject);\n this._addToIndex(graphItem.objects, object, subject, predicate);\n\n // The cached quad count is now invalid\n this._size = null;\n return true;\n }\n\n // ### `addQuads` adds multiple quads to the store\n addQuads(quads) {\n for (let i = 0; i < quads.length; i++)\n this.addQuad(quads[i]);\n }\n\n // ### `delete` removes the specified quad from the dataset.\n // Returns the dataset instance it was called on.\n delete(quad) {\n this.removeQuad(quad);\n return this;\n }\n\n // ### `has` determines whether a dataset includes a certain quad or quad pattern.\n has(subjectOrQuad, predicate, object, graph) {\n if (subjectOrQuad && subjectOrQuad.subject)\n ({ subject: subjectOrQuad, predicate, object, graph } = subjectOrQuad);\n return !this.readQuads(subjectOrQuad, predicate, object, graph).next().done;\n }\n\n // ### `import` adds a stream of quads to the store\n import(stream) {\n stream.on('data', quad => { this.addQuad(quad); });\n return stream;\n }\n\n // ### `removeQuad` removes a quad from the store if it exists\n removeQuad(subject, predicate, object, graph) {\n // Shift arguments if a quad object is given instead of components\n if (!predicate)\n ({ subject, predicate, object, graph } = subject);\n // Convert terms to internal string representation\n graph = graph ? this._termToNumericId(graph) : 1;\n\n // Find internal identifiers for all components\n // and verify the quad exists.\n const graphs = this._graphs;\n let graphItem, subjects, predicates;\n if (!(subject = subject && this._termToNumericId(subject)) || !(predicate = predicate && this._termToNumericId(predicate)) ||\n !(object = object && this._termToNumericId(object)) || !(graphItem = graphs[graph]) ||\n !(subjects = graphItem.subjects[subject]) ||\n !(predicates = subjects[predicate]) ||\n !(object in predicates))\n return false;\n\n // Remove it from all indexes\n this._removeFromIndex(graphItem.subjects, subject, predicate, object);\n this._removeFromIndex(graphItem.predicates, predicate, object, subject);\n this._removeFromIndex(graphItem.objects, object, subject, predicate);\n if (this._size !== null) this._size--;\n\n // Remove the graph if it is empty\n for (subject in graphItem.subjects) return true;\n delete graphs[graph];\n return true;\n }\n\n // ### `removeQuads` removes multiple quads from the store\n removeQuads(quads) {\n for (let i = 0; i < quads.length; i++)\n this.removeQuad(quads[i]);\n }\n\n // ### `remove` removes a stream of quads from the store\n remove(stream) {\n stream.on('data', quad => { this.removeQuad(quad); });\n return stream;\n }\n\n // ### `removeMatches` removes all matching quads from the store\n // Setting any field to `undefined` or `null` indicates a wildcard.\n removeMatches(subject, predicate, object, graph) {\n const stream = new Readable({ objectMode: true });\n\n const iterable = this.readQuads(subject, predicate, object, graph);\n stream._read = size => {\n while (--size >= 0) {\n const { done, value } = iterable.next();\n if (done) {\n stream.push(null);\n return;\n }\n stream.push(value);\n }\n };\n\n return this.remove(stream);\n }\n\n // ### `deleteGraph` removes all triples with the given graph from the store\n deleteGraph(graph) {\n return this.removeMatches(null, null, null, graph);\n }\n\n // ### `getQuads` returns an array of quads matching a pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n getQuads(subject, predicate, object, graph) {\n return [...this.readQuads(subject, predicate, object, graph)];\n }\n\n /**\n * `readQuads` returns a generator of quads matching a pattern.\n * Setting any field to `undefined` or `null` indicates a wildcard.\n * @deprecated Use `match` instead.\n */\n *readQuads(subject, predicate, object, graph) {\n const graphs = this._getGraphs(graph);\n let content, subjectId, predicateId, objectId;\n\n // Translate IRIs to internal index keys.\n if (subject && !(subjectId = this._termToNumericId(subject)) ||\n predicate && !(predicateId = this._termToNumericId(predicate)) ||\n object && !(objectId = this._termToNumericId(object)))\n return;\n\n for (const graphId in graphs) {\n // Only if the specified graph contains triples, there can be results\n if (content = graphs[graphId]) {\n // Choose the optimal index, based on what fields are present\n if (subjectId) {\n if (objectId)\n // If subject and object are given, the object index will be the fastest\n yield* this._findInIndex(content.objects, objectId, subjectId, predicateId,\n 'object', 'subject', 'predicate', graphId);\n else\n // If only subject and possibly predicate are given, the subject index will be the fastest\n yield* this._findInIndex(content.subjects, subjectId, predicateId, null,\n 'subject', 'predicate', 'object', graphId);\n }\n else if (predicateId)\n // If only predicate and possibly object are given, the predicate index will be the fastest\n yield* this._findInIndex(content.predicates, predicateId, objectId, null,\n 'predicate', 'object', 'subject', graphId);\n else if (objectId)\n // If only object is given, the object index will be the fastest\n yield* this._findInIndex(content.objects, objectId, null, null,\n 'object', 'subject', 'predicate', graphId);\n else\n // If nothing is given, iterate subjects and predicates first\n yield* this._findInIndex(content.subjects, null, null, null,\n 'subject', 'predicate', 'object', graphId);\n }\n }\n }\n\n // ### `match` returns a new dataset that is comprised of all quads in the current instance matching the given arguments.\n // The logic described in Quad Matching is applied for each quad in this dataset to check if it should be included in the output dataset.\n // Note: This method always returns a new DatasetCore, even if that dataset contains no quads.\n // Note: Since a DatasetCore is an unordered set, the order of the quads within the returned sequence is arbitrary.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n // For backwards compatibility, the object return also implements the Readable stream interface.\n match(subject, predicate, object, graph) {\n return new DatasetCoreAndReadableStream(this, subject, predicate, object, graph, { entityIndex: this._entityIndex });\n }\n\n // ### `countQuads` returns the number of quads matching a pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n countQuads(subject, predicate, object, graph) {\n const graphs = this._getGraphs(graph);\n let count = 0, content, subjectId, predicateId, objectId;\n\n // Translate IRIs to internal index keys.\n if (subject && !(subjectId = this._termToNumericId(subject)) ||\n predicate && !(predicateId = this._termToNumericId(predicate)) ||\n object && !(objectId = this._termToNumericId(object)))\n return 0;\n\n for (const graphId in graphs) {\n // Only if the specified graph contains triples, there can be results\n if (content = graphs[graphId]) {\n // Choose the optimal index, based on what fields are present\n if (subject) {\n if (object)\n // If subject and object are given, the object index will be the fastest\n count += this._countInIndex(content.objects, objectId, subjectId, predicateId);\n else\n // If only subject and possibly predicate are given, the subject index will be the fastest\n count += this._countInIndex(content.subjects, subjectId, predicateId, objectId);\n }\n else if (predicate) {\n // If only predicate and possibly object are given, the predicate index will be the fastest\n count += this._countInIndex(content.predicates, predicateId, objectId, subjectId);\n }\n else {\n // If only object is possibly given, the object index will be the fastest\n count += this._countInIndex(content.objects, objectId, subjectId, predicateId);\n }\n }\n }\n return count;\n }\n\n // ### `forEach` executes the callback on all quads.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n forEach(callback, subject, predicate, object, graph) {\n this.some(quad => {\n callback(quad, this);\n return false;\n }, subject, predicate, object, graph);\n }\n\n // ### `every` executes the callback on all quads,\n // and returns `true` if it returns truthy for all them.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n every(callback, subject, predicate, object, graph) {\n return !this.some(quad => !callback(quad, this), subject, predicate, object, graph);\n }\n\n // ### `some` executes the callback on all quads,\n // and returns `true` if it returns truthy for any of them.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n some(callback, subject, predicate, object, graph) {\n for (const quad of this.readQuads(subject, predicate, object, graph))\n if (callback(quad))\n return true;\n return false;\n }\n\n // ### `getSubjects` returns all subjects that match the pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n getSubjects(predicate, object, graph) {\n const results = [];\n this.forSubjects(s => { results.push(s); }, predicate, object, graph);\n return results;\n }\n\n // ### `forSubjects` executes the callback on all subjects that match the pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n forSubjects(callback, predicate, object, graph) {\n const graphs = this._getGraphs(graph);\n let content, predicateId, objectId;\n callback = this._uniqueEntities(callback);\n\n // Translate IRIs to internal index keys.\n if (predicate && !(predicateId = this._termToNumericId(predicate)) ||\n object && !(objectId = this._termToNumericId(object)))\n return;\n\n for (graph in graphs) {\n // Only if the specified graph contains triples, there can be results\n if (content = graphs[graph]) {\n // Choose optimal index based on which fields are wildcards\n if (predicateId) {\n if (objectId)\n // If predicate and object are given, the POS index is best.\n this._loopBy2Keys(content.predicates, predicateId, objectId, callback);\n else\n // If only predicate is given, the SPO index is best.\n this._loopByKey1(content.subjects, predicateId, callback);\n }\n else if (objectId)\n // If only object is given, the OSP index is best.\n this._loopByKey0(content.objects, objectId, callback);\n else\n // If no params given, iterate all the subjects\n this._loop(content.subjects, callback);\n }\n }\n }\n\n // ### `getPredicates` returns all predicates that match the pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n getPredicates(subject, object, graph) {\n const results = [];\n this.forPredicates(p => { results.push(p); }, subject, object, graph);\n return results;\n }\n\n // ### `forPredicates` executes the callback on all predicates that match the pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n forPredicates(callback, subject, object, graph) {\n const graphs = this._getGraphs(graph);\n let content, subjectId, objectId;\n callback = this._uniqueEntities(callback);\n\n // Translate IRIs to internal index keys.\n if (subject && !(subjectId = this._termToNumericId(subject)) ||\n object && !(objectId = this._termToNumericId(object)))\n return;\n\n for (graph in graphs) {\n // Only if the specified graph contains triples, there can be results\n if (content = graphs[graph]) {\n // Choose optimal index based on which fields are wildcards\n if (subjectId) {\n if (objectId)\n // If subject and object are given, the OSP index is best.\n this._loopBy2Keys(content.objects, objectId, subjectId, callback);\n else\n // If only subject is given, the SPO index is best.\n this._loopByKey0(content.subjects, subjectId, callback);\n }\n else if (objectId)\n // If only object is given, the POS index is best.\n this._loopByKey1(content.predicates, objectId, callback);\n else\n // If no params given, iterate all the predicates.\n this._loop(content.predicates, callback);\n }\n }\n }\n\n // ### `getObjects` returns all objects that match the pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n getObjects(subject, predicate, graph) {\n const results = [];\n this.forObjects(o => { results.push(o); }, subject, predicate, graph);\n return results;\n }\n\n // ### `forObjects` executes the callback on all objects that match the pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n forObjects(callback, subject, predicate, graph) {\n const graphs = this._getGraphs(graph);\n let content, subjectId, predicateId;\n callback = this._uniqueEntities(callback);\n\n // Translate IRIs to internal index keys.\n if (subject && !(subjectId = this._termToNumericId(subject)) ||\n predicate && !(predicateId = this._termToNumericId(predicate)))\n return;\n\n for (graph in graphs) {\n // Only if the specified graph contains triples, there can be results\n if (content = graphs[graph]) {\n // Choose optimal index based on which fields are wildcards\n if (subjectId) {\n if (predicateId)\n // If subject and predicate are given, the SPO index is best.\n this._loopBy2Keys(content.subjects, subjectId, predicateId, callback);\n else\n // If only subject is given, the OSP index is best.\n this._loopByKey1(content.objects, subjectId, callback);\n }\n else if (predicateId)\n // If only predicate is given, the POS index is best.\n this._loopByKey0(content.predicates, predicateId, callback);\n else\n // If no params given, iterate all the objects.\n this._loop(content.objects, callback);\n }\n }\n }\n\n // ### `getGraphs` returns all graphs that match the pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n getGraphs(subject, predicate, object) {\n const results = [];\n this.forGraphs(g => { results.push(g); }, subject, predicate, object);\n return results;\n }\n\n // ### `forGraphs` executes the callback on all graphs that match the pattern.\n // Setting any field to `undefined` or `null` indicates a wildcard.\n forGraphs(callback, subject, predicate, object) {\n for (const graph in this._graphs) {\n this.some(quad => {\n callback(quad.graph);\n return true; // Halt iteration of some()\n }, subject, predicate, object, this._termFromId(this._entities[graph]));\n }\n }\n\n // ### `createBlankNode` creates a new blank node, returning its name\n createBlankNode(suggestedName) {\n return this._entityIndex.createBlankNode(suggestedName);\n }\n\n // ### `extractLists` finds and removes all list triples\n // and returns the items per list.\n extractLists({ remove = false, ignoreErrors = false } = {}) {\n const lists = {}; // has scalar keys so could be a simple Object\n const onError = ignoreErrors ? (() => true) :\n ((node, message) => { throw new Error(`${node.value} ${message}`); });\n\n // Traverse each list from its tail\n const tails = this.getQuads(null, namespaces.rdf.rest, namespaces.rdf.nil, null);\n const toRemove = remove ? [...tails] : [];\n tails.forEach(tailQuad => {\n const items = []; // the members found as objects of rdf:first quads\n let malformed = false; // signals whether the current list is malformed\n let head; // the head of the list (_:b1 in above example)\n let headPos; // set to subject or object when head is set\n const graph = tailQuad.graph; // make sure list is in exactly one graph\n\n // Traverse the list from tail to end\n let current = tailQuad.subject;\n while (current && !malformed) {\n const objectQuads = this.getQuads(null, null, current, null);\n const subjectQuads = this.getQuads(current, null, null, null);\n let quad, first = null, rest = null, parent = null;\n\n // Find the first and rest of this list node\n for (let i = 0; i < subjectQuads.length && !malformed; i++) {\n quad = subjectQuads[i];\n if (!quad.graph.equals(graph))\n malformed = onError(current, 'not confined to single graph');\n else if (head)\n malformed = onError(current, 'has non-list arcs out');\n\n // one rdf:first\n else if (quad.predicate.value === namespaces.rdf.first) {\n if (first)\n malformed = onError(current, 'has multiple rdf:first arcs');\n else\n toRemove.push(first = quad);\n }\n\n // one rdf:rest\n else if (quad.predicate.value === namespaces.rdf.rest) {\n if (rest)\n malformed = onError(current, 'has multiple rdf:rest arcs');\n else\n toRemove.push(rest = quad);\n }\n\n // alien triple\n else if (objectQuads.length)\n malformed = onError(current, 'can\\'t be subject and object');\n else {\n head = quad; // e.g. { (1 2 3) :p :o }\n headPos = 'subject';\n }\n }\n\n // { :s :p (1 2) } arrives here with no head\n // { (1 2) :p :o } arrives here with head set to the list.\n for (let i = 0; i < objectQuads.length && !malformed; ++i) {\n quad = objectQuads[i];\n if (head)\n malformed = onError(current, 'can\\'t have coreferences');\n // one rdf:rest\n else if (quad.predicate.value === namespaces.rdf.rest) {\n if (parent)\n malformed = onError(current, 'has incoming rdf:rest arcs');\n else\n parent = quad;\n }\n else {\n head = quad; // e.g. { :s :p (1 2) }\n headPos = 'object';\n }\n }\n\n // Store the list item and continue with parent\n if (!first)\n malformed = onError(current, 'has no list head');\n else\n items.unshift(first.object);\n current = parent && parent.subject;\n }\n\n // Don't remove any quads if the list is malformed\n if (malformed)\n remove = false;\n // Store the list under the value of its head\n else if (head)\n lists[head[headPos].value] = items;\n });\n\n // Remove list quads if requested\n if (remove)\n this.removeQuads(toRemove);\n return lists;\n }\n\n /**\n * Returns `true` if the current dataset is a superset of the given dataset; in other words, returns `true` if\n * the given dataset is a subset of, i.e., is contained within, the current dataset.\n *\n * Blank Nodes will be normalized.\n */\n addAll(quads) {\n if (quads instanceof DatasetCoreAndReadableStream)\n quads = quads.filtered;\n\n if (Array.isArray(quads))\n this.addQuads(quads);\n else if (quads instanceof N3Store && quads._entityIndex === this._entityIndex) {\n if (quads._size !== 0) {\n this._graphs = merge(this._graphs, quads._graphs);\n this._size = null; // Invalidate the cached size\n }\n }\n else {\n for (const quad of quads)\n this.add(quad);\n }\n return this;\n }\n\n /**\n * Returns `true` if the current dataset is a superset of the given dataset; in other words, returns `true` if\n * the given dataset is a subset of, i.e., is contained within, the current dataset.\n *\n * Blank Nodes will be normalized.\n */\n contains(other) {\n if (other instanceof DatasetCoreAndReadableStream)\n other = other.filtered;\n\n if (other === this)\n return true;\n\n if (!(other instanceof N3Store) || this._entityIndex !== other._entityIndex)\n return other.every(quad => this.has(quad));\n\n const g1 = this._graphs, g2 = other._graphs;\n let s1, s2, p1, p2, o1;\n for (const graph in g2) {\n if (!(s1 = g1[graph])) return false;\n s1 = s1.subjects;\n for (const subject in (s2 = g2[graph].subjects)) {\n if (!(p1 = s1[subject])) return false;\n for (const predicate in (p2 = s2[subject])) {\n if (!(o1 = p1[predicate])) return false;\n for (const object in p2[predicate])\n if (!(object in o1)) return false;\n }\n }\n }\n return true;\n }\n\n /**\n * This method removes the quads in the current dataset that match the given arguments.\n *\n * The logic described in {@link https://rdf.js.org/dataset-spec/#quad-matching|Quad Matching} is applied for each\n * quad in this dataset, to select the quads which will be deleted.\n *\n * @param subject The optional exact subject to match.\n * @param predicate The optional exact predicate to match.\n * @param object The optional exact object to match.\n * @param graph The optional exact graph to match.\n */\n deleteMatches(subject, predicate, object, graph) {\n for (const quad of this.match(subject, predicate, object, graph))\n this.removeQuad(quad);\n return this;\n }\n\n /**\n * Returns a new dataset that contains all quads from the current dataset that are not included in the given dataset.\n */\n difference(other) {\n if (other && other instanceof DatasetCoreAndReadableStream)\n other = other.filtered;\n\n if (other === this)\n return new N3Store({ entityIndex: this._entityIndex });\n\n if ((other instanceof N3Store) && other._entityIndex === this._entityIndex) {\n const store = new N3Store({ entityIndex: this._entityIndex });\n const graphs = difference(this._graphs, other._graphs);\n if (graphs) {\n store._graphs = graphs;\n store._size = null;\n }\n return store;\n }\n\n return this.filter(quad => !other.has(quad));\n }\n\n /**\n * Returns true if the current dataset contains the same graph structure as the given dataset.\n *\n * Blank Nodes will be normalized.\n */\n equals(other) {\n if (other instanceof DatasetCoreAndReadableStream)\n other = other.filtered;\n\n return other === this || (this.size === other.size && this.contains(other));\n }\n\n /**\n * Creates a new dataset with all the quads that pass the test implemented by the provided `iteratee`.\n *\n * This method is aligned with Array.prototype.filter() in ECMAScript-262.\n */\n filter(iteratee) {\n const store = new N3Store({ entityIndex: this._entityIndex });\n for (const quad of this)\n if (iteratee(quad, this))\n store.add(quad);\n return store;\n }\n\n /**\n * Returns a new dataset containing all quads from the current dataset that are also included in the given dataset.\n */\n intersection(other) {\n if (other instanceof DatasetCoreAndReadableStream)\n other = other.filtered;\n\n if (other === this) {\n const store = new N3Store({ entityIndex: this._entityIndex });\n store._graphs = merge(Object.create(null), this._graphs);\n store._size = this._size;\n return store;\n }\n else if ((other instanceof N3Store) && this._entityIndex === other._entityIndex) {\n const store = new N3Store({ entityIndex: this._entityIndex });\n const graphs = intersect(other._graphs, this._graphs);\n if (graphs) {\n store._graphs = graphs;\n store._size = null;\n }\n return store;\n }\n\n return this.filter(quad => other.has(quad));\n }\n\n /**\n * Returns a new dataset containing all quads returned by applying `iteratee` to each quad in the current dataset.\n */\n map(iteratee) {\n const store = new N3Store({ entityIndex: this._entityIndex });\n for (const quad of this)\n store.add(iteratee(quad, this));\n return store;\n }\n\n /**\n * This method calls the `iteratee` method on each `quad` of the `Dataset`. The first time the `iteratee` method\n * is called, the `accumulator` value is the `initialValue`, or, if not given, equals the first quad of the `Dataset`.\n * The return value of each call to the `iteratee` method is used as the `accumulator` value for the next call.\n *\n * This method returns the return value of the last `iteratee` call.\n *\n * This method is aligned with `Array.prototype.reduce()` in ECMAScript-262.\n */\n reduce(callback, initialValue) {\n const iter = this.readQuads();\n let accumulator = initialValue === undefined ? iter.next().value : initialValue;\n for (const quad of iter)\n accumulator = callback(accumulator, quad, this);\n return accumulator;\n }\n\n /**\n * Returns the set of quads within the dataset as a host-language-native sequence, for example an `Array` in\n * ECMAScript-262.\n *\n * Since a `Dataset` is an unordered set, the order of the quads within the returned sequence is arbitrary.\n */\n toArray() {\n return this.getQuads();\n }\n\n /**\n * Returns an N-Quads string representation of the dataset, preprocessed with the\n * {@link https://json-ld.github.io/normalization/spec/|RDF Dataset Normalization} algorithm.\n */\n toCanonical() {\n throw new Error('not implemented');\n }\n\n /**\n * Returns a stream that contains all quads of the dataset.\n */\n toStream() {\n return this.match();\n }\n\n /**\n * Returns an N-Quads string representation of the dataset.\n *\n * No prior normalization is required, therefore the results for the same quads may vary depending on the `Dataset`\n * implementation.\n */\n toString() {\n return (new N3Writer()).quadsToString(this);\n }\n\n /**\n * Returns a new `Dataset` that is a concatenation of this dataset and the quads given as an argument.\n */\n union(quads) {\n const store = new N3Store({ entityIndex: this._entityIndex });\n store._graphs = merge(Object.create(null), this._graphs);\n store._size = this._size;\n\n store.addAll(quads);\n return store;\n }\n\n // ### Store is an iterable.\n // Can be used where iterables are expected: for...of loops, array spread operator,\n // `yield*`, and destructuring assignment (order is not guaranteed).\n *[Symbol.iterator]() {\n yield* this.readQuads();\n }\n}\n\n/**\n * Returns a subset of the `index` with that part of the index\n * matching the `ids` array. `ids` contains 3 elements that are\n * either numerical ids; or `null`.\n *\n * `false` is returned when there are no matching indices; this should\n * *not* be set as the value for an index.\n */\nfunction indexMatch(index, ids, depth = 0) {\n const ind = ids[depth];\n if (ind && !(ind in index))\n return false;\n\n let target = false;\n for (const key in (ind ? { [ind]: index[ind] } : index)) {\n const result = depth === 2 ? null : indexMatch(index[key], ids, depth + 1);\n\n if (result !== false) {\n target = target || Object.create(null);\n target[key] = result;\n }\n }\n return target;\n}\n\n/**\n * A class that implements both DatasetCore and Readable.\n */\nclass DatasetCoreAndReadableStream extends Readable {\n constructor(n3Store, subject, predicate, object, graph, options) {\n super({ objectMode: true });\n Object.assign(this, { n3Store, subject, predicate, object, graph, options });\n }\n\n get filtered() {\n if (!this._filtered) {\n const { n3Store, graph, object, predicate, subject } = this;\n const newStore = this._filtered = new N3Store({ factory: n3Store._factory, entityIndex: this.options.entityIndex });\n\n let subjectId, predicateId, objectId;\n\n // Translate IRIs to internal index keys.\n if (subject && !(subjectId = newStore._termToNumericId(subject)) ||\n predicate && !(predicateId = newStore._termToNumericId(predicate)) ||\n object && !(objectId = newStore._termToNumericId(object)))\n return newStore;\n\n const graphs = n3Store._getGraphs(graph);\n for (const graphKey in graphs) {\n let subjects, predicates, objects;\n\n if (!subjectId && predicateId) {\n if (predicates = indexMatch(graphs[graphKey].predicates, [predicateId, objectId, subjectId])) {\n subjects = indexMatch(graphs[graphKey].subjects, [subjectId, predicateId, objectId]);\n objects = indexMatch(graphs[graphKey].objects, [objectId, subjectId, predicateId]);\n }\n }\n else if (objectId) {\n if (objects = indexMatch(graphs[graphKey].objects, [objectId, subjectId, predicateId])) {\n subjects = indexMatch(graphs[graphKey].subjects, [subjectId, predicateId, objectId]);\n predicates = indexMatch(graphs[graphKey].predicates, [predicateId, objectId, subjectId]);\n }\n }\n else if (subjects = indexMatch(graphs[graphKey].subjects, [subjectId, predicateId, objectId])) {\n predicates = indexMatch(graphs[graphKey].predicates, [predicateId, objectId, subjectId]);\n objects = indexMatch(graphs[graphKey].objects, [objectId, subjectId, predicateId]);\n }\n\n if (subjects)\n newStore._graphs[graphKey] = { subjects, predicates, objects };\n }\n newStore._size = null;\n }\n return this._filtered;\n }\n\n get size() {\n return this.filtered.size;\n }\n\n _read(size) {\n if (size > 0 && !this[ITERATOR])\n this[ITERATOR] = this[Symbol.iterator]();\n const iterable = this[ITERATOR];\n while (--size >= 0) {\n const { done, value } = iterable.next();\n if (done) {\n this.push(null);\n return;\n }\n this.push(value);\n }\n }\n\n addAll(quads) {\n return this.filtered.addAll(quads);\n }\n\n contains(other) {\n return this.filtered.contains(other);\n }\n\n deleteMatches(subject, predicate, object, graph) {\n return this.filtered.deleteMatches(subject, predicate, object, graph);\n }\n\n difference(other) {\n return this.filtered.difference(other);\n }\n\n equals(other) {\n return this.filtered.equals(other);\n }\n\n every(callback, subject, predicate, object, graph) {\n return this.filtered.every(callback, subject, predicate, object, graph);\n }\n\n filter(iteratee) {\n return this.filtered.filter(iteratee);\n }\n\n forEach(callback, subject, predicate, object, graph) {\n return this.filtered.forEach(callback, subject, predicate, object, graph);\n }\n\n import(stream) {\n return this.filtered.import(stream);\n }\n\n intersection(other) {\n return this.filtered.intersection(other);\n }\n\n map(iteratee) {\n return this.filtered.map(iteratee);\n }\n\n some(callback, subject, predicate, object, graph) {\n return this.filtered.some(callback, subject, predicate, object, graph);\n }\n\n toCanonical() {\n return this.filtered.toCanonical();\n }\n\n toStream() {\n return this._filtered ?\n this._filtered.toStream()\n : this.n3Store.match(this.subject, this.predicate, this.object, this.graph);\n }\n\n union(quads) {\n return this._filtered ?\n this._filtered.union(quads)\n : this.n3Store.match(this.subject, this.predicate, this.object, this.graph).addAll(quads);\n }\n\n toArray() {\n return this._filtered ? this._filtered.toArray() : this.n3Store.getQuads(this.subject, this.predicate, this.object, this.graph);\n }\n\n reduce(callback, initialValue) {\n return this.filtered.reduce(callback, initialValue);\n }\n\n toString() {\n return (new N3Writer()).quadsToString(this);\n }\n\n add(quad) {\n return this.filtered.add(quad);\n }\n\n delete(quad) {\n return this.filtered.delete(quad);\n }\n\n has(quad) {\n return this.filtered.has(quad);\n }\n\n match(subject, predicate, object, graph) {\n return new DatasetCoreAndReadableStream(this.filtered, subject, predicate, object, graph, this.options);\n }\n\n *[Symbol.iterator]() {\n yield* this._filtered || this.n3Store.readQuads(this.subject, this.predicate, this.object, this.graph);\n }\n}\n","import N3Store from './N3Store';\n\nexport default class N3DatasetCoreFactory {\n dataset(quads) {\n return new N3Store(quads);\n }\n}\n","import DF from './N3DataFactory';\n\n/**\n * Gets rules from a dataset. This will only collect horn rules declared using log:implies.\n */\nexport function getRulesFromDataset(dataset) {\n const rules = [];\n for (const { subject, object } of dataset.match(null, DF.namedNode('http://www.w3.org/2000/10/swap/log#implies'), null, DF.defaultGraph())) {\n const premise = [...dataset.match(null, null, null, subject)];\n const conclusion = [...dataset.match(null, null, null, object)];\n rules.push({ premise, conclusion });\n }\n return rules;\n}\n\nexport default class N3Reasoner {\n constructor(store) {\n this._store = store;\n }\n\n _add(subject, predicate, object, graphItem, cb) {\n // Only add to the remaining indexes if there is not already a value in the index\n if (!this._store._addToIndex(graphItem.subjects, subject, predicate, object)) return;\n this._store._addToIndex(graphItem.predicates, predicate, object, subject);\n this._store._addToIndex(graphItem.objects, object, subject, predicate);\n cb();\n }\n\n // eslint-disable-next-line no-warning-comments\n _evaluatePremise(rule, content, cb, i = 0) {\n let v1, v2, value, index1, index2;\n const [val0, val1, val2] = rule.premise[i].value, index = content[rule.premise[i].content];\n const v0 = !(value = val0.value);\n for (value in v0 ? index : { [value]: index[value] }) {\n if (index1 = index[value]) {\n if (v0) val0.value = Number(value);\n v1 = !(value = val1.value);\n for (value in v1 ? index1 : { [value]: index1[value] }) {\n if (index2 = index1[value]) {\n if (v1) val1.value = Number(value);\n v2 = !(value = val2.value);\n for (value in v2 ? index2 : { [value]: index2[value] }) {\n if (v2) val2.value = Number(value);\n\n if (i === rule.premise.length - 1)\n rule.conclusion.forEach(c => {\n // eslint-disable-next-line max-nested-callbacks\n this._add(c.subject.value, c.predicate.value, c.object.value, content, () => { cb(c); });\n });\n else\n this._evaluatePremise(rule, content, cb, i + 1);\n }\n if (v2) val2.value = null;\n }\n }\n if (v1) val1.value = null;\n }\n }\n if (v0) val0.value = null;\n }\n\n _evaluateRules(rules, content, cb) {\n for (let i = 0; i < rules.length; i++) {\n this._evaluatePremise(rules[i], content, cb);\n }\n }\n\n // A naive reasoning algorithm where rules are just applied by repeatedly applying rules\n // until no more evaluations are made\n _reasonGraphNaive(rules, content) {\n const newRules = [];\n\n function addRule(conclusion) {\n if (conclusion.next)\n conclusion.next.forEach(rule => {\n newRules.push([conclusion.subject.value, conclusion.predicate.value, conclusion.object.value, rule]);\n });\n }\n\n // eslint-disable-next-line func-style\n const addConclusions = conclusion => {\n conclusion.forEach(c => {\n // eslint-disable-next-line max-nested-callbacks\n this._add(c.subject.value, c.predicate.value, c.object.value, content, () => { addRule(c); });\n });\n };\n\n this._evaluateRules(rules, content, addRule);\n\n let r;\n while ((r = newRules.pop()) !== undefined) {\n const [subject, predicate, object, rule] = r;\n const v1 = rule.basePremise.subject.value;\n if (!v1) rule.basePremise.subject.value = subject;\n const v2 = rule.basePremise.predicate.value;\n if (!v2) rule.basePremise.predicate.value = predicate;\n const v3 = rule.basePremise.object.value;\n if (!v3) rule.basePremise.object.value = object;\n\n if (rule.premise.length === 0) {\n addConclusions(rule.conclusion);\n }\n else {\n this._evaluatePremise(rule, content, addRule);\n }\n\n if (!v1) rule.basePremise.subject.value = null;\n if (!v2) rule.basePremise.predicate.value = null;\n if (!v3) rule.basePremise.object.value = null;\n }\n }\n\n _createRule({ premise, conclusion }) {\n const varMapping = {};\n\n const toId = value => value.termType === 'Variable' ?\n // If the term is a variable, then create an empty object that values can be placed into\n (varMapping[value.value] = varMapping[value.value] || {}) :\n // If the term is not a variable, then set the ID value\n { value: this._store._termToNewNumericId(value) };\n\n // eslint-disable-next-line func-style\n const t = term => ({ subject: toId(term.subject), predicate: toId(term.predicate), object: toId(term.object) });\n\n return {\n premise: premise.map(p => t(p)),\n conclusion: conclusion.map(p => t(p)),\n variables: Object.values(varMapping),\n };\n }\n\n reason(rules) {\n if (!Array.isArray(rules)) {\n rules = getRulesFromDataset(rules);\n }\n rules = rules.map(rule => this._createRule(rule));\n\n for (const r1 of rules) {\n for (const r2 of rules) {\n for (let i = 0; i < r2.premise.length; i++) {\n const p = r2.premise[i];\n for (const c of r1.conclusion) {\n if (termEq(p.subject, c.subject) && termEq(p.predicate, c.predicate) && termEq(p.object, c.object)) {\n const set = new Set();\n\n const premise = [];\n\n // Since these *will* be substituted when we apply the rule,\n // we need to do this, so that we index correctly in the subsequent section\n p.subject.value = p.subject.value || 1;\n p.object.value = p.object.value || 1;\n p.predicate.value = p.predicate.value || 1;\n\n for (let j = 0; j < r2.premise.length; j++) {\n if (j !== i) {\n premise.push(getIndex(r2.premise[j], set));\n }\n }\n\n // eslint-disable-next-line no-warning-comments\n // TODO: Create new rule, with new indexing\n // Future, 'collapse' the next statements when they share a premise/base-premise\n (c.next = c.next || []).push({\n premise,\n conclusion: r2.conclusion,\n // This is a single premise of the form { subject, predicate, object },\n // which we can use to instantiate the rule using the new data that was emitted\n basePremise: p,\n });\n }\n r2.variables.forEach(v => { v.value = null; });\n }\n }\n }\n }\n\n for (const rule of rules) {\n const set = new Set();\n rule.premise = rule.premise.map(p => getIndex(p, set));\n }\n\n const graphs = this._store._getGraphs();\n for (const graphId in graphs) {\n this._reasonGraphNaive(rules, graphs[graphId]);\n }\n\n this._store._size = null;\n }\n}\n\nfunction getIndex({ subject, predicate, object }, set) {\n const s = subject.value || set.has(subject) || (set.add(subject), false);\n const p = predicate.value || set.has(predicate) || (set.add(predicate), false);\n const o = object.value || set.has(object) || (set.add(object), false);\n\n return (!s && p) ? { content: 'predicates', value: [predicate, object, subject] } :\n o ? { content: 'objects', value: [object, subject, predicate] } :\n { content: 'subjects', value: [subject, predicate, object] };\n}\n\nfunction termEq(t1, t2) {\n if (t1.value === null) {\n t1.value = t2.value;\n }\n return t1.value === t2.value;\n}\n","// **N3StreamWriter** serializes a quad stream into a text stream.\nimport { Transform } from 'readable-stream';\nimport N3Writer from './N3Writer';\n\n// ## Constructor\nexport default class N3StreamWriter extends Transform {\n constructor(options) {\n super({ encoding: 'utf8', writableObjectMode: true });\n\n // Set up writer with a dummy stream object\n const writer = this._writer = new N3Writer({\n write: (quad, encoding, callback) => { this.push(quad); callback && callback(); },\n end: callback => { this.push(null); callback && callback(); },\n }, options);\n\n // Implement Transform methods on top of writer\n this._transform = (quad, encoding, done) => { writer.addQuad(quad, done); };\n this._flush = done => { writer.end(done); };\n }\n\n// ### Serializes a stream of quads\n import(stream) {\n stream.on('data', quad => { this.write(quad); });\n stream.on('end', () => { this.end(); });\n stream.on('error', error => { this.emit('error', error); });\n stream.on('prefix', (prefix, iri) => { this._writer.addPrefix(prefix, iri); });\n return this;\n }\n}\n","import Lexer from './N3Lexer';\nimport Parser from './N3Parser';\nimport Writer from './N3Writer';\nimport Store, { N3EntityIndex as EntityIndex } from './N3Store';\nimport StoreFactory from './N3StoreFactory';\nimport Reasoner, { getRulesFromDataset } from './N3Reasoner';\nimport StreamParser from './N3StreamParser';\nimport StreamWriter from './N3StreamWriter';\nimport * as Util from './N3Util';\n\nimport {\n default as DataFactory,\n\n Term,\n NamedNode,\n Literal,\n BlankNode,\n Variable,\n DefaultGraph,\n Quad,\n Triple,\n\n termFromId,\n termToId,\n} from './N3DataFactory';\n\n// Named exports\nexport {\n Lexer,\n Parser,\n Writer,\n Store,\n StoreFactory,\n EntityIndex,\n StreamParser,\n StreamWriter,\n Util,\n Reasoner,\n\n DataFactory,\n\n Term,\n NamedNode,\n Literal,\n BlankNode,\n Variable,\n DefaultGraph,\n Quad,\n Triple,\n\n termFromId,\n termToId,\n getRulesFromDataset,\n};\n\n// Export all named exports as a default object for backward compatibility\nexport default {\n Lexer,\n Parser,\n Writer,\n Store,\n StoreFactory,\n EntityIndex,\n StreamParser,\n StreamWriter,\n Util,\n Reasoner,\n\n DataFactory,\n\n Term,\n NamedNode,\n Literal,\n BlankNode,\n Variable,\n DefaultGraph,\n Quad,\n Triple,\n\n termFromId,\n termToId,\n};\n"],"names":["isNamedNode","term","termType","isBlankNode","isLiteral","isVariable","isDefaultGraph","inDefaultGraph","quad","graph","prefix","iri","factory","prefixes","value","defaultPrefixes","Object","create","processPrefix","cache","local","namedNode","Error","N3DataFactory","DEFAULTGRAPH","defaultGraph","rdf","xsd","escapeAll","escapedCharacters","SerializedTerm","equals","other","this","N3Writer","constructor","outputStream","options","_prefixRegex","write","_lists","lists","_outputStream","_endStream","undefined","end","output","chunk","encoding","done","_subject","test","format","_lineMode","_writeQuad","_writeQuadLine","_graph","_prefixIRIs","addPrefixes","baseIRI","_baseMatcher","RegExp","escapeRegex","endsWith","_baseLength","length","_inDefaultGraph","_write","string","callback","subject","predicate","object","_encodeIriOrBlank","_predicate","_encodeObject","_encodePredicate","_encodeSubject","error","_prefixMatch","quadToString","quadsToString","quads","quadsString","entity","_encodeQuad","list","id","substr","replace","characterReplacer","prefixMatch","exec","_encodeLiteral","literal","language","datatype","boolean","integer","decimal","double","type","_blockedWrite","addQuad","addQuads","i","addPrefix","hasPrefixes","IRIlist","prefixList","prefixIRI","blank","child","children","contents","elements","Array","join","singleDone","result","character","charCodeAt","toString","regex","ITERATOR","Symbol","merge","target","source","depth","assign","key","intersect","s1","s2","intersection","difference","diff","N3EntityIndex","_id","_ids","_entities","_blankNodeIndex","_factory","_termFromId","entities","terms","split","q","_termToNumericId","s","p","o","g","_termToNewNumericId","str","createBlankNode","suggestedName","name","index","blankNode","N3Store","_size","_graphs","_entityIndex","entityIndex","bind","size","graphs","subjects","graphKey","subjectKey","predicateKey","keys","_addToIndex","index0","key0","key1","key2","index1","index2","existed","_removeFromIndex","_findInIndex","name0","name1","name2","graphId","tmp","entityKeys","parts","value0","value1","values","l","_loop","_loopByKey0","_loopByKey1","_loopBy2Keys","_countInIndex","count","_getGraphs","_uniqueEntities","uniqueIds","add","graphItem","predicates","objects","freeze","removeQuad","has","subjectOrQuad","readQuads","next","import","stream","on","removeQuads","remove","removeMatches","Readable","objectMode","iterable","_read","push","deleteGraph","getQuads","content","subjectId","predicateId","objectId","match","DatasetCoreAndReadableStream","countQuads","forEach","some","every","getSubjects","results","forSubjects","getPredicates","forPredicates","getObjects","forObjects","getGraphs","forGraphs","extractLists","ignoreErrors","onError","node","message","tails","rest","nil","toRemove","tailQuad","items","head","headPos","malformed","current","objectQuads","subjectQuads","first","parent","unshift","addAll","filtered","isArray","contains","g1","g2","p1","p2","o1","deleteMatches","store","filter","iteratee","map","reduce","initialValue","iter","accumulator","toArray","toCanonical","toStream","union","iterator","indexMatch","ids","ind","n3Store","super","_filtered","newStore","delete","N3DatasetCoreFactory","dataset","getRulesFromDataset","rules","premise","conclusion","N3Reasoner","_store","_add","cb","_evaluatePremise","rule","v1","v2","val0","val1","val2","v0","Number","c","_evaluateRules","_reasonGraphNaive","newRules","addRule","addConclusions","r","pop","basePremise","v3","_createRule","varMapping","toId","t","variables","reason","r1","r2","termEq","set","Set","j","getIndex","v","t1","t2","N3StreamWriter","Transform","writableObjectMode","writer","_writer","_transform","_flush","emit","Lexer","Parser","Writer","Store","StoreFactory","EntityIndex","StreamParser","StreamWriter","Util","Reasoner","DataFactory","Term","NamedNode","Literal","BlankNode","Variable","DefaultGraph","Quad","Triple","termFromId","termToId"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/590.a00bbba2.js b/dist/js/590.47d0c120.js similarity index 97% rename from dist/js/590.a00bbba2.js rename to dist/js/590.47d0c120.js index ab57b62..99b8592 100644 --- a/dist/js/590.a00bbba2.js +++ b/dist/js/590.47d0c120.js @@ -66,8 +66,8 @@ const r=n(60989),o=n(60701),i=n(59263),a=n(47034),s=i.IdentifierIssuer,l=n(82207 */const r=n(32985),o=n(23751),i=n(29925),a=n(11227);function s(e,t){return e.hasht.hash?1:0}e.exports=class{constructor({createMessageDigest:e=()=>new o("sha256"),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n",t),this.createMessageDigest=e,this.maxDeepIterations=n,this.quads=null,this.deepIterations=null}main(e){this.deepIterations=new Map,this.quads=e;for(const r of e)this._addBlankNodeQuadInfo({quad:r,component:r.subject}),this._addBlankNodeQuadInfo({quad:r,component:r.object}),this._addBlankNodeQuadInfo({quad:r,component:r.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];for(const r of n)this._hashAndTrackBlankNode({id:r,hashToBlankNodes:t});const o=[...t.keys()].sort(),i=[];for(const r of o){const e=t.get(r);if(e.length>1){i.push(e);continue}const n=e[0];this.canonicalIssuer.getId(n)}for(const a of i){const e=[];for(const t of a){if(this.canonicalIssuer.hasId(t))continue;const n=new r("_:b");n.getId(t);const o=this.hashNDegreeQuads(t,n);e.push(o)}e.sort(s);for(const t of e){const e=t.issuer.getOldIds();for(const t of e)this.canonicalIssuer.getId(t)}}const l=[];for(const r of this.quads){const e=a.serializeQuadComponents(this._componentWithCanonicalId({component:r.subject}),r.predicate,this._componentWithCanonicalId({component:r.object}),this._componentWithCanonicalId({component:r.graph}));l.push(e)}return l.sort(),l.join("")}hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),r=n.quads;for(const i of r){const n={subject:null,predicate:i.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,i.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,i.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,i.graph,"graph"),t.push(a.serializeQuad(n))}t.sort();const o=this.createMessageDigest();for(const i of t)o.update(i);return n.hash=o.digest(),n.hash}hashRelatedBlankNode(e,t,n,r){let o;o=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const i=this.createMessageDigest();return i.update(r),"g"!==r&&i.update(this.getRelatedPredicate(t)),i.update(o),i.digest()}hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const r=this.createMessageDigest(),o=this.createHashToRelated(e,t),a=[...o.keys()].sort();for(const s of a){r.update(s);let e,n="";const a=new i(o.get(s));while(a.hasNext()){const r=a.next();let o=t.clone(),i="";const s=[];let l=!1;for(const e of r)if(this.canonicalIssuer.hasId(e)?i+=this.canonicalIssuer.getId(e):(o.hasId(e)||s.push(e),i+=o.getId(e)),0!==n.length&&i>n){l=!0;break}if(!l){for(const e of s){const t=this.hashNDegreeQuads(e,o);if(i+=o.getId(e),i+=`<${t.hash}>`,o=t.issuer,0!==n.length&&i>n){l=!0;break}}l||(0===n.length||i`}createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;for(const o of r)this._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:e,issuer:t,hashToRelated:n});return n}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=this.hashFirstDegreeQuads(e),r=t.get(n);r?r.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,r=this.blankNodeInfo.get(n);r?r.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:n,id:r,issuer:o,hashToRelated:i}){if("BlankNode"!==t.termType||t.value===r)return;const a=t.value,s=this.hashRelatedBlankNode(a,e,o,n),l=i.get(s);l?l.push(a):i.set(s,[a])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},93845:function(e,t,n){"use strict"; /*! * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved. - */const r=n(23751),o=n(43513);e.exports=class extends o{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;let o=0;for(const i of r){let r,a;if("BlankNode"===i.subject.termType&&i.subject.value!==e)a=i.subject.value,r="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;a=i.object.value,r="r"}++o%100===0&&await this._yield();const s=await this.hashRelatedBlankNode(a,i,t,r),l=n.get(s);l?l.push(a):n.set(s,[a])}return n}}},7997:function(e,t,n){"use strict"; + */const r=n(23751),o=n(43513);e.exports=class extends o{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;let o=0;for(const i of r){let r,a;if("BlankNode"===i.subject.termType&&i.subject.value!==e)a=i.subject.value,r="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;a=i.object.value,r="r"}++o%100===0&&await this._yield();const s=await this.hashRelatedBlankNode(a,i,t,r),l=n.get(s);l?l.push(a):n.set(s,[a])}return n}}},30378:function(e,t,n){"use strict"; /*! * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved. - */const r=n(23751),o=n(62438);e.exports=class extends o{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;for(const o of r){let r,i;if("BlankNode"===o.subject.termType&&o.subject.value!==e)i=o.subject.value,r="p";else{if("BlankNode"!==o.object.termType||o.object.value===e)continue;i=o.object.value,r="r"}const a=this.hashRelatedBlankNode(i,o,t,r),s=n.get(a);s?s.push(i):n.set(a,[i])}return n}}},64005:function(e,t,n){"use strict";const r=n(43513),o=n(93845),i=n(62438),a=n(7997);let s;try{s=n(67789)}catch(c){}function l(e){return Array.isArray(e)?e:t.NQuads.legacyDatasetToQuads(e)}t.NQuads=n(11227),t.IdentifierIssuer=n(32985),t._rdfCanonizeNative=function(e){return e&&(s=e),s},t.canonize=async function(e,t){const n=l(e,t);if(t.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((e,r)=>s.canonize(n,t,((t,n)=>t?r(t):e(n)))))}if("URDNA2015"===t.algorithm)return new r(t).main(n);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new o(t).main(n)}if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)},t._canonizeSync=function(e,t){const n=l(e,t);if(t.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return s.canonizeSync(n,t)}if("URDNA2015"===t.algorithm)return new i(t).main(n);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new a(t).main(n)}if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)}},42791:function(e,t,n){var r=n(65606);(function(e,t){"use strict";if(!e.setImmediate){var n,o=1,i={},a=!1,s=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,"[object process]"==={}.toString.call(e.process)?f():h()?g():e.MessageChannel?y():s&&"onreadystatechange"in s.createElement("script")?b():v(),l.setImmediate=c,l.clearImmediate=d}function c(e){"function"!==typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r{n.readable||n.emit("end")})),e.on("error",(e=>{n.emit("error",e)})),n}}var o=r,i=n(34841),a=n(23521);async function s(e){const t=[];for await(const n of e)t.push(n);return t}var l=s;class c extends a.Readable{constructor(e,{baseIRI:t,compact:n,context:r={},encoding:o="object",flatten:i,frame:a,prettyPrint:s,skipContext:l}={}){super({objectMode:!0,read:()=>{}}),this.compact=n,this.context=r,this.encoding=o,this.flatten=i,this.frame=a,this.prettyPrint=s,this.skipContext=l,t&&(this.context["@base"]=t.value||t.toString()),e.on("prefix",((e,t)=>{this.context[e]||(this.context[e]=t.value)})),this.handleData(e)}async handleData(e){try{const t=(await l(e)).map(c.toJsonldQuad),n=await i.fromRDF(t),r=await this.transform(n,this.options);this.push(r),this.push(null)}catch(t){this.emit("error",t)}}async transform(e){return this.compact&&(e=await i.compact(e,this.context)),this.flatten&&(e=await i.flatten(e,this.context)),this.frame&&(e=await i.frame(e,this.context)),this.skipContext&&e["@context"]&&delete e["@context"],"string"===this.encoding?this.prettyPrint?JSON.stringify(e,null,2):JSON.stringify(e):e}static toJsonldQuad(e){return{subject:c.toJsonldTerm(e.subject),predicate:c.toJsonldTerm(e.predicate),object:c.toJsonldTerm(e.object),graph:c.toJsonldTerm(e.graph)}}static toJsonldTerm(e){return"BlankNode"===e.termType?{termType:"BlankNode",value:`_:${e.value}`}:e}}var d=c;class u extends o{constructor(e){super(d,e)}}var p=u}}]); -//# sourceMappingURL=590.a00bbba2.js.map \ No newline at end of file + */const r=n(23751),o=n(62438);e.exports=class extends o{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;for(const o of r){let r,i;if("BlankNode"===o.subject.termType&&o.subject.value!==e)i=o.subject.value,r="p";else{if("BlankNode"!==o.object.termType||o.object.value===e)continue;i=o.object.value,r="r"}const a=this.hashRelatedBlankNode(i,o,t,r),s=n.get(a);s?s.push(i):n.set(a,[i])}return n}}},64005:function(e,t,n){"use strict";const r=n(43513),o=n(93845),i=n(62438),a=n(30378);let s;try{s=n(67789)}catch(c){}function l(e){return Array.isArray(e)?e:t.NQuads.legacyDatasetToQuads(e)}t.NQuads=n(11227),t.IdentifierIssuer=n(32985),t._rdfCanonizeNative=function(e){return e&&(s=e),s},t.canonize=async function(e,t){const n=l(e,t);if(t.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((e,r)=>s.canonize(n,t,((t,n)=>t?r(t):e(n)))))}if("URDNA2015"===t.algorithm)return new r(t).main(n);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new o(t).main(n)}if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)},t._canonizeSync=function(e,t){const n=l(e,t);if(t.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return s.canonizeSync(n,t)}if("URDNA2015"===t.algorithm)return new i(t).main(n);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new a(t).main(n)}if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)}},42791:function(e,t,n){var r=n(65606);(function(e,t){"use strict";if(!e.setImmediate){var n,o=1,i={},a=!1,s=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,"[object process]"==={}.toString.call(e.process)?f():h()?g():e.MessageChannel?y():s&&"onreadystatechange"in s.createElement("script")?b():v(),l.setImmediate=c,l.clearImmediate=d}function c(e){"function"!==typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r{n.readable||n.emit("end")})),e.on("error",(e=>{n.emit("error",e)})),n}}var o=r,i=n(34841),a=n(23521);async function s(e){const t=[];for await(const n of e)t.push(n);return t}var l=s;class c extends a.Readable{constructor(e,{baseIRI:t,compact:n,context:r={},encoding:o="object",flatten:i,frame:a,prettyPrint:s,skipContext:l}={}){super({objectMode:!0,read:()=>{}}),this.compact=n,this.context=r,this.encoding=o,this.flatten=i,this.frame=a,this.prettyPrint=s,this.skipContext=l,t&&(this.context["@base"]=t.value||t.toString()),e.on("prefix",((e,t)=>{this.context[e]||(this.context[e]=t.value)})),this.handleData(e)}async handleData(e){try{const t=(await l(e)).map(c.toJsonldQuad),n=await i.fromRDF(t),r=await this.transform(n,this.options);this.push(r),this.push(null)}catch(t){this.emit("error",t)}}async transform(e){return this.compact&&(e=await i.compact(e,this.context)),this.flatten&&(e=await i.flatten(e,this.context)),this.frame&&(e=await i.frame(e,this.context)),this.skipContext&&e["@context"]&&delete e["@context"],"string"===this.encoding?this.prettyPrint?JSON.stringify(e,null,2):JSON.stringify(e):e}static toJsonldQuad(e){return{subject:c.toJsonldTerm(e.subject),predicate:c.toJsonldTerm(e.predicate),object:c.toJsonldTerm(e.object),graph:c.toJsonldTerm(e.graph)}}static toJsonldTerm(e){return"BlankNode"===e.termType?{termType:"BlankNode",value:`_:${e.value}`}:e}}var d=c;class u extends o{constructor(e){super(d,e)}}var p=u}}]); +//# sourceMappingURL=590.47d0c120.js.map \ No newline at end of file diff --git a/dist/js/590.a00bbba2.js.map b/dist/js/590.47d0c120.js.map similarity index 99% rename from dist/js/590.a00bbba2.js.map rename to dist/js/590.47d0c120.js.map index 6eb5113..544966a 100644 --- a/dist/js/590.a00bbba2.js.map +++ b/dist/js/590.47d0c120.js.map @@ -1 +1 @@ -{"version":3,"file":"js/590.a00bbba2.js","mappings":"kIAEA,MAAM,cAAEA,GAAkB,EAAQ,OAC5B,WAAEC,EAAU,MAAEC,GAAU,EAAQ,QAChC,aAAEC,EAAY,YAAEC,EAAW,yBAAEC,GAA6B,EAAQ,OAClEC,EAAM,EAAQ,QACd,qBAAEC,GAAyBL,EACjC,IAAIM,EAKJ,MAAMC,EAAsB,CAACC,EAAQC,KACnC,GAAsB,kBAAXD,KAAyB,YAAaA,GAC/C,MAAM,IAAIH,EAAqBI,EAAM,cAAeD,EACtD,EAEFE,EAAOC,QAAQC,eAAiB,SAAwBJ,EAAQK,GAE9D,GADAN,EAAoBC,EAAQ,WACvBP,EAAaY,KAAYX,EAAYW,GACxC,MAAM,IAAIR,EAAqB,SAAU,CAAC,iBAAkB,iBAAkB,UAAWQ,GAE3F,OAAOH,EAAOC,QAAQG,yBAAyBN,EAAQK,EACzD,EACAH,EAAOC,QAAQG,yBAA2B,SAAUN,EAAQK,GAC1D,GAAsB,kBAAXL,KAAyB,YAAaA,GAC/C,OAAOK,EAET,MAAME,EAAUd,EAAaY,GACzB,KACEA,EAAOG,QACL,IAAIjB,OAAWkB,EAAW,CACxBC,MAAOV,EAAOW,SAElB,EAEF,KACEN,EAAOV,GACL,IAAIJ,OAAWkB,EAAW,CACxBC,MAAOV,EAAOW,SAElB,EAEN,GAAIX,EAAOY,QACTL,QACK,CACLT,EAAmBA,GAAoB,0BACvC,MAAMe,EAAaf,EAAiBE,EAAQO,GAC5CX,EAAIS,EAAQQ,EAAWvB,GACzB,CACA,OAAOe,CACT,C,oCCjDA,MAAM,qBAAES,EAAoB,eAAEC,EAAc,uBAAEC,EAAsB,WAAEC,GAAe,EAAQ,OACvF,OAAEC,GAAW,EAAQ,QACrB,QAAEC,GAAY,E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AKi0B,UACP1zB,QAAawzB,EAAOE,QAAQ1zB,EAAMP,KAAKmyB,UAGrCnyB,KAAKm0B,UACP5zB,QAAawzB,EAAOI,QAAQ5zB,EAAMP,KAAKmyB,UAGrCnyB,KAAKmoC,QACP5nC,QAAawzB,EAAOoU,MAAM5nC,EAAMP,KAAKmyB,UAGnCnyB,KAAKokD,aAAe7jD,EAAK,oBACpBA,EAAK,YAGQ,WAAlBP,KAAKmE,SACHnE,KAAKmkD,YACAz0B,KAAKC,UAAUpvB,EAAM,KAAM,GAE3BmvB,KAAKC,UAAUpvB,GAInBA,CACT,CAEA,mBAAOikD,CAAcxX,GACnB,MAAO,CACLxE,QAASyb,EAAiBU,aAAa3X,EAAKxE,SAC5C0E,UAAW+W,EAAiBU,aAAa3X,EAAKE,WAC9CjoB,OAAQg/B,EAAiBU,aAAa3X,EAAK/nB,QAC3CqjB,MAAO2b,EAAiBU,aAAa3X,EAAK1E,OAE9C,CAEA,mBAAOqc,CAAcpyB,GACnB,MAAsB,cAAlBA,EAAKga,SACA,CACLA,SAAU,YACVnnC,MAAO,KAAKmtB,EAAKntB,SAIdmtB,CACT,EAGF,QCpGA,MAAMqyB,UAAmB,EACvB,WAAA7kD,CAAaqC,GACXwJ,MAAM,EAAkBxJ,EAC1B,EAGF,O","sources":["webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/add-abort-signal.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/buffer_list.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/compose.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/destroy.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/duplex.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/duplexify.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/end-of-stream.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/from.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/legacy.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/operators.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/passthrough.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/pipeline.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/readable.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/state.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/transform.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/utils.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/streams/writable.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/internal/validators.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/ours/browser.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/ours/errors.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/ours/primordials.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/ours/util.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/stream.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/readable-stream/lib/stream/promises.js","webpack://mobilitydcatap-ui/./node_modules/canonicalize/lib/canonicalize.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/ContextResolver.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/JsonLdError.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/JsonLdProcessor.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/NQuads.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/RequestQueue.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/ResolvedContext.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/compact.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/constants.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/context.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/documentLoaders/xhr.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/events.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/expand.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/flatten.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/frame.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/fromRdf.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/graphTypes.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/jsonld.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/nodeMap.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/platform-browser.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/toRdf.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/types.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/url.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/lib/util.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/node_modules/lru-cache/index.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/node_modules/yallist/iterator.js","webpack://mobilitydcatap-ui/./node_modules/jsonld/node_modules/yallist/yallist.js","webpack://mobilitydcatap-ui/./node_modules/rdf-canonize/index.js","webpack://mobilitydcatap-ui/./node_modules/rdf-canonize/lib/IdentifierIssuer.js","webpack://mobilitydcatap-ui/./node_modules/rdf-canonize/lib/MessageDigest-browser.js","webpack://mobilitydcatap-ui/./node_modules/rdf-canonize/lib/NQuads.js","webpack://mobilitydcatap-ui/./node_modules/rdf-canonize/lib/Permuter.js","webpack://mobilitydcatap-ui/./node_modules/rdf-canonize/lib/URDNA2015.js","webpack://mobilitydcatap-ui/./node_modules/rdf-canonize/lib/URDNA2015Sync.js","webpack://mobilitydcatap-ui/./node_modules/rdf-canonize/lib/URGNA2012.js","webpack://mobilitydcatap-ui/./node_modules/rdf-canonize/lib/URGNA2012Sync.js","webpack://mobilitydcatap-ui/./node_modules/rdf-canonize/lib/index.js","webpack://mobilitydcatap-ui/./node_modules/setimmediate/setImmediate.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/node_modules/@rdfjs/sink/index.js","webpack://mobilitydcatap-ui/./node_modules/stream-chunks/chunks.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/lib/SerializerStream.js","webpack://mobilitydcatap-ui/./node_modules/@rdfjs/serializer-jsonld-ext/index.js"],"sourcesContent":["'use strict'\n\nconst { SymbolDispose } = require('../../ours/primordials')\nconst { AbortError, codes } = require('../../ours/errors')\nconst { isNodeStream, isWebStream, kControllerErrorFunction } = require('./utils')\nconst eos = require('./end-of-stream')\nconst { ERR_INVALID_ARG_TYPE } = codes\nlet addAbortListener\n\n// This method is inlined here for readable-stream\n// It also does not allow for signal to not exist on the stream\n// https://github.com/nodejs/node/pull/36061#discussion_r533718029\nconst validateAbortSignal = (signal, name) => {\n if (typeof signal !== 'object' || !('aborted' in signal)) {\n throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal)\n }\n}\nmodule.exports.addAbortSignal = function addAbortSignal(signal, stream) {\n validateAbortSignal(signal, 'signal')\n if (!isNodeStream(stream) && !isWebStream(stream)) {\n throw new ERR_INVALID_ARG_TYPE('stream', ['ReadableStream', 'WritableStream', 'Stream'], stream)\n }\n return module.exports.addAbortSignalNoValidate(signal, stream)\n}\nmodule.exports.addAbortSignalNoValidate = function (signal, stream) {\n if (typeof signal !== 'object' || !('aborted' in signal)) {\n return stream\n }\n const onAbort = isNodeStream(stream)\n ? () => {\n stream.destroy(\n new AbortError(undefined, {\n cause: signal.reason\n })\n )\n }\n : () => {\n stream[kControllerErrorFunction](\n new AbortError(undefined, {\n cause: signal.reason\n })\n )\n }\n if (signal.aborted) {\n onAbort()\n } else {\n addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n const disposable = addAbortListener(signal, onAbort)\n eos(stream, disposable[SymbolDispose])\n }\n return stream\n}\n","'use strict'\n\nconst { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array } = require('../../ours/primordials')\nconst { Buffer } = require('buffer')\nconst { inspect } = require('../../ours/util')\nmodule.exports = class BufferList {\n constructor() {\n this.head = null\n this.tail = null\n this.length = 0\n }\n push(v) {\n const entry = {\n data: v,\n next: null\n }\n if (this.length > 0) this.tail.next = entry\n else this.head = entry\n this.tail = entry\n ++this.length\n }\n unshift(v) {\n const entry = {\n data: v,\n next: this.head\n }\n if (this.length === 0) this.tail = entry\n this.head = entry\n ++this.length\n }\n shift() {\n if (this.length === 0) return\n const ret = this.head.data\n if (this.length === 1) this.head = this.tail = null\n else this.head = this.head.next\n --this.length\n return ret\n }\n clear() {\n this.head = this.tail = null\n this.length = 0\n }\n join(s) {\n if (this.length === 0) return ''\n let p = this.head\n let ret = '' + p.data\n while ((p = p.next) !== null) ret += s + p.data\n return ret\n }\n concat(n) {\n if (this.length === 0) return Buffer.alloc(0)\n const ret = Buffer.allocUnsafe(n >>> 0)\n let p = this.head\n let i = 0\n while (p) {\n TypedArrayPrototypeSet(ret, p.data, i)\n i += p.data.length\n p = p.next\n }\n return ret\n }\n\n // Consumes a specified amount of bytes or characters from the buffered data.\n consume(n, hasStrings) {\n const data = this.head.data\n if (n < data.length) {\n // `slice` is the same for buffers and strings.\n const slice = data.slice(0, n)\n this.head.data = data.slice(n)\n return slice\n }\n if (n === data.length) {\n // First chunk is a perfect match.\n return this.shift()\n }\n // Result spans more than one buffer.\n return hasStrings ? this._getString(n) : this._getBuffer(n)\n }\n first() {\n return this.head.data\n }\n *[SymbolIterator]() {\n for (let p = this.head; p; p = p.next) {\n yield p.data\n }\n }\n\n // Consumes a specified amount of characters from the buffered data.\n _getString(n) {\n let ret = ''\n let p = this.head\n let c = 0\n do {\n const str = p.data\n if (n > str.length) {\n ret += str\n n -= str.length\n } else {\n if (n === str.length) {\n ret += str\n ++c\n if (p.next) this.head = p.next\n else this.head = this.tail = null\n } else {\n ret += StringPrototypeSlice(str, 0, n)\n this.head = p\n p.data = StringPrototypeSlice(str, n)\n }\n break\n }\n ++c\n } while ((p = p.next) !== null)\n this.length -= c\n return ret\n }\n\n // Consumes a specified amount of bytes from the buffered data.\n _getBuffer(n) {\n const ret = Buffer.allocUnsafe(n)\n const retLen = n\n let p = this.head\n let c = 0\n do {\n const buf = p.data\n if (n > buf.length) {\n TypedArrayPrototypeSet(ret, buf, retLen - n)\n n -= buf.length\n } else {\n if (n === buf.length) {\n TypedArrayPrototypeSet(ret, buf, retLen - n)\n ++c\n if (p.next) this.head = p.next\n else this.head = this.tail = null\n } else {\n TypedArrayPrototypeSet(ret, new Uint8Array(buf.buffer, buf.byteOffset, n), retLen - n)\n this.head = p\n p.data = buf.slice(n)\n }\n break\n }\n ++c\n } while ((p = p.next) !== null)\n this.length -= c\n return ret\n }\n\n // Make sure the linked list only shows the minimal necessary information.\n [Symbol.for('nodejs.util.inspect.custom')](_, options) {\n return inspect(this, {\n ...options,\n // Only inspect one level.\n depth: 0,\n // It should not recurse.\n customInspect: false\n })\n }\n}\n","'use strict'\n\nconst { pipeline } = require('./pipeline')\nconst Duplex = require('./duplex')\nconst { destroyer } = require('./destroy')\nconst {\n isNodeStream,\n isReadable,\n isWritable,\n isWebStream,\n isTransformStream,\n isWritableStream,\n isReadableStream\n} = require('./utils')\nconst {\n AbortError,\n codes: { ERR_INVALID_ARG_VALUE, ERR_MISSING_ARGS }\n} = require('../../ours/errors')\nconst eos = require('./end-of-stream')\nmodule.exports = function compose(...streams) {\n if (streams.length === 0) {\n throw new ERR_MISSING_ARGS('streams')\n }\n if (streams.length === 1) {\n return Duplex.from(streams[0])\n }\n const orgStreams = [...streams]\n if (typeof streams[0] === 'function') {\n streams[0] = Duplex.from(streams[0])\n }\n if (typeof streams[streams.length - 1] === 'function') {\n const idx = streams.length - 1\n streams[idx] = Duplex.from(streams[idx])\n }\n for (let n = 0; n < streams.length; ++n) {\n if (!isNodeStream(streams[n]) && !isWebStream(streams[n])) {\n // TODO(ronag): Add checks for non streams.\n continue\n }\n if (\n n < streams.length - 1 &&\n !(isReadable(streams[n]) || isReadableStream(streams[n]) || isTransformStream(streams[n]))\n ) {\n throw new ERR_INVALID_ARG_VALUE(`streams[${n}]`, orgStreams[n], 'must be readable')\n }\n if (n > 0 && !(isWritable(streams[n]) || isWritableStream(streams[n]) || isTransformStream(streams[n]))) {\n throw new ERR_INVALID_ARG_VALUE(`streams[${n}]`, orgStreams[n], 'must be writable')\n }\n }\n let ondrain\n let onfinish\n let onreadable\n let onclose\n let d\n function onfinished(err) {\n const cb = onclose\n onclose = null\n if (cb) {\n cb(err)\n } else if (err) {\n d.destroy(err)\n } else if (!readable && !writable) {\n d.destroy()\n }\n }\n const head = streams[0]\n const tail = pipeline(streams, onfinished)\n const writable = !!(isWritable(head) || isWritableStream(head) || isTransformStream(head))\n const readable = !!(isReadable(tail) || isReadableStream(tail) || isTransformStream(tail))\n\n // TODO(ronag): Avoid double buffering.\n // Implement Writable/Readable/Duplex traits.\n // See, https://github.com/nodejs/node/pull/33515.\n d = new Duplex({\n // TODO (ronag): highWaterMark?\n writableObjectMode: !!(head !== null && head !== undefined && head.writableObjectMode),\n readableObjectMode: !!(tail !== null && tail !== undefined && tail.readableObjectMode),\n writable,\n readable\n })\n if (writable) {\n if (isNodeStream(head)) {\n d._write = function (chunk, encoding, callback) {\n if (head.write(chunk, encoding)) {\n callback()\n } else {\n ondrain = callback\n }\n }\n d._final = function (callback) {\n head.end()\n onfinish = callback\n }\n head.on('drain', function () {\n if (ondrain) {\n const cb = ondrain\n ondrain = null\n cb()\n }\n })\n } else if (isWebStream(head)) {\n const writable = isTransformStream(head) ? head.writable : head\n const writer = writable.getWriter()\n d._write = async function (chunk, encoding, callback) {\n try {\n await writer.ready\n writer.write(chunk).catch(() => {})\n callback()\n } catch (err) {\n callback(err)\n }\n }\n d._final = async function (callback) {\n try {\n await writer.ready\n writer.close().catch(() => {})\n onfinish = callback\n } catch (err) {\n callback(err)\n }\n }\n }\n const toRead = isTransformStream(tail) ? tail.readable : tail\n eos(toRead, () => {\n if (onfinish) {\n const cb = onfinish\n onfinish = null\n cb()\n }\n })\n }\n if (readable) {\n if (isNodeStream(tail)) {\n tail.on('readable', function () {\n if (onreadable) {\n const cb = onreadable\n onreadable = null\n cb()\n }\n })\n tail.on('end', function () {\n d.push(null)\n })\n d._read = function () {\n while (true) {\n const buf = tail.read()\n if (buf === null) {\n onreadable = d._read\n return\n }\n if (!d.push(buf)) {\n return\n }\n }\n }\n } else if (isWebStream(tail)) {\n const readable = isTransformStream(tail) ? tail.readable : tail\n const reader = readable.getReader()\n d._read = async function () {\n while (true) {\n try {\n const { value, done } = await reader.read()\n if (!d.push(value)) {\n return\n }\n if (done) {\n d.push(null)\n return\n }\n } catch {\n return\n }\n }\n }\n }\n }\n d._destroy = function (err, callback) {\n if (!err && onclose !== null) {\n err = new AbortError()\n }\n onreadable = null\n ondrain = null\n onfinish = null\n if (onclose === null) {\n callback(err)\n } else {\n onclose = callback\n if (isNodeStream(tail)) {\n destroyer(tail, err)\n }\n }\n }\n return d\n}\n","'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst {\n aggregateTwoErrors,\n codes: { ERR_MULTIPLE_CALLBACK },\n AbortError\n} = require('../../ours/errors')\nconst { Symbol } = require('../../ours/primordials')\nconst { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require('./utils')\nconst kDestroy = Symbol('kDestroy')\nconst kConstruct = Symbol('kConstruct')\nfunction checkError(err, w, r) {\n if (err) {\n // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364\n err.stack // eslint-disable-line no-unused-expressions\n\n if (w && !w.errored) {\n w.errored = err\n }\n if (r && !r.errored) {\n r.errored = err\n }\n }\n}\n\n// Backwards compat. cb() is undocumented and unused in core but\n// unfortunately might be used by modules.\nfunction destroy(err, cb) {\n const r = this._readableState\n const w = this._writableState\n // With duplex streams we use the writable side for state.\n const s = w || r\n if ((w !== null && w !== undefined && w.destroyed) || (r !== null && r !== undefined && r.destroyed)) {\n if (typeof cb === 'function') {\n cb()\n }\n return this\n }\n\n // We set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n checkError(err, w, r)\n if (w) {\n w.destroyed = true\n }\n if (r) {\n r.destroyed = true\n }\n\n // If still constructing then defer calling _destroy.\n if (!s.constructed) {\n this.once(kDestroy, function (er) {\n _destroy(this, aggregateTwoErrors(er, err), cb)\n })\n } else {\n _destroy(this, err, cb)\n }\n return this\n}\nfunction _destroy(self, err, cb) {\n let called = false\n function onDestroy(err) {\n if (called) {\n return\n }\n called = true\n const r = self._readableState\n const w = self._writableState\n checkError(err, w, r)\n if (w) {\n w.closed = true\n }\n if (r) {\n r.closed = true\n }\n if (typeof cb === 'function') {\n cb(err)\n }\n if (err) {\n process.nextTick(emitErrorCloseNT, self, err)\n } else {\n process.nextTick(emitCloseNT, self)\n }\n }\n try {\n self._destroy(err || null, onDestroy)\n } catch (err) {\n onDestroy(err)\n }\n}\nfunction emitErrorCloseNT(self, err) {\n emitErrorNT(self, err)\n emitCloseNT(self)\n}\nfunction emitCloseNT(self) {\n const r = self._readableState\n const w = self._writableState\n if (w) {\n w.closeEmitted = true\n }\n if (r) {\n r.closeEmitted = true\n }\n if ((w !== null && w !== undefined && w.emitClose) || (r !== null && r !== undefined && r.emitClose)) {\n self.emit('close')\n }\n}\nfunction emitErrorNT(self, err) {\n const r = self._readableState\n const w = self._writableState\n if ((w !== null && w !== undefined && w.errorEmitted) || (r !== null && r !== undefined && r.errorEmitted)) {\n return\n }\n if (w) {\n w.errorEmitted = true\n }\n if (r) {\n r.errorEmitted = true\n }\n self.emit('error', err)\n}\nfunction undestroy() {\n const r = this._readableState\n const w = this._writableState\n if (r) {\n r.constructed = true\n r.closed = false\n r.closeEmitted = false\n r.destroyed = false\n r.errored = null\n r.errorEmitted = false\n r.reading = false\n r.ended = r.readable === false\n r.endEmitted = r.readable === false\n }\n if (w) {\n w.constructed = true\n w.destroyed = false\n w.closed = false\n w.closeEmitted = false\n w.errored = null\n w.errorEmitted = false\n w.finalCalled = false\n w.prefinished = false\n w.ended = w.writable === false\n w.ending = w.writable === false\n w.finished = w.writable === false\n }\n}\nfunction errorOrDestroy(stream, err, sync) {\n // We have tests that rely on errors being emitted\n // in the same tick, so changing this is semver major.\n // For now when you opt-in to autoDestroy we allow\n // the error to be emitted nextTick. In a future\n // semver major update we should change the default to this.\n\n const r = stream._readableState\n const w = stream._writableState\n if ((w !== null && w !== undefined && w.destroyed) || (r !== null && r !== undefined && r.destroyed)) {\n return this\n }\n if ((r !== null && r !== undefined && r.autoDestroy) || (w !== null && w !== undefined && w.autoDestroy))\n stream.destroy(err)\n else if (err) {\n // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364\n err.stack // eslint-disable-line no-unused-expressions\n\n if (w && !w.errored) {\n w.errored = err\n }\n if (r && !r.errored) {\n r.errored = err\n }\n if (sync) {\n process.nextTick(emitErrorNT, stream, err)\n } else {\n emitErrorNT(stream, err)\n }\n }\n}\nfunction construct(stream, cb) {\n if (typeof stream._construct !== 'function') {\n return\n }\n const r = stream._readableState\n const w = stream._writableState\n if (r) {\n r.constructed = false\n }\n if (w) {\n w.constructed = false\n }\n stream.once(kConstruct, cb)\n if (stream.listenerCount(kConstruct) > 1) {\n // Duplex\n return\n }\n process.nextTick(constructNT, stream)\n}\nfunction constructNT(stream) {\n let called = false\n function onConstruct(err) {\n if (called) {\n errorOrDestroy(stream, err !== null && err !== undefined ? err : new ERR_MULTIPLE_CALLBACK())\n return\n }\n called = true\n const r = stream._readableState\n const w = stream._writableState\n const s = w || r\n if (r) {\n r.constructed = true\n }\n if (w) {\n w.constructed = true\n }\n if (s.destroyed) {\n stream.emit(kDestroy, err)\n } else if (err) {\n errorOrDestroy(stream, err, true)\n } else {\n process.nextTick(emitConstructNT, stream)\n }\n }\n try {\n stream._construct((err) => {\n process.nextTick(onConstruct, err)\n })\n } catch (err) {\n process.nextTick(onConstruct, err)\n }\n}\nfunction emitConstructNT(stream) {\n stream.emit(kConstruct)\n}\nfunction isRequest(stream) {\n return (stream === null || stream === undefined ? undefined : stream.setHeader) && typeof stream.abort === 'function'\n}\nfunction emitCloseLegacy(stream) {\n stream.emit('close')\n}\nfunction emitErrorCloseLegacy(stream, err) {\n stream.emit('error', err)\n process.nextTick(emitCloseLegacy, stream)\n}\n\n// Normalize destroy for legacy.\nfunction destroyer(stream, err) {\n if (!stream || isDestroyed(stream)) {\n return\n }\n if (!err && !isFinished(stream)) {\n err = new AbortError()\n }\n\n // TODO: Remove isRequest branches.\n if (isServerRequest(stream)) {\n stream.socket = null\n stream.destroy(err)\n } else if (isRequest(stream)) {\n stream.abort()\n } else if (isRequest(stream.req)) {\n stream.req.abort()\n } else if (typeof stream.destroy === 'function') {\n stream.destroy(err)\n } else if (typeof stream.close === 'function') {\n // TODO: Don't lose err?\n stream.close()\n } else if (err) {\n process.nextTick(emitErrorCloseLegacy, stream, err)\n } else {\n process.nextTick(emitCloseLegacy, stream)\n }\n if (!stream.destroyed) {\n stream[kIsDestroyed] = true\n }\n}\nmodule.exports = {\n construct,\n destroyer,\n destroy,\n undestroy,\n errorOrDestroy\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototype inheritance, this class\n// prototypically inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict'\n\nconst {\n ObjectDefineProperties,\n ObjectGetOwnPropertyDescriptor,\n ObjectKeys,\n ObjectSetPrototypeOf\n} = require('../../ours/primordials')\nmodule.exports = Duplex\nconst Readable = require('./readable')\nconst Writable = require('./writable')\nObjectSetPrototypeOf(Duplex.prototype, Readable.prototype)\nObjectSetPrototypeOf(Duplex, Readable)\n{\n const keys = ObjectKeys(Writable.prototype)\n // Allow the keys array to be GC'ed.\n for (let i = 0; i < keys.length; i++) {\n const method = keys[i]\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]\n }\n}\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options)\n Readable.call(this, options)\n Writable.call(this, options)\n if (options) {\n this.allowHalfOpen = options.allowHalfOpen !== false\n if (options.readable === false) {\n this._readableState.readable = false\n this._readableState.ended = true\n this._readableState.endEmitted = true\n }\n if (options.writable === false) {\n this._writableState.writable = false\n this._writableState.ending = true\n this._writableState.ended = true\n this._writableState.finished = true\n }\n } else {\n this.allowHalfOpen = true\n }\n}\nObjectDefineProperties(Duplex.prototype, {\n writable: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writable')\n },\n writableHighWaterMark: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableHighWaterMark')\n },\n writableObjectMode: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableObjectMode')\n },\n writableBuffer: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableBuffer')\n },\n writableLength: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableLength')\n },\n writableFinished: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableFinished')\n },\n writableCorked: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableCorked')\n },\n writableEnded: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableEnded')\n },\n writableNeedDrain: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableNeedDrain')\n },\n destroyed: {\n __proto__: null,\n get() {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false\n }\n return this._readableState.destroyed && this._writableState.destroyed\n },\n set(value) {\n // Backward compatibility, the user is explicitly\n // managing destroyed.\n if (this._readableState && this._writableState) {\n this._readableState.destroyed = value\n this._writableState.destroyed = value\n }\n }\n }\n})\nlet webStreamsAdapters\n\n// Lazy to avoid circular references\nfunction lazyWebStreams() {\n if (webStreamsAdapters === undefined) webStreamsAdapters = {}\n return webStreamsAdapters\n}\nDuplex.fromWeb = function (pair, options) {\n return lazyWebStreams().newStreamDuplexFromReadableWritablePair(pair, options)\n}\nDuplex.toWeb = function (duplex) {\n return lazyWebStreams().newReadableWritablePairFromDuplex(duplex)\n}\nlet duplexify\nDuplex.from = function (body) {\n if (!duplexify) {\n duplexify = require('./duplexify')\n }\n return duplexify(body, 'body')\n}\n","/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\n;('use strict')\nconst bufferModule = require('buffer')\nconst {\n isReadable,\n isWritable,\n isIterable,\n isNodeStream,\n isReadableNodeStream,\n isWritableNodeStream,\n isDuplexNodeStream,\n isReadableStream,\n isWritableStream\n} = require('./utils')\nconst eos = require('./end-of-stream')\nconst {\n AbortError,\n codes: { ERR_INVALID_ARG_TYPE, ERR_INVALID_RETURN_VALUE }\n} = require('../../ours/errors')\nconst { destroyer } = require('./destroy')\nconst Duplex = require('./duplex')\nconst Readable = require('./readable')\nconst Writable = require('./writable')\nconst { createDeferredPromise } = require('../../ours/util')\nconst from = require('./from')\nconst Blob = globalThis.Blob || bufferModule.Blob\nconst isBlob =\n typeof Blob !== 'undefined'\n ? function isBlob(b) {\n return b instanceof Blob\n }\n : function isBlob(b) {\n return false\n }\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nconst { FunctionPrototypeCall } = require('../../ours/primordials')\n\n// This is needed for pre node 17.\nclass Duplexify extends Duplex {\n constructor(options) {\n super(options)\n\n // https://github.com/nodejs/node/pull/34385\n\n if ((options === null || options === undefined ? undefined : options.readable) === false) {\n this._readableState.readable = false\n this._readableState.ended = true\n this._readableState.endEmitted = true\n }\n if ((options === null || options === undefined ? undefined : options.writable) === false) {\n this._writableState.writable = false\n this._writableState.ending = true\n this._writableState.ended = true\n this._writableState.finished = true\n }\n }\n}\nmodule.exports = function duplexify(body, name) {\n if (isDuplexNodeStream(body)) {\n return body\n }\n if (isReadableNodeStream(body)) {\n return _duplexify({\n readable: body\n })\n }\n if (isWritableNodeStream(body)) {\n return _duplexify({\n writable: body\n })\n }\n if (isNodeStream(body)) {\n return _duplexify({\n writable: false,\n readable: false\n })\n }\n if (isReadableStream(body)) {\n return _duplexify({\n readable: Readable.fromWeb(body)\n })\n }\n if (isWritableStream(body)) {\n return _duplexify({\n writable: Writable.fromWeb(body)\n })\n }\n if (typeof body === 'function') {\n const { value, write, final, destroy } = fromAsyncGen(body)\n if (isIterable(value)) {\n return from(Duplexify, value, {\n // TODO (ronag): highWaterMark?\n objectMode: true,\n write,\n final,\n destroy\n })\n }\n const then = value === null || value === undefined ? undefined : value.then\n if (typeof then === 'function') {\n let d\n const promise = FunctionPrototypeCall(\n then,\n value,\n (val) => {\n if (val != null) {\n throw new ERR_INVALID_RETURN_VALUE('nully', 'body', val)\n }\n },\n (err) => {\n destroyer(d, err)\n }\n )\n return (d = new Duplexify({\n // TODO (ronag): highWaterMark?\n objectMode: true,\n readable: false,\n write,\n final(cb) {\n final(async () => {\n try {\n await promise\n process.nextTick(cb, null)\n } catch (err) {\n process.nextTick(cb, err)\n }\n })\n },\n destroy\n }))\n }\n throw new ERR_INVALID_RETURN_VALUE('Iterable, AsyncIterable or AsyncFunction', name, value)\n }\n if (isBlob(body)) {\n return duplexify(body.arrayBuffer())\n }\n if (isIterable(body)) {\n return from(Duplexify, body, {\n // TODO (ronag): highWaterMark?\n objectMode: true,\n writable: false\n })\n }\n if (\n isReadableStream(body === null || body === undefined ? undefined : body.readable) &&\n isWritableStream(body === null || body === undefined ? undefined : body.writable)\n ) {\n return Duplexify.fromWeb(body)\n }\n if (\n typeof (body === null || body === undefined ? undefined : body.writable) === 'object' ||\n typeof (body === null || body === undefined ? undefined : body.readable) === 'object'\n ) {\n const readable =\n body !== null && body !== undefined && body.readable\n ? isReadableNodeStream(body === null || body === undefined ? undefined : body.readable)\n ? body === null || body === undefined\n ? undefined\n : body.readable\n : duplexify(body.readable)\n : undefined\n const writable =\n body !== null && body !== undefined && body.writable\n ? isWritableNodeStream(body === null || body === undefined ? undefined : body.writable)\n ? body === null || body === undefined\n ? undefined\n : body.writable\n : duplexify(body.writable)\n : undefined\n return _duplexify({\n readable,\n writable\n })\n }\n const then = body === null || body === undefined ? undefined : body.then\n if (typeof then === 'function') {\n let d\n FunctionPrototypeCall(\n then,\n body,\n (val) => {\n if (val != null) {\n d.push(val)\n }\n d.push(null)\n },\n (err) => {\n destroyer(d, err)\n }\n )\n return (d = new Duplexify({\n objectMode: true,\n writable: false,\n read() {}\n }))\n }\n throw new ERR_INVALID_ARG_TYPE(\n name,\n [\n 'Blob',\n 'ReadableStream',\n 'WritableStream',\n 'Stream',\n 'Iterable',\n 'AsyncIterable',\n 'Function',\n '{ readable, writable } pair',\n 'Promise'\n ],\n body\n )\n}\nfunction fromAsyncGen(fn) {\n let { promise, resolve } = createDeferredPromise()\n const ac = new AbortController()\n const signal = ac.signal\n const value = fn(\n (async function* () {\n while (true) {\n const _promise = promise\n promise = null\n const { chunk, done, cb } = await _promise\n process.nextTick(cb)\n if (done) return\n if (signal.aborted)\n throw new AbortError(undefined, {\n cause: signal.reason\n })\n ;({ promise, resolve } = createDeferredPromise())\n yield chunk\n }\n })(),\n {\n signal\n }\n )\n return {\n value,\n write(chunk, encoding, cb) {\n const _resolve = resolve\n resolve = null\n _resolve({\n chunk,\n done: false,\n cb\n })\n },\n final(cb) {\n const _resolve = resolve\n resolve = null\n _resolve({\n done: true,\n cb\n })\n },\n destroy(err, cb) {\n ac.abort()\n cb(err)\n }\n }\n}\nfunction _duplexify(pair) {\n const r = pair.readable && typeof pair.readable.read !== 'function' ? Readable.wrap(pair.readable) : pair.readable\n const w = pair.writable\n let readable = !!isReadable(r)\n let writable = !!isWritable(w)\n let ondrain\n let onfinish\n let onreadable\n let onclose\n let d\n function onfinished(err) {\n const cb = onclose\n onclose = null\n if (cb) {\n cb(err)\n } else if (err) {\n d.destroy(err)\n }\n }\n\n // TODO(ronag): Avoid double buffering.\n // Implement Writable/Readable/Duplex traits.\n // See, https://github.com/nodejs/node/pull/33515.\n d = new Duplexify({\n // TODO (ronag): highWaterMark?\n readableObjectMode: !!(r !== null && r !== undefined && r.readableObjectMode),\n writableObjectMode: !!(w !== null && w !== undefined && w.writableObjectMode),\n readable,\n writable\n })\n if (writable) {\n eos(w, (err) => {\n writable = false\n if (err) {\n destroyer(r, err)\n }\n onfinished(err)\n })\n d._write = function (chunk, encoding, callback) {\n if (w.write(chunk, encoding)) {\n callback()\n } else {\n ondrain = callback\n }\n }\n d._final = function (callback) {\n w.end()\n onfinish = callback\n }\n w.on('drain', function () {\n if (ondrain) {\n const cb = ondrain\n ondrain = null\n cb()\n }\n })\n w.on('finish', function () {\n if (onfinish) {\n const cb = onfinish\n onfinish = null\n cb()\n }\n })\n }\n if (readable) {\n eos(r, (err) => {\n readable = false\n if (err) {\n destroyer(r, err)\n }\n onfinished(err)\n })\n r.on('readable', function () {\n if (onreadable) {\n const cb = onreadable\n onreadable = null\n cb()\n }\n })\n r.on('end', function () {\n d.push(null)\n })\n d._read = function () {\n while (true) {\n const buf = r.read()\n if (buf === null) {\n onreadable = d._read\n return\n }\n if (!d.push(buf)) {\n return\n }\n }\n }\n }\n d._destroy = function (err, callback) {\n if (!err && onclose !== null) {\n err = new AbortError()\n }\n onreadable = null\n ondrain = null\n onfinish = null\n if (onclose === null) {\n callback(err)\n } else {\n onclose = callback\n destroyer(w, err)\n destroyer(r, err)\n }\n }\n return d\n}\n","/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n// Ported from https://github.com/mafintosh/end-of-stream with\n// permission from the author, Mathias Buus (@mafintosh).\n\n;('use strict')\nconst { AbortError, codes } = require('../../ours/errors')\nconst { ERR_INVALID_ARG_TYPE, ERR_STREAM_PREMATURE_CLOSE } = codes\nconst { kEmptyObject, once } = require('../../ours/util')\nconst { validateAbortSignal, validateFunction, validateObject, validateBoolean } = require('../validators')\nconst { Promise, PromisePrototypeThen, SymbolDispose } = require('../../ours/primordials')\nconst {\n isClosed,\n isReadable,\n isReadableNodeStream,\n isReadableStream,\n isReadableFinished,\n isReadableErrored,\n isWritable,\n isWritableNodeStream,\n isWritableStream,\n isWritableFinished,\n isWritableErrored,\n isNodeStream,\n willEmitClose: _willEmitClose,\n kIsClosedPromise\n} = require('./utils')\nlet addAbortListener\nfunction isRequest(stream) {\n return stream.setHeader && typeof stream.abort === 'function'\n}\nconst nop = () => {}\nfunction eos(stream, options, callback) {\n var _options$readable, _options$writable\n if (arguments.length === 2) {\n callback = options\n options = kEmptyObject\n } else if (options == null) {\n options = kEmptyObject\n } else {\n validateObject(options, 'options')\n }\n validateFunction(callback, 'callback')\n validateAbortSignal(options.signal, 'options.signal')\n callback = once(callback)\n if (isReadableStream(stream) || isWritableStream(stream)) {\n return eosWeb(stream, options, callback)\n }\n if (!isNodeStream(stream)) {\n throw new ERR_INVALID_ARG_TYPE('stream', ['ReadableStream', 'WritableStream', 'Stream'], stream)\n }\n const readable =\n (_options$readable = options.readable) !== null && _options$readable !== undefined\n ? _options$readable\n : isReadableNodeStream(stream)\n const writable =\n (_options$writable = options.writable) !== null && _options$writable !== undefined\n ? _options$writable\n : isWritableNodeStream(stream)\n const wState = stream._writableState\n const rState = stream._readableState\n const onlegacyfinish = () => {\n if (!stream.writable) {\n onfinish()\n }\n }\n\n // TODO (ronag): Improve soft detection to include core modules and\n // common ecosystem modules that do properly emit 'close' but fail\n // this generic check.\n let willEmitClose =\n _willEmitClose(stream) && isReadableNodeStream(stream) === readable && isWritableNodeStream(stream) === writable\n let writableFinished = isWritableFinished(stream, false)\n const onfinish = () => {\n writableFinished = true\n // Stream should not be destroyed here. If it is that\n // means that user space is doing something differently and\n // we cannot trust willEmitClose.\n if (stream.destroyed) {\n willEmitClose = false\n }\n if (willEmitClose && (!stream.readable || readable)) {\n return\n }\n if (!readable || readableFinished) {\n callback.call(stream)\n }\n }\n let readableFinished = isReadableFinished(stream, false)\n const onend = () => {\n readableFinished = true\n // Stream should not be destroyed here. If it is that\n // means that user space is doing something differently and\n // we cannot trust willEmitClose.\n if (stream.destroyed) {\n willEmitClose = false\n }\n if (willEmitClose && (!stream.writable || writable)) {\n return\n }\n if (!writable || writableFinished) {\n callback.call(stream)\n }\n }\n const onerror = (err) => {\n callback.call(stream, err)\n }\n let closed = isClosed(stream)\n const onclose = () => {\n closed = true\n const errored = isWritableErrored(stream) || isReadableErrored(stream)\n if (errored && typeof errored !== 'boolean') {\n return callback.call(stream, errored)\n }\n if (readable && !readableFinished && isReadableNodeStream(stream, true)) {\n if (!isReadableFinished(stream, false)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE())\n }\n if (writable && !writableFinished) {\n if (!isWritableFinished(stream, false)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE())\n }\n callback.call(stream)\n }\n const onclosed = () => {\n closed = true\n const errored = isWritableErrored(stream) || isReadableErrored(stream)\n if (errored && typeof errored !== 'boolean') {\n return callback.call(stream, errored)\n }\n callback.call(stream)\n }\n const onrequest = () => {\n stream.req.on('finish', onfinish)\n }\n if (isRequest(stream)) {\n stream.on('complete', onfinish)\n if (!willEmitClose) {\n stream.on('abort', onclose)\n }\n if (stream.req) {\n onrequest()\n } else {\n stream.on('request', onrequest)\n }\n } else if (writable && !wState) {\n // legacy streams\n stream.on('end', onlegacyfinish)\n stream.on('close', onlegacyfinish)\n }\n\n // Not all streams will emit 'close' after 'aborted'.\n if (!willEmitClose && typeof stream.aborted === 'boolean') {\n stream.on('aborted', onclose)\n }\n stream.on('end', onend)\n stream.on('finish', onfinish)\n if (options.error !== false) {\n stream.on('error', onerror)\n }\n stream.on('close', onclose)\n if (closed) {\n process.nextTick(onclose)\n } else if (\n (wState !== null && wState !== undefined && wState.errorEmitted) ||\n (rState !== null && rState !== undefined && rState.errorEmitted)\n ) {\n if (!willEmitClose) {\n process.nextTick(onclosed)\n }\n } else if (\n !readable &&\n (!willEmitClose || isReadable(stream)) &&\n (writableFinished || isWritable(stream) === false)\n ) {\n process.nextTick(onclosed)\n } else if (\n !writable &&\n (!willEmitClose || isWritable(stream)) &&\n (readableFinished || isReadable(stream) === false)\n ) {\n process.nextTick(onclosed)\n } else if (rState && stream.req && stream.aborted) {\n process.nextTick(onclosed)\n }\n const cleanup = () => {\n callback = nop\n stream.removeListener('aborted', onclose)\n stream.removeListener('complete', onfinish)\n stream.removeListener('abort', onclose)\n stream.removeListener('request', onrequest)\n if (stream.req) stream.req.removeListener('finish', onfinish)\n stream.removeListener('end', onlegacyfinish)\n stream.removeListener('close', onlegacyfinish)\n stream.removeListener('finish', onfinish)\n stream.removeListener('end', onend)\n stream.removeListener('error', onerror)\n stream.removeListener('close', onclose)\n }\n if (options.signal && !closed) {\n const abort = () => {\n // Keep it because cleanup removes it.\n const endCallback = callback\n cleanup()\n endCallback.call(\n stream,\n new AbortError(undefined, {\n cause: options.signal.reason\n })\n )\n }\n if (options.signal.aborted) {\n process.nextTick(abort)\n } else {\n addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n const disposable = addAbortListener(options.signal, abort)\n const originalCallback = callback\n callback = once((...args) => {\n disposable[SymbolDispose]()\n originalCallback.apply(stream, args)\n })\n }\n }\n return cleanup\n}\nfunction eosWeb(stream, options, callback) {\n let isAborted = false\n let abort = nop\n if (options.signal) {\n abort = () => {\n isAborted = true\n callback.call(\n stream,\n new AbortError(undefined, {\n cause: options.signal.reason\n })\n )\n }\n if (options.signal.aborted) {\n process.nextTick(abort)\n } else {\n addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n const disposable = addAbortListener(options.signal, abort)\n const originalCallback = callback\n callback = once((...args) => {\n disposable[SymbolDispose]()\n originalCallback.apply(stream, args)\n })\n }\n }\n const resolverFn = (...args) => {\n if (!isAborted) {\n process.nextTick(() => callback.apply(stream, args))\n }\n }\n PromisePrototypeThen(stream[kIsClosedPromise].promise, resolverFn, resolverFn)\n return nop\n}\nfunction finished(stream, opts) {\n var _opts\n let autoCleanup = false\n if (opts === null) {\n opts = kEmptyObject\n }\n if ((_opts = opts) !== null && _opts !== undefined && _opts.cleanup) {\n validateBoolean(opts.cleanup, 'cleanup')\n autoCleanup = opts.cleanup\n }\n return new Promise((resolve, reject) => {\n const cleanup = eos(stream, opts, (err) => {\n if (autoCleanup) {\n cleanup()\n }\n if (err) {\n reject(err)\n } else {\n resolve()\n }\n })\n })\n}\nmodule.exports = eos\nmodule.exports.finished = finished\n","'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require('../../ours/primordials')\nconst { Buffer } = require('buffer')\nconst { ERR_INVALID_ARG_TYPE, ERR_STREAM_NULL_VALUES } = require('../../ours/errors').codes\nfunction from(Readable, iterable, opts) {\n let iterator\n if (typeof iterable === 'string' || iterable instanceof Buffer) {\n return new Readable({\n objectMode: true,\n ...opts,\n read() {\n this.push(iterable)\n this.push(null)\n }\n })\n }\n let isAsync\n if (iterable && iterable[SymbolAsyncIterator]) {\n isAsync = true\n iterator = iterable[SymbolAsyncIterator]()\n } else if (iterable && iterable[SymbolIterator]) {\n isAsync = false\n iterator = iterable[SymbolIterator]()\n } else {\n throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable)\n }\n const readable = new Readable({\n objectMode: true,\n highWaterMark: 1,\n // TODO(ronag): What options should be allowed?\n ...opts\n })\n\n // Flag to protect against _read\n // being called before last iteration completion.\n let reading = false\n readable._read = function () {\n if (!reading) {\n reading = true\n next()\n }\n }\n readable._destroy = function (error, cb) {\n PromisePrototypeThen(\n close(error),\n () => process.nextTick(cb, error),\n // nextTick is here in case cb throws\n (e) => process.nextTick(cb, e || error)\n )\n }\n async function close(error) {\n const hadError = error !== undefined && error !== null\n const hasThrow = typeof iterator.throw === 'function'\n if (hadError && hasThrow) {\n const { value, done } = await iterator.throw(error)\n await value\n if (done) {\n return\n }\n }\n if (typeof iterator.return === 'function') {\n const { value } = await iterator.return()\n await value\n }\n }\n async function next() {\n for (;;) {\n try {\n const { value, done } = isAsync ? await iterator.next() : iterator.next()\n if (done) {\n readable.push(null)\n } else {\n const res = value && typeof value.then === 'function' ? await value : value\n if (res === null) {\n reading = false\n throw new ERR_STREAM_NULL_VALUES()\n } else if (readable.push(res)) {\n continue\n } else {\n reading = false\n }\n }\n } catch (err) {\n readable.destroy(err)\n }\n break\n }\n }\n return readable\n}\nmodule.exports = from\n","'use strict'\n\nconst { ArrayIsArray, ObjectSetPrototypeOf } = require('../../ours/primordials')\nconst { EventEmitter: EE } = require('events')\nfunction Stream(opts) {\n EE.call(this, opts)\n}\nObjectSetPrototypeOf(Stream.prototype, EE.prototype)\nObjectSetPrototypeOf(Stream, EE)\nStream.prototype.pipe = function (dest, options) {\n const source = this\n function ondata(chunk) {\n if (dest.writable && dest.write(chunk) === false && source.pause) {\n source.pause()\n }\n }\n source.on('data', ondata)\n function ondrain() {\n if (source.readable && source.resume) {\n source.resume()\n }\n }\n dest.on('drain', ondrain)\n\n // If the 'end' option is not supplied, dest.end() will be called when\n // source gets the 'end' or 'close' events. Only dest.end() once.\n if (!dest._isStdio && (!options || options.end !== false)) {\n source.on('end', onend)\n source.on('close', onclose)\n }\n let didOnEnd = false\n function onend() {\n if (didOnEnd) return\n didOnEnd = true\n dest.end()\n }\n function onclose() {\n if (didOnEnd) return\n didOnEnd = true\n if (typeof dest.destroy === 'function') dest.destroy()\n }\n\n // Don't leave dangling pipes when there are errors.\n function onerror(er) {\n cleanup()\n if (EE.listenerCount(this, 'error') === 0) {\n this.emit('error', er)\n }\n }\n prependListener(source, 'error', onerror)\n prependListener(dest, 'error', onerror)\n\n // Remove all the event listeners that were added.\n function cleanup() {\n source.removeListener('data', ondata)\n dest.removeListener('drain', ondrain)\n source.removeListener('end', onend)\n source.removeListener('close', onclose)\n source.removeListener('error', onerror)\n dest.removeListener('error', onerror)\n source.removeListener('end', cleanup)\n source.removeListener('close', cleanup)\n dest.removeListener('close', cleanup)\n }\n source.on('end', cleanup)\n source.on('close', cleanup)\n dest.on('close', cleanup)\n dest.emit('pipe', source)\n\n // Allow for unix-like usage: A.pipe(B).pipe(C)\n return dest\n}\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn)\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn)\n else if (ArrayIsArray(emitter._events[event])) emitter._events[event].unshift(fn)\n else emitter._events[event] = [fn, emitter._events[event]]\n}\nmodule.exports = {\n Stream,\n prependListener\n}\n","'use strict'\n\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nconst {\n codes: { ERR_INVALID_ARG_VALUE, ERR_INVALID_ARG_TYPE, ERR_MISSING_ARGS, ERR_OUT_OF_RANGE },\n AbortError\n} = require('../../ours/errors')\nconst { validateAbortSignal, validateInteger, validateObject } = require('../validators')\nconst kWeakHandler = require('../../ours/primordials').Symbol('kWeak')\nconst kResistStopPropagation = require('../../ours/primordials').Symbol('kResistStopPropagation')\nconst { finished } = require('./end-of-stream')\nconst staticCompose = require('./compose')\nconst { addAbortSignalNoValidate } = require('./add-abort-signal')\nconst { isWritable, isNodeStream } = require('./utils')\nconst { deprecate } = require('../../ours/util')\nconst {\n ArrayPrototypePush,\n Boolean,\n MathFloor,\n Number,\n NumberIsNaN,\n Promise,\n PromiseReject,\n PromiseResolve,\n PromisePrototypeThen,\n Symbol\n} = require('../../ours/primordials')\nconst kEmpty = Symbol('kEmpty')\nconst kEof = Symbol('kEof')\nfunction compose(stream, options) {\n if (options != null) {\n validateObject(options, 'options')\n }\n if ((options === null || options === undefined ? undefined : options.signal) != null) {\n validateAbortSignal(options.signal, 'options.signal')\n }\n if (isNodeStream(stream) && !isWritable(stream)) {\n throw new ERR_INVALID_ARG_VALUE('stream', stream, 'must be writable')\n }\n const composedStream = staticCompose(this, stream)\n if (options !== null && options !== undefined && options.signal) {\n // Not validating as we already validated before\n addAbortSignalNoValidate(options.signal, composedStream)\n }\n return composedStream\n}\nfunction map(fn, options) {\n if (typeof fn !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n }\n if (options != null) {\n validateObject(options, 'options')\n }\n if ((options === null || options === undefined ? undefined : options.signal) != null) {\n validateAbortSignal(options.signal, 'options.signal')\n }\n let concurrency = 1\n if ((options === null || options === undefined ? undefined : options.concurrency) != null) {\n concurrency = MathFloor(options.concurrency)\n }\n let highWaterMark = concurrency - 1\n if ((options === null || options === undefined ? undefined : options.highWaterMark) != null) {\n highWaterMark = MathFloor(options.highWaterMark)\n }\n validateInteger(concurrency, 'options.concurrency', 1)\n validateInteger(highWaterMark, 'options.highWaterMark', 0)\n highWaterMark += concurrency\n return async function* map() {\n const signal = require('../../ours/util').AbortSignalAny(\n [options === null || options === undefined ? undefined : options.signal].filter(Boolean)\n )\n const stream = this\n const queue = []\n const signalOpt = {\n signal\n }\n let next\n let resume\n let done = false\n let cnt = 0\n function onCatch() {\n done = true\n afterItemProcessed()\n }\n function afterItemProcessed() {\n cnt -= 1\n maybeResume()\n }\n function maybeResume() {\n if (resume && !done && cnt < concurrency && queue.length < highWaterMark) {\n resume()\n resume = null\n }\n }\n async function pump() {\n try {\n for await (let val of stream) {\n if (done) {\n return\n }\n if (signal.aborted) {\n throw new AbortError()\n }\n try {\n val = fn(val, signalOpt)\n if (val === kEmpty) {\n continue\n }\n val = PromiseResolve(val)\n } catch (err) {\n val = PromiseReject(err)\n }\n cnt += 1\n PromisePrototypeThen(val, afterItemProcessed, onCatch)\n queue.push(val)\n if (next) {\n next()\n next = null\n }\n if (!done && (queue.length >= highWaterMark || cnt >= concurrency)) {\n await new Promise((resolve) => {\n resume = resolve\n })\n }\n }\n queue.push(kEof)\n } catch (err) {\n const val = PromiseReject(err)\n PromisePrototypeThen(val, afterItemProcessed, onCatch)\n queue.push(val)\n } finally {\n done = true\n if (next) {\n next()\n next = null\n }\n }\n }\n pump()\n try {\n while (true) {\n while (queue.length > 0) {\n const val = await queue[0]\n if (val === kEof) {\n return\n }\n if (signal.aborted) {\n throw new AbortError()\n }\n if (val !== kEmpty) {\n yield val\n }\n queue.shift()\n maybeResume()\n }\n await new Promise((resolve) => {\n next = resolve\n })\n }\n } finally {\n done = true\n if (resume) {\n resume()\n resume = null\n }\n }\n }.call(this)\n}\nfunction asIndexedPairs(options = undefined) {\n if (options != null) {\n validateObject(options, 'options')\n }\n if ((options === null || options === undefined ? undefined : options.signal) != null) {\n validateAbortSignal(options.signal, 'options.signal')\n }\n return async function* asIndexedPairs() {\n let index = 0\n for await (const val of this) {\n var _options$signal\n if (\n options !== null &&\n options !== undefined &&\n (_options$signal = options.signal) !== null &&\n _options$signal !== undefined &&\n _options$signal.aborted\n ) {\n throw new AbortError({\n cause: options.signal.reason\n })\n }\n yield [index++, val]\n }\n }.call(this)\n}\nasync function some(fn, options = undefined) {\n for await (const unused of filter.call(this, fn, options)) {\n return true\n }\n return false\n}\nasync function every(fn, options = undefined) {\n if (typeof fn !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n }\n // https://en.wikipedia.org/wiki/De_Morgan%27s_laws\n return !(await some.call(\n this,\n async (...args) => {\n return !(await fn(...args))\n },\n options\n ))\n}\nasync function find(fn, options) {\n for await (const result of filter.call(this, fn, options)) {\n return result\n }\n return undefined\n}\nasync function forEach(fn, options) {\n if (typeof fn !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n }\n async function forEachFn(value, options) {\n await fn(value, options)\n return kEmpty\n }\n // eslint-disable-next-line no-unused-vars\n for await (const unused of map.call(this, forEachFn, options));\n}\nfunction filter(fn, options) {\n if (typeof fn !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n }\n async function filterFn(value, options) {\n if (await fn(value, options)) {\n return value\n }\n return kEmpty\n }\n return map.call(this, filterFn, options)\n}\n\n// Specific to provide better error to reduce since the argument is only\n// missing if the stream has no items in it - but the code is still appropriate\nclass ReduceAwareErrMissingArgs extends ERR_MISSING_ARGS {\n constructor() {\n super('reduce')\n this.message = 'Reduce of an empty stream requires an initial value'\n }\n}\nasync function reduce(reducer, initialValue, options) {\n var _options$signal2\n if (typeof reducer !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('reducer', ['Function', 'AsyncFunction'], reducer)\n }\n if (options != null) {\n validateObject(options, 'options')\n }\n if ((options === null || options === undefined ? undefined : options.signal) != null) {\n validateAbortSignal(options.signal, 'options.signal')\n }\n let hasInitialValue = arguments.length > 1\n if (\n options !== null &&\n options !== undefined &&\n (_options$signal2 = options.signal) !== null &&\n _options$signal2 !== undefined &&\n _options$signal2.aborted\n ) {\n const err = new AbortError(undefined, {\n cause: options.signal.reason\n })\n this.once('error', () => {}) // The error is already propagated\n await finished(this.destroy(err))\n throw err\n }\n const ac = new AbortController()\n const signal = ac.signal\n if (options !== null && options !== undefined && options.signal) {\n const opts = {\n once: true,\n [kWeakHandler]: this,\n [kResistStopPropagation]: true\n }\n options.signal.addEventListener('abort', () => ac.abort(), opts)\n }\n let gotAnyItemFromStream = false\n try {\n for await (const value of this) {\n var _options$signal3\n gotAnyItemFromStream = true\n if (\n options !== null &&\n options !== undefined &&\n (_options$signal3 = options.signal) !== null &&\n _options$signal3 !== undefined &&\n _options$signal3.aborted\n ) {\n throw new AbortError()\n }\n if (!hasInitialValue) {\n initialValue = value\n hasInitialValue = true\n } else {\n initialValue = await reducer(initialValue, value, {\n signal\n })\n }\n }\n if (!gotAnyItemFromStream && !hasInitialValue) {\n throw new ReduceAwareErrMissingArgs()\n }\n } finally {\n ac.abort()\n }\n return initialValue\n}\nasync function toArray(options) {\n if (options != null) {\n validateObject(options, 'options')\n }\n if ((options === null || options === undefined ? undefined : options.signal) != null) {\n validateAbortSignal(options.signal, 'options.signal')\n }\n const result = []\n for await (const val of this) {\n var _options$signal4\n if (\n options !== null &&\n options !== undefined &&\n (_options$signal4 = options.signal) !== null &&\n _options$signal4 !== undefined &&\n _options$signal4.aborted\n ) {\n throw new AbortError(undefined, {\n cause: options.signal.reason\n })\n }\n ArrayPrototypePush(result, val)\n }\n return result\n}\nfunction flatMap(fn, options) {\n const values = map.call(this, fn, options)\n return async function* flatMap() {\n for await (const val of values) {\n yield* val\n }\n }.call(this)\n}\nfunction toIntegerOrInfinity(number) {\n // We coerce here to align with the spec\n // https://github.com/tc39/proposal-iterator-helpers/issues/169\n number = Number(number)\n if (NumberIsNaN(number)) {\n return 0\n }\n if (number < 0) {\n throw new ERR_OUT_OF_RANGE('number', '>= 0', number)\n }\n return number\n}\nfunction drop(number, options = undefined) {\n if (options != null) {\n validateObject(options, 'options')\n }\n if ((options === null || options === undefined ? undefined : options.signal) != null) {\n validateAbortSignal(options.signal, 'options.signal')\n }\n number = toIntegerOrInfinity(number)\n return async function* drop() {\n var _options$signal5\n if (\n options !== null &&\n options !== undefined &&\n (_options$signal5 = options.signal) !== null &&\n _options$signal5 !== undefined &&\n _options$signal5.aborted\n ) {\n throw new AbortError()\n }\n for await (const val of this) {\n var _options$signal6\n if (\n options !== null &&\n options !== undefined &&\n (_options$signal6 = options.signal) !== null &&\n _options$signal6 !== undefined &&\n _options$signal6.aborted\n ) {\n throw new AbortError()\n }\n if (number-- <= 0) {\n yield val\n }\n }\n }.call(this)\n}\nfunction take(number, options = undefined) {\n if (options != null) {\n validateObject(options, 'options')\n }\n if ((options === null || options === undefined ? undefined : options.signal) != null) {\n validateAbortSignal(options.signal, 'options.signal')\n }\n number = toIntegerOrInfinity(number)\n return async function* take() {\n var _options$signal7\n if (\n options !== null &&\n options !== undefined &&\n (_options$signal7 = options.signal) !== null &&\n _options$signal7 !== undefined &&\n _options$signal7.aborted\n ) {\n throw new AbortError()\n }\n for await (const val of this) {\n var _options$signal8\n if (\n options !== null &&\n options !== undefined &&\n (_options$signal8 = options.signal) !== null &&\n _options$signal8 !== undefined &&\n _options$signal8.aborted\n ) {\n throw new AbortError()\n }\n if (number-- > 0) {\n yield val\n }\n\n // Don't get another item from iterator in case we reached the end\n if (number <= 0) {\n return\n }\n }\n }.call(this)\n}\nmodule.exports.streamReturningOperators = {\n asIndexedPairs: deprecate(asIndexedPairs, 'readable.asIndexedPairs will be removed in a future version.'),\n drop,\n filter,\n flatMap,\n map,\n take,\n compose\n}\nmodule.exports.promiseReturningOperators = {\n every,\n forEach,\n reduce,\n toArray,\n some,\n find\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict'\n\nconst { ObjectSetPrototypeOf } = require('../../ours/primordials')\nmodule.exports = PassThrough\nconst Transform = require('./transform')\nObjectSetPrototypeOf(PassThrough.prototype, Transform.prototype)\nObjectSetPrototypeOf(PassThrough, Transform)\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options)\n Transform.call(this, options)\n}\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk)\n}\n","/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n// Ported from https://github.com/mafintosh/pump with\n// permission from the author, Mathias Buus (@mafintosh).\n\n;('use strict')\nconst { ArrayIsArray, Promise, SymbolAsyncIterator, SymbolDispose } = require('../../ours/primordials')\nconst eos = require('./end-of-stream')\nconst { once } = require('../../ours/util')\nconst destroyImpl = require('./destroy')\nconst Duplex = require('./duplex')\nconst {\n aggregateTwoErrors,\n codes: {\n ERR_INVALID_ARG_TYPE,\n ERR_INVALID_RETURN_VALUE,\n ERR_MISSING_ARGS,\n ERR_STREAM_DESTROYED,\n ERR_STREAM_PREMATURE_CLOSE\n },\n AbortError\n} = require('../../ours/errors')\nconst { validateFunction, validateAbortSignal } = require('../validators')\nconst {\n isIterable,\n isReadable,\n isReadableNodeStream,\n isNodeStream,\n isTransformStream,\n isWebStream,\n isReadableStream,\n isReadableFinished\n} = require('./utils')\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nlet PassThrough\nlet Readable\nlet addAbortListener\nfunction destroyer(stream, reading, writing) {\n let finished = false\n stream.on('close', () => {\n finished = true\n })\n const cleanup = eos(\n stream,\n {\n readable: reading,\n writable: writing\n },\n (err) => {\n finished = !err\n }\n )\n return {\n destroy: (err) => {\n if (finished) return\n finished = true\n destroyImpl.destroyer(stream, err || new ERR_STREAM_DESTROYED('pipe'))\n },\n cleanup\n }\n}\nfunction popCallback(streams) {\n // Streams should never be an empty array. It should always contain at least\n // a single stream. Therefore optimize for the average case instead of\n // checking for length === 0 as well.\n validateFunction(streams[streams.length - 1], 'streams[stream.length - 1]')\n return streams.pop()\n}\nfunction makeAsyncIterable(val) {\n if (isIterable(val)) {\n return val\n } else if (isReadableNodeStream(val)) {\n // Legacy streams are not Iterable.\n return fromReadable(val)\n }\n throw new ERR_INVALID_ARG_TYPE('val', ['Readable', 'Iterable', 'AsyncIterable'], val)\n}\nasync function* fromReadable(val) {\n if (!Readable) {\n Readable = require('./readable')\n }\n yield* Readable.prototype[SymbolAsyncIterator].call(val)\n}\nasync function pumpToNode(iterable, writable, finish, { end }) {\n let error\n let onresolve = null\n const resume = (err) => {\n if (err) {\n error = err\n }\n if (onresolve) {\n const callback = onresolve\n onresolve = null\n callback()\n }\n }\n const wait = () =>\n new Promise((resolve, reject) => {\n if (error) {\n reject(error)\n } else {\n onresolve = () => {\n if (error) {\n reject(error)\n } else {\n resolve()\n }\n }\n }\n })\n writable.on('drain', resume)\n const cleanup = eos(\n writable,\n {\n readable: false\n },\n resume\n )\n try {\n if (writable.writableNeedDrain) {\n await wait()\n }\n for await (const chunk of iterable) {\n if (!writable.write(chunk)) {\n await wait()\n }\n }\n if (end) {\n writable.end()\n await wait()\n }\n finish()\n } catch (err) {\n finish(error !== err ? aggregateTwoErrors(error, err) : err)\n } finally {\n cleanup()\n writable.off('drain', resume)\n }\n}\nasync function pumpToWeb(readable, writable, finish, { end }) {\n if (isTransformStream(writable)) {\n writable = writable.writable\n }\n // https://streams.spec.whatwg.org/#example-manual-write-with-backpressure\n const writer = writable.getWriter()\n try {\n for await (const chunk of readable) {\n await writer.ready\n writer.write(chunk).catch(() => {})\n }\n await writer.ready\n if (end) {\n await writer.close()\n }\n finish()\n } catch (err) {\n try {\n await writer.abort(err)\n finish(err)\n } catch (err) {\n finish(err)\n }\n }\n}\nfunction pipeline(...streams) {\n return pipelineImpl(streams, once(popCallback(streams)))\n}\nfunction pipelineImpl(streams, callback, opts) {\n if (streams.length === 1 && ArrayIsArray(streams[0])) {\n streams = streams[0]\n }\n if (streams.length < 2) {\n throw new ERR_MISSING_ARGS('streams')\n }\n const ac = new AbortController()\n const signal = ac.signal\n const outerSignal = opts === null || opts === undefined ? undefined : opts.signal\n\n // Need to cleanup event listeners if last stream is readable\n // https://github.com/nodejs/node/issues/35452\n const lastStreamCleanup = []\n validateAbortSignal(outerSignal, 'options.signal')\n function abort() {\n finishImpl(new AbortError())\n }\n addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n let disposable\n if (outerSignal) {\n disposable = addAbortListener(outerSignal, abort)\n }\n let error\n let value\n const destroys = []\n let finishCount = 0\n function finish(err) {\n finishImpl(err, --finishCount === 0)\n }\n function finishImpl(err, final) {\n var _disposable\n if (err && (!error || error.code === 'ERR_STREAM_PREMATURE_CLOSE')) {\n error = err\n }\n if (!error && !final) {\n return\n }\n while (destroys.length) {\n destroys.shift()(error)\n }\n ;(_disposable = disposable) === null || _disposable === undefined ? undefined : _disposable[SymbolDispose]()\n ac.abort()\n if (final) {\n if (!error) {\n lastStreamCleanup.forEach((fn) => fn())\n }\n process.nextTick(callback, error, value)\n }\n }\n let ret\n for (let i = 0; i < streams.length; i++) {\n const stream = streams[i]\n const reading = i < streams.length - 1\n const writing = i > 0\n const end = reading || (opts === null || opts === undefined ? undefined : opts.end) !== false\n const isLastStream = i === streams.length - 1\n if (isNodeStream(stream)) {\n if (end) {\n const { destroy, cleanup } = destroyer(stream, reading, writing)\n destroys.push(destroy)\n if (isReadable(stream) && isLastStream) {\n lastStreamCleanup.push(cleanup)\n }\n }\n\n // Catch stream errors that occur after pipe/pump has completed.\n function onError(err) {\n if (err && err.name !== 'AbortError' && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {\n finish(err)\n }\n }\n stream.on('error', onError)\n if (isReadable(stream) && isLastStream) {\n lastStreamCleanup.push(() => {\n stream.removeListener('error', onError)\n })\n }\n }\n if (i === 0) {\n if (typeof stream === 'function') {\n ret = stream({\n signal\n })\n if (!isIterable(ret)) {\n throw new ERR_INVALID_RETURN_VALUE('Iterable, AsyncIterable or Stream', 'source', ret)\n }\n } else if (isIterable(stream) || isReadableNodeStream(stream) || isTransformStream(stream)) {\n ret = stream\n } else {\n ret = Duplex.from(stream)\n }\n } else if (typeof stream === 'function') {\n if (isTransformStream(ret)) {\n var _ret\n ret = makeAsyncIterable((_ret = ret) === null || _ret === undefined ? undefined : _ret.readable)\n } else {\n ret = makeAsyncIterable(ret)\n }\n ret = stream(ret, {\n signal\n })\n if (reading) {\n if (!isIterable(ret, true)) {\n throw new ERR_INVALID_RETURN_VALUE('AsyncIterable', `transform[${i - 1}]`, ret)\n }\n } else {\n var _ret2\n if (!PassThrough) {\n PassThrough = require('./passthrough')\n }\n\n // If the last argument to pipeline is not a stream\n // we must create a proxy stream so that pipeline(...)\n // always returns a stream which can be further\n // composed through `.pipe(stream)`.\n\n const pt = new PassThrough({\n objectMode: true\n })\n\n // Handle Promises/A+ spec, `then` could be a getter that throws on\n // second use.\n const then = (_ret2 = ret) === null || _ret2 === undefined ? undefined : _ret2.then\n if (typeof then === 'function') {\n finishCount++\n then.call(\n ret,\n (val) => {\n value = val\n if (val != null) {\n pt.write(val)\n }\n if (end) {\n pt.end()\n }\n process.nextTick(finish)\n },\n (err) => {\n pt.destroy(err)\n process.nextTick(finish, err)\n }\n )\n } else if (isIterable(ret, true)) {\n finishCount++\n pumpToNode(ret, pt, finish, {\n end\n })\n } else if (isReadableStream(ret) || isTransformStream(ret)) {\n const toRead = ret.readable || ret\n finishCount++\n pumpToNode(toRead, pt, finish, {\n end\n })\n } else {\n throw new ERR_INVALID_RETURN_VALUE('AsyncIterable or Promise', 'destination', ret)\n }\n ret = pt\n const { destroy, cleanup } = destroyer(ret, false, true)\n destroys.push(destroy)\n if (isLastStream) {\n lastStreamCleanup.push(cleanup)\n }\n }\n } else if (isNodeStream(stream)) {\n if (isReadableNodeStream(ret)) {\n finishCount += 2\n const cleanup = pipe(ret, stream, finish, {\n end\n })\n if (isReadable(stream) && isLastStream) {\n lastStreamCleanup.push(cleanup)\n }\n } else if (isTransformStream(ret) || isReadableStream(ret)) {\n const toRead = ret.readable || ret\n finishCount++\n pumpToNode(toRead, stream, finish, {\n end\n })\n } else if (isIterable(ret)) {\n finishCount++\n pumpToNode(ret, stream, finish, {\n end\n })\n } else {\n throw new ERR_INVALID_ARG_TYPE(\n 'val',\n ['Readable', 'Iterable', 'AsyncIterable', 'ReadableStream', 'TransformStream'],\n ret\n )\n }\n ret = stream\n } else if (isWebStream(stream)) {\n if (isReadableNodeStream(ret)) {\n finishCount++\n pumpToWeb(makeAsyncIterable(ret), stream, finish, {\n end\n })\n } else if (isReadableStream(ret) || isIterable(ret)) {\n finishCount++\n pumpToWeb(ret, stream, finish, {\n end\n })\n } else if (isTransformStream(ret)) {\n finishCount++\n pumpToWeb(ret.readable, stream, finish, {\n end\n })\n } else {\n throw new ERR_INVALID_ARG_TYPE(\n 'val',\n ['Readable', 'Iterable', 'AsyncIterable', 'ReadableStream', 'TransformStream'],\n ret\n )\n }\n ret = stream\n } else {\n ret = Duplex.from(stream)\n }\n }\n if (\n (signal !== null && signal !== undefined && signal.aborted) ||\n (outerSignal !== null && outerSignal !== undefined && outerSignal.aborted)\n ) {\n process.nextTick(abort)\n }\n return ret\n}\nfunction pipe(src, dst, finish, { end }) {\n let ended = false\n dst.on('close', () => {\n if (!ended) {\n // Finish if the destination closes before the source has completed.\n finish(new ERR_STREAM_PREMATURE_CLOSE())\n }\n })\n src.pipe(dst, {\n end: false\n }) // If end is true we already will have a listener to end dst.\n\n if (end) {\n // Compat. Before node v10.12.0 stdio used to throw an error so\n // pipe() did/does not end() stdio destinations.\n // Now they allow it but \"secretly\" don't close the underlying fd.\n\n function endFn() {\n ended = true\n dst.end()\n }\n if (isReadableFinished(src)) {\n // End the destination if the source has already ended.\n process.nextTick(endFn)\n } else {\n src.once('end', endFn)\n }\n } else {\n finish()\n }\n eos(\n src,\n {\n readable: true,\n writable: false\n },\n (err) => {\n const rState = src._readableState\n if (\n err &&\n err.code === 'ERR_STREAM_PREMATURE_CLOSE' &&\n rState &&\n rState.ended &&\n !rState.errored &&\n !rState.errorEmitted\n ) {\n // Some readable streams will emit 'close' before 'end'. However, since\n // this is on the readable side 'end' should still be emitted if the\n // stream has been ended and no error emitted. This should be allowed in\n // favor of backwards compatibility. Since the stream is piped to a\n // destination this should not result in any observable difference.\n // We don't need to check if this is a writable premature close since\n // eos will only fail with premature close on the reading side for\n // duplex streams.\n src.once('end', finish).once('error', finish)\n } else {\n finish(err)\n }\n }\n )\n return eos(\n dst,\n {\n readable: false,\n writable: true\n },\n finish\n )\n}\nmodule.exports = {\n pipelineImpl,\n pipeline\n}\n","/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n;('use strict')\nconst {\n ArrayPrototypeIndexOf,\n NumberIsInteger,\n NumberIsNaN,\n NumberParseInt,\n ObjectDefineProperties,\n ObjectKeys,\n ObjectSetPrototypeOf,\n Promise,\n SafeSet,\n SymbolAsyncDispose,\n SymbolAsyncIterator,\n Symbol\n} = require('../../ours/primordials')\nmodule.exports = Readable\nReadable.ReadableState = ReadableState\nconst { EventEmitter: EE } = require('events')\nconst { Stream, prependListener } = require('./legacy')\nconst { Buffer } = require('buffer')\nconst { addAbortSignal } = require('./add-abort-signal')\nconst eos = require('./end-of-stream')\nlet debug = require('../../ours/util').debuglog('stream', (fn) => {\n debug = fn\n})\nconst BufferList = require('./buffer_list')\nconst destroyImpl = require('./destroy')\nconst { getHighWaterMark, getDefaultHighWaterMark } = require('./state')\nconst {\n aggregateTwoErrors,\n codes: {\n ERR_INVALID_ARG_TYPE,\n ERR_METHOD_NOT_IMPLEMENTED,\n ERR_OUT_OF_RANGE,\n ERR_STREAM_PUSH_AFTER_EOF,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT\n },\n AbortError\n} = require('../../ours/errors')\nconst { validateObject } = require('../validators')\nconst kPaused = Symbol('kPaused')\nconst { StringDecoder } = require('string_decoder')\nconst from = require('./from')\nObjectSetPrototypeOf(Readable.prototype, Stream.prototype)\nObjectSetPrototypeOf(Readable, Stream)\nconst nop = () => {}\nconst { errorOrDestroy } = destroyImpl\nconst kObjectMode = 1 << 0\nconst kEnded = 1 << 1\nconst kEndEmitted = 1 << 2\nconst kReading = 1 << 3\nconst kConstructed = 1 << 4\nconst kSync = 1 << 5\nconst kNeedReadable = 1 << 6\nconst kEmittedReadable = 1 << 7\nconst kReadableListening = 1 << 8\nconst kResumeScheduled = 1 << 9\nconst kErrorEmitted = 1 << 10\nconst kEmitClose = 1 << 11\nconst kAutoDestroy = 1 << 12\nconst kDestroyed = 1 << 13\nconst kClosed = 1 << 14\nconst kCloseEmitted = 1 << 15\nconst kMultiAwaitDrain = 1 << 16\nconst kReadingMore = 1 << 17\nconst kDataEmitted = 1 << 18\n\n// TODO(benjamingr) it is likely slower to do it this way than with free functions\nfunction makeBitMapDescriptor(bit) {\n return {\n enumerable: false,\n get() {\n return (this.state & bit) !== 0\n },\n set(value) {\n if (value) this.state |= bit\n else this.state &= ~bit\n }\n }\n}\nObjectDefineProperties(ReadableState.prototype, {\n objectMode: makeBitMapDescriptor(kObjectMode),\n ended: makeBitMapDescriptor(kEnded),\n endEmitted: makeBitMapDescriptor(kEndEmitted),\n reading: makeBitMapDescriptor(kReading),\n // Stream is still being constructed and cannot be\n // destroyed until construction finished or failed.\n // Async construction is opt in, therefore we start as\n // constructed.\n constructed: makeBitMapDescriptor(kConstructed),\n // A flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n sync: makeBitMapDescriptor(kSync),\n // Whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n needReadable: makeBitMapDescriptor(kNeedReadable),\n emittedReadable: makeBitMapDescriptor(kEmittedReadable),\n readableListening: makeBitMapDescriptor(kReadableListening),\n resumeScheduled: makeBitMapDescriptor(kResumeScheduled),\n // True if the error was already emitted and should not be thrown again.\n errorEmitted: makeBitMapDescriptor(kErrorEmitted),\n emitClose: makeBitMapDescriptor(kEmitClose),\n autoDestroy: makeBitMapDescriptor(kAutoDestroy),\n // Has it been destroyed.\n destroyed: makeBitMapDescriptor(kDestroyed),\n // Indicates whether the stream has finished destroying.\n closed: makeBitMapDescriptor(kClosed),\n // True if close has been emitted or would have been emitted\n // depending on emitClose.\n closeEmitted: makeBitMapDescriptor(kCloseEmitted),\n multiAwaitDrain: makeBitMapDescriptor(kMultiAwaitDrain),\n // If true, a maybeReadMore has been scheduled.\n readingMore: makeBitMapDescriptor(kReadingMore),\n dataEmitted: makeBitMapDescriptor(kDataEmitted)\n})\nfunction ReadableState(options, stream, isDuplex) {\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof require('./duplex')\n\n // Bit map field to store ReadableState more effciently with 1 bit per field\n // instead of a V8 slot per field.\n this.state = kEmitClose | kAutoDestroy | kConstructed | kSync\n // Object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away.\n if (options && options.objectMode) this.state |= kObjectMode\n if (isDuplex && options && options.readableObjectMode) this.state |= kObjectMode\n\n // The point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n this.highWaterMark = options\n ? getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex)\n : getDefaultHighWaterMark(false)\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift().\n this.buffer = new BufferList()\n this.length = 0\n this.pipes = []\n this.flowing = null\n this[kPaused] = null\n\n // Should close be emitted on destroy. Defaults to true.\n if (options && options.emitClose === false) this.state &= ~kEmitClose\n\n // Should .destroy() be called after 'end' (and potentially 'finish').\n if (options && options.autoDestroy === false) this.state &= ~kAutoDestroy\n\n // Indicates whether the stream has errored. When true no further\n // _read calls, 'data' or 'readable' events should occur. This is needed\n // since when autoDestroy is disabled we need a way to tell whether the\n // stream has failed.\n this.errored = null\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = (options && options.defaultEncoding) || 'utf8'\n\n // Ref the piped dest which we need a drain event on it\n // type: null | Writable | Set.\n this.awaitDrainWriters = null\n this.decoder = null\n this.encoding = null\n if (options && options.encoding) {\n this.decoder = new StringDecoder(options.encoding)\n this.encoding = options.encoding\n }\n}\nfunction Readable(options) {\n if (!(this instanceof Readable)) return new Readable(options)\n\n // Checking for a Stream.Duplex instance is faster here instead of inside\n // the ReadableState constructor, at least with V8 6.5.\n const isDuplex = this instanceof require('./duplex')\n this._readableState = new ReadableState(options, this, isDuplex)\n if (options) {\n if (typeof options.read === 'function') this._read = options.read\n if (typeof options.destroy === 'function') this._destroy = options.destroy\n if (typeof options.construct === 'function') this._construct = options.construct\n if (options.signal && !isDuplex) addAbortSignal(options.signal, this)\n }\n Stream.call(this, options)\n destroyImpl.construct(this, () => {\n if (this._readableState.needReadable) {\n maybeReadMore(this, this._readableState)\n }\n })\n}\nReadable.prototype.destroy = destroyImpl.destroy\nReadable.prototype._undestroy = destroyImpl.undestroy\nReadable.prototype._destroy = function (err, cb) {\n cb(err)\n}\nReadable.prototype[EE.captureRejectionSymbol] = function (err) {\n this.destroy(err)\n}\nReadable.prototype[SymbolAsyncDispose] = function () {\n let error\n if (!this.destroyed) {\n error = this.readableEnded ? null : new AbortError()\n this.destroy(error)\n }\n return new Promise((resolve, reject) => eos(this, (err) => (err && err !== error ? reject(err) : resolve(null))))\n}\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n return readableAddChunk(this, chunk, encoding, false)\n}\n\n// Unshift should *always* be something directly out of read().\nReadable.prototype.unshift = function (chunk, encoding) {\n return readableAddChunk(this, chunk, encoding, true)\n}\nfunction readableAddChunk(stream, chunk, encoding, addToFront) {\n debug('readableAddChunk', chunk)\n const state = stream._readableState\n let err\n if ((state.state & kObjectMode) === 0) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding\n if (state.encoding !== encoding) {\n if (addToFront && state.encoding) {\n // When unshifting, if state.encoding is set, we have to save\n // the string in the BufferList with the state encoding.\n chunk = Buffer.from(chunk, encoding).toString(state.encoding)\n } else {\n chunk = Buffer.from(chunk, encoding)\n encoding = ''\n }\n }\n } else if (chunk instanceof Buffer) {\n encoding = ''\n } else if (Stream._isUint8Array(chunk)) {\n chunk = Stream._uint8ArrayToBuffer(chunk)\n encoding = ''\n } else if (chunk != null) {\n err = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk)\n }\n }\n if (err) {\n errorOrDestroy(stream, err)\n } else if (chunk === null) {\n state.state &= ~kReading\n onEofChunk(stream, state)\n } else if ((state.state & kObjectMode) !== 0 || (chunk && chunk.length > 0)) {\n if (addToFront) {\n if ((state.state & kEndEmitted) !== 0) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT())\n else if (state.destroyed || state.errored) return false\n else addChunk(stream, state, chunk, true)\n } else if (state.ended) {\n errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF())\n } else if (state.destroyed || state.errored) {\n return false\n } else {\n state.state &= ~kReading\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk)\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false)\n else maybeReadMore(stream, state)\n } else {\n addChunk(stream, state, chunk, false)\n }\n }\n } else if (!addToFront) {\n state.state &= ~kReading\n maybeReadMore(stream, state)\n }\n\n // We can push more data if we are below the highWaterMark.\n // Also, if we have no data yet, we can stand some more bytes.\n // This is to work around cases where hwm=0, such as the repl.\n return !state.ended && (state.length < state.highWaterMark || state.length === 0)\n}\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync && stream.listenerCount('data') > 0) {\n // Use the guard to avoid creating `Set()` repeatedly\n // when we have multiple pipes.\n if ((state.state & kMultiAwaitDrain) !== 0) {\n state.awaitDrainWriters.clear()\n } else {\n state.awaitDrainWriters = null\n }\n state.dataEmitted = true\n stream.emit('data', chunk)\n } else {\n // Update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length\n if (addToFront) state.buffer.unshift(chunk)\n else state.buffer.push(chunk)\n if ((state.state & kNeedReadable) !== 0) emitReadable(stream)\n }\n maybeReadMore(stream, state)\n}\nReadable.prototype.isPaused = function () {\n const state = this._readableState\n return state[kPaused] === true || state.flowing === false\n}\n\n// Backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n const decoder = new StringDecoder(enc)\n this._readableState.decoder = decoder\n // If setEncoding(null), decoder.encoding equals utf8.\n this._readableState.encoding = this._readableState.decoder.encoding\n const buffer = this._readableState.buffer\n // Iterate over current buffer to convert already stored Buffers:\n let content = ''\n for (const data of buffer) {\n content += decoder.write(data)\n }\n buffer.clear()\n if (content !== '') buffer.push(content)\n this._readableState.length = content.length\n return this\n}\n\n// Don't raise the hwm > 1GB.\nconst MAX_HWM = 0x40000000\nfunction computeNewHighWaterMark(n) {\n if (n > MAX_HWM) {\n throw new ERR_OUT_OF_RANGE('size', '<= 1GiB', n)\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts.\n n--\n n |= n >>> 1\n n |= n >>> 2\n n |= n >>> 4\n n |= n >>> 8\n n |= n >>> 16\n n++\n }\n return n\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || (state.length === 0 && state.ended)) return 0\n if ((state.state & kObjectMode) !== 0) return 1\n if (NumberIsNaN(n)) {\n // Only flow one buffer at a time.\n if (state.flowing && state.length) return state.buffer.first().length\n return state.length\n }\n if (n <= state.length) return n\n return state.ended ? state.length : 0\n}\n\n// You can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n)\n // Same as parseInt(undefined, 10), however V8 7.3 performance regressed\n // in this scenario, so we are doing it manually.\n if (n === undefined) {\n n = NaN\n } else if (!NumberIsInteger(n)) {\n n = NumberParseInt(n, 10)\n }\n const state = this._readableState\n const nOrig = n\n\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n)\n if (n !== 0) state.state &= ~kEmittedReadable\n\n // If we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (\n n === 0 &&\n state.needReadable &&\n ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)\n ) {\n debug('read: emitReadable', state.length, state.ended)\n if (state.length === 0 && state.ended) endReadable(this)\n else emitReadable(this)\n return null\n }\n n = howMuchToRead(n, state)\n\n // If we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this)\n return null\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n let doRead = (state.state & kNeedReadable) !== 0\n debug('need readable', doRead)\n\n // If we currently have less than the highWaterMark, then also read some.\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true\n debug('length less than watermark', doRead)\n }\n\n // However, if we've ended, then there's no point, if we're already\n // reading, then it's unnecessary, if we're constructing we have to wait,\n // and if we're destroyed or errored, then it's not allowed,\n if (state.ended || state.reading || state.destroyed || state.errored || !state.constructed) {\n doRead = false\n debug('reading, ended or constructing', doRead)\n } else if (doRead) {\n debug('do read')\n state.state |= kReading | kSync\n // If the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.state |= kNeedReadable\n\n // Call internal read method\n try {\n this._read(state.highWaterMark)\n } catch (err) {\n errorOrDestroy(this, err)\n }\n state.state &= ~kSync\n\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state)\n }\n let ret\n if (n > 0) ret = fromList(n, state)\n else ret = null\n if (ret === null) {\n state.needReadable = state.length <= state.highWaterMark\n n = 0\n } else {\n state.length -= n\n if (state.multiAwaitDrain) {\n state.awaitDrainWriters.clear()\n } else {\n state.awaitDrainWriters = null\n }\n }\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this)\n }\n if (ret !== null && !state.errorEmitted && !state.closeEmitted) {\n state.dataEmitted = true\n this.emit('data', ret)\n }\n return ret\n}\nfunction onEofChunk(stream, state) {\n debug('onEofChunk')\n if (state.ended) return\n if (state.decoder) {\n const chunk = state.decoder.end()\n if (chunk && chunk.length) {\n state.buffer.push(chunk)\n state.length += state.objectMode ? 1 : chunk.length\n }\n }\n state.ended = true\n if (state.sync) {\n // If we are sync, wait until next tick to emit the data.\n // Otherwise we risk emitting data in the flow()\n // the readable code triggers during a read() call.\n emitReadable(stream)\n } else {\n // Emit 'readable' now to make sure it gets picked up.\n state.needReadable = false\n state.emittedReadable = true\n // We have to emit readable now that we are EOF. Modules\n // in the ecosystem (e.g. dicer) rely on this event being sync.\n emitReadable_(stream)\n }\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n const state = stream._readableState\n debug('emitReadable', state.needReadable, state.emittedReadable)\n state.needReadable = false\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing)\n state.emittedReadable = true\n process.nextTick(emitReadable_, stream)\n }\n}\nfunction emitReadable_(stream) {\n const state = stream._readableState\n debug('emitReadable_', state.destroyed, state.length, state.ended)\n if (!state.destroyed && !state.errored && (state.length || state.ended)) {\n stream.emit('readable')\n state.emittedReadable = false\n }\n\n // The stream needs another readable event if:\n // 1. It is not flowing, as the flow mechanism will take\n // care of it.\n // 2. It is not ended.\n // 3. It is below the highWaterMark, so we can schedule\n // another readable later.\n state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark\n flow(stream)\n}\n\n// At this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore && state.constructed) {\n state.readingMore = true\n process.nextTick(maybeReadMore_, stream, state)\n }\n}\nfunction maybeReadMore_(stream, state) {\n // Attempt to read more data if we should.\n //\n // The conditions for reading more data are (one of):\n // - Not enough data buffered (state.length < state.highWaterMark). The loop\n // is responsible for filling the buffer with enough data if such data\n // is available. If highWaterMark is 0 and we are not in the flowing mode\n // we should _not_ attempt to buffer any extra data. We'll get more data\n // when the stream consumer calls read() instead.\n // - No data in the buffer, and the stream is in flowing mode. In this mode\n // the loop below is responsible for ensuring read() is called. Failing to\n // call read here would abort the flow and there's no other mechanism for\n // continuing the flow if the stream consumer has just subscribed to the\n // 'data' event.\n //\n // In addition to the above conditions to keep reading data, the following\n // conditions prevent the data from being read:\n // - The stream has ended (state.ended).\n // - There is already a pending 'read' operation (state.reading). This is a\n // case where the stream has called the implementation defined _read()\n // method, but they are processing the call asynchronously and have _not_\n // called push() with new data. In this case we skip performing more\n // read()s. The execution ends in this method again after the _read() ends\n // up calling push() with more data.\n while (\n !state.reading &&\n !state.ended &&\n (state.length < state.highWaterMark || (state.flowing && state.length === 0))\n ) {\n const len = state.length\n debug('maybeReadMore read 0')\n stream.read(0)\n if (len === state.length)\n // Didn't get any data, stop spinning.\n break\n }\n state.readingMore = false\n}\n\n// Abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n throw new ERR_METHOD_NOT_IMPLEMENTED('_read()')\n}\nReadable.prototype.pipe = function (dest, pipeOpts) {\n const src = this\n const state = this._readableState\n if (state.pipes.length === 1) {\n if (!state.multiAwaitDrain) {\n state.multiAwaitDrain = true\n state.awaitDrainWriters = new SafeSet(state.awaitDrainWriters ? [state.awaitDrainWriters] : [])\n }\n }\n state.pipes.push(dest)\n debug('pipe count=%d opts=%j', state.pipes.length, pipeOpts)\n const doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr\n const endFn = doEnd ? onend : unpipe\n if (state.endEmitted) process.nextTick(endFn)\n else src.once('end', endFn)\n dest.on('unpipe', onunpipe)\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe')\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true\n cleanup()\n }\n }\n }\n function onend() {\n debug('onend')\n dest.end()\n }\n let ondrain\n let cleanedUp = false\n function cleanup() {\n debug('cleanup')\n // Cleanup event handlers once the pipe is broken.\n dest.removeListener('close', onclose)\n dest.removeListener('finish', onfinish)\n if (ondrain) {\n dest.removeListener('drain', ondrain)\n }\n dest.removeListener('error', onerror)\n dest.removeListener('unpipe', onunpipe)\n src.removeListener('end', onend)\n src.removeListener('end', unpipe)\n src.removeListener('data', ondata)\n cleanedUp = true\n\n // If the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (ondrain && state.awaitDrainWriters && (!dest._writableState || dest._writableState.needDrain)) ondrain()\n }\n function pause() {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if (!cleanedUp) {\n if (state.pipes.length === 1 && state.pipes[0] === dest) {\n debug('false write response, pause', 0)\n state.awaitDrainWriters = dest\n state.multiAwaitDrain = false\n } else if (state.pipes.length > 1 && state.pipes.includes(dest)) {\n debug('false write response, pause', state.awaitDrainWriters.size)\n state.awaitDrainWriters.add(dest)\n }\n src.pause()\n }\n if (!ondrain) {\n // When the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n ondrain = pipeOnDrain(src, dest)\n dest.on('drain', ondrain)\n }\n }\n src.on('data', ondata)\n function ondata(chunk) {\n debug('ondata')\n const ret = dest.write(chunk)\n debug('dest.write', ret)\n if (ret === false) {\n pause()\n }\n }\n\n // If the dest has an error, then stop piping into it.\n // However, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er)\n unpipe()\n dest.removeListener('error', onerror)\n if (dest.listenerCount('error') === 0) {\n const s = dest._writableState || dest._readableState\n if (s && !s.errorEmitted) {\n // User incorrectly emitted 'error' directly on the stream.\n errorOrDestroy(dest, er)\n } else {\n dest.emit('error', er)\n }\n }\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror)\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish)\n unpipe()\n }\n dest.once('close', onclose)\n function onfinish() {\n debug('onfinish')\n dest.removeListener('close', onclose)\n unpipe()\n }\n dest.once('finish', onfinish)\n function unpipe() {\n debug('unpipe')\n src.unpipe(dest)\n }\n\n // Tell the dest that it's being piped to.\n dest.emit('pipe', src)\n\n // Start the flow if it hasn't been started already.\n\n if (dest.writableNeedDrain === true) {\n pause()\n } else if (!state.flowing) {\n debug('pipe resume')\n src.resume()\n }\n return dest\n}\nfunction pipeOnDrain(src, dest) {\n return function pipeOnDrainFunctionResult() {\n const state = src._readableState\n\n // `ondrain` will call directly,\n // `this` maybe not a reference to dest,\n // so we use the real dest here.\n if (state.awaitDrainWriters === dest) {\n debug('pipeOnDrain', 1)\n state.awaitDrainWriters = null\n } else if (state.multiAwaitDrain) {\n debug('pipeOnDrain', state.awaitDrainWriters.size)\n state.awaitDrainWriters.delete(dest)\n }\n if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) && src.listenerCount('data')) {\n src.resume()\n }\n }\n}\nReadable.prototype.unpipe = function (dest) {\n const state = this._readableState\n const unpipeInfo = {\n hasUnpiped: false\n }\n\n // If we're not piping anywhere, then do nothing.\n if (state.pipes.length === 0) return this\n if (!dest) {\n // remove all.\n const dests = state.pipes\n state.pipes = []\n this.pause()\n for (let i = 0; i < dests.length; i++)\n dests[i].emit('unpipe', this, {\n hasUnpiped: false\n })\n return this\n }\n\n // Try to find the right one.\n const index = ArrayPrototypeIndexOf(state.pipes, dest)\n if (index === -1) return this\n state.pipes.splice(index, 1)\n if (state.pipes.length === 0) this.pause()\n dest.emit('unpipe', this, unpipeInfo)\n return this\n}\n\n// Set up data events if they are asked for\n// Ensure readable listeners eventually get something.\nReadable.prototype.on = function (ev, fn) {\n const res = Stream.prototype.on.call(this, ev, fn)\n const state = this._readableState\n if (ev === 'data') {\n // Update readableListening so that resume() may be a no-op\n // a few lines down. This is needed to support once('readable').\n state.readableListening = this.listenerCount('readable') > 0\n\n // Try start flowing on next tick if stream isn't explicitly paused.\n if (state.flowing !== false) this.resume()\n } else if (ev === 'readable') {\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true\n state.flowing = false\n state.emittedReadable = false\n debug('on readable', state.length, state.reading)\n if (state.length) {\n emitReadable(this)\n } else if (!state.reading) {\n process.nextTick(nReadingNextTick, this)\n }\n }\n }\n return res\n}\nReadable.prototype.addListener = Readable.prototype.on\nReadable.prototype.removeListener = function (ev, fn) {\n const res = Stream.prototype.removeListener.call(this, ev, fn)\n if (ev === 'readable') {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this)\n }\n return res\n}\nReadable.prototype.off = Readable.prototype.removeListener\nReadable.prototype.removeAllListeners = function (ev) {\n const res = Stream.prototype.removeAllListeners.apply(this, arguments)\n if (ev === 'readable' || ev === undefined) {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this)\n }\n return res\n}\nfunction updateReadableListening(self) {\n const state = self._readableState\n state.readableListening = self.listenerCount('readable') > 0\n if (state.resumeScheduled && state[kPaused] === false) {\n // Flowing needs to be set to true now, otherwise\n // the upcoming resume will not flow.\n state.flowing = true\n\n // Crude way to check if we should resume.\n } else if (self.listenerCount('data') > 0) {\n self.resume()\n } else if (!state.readableListening) {\n state.flowing = null\n }\n}\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0')\n self.read(0)\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n const state = this._readableState\n if (!state.flowing) {\n debug('resume')\n // We flow only if there is no one listening\n // for readable, but we still have to call\n // resume().\n state.flowing = !state.readableListening\n resume(this, state)\n }\n state[kPaused] = false\n return this\n}\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true\n process.nextTick(resume_, stream, state)\n }\n}\nfunction resume_(stream, state) {\n debug('resume', state.reading)\n if (!state.reading) {\n stream.read(0)\n }\n state.resumeScheduled = false\n stream.emit('resume')\n flow(stream)\n if (state.flowing && !state.reading) stream.read(0)\n}\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing)\n if (this._readableState.flowing !== false) {\n debug('pause')\n this._readableState.flowing = false\n this.emit('pause')\n }\n this._readableState[kPaused] = true\n return this\n}\nfunction flow(stream) {\n const state = stream._readableState\n debug('flow', state.flowing)\n while (state.flowing && stream.read() !== null);\n}\n\n// Wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n let paused = false\n\n // TODO (ronag): Should this.destroy(err) emit\n // 'error' on the wrapped stream? Would require\n // a static factory method, e.g. Readable.wrap(stream).\n\n stream.on('data', (chunk) => {\n if (!this.push(chunk) && stream.pause) {\n paused = true\n stream.pause()\n }\n })\n stream.on('end', () => {\n this.push(null)\n })\n stream.on('error', (err) => {\n errorOrDestroy(this, err)\n })\n stream.on('close', () => {\n this.destroy()\n })\n stream.on('destroy', () => {\n this.destroy()\n })\n this._read = () => {\n if (paused && stream.resume) {\n paused = false\n stream.resume()\n }\n }\n\n // Proxy all the other methods. Important when wrapping filters and duplexes.\n const streamKeys = ObjectKeys(stream)\n for (let j = 1; j < streamKeys.length; j++) {\n const i = streamKeys[j]\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = stream[i].bind(stream)\n }\n }\n return this\n}\nReadable.prototype[SymbolAsyncIterator] = function () {\n return streamToAsyncIterator(this)\n}\nReadable.prototype.iterator = function (options) {\n if (options !== undefined) {\n validateObject(options, 'options')\n }\n return streamToAsyncIterator(this, options)\n}\nfunction streamToAsyncIterator(stream, options) {\n if (typeof stream.read !== 'function') {\n stream = Readable.wrap(stream, {\n objectMode: true\n })\n }\n const iter = createAsyncIterator(stream, options)\n iter.stream = stream\n return iter\n}\nasync function* createAsyncIterator(stream, options) {\n let callback = nop\n function next(resolve) {\n if (this === stream) {\n callback()\n callback = nop\n } else {\n callback = resolve\n }\n }\n stream.on('readable', next)\n let error\n const cleanup = eos(\n stream,\n {\n writable: false\n },\n (err) => {\n error = err ? aggregateTwoErrors(error, err) : null\n callback()\n callback = nop\n }\n )\n try {\n while (true) {\n const chunk = stream.destroyed ? null : stream.read()\n if (chunk !== null) {\n yield chunk\n } else if (error) {\n throw error\n } else if (error === null) {\n return\n } else {\n await new Promise(next)\n }\n }\n } catch (err) {\n error = aggregateTwoErrors(error, err)\n throw error\n } finally {\n if (\n (error || (options === null || options === undefined ? undefined : options.destroyOnReturn) !== false) &&\n (error === undefined || stream._readableState.autoDestroy)\n ) {\n destroyImpl.destroyer(stream, null)\n } else {\n stream.off('readable', next)\n cleanup()\n }\n }\n}\n\n// Making it explicit these properties are not enumerable\n// because otherwise some prototype manipulation in\n// userland will fail.\nObjectDefineProperties(Readable.prototype, {\n readable: {\n __proto__: null,\n get() {\n const r = this._readableState\n // r.readable === false means that this is part of a Duplex stream\n // where the readable side was disabled upon construction.\n // Compat. The user might manually disable readable side through\n // deprecated setter.\n return !!r && r.readable !== false && !r.destroyed && !r.errorEmitted && !r.endEmitted\n },\n set(val) {\n // Backwards compat.\n if (this._readableState) {\n this._readableState.readable = !!val\n }\n }\n },\n readableDidRead: {\n __proto__: null,\n enumerable: false,\n get: function () {\n return this._readableState.dataEmitted\n }\n },\n readableAborted: {\n __proto__: null,\n enumerable: false,\n get: function () {\n return !!(\n this._readableState.readable !== false &&\n (this._readableState.destroyed || this._readableState.errored) &&\n !this._readableState.endEmitted\n )\n }\n },\n readableHighWaterMark: {\n __proto__: null,\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark\n }\n },\n readableBuffer: {\n __proto__: null,\n enumerable: false,\n get: function () {\n return this._readableState && this._readableState.buffer\n }\n },\n readableFlowing: {\n __proto__: null,\n enumerable: false,\n get: function () {\n return this._readableState.flowing\n },\n set: function (state) {\n if (this._readableState) {\n this._readableState.flowing = state\n }\n }\n },\n readableLength: {\n __proto__: null,\n enumerable: false,\n get() {\n return this._readableState.length\n }\n },\n readableObjectMode: {\n __proto__: null,\n enumerable: false,\n get() {\n return this._readableState ? this._readableState.objectMode : false\n }\n },\n readableEncoding: {\n __proto__: null,\n enumerable: false,\n get() {\n return this._readableState ? this._readableState.encoding : null\n }\n },\n errored: {\n __proto__: null,\n enumerable: false,\n get() {\n return this._readableState ? this._readableState.errored : null\n }\n },\n closed: {\n __proto__: null,\n get() {\n return this._readableState ? this._readableState.closed : false\n }\n },\n destroyed: {\n __proto__: null,\n enumerable: false,\n get() {\n return this._readableState ? this._readableState.destroyed : false\n },\n set(value) {\n // We ignore the value if the stream\n // has not been initialized yet.\n if (!this._readableState) {\n return\n }\n\n // Backward compatibility, the user is explicitly\n // managing destroyed.\n this._readableState.destroyed = value\n }\n },\n readableEnded: {\n __proto__: null,\n enumerable: false,\n get() {\n return this._readableState ? this._readableState.endEmitted : false\n }\n }\n})\nObjectDefineProperties(ReadableState.prototype, {\n // Legacy getter for `pipesCount`.\n pipesCount: {\n __proto__: null,\n get() {\n return this.pipes.length\n }\n },\n // Legacy property for `paused`.\n paused: {\n __proto__: null,\n get() {\n return this[kPaused] !== false\n },\n set(value) {\n this[kPaused] = !!value\n }\n }\n})\n\n// Exposed for testing purposes only.\nReadable._fromList = fromList\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered.\n if (state.length === 0) return null\n let ret\n if (state.objectMode) ret = state.buffer.shift()\n else if (!n || n >= state.length) {\n // Read it all, truncate the list.\n if (state.decoder) ret = state.buffer.join('')\n else if (state.buffer.length === 1) ret = state.buffer.first()\n else ret = state.buffer.concat(state.length)\n state.buffer.clear()\n } else {\n // read part of list.\n ret = state.buffer.consume(n, state.decoder)\n }\n return ret\n}\nfunction endReadable(stream) {\n const state = stream._readableState\n debug('endReadable', state.endEmitted)\n if (!state.endEmitted) {\n state.ended = true\n process.nextTick(endReadableNT, state, stream)\n }\n}\nfunction endReadableNT(state, stream) {\n debug('endReadableNT', state.endEmitted, state.length)\n\n // Check that we didn't get one last unshift.\n if (!state.errored && !state.closeEmitted && !state.endEmitted && state.length === 0) {\n state.endEmitted = true\n stream.emit('end')\n if (stream.writable && stream.allowHalfOpen === false) {\n process.nextTick(endWritableNT, stream)\n } else if (state.autoDestroy) {\n // In case of duplex streams we need a way to detect\n // if the writable side is ready for autoDestroy as well.\n const wState = stream._writableState\n const autoDestroy =\n !wState ||\n (wState.autoDestroy &&\n // We don't expect the writable to ever 'finish'\n // if writable is explicitly set to false.\n (wState.finished || wState.writable === false))\n if (autoDestroy) {\n stream.destroy()\n }\n }\n }\n}\nfunction endWritableNT(stream) {\n const writable = stream.writable && !stream.writableEnded && !stream.destroyed\n if (writable) {\n stream.end()\n }\n}\nReadable.from = function (iterable, opts) {\n return from(Readable, iterable, opts)\n}\nlet webStreamsAdapters\n\n// Lazy to avoid circular references\nfunction lazyWebStreams() {\n if (webStreamsAdapters === undefined) webStreamsAdapters = {}\n return webStreamsAdapters\n}\nReadable.fromWeb = function (readableStream, options) {\n return lazyWebStreams().newStreamReadableFromReadableStream(readableStream, options)\n}\nReadable.toWeb = function (streamReadable, options) {\n return lazyWebStreams().newReadableStreamFromStreamReadable(streamReadable, options)\n}\nReadable.wrap = function (src, options) {\n var _ref, _src$readableObjectMo\n return new Readable({\n objectMode:\n (_ref =\n (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== undefined\n ? _src$readableObjectMo\n : src.objectMode) !== null && _ref !== undefined\n ? _ref\n : true,\n ...options,\n destroy(err, callback) {\n destroyImpl.destroyer(src, err)\n callback(err)\n }\n }).wrap(src)\n}\n","'use strict'\n\nconst { MathFloor, NumberIsInteger } = require('../../ours/primordials')\nconst { validateInteger } = require('../validators')\nconst { ERR_INVALID_ARG_VALUE } = require('../../ours/errors').codes\nlet defaultHighWaterMarkBytes = 16 * 1024\nlet defaultHighWaterMarkObjectMode = 16\nfunction highWaterMarkFrom(options, isDuplex, duplexKey) {\n return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null\n}\nfunction getDefaultHighWaterMark(objectMode) {\n return objectMode ? defaultHighWaterMarkObjectMode : defaultHighWaterMarkBytes\n}\nfunction setDefaultHighWaterMark(objectMode, value) {\n validateInteger(value, 'value', 0)\n if (objectMode) {\n defaultHighWaterMarkObjectMode = value\n } else {\n defaultHighWaterMarkBytes = value\n }\n}\nfunction getHighWaterMark(state, options, duplexKey, isDuplex) {\n const hwm = highWaterMarkFrom(options, isDuplex, duplexKey)\n if (hwm != null) {\n if (!NumberIsInteger(hwm) || hwm < 0) {\n const name = isDuplex ? `options.${duplexKey}` : 'options.highWaterMark'\n throw new ERR_INVALID_ARG_VALUE(name, hwm)\n }\n return MathFloor(hwm)\n }\n\n // Default value\n return getDefaultHighWaterMark(state.objectMode)\n}\nmodule.exports = {\n getHighWaterMark,\n getDefaultHighWaterMark,\n setDefaultHighWaterMark\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict'\n\nconst { ObjectSetPrototypeOf, Symbol } = require('../../ours/primordials')\nmodule.exports = Transform\nconst { ERR_METHOD_NOT_IMPLEMENTED } = require('../../ours/errors').codes\nconst Duplex = require('./duplex')\nconst { getHighWaterMark } = require('./state')\nObjectSetPrototypeOf(Transform.prototype, Duplex.prototype)\nObjectSetPrototypeOf(Transform, Duplex)\nconst kCallback = Symbol('kCallback')\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options)\n\n // TODO (ronag): This should preferably always be\n // applied but would be semver-major. Or even better;\n // make Transform a Readable with the Writable interface.\n const readableHighWaterMark = options ? getHighWaterMark(this, options, 'readableHighWaterMark', true) : null\n if (readableHighWaterMark === 0) {\n // A Duplex will buffer both on the writable and readable side while\n // a Transform just wants to buffer hwm number of elements. To avoid\n // buffering twice we disable buffering on the writable side.\n options = {\n ...options,\n highWaterMark: null,\n readableHighWaterMark,\n // TODO (ronag): 0 is not optimal since we have\n // a \"bug\" where we check needDrain before calling _write and not after.\n // Refs: https://github.com/nodejs/node/pull/32887\n // Refs: https://github.com/nodejs/node/pull/35941\n writableHighWaterMark: options.writableHighWaterMark || 0\n }\n }\n Duplex.call(this, options)\n\n // We have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false\n this[kCallback] = null\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform\n if (typeof options.flush === 'function') this._flush = options.flush\n }\n\n // When the writable side finishes, then flush out anything remaining.\n // Backwards compat. Some Transform streams incorrectly implement _final\n // instead of or in addition to _flush. By using 'prefinish' instead of\n // implementing _final we continue supporting this unfortunate use case.\n this.on('prefinish', prefinish)\n}\nfunction final(cb) {\n if (typeof this._flush === 'function' && !this.destroyed) {\n this._flush((er, data) => {\n if (er) {\n if (cb) {\n cb(er)\n } else {\n this.destroy(er)\n }\n return\n }\n if (data != null) {\n this.push(data)\n }\n this.push(null)\n if (cb) {\n cb()\n }\n })\n } else {\n this.push(null)\n if (cb) {\n cb()\n }\n }\n}\nfunction prefinish() {\n if (this._final !== final) {\n final.call(this)\n }\n}\nTransform.prototype._final = final\nTransform.prototype._transform = function (chunk, encoding, callback) {\n throw new ERR_METHOD_NOT_IMPLEMENTED('_transform()')\n}\nTransform.prototype._write = function (chunk, encoding, callback) {\n const rState = this._readableState\n const wState = this._writableState\n const length = rState.length\n this._transform(chunk, encoding, (err, val) => {\n if (err) {\n callback(err)\n return\n }\n if (val != null) {\n this.push(val)\n }\n if (\n wState.ended ||\n // Backwards compat.\n length === rState.length ||\n // Backwards compat.\n rState.length < rState.highWaterMark\n ) {\n callback()\n } else {\n this[kCallback] = callback\n }\n })\n}\nTransform.prototype._read = function () {\n if (this[kCallback]) {\n const callback = this[kCallback]\n this[kCallback] = null\n callback()\n }\n}\n","'use strict'\n\nconst { SymbolAsyncIterator, SymbolIterator, SymbolFor } = require('../../ours/primordials')\n\n// We need to use SymbolFor to make these globally available\n// for interopt with readable-stream, i.e. readable-stream\n// and node core needs to be able to read/write private state\n// from each other for proper interoperability.\nconst kIsDestroyed = SymbolFor('nodejs.stream.destroyed')\nconst kIsErrored = SymbolFor('nodejs.stream.errored')\nconst kIsReadable = SymbolFor('nodejs.stream.readable')\nconst kIsWritable = SymbolFor('nodejs.stream.writable')\nconst kIsDisturbed = SymbolFor('nodejs.stream.disturbed')\nconst kIsClosedPromise = SymbolFor('nodejs.webstream.isClosedPromise')\nconst kControllerErrorFunction = SymbolFor('nodejs.webstream.controllerErrorFunction')\nfunction isReadableNodeStream(obj, strict = false) {\n var _obj$_readableState\n return !!(\n (\n obj &&\n typeof obj.pipe === 'function' &&\n typeof obj.on === 'function' &&\n (!strict || (typeof obj.pause === 'function' && typeof obj.resume === 'function')) &&\n (!obj._writableState ||\n ((_obj$_readableState = obj._readableState) === null || _obj$_readableState === undefined\n ? undefined\n : _obj$_readableState.readable) !== false) &&\n // Duplex\n (!obj._writableState || obj._readableState)\n ) // Writable has .pipe.\n )\n}\n\nfunction isWritableNodeStream(obj) {\n var _obj$_writableState\n return !!(\n (\n obj &&\n typeof obj.write === 'function' &&\n typeof obj.on === 'function' &&\n (!obj._readableState ||\n ((_obj$_writableState = obj._writableState) === null || _obj$_writableState === undefined\n ? undefined\n : _obj$_writableState.writable) !== false)\n ) // Duplex\n )\n}\n\nfunction isDuplexNodeStream(obj) {\n return !!(\n obj &&\n typeof obj.pipe === 'function' &&\n obj._readableState &&\n typeof obj.on === 'function' &&\n typeof obj.write === 'function'\n )\n}\nfunction isNodeStream(obj) {\n return (\n obj &&\n (obj._readableState ||\n obj._writableState ||\n (typeof obj.write === 'function' && typeof obj.on === 'function') ||\n (typeof obj.pipe === 'function' && typeof obj.on === 'function'))\n )\n}\nfunction isReadableStream(obj) {\n return !!(\n obj &&\n !isNodeStream(obj) &&\n typeof obj.pipeThrough === 'function' &&\n typeof obj.getReader === 'function' &&\n typeof obj.cancel === 'function'\n )\n}\nfunction isWritableStream(obj) {\n return !!(obj && !isNodeStream(obj) && typeof obj.getWriter === 'function' && typeof obj.abort === 'function')\n}\nfunction isTransformStream(obj) {\n return !!(obj && !isNodeStream(obj) && typeof obj.readable === 'object' && typeof obj.writable === 'object')\n}\nfunction isWebStream(obj) {\n return isReadableStream(obj) || isWritableStream(obj) || isTransformStream(obj)\n}\nfunction isIterable(obj, isAsync) {\n if (obj == null) return false\n if (isAsync === true) return typeof obj[SymbolAsyncIterator] === 'function'\n if (isAsync === false) return typeof obj[SymbolIterator] === 'function'\n return typeof obj[SymbolAsyncIterator] === 'function' || typeof obj[SymbolIterator] === 'function'\n}\nfunction isDestroyed(stream) {\n if (!isNodeStream(stream)) return null\n const wState = stream._writableState\n const rState = stream._readableState\n const state = wState || rState\n return !!(stream.destroyed || stream[kIsDestroyed] || (state !== null && state !== undefined && state.destroyed))\n}\n\n// Have been end():d.\nfunction isWritableEnded(stream) {\n if (!isWritableNodeStream(stream)) return null\n if (stream.writableEnded === true) return true\n const wState = stream._writableState\n if (wState !== null && wState !== undefined && wState.errored) return false\n if (typeof (wState === null || wState === undefined ? undefined : wState.ended) !== 'boolean') return null\n return wState.ended\n}\n\n// Have emitted 'finish'.\nfunction isWritableFinished(stream, strict) {\n if (!isWritableNodeStream(stream)) return null\n if (stream.writableFinished === true) return true\n const wState = stream._writableState\n if (wState !== null && wState !== undefined && wState.errored) return false\n if (typeof (wState === null || wState === undefined ? undefined : wState.finished) !== 'boolean') return null\n return !!(wState.finished || (strict === false && wState.ended === true && wState.length === 0))\n}\n\n// Have been push(null):d.\nfunction isReadableEnded(stream) {\n if (!isReadableNodeStream(stream)) return null\n if (stream.readableEnded === true) return true\n const rState = stream._readableState\n if (!rState || rState.errored) return false\n if (typeof (rState === null || rState === undefined ? undefined : rState.ended) !== 'boolean') return null\n return rState.ended\n}\n\n// Have emitted 'end'.\nfunction isReadableFinished(stream, strict) {\n if (!isReadableNodeStream(stream)) return null\n const rState = stream._readableState\n if (rState !== null && rState !== undefined && rState.errored) return false\n if (typeof (rState === null || rState === undefined ? undefined : rState.endEmitted) !== 'boolean') return null\n return !!(rState.endEmitted || (strict === false && rState.ended === true && rState.length === 0))\n}\nfunction isReadable(stream) {\n if (stream && stream[kIsReadable] != null) return stream[kIsReadable]\n if (typeof (stream === null || stream === undefined ? undefined : stream.readable) !== 'boolean') return null\n if (isDestroyed(stream)) return false\n return isReadableNodeStream(stream) && stream.readable && !isReadableFinished(stream)\n}\nfunction isWritable(stream) {\n if (stream && stream[kIsWritable] != null) return stream[kIsWritable]\n if (typeof (stream === null || stream === undefined ? undefined : stream.writable) !== 'boolean') return null\n if (isDestroyed(stream)) return false\n return isWritableNodeStream(stream) && stream.writable && !isWritableEnded(stream)\n}\nfunction isFinished(stream, opts) {\n if (!isNodeStream(stream)) {\n return null\n }\n if (isDestroyed(stream)) {\n return true\n }\n if ((opts === null || opts === undefined ? undefined : opts.readable) !== false && isReadable(stream)) {\n return false\n }\n if ((opts === null || opts === undefined ? undefined : opts.writable) !== false && isWritable(stream)) {\n return false\n }\n return true\n}\nfunction isWritableErrored(stream) {\n var _stream$_writableStat, _stream$_writableStat2\n if (!isNodeStream(stream)) {\n return null\n }\n if (stream.writableErrored) {\n return stream.writableErrored\n }\n return (_stream$_writableStat =\n (_stream$_writableStat2 = stream._writableState) === null || _stream$_writableStat2 === undefined\n ? undefined\n : _stream$_writableStat2.errored) !== null && _stream$_writableStat !== undefined\n ? _stream$_writableStat\n : null\n}\nfunction isReadableErrored(stream) {\n var _stream$_readableStat, _stream$_readableStat2\n if (!isNodeStream(stream)) {\n return null\n }\n if (stream.readableErrored) {\n return stream.readableErrored\n }\n return (_stream$_readableStat =\n (_stream$_readableStat2 = stream._readableState) === null || _stream$_readableStat2 === undefined\n ? undefined\n : _stream$_readableStat2.errored) !== null && _stream$_readableStat !== undefined\n ? _stream$_readableStat\n : null\n}\nfunction isClosed(stream) {\n if (!isNodeStream(stream)) {\n return null\n }\n if (typeof stream.closed === 'boolean') {\n return stream.closed\n }\n const wState = stream._writableState\n const rState = stream._readableState\n if (\n typeof (wState === null || wState === undefined ? undefined : wState.closed) === 'boolean' ||\n typeof (rState === null || rState === undefined ? undefined : rState.closed) === 'boolean'\n ) {\n return (\n (wState === null || wState === undefined ? undefined : wState.closed) ||\n (rState === null || rState === undefined ? undefined : rState.closed)\n )\n }\n if (typeof stream._closed === 'boolean' && isOutgoingMessage(stream)) {\n return stream._closed\n }\n return null\n}\nfunction isOutgoingMessage(stream) {\n return (\n typeof stream._closed === 'boolean' &&\n typeof stream._defaultKeepAlive === 'boolean' &&\n typeof stream._removedConnection === 'boolean' &&\n typeof stream._removedContLen === 'boolean'\n )\n}\nfunction isServerResponse(stream) {\n return typeof stream._sent100 === 'boolean' && isOutgoingMessage(stream)\n}\nfunction isServerRequest(stream) {\n var _stream$req\n return (\n typeof stream._consuming === 'boolean' &&\n typeof stream._dumped === 'boolean' &&\n ((_stream$req = stream.req) === null || _stream$req === undefined ? undefined : _stream$req.upgradeOrConnect) ===\n undefined\n )\n}\nfunction willEmitClose(stream) {\n if (!isNodeStream(stream)) return null\n const wState = stream._writableState\n const rState = stream._readableState\n const state = wState || rState\n return (\n (!state && isServerResponse(stream)) || !!(state && state.autoDestroy && state.emitClose && state.closed === false)\n )\n}\nfunction isDisturbed(stream) {\n var _stream$kIsDisturbed\n return !!(\n stream &&\n ((_stream$kIsDisturbed = stream[kIsDisturbed]) !== null && _stream$kIsDisturbed !== undefined\n ? _stream$kIsDisturbed\n : stream.readableDidRead || stream.readableAborted)\n )\n}\nfunction isErrored(stream) {\n var _ref,\n _ref2,\n _ref3,\n _ref4,\n _ref5,\n _stream$kIsErrored,\n _stream$_readableStat3,\n _stream$_writableStat3,\n _stream$_readableStat4,\n _stream$_writableStat4\n return !!(\n stream &&\n ((_ref =\n (_ref2 =\n (_ref3 =\n (_ref4 =\n (_ref5 =\n (_stream$kIsErrored = stream[kIsErrored]) !== null && _stream$kIsErrored !== undefined\n ? _stream$kIsErrored\n : stream.readableErrored) !== null && _ref5 !== undefined\n ? _ref5\n : stream.writableErrored) !== null && _ref4 !== undefined\n ? _ref4\n : (_stream$_readableStat3 = stream._readableState) === null || _stream$_readableStat3 === undefined\n ? undefined\n : _stream$_readableStat3.errorEmitted) !== null && _ref3 !== undefined\n ? _ref3\n : (_stream$_writableStat3 = stream._writableState) === null || _stream$_writableStat3 === undefined\n ? undefined\n : _stream$_writableStat3.errorEmitted) !== null && _ref2 !== undefined\n ? _ref2\n : (_stream$_readableStat4 = stream._readableState) === null || _stream$_readableStat4 === undefined\n ? undefined\n : _stream$_readableStat4.errored) !== null && _ref !== undefined\n ? _ref\n : (_stream$_writableStat4 = stream._writableState) === null || _stream$_writableStat4 === undefined\n ? undefined\n : _stream$_writableStat4.errored)\n )\n}\nmodule.exports = {\n isDestroyed,\n kIsDestroyed,\n isDisturbed,\n kIsDisturbed,\n isErrored,\n kIsErrored,\n isReadable,\n kIsReadable,\n kIsClosedPromise,\n kControllerErrorFunction,\n kIsWritable,\n isClosed,\n isDuplexNodeStream,\n isFinished,\n isIterable,\n isReadableNodeStream,\n isReadableStream,\n isReadableEnded,\n isReadableFinished,\n isReadableErrored,\n isNodeStream,\n isWebStream,\n isWritable,\n isWritableNodeStream,\n isWritableStream,\n isWritableEnded,\n isWritableFinished,\n isWritableErrored,\n isServerRequest,\n isServerResponse,\n willEmitClose,\n isTransformStream\n}\n","/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n;('use strict')\nconst {\n ArrayPrototypeSlice,\n Error,\n FunctionPrototypeSymbolHasInstance,\n ObjectDefineProperty,\n ObjectDefineProperties,\n ObjectSetPrototypeOf,\n StringPrototypeToLowerCase,\n Symbol,\n SymbolHasInstance\n} = require('../../ours/primordials')\nmodule.exports = Writable\nWritable.WritableState = WritableState\nconst { EventEmitter: EE } = require('events')\nconst Stream = require('./legacy').Stream\nconst { Buffer } = require('buffer')\nconst destroyImpl = require('./destroy')\nconst { addAbortSignal } = require('./add-abort-signal')\nconst { getHighWaterMark, getDefaultHighWaterMark } = require('./state')\nconst {\n ERR_INVALID_ARG_TYPE,\n ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK,\n ERR_STREAM_CANNOT_PIPE,\n ERR_STREAM_DESTROYED,\n ERR_STREAM_ALREADY_FINISHED,\n ERR_STREAM_NULL_VALUES,\n ERR_STREAM_WRITE_AFTER_END,\n ERR_UNKNOWN_ENCODING\n} = require('../../ours/errors').codes\nconst { errorOrDestroy } = destroyImpl\nObjectSetPrototypeOf(Writable.prototype, Stream.prototype)\nObjectSetPrototypeOf(Writable, Stream)\nfunction nop() {}\nconst kOnFinished = Symbol('kOnFinished')\nfunction WritableState(options, stream, isDuplex) {\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream,\n // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof require('./duplex')\n\n // Object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!(options && options.objectMode)\n if (isDuplex) this.objectMode = this.objectMode || !!(options && options.writableObjectMode)\n\n // The point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write().\n this.highWaterMark = options\n ? getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex)\n : getDefaultHighWaterMark(false)\n\n // if _final has been called.\n this.finalCalled = false\n\n // drain event flag.\n this.needDrain = false\n // At the start of calling end()\n this.ending = false\n // When end() has been called, and returned.\n this.ended = false\n // When 'finish' is emitted.\n this.finished = false\n\n // Has it been destroyed\n this.destroyed = false\n\n // Should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n const noDecode = !!(options && options.decodeStrings === false)\n this.decodeStrings = !noDecode\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = (options && options.defaultEncoding) || 'utf8'\n\n // Not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0\n\n // A flag to see when we're in the middle of a write.\n this.writing = false\n\n // When true all writes will be buffered until .uncork() call.\n this.corked = 0\n\n // A flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true\n\n // A flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false\n\n // The callback that's passed to _write(chunk, cb).\n this.onwrite = onwrite.bind(undefined, stream)\n\n // The callback that the user supplies to write(chunk, encoding, cb).\n this.writecb = null\n\n // The amount that is being written when _write is called.\n this.writelen = 0\n\n // Storage for data passed to the afterWrite() callback in case of\n // synchronous _write() completion.\n this.afterWriteTickInfo = null\n resetBuffer(this)\n\n // Number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted.\n this.pendingcb = 0\n\n // Stream is still being constructed and cannot be\n // destroyed until construction finished or failed.\n // Async construction is opt in, therefore we start as\n // constructed.\n this.constructed = true\n\n // Emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams.\n this.prefinished = false\n\n // True if the error was already emitted and should not be thrown again.\n this.errorEmitted = false\n\n // Should close be emitted on destroy. Defaults to true.\n this.emitClose = !options || options.emitClose !== false\n\n // Should .destroy() be called after 'finish' (and potentially 'end').\n this.autoDestroy = !options || options.autoDestroy !== false\n\n // Indicates whether the stream has errored. When true all write() calls\n // should return false. This is needed since when autoDestroy\n // is disabled we need a way to tell whether the stream has failed.\n this.errored = null\n\n // Indicates whether the stream has finished destroying.\n this.closed = false\n\n // True if close has been emitted or would have been emitted\n // depending on emitClose.\n this.closeEmitted = false\n this[kOnFinished] = []\n}\nfunction resetBuffer(state) {\n state.buffered = []\n state.bufferedIndex = 0\n state.allBuffers = true\n state.allNoop = true\n}\nWritableState.prototype.getBuffer = function getBuffer() {\n return ArrayPrototypeSlice(this.buffered, this.bufferedIndex)\n}\nObjectDefineProperty(WritableState.prototype, 'bufferedRequestCount', {\n __proto__: null,\n get() {\n return this.buffered.length - this.bufferedIndex\n }\n})\nfunction Writable(options) {\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n\n // Checking for a Stream.Duplex instance is faster here instead of inside\n // the WritableState constructor, at least with V8 6.5.\n const isDuplex = this instanceof require('./duplex')\n if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable, this)) return new Writable(options)\n this._writableState = new WritableState(options, this, isDuplex)\n if (options) {\n if (typeof options.write === 'function') this._write = options.write\n if (typeof options.writev === 'function') this._writev = options.writev\n if (typeof options.destroy === 'function') this._destroy = options.destroy\n if (typeof options.final === 'function') this._final = options.final\n if (typeof options.construct === 'function') this._construct = options.construct\n if (options.signal) addAbortSignal(options.signal, this)\n }\n Stream.call(this, options)\n destroyImpl.construct(this, () => {\n const state = this._writableState\n if (!state.writing) {\n clearBuffer(this, state)\n }\n finishMaybe(this, state)\n })\n}\nObjectDefineProperty(Writable, SymbolHasInstance, {\n __proto__: null,\n value: function (object) {\n if (FunctionPrototypeSymbolHasInstance(this, object)) return true\n if (this !== Writable) return false\n return object && object._writableState instanceof WritableState\n }\n})\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE())\n}\nfunction _write(stream, chunk, encoding, cb) {\n const state = stream._writableState\n if (typeof encoding === 'function') {\n cb = encoding\n encoding = state.defaultEncoding\n } else {\n if (!encoding) encoding = state.defaultEncoding\n else if (encoding !== 'buffer' && !Buffer.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding)\n if (typeof cb !== 'function') cb = nop\n }\n if (chunk === null) {\n throw new ERR_STREAM_NULL_VALUES()\n } else if (!state.objectMode) {\n if (typeof chunk === 'string') {\n if (state.decodeStrings !== false) {\n chunk = Buffer.from(chunk, encoding)\n encoding = 'buffer'\n }\n } else if (chunk instanceof Buffer) {\n encoding = 'buffer'\n } else if (Stream._isUint8Array(chunk)) {\n chunk = Stream._uint8ArrayToBuffer(chunk)\n encoding = 'buffer'\n } else {\n throw new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk)\n }\n }\n let err\n if (state.ending) {\n err = new ERR_STREAM_WRITE_AFTER_END()\n } else if (state.destroyed) {\n err = new ERR_STREAM_DESTROYED('write')\n }\n if (err) {\n process.nextTick(cb, err)\n errorOrDestroy(stream, err, true)\n return err\n }\n state.pendingcb++\n return writeOrBuffer(stream, state, chunk, encoding, cb)\n}\nWritable.prototype.write = function (chunk, encoding, cb) {\n return _write(this, chunk, encoding, cb) === true\n}\nWritable.prototype.cork = function () {\n this._writableState.corked++\n}\nWritable.prototype.uncork = function () {\n const state = this._writableState\n if (state.corked) {\n state.corked--\n if (!state.writing) clearBuffer(this, state)\n }\n}\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = StringPrototypeToLowerCase(encoding)\n if (!Buffer.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding)\n this._writableState.defaultEncoding = encoding\n return this\n}\n\n// If we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, chunk, encoding, callback) {\n const len = state.objectMode ? 1 : chunk.length\n state.length += len\n\n // stream._write resets state.length\n const ret = state.length < state.highWaterMark\n // We must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true\n if (state.writing || state.corked || state.errored || !state.constructed) {\n state.buffered.push({\n chunk,\n encoding,\n callback\n })\n if (state.allBuffers && encoding !== 'buffer') {\n state.allBuffers = false\n }\n if (state.allNoop && callback !== nop) {\n state.allNoop = false\n }\n } else {\n state.writelen = len\n state.writecb = callback\n state.writing = true\n state.sync = true\n stream._write(chunk, encoding, state.onwrite)\n state.sync = false\n }\n\n // Return false if errored or destroyed in order to break\n // any synchronous while(stream.write(data)) loops.\n return ret && !state.errored && !state.destroyed\n}\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len\n state.writecb = cb\n state.writing = true\n state.sync = true\n if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'))\n else if (writev) stream._writev(chunk, state.onwrite)\n else stream._write(chunk, encoding, state.onwrite)\n state.sync = false\n}\nfunction onwriteError(stream, state, er, cb) {\n --state.pendingcb\n cb(er)\n // Ensure callbacks are invoked even when autoDestroy is\n // not enabled. Passing `er` here doesn't make sense since\n // it's related to one specific write, not to the buffered\n // writes.\n errorBuffer(state)\n // This can emit error, but error must always follow cb.\n errorOrDestroy(stream, er)\n}\nfunction onwrite(stream, er) {\n const state = stream._writableState\n const sync = state.sync\n const cb = state.writecb\n if (typeof cb !== 'function') {\n errorOrDestroy(stream, new ERR_MULTIPLE_CALLBACK())\n return\n }\n state.writing = false\n state.writecb = null\n state.length -= state.writelen\n state.writelen = 0\n if (er) {\n // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364\n er.stack // eslint-disable-line no-unused-expressions\n\n if (!state.errored) {\n state.errored = er\n }\n\n // In case of duplex streams we need to notify the readable side of the\n // error.\n if (stream._readableState && !stream._readableState.errored) {\n stream._readableState.errored = er\n }\n if (sync) {\n process.nextTick(onwriteError, stream, state, er, cb)\n } else {\n onwriteError(stream, state, er, cb)\n }\n } else {\n if (state.buffered.length > state.bufferedIndex) {\n clearBuffer(stream, state)\n }\n if (sync) {\n // It is a common case that the callback passed to .write() is always\n // the same. In that case, we do not schedule a new nextTick(), but\n // rather just increase a counter, to improve performance and avoid\n // memory allocations.\n if (state.afterWriteTickInfo !== null && state.afterWriteTickInfo.cb === cb) {\n state.afterWriteTickInfo.count++\n } else {\n state.afterWriteTickInfo = {\n count: 1,\n cb,\n stream,\n state\n }\n process.nextTick(afterWriteTick, state.afterWriteTickInfo)\n }\n } else {\n afterWrite(stream, state, 1, cb)\n }\n }\n}\nfunction afterWriteTick({ stream, state, count, cb }) {\n state.afterWriteTickInfo = null\n return afterWrite(stream, state, count, cb)\n}\nfunction afterWrite(stream, state, count, cb) {\n const needDrain = !state.ending && !stream.destroyed && state.length === 0 && state.needDrain\n if (needDrain) {\n state.needDrain = false\n stream.emit('drain')\n }\n while (count-- > 0) {\n state.pendingcb--\n cb()\n }\n if (state.destroyed) {\n errorBuffer(state)\n }\n finishMaybe(stream, state)\n}\n\n// If there's something in the buffer waiting, then invoke callbacks.\nfunction errorBuffer(state) {\n if (state.writing) {\n return\n }\n for (let n = state.bufferedIndex; n < state.buffered.length; ++n) {\n var _state$errored\n const { chunk, callback } = state.buffered[n]\n const len = state.objectMode ? 1 : chunk.length\n state.length -= len\n callback(\n (_state$errored = state.errored) !== null && _state$errored !== undefined\n ? _state$errored\n : new ERR_STREAM_DESTROYED('write')\n )\n }\n const onfinishCallbacks = state[kOnFinished].splice(0)\n for (let i = 0; i < onfinishCallbacks.length; i++) {\n var _state$errored2\n onfinishCallbacks[i](\n (_state$errored2 = state.errored) !== null && _state$errored2 !== undefined\n ? _state$errored2\n : new ERR_STREAM_DESTROYED('end')\n )\n }\n resetBuffer(state)\n}\n\n// If there's something in the buffer waiting, then process it.\nfunction clearBuffer(stream, state) {\n if (state.corked || state.bufferProcessing || state.destroyed || !state.constructed) {\n return\n }\n const { buffered, bufferedIndex, objectMode } = state\n const bufferedLength = buffered.length - bufferedIndex\n if (!bufferedLength) {\n return\n }\n let i = bufferedIndex\n state.bufferProcessing = true\n if (bufferedLength > 1 && stream._writev) {\n state.pendingcb -= bufferedLength - 1\n const callback = state.allNoop\n ? nop\n : (err) => {\n for (let n = i; n < buffered.length; ++n) {\n buffered[n].callback(err)\n }\n }\n // Make a copy of `buffered` if it's going to be used by `callback` above,\n // since `doWrite` will mutate the array.\n const chunks = state.allNoop && i === 0 ? buffered : ArrayPrototypeSlice(buffered, i)\n chunks.allBuffers = state.allBuffers\n doWrite(stream, state, true, state.length, chunks, '', callback)\n resetBuffer(state)\n } else {\n do {\n const { chunk, encoding, callback } = buffered[i]\n buffered[i++] = null\n const len = objectMode ? 1 : chunk.length\n doWrite(stream, state, false, len, chunk, encoding, callback)\n } while (i < buffered.length && !state.writing)\n if (i === buffered.length) {\n resetBuffer(state)\n } else if (i > 256) {\n buffered.splice(0, i)\n state.bufferedIndex = 0\n } else {\n state.bufferedIndex = i\n }\n }\n state.bufferProcessing = false\n}\nWritable.prototype._write = function (chunk, encoding, cb) {\n if (this._writev) {\n this._writev(\n [\n {\n chunk,\n encoding\n }\n ],\n cb\n )\n } else {\n throw new ERR_METHOD_NOT_IMPLEMENTED('_write()')\n }\n}\nWritable.prototype._writev = null\nWritable.prototype.end = function (chunk, encoding, cb) {\n const state = this._writableState\n if (typeof chunk === 'function') {\n cb = chunk\n chunk = null\n encoding = null\n } else if (typeof encoding === 'function') {\n cb = encoding\n encoding = null\n }\n let err\n if (chunk !== null && chunk !== undefined) {\n const ret = _write(this, chunk, encoding)\n if (ret instanceof Error) {\n err = ret\n }\n }\n\n // .end() fully uncorks.\n if (state.corked) {\n state.corked = 1\n this.uncork()\n }\n if (err) {\n // Do nothing...\n } else if (!state.errored && !state.ending) {\n // This is forgiving in terms of unnecessary calls to end() and can hide\n // logic errors. However, usually such errors are harmless and causing a\n // hard error can be disproportionately destructive. It is not always\n // trivial for the user to determine whether end() needs to be called\n // or not.\n\n state.ending = true\n finishMaybe(this, state, true)\n state.ended = true\n } else if (state.finished) {\n err = new ERR_STREAM_ALREADY_FINISHED('end')\n } else if (state.destroyed) {\n err = new ERR_STREAM_DESTROYED('end')\n }\n if (typeof cb === 'function') {\n if (err || state.finished) {\n process.nextTick(cb, err)\n } else {\n state[kOnFinished].push(cb)\n }\n }\n return this\n}\nfunction needFinish(state) {\n return (\n state.ending &&\n !state.destroyed &&\n state.constructed &&\n state.length === 0 &&\n !state.errored &&\n state.buffered.length === 0 &&\n !state.finished &&\n !state.writing &&\n !state.errorEmitted &&\n !state.closeEmitted\n )\n}\nfunction callFinal(stream, state) {\n let called = false\n function onFinish(err) {\n if (called) {\n errorOrDestroy(stream, err !== null && err !== undefined ? err : ERR_MULTIPLE_CALLBACK())\n return\n }\n called = true\n state.pendingcb--\n if (err) {\n const onfinishCallbacks = state[kOnFinished].splice(0)\n for (let i = 0; i < onfinishCallbacks.length; i++) {\n onfinishCallbacks[i](err)\n }\n errorOrDestroy(stream, err, state.sync)\n } else if (needFinish(state)) {\n state.prefinished = true\n stream.emit('prefinish')\n // Backwards compat. Don't check state.sync here.\n // Some streams assume 'finish' will be emitted\n // asynchronously relative to _final callback.\n state.pendingcb++\n process.nextTick(finish, stream, state)\n }\n }\n state.sync = true\n state.pendingcb++\n try {\n stream._final(onFinish)\n } catch (err) {\n onFinish(err)\n }\n state.sync = false\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function' && !state.destroyed) {\n state.finalCalled = true\n callFinal(stream, state)\n } else {\n state.prefinished = true\n stream.emit('prefinish')\n }\n }\n}\nfunction finishMaybe(stream, state, sync) {\n if (needFinish(state)) {\n prefinish(stream, state)\n if (state.pendingcb === 0) {\n if (sync) {\n state.pendingcb++\n process.nextTick(\n (stream, state) => {\n if (needFinish(state)) {\n finish(stream, state)\n } else {\n state.pendingcb--\n }\n },\n stream,\n state\n )\n } else if (needFinish(state)) {\n state.pendingcb++\n finish(stream, state)\n }\n }\n }\n}\nfunction finish(stream, state) {\n state.pendingcb--\n state.finished = true\n const onfinishCallbacks = state[kOnFinished].splice(0)\n for (let i = 0; i < onfinishCallbacks.length; i++) {\n onfinishCallbacks[i]()\n }\n stream.emit('finish')\n if (state.autoDestroy) {\n // In case of duplex streams we need a way to detect\n // if the readable side is ready for autoDestroy as well.\n const rState = stream._readableState\n const autoDestroy =\n !rState ||\n (rState.autoDestroy &&\n // We don't expect the readable to ever 'end'\n // if readable is explicitly set to false.\n (rState.endEmitted || rState.readable === false))\n if (autoDestroy) {\n stream.destroy()\n }\n }\n}\nObjectDefineProperties(Writable.prototype, {\n closed: {\n __proto__: null,\n get() {\n return this._writableState ? this._writableState.closed : false\n }\n },\n destroyed: {\n __proto__: null,\n get() {\n return this._writableState ? this._writableState.destroyed : false\n },\n set(value) {\n // Backward compatibility, the user is explicitly managing destroyed.\n if (this._writableState) {\n this._writableState.destroyed = value\n }\n }\n },\n writable: {\n __proto__: null,\n get() {\n const w = this._writableState\n // w.writable === false means that this is part of a Duplex stream\n // where the writable side was disabled upon construction.\n // Compat. The user might manually disable writable side through\n // deprecated setter.\n return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended\n },\n set(val) {\n // Backwards compatible.\n if (this._writableState) {\n this._writableState.writable = !!val\n }\n }\n },\n writableFinished: {\n __proto__: null,\n get() {\n return this._writableState ? this._writableState.finished : false\n }\n },\n writableObjectMode: {\n __proto__: null,\n get() {\n return this._writableState ? this._writableState.objectMode : false\n }\n },\n writableBuffer: {\n __proto__: null,\n get() {\n return this._writableState && this._writableState.getBuffer()\n }\n },\n writableEnded: {\n __proto__: null,\n get() {\n return this._writableState ? this._writableState.ending : false\n }\n },\n writableNeedDrain: {\n __proto__: null,\n get() {\n const wState = this._writableState\n if (!wState) return false\n return !wState.destroyed && !wState.ending && wState.needDrain\n }\n },\n writableHighWaterMark: {\n __proto__: null,\n get() {\n return this._writableState && this._writableState.highWaterMark\n }\n },\n writableCorked: {\n __proto__: null,\n get() {\n return this._writableState ? this._writableState.corked : 0\n }\n },\n writableLength: {\n __proto__: null,\n get() {\n return this._writableState && this._writableState.length\n }\n },\n errored: {\n __proto__: null,\n enumerable: false,\n get() {\n return this._writableState ? this._writableState.errored : null\n }\n },\n writableAborted: {\n __proto__: null,\n enumerable: false,\n get: function () {\n return !!(\n this._writableState.writable !== false &&\n (this._writableState.destroyed || this._writableState.errored) &&\n !this._writableState.finished\n )\n }\n }\n})\nconst destroy = destroyImpl.destroy\nWritable.prototype.destroy = function (err, cb) {\n const state = this._writableState\n\n // Invoke pending callbacks.\n if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length)) {\n process.nextTick(errorBuffer, state)\n }\n destroy.call(this, err, cb)\n return this\n}\nWritable.prototype._undestroy = destroyImpl.undestroy\nWritable.prototype._destroy = function (err, cb) {\n cb(err)\n}\nWritable.prototype[EE.captureRejectionSymbol] = function (err) {\n this.destroy(err)\n}\nlet webStreamsAdapters\n\n// Lazy to avoid circular references\nfunction lazyWebStreams() {\n if (webStreamsAdapters === undefined) webStreamsAdapters = {}\n return webStreamsAdapters\n}\nWritable.fromWeb = function (writableStream, options) {\n return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options)\n}\nWritable.toWeb = function (streamWritable) {\n return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable)\n}\n","/* eslint jsdoc/require-jsdoc: \"error\" */\n\n'use strict'\n\nconst {\n ArrayIsArray,\n ArrayPrototypeIncludes,\n ArrayPrototypeJoin,\n ArrayPrototypeMap,\n NumberIsInteger,\n NumberIsNaN,\n NumberMAX_SAFE_INTEGER,\n NumberMIN_SAFE_INTEGER,\n NumberParseInt,\n ObjectPrototypeHasOwnProperty,\n RegExpPrototypeExec,\n String,\n StringPrototypeToUpperCase,\n StringPrototypeTrim\n} = require('../ours/primordials')\nconst {\n hideStackFrames,\n codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL }\n} = require('../ours/errors')\nconst { normalizeEncoding } = require('../ours/util')\nconst { isAsyncFunction, isArrayBufferView } = require('../ours/util').types\nconst signals = {}\n\n/**\n * @param {*} value\n * @returns {boolean}\n */\nfunction isInt32(value) {\n return value === (value | 0)\n}\n\n/**\n * @param {*} value\n * @returns {boolean}\n */\nfunction isUint32(value) {\n return value === value >>> 0\n}\nconst octalReg = /^[0-7]+$/\nconst modeDesc = 'must be a 32-bit unsigned integer or an octal string'\n\n/**\n * Parse and validate values that will be converted into mode_t (the S_*\n * constants). Only valid numbers and octal strings are allowed. They could be\n * converted to 32-bit unsigned integers or non-negative signed integers in the\n * C++ land, but any value higher than 0o777 will result in platform-specific\n * behaviors.\n * @param {*} value Values to be validated\n * @param {string} name Name of the argument\n * @param {number} [def] If specified, will be returned for invalid values\n * @returns {number}\n */\nfunction parseFileMode(value, name, def) {\n if (typeof value === 'undefined') {\n value = def\n }\n if (typeof value === 'string') {\n if (RegExpPrototypeExec(octalReg, value) === null) {\n throw new ERR_INVALID_ARG_VALUE(name, value, modeDesc)\n }\n value = NumberParseInt(value, 8)\n }\n validateUint32(value, name)\n return value\n}\n\n/**\n * @callback validateInteger\n * @param {*} value\n * @param {string} name\n * @param {number} [min]\n * @param {number} [max]\n * @returns {asserts value is number}\n */\n\n/** @type {validateInteger} */\nconst validateInteger = hideStackFrames((value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) => {\n if (typeof value !== 'number') throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n if (!NumberIsInteger(value)) throw new ERR_OUT_OF_RANGE(name, 'an integer', value)\n if (value < min || value > max) throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value)\n})\n\n/**\n * @callback validateInt32\n * @param {*} value\n * @param {string} name\n * @param {number} [min]\n * @param {number} [max]\n * @returns {asserts value is number}\n */\n\n/** @type {validateInt32} */\nconst validateInt32 = hideStackFrames((value, name, min = -2147483648, max = 2147483647) => {\n // The defaults for min and max correspond to the limits of 32-bit integers.\n if (typeof value !== 'number') {\n throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n if (!NumberIsInteger(value)) {\n throw new ERR_OUT_OF_RANGE(name, 'an integer', value)\n }\n if (value < min || value > max) {\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value)\n }\n})\n\n/**\n * @callback validateUint32\n * @param {*} value\n * @param {string} name\n * @param {number|boolean} [positive=false]\n * @returns {asserts value is number}\n */\n\n/** @type {validateUint32} */\nconst validateUint32 = hideStackFrames((value, name, positive = false) => {\n if (typeof value !== 'number') {\n throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n if (!NumberIsInteger(value)) {\n throw new ERR_OUT_OF_RANGE(name, 'an integer', value)\n }\n const min = positive ? 1 : 0\n // 2 ** 32 === 4294967296\n const max = 4294967295\n if (value < min || value > max) {\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value)\n }\n})\n\n/**\n * @callback validateString\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is string}\n */\n\n/** @type {validateString} */\nfunction validateString(value, name) {\n if (typeof value !== 'string') throw new ERR_INVALID_ARG_TYPE(name, 'string', value)\n}\n\n/**\n * @callback validateNumber\n * @param {*} value\n * @param {string} name\n * @param {number} [min]\n * @param {number} [max]\n * @returns {asserts value is number}\n */\n\n/** @type {validateNumber} */\nfunction validateNumber(value, name, min = undefined, max) {\n if (typeof value !== 'number') throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n if (\n (min != null && value < min) ||\n (max != null && value > max) ||\n ((min != null || max != null) && NumberIsNaN(value))\n ) {\n throw new ERR_OUT_OF_RANGE(\n name,\n `${min != null ? `>= ${min}` : ''}${min != null && max != null ? ' && ' : ''}${max != null ? `<= ${max}` : ''}`,\n value\n )\n }\n}\n\n/**\n * @callback validateOneOf\n * @template T\n * @param {T} value\n * @param {string} name\n * @param {T[]} oneOf\n */\n\n/** @type {validateOneOf} */\nconst validateOneOf = hideStackFrames((value, name, oneOf) => {\n if (!ArrayPrototypeIncludes(oneOf, value)) {\n const allowed = ArrayPrototypeJoin(\n ArrayPrototypeMap(oneOf, (v) => (typeof v === 'string' ? `'${v}'` : String(v))),\n ', '\n )\n const reason = 'must be one of: ' + allowed\n throw new ERR_INVALID_ARG_VALUE(name, value, reason)\n }\n})\n\n/**\n * @callback validateBoolean\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is boolean}\n */\n\n/** @type {validateBoolean} */\nfunction validateBoolean(value, name) {\n if (typeof value !== 'boolean') throw new ERR_INVALID_ARG_TYPE(name, 'boolean', value)\n}\n\n/**\n * @param {any} options\n * @param {string} key\n * @param {boolean} defaultValue\n * @returns {boolean}\n */\nfunction getOwnPropertyValueOrDefault(options, key, defaultValue) {\n return options == null || !ObjectPrototypeHasOwnProperty(options, key) ? defaultValue : options[key]\n}\n\n/**\n * @callback validateObject\n * @param {*} value\n * @param {string} name\n * @param {{\n * allowArray?: boolean,\n * allowFunction?: boolean,\n * nullable?: boolean\n * }} [options]\n */\n\n/** @type {validateObject} */\nconst validateObject = hideStackFrames((value, name, options = null) => {\n const allowArray = getOwnPropertyValueOrDefault(options, 'allowArray', false)\n const allowFunction = getOwnPropertyValueOrDefault(options, 'allowFunction', false)\n const nullable = getOwnPropertyValueOrDefault(options, 'nullable', false)\n if (\n (!nullable && value === null) ||\n (!allowArray && ArrayIsArray(value)) ||\n (typeof value !== 'object' && (!allowFunction || typeof value !== 'function'))\n ) {\n throw new ERR_INVALID_ARG_TYPE(name, 'Object', value)\n }\n})\n\n/**\n * @callback validateDictionary - We are using the Web IDL Standard definition\n * of \"dictionary\" here, which means any value\n * whose Type is either Undefined, Null, or\n * Object (which includes functions).\n * @param {*} value\n * @param {string} name\n * @see https://webidl.spec.whatwg.org/#es-dictionary\n * @see https://tc39.es/ecma262/#table-typeof-operator-results\n */\n\n/** @type {validateDictionary} */\nconst validateDictionary = hideStackFrames((value, name) => {\n if (value != null && typeof value !== 'object' && typeof value !== 'function') {\n throw new ERR_INVALID_ARG_TYPE(name, 'a dictionary', value)\n }\n})\n\n/**\n * @callback validateArray\n * @param {*} value\n * @param {string} name\n * @param {number} [minLength]\n * @returns {asserts value is any[]}\n */\n\n/** @type {validateArray} */\nconst validateArray = hideStackFrames((value, name, minLength = 0) => {\n if (!ArrayIsArray(value)) {\n throw new ERR_INVALID_ARG_TYPE(name, 'Array', value)\n }\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`\n throw new ERR_INVALID_ARG_VALUE(name, value, reason)\n }\n})\n\n/**\n * @callback validateStringArray\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is string[]}\n */\n\n/** @type {validateStringArray} */\nfunction validateStringArray(value, name) {\n validateArray(value, name)\n for (let i = 0; i < value.length; i++) {\n validateString(value[i], `${name}[${i}]`)\n }\n}\n\n/**\n * @callback validateBooleanArray\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is boolean[]}\n */\n\n/** @type {validateBooleanArray} */\nfunction validateBooleanArray(value, name) {\n validateArray(value, name)\n for (let i = 0; i < value.length; i++) {\n validateBoolean(value[i], `${name}[${i}]`)\n }\n}\n\n/**\n * @callback validateAbortSignalArray\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is AbortSignal[]}\n */\n\n/** @type {validateAbortSignalArray} */\nfunction validateAbortSignalArray(value, name) {\n validateArray(value, name)\n for (let i = 0; i < value.length; i++) {\n const signal = value[i]\n const indexedName = `${name}[${i}]`\n if (signal == null) {\n throw new ERR_INVALID_ARG_TYPE(indexedName, 'AbortSignal', signal)\n }\n validateAbortSignal(signal, indexedName)\n }\n}\n\n/**\n * @param {*} signal\n * @param {string} [name='signal']\n * @returns {asserts signal is keyof signals}\n */\nfunction validateSignalName(signal, name = 'signal') {\n validateString(signal, name)\n if (signals[signal] === undefined) {\n if (signals[StringPrototypeToUpperCase(signal)] !== undefined) {\n throw new ERR_UNKNOWN_SIGNAL(signal + ' (signals must use all capital letters)')\n }\n throw new ERR_UNKNOWN_SIGNAL(signal)\n }\n}\n\n/**\n * @callback validateBuffer\n * @param {*} buffer\n * @param {string} [name='buffer']\n * @returns {asserts buffer is ArrayBufferView}\n */\n\n/** @type {validateBuffer} */\nconst validateBuffer = hideStackFrames((buffer, name = 'buffer') => {\n if (!isArrayBufferView(buffer)) {\n throw new ERR_INVALID_ARG_TYPE(name, ['Buffer', 'TypedArray', 'DataView'], buffer)\n }\n})\n\n/**\n * @param {string} data\n * @param {string} encoding\n */\nfunction validateEncoding(data, encoding) {\n const normalizedEncoding = normalizeEncoding(encoding)\n const length = data.length\n if (normalizedEncoding === 'hex' && length % 2 !== 0) {\n throw new ERR_INVALID_ARG_VALUE('encoding', encoding, `is invalid for data of length ${length}`)\n }\n}\n\n/**\n * Check that the port number is not NaN when coerced to a number,\n * is an integer and that it falls within the legal range of port numbers.\n * @param {*} port\n * @param {string} [name='Port']\n * @param {boolean} [allowZero=true]\n * @returns {number}\n */\nfunction validatePort(port, name = 'Port', allowZero = true) {\n if (\n (typeof port !== 'number' && typeof port !== 'string') ||\n (typeof port === 'string' && StringPrototypeTrim(port).length === 0) ||\n +port !== +port >>> 0 ||\n port > 0xffff ||\n (port === 0 && !allowZero)\n ) {\n throw new ERR_SOCKET_BAD_PORT(name, port, allowZero)\n }\n return port | 0\n}\n\n/**\n * @callback validateAbortSignal\n * @param {*} signal\n * @param {string} name\n */\n\n/** @type {validateAbortSignal} */\nconst validateAbortSignal = hideStackFrames((signal, name) => {\n if (signal !== undefined && (signal === null || typeof signal !== 'object' || !('aborted' in signal))) {\n throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal)\n }\n})\n\n/**\n * @callback validateFunction\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is Function}\n */\n\n/** @type {validateFunction} */\nconst validateFunction = hideStackFrames((value, name) => {\n if (typeof value !== 'function') throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)\n})\n\n/**\n * @callback validatePlainFunction\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is Function}\n */\n\n/** @type {validatePlainFunction} */\nconst validatePlainFunction = hideStackFrames((value, name) => {\n if (typeof value !== 'function' || isAsyncFunction(value)) throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)\n})\n\n/**\n * @callback validateUndefined\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is undefined}\n */\n\n/** @type {validateUndefined} */\nconst validateUndefined = hideStackFrames((value, name) => {\n if (value !== undefined) throw new ERR_INVALID_ARG_TYPE(name, 'undefined', value)\n})\n\n/**\n * @template T\n * @param {T} value\n * @param {string} name\n * @param {T[]} union\n */\nfunction validateUnion(value, name, union) {\n if (!ArrayPrototypeIncludes(union, value)) {\n throw new ERR_INVALID_ARG_TYPE(name, `('${ArrayPrototypeJoin(union, '|')}')`, value)\n }\n}\n\n/*\n The rules for the Link header field are described here:\n https://www.rfc-editor.org/rfc/rfc8288.html#section-3\n\n This regex validates any string surrounded by angle brackets\n (not necessarily a valid URI reference) followed by zero or more\n link-params separated by semicolons.\n*/\nconst linkValueRegExp = /^(?:<[^>]*>)(?:\\s*;\\s*[^;\"\\s]+(?:=(\")?[^;\"\\s]*\\1)?)*$/\n\n/**\n * @param {any} value\n * @param {string} name\n */\nfunction validateLinkHeaderFormat(value, name) {\n if (typeof value === 'undefined' || !RegExpPrototypeExec(linkValueRegExp, value)) {\n throw new ERR_INVALID_ARG_VALUE(\n name,\n value,\n 'must be an array or string of format \"; rel=preload; as=style\"'\n )\n }\n}\n\n/**\n * @param {any} hints\n * @return {string}\n */\nfunction validateLinkHeaderValue(hints) {\n if (typeof hints === 'string') {\n validateLinkHeaderFormat(hints, 'hints')\n return hints\n } else if (ArrayIsArray(hints)) {\n const hintsLength = hints.length\n let result = ''\n if (hintsLength === 0) {\n return result\n }\n for (let i = 0; i < hintsLength; i++) {\n const link = hints[i]\n validateLinkHeaderFormat(link, 'hints')\n result += link\n if (i !== hintsLength - 1) {\n result += ', '\n }\n }\n return result\n }\n throw new ERR_INVALID_ARG_VALUE(\n 'hints',\n hints,\n 'must be an array or string of format \"; rel=preload; as=style\"'\n )\n}\nmodule.exports = {\n isInt32,\n isUint32,\n parseFileMode,\n validateArray,\n validateStringArray,\n validateBooleanArray,\n validateAbortSignalArray,\n validateBoolean,\n validateBuffer,\n validateDictionary,\n validateEncoding,\n validateFunction,\n validateInt32,\n validateInteger,\n validateNumber,\n validateObject,\n validateOneOf,\n validatePlainFunction,\n validatePort,\n validateSignalName,\n validateString,\n validateUint32,\n validateUndefined,\n validateUnion,\n validateAbortSignal,\n validateLinkHeaderValue\n}\n","'use strict'\n\nconst CustomStream = require('../stream')\nconst promises = require('../stream/promises')\nconst originalDestroy = CustomStream.Readable.destroy\nmodule.exports = CustomStream.Readable\n\n// Explicit export naming is needed for ESM\nmodule.exports._uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer\nmodule.exports._isUint8Array = CustomStream._isUint8Array\nmodule.exports.isDisturbed = CustomStream.isDisturbed\nmodule.exports.isErrored = CustomStream.isErrored\nmodule.exports.isReadable = CustomStream.isReadable\nmodule.exports.Readable = CustomStream.Readable\nmodule.exports.Writable = CustomStream.Writable\nmodule.exports.Duplex = CustomStream.Duplex\nmodule.exports.Transform = CustomStream.Transform\nmodule.exports.PassThrough = CustomStream.PassThrough\nmodule.exports.addAbortSignal = CustomStream.addAbortSignal\nmodule.exports.finished = CustomStream.finished\nmodule.exports.destroy = CustomStream.destroy\nmodule.exports.destroy = originalDestroy\nmodule.exports.pipeline = CustomStream.pipeline\nmodule.exports.compose = CustomStream.compose\nObject.defineProperty(CustomStream, 'promises', {\n configurable: true,\n enumerable: true,\n get() {\n return promises\n }\n})\nmodule.exports.Stream = CustomStream.Stream\n\n// Allow default importing\nmodule.exports.default = module.exports\n","'use strict'\n\nconst { format, inspect, AggregateError: CustomAggregateError } = require('./util')\n\n/*\n This file is a reduced and adapted version of the main lib/internal/errors.js file defined at\n\n https://github.com/nodejs/node/blob/master/lib/internal/errors.js\n\n Don't try to replace with the original file and keep it up to date (starting from E(...) definitions)\n with the upstream file.\n*/\n\nconst AggregateError = globalThis.AggregateError || CustomAggregateError\nconst kIsNodeError = Symbol('kIsNodeError')\nconst kTypes = [\n 'string',\n 'function',\n 'number',\n 'object',\n // Accept 'Function' and 'Object' as alternative to the lower cased version.\n 'Function',\n 'Object',\n 'boolean',\n 'bigint',\n 'symbol'\n]\nconst classRegExp = /^([A-Z][a-z0-9]*)+$/\nconst nodeInternalPrefix = '__node_internal_'\nconst codes = {}\nfunction assert(value, message) {\n if (!value) {\n throw new codes.ERR_INTERNAL_ASSERTION(message)\n }\n}\n\n// Only use this for integers! Decimal numbers do not work with this function.\nfunction addNumericalSeparator(val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\nfunction getMessage(key, msg, args) {\n if (typeof msg === 'function') {\n assert(\n msg.length <= args.length,\n // Default options do not count.\n `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`\n )\n return msg(...args)\n }\n const expectedLength = (msg.match(/%[dfijoOs]/g) || []).length\n assert(\n expectedLength === args.length,\n `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`\n )\n if (args.length === 0) {\n return msg\n }\n return format(msg, ...args)\n}\nfunction E(code, message, Base) {\n if (!Base) {\n Base = Error\n }\n class NodeError extends Base {\n constructor(...args) {\n super(getMessage(code, message, args))\n }\n toString() {\n return `${this.name} [${code}]: ${this.message}`\n }\n }\n Object.defineProperties(NodeError.prototype, {\n name: {\n value: Base.name,\n writable: true,\n enumerable: false,\n configurable: true\n },\n toString: {\n value() {\n return `${this.name} [${code}]: ${this.message}`\n },\n writable: true,\n enumerable: false,\n configurable: true\n }\n })\n NodeError.prototype.code = code\n NodeError.prototype[kIsNodeError] = true\n codes[code] = NodeError\n}\nfunction hideStackFrames(fn) {\n // We rename the functions that will be hidden to cut off the stacktrace\n // at the outermost one\n const hidden = nodeInternalPrefix + fn.name\n Object.defineProperty(fn, 'name', {\n value: hidden\n })\n return fn\n}\nfunction aggregateTwoErrors(innerError, outerError) {\n if (innerError && outerError && innerError !== outerError) {\n if (Array.isArray(outerError.errors)) {\n // If `outerError` is already an `AggregateError`.\n outerError.errors.push(innerError)\n return outerError\n }\n const err = new AggregateError([outerError, innerError], outerError.message)\n err.code = outerError.code\n return err\n }\n return innerError || outerError\n}\nclass AbortError extends Error {\n constructor(message = 'The operation was aborted', options = undefined) {\n if (options !== undefined && typeof options !== 'object') {\n throw new codes.ERR_INVALID_ARG_TYPE('options', 'Object', options)\n }\n super(message, options)\n this.code = 'ABORT_ERR'\n this.name = 'AbortError'\n }\n}\nE('ERR_ASSERTION', '%s', Error)\nE(\n 'ERR_INVALID_ARG_TYPE',\n (name, expected, actual) => {\n assert(typeof name === 'string', \"'name' must be a string\")\n if (!Array.isArray(expected)) {\n expected = [expected]\n }\n let msg = 'The '\n if (name.endsWith(' argument')) {\n // For cases like 'first argument'\n msg += `${name} `\n } else {\n msg += `\"${name}\" ${name.includes('.') ? 'property' : 'argument'} `\n }\n msg += 'must be '\n const types = []\n const instances = []\n const other = []\n for (const value of expected) {\n assert(typeof value === 'string', 'All expected entries have to be of type string')\n if (kTypes.includes(value)) {\n types.push(value.toLowerCase())\n } else if (classRegExp.test(value)) {\n instances.push(value)\n } else {\n assert(value !== 'object', 'The value \"object\" should be written as \"Object\"')\n other.push(value)\n }\n }\n\n // Special handle `object` in case other instances are allowed to outline\n // the differences between each other.\n if (instances.length > 0) {\n const pos = types.indexOf('object')\n if (pos !== -1) {\n types.splice(types, pos, 1)\n instances.push('Object')\n }\n }\n if (types.length > 0) {\n switch (types.length) {\n case 1:\n msg += `of type ${types[0]}`\n break\n case 2:\n msg += `one of type ${types[0]} or ${types[1]}`\n break\n default: {\n const last = types.pop()\n msg += `one of type ${types.join(', ')}, or ${last}`\n }\n }\n if (instances.length > 0 || other.length > 0) {\n msg += ' or '\n }\n }\n if (instances.length > 0) {\n switch (instances.length) {\n case 1:\n msg += `an instance of ${instances[0]}`\n break\n case 2:\n msg += `an instance of ${instances[0]} or ${instances[1]}`\n break\n default: {\n const last = instances.pop()\n msg += `an instance of ${instances.join(', ')}, or ${last}`\n }\n }\n if (other.length > 0) {\n msg += ' or '\n }\n }\n switch (other.length) {\n case 0:\n break\n case 1:\n if (other[0].toLowerCase() !== other[0]) {\n msg += 'an '\n }\n msg += `${other[0]}`\n break\n case 2:\n msg += `one of ${other[0]} or ${other[1]}`\n break\n default: {\n const last = other.pop()\n msg += `one of ${other.join(', ')}, or ${last}`\n }\n }\n if (actual == null) {\n msg += `. Received ${actual}`\n } else if (typeof actual === 'function' && actual.name) {\n msg += `. Received function ${actual.name}`\n } else if (typeof actual === 'object') {\n var _actual$constructor\n if (\n (_actual$constructor = actual.constructor) !== null &&\n _actual$constructor !== undefined &&\n _actual$constructor.name\n ) {\n msg += `. Received an instance of ${actual.constructor.name}`\n } else {\n const inspected = inspect(actual, {\n depth: -1\n })\n msg += `. Received ${inspected}`\n }\n } else {\n let inspected = inspect(actual, {\n colors: false\n })\n if (inspected.length > 25) {\n inspected = `${inspected.slice(0, 25)}...`\n }\n msg += `. Received type ${typeof actual} (${inspected})`\n }\n return msg\n },\n TypeError\n)\nE(\n 'ERR_INVALID_ARG_VALUE',\n (name, value, reason = 'is invalid') => {\n let inspected = inspect(value)\n if (inspected.length > 128) {\n inspected = inspected.slice(0, 128) + '...'\n }\n const type = name.includes('.') ? 'property' : 'argument'\n return `The ${type} '${name}' ${reason}. Received ${inspected}`\n },\n TypeError\n)\nE(\n 'ERR_INVALID_RETURN_VALUE',\n (input, name, value) => {\n var _value$constructor\n const type =\n value !== null &&\n value !== undefined &&\n (_value$constructor = value.constructor) !== null &&\n _value$constructor !== undefined &&\n _value$constructor.name\n ? `instance of ${value.constructor.name}`\n : `type ${typeof value}`\n return `Expected ${input} to be returned from the \"${name}\"` + ` function but got ${type}.`\n },\n TypeError\n)\nE(\n 'ERR_MISSING_ARGS',\n (...args) => {\n assert(args.length > 0, 'At least one arg needs to be specified')\n let msg\n const len = args.length\n args = (Array.isArray(args) ? args : [args]).map((a) => `\"${a}\"`).join(' or ')\n switch (len) {\n case 1:\n msg += `The ${args[0]} argument`\n break\n case 2:\n msg += `The ${args[0]} and ${args[1]} arguments`\n break\n default:\n {\n const last = args.pop()\n msg += `The ${args.join(', ')}, and ${last} arguments`\n }\n break\n }\n return `${msg} must be specified`\n },\n TypeError\n)\nE(\n 'ERR_OUT_OF_RANGE',\n (str, range, input) => {\n assert(range, 'Missing \"range\" argument')\n let received\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > 2n ** 32n || input < -(2n ** 32n)) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n } else {\n received = inspect(input)\n }\n return `The value of \"${str}\" is out of range. It must be ${range}. Received ${received}`\n },\n RangeError\n)\nE('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times', Error)\nE('ERR_METHOD_NOT_IMPLEMENTED', 'The %s method is not implemented', Error)\nE('ERR_STREAM_ALREADY_FINISHED', 'Cannot call %s after a stream was finished', Error)\nE('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable', Error)\nE('ERR_STREAM_DESTROYED', 'Cannot call %s after a stream was destroyed', Error)\nE('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError)\nE('ERR_STREAM_PREMATURE_CLOSE', 'Premature close', Error)\nE('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF', Error)\nE('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event', Error)\nE('ERR_STREAM_WRITE_AFTER_END', 'write after end', Error)\nE('ERR_UNKNOWN_ENCODING', 'Unknown encoding: %s', TypeError)\nmodule.exports = {\n AbortError,\n aggregateTwoErrors: hideStackFrames(aggregateTwoErrors),\n hideStackFrames,\n codes\n}\n","'use strict'\n\n/*\n This file is a reduced and adapted version of the main lib/internal/per_context/primordials.js file defined at\n\n https://github.com/nodejs/node/blob/master/lib/internal/per_context/primordials.js\n\n Don't try to replace with the original file and keep it up to date with the upstream file.\n*/\nmodule.exports = {\n ArrayIsArray(self) {\n return Array.isArray(self)\n },\n ArrayPrototypeIncludes(self, el) {\n return self.includes(el)\n },\n ArrayPrototypeIndexOf(self, el) {\n return self.indexOf(el)\n },\n ArrayPrototypeJoin(self, sep) {\n return self.join(sep)\n },\n ArrayPrototypeMap(self, fn) {\n return self.map(fn)\n },\n ArrayPrototypePop(self, el) {\n return self.pop(el)\n },\n ArrayPrototypePush(self, el) {\n return self.push(el)\n },\n ArrayPrototypeSlice(self, start, end) {\n return self.slice(start, end)\n },\n Error,\n FunctionPrototypeCall(fn, thisArgs, ...args) {\n return fn.call(thisArgs, ...args)\n },\n FunctionPrototypeSymbolHasInstance(self, instance) {\n return Function.prototype[Symbol.hasInstance].call(self, instance)\n },\n MathFloor: Math.floor,\n Number,\n NumberIsInteger: Number.isInteger,\n NumberIsNaN: Number.isNaN,\n NumberMAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER,\n NumberMIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER,\n NumberParseInt: Number.parseInt,\n ObjectDefineProperties(self, props) {\n return Object.defineProperties(self, props)\n },\n ObjectDefineProperty(self, name, prop) {\n return Object.defineProperty(self, name, prop)\n },\n ObjectGetOwnPropertyDescriptor(self, name) {\n return Object.getOwnPropertyDescriptor(self, name)\n },\n ObjectKeys(obj) {\n return Object.keys(obj)\n },\n ObjectSetPrototypeOf(target, proto) {\n return Object.setPrototypeOf(target, proto)\n },\n Promise,\n PromisePrototypeCatch(self, fn) {\n return self.catch(fn)\n },\n PromisePrototypeThen(self, thenFn, catchFn) {\n return self.then(thenFn, catchFn)\n },\n PromiseReject(err) {\n return Promise.reject(err)\n },\n PromiseResolve(val) {\n return Promise.resolve(val)\n },\n ReflectApply: Reflect.apply,\n RegExpPrototypeTest(self, value) {\n return self.test(value)\n },\n SafeSet: Set,\n String,\n StringPrototypeSlice(self, start, end) {\n return self.slice(start, end)\n },\n StringPrototypeToLowerCase(self) {\n return self.toLowerCase()\n },\n StringPrototypeToUpperCase(self) {\n return self.toUpperCase()\n },\n StringPrototypeTrim(self) {\n return self.trim()\n },\n Symbol,\n SymbolFor: Symbol.for,\n SymbolAsyncIterator: Symbol.asyncIterator,\n SymbolHasInstance: Symbol.hasInstance,\n SymbolIterator: Symbol.iterator,\n SymbolDispose: Symbol.dispose || Symbol('Symbol.dispose'),\n SymbolAsyncDispose: Symbol.asyncDispose || Symbol('Symbol.asyncDispose'),\n TypedArrayPrototypeSet(self, buf, len) {\n return self.set(buf, len)\n },\n Boolean: Boolean,\n Uint8Array\n}\n","'use strict'\n\nconst bufferModule = require('buffer')\nconst { kResistStopPropagation, SymbolDispose } = require('./primordials')\nconst AbortSignal = globalThis.AbortSignal || require('abort-controller').AbortSignal\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nconst AsyncFunction = Object.getPrototypeOf(async function () {}).constructor\nconst Blob = globalThis.Blob || bufferModule.Blob\n/* eslint-disable indent */\nconst isBlob =\n typeof Blob !== 'undefined'\n ? function isBlob(b) {\n // eslint-disable-next-line indent\n return b instanceof Blob\n }\n : function isBlob(b) {\n return false\n }\n/* eslint-enable indent */\n\nconst validateAbortSignal = (signal, name) => {\n if (signal !== undefined && (signal === null || typeof signal !== 'object' || !('aborted' in signal))) {\n throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal)\n }\n}\nconst validateFunction = (value, name) => {\n if (typeof value !== 'function') throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)\n}\n\n// This is a simplified version of AggregateError\nclass AggregateError extends Error {\n constructor(errors) {\n if (!Array.isArray(errors)) {\n throw new TypeError(`Expected input to be an Array, got ${typeof errors}`)\n }\n let message = ''\n for (let i = 0; i < errors.length; i++) {\n message += ` ${errors[i].stack}\\n`\n }\n super(message)\n this.name = 'AggregateError'\n this.errors = errors\n }\n}\nmodule.exports = {\n AggregateError,\n kEmptyObject: Object.freeze({}),\n once(callback) {\n let called = false\n return function (...args) {\n if (called) {\n return\n }\n called = true\n callback.apply(this, args)\n }\n },\n createDeferredPromise: function () {\n let resolve\n let reject\n\n // eslint-disable-next-line promise/param-names\n const promise = new Promise((res, rej) => {\n resolve = res\n reject = rej\n })\n return {\n promise,\n resolve,\n reject\n }\n },\n promisify(fn) {\n return new Promise((resolve, reject) => {\n fn((err, ...args) => {\n if (err) {\n return reject(err)\n }\n return resolve(...args)\n })\n })\n },\n debuglog() {\n return function () {}\n },\n format(format, ...args) {\n // Simplified version of https://nodejs.org/api/util.html#utilformatformat-args\n return format.replace(/%([sdifj])/g, function (...[_unused, type]) {\n const replacement = args.shift()\n if (type === 'f') {\n return replacement.toFixed(6)\n } else if (type === 'j') {\n return JSON.stringify(replacement)\n } else if (type === 's' && typeof replacement === 'object') {\n const ctor = replacement.constructor !== Object ? replacement.constructor.name : ''\n return `${ctor} {}`.trim()\n } else {\n return replacement.toString()\n }\n })\n },\n inspect(value) {\n // Vastly simplified version of https://nodejs.org/api/util.html#utilinspectobject-options\n switch (typeof value) {\n case 'string':\n if (value.includes(\"'\")) {\n if (!value.includes('\"')) {\n return `\"${value}\"`\n } else if (!value.includes('`') && !value.includes('${')) {\n return `\\`${value}\\``\n }\n }\n return `'${value}'`\n case 'number':\n if (isNaN(value)) {\n return 'NaN'\n } else if (Object.is(value, -0)) {\n return String(value)\n }\n return value\n case 'bigint':\n return `${String(value)}n`\n case 'boolean':\n case 'undefined':\n return String(value)\n case 'object':\n return '{}'\n }\n },\n types: {\n isAsyncFunction(fn) {\n return fn instanceof AsyncFunction\n },\n isArrayBufferView(arr) {\n return ArrayBuffer.isView(arr)\n }\n },\n isBlob,\n deprecate(fn, message) {\n return fn\n },\n addAbortListener:\n require('events').addAbortListener ||\n function addAbortListener(signal, listener) {\n if (signal === undefined) {\n throw new ERR_INVALID_ARG_TYPE('signal', 'AbortSignal', signal)\n }\n validateAbortSignal(signal, 'signal')\n validateFunction(listener, 'listener')\n let removeEventListener\n if (signal.aborted) {\n queueMicrotask(() => listener())\n } else {\n signal.addEventListener('abort', listener, {\n __proto__: null,\n once: true,\n [kResistStopPropagation]: true\n })\n removeEventListener = () => {\n signal.removeEventListener('abort', listener)\n }\n }\n return {\n __proto__: null,\n [SymbolDispose]() {\n var _removeEventListener\n ;(_removeEventListener = removeEventListener) === null || _removeEventListener === undefined\n ? undefined\n : _removeEventListener()\n }\n }\n },\n AbortSignalAny:\n AbortSignal.any ||\n function AbortSignalAny(signals) {\n // Fast path if there is only one signal.\n if (signals.length === 1) {\n return signals[0]\n }\n const ac = new AbortController()\n const abort = () => ac.abort()\n signals.forEach((signal) => {\n validateAbortSignal(signal, 'signals')\n signal.addEventListener('abort', abort, {\n once: true\n })\n })\n ac.signal.addEventListener(\n 'abort',\n () => {\n signals.forEach((signal) => signal.removeEventListener('abort', abort))\n },\n {\n once: true\n }\n )\n return ac.signal\n }\n}\nmodule.exports.promisify.custom = Symbol.for('nodejs.util.promisify.custom')\n","/* replacement start */\n\nconst { Buffer } = require('buffer')\n\n/* replacement end */\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n;('use strict')\nconst { ObjectDefineProperty, ObjectKeys, ReflectApply } = require('./ours/primordials')\nconst {\n promisify: { custom: customPromisify }\n} = require('./ours/util')\nconst { streamReturningOperators, promiseReturningOperators } = require('./internal/streams/operators')\nconst {\n codes: { ERR_ILLEGAL_CONSTRUCTOR }\n} = require('./ours/errors')\nconst compose = require('./internal/streams/compose')\nconst { setDefaultHighWaterMark, getDefaultHighWaterMark } = require('./internal/streams/state')\nconst { pipeline } = require('./internal/streams/pipeline')\nconst { destroyer } = require('./internal/streams/destroy')\nconst eos = require('./internal/streams/end-of-stream')\nconst internalBuffer = {}\nconst promises = require('./stream/promises')\nconst utils = require('./internal/streams/utils')\nconst Stream = (module.exports = require('./internal/streams/legacy').Stream)\nStream.isDestroyed = utils.isDestroyed\nStream.isDisturbed = utils.isDisturbed\nStream.isErrored = utils.isErrored\nStream.isReadable = utils.isReadable\nStream.isWritable = utils.isWritable\nStream.Readable = require('./internal/streams/readable')\nfor (const key of ObjectKeys(streamReturningOperators)) {\n const op = streamReturningOperators[key]\n function fn(...args) {\n if (new.target) {\n throw ERR_ILLEGAL_CONSTRUCTOR()\n }\n return Stream.Readable.from(ReflectApply(op, this, args))\n }\n ObjectDefineProperty(fn, 'name', {\n __proto__: null,\n value: op.name\n })\n ObjectDefineProperty(fn, 'length', {\n __proto__: null,\n value: op.length\n })\n ObjectDefineProperty(Stream.Readable.prototype, key, {\n __proto__: null,\n value: fn,\n enumerable: false,\n configurable: true,\n writable: true\n })\n}\nfor (const key of ObjectKeys(promiseReturningOperators)) {\n const op = promiseReturningOperators[key]\n function fn(...args) {\n if (new.target) {\n throw ERR_ILLEGAL_CONSTRUCTOR()\n }\n return ReflectApply(op, this, args)\n }\n ObjectDefineProperty(fn, 'name', {\n __proto__: null,\n value: op.name\n })\n ObjectDefineProperty(fn, 'length', {\n __proto__: null,\n value: op.length\n })\n ObjectDefineProperty(Stream.Readable.prototype, key, {\n __proto__: null,\n value: fn,\n enumerable: false,\n configurable: true,\n writable: true\n })\n}\nStream.Writable = require('./internal/streams/writable')\nStream.Duplex = require('./internal/streams/duplex')\nStream.Transform = require('./internal/streams/transform')\nStream.PassThrough = require('./internal/streams/passthrough')\nStream.pipeline = pipeline\nconst { addAbortSignal } = require('./internal/streams/add-abort-signal')\nStream.addAbortSignal = addAbortSignal\nStream.finished = eos\nStream.destroy = destroyer\nStream.compose = compose\nStream.setDefaultHighWaterMark = setDefaultHighWaterMark\nStream.getDefaultHighWaterMark = getDefaultHighWaterMark\nObjectDefineProperty(Stream, 'promises', {\n __proto__: null,\n configurable: true,\n enumerable: true,\n get() {\n return promises\n }\n})\nObjectDefineProperty(pipeline, customPromisify, {\n __proto__: null,\n enumerable: true,\n get() {\n return promises.pipeline\n }\n})\nObjectDefineProperty(eos, customPromisify, {\n __proto__: null,\n enumerable: true,\n get() {\n return promises.finished\n }\n})\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream\nStream._isUint8Array = function isUint8Array(value) {\n return value instanceof Uint8Array\n}\nStream._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength)\n}\n","'use strict'\n\nconst { ArrayPrototypePop, Promise } = require('../ours/primordials')\nconst { isIterable, isNodeStream, isWebStream } = require('../internal/streams/utils')\nconst { pipelineImpl: pl } = require('../internal/streams/pipeline')\nconst { finished } = require('../internal/streams/end-of-stream')\nrequire('../../lib/stream.js')\nfunction pipeline(...streams) {\n return new Promise((resolve, reject) => {\n let signal\n let end\n const lastArg = streams[streams.length - 1]\n if (\n lastArg &&\n typeof lastArg === 'object' &&\n !isNodeStream(lastArg) &&\n !isIterable(lastArg) &&\n !isWebStream(lastArg)\n ) {\n const options = ArrayPrototypePop(streams)\n signal = options.signal\n end = options.end\n }\n pl(\n streams,\n (err, value) => {\n if (err) {\n reject(err)\n } else {\n resolve(value)\n }\n },\n {\n signal,\n end\n }\n )\n })\n}\nmodule.exports = {\n finished,\n pipeline\n}\n","/* jshint esversion: 6 */\n/* jslint node: true */\n'use strict';\n\nmodule.exports = function serialize (object) {\n if (object === null || typeof object !== 'object' || object.toJSON != null) {\n return JSON.stringify(object);\n }\n\n if (Array.isArray(object)) {\n return '[' + object.reduce((t, cv, ci) => {\n const comma = ci === 0 ? '' : ',';\n const value = cv === undefined || typeof cv === 'symbol' ? null : cv;\n return t + comma + serialize(value);\n }, '') + ']';\n }\n\n return '{' + Object.keys(object).sort().reduce((t, cv, ci) => {\n if (object[cv] === undefined ||\n typeof object[cv] === 'symbol') {\n return t;\n }\n const comma = t.length === 0 ? '' : ',';\n return t + comma + serialize(cv) + ':' + serialize(object[cv]);\n }, '') + '}';\n};\n","/*\n * Copyright (c) 2019 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst {\n isArray: _isArray,\n isObject: _isObject,\n isString: _isString,\n} = require('./types');\nconst {\n asArray: _asArray\n} = require('./util');\nconst {prependBase} = require('./url');\nconst JsonLdError = require('./JsonLdError');\nconst ResolvedContext = require('./ResolvedContext');\n\nconst MAX_CONTEXT_URLS = 10;\n\nmodule.exports = class ContextResolver {\n /**\n * Creates a ContextResolver.\n *\n * @param sharedCache a shared LRU cache with `get` and `set` APIs.\n */\n constructor({sharedCache}) {\n this.perOpCache = new Map();\n this.sharedCache = sharedCache;\n }\n\n async resolve({\n activeCtx, context, documentLoader, base, cycles = new Set()\n }) {\n // process `@context`\n if(context && _isObject(context) && context['@context']) {\n context = context['@context'];\n }\n\n // context is one or more contexts\n context = _asArray(context);\n\n // resolve each context in the array\n const allResolved = [];\n for(const ctx of context) {\n if(_isString(ctx)) {\n // see if `ctx` has been resolved before...\n let resolved = this._get(ctx);\n if(!resolved) {\n // not resolved yet, resolve\n resolved = await this._resolveRemoteContext(\n {activeCtx, url: ctx, documentLoader, base, cycles});\n }\n\n // add to output and continue\n if(_isArray(resolved)) {\n allResolved.push(...resolved);\n } else {\n allResolved.push(resolved);\n }\n continue;\n }\n if(ctx === null) {\n // handle `null` context, nothing to cache\n allResolved.push(new ResolvedContext({document: null}));\n continue;\n }\n if(!_isObject(ctx)) {\n _throwInvalidLocalContext(context);\n }\n // context is an object, get/create `ResolvedContext` for it\n const key = JSON.stringify(ctx);\n let resolved = this._get(key);\n if(!resolved) {\n // create a new static `ResolvedContext` and cache it\n resolved = new ResolvedContext({document: ctx});\n this._cacheResolvedContext({key, resolved, tag: 'static'});\n }\n allResolved.push(resolved);\n }\n\n return allResolved;\n }\n\n _get(key) {\n // get key from per operation cache; no `tag` is used with this cache so\n // any retrieved context will always be the same during a single operation\n let resolved = this.perOpCache.get(key);\n if(!resolved) {\n // see if the shared cache has a `static` entry for this URL\n const tagMap = this.sharedCache.get(key);\n if(tagMap) {\n resolved = tagMap.get('static');\n if(resolved) {\n this.perOpCache.set(key, resolved);\n }\n }\n }\n return resolved;\n }\n\n _cacheResolvedContext({key, resolved, tag}) {\n this.perOpCache.set(key, resolved);\n if(tag !== undefined) {\n let tagMap = this.sharedCache.get(key);\n if(!tagMap) {\n tagMap = new Map();\n this.sharedCache.set(key, tagMap);\n }\n tagMap.set(tag, resolved);\n }\n return resolved;\n }\n\n async _resolveRemoteContext({activeCtx, url, documentLoader, base, cycles}) {\n // resolve relative URL and fetch context\n url = prependBase(base, url);\n const {context, remoteDoc} = await this._fetchContext(\n {activeCtx, url, documentLoader, cycles});\n\n // update base according to remote document and resolve any relative URLs\n base = remoteDoc.documentUrl || url;\n _resolveContextUrls({context, base});\n\n // resolve, cache, and return context\n const resolved = await this.resolve(\n {activeCtx, context, documentLoader, base, cycles});\n this._cacheResolvedContext({key: url, resolved, tag: remoteDoc.tag});\n return resolved;\n }\n\n async _fetchContext({activeCtx, url, documentLoader, cycles}) {\n // check for max context URLs fetched during a resolve operation\n if(cycles.size > MAX_CONTEXT_URLS) {\n throw new JsonLdError(\n 'Maximum number of @context URLs exceeded.',\n 'jsonld.ContextUrlError',\n {\n code: activeCtx.processingMode === 'json-ld-1.0' ?\n 'loading remote context failed' :\n 'context overflow',\n max: MAX_CONTEXT_URLS\n });\n }\n\n // check for context URL cycle\n // shortcut to avoid extra work that would eventually hit the max above\n if(cycles.has(url)) {\n throw new JsonLdError(\n 'Cyclical @context URLs detected.',\n 'jsonld.ContextUrlError',\n {\n code: activeCtx.processingMode === 'json-ld-1.0' ?\n 'recursive context inclusion' :\n 'context overflow',\n url\n });\n }\n\n // track cycles\n cycles.add(url);\n\n let context;\n let remoteDoc;\n\n try {\n remoteDoc = await documentLoader(url);\n context = remoteDoc.document || null;\n // parse string context as JSON\n if(_isString(context)) {\n context = JSON.parse(context);\n }\n } catch(e) {\n throw new JsonLdError(\n 'Dereferencing a URL did not result in a valid JSON-LD object. ' +\n 'Possible causes are an inaccessible URL perhaps due to ' +\n 'a same-origin policy (ensure the server uses CORS if you are ' +\n 'using client-side JavaScript), too many redirects, a ' +\n 'non-JSON response, or more than one HTTP Link Header was ' +\n 'provided for a remote context.',\n 'jsonld.InvalidUrl',\n {code: 'loading remote context failed', url, cause: e});\n }\n\n // ensure ctx is an object\n if(!_isObject(context)) {\n throw new JsonLdError(\n 'Dereferencing a URL did not result in a JSON object. The ' +\n 'response was valid JSON, but it was not a JSON object.',\n 'jsonld.InvalidUrl', {code: 'invalid remote context', url});\n }\n\n // use empty context if no @context key is present\n if(!('@context' in context)) {\n context = {'@context': {}};\n } else {\n context = {'@context': context['@context']};\n }\n\n // append @context URL to context if given\n if(remoteDoc.contextUrl) {\n if(!_isArray(context['@context'])) {\n context['@context'] = [context['@context']];\n }\n context['@context'].push(remoteDoc.contextUrl);\n }\n\n return {context, remoteDoc};\n }\n};\n\nfunction _throwInvalidLocalContext(ctx) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context must be an object.',\n 'jsonld.SyntaxError', {\n code: 'invalid local context', context: ctx\n });\n}\n\n/**\n * Resolve all relative `@context` URLs in the given context by inline\n * replacing them with absolute URLs.\n *\n * @param context the context.\n * @param base the base IRI to use to resolve relative IRIs.\n */\nfunction _resolveContextUrls({context, base}) {\n if(!context) {\n return;\n }\n\n const ctx = context['@context'];\n\n if(_isString(ctx)) {\n context['@context'] = prependBase(base, ctx);\n return;\n }\n\n if(_isArray(ctx)) {\n for(let i = 0; i < ctx.length; ++i) {\n const element = ctx[i];\n if(_isString(element)) {\n ctx[i] = prependBase(base, element);\n continue;\n }\n if(_isObject(element)) {\n _resolveContextUrls({context: {'@context': element}, base});\n }\n }\n return;\n }\n\n if(!_isObject(ctx)) {\n // no @context URLs can be found in non-object\n return;\n }\n\n // ctx is an object, resolve any context URLs in terms\n for(const term in ctx) {\n _resolveContextUrls({context: ctx[term], base});\n }\n}\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nmodule.exports = class JsonLdError extends Error {\n /**\n * Creates a JSON-LD Error.\n *\n * @param msg the error message.\n * @param type the error type.\n * @param details the error details.\n */\n constructor(\n message = 'An unspecified JSON-LD error occurred.',\n name = 'jsonld.Error',\n details = {}) {\n super(message);\n this.name = name;\n this.message = message;\n this.details = details;\n }\n};\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nmodule.exports = jsonld => {\n class JsonLdProcessor {\n toString() {\n return '[object JsonLdProcessor]';\n }\n }\n Object.defineProperty(JsonLdProcessor, 'prototype', {\n writable: false,\n enumerable: false\n });\n Object.defineProperty(JsonLdProcessor.prototype, 'constructor', {\n writable: true,\n enumerable: false,\n configurable: true,\n value: JsonLdProcessor\n });\n\n // The Web IDL test harness will check the number of parameters defined in\n // the functions below. The number of parameters must exactly match the\n // required (non-optional) parameters of the JsonLdProcessor interface as\n // defined here:\n // https://www.w3.org/TR/json-ld-api/#the-jsonldprocessor-interface\n\n JsonLdProcessor.compact = function(input, ctx) {\n if(arguments.length < 2) {\n return Promise.reject(\n new TypeError('Could not compact, too few arguments.'));\n }\n return jsonld.compact(input, ctx);\n };\n JsonLdProcessor.expand = function(input) {\n if(arguments.length < 1) {\n return Promise.reject(\n new TypeError('Could not expand, too few arguments.'));\n }\n return jsonld.expand(input);\n };\n JsonLdProcessor.flatten = function(input) {\n if(arguments.length < 1) {\n return Promise.reject(\n new TypeError('Could not flatten, too few arguments.'));\n }\n return jsonld.flatten(input);\n };\n\n return JsonLdProcessor;\n};\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\n// TODO: move `NQuads` to its own package\nmodule.exports = require('rdf-canonize').NQuads;\n","/*\n * Copyright (c) 2017-2019 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nmodule.exports = class RequestQueue {\n /**\n * Creates a simple queue for requesting documents.\n */\n constructor() {\n this._requests = {};\n }\n\n wrapLoader(loader) {\n const self = this;\n self._loader = loader;\n return function(/* url */) {\n return self.add.apply(self, arguments);\n };\n }\n\n async add(url) {\n let promise = this._requests[url];\n if(promise) {\n // URL already queued, wait for it to load\n return Promise.resolve(promise);\n }\n\n // queue URL and load it\n promise = this._requests[url] = this._loader(url);\n\n try {\n return await promise;\n } finally {\n delete this._requests[url];\n }\n }\n};\n","/*\n * Copyright (c) 2019 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst LRU = require('lru-cache');\n\nconst MAX_ACTIVE_CONTEXTS = 10;\n\nmodule.exports = class ResolvedContext {\n /**\n * Creates a ResolvedContext.\n *\n * @param document the context document.\n */\n constructor({document}) {\n this.document = document;\n // TODO: enable customization of processed context cache\n // TODO: limit based on size of processed contexts vs. number of them\n this.cache = new LRU({max: MAX_ACTIVE_CONTEXTS});\n }\n\n getProcessed(activeCtx) {\n return this.cache.get(activeCtx);\n }\n\n setProcessed(activeCtx, processedCtx) {\n this.cache.set(activeCtx, processedCtx);\n }\n};\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst JsonLdError = require('./JsonLdError');\n\nconst {\n isArray: _isArray,\n isObject: _isObject,\n isString: _isString,\n isUndefined: _isUndefined\n} = require('./types');\n\nconst {\n isList: _isList,\n isValue: _isValue,\n isGraph: _isGraph,\n isSimpleGraph: _isSimpleGraph,\n isSubjectReference: _isSubjectReference\n} = require('./graphTypes');\n\nconst {\n expandIri: _expandIri,\n getContextValue: _getContextValue,\n isKeyword: _isKeyword,\n process: _processContext,\n processingMode: _processingMode\n} = require('./context');\n\nconst {\n removeBase: _removeBase,\n prependBase: _prependBase\n} = require('./url');\n\nconst {\n REGEX_KEYWORD,\n addValue: _addValue,\n asArray: _asArray,\n compareShortestLeast: _compareShortestLeast\n} = require('./util');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Recursively compacts an element using the given active context. All values\n * must be in expanded form before this method is called.\n *\n * @param activeCtx the active context to use.\n * @param activeProperty the compacted property associated with the element\n * to compact, null for none.\n * @param element the element to compact.\n * @param options the compaction options.\n *\n * @return a promise that resolves to the compacted value.\n */\napi.compact = async ({\n activeCtx,\n activeProperty = null,\n element,\n options = {}\n}) => {\n // recursively compact array\n if(_isArray(element)) {\n let rval = [];\n for(let i = 0; i < element.length; ++i) {\n const compacted = await api.compact({\n activeCtx,\n activeProperty,\n element: element[i],\n options\n });\n if(compacted === null) {\n // FIXME: need event?\n continue;\n }\n rval.push(compacted);\n }\n if(options.compactArrays && rval.length === 1) {\n // use single element if no container is specified\n const container = _getContextValue(\n activeCtx, activeProperty, '@container') || [];\n if(container.length === 0) {\n rval = rval[0];\n }\n }\n return rval;\n }\n\n // use any scoped context on activeProperty\n const ctx = _getContextValue(activeCtx, activeProperty, '@context');\n if(!_isUndefined(ctx)) {\n activeCtx = await _processContext({\n activeCtx,\n localCtx: ctx,\n propagate: true,\n overrideProtected: true,\n options\n });\n }\n\n // recursively compact object\n if(_isObject(element)) {\n if(options.link && '@id' in element &&\n options.link.hasOwnProperty(element['@id'])) {\n // check for a linked element to reuse\n const linked = options.link[element['@id']];\n for(let i = 0; i < linked.length; ++i) {\n if(linked[i].expanded === element) {\n return linked[i].compacted;\n }\n }\n }\n\n // do value compaction on @values and subject references\n if(_isValue(element) || _isSubjectReference(element)) {\n const rval =\n api.compactValue({activeCtx, activeProperty, value: element, options});\n if(options.link && _isSubjectReference(element)) {\n // store linked element\n if(!(options.link.hasOwnProperty(element['@id']))) {\n options.link[element['@id']] = [];\n }\n options.link[element['@id']].push({expanded: element, compacted: rval});\n }\n return rval;\n }\n\n // if expanded property is @list and we're contained within a list\n // container, recursively compact this item to an array\n if(_isList(element)) {\n const container = _getContextValue(\n activeCtx, activeProperty, '@container') || [];\n if(container.includes('@list')) {\n return api.compact({\n activeCtx,\n activeProperty,\n element: element['@list'],\n options\n });\n }\n }\n\n // FIXME: avoid misuse of active property as an expanded property?\n const insideReverse = (activeProperty === '@reverse');\n\n const rval = {};\n\n // original context before applying property-scoped and local contexts\n const inputCtx = activeCtx;\n\n // revert to previous context, if there is one,\n // and element is not a value object or a node reference\n if(!_isValue(element) && !_isSubjectReference(element)) {\n activeCtx = activeCtx.revertToPreviousContext();\n }\n\n // apply property-scoped context after reverting term-scoped context\n const propertyScopedCtx =\n _getContextValue(inputCtx, activeProperty, '@context');\n if(!_isUndefined(propertyScopedCtx)) {\n activeCtx = await _processContext({\n activeCtx,\n localCtx: propertyScopedCtx,\n propagate: true,\n overrideProtected: true,\n options\n });\n }\n\n if(options.link && '@id' in element) {\n // store linked element\n if(!options.link.hasOwnProperty(element['@id'])) {\n options.link[element['@id']] = [];\n }\n options.link[element['@id']].push({expanded: element, compacted: rval});\n }\n\n // apply any context defined on an alias of @type\n // if key is @type and any compacted value is a term having a local\n // context, overlay that context\n let types = element['@type'] || [];\n if(types.length > 1) {\n types = Array.from(types).sort();\n }\n // find all type-scoped contexts based on current context, prior to\n // updating it\n const typeContext = activeCtx;\n for(const type of types) {\n const compactedType = api.compactIri(\n {activeCtx: typeContext, iri: type, relativeTo: {vocab: true}});\n\n // Use any type-scoped context defined on this value\n const ctx = _getContextValue(inputCtx, compactedType, '@context');\n if(!_isUndefined(ctx)) {\n activeCtx = await _processContext({\n activeCtx,\n localCtx: ctx,\n options,\n propagate: false\n });\n }\n }\n\n // process element keys in order\n const keys = Object.keys(element).sort();\n for(const expandedProperty of keys) {\n const expandedValue = element[expandedProperty];\n\n // compact @id\n if(expandedProperty === '@id') {\n let compactedValue = _asArray(expandedValue).map(\n expandedIri => api.compactIri({\n activeCtx,\n iri: expandedIri,\n relativeTo: {vocab: false},\n base: options.base\n }));\n if(compactedValue.length === 1) {\n compactedValue = compactedValue[0];\n }\n\n // use keyword alias and add value\n const alias = api.compactIri(\n {activeCtx, iri: '@id', relativeTo: {vocab: true}});\n\n rval[alias] = compactedValue;\n continue;\n }\n\n // compact @type(s)\n if(expandedProperty === '@type') {\n // resolve type values against previous context\n let compactedValue = _asArray(expandedValue).map(\n expandedIri => api.compactIri({\n activeCtx: inputCtx,\n iri: expandedIri,\n relativeTo: {vocab: true}\n }));\n if(compactedValue.length === 1) {\n compactedValue = compactedValue[0];\n }\n\n // use keyword alias and add value\n const alias = api.compactIri(\n {activeCtx, iri: '@type', relativeTo: {vocab: true}});\n const container = _getContextValue(\n activeCtx, alias, '@container') || [];\n\n // treat as array for @type if @container includes @set\n const typeAsSet =\n container.includes('@set') &&\n _processingMode(activeCtx, 1.1);\n const isArray =\n typeAsSet || (_isArray(compactedValue) && expandedValue.length === 0);\n _addValue(rval, alias, compactedValue, {propertyIsArray: isArray});\n continue;\n }\n\n // handle @reverse\n if(expandedProperty === '@reverse') {\n // recursively compact expanded value\n const compactedValue = await api.compact({\n activeCtx,\n activeProperty: '@reverse',\n element: expandedValue,\n options\n });\n\n // handle double-reversed properties\n for(const compactedProperty in compactedValue) {\n if(activeCtx.mappings.has(compactedProperty) &&\n activeCtx.mappings.get(compactedProperty).reverse) {\n const value = compactedValue[compactedProperty];\n const container = _getContextValue(\n activeCtx, compactedProperty, '@container') || [];\n const useArray = (\n container.includes('@set') || !options.compactArrays);\n _addValue(\n rval, compactedProperty, value, {propertyIsArray: useArray});\n delete compactedValue[compactedProperty];\n }\n }\n\n if(Object.keys(compactedValue).length > 0) {\n // use keyword alias and add value\n const alias = api.compactIri({\n activeCtx,\n iri: expandedProperty,\n relativeTo: {vocab: true}\n });\n _addValue(rval, alias, compactedValue);\n }\n\n continue;\n }\n\n if(expandedProperty === '@preserve') {\n // compact using activeProperty\n const compactedValue = await api.compact({\n activeCtx,\n activeProperty,\n element: expandedValue,\n options\n });\n\n if(!(_isArray(compactedValue) && compactedValue.length === 0)) {\n _addValue(rval, expandedProperty, compactedValue);\n }\n continue;\n }\n\n // handle @index property\n if(expandedProperty === '@index') {\n // drop @index if inside an @index container\n const container = _getContextValue(\n activeCtx, activeProperty, '@container') || [];\n if(container.includes('@index')) {\n continue;\n }\n\n // use keyword alias and add value\n const alias = api.compactIri({\n activeCtx,\n iri: expandedProperty,\n relativeTo: {vocab: true}\n });\n _addValue(rval, alias, expandedValue);\n continue;\n }\n\n // skip array processing for keywords that aren't\n // @graph, @list, or @included\n if(expandedProperty !== '@graph' && expandedProperty !== '@list' &&\n expandedProperty !== '@included' &&\n _isKeyword(expandedProperty)) {\n // use keyword alias and add value as is\n const alias = api.compactIri({\n activeCtx,\n iri: expandedProperty,\n relativeTo: {vocab: true}\n });\n _addValue(rval, alias, expandedValue);\n continue;\n }\n\n // Note: expanded value must be an array due to expansion algorithm.\n if(!_isArray(expandedValue)) {\n throw new JsonLdError(\n 'JSON-LD expansion error; expanded value must be an array.',\n 'jsonld.SyntaxError');\n }\n\n // preserve empty arrays\n if(expandedValue.length === 0) {\n const itemActiveProperty = api.compactIri({\n activeCtx,\n iri: expandedProperty,\n value: expandedValue,\n relativeTo: {vocab: true},\n reverse: insideReverse\n });\n const nestProperty = activeCtx.mappings.has(itemActiveProperty) ?\n activeCtx.mappings.get(itemActiveProperty)['@nest'] : null;\n let nestResult = rval;\n if(nestProperty) {\n _checkNestProperty(activeCtx, nestProperty, options);\n if(!_isObject(rval[nestProperty])) {\n rval[nestProperty] = {};\n }\n nestResult = rval[nestProperty];\n }\n _addValue(\n nestResult, itemActiveProperty, expandedValue, {\n propertyIsArray: true\n });\n }\n\n // recusively process array values\n for(const expandedItem of expandedValue) {\n // compact property and get container type\n const itemActiveProperty = api.compactIri({\n activeCtx,\n iri: expandedProperty,\n value: expandedItem,\n relativeTo: {vocab: true},\n reverse: insideReverse\n });\n\n // if itemActiveProperty is a @nest property, add values to nestResult,\n // otherwise rval\n const nestProperty = activeCtx.mappings.has(itemActiveProperty) ?\n activeCtx.mappings.get(itemActiveProperty)['@nest'] : null;\n let nestResult = rval;\n if(nestProperty) {\n _checkNestProperty(activeCtx, nestProperty, options);\n if(!_isObject(rval[nestProperty])) {\n rval[nestProperty] = {};\n }\n nestResult = rval[nestProperty];\n }\n\n const container = _getContextValue(\n activeCtx, itemActiveProperty, '@container') || [];\n\n // get simple @graph or @list value if appropriate\n const isGraph = _isGraph(expandedItem);\n const isList = _isList(expandedItem);\n let inner;\n if(isList) {\n inner = expandedItem['@list'];\n } else if(isGraph) {\n inner = expandedItem['@graph'];\n }\n\n // recursively compact expanded item\n let compactedItem = await api.compact({\n activeCtx,\n activeProperty: itemActiveProperty,\n element: (isList || isGraph) ? inner : expandedItem,\n options\n });\n\n // handle @list\n if(isList) {\n // ensure @list value is an array\n if(!_isArray(compactedItem)) {\n compactedItem = [compactedItem];\n }\n\n if(!container.includes('@list')) {\n // wrap using @list alias\n compactedItem = {\n [api.compactIri({\n activeCtx,\n iri: '@list',\n relativeTo: {vocab: true}\n })]: compactedItem\n };\n\n // include @index from expanded @list, if any\n if('@index' in expandedItem) {\n compactedItem[api.compactIri({\n activeCtx,\n iri: '@index',\n relativeTo: {vocab: true}\n })] = expandedItem['@index'];\n }\n } else {\n _addValue(nestResult, itemActiveProperty, compactedItem, {\n valueIsArray: true,\n allowDuplicate: true\n });\n continue;\n }\n }\n\n // Graph object compaction cases\n if(isGraph) {\n if(container.includes('@graph') && (container.includes('@id') ||\n container.includes('@index') && _isSimpleGraph(expandedItem))) {\n // get or create the map object\n let mapObject;\n if(nestResult.hasOwnProperty(itemActiveProperty)) {\n mapObject = nestResult[itemActiveProperty];\n } else {\n nestResult[itemActiveProperty] = mapObject = {};\n }\n\n // index on @id or @index or alias of @none\n const key = (container.includes('@id') ?\n expandedItem['@id'] : expandedItem['@index']) ||\n api.compactIri({activeCtx, iri: '@none',\n relativeTo: {vocab: true}});\n // add compactedItem to map, using value of `@id` or a new blank\n // node identifier\n\n _addValue(\n mapObject, key, compactedItem, {\n propertyIsArray:\n (!options.compactArrays || container.includes('@set'))\n });\n } else if(container.includes('@graph') &&\n _isSimpleGraph(expandedItem)) {\n // container includes @graph but not @id or @index and value is a\n // simple graph object add compact value\n // if compactedItem contains multiple values, it is wrapped in\n // `@included`\n if(_isArray(compactedItem) && compactedItem.length > 1) {\n compactedItem = {'@included': compactedItem};\n }\n _addValue(\n nestResult, itemActiveProperty, compactedItem, {\n propertyIsArray:\n (!options.compactArrays || container.includes('@set'))\n });\n } else {\n // wrap using @graph alias, remove array if only one item and\n // compactArrays not set\n if(_isArray(compactedItem) && compactedItem.length === 1 &&\n options.compactArrays) {\n compactedItem = compactedItem[0];\n }\n compactedItem = {\n [api.compactIri({\n activeCtx,\n iri: '@graph',\n relativeTo: {vocab: true}\n })]: compactedItem\n };\n\n // include @id from expanded graph, if any\n if('@id' in expandedItem) {\n compactedItem[api.compactIri({\n activeCtx,\n iri: '@id',\n relativeTo: {vocab: true}\n })] = expandedItem['@id'];\n }\n\n // include @index from expanded graph, if any\n if('@index' in expandedItem) {\n compactedItem[api.compactIri({\n activeCtx,\n iri: '@index',\n relativeTo: {vocab: true}\n })] = expandedItem['@index'];\n }\n _addValue(\n nestResult, itemActiveProperty, compactedItem, {\n propertyIsArray:\n (!options.compactArrays || container.includes('@set'))\n });\n }\n } else if(container.includes('@language') ||\n container.includes('@index') || container.includes('@id') ||\n container.includes('@type')) {\n // handle language and index maps\n // get or create the map object\n let mapObject;\n if(nestResult.hasOwnProperty(itemActiveProperty)) {\n mapObject = nestResult[itemActiveProperty];\n } else {\n nestResult[itemActiveProperty] = mapObject = {};\n }\n\n let key;\n if(container.includes('@language')) {\n // if container is a language map, simplify compacted value to\n // a simple string\n if(_isValue(compactedItem)) {\n compactedItem = compactedItem['@value'];\n }\n key = expandedItem['@language'];\n } else if(container.includes('@index')) {\n const indexKey = _getContextValue(\n activeCtx, itemActiveProperty, '@index') || '@index';\n const containerKey = api.compactIri(\n {activeCtx, iri: indexKey, relativeTo: {vocab: true}});\n if(indexKey === '@index') {\n key = expandedItem['@index'];\n delete compactedItem[containerKey];\n } else {\n let others;\n [key, ...others] = _asArray(compactedItem[indexKey] || []);\n if(!_isString(key)) {\n // Will use @none if it isn't a string.\n key = null;\n } else {\n switch(others.length) {\n case 0:\n delete compactedItem[indexKey];\n break;\n case 1:\n compactedItem[indexKey] = others[0];\n break;\n default:\n compactedItem[indexKey] = others;\n break;\n }\n }\n }\n } else if(container.includes('@id')) {\n const idKey = api.compactIri({activeCtx, iri: '@id',\n relativeTo: {vocab: true}});\n key = compactedItem[idKey];\n delete compactedItem[idKey];\n } else if(container.includes('@type')) {\n const typeKey = api.compactIri({\n activeCtx,\n iri: '@type',\n relativeTo: {vocab: true}\n });\n let types;\n [key, ...types] = _asArray(compactedItem[typeKey] || []);\n switch(types.length) {\n case 0:\n delete compactedItem[typeKey];\n break;\n case 1:\n compactedItem[typeKey] = types[0];\n break;\n default:\n compactedItem[typeKey] = types;\n break;\n }\n\n // If compactedItem contains a single entry\n // whose key maps to @id, recompact without @type\n if(Object.keys(compactedItem).length === 1 &&\n '@id' in expandedItem) {\n compactedItem = await api.compact({\n activeCtx,\n activeProperty: itemActiveProperty,\n element: {'@id': expandedItem['@id']},\n options\n });\n }\n }\n\n // if compacting this value which has no key, index on @none\n if(!key) {\n key = api.compactIri({activeCtx, iri: '@none',\n relativeTo: {vocab: true}});\n }\n // add compact value to map object using key from expanded value\n // based on the container type\n _addValue(\n mapObject, key, compactedItem, {\n propertyIsArray: container.includes('@set')\n });\n } else {\n // use an array if: compactArrays flag is false,\n // @container is @set or @list , value is an empty\n // array, or key is @graph\n const isArray = (!options.compactArrays ||\n container.includes('@set') || container.includes('@list') ||\n (_isArray(compactedItem) && compactedItem.length === 0) ||\n expandedProperty === '@list' || expandedProperty === '@graph');\n\n // add compact value\n _addValue(\n nestResult, itemActiveProperty, compactedItem,\n {propertyIsArray: isArray});\n }\n }\n }\n\n return rval;\n }\n\n // only primitives remain which are already compact\n return element;\n};\n\n/**\n * Compacts an IRI or keyword into a term or prefix if it can be. If the\n * IRI has an associated value it may be passed.\n *\n * @param activeCtx the active context to use.\n * @param iri the IRI to compact.\n * @param value the value to check or null.\n * @param relativeTo options for how to compact IRIs:\n * vocab: true to split after @vocab, false not to.\n * @param reverse true if a reverse property is being compacted, false if not.\n * @param base the absolute URL to use for compacting document-relative IRIs.\n *\n * @return the compacted term, prefix, keyword alias, or the original IRI.\n */\napi.compactIri = ({\n activeCtx,\n iri,\n value = null,\n relativeTo = {vocab: false},\n reverse = false,\n base = null\n}) => {\n // can't compact null\n if(iri === null) {\n return iri;\n }\n\n // if context is from a property term scoped context composed with a\n // type-scoped context, then use the previous context instead\n if(activeCtx.isPropertyTermScoped && activeCtx.previousContext) {\n activeCtx = activeCtx.previousContext;\n }\n\n const inverseCtx = activeCtx.getInverse();\n\n // if term is a keyword, it may be compacted to a simple alias\n if(_isKeyword(iri) &&\n iri in inverseCtx &&\n '@none' in inverseCtx[iri] &&\n '@type' in inverseCtx[iri]['@none'] &&\n '@none' in inverseCtx[iri]['@none']['@type']) {\n return inverseCtx[iri]['@none']['@type']['@none'];\n }\n\n // use inverse context to pick a term if iri is relative to vocab\n if(relativeTo.vocab && iri in inverseCtx) {\n const defaultLanguage = activeCtx['@language'] || '@none';\n\n // prefer @index if available in value\n const containers = [];\n if(_isObject(value) && '@index' in value && !('@graph' in value)) {\n containers.push('@index', '@index@set');\n }\n\n // if value is a preserve object, use its value\n if(_isObject(value) && '@preserve' in value) {\n value = value['@preserve'][0];\n }\n\n // prefer most specific container including @graph, prefering @set\n // variations\n if(_isGraph(value)) {\n // favor indexmap if the graph is indexed\n if('@index' in value) {\n containers.push(\n '@graph@index', '@graph@index@set', '@index', '@index@set');\n }\n // favor idmap if the graph is has an @id\n if('@id' in value) {\n containers.push(\n '@graph@id', '@graph@id@set');\n }\n containers.push('@graph', '@graph@set', '@set');\n // allow indexmap if the graph is not indexed\n if(!('@index' in value)) {\n containers.push(\n '@graph@index', '@graph@index@set', '@index', '@index@set');\n }\n // allow idmap if the graph does not have an @id\n if(!('@id' in value)) {\n containers.push('@graph@id', '@graph@id@set');\n }\n } else if(_isObject(value) && !_isValue(value)) {\n containers.push('@id', '@id@set', '@type', '@set@type');\n }\n\n // defaults for term selection based on type/language\n let typeOrLanguage = '@language';\n let typeOrLanguageValue = '@null';\n\n if(reverse) {\n typeOrLanguage = '@type';\n typeOrLanguageValue = '@reverse';\n containers.push('@set');\n } else if(_isList(value)) {\n // choose the most specific term that works for all elements in @list\n // only select @list containers if @index is NOT in value\n if(!('@index' in value)) {\n containers.push('@list');\n }\n const list = value['@list'];\n if(list.length === 0) {\n // any empty list can be matched against any term that uses the\n // @list container regardless of @type or @language\n typeOrLanguage = '@any';\n typeOrLanguageValue = '@none';\n } else {\n let commonLanguage = (list.length === 0) ? defaultLanguage : null;\n let commonType = null;\n for(let i = 0; i < list.length; ++i) {\n const item = list[i];\n let itemLanguage = '@none';\n let itemType = '@none';\n if(_isValue(item)) {\n if('@direction' in item) {\n const lang = (item['@language'] || '').toLowerCase();\n const dir = item['@direction'];\n itemLanguage = `${lang}_${dir}`;\n } else if('@language' in item) {\n itemLanguage = item['@language'].toLowerCase();\n } else if('@type' in item) {\n itemType = item['@type'];\n } else {\n // plain literal\n itemLanguage = '@null';\n }\n } else {\n itemType = '@id';\n }\n if(commonLanguage === null) {\n commonLanguage = itemLanguage;\n } else if(itemLanguage !== commonLanguage && _isValue(item)) {\n commonLanguage = '@none';\n }\n if(commonType === null) {\n commonType = itemType;\n } else if(itemType !== commonType) {\n commonType = '@none';\n }\n // there are different languages and types in the list, so choose\n // the most generic term, no need to keep iterating the list\n if(commonLanguage === '@none' && commonType === '@none') {\n break;\n }\n }\n commonLanguage = commonLanguage || '@none';\n commonType = commonType || '@none';\n if(commonType !== '@none') {\n typeOrLanguage = '@type';\n typeOrLanguageValue = commonType;\n } else {\n typeOrLanguageValue = commonLanguage;\n }\n }\n } else {\n if(_isValue(value)) {\n if('@language' in value && !('@index' in value)) {\n containers.push('@language', '@language@set');\n typeOrLanguageValue = value['@language'];\n const dir = value['@direction'];\n if(dir) {\n typeOrLanguageValue = `${typeOrLanguageValue}_${dir}`;\n }\n } else if('@direction' in value && !('@index' in value)) {\n typeOrLanguageValue = `_${value['@direction']}`;\n } else if('@type' in value) {\n typeOrLanguage = '@type';\n typeOrLanguageValue = value['@type'];\n }\n } else {\n typeOrLanguage = '@type';\n typeOrLanguageValue = '@id';\n }\n containers.push('@set');\n }\n\n // do term selection\n containers.push('@none');\n\n // an index map can be used to index values using @none, so add as a low\n // priority\n if(_isObject(value) && !('@index' in value)) {\n // allow indexing even if no @index present\n containers.push('@index', '@index@set');\n }\n\n // values without type or language can use @language map\n if(_isValue(value) && Object.keys(value).length === 1) {\n // allow indexing even if no @index present\n containers.push('@language', '@language@set');\n }\n\n const term = _selectTerm(\n activeCtx, iri, value, containers, typeOrLanguage, typeOrLanguageValue);\n if(term !== null) {\n return term;\n }\n }\n\n // no term match, use @vocab if available\n if(relativeTo.vocab) {\n if('@vocab' in activeCtx) {\n // determine if vocab is a prefix of the iri\n const vocab = activeCtx['@vocab'];\n if(iri.indexOf(vocab) === 0 && iri !== vocab) {\n // use suffix as relative iri if it is not a term in the active context\n const suffix = iri.substr(vocab.length);\n if(!activeCtx.mappings.has(suffix)) {\n return suffix;\n }\n }\n }\n }\n\n // no term or @vocab match, check for possible CURIEs\n let choice = null;\n // TODO: make FastCurieMap a class with a method to do this lookup\n const partialMatches = [];\n let iriMap = activeCtx.fastCurieMap;\n // check for partial matches of against `iri`, which means look until\n // iri.length - 1, not full length\n const maxPartialLength = iri.length - 1;\n for(let i = 0; i < maxPartialLength && iri[i] in iriMap; ++i) {\n iriMap = iriMap[iri[i]];\n if('' in iriMap) {\n partialMatches.push(iriMap[''][0]);\n }\n }\n // check partial matches in reverse order to prefer longest ones first\n for(let i = partialMatches.length - 1; i >= 0; --i) {\n const entry = partialMatches[i];\n const terms = entry.terms;\n for(const term of terms) {\n // a CURIE is usable if:\n // 1. it has no mapping, OR\n // 2. value is null, which means we're not compacting an @value, AND\n // the mapping matches the IRI\n const curie = term + ':' + iri.substr(entry.iri.length);\n const isUsableCurie = (activeCtx.mappings.get(term)._prefix &&\n (!activeCtx.mappings.has(curie) ||\n (value === null && activeCtx.mappings.get(curie)['@id'] === iri)));\n\n // select curie if it is shorter or the same length but lexicographically\n // less than the current choice\n if(isUsableCurie && (choice === null ||\n _compareShortestLeast(curie, choice) < 0)) {\n choice = curie;\n }\n }\n }\n\n // return chosen curie\n if(choice !== null) {\n return choice;\n }\n\n // If iri could be confused with a compact IRI using a term in this context,\n // signal an error\n for(const [term, td] of activeCtx.mappings) {\n if(td && td._prefix && iri.startsWith(term + ':')) {\n throw new JsonLdError(\n `Absolute IRI \"${iri}\" confused with prefix \"${term}\".`,\n 'jsonld.SyntaxError',\n {code: 'IRI confused with prefix', context: activeCtx});\n }\n }\n\n // compact IRI relative to base\n if(!relativeTo.vocab) {\n if('@base' in activeCtx) {\n if(!activeCtx['@base']) {\n // The None case preserves rval as potentially relative\n return iri;\n } else {\n const _iri = _removeBase(_prependBase(base, activeCtx['@base']), iri);\n return REGEX_KEYWORD.test(_iri) ? `./${_iri}` : _iri;\n }\n } else {\n return _removeBase(base, iri);\n }\n }\n\n // return IRI as is\n return iri;\n};\n\n/**\n * Performs value compaction on an object with '@value' or '@id' as the only\n * property.\n *\n * @param activeCtx the active context.\n * @param activeProperty the active property that points to the value.\n * @param value the value to compact.\n * @param {Object} [options] - processing options.\n *\n * @return the compaction result.\n */\napi.compactValue = ({activeCtx, activeProperty, value, options}) => {\n // value is a @value\n if(_isValue(value)) {\n // get context rules\n const type = _getContextValue(activeCtx, activeProperty, '@type');\n const language = _getContextValue(activeCtx, activeProperty, '@language');\n const direction = _getContextValue(activeCtx, activeProperty, '@direction');\n const container =\n _getContextValue(activeCtx, activeProperty, '@container') || [];\n\n // whether or not the value has an @index that must be preserved\n const preserveIndex = '@index' in value && !container.includes('@index');\n\n // if there's no @index to preserve ...\n if(!preserveIndex && type !== '@none') {\n // matching @type or @language specified in context, compact value\n if(value['@type'] === type) {\n return value['@value'];\n }\n if('@language' in value && value['@language'] === language &&\n '@direction' in value && value['@direction'] === direction) {\n return value['@value'];\n }\n if('@language' in value && value['@language'] === language) {\n return value['@value'];\n }\n if('@direction' in value && value['@direction'] === direction) {\n return value['@value'];\n }\n }\n\n // return just the value of @value if all are true:\n // 1. @value is the only key or @index isn't being preserved\n // 2. there is no default language or @value is not a string or\n // the key has a mapping with a null @language\n const keyCount = Object.keys(value).length;\n const isValueOnlyKey = (keyCount === 1 ||\n (keyCount === 2 && '@index' in value && !preserveIndex));\n const hasDefaultLanguage = ('@language' in activeCtx);\n const isValueString = _isString(value['@value']);\n const hasNullMapping = (activeCtx.mappings.has(activeProperty) &&\n activeCtx.mappings.get(activeProperty)['@language'] === null);\n if(isValueOnlyKey &&\n type !== '@none' &&\n (!hasDefaultLanguage || !isValueString || hasNullMapping)) {\n return value['@value'];\n }\n\n const rval = {};\n\n // preserve @index\n if(preserveIndex) {\n rval[api.compactIri({\n activeCtx,\n iri: '@index',\n relativeTo: {vocab: true}\n })] = value['@index'];\n }\n\n if('@type' in value) {\n // compact @type IRI\n rval[api.compactIri({\n activeCtx,\n iri: '@type',\n relativeTo: {vocab: true}\n })] = api.compactIri(\n {activeCtx, iri: value['@type'], relativeTo: {vocab: true}});\n } else if('@language' in value) {\n // alias @language\n rval[api.compactIri({\n activeCtx,\n iri: '@language',\n relativeTo: {vocab: true}\n })] = value['@language'];\n }\n\n if('@direction' in value) {\n // alias @direction\n rval[api.compactIri({\n activeCtx,\n iri: '@direction',\n relativeTo: {vocab: true}\n })] = value['@direction'];\n }\n\n // alias @value\n rval[api.compactIri({\n activeCtx,\n iri: '@value',\n relativeTo: {vocab: true}\n })] = value['@value'];\n\n return rval;\n }\n\n // value is a subject reference\n const expandedProperty = _expandIri(activeCtx, activeProperty, {vocab: true},\n options);\n const type = _getContextValue(activeCtx, activeProperty, '@type');\n const compacted = api.compactIri({\n activeCtx,\n iri: value['@id'],\n relativeTo: {vocab: type === '@vocab'},\n base: options.base});\n\n // compact to scalar\n if(type === '@id' || type === '@vocab' || expandedProperty === '@graph') {\n return compacted;\n }\n\n return {\n [api.compactIri({\n activeCtx,\n iri: '@id',\n relativeTo: {vocab: true}\n })]: compacted\n };\n};\n\n/**\n * Picks the preferred compaction term from the given inverse context entry.\n *\n * @param activeCtx the active context.\n * @param iri the IRI to pick the term for.\n * @param value the value to pick the term for.\n * @param containers the preferred containers.\n * @param typeOrLanguage either '@type' or '@language'.\n * @param typeOrLanguageValue the preferred value for '@type' or '@language'.\n *\n * @return the preferred term.\n */\nfunction _selectTerm(\n activeCtx, iri, value, containers, typeOrLanguage, typeOrLanguageValue) {\n if(typeOrLanguageValue === null) {\n typeOrLanguageValue = '@null';\n }\n\n // preferences for the value of @type or @language\n const prefs = [];\n\n // determine prefs for @id based on whether or not value compacts to a term\n if((typeOrLanguageValue === '@id' || typeOrLanguageValue === '@reverse') &&\n _isObject(value) && '@id' in value) {\n // prefer @reverse first\n if(typeOrLanguageValue === '@reverse') {\n prefs.push('@reverse');\n }\n // try to compact value to a term\n const term = api.compactIri(\n {activeCtx, iri: value['@id'], relativeTo: {vocab: true}});\n if(activeCtx.mappings.has(term) &&\n activeCtx.mappings.get(term) &&\n activeCtx.mappings.get(term)['@id'] === value['@id']) {\n // prefer @vocab\n prefs.push.apply(prefs, ['@vocab', '@id']);\n } else {\n // prefer @id\n prefs.push.apply(prefs, ['@id', '@vocab']);\n }\n } else {\n prefs.push(typeOrLanguageValue);\n\n // consider direction only\n const langDir = prefs.find(el => el.includes('_'));\n if(langDir) {\n // consider _dir portion\n prefs.push(langDir.replace(/^[^_]+_/, '_'));\n }\n }\n prefs.push('@none');\n\n const containerMap = activeCtx.inverse[iri];\n for(const container of containers) {\n // if container not available in the map, continue\n if(!(container in containerMap)) {\n continue;\n }\n\n const typeOrLanguageValueMap = containerMap[container][typeOrLanguage];\n for(const pref of prefs) {\n // if type/language option not available in the map, continue\n if(!(pref in typeOrLanguageValueMap)) {\n continue;\n }\n\n // select term\n return typeOrLanguageValueMap[pref];\n }\n }\n\n return null;\n}\n\n/**\n * The value of `@nest` in the term definition must either be `@nest`, or a term\n * which resolves to `@nest`.\n *\n * @param activeCtx the active context.\n * @param nestProperty a term in the active context or `@nest`.\n * @param {Object} [options] - processing options.\n */\nfunction _checkNestProperty(activeCtx, nestProperty, options) {\n if(_expandIri(activeCtx, nestProperty, {vocab: true}, options) !== '@nest') {\n throw new JsonLdError(\n 'JSON-LD compact error; nested property must have an @nest value ' +\n 'resolving to @nest.',\n 'jsonld.SyntaxError', {code: 'invalid @nest value'});\n }\n}\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';\nconst XSD = 'http://www.w3.org/2001/XMLSchema#';\n\nmodule.exports = {\n // TODO: Deprecated and will be removed later. Use LINK_HEADER_CONTEXT.\n LINK_HEADER_REL: 'http://www.w3.org/ns/json-ld#context',\n\n LINK_HEADER_CONTEXT: 'http://www.w3.org/ns/json-ld#context',\n\n RDF,\n RDF_LIST: RDF + 'List',\n RDF_FIRST: RDF + 'first',\n RDF_REST: RDF + 'rest',\n RDF_NIL: RDF + 'nil',\n RDF_TYPE: RDF + 'type',\n RDF_PLAIN_LITERAL: RDF + 'PlainLiteral',\n RDF_XML_LITERAL: RDF + 'XMLLiteral',\n RDF_JSON_LITERAL: RDF + 'JSON',\n RDF_OBJECT: RDF + 'object',\n RDF_LANGSTRING: RDF + 'langString',\n\n XSD,\n XSD_BOOLEAN: XSD + 'boolean',\n XSD_DOUBLE: XSD + 'double',\n XSD_INTEGER: XSD + 'integer',\n XSD_STRING: XSD + 'string',\n};\n","/*\n * Copyright (c) 2017-2019 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst util = require('./util');\nconst JsonLdError = require('./JsonLdError');\n\nconst {\n isArray: _isArray,\n isObject: _isObject,\n isString: _isString,\n isUndefined: _isUndefined\n} = require('./types');\n\nconst {\n isAbsolute: _isAbsoluteIri,\n isRelative: _isRelativeIri,\n prependBase\n} = require('./url');\n\nconst {\n handleEvent: _handleEvent\n} = require('./events');\n\nconst {\n REGEX_BCP47,\n REGEX_KEYWORD,\n asArray: _asArray,\n compareShortestLeast: _compareShortestLeast\n} = require('./util');\n\nconst INITIAL_CONTEXT_CACHE = new Map();\nconst INITIAL_CONTEXT_CACHE_MAX_SIZE = 10000;\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Processes a local context and returns a new active context.\n *\n * @param activeCtx the current active context.\n * @param localCtx the local context to process.\n * @param options the context processing options.\n * @param propagate `true` if `false`, retains any previously defined term,\n * which can be rolled back when the descending into a new node object.\n * @param overrideProtected `false` allows protected terms to be modified.\n *\n * @return a Promise that resolves to the new active context.\n */\napi.process = async ({\n activeCtx, localCtx, options,\n propagate = true,\n overrideProtected = false,\n cycles = new Set()\n}) => {\n // normalize local context to an array of @context objects\n if(_isObject(localCtx) && '@context' in localCtx &&\n _isArray(localCtx['@context'])) {\n localCtx = localCtx['@context'];\n }\n const ctxs = _asArray(localCtx);\n\n // no contexts in array, return current active context w/o changes\n if(ctxs.length === 0) {\n return activeCtx;\n }\n\n // event handler for capturing events to replay when using a cached context\n const events = [];\n const eventCaptureHandler = [\n ({event, next}) => {\n events.push(event);\n next();\n }\n ];\n // chain to original handler\n if(options.eventHandler) {\n eventCaptureHandler.push(options.eventHandler);\n }\n // store original options to use when replaying events\n const originalOptions = options;\n // shallow clone options with event capture handler\n options = {...options, eventHandler: eventCaptureHandler};\n\n // resolve contexts\n const resolved = await options.contextResolver.resolve({\n activeCtx,\n context: localCtx,\n documentLoader: options.documentLoader,\n base: options.base\n });\n\n // override propagate if first resolved context has `@propagate`\n if(_isObject(resolved[0].document) &&\n typeof resolved[0].document['@propagate'] === 'boolean') {\n // retrieve early, error checking done later\n propagate = resolved[0].document['@propagate'];\n }\n\n // process each context in order, update active context\n // on each iteration to ensure proper caching\n let rval = activeCtx;\n\n // track the previous context\n // if not propagating, make sure rval has a previous context\n if(!propagate && !rval.previousContext) {\n // clone `rval` context before updating\n rval = rval.clone();\n rval.previousContext = activeCtx;\n }\n\n for(const resolvedContext of resolved) {\n let {document: ctx} = resolvedContext;\n\n // update active context to one computed from last iteration\n activeCtx = rval;\n\n // reset to initial context\n if(ctx === null) {\n // We can't nullify if there are protected terms and we're\n // not allowing overrides (e.g. processing a property term scoped context)\n if(!overrideProtected && Object.keys(activeCtx.protected).length !== 0) {\n throw new JsonLdError(\n 'Tried to nullify a context with protected terms outside of ' +\n 'a term definition.',\n 'jsonld.SyntaxError',\n {code: 'invalid context nullification'});\n }\n rval = activeCtx = api.getInitialContext(options).clone();\n continue;\n }\n\n // get processed context from cache if available\n const processed = resolvedContext.getProcessed(activeCtx);\n if(processed) {\n if(originalOptions.eventHandler) {\n // replay events with original non-capturing options\n for(const event of processed.events) {\n _handleEvent({event, options: originalOptions});\n }\n }\n\n rval = activeCtx = processed.context;\n continue;\n }\n\n // dereference @context key if present\n if(_isObject(ctx) && '@context' in ctx) {\n ctx = ctx['@context'];\n }\n\n // context must be an object by now, all URLs retrieved before this call\n if(!_isObject(ctx)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context must be an object.',\n 'jsonld.SyntaxError', {code: 'invalid local context', context: ctx});\n }\n\n // TODO: there is likely a `previousContext` cloning optimization that\n // could be applied here (no need to copy it under certain conditions)\n\n // clone context before updating it\n rval = rval.clone();\n\n // define context mappings for keys in local context\n const defined = new Map();\n\n // handle @version\n if('@version' in ctx) {\n if(ctx['@version'] !== 1.1) {\n throw new JsonLdError(\n 'Unsupported JSON-LD version: ' + ctx['@version'],\n 'jsonld.UnsupportedVersion',\n {code: 'invalid @version value', context: ctx});\n }\n if(activeCtx.processingMode &&\n activeCtx.processingMode === 'json-ld-1.0') {\n throw new JsonLdError(\n '@version: ' + ctx['@version'] + ' not compatible with ' +\n activeCtx.processingMode,\n 'jsonld.ProcessingModeConflict',\n {code: 'processing mode conflict', context: ctx});\n }\n rval.processingMode = 'json-ld-1.1';\n rval['@version'] = ctx['@version'];\n defined.set('@version', true);\n }\n\n // if not set explicitly, set processingMode to \"json-ld-1.1\"\n rval.processingMode =\n rval.processingMode || activeCtx.processingMode;\n\n // handle @base\n if('@base' in ctx) {\n let base = ctx['@base'];\n\n if(base === null || _isAbsoluteIri(base)) {\n // no action\n } else if(_isRelativeIri(base)) {\n base = prependBase(rval['@base'], base);\n } else {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; the value of \"@base\" in a ' +\n '@context must be an absolute IRI, a relative IRI, or null.',\n 'jsonld.SyntaxError', {code: 'invalid base IRI', context: ctx});\n }\n\n rval['@base'] = base;\n defined.set('@base', true);\n }\n\n // handle @vocab\n if('@vocab' in ctx) {\n const value = ctx['@vocab'];\n if(value === null) {\n delete rval['@vocab'];\n } else if(!_isString(value)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; the value of \"@vocab\" in a ' +\n '@context must be a string or null.',\n 'jsonld.SyntaxError', {code: 'invalid vocab mapping', context: ctx});\n } else if(!_isAbsoluteIri(value) && api.processingMode(rval, 1.0)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; the value of \"@vocab\" in a ' +\n '@context must be an absolute IRI.',\n 'jsonld.SyntaxError', {code: 'invalid vocab mapping', context: ctx});\n } else {\n const vocab = _expandIri(rval, value, {vocab: true, base: true},\n undefined, undefined, options);\n if(!_isAbsoluteIri(vocab)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'relative @vocab reference',\n level: 'warning',\n message: 'Relative @vocab reference found.',\n details: {\n vocab\n }\n },\n options\n });\n }\n }\n rval['@vocab'] = vocab;\n }\n defined.set('@vocab', true);\n }\n\n // handle @language\n if('@language' in ctx) {\n const value = ctx['@language'];\n if(value === null) {\n delete rval['@language'];\n } else if(!_isString(value)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; the value of \"@language\" in a ' +\n '@context must be a string or null.',\n 'jsonld.SyntaxError',\n {code: 'invalid default language', context: ctx});\n } else {\n if(!value.match(REGEX_BCP47)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'invalid @language value',\n level: 'warning',\n message: '@language value must be valid BCP47.',\n details: {\n language: value\n }\n },\n options\n });\n }\n }\n rval['@language'] = value.toLowerCase();\n }\n defined.set('@language', true);\n }\n\n // handle @direction\n if('@direction' in ctx) {\n const value = ctx['@direction'];\n if(activeCtx.processingMode === 'json-ld-1.0') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @direction not compatible with ' +\n activeCtx.processingMode,\n 'jsonld.SyntaxError',\n {code: 'invalid context member', context: ctx});\n }\n if(value === null) {\n delete rval['@direction'];\n } else if(value !== 'ltr' && value !== 'rtl') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; the value of \"@direction\" in a ' +\n '@context must be null, \"ltr\", or \"rtl\".',\n 'jsonld.SyntaxError',\n {code: 'invalid base direction', context: ctx});\n } else {\n rval['@direction'] = value;\n }\n defined.set('@direction', true);\n }\n\n // handle @propagate\n // note: we've already extracted it, here we just do error checking\n if('@propagate' in ctx) {\n const value = ctx['@propagate'];\n if(activeCtx.processingMode === 'json-ld-1.0') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @propagate not compatible with ' +\n activeCtx.processingMode,\n 'jsonld.SyntaxError',\n {code: 'invalid context entry', context: ctx});\n }\n if(typeof value !== 'boolean') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @propagate value must be a boolean.',\n 'jsonld.SyntaxError',\n {code: 'invalid @propagate value', context: localCtx});\n }\n defined.set('@propagate', true);\n }\n\n // handle @import\n if('@import' in ctx) {\n const value = ctx['@import'];\n if(activeCtx.processingMode === 'json-ld-1.0') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @import not compatible with ' +\n activeCtx.processingMode,\n 'jsonld.SyntaxError',\n {code: 'invalid context entry', context: ctx});\n }\n if(!_isString(value)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @import must be a string.',\n 'jsonld.SyntaxError',\n {code: 'invalid @import value', context: localCtx});\n }\n\n // resolve contexts\n const resolvedImport = await options.contextResolver.resolve({\n activeCtx,\n context: value,\n documentLoader: options.documentLoader,\n base: options.base\n });\n if(resolvedImport.length !== 1) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @import must reference a single context.',\n 'jsonld.SyntaxError',\n {code: 'invalid remote context', context: localCtx});\n }\n const processedImport = resolvedImport[0].getProcessed(activeCtx);\n if(processedImport) {\n // Note: if the same context were used in this active context\n // as a reference context, then processed_input might not\n // be a dict.\n ctx = processedImport;\n } else {\n const importCtx = resolvedImport[0].document;\n if('@import' in importCtx) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax: ' +\n 'imported context must not include @import.',\n 'jsonld.SyntaxError',\n {code: 'invalid context entry', context: localCtx});\n }\n\n // merge ctx into importCtx and replace rval with the result\n for(const key in importCtx) {\n if(!ctx.hasOwnProperty(key)) {\n ctx[key] = importCtx[key];\n }\n }\n\n // Note: this could potenially conflict if the import\n // were used in the same active context as a referenced\n // context and an import. In this case, we\n // could override the cached result, but seems unlikely.\n resolvedImport[0].setProcessed(activeCtx, ctx);\n }\n\n defined.set('@import', true);\n }\n\n // handle @protected; determine whether this sub-context is declaring\n // all its terms to be \"protected\" (exceptions can be made on a\n // per-definition basis)\n defined.set('@protected', ctx['@protected'] || false);\n\n // process all other keys\n for(const key in ctx) {\n api.createTermDefinition({\n activeCtx: rval,\n localCtx: ctx,\n term: key,\n defined,\n options,\n overrideProtected\n });\n\n if(_isObject(ctx[key]) && '@context' in ctx[key]) {\n const keyCtx = ctx[key]['@context'];\n let process = true;\n if(_isString(keyCtx)) {\n const url = prependBase(options.base, keyCtx);\n // track processed contexts to avoid scoped context recursion\n if(cycles.has(url)) {\n process = false;\n } else {\n cycles.add(url);\n }\n }\n // parse context to validate\n if(process) {\n try {\n await api.process({\n activeCtx: rval.clone(),\n localCtx: ctx[key]['@context'],\n overrideProtected: true,\n options,\n cycles\n });\n } catch(e) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; invalid scoped context.',\n 'jsonld.SyntaxError',\n {\n code: 'invalid scoped context',\n context: ctx[key]['@context'],\n term: key\n });\n }\n }\n }\n }\n\n // cache processed result\n resolvedContext.setProcessed(activeCtx, {\n context: rval,\n events\n });\n }\n\n return rval;\n};\n\n/**\n * Creates a term definition during context processing.\n *\n * @param activeCtx the current active context.\n * @param localCtx the local context being processed.\n * @param term the term in the local context to define the mapping for.\n * @param defined a map of defining/defined keys to detect cycles and prevent\n * double definitions.\n * @param {Object} [options] - creation options.\n * @param overrideProtected `false` allows protected terms to be modified.\n */\napi.createTermDefinition = ({\n activeCtx,\n localCtx,\n term,\n defined,\n options,\n overrideProtected = false,\n}) => {\n if(defined.has(term)) {\n // term already defined\n if(defined.get(term)) {\n return;\n }\n // cycle detected\n throw new JsonLdError(\n 'Cyclical context definition detected.',\n 'jsonld.CyclicalContext',\n {code: 'cyclic IRI mapping', context: localCtx, term});\n }\n\n // now defining term\n defined.set(term, false);\n\n // get context term value\n let value;\n if(localCtx.hasOwnProperty(term)) {\n value = localCtx[term];\n }\n\n if(term === '@type' &&\n _isObject(value) &&\n (value['@container'] || '@set') === '@set' &&\n api.processingMode(activeCtx, 1.1)) {\n\n const validKeys = ['@container', '@id', '@protected'];\n const keys = Object.keys(value);\n if(keys.length === 0 || keys.some(k => !validKeys.includes(k))) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; keywords cannot be overridden.',\n 'jsonld.SyntaxError',\n {code: 'keyword redefinition', context: localCtx, term});\n }\n } else if(api.isKeyword(term)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; keywords cannot be overridden.',\n 'jsonld.SyntaxError',\n {code: 'keyword redefinition', context: localCtx, term});\n } else if(term.match(REGEX_KEYWORD)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'reserved term',\n level: 'warning',\n message:\n 'Terms beginning with \"@\" are ' +\n 'reserved for future use and dropped.',\n details: {\n term\n }\n },\n options\n });\n }\n return;\n } else if(term === '') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a term cannot be an empty string.',\n 'jsonld.SyntaxError',\n {code: 'invalid term definition', context: localCtx});\n }\n\n // keep reference to previous mapping for potential `@protected` check\n const previousMapping = activeCtx.mappings.get(term);\n\n // remove old mapping\n if(activeCtx.mappings.has(term)) {\n activeCtx.mappings.delete(term);\n }\n\n // convert short-hand value to object w/@id\n let simpleTerm = false;\n if(_isString(value) || value === null) {\n simpleTerm = true;\n value = {'@id': value};\n }\n\n if(!_isObject(value)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context term values must be ' +\n 'strings or objects.',\n 'jsonld.SyntaxError',\n {code: 'invalid term definition', context: localCtx});\n }\n\n // create new mapping\n const mapping = {};\n activeCtx.mappings.set(term, mapping);\n mapping.reverse = false;\n\n // make sure term definition only has expected keywords\n const validKeys = ['@container', '@id', '@language', '@reverse', '@type'];\n\n // JSON-LD 1.1 support\n if(api.processingMode(activeCtx, 1.1)) {\n validKeys.push(\n '@context', '@direction', '@index', '@nest', '@prefix', '@protected');\n }\n\n for(const kw in value) {\n if(!validKeys.includes(kw)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a term definition must not contain ' + kw,\n 'jsonld.SyntaxError',\n {code: 'invalid term definition', context: localCtx});\n }\n }\n\n // always compute whether term has a colon as an optimization for\n // _compactIri\n const colon = term.indexOf(':');\n mapping._termHasColon = (colon > 0);\n\n if('@reverse' in value) {\n if('@id' in value) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a @reverse term definition must not ' +\n 'contain @id.', 'jsonld.SyntaxError',\n {code: 'invalid reverse property', context: localCtx});\n }\n if('@nest' in value) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a @reverse term definition must not ' +\n 'contain @nest.', 'jsonld.SyntaxError',\n {code: 'invalid reverse property', context: localCtx});\n }\n const reverse = value['@reverse'];\n if(!_isString(reverse)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a @context @reverse value must be a string.',\n 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx});\n }\n\n if(reverse.match(REGEX_KEYWORD)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'reserved @reverse value',\n level: 'warning',\n message:\n '@reverse values beginning with \"@\" are ' +\n 'reserved for future use and dropped.',\n details: {\n reverse\n }\n },\n options\n });\n }\n if(previousMapping) {\n activeCtx.mappings.set(term, previousMapping);\n } else {\n activeCtx.mappings.delete(term);\n }\n return;\n }\n\n // expand and add @id mapping\n const id = _expandIri(\n activeCtx, reverse, {vocab: true, base: false}, localCtx, defined,\n options);\n if(!_isAbsoluteIri(id)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a @context @reverse value must be an ' +\n 'absolute IRI or a blank node identifier.',\n 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx});\n }\n\n mapping['@id'] = id;\n mapping.reverse = true;\n } else if('@id' in value) {\n let id = value['@id'];\n if(id && !_isString(id)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a @context @id value must be an array ' +\n 'of strings or a string.',\n 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx});\n }\n if(id === null) {\n // reserve a null term, which may be protected\n mapping['@id'] = null;\n } else if(!api.isKeyword(id) && id.match(REGEX_KEYWORD)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'reserved @id value',\n level: 'warning',\n message:\n '@id values beginning with \"@\" are ' +\n 'reserved for future use and dropped.',\n details: {\n id\n }\n },\n options\n });\n }\n if(previousMapping) {\n activeCtx.mappings.set(term, previousMapping);\n } else {\n activeCtx.mappings.delete(term);\n }\n return;\n } else if(id !== term) {\n // expand and add @id mapping\n id = _expandIri(\n activeCtx, id, {vocab: true, base: false}, localCtx, defined, options);\n if(!_isAbsoluteIri(id) && !api.isKeyword(id)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a @context @id value must be an ' +\n 'absolute IRI, a blank node identifier, or a keyword.',\n 'jsonld.SyntaxError',\n {code: 'invalid IRI mapping', context: localCtx});\n }\n\n // if term has the form of an IRI it must map the same\n if(term.match(/(?::[^:])|\\//)) {\n const termDefined = new Map(defined).set(term, true);\n const termIri = _expandIri(\n activeCtx, term, {vocab: true, base: false},\n localCtx, termDefined, options);\n if(termIri !== id) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; term in form of IRI must ' +\n 'expand to definition.',\n 'jsonld.SyntaxError',\n {code: 'invalid IRI mapping', context: localCtx});\n }\n }\n\n mapping['@id'] = id;\n // indicate if this term may be used as a compact IRI prefix\n mapping._prefix = (simpleTerm &&\n !mapping._termHasColon &&\n id.match(/[:\\/\\?#\\[\\]@]$/) !== null);\n }\n }\n\n if(!('@id' in mapping)) {\n // see if the term has a prefix\n if(mapping._termHasColon) {\n const prefix = term.substr(0, colon);\n if(localCtx.hasOwnProperty(prefix)) {\n // define parent prefix\n api.createTermDefinition({\n activeCtx, localCtx, term: prefix, defined, options\n });\n }\n\n if(activeCtx.mappings.has(prefix)) {\n // set @id based on prefix parent\n const suffix = term.substr(colon + 1);\n mapping['@id'] = activeCtx.mappings.get(prefix)['@id'] + suffix;\n } else {\n // term is an absolute IRI\n mapping['@id'] = term;\n }\n } else if(term === '@type') {\n // Special case, were we've previously determined that container is @set\n mapping['@id'] = term;\n } else {\n // non-IRIs *must* define @ids if @vocab is not available\n if(!('@vocab' in activeCtx)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context terms must define an @id.',\n 'jsonld.SyntaxError',\n {code: 'invalid IRI mapping', context: localCtx, term});\n }\n // prepend vocab to term\n mapping['@id'] = activeCtx['@vocab'] + term;\n }\n }\n\n // Handle term protection\n if(value['@protected'] === true ||\n (defined.get('@protected') === true && value['@protected'] !== false)) {\n activeCtx.protected[term] = true;\n mapping.protected = true;\n }\n\n // IRI mapping now defined\n defined.set(term, true);\n\n if('@type' in value) {\n let type = value['@type'];\n if(!_isString(type)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; an @context @type value must be a string.',\n 'jsonld.SyntaxError',\n {code: 'invalid type mapping', context: localCtx});\n }\n\n if((type === '@json' || type === '@none')) {\n if(api.processingMode(activeCtx, 1.0)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; an @context @type value must not be ' +\n `\"${type}\" in JSON-LD 1.0 mode.`,\n 'jsonld.SyntaxError',\n {code: 'invalid type mapping', context: localCtx});\n }\n } else if(type !== '@id' && type !== '@vocab') {\n // expand @type to full IRI\n type = _expandIri(\n activeCtx, type, {vocab: true, base: false}, localCtx, defined,\n options);\n if(!_isAbsoluteIri(type)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; an @context @type value must be an ' +\n 'absolute IRI.',\n 'jsonld.SyntaxError',\n {code: 'invalid type mapping', context: localCtx});\n }\n if(type.indexOf('_:') === 0) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; an @context @type value must be an IRI, ' +\n 'not a blank node identifier.',\n 'jsonld.SyntaxError',\n {code: 'invalid type mapping', context: localCtx});\n }\n }\n\n // add @type to mapping\n mapping['@type'] = type;\n }\n\n if('@container' in value) {\n // normalize container to an array form\n const container = _isString(value['@container']) ?\n [value['@container']] : (value['@container'] || []);\n const validContainers = ['@list', '@set', '@index', '@language'];\n let isValid = true;\n const hasSet = container.includes('@set');\n\n // JSON-LD 1.1 support\n if(api.processingMode(activeCtx, 1.1)) {\n validContainers.push('@graph', '@id', '@type');\n\n // check container length\n if(container.includes('@list')) {\n if(container.length !== 1) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context @container with @list must ' +\n 'have no other values',\n 'jsonld.SyntaxError',\n {code: 'invalid container mapping', context: localCtx});\n }\n } else if(container.includes('@graph')) {\n if(container.some(key =>\n key !== '@graph' && key !== '@id' && key !== '@index' &&\n key !== '@set')) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context @container with @graph must ' +\n 'have no other values other than @id, @index, and @set',\n 'jsonld.SyntaxError',\n {code: 'invalid container mapping', context: localCtx});\n }\n } else {\n // otherwise, container may also include @set\n isValid &= container.length <= (hasSet ? 2 : 1);\n }\n\n if(container.includes('@type')) {\n // If mapping does not have an @type,\n // set it to @id\n mapping['@type'] = mapping['@type'] || '@id';\n\n // type mapping must be either @id or @vocab\n if(!['@id', '@vocab'].includes(mapping['@type'])) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; container: @type requires @type to be ' +\n '@id or @vocab.',\n 'jsonld.SyntaxError',\n {code: 'invalid type mapping', context: localCtx});\n }\n }\n } else {\n // in JSON-LD 1.0, container must not be an array (it must be a string,\n // which is one of the validContainers)\n isValid &= !_isArray(value['@container']);\n\n // check container length\n isValid &= container.length <= 1;\n }\n\n // check against valid containers\n isValid &= container.every(c => validContainers.includes(c));\n\n // @set not allowed with @list\n isValid &= !(hasSet && container.includes('@list'));\n\n if(!isValid) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context @container value must be ' +\n 'one of the following: ' + validContainers.join(', '),\n 'jsonld.SyntaxError',\n {code: 'invalid container mapping', context: localCtx});\n }\n\n if(mapping.reverse &&\n !container.every(c => ['@index', '@set'].includes(c))) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context @container value for a @reverse ' +\n 'type definition must be @index or @set.', 'jsonld.SyntaxError',\n {code: 'invalid reverse property', context: localCtx});\n }\n\n // add @container to mapping\n mapping['@container'] = container;\n }\n\n // property indexing\n if('@index' in value) {\n if(!('@container' in value) || !mapping['@container'].includes('@index')) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @index without @index in @container: ' +\n `\"${value['@index']}\" on term \"${term}\".`, 'jsonld.SyntaxError',\n {code: 'invalid term definition', context: localCtx});\n }\n if(!_isString(value['@index']) || value['@index'].indexOf('@') === 0) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @index must expand to an IRI: ' +\n `\"${value['@index']}\" on term \"${term}\".`, 'jsonld.SyntaxError',\n {code: 'invalid term definition', context: localCtx});\n }\n mapping['@index'] = value['@index'];\n }\n\n // scoped contexts\n if('@context' in value) {\n mapping['@context'] = value['@context'];\n }\n\n if('@language' in value && !('@type' in value)) {\n let language = value['@language'];\n if(language !== null && !_isString(language)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context @language value must be ' +\n 'a string or null.', 'jsonld.SyntaxError',\n {code: 'invalid language mapping', context: localCtx});\n }\n\n // add @language to mapping\n if(language !== null) {\n language = language.toLowerCase();\n }\n mapping['@language'] = language;\n }\n\n // term may be used as a prefix\n if('@prefix' in value) {\n if(term.match(/:|\\//)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context @prefix used on a compact IRI term',\n 'jsonld.SyntaxError',\n {code: 'invalid term definition', context: localCtx});\n }\n if(api.isKeyword(mapping['@id'])) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; keywords may not be used as prefixes',\n 'jsonld.SyntaxError',\n {code: 'invalid term definition', context: localCtx});\n }\n if(typeof value['@prefix'] === 'boolean') {\n mapping._prefix = value['@prefix'] === true;\n } else {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context value for @prefix must be boolean',\n 'jsonld.SyntaxError',\n {code: 'invalid @prefix value', context: localCtx});\n }\n }\n\n if('@direction' in value) {\n const direction = value['@direction'];\n if(direction !== null && direction !== 'ltr' && direction !== 'rtl') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @direction value must be ' +\n 'null, \"ltr\", or \"rtl\".',\n 'jsonld.SyntaxError',\n {code: 'invalid base direction', context: localCtx});\n }\n mapping['@direction'] = direction;\n }\n\n if('@nest' in value) {\n const nest = value['@nest'];\n if(!_isString(nest) || (nest !== '@nest' && nest.indexOf('@') === 0)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context @nest value must be ' +\n 'a string which is not a keyword other than @nest.',\n 'jsonld.SyntaxError',\n {code: 'invalid @nest value', context: localCtx});\n }\n mapping['@nest'] = nest;\n }\n\n // disallow aliasing @context and @preserve\n const id = mapping['@id'];\n if(id === '@context' || id === '@preserve') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context and @preserve cannot be aliased.',\n 'jsonld.SyntaxError', {code: 'invalid keyword alias', context: localCtx});\n }\n\n // Check for overriding protected terms\n if(previousMapping && previousMapping.protected && !overrideProtected) {\n // force new term to continue to be protected and see if the mappings would\n // be equal\n activeCtx.protected[term] = true;\n mapping.protected = true;\n if(!_deepCompare(previousMapping, mapping)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; tried to redefine a protected term.',\n 'jsonld.SyntaxError',\n {code: 'protected term redefinition', context: localCtx, term});\n }\n }\n};\n\n/**\n * Expands a string to a full IRI. The string may be a term, a prefix, a\n * relative IRI, or an absolute IRI. The associated absolute IRI will be\n * returned.\n *\n * @param activeCtx the current active context.\n * @param value the string to expand.\n * @param relativeTo options for how to resolve relative IRIs:\n * base: true to resolve against the base IRI, false not to.\n * vocab: true to concatenate after @vocab, false not to.\n * @param {Object} [options] - processing options.\n *\n * @return the expanded value.\n */\napi.expandIri = (activeCtx, value, relativeTo, options) => {\n return _expandIri(activeCtx, value, relativeTo, undefined, undefined,\n options);\n};\n\n/**\n * Expands a string to a full IRI. The string may be a term, a prefix, a\n * relative IRI, or an absolute IRI. The associated absolute IRI will be\n * returned.\n *\n * @param activeCtx the current active context.\n * @param value the string to expand.\n * @param relativeTo options for how to resolve relative IRIs:\n * base: true to resolve against the base IRI, false not to.\n * vocab: true to concatenate after @vocab, false not to.\n * @param localCtx the local context being processed (only given if called\n * during context processing).\n * @param defined a map for tracking cycles in context definitions (only given\n * if called during context processing).\n * @param {Object} [options] - processing options.\n *\n * @return the expanded value.\n */\nfunction _expandIri(activeCtx, value, relativeTo, localCtx, defined, options) {\n // already expanded\n if(value === null || !_isString(value) || api.isKeyword(value)) {\n return value;\n }\n\n // ignore non-keyword things that look like a keyword\n if(value.match(REGEX_KEYWORD)) {\n return null;\n }\n\n // define term dependency if not defined\n if(localCtx && localCtx.hasOwnProperty(value) &&\n defined.get(value) !== true) {\n api.createTermDefinition({\n activeCtx, localCtx, term: value, defined, options\n });\n }\n\n relativeTo = relativeTo || {};\n if(relativeTo.vocab) {\n const mapping = activeCtx.mappings.get(value);\n\n // value is explicitly ignored with a null mapping\n if(mapping === null) {\n return null;\n }\n\n if(_isObject(mapping) && '@id' in mapping) {\n // value is a term\n return mapping['@id'];\n }\n }\n\n // split value into prefix:suffix\n const colon = value.indexOf(':');\n if(colon > 0) {\n const prefix = value.substr(0, colon);\n const suffix = value.substr(colon + 1);\n\n // do not expand blank nodes (prefix of '_') or already-absolute\n // IRIs (suffix of '//')\n if(prefix === '_' || suffix.indexOf('//') === 0) {\n return value;\n }\n\n // prefix dependency not defined, define it\n if(localCtx && localCtx.hasOwnProperty(prefix)) {\n api.createTermDefinition({\n activeCtx, localCtx, term: prefix, defined, options\n });\n }\n\n // use mapping if prefix is defined\n const mapping = activeCtx.mappings.get(prefix);\n if(mapping && mapping._prefix) {\n return mapping['@id'] + suffix;\n }\n\n // already absolute IRI\n if(_isAbsoluteIri(value)) {\n return value;\n }\n }\n\n // A flag that captures whether the iri being expanded is\n // the value for an @type\n //let typeExpansion = false;\n\n //if(options !== undefined && options.typeExpansion !== undefined) {\n // typeExpansion = options.typeExpansion;\n //}\n\n if(relativeTo.vocab && '@vocab' in activeCtx) {\n // prepend vocab\n const prependedResult = activeCtx['@vocab'] + value;\n // FIXME: needed? may be better as debug event.\n /*\n if(options && options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'prepending @vocab during expansion',\n level: 'info',\n message: 'Prepending @vocab during expansion.',\n details: {\n type: '@vocab',\n vocab: activeCtx['@vocab'],\n value,\n result: prependedResult,\n typeExpansion\n }\n },\n options\n });\n }\n */\n // the null case preserves value as potentially relative\n value = prependedResult;\n } else if(relativeTo.base) {\n // prepend base\n let prependedResult;\n let base;\n if('@base' in activeCtx) {\n if(activeCtx['@base']) {\n base = prependBase(options.base, activeCtx['@base']);\n prependedResult = prependBase(base, value);\n } else {\n base = activeCtx['@base'];\n prependedResult = value;\n }\n } else {\n base = options.base;\n prependedResult = prependBase(options.base, value);\n }\n // FIXME: needed? may be better as debug event.\n /*\n if(options && options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'prepending @base during expansion',\n level: 'info',\n message: 'Prepending @base during expansion.',\n details: {\n type: '@base',\n base,\n value,\n result: prependedResult,\n typeExpansion\n }\n },\n options\n });\n }\n */\n // the null case preserves value as potentially relative\n value = prependedResult;\n }\n\n // FIXME: duplicate? needed? maybe just enable in a verbose debug mode\n /*\n if(!_isAbsoluteIri(value) && options && options.eventHandler) {\n // emit event indicating a relative IRI was found, which can result in it\n // being dropped when converting to other RDF representations\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'relative IRI after expansion',\n // FIXME: what level?\n level: 'warning',\n message: 'Relative IRI after expansion.',\n details: {\n relativeIri: value,\n typeExpansion\n }\n },\n options\n });\n // NOTE: relative reference events emitted at calling sites as needed\n }\n */\n\n return value;\n}\n\n/**\n * Gets the initial context.\n *\n * @param options the options to use:\n * [base] the document base IRI.\n *\n * @return the initial context.\n */\napi.getInitialContext = options => {\n const key = JSON.stringify({processingMode: options.processingMode});\n const cached = INITIAL_CONTEXT_CACHE.get(key);\n if(cached) {\n return cached;\n }\n\n const initialContext = {\n processingMode: options.processingMode,\n mappings: new Map(),\n inverse: null,\n getInverse: _createInverseContext,\n clone: _cloneActiveContext,\n revertToPreviousContext: _revertToPreviousContext,\n protected: {}\n };\n // TODO: consider using LRU cache instead\n if(INITIAL_CONTEXT_CACHE.size === INITIAL_CONTEXT_CACHE_MAX_SIZE) {\n // clear whole cache -- assumes scenario where the cache fills means\n // the cache isn't being used very efficiently anyway\n INITIAL_CONTEXT_CACHE.clear();\n }\n INITIAL_CONTEXT_CACHE.set(key, initialContext);\n return initialContext;\n\n /**\n * Generates an inverse context for use in the compaction algorithm, if\n * not already generated for the given active context.\n *\n * @return the inverse context.\n */\n function _createInverseContext() {\n const activeCtx = this;\n\n // lazily create inverse\n if(activeCtx.inverse) {\n return activeCtx.inverse;\n }\n const inverse = activeCtx.inverse = {};\n\n // variables for building fast CURIE map\n const fastCurieMap = activeCtx.fastCurieMap = {};\n const irisToTerms = {};\n\n // handle default language\n const defaultLanguage = (activeCtx['@language'] || '@none').toLowerCase();\n\n // handle default direction\n const defaultDirection = activeCtx['@direction'];\n\n // create term selections for each mapping in the context, ordered by\n // shortest and then lexicographically least\n const mappings = activeCtx.mappings;\n const terms = [...mappings.keys()].sort(_compareShortestLeast);\n for(const term of terms) {\n const mapping = mappings.get(term);\n if(mapping === null) {\n continue;\n }\n\n let container = mapping['@container'] || '@none';\n container = [].concat(container).sort().join('');\n\n if(mapping['@id'] === null) {\n continue;\n }\n // iterate over every IRI in the mapping\n const ids = _asArray(mapping['@id']);\n for(const iri of ids) {\n let entry = inverse[iri];\n const isKeyword = api.isKeyword(iri);\n\n if(!entry) {\n // initialize entry\n inverse[iri] = entry = {};\n\n if(!isKeyword && !mapping._termHasColon) {\n // init IRI to term map and fast CURIE prefixes\n irisToTerms[iri] = [term];\n const fastCurieEntry = {iri, terms: irisToTerms[iri]};\n if(iri[0] in fastCurieMap) {\n fastCurieMap[iri[0]].push(fastCurieEntry);\n } else {\n fastCurieMap[iri[0]] = [fastCurieEntry];\n }\n }\n } else if(!isKeyword && !mapping._termHasColon) {\n // add IRI to term match\n irisToTerms[iri].push(term);\n }\n\n // add new entry\n if(!entry[container]) {\n entry[container] = {\n '@language': {},\n '@type': {},\n '@any': {}\n };\n }\n entry = entry[container];\n _addPreferredTerm(term, entry['@any'], '@none');\n\n if(mapping.reverse) {\n // term is preferred for values using @reverse\n _addPreferredTerm(term, entry['@type'], '@reverse');\n } else if(mapping['@type'] === '@none') {\n _addPreferredTerm(term, entry['@any'], '@none');\n _addPreferredTerm(term, entry['@language'], '@none');\n _addPreferredTerm(term, entry['@type'], '@none');\n } else if('@type' in mapping) {\n // term is preferred for values using specific type\n _addPreferredTerm(term, entry['@type'], mapping['@type']);\n } else if('@language' in mapping && '@direction' in mapping) {\n // term is preferred for values using specific language and direction\n const language = mapping['@language'];\n const direction = mapping['@direction'];\n if(language && direction) {\n _addPreferredTerm(term, entry['@language'],\n `${language}_${direction}`.toLowerCase());\n } else if(language) {\n _addPreferredTerm(term, entry['@language'], language.toLowerCase());\n } else if(direction) {\n _addPreferredTerm(term, entry['@language'], `_${direction}`);\n } else {\n _addPreferredTerm(term, entry['@language'], '@null');\n }\n } else if('@language' in mapping) {\n _addPreferredTerm(term, entry['@language'],\n (mapping['@language'] || '@null').toLowerCase());\n } else if('@direction' in mapping) {\n if(mapping['@direction']) {\n _addPreferredTerm(term, entry['@language'],\n `_${mapping['@direction']}`);\n } else {\n _addPreferredTerm(term, entry['@language'], '@none');\n }\n } else if(defaultDirection) {\n _addPreferredTerm(term, entry['@language'], `_${defaultDirection}`);\n _addPreferredTerm(term, entry['@language'], '@none');\n _addPreferredTerm(term, entry['@type'], '@none');\n } else {\n // add entries for no type and no language\n _addPreferredTerm(term, entry['@language'], defaultLanguage);\n _addPreferredTerm(term, entry['@language'], '@none');\n _addPreferredTerm(term, entry['@type'], '@none');\n }\n }\n }\n\n // build fast CURIE map\n for(const key in fastCurieMap) {\n _buildIriMap(fastCurieMap, key, 1);\n }\n\n return inverse;\n }\n\n /**\n * Runs a recursive algorithm to build a lookup map for quickly finding\n * potential CURIEs.\n *\n * @param iriMap the map to build.\n * @param key the current key in the map to work on.\n * @param idx the index into the IRI to compare.\n */\n function _buildIriMap(iriMap, key, idx) {\n const entries = iriMap[key];\n const next = iriMap[key] = {};\n\n let iri;\n let letter;\n for(const entry of entries) {\n iri = entry.iri;\n if(idx >= iri.length) {\n letter = '';\n } else {\n letter = iri[idx];\n }\n if(letter in next) {\n next[letter].push(entry);\n } else {\n next[letter] = [entry];\n }\n }\n\n for(const key in next) {\n if(key === '') {\n continue;\n }\n _buildIriMap(next, key, idx + 1);\n }\n }\n\n /**\n * Adds the term for the given entry if not already added.\n *\n * @param term the term to add.\n * @param entry the inverse context typeOrLanguage entry to add to.\n * @param typeOrLanguageValue the key in the entry to add to.\n */\n function _addPreferredTerm(term, entry, typeOrLanguageValue) {\n if(!entry.hasOwnProperty(typeOrLanguageValue)) {\n entry[typeOrLanguageValue] = term;\n }\n }\n\n /**\n * Clones an active context, creating a child active context.\n *\n * @return a clone (child) of the active context.\n */\n function _cloneActiveContext() {\n const child = {};\n child.mappings = util.clone(this.mappings);\n child.clone = this.clone;\n child.inverse = null;\n child.getInverse = this.getInverse;\n child.protected = util.clone(this.protected);\n if(this.previousContext) {\n child.previousContext = this.previousContext.clone();\n }\n child.revertToPreviousContext = this.revertToPreviousContext;\n if('@base' in this) {\n child['@base'] = this['@base'];\n }\n if('@language' in this) {\n child['@language'] = this['@language'];\n }\n if('@vocab' in this) {\n child['@vocab'] = this['@vocab'];\n }\n return child;\n }\n\n /**\n * Reverts any type-scoped context in this active context to the previous\n * context.\n */\n function _revertToPreviousContext() {\n if(!this.previousContext) {\n return this;\n }\n return this.previousContext.clone();\n }\n};\n\n/**\n * Gets the value for the given active context key and type, null if none is\n * set or undefined if none is set and type is '@context'.\n *\n * @param ctx the active context.\n * @param key the context key.\n * @param [type] the type of value to get (eg: '@id', '@type'), if not\n * specified gets the entire entry for a key, null if not found.\n *\n * @return the value, null, or undefined.\n */\napi.getContextValue = (ctx, key, type) => {\n // invalid key\n if(key === null) {\n if(type === '@context') {\n return undefined;\n }\n return null;\n }\n\n // get specific entry information\n if(ctx.mappings.has(key)) {\n const entry = ctx.mappings.get(key);\n\n if(_isUndefined(type)) {\n // return whole entry\n return entry;\n }\n if(entry.hasOwnProperty(type)) {\n // return entry value for type\n return entry[type];\n }\n }\n\n // get default language\n if(type === '@language' && type in ctx) {\n return ctx[type];\n }\n\n // get default direction\n if(type === '@direction' && type in ctx) {\n return ctx[type];\n }\n\n if(type === '@context') {\n return undefined;\n }\n return null;\n};\n\n/**\n * Processing Mode check.\n *\n * @param activeCtx the current active context.\n * @param version the string or numeric version to check.\n *\n * @return boolean.\n */\napi.processingMode = (activeCtx, version) => {\n if(version.toString() >= '1.1') {\n return !activeCtx.processingMode ||\n activeCtx.processingMode >= 'json-ld-' + version.toString();\n } else {\n return activeCtx.processingMode === 'json-ld-1.0';\n }\n};\n\n/**\n * Returns whether or not the given value is a keyword.\n *\n * @param v the value to check.\n *\n * @return true if the value is a keyword, false if not.\n */\napi.isKeyword = v => {\n if(!_isString(v) || v[0] !== '@') {\n return false;\n }\n switch(v) {\n case '@base':\n case '@container':\n case '@context':\n case '@default':\n case '@direction':\n case '@embed':\n case '@explicit':\n case '@graph':\n case '@id':\n case '@included':\n case '@index':\n case '@json':\n case '@language':\n case '@list':\n case '@nest':\n case '@none':\n case '@omitDefault':\n case '@prefix':\n case '@preserve':\n case '@protected':\n case '@requireAll':\n case '@reverse':\n case '@set':\n case '@type':\n case '@value':\n case '@version':\n case '@vocab':\n return true;\n }\n return false;\n};\n\nfunction _deepCompare(x1, x2) {\n // compare `null` or primitive types directly\n if((!(x1 && typeof x1 === 'object')) ||\n (!(x2 && typeof x2 === 'object'))) {\n return x1 === x2;\n }\n // x1 and x2 are objects (also potentially arrays)\n const x1Array = Array.isArray(x1);\n if(x1Array !== Array.isArray(x2)) {\n return false;\n }\n if(x1Array) {\n if(x1.length !== x2.length) {\n return false;\n }\n for(let i = 0; i < x1.length; ++i) {\n if(!_deepCompare(x1[i], x2[i])) {\n return false;\n }\n }\n return true;\n }\n // x1 and x2 are non-array objects\n const k1s = Object.keys(x1);\n const k2s = Object.keys(x2);\n if(k1s.length !== k2s.length) {\n return false;\n }\n for(const k1 in x1) {\n let v1 = x1[k1];\n let v2 = x2[k1];\n // special case: `@container` can be in any order\n if(k1 === '@container') {\n if(Array.isArray(v1) && Array.isArray(v2)) {\n v1 = v1.slice().sort();\n v2 = v2.slice().sort();\n }\n }\n if(!_deepCompare(v1, v2)) {\n return false;\n }\n }\n return true;\n}\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst {parseLinkHeader, buildHeaders} = require('../util');\nconst {LINK_HEADER_CONTEXT} = require('../constants');\nconst JsonLdError = require('../JsonLdError');\nconst RequestQueue = require('../RequestQueue');\nconst {prependBase} = require('../url');\n\nconst REGEX_LINK_HEADER = /(^|(\\r\\n))link:/i;\n\n/**\n * Creates a built-in XMLHttpRequest document loader.\n *\n * @param options the options to use:\n * secure: require all URLs to use HTTPS.\n * headers: an object (map) of headers which will be passed as request\n * headers for the requested document. Accept is not allowed.\n * [xhr]: the XMLHttpRequest API to use.\n *\n * @return the XMLHttpRequest document loader.\n */\nmodule.exports = ({\n secure,\n headers = {},\n xhr\n} = {headers: {}}) => {\n headers = buildHeaders(headers);\n const queue = new RequestQueue();\n return queue.wrapLoader(loader);\n\n async function loader(url) {\n if(url.indexOf('http:') !== 0 && url.indexOf('https:') !== 0) {\n throw new JsonLdError(\n 'URL could not be dereferenced; only \"http\" and \"https\" URLs are ' +\n 'supported.',\n 'jsonld.InvalidUrl', {code: 'loading document failed', url});\n }\n if(secure && url.indexOf('https') !== 0) {\n throw new JsonLdError(\n 'URL could not be dereferenced; secure mode is enabled and ' +\n 'the URL\\'s scheme is not \"https\".',\n 'jsonld.InvalidUrl', {code: 'loading document failed', url});\n }\n\n let req;\n try {\n req = await _get(xhr, url, headers);\n } catch(e) {\n throw new JsonLdError(\n 'URL could not be dereferenced, an error occurred.',\n 'jsonld.LoadDocumentError',\n {code: 'loading document failed', url, cause: e});\n }\n\n if(req.status >= 400) {\n throw new JsonLdError(\n 'URL could not be dereferenced: ' + req.statusText,\n 'jsonld.LoadDocumentError', {\n code: 'loading document failed',\n url,\n httpStatusCode: req.status\n });\n }\n\n let doc = {contextUrl: null, documentUrl: url, document: req.response};\n let alternate = null;\n\n // handle Link Header (avoid unsafe header warning by existence testing)\n const contentType = req.getResponseHeader('Content-Type');\n let linkHeader;\n if(REGEX_LINK_HEADER.test(req.getAllResponseHeaders())) {\n linkHeader = req.getResponseHeader('Link');\n }\n if(linkHeader && contentType !== 'application/ld+json') {\n // only 1 related link header permitted\n const linkHeaders = parseLinkHeader(linkHeader);\n const linkedContext = linkHeaders[LINK_HEADER_CONTEXT];\n if(Array.isArray(linkedContext)) {\n throw new JsonLdError(\n 'URL could not be dereferenced, it has more than one ' +\n 'associated HTTP Link Header.',\n 'jsonld.InvalidUrl',\n {code: 'multiple context link headers', url});\n }\n if(linkedContext) {\n doc.contextUrl = linkedContext.target;\n }\n\n // \"alternate\" link header is a redirect\n alternate = linkHeaders.alternate;\n if(alternate &&\n alternate.type == 'application/ld+json' &&\n !(contentType || '').match(/^application\\/(\\w*\\+)?json$/)) {\n doc = await loader(prependBase(url, alternate.target));\n }\n }\n\n return doc;\n }\n};\n\nfunction _get(xhr, url, headers) {\n xhr = xhr || XMLHttpRequest;\n const req = new xhr();\n return new Promise((resolve, reject) => {\n req.onload = () => resolve(req);\n req.onerror = err => reject(err);\n req.open('GET', url, true);\n for(const k in headers) {\n req.setRequestHeader(k, headers[k]);\n }\n req.send();\n });\n}\n","/*\n * Copyright (c) 2020 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst JsonLdError = require('./JsonLdError');\n\nconst {\n isArray: _isArray\n} = require('./types');\n\nconst {\n asArray: _asArray\n} = require('./util');\n\nconst api = {};\nmodule.exports = api;\n\n// default handler, store as null or an array\n// exposed to allow fast external pre-handleEvent() checks\napi.defaultEventHandler = null;\n\n/**\n * Setup event handler.\n *\n * Return an array event handler constructed from an optional safe mode\n * handler, an optional options event handler, and an optional default handler.\n *\n * @param {object} options - processing options\n * {function|object|array} [eventHandler] - an event handler.\n *\n * @return an array event handler.\n */\napi.setupEventHandler = ({options = {}}) => {\n // build in priority order\n const eventHandler = [].concat(\n options.safe ? api.safeEventHandler : [],\n options.eventHandler ? _asArray(options.eventHandler) : [],\n api.defaultEventHandler ? api.defaultEventHandler : []\n );\n // null if no handlers\n return eventHandler.length === 0 ? null : eventHandler;\n};\n\n/**\n * Handle an event.\n *\n * Top level APIs have a common 'eventHandler' option. This option can be a\n * function, array of functions, object mapping event.code to functions (with a\n * default to call next()), or any combination of such handlers. Handlers will\n * be called with an object with an 'event' entry and a 'next' function. Custom\n * handlers should process the event as appropriate. The 'next()' function\n * should be called to let the next handler process the event.\n *\n * NOTE: Only call this function if options.eventHandler is set and is an\n * array of hanlers. This is an optimization. Callers are expected to check\n * for an event handler before constructing events and calling this function.\n *\n * @param {object} event - event structure:\n * {string} code - event code\n * {string} level - severity level, one of: ['warning']\n * {string} message - human readable message\n * {object} details - event specific details\n * @param {object} options - processing options\n * {array} eventHandler - an event handler array.\n */\napi.handleEvent = ({\n event,\n options\n}) => {\n _handle({event, handlers: options.eventHandler});\n};\n\nfunction _handle({event, handlers}) {\n let doNext = true;\n for(let i = 0; doNext && i < handlers.length; ++i) {\n doNext = false;\n const handler = handlers[i];\n if(_isArray(handler)) {\n doNext = _handle({event, handlers: handler});\n } else if(typeof handler === 'function') {\n handler({event, next: () => {\n doNext = true;\n }});\n } else if(typeof handler === 'object') {\n if(event.code in handler) {\n handler[event.code]({event, next: () => {\n doNext = true;\n }});\n } else {\n doNext = true;\n }\n } else {\n throw new JsonLdError(\n 'Invalid event handler.',\n 'jsonld.InvalidEventHandler',\n {event});\n }\n }\n return doNext;\n}\n\nconst _notSafeEventCodes = new Set([\n 'empty object',\n 'free-floating scalar',\n 'invalid @language value',\n 'invalid property',\n // NOTE: spec edge case\n 'null @id value',\n 'null @value value',\n 'object with only @id',\n 'object with only @language',\n 'object with only @list',\n 'object with only @value',\n 'relative @id reference',\n 'relative @type reference',\n 'relative @vocab reference',\n 'reserved @id value',\n 'reserved @reverse value',\n 'reserved term',\n // toRDF\n 'blank node predicate',\n 'relative graph reference',\n 'relative object reference',\n 'relative predicate reference',\n 'relative subject reference',\n // toRDF / fromRDF\n 'rdfDirection not set'\n]);\n\n// safe handler that rejects unsafe warning conditions\napi.safeEventHandler = function safeEventHandler({event, next}) {\n // fail on all unsafe warnings\n if(event.level === 'warning' && _notSafeEventCodes.has(event.code)) {\n throw new JsonLdError(\n 'Safe mode validation error.',\n 'jsonld.ValidationError',\n {event}\n );\n }\n next();\n};\n\n// logs all events and continues\napi.logEventHandler = function logEventHandler({event, next}) {\n console.log(`EVENT: ${event.message}`, {event});\n next();\n};\n\n// log 'warning' level events\napi.logWarningEventHandler = function logWarningEventHandler({event, next}) {\n if(event.level === 'warning') {\n console.warn(`WARNING: ${event.message}`, {event});\n }\n next();\n};\n\n// fallback to throw errors for any unhandled events\napi.unhandledEventHandler = function unhandledEventHandler({event}) {\n throw new JsonLdError(\n 'No handler for event.',\n 'jsonld.UnhandledEvent',\n {event}\n );\n};\n\n/**\n * Set default event handler.\n *\n * By default, all event are unhandled. It is recommended to pass in an\n * eventHandler into each call. However, this call allows using a default\n * eventHandler when one is not otherwise provided.\n *\n * @param {object} options - default handler options:\n * {function|object|array} eventHandler - a default event handler.\n * falsey to unset.\n */\napi.setDefaultEventHandler = function({eventHandler} = {}) {\n api.defaultEventHandler = eventHandler ? _asArray(eventHandler) : null;\n};\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst JsonLdError = require('./JsonLdError');\n\nconst {\n isArray: _isArray,\n isObject: _isObject,\n isEmptyObject: _isEmptyObject,\n isString: _isString,\n isUndefined: _isUndefined\n} = require('./types');\n\nconst {\n isList: _isList,\n isValue: _isValue,\n isGraph: _isGraph,\n isSubject: _isSubject\n} = require('./graphTypes');\n\nconst {\n expandIri: _expandIri,\n getContextValue: _getContextValue,\n isKeyword: _isKeyword,\n process: _processContext,\n processingMode: _processingMode\n} = require('./context');\n\nconst {\n isAbsolute: _isAbsoluteIri\n} = require('./url');\n\nconst {\n REGEX_BCP47,\n REGEX_KEYWORD,\n addValue: _addValue,\n asArray: _asArray,\n getValues: _getValues,\n validateTypeValue: _validateTypeValue\n} = require('./util');\n\nconst {\n handleEvent: _handleEvent\n} = require('./events');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Recursively expands an element using the given context. Any context in\n * the element will be removed. All context URLs must have been retrieved\n * before calling this method.\n *\n * @param activeCtx the context to use.\n * @param activeProperty the property for the element, null for none.\n * @param element the element to expand.\n * @param options the expansion options.\n * @param insideList true if the element is a list, false if not.\n * @param insideIndex true if the element is inside an index container,\n * false if not.\n * @param typeScopedContext an optional type-scoped active context for\n * expanding values of nodes that were expressed according to\n * a type-scoped context.\n *\n * @return a Promise that resolves to the expanded value.\n */\napi.expand = async ({\n activeCtx,\n activeProperty = null,\n element,\n options = {},\n insideList = false,\n insideIndex = false,\n typeScopedContext = null\n}) => {\n // nothing to expand\n if(element === null || element === undefined) {\n return null;\n }\n\n // disable framing if activeProperty is @default\n if(activeProperty === '@default') {\n options = Object.assign({}, options, {isFrame: false});\n }\n\n if(!_isArray(element) && !_isObject(element)) {\n // drop free-floating scalars that are not in lists\n if(!insideList && (activeProperty === null ||\n _expandIri(activeCtx, activeProperty, {vocab: true},\n options) === '@graph')) {\n // FIXME\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'free-floating scalar',\n level: 'warning',\n message: 'Dropping free-floating scalar not in a list.',\n details: {\n value: element\n //activeProperty\n //insideList\n }\n },\n options\n });\n }\n return null;\n }\n\n // expand element according to value expansion rules\n return _expandValue({activeCtx, activeProperty, value: element, options});\n }\n\n // recursively expand array\n if(_isArray(element)) {\n let rval = [];\n const container = _getContextValue(\n activeCtx, activeProperty, '@container') || [];\n insideList = insideList || container.includes('@list');\n for(let i = 0; i < element.length; ++i) {\n // expand element\n let e = await api.expand({\n activeCtx,\n activeProperty,\n element: element[i],\n options,\n insideIndex,\n typeScopedContext\n });\n if(insideList && _isArray(e)) {\n e = {'@list': e};\n }\n\n if(e === null) {\n // FIXME: add debug event?\n //unmappedValue: element[i],\n //activeProperty,\n //parent: element,\n //index: i,\n //expandedParent: rval,\n //insideList\n\n // NOTE: no-value events emitted at calling sites as needed\n continue;\n }\n\n if(_isArray(e)) {\n rval = rval.concat(e);\n } else {\n rval.push(e);\n }\n }\n return rval;\n }\n\n // recursively expand object:\n\n // first, expand the active property\n const expandedActiveProperty = _expandIri(\n activeCtx, activeProperty, {vocab: true}, options);\n\n // Get any property-scoped context for activeProperty\n const propertyScopedCtx =\n _getContextValue(activeCtx, activeProperty, '@context');\n\n // second, determine if any type-scoped context should be reverted; it\n // should only be reverted when the following are all true:\n // 1. `element` is not a value or subject reference\n // 2. `insideIndex` is false\n typeScopedContext = typeScopedContext ||\n (activeCtx.previousContext ? activeCtx : null);\n let keys = Object.keys(element).sort();\n let mustRevert = !insideIndex;\n if(mustRevert && typeScopedContext && keys.length <= 2 &&\n !keys.includes('@context')) {\n for(const key of keys) {\n const expandedProperty = _expandIri(\n typeScopedContext, key, {vocab: true}, options);\n if(expandedProperty === '@value') {\n // value found, ensure type-scoped context is used to expand it\n mustRevert = false;\n activeCtx = typeScopedContext;\n break;\n }\n if(expandedProperty === '@id' && keys.length === 1) {\n // subject reference found, do not revert\n mustRevert = false;\n break;\n }\n }\n }\n\n if(mustRevert) {\n // revert type scoped context\n activeCtx = activeCtx.revertToPreviousContext();\n }\n\n // apply property-scoped context after reverting term-scoped context\n if(!_isUndefined(propertyScopedCtx)) {\n activeCtx = await _processContext({\n activeCtx,\n localCtx: propertyScopedCtx,\n propagate: true,\n overrideProtected: true,\n options\n });\n }\n\n // if element has a context, process it\n if('@context' in element) {\n activeCtx = await _processContext(\n {activeCtx, localCtx: element['@context'], options});\n }\n\n // set the type-scoped context to the context on input, for use later\n typeScopedContext = activeCtx;\n\n // Remember the first key found expanding to @type\n let typeKey = null;\n\n // look for scoped contexts on `@type`\n for(const key of keys) {\n const expandedProperty = _expandIri(activeCtx, key, {vocab: true}, options);\n if(expandedProperty === '@type') {\n // set scoped contexts from @type\n // avoid sorting if possible\n typeKey = typeKey || key;\n const value = element[key];\n const types =\n Array.isArray(value) ?\n (value.length > 1 ? value.slice().sort() : value) : [value];\n for(const type of types) {\n const ctx = _getContextValue(typeScopedContext, type, '@context');\n if(!_isUndefined(ctx)) {\n activeCtx = await _processContext({\n activeCtx,\n localCtx: ctx,\n options,\n propagate: false\n });\n }\n }\n }\n }\n\n // process each key and value in element, ignoring @nest content\n let rval = {};\n await _expandObject({\n activeCtx,\n activeProperty,\n expandedActiveProperty,\n element,\n expandedParent: rval,\n options,\n insideList,\n typeKey,\n typeScopedContext\n });\n\n // get property count on expanded output\n keys = Object.keys(rval);\n let count = keys.length;\n\n if('@value' in rval) {\n // @value must only have @language or @type\n if('@type' in rval && ('@language' in rval || '@direction' in rval)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; an element containing \"@value\" may not ' +\n 'contain both \"@type\" and either \"@language\" or \"@direction\".',\n 'jsonld.SyntaxError', {code: 'invalid value object', element: rval});\n }\n let validCount = count - 1;\n if('@type' in rval) {\n validCount -= 1;\n }\n if('@index' in rval) {\n validCount -= 1;\n }\n if('@language' in rval) {\n validCount -= 1;\n }\n if('@direction' in rval) {\n validCount -= 1;\n }\n if(validCount !== 0) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; an element containing \"@value\" may only ' +\n 'have an \"@index\" property and either \"@type\" ' +\n 'or either or both \"@language\" or \"@direction\".',\n 'jsonld.SyntaxError', {code: 'invalid value object', element: rval});\n }\n const values = rval['@value'] === null ? [] : _asArray(rval['@value']);\n const types = _getValues(rval, '@type');\n\n // drop null @values\n if(_processingMode(activeCtx, 1.1) && types.includes('@json') &&\n types.length === 1) {\n // Any value of @value is okay if @type: @json\n } else if(values.length === 0) {\n // FIXME\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'null @value value',\n level: 'warning',\n message: 'Dropping null @value value.',\n details: {\n value: rval\n }\n },\n options\n });\n }\n rval = null;\n } else if(!values.every(v => (_isString(v) || _isEmptyObject(v))) &&\n '@language' in rval) {\n // if @language is present, @value must be a string\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; only strings may be language-tagged.',\n 'jsonld.SyntaxError',\n {code: 'invalid language-tagged value', element: rval});\n } else if(!types.every(t =>\n (_isAbsoluteIri(t) && !(_isString(t) && t.indexOf('_:') === 0) ||\n _isEmptyObject(t)))) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; an element containing \"@value\" and \"@type\" ' +\n 'must have an absolute IRI for the value of \"@type\".',\n 'jsonld.SyntaxError', {code: 'invalid typed value', element: rval});\n }\n } else if('@type' in rval && !_isArray(rval['@type'])) {\n // convert @type to an array\n rval['@type'] = [rval['@type']];\n } else if('@set' in rval || '@list' in rval) {\n // handle @set and @list\n if(count > 1 && !(count === 2 && '@index' in rval)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; if an element has the property \"@set\" ' +\n 'or \"@list\", then it can have at most one other property that is ' +\n '\"@index\".', 'jsonld.SyntaxError',\n {code: 'invalid set or list object', element: rval});\n }\n // optimize away @set\n if('@set' in rval) {\n rval = rval['@set'];\n keys = Object.keys(rval);\n count = keys.length;\n }\n } else if(count === 1 && '@language' in rval) {\n // drop objects with only @language\n // FIXME\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'object with only @language',\n level: 'warning',\n message: 'Dropping object with only @language.',\n details: {\n value: rval\n }\n },\n options\n });\n }\n rval = null;\n }\n\n // drop certain top-level objects that do not occur in lists\n if(_isObject(rval) &&\n !options.keepFreeFloatingNodes && !insideList &&\n (activeProperty === null ||\n expandedActiveProperty === '@graph' ||\n (_getContextValue(activeCtx, activeProperty, '@container') || [])\n .includes('@graph')\n )) {\n // drop empty object, top-level @value/@list, or object with only @id\n rval = _dropUnsafeObject({value: rval, count, options});\n }\n\n return rval;\n};\n\n/**\n * Drop empty object, top-level @value/@list, or object with only @id\n *\n * @param value Value to check.\n * @param count Number of properties in object.\n * @param options The expansion options.\n *\n * @return null if dropped, value otherwise.\n */\nfunction _dropUnsafeObject({\n value,\n count,\n options\n}) {\n if(count === 0 || '@value' in value || '@list' in value ||\n (count === 1 && '@id' in value)) {\n // FIXME\n if(options.eventHandler) {\n // FIXME: one event or diff event for empty, @v/@l, {@id}?\n let code;\n let message;\n if(count === 0) {\n code = 'empty object';\n message = 'Dropping empty object.';\n } else if('@value' in value) {\n code = 'object with only @value';\n message = 'Dropping object with only @value.';\n } else if('@list' in value) {\n code = 'object with only @list';\n message = 'Dropping object with only @list.';\n } else if(count === 1 && '@id' in value) {\n code = 'object with only @id';\n message = 'Dropping object with only @id.';\n }\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code,\n level: 'warning',\n message,\n details: {\n value\n }\n },\n options\n });\n }\n return null;\n }\n return value;\n}\n\n/**\n * Expand each key and value of element adding to result\n *\n * @param activeCtx the context to use.\n * @param activeProperty the property for the element.\n * @param expandedActiveProperty the expansion of activeProperty\n * @param element the element to expand.\n * @param expandedParent the expanded result into which to add values.\n * @param options the expansion options.\n * @param insideList true if the element is a list, false if not.\n * @param typeKey first key found expanding to @type.\n * @param typeScopedContext the context before reverting.\n */\nasync function _expandObject({\n activeCtx,\n activeProperty,\n expandedActiveProperty,\n element,\n expandedParent,\n options = {},\n insideList,\n typeKey,\n typeScopedContext\n}) {\n const keys = Object.keys(element).sort();\n const nests = [];\n let unexpandedValue;\n\n // Figure out if this is the type for a JSON literal\n const isJsonType = element[typeKey] &&\n _expandIri(activeCtx,\n (_isArray(element[typeKey]) ? element[typeKey][0] : element[typeKey]),\n {vocab: true}, {\n ...options,\n typeExpansion: true\n }) === '@json';\n\n for(const key of keys) {\n let value = element[key];\n let expandedValue;\n\n // skip @context\n if(key === '@context') {\n continue;\n }\n\n // expand property\n const expandedProperty = _expandIri(activeCtx, key, {vocab: true}, options);\n\n // drop non-absolute IRI keys that aren't keywords\n if(expandedProperty === null ||\n !(_isAbsoluteIri(expandedProperty) || _isKeyword(expandedProperty))) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'invalid property',\n level: 'warning',\n message: 'Dropping property that did not expand into an ' +\n 'absolute IRI or keyword.',\n details: {\n property: key,\n expandedProperty\n }\n },\n options\n });\n }\n continue;\n }\n\n if(_isKeyword(expandedProperty)) {\n if(expandedActiveProperty === '@reverse') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a keyword cannot be used as a @reverse ' +\n 'property.', 'jsonld.SyntaxError',\n {code: 'invalid reverse property map', value});\n }\n if(expandedProperty in expandedParent &&\n expandedProperty !== '@included' &&\n expandedProperty !== '@type') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; colliding keywords detected.',\n 'jsonld.SyntaxError',\n {code: 'colliding keywords', keyword: expandedProperty});\n }\n }\n\n // syntax error if @id is not a string\n if(expandedProperty === '@id') {\n if(!_isString(value)) {\n if(!options.isFrame) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@id\" value must a string.',\n 'jsonld.SyntaxError', {code: 'invalid @id value', value});\n }\n if(_isObject(value)) {\n // empty object is a wildcard\n if(!_isEmptyObject(value)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@id\" value an empty object or array ' +\n 'of strings, if framing',\n 'jsonld.SyntaxError', {code: 'invalid @id value', value});\n }\n } else if(_isArray(value)) {\n if(!value.every(v => _isString(v))) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@id\" value an empty object or array ' +\n 'of strings, if framing',\n 'jsonld.SyntaxError', {code: 'invalid @id value', value});\n }\n } else {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@id\" value an empty object or array ' +\n 'of strings, if framing',\n 'jsonld.SyntaxError', {code: 'invalid @id value', value});\n }\n }\n\n _addValue(\n expandedParent, '@id',\n _asArray(value).map(v => {\n if(_isString(v)) {\n const ve = _expandIri(activeCtx, v, {base: true}, options);\n if(options.eventHandler) {\n if(ve === null) {\n // NOTE: spec edge case\n // See https://github.com/w3c/json-ld-api/issues/480\n if(v === null) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'null @id value',\n level: 'warning',\n message: 'Null @id found.',\n details: {\n id: v\n }\n },\n options\n });\n } else {\n // matched KEYWORD regex\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'reserved @id value',\n level: 'warning',\n message: 'Reserved @id found.',\n details: {\n id: v\n }\n },\n options\n });\n }\n } else if(!_isAbsoluteIri(ve)) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'relative @id reference',\n level: 'warning',\n message: 'Relative @id reference found.',\n details: {\n id: v,\n expandedId: ve\n }\n },\n options\n });\n }\n }\n return ve;\n }\n return v;\n }),\n {propertyIsArray: options.isFrame});\n continue;\n }\n\n if(expandedProperty === '@type') {\n // if framing, can be a default object, but need to expand\n // key to determine that\n if(_isObject(value)) {\n value = Object.fromEntries(Object.entries(value).map(([k, v]) => [\n _expandIri(typeScopedContext, k, {vocab: true}),\n _asArray(v).map(vv =>\n _expandIri(typeScopedContext, vv, {base: true, vocab: true},\n {...options, typeExpansion: true})\n )\n ]));\n }\n _validateTypeValue(value, options.isFrame);\n _addValue(\n expandedParent, '@type',\n _asArray(value).map(v => {\n if(_isString(v)) {\n const ve = _expandIri(typeScopedContext, v,\n {base: true, vocab: true},\n {...options, typeExpansion: true});\n if(ve !== '@json' && !_isAbsoluteIri(ve)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'relative @type reference',\n level: 'warning',\n message: 'Relative @type reference found.',\n details: {\n type: v\n }\n },\n options\n });\n }\n }\n return ve;\n }\n return v;\n }),\n {propertyIsArray: !!options.isFrame});\n continue;\n }\n\n // Included blocks are treated as an array of separate object nodes sharing\n // the same referencing active_property.\n // For 1.0, it is skipped as are other unknown keywords\n if(expandedProperty === '@included' && _processingMode(activeCtx, 1.1)) {\n const includedResult = _asArray(await api.expand({\n activeCtx,\n activeProperty,\n element: value,\n options\n }));\n\n // Expanded values must be node objects\n if(!includedResult.every(v => _isSubject(v))) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; ' +\n 'values of @included must expand to node objects.',\n 'jsonld.SyntaxError', {code: 'invalid @included value', value});\n }\n\n _addValue(\n expandedParent, '@included', includedResult, {propertyIsArray: true});\n continue;\n }\n\n // @graph must be an array or an object\n if(expandedProperty === '@graph' &&\n !(_isObject(value) || _isArray(value))) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@graph\" value must not be an ' +\n 'object or an array.',\n 'jsonld.SyntaxError', {code: 'invalid @graph value', value});\n }\n\n if(expandedProperty === '@value') {\n // capture value for later\n // \"colliding keywords\" check prevents this from being set twice\n unexpandedValue = value;\n if(isJsonType && _processingMode(activeCtx, 1.1)) {\n // no coercion to array, and retain all values\n expandedParent['@value'] = value;\n } else {\n _addValue(\n expandedParent, '@value', value, {propertyIsArray: options.isFrame});\n }\n continue;\n }\n\n // @language must be a string\n // it should match BCP47\n if(expandedProperty === '@language') {\n if(value === null) {\n // drop null @language values, they expand as if they didn't exist\n continue;\n }\n if(!_isString(value) && !options.isFrame) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@language\" value must be a string.',\n 'jsonld.SyntaxError',\n {code: 'invalid language-tagged string', value});\n }\n // ensure language value is lowercase\n value = _asArray(value).map(v => _isString(v) ? v.toLowerCase() : v);\n\n // ensure language tag matches BCP47\n for(const language of value) {\n if(_isString(language) && !language.match(REGEX_BCP47)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'invalid @language value',\n level: 'warning',\n message: '@language value must be valid BCP47.',\n details: {\n language\n }\n },\n options\n });\n }\n }\n }\n\n _addValue(\n expandedParent, '@language', value, {propertyIsArray: options.isFrame});\n continue;\n }\n\n // @direction must be \"ltr\" or \"rtl\"\n if(expandedProperty === '@direction') {\n if(!_isString(value) && !options.isFrame) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@direction\" value must be a string.',\n 'jsonld.SyntaxError',\n {code: 'invalid base direction', value});\n }\n\n value = _asArray(value);\n\n // ensure direction is \"ltr\" or \"rtl\"\n for(const dir of value) {\n if(_isString(dir) && dir !== 'ltr' && dir !== 'rtl') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@direction\" must be \"ltr\" or \"rtl\".',\n 'jsonld.SyntaxError',\n {code: 'invalid base direction', value});\n }\n }\n\n _addValue(\n expandedParent, '@direction', value,\n {propertyIsArray: options.isFrame});\n continue;\n }\n\n // @index must be a string\n if(expandedProperty === '@index') {\n if(!_isString(value)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@index\" value must be a string.',\n 'jsonld.SyntaxError',\n {code: 'invalid @index value', value});\n }\n _addValue(expandedParent, '@index', value);\n continue;\n }\n\n // @reverse must be an object\n if(expandedProperty === '@reverse') {\n if(!_isObject(value)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@reverse\" value must be an object.',\n 'jsonld.SyntaxError', {code: 'invalid @reverse value', value});\n }\n\n expandedValue = await api.expand({\n activeCtx,\n activeProperty: '@reverse',\n element: value,\n options\n });\n // properties double-reversed\n if('@reverse' in expandedValue) {\n for(const property in expandedValue['@reverse']) {\n _addValue(\n expandedParent, property, expandedValue['@reverse'][property],\n {propertyIsArray: true});\n }\n }\n\n // FIXME: can this be merged with code below to simplify?\n // merge in all reversed properties\n let reverseMap = expandedParent['@reverse'] || null;\n for(const property in expandedValue) {\n if(property === '@reverse') {\n continue;\n }\n if(reverseMap === null) {\n reverseMap = expandedParent['@reverse'] = {};\n }\n _addValue(reverseMap, property, [], {propertyIsArray: true});\n const items = expandedValue[property];\n for(let ii = 0; ii < items.length; ++ii) {\n const item = items[ii];\n if(_isValue(item) || _isList(item)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@reverse\" value must not be a ' +\n '@value or an @list.', 'jsonld.SyntaxError',\n {code: 'invalid reverse property value', value: expandedValue});\n }\n _addValue(reverseMap, property, item, {propertyIsArray: true});\n }\n }\n\n continue;\n }\n\n // nested keys\n if(expandedProperty === '@nest') {\n nests.push(key);\n continue;\n }\n\n // use potential scoped context for key\n let termCtx = activeCtx;\n const ctx = _getContextValue(activeCtx, key, '@context');\n if(!_isUndefined(ctx)) {\n termCtx = await _processContext({\n activeCtx,\n localCtx: ctx,\n propagate: true,\n overrideProtected: true,\n options\n });\n }\n\n const container = _getContextValue(activeCtx, key, '@container') || [];\n\n if(container.includes('@language') && _isObject(value)) {\n const direction = _getContextValue(termCtx, key, '@direction');\n // handle language map container (skip if value is not an object)\n expandedValue = _expandLanguageMap(termCtx, value, direction, options);\n } else if(container.includes('@index') && _isObject(value)) {\n // handle index container (skip if value is not an object)\n const asGraph = container.includes('@graph');\n const indexKey = _getContextValue(termCtx, key, '@index') || '@index';\n const propertyIndex = indexKey !== '@index' &&\n _expandIri(activeCtx, indexKey, {vocab: true}, options);\n\n expandedValue = await _expandIndexMap({\n activeCtx: termCtx,\n options,\n activeProperty: key,\n value,\n asGraph,\n indexKey,\n propertyIndex\n });\n } else if(container.includes('@id') && _isObject(value)) {\n // handle id container (skip if value is not an object)\n const asGraph = container.includes('@graph');\n expandedValue = await _expandIndexMap({\n activeCtx: termCtx,\n options,\n activeProperty: key,\n value,\n asGraph,\n indexKey: '@id'\n });\n } else if(container.includes('@type') && _isObject(value)) {\n // handle type container (skip if value is not an object)\n expandedValue = await _expandIndexMap({\n // since container is `@type`, revert type scoped context when expanding\n activeCtx: termCtx.revertToPreviousContext(),\n options,\n activeProperty: key,\n value,\n asGraph: false,\n indexKey: '@type'\n });\n } else {\n // recurse into @list or @set\n const isList = expandedProperty === '@list';\n if(isList || expandedProperty === '@set') {\n let nextActiveProperty = activeProperty;\n if(isList && expandedActiveProperty === '@graph') {\n nextActiveProperty = null;\n }\n expandedValue = await api.expand({\n activeCtx: termCtx,\n activeProperty: nextActiveProperty,\n element: value,\n options,\n insideList: isList\n });\n } else if(\n _getContextValue(activeCtx, key, '@type') === '@json') {\n expandedValue = {\n '@type': '@json',\n '@value': value\n };\n } else {\n // recursively expand value with key as new active property\n expandedValue = await api.expand({\n activeCtx: termCtx,\n activeProperty: key,\n element: value,\n options,\n insideList: false\n });\n }\n }\n\n // drop null values if property is not @value\n if(expandedValue === null && expandedProperty !== '@value') {\n // FIXME: event?\n //unmappedValue: value,\n //expandedProperty,\n //key,\n continue;\n }\n\n // convert expanded value to @list if container specifies it\n if(expandedProperty !== '@list' && !_isList(expandedValue) &&\n container.includes('@list')) {\n // ensure expanded value in @list is an array\n expandedValue = {'@list': _asArray(expandedValue)};\n }\n\n // convert expanded value to @graph if container specifies it\n // and value is not, itself, a graph\n // index cases handled above\n if(container.includes('@graph') &&\n !container.some(key => key === '@id' || key === '@index')) {\n // ensure expanded values are in an array\n expandedValue = _asArray(expandedValue);\n if(!options.isFrame) {\n // drop items if needed\n expandedValue = expandedValue.filter(v => {\n const count = Object.keys(v).length;\n return _dropUnsafeObject({value: v, count, options}) !== null;\n });\n }\n if(expandedValue.length === 0) {\n // all items dropped, skip adding and continue\n continue;\n }\n // convert to graph\n expandedValue = expandedValue.map(v => ({'@graph': _asArray(v)}));\n }\n\n // FIXME: can this be merged with code above to simplify?\n // merge in reverse properties\n if(termCtx.mappings.has(key) && termCtx.mappings.get(key).reverse) {\n const reverseMap =\n expandedParent['@reverse'] = expandedParent['@reverse'] || {};\n expandedValue = _asArray(expandedValue);\n for(let ii = 0; ii < expandedValue.length; ++ii) {\n const item = expandedValue[ii];\n if(_isValue(item) || _isList(item)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@reverse\" value must not be a ' +\n '@value or an @list.', 'jsonld.SyntaxError',\n {code: 'invalid reverse property value', value: expandedValue});\n }\n _addValue(reverseMap, expandedProperty, item, {propertyIsArray: true});\n }\n continue;\n }\n\n // add value for property\n // special keywords handled above\n _addValue(expandedParent, expandedProperty, expandedValue, {\n propertyIsArray: true\n });\n }\n\n // @value must not be an object or an array (unless framing) or if @type is\n // @json\n if('@value' in expandedParent) {\n if(expandedParent['@type'] === '@json' && _processingMode(activeCtx, 1.1)) {\n // allow any value, to be verified when the object is fully expanded and\n // the @type is @json.\n } else if((_isObject(unexpandedValue) || _isArray(unexpandedValue)) &&\n !options.isFrame) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@value\" value must not be an ' +\n 'object or an array.',\n 'jsonld.SyntaxError',\n {code: 'invalid value object value', value: unexpandedValue});\n }\n }\n\n // expand each nested key\n for(const key of nests) {\n const nestedValues = _isArray(element[key]) ? element[key] : [element[key]];\n for(const nv of nestedValues) {\n if(!_isObject(nv) || Object.keys(nv).some(k =>\n _expandIri(activeCtx, k, {vocab: true}, options) === '@value')) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; nested value must be a node object.',\n 'jsonld.SyntaxError',\n {code: 'invalid @nest value', value: nv});\n }\n await _expandObject({\n activeCtx,\n activeProperty,\n expandedActiveProperty,\n element: nv,\n expandedParent,\n options,\n insideList,\n typeScopedContext,\n typeKey\n });\n }\n }\n}\n\n/**\n * Expands the given value by using the coercion and keyword rules in the\n * given context.\n *\n * @param activeCtx the active context to use.\n * @param activeProperty the active property the value is associated with.\n * @param value the value to expand.\n * @param {Object} [options] - processing options.\n *\n * @return the expanded value.\n */\nfunction _expandValue({activeCtx, activeProperty, value, options}) {\n // nothing to expand\n if(value === null || value === undefined) {\n return null;\n }\n\n // special-case expand @id and @type (skips '@id' expansion)\n const expandedProperty = _expandIri(\n activeCtx, activeProperty, {vocab: true}, options);\n if(expandedProperty === '@id') {\n return _expandIri(activeCtx, value, {base: true}, options);\n } else if(expandedProperty === '@type') {\n return _expandIri(activeCtx, value, {vocab: true, base: true},\n {...options, typeExpansion: true});\n }\n\n // get type definition from context\n const type = _getContextValue(activeCtx, activeProperty, '@type');\n\n // do @id expansion (automatic for @graph)\n if((type === '@id' || expandedProperty === '@graph') && _isString(value)) {\n const expandedValue = _expandIri(activeCtx, value, {base: true}, options);\n // NOTE: handle spec edge case and avoid invalid {\"@id\": null}\n if(expandedValue === null && value.match(REGEX_KEYWORD)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'reserved @id value',\n level: 'warning',\n message: 'Reserved @id found.',\n details: {\n id: activeProperty\n }\n },\n options\n });\n }\n }\n return {'@id': expandedValue};\n }\n // do @id expansion w/vocab\n if(type === '@vocab' && _isString(value)) {\n return {\n '@id': _expandIri(activeCtx, value, {vocab: true, base: true}, options)\n };\n }\n\n // do not expand keyword values\n if(_isKeyword(expandedProperty)) {\n return value;\n }\n\n const rval = {};\n\n if(type && !['@id', '@vocab', '@none'].includes(type)) {\n // other type\n rval['@type'] = type;\n } else if(_isString(value)) {\n // check for language tagging for strings\n const language = _getContextValue(activeCtx, activeProperty, '@language');\n if(language !== null) {\n rval['@language'] = language;\n }\n const direction = _getContextValue(activeCtx, activeProperty, '@direction');\n if(direction !== null) {\n rval['@direction'] = direction;\n }\n }\n // do conversion of values that aren't basic JSON types to strings\n if(!['boolean', 'number', 'string'].includes(typeof value)) {\n value = value.toString();\n }\n rval['@value'] = value;\n\n return rval;\n}\n\n/**\n * Expands a language map.\n *\n * @param activeCtx the active context to use.\n * @param languageMap the language map to expand.\n * @param direction the direction to apply to values.\n * @param {Object} [options] - processing options.\n *\n * @return the expanded language map.\n */\nfunction _expandLanguageMap(activeCtx, languageMap, direction, options) {\n const rval = [];\n const keys = Object.keys(languageMap).sort();\n for(const key of keys) {\n const expandedKey = _expandIri(activeCtx, key, {vocab: true}, options);\n let val = languageMap[key];\n if(!_isArray(val)) {\n val = [val];\n }\n for(const item of val) {\n if(item === null) {\n // null values are allowed (8.5) but ignored (3.1)\n continue;\n }\n if(!_isString(item)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; language map values must be strings.',\n 'jsonld.SyntaxError',\n {code: 'invalid language map value', languageMap});\n }\n const val = {'@value': item};\n if(expandedKey !== '@none') {\n if(!key.match(REGEX_BCP47)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'invalid @language value',\n level: 'warning',\n message: '@language value must be valid BCP47.',\n details: {\n language: key\n }\n },\n options\n });\n }\n }\n val['@language'] = key.toLowerCase();\n }\n if(direction) {\n val['@direction'] = direction;\n }\n rval.push(val);\n }\n }\n return rval;\n}\n\nasync function _expandIndexMap({\n activeCtx, options, activeProperty, value, asGraph, indexKey, propertyIndex\n}) {\n const rval = [];\n const keys = Object.keys(value).sort();\n const isTypeIndex = indexKey === '@type';\n for(let key of keys) {\n // if indexKey is @type, there may be a context defined for it\n if(isTypeIndex) {\n const ctx = _getContextValue(activeCtx, key, '@context');\n if(!_isUndefined(ctx)) {\n activeCtx = await _processContext({\n activeCtx,\n localCtx: ctx,\n propagate: false,\n options\n });\n }\n }\n\n let val = value[key];\n if(!_isArray(val)) {\n val = [val];\n }\n\n val = await api.expand({\n activeCtx,\n activeProperty,\n element: val,\n options,\n insideList: false,\n insideIndex: true\n });\n\n // expand for @type, but also for @none\n let expandedKey;\n if(propertyIndex) {\n if(key === '@none') {\n expandedKey = '@none';\n } else {\n expandedKey = _expandValue(\n {activeCtx, activeProperty: indexKey, value: key, options});\n }\n } else {\n expandedKey = _expandIri(activeCtx, key, {vocab: true}, options);\n }\n\n if(indexKey === '@id') {\n // expand document relative\n key = _expandIri(activeCtx, key, {base: true}, options);\n } else if(isTypeIndex) {\n key = expandedKey;\n }\n\n for(let item of val) {\n // If this is also a @graph container, turn items into graphs\n if(asGraph && !_isGraph(item)) {\n item = {'@graph': [item]};\n }\n if(indexKey === '@type') {\n if(expandedKey === '@none') {\n // ignore @none\n } else if(item['@type']) {\n item['@type'] = [key].concat(item['@type']);\n } else {\n item['@type'] = [key];\n }\n } else if(_isValue(item) &&\n !['@language', '@type', '@index'].includes(indexKey)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; Attempt to add illegal key to value ' +\n `object: \"${indexKey}\".`,\n 'jsonld.SyntaxError',\n {code: 'invalid value object', value: item});\n } else if(propertyIndex) {\n // index is a property to be expanded, and values interpreted for that\n // property\n if(expandedKey !== '@none') {\n // expand key as a value\n _addValue(item, propertyIndex, expandedKey, {\n propertyIsArray: true,\n prependValue: true\n });\n }\n } else if(expandedKey !== '@none' && !(indexKey in item)) {\n item[indexKey] = key;\n }\n rval.push(item);\n }\n }\n return rval;\n}\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst {\n isSubjectReference: _isSubjectReference\n} = require('./graphTypes');\n\nconst {\n createMergedNodeMap: _createMergedNodeMap\n} = require('./nodeMap');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Performs JSON-LD flattening.\n *\n * @param input the expanded JSON-LD to flatten.\n *\n * @return the flattened output.\n */\napi.flatten = input => {\n const defaultGraph = _createMergedNodeMap(input);\n\n // produce flattened output\n const flattened = [];\n const keys = Object.keys(defaultGraph).sort();\n for(let ki = 0; ki < keys.length; ++ki) {\n const node = defaultGraph[keys[ki]];\n // only add full subjects to top-level\n if(!_isSubjectReference(node)) {\n flattened.push(node);\n }\n }\n return flattened;\n};\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst {isKeyword} = require('./context');\nconst graphTypes = require('./graphTypes');\nconst types = require('./types');\nconst util = require('./util');\nconst url = require('./url');\nconst JsonLdError = require('./JsonLdError');\nconst {\n createNodeMap: _createNodeMap,\n mergeNodeMapGraphs: _mergeNodeMapGraphs\n} = require('./nodeMap');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Performs JSON-LD `merged` framing.\n *\n * @param input the expanded JSON-LD to frame.\n * @param frame the expanded JSON-LD frame to use.\n * @param options the framing options.\n *\n * @return the framed output.\n */\napi.frameMergedOrDefault = (input, frame, options) => {\n // create framing state\n const state = {\n options,\n embedded: false,\n graph: '@default',\n graphMap: {'@default': {}},\n subjectStack: [],\n link: {},\n bnodeMap: {}\n };\n\n // produce a map of all graphs and name each bnode\n // FIXME: currently uses subjects from @merged graph only\n const issuer = new util.IdentifierIssuer('_:b');\n _createNodeMap(input, state.graphMap, '@default', issuer);\n if(options.merged) {\n state.graphMap['@merged'] = _mergeNodeMapGraphs(state.graphMap);\n state.graph = '@merged';\n }\n state.subjects = state.graphMap[state.graph];\n\n // frame the subjects\n const framed = [];\n api.frame(state, Object.keys(state.subjects).sort(), frame, framed);\n\n // If pruning blank nodes, find those to prune\n if(options.pruneBlankNodeIdentifiers) {\n // remove all blank nodes appearing only once, done in compaction\n options.bnodesToClear =\n Object.keys(state.bnodeMap).filter(id => state.bnodeMap[id].length === 1);\n }\n\n // remove @preserve from results\n options.link = {};\n return _cleanupPreserve(framed, options);\n};\n\n/**\n * Frames subjects according to the given frame.\n *\n * @param state the current framing state.\n * @param subjects the subjects to filter.\n * @param frame the frame.\n * @param parent the parent subject or top-level array.\n * @param property the parent property, initialized to null.\n */\napi.frame = (state, subjects, frame, parent, property = null) => {\n // validate the frame\n _validateFrame(frame);\n frame = frame[0];\n\n // get flags for current frame\n const options = state.options;\n const flags = {\n embed: _getFrameFlag(frame, options, 'embed'),\n explicit: _getFrameFlag(frame, options, 'explicit'),\n requireAll: _getFrameFlag(frame, options, 'requireAll')\n };\n\n // get link for current graph\n if(!state.link.hasOwnProperty(state.graph)) {\n state.link[state.graph] = {};\n }\n const link = state.link[state.graph];\n\n // filter out subjects that match the frame\n const matches = _filterSubjects(state, subjects, frame, flags);\n\n // add matches to output\n const ids = Object.keys(matches).sort();\n for(const id of ids) {\n const subject = matches[id];\n\n /* Note: In order to treat each top-level match as a compartmentalized\n result, clear the unique embedded subjects map when the property is null,\n which only occurs at the top-level. */\n if(property === null) {\n state.uniqueEmbeds = {[state.graph]: {}};\n } else {\n state.uniqueEmbeds[state.graph] = state.uniqueEmbeds[state.graph] || {};\n }\n\n if(flags.embed === '@link' && id in link) {\n // TODO: may want to also match an existing linked subject against\n // the current frame ... so different frames could produce different\n // subjects that are only shared in-memory when the frames are the same\n\n // add existing linked subject\n _addFrameOutput(parent, property, link[id]);\n continue;\n }\n\n // start output for subject\n const output = {'@id': id};\n if(id.indexOf('_:') === 0) {\n util.addValue(state.bnodeMap, id, output, {propertyIsArray: true});\n }\n link[id] = output;\n\n // validate @embed\n if((flags.embed === '@first' || flags.embed === '@last') && state.is11) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; invalid value of @embed.',\n 'jsonld.SyntaxError', {code: 'invalid @embed value', frame});\n }\n\n if(!state.embedded && state.uniqueEmbeds[state.graph].hasOwnProperty(id)) {\n // skip adding this node object to the top level, as it was\n // already included in another node object\n continue;\n }\n\n // if embed is @never or if a circular reference would be created by an\n // embed, the subject cannot be embedded, just add the reference;\n // note that a circular reference won't occur when the embed flag is\n // `@link` as the above check will short-circuit before reaching this point\n if(state.embedded &&\n (flags.embed === '@never' ||\n _createsCircularReference(subject, state.graph, state.subjectStack))) {\n _addFrameOutput(parent, property, output);\n continue;\n }\n\n // if only the first (or once) should be embedded\n if(state.embedded &&\n (flags.embed == '@first' || flags.embed == '@once') &&\n state.uniqueEmbeds[state.graph].hasOwnProperty(id)) {\n _addFrameOutput(parent, property, output);\n continue;\n }\n\n // if only the last match should be embedded\n if(flags.embed === '@last') {\n // remove any existing embed\n if(id in state.uniqueEmbeds[state.graph]) {\n _removeEmbed(state, id);\n }\n }\n\n state.uniqueEmbeds[state.graph][id] = {parent, property};\n\n // push matching subject onto stack to enable circular embed checks\n state.subjectStack.push({subject, graph: state.graph});\n\n // subject is also the name of a graph\n if(id in state.graphMap) {\n let recurse = false;\n let subframe = null;\n if(!('@graph' in frame)) {\n recurse = state.graph !== '@merged';\n subframe = {};\n } else {\n subframe = frame['@graph'][0];\n recurse = !(id === '@merged' || id === '@default');\n if(!types.isObject(subframe)) {\n subframe = {};\n }\n }\n\n if(recurse) {\n // recurse into graph\n api.frame(\n {...state, graph: id, embedded: false},\n Object.keys(state.graphMap[id]).sort(), [subframe], output, '@graph');\n }\n }\n\n // if frame has @included, recurse over its sub-frame\n if('@included' in frame) {\n api.frame(\n {...state, embedded: false},\n subjects, frame['@included'], output, '@included');\n }\n\n // iterate over subject properties\n for(const prop of Object.keys(subject).sort()) {\n // copy keywords to output\n if(isKeyword(prop)) {\n output[prop] = util.clone(subject[prop]);\n\n if(prop === '@type') {\n // count bnode values of @type\n for(const type of subject['@type']) {\n if(type.indexOf('_:') === 0) {\n util.addValue(\n state.bnodeMap, type, output, {propertyIsArray: true});\n }\n }\n }\n continue;\n }\n\n // explicit is on and property isn't in the frame, skip processing\n if(flags.explicit && !(prop in frame)) {\n continue;\n }\n\n // add objects\n for(const o of subject[prop]) {\n const subframe = (prop in frame ?\n frame[prop] : _createImplicitFrame(flags));\n\n // recurse into list\n if(graphTypes.isList(o)) {\n const subframe =\n (frame[prop] && frame[prop][0] && frame[prop][0]['@list']) ?\n frame[prop][0]['@list'] :\n _createImplicitFrame(flags);\n\n // add empty list\n const list = {'@list': []};\n _addFrameOutput(output, prop, list);\n\n // add list objects\n const src = o['@list'];\n for(const oo of src) {\n if(graphTypes.isSubjectReference(oo)) {\n // recurse into subject reference\n api.frame(\n {...state, embedded: true},\n [oo['@id']], subframe, list, '@list');\n } else {\n // include other values automatically\n _addFrameOutput(list, '@list', util.clone(oo));\n }\n }\n } else if(graphTypes.isSubjectReference(o)) {\n // recurse into subject reference\n api.frame(\n {...state, embedded: true},\n [o['@id']], subframe, output, prop);\n } else if(_valueMatch(subframe[0], o)) {\n // include other values, if they match\n _addFrameOutput(output, prop, util.clone(o));\n }\n }\n }\n\n // handle defaults\n for(const prop of Object.keys(frame).sort()) {\n // skip keywords\n if(prop === '@type') {\n if(!types.isObject(frame[prop][0]) ||\n !('@default' in frame[prop][0])) {\n continue;\n }\n // allow through default types\n } else if(isKeyword(prop)) {\n continue;\n }\n\n // if omit default is off, then include default values for properties\n // that appear in the next frame but are not in the matching subject\n const next = frame[prop][0] || {};\n const omitDefaultOn = _getFrameFlag(next, options, 'omitDefault');\n if(!omitDefaultOn && !(prop in output)) {\n let preserve = '@null';\n if('@default' in next) {\n preserve = util.clone(next['@default']);\n }\n if(!types.isArray(preserve)) {\n preserve = [preserve];\n }\n output[prop] = [{'@preserve': preserve}];\n }\n }\n\n // if embed reverse values by finding nodes having this subject as a value\n // of the associated property\n for(const reverseProp of Object.keys(frame['@reverse'] || {}).sort()) {\n const subframe = frame['@reverse'][reverseProp];\n for(const subject of Object.keys(state.subjects)) {\n const nodeValues =\n util.getValues(state.subjects[subject], reverseProp);\n if(nodeValues.some(v => v['@id'] === id)) {\n // node has property referencing this subject, recurse\n output['@reverse'] = output['@reverse'] || {};\n util.addValue(\n output['@reverse'], reverseProp, [], {propertyIsArray: true});\n api.frame(\n {...state, embedded: true},\n [subject], subframe, output['@reverse'][reverseProp],\n property);\n }\n }\n }\n\n // add output to parent\n _addFrameOutput(parent, property, output);\n\n // pop matching subject from circular ref-checking stack\n state.subjectStack.pop();\n }\n};\n\n/**\n * Replace `@null` with `null`, removing it from arrays.\n *\n * @param input the framed, compacted output.\n * @param options the framing options used.\n *\n * @return the resulting output.\n */\napi.cleanupNull = (input, options) => {\n // recurse through arrays\n if(types.isArray(input)) {\n const noNulls = input.map(v => api.cleanupNull(v, options));\n return noNulls.filter(v => v); // removes nulls from array\n }\n\n if(input === '@null') {\n return null;\n }\n\n if(types.isObject(input)) {\n // handle in-memory linked nodes\n if('@id' in input) {\n const id = input['@id'];\n if(options.link.hasOwnProperty(id)) {\n const idx = options.link[id].indexOf(input);\n if(idx !== -1) {\n // already visited\n return options.link[id][idx];\n }\n // prevent circular visitation\n options.link[id].push(input);\n } else {\n // prevent circular visitation\n options.link[id] = [input];\n }\n }\n\n for(const key in input) {\n input[key] = api.cleanupNull(input[key], options);\n }\n }\n return input;\n};\n\n/**\n * Creates an implicit frame when recursing through subject matches. If\n * a frame doesn't have an explicit frame for a particular property, then\n * a wildcard child frame will be created that uses the same flags that the\n * parent frame used.\n *\n * @param flags the current framing flags.\n *\n * @return the implicit frame.\n */\nfunction _createImplicitFrame(flags) {\n const frame = {};\n for(const key in flags) {\n if(flags[key] !== undefined) {\n frame['@' + key] = [flags[key]];\n }\n }\n return [frame];\n}\n\n/**\n * Checks the current subject stack to see if embedding the given subject\n * would cause a circular reference.\n *\n * @param subjectToEmbed the subject to embed.\n * @param graph the graph the subject to embed is in.\n * @param subjectStack the current stack of subjects.\n *\n * @return true if a circular reference would be created, false if not.\n */\nfunction _createsCircularReference(subjectToEmbed, graph, subjectStack) {\n for(let i = subjectStack.length - 1; i >= 0; --i) {\n const subject = subjectStack[i];\n if(subject.graph === graph &&\n subject.subject['@id'] === subjectToEmbed['@id']) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Gets the frame flag value for the given flag name.\n *\n * @param frame the frame.\n * @param options the framing options.\n * @param name the flag name.\n *\n * @return the flag value.\n */\nfunction _getFrameFlag(frame, options, name) {\n const flag = '@' + name;\n let rval = (flag in frame ? frame[flag][0] : options[name]);\n if(name === 'embed') {\n // default is \"@last\"\n // backwards-compatibility support for \"embed\" maps:\n // true => \"@last\"\n // false => \"@never\"\n if(rval === true) {\n rval = '@once';\n } else if(rval === false) {\n rval = '@never';\n } else if(rval !== '@always' && rval !== '@never' && rval !== '@link' &&\n rval !== '@first' && rval !== '@last' && rval !== '@once') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; invalid value of @embed.',\n 'jsonld.SyntaxError', {code: 'invalid @embed value', frame});\n }\n }\n return rval;\n}\n\n/**\n * Validates a JSON-LD frame, throwing an exception if the frame is invalid.\n *\n * @param frame the frame to validate.\n */\nfunction _validateFrame(frame) {\n if(!types.isArray(frame) || frame.length !== 1 || !types.isObject(frame[0])) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a JSON-LD frame must be a single object.',\n 'jsonld.SyntaxError', {frame});\n }\n\n if('@id' in frame[0]) {\n for(const id of util.asArray(frame[0]['@id'])) {\n // @id must be wildcard or an IRI\n if(!(types.isObject(id) || url.isAbsolute(id)) ||\n (types.isString(id) && id.indexOf('_:') === 0)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; invalid @id in frame.',\n 'jsonld.SyntaxError', {code: 'invalid frame', frame});\n }\n }\n }\n\n if('@type' in frame[0]) {\n for(const type of util.asArray(frame[0]['@type'])) {\n // @type must be wildcard, IRI, or @json\n if(!(types.isObject(type) || url.isAbsolute(type) ||\n (type === '@json')) ||\n (types.isString(type) && type.indexOf('_:') === 0)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; invalid @type in frame.',\n 'jsonld.SyntaxError', {code: 'invalid frame', frame});\n }\n }\n }\n}\n\n/**\n * Returns a map of all of the subjects that match a parsed frame.\n *\n * @param state the current framing state.\n * @param subjects the set of subjects to filter.\n * @param frame the parsed frame.\n * @param flags the frame flags.\n *\n * @return all of the matched subjects.\n */\nfunction _filterSubjects(state, subjects, frame, flags) {\n // filter subjects in @id order\n const rval = {};\n for(const id of subjects) {\n const subject = state.graphMap[state.graph][id];\n if(_filterSubject(state, subject, frame, flags)) {\n rval[id] = subject;\n }\n }\n return rval;\n}\n\n/**\n * Returns true if the given subject matches the given frame.\n *\n * Matches either based on explicit type inclusion where the node has any\n * type listed in the frame. If the frame has empty types defined matches\n * nodes not having a @type. If the frame has a type of {} defined matches\n * nodes having any type defined.\n *\n * Otherwise, does duck typing, where the node must have all of the\n * properties defined in the frame.\n *\n * @param state the current framing state.\n * @param subject the subject to check.\n * @param frame the frame to check.\n * @param flags the frame flags.\n *\n * @return true if the subject matches, false if not.\n */\nfunction _filterSubject(state, subject, frame, flags) {\n // check ducktype\n let wildcard = true;\n let matchesSome = false;\n\n for(const key in frame) {\n let matchThis = false;\n const nodeValues = util.getValues(subject, key);\n const isEmpty = util.getValues(frame, key).length === 0;\n\n if(key === '@id') {\n // match on no @id or any matching @id, including wildcard\n if(types.isEmptyObject(frame['@id'][0] || {})) {\n matchThis = true;\n } else if(frame['@id'].length >= 0) {\n matchThis = frame['@id'].includes(nodeValues[0]);\n }\n if(!flags.requireAll) {\n return matchThis;\n }\n } else if(key === '@type') {\n // check @type (object value means 'any' type,\n // fall through to ducktyping)\n wildcard = false;\n if(isEmpty) {\n if(nodeValues.length > 0) {\n // don't match on no @type\n return false;\n }\n matchThis = true;\n } else if(frame['@type'].length === 1 &&\n types.isEmptyObject(frame['@type'][0])) {\n // match on wildcard @type if there is a type\n matchThis = nodeValues.length > 0;\n } else {\n // match on a specific @type\n for(const type of frame['@type']) {\n if(types.isObject(type) && '@default' in type) {\n // match on default object\n matchThis = true;\n } else {\n matchThis = matchThis || nodeValues.some(tt => tt === type);\n }\n }\n }\n if(!flags.requireAll) {\n return matchThis;\n }\n } else if(isKeyword(key)) {\n continue;\n } else {\n // Force a copy of this frame entry so it can be manipulated\n const thisFrame = util.getValues(frame, key)[0];\n let hasDefault = false;\n if(thisFrame) {\n _validateFrame([thisFrame]);\n hasDefault = '@default' in thisFrame;\n }\n\n // no longer a wildcard pattern if frame has any non-keyword properties\n wildcard = false;\n\n // skip, but allow match if node has no value for property, and frame has\n // a default value\n if(nodeValues.length === 0 && hasDefault) {\n continue;\n }\n\n // if frame value is empty, don't match if subject has any value\n if(nodeValues.length > 0 && isEmpty) {\n return false;\n }\n\n if(thisFrame === undefined) {\n // node does not match if values is not empty and the value of property\n // in frame is match none.\n if(nodeValues.length > 0) {\n return false;\n }\n matchThis = true;\n } else {\n if(graphTypes.isList(thisFrame)) {\n const listValue = thisFrame['@list'][0];\n if(graphTypes.isList(nodeValues[0])) {\n const nodeListValues = nodeValues[0]['@list'];\n\n if(graphTypes.isValue(listValue)) {\n // match on any matching value\n matchThis = nodeListValues.some(lv => _valueMatch(listValue, lv));\n } else if(graphTypes.isSubject(listValue) ||\n graphTypes.isSubjectReference(listValue)) {\n matchThis = nodeListValues.some(lv => _nodeMatch(\n state, listValue, lv, flags));\n }\n }\n } else if(graphTypes.isValue(thisFrame)) {\n matchThis = nodeValues.some(nv => _valueMatch(thisFrame, nv));\n } else if(graphTypes.isSubjectReference(thisFrame)) {\n matchThis =\n nodeValues.some(nv => _nodeMatch(state, thisFrame, nv, flags));\n } else if(types.isObject(thisFrame)) {\n matchThis = nodeValues.length > 0;\n } else {\n matchThis = false;\n }\n }\n }\n\n // all non-defaulted values must match if requireAll is set\n if(!matchThis && flags.requireAll) {\n return false;\n }\n\n matchesSome = matchesSome || matchThis;\n }\n\n // return true if wildcard or subject matches some properties\n return wildcard || matchesSome;\n}\n\n/**\n * Removes an existing embed.\n *\n * @param state the current framing state.\n * @param id the @id of the embed to remove.\n */\nfunction _removeEmbed(state, id) {\n // get existing embed\n const embeds = state.uniqueEmbeds[state.graph];\n const embed = embeds[id];\n const parent = embed.parent;\n const property = embed.property;\n\n // create reference to replace embed\n const subject = {'@id': id};\n\n // remove existing embed\n if(types.isArray(parent)) {\n // replace subject with reference\n for(let i = 0; i < parent.length; ++i) {\n if(util.compareValues(parent[i], subject)) {\n parent[i] = subject;\n break;\n }\n }\n } else {\n // replace subject with reference\n const useArray = types.isArray(parent[property]);\n util.removeValue(parent, property, subject, {propertyIsArray: useArray});\n util.addValue(parent, property, subject, {propertyIsArray: useArray});\n }\n\n // recursively remove dependent dangling embeds\n const removeDependents = id => {\n // get embed keys as a separate array to enable deleting keys in map\n const ids = Object.keys(embeds);\n for(const next of ids) {\n if(next in embeds && types.isObject(embeds[next].parent) &&\n embeds[next].parent['@id'] === id) {\n delete embeds[next];\n removeDependents(next);\n }\n }\n };\n removeDependents(id);\n}\n\n/**\n * Removes the @preserve keywords from expanded result of framing.\n *\n * @param input the framed, framed output.\n * @param options the framing options used.\n *\n * @return the resulting output.\n */\nfunction _cleanupPreserve(input, options) {\n // recurse through arrays\n if(types.isArray(input)) {\n return input.map(value => _cleanupPreserve(value, options));\n }\n\n if(types.isObject(input)) {\n // remove @preserve\n if('@preserve' in input) {\n return input['@preserve'][0];\n }\n\n // skip @values\n if(graphTypes.isValue(input)) {\n return input;\n }\n\n // recurse through @lists\n if(graphTypes.isList(input)) {\n input['@list'] = _cleanupPreserve(input['@list'], options);\n return input;\n }\n\n // handle in-memory linked nodes\n if('@id' in input) {\n const id = input['@id'];\n if(options.link.hasOwnProperty(id)) {\n const idx = options.link[id].indexOf(input);\n if(idx !== -1) {\n // already visited\n return options.link[id][idx];\n }\n // prevent circular visitation\n options.link[id].push(input);\n } else {\n // prevent circular visitation\n options.link[id] = [input];\n }\n }\n\n // recurse through properties\n for(const prop in input) {\n // potentially remove the id, if it is an unreference bnode\n if(prop === '@id' && options.bnodesToClear.includes(input[prop])) {\n delete input['@id'];\n continue;\n }\n\n input[prop] = _cleanupPreserve(input[prop], options);\n }\n }\n return input;\n}\n\n/**\n * Adds framing output to the given parent.\n *\n * @param parent the parent to add to.\n * @param property the parent property.\n * @param output the output to add.\n */\nfunction _addFrameOutput(parent, property, output) {\n if(types.isObject(parent)) {\n util.addValue(parent, property, output, {propertyIsArray: true});\n } else {\n parent.push(output);\n }\n}\n\n/**\n * Node matches if it is a node, and matches the pattern as a frame.\n *\n * @param state the current framing state.\n * @param pattern used to match value\n * @param value to check\n * @param flags the frame flags.\n */\nfunction _nodeMatch(state, pattern, value, flags) {\n if(!('@id' in value)) {\n return false;\n }\n const nodeObject = state.subjects[value['@id']];\n return nodeObject && _filterSubject(state, nodeObject, pattern, flags);\n}\n\n/**\n * Value matches if it is a value and matches the value pattern\n *\n * * `pattern` is empty\n * * @values are the same, or `pattern[@value]` is a wildcard, and\n * * @types are the same or `value[@type]` is not null\n * and `pattern[@type]` is `{}`, or `value[@type]` is null\n * and `pattern[@type]` is null or `[]`, and\n * * @languages are the same or `value[@language]` is not null\n * and `pattern[@language]` is `{}`, or `value[@language]` is null\n * and `pattern[@language]` is null or `[]`.\n *\n * @param pattern used to match value\n * @param value to check\n */\nfunction _valueMatch(pattern, value) {\n const v1 = value['@value'];\n const t1 = value['@type'];\n const l1 = value['@language'];\n const v2 = pattern['@value'] ?\n (types.isArray(pattern['@value']) ?\n pattern['@value'] : [pattern['@value']]) :\n [];\n const t2 = pattern['@type'] ?\n (types.isArray(pattern['@type']) ?\n pattern['@type'] : [pattern['@type']]) :\n [];\n const l2 = pattern['@language'] ?\n (types.isArray(pattern['@language']) ?\n pattern['@language'] : [pattern['@language']]) :\n [];\n\n if(v2.length === 0 && t2.length === 0 && l2.length === 0) {\n return true;\n }\n if(!(v2.includes(v1) || types.isEmptyObject(v2[0]))) {\n return false;\n }\n if(!(!t1 && t2.length === 0 || t2.includes(t1) || t1 &&\n types.isEmptyObject(t2[0]))) {\n return false;\n }\n if(!(!l1 && l2.length === 0 || l2.includes(l1) || l1 &&\n types.isEmptyObject(l2[0]))) {\n return false;\n }\n return true;\n}\n","/*\n * Copyright (c) 2017-2023 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst JsonLdError = require('./JsonLdError');\nconst graphTypes = require('./graphTypes');\nconst types = require('./types');\n\nconst {\n REGEX_BCP47,\n addValue: _addValue\n} = require('./util');\n\nconst {\n handleEvent: _handleEvent\n} = require('./events');\n\n// constants\nconst {\n // RDF,\n RDF_LIST,\n RDF_FIRST,\n RDF_REST,\n RDF_NIL,\n RDF_TYPE,\n // RDF_PLAIN_LITERAL,\n // RDF_XML_LITERAL,\n RDF_JSON_LITERAL,\n // RDF_OBJECT,\n // RDF_LANGSTRING,\n\n // XSD,\n XSD_BOOLEAN,\n XSD_DOUBLE,\n XSD_INTEGER,\n XSD_STRING,\n} = require('./constants');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Converts an RDF dataset to JSON-LD.\n *\n * @param dataset the RDF dataset.\n * @param options the RDF serialization options.\n *\n * @return a Promise that resolves to the JSON-LD output.\n */\napi.fromRDF = async (\n dataset,\n options\n) => {\n const {\n useRdfType = false,\n useNativeTypes = false,\n rdfDirection = null\n } = options;\n // FIXME: use Maps?\n const defaultGraph = {};\n const graphMap = {'@default': defaultGraph};\n const referencedOnce = {};\n if(rdfDirection) {\n if(rdfDirection === 'compound-literal') {\n throw new JsonLdError(\n 'Unsupported rdfDirection value.',\n 'jsonld.InvalidRdfDirection',\n {value: rdfDirection});\n } else if(rdfDirection !== 'i18n-datatype') {\n throw new JsonLdError(\n 'Unknown rdfDirection value.',\n 'jsonld.InvalidRdfDirection',\n {value: rdfDirection});\n }\n }\n\n for(const quad of dataset) {\n // TODO: change 'name' to 'graph'\n const name = (quad.graph.termType === 'DefaultGraph') ?\n '@default' : quad.graph.value;\n if(!(name in graphMap)) {\n graphMap[name] = {};\n }\n if(name !== '@default' && !(name in defaultGraph)) {\n defaultGraph[name] = {'@id': name};\n }\n\n const nodeMap = graphMap[name];\n\n // get subject, predicate, object\n const s = quad.subject.value;\n const p = quad.predicate.value;\n const o = quad.object;\n\n if(!(s in nodeMap)) {\n nodeMap[s] = {'@id': s};\n }\n const node = nodeMap[s];\n\n const objectIsNode = o.termType.endsWith('Node');\n if(objectIsNode && !(o.value in nodeMap)) {\n nodeMap[o.value] = {'@id': o.value};\n }\n\n if(p === RDF_TYPE && !useRdfType && objectIsNode) {\n _addValue(node, '@type', o.value, {propertyIsArray: true});\n continue;\n }\n\n const value = _RDFToObject(o, useNativeTypes, rdfDirection, options);\n _addValue(node, p, value, {propertyIsArray: true});\n\n // object may be an RDF list/partial list node but we can't know easily\n // until all triples are read\n if(objectIsNode) {\n if(o.value === RDF_NIL) {\n // track rdf:nil uniquely per graph\n const object = nodeMap[o.value];\n if(!('usages' in object)) {\n object.usages = [];\n }\n object.usages.push({\n node,\n property: p,\n value\n });\n } else if(o.value in referencedOnce) {\n // object referenced more than once\n referencedOnce[o.value] = false;\n } else {\n // keep track of single reference\n referencedOnce[o.value] = {\n node,\n property: p,\n value\n };\n }\n }\n }\n\n /*\n for(let name in dataset) {\n const graph = dataset[name];\n if(!(name in graphMap)) {\n graphMap[name] = {};\n }\n if(name !== '@default' && !(name in defaultGraph)) {\n defaultGraph[name] = {'@id': name};\n }\n const nodeMap = graphMap[name];\n for(let ti = 0; ti < graph.length; ++ti) {\n const triple = graph[ti];\n\n // get subject, predicate, object\n const s = triple.subject.value;\n const p = triple.predicate.value;\n const o = triple.object;\n\n if(!(s in nodeMap)) {\n nodeMap[s] = {'@id': s};\n }\n const node = nodeMap[s];\n\n const objectIsId = (o.type === 'IRI' || o.type === 'blank node');\n if(objectIsId && !(o.value in nodeMap)) {\n nodeMap[o.value] = {'@id': o.value};\n }\n\n if(p === RDF_TYPE && !useRdfType && objectIsId) {\n _addValue(node, '@type', o.value, {propertyIsArray: true});\n continue;\n }\n\n const value = _RDFToObject(o, useNativeTypes);\n _addValue(node, p, value, {propertyIsArray: true});\n\n // object may be an RDF list/partial list node but we can't know easily\n // until all triples are read\n if(objectIsId) {\n if(o.value === RDF_NIL) {\n // track rdf:nil uniquely per graph\n const object = nodeMap[o.value];\n if(!('usages' in object)) {\n object.usages = [];\n }\n object.usages.push({\n node: node,\n property: p,\n value: value\n });\n } else if(o.value in referencedOnce) {\n // object referenced more than once\n referencedOnce[o.value] = false;\n } else {\n // keep track of single reference\n referencedOnce[o.value] = {\n node: node,\n property: p,\n value: value\n };\n }\n }\n }\n }*/\n\n // convert linked lists to @list arrays\n for(const name in graphMap) {\n const graphObject = graphMap[name];\n\n // no @lists to be converted, continue\n if(!(RDF_NIL in graphObject)) {\n continue;\n }\n\n // iterate backwards through each RDF list\n const nil = graphObject[RDF_NIL];\n if(!nil.usages) {\n continue;\n }\n for(let usage of nil.usages) {\n let node = usage.node;\n let property = usage.property;\n let head = usage.value;\n const list = [];\n const listNodes = [];\n\n // ensure node is a well-formed list node; it must:\n // 1. Be referenced only once.\n // 2. Have an array for rdf:first that has 1 item.\n // 3. Have an array for rdf:rest that has 1 item.\n // 4. Have no keys other than: @id, rdf:first, rdf:rest, and,\n // optionally, @type where the value is rdf:List.\n let nodeKeyCount = Object.keys(node).length;\n while(property === RDF_REST &&\n types.isObject(referencedOnce[node['@id']]) &&\n types.isArray(node[RDF_FIRST]) && node[RDF_FIRST].length === 1 &&\n types.isArray(node[RDF_REST]) && node[RDF_REST].length === 1 &&\n (nodeKeyCount === 3 ||\n (nodeKeyCount === 4 && types.isArray(node['@type']) &&\n node['@type'].length === 1 && node['@type'][0] === RDF_LIST))) {\n list.push(node[RDF_FIRST][0]);\n listNodes.push(node['@id']);\n\n // get next node, moving backwards through list\n usage = referencedOnce[node['@id']];\n node = usage.node;\n property = usage.property;\n head = usage.value;\n nodeKeyCount = Object.keys(node).length;\n\n // if node is not a blank node, then list head found\n if(!graphTypes.isBlankNode(node)) {\n break;\n }\n }\n\n // transform list into @list object\n delete head['@id'];\n head['@list'] = list.reverse();\n for(const listNode of listNodes) {\n delete graphObject[listNode];\n }\n }\n\n delete nil.usages;\n }\n\n const result = [];\n const subjects = Object.keys(defaultGraph).sort();\n for(const subject of subjects) {\n const node = defaultGraph[subject];\n if(subject in graphMap) {\n const graph = node['@graph'] = [];\n const graphObject = graphMap[subject];\n const graphSubjects = Object.keys(graphObject).sort();\n for(const graphSubject of graphSubjects) {\n const node = graphObject[graphSubject];\n // only add full subjects to top-level\n if(!graphTypes.isSubjectReference(node)) {\n graph.push(node);\n }\n }\n }\n // only add full subjects to top-level\n if(!graphTypes.isSubjectReference(node)) {\n result.push(node);\n }\n }\n\n return result;\n};\n\n/**\n * Converts an RDF triple object to a JSON-LD object.\n *\n * @param o the RDF triple object to convert.\n * @param useNativeTypes true to output native types, false not to.\n * @param rdfDirection text direction mode [null, i18n-datatype]\n * @param options top level API options\n *\n * @return the JSON-LD object.\n */\nfunction _RDFToObject(o, useNativeTypes, rdfDirection, options) {\n // convert NamedNode/BlankNode object to JSON-LD\n if(o.termType.endsWith('Node')) {\n return {'@id': o.value};\n }\n\n // convert literal to JSON-LD\n const rval = {'@value': o.value};\n\n // add language\n if(o.language) {\n if(!o.language.match(REGEX_BCP47)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'invalid @language value',\n level: 'warning',\n message: '@language value must be valid BCP47.',\n details: {\n language: o.language\n }\n },\n options\n });\n }\n }\n rval['@language'] = o.language;\n } else {\n let type = o.datatype.value;\n if(!type) {\n type = XSD_STRING;\n }\n if(type === RDF_JSON_LITERAL) {\n type = '@json';\n try {\n rval['@value'] = JSON.parse(rval['@value']);\n } catch(e) {\n throw new JsonLdError(\n 'JSON literal could not be parsed.',\n 'jsonld.InvalidJsonLiteral',\n {code: 'invalid JSON literal', value: rval['@value'], cause: e});\n }\n }\n // use native types for certain xsd types\n if(useNativeTypes) {\n if(type === XSD_BOOLEAN) {\n if(rval['@value'] === 'true') {\n rval['@value'] = true;\n } else if(rval['@value'] === 'false') {\n rval['@value'] = false;\n }\n } else if(types.isNumeric(rval['@value'])) {\n if(type === XSD_INTEGER) {\n const i = parseInt(rval['@value'], 10);\n if(i.toFixed(0) === rval['@value']) {\n rval['@value'] = i;\n }\n } else if(type === XSD_DOUBLE) {\n rval['@value'] = parseFloat(rval['@value']);\n }\n }\n // do not add native type\n if(![XSD_BOOLEAN, XSD_INTEGER, XSD_DOUBLE, XSD_STRING].includes(type)) {\n rval['@type'] = type;\n }\n } else if(rdfDirection === 'i18n-datatype' &&\n type.startsWith('https://www.w3.org/ns/i18n#')) {\n const [, language, direction] = type.split(/[#_]/);\n if(language.length > 0) {\n rval['@language'] = language;\n if(!language.match(REGEX_BCP47)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'invalid @language value',\n level: 'warning',\n message: '@language value must be valid BCP47.',\n details: {\n language\n }\n },\n options\n });\n }\n }\n }\n rval['@direction'] = direction;\n } else if(type !== XSD_STRING) {\n rval['@type'] = type;\n }\n }\n\n return rval;\n}\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst types = require('./types');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Returns true if the given value is a subject with properties.\n *\n * @param v the value to check.\n *\n * @return true if the value is a subject with properties, false if not.\n */\napi.isSubject = v => {\n // Note: A value is a subject if all of these hold true:\n // 1. It is an Object.\n // 2. It is not a @value, @set, or @list.\n // 3. It has more than 1 key OR any existing key is not @id.\n if(types.isObject(v) &&\n !(('@value' in v) || ('@set' in v) || ('@list' in v))) {\n const keyCount = Object.keys(v).length;\n return (keyCount > 1 || !('@id' in v));\n }\n return false;\n};\n\n/**\n * Returns true if the given value is a subject reference.\n *\n * @param v the value to check.\n *\n * @return true if the value is a subject reference, false if not.\n */\napi.isSubjectReference = v =>\n // Note: A value is a subject reference if all of these hold true:\n // 1. It is an Object.\n // 2. It has a single key: @id.\n (types.isObject(v) && Object.keys(v).length === 1 && ('@id' in v));\n\n/**\n * Returns true if the given value is a @value.\n *\n * @param v the value to check.\n *\n * @return true if the value is a @value, false if not.\n */\napi.isValue = v =>\n // Note: A value is a @value if all of these hold true:\n // 1. It is an Object.\n // 2. It has the @value property.\n types.isObject(v) && ('@value' in v);\n\n/**\n * Returns true if the given value is a @list.\n *\n * @param v the value to check.\n *\n * @return true if the value is a @list, false if not.\n */\napi.isList = v =>\n // Note: A value is a @list if all of these hold true:\n // 1. It is an Object.\n // 2. It has the @list property.\n types.isObject(v) && ('@list' in v);\n\n/**\n * Returns true if the given value is a @graph.\n *\n * @return true if the value is a @graph, false if not.\n */\napi.isGraph = v => {\n // Note: A value is a graph if all of these hold true:\n // 1. It is an object.\n // 2. It has an `@graph` key.\n // 3. It may have '@id' or '@index'\n return types.isObject(v) &&\n '@graph' in v &&\n Object.keys(v)\n .filter(key => key !== '@id' && key !== '@index').length === 1;\n};\n\n/**\n * Returns true if the given value is a simple @graph.\n *\n * @return true if the value is a simple @graph, false if not.\n */\napi.isSimpleGraph = v => {\n // Note: A value is a simple graph if all of these hold true:\n // 1. It is an object.\n // 2. It has an `@graph` key.\n // 3. It has only 1 key or 2 keys where one of them is `@index`.\n return api.isGraph(v) && !('@id' in v);\n};\n\n/**\n * Returns true if the given value is a blank node.\n *\n * @param v the value to check.\n *\n * @return true if the value is a blank node, false if not.\n */\napi.isBlankNode = v => {\n // Note: A value is a blank node if all of these hold true:\n // 1. It is an Object.\n // 2. If it has an @id key that is not a string OR begins with '_:'.\n // 3. It has no keys OR is not a @value, @set, or @list.\n if(types.isObject(v)) {\n if('@id' in v) {\n const id = v['@id'];\n return !types.isString(id) || id.indexOf('_:') === 0;\n }\n return (Object.keys(v).length === 0 ||\n !(('@value' in v) || ('@set' in v) || ('@list' in v)));\n }\n return false;\n};\n","/**\n * A JavaScript implementation of the JSON-LD API.\n *\n * @author Dave Longley\n *\n * @license BSD 3-Clause License\n * Copyright (c) 2011-2022 Digital Bazaar, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * Neither the name of the Digital Bazaar, Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n * IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\n * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nconst canonize = require('rdf-canonize');\nconst platform = require('./platform');\nconst util = require('./util');\nconst ContextResolver = require('./ContextResolver');\nconst IdentifierIssuer = util.IdentifierIssuer;\nconst JsonLdError = require('./JsonLdError');\nconst LRU = require('lru-cache');\nconst NQuads = require('./NQuads');\n\nconst {expand: _expand} = require('./expand');\nconst {flatten: _flatten} = require('./flatten');\nconst {fromRDF: _fromRDF} = require('./fromRdf');\nconst {toRDF: _toRDF} = require('./toRdf');\n\nconst {\n frameMergedOrDefault: _frameMergedOrDefault,\n cleanupNull: _cleanupNull\n} = require('./frame');\n\nconst {\n isArray: _isArray,\n isObject: _isObject,\n isString: _isString\n} = require('./types');\n\nconst {\n isSubjectReference: _isSubjectReference,\n} = require('./graphTypes');\n\nconst {\n expandIri: _expandIri,\n getInitialContext: _getInitialContext,\n process: _processContext,\n processingMode: _processingMode\n} = require('./context');\n\nconst {\n compact: _compact,\n compactIri: _compactIri\n} = require('./compact');\n\nconst {\n createNodeMap: _createNodeMap,\n createMergedNodeMap: _createMergedNodeMap,\n mergeNodeMaps: _mergeNodeMaps\n} = require('./nodeMap');\n\nconst {\n logEventHandler: _logEventHandler,\n logWarningEventHandler: _logWarningEventHandler,\n safeEventHandler: _safeEventHandler,\n setDefaultEventHandler: _setDefaultEventHandler,\n setupEventHandler: _setupEventHandler,\n strictEventHandler: _strictEventHandler,\n unhandledEventHandler: _unhandledEventHandler\n} = require('./events');\n\n/* eslint-disable indent */\n// attaches jsonld API to the given object\nconst wrapper = function(jsonld) {\n\n/** Registered RDF dataset parsers hashed by content-type. */\nconst _rdfParsers = {};\n\n// resolved context cache\n// TODO: consider basing max on context size rather than number\nconst RESOLVED_CONTEXT_CACHE_MAX_SIZE = 100;\nconst _resolvedContextCache = new LRU({max: RESOLVED_CONTEXT_CACHE_MAX_SIZE});\n\n/* Core API */\n\n/**\n * Performs JSON-LD compaction.\n *\n * @param input the JSON-LD input to compact.\n * @param ctx the context to compact with.\n * @param [options] options to use:\n * [base] the base IRI to use.\n * [compactArrays] true to compact arrays to single values when\n * appropriate, false not to (default: true).\n * [compactToRelative] true to compact IRIs to be relative to document\n * base, false to keep absolute (default: true)\n * [graph] true to always output a top-level graph (default: false).\n * [expandContext] a context to expand with.\n * [skipExpansion] true to assume the input is expanded and skip\n * expansion, false not to, defaults to false. Some well-formed\n * and safe-mode checks may be omitted.\n * [documentLoader(url, options)] the document loader.\n * [framing] true if compaction is occuring during a framing operation.\n * [safe] true to use safe mode. (default: false)\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the compacted output.\n */\njsonld.compact = async function(input, ctx, options) {\n if(arguments.length < 2) {\n throw new TypeError('Could not compact, too few arguments.');\n }\n\n if(ctx === null) {\n throw new JsonLdError(\n 'The compaction context must not be null.',\n 'jsonld.CompactError', {code: 'invalid local context'});\n }\n\n // nothing to compact\n if(input === null) {\n return null;\n }\n\n // set default options\n options = _setDefaults(options, {\n base: _isString(input) ? input : '',\n compactArrays: true,\n compactToRelative: true,\n graph: false,\n skipExpansion: false,\n link: false,\n issuer: new IdentifierIssuer('_:b'),\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n if(options.link) {\n // force skip expansion when linking, \"link\" is not part of the public\n // API, it should only be called from framing\n options.skipExpansion = true;\n }\n if(!options.compactToRelative) {\n delete options.base;\n }\n\n // expand input\n let expanded;\n if(options.skipExpansion) {\n expanded = input;\n } else {\n expanded = await jsonld.expand(input, options);\n }\n\n // process context\n const activeCtx = await jsonld.processContext(\n _getInitialContext(options), ctx, options);\n\n // do compaction\n let compacted = await _compact({\n activeCtx,\n element: expanded,\n options\n });\n\n // perform clean up\n if(options.compactArrays && !options.graph && _isArray(compacted)) {\n if(compacted.length === 1) {\n // simplify to a single item\n compacted = compacted[0];\n } else if(compacted.length === 0) {\n // simplify to an empty object\n compacted = {};\n }\n } else if(options.graph && _isObject(compacted)) {\n // always use array if graph option is on\n compacted = [compacted];\n }\n\n // follow @context key\n if(_isObject(ctx) && '@context' in ctx) {\n ctx = ctx['@context'];\n }\n\n // build output context\n ctx = util.clone(ctx);\n if(!_isArray(ctx)) {\n ctx = [ctx];\n }\n // remove empty contexts\n const tmp = ctx;\n ctx = [];\n for(let i = 0; i < tmp.length; ++i) {\n if(!_isObject(tmp[i]) || Object.keys(tmp[i]).length > 0) {\n ctx.push(tmp[i]);\n }\n }\n\n // remove array if only one context\n const hasContext = (ctx.length > 0);\n if(ctx.length === 1) {\n ctx = ctx[0];\n }\n\n // add context and/or @graph\n if(_isArray(compacted)) {\n // use '@graph' keyword\n const graphAlias = _compactIri({\n activeCtx, iri: '@graph', relativeTo: {vocab: true}\n });\n const graph = compacted;\n compacted = {};\n if(hasContext) {\n compacted['@context'] = ctx;\n }\n compacted[graphAlias] = graph;\n } else if(_isObject(compacted) && hasContext) {\n // reorder keys so @context is first\n const graph = compacted;\n compacted = {'@context': ctx};\n for(const key in graph) {\n compacted[key] = graph[key];\n }\n }\n\n return compacted;\n};\n\n/**\n * Performs JSON-LD expansion.\n *\n * @param input the JSON-LD input to expand.\n * @param [options] the options to use:\n * [base] the base IRI to use.\n * [expandContext] a context to expand with.\n * [keepFreeFloatingNodes] true to keep free-floating nodes,\n * false not to, defaults to false.\n * [documentLoader(url, options)] the document loader.\n * [safe] true to use safe mode. (default: false)\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the expanded output.\n */\njsonld.expand = async function(input, options) {\n if(arguments.length < 1) {\n throw new TypeError('Could not expand, too few arguments.');\n }\n\n // set default options\n options = _setDefaults(options, {\n keepFreeFloatingNodes: false,\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n\n // build set of objects that may have @contexts to resolve\n const toResolve = {};\n\n // build set of contexts to process prior to expansion\n const contextsToProcess = [];\n\n // if an `expandContext` has been given ensure it gets resolved\n if('expandContext' in options) {\n const expandContext = util.clone(options.expandContext);\n if(_isObject(expandContext) && '@context' in expandContext) {\n toResolve.expandContext = expandContext;\n } else {\n toResolve.expandContext = {'@context': expandContext};\n }\n contextsToProcess.push(toResolve.expandContext);\n }\n\n // if input is a string, attempt to dereference remote document\n let defaultBase;\n if(!_isString(input)) {\n // input is not a URL, do not need to retrieve it first\n toResolve.input = util.clone(input);\n } else {\n // load remote doc\n const remoteDoc = await jsonld.get(input, options);\n defaultBase = remoteDoc.documentUrl;\n toResolve.input = remoteDoc.document;\n if(remoteDoc.contextUrl) {\n // context included in HTTP link header and must be resolved\n toResolve.remoteContext = {'@context': remoteDoc.contextUrl};\n contextsToProcess.push(toResolve.remoteContext);\n }\n }\n\n // set default base\n if(!('base' in options)) {\n options.base = defaultBase || '';\n }\n\n // process any additional contexts\n let activeCtx = _getInitialContext(options);\n for(const localCtx of contextsToProcess) {\n activeCtx = await _processContext({activeCtx, localCtx, options});\n }\n\n // expand resolved input\n let expanded = await _expand({\n activeCtx,\n element: toResolve.input,\n options\n });\n\n // optimize away @graph with no other properties\n if(_isObject(expanded) && ('@graph' in expanded) &&\n Object.keys(expanded).length === 1) {\n expanded = expanded['@graph'];\n } else if(expanded === null) {\n expanded = [];\n }\n\n // normalize to an array\n if(!_isArray(expanded)) {\n expanded = [expanded];\n }\n\n return expanded;\n};\n\n/**\n * Performs JSON-LD flattening.\n *\n * @param input the JSON-LD to flatten.\n * @param ctx the context to use to compact the flattened output, or null.\n * @param [options] the options to use:\n * [base] the base IRI to use.\n * [expandContext] a context to expand with.\n * [documentLoader(url, options)] the document loader.\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the flattened output.\n */\njsonld.flatten = async function(input, ctx, options) {\n if(arguments.length < 1) {\n return new TypeError('Could not flatten, too few arguments.');\n }\n\n if(typeof ctx === 'function') {\n ctx = null;\n } else {\n ctx = ctx || null;\n }\n\n // set default options\n options = _setDefaults(options, {\n base: _isString(input) ? input : '',\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n\n // expand input\n const expanded = await jsonld.expand(input, options);\n\n // do flattening\n const flattened = _flatten(expanded);\n\n if(ctx === null) {\n // no compaction required\n return flattened;\n }\n\n // compact result (force @graph option to true, skip expansion)\n options.graph = true;\n options.skipExpansion = true;\n const compacted = await jsonld.compact(flattened, ctx, options);\n\n return compacted;\n};\n\n/**\n * Performs JSON-LD framing.\n *\n * @param input the JSON-LD input to frame.\n * @param frame the JSON-LD frame to use.\n * @param [options] the framing options.\n * [base] the base IRI to use.\n * [expandContext] a context to expand with.\n * [embed] default @embed flag: '@last', '@always', '@never', '@link'\n * (default: '@last').\n * [explicit] default @explicit flag (default: false).\n * [requireAll] default @requireAll flag (default: true).\n * [omitDefault] default @omitDefault flag (default: false).\n * [documentLoader(url, options)] the document loader.\n * [safe] true to use safe mode. (default: false)\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the framed output.\n */\njsonld.frame = async function(input, frame, options) {\n if(arguments.length < 2) {\n throw new TypeError('Could not frame, too few arguments.');\n }\n\n // set default options\n options = _setDefaults(options, {\n base: _isString(input) ? input : '',\n embed: '@once',\n explicit: false,\n requireAll: false,\n omitDefault: false,\n bnodesToClear: [],\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n\n // if frame is a string, attempt to dereference remote document\n if(_isString(frame)) {\n // load remote doc\n const remoteDoc = await jsonld.get(frame, options);\n frame = remoteDoc.document;\n\n if(remoteDoc.contextUrl) {\n // inject link header @context into frame\n let ctx = frame['@context'];\n if(!ctx) {\n ctx = remoteDoc.contextUrl;\n } else if(_isArray(ctx)) {\n ctx.push(remoteDoc.contextUrl);\n } else {\n ctx = [ctx, remoteDoc.contextUrl];\n }\n frame['@context'] = ctx;\n }\n }\n\n const frameContext = frame ? frame['@context'] || {} : {};\n\n // process context\n const activeCtx = await jsonld.processContext(\n _getInitialContext(options), frameContext, options);\n\n // mode specific defaults\n if(!options.hasOwnProperty('omitGraph')) {\n options.omitGraph = _processingMode(activeCtx, 1.1);\n }\n if(!options.hasOwnProperty('pruneBlankNodeIdentifiers')) {\n options.pruneBlankNodeIdentifiers = _processingMode(activeCtx, 1.1);\n }\n\n // expand input\n const expanded = await jsonld.expand(input, options);\n\n // expand frame\n const opts = {...options};\n opts.isFrame = true;\n opts.keepFreeFloatingNodes = true;\n const expandedFrame = await jsonld.expand(frame, opts);\n\n // if the unexpanded frame includes a key expanding to @graph, frame the\n // default graph, otherwise, the merged graph\n const frameKeys = Object.keys(frame)\n .map(key => _expandIri(activeCtx, key, {vocab: true}));\n opts.merged = !frameKeys.includes('@graph');\n opts.is11 = _processingMode(activeCtx, 1.1);\n\n // do framing\n const framed = _frameMergedOrDefault(expanded, expandedFrame, opts);\n\n opts.graph = !options.omitGraph;\n opts.skipExpansion = true;\n opts.link = {};\n opts.framing = true;\n let compacted = await jsonld.compact(framed, frameContext, opts);\n\n // replace @null with null, compacting arrays\n opts.link = {};\n compacted = _cleanupNull(compacted, opts);\n\n return compacted;\n};\n\n/**\n * **Experimental**\n *\n * Links a JSON-LD document's nodes in memory.\n *\n * @param input the JSON-LD document to link.\n * @param [ctx] the JSON-LD context to apply.\n * @param [options] the options to use:\n * [base] the base IRI to use.\n * [expandContext] a context to expand with.\n * [documentLoader(url, options)] the document loader.\n * [safe] true to use safe mode. (default: false)\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the linked output.\n */\njsonld.link = async function(input, ctx, options) {\n // API matches running frame with a wildcard frame and embed: '@link'\n // get arguments\n const frame = {};\n if(ctx) {\n frame['@context'] = ctx;\n }\n frame['@embed'] = '@link';\n return jsonld.frame(input, frame, options);\n};\n\n/**\n * Performs RDF dataset normalization on the given input. The input is JSON-LD\n * unless the 'inputFormat' option is used. The output is an RDF dataset\n * unless the 'format' option is used.\n *\n * Note: Canonicalization sets `safe` to `true` and `base` to `null` by\n * default in order to produce safe outputs and \"fail closed\" by default. This\n * is different from the other API transformations in this version which\n * allow unsafe defaults (for cryptographic usage) in order to comply with the\n * JSON-LD 1.1 specification.\n *\n * @param input the input to normalize as JSON-LD or as a format specified by\n * the 'inputFormat' option.\n * @param [options] the options to use:\n * [algorithm] the normalization algorithm to use, `URDNA2015` or\n * `URGNA2012` (default: `URDNA2015`).\n * [base] the base IRI to use (default: `null`).\n * [expandContext] a context to expand with.\n * [skipExpansion] true to assume the input is expanded and skip\n * expansion, false not to, defaults to false. Some well-formed\n * and safe-mode checks may be omitted.\n * [inputFormat] the format if input is not JSON-LD:\n * 'application/n-quads' for N-Quads.\n * [format] the format if output is a string:\n * 'application/n-quads' for N-Quads.\n * [documentLoader(url, options)] the document loader.\n * [useNative] true to use a native canonize algorithm\n * [rdfDirection] null or 'i18n-datatype' to support RDF\n * transformation of @direction (default: null).\n * [safe] true to use safe mode. (default: true).\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the normalized output.\n */\njsonld.normalize = jsonld.canonize = async function(input, options) {\n if(arguments.length < 1) {\n throw new TypeError('Could not canonize, too few arguments.');\n }\n\n // set default options\n options = _setDefaults(options, {\n base: _isString(input) ? input : null,\n algorithm: 'URDNA2015',\n skipExpansion: false,\n safe: true,\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n if('inputFormat' in options) {\n if(options.inputFormat !== 'application/n-quads' &&\n options.inputFormat !== 'application/nquads') {\n throw new JsonLdError(\n 'Unknown canonicalization input format.',\n 'jsonld.CanonizeError');\n }\n // TODO: `await` for async parsers\n const parsedInput = NQuads.parse(input);\n\n // do canonicalization\n return canonize.canonize(parsedInput, options);\n }\n\n // convert to RDF dataset then do normalization\n const opts = {...options};\n delete opts.format;\n opts.produceGeneralizedRdf = false;\n const dataset = await jsonld.toRDF(input, opts);\n\n // do canonicalization\n return canonize.canonize(dataset, options);\n};\n\n/**\n * Converts an RDF dataset to JSON-LD.\n *\n * @param dataset a serialized string of RDF in a format specified by the\n * format option or an RDF dataset to convert.\n * @param [options] the options to use:\n * [format] the format if dataset param must first be parsed:\n * 'application/n-quads' for N-Quads (default).\n * [rdfParser] a custom RDF-parser to use to parse the dataset.\n * [useRdfType] true to use rdf:type, false to use @type\n * (default: false).\n * [useNativeTypes] true to convert XSD types into native types\n * (boolean, integer, double), false not to (default: false).\n * [rdfDirection] null or 'i18n-datatype' to support RDF\n * transformation of @direction (default: null).\n * [safe] true to use safe mode. (default: false)\n *\n * @return a Promise that resolves to the JSON-LD document.\n */\njsonld.fromRDF = async function(dataset, options) {\n if(arguments.length < 1) {\n throw new TypeError('Could not convert from RDF, too few arguments.');\n }\n\n // set default options\n options = _setDefaults(options, {\n format: _isString(dataset) ? 'application/n-quads' : undefined\n });\n\n const {format} = options;\n let {rdfParser} = options;\n\n // handle special format\n if(format) {\n // check supported formats\n rdfParser = rdfParser || _rdfParsers[format];\n if(!rdfParser) {\n throw new JsonLdError(\n 'Unknown input format.',\n 'jsonld.UnknownFormat', {format});\n }\n } else {\n // no-op parser, assume dataset already parsed\n rdfParser = () => dataset;\n }\n\n // rdfParser must be synchronous or return a promise, no callback support\n const parsedDataset = await rdfParser(dataset);\n return _fromRDF(parsedDataset, options);\n};\n\n/**\n * Outputs the RDF dataset found in the given JSON-LD object.\n *\n * @param input the JSON-LD input.\n * @param [options] the options to use:\n * [base] the base IRI to use.\n * [expandContext] a context to expand with.\n * [skipExpansion] true to assume the input is expanded and skip\n * expansion, false not to, defaults to false. Some well-formed\n * and safe-mode checks may be omitted.\n * [format] the format to use to output a string:\n * 'application/n-quads' for N-Quads.\n * [produceGeneralizedRdf] true to output generalized RDF, false\n * to produce only standard RDF (default: false).\n * [documentLoader(url, options)] the document loader.\n * [safe] true to use safe mode. (default: false)\n * [rdfDirection] null or 'i18n-datatype' to support RDF\n * transformation of @direction (default: null).\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the RDF dataset.\n */\njsonld.toRDF = async function(input, options) {\n if(arguments.length < 1) {\n throw new TypeError('Could not convert to RDF, too few arguments.');\n }\n\n // set default options\n options = _setDefaults(options, {\n base: _isString(input) ? input : '',\n skipExpansion: false,\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n\n // TODO: support toRDF custom map?\n let expanded;\n if(options.skipExpansion) {\n expanded = input;\n } else {\n // expand input\n expanded = await jsonld.expand(input, options);\n }\n\n // output RDF dataset\n const dataset = _toRDF(expanded, options);\n if(options.format) {\n if(options.format === 'application/n-quads' ||\n options.format === 'application/nquads') {\n return NQuads.serialize(dataset);\n }\n throw new JsonLdError(\n 'Unknown output format.',\n 'jsonld.UnknownFormat', {format: options.format});\n }\n\n return dataset;\n};\n\n/**\n * **Experimental**\n *\n * Recursively flattens the nodes in the given JSON-LD input into a merged\n * map of node ID => node. All graphs will be merged into the default graph.\n *\n * @param input the JSON-LD input.\n * @param [options] the options to use:\n * [base] the base IRI to use.\n * [expandContext] a context to expand with.\n * [issuer] a jsonld.IdentifierIssuer to use to label blank nodes.\n * [documentLoader(url, options)] the document loader.\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the merged node map.\n */\njsonld.createNodeMap = async function(input, options) {\n if(arguments.length < 1) {\n throw new TypeError('Could not create node map, too few arguments.');\n }\n\n // set default options\n options = _setDefaults(options, {\n base: _isString(input) ? input : '',\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n\n // expand input\n const expanded = await jsonld.expand(input, options);\n\n return _createMergedNodeMap(expanded, options);\n};\n\n/**\n * **Experimental**\n *\n * Merges two or more JSON-LD documents into a single flattened document.\n *\n * @param docs the JSON-LD documents to merge together.\n * @param ctx the context to use to compact the merged result, or null.\n * @param [options] the options to use:\n * [base] the base IRI to use.\n * [expandContext] a context to expand with.\n * [issuer] a jsonld.IdentifierIssuer to use to label blank nodes.\n * [mergeNodes] true to merge properties for nodes with the same ID,\n * false to ignore new properties for nodes with the same ID once\n * the ID has been defined; note that this may not prevent merging\n * new properties where a node is in the `object` position\n * (default: true).\n * [documentLoader(url, options)] the document loader.\n * [safe] true to use safe mode. (default: false)\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the merged output.\n */\njsonld.merge = async function(docs, ctx, options) {\n if(arguments.length < 1) {\n throw new TypeError('Could not merge, too few arguments.');\n }\n if(!_isArray(docs)) {\n throw new TypeError('Could not merge, \"docs\" must be an array.');\n }\n\n if(typeof ctx === 'function') {\n ctx = null;\n } else {\n ctx = ctx || null;\n }\n\n // set default options\n options = _setDefaults(options, {\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n\n // expand all documents\n const expanded = await Promise.all(docs.map(doc => {\n const opts = {...options};\n return jsonld.expand(doc, opts);\n }));\n\n let mergeNodes = true;\n if('mergeNodes' in options) {\n mergeNodes = options.mergeNodes;\n }\n\n const issuer = options.issuer || new IdentifierIssuer('_:b');\n const graphs = {'@default': {}};\n\n for(let i = 0; i < expanded.length; ++i) {\n // uniquely relabel blank nodes\n const doc = util.relabelBlankNodes(expanded[i], {\n issuer: new IdentifierIssuer('_:b' + i + '-')\n });\n\n // add nodes to the shared node map graphs if merging nodes, to a\n // separate graph set if not\n const _graphs = (mergeNodes || i === 0) ? graphs : {'@default': {}};\n _createNodeMap(doc, _graphs, '@default', issuer);\n\n if(_graphs !== graphs) {\n // merge document graphs but don't merge existing nodes\n for(const graphName in _graphs) {\n const _nodeMap = _graphs[graphName];\n if(!(graphName in graphs)) {\n graphs[graphName] = _nodeMap;\n continue;\n }\n const nodeMap = graphs[graphName];\n for(const key in _nodeMap) {\n if(!(key in nodeMap)) {\n nodeMap[key] = _nodeMap[key];\n }\n }\n }\n }\n }\n\n // add all non-default graphs to default graph\n const defaultGraph = _mergeNodeMaps(graphs);\n\n // produce flattened output\n const flattened = [];\n const keys = Object.keys(defaultGraph).sort();\n for(let ki = 0; ki < keys.length; ++ki) {\n const node = defaultGraph[keys[ki]];\n // only add full subjects to top-level\n if(!_isSubjectReference(node)) {\n flattened.push(node);\n }\n }\n\n if(ctx === null) {\n return flattened;\n }\n\n // compact result (force @graph option to true, skip expansion)\n options.graph = true;\n options.skipExpansion = true;\n const compacted = await jsonld.compact(flattened, ctx, options);\n\n return compacted;\n};\n\n/**\n * The default document loader for external documents.\n *\n * @param url the URL to load.\n *\n * @return a promise that resolves to the remote document.\n */\nObject.defineProperty(jsonld, 'documentLoader', {\n get: () => jsonld._documentLoader,\n set: v => jsonld._documentLoader = v\n});\n// default document loader not implemented\njsonld.documentLoader = async url => {\n throw new JsonLdError(\n 'Could not retrieve a JSON-LD document from the URL. URL ' +\n 'dereferencing not implemented.', 'jsonld.LoadDocumentError',\n {code: 'loading document failed', url});\n};\n\n/**\n * Gets a remote JSON-LD document using the default document loader or\n * one given in the passed options.\n *\n * @param url the URL to fetch.\n * @param [options] the options to use:\n * [documentLoader] the document loader to use.\n *\n * @return a Promise that resolves to the retrieved remote document.\n */\njsonld.get = async function(url, options) {\n let load;\n if(typeof options.documentLoader === 'function') {\n load = options.documentLoader;\n } else {\n load = jsonld.documentLoader;\n }\n\n const remoteDoc = await load(url);\n\n try {\n if(!remoteDoc.document) {\n throw new JsonLdError(\n 'No remote document found at the given URL.',\n 'jsonld.NullRemoteDocument');\n }\n if(_isString(remoteDoc.document)) {\n remoteDoc.document = JSON.parse(remoteDoc.document);\n }\n } catch(e) {\n throw new JsonLdError(\n 'Could not retrieve a JSON-LD document from the URL.',\n 'jsonld.LoadDocumentError', {\n code: 'loading document failed',\n cause: e,\n remoteDoc\n });\n }\n\n return remoteDoc;\n};\n\n/**\n * Processes a local context, resolving any URLs as necessary, and returns a\n * new active context.\n *\n * @param activeCtx the current active context.\n * @param localCtx the local context to process.\n * @param [options] the options to use:\n * [documentLoader(url, options)] the document loader.\n * [safe] true to use safe mode. (default: false)\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the new active context.\n */\njsonld.processContext = async function(\n activeCtx, localCtx, options) {\n // set default options\n options = _setDefaults(options, {\n base: '',\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n\n // return initial context early for null context\n if(localCtx === null) {\n return _getInitialContext(options);\n }\n\n // get URLs in localCtx\n localCtx = util.clone(localCtx);\n if(!(_isObject(localCtx) && '@context' in localCtx)) {\n localCtx = {'@context': localCtx};\n }\n\n return _processContext({activeCtx, localCtx, options});\n};\n\n// backwards compatibility\njsonld.getContextValue = require('./context').getContextValue;\n\n/**\n * Document loaders.\n */\njsonld.documentLoaders = {};\n\n/**\n * Assigns the default document loader for external document URLs to a built-in\n * default. Supported types currently include: 'xhr' and 'node'.\n *\n * @param type the type to set.\n * @param [params] the parameters required to use the document loader.\n */\njsonld.useDocumentLoader = function(type) {\n if(!(type in jsonld.documentLoaders)) {\n throw new JsonLdError(\n 'Unknown document loader type: \"' + type + '\"',\n 'jsonld.UnknownDocumentLoader',\n {type});\n }\n\n // set document loader\n jsonld.documentLoader = jsonld.documentLoaders[type].apply(\n jsonld, Array.prototype.slice.call(arguments, 1));\n};\n\n/**\n * Registers an RDF dataset parser by content-type, for use with\n * jsonld.fromRDF. An RDF dataset parser will always be given one parameter,\n * a string of input. An RDF dataset parser can be synchronous or\n * asynchronous (by returning a promise).\n *\n * @param contentType the content-type for the parser.\n * @param parser(input) the parser function (takes a string as a parameter\n * and either returns an RDF dataset or a Promise that resolves to one.\n */\njsonld.registerRDFParser = function(contentType, parser) {\n _rdfParsers[contentType] = parser;\n};\n\n/**\n * Unregisters an RDF dataset parser by content-type.\n *\n * @param contentType the content-type for the parser.\n */\njsonld.unregisterRDFParser = function(contentType) {\n delete _rdfParsers[contentType];\n};\n\n// register the N-Quads RDF parser\njsonld.registerRDFParser('application/n-quads', NQuads.parse);\njsonld.registerRDFParser('application/nquads', NQuads.parse);\n\n/* URL API */\njsonld.url = require('./url');\n\n/* Events API and handlers */\njsonld.logEventHandler = _logEventHandler;\njsonld.logWarningEventHandler = _logWarningEventHandler;\njsonld.safeEventHandler = _safeEventHandler;\njsonld.setDefaultEventHandler = _setDefaultEventHandler;\njsonld.strictEventHandler = _strictEventHandler;\njsonld.unhandledEventHandler = _unhandledEventHandler;\n\n/* Utility API */\njsonld.util = util;\n// backwards compatibility\nObject.assign(jsonld, util);\n\n// reexpose API as jsonld.promises for backwards compatability\njsonld.promises = jsonld;\n\n// backwards compatibility\njsonld.RequestQueue = require('./RequestQueue');\n\n/* WebIDL API */\njsonld.JsonLdProcessor = require('./JsonLdProcessor')(jsonld);\n\nplatform.setupGlobals(jsonld);\nplatform.setupDocumentLoaders(jsonld);\n\nfunction _setDefaults(options, {\n documentLoader = jsonld.documentLoader,\n ...defaults\n}) {\n // fail if obsolete options present\n if(options && 'compactionMap' in options) {\n throw new JsonLdError(\n '\"compactionMap\" not supported.',\n 'jsonld.OptionsError');\n }\n if(options && 'expansionMap' in options) {\n throw new JsonLdError(\n '\"expansionMap\" not supported.',\n 'jsonld.OptionsError');\n }\n return Object.assign(\n {},\n {documentLoader},\n defaults,\n options,\n {eventHandler: _setupEventHandler({options})}\n );\n}\n\n// end of jsonld API `wrapper` factory\nreturn jsonld;\n};\n\n// external APIs:\n\n// used to generate a new jsonld API instance\nconst factory = function() {\n return wrapper(function() {\n return factory();\n });\n};\n\n// wrap the main jsonld API instance\nwrapper(factory);\n// export API\nmodule.exports = factory;\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst {isKeyword} = require('./context');\nconst graphTypes = require('./graphTypes');\nconst types = require('./types');\nconst util = require('./util');\nconst JsonLdError = require('./JsonLdError');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Creates a merged JSON-LD node map (node ID => node).\n *\n * @param input the expanded JSON-LD to create a node map of.\n * @param [options] the options to use:\n * [issuer] a jsonld.IdentifierIssuer to use to label blank nodes.\n *\n * @return the node map.\n */\napi.createMergedNodeMap = (input, options) => {\n options = options || {};\n\n // produce a map of all subjects and name each bnode\n const issuer = options.issuer || new util.IdentifierIssuer('_:b');\n const graphs = {'@default': {}};\n api.createNodeMap(input, graphs, '@default', issuer);\n\n // add all non-default graphs to default graph\n return api.mergeNodeMaps(graphs);\n};\n\n/**\n * Recursively flattens the subjects in the given JSON-LD expanded input\n * into a node map.\n *\n * @param input the JSON-LD expanded input.\n * @param graphs a map of graph name to subject map.\n * @param graph the name of the current graph.\n * @param issuer the blank node identifier issuer.\n * @param name the name assigned to the current input if it is a bnode.\n * @param list the list to append to, null for none.\n */\napi.createNodeMap = (input, graphs, graph, issuer, name, list) => {\n // recurse through array\n if(types.isArray(input)) {\n for(const node of input) {\n api.createNodeMap(node, graphs, graph, issuer, undefined, list);\n }\n return;\n }\n\n // add non-object to list\n if(!types.isObject(input)) {\n if(list) {\n list.push(input);\n }\n return;\n }\n\n // add values to list\n if(graphTypes.isValue(input)) {\n if('@type' in input) {\n let type = input['@type'];\n // rename @type blank node\n if(type.indexOf('_:') === 0) {\n input['@type'] = type = issuer.getId(type);\n }\n }\n if(list) {\n list.push(input);\n }\n return;\n } else if(list && graphTypes.isList(input)) {\n const _list = [];\n api.createNodeMap(input['@list'], graphs, graph, issuer, name, _list);\n list.push({'@list': _list});\n return;\n }\n\n // Note: At this point, input must be a subject.\n\n // spec requires @type to be named first, so assign names early\n if('@type' in input) {\n const types = input['@type'];\n for(const type of types) {\n if(type.indexOf('_:') === 0) {\n issuer.getId(type);\n }\n }\n }\n\n // get name for subject\n if(types.isUndefined(name)) {\n name = graphTypes.isBlankNode(input) ?\n issuer.getId(input['@id']) : input['@id'];\n }\n\n // add subject reference to list\n if(list) {\n list.push({'@id': name});\n }\n\n // create new subject or merge into existing one\n const subjects = graphs[graph];\n const subject = subjects[name] = subjects[name] || {};\n subject['@id'] = name;\n const properties = Object.keys(input).sort();\n for(let property of properties) {\n // skip @id\n if(property === '@id') {\n continue;\n }\n\n // handle reverse properties\n if(property === '@reverse') {\n const referencedNode = {'@id': name};\n const reverseMap = input['@reverse'];\n for(const reverseProperty in reverseMap) {\n const items = reverseMap[reverseProperty];\n for(const item of items) {\n let itemName = item['@id'];\n if(graphTypes.isBlankNode(item)) {\n itemName = issuer.getId(itemName);\n }\n api.createNodeMap(item, graphs, graph, issuer, itemName);\n util.addValue(\n subjects[itemName], reverseProperty, referencedNode,\n {propertyIsArray: true, allowDuplicate: false});\n }\n }\n continue;\n }\n\n // recurse into graph\n if(property === '@graph') {\n // add graph subjects map entry\n if(!(name in graphs)) {\n graphs[name] = {};\n }\n api.createNodeMap(input[property], graphs, name, issuer);\n continue;\n }\n\n // recurse into included\n if(property === '@included') {\n api.createNodeMap(input[property], graphs, graph, issuer);\n continue;\n }\n\n // copy non-@type keywords\n if(property !== '@type' && isKeyword(property)) {\n if(property === '@index' && property in subject &&\n (input[property] !== subject[property] ||\n input[property]['@id'] !== subject[property]['@id'])) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; conflicting @index property detected.',\n 'jsonld.SyntaxError',\n {code: 'conflicting indexes', subject});\n }\n subject[property] = input[property];\n continue;\n }\n\n // iterate over objects\n const objects = input[property];\n\n // if property is a bnode, assign it a new id\n if(property.indexOf('_:') === 0) {\n property = issuer.getId(property);\n }\n\n // ensure property is added for empty arrays\n if(objects.length === 0) {\n util.addValue(subject, property, [], {propertyIsArray: true});\n continue;\n }\n for(let o of objects) {\n if(property === '@type') {\n // rename @type blank nodes\n o = (o.indexOf('_:') === 0) ? issuer.getId(o) : o;\n }\n\n // handle embedded subject or subject reference\n if(graphTypes.isSubject(o) || graphTypes.isSubjectReference(o)) {\n // skip null @id\n if('@id' in o && !o['@id']) {\n continue;\n }\n\n // relabel blank node @id\n const id = graphTypes.isBlankNode(o) ?\n issuer.getId(o['@id']) : o['@id'];\n\n // add reference and recurse\n util.addValue(\n subject, property, {'@id': id},\n {propertyIsArray: true, allowDuplicate: false});\n api.createNodeMap(o, graphs, graph, issuer, id);\n } else if(graphTypes.isValue(o)) {\n util.addValue(\n subject, property, o,\n {propertyIsArray: true, allowDuplicate: false});\n } else if(graphTypes.isList(o)) {\n // handle @list\n const _list = [];\n api.createNodeMap(o['@list'], graphs, graph, issuer, name, _list);\n o = {'@list': _list};\n util.addValue(\n subject, property, o,\n {propertyIsArray: true, allowDuplicate: false});\n } else {\n // handle @value\n api.createNodeMap(o, graphs, graph, issuer, name);\n util.addValue(\n subject, property, o, {propertyIsArray: true, allowDuplicate: false});\n }\n }\n }\n};\n\n/**\n * Merge separate named graphs into a single merged graph including\n * all nodes from the default graph and named graphs.\n *\n * @param graphs a map of graph name to subject map.\n *\n * @return the merged graph map.\n */\napi.mergeNodeMapGraphs = graphs => {\n const merged = {};\n for(const name of Object.keys(graphs).sort()) {\n for(const id of Object.keys(graphs[name]).sort()) {\n const node = graphs[name][id];\n if(!(id in merged)) {\n merged[id] = {'@id': id};\n }\n const mergedNode = merged[id];\n\n for(const property of Object.keys(node).sort()) {\n if(isKeyword(property) && property !== '@type') {\n // copy keywords\n mergedNode[property] = util.clone(node[property]);\n } else {\n // merge objects\n for(const value of node[property]) {\n util.addValue(\n mergedNode, property, util.clone(value),\n {propertyIsArray: true, allowDuplicate: false});\n }\n }\n }\n }\n }\n\n return merged;\n};\n\napi.mergeNodeMaps = graphs => {\n // add all non-default graphs to default graph\n const defaultGraph = graphs['@default'];\n const graphNames = Object.keys(graphs).sort();\n for(const graphName of graphNames) {\n if(graphName === '@default') {\n continue;\n }\n const nodeMap = graphs[graphName];\n let subject = defaultGraph[graphName];\n if(!subject) {\n defaultGraph[graphName] = subject = {\n '@id': graphName,\n '@graph': []\n };\n } else if(!('@graph' in subject)) {\n subject['@graph'] = [];\n }\n const graph = subject['@graph'];\n for(const id of Object.keys(nodeMap).sort()) {\n const node = nodeMap[id];\n // only add full subjects\n if(!graphTypes.isSubjectReference(node)) {\n graph.push(node);\n }\n }\n }\n return defaultGraph;\n};\n","/*\n * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst xhrLoader = require('./documentLoaders/xhr');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Setup browser document loaders.\n *\n * @param jsonld the jsonld api.\n */\napi.setupDocumentLoaders = function(jsonld) {\n if(typeof XMLHttpRequest !== 'undefined') {\n jsonld.documentLoaders.xhr = xhrLoader;\n // use xhr document loader by default\n jsonld.useDocumentLoader('xhr');\n }\n};\n\n/**\n * Setup browser globals.\n *\n * @param jsonld the jsonld api.\n */\napi.setupGlobals = function(jsonld) {\n // setup browser global JsonLdProcessor\n if(typeof globalThis.JsonLdProcessor === 'undefined') {\n Object.defineProperty(globalThis, 'JsonLdProcessor', {\n writable: true,\n enumerable: false,\n configurable: true,\n value: jsonld.JsonLdProcessor\n });\n }\n};\n","/*\n * Copyright (c) 2017-2023 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst {createNodeMap} = require('./nodeMap');\nconst {isKeyword} = require('./context');\nconst graphTypes = require('./graphTypes');\nconst jsonCanonicalize = require('canonicalize');\nconst JsonLdError = require('./JsonLdError');\nconst types = require('./types');\nconst util = require('./util');\n\nconst {\n handleEvent: _handleEvent\n} = require('./events');\n\nconst {\n // RDF,\n // RDF_LIST,\n RDF_FIRST,\n RDF_REST,\n RDF_NIL,\n RDF_TYPE,\n // RDF_PLAIN_LITERAL,\n // RDF_XML_LITERAL,\n RDF_JSON_LITERAL,\n // RDF_OBJECT,\n RDF_LANGSTRING,\n\n // XSD,\n XSD_BOOLEAN,\n XSD_DOUBLE,\n XSD_INTEGER,\n XSD_STRING,\n} = require('./constants');\n\nconst {\n isAbsolute: _isAbsoluteIri\n} = require('./url');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Outputs an RDF dataset for the expanded JSON-LD input.\n *\n * @param input the expanded JSON-LD input.\n * @param options the RDF serialization options.\n *\n * @return the RDF dataset.\n */\napi.toRDF = (input, options) => {\n // create node map for default graph (and any named graphs)\n const issuer = new util.IdentifierIssuer('_:b');\n const nodeMap = {'@default': {}};\n createNodeMap(input, nodeMap, '@default', issuer);\n\n const dataset = [];\n const graphNames = Object.keys(nodeMap).sort();\n for(const graphName of graphNames) {\n let graphTerm;\n if(graphName === '@default') {\n graphTerm = {termType: 'DefaultGraph', value: ''};\n } else if(_isAbsoluteIri(graphName)) {\n if(graphName.startsWith('_:')) {\n graphTerm = {termType: 'BlankNode'};\n } else {\n graphTerm = {termType: 'NamedNode'};\n }\n graphTerm.value = graphName;\n } else {\n // skip relative IRIs (not valid RDF)\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'relative graph reference',\n level: 'warning',\n message: 'Relative graph reference found.',\n details: {\n graph: graphName\n }\n },\n options\n });\n }\n continue;\n }\n _graphToRDF(dataset, nodeMap[graphName], graphTerm, issuer, options);\n }\n\n return dataset;\n};\n\n/**\n * Adds RDF quads for a particular graph to the given dataset.\n *\n * @param dataset the dataset to append RDF quads to.\n * @param graph the graph to create RDF quads for.\n * @param graphTerm the graph term for each quad.\n * @param issuer a IdentifierIssuer for assigning blank node names.\n * @param options the RDF serialization options.\n *\n * @return the array of RDF triples for the given graph.\n */\nfunction _graphToRDF(dataset, graph, graphTerm, issuer, options) {\n const ids = Object.keys(graph).sort();\n for(const id of ids) {\n const node = graph[id];\n const properties = Object.keys(node).sort();\n for(let property of properties) {\n const items = node[property];\n if(property === '@type') {\n property = RDF_TYPE;\n } else if(isKeyword(property)) {\n continue;\n }\n\n for(const item of items) {\n // RDF subject\n const subject = {\n termType: id.startsWith('_:') ? 'BlankNode' : 'NamedNode',\n value: id\n };\n\n // skip relative IRI subjects (not valid RDF)\n if(!_isAbsoluteIri(id)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'relative subject reference',\n level: 'warning',\n message: 'Relative subject reference found.',\n details: {\n subject: id\n }\n },\n options\n });\n }\n continue;\n }\n\n // RDF predicate\n const predicate = {\n termType: property.startsWith('_:') ? 'BlankNode' : 'NamedNode',\n value: property\n };\n\n // skip relative IRI predicates (not valid RDF)\n if(!_isAbsoluteIri(property)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'relative predicate reference',\n level: 'warning',\n message: 'Relative predicate reference found.',\n details: {\n predicate: property\n }\n },\n options\n });\n }\n continue;\n }\n\n // skip blank node predicates unless producing generalized RDF\n if(predicate.termType === 'BlankNode' &&\n !options.produceGeneralizedRdf) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'blank node predicate',\n level: 'warning',\n message: 'Dropping blank node predicate.',\n details: {\n // FIXME: add better issuer API to get reverse mapping\n property: issuer.getOldIds()\n .find(key => issuer.getId(key) === property)\n }\n },\n options\n });\n }\n continue;\n }\n\n // convert list, value or node object to triple\n const object = _objectToRDF(\n item, issuer, dataset, graphTerm, options.rdfDirection, options);\n // skip null objects (they are relative IRIs)\n if(object) {\n dataset.push({\n subject,\n predicate,\n object,\n graph: graphTerm\n });\n }\n }\n }\n }\n}\n\n/**\n * Converts a @list value into linked list of blank node RDF quads\n * (an RDF collection).\n *\n * @param list the @list value.\n * @param issuer a IdentifierIssuer for assigning blank node names.\n * @param dataset the array of quads to append to.\n * @param graphTerm the graph term for each quad.\n * @param options the RDF serialization options.\n *\n * @return the head of the list.\n */\nfunction _listToRDF(list, issuer, dataset, graphTerm, rdfDirection, options) {\n const first = {termType: 'NamedNode', value: RDF_FIRST};\n const rest = {termType: 'NamedNode', value: RDF_REST};\n const nil = {termType: 'NamedNode', value: RDF_NIL};\n\n const last = list.pop();\n // Result is the head of the list\n const result = last ? {termType: 'BlankNode', value: issuer.getId()} : nil;\n let subject = result;\n\n for(const item of list) {\n const object = _objectToRDF(\n item, issuer, dataset, graphTerm, rdfDirection, options);\n const next = {termType: 'BlankNode', value: issuer.getId()};\n dataset.push({\n subject,\n predicate: first,\n object,\n graph: graphTerm\n });\n dataset.push({\n subject,\n predicate: rest,\n object: next,\n graph: graphTerm\n });\n subject = next;\n }\n\n // Tail of list\n if(last) {\n const object = _objectToRDF(\n last, issuer, dataset, graphTerm, rdfDirection, options);\n dataset.push({\n subject,\n predicate: first,\n object,\n graph: graphTerm\n });\n dataset.push({\n subject,\n predicate: rest,\n object: nil,\n graph: graphTerm\n });\n }\n\n return result;\n}\n\n/**\n * Converts a JSON-LD value object to an RDF literal or a JSON-LD string,\n * node object to an RDF resource, or adds a list.\n *\n * @param item the JSON-LD value or node object.\n * @param issuer a IdentifierIssuer for assigning blank node names.\n * @param dataset the dataset to append RDF quads to.\n * @param graphTerm the graph term for each quad.\n * @param options the RDF serialization options.\n *\n * @return the RDF literal or RDF resource.\n */\nfunction _objectToRDF(\n item, issuer, dataset, graphTerm, rdfDirection, options\n) {\n const object = {};\n\n // convert value object to RDF\n if(graphTypes.isValue(item)) {\n object.termType = 'Literal';\n object.value = undefined;\n object.datatype = {\n termType: 'NamedNode'\n };\n let value = item['@value'];\n const datatype = item['@type'] || null;\n\n // convert to XSD/JSON datatypes as appropriate\n if(datatype === '@json') {\n object.value = jsonCanonicalize(value);\n object.datatype.value = RDF_JSON_LITERAL;\n } else if(types.isBoolean(value)) {\n object.value = value.toString();\n object.datatype.value = datatype || XSD_BOOLEAN;\n } else if(types.isDouble(value) || datatype === XSD_DOUBLE) {\n if(!types.isDouble(value)) {\n value = parseFloat(value);\n }\n // canonical double representation\n object.value = value.toExponential(15).replace(/(\\d)0*e\\+?/, '$1E');\n object.datatype.value = datatype || XSD_DOUBLE;\n } else if(types.isNumber(value)) {\n object.value = value.toFixed(0);\n object.datatype.value = datatype || XSD_INTEGER;\n } else if('@direction' in item && rdfDirection === 'i18n-datatype') {\n const language = (item['@language'] || '').toLowerCase();\n const direction = item['@direction'];\n const datatype = `https://www.w3.org/ns/i18n#${language}_${direction}`;\n object.datatype.value = datatype;\n object.value = value;\n } else if('@direction' in item && rdfDirection === 'compound-literal') {\n throw new JsonLdError(\n 'Unsupported rdfDirection value.',\n 'jsonld.InvalidRdfDirection',\n {value: rdfDirection});\n } else if('@direction' in item && rdfDirection) {\n throw new JsonLdError(\n 'Unknown rdfDirection value.',\n 'jsonld.InvalidRdfDirection',\n {value: rdfDirection});\n } else if('@language' in item) {\n if('@direction' in item && !rdfDirection) {\n if(options.eventHandler) {\n // FIXME: only emit once?\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'rdfDirection not set',\n level: 'warning',\n message: 'rdfDirection not set for @direction.',\n details: {\n object: object.value\n }\n },\n options\n });\n }\n }\n object.value = value;\n object.datatype.value = datatype || RDF_LANGSTRING;\n object.language = item['@language'];\n } else {\n if('@direction' in item && !rdfDirection) {\n if(options.eventHandler) {\n // FIXME: only emit once?\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'rdfDirection not set',\n level: 'warning',\n message: 'rdfDirection not set for @direction.',\n details: {\n object: object.value\n }\n },\n options\n });\n }\n }\n object.value = value;\n object.datatype.value = datatype || XSD_STRING;\n }\n } else if(graphTypes.isList(item)) {\n const _list = _listToRDF(\n item['@list'], issuer, dataset, graphTerm, rdfDirection, options);\n object.termType = _list.termType;\n object.value = _list.value;\n } else {\n // convert string/node object to RDF\n const id = types.isObject(item) ? item['@id'] : item;\n object.termType = id.startsWith('_:') ? 'BlankNode' : 'NamedNode';\n object.value = id;\n }\n\n // skip relative IRIs, not valid RDF\n if(object.termType === 'NamedNode' && !_isAbsoluteIri(object.value)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'relative object reference',\n level: 'warning',\n message: 'Relative object reference found.',\n details: {\n object: object.value\n }\n },\n options\n });\n }\n return null;\n }\n\n return object;\n}\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Returns true if the given value is an Array.\n *\n * @param v the value to check.\n *\n * @return true if the value is an Array, false if not.\n */\napi.isArray = Array.isArray;\n\n/**\n * Returns true if the given value is a Boolean.\n *\n * @param v the value to check.\n *\n * @return true if the value is a Boolean, false if not.\n */\napi.isBoolean = v => (typeof v === 'boolean' ||\n Object.prototype.toString.call(v) === '[object Boolean]');\n\n/**\n * Returns true if the given value is a double.\n *\n * @param v the value to check.\n *\n * @return true if the value is a double, false if not.\n */\napi.isDouble = v => api.isNumber(v) &&\n (String(v).indexOf('.') !== -1 || Math.abs(v) >= 1e21);\n\n/**\n * Returns true if the given value is an empty Object.\n *\n * @param v the value to check.\n *\n * @return true if the value is an empty Object, false if not.\n */\napi.isEmptyObject = v => api.isObject(v) && Object.keys(v).length === 0;\n\n/**\n * Returns true if the given value is a Number.\n *\n * @param v the value to check.\n *\n * @return true if the value is a Number, false if not.\n */\napi.isNumber = v => (typeof v === 'number' ||\n Object.prototype.toString.call(v) === '[object Number]');\n\n/**\n * Returns true if the given value is numeric.\n *\n * @param v the value to check.\n *\n * @return true if the value is numeric, false if not.\n */\napi.isNumeric = v => !isNaN(parseFloat(v)) && isFinite(v);\n\n/**\n * Returns true if the given value is an Object.\n *\n * @param v the value to check.\n *\n * @return true if the value is an Object, false if not.\n */\napi.isObject = v => Object.prototype.toString.call(v) === '[object Object]';\n\n/**\n * Returns true if the given value is a String.\n *\n * @param v the value to check.\n *\n * @return true if the value is a String, false if not.\n */\napi.isString = v => (typeof v === 'string' ||\n Object.prototype.toString.call(v) === '[object String]');\n\n/**\n * Returns true if the given value is undefined.\n *\n * @param v the value to check.\n *\n * @return true if the value is undefined, false if not.\n */\napi.isUndefined = v => typeof v === 'undefined';\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst types = require('./types');\n\nconst api = {};\nmodule.exports = api;\n\n// define URL parser\n// parseUri 1.2.2\n// (c) Steven Levithan \n// MIT License\n// with local jsonld.js modifications\napi.parsers = {\n simple: {\n // RFC 3986 basic parts\n keys: [\n 'href', 'scheme', 'authority', 'path', 'query', 'fragment'\n ],\n /* eslint-disable-next-line max-len */\n regex: /^(?:([^:\\/?#]+):)?(?:\\/\\/([^\\/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/\n },\n full: {\n keys: [\n 'href', 'protocol', 'scheme', 'authority', 'auth', 'user', 'password',\n 'hostname', 'port', 'path', 'directory', 'file', 'query', 'fragment'\n ],\n /* eslint-disable-next-line max-len */\n regex: /^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?(?:(((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n};\napi.parse = (str, parser) => {\n const parsed = {};\n const o = api.parsers[parser || 'full'];\n const m = o.regex.exec(str);\n let i = o.keys.length;\n while(i--) {\n parsed[o.keys[i]] = (m[i] === undefined) ? null : m[i];\n }\n\n // remove default ports in found in URLs\n if((parsed.scheme === 'https' && parsed.port === '443') ||\n (parsed.scheme === 'http' && parsed.port === '80')) {\n parsed.href = parsed.href.replace(':' + parsed.port, '');\n parsed.authority = parsed.authority.replace(':' + parsed.port, '');\n parsed.port = null;\n }\n\n parsed.normalizedPath = api.removeDotSegments(parsed.path);\n return parsed;\n};\n\n/**\n * Prepends a base IRI to the given relative IRI.\n *\n * @param base the base IRI.\n * @param iri the relative IRI.\n *\n * @return the absolute IRI.\n */\napi.prependBase = (base, iri) => {\n // skip IRI processing\n if(base === null) {\n return iri;\n }\n // already an absolute IRI\n if(api.isAbsolute(iri)) {\n return iri;\n }\n\n // parse base if it is a string\n if(!base || types.isString(base)) {\n base = api.parse(base || '');\n }\n\n // parse given IRI\n const rel = api.parse(iri);\n\n // per RFC3986 5.2.2\n const transform = {\n protocol: base.protocol || ''\n };\n\n if(rel.authority !== null) {\n transform.authority = rel.authority;\n transform.path = rel.path;\n transform.query = rel.query;\n } else {\n transform.authority = base.authority;\n\n if(rel.path === '') {\n transform.path = base.path;\n if(rel.query !== null) {\n transform.query = rel.query;\n } else {\n transform.query = base.query;\n }\n } else {\n if(rel.path.indexOf('/') === 0) {\n // IRI represents an absolute path\n transform.path = rel.path;\n } else {\n // merge paths\n let path = base.path;\n\n // append relative path to the end of the last directory from base\n path = path.substr(0, path.lastIndexOf('/') + 1);\n if((path.length > 0 || base.authority) && path.substr(-1) !== '/') {\n path += '/';\n }\n path += rel.path;\n\n transform.path = path;\n }\n transform.query = rel.query;\n }\n }\n\n if(rel.path !== '') {\n // remove slashes and dots in path\n transform.path = api.removeDotSegments(transform.path);\n }\n\n // construct URL\n let rval = transform.protocol;\n if(transform.authority !== null) {\n rval += '//' + transform.authority;\n }\n rval += transform.path;\n if(transform.query !== null) {\n rval += '?' + transform.query;\n }\n if(rel.fragment !== null) {\n rval += '#' + rel.fragment;\n }\n\n // handle empty base\n if(rval === '') {\n rval = './';\n }\n\n return rval;\n};\n\n/**\n * Removes a base IRI from the given absolute IRI.\n *\n * @param base the base IRI.\n * @param iri the absolute IRI.\n *\n * @return the relative IRI if relative to base, otherwise the absolute IRI.\n */\napi.removeBase = (base, iri) => {\n // skip IRI processing\n if(base === null) {\n return iri;\n }\n\n if(!base || types.isString(base)) {\n base = api.parse(base || '');\n }\n\n // establish base root\n let root = '';\n if(base.href !== '') {\n root += (base.protocol || '') + '//' + (base.authority || '');\n } else if(iri.indexOf('//')) {\n // support network-path reference with empty base\n root += '//';\n }\n\n // IRI not relative to base\n if(iri.indexOf(root) !== 0) {\n return iri;\n }\n\n // remove root from IRI and parse remainder\n const rel = api.parse(iri.substr(root.length));\n\n // remove path segments that match (do not remove last segment unless there\n // is a hash or query)\n const baseSegments = base.normalizedPath.split('/');\n const iriSegments = rel.normalizedPath.split('/');\n const last = (rel.fragment || rel.query) ? 0 : 1;\n while(baseSegments.length > 0 && iriSegments.length > last) {\n if(baseSegments[0] !== iriSegments[0]) {\n break;\n }\n baseSegments.shift();\n iriSegments.shift();\n }\n\n // use '../' for each non-matching base segment\n let rval = '';\n if(baseSegments.length > 0) {\n // don't count the last segment (if it ends with '/' last path doesn't\n // count and if it doesn't end with '/' it isn't a path)\n baseSegments.pop();\n for(let i = 0; i < baseSegments.length; ++i) {\n rval += '../';\n }\n }\n\n // prepend remaining segments\n rval += iriSegments.join('/');\n\n // add query and hash\n if(rel.query !== null) {\n rval += '?' + rel.query;\n }\n if(rel.fragment !== null) {\n rval += '#' + rel.fragment;\n }\n\n // handle empty base\n if(rval === '') {\n rval = './';\n }\n\n return rval;\n};\n\n/**\n * Removes dot segments from a URL path.\n *\n * @param path the path to remove dot segments from.\n */\napi.removeDotSegments = path => {\n // RFC 3986 5.2.4 (reworked)\n\n // empty path shortcut\n if(path.length === 0) {\n return '';\n }\n\n const input = path.split('/');\n const output = [];\n\n while(input.length > 0) {\n const next = input.shift();\n const done = input.length === 0;\n\n if(next === '.') {\n if(done) {\n // ensure output has trailing /\n output.push('');\n }\n continue;\n }\n\n if(next === '..') {\n output.pop();\n if(done) {\n // ensure output has trailing /\n output.push('');\n }\n continue;\n }\n\n output.push(next);\n }\n\n // if path was absolute, ensure output has leading /\n if(path[0] === '/' && output.length > 0 && output[0] !== '') {\n output.unshift('');\n }\n if(output.length === 1 && output[0] === '') {\n return '/';\n }\n\n return output.join('/');\n};\n\n// TODO: time better isAbsolute/isRelative checks using full regexes:\n// http://jmrware.com/articles/2009/uri_regexp/URI_regex.html\n\n// regex to check for absolute IRI (starting scheme and ':') or blank node IRI\nconst isAbsoluteRegex = /^([A-Za-z][A-Za-z0-9+-.]*|_):[^\\s]*$/;\n\n/**\n * Returns true if the given value is an absolute IRI or blank node IRI, false\n * if not.\n * Note: This weak check only checks for a correct starting scheme.\n *\n * @param v the value to check.\n *\n * @return true if the value is an absolute IRI, false if not.\n */\napi.isAbsolute = v => types.isString(v) && isAbsoluteRegex.test(v);\n\n/**\n * Returns true if the given value is a relative IRI, false if not.\n * Note: this is a weak check.\n *\n * @param v the value to check.\n *\n * @return true if the value is a relative IRI, false if not.\n */\napi.isRelative = v => types.isString(v);\n","/*\n * Copyright (c) 2017-2019 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst graphTypes = require('./graphTypes');\nconst types = require('./types');\n// TODO: move `IdentifierIssuer` to its own package\nconst IdentifierIssuer = require('rdf-canonize').IdentifierIssuer;\nconst JsonLdError = require('./JsonLdError');\n\n// constants\nconst REGEX_BCP47 = /^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;\nconst REGEX_LINK_HEADERS = /(?:<[^>]*?>|\"[^\"]*?\"|[^,])+/g;\nconst REGEX_LINK_HEADER = /\\s*<([^>]*?)>\\s*(?:;\\s*(.*))?/;\nconst REGEX_LINK_HEADER_PARAMS =\n /(.*?)=(?:(?:\"([^\"]*?)\")|([^\"]*?))\\s*(?:(?:;\\s*)|$)/g;\nconst REGEX_KEYWORD = /^@[a-zA-Z]+$/;\n\nconst DEFAULTS = {\n headers: {\n accept: 'application/ld+json, application/json'\n }\n};\n\nconst api = {};\nmodule.exports = api;\napi.IdentifierIssuer = IdentifierIssuer;\napi.REGEX_BCP47 = REGEX_BCP47;\napi.REGEX_KEYWORD = REGEX_KEYWORD;\n\n/**\n * Clones an object, array, Map, Set, or string/number. If a typed JavaScript\n * object is given, such as a Date, it will be converted to a string.\n *\n * @param value the value to clone.\n *\n * @return the cloned value.\n */\napi.clone = function(value) {\n if(value && typeof value === 'object') {\n let rval;\n if(types.isArray(value)) {\n rval = [];\n for(let i = 0; i < value.length; ++i) {\n rval[i] = api.clone(value[i]);\n }\n } else if(value instanceof Map) {\n rval = new Map();\n for(const [k, v] of value) {\n rval.set(k, api.clone(v));\n }\n } else if(value instanceof Set) {\n rval = new Set();\n for(const v of value) {\n rval.add(api.clone(v));\n }\n } else if(types.isObject(value)) {\n rval = {};\n for(const key in value) {\n rval[key] = api.clone(value[key]);\n }\n } else {\n rval = value.toString();\n }\n return rval;\n }\n return value;\n};\n\n/**\n * Ensure a value is an array. If the value is an array, it is returned.\n * Otherwise, it is wrapped in an array.\n *\n * @param value the value to return as an array.\n *\n * @return the value as an array.\n */\napi.asArray = function(value) {\n return Array.isArray(value) ? value : [value];\n};\n\n/**\n * Builds an HTTP headers object for making a JSON-LD request from custom\n * headers and asserts the `accept` header isn't overridden.\n *\n * @param headers an object of headers with keys as header names and values\n * as header values.\n *\n * @return an object of headers with a valid `accept` header.\n */\napi.buildHeaders = (headers = {}) => {\n const hasAccept = Object.keys(headers).some(\n h => h.toLowerCase() === 'accept');\n\n if(hasAccept) {\n throw new RangeError(\n 'Accept header may not be specified; only \"' +\n DEFAULTS.headers.accept + '\" is supported.');\n }\n\n return Object.assign({Accept: DEFAULTS.headers.accept}, headers);\n};\n\n/**\n * Parses a link header. The results will be key'd by the value of \"rel\".\n *\n * Link: ;\n * rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"\n *\n * Parses as: {\n * 'http://www.w3.org/ns/json-ld#context': {\n * target: http://json-ld.org/contexts/person.jsonld,\n * type: 'application/ld+json'\n * }\n * }\n *\n * If there is more than one \"rel\" with the same IRI, then entries in the\n * resulting map for that \"rel\" will be arrays.\n *\n * @param header the link header to parse.\n */\napi.parseLinkHeader = header => {\n const rval = {};\n // split on unbracketed/unquoted commas\n const entries = header.match(REGEX_LINK_HEADERS);\n for(let i = 0; i < entries.length; ++i) {\n let match = entries[i].match(REGEX_LINK_HEADER);\n if(!match) {\n continue;\n }\n const result = {target: match[1]};\n const params = match[2];\n while((match = REGEX_LINK_HEADER_PARAMS.exec(params))) {\n result[match[1]] = (match[2] === undefined) ? match[3] : match[2];\n }\n const rel = result.rel || '';\n if(Array.isArray(rval[rel])) {\n rval[rel].push(result);\n } else if(rval.hasOwnProperty(rel)) {\n rval[rel] = [rval[rel], result];\n } else {\n rval[rel] = result;\n }\n }\n return rval;\n};\n\n/**\n * Throws an exception if the given value is not a valid @type value.\n *\n * @param v the value to check.\n */\napi.validateTypeValue = (v, isFrame) => {\n if(types.isString(v)) {\n return;\n }\n\n if(types.isArray(v) && v.every(vv => types.isString(vv))) {\n return;\n }\n if(isFrame && types.isObject(v)) {\n switch(Object.keys(v).length) {\n case 0:\n // empty object is wildcard\n return;\n case 1:\n // default entry is all strings\n if('@default' in v &&\n api.asArray(v['@default']).every(vv => types.isString(vv))) {\n return;\n }\n }\n }\n\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@type\" value must a string, an array of ' +\n 'strings, an empty object, ' +\n 'or a default object.', 'jsonld.SyntaxError',\n {code: 'invalid type value', value: v});\n};\n\n/**\n * Returns true if the given subject has the given property.\n *\n * @param subject the subject to check.\n * @param property the property to look for.\n *\n * @return true if the subject has the given property, false if not.\n */\napi.hasProperty = (subject, property) => {\n if(subject.hasOwnProperty(property)) {\n const value = subject[property];\n return (!types.isArray(value) || value.length > 0);\n }\n return false;\n};\n\n/**\n * Determines if the given value is a property of the given subject.\n *\n * @param subject the subject to check.\n * @param property the property to check.\n * @param value the value to check.\n *\n * @return true if the value exists, false if not.\n */\napi.hasValue = (subject, property, value) => {\n if(api.hasProperty(subject, property)) {\n let val = subject[property];\n const isList = graphTypes.isList(val);\n if(types.isArray(val) || isList) {\n if(isList) {\n val = val['@list'];\n }\n for(let i = 0; i < val.length; ++i) {\n if(api.compareValues(value, val[i])) {\n return true;\n }\n }\n } else if(!types.isArray(value)) {\n // avoid matching the set of values with an array value parameter\n return api.compareValues(value, val);\n }\n }\n return false;\n};\n\n/**\n * Adds a value to a subject. If the value is an array, all values in the\n * array will be added.\n *\n * @param subject the subject to add the value to.\n * @param property the property that relates the value to the subject.\n * @param value the value to add.\n * @param [options] the options to use:\n * [propertyIsArray] true if the property is always an array, false\n * if not (default: false).\n * [valueIsArray] true if the value to be added should be preserved as\n * an array (lists) (default: false).\n * [allowDuplicate] true to allow duplicates, false not to (uses a\n * simple shallow comparison of subject ID or value) (default: true).\n * [prependValue] false to prepend value to any existing values.\n * (default: false)\n */\napi.addValue = (subject, property, value, options) => {\n options = options || {};\n if(!('propertyIsArray' in options)) {\n options.propertyIsArray = false;\n }\n if(!('valueIsArray' in options)) {\n options.valueIsArray = false;\n }\n if(!('allowDuplicate' in options)) {\n options.allowDuplicate = true;\n }\n if(!('prependValue' in options)) {\n options.prependValue = false;\n }\n\n if(options.valueIsArray) {\n subject[property] = value;\n } else if(types.isArray(value)) {\n if(value.length === 0 && options.propertyIsArray &&\n !subject.hasOwnProperty(property)) {\n subject[property] = [];\n }\n if(options.prependValue) {\n value = value.concat(subject[property]);\n subject[property] = [];\n }\n for(let i = 0; i < value.length; ++i) {\n api.addValue(subject, property, value[i], options);\n }\n } else if(subject.hasOwnProperty(property)) {\n // check if subject already has value if duplicates not allowed\n const hasValue = (!options.allowDuplicate &&\n api.hasValue(subject, property, value));\n\n // make property an array if value not present or always an array\n if(!types.isArray(subject[property]) &&\n (!hasValue || options.propertyIsArray)) {\n subject[property] = [subject[property]];\n }\n\n // add new value\n if(!hasValue) {\n if(options.prependValue) {\n subject[property].unshift(value);\n } else {\n subject[property].push(value);\n }\n }\n } else {\n // add new value as set or single value\n subject[property] = options.propertyIsArray ? [value] : value;\n }\n};\n\n/**\n * Gets all of the values for a subject's property as an array.\n *\n * @param subject the subject.\n * @param property the property.\n *\n * @return all of the values for a subject's property as an array.\n */\napi.getValues = (subject, property) => [].concat(subject[property] || []);\n\n/**\n * Removes a property from a subject.\n *\n * @param subject the subject.\n * @param property the property.\n */\napi.removeProperty = (subject, property) => {\n delete subject[property];\n};\n\n/**\n * Removes a value from a subject.\n *\n * @param subject the subject.\n * @param property the property that relates the value to the subject.\n * @param value the value to remove.\n * @param [options] the options to use:\n * [propertyIsArray] true if the property is always an array, false\n * if not (default: false).\n */\napi.removeValue = (subject, property, value, options) => {\n options = options || {};\n if(!('propertyIsArray' in options)) {\n options.propertyIsArray = false;\n }\n\n // filter out value\n const values = api.getValues(subject, property).filter(\n e => !api.compareValues(e, value));\n\n if(values.length === 0) {\n api.removeProperty(subject, property);\n } else if(values.length === 1 && !options.propertyIsArray) {\n subject[property] = values[0];\n } else {\n subject[property] = values;\n }\n};\n\n/**\n * Relabels all blank nodes in the given JSON-LD input.\n *\n * @param input the JSON-LD input.\n * @param [options] the options to use:\n * [issuer] an IdentifierIssuer to use to label blank nodes.\n */\napi.relabelBlankNodes = (input, options) => {\n options = options || {};\n const issuer = options.issuer || new IdentifierIssuer('_:b');\n return _labelBlankNodes(issuer, input);\n};\n\n/**\n * Compares two JSON-LD values for equality. Two JSON-LD values will be\n * considered equal if:\n *\n * 1. They are both primitives of the same type and value.\n * 2. They are both @values with the same @value, @type, @language,\n * and @index, OR\n * 3. They both have @ids they are the same.\n *\n * @param v1 the first value.\n * @param v2 the second value.\n *\n * @return true if v1 and v2 are considered equal, false if not.\n */\napi.compareValues = (v1, v2) => {\n // 1. equal primitives\n if(v1 === v2) {\n return true;\n }\n\n // 2. equal @values\n if(graphTypes.isValue(v1) && graphTypes.isValue(v2) &&\n v1['@value'] === v2['@value'] &&\n v1['@type'] === v2['@type'] &&\n v1['@language'] === v2['@language'] &&\n v1['@index'] === v2['@index']) {\n return true;\n }\n\n // 3. equal @ids\n if(types.isObject(v1) &&\n ('@id' in v1) &&\n types.isObject(v2) &&\n ('@id' in v2)) {\n return v1['@id'] === v2['@id'];\n }\n\n return false;\n};\n\n/**\n * Compares two strings first based on length and then lexicographically.\n *\n * @param a the first string.\n * @param b the second string.\n *\n * @return -1 if a < b, 1 if a > b, 0 if a === b.\n */\napi.compareShortestLeast = (a, b) => {\n if(a.length < b.length) {\n return -1;\n }\n if(b.length < a.length) {\n return 1;\n }\n if(a === b) {\n return 0;\n }\n return (a < b) ? -1 : 1;\n};\n\n/**\n * Labels the blank nodes in the given value using the given IdentifierIssuer.\n *\n * @param issuer the IdentifierIssuer to use.\n * @param element the element with blank nodes to rename.\n *\n * @return the element.\n */\nfunction _labelBlankNodes(issuer, element) {\n if(types.isArray(element)) {\n for(let i = 0; i < element.length; ++i) {\n element[i] = _labelBlankNodes(issuer, element[i]);\n }\n } else if(graphTypes.isList(element)) {\n element['@list'] = _labelBlankNodes(issuer, element['@list']);\n } else if(types.isObject(element)) {\n // relabel blank node\n if(graphTypes.isBlankNode(element)) {\n element['@id'] = issuer.getId(element['@id']);\n }\n\n // recursively apply to all keys\n const keys = Object.keys(element).sort();\n for(let ki = 0; ki < keys.length; ++ki) {\n const key = keys[ki];\n if(key !== '@id') {\n element[key] = _labelBlankNodes(issuer, element[key]);\n }\n }\n }\n\n return element;\n}\n","'use strict'\n\n// A linked list to keep track of recently-used-ness\nconst Yallist = require('yallist')\n\nconst MAX = Symbol('max')\nconst LENGTH = Symbol('length')\nconst LENGTH_CALCULATOR = Symbol('lengthCalculator')\nconst ALLOW_STALE = Symbol('allowStale')\nconst MAX_AGE = Symbol('maxAge')\nconst DISPOSE = Symbol('dispose')\nconst NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet')\nconst LRU_LIST = Symbol('lruList')\nconst CACHE = Symbol('cache')\nconst UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet')\n\nconst naiveLength = () => 1\n\n// lruList is a yallist where the head is the youngest\n// item, and the tail is the oldest. the list contains the Hit\n// objects as the entries.\n// Each Hit object has a reference to its Yallist.Node. This\n// never changes.\n//\n// cache is a Map (or PseudoMap) that matches the keys to\n// the Yallist.Node object.\nclass LRUCache {\n constructor (options) {\n if (typeof options === 'number')\n options = { max: options }\n\n if (!options)\n options = {}\n\n if (options.max && (typeof options.max !== 'number' || options.max < 0))\n throw new TypeError('max must be a non-negative number')\n // Kind of weird to have a default max of Infinity, but oh well.\n const max = this[MAX] = options.max || Infinity\n\n const lc = options.length || naiveLength\n this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc\n this[ALLOW_STALE] = options.stale || false\n if (options.maxAge && typeof options.maxAge !== 'number')\n throw new TypeError('maxAge must be a number')\n this[MAX_AGE] = options.maxAge || 0\n this[DISPOSE] = options.dispose\n this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false\n this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false\n this.reset()\n }\n\n // resize the cache when the max changes.\n set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }\n get max () {\n return this[MAX]\n }\n\n set allowStale (allowStale) {\n this[ALLOW_STALE] = !!allowStale\n }\n get allowStale () {\n return this[ALLOW_STALE]\n }\n\n set maxAge (mA) {\n if (typeof mA !== 'number')\n throw new TypeError('maxAge must be a non-negative number')\n\n this[MAX_AGE] = mA\n trim(this)\n }\n get maxAge () {\n return this[MAX_AGE]\n }\n\n // resize the cache when the lengthCalculator changes.\n set lengthCalculator (lC) {\n if (typeof lC !== 'function')\n lC = naiveLength\n\n if (lC !== this[LENGTH_CALCULATOR]) {\n this[LENGTH_CALCULATOR] = lC\n this[LENGTH] = 0\n this[LRU_LIST].forEach(hit => {\n hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key)\n this[LENGTH] += hit.length\n })\n }\n trim(this)\n }\n get lengthCalculator () { return this[LENGTH_CALCULATOR] }\n\n get length () { return this[LENGTH] }\n get itemCount () { return this[LRU_LIST].length }\n\n rforEach (fn, thisp) {\n thisp = thisp || this\n for (let walker = this[LRU_LIST].tail; walker !== null;) {\n const prev = walker.prev\n forEachStep(this, fn, walker, thisp)\n walker = prev\n }\n }\n\n forEach (fn, thisp) {\n thisp = thisp || this\n for (let walker = this[LRU_LIST].head; walker !== null;) {\n const next = walker.next\n forEachStep(this, fn, walker, thisp)\n walker = next\n }\n }\n\n keys () {\n return this[LRU_LIST].toArray().map(k => k.key)\n }\n\n values () {\n return this[LRU_LIST].toArray().map(k => k.value)\n }\n\n reset () {\n if (this[DISPOSE] &&\n this[LRU_LIST] &&\n this[LRU_LIST].length) {\n this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value))\n }\n\n this[CACHE] = new Map() // hash of items by key\n this[LRU_LIST] = new Yallist() // list of items in order of use recency\n this[LENGTH] = 0 // length of items in the list\n }\n\n dump () {\n return this[LRU_LIST].map(hit =>\n isStale(this, hit) ? false : {\n k: hit.key,\n v: hit.value,\n e: hit.now + (hit.maxAge || 0)\n }).toArray().filter(h => h)\n }\n\n dumpLru () {\n return this[LRU_LIST]\n }\n\n set (key, value, maxAge) {\n maxAge = maxAge || this[MAX_AGE]\n\n if (maxAge && typeof maxAge !== 'number')\n throw new TypeError('maxAge must be a number')\n\n const now = maxAge ? Date.now() : 0\n const len = this[LENGTH_CALCULATOR](value, key)\n\n if (this[CACHE].has(key)) {\n if (len > this[MAX]) {\n del(this, this[CACHE].get(key))\n return false\n }\n\n const node = this[CACHE].get(key)\n const item = node.value\n\n // dispose of the old one before overwriting\n // split out into 2 ifs for better coverage tracking\n if (this[DISPOSE]) {\n if (!this[NO_DISPOSE_ON_SET])\n this[DISPOSE](key, item.value)\n }\n\n item.now = now\n item.maxAge = maxAge\n item.value = value\n this[LENGTH] += len - item.length\n item.length = len\n this.get(key)\n trim(this)\n return true\n }\n\n const hit = new Entry(key, value, len, now, maxAge)\n\n // oversized objects fall out of cache automatically.\n if (hit.length > this[MAX]) {\n if (this[DISPOSE])\n this[DISPOSE](key, value)\n\n return false\n }\n\n this[LENGTH] += hit.length\n this[LRU_LIST].unshift(hit)\n this[CACHE].set(key, this[LRU_LIST].head)\n trim(this)\n return true\n }\n\n has (key) {\n if (!this[CACHE].has(key)) return false\n const hit = this[CACHE].get(key).value\n return !isStale(this, hit)\n }\n\n get (key) {\n return get(this, key, true)\n }\n\n peek (key) {\n return get(this, key, false)\n }\n\n pop () {\n const node = this[LRU_LIST].tail\n if (!node)\n return null\n\n del(this, node)\n return node.value\n }\n\n del (key) {\n del(this, this[CACHE].get(key))\n }\n\n load (arr) {\n // reset the cache\n this.reset()\n\n const now = Date.now()\n // A previous serialized cache has the most recent items first\n for (let l = arr.length - 1; l >= 0; l--) {\n const hit = arr[l]\n const expiresAt = hit.e || 0\n if (expiresAt === 0)\n // the item was created without expiration in a non aged cache\n this.set(hit.k, hit.v)\n else {\n const maxAge = expiresAt - now\n // dont add already expired items\n if (maxAge > 0) {\n this.set(hit.k, hit.v, maxAge)\n }\n }\n }\n }\n\n prune () {\n this[CACHE].forEach((value, key) => get(this, key, false))\n }\n}\n\nconst get = (self, key, doUse) => {\n const node = self[CACHE].get(key)\n if (node) {\n const hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!self[ALLOW_STALE])\n return undefined\n } else {\n if (doUse) {\n if (self[UPDATE_AGE_ON_GET])\n node.value.now = Date.now()\n self[LRU_LIST].unshiftNode(node)\n }\n }\n return hit.value\n }\n}\n\nconst isStale = (self, hit) => {\n if (!hit || (!hit.maxAge && !self[MAX_AGE]))\n return false\n\n const diff = Date.now() - hit.now\n return hit.maxAge ? diff > hit.maxAge\n : self[MAX_AGE] && (diff > self[MAX_AGE])\n}\n\nconst trim = self => {\n if (self[LENGTH] > self[MAX]) {\n for (let walker = self[LRU_LIST].tail;\n self[LENGTH] > self[MAX] && walker !== null;) {\n // We know that we're about to delete this one, and also\n // what the next least recently used key will be, so just\n // go ahead and set it now.\n const prev = walker.prev\n del(self, walker)\n walker = prev\n }\n }\n}\n\nconst del = (self, node) => {\n if (node) {\n const hit = node.value\n if (self[DISPOSE])\n self[DISPOSE](hit.key, hit.value)\n\n self[LENGTH] -= hit.length\n self[CACHE].delete(hit.key)\n self[LRU_LIST].removeNode(node)\n }\n}\n\nclass Entry {\n constructor (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n }\n}\n\nconst forEachStep = (self, fn, node, thisp) => {\n let hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!self[ALLOW_STALE])\n hit = undefined\n }\n if (hit)\n fn.call(thisp, hit.value, hit.key, self)\n}\n\nmodule.exports = LRUCache\n","'use strict'\nmodule.exports = function (Yallist) {\n Yallist.prototype[Symbol.iterator] = function* () {\n for (let walker = this.head; walker; walker = walker.next) {\n yield walker.value\n }\n }\n}\n","'use strict'\nmodule.exports = Yallist\n\nYallist.Node = Node\nYallist.create = Yallist\n\nfunction Yallist (list) {\n var self = this\n if (!(self instanceof Yallist)) {\n self = new Yallist()\n }\n\n self.tail = null\n self.head = null\n self.length = 0\n\n if (list && typeof list.forEach === 'function') {\n list.forEach(function (item) {\n self.push(item)\n })\n } else if (arguments.length > 0) {\n for (var i = 0, l = arguments.length; i < l; i++) {\n self.push(arguments[i])\n }\n }\n\n return self\n}\n\nYallist.prototype.removeNode = function (node) {\n if (node.list !== this) {\n throw new Error('removing node which does not belong to this list')\n }\n\n var next = node.next\n var prev = node.prev\n\n if (next) {\n next.prev = prev\n }\n\n if (prev) {\n prev.next = next\n }\n\n if (node === this.head) {\n this.head = next\n }\n if (node === this.tail) {\n this.tail = prev\n }\n\n node.list.length--\n node.next = null\n node.prev = null\n node.list = null\n\n return next\n}\n\nYallist.prototype.unshiftNode = function (node) {\n if (node === this.head) {\n return\n }\n\n if (node.list) {\n node.list.removeNode(node)\n }\n\n var head = this.head\n node.list = this\n node.next = head\n if (head) {\n head.prev = node\n }\n\n this.head = node\n if (!this.tail) {\n this.tail = node\n }\n this.length++\n}\n\nYallist.prototype.pushNode = function (node) {\n if (node === this.tail) {\n return\n }\n\n if (node.list) {\n node.list.removeNode(node)\n }\n\n var tail = this.tail\n node.list = this\n node.prev = tail\n if (tail) {\n tail.next = node\n }\n\n this.tail = node\n if (!this.head) {\n this.head = node\n }\n this.length++\n}\n\nYallist.prototype.push = function () {\n for (var i = 0, l = arguments.length; i < l; i++) {\n push(this, arguments[i])\n }\n return this.length\n}\n\nYallist.prototype.unshift = function () {\n for (var i = 0, l = arguments.length; i < l; i++) {\n unshift(this, arguments[i])\n }\n return this.length\n}\n\nYallist.prototype.pop = function () {\n if (!this.tail) {\n return undefined\n }\n\n var res = this.tail.value\n this.tail = this.tail.prev\n if (this.tail) {\n this.tail.next = null\n } else {\n this.head = null\n }\n this.length--\n return res\n}\n\nYallist.prototype.shift = function () {\n if (!this.head) {\n return undefined\n }\n\n var res = this.head.value\n this.head = this.head.next\n if (this.head) {\n this.head.prev = null\n } else {\n this.tail = null\n }\n this.length--\n return res\n}\n\nYallist.prototype.forEach = function (fn, thisp) {\n thisp = thisp || this\n for (var walker = this.head, i = 0; walker !== null; i++) {\n fn.call(thisp, walker.value, i, this)\n walker = walker.next\n }\n}\n\nYallist.prototype.forEachReverse = function (fn, thisp) {\n thisp = thisp || this\n for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {\n fn.call(thisp, walker.value, i, this)\n walker = walker.prev\n }\n}\n\nYallist.prototype.get = function (n) {\n for (var i = 0, walker = this.head; walker !== null && i < n; i++) {\n // abort out of the list early if we hit a cycle\n walker = walker.next\n }\n if (i === n && walker !== null) {\n return walker.value\n }\n}\n\nYallist.prototype.getReverse = function (n) {\n for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {\n // abort out of the list early if we hit a cycle\n walker = walker.prev\n }\n if (i === n && walker !== null) {\n return walker.value\n }\n}\n\nYallist.prototype.map = function (fn, thisp) {\n thisp = thisp || this\n var res = new Yallist()\n for (var walker = this.head; walker !== null;) {\n res.push(fn.call(thisp, walker.value, this))\n walker = walker.next\n }\n return res\n}\n\nYallist.prototype.mapReverse = function (fn, thisp) {\n thisp = thisp || this\n var res = new Yallist()\n for (var walker = this.tail; walker !== null;) {\n res.push(fn.call(thisp, walker.value, this))\n walker = walker.prev\n }\n return res\n}\n\nYallist.prototype.reduce = function (fn, initial) {\n var acc\n var walker = this.head\n if (arguments.length > 1) {\n acc = initial\n } else if (this.head) {\n walker = this.head.next\n acc = this.head.value\n } else {\n throw new TypeError('Reduce of empty list with no initial value')\n }\n\n for (var i = 0; walker !== null; i++) {\n acc = fn(acc, walker.value, i)\n walker = walker.next\n }\n\n return acc\n}\n\nYallist.prototype.reduceReverse = function (fn, initial) {\n var acc\n var walker = this.tail\n if (arguments.length > 1) {\n acc = initial\n } else if (this.tail) {\n walker = this.tail.prev\n acc = this.tail.value\n } else {\n throw new TypeError('Reduce of empty list with no initial value')\n }\n\n for (var i = this.length - 1; walker !== null; i--) {\n acc = fn(acc, walker.value, i)\n walker = walker.prev\n }\n\n return acc\n}\n\nYallist.prototype.toArray = function () {\n var arr = new Array(this.length)\n for (var i = 0, walker = this.head; walker !== null; i++) {\n arr[i] = walker.value\n walker = walker.next\n }\n return arr\n}\n\nYallist.prototype.toArrayReverse = function () {\n var arr = new Array(this.length)\n for (var i = 0, walker = this.tail; walker !== null; i++) {\n arr[i] = walker.value\n walker = walker.prev\n }\n return arr\n}\n\nYallist.prototype.slice = function (from, to) {\n to = to || this.length\n if (to < 0) {\n to += this.length\n }\n from = from || 0\n if (from < 0) {\n from += this.length\n }\n var ret = new Yallist()\n if (to < from || to < 0) {\n return ret\n }\n if (from < 0) {\n from = 0\n }\n if (to > this.length) {\n to = this.length\n }\n for (var i = 0, walker = this.head; walker !== null && i < from; i++) {\n walker = walker.next\n }\n for (; walker !== null && i < to; i++, walker = walker.next) {\n ret.push(walker.value)\n }\n return ret\n}\n\nYallist.prototype.sliceReverse = function (from, to) {\n to = to || this.length\n if (to < 0) {\n to += this.length\n }\n from = from || 0\n if (from < 0) {\n from += this.length\n }\n var ret = new Yallist()\n if (to < from || to < 0) {\n return ret\n }\n if (from < 0) {\n from = 0\n }\n if (to > this.length) {\n to = this.length\n }\n for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {\n walker = walker.prev\n }\n for (; walker !== null && i > from; i--, walker = walker.prev) {\n ret.push(walker.value)\n }\n return ret\n}\n\nYallist.prototype.splice = function (start, deleteCount, ...nodes) {\n if (start > this.length) {\n start = this.length - 1\n }\n if (start < 0) {\n start = this.length + start;\n }\n\n for (var i = 0, walker = this.head; walker !== null && i < start; i++) {\n walker = walker.next\n }\n\n var ret = []\n for (var i = 0; walker && i < deleteCount; i++) {\n ret.push(walker.value)\n walker = this.removeNode(walker)\n }\n if (walker === null) {\n walker = this.tail\n }\n\n if (walker !== this.head && walker !== this.tail) {\n walker = walker.prev\n }\n\n for (var i = 0; i < nodes.length; i++) {\n walker = insert(this, walker, nodes[i])\n }\n return ret;\n}\n\nYallist.prototype.reverse = function () {\n var head = this.head\n var tail = this.tail\n for (var walker = head; walker !== null; walker = walker.prev) {\n var p = walker.prev\n walker.prev = walker.next\n walker.next = p\n }\n this.head = tail\n this.tail = head\n return this\n}\n\nfunction insert (self, node, value) {\n var inserted = node === self.head ?\n new Node(value, null, node, self) :\n new Node(value, node, node.next, self)\n\n if (inserted.next === null) {\n self.tail = inserted\n }\n if (inserted.prev === null) {\n self.head = inserted\n }\n\n self.length++\n\n return inserted\n}\n\nfunction push (self, item) {\n self.tail = new Node(item, self.tail, null, self)\n if (!self.head) {\n self.head = self.tail\n }\n self.length++\n}\n\nfunction unshift (self, item) {\n self.head = new Node(item, null, self.head, self)\n if (!self.tail) {\n self.tail = self.head\n }\n self.length++\n}\n\nfunction Node (value, prev, next, list) {\n if (!(this instanceof Node)) {\n return new Node(value, prev, next, list)\n }\n\n this.list = list\n this.value = value\n\n if (prev) {\n prev.next = this\n this.prev = prev\n } else {\n this.prev = null\n }\n\n if (next) {\n next.prev = this\n this.next = next\n } else {\n this.next = null\n }\n}\n\ntry {\n // add if support for Symbol.iterator is present\n require('./iterator.js')(Yallist)\n} catch (er) {}\n","/**\n * An implementation of the RDF Dataset Normalization specification.\n *\n * @author Dave Longley\n *\n * Copyright 2010-2021 Digital Bazaar, Inc.\n */\nmodule.exports = require('./lib');\n","/*\n * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nmodule.exports = class IdentifierIssuer {\n /**\n * Creates a new IdentifierIssuer. A IdentifierIssuer issues unique\n * identifiers, keeping track of any previously issued identifiers.\n *\n * @param prefix the prefix to use ('').\n * @param existing an existing Map to use.\n * @param counter the counter to use.\n */\n constructor(prefix, existing = new Map(), counter = 0) {\n this.prefix = prefix;\n this._existing = existing;\n this.counter = counter;\n }\n\n /**\n * Copies this IdentifierIssuer.\n *\n * @return a copy of this IdentifierIssuer.\n */\n clone() {\n const {prefix, _existing, counter} = this;\n return new IdentifierIssuer(prefix, new Map(_existing), counter);\n }\n\n /**\n * Gets the new identifier for the given old identifier, where if no old\n * identifier is given a new identifier will be generated.\n *\n * @param [old] the old identifier to get the new identifier for.\n *\n * @return the new identifier.\n */\n getId(old) {\n // return existing old identifier\n const existing = old && this._existing.get(old);\n if(existing) {\n return existing;\n }\n\n // get next identifier\n const identifier = this.prefix + this.counter;\n this.counter++;\n\n // save mapping\n if(old) {\n this._existing.set(old, identifier);\n }\n\n return identifier;\n }\n\n /**\n * Returns true if the given old identifer has already been assigned a new\n * identifier.\n *\n * @param old the old identifier to check.\n *\n * @return true if the old identifier has been assigned a new identifier,\n * false if not.\n */\n hasId(old) {\n return this._existing.has(old);\n }\n\n /**\n * Returns all of the IDs that have been issued new IDs in the order in\n * which they were issued new IDs.\n *\n * @return the list of old IDs that has been issued new IDs in order.\n */\n getOldIds() {\n return [...this._existing.keys()];\n }\n};\n","/*!\n * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nrequire('setimmediate');\n\nconst crypto = self.crypto || self.msCrypto;\n\nmodule.exports = class MessageDigest {\n /**\n * Creates a new MessageDigest.\n *\n * @param algorithm the algorithm to use.\n */\n constructor(algorithm) {\n // check if crypto.subtle is available\n // check is here rather than top-level to only fail if class is used\n if(!(crypto && crypto.subtle)) {\n throw new Error('crypto.subtle not found.');\n }\n if(algorithm === 'sha256') {\n this.algorithm = {name: 'SHA-256'};\n } else if(algorithm === 'sha1') {\n this.algorithm = {name: 'SHA-1'};\n } else {\n throw new Error(`Unsupported algorithm \"${algorithm}\".`);\n }\n this._content = '';\n }\n\n update(msg) {\n this._content += msg;\n }\n\n async digest() {\n const data = new TextEncoder().encode(this._content);\n const buffer = new Uint8Array(\n await crypto.subtle.digest(this.algorithm, data));\n // return digest in hex\n let hex = '';\n for(let i = 0; i < buffer.length; ++i) {\n hex += buffer[i].toString(16).padStart(2, '0');\n }\n return hex;\n }\n};\n","/*!\n * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\n// eslint-disable-next-line no-unused-vars\nconst TERMS = ['subject', 'predicate', 'object', 'graph'];\nconst RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';\nconst RDF_LANGSTRING = RDF + 'langString';\nconst XSD_STRING = 'http://www.w3.org/2001/XMLSchema#string';\n\nconst TYPE_NAMED_NODE = 'NamedNode';\nconst TYPE_BLANK_NODE = 'BlankNode';\nconst TYPE_LITERAL = 'Literal';\nconst TYPE_DEFAULT_GRAPH = 'DefaultGraph';\n\n// build regexes\nconst REGEX = {};\n(() => {\n const iri = '(?:<([^:]+:[^>]*)>)';\n // https://www.w3.org/TR/turtle/#grammar-production-BLANK_NODE_LABEL\n const PN_CHARS_BASE =\n 'A-Z' + 'a-z' +\n '\\u00C0-\\u00D6' +\n '\\u00D8-\\u00F6' +\n '\\u00F8-\\u02FF' +\n '\\u0370-\\u037D' +\n '\\u037F-\\u1FFF' +\n '\\u200C-\\u200D' +\n '\\u2070-\\u218F' +\n '\\u2C00-\\u2FEF' +\n '\\u3001-\\uD7FF' +\n '\\uF900-\\uFDCF' +\n '\\uFDF0-\\uFFFD';\n // TODO:\n //'\\u10000-\\uEFFFF';\n const PN_CHARS_U =\n PN_CHARS_BASE +\n '_';\n const PN_CHARS =\n PN_CHARS_U +\n '0-9' +\n '-' +\n '\\u00B7' +\n '\\u0300-\\u036F' +\n '\\u203F-\\u2040';\n const BLANK_NODE_LABEL =\n '(_:' +\n '(?:[' + PN_CHARS_U + '0-9])' +\n '(?:(?:[' + PN_CHARS + '.])*(?:[' + PN_CHARS + ']))?' +\n ')';\n const bnode = BLANK_NODE_LABEL;\n const plain = '\"([^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*)\"';\n const datatype = '(?:\\\\^\\\\^' + iri + ')';\n const language = '(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*))';\n const literal = '(?:' + plain + '(?:' + datatype + '|' + language + ')?)';\n const ws = '[ \\\\t]+';\n const wso = '[ \\\\t]*';\n\n // define quad part regexes\n const subject = '(?:' + iri + '|' + bnode + ')' + ws;\n const property = iri + ws;\n const object = '(?:' + iri + '|' + bnode + '|' + literal + ')' + wso;\n const graphName = '(?:\\\\.|(?:(?:' + iri + '|' + bnode + ')' + wso + '\\\\.))';\n\n // end of line and empty regexes\n REGEX.eoln = /(?:\\r\\n)|(?:\\n)|(?:\\r)/g;\n REGEX.empty = new RegExp('^' + wso + '$');\n\n // full quad regex\n REGEX.quad = new RegExp(\n '^' + wso + subject + property + object + graphName + wso + '$');\n})();\n\nmodule.exports = class NQuads {\n /**\n * Parses RDF in the form of N-Quads.\n *\n * @param input the N-Quads input to parse.\n *\n * @return an RDF dataset (an array of quads per http://rdf.js.org/).\n */\n static parse(input) {\n // build RDF dataset\n const dataset = [];\n\n const graphs = {};\n\n // split N-Quad input into lines\n const lines = input.split(REGEX.eoln);\n let lineNumber = 0;\n for(const line of lines) {\n lineNumber++;\n\n // skip empty lines\n if(REGEX.empty.test(line)) {\n continue;\n }\n\n // parse quad\n const match = line.match(REGEX.quad);\n if(match === null) {\n throw new Error('N-Quads parse error on line ' + lineNumber + '.');\n }\n\n // create RDF quad\n const quad = {subject: null, predicate: null, object: null, graph: null};\n\n // get subject\n if(match[1] !== undefined) {\n quad.subject = {termType: TYPE_NAMED_NODE, value: match[1]};\n } else {\n quad.subject = {termType: TYPE_BLANK_NODE, value: match[2]};\n }\n\n // get predicate\n quad.predicate = {termType: TYPE_NAMED_NODE, value: match[3]};\n\n // get object\n if(match[4] !== undefined) {\n quad.object = {termType: TYPE_NAMED_NODE, value: match[4]};\n } else if(match[5] !== undefined) {\n quad.object = {termType: TYPE_BLANK_NODE, value: match[5]};\n } else {\n quad.object = {\n termType: TYPE_LITERAL,\n value: undefined,\n datatype: {\n termType: TYPE_NAMED_NODE\n }\n };\n if(match[7] !== undefined) {\n quad.object.datatype.value = match[7];\n } else if(match[8] !== undefined) {\n quad.object.datatype.value = RDF_LANGSTRING;\n quad.object.language = match[8];\n } else {\n quad.object.datatype.value = XSD_STRING;\n }\n quad.object.value = _unescape(match[6]);\n }\n\n // get graph\n if(match[9] !== undefined) {\n quad.graph = {\n termType: TYPE_NAMED_NODE,\n value: match[9]\n };\n } else if(match[10] !== undefined) {\n quad.graph = {\n termType: TYPE_BLANK_NODE,\n value: match[10]\n };\n } else {\n quad.graph = {\n termType: TYPE_DEFAULT_GRAPH,\n value: ''\n };\n }\n\n // only add quad if it is unique in its graph\n if(!(quad.graph.value in graphs)) {\n graphs[quad.graph.value] = [quad];\n dataset.push(quad);\n } else {\n let unique = true;\n const quads = graphs[quad.graph.value];\n for(const q of quads) {\n if(_compareTriples(q, quad)) {\n unique = false;\n break;\n }\n }\n if(unique) {\n quads.push(quad);\n dataset.push(quad);\n }\n }\n }\n\n return dataset;\n }\n\n /**\n * Converts an RDF dataset to N-Quads.\n *\n * @param dataset (array of quads) the RDF dataset to convert.\n *\n * @return the N-Quads string.\n */\n static serialize(dataset) {\n if(!Array.isArray(dataset)) {\n dataset = NQuads.legacyDatasetToQuads(dataset);\n }\n const quads = [];\n for(const quad of dataset) {\n quads.push(NQuads.serializeQuad(quad));\n }\n return quads.sort().join('');\n }\n\n /**\n * Converts RDF quad components to an N-Quad string (a single quad).\n *\n * @param {Object} s - N-Quad subject component.\n * @param {Object} p - N-Quad predicate component.\n * @param {Object} o - N-Quad object component.\n * @param {Object} g - N-Quad graph component.\n *\n * @return {string} the N-Quad.\n */\n static serializeQuadComponents(s, p, o, g) {\n let nquad = '';\n\n // subject can only be NamedNode or BlankNode\n if(s.termType === TYPE_NAMED_NODE) {\n nquad += `<${s.value}>`;\n } else {\n nquad += `${s.value}`;\n }\n\n // predicate can only be NamedNode\n nquad += ` <${p.value}> `;\n\n // object is NamedNode, BlankNode, or Literal\n if(o.termType === TYPE_NAMED_NODE) {\n nquad += `<${o.value}>`;\n } else if(o.termType === TYPE_BLANK_NODE) {\n nquad += o.value;\n } else {\n nquad += `\"${_escape(o.value)}\"`;\n if(o.datatype.value === RDF_LANGSTRING) {\n if(o.language) {\n nquad += `@${o.language}`;\n }\n } else if(o.datatype.value !== XSD_STRING) {\n nquad += `^^<${o.datatype.value}>`;\n }\n }\n\n // graph can only be NamedNode or BlankNode (or DefaultGraph, but that\n // does not add to `nquad`)\n if(g.termType === TYPE_NAMED_NODE) {\n nquad += ` <${g.value}>`;\n } else if(g.termType === TYPE_BLANK_NODE) {\n nquad += ` ${g.value}`;\n }\n\n nquad += ' .\\n';\n return nquad;\n }\n\n /**\n * Converts an RDF quad to an N-Quad string (a single quad).\n *\n * @param quad the RDF quad convert.\n *\n * @return the N-Quad string.\n */\n static serializeQuad(quad) {\n return NQuads.serializeQuadComponents(\n quad.subject, quad.predicate, quad.object, quad.graph);\n }\n\n /**\n * Converts a legacy-formatted dataset to an array of quads dataset per\n * http://rdf.js.org/.\n *\n * @param dataset the legacy dataset to convert.\n *\n * @return the array of quads dataset.\n */\n static legacyDatasetToQuads(dataset) {\n const quads = [];\n\n const termTypeMap = {\n 'blank node': TYPE_BLANK_NODE,\n IRI: TYPE_NAMED_NODE,\n literal: TYPE_LITERAL\n };\n\n for(const graphName in dataset) {\n const triples = dataset[graphName];\n triples.forEach(triple => {\n const quad = {};\n for(const componentName in triple) {\n const oldComponent = triple[componentName];\n const newComponent = {\n termType: termTypeMap[oldComponent.type],\n value: oldComponent.value\n };\n if(newComponent.termType === TYPE_LITERAL) {\n newComponent.datatype = {\n termType: TYPE_NAMED_NODE\n };\n if('datatype' in oldComponent) {\n newComponent.datatype.value = oldComponent.datatype;\n }\n if('language' in oldComponent) {\n if(!('datatype' in oldComponent)) {\n newComponent.datatype.value = RDF_LANGSTRING;\n }\n newComponent.language = oldComponent.language;\n } else if(!('datatype' in oldComponent)) {\n newComponent.datatype.value = XSD_STRING;\n }\n }\n quad[componentName] = newComponent;\n }\n if(graphName === '@default') {\n quad.graph = {\n termType: TYPE_DEFAULT_GRAPH,\n value: ''\n };\n } else {\n quad.graph = {\n termType: graphName.startsWith('_:') ?\n TYPE_BLANK_NODE : TYPE_NAMED_NODE,\n value: graphName\n };\n }\n quads.push(quad);\n });\n }\n\n return quads;\n }\n};\n\n/**\n * Compares two RDF triples for equality.\n *\n * @param t1 the first triple.\n * @param t2 the second triple.\n *\n * @return true if the triples are the same, false if not.\n */\nfunction _compareTriples(t1, t2) {\n // compare subject and object types first as it is the quickest check\n if(!(t1.subject.termType === t2.subject.termType &&\n t1.object.termType === t2.object.termType)) {\n return false;\n }\n // compare values\n if(!(t1.subject.value === t2.subject.value &&\n t1.predicate.value === t2.predicate.value &&\n t1.object.value === t2.object.value)) {\n return false;\n }\n if(t1.object.termType !== TYPE_LITERAL) {\n // no `datatype` or `language` to check\n return true;\n }\n return (\n (t1.object.datatype.termType === t2.object.datatype.termType) &&\n (t1.object.language === t2.object.language) &&\n (t1.object.datatype.value === t2.object.datatype.value)\n );\n}\n\nconst _escapeRegex = /[\"\\\\\\n\\r]/g;\n/**\n * Escape string to N-Quads literal\n */\nfunction _escape(s) {\n return s.replace(_escapeRegex, function(match) {\n switch(match) {\n case '\"': return '\\\\\"';\n case '\\\\': return '\\\\\\\\';\n case '\\n': return '\\\\n';\n case '\\r': return '\\\\r';\n }\n });\n}\n\nconst _unescapeRegex =\n /(?:\\\\([tbnrf\"'\\\\]))|(?:\\\\u([0-9A-Fa-f]{4}))|(?:\\\\U([0-9A-Fa-f]{8}))/g;\n/**\n * Unescape N-Quads literal to string\n */\nfunction _unescape(s) {\n return s.replace(_unescapeRegex, function(match, code, u, U) {\n if(code) {\n switch(code) {\n case 't': return '\\t';\n case 'b': return '\\b';\n case 'n': return '\\n';\n case 'r': return '\\r';\n case 'f': return '\\f';\n case '\"': return '\"';\n case '\\'': return '\\'';\n case '\\\\': return '\\\\';\n }\n }\n if(u) {\n return String.fromCharCode(parseInt(u, 16));\n }\n if(U) {\n // FIXME: support larger values\n throw new Error('Unsupported U escape');\n }\n });\n}\n","/*!\n * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nmodule.exports = class Permuter {\n /**\n * A Permuter iterates over all possible permutations of the given array\n * of elements.\n *\n * @param list the array of elements to iterate over.\n */\n constructor(list) {\n // original array\n this.current = list.sort();\n // indicates whether there are more permutations\n this.done = false;\n // directional info for permutation algorithm\n this.dir = new Map();\n for(let i = 0; i < list.length; ++i) {\n this.dir.set(list[i], true);\n }\n }\n\n /**\n * Returns true if there is another permutation.\n *\n * @return true if there is another permutation, false if not.\n */\n hasNext() {\n return !this.done;\n }\n\n /**\n * Gets the next permutation. Call hasNext() to ensure there is another one\n * first.\n *\n * @return the next permutation.\n */\n next() {\n // copy current permutation to return it\n const {current, dir} = this;\n const rval = current.slice();\n\n /* Calculate the next permutation using the Steinhaus-Johnson-Trotter\n permutation algorithm. */\n\n // get largest mobile element k\n // (mobile: element is greater than the one it is looking at)\n let k = null;\n let pos = 0;\n const length = current.length;\n for(let i = 0; i < length; ++i) {\n const element = current[i];\n const left = dir.get(element);\n if((k === null || element > k) &&\n ((left && i > 0 && element > current[i - 1]) ||\n (!left && i < (length - 1) && element > current[i + 1]))) {\n k = element;\n pos = i;\n }\n }\n\n // no more permutations\n if(k === null) {\n this.done = true;\n } else {\n // swap k and the element it is looking at\n const swap = dir.get(k) ? pos - 1 : pos + 1;\n current[pos] = current[swap];\n current[swap] = k;\n\n // reverse the direction of all elements larger than k\n for(const element of current) {\n if(element > k) {\n dir.set(element, !dir.get(element));\n }\n }\n }\n\n return rval;\n }\n};\n","/*!\n * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst IdentifierIssuer = require('./IdentifierIssuer');\nconst MessageDigest = require('./MessageDigest');\nconst Permuter = require('./Permuter');\nconst NQuads = require('./NQuads');\n\nmodule.exports = class URDNA2015 {\n constructor({\n createMessageDigest = () => new MessageDigest('sha256'),\n canonicalIdMap = new Map(),\n maxDeepIterations = Infinity\n } = {}) {\n this.name = 'URDNA2015';\n this.blankNodeInfo = new Map();\n this.canonicalIssuer = new IdentifierIssuer('_:c14n', canonicalIdMap);\n this.createMessageDigest = createMessageDigest;\n this.maxDeepIterations = maxDeepIterations;\n this.quads = null;\n this.deepIterations = null;\n }\n\n // 4.4) Normalization Algorithm\n async main(dataset) {\n this.deepIterations = new Map();\n this.quads = dataset;\n\n // 1) Create the normalization state.\n // 2) For every quad in input dataset:\n for(const quad of dataset) {\n // 2.1) For each blank node that occurs in the quad, add a reference\n // to the quad using the blank node identifier in the blank node to\n // quads map, creating a new entry if necessary.\n this._addBlankNodeQuadInfo({quad, component: quad.subject});\n this._addBlankNodeQuadInfo({quad, component: quad.object});\n this._addBlankNodeQuadInfo({quad, component: quad.graph});\n }\n\n // 3) Create a list of non-normalized blank node identifiers\n // non-normalized identifiers and populate it using the keys from the\n // blank node to quads map.\n // Note: We use a map here and it was generated during step 2.\n\n // 4) `simple` flag is skipped -- loop is optimized away. This optimization\n // is permitted because there was a typo in the hash first degree quads\n // algorithm in the URDNA2015 spec that was implemented widely making it\n // such that it could not be fixed; the result was that the loop only\n // needs to be run once and the first degree quad hashes will never change.\n // 5.1-5.2 are skipped; first degree quad hashes are generated just once\n // for all non-normalized blank nodes.\n\n // 5.3) For each blank node identifier identifier in non-normalized\n // identifiers:\n const hashToBlankNodes = new Map();\n const nonNormalized = [...this.blankNodeInfo.keys()];\n let i = 0;\n for(const id of nonNormalized) {\n // Note: batch hashing first degree quads 100 at a time\n if(++i % 100 === 0) {\n await this._yield();\n }\n // steps 5.3.1 and 5.3.2:\n await this._hashAndTrackBlankNode({id, hashToBlankNodes});\n }\n\n // 5.4) For each hash to identifier list mapping in hash to blank\n // nodes map, lexicographically-sorted by hash:\n const hashes = [...hashToBlankNodes.keys()].sort();\n // optimize away second sort, gather non-unique hashes in order as we go\n const nonUnique = [];\n for(const hash of hashes) {\n // 5.4.1) If the length of identifier list is greater than 1,\n // continue to the next mapping.\n const idList = hashToBlankNodes.get(hash);\n if(idList.length > 1) {\n nonUnique.push(idList);\n continue;\n }\n\n // 5.4.2) Use the Issue Identifier algorithm, passing canonical\n // issuer and the single blank node identifier in identifier\n // list, identifier, to issue a canonical replacement identifier\n // for identifier.\n const id = idList[0];\n this.canonicalIssuer.getId(id);\n\n // Note: These steps are skipped, optimized away since the loop\n // only needs to be run once.\n // 5.4.3) Remove identifier from non-normalized identifiers.\n // 5.4.4) Remove hash from the hash to blank nodes map.\n // 5.4.5) Set simple to true.\n }\n\n // 6) For each hash to identifier list mapping in hash to blank nodes map,\n // lexicographically-sorted by hash:\n // Note: sort optimized away, use `nonUnique`.\n for(const idList of nonUnique) {\n // 6.1) Create hash path list where each item will be a result of\n // running the Hash N-Degree Quads algorithm.\n const hashPathList = [];\n\n // 6.2) For each blank node identifier identifier in identifier list:\n for(const id of idList) {\n // 6.2.1) If a canonical identifier has already been issued for\n // identifier, continue to the next identifier.\n if(this.canonicalIssuer.hasId(id)) {\n continue;\n }\n\n // 6.2.2) Create temporary issuer, an identifier issuer\n // initialized with the prefix _:b.\n const issuer = new IdentifierIssuer('_:b');\n\n // 6.2.3) Use the Issue Identifier algorithm, passing temporary\n // issuer and identifier, to issue a new temporary blank node\n // identifier for identifier.\n issuer.getId(id);\n\n // 6.2.4) Run the Hash N-Degree Quads algorithm, passing\n // temporary issuer, and append the result to the hash path list.\n const result = await this.hashNDegreeQuads(id, issuer);\n hashPathList.push(result);\n }\n\n // 6.3) For each result in the hash path list,\n // lexicographically-sorted by the hash in result:\n hashPathList.sort(_stringHashCompare);\n for(const result of hashPathList) {\n // 6.3.1) For each blank node identifier, existing identifier,\n // that was issued a temporary identifier by identifier issuer\n // in result, issue a canonical identifier, in the same order,\n // using the Issue Identifier algorithm, passing canonical\n // issuer and existing identifier.\n const oldIds = result.issuer.getOldIds();\n for(const id of oldIds) {\n this.canonicalIssuer.getId(id);\n }\n }\n }\n\n /* Note: At this point all blank nodes in the set of RDF quads have been\n assigned canonical identifiers, which have been stored in the canonical\n issuer. Here each quad is updated by assigning each of its blank nodes\n its new identifier. */\n\n // 7) For each quad, quad, in input dataset:\n const normalized = [];\n for(const quad of this.quads) {\n // 7.1) Create a copy, quad copy, of quad and replace any existing\n // blank node identifiers using the canonical identifiers\n // previously issued by canonical issuer.\n // Note: We optimize away the copy here.\n const nQuad = NQuads.serializeQuadComponents(\n this._componentWithCanonicalId(quad.subject),\n quad.predicate,\n this._componentWithCanonicalId(quad.object),\n this._componentWithCanonicalId(quad.graph)\n );\n // 7.2) Add quad copy to the normalized dataset.\n normalized.push(nQuad);\n }\n\n // sort normalized output\n normalized.sort();\n\n // 8) Return the normalized dataset.\n return normalized.join('');\n }\n\n // 4.6) Hash First Degree Quads\n async hashFirstDegreeQuads(id) {\n // 1) Initialize nquads to an empty list. It will be used to store quads in\n // N-Quads format.\n const nquads = [];\n\n // 2) Get the list of quads `quads` associated with the reference blank node\n // identifier in the blank node to quads map.\n const info = this.blankNodeInfo.get(id);\n const quads = info.quads;\n\n // 3) For each quad `quad` in `quads`:\n for(const quad of quads) {\n // 3.1) Serialize the quad in N-Quads format with the following special\n // rule:\n\n // 3.1.1) If any component in quad is an blank node, then serialize it\n // using a special identifier as follows:\n const copy = {\n subject: null, predicate: quad.predicate, object: null, graph: null\n };\n // 3.1.2) If the blank node's existing blank node identifier matches\n // the reference blank node identifier then use the blank node\n // identifier _:a, otherwise, use the blank node identifier _:z.\n copy.subject = this.modifyFirstDegreeComponent(\n id, quad.subject, 'subject');\n copy.object = this.modifyFirstDegreeComponent(\n id, quad.object, 'object');\n copy.graph = this.modifyFirstDegreeComponent(\n id, quad.graph, 'graph');\n nquads.push(NQuads.serializeQuad(copy));\n }\n\n // 4) Sort nquads in lexicographical order.\n nquads.sort();\n\n // 5) Return the hash that results from passing the sorted, joined nquads\n // through the hash algorithm.\n const md = this.createMessageDigest();\n for(const nquad of nquads) {\n md.update(nquad);\n }\n info.hash = await md.digest();\n return info.hash;\n }\n\n // 4.7) Hash Related Blank Node\n async hashRelatedBlankNode(related, quad, issuer, position) {\n // 1) Set the identifier to use for related, preferring first the canonical\n // identifier for related if issued, second the identifier issued by issuer\n // if issued, and last, if necessary, the result of the Hash First Degree\n // Quads algorithm, passing related.\n let id;\n if(this.canonicalIssuer.hasId(related)) {\n id = this.canonicalIssuer.getId(related);\n } else if(issuer.hasId(related)) {\n id = issuer.getId(related);\n } else {\n id = this.blankNodeInfo.get(related).hash;\n }\n\n // 2) Initialize a string input to the value of position.\n // Note: We use a hash object instead.\n const md = this.createMessageDigest();\n md.update(position);\n\n // 3) If position is not g, append <, the value of the predicate in quad,\n // and > to input.\n if(position !== 'g') {\n md.update(this.getRelatedPredicate(quad));\n }\n\n // 4) Append identifier to input.\n md.update(id);\n\n // 5) Return the hash that results from passing input through the hash\n // algorithm.\n return md.digest();\n }\n\n // 4.8) Hash N-Degree Quads\n async hashNDegreeQuads(id, issuer) {\n const deepIterations = this.deepIterations.get(id) || 0;\n if(deepIterations > this.maxDeepIterations) {\n throw new Error(\n `Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);\n }\n this.deepIterations.set(id, deepIterations + 1);\n\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n // Note: 2) and 3) handled within `createHashToRelated`\n const md = this.createMessageDigest();\n const hashToRelated = await this.createHashToRelated(id, issuer);\n\n // 4) Create an empty string, data to hash.\n // Note: We created a hash object `md` above instead.\n\n // 5) For each related hash to blank node list mapping in hash to related\n // blank nodes map, sorted lexicographically by related hash:\n const hashes = [...hashToRelated.keys()].sort();\n for(const hash of hashes) {\n // 5.1) Append the related hash to the data to hash.\n md.update(hash);\n\n // 5.2) Create a string chosen path.\n let chosenPath = '';\n\n // 5.3) Create an unset chosen issuer variable.\n let chosenIssuer;\n\n // 5.4) For each permutation of blank node list:\n const permuter = new Permuter(hashToRelated.get(hash));\n let i = 0;\n while(permuter.hasNext()) {\n const permutation = permuter.next();\n // Note: batch permutations 3 at a time\n if(++i % 3 === 0) {\n await this._yield();\n }\n\n // 5.4.1) Create a copy of issuer, issuer copy.\n let issuerCopy = issuer.clone();\n\n // 5.4.2) Create a string path.\n let path = '';\n\n // 5.4.3) Create a recursion list, to store blank node identifiers\n // that must be recursively processed by this algorithm.\n const recursionList = [];\n\n // 5.4.4) For each related in permutation:\n let nextPermutation = false;\n for(const related of permutation) {\n // 5.4.4.1) If a canonical identifier has been issued for\n // related, append it to path.\n if(this.canonicalIssuer.hasId(related)) {\n path += this.canonicalIssuer.getId(related);\n } else {\n // 5.4.4.2) Otherwise:\n // 5.4.4.2.1) If issuer copy has not issued an identifier for\n // related, append related to recursion list.\n if(!issuerCopy.hasId(related)) {\n recursionList.push(related);\n }\n // 5.4.4.2.2) Use the Issue Identifier algorithm, passing\n // issuer copy and related and append the result to path.\n path += issuerCopy.getId(related);\n }\n\n // 5.4.4.3) If chosen path is not empty and the length of path\n // is greater than or equal to the length of chosen path and\n // path is lexicographically greater than chosen path, then\n // skip to the next permutation.\n // Note: Comparing path length to chosen path length can be optimized\n // away; only compare lexicographically.\n if(chosenPath.length !== 0 && path > chosenPath) {\n nextPermutation = true;\n break;\n }\n }\n\n if(nextPermutation) {\n continue;\n }\n\n // 5.4.5) For each related in recursion list:\n for(const related of recursionList) {\n // 5.4.5.1) Set result to the result of recursively executing\n // the Hash N-Degree Quads algorithm, passing related for\n // identifier and issuer copy for path identifier issuer.\n const result = await this.hashNDegreeQuads(related, issuerCopy);\n\n // 5.4.5.2) Use the Issue Identifier algorithm, passing issuer\n // copy and related and append the result to path.\n path += issuerCopy.getId(related);\n\n // 5.4.5.3) Append <, the hash in result, and > to path.\n path += `<${result.hash}>`;\n\n // 5.4.5.4) Set issuer copy to the identifier issuer in\n // result.\n issuerCopy = result.issuer;\n\n // 5.4.5.5) If chosen path is not empty and the length of path\n // is greater than or equal to the length of chosen path and\n // path is lexicographically greater than chosen path, then\n // skip to the next permutation.\n // Note: Comparing path length to chosen path length can be optimized\n // away; only compare lexicographically.\n if(chosenPath.length !== 0 && path > chosenPath) {\n nextPermutation = true;\n break;\n }\n }\n\n if(nextPermutation) {\n continue;\n }\n\n // 5.4.6) If chosen path is empty or path is lexicographically\n // less than chosen path, set chosen path to path and chosen\n // issuer to issuer copy.\n if(chosenPath.length === 0 || path < chosenPath) {\n chosenPath = path;\n chosenIssuer = issuerCopy;\n }\n }\n\n // 5.5) Append chosen path to data to hash.\n md.update(chosenPath);\n\n // 5.6) Replace issuer, by reference, with chosen issuer.\n issuer = chosenIssuer;\n }\n\n // 6) Return issuer and the hash that results from passing data to hash\n // through the hash algorithm.\n return {hash: await md.digest(), issuer};\n }\n\n // helper for modifying component during Hash First Degree Quads\n modifyFirstDegreeComponent(id, component) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n /* Note: A mistake in the URDNA2015 spec that made its way into\n implementations (and therefore must stay to avoid interop breakage)\n resulted in an assigned canonical ID, if available for\n `component.value`, not being used in place of `_:a`/`_:z`, so\n we don't use it here. */\n return {\n termType: 'BlankNode',\n value: component.value === id ? '_:a' : '_:z'\n };\n }\n\n // helper for getting a related predicate\n getRelatedPredicate(quad) {\n return `<${quad.predicate.value}>`;\n }\n\n // helper for creating hash to related blank nodes map\n async createHashToRelated(id, issuer) {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map();\n\n // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n const quads = this.blankNodeInfo.get(id).quads;\n\n // 3) For each quad in quads:\n let i = 0;\n for(const quad of quads) {\n // Note: batch hashing related blank node quads 100 at a time\n if(++i % 100 === 0) {\n await this._yield();\n }\n // 3.1) For each component in quad, if component is the subject, object,\n // and graph name and it is a blank node that is not identified by\n // identifier:\n // steps 3.1.1 and 3.1.2 occur in helpers:\n await Promise.all([\n this._addRelatedBlankNodeHash({\n quad, component: quad.subject, position: 's',\n id, issuer, hashToRelated\n }),\n this._addRelatedBlankNodeHash({\n quad, component: quad.object, position: 'o',\n id, issuer, hashToRelated\n }),\n this._addRelatedBlankNodeHash({\n quad, component: quad.graph, position: 'g',\n id, issuer, hashToRelated\n })\n ]);\n }\n\n return hashToRelated;\n }\n\n async _hashAndTrackBlankNode({id, hashToBlankNodes}) {\n // 5.3.1) Create a hash, hash, according to the Hash First Degree\n // Quads algorithm.\n const hash = await this.hashFirstDegreeQuads(id);\n\n // 5.3.2) Add hash and identifier to hash to blank nodes map,\n // creating a new entry if necessary.\n const idList = hashToBlankNodes.get(hash);\n if(!idList) {\n hashToBlankNodes.set(hash, [id]);\n } else {\n idList.push(id);\n }\n }\n\n _addBlankNodeQuadInfo({quad, component}) {\n if(component.termType !== 'BlankNode') {\n return;\n }\n const id = component.value;\n const info = this.blankNodeInfo.get(id);\n if(info) {\n info.quads.add(quad);\n } else {\n this.blankNodeInfo.set(id, {quads: new Set([quad]), hash: null});\n }\n }\n\n async _addRelatedBlankNodeHash(\n {quad, component, position, id, issuer, hashToRelated}) {\n if(!(component.termType === 'BlankNode' && component.value !== id)) {\n return;\n }\n // 3.1.1) Set hash to the result of the Hash Related Blank Node\n // algorithm, passing the blank node identifier for component as\n // related, quad, path identifier issuer as issuer, and position as\n // either s, o, or g based on whether component is a subject, object,\n // graph name, respectively.\n const related = component.value;\n const hash = await this.hashRelatedBlankNode(\n related, quad, issuer, position);\n\n // 3.1.2) Add a mapping of hash to the blank node identifier for\n // component to hash to related blank nodes map, adding an entry as\n // necessary.\n const entries = hashToRelated.get(hash);\n if(entries) {\n entries.push(related);\n } else {\n hashToRelated.set(hash, [related]);\n }\n }\n\n // canonical ids for 7.1\n _componentWithCanonicalId(component) {\n if(component.termType === 'BlankNode' &&\n !component.value.startsWith(this.canonicalIssuer.prefix)) {\n // create new BlankNode\n return {\n termType: 'BlankNode',\n value: this.canonicalIssuer.getId(component.value)\n };\n }\n return component;\n }\n\n async _yield() {\n return new Promise(resolve => setImmediate(resolve));\n }\n};\n\nfunction _stringHashCompare(a, b) {\n return a.hash < b.hash ? -1 : a.hash > b.hash ? 1 : 0;\n}\n","/*!\n * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst IdentifierIssuer = require('./IdentifierIssuer');\n// FIXME: do not import; convert to requiring a\n// hash factory\nconst MessageDigest = require('./MessageDigest');\nconst Permuter = require('./Permuter');\nconst NQuads = require('./NQuads');\n\nmodule.exports = class URDNA2015Sync {\n constructor({\n createMessageDigest = () => new MessageDigest('sha256'),\n canonicalIdMap = new Map(),\n maxDeepIterations = Infinity\n } = {}) {\n this.name = 'URDNA2015';\n this.blankNodeInfo = new Map();\n this.canonicalIssuer = new IdentifierIssuer('_:c14n', canonicalIdMap);\n this.createMessageDigest = createMessageDigest;\n this.maxDeepIterations = maxDeepIterations;\n this.quads = null;\n this.deepIterations = null;\n }\n\n // 4.4) Normalization Algorithm\n main(dataset) {\n this.deepIterations = new Map();\n this.quads = dataset;\n\n // 1) Create the normalization state.\n // 2) For every quad in input dataset:\n for(const quad of dataset) {\n // 2.1) For each blank node that occurs in the quad, add a reference\n // to the quad using the blank node identifier in the blank node to\n // quads map, creating a new entry if necessary.\n this._addBlankNodeQuadInfo({quad, component: quad.subject});\n this._addBlankNodeQuadInfo({quad, component: quad.object});\n this._addBlankNodeQuadInfo({quad, component: quad.graph});\n }\n\n // 3) Create a list of non-normalized blank node identifiers\n // non-normalized identifiers and populate it using the keys from the\n // blank node to quads map.\n // Note: We use a map here and it was generated during step 2.\n\n // 4) `simple` flag is skipped -- loop is optimized away. This optimization\n // is permitted because there was a typo in the hash first degree quads\n // algorithm in the URDNA2015 spec that was implemented widely making it\n // such that it could not be fixed; the result was that the loop only\n // needs to be run once and the first degree quad hashes will never change.\n // 5.1-5.2 are skipped; first degree quad hashes are generated just once\n // for all non-normalized blank nodes.\n\n // 5.3) For each blank node identifier identifier in non-normalized\n // identifiers:\n const hashToBlankNodes = new Map();\n const nonNormalized = [...this.blankNodeInfo.keys()];\n for(const id of nonNormalized) {\n // steps 5.3.1 and 5.3.2:\n this._hashAndTrackBlankNode({id, hashToBlankNodes});\n }\n\n // 5.4) For each hash to identifier list mapping in hash to blank\n // nodes map, lexicographically-sorted by hash:\n const hashes = [...hashToBlankNodes.keys()].sort();\n // optimize away second sort, gather non-unique hashes in order as we go\n const nonUnique = [];\n for(const hash of hashes) {\n // 5.4.1) If the length of identifier list is greater than 1,\n // continue to the next mapping.\n const idList = hashToBlankNodes.get(hash);\n if(idList.length > 1) {\n nonUnique.push(idList);\n continue;\n }\n\n // 5.4.2) Use the Issue Identifier algorithm, passing canonical\n // issuer and the single blank node identifier in identifier\n // list, identifier, to issue a canonical replacement identifier\n // for identifier.\n const id = idList[0];\n this.canonicalIssuer.getId(id);\n\n // Note: These steps are skipped, optimized away since the loop\n // only needs to be run once.\n // 5.4.3) Remove identifier from non-normalized identifiers.\n // 5.4.4) Remove hash from the hash to blank nodes map.\n // 5.4.5) Set simple to true.\n }\n\n // 6) For each hash to identifier list mapping in hash to blank nodes map,\n // lexicographically-sorted by hash:\n // Note: sort optimized away, use `nonUnique`.\n for(const idList of nonUnique) {\n // 6.1) Create hash path list where each item will be a result of\n // running the Hash N-Degree Quads algorithm.\n const hashPathList = [];\n\n // 6.2) For each blank node identifier identifier in identifier list:\n for(const id of idList) {\n // 6.2.1) If a canonical identifier has already been issued for\n // identifier, continue to the next identifier.\n if(this.canonicalIssuer.hasId(id)) {\n continue;\n }\n\n // 6.2.2) Create temporary issuer, an identifier issuer\n // initialized with the prefix _:b.\n const issuer = new IdentifierIssuer('_:b');\n\n // 6.2.3) Use the Issue Identifier algorithm, passing temporary\n // issuer and identifier, to issue a new temporary blank node\n // identifier for identifier.\n issuer.getId(id);\n\n // 6.2.4) Run the Hash N-Degree Quads algorithm, passing\n // temporary issuer, and append the result to the hash path list.\n const result = this.hashNDegreeQuads(id, issuer);\n hashPathList.push(result);\n }\n\n // 6.3) For each result in the hash path list,\n // lexicographically-sorted by the hash in result:\n hashPathList.sort(_stringHashCompare);\n for(const result of hashPathList) {\n // 6.3.1) For each blank node identifier, existing identifier,\n // that was issued a temporary identifier by identifier issuer\n // in result, issue a canonical identifier, in the same order,\n // using the Issue Identifier algorithm, passing canonical\n // issuer and existing identifier.\n const oldIds = result.issuer.getOldIds();\n for(const id of oldIds) {\n this.canonicalIssuer.getId(id);\n }\n }\n }\n\n /* Note: At this point all blank nodes in the set of RDF quads have been\n assigned canonical identifiers, which have been stored in the canonical\n issuer. Here each quad is updated by assigning each of its blank nodes\n its new identifier. */\n\n // 7) For each quad, quad, in input dataset:\n const normalized = [];\n for(const quad of this.quads) {\n // 7.1) Create a copy, quad copy, of quad and replace any existing\n // blank node identifiers using the canonical identifiers\n // previously issued by canonical issuer.\n // Note: We optimize away the copy here.\n const nQuad = NQuads.serializeQuadComponents(\n this._componentWithCanonicalId({component: quad.subject}),\n quad.predicate,\n this._componentWithCanonicalId({component: quad.object}),\n this._componentWithCanonicalId({component: quad.graph})\n );\n // 7.2) Add quad copy to the normalized dataset.\n normalized.push(nQuad);\n }\n\n // sort normalized output\n normalized.sort();\n\n // 8) Return the normalized dataset.\n return normalized.join('');\n }\n\n // 4.6) Hash First Degree Quads\n hashFirstDegreeQuads(id) {\n // 1) Initialize nquads to an empty list. It will be used to store quads in\n // N-Quads format.\n const nquads = [];\n\n // 2) Get the list of quads `quads` associated with the reference blank node\n // identifier in the blank node to quads map.\n const info = this.blankNodeInfo.get(id);\n const quads = info.quads;\n\n // 3) For each quad `quad` in `quads`:\n for(const quad of quads) {\n // 3.1) Serialize the quad in N-Quads format with the following special\n // rule:\n\n // 3.1.1) If any component in quad is an blank node, then serialize it\n // using a special identifier as follows:\n const copy = {\n subject: null, predicate: quad.predicate, object: null, graph: null\n };\n // 3.1.2) If the blank node's existing blank node identifier matches\n // the reference blank node identifier then use the blank node\n // identifier _:a, otherwise, use the blank node identifier _:z.\n copy.subject = this.modifyFirstDegreeComponent(\n id, quad.subject, 'subject');\n copy.object = this.modifyFirstDegreeComponent(\n id, quad.object, 'object');\n copy.graph = this.modifyFirstDegreeComponent(\n id, quad.graph, 'graph');\n nquads.push(NQuads.serializeQuad(copy));\n }\n\n // 4) Sort nquads in lexicographical order.\n nquads.sort();\n\n // 5) Return the hash that results from passing the sorted, joined nquads\n // through the hash algorithm.\n const md = this.createMessageDigest();\n for(const nquad of nquads) {\n md.update(nquad);\n }\n info.hash = md.digest();\n return info.hash;\n }\n\n // 4.7) Hash Related Blank Node\n hashRelatedBlankNode(related, quad, issuer, position) {\n // 1) Set the identifier to use for related, preferring first the canonical\n // identifier for related if issued, second the identifier issued by issuer\n // if issued, and last, if necessary, the result of the Hash First Degree\n // Quads algorithm, passing related.\n let id;\n if(this.canonicalIssuer.hasId(related)) {\n id = this.canonicalIssuer.getId(related);\n } else if(issuer.hasId(related)) {\n id = issuer.getId(related);\n } else {\n id = this.blankNodeInfo.get(related).hash;\n }\n\n // 2) Initialize a string input to the value of position.\n // Note: We use a hash object instead.\n const md = this.createMessageDigest();\n md.update(position);\n\n // 3) If position is not g, append <, the value of the predicate in quad,\n // and > to input.\n if(position !== 'g') {\n md.update(this.getRelatedPredicate(quad));\n }\n\n // 4) Append identifier to input.\n md.update(id);\n\n // 5) Return the hash that results from passing input through the hash\n // algorithm.\n return md.digest();\n }\n\n // 4.8) Hash N-Degree Quads\n hashNDegreeQuads(id, issuer) {\n const deepIterations = this.deepIterations.get(id) || 0;\n if(deepIterations > this.maxDeepIterations) {\n throw new Error(\n `Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);\n }\n this.deepIterations.set(id, deepIterations + 1);\n\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n // Note: 2) and 3) handled within `createHashToRelated`\n const md = this.createMessageDigest();\n const hashToRelated = this.createHashToRelated(id, issuer);\n\n // 4) Create an empty string, data to hash.\n // Note: We created a hash object `md` above instead.\n\n // 5) For each related hash to blank node list mapping in hash to related\n // blank nodes map, sorted lexicographically by related hash:\n const hashes = [...hashToRelated.keys()].sort();\n for(const hash of hashes) {\n // 5.1) Append the related hash to the data to hash.\n md.update(hash);\n\n // 5.2) Create a string chosen path.\n let chosenPath = '';\n\n // 5.3) Create an unset chosen issuer variable.\n let chosenIssuer;\n\n // 5.4) For each permutation of blank node list:\n const permuter = new Permuter(hashToRelated.get(hash));\n while(permuter.hasNext()) {\n const permutation = permuter.next();\n\n // 5.4.1) Create a copy of issuer, issuer copy.\n let issuerCopy = issuer.clone();\n\n // 5.4.2) Create a string path.\n let path = '';\n\n // 5.4.3) Create a recursion list, to store blank node identifiers\n // that must be recursively processed by this algorithm.\n const recursionList = [];\n\n // 5.4.4) For each related in permutation:\n let nextPermutation = false;\n for(const related of permutation) {\n // 5.4.4.1) If a canonical identifier has been issued for\n // related, append it to path.\n if(this.canonicalIssuer.hasId(related)) {\n path += this.canonicalIssuer.getId(related);\n } else {\n // 5.4.4.2) Otherwise:\n // 5.4.4.2.1) If issuer copy has not issued an identifier for\n // related, append related to recursion list.\n if(!issuerCopy.hasId(related)) {\n recursionList.push(related);\n }\n // 5.4.4.2.2) Use the Issue Identifier algorithm, passing\n // issuer copy and related and append the result to path.\n path += issuerCopy.getId(related);\n }\n\n // 5.4.4.3) If chosen path is not empty and the length of path\n // is greater than or equal to the length of chosen path and\n // path is lexicographically greater than chosen path, then\n // skip to the next permutation.\n // Note: Comparing path length to chosen path length can be optimized\n // away; only compare lexicographically.\n if(chosenPath.length !== 0 && path > chosenPath) {\n nextPermutation = true;\n break;\n }\n }\n\n if(nextPermutation) {\n continue;\n }\n\n // 5.4.5) For each related in recursion list:\n for(const related of recursionList) {\n // 5.4.5.1) Set result to the result of recursively executing\n // the Hash N-Degree Quads algorithm, passing related for\n // identifier and issuer copy for path identifier issuer.\n const result = this.hashNDegreeQuads(related, issuerCopy);\n\n // 5.4.5.2) Use the Issue Identifier algorithm, passing issuer\n // copy and related and append the result to path.\n path += issuerCopy.getId(related);\n\n // 5.4.5.3) Append <, the hash in result, and > to path.\n path += `<${result.hash}>`;\n\n // 5.4.5.4) Set issuer copy to the identifier issuer in\n // result.\n issuerCopy = result.issuer;\n\n // 5.4.5.5) If chosen path is not empty and the length of path\n // is greater than or equal to the length of chosen path and\n // path is lexicographically greater than chosen path, then\n // skip to the next permutation.\n // Note: Comparing path length to chosen path length can be optimized\n // away; only compare lexicographically.\n if(chosenPath.length !== 0 && path > chosenPath) {\n nextPermutation = true;\n break;\n }\n }\n\n if(nextPermutation) {\n continue;\n }\n\n // 5.4.6) If chosen path is empty or path is lexicographically\n // less than chosen path, set chosen path to path and chosen\n // issuer to issuer copy.\n if(chosenPath.length === 0 || path < chosenPath) {\n chosenPath = path;\n chosenIssuer = issuerCopy;\n }\n }\n\n // 5.5) Append chosen path to data to hash.\n md.update(chosenPath);\n\n // 5.6) Replace issuer, by reference, with chosen issuer.\n issuer = chosenIssuer;\n }\n\n // 6) Return issuer and the hash that results from passing data to hash\n // through the hash algorithm.\n return {hash: md.digest(), issuer};\n }\n\n // helper for modifying component during Hash First Degree Quads\n modifyFirstDegreeComponent(id, component) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n /* Note: A mistake in the URDNA2015 spec that made its way into\n implementations (and therefore must stay to avoid interop breakage)\n resulted in an assigned canonical ID, if available for\n `component.value`, not being used in place of `_:a`/`_:z`, so\n we don't use it here. */\n return {\n termType: 'BlankNode',\n value: component.value === id ? '_:a' : '_:z'\n };\n }\n\n // helper for getting a related predicate\n getRelatedPredicate(quad) {\n return `<${quad.predicate.value}>`;\n }\n\n // helper for creating hash to related blank nodes map\n createHashToRelated(id, issuer) {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map();\n\n // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n const quads = this.blankNodeInfo.get(id).quads;\n\n // 3) For each quad in quads:\n for(const quad of quads) {\n // 3.1) For each component in quad, if component is the subject, object,\n // or graph name and it is a blank node that is not identified by\n // identifier:\n // steps 3.1.1 and 3.1.2 occur in helpers:\n this._addRelatedBlankNodeHash({\n quad, component: quad.subject, position: 's',\n id, issuer, hashToRelated\n });\n this._addRelatedBlankNodeHash({\n quad, component: quad.object, position: 'o',\n id, issuer, hashToRelated\n });\n this._addRelatedBlankNodeHash({\n quad, component: quad.graph, position: 'g',\n id, issuer, hashToRelated\n });\n }\n\n return hashToRelated;\n }\n\n _hashAndTrackBlankNode({id, hashToBlankNodes}) {\n // 5.3.1) Create a hash, hash, according to the Hash First Degree\n // Quads algorithm.\n const hash = this.hashFirstDegreeQuads(id);\n\n // 5.3.2) Add hash and identifier to hash to blank nodes map,\n // creating a new entry if necessary.\n const idList = hashToBlankNodes.get(hash);\n if(!idList) {\n hashToBlankNodes.set(hash, [id]);\n } else {\n idList.push(id);\n }\n }\n\n _addBlankNodeQuadInfo({quad, component}) {\n if(component.termType !== 'BlankNode') {\n return;\n }\n const id = component.value;\n const info = this.blankNodeInfo.get(id);\n if(info) {\n info.quads.add(quad);\n } else {\n this.blankNodeInfo.set(id, {quads: new Set([quad]), hash: null});\n }\n }\n\n _addRelatedBlankNodeHash(\n {quad, component, position, id, issuer, hashToRelated}) {\n if(!(component.termType === 'BlankNode' && component.value !== id)) {\n return;\n }\n // 3.1.1) Set hash to the result of the Hash Related Blank Node\n // algorithm, passing the blank node identifier for component as\n // related, quad, path identifier issuer as issuer, and position as\n // either s, o, or g based on whether component is a subject, object,\n // graph name, respectively.\n const related = component.value;\n const hash = this.hashRelatedBlankNode(related, quad, issuer, position);\n\n // 3.1.2) Add a mapping of hash to the blank node identifier for\n // component to hash to related blank nodes map, adding an entry as\n // necessary.\n const entries = hashToRelated.get(hash);\n if(entries) {\n entries.push(related);\n } else {\n hashToRelated.set(hash, [related]);\n }\n }\n\n // canonical ids for 7.1\n _componentWithCanonicalId({component}) {\n if(component.termType === 'BlankNode' &&\n !component.value.startsWith(this.canonicalIssuer.prefix)) {\n // create new BlankNode\n return {\n termType: 'BlankNode',\n value: this.canonicalIssuer.getId(component.value)\n };\n }\n return component;\n }\n};\n\nfunction _stringHashCompare(a, b) {\n return a.hash < b.hash ? -1 : a.hash > b.hash ? 1 : 0;\n}\n","/*!\n * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst MessageDigest = require('./MessageDigest');\nconst URDNA2015 = require('./URDNA2015');\n\nmodule.exports = class URDNA2012 extends URDNA2015 {\n constructor() {\n super();\n this.name = 'URGNA2012';\n this.createMessageDigest = () => new MessageDigest('sha1');\n }\n\n // helper for modifying component during Hash First Degree Quads\n modifyFirstDegreeComponent(id, component, key) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n if(key === 'graph') {\n return {\n termType: 'BlankNode',\n value: '_:g'\n };\n }\n return {\n termType: 'BlankNode',\n value: (component.value === id ? '_:a' : '_:z')\n };\n }\n\n // helper for getting a related predicate\n getRelatedPredicate(quad) {\n return quad.predicate.value;\n }\n\n // helper for creating hash to related blank nodes map\n async createHashToRelated(id, issuer) {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map();\n\n // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n const quads = this.blankNodeInfo.get(id).quads;\n\n // 3) For each quad in quads:\n let i = 0;\n for(const quad of quads) {\n // 3.1) If the quad's subject is a blank node that does not match\n // identifier, set hash to the result of the Hash Related Blank Node\n // algorithm, passing the blank node identifier for subject as related,\n // quad, path identifier issuer as issuer, and p as position.\n let position;\n let related;\n if(quad.subject.termType === 'BlankNode' && quad.subject.value !== id) {\n related = quad.subject.value;\n position = 'p';\n } else if(\n quad.object.termType === 'BlankNode' && quad.object.value !== id) {\n // 3.2) Otherwise, if quad's object is a blank node that does not match\n // identifier, to the result of the Hash Related Blank Node algorithm,\n // passing the blank node identifier for object as related, quad, path\n // identifier issuer as issuer, and r as position.\n related = quad.object.value;\n position = 'r';\n } else {\n // 3.3) Otherwise, continue to the next quad.\n continue;\n }\n // Note: batch hashing related blank nodes 100 at a time\n if(++i % 100 === 0) {\n await this._yield();\n }\n // 3.4) Add a mapping of hash to the blank node identifier for the\n // component that matched (subject or object) to hash to related blank\n // nodes map, adding an entry as necessary.\n const hash = await this.hashRelatedBlankNode(\n related, quad, issuer, position);\n const entries = hashToRelated.get(hash);\n if(entries) {\n entries.push(related);\n } else {\n hashToRelated.set(hash, [related]);\n }\n }\n\n return hashToRelated;\n }\n};\n","/*!\n * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst MessageDigest = require('./MessageDigest');\nconst URDNA2015Sync = require('./URDNA2015Sync');\n\nmodule.exports = class URDNA2012Sync extends URDNA2015Sync {\n constructor() {\n super();\n this.name = 'URGNA2012';\n this.createMessageDigest = () => new MessageDigest('sha1');\n }\n\n // helper for modifying component during Hash First Degree Quads\n modifyFirstDegreeComponent(id, component, key) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n if(key === 'graph') {\n return {\n termType: 'BlankNode',\n value: '_:g'\n };\n }\n return {\n termType: 'BlankNode',\n value: (component.value === id ? '_:a' : '_:z')\n };\n }\n\n // helper for getting a related predicate\n getRelatedPredicate(quad) {\n return quad.predicate.value;\n }\n\n // helper for creating hash to related blank nodes map\n createHashToRelated(id, issuer) {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map();\n\n // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n const quads = this.blankNodeInfo.get(id).quads;\n\n // 3) For each quad in quads:\n for(const quad of quads) {\n // 3.1) If the quad's subject is a blank node that does not match\n // identifier, set hash to the result of the Hash Related Blank Node\n // algorithm, passing the blank node identifier for subject as related,\n // quad, path identifier issuer as issuer, and p as position.\n let position;\n let related;\n if(quad.subject.termType === 'BlankNode' && quad.subject.value !== id) {\n related = quad.subject.value;\n position = 'p';\n } else if(\n quad.object.termType === 'BlankNode' && quad.object.value !== id) {\n // 3.2) Otherwise, if quad's object is a blank node that does not match\n // identifier, to the result of the Hash Related Blank Node algorithm,\n // passing the blank node identifier for object as related, quad, path\n // identifier issuer as issuer, and r as position.\n related = quad.object.value;\n position = 'r';\n } else {\n // 3.3) Otherwise, continue to the next quad.\n continue;\n }\n // 3.4) Add a mapping of hash to the blank node identifier for the\n // component that matched (subject or object) to hash to related blank\n // nodes map, adding an entry as necessary.\n const hash = this.hashRelatedBlankNode(related, quad, issuer, position);\n const entries = hashToRelated.get(hash);\n if(entries) {\n entries.push(related);\n } else {\n hashToRelated.set(hash, [related]);\n }\n }\n\n return hashToRelated;\n }\n};\n","/**\n * An implementation of the RDF Dataset Normalization specification.\n * This library works in the browser and node.js.\n *\n * BSD 3-Clause License\n * Copyright (c) 2016-2023 Digital Bazaar, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * Neither the name of the Digital Bazaar, Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n * IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\n * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n'use strict';\n\nconst URDNA2015 = require('./URDNA2015');\nconst URGNA2012 = require('./URGNA2012');\nconst URDNA2015Sync = require('./URDNA2015Sync');\nconst URGNA2012Sync = require('./URGNA2012Sync');\n\n// optional native support\nlet rdfCanonizeNative;\ntry {\n rdfCanonizeNative = require('rdf-canonize-native');\n} catch(e) {}\n\n// return a dataset from input dataset or legacy dataset\nfunction _inputToDataset(input/*, options*/) {\n // back-compat with legacy dataset\n if(!Array.isArray(input)) {\n return exports.NQuads.legacyDatasetToQuads(input);\n }\n return input;\n}\n\n// expose helpers\nexports.NQuads = require('./NQuads');\nexports.IdentifierIssuer = require('./IdentifierIssuer');\n\n/**\n * Get or set native API.\n *\n * @param api the native API.\n *\n * @return the currently set native API.\n */\nexports._rdfCanonizeNative = function(api) {\n if(api) {\n rdfCanonizeNative = api;\n }\n return rdfCanonizeNative;\n};\n\n/**\n * Asynchronously canonizes an RDF dataset.\n *\n * @param {Array|object|string} input - The input to canonize given as a\n * dataset or legacy dataset.\n * @param {object} options - The options to use:\n * {string} algorithm - The canonicalization algorithm to use, `URDNA2015` or\n * `URGNA2012`.\n * {Function} [createMessageDigest] - A factory function for creating a\n * `MessageDigest` interface that overrides the built-in message digest\n * implementation used by the canonize algorithm; note that using a hash\n * algorithm (or HMAC algorithm) that differs from the one specified by\n * the canonize algorithm will result in different output.\n * {Map} [canonicalIdMap] - An optional Map to be populated by the canonical\n * identifier issuer with the bnode identifier mapping generated by the\n * canonicalization algorithm.\n * {boolean} [useNative=false] - Use native implementation.\n * {number} [maxDeepIterations=Infinity] - The maximum number of times to run\n * deep comparison algorithms (such as the N-Degree Hash Quads algorithm\n * used in URDNA2015) before bailing out and throwing an error; this is a\n * useful setting for preventing wasted CPU cycles or DoS when canonizing\n * meaningless or potentially malicious datasets, a recommended value is\n * `1`.\n *\n * @return a Promise that resolves to the canonicalized RDF Dataset.\n */\nexports.canonize = async function(input, options) {\n const dataset = _inputToDataset(input, options);\n\n if(options.useNative) {\n if(!rdfCanonizeNative) {\n throw new Error('rdf-canonize-native not available');\n }\n if(options.createMessageDigest) {\n throw new Error(\n '\"createMessageDigest\" cannot be used with \"useNative\".');\n }\n return new Promise((resolve, reject) =>\n rdfCanonizeNative.canonize(dataset, options, (err, canonical) =>\n err ? reject(err) : resolve(canonical)));\n }\n\n if(options.algorithm === 'URDNA2015') {\n return new URDNA2015(options).main(dataset);\n }\n if(options.algorithm === 'URGNA2012') {\n if(options.createMessageDigest) {\n throw new Error(\n '\"createMessageDigest\" cannot be used with \"URGNA2012\".');\n }\n return new URGNA2012(options).main(dataset);\n }\n if(!('algorithm' in options)) {\n throw new Error('No RDF Dataset Canonicalization algorithm specified.');\n }\n throw new Error(\n 'Invalid RDF Dataset Canonicalization algorithm: ' + options.algorithm);\n};\n\n/**\n * This method is no longer available in the public API, it is for testing\n * only. It synchronously canonizes an RDF dataset and does not work in the\n * browser.\n *\n * @param {Array|object|string} input - The input to canonize given as a\n * dataset or legacy dataset.\n * @param {object} options - The options to use:\n * {string} algorithm - The canonicalization algorithm to use, `URDNA2015` or\n * `URGNA2012`.\n * {Function} [createMessageDigest] - A factory function for creating a\n * `MessageDigest` interface that overrides the built-in message digest\n * implementation used by the canonize algorithm; note that using a hash\n * algorithm (or HMAC algorithm) that differs from the one specified by\n * the canonize algorithm will result in different output.\n * {boolean} [useNative=false] - Use native implementation.\n * {number} [maxDeepIterations=Infinity] - The maximum number of times to run\n * deep comparison algorithms (such as the N-Degree Hash Quads algorithm\n * used in URDNA2015) before bailing out and throwing an error; this is a\n * useful setting for preventing wasted CPU cycles or DoS when canonizing\n * meaningless or potentially malicious datasets, a recommended value is\n * `1`.\n *\n * @return the RDF dataset in canonical form.\n */\nexports._canonizeSync = function(input, options) {\n const dataset = _inputToDataset(input, options);\n\n if(options.useNative) {\n if(!rdfCanonizeNative) {\n throw new Error('rdf-canonize-native not available');\n }\n if(options.createMessageDigest) {\n throw new Error(\n '\"createMessageDigest\" cannot be used with \"useNative\".');\n }\n return rdfCanonizeNative.canonizeSync(dataset, options);\n }\n if(options.algorithm === 'URDNA2015') {\n return new URDNA2015Sync(options).main(dataset);\n }\n if(options.algorithm === 'URGNA2012') {\n if(options.createMessageDigest) {\n throw new Error(\n '\"createMessageDigest\" cannot be used with \"URGNA2012\".');\n }\n return new URGNA2012Sync(options).main(dataset);\n }\n if(!('algorithm' in options)) {\n throw new Error('No RDF Dataset Canonicalization algorithm specified.');\n }\n throw new Error(\n 'Invalid RDF Dataset Canonicalization algorithm: ' + options.algorithm);\n};\n","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a \r\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Footer.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Footer.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./Footer.vue?vue&type=template&id=579b6b3e\"\nimport script from \"./Footer.vue?vue&type=script&lang=js\"\nexport * from \"./Footer.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('v-app-bar',{attrs:{\"app\":\"\",\"flat\":\"\",\"clipped-left\":\"\"}},[_c('router-link',{attrs:{\"to\":\"/\"}},[_c('v-img',{staticClass:\"mx-2\",attrs:{\"src\":_vm.app_logo,\"max-height\":\"40\",\"max-width\":\"40\",\"contain\":\"\"}})],1),_c('v-toolbar-title',[_vm._v(_vm._s(_vm.app_name))])],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Topbar.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Topbar.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./Topbar.vue?vue&type=template&id=5a5c0e34\"\nimport script from \"./Topbar.vue?vue&type=script&lang=js\"\nexport * from \"./Topbar.vue?vue&type=script&lang=js\"\nimport style0 from \"./Topbar.vue?vue&type=style&index=0&id=5a5c0e34&prod&lang=css\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\r\n\r\n\r\n\r\n","import mod from \"-!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./App.vue?vue&type=template&id=fefcadbe\"\nimport script from \"./App.vue?vue&type=script&lang=js\"\nexport * from \"./App.vue?vue&type=script&lang=js\"\nimport style0 from \"./App.vue?vue&type=style&index=0&id=fefcadbe&prod&lang=css\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import Vue from 'vue';\r\nimport Vuetify from 'vuetify/lib/framework';\r\nimport '@mdi/font/css/materialdesignicons.css'\r\n\r\nVue.use(Vuetify);\r\n\r\nexport default new Vuetify({\r\n theme: {\r\n themes: {\r\n light: {\r\n primary: '#757575', },\r\n }\r\n }\r\n});\r\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[_c('PageTitle',{attrs:{\"title\":_vm.asset_type,\"show_breadcrumbs\":true}}),_c('v-row',{staticClass:\"px-10 my-2\"},[_c('v-col',{staticClass:\"py-2\",attrs:{\"cols\":\"8\"}},[_c('p',[_c('b',[_vm._v(\"Fill the form with all the metadata and download the RDF\")]),_vm._v(\" representation using \"),_c('a',{attrs:{\"href\":\"https://w3id.org/mobilitydcat-ap/\"}},[_vm._v(\"mobilityDCAT-AP\")]),_vm._v(\". Test and experiment to learn how different information should be described in RDF according to the mobilityDCAT-AP specification. The form is compliant with the minimum profile required by mobilityDCAT-AP.\"),_c('br'),_c('br'),_vm._v(\" This page is powered by \"),_c('b',[_vm._v(\"KCONG (Knowledge Catalogue and Governance)\")]),_vm._v(\" a complete (meta)data catalogue solution developed by \"),_c('a',{attrs:{\"href\":\"https://www.cefriel.com/\"}},[_vm._v(\"Cefriel\")]),_vm._v(\". If you want to know more visit \"),_c('a',{attrs:{\"href\":\"https://kcong.cefriel.com/\"}},[_vm._v(\"https://kcong.cefriel.com/\")]),_vm._v(\". The page is client-side only so all the information inserted are not collected/stored and can not be retrieved if the page is reloaded.\")])]),_c('v-col',{staticClass:\"text-center py-2\",attrs:{\"cols\":\"4\"}},[_c('img',{staticStyle:{\"max-height\":\"100px\"},attrs:{\"src\":require(\"@/assets/logo.png\"),\"alt\":\"Company Logo\"}})])],1),_vm._l((_vm.alert_messages),function(alert_message,index){return _c('Alert',{key:index,attrs:{\"message\":alert_message.message,\"alert_type\":alert_message.alert_type}})}),_c('v-container',[_c('v-row',[_c('v-col',{attrs:{\"cols\":\"6\"}},[_c('v-form',{ref:\"form\",model:{value:(_vm.valid),callback:function ($$v) {_vm.valid=$$v},expression:\"valid\"}},[_c('JsonForm',{key:_vm.formKey,attrs:{\"value\":_vm.asset,\"schema\":_vm.asset_schema,\"options\":_vm.options},on:{\"update:model\":_vm.set_asset_value}})],1),_c('p',[_c('br')]),_c('v-btn',{staticStyle:{\"margin-top\":\"10px\"},on:{\"click\":_vm.create_object}},[_vm._v(\"Generate\")])],1),_c('v-col',{attrs:{\"cols\":\"6\"}},[(_vm.saved_asset_rdf)?_c('div',{staticClass:\"rdf-container\"},[_c('v-select',{staticClass:\"mb-3\",attrs:{\"items\":_vm.formats,\"label\":\"Select RDF Format\"},model:{value:(_vm.selectedFormat),callback:function ($$v) {_vm.selectedFormat=$$v},expression:\"selectedFormat\"}}),_c('rdf-editor',{staticClass:\"h-full overflow-hidden\",attrs:{\"format\":_vm.selectedFormat,\"readonly\":true,\"prefixes\":_vm.editorPrefixes,\"auto-parse\":\"\",\"parse-delay\":\"1000\"},domProps:{\"value\":_vm.saved_asset_rdf},on:{\"parsing-failed\":_vm.onParsingFailed,\"prefixes-parsed\":_vm.onPrefixesParsed,\"serialized\":_vm.onSerialized}}),_c('v-btn',{staticClass:\"mb-2\",attrs:{\"color\":\"primary\"},on:{\"click\":_vm.downloadRDF}},[_vm._v(\"Download RDF\")])],1):_vm._e()])],1)],1)],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('v-container',[_c('v-form',{model:{value:(_vm.valid),callback:function ($$v) {_vm.valid=$$v},expression:\"valid\"}},[_c('v-jsf',{attrs:{\"schema\":_vm.schema,\"options\":_vm.options},on:{\"input\":function($event){return _vm.$emit('update:model', $event)}},model:{value:(_vm.model),callback:function ($$v) {_vm.model=$$v},expression:\"model\"}})],1)],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./JsonForm.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./JsonForm.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./JsonForm.vue?vue&type=template&id=7f267588\"\nimport script from \"./JsonForm.vue?vue&type=script&lang=js\"\nexport * from \"./JsonForm.vue?vue&type=script&lang=js\"\nimport style0 from \"./JsonForm.vue?vue&type=style&index=0&id=7f267588&prod&lang=css\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('v-container',[_c('v-alert',{staticClass:\"text-center\",attrs:{\"value\":!!_vm.message,\"type\":_vm.alert_type,\"dismissible\":\"\"}},[_vm._v(\" \"+_vm._s(_vm.message)+\" \")])],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Alert.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Alert.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./Alert.vue?vue&type=template&id=64459cc8\"\nimport script from \"./Alert.vue?vue&type=script&lang=js\"\nexport * from \"./Alert.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('v-container',{staticClass:\"page-top py-4 mb-8\",attrs:{\"fluid\":\"\"}},[_c('v-row',[_c('v-col',{attrs:{\"cols\":\"9\"}},[_c('v-row',{staticClass:\"ml-4\"},[_c('v-col',[_c('h1',{staticClass:\"text-capitalize\"},[_vm._v(_vm._s(_vm.title || _vm.remove_underscore))])])],1),(_vm.subtitle!=null)?_c('v-row',{staticClass:\"ml-4\"},[_c('v-col',[_c('h2',{staticClass:\"text-capitalize\"},[_vm._v(_vm._s(_vm.subtitle || _vm.remove_underscore))])])],1):_vm._e(),(_vm.third_line!=null)?_c('v-row',{staticClass:\"ml-4\"},[_c('v-col',[_c('h3',[_vm._v(\" \"+_vm._s(_vm.third_line || _vm.remove_underscore)+\" \")])])],1):_vm._e()],1),_c('v-col',{attrs:{\"cols\":\"3\"}},[(_vm.image!=null)?_c('v-row',[_c('v-img',{attrs:{\"max-height\":\"160px\",\"position\":\"bottom center\",\"src\":_vm.image,\"contain\":\"\"}})],1):_vm._e()],1)],1)],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./PageTitle.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./PageTitle.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./PageTitle.vue?vue&type=template&id=46f3abe2&scoped=true\"\nimport script from \"./PageTitle.vue?vue&type=script&lang=js\"\nexport * from \"./PageTitle.vue?vue&type=script&lang=js\"\nimport style0 from \"./PageTitle.vue?vue&type=style&index=0&id=46f3abe2&prod&lang=css&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"46f3abe2\",\n null\n \n)\n\nexport default component.exports","export default \"{%- set prefix=\\\"https://knowledge.c-innovationhub.com/cefriel/data/\\\" -%}\\r\\n{%- set dcat_content = obj.header -%}\\r\\n{%- set json_content = obj.content -%}\\r\\n{%- set asset_name = slugify(dcat_content.name) -%}\\r\\n{%- set asset_type = \\\"MobilityDataset\\\" -%}\\r\\n{%- set asset_id = '<' + prefix + asset_type + '#' + asset_name + '>' -%}\\r\\n{%- set catalogue_id= '<' + prefix + 'CefrielDataCatalogue#' + asset_type + '>' -%}\\r\\n{%- set catalogue_record_id = '<' + prefix + 'CefrielDataCatalogueRecord/' + asset_type + '#' + asset_name + '>' -%}\\r\\n{%- set asset_type_url = data_platform_url + '/assets/' + asset_name -%}\\r\\n{%- set freq_iri = {\\r\\n \\\"Continuously\\\": \\\"http://publications.europa.eu/resource/authority/frequency/UPDATE_CONT\\\",\\r\\n \\\"Never (one-time provision)\\\": \\\"http://publications.europa.eu/resource/authority/frequency/NEVER\\\",\\r\\n \\\"On occurrence / irregularly\\\": \\\"http://publications.europa.eu/resource/authority/frequency/IRREG\\\",\\r\\n \\\"Up to 1min\\\": \\\"https://w3id.org/mobilitydcat-ap/update-frequency/1min\\\",\\r\\n \\\"Up to 5min\\\": \\\"https://w3id.org/mobilitydcat-ap/update-frequency/5min\\\",\\r\\n \\\"Up to 10 min\\\": \\\"https://w3id.org/mobilitydcat-ap/update-frequency/10min\\\",\\r\\n \\\"Up to 15 min\\\": \\\"https://w3id.org/mobilitydcat-ap/update-frequency/15min\\\",\\r\\n \\\"Up to 30 min\\\": \\\"https://w3id.org/mobilitydcat-ap/update-frequency/30min\\\",\\r\\n \\\"Up to 1h\\\": \\\"http://publications.europa.eu/resource/authority/frequency/HOURLY\\\",\\r\\n \\\"Up to 2h\\\": \\\"http://publications.europa.eu/resource/authority/frequency/BIHOURLY\\\",\\r\\n \\\"Up to 3h\\\": \\\"http://publications.europa.eu/resource/authority/frequency/TRIHOURLY\\\",\\r\\n \\\"Up to 12h\\\": \\\"https://w3id.org/mobilitydcat-ap/update-frequency/12h\\\",\\r\\n \\\"Up to 24h\\\": \\\"http://publications.europa.eu/resource/authority/frequency/DAILY\\\",\\r\\n \\\"Up to Weekly\\\": \\\"http://publications.europa.eu/resource/authority/frequency/WEEKLY\\\",\\r\\n \\\"Up to Monthly\\\": \\\"http://publications.europa.eu/resource/authority/frequency/MONTHLY\\\",\\r\\n \\\"Up to every 2 months\\\": \\\"http://publications.europa.eu/resource/authority/frequency/BIMONTHLY\\\",\\r\\n \\\"Up to every 3 months\\\": \\\"http://publications.europa.eu/resource/authority/frequency/QUARTERLY\\\",\\r\\n \\\"Up to every 6 months\\\": \\\"https://w3id.org/mobilitydcat-ap/update-frequency/ANNUAL_2\\\",\\r\\n \\\"Up to Annual\\\": \\\"http://publications.europa.eu/resource/authority/frequency/ANNUAL\\\",\\r\\n \\\"Up to Biennial\\\": \\\"http://publications.europa.eu/resource/authority/frequency/BIENNIAL\\\",\\r\\n \\\"Up to Triennial\\\": \\\"http://publications.europa.eu/resource/authority/frequency/TRIENNIAL\\\",\\r\\n \\\"Up to Quadrennial\\\": \\\"http://publications.europa.eu/resource/authority/frequency/QUADRENNIAL\\\",\\r\\n \\\"Up to Quinquennial\\\": \\\"http://publications.europa.eu/resource/authority/frequency/QUINQUENNIAL\\\",\\r\\n \\\"Up to Decennial\\\": \\\"http://publications.europa.eu/resource/authority/frequency/DECENNIAL\\\",\\r\\n \\\"Up to Bidecennial\\\": \\\"http://publications.europa.eu/resource/authority/frequency/BIDECENNIAL\\\",\\r\\n \\\"Up to Tridecennial\\\": \\\"http://publications.europa.eu/resource/authority/frequency/TRIDECENNIAL\\\",\\r\\n \\\"Unknown\\\": \\\"http://publications.europa.eu/resource/authority/frequency/UNKNOWN\\\"\\r\\n }\\r\\n-%}\\r\\n\\r\\n@prefix dcterms: .\\r\\n@prefix rdf: .\\r\\n@prefix xsd: .\\r\\n@prefix dcat: .\\r\\n@prefix vcard: .\\r\\n@prefix foaf: .\\r\\n@prefix owl: .\\r\\n@prefix mobilitydcatap: .\\r\\n@prefix mdata: .\\r\\n@prefix mtheme: .\\r\\n\\r\\n\\r\\n{{catalogue_id | safe}} rdf:type dcat:Catalog;\\r\\n\\tdcterms:title \\\"Cefriel RDF Metadata Generator for mobilityDCAT-AP\\\";\\r\\n\\tdcterms:description \\\"Cefriel RDF Metadata Generator for mobilityDCAT-AP powered by KCONG\\\"@en;\\r\\n\\tdcterms:publisher [\\r\\n\\t rdf:type foaf:Agent;\\r\\n\\t foaf:name \\\"Mobility Data Publisher\\\";\\r\\n\\t foaf:mbox \\\"no-reply@cefriel.com\\\";\\r\\n\\t];\\r\\n\\tdcterms:dataset {{asset_id | safe}};\\r\\n\\tdcat:record {{catalogue_record_id | safe}};\\r\\n\\tfoaf:homepage .\\r\\n\\r\\n\\r\\n{{catalogue_record_id | safe}} rdf:type dcat:CatalogRecord ;\\r\\n\\tdcterms:modified \\\"{{dcat_content.last_updated}}\\\"^^xsd:dateTime ;\\r\\n\\tdcterms:created \\\"{{dcat_content.creation_time}}\\\"^^xsd:dateTime ;\\r\\n\\tfoaf:primaryTopic {{asset_id | safe}} .\\r\\n\\r\\n\\r\\n{{asset_id | safe}} rdf:type dcat:Dataset;\\r\\n dcterms:identifier \\\"\\\"\\\"{{dcat_content.identifier}}\\\"\\\"\\\";\\r\\n dcterms:title \\\"{{dcat_content.name}}\\\";\\r\\n dcterms:description \\\"\\\"\\\"{{dcat_content.description}}\\\"\\\"\\\";\\r\\n {%if dcat_content.publisher_name or dcat_content.publisher_email %}\\r\\n dcterms:publisher [\\r\\n\\t rdf:type foaf:Agent;\\r\\n {%if dcat_content.publisher_name %}\\r\\n\\t foaf:name \\\"{{dcat_content.publisher_name}}\\\";\\r\\n {%endif%}\\r\\n {%if dcat_content.publisher_email %}\\r\\n\\t foaf:mbox \\\"{{dcat_content.publisher_email}}\\\";\\r\\n {%endif%}\\r\\n ];\\r\\n {%endif%}\\r\\n \\r\\n {%if json_content.mobility_themes%}\\r\\n {% for mtheme in json_content.mobility_themes %}\\r\\n mobilitydcatap:mobilityTheme mtheme:{{mtheme | lower | replace(\\\" \\\", \\\"-\\\") | replace(\\\",\\\" , \\\"\\\")}};\\r\\n {% endfor %}\\r\\n {%endif%}\\r\\n {%if '://' in json_content.spatial_coverage %}\\r\\n dcat:spatial <{{json_content.spatial_coverage}}>;\\r\\n {%else%}\\r\\n dcat:spatial \\\"\\\"\\\"{{json_content.spatial_coverage}}\\\"\\\"\\\";\\r\\n {%endif%}\\r\\n {%if json_content.spatial_aggregation%}\\r\\n dcat:spatialResolutionInMeters \\\"\\\"\\\"{{json_content.spatial_aggregation}}\\\"\\\"\\\";\\r\\n {%endif%}\\r\\n\\r\\n {%if json_content.temporal_coverage_start or json_content.temporal_coverage_end%}\\r\\n dcat:temporal [ a dcterms:PeriodOfTime;\\r\\n {%if json_content.temporal_coverage_start%}\\r\\n\\t dcat:startDate \\\"\\\"\\\"{{json_content.temporal_coverage_start}}\\\"\\\"\\\";\\r\\n {%endif%}\\r\\n {%if json_content.temporal_coverage_end%}\\r\\n\\t dcat:endDate \\\"\\\"\\\"{{json_content.temporal_coverage_end}}\\\"\\\"\\\";\\r\\n {%endif%}\\r\\n ];\\r\\n {%endif%}\\r\\n\\r\\n {%if json_content.temporal_aggregation%}\\r\\n dcat:temporalResolution \\\"\\\"\\\"{{json_content.temporal_aggregation}}\\\"\\\"\\\";\\r\\n {%endif%}\\r\\n\\r\\n {%-if json_content.source_asset.id-%}\\r\\n dcterms:source <{{json_content.source_asset.id}}>;\\r\\n {%-endif-%}\\r\\n\\r\\n {%- set accrual_periodicity = json_content.accrual_periodicity -%}\\r\\n dcat:accrualPeriodicity <{{ freq_iri[accrual_periodicity] }}>.\\r\\n\\r\\n\\r\\n {%if json_content.distributions %}\\r\\n {%- for distribution in json_content.distributions -%}\\r\\n {%- set distribution_id = '<' + prefix + asset_type + '/Distribution#' + asset_name + '-' + loop.index + '>' -%}\\r\\n {{asset_id | safe}} dcat:distribution {{distribution_id | safe}} .\\r\\n\\r\\n {{distribution_id | safe}} rdf:type dcat:Distribution;\\r\\n mobilitydcatap:mobilityDataStandard mdata:{{distribution.data_schema | lower | replace(\\\" \\\", \\\"-\\\")}} ;\\r\\n {% if '://' in json_content.spatial_coverage %}\\r\\n dcterms:format <{{distribution.format}}>;\\r\\n {%else%}\\r\\n dcterms:format \\\"{{distribution.format}}\\\";\\r\\n {%endif%}\\r\\n\\t {%-if json_content.data_sample -%}\\r\\n {%- for sample in json_content.data_sample -%}\\r\\n adms:sample [\\r\\n rdf:type dcat:Distribution;\\r\\n dcat:downloadURL <{{sample.url}}>;\\r\\n {%-if sample.sample_description -%}\\r\\n dcterms:description \\\"\\\"\\\"{{sample.sample_description}}\\\"\\\"\\\"\\r\\n {%- endif -%}\\r\\n ];\\r\\n {%- endfor -%}\\r\\n\\t {%- endif -%}\\r\\n\\tdcat:accessURL <{{distribution.access_url}}> .\\r\\n {%- endfor -%}\\r\\n {%- endif -%}\\r\\n\";","\r\n\r\n\r\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./AssetCreate.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./AssetCreate.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./AssetCreate.vue?vue&type=template&id=402a299a\"\nimport script from \"./AssetCreate.vue?vue&type=script&lang=js\"\nexport * from \"./AssetCreate.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import Vue from 'vue'\r\nimport Router from 'vue-router'\r\n\r\nimport AssetCreate from './components/AssetCreate.vue'\r\n\r\nVue.use(Router)\r\n\r\n\r\nconst router= new Router({\r\n mode: 'history',\r\n routes: [\r\n {\r\n path: '/mobilitydcatap-ui/',\r\n name: 'asset_create',\r\n component: AssetCreate,\r\n props: {\r\n asset_type : 'mobilityDCAT-AP Generator Tool'\r\n },\r\n meta: {\r\n title: \"Cefriel RDF Metadata Generator\",\r\n }\r\n },\r\n ]\r\n})\r\n\r\nexport default router\r\n","import Vue from 'vue';\r\nimport App from './App.vue';\r\nimport vuetify from './plugins/vuetify';\r\nimport router from './router';\r\nimport Resource from 'vue-resource';\r\nimport moment from 'moment/src/moment';\r\n\r\nVue.config.productionTip = false;\r\nVue.config.ignoredElements = ['rdf-editor']\r\n\r\nVue.use(Resource);\r\n\r\n// Set page title\r\nrouter.beforeEach((to, from, next) => {\r\n const { title } = to.meta;\r\n document.title = typeof title === 'function' ? title(to) : title;\r\n next();\r\n});\r\n\r\n// Vue functions to be used in templates\r\nVue.filter('formatDate', function(value) {\r\n if (value) {\r\n return moment(String(value)).format('MM/DD/YYYY hh:mm')\r\n }\r\n});\r\n\r\nVue.filter('remove_underscore', function (value) {\r\n if (!value) return ''\r\n value = value.toString()\r\n return value.replaceAll(\"_\", \" \")\r\n})\r\n\r\nnew Vue({\r\n vuetify,\r\n router,\r\n render: h => h(App)\r\n}).$mount('#app')\r\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","var getProto = Object.getPrototypeOf ? function(obj) { return Object.getPrototypeOf(obj); } : function(obj) { return obj.__proto__; };\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach(function(key) { def[key] = function() { return value[key]; }; });\n\t}\n\tdef['default'] = function() { return value; };\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"js/\" + chunkId + \".\" + {\"13\":\"06cd2e07\",\"43\":\"fb5b896b\",\"49\":\"f2c20221\",\"55\":\"d111b5d7\",\"109\":\"350c7c05\",\"148\":\"2b6347d2\",\"200\":\"4dc78eed\",\"208\":\"65de7a32\",\"236\":\"207c840f\",\"420\":\"fb240bdb\",\"590\":\"47d0c120\",\"595\":\"96320e8c\",\"611\":\"77fb901c\",\"675\":\"a10f8029\",\"699\":\"15a1d044\",\"731\":\"a686c60c\",\"733\":\"320f4a50\",\"818\":\"44b91e54\",\"954\":\"898da33a\",\"978\":\"44af7ef6\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.hmd = function(module) {\n\tmodule = Object.create(module);\n\tif (!module.children) module.children = [];\n\tObject.defineProperty(module, 'exports', {\n\t\tenumerable: true,\n\t\tset: function() {\n\t\t\tthrow new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);\n\t\t}\n\t});\n\treturn module;\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var inProgress = {};\nvar dataWebpackPrefix = \"mobilitydcatap-ui:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.p = \"/mobilitydcatap-ui/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t524: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmobilitydcatap_ui\"] = self[\"webpackChunkmobilitydcatap_ui\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [504], function() { return __webpack_require__(52283); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["attrs","render","staticRenderFns","staticClass","_c","_vm","_v","name","component","data","app_name","app_logo","require","path_items","components","Footer","Topbar","username","window","localStorage","getItem","methods","Vue","use","Vuetify","theme","themes","light","primary","_l","alert_message","value","valid","callback","expression","key","formKey","asset","on","staticStyle","create_object","model","selectedFormat","domProps","saved_asset_rdf","$$v","VJsf","props","schema","Object","options","emits","watch","handler","newValue","deep","immediate","message","String","alert_type","_s","title","type","required","subtitle","third_line","freetext","image","show_breadcrumbs","Boolean","ajv","Ajv","JsonForm","PageTitle","Alert","template_engine","template","asset_schema","initial_asset","saved_asset","serialized_rdf","alert_messages","selectedPdf","pdfUrl","parseError","formats","parsers","keys","editorPrefixes","context","languages","mounted","compile","form_template","onParsingFailed","e","console","error","detail","onPrefixesParsed","prefixes","join","onSerialized","downloadRDF","push","formatToExtension","fileExtension","blob","Blob","url","URL","createObjectURL","link","document","createElement","href","setAttribute","body","appendChild","click","removeChild","revokeObjectURL","set_asset_value","event","slugify","str","normalize","replace","trim","toLowerCase","$refs","form","validate","header","creation_time","Date","toISOString","last_updated","asset_type","id","uuidv4","obj","data_platform_url","log","Router","router","mode","routes","path","AssetCreate","meta","config","productionTip","ignoredElements","Resource","beforeEach","to","from","next","filter","moment","format","toString","replaceAll","vuetify","h","App","$mount","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","loaded","__webpack_modules__","call","m","deferred","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","every","splice","r","n","getter","__esModule","d","a","leafPrototypes","getProto","getPrototypeOf","__proto__","t","this","then","ns","create","def","current","indexOf","getOwnPropertyNames","forEach","definition","o","defineProperty","enumerable","get","f","chunkId","Promise","all","reduce","promises","u","miniCssF","g","globalThis","Function","hmd","children","set","Error","prop","prototype","hasOwnProperty","inProgress","dataWebpackPrefix","l","done","script","needAttach","scripts","getElementsByTagName","s","getAttribute","charset","timeout","nc","src","onScriptComplete","prev","onerror","onload","clearTimeout","doneFns","parentNode","setTimeout","bind","target","head","Symbol","toStringTag","nmd","paths","p","installedChunks","installedChunkData","promise","resolve","reject","loadingEnded","errorType","realSrc","request","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","self","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/app.2e291fc4.js b/dist/js/app.2e291fc4.js deleted file mode 100644 index 45a0706..0000000 --- a/dist/js/app.2e291fc4.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(){var e={84217:function(e,t,a){"use strict";a(98992),a(54520);var n=a(85471),r=a(45602),i=a(36407),o=function(){var e=this,t=e._self._c;return t(r.A,{attrs:{id:"inspire"}},[t("Topbar"),t(i.A,[t("router-view")],1),t("Footer")],1)},s=[],c=a(3698),d=a(52938),l=a(91950),u=function(){var e=this,t=e._self._c;return t(l.A,{attrs:{padless:""}},[t(c.A,{staticClass:"flex",attrs:{flat:"",tile:"",color:"#f5f5f5"}},[t(d.OQ,{staticClass:"text-center"},[e._v(" "+e._s((new Date).getFullYear())+" — "),t("strong",[t("a",{attrs:{href:"https://www.cefriel.com"}},[e._v("Cefriel")])])])],1)],1)},m=[],p={name:"Footer"},f=p,h=a(81656),y=(0,h.A)(f,u,m,!1,null,null,null),g=y.exports,b=a(40070),_=a(21163),v=a(92367),w=function(){var e=this,t=e._self._c;return t(b.A,{attrs:{app:"",flat:"","clipped-left":""}},[t("router-link",{attrs:{to:"/"}},[t(_.A,{staticClass:"mx-2",attrs:{src:e.app_logo,"max-height":"40","max-width":"40",contain:""}})],1),t(v.sw,[e._v(e._s(e.app_name))])],1)},A=[],k={name:"App",data(){return{app_name:"Cefriel RDF Metadata Generator",app_logo:a(99467),path_items:[]}}},T=k,C=(0,h.A)(T,w,A,!1,null,null,null),x=C.exports,S={name:"App",components:{Footer:g,Topbar:x},data(){return{app_name:"Cefriel RDF Metadata Generator",app_logo:a(33153),path_items:[],username:window.localStorage.getItem("auth-user")}},methods:{}},j=S,U=(0,h.A)(j,o,s,!1,null,null,null),P=U.exports,O=a(25417);n.Ay.use(O.A);var D=new O.A({theme:{themes:{light:{primary:"#757575"}}}}),N=a(40173),R=a(88787),L=a(54414),E=a(3449),F=a(70174),q=a(2756),I=a(81925),M=function(){var e=this,t=e._self._c;return t("div",[t("PageTitle",{attrs:{title:e.asset_type,show_breadcrumbs:!0}}),t(q.A,{staticClass:"px-10 my-2"},[t(L.A,{staticClass:"py-2",attrs:{cols:"8"}},[t("p",[t("b",[e._v("Fill the form with all the metadata and download the RDF")]),e._v(" representation using "),t("a",{attrs:{href:"https://w3id.org/mobilitydcat-ap/"}},[e._v("mobilityDCAT-AP")]),e._v(". Test and experiment to learn how different information should be described in RDF according to the mobilityDCAT-AP specification. The form is compliant with the minimum profile required by mobilityDCAT-AP."),t("br"),t("br"),e._v(" This page is powered by "),t("b",[e._v("KCONG (Knowledge Catalogue and Governance)")]),e._v(" a complete (meta)data catalogue solution developed by "),t("a",{attrs:{href:"https://www.cefriel.com/"}},[e._v("Cefriel")]),e._v(". If you want to know more visit "),t("a",{attrs:{href:"https://kcong.cefriel.com/"}},[e._v("https://kcong.cefriel.com/")]),e._v(". The page is client-side only so all the information inserted are not collected/stored and can not be retrieved if the page is reloaded.")])]),t(L.A,{staticClass:"text-center py-2",attrs:{cols:"4"}},[t("img",{staticStyle:{"max-height":"100px"},attrs:{src:a(33153),alt:"Company Logo"}})])],1),e._l(e.alert_messages,(function(e,a){return t("Alert",{key:a,attrs:{message:e.message,alert_type:e.alert_type}})})),t(E.A,[t(q.A,[t(L.A,{attrs:{cols:"6"}},[t(F.A,{ref:"form",model:{value:e.valid,callback:function(t){e.valid=t},expression:"valid"}},[t("JsonForm",{key:e.formKey,attrs:{value:e.asset,schema:e.asset_schema,options:e.options},on:{"update:model":e.set_asset_value}})],1),t("p",[t("br")]),t(R.A,{staticStyle:{"margin-top":"10px"},on:{click:e.create_object}},[e._v("Generate")])],1),t(L.A,{attrs:{cols:"6"}},[e.saved_asset_rdf?t("div",{staticClass:"rdf-container"},[t(I.A,{staticClass:"mb-3",attrs:{items:e.formats,label:"Select RDF Format"},model:{value:e.selectedFormat,callback:function(t){e.selectedFormat=t},expression:"selectedFormat"}}),t("rdf-editor",{staticClass:"h-full overflow-hidden",attrs:{format:e.selectedFormat,readonly:!0,prefixes:e.editorPrefixes,"auto-parse":"","parse-delay":"1000"},domProps:{value:e.saved_asset_rdf},on:{"parsing-failed":e.onParsingFailed,"prefixes-parsed":e.onPrefixesParsed,serialized:e.onSerialized}}),t(R.A,{staticClass:"mb-2",attrs:{color:"primary"},on:{click:e.downloadRDF}},[e._v("Download RDF")])],1):e._e()])],1)],1)],2)},B=[],G=(a(44114),a(14603),a(47566),a(98721),function(){var e=this,t=e._self._c;return t(E.A,[t(F.A,{model:{value:e.valid,callback:function(t){e.valid=t},expression:"valid"}},[t("v-jsf",{attrs:{schema:e.schema,options:e.options},on:{input:function(t){return e.$emit("update:model",t)}},model:{value:e.model,callback:function(t){e.model=t},expression:"model"}})],1)],1)}),z=[],K=a(30766),Y=(a(96213),{name:"JsonForm",components:{VJsf:K.A},props:{schema:Object,options:Object,value:Object},emits:["update:model"],data(){return{valid:!1,model:this.value||{}}},watch:{value:{handler(e){this.model=e||{}},deep:!0,immediate:!0}},methods:{}}),H=Y,Q=(0,h.A)(H,G,z,!1,null,null,null),W=Q.exports,J=a(69964),V=function(){var e=this,t=e._self._c;return t(E.A,[t(J.A,{staticClass:"text-center",attrs:{value:!!e.message,type:e.alert_type,dismissible:""}},[e._v(" "+e._s(e.message)+" ")])],1)},$=[],X={name:"Alert",props:{message:String,alert_type:String}},Z=X,ee=(0,h.A)(Z,V,$,!1,null,null,null),te=ee.exports,ae=function(){var e=this,t=e._self._c;return t(E.A,{staticClass:"page-top py-4 mb-8",attrs:{fluid:""}},[t(q.A,[t(L.A,{attrs:{cols:"9"}},[t(q.A,{staticClass:"ml-4"},[t(L.A,[t("h1",{staticClass:"text-capitalize"},[e._v(e._s(e.title||e.remove_underscore))])])],1),null!=e.subtitle?t(q.A,{staticClass:"ml-4"},[t(L.A,[t("h2",{staticClass:"text-capitalize"},[e._v(e._s(e.subtitle||e.remove_underscore))])])],1):e._e(),null!=e.third_line?t(q.A,{staticClass:"ml-4"},[t(L.A,[t("h3",[e._v(" "+e._s(e.third_line||e.remove_underscore)+" ")])])],1):e._e()],1),t(L.A,{attrs:{cols:"3"}},[null!=e.image?t(q.A,[t(_.A,{attrs:{"max-height":"160px",position:"bottom center",src:e.image,contain:""}})],1):e._e()],1)],1)],1)},ne=[],re={name:"PageTitle",components:{},props:{title:{type:String,required:!0},subtitle:{type:String,required:!1},third_line:{type:String,required:!1},freetext:{type:String,required:!1},image:{type:String,required:!1},show_breadcrumbs:{type:Boolean,required:!0}}},ie=re,oe=(0,h.A)(ie,ae,ne,!1,null,"46f3abe2",null),se=oe.exports,ce='{%- set prefix="https://knowledge.c-innovationhub.com/cefriel/data/" -%}\r\n{%- set dcat_content = obj.header -%}\r\n{%- set json_content = obj.content -%}\r\n{%- set asset_name = slugify(dcat_content.name) -%}\r\n{%- set asset_type = "MobilityDataset" -%}\r\n{%- set asset_id = \'<\' + prefix + asset_type + \'#\' + asset_name + \'>\' -%}\r\n{%- set catalogue_id= \'<\' + prefix + \'CefrielDataCatalogue#\' + asset_type + \'>\' -%}\r\n{%- set catalogue_record_id = \'<\' + prefix + \'CefrielDataCatalogueRecord/\' + asset_type + \'#\' + asset_name + \'>\' -%}\r\n{%- set asset_type_url = data_platform_url + \'/assets/\' + asset_name -%}\r\n{%- set freq_iri = {\r\n "Continuously": "http://publications.europa.eu/resource/authority/frequency/UPDATE_CONT",\r\n "Never (one-time provision)": "http://publications.europa.eu/resource/authority/frequency/NEVER",\r\n "On occurrence / irregularly": "http://publications.europa.eu/resource/authority/frequency/IRREG",\r\n "Up to 1min": "https://w3id.org/mobilitydcat-ap/update-frequency/1min",\r\n "Up to 5min": "https://w3id.org/mobilitydcat-ap/update-frequency/5min",\r\n "Up to 10 min": "https://w3id.org/mobilitydcat-ap/update-frequency/10min",\r\n "Up to 15 min": "https://w3id.org/mobilitydcat-ap/update-frequency/15min",\r\n "Up to 30 min": "https://w3id.org/mobilitydcat-ap/update-frequency/30min",\r\n "Up to 1h": "http://publications.europa.eu/resource/authority/frequency/HOURLY",\r\n "Up to 2h": "http://publications.europa.eu/resource/authority/frequency/BIHOURLY",\r\n "Up to 3h": "http://publications.europa.eu/resource/authority/frequency/TRIHOURLY",\r\n "Up to 12h": "https://w3id.org/mobilitydcat-ap/update-frequency/12h",\r\n "Up to 24h": "http://publications.europa.eu/resource/authority/frequency/DAILY",\r\n "Up to Weekly": "http://publications.europa.eu/resource/authority/frequency/WEEKLY",\r\n "Up to Monthly": "http://publications.europa.eu/resource/authority/frequency/MONTHLY",\r\n "Up to every 2 months": "http://publications.europa.eu/resource/authority/frequency/BIMONTHLY",\r\n "Up to every 3 months": "http://publications.europa.eu/resource/authority/frequency/QUARTERLY",\r\n "Up to every 6 months": "https://w3id.org/mobilitydcat-ap/update-frequency/ANNUAL_2",\r\n "Up to Annual": "http://publications.europa.eu/resource/authority/frequency/ANNUAL",\r\n "Up to Biennial": "http://publications.europa.eu/resource/authority/frequency/BIENNIAL",\r\n "Up to Triennial": "http://publications.europa.eu/resource/authority/frequency/TRIENNIAL",\r\n "Up to Quadrennial": "http://publications.europa.eu/resource/authority/frequency/QUADRENNIAL",\r\n "Up to Quinquennial": "http://publications.europa.eu/resource/authority/frequency/QUINQUENNIAL",\r\n "Up to Decennial": "http://publications.europa.eu/resource/authority/frequency/DECENNIAL",\r\n "Up to Bidecennial": "http://publications.europa.eu/resource/authority/frequency/BIDECENNIAL",\r\n "Up to Tridecennial": "http://publications.europa.eu/resource/authority/frequency/TRIDECENNIAL",\r\n "Unknown": "http://publications.europa.eu/resource/authority/frequency/UNKNOWN"\r\n }\r\n-%}\r\n\r\n@prefix dcterms: .\r\n@prefix rdf: .\r\n@prefix xsd: .\r\n@prefix dcat: .\r\n@prefix vcard: .\r\n@prefix foaf: .\r\n@prefix owl: .\r\n@prefix mobilitydcatap: .\r\n@prefix mdata: .\r\n@prefix mtheme: .\r\n\r\n\r\n{{catalogue_id | safe}} rdf:type dcat:Catalog;\r\n\tdcterms:title "Cefriel RDF Metadata Generator for mobilityDCAT-AP";\r\n\tdcterms:description "Cefriel RDF Metadata Generator for mobilityDCAT-AP powered by KCONG"@en;\r\n\tdcterms:publisher [\r\n\t rdf:type foaf:Agent;\r\n\t foaf:name "Mobility Data Publisher";\r\n\t foaf:mbox "no-reply@cefriel.com";\r\n\t];\r\n\tdcterms:dataset {{asset_id | safe}};\r\n\tdcat:record {{catalogue_record_id | safe}};\r\n\tfoaf:homepage .\r\n\r\n\r\n{{catalogue_record_id | safe}} rdf:type dcat:CatalogRecord ;\r\n\tdcterms:modified "{{dcat_content.last_updated}}"^^xsd:dateTime ;\r\n\tdcterms:created "{{dcat_content.creation_time}}"^^xsd:dateTime ;\r\n\tfoaf:primaryTopic {{asset_id | safe}} .\r\n\r\n\r\n{{asset_id | safe}} rdf:type dcat:Dataset;\r\n dcterms:identifier """{{dcat_content.identifier}}""";\r\n dcterms:title "{{dcat_content.name}}";\r\n dcterms:description """{{dcat_content.description}}""";\r\n {%if dcat_content.publisher_name or dcat_content.publisher_email %}\r\n dcterms:publisher [\r\n\t rdf:type foaf:Agent;\r\n {%if dcat_content.publisher_name %}\r\n\t foaf:name "{{dcat_content.publisher_name}}";\r\n {%endif%}\r\n {%if dcat_content.publisher_email %}\r\n\t foaf:mbox "{{dcat_content.publisher_email}}";\r\n {%endif%}\r\n ];\r\n {%endif%}\r\n \r\n {%if json_content.mobility_themes%}\r\n {% for mtheme in json_content.mobility_themes %}\r\n mobilitydcatap:mobilityTheme mtheme:{{mtheme | lower | replace(" ", "-") | replace("," , "")}};\r\n {% endfor %}\r\n {%endif%}\r\n {%if \'://\' in json_content.spatial_coverage %}\r\n dcat:spatial <{{json_content.spatial_coverage}}>;\r\n {%else%}\r\n dcat:spatial """{{json_content.spatial_coverage}}""";\r\n {%endif%}\r\n {%if json_content.spatial_aggregation%}\r\n dcat:spatialResolutionInMeters """{{json_content.spatial_aggregation}}""";\r\n {%endif%}\r\n\r\n {%if json_content.temporal_coverage_start or json_content.temporal_coverage_end%}\r\n dcat:temporal [ a dcterms:PeriodOfTime;\r\n {%if json_content.temporal_coverage_start%}\r\n\t dcat:startDate """{{json_content.temporal_coverage_start}}""";\r\n {%endif%}\r\n {%if json_content.temporal_coverage_end%}\r\n\t dcat:endDate """{{json_content.temporal_coverage_end}}""";\r\n {%endif%}\r\n ];\r\n {%endif%}\r\n\r\n {%if json_content.temporal_aggregation%}\r\n dcat:temporalResolution """{{json_content.temporal_aggregation}}""";\r\n {%endif%}\r\n\r\n {%-if json_content.source_asset.id-%}\r\n dcterms:source <{{json_content.source_asset.id}}>;\r\n {%-endif-%}\r\n\r\n {%- set accrual_periodicity = json_content.accrual_periodicity -%}\r\n dcat:accrualPeriodicity <{{ freq_iri[accrual_periodicity] }}>.\r\n\r\n\r\n {%if json_content.distributions %}\r\n {%- for distribution in json_content.distributions -%}\r\n {%- set distribution_id = \'<\' + prefix + asset_type + \'/Distribution#\' + asset_name + \'-\' + loop.index + \'>\' -%}\r\n {{asset_id | safe}} dcat:distribution {{distribution_id | safe}} .\r\n\r\n {{distribution_id | safe}} rdf:type dcat:Distribution;\r\n mobilitydcatap:mobilityDataStandard mdata:{{distribution.data_schema | lower | replace(" ", "-")}} ;\r\n {% if \'://\' in json_content.spatial_coverage %}\r\n dcterms:format <{{distribution.format}}>;\r\n {%else%}\r\n dcterms:format "{{distribution.format}}";\r\n {%endif%}\r\n\t {%-if json_content.data_sample -%}\r\n {%- for sample in json_content.data_sample -%}\r\n adms:sample [\r\n rdf:type dcat:Distribution;\r\n dcat:downloadURL <{{sample.url}}>;\r\n {%-if sample.sample_description -%}\r\n dcterms:description """{{sample.sample_description}}"""\r\n {%- endif -%}\r\n ];\r\n {%- endfor -%}\r\n\t {%- endif -%}\r\n\tdcat:accessURL <{{distribution.access_url}}> .\r\n {%- endfor -%}\r\n {%- endif -%}\r\n',de=a(28019),le=a.n(de),ue=(a(69978),a(90876)),me=a(44526);const pe=new(le());var fe={name:"AssetCreate",components:{JsonForm:W,PageTitle:se,Alert:te},props:["asset_type"],data(){return{template_engine:null,template:null,valid:null,asset_schema:{},initial_asset:{},asset:{},saved_asset:{},saved_asset_rdf:null,serialized_rdf:null,alert_messages:[],selectedPdf:null,pdfUrl:null,formKey:0,parseError:null,formats:[...ue.T.keys()],selectedFormat:"text/turtle",editorPrefixes:null,options:{ajv:pe,context:{languages:a(87932)}}}},mounted(){this.asset_schema=a(73858),this.template_engine=a(61326),this.template=this.template_engine.compile(ce)},methods:{onParsingFailed(e){console.error("Parsing failed:",e.detail.error),this.parseError=e.detail.error},onPrefixesParsed(e){this.editorPrefixes||(this.editorPrefixes=Object.keys(e.detail.prefixes).join(","))},onSerialized(e){this.serialized_rdf=e.detail.value},downloadRDF(){if(!this.serialized_rdf)return void this.alert_messages.push({message:"No RDF content to download.",alert_type:"error"});const e={"text/turtle":"ttl","application/ld+json":"jsonld","application/rdf+xml":"rdf","application/trig":"trig","application/n-triples":"nt","application/n-quads":"nq","text/n3":"n3"},t=e[this.selectedFormat]||"ttl",a=new Blob([this.serialized_rdf],{type:this.selectedFormat}),n=window.URL.createObjectURL(a),r=document.createElement("a");r.href=n,r.setAttribute("download",`rdf-data.${t}`),document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n)},set_asset_value(e){this.asset=e},create_object(){function e(e){return String(e).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").trim().toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}this.$refs.form.validate(),this.valid?this.alert_messages=[]:this.alert_messages.push({message:"Validation error",alert_type:"error"}),this.asset.header||(this.asset.header={}),this.asset.header.creation_time=(new Date).toISOString(),this.asset.header.last_updated=(new Date).toISOString(),this.asset.header.type=this.asset_type,this.asset.header.id=(0,me.A)();try{this.saved_asset_rdf=this.template.render({obj:this.asset,data_platform_url:"https://kcong.cefriel.com/",slugify:e})}catch(t){console.log(t)}this.saved_asset_rdf=this.saved_asset_rdf.replace(/^\s*\n/gm,"")}}},he=fe,ye=(0,h.A)(he,M,B,!1,null,null,null),ge=ye.exports;n.Ay.use(N.Ay);const be=new N.Ay({mode:"history",routes:[{path:"/mobilitydcatap-ui/",name:"asset_create",component:ge,props:{asset_type:"mobilityDCAT-AP Generator Tool"},meta:{title:"Cefriel RDF Metadata Generator"}}]});var _e=be,ve=a(75993),we=a(76017);n.Ay.config.productionTip=!1,n.Ay.config.ignoredElements=["rdf-editor"],n.Ay.use(ve.Ay),_e.beforeEach(((e,t,a)=>{const{title:n}=e.meta;document.title="function"===typeof n?n(e):n,a()})),n.Ay.filter("formatDate",(function(e){if(e)return(0,we.A)(String(e)).format("MM/DD/YYYY hh:mm")})),n.Ay.filter("remove_underscore",(function(e){return e?(e=e.toString(),e.replaceAll("_"," ")):""})),new n.Ay({vuetify:D,router:_e,render:e=>e(P)}).$mount("#app")},99467:function(e,t,a){"use strict";e.exports=a.p+"img/cefriel_clogo.e1c6dc50.png"},33153:function(e,t,a){"use strict";e.exports=a.p+"img/logo.8c51896c.png"},78982:function(){},47790:function(){},73776:function(){},21638:function(){},92668:function(){},77965:function(){},66089:function(){},79368:function(){},64688:function(){},51069:function(){},15340:function(){},79838:function(){},15182:function(){},87932:function(e){"use strict";e.exports=JSON.parse('[{"code":"ab","name":"Abkhaz"},{"code":"aa","name":"Afar"},{"code":"af","name":"Afrikaans"},{"code":"ak","name":"Akan"},{"code":"sq","name":"Albanian"},{"code":"am","name":"Amharic"},{"code":"ar","name":"Arabic"},{"code":"an","name":"Aragonese"},{"code":"hy","name":"Armenian"},{"code":"as","name":"Assamese"},{"code":"av","name":"Avaric"},{"code":"ae","name":"Avestan"},{"code":"ay","name":"Aymara"},{"code":"az","name":"Azerbaijani"},{"code":"bm","name":"Bambara"},{"code":"ba","name":"Bashkir"},{"code":"eu","name":"Basque"},{"code":"be","name":"Belarusian"},{"code":"bn","name":"Bengali; Bangla"},{"code":"bh","name":"Bihari"},{"code":"bi","name":"Bislama"},{"code":"bs","name":"Bosnian"},{"code":"br","name":"Breton"},{"code":"bg","name":"Bulgarian"},{"code":"my","name":"Burmese"},{"code":"ca","name":"Catalan; Valencian"},{"code":"ch","name":"Chamorro"},{"code":"ce","name":"Chechen"},{"code":"ny","name":"Chichewa; Chewa; Nyanja"},{"code":"zh","name":"Chinese"},{"code":"cv","name":"Chuvash"},{"code":"kw","name":"Cornish"},{"code":"co","name":"Corsican"},{"code":"cr","name":"Cree"},{"code":"hr","name":"Croatian"},{"code":"cs","name":"Czech"},{"code":"da","name":"Danish"},{"code":"dv","name":"Divehi; Dhivehi; Maldivian;"},{"code":"nl","name":"Dutch"},{"code":"dz","name":"Dzongkha"},{"code":"en","name":"English"},{"code":"eo","name":"Esperanto"},{"code":"et","name":"Estonian"},{"code":"ee","name":"Ewe"},{"code":"fo","name":"Faroese"},{"code":"fj","name":"Fijian"},{"code":"fi","name":"Finnish"},{"code":"fr","name":"French"},{"code":"ff","name":"Fula; Fulah; Pulaar; Pular"},{"code":"gl","name":"Galician"},{"code":"ka","name":"Georgian"},{"code":"de","name":"German"},{"code":"el","name":"Greek, Modern"},{"code":"gn","name":"Guaraní"},{"code":"gu","name":"Gujarati"},{"code":"ht","name":"Haitian; Haitian Creole"},{"code":"ha","name":"Hausa"},{"code":"he","name":"Hebrew (modern)"},{"code":"hz","name":"Herero"},{"code":"hi","name":"Hindi"},{"code":"ho","name":"Hiri Motu"},{"code":"hu","name":"Hungarian"},{"code":"ia","name":"Interlingua"},{"code":"id","name":"Indonesian"},{"code":"ie","name":"Interlingue"},{"code":"ga","name":"Irish"},{"code":"ig","name":"Igbo"},{"code":"ik","name":"Inupiaq"},{"code":"io","name":"Ido"},{"code":"is","name":"Icelandic"},{"code":"it","name":"Italian"},{"code":"iu","name":"Inuktitut"},{"code":"ja","name":"Japanese"},{"code":"jv","name":"Javanese"},{"code":"kl","name":"Kalaallisut, Greenlandic"},{"code":"kn","name":"Kannada"},{"code":"kr","name":"Kanuri"},{"code":"ks","name":"Kashmiri"},{"code":"kk","name":"Kazakh"},{"code":"km","name":"Khmer"},{"code":"ki","name":"Kikuyu, Gikuyu"},{"code":"rw","name":"Kinyarwanda"},{"code":"ky","name":"Kyrgyz"},{"code":"kv","name":"Komi"},{"code":"kg","name":"Kongo"},{"code":"ko","name":"Korean"},{"code":"ku","name":"Kurdish"},{"code":"kj","name":"Kwanyama, Kuanyama"},{"code":"la","name":"Latin"},{"code":"lb","name":"Luxembourgish, Letzeburgesch"},{"code":"lg","name":"Ganda"},{"code":"li","name":"Limburgish, Limburgan, Limburger"},{"code":"ln","name":"Lingala"},{"code":"lo","name":"Lao"},{"code":"lt","name":"Lithuanian"},{"code":"lu","name":"Luba-Katanga"},{"code":"lv","name":"Latvian"},{"code":"gv","name":"Manx"},{"code":"mk","name":"Macedonian"},{"code":"mg","name":"Malagasy"},{"code":"ms","name":"Malay"},{"code":"ml","name":"Malayalam"},{"code":"mt","name":"Maltese"},{"code":"mi","name":"MÄori"},{"code":"mr","name":"Marathi (MarÄá¹­hÄ«)"},{"code":"mh","name":"Marshallese"},{"code":"mn","name":"Mongolian"},{"code":"na","name":"Nauru"},{"code":"nv","name":"Navajo, Navaho"},{"code":"nb","name":"Norwegian BokmÃ¥l"},{"code":"nd","name":"North Ndebele"},{"code":"ne","name":"Nepali"},{"code":"ng","name":"Ndonga"},{"code":"nn","name":"Norwegian Nynorsk"},{"code":"no","name":"Norwegian"},{"code":"ii","name":"Nuosu"},{"code":"nr","name":"South Ndebele"},{"code":"oc","name":"Occitan"},{"code":"oj","name":"Ojibwe, Ojibwa"},{"code":"cu","name":"Old Church Slavonic, Church Slavic, Church Slavonic, Old Bulgarian, Old Slavonic"},{"code":"om","name":"Oromo"},{"code":"or","name":"Oriya"},{"code":"os","name":"Ossetian, Ossetic"},{"code":"pa","name":"Panjabi, Punjabi"},{"code":"pi","name":"PÄli"},{"code":"fa","name":"Persian (Farsi)"},{"code":"pl","name":"Polish"},{"code":"ps","name":"Pashto, Pushto"},{"code":"pt","name":"Portuguese"},{"code":"qu","name":"Quechua"},{"code":"rm","name":"Romansh"},{"code":"rn","name":"Kirundi"},{"code":"ro","name":"Romanian, [])"},{"code":"ru","name":"Russian"},{"code":"sa","name":"Sanskrit (Saá¹ská¹›ta)"},{"code":"sc","name":"Sardinian"},{"code":"sd","name":"Sindhi"},{"code":"se","name":"Northern Sami"},{"code":"sm","name":"Samoan"},{"code":"sg","name":"Sango"},{"code":"sr","name":"Serbian"},{"code":"gd","name":"Scottish Gaelic; Gaelic"},{"code":"sn","name":"Shona"},{"code":"si","name":"Sinhala, Sinhalese"},{"code":"sk","name":"Slovak"},{"code":"sl","name":"Slovene"},{"code":"so","name":"Somali"},{"code":"st","name":"Southern Sotho"},{"code":"es","name":"Spanish; Castilian"},{"code":"su","name":"Sundanese"},{"code":"sw","name":"Swahili"},{"code":"ss","name":"Swati"},{"code":"sv","name":"Swedish"},{"code":"ta","name":"Tamil"},{"code":"te","name":"Telugu"},{"code":"tg","name":"Tajik"},{"code":"th","name":"Thai"},{"code":"ti","name":"Tigrinya"},{"code":"bo","name":"Tibetan Standard, Tibetan, Central"},{"code":"tk","name":"Turkmen"},{"code":"tl","name":"Tagalog"},{"code":"tn","name":"Tswana"},{"code":"to","name":"Tonga (Tonga Islands)"},{"code":"tr","name":"Turkish"},{"code":"ts","name":"Tsonga"},{"code":"tt","name":"Tatar"},{"code":"tw","name":"Twi"},{"code":"ty","name":"Tahitian"},{"code":"ug","name":"Uyghur, Uighur"},{"code":"uk","name":"Ukrainian"},{"code":"ur","name":"Urdu"},{"code":"uz","name":"Uzbek"},{"code":"ve","name":"Venda"},{"code":"vi","name":"Vietnamese"},{"code":"vo","name":"Volapük"},{"code":"wa","name":"Walloon"},{"code":"cy","name":"Welsh"},{"code":"wo","name":"Wolof"},{"code":"fy","name":"Western Frisian"},{"code":"xh","name":"Xhosa"},{"code":"yi","name":"Yiddish"},{"code":"yo","name":"Yoruba"},{"code":"za","name":"Zhuang, Chuang"},{"code":"zu","name":"Zulu"}]')},73858:function(e){"use strict";e.exports=JSON.parse('{"type":"object","properties":{"header":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"identifier":{"type":"string","title":"Identifier","description":"Identifier of the data source.","default":"MY_DATASOURCE"},"name":{"type":"string","title":"Name","description":"Name of the data source","default":"My Data Source"},"description":{"type":"string","title":"Description","description":"Description of the data contained in the data source","default":"My Data Source contains mobility data about mobility things."},"publisher_name":{"type":"string","title":"Publisher name","description":"Name of the entity providing the data source","default":"Cefriel Data Publisher"},"publisher_email":{"title":"Publisher email","type":"string","description":"Email of the entity providing the data source","default":"no-reply@cefriel.com"},"access_url":{"type":"string","title":"Access URL","x-display":"hidden"},"creation_time":{"type":"string","title":"Creation date","x-display":"hidden"},"last_updated":{"type":"string","title":"Modification time","x-display":"hidden"},"type":{"type":"string","title":"Type","x-display":"hidden"},"id":{"type":"string","title":"Identifier","x-display":"hidden"}}},"content":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"mobility_themes":{"title":"Mobility themes","description":"Categories describing the data in the data source. The first level of categories defined by the mobilitydcatap:mobilityTheme vocabulary can be selected. This field is recommended.","type":"array","default":["Other"],"items":{"type":"string","enum":["Static road network data","Geometry","Road width","Number of lanes","Gradients","Junctions","Road classification","Cycle network data","Network geometry and lane character","Network detailed attributes","Network closures/diversions","Pedestrian network data","Pedestrian network geometry","Pedestrian accessibility facilities","Static traffic signs and regulations","Tunnel access conditions","Bridge access conditions","Speed limits","Other static traffic signs","Permanent access restrictions","Other traffic regulations","Traffic circulation plans","Toll information","Location of tolling stations","Identification of tolled roads","Applicable road user charges and payment methods","Payment methods for tolls","Parking, service and rest area information","Car parking locations and conditions","Car parking availability","Service and rest area locations and conditions","Service and rest area availability","Truck parking locations and conditions","Truck parking availability","Park and Ride stops","Bike-parking locations","Filling and charging stations","Location and conditions of charging points","Location and conditions of filling stations","Availability of charging points for electric vehicles","Availability of filling stations","Freight and logistics","Freight delivery regulations","Location of delivery areas","Availability of delivery areas","Dynamic traffic signs and regulations","Road closures and access conditions","Lane closures and access conditions","Bridge closures and access conditions","Tunnel closures and access conditions","Other access restrictions and traffic regulations","Dynamic overtaking bans on heavy goods vehicles","Dynamic speed limits","Direction of travel on reversible lanes","Other temporary traffic management measures or plans","Road work information","Long-term road works","Short-term road works","Road events and conditions","Accidents and incidents","Poor road conditions","Road weather conditions","Real-time traffic data","Traffic volume","Speed","Location and length of queues","Current travel times","Predicted travel times","Expected delays","Waiting time at border crossings to non-EU Member States","Traffic data at border crossings to third countries","General information for trip-planning","Address identifiers","Topographic places","Points of interest","Parameters needed to calculate environmental factors","Parameters needed to calculate costs","Public transport scheduled transport","Stop facilities location and features","Stop facilities geometry and map layout","Stop facilities status of features","Stop facilities accessibility and paths within facility","Operational Calendar","Connection links","Network topology and routes/lines","Transport operators","Timetables static","Real-time estimated departure and arrival times","Planned interchanges between scheduled services","Hours of operation","Vehicle details","Environmental standards for vehicles","Disruptions, delays, cancellations","Basic common standard fares","Passenger classes","Common fare products","Special Fare Products","Basic commercial conditions","Purchase information","Public transport non-scheduled transport","Provider data","Service areas and service times","Locations and stations","Fares","Reservation and purchase options","Accesibility information for vehicles","Environmental standards for vehicles","Sharing and Hiring Services","Bike-sharing Locations and stations","Car-sharing Locations and stations","Bike-hiring Stations","Car-sharing Stations","E-scooter-sharing Locations and stations","Car-sharing Availability","Bike sharing Availability","Car-hiring Availability","Bike-hiring Availability","E-scooter-sharing Availability","Payment methods","Environmental standards for vehicles","Air and space travel","Waterways and water bodies","Other"]}},"accrual_periodicity":{"description":"Describes how often the content of the data source is updated. The usage of the vocabularies http://publications.europa.eu/resource/authority/frequency and https://w3id.org/mobilitydcat-ap/update-frequency is recommended.","title":"Accrual periodicity","type":"string","enum":["Continuously","Never (one-time provision)","On occurrence / irregularly","Up to 1min","Up to 5min","Up to 10 min","Up to 15 min","Up to 30 min","Up to 1h","Up to 2h","Up to 3h","Up to 12h","Up to 24h","Up to Weekly","Up to Monthly","Up to every 2 months","Up to every 3 months","Up to every 6 months","Up to Annual","Up to Biennial","Up to Triennial","Up to Quadrennial","Up to Quinquennial","Up to Decennial","Up to Bidecennial","Up to Tridecennial","Unknown"],"default":"Unknown"},"spatial_coverage":{"type":"string","default":"http://publications.europa.eu/resource/authority/country/ITA","description":"The geographical coverage of the data in the data source.","title":"Area covered"},"temporal_coverage_start":{"type":"string","format":"date","description":"The starting timestamp for the timeframe covered by the data source. This field is recommended.","title":"Timeframe start"},"temporal_coverage_end":{"type":"string","format":"date","description":"The ending timestamp for the timeframe covered by the data source. This field is recommended.","title":"Timeframe end"},"distributions":{"title":"Distributions","description":"A specific representation of a Dataset.","type":"array","items":{"type":"object","properties":{"data_schema":{"description":"The data schema/model adopted to represent the data in the distribution. The data schema/model should be selected from the list defined in the mobilitydcatap:mobility-data-standard vocabulary or defined as TANGENT Reference Conceptual Model.","title":"Data schema/model","type":"string","default":"Other","enum":["DATEX II","OCIT-C","C-ITS","TN-ITS","INSPIRE","GML","NeTEx","SIRI","GTFS","GTFS-RT","GBFS","tpegML","DINO","Other"]},"format":{"type":"string","description":"The format used to encode the data in the distribution. The vocabulary http://publications.europa.eu/resource/dataset/file-type is recommended to serialise the admissible values ","title":"Resource format","default":"http://publications.europa.eu/resource/authority/file-type/CSV"},"access_url":{"type":"string","title":"Access URL.","description":"URL redirecting to a webpage or an endpoint to access the data.","default":"http://www.cefriel.com/data/my_data_source"}}}}}}}}')}},t={};function a(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,a),i.loaded=!0,i.exports}a.m=e,function(){var e=[];a.O=function(t,n,r,i){if(!n){var o=1/0;for(l=0;l=i)&&Object.keys(a.O).every((function(e){return a.O[e](n[c])}))?n.splice(c--,1):(s=!1,i0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[n,r,i]}}(),function(){a.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return a.d(t,{a:t}),t}}(),function(){var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};a.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"===typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"===typeof n.then)return n}var i=Object.create(null);a.r(i);var o={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((function(e){o[e]=function(){return n[e]}}));return o["default"]=function(){return n},a.d(i,o),i}}(),function(){a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}}(),function(){a.f={},a.e=function(e){return Promise.all(Object.keys(a.f).reduce((function(t,n){return a.f[n](e,t),t}),[]))}}(),function(){a.u=function(e){return"js/"+e+"."+{13:"6c9a5db4",43:"d0b4a88a",49:"11942c3a",55:"a9b33011",109:"8a94cc6b",148:"55fc6e6c",200:"944c37a3",208:"e089da2b",236:"aff9ab69",420:"14eb6617",564:"9497f0a9",590:"a00bbba2",595:"21fc48c4",611:"575aef38",675:"39da3138",699:"a64bba25",731:"bc66358b",733:"fefd97ec",818:"e865edf8",954:"3ce06965",978:"c30ec276"}[e]+".js"}}(),function(){a.miniCssF=function(e){}}(),function(){a.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){a.hmd=function(e){return e=Object.create(e),e.children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e}}(),function(){a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="mobilitydcatap-ui:";a.l=function(n,r,i,o){if(e[n])e[n].push(r);else{var s,c;if(void 0!==i)for(var d=document.getElementsByTagName("script"),l=0;l\r\n \r\n \r\n \r\n {{ new Date().getFullYear() }} — Cefriel \r\n \r\n \r\n \r\n\r\n\r\n\r\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Footer.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Footer.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./Footer.vue?vue&type=template&id=579b6b3e\"\nimport script from \"./Footer.vue?vue&type=script&lang=js\"\nexport * from \"./Footer.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('v-app-bar',{attrs:{\"app\":\"\",\"flat\":\"\",\"clipped-left\":\"\"}},[_c('router-link',{attrs:{\"to\":\"/\"}},[_c('v-img',{staticClass:\"mx-2\",attrs:{\"src\":_vm.app_logo,\"max-height\":\"40\",\"max-width\":\"40\",\"contain\":\"\"}})],1),_c('v-toolbar-title',[_vm._v(_vm._s(_vm.app_name))])],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Topbar.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Topbar.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./Topbar.vue?vue&type=template&id=5a5c0e34\"\nimport script from \"./Topbar.vue?vue&type=script&lang=js\"\nexport * from \"./Topbar.vue?vue&type=script&lang=js\"\nimport style0 from \"./Topbar.vue?vue&type=style&index=0&id=5a5c0e34&prod&lang=css\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\r\n\r\n\r\n\r\n","import mod from \"-!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./App.vue?vue&type=template&id=fefcadbe\"\nimport script from \"./App.vue?vue&type=script&lang=js\"\nexport * from \"./App.vue?vue&type=script&lang=js\"\nimport style0 from \"./App.vue?vue&type=style&index=0&id=fefcadbe&prod&lang=css\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import Vue from 'vue';\r\nimport Vuetify from 'vuetify/lib/framework';\r\nimport '@mdi/font/css/materialdesignicons.css'\r\n\r\nVue.use(Vuetify);\r\n\r\nexport default new Vuetify({\r\n theme: {\r\n themes: {\r\n light: {\r\n primary: '#757575', },\r\n }\r\n }\r\n});\r\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[_c('PageTitle',{attrs:{\"title\":_vm.asset_type,\"show_breadcrumbs\":true}}),_c('v-row',{staticClass:\"px-10 my-2\"},[_c('v-col',{staticClass:\"py-2\",attrs:{\"cols\":\"8\"}},[_c('p',[_c('b',[_vm._v(\"Fill the form with all the metadata and download the RDF\")]),_vm._v(\" representation using \"),_c('a',{attrs:{\"href\":\"https://w3id.org/mobilitydcat-ap/\"}},[_vm._v(\"mobilityDCAT-AP\")]),_vm._v(\". Test and experiment to learn how different information should be described in RDF according to the mobilityDCAT-AP specification. The form is compliant with the minimum profile required by mobilityDCAT-AP.\"),_c('br'),_c('br'),_vm._v(\" This page is powered by \"),_c('b',[_vm._v(\"KCONG (Knowledge Catalogue and Governance)\")]),_vm._v(\" a complete (meta)data catalogue solution developed by \"),_c('a',{attrs:{\"href\":\"https://www.cefriel.com/\"}},[_vm._v(\"Cefriel\")]),_vm._v(\". If you want to know more visit \"),_c('a',{attrs:{\"href\":\"https://kcong.cefriel.com/\"}},[_vm._v(\"https://kcong.cefriel.com/\")]),_vm._v(\". The page is client-side only so all the information inserted are not collected/stored and can not be retrieved if the page is reloaded.\")])]),_c('v-col',{staticClass:\"text-center py-2\",attrs:{\"cols\":\"4\"}},[_c('img',{staticStyle:{\"max-height\":\"100px\"},attrs:{\"src\":require(\"@/assets/logo.png\"),\"alt\":\"Company Logo\"}})])],1),_vm._l((_vm.alert_messages),function(alert_message,index){return _c('Alert',{key:index,attrs:{\"message\":alert_message.message,\"alert_type\":alert_message.alert_type}})}),_c('v-container',[_c('v-row',[_c('v-col',{attrs:{\"cols\":\"6\"}},[_c('v-form',{ref:\"form\",model:{value:(_vm.valid),callback:function ($$v) {_vm.valid=$$v},expression:\"valid\"}},[_c('JsonForm',{key:_vm.formKey,attrs:{\"value\":_vm.asset,\"schema\":_vm.asset_schema,\"options\":_vm.options},on:{\"update:model\":_vm.set_asset_value}})],1),_c('p',[_c('br')]),_c('v-btn',{staticStyle:{\"margin-top\":\"10px\"},on:{\"click\":_vm.create_object}},[_vm._v(\"Generate\")])],1),_c('v-col',{attrs:{\"cols\":\"6\"}},[(_vm.saved_asset_rdf)?_c('div',{staticClass:\"rdf-container\"},[_c('v-select',{staticClass:\"mb-3\",attrs:{\"items\":_vm.formats,\"label\":\"Select RDF Format\"},model:{value:(_vm.selectedFormat),callback:function ($$v) {_vm.selectedFormat=$$v},expression:\"selectedFormat\"}}),_c('rdf-editor',{staticClass:\"h-full overflow-hidden\",attrs:{\"format\":_vm.selectedFormat,\"readonly\":true,\"prefixes\":_vm.editorPrefixes,\"auto-parse\":\"\",\"parse-delay\":\"1000\"},domProps:{\"value\":_vm.saved_asset_rdf},on:{\"parsing-failed\":_vm.onParsingFailed,\"prefixes-parsed\":_vm.onPrefixesParsed,\"serialized\":_vm.onSerialized}}),_c('v-btn',{staticClass:\"mb-2\",attrs:{\"color\":\"primary\"},on:{\"click\":_vm.downloadRDF}},[_vm._v(\"Download RDF\")])],1):_vm._e()])],1)],1)],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('v-container',[_c('v-form',{model:{value:(_vm.valid),callback:function ($$v) {_vm.valid=$$v},expression:\"valid\"}},[_c('v-jsf',{attrs:{\"schema\":_vm.schema,\"options\":_vm.options},on:{\"input\":function($event){return _vm.$emit('update:model', $event)}},model:{value:(_vm.model),callback:function ($$v) {_vm.model=$$v},expression:\"model\"}})],1)],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./JsonForm.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./JsonForm.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./JsonForm.vue?vue&type=template&id=7f267588\"\nimport script from \"./JsonForm.vue?vue&type=script&lang=js\"\nexport * from \"./JsonForm.vue?vue&type=script&lang=js\"\nimport style0 from \"./JsonForm.vue?vue&type=style&index=0&id=7f267588&prod&lang=css\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('v-container',[_c('v-alert',{staticClass:\"text-center\",attrs:{\"value\":!!_vm.message,\"type\":_vm.alert_type,\"dismissible\":\"\"}},[_vm._v(\" \"+_vm._s(_vm.message)+\" \")])],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Alert.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Alert.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./Alert.vue?vue&type=template&id=64459cc8\"\nimport script from \"./Alert.vue?vue&type=script&lang=js\"\nexport * from \"./Alert.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('v-container',{staticClass:\"page-top py-4 mb-8\",attrs:{\"fluid\":\"\"}},[_c('v-row',[_c('v-col',{attrs:{\"cols\":\"9\"}},[_c('v-row',{staticClass:\"ml-4\"},[_c('v-col',[_c('h1',{staticClass:\"text-capitalize\"},[_vm._v(_vm._s(_vm.title || _vm.remove_underscore))])])],1),(_vm.subtitle!=null)?_c('v-row',{staticClass:\"ml-4\"},[_c('v-col',[_c('h2',{staticClass:\"text-capitalize\"},[_vm._v(_vm._s(_vm.subtitle || _vm.remove_underscore))])])],1):_vm._e(),(_vm.third_line!=null)?_c('v-row',{staticClass:\"ml-4\"},[_c('v-col',[_c('h3',[_vm._v(\" \"+_vm._s(_vm.third_line || _vm.remove_underscore)+\" \")])])],1):_vm._e()],1),_c('v-col',{attrs:{\"cols\":\"3\"}},[(_vm.image!=null)?_c('v-row',[_c('v-img',{attrs:{\"max-height\":\"160px\",\"position\":\"bottom center\",\"src\":_vm.image,\"contain\":\"\"}})],1):_vm._e()],1)],1)],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./PageTitle.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./PageTitle.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./PageTitle.vue?vue&type=template&id=46f3abe2&scoped=true\"\nimport script from \"./PageTitle.vue?vue&type=script&lang=js\"\nexport * from \"./PageTitle.vue?vue&type=script&lang=js\"\nimport style0 from \"./PageTitle.vue?vue&type=style&index=0&id=46f3abe2&prod&lang=css&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"46f3abe2\",\n null\n \n)\n\nexport default component.exports","export default \"{%- set prefix=\\\"https://knowledge.c-innovationhub.com/cefriel/data/\\\" -%}\\r\\n{%- set dcat_content = obj.header -%}\\r\\n{%- set json_content = obj.content -%}\\r\\n{%- set asset_name = slugify(dcat_content.name) -%}\\r\\n{%- set asset_type = \\\"MobilityDataset\\\" -%}\\r\\n{%- set asset_id = '<' + prefix + asset_type + '#' + asset_name + '>' -%}\\r\\n{%- set catalogue_id= '<' + prefix + 'CefrielDataCatalogue#' + asset_type + '>' -%}\\r\\n{%- set catalogue_record_id = '<' + prefix + 'CefrielDataCatalogueRecord/' + asset_type + '#' + asset_name + '>' -%}\\r\\n{%- set asset_type_url = data_platform_url + '/assets/' + asset_name -%}\\r\\n{%- set freq_iri = {\\r\\n \\\"Continuously\\\": \\\"http://publications.europa.eu/resource/authority/frequency/UPDATE_CONT\\\",\\r\\n \\\"Never (one-time provision)\\\": \\\"http://publications.europa.eu/resource/authority/frequency/NEVER\\\",\\r\\n \\\"On occurrence / irregularly\\\": \\\"http://publications.europa.eu/resource/authority/frequency/IRREG\\\",\\r\\n \\\"Up to 1min\\\": \\\"https://w3id.org/mobilitydcat-ap/update-frequency/1min\\\",\\r\\n \\\"Up to 5min\\\": \\\"https://w3id.org/mobilitydcat-ap/update-frequency/5min\\\",\\r\\n \\\"Up to 10 min\\\": \\\"https://w3id.org/mobilitydcat-ap/update-frequency/10min\\\",\\r\\n \\\"Up to 15 min\\\": \\\"https://w3id.org/mobilitydcat-ap/update-frequency/15min\\\",\\r\\n \\\"Up to 30 min\\\": \\\"https://w3id.org/mobilitydcat-ap/update-frequency/30min\\\",\\r\\n \\\"Up to 1h\\\": \\\"http://publications.europa.eu/resource/authority/frequency/HOURLY\\\",\\r\\n \\\"Up to 2h\\\": \\\"http://publications.europa.eu/resource/authority/frequency/BIHOURLY\\\",\\r\\n \\\"Up to 3h\\\": \\\"http://publications.europa.eu/resource/authority/frequency/TRIHOURLY\\\",\\r\\n \\\"Up to 12h\\\": \\\"https://w3id.org/mobilitydcat-ap/update-frequency/12h\\\",\\r\\n \\\"Up to 24h\\\": \\\"http://publications.europa.eu/resource/authority/frequency/DAILY\\\",\\r\\n \\\"Up to Weekly\\\": \\\"http://publications.europa.eu/resource/authority/frequency/WEEKLY\\\",\\r\\n \\\"Up to Monthly\\\": \\\"http://publications.europa.eu/resource/authority/frequency/MONTHLY\\\",\\r\\n \\\"Up to every 2 months\\\": \\\"http://publications.europa.eu/resource/authority/frequency/BIMONTHLY\\\",\\r\\n \\\"Up to every 3 months\\\": \\\"http://publications.europa.eu/resource/authority/frequency/QUARTERLY\\\",\\r\\n \\\"Up to every 6 months\\\": \\\"https://w3id.org/mobilitydcat-ap/update-frequency/ANNUAL_2\\\",\\r\\n \\\"Up to Annual\\\": \\\"http://publications.europa.eu/resource/authority/frequency/ANNUAL\\\",\\r\\n \\\"Up to Biennial\\\": \\\"http://publications.europa.eu/resource/authority/frequency/BIENNIAL\\\",\\r\\n \\\"Up to Triennial\\\": \\\"http://publications.europa.eu/resource/authority/frequency/TRIENNIAL\\\",\\r\\n \\\"Up to Quadrennial\\\": \\\"http://publications.europa.eu/resource/authority/frequency/QUADRENNIAL\\\",\\r\\n \\\"Up to Quinquennial\\\": \\\"http://publications.europa.eu/resource/authority/frequency/QUINQUENNIAL\\\",\\r\\n \\\"Up to Decennial\\\": \\\"http://publications.europa.eu/resource/authority/frequency/DECENNIAL\\\",\\r\\n \\\"Up to Bidecennial\\\": \\\"http://publications.europa.eu/resource/authority/frequency/BIDECENNIAL\\\",\\r\\n \\\"Up to Tridecennial\\\": \\\"http://publications.europa.eu/resource/authority/frequency/TRIDECENNIAL\\\",\\r\\n \\\"Unknown\\\": \\\"http://publications.europa.eu/resource/authority/frequency/UNKNOWN\\\"\\r\\n }\\r\\n-%}\\r\\n\\r\\n@prefix dcterms: .\\r\\n@prefix rdf: .\\r\\n@prefix xsd: .\\r\\n@prefix dcat: .\\r\\n@prefix vcard: .\\r\\n@prefix foaf: .\\r\\n@prefix owl: .\\r\\n@prefix mobilitydcatap: .\\r\\n@prefix mdata: .\\r\\n@prefix mtheme: .\\r\\n\\r\\n\\r\\n{{catalogue_id | safe}} rdf:type dcat:Catalog;\\r\\n\\tdcterms:title \\\"Cefriel RDF Metadata Generator for mobilityDCAT-AP\\\";\\r\\n\\tdcterms:description \\\"Cefriel RDF Metadata Generator for mobilityDCAT-AP powered by KCONG\\\"@en;\\r\\n\\tdcterms:publisher [\\r\\n\\t rdf:type foaf:Agent;\\r\\n\\t foaf:name \\\"Mobility Data Publisher\\\";\\r\\n\\t foaf:mbox \\\"no-reply@cefriel.com\\\";\\r\\n\\t];\\r\\n\\tdcterms:dataset {{asset_id | safe}};\\r\\n\\tdcat:record {{catalogue_record_id | safe}};\\r\\n\\tfoaf:homepage .\\r\\n\\r\\n\\r\\n{{catalogue_record_id | safe}} rdf:type dcat:CatalogRecord ;\\r\\n\\tdcterms:modified \\\"{{dcat_content.last_updated}}\\\"^^xsd:dateTime ;\\r\\n\\tdcterms:created \\\"{{dcat_content.creation_time}}\\\"^^xsd:dateTime ;\\r\\n\\tfoaf:primaryTopic {{asset_id | safe}} .\\r\\n\\r\\n\\r\\n{{asset_id | safe}} rdf:type dcat:Dataset;\\r\\n dcterms:identifier \\\"\\\"\\\"{{dcat_content.identifier}}\\\"\\\"\\\";\\r\\n dcterms:title \\\"{{dcat_content.name}}\\\";\\r\\n dcterms:description \\\"\\\"\\\"{{dcat_content.description}}\\\"\\\"\\\";\\r\\n {%if dcat_content.publisher_name or dcat_content.publisher_email %}\\r\\n dcterms:publisher [\\r\\n\\t rdf:type foaf:Agent;\\r\\n {%if dcat_content.publisher_name %}\\r\\n\\t foaf:name \\\"{{dcat_content.publisher_name}}\\\";\\r\\n {%endif%}\\r\\n {%if dcat_content.publisher_email %}\\r\\n\\t foaf:mbox \\\"{{dcat_content.publisher_email}}\\\";\\r\\n {%endif%}\\r\\n ];\\r\\n {%endif%}\\r\\n \\r\\n {%if json_content.mobility_themes%}\\r\\n {% for mtheme in json_content.mobility_themes %}\\r\\n mobilitydcatap:mobilityTheme mtheme:{{mtheme | lower | replace(\\\" \\\", \\\"-\\\") | replace(\\\",\\\" , \\\"\\\")}};\\r\\n {% endfor %}\\r\\n {%endif%}\\r\\n {%if '://' in json_content.spatial_coverage %}\\r\\n dcat:spatial <{{json_content.spatial_coverage}}>;\\r\\n {%else%}\\r\\n dcat:spatial \\\"\\\"\\\"{{json_content.spatial_coverage}}\\\"\\\"\\\";\\r\\n {%endif%}\\r\\n {%if json_content.spatial_aggregation%}\\r\\n dcat:spatialResolutionInMeters \\\"\\\"\\\"{{json_content.spatial_aggregation}}\\\"\\\"\\\";\\r\\n {%endif%}\\r\\n\\r\\n {%if json_content.temporal_coverage_start or json_content.temporal_coverage_end%}\\r\\n dcat:temporal [ a dcterms:PeriodOfTime;\\r\\n {%if json_content.temporal_coverage_start%}\\r\\n\\t dcat:startDate \\\"\\\"\\\"{{json_content.temporal_coverage_start}}\\\"\\\"\\\";\\r\\n {%endif%}\\r\\n {%if json_content.temporal_coverage_end%}\\r\\n\\t dcat:endDate \\\"\\\"\\\"{{json_content.temporal_coverage_end}}\\\"\\\"\\\";\\r\\n {%endif%}\\r\\n ];\\r\\n {%endif%}\\r\\n\\r\\n {%if json_content.temporal_aggregation%}\\r\\n dcat:temporalResolution \\\"\\\"\\\"{{json_content.temporal_aggregation}}\\\"\\\"\\\";\\r\\n {%endif%}\\r\\n\\r\\n {%-if json_content.source_asset.id-%}\\r\\n dcterms:source <{{json_content.source_asset.id}}>;\\r\\n {%-endif-%}\\r\\n\\r\\n {%- set accrual_periodicity = json_content.accrual_periodicity -%}\\r\\n dcat:accrualPeriodicity <{{ freq_iri[accrual_periodicity] }}>.\\r\\n\\r\\n\\r\\n {%if json_content.distributions %}\\r\\n {%- for distribution in json_content.distributions -%}\\r\\n {%- set distribution_id = '<' + prefix + asset_type + '/Distribution#' + asset_name + '-' + loop.index + '>' -%}\\r\\n {{asset_id | safe}} dcat:distribution {{distribution_id | safe}} .\\r\\n\\r\\n {{distribution_id | safe}} rdf:type dcat:Distribution;\\r\\n mobilitydcatap:mobilityDataStandard mdata:{{distribution.data_schema | lower | replace(\\\" \\\", \\\"-\\\")}} ;\\r\\n {% if '://' in json_content.spatial_coverage %}\\r\\n dcterms:format <{{distribution.format}}>;\\r\\n {%else%}\\r\\n dcterms:format \\\"{{distribution.format}}\\\";\\r\\n {%endif%}\\r\\n\\t {%-if json_content.data_sample -%}\\r\\n {%- for sample in json_content.data_sample -%}\\r\\n adms:sample [\\r\\n rdf:type dcat:Distribution;\\r\\n dcat:downloadURL <{{sample.url}}>;\\r\\n {%-if sample.sample_description -%}\\r\\n dcterms:description \\\"\\\"\\\"{{sample.sample_description}}\\\"\\\"\\\"\\r\\n {%- endif -%}\\r\\n ];\\r\\n {%- endfor -%}\\r\\n\\t {%- endif -%}\\r\\n\\tdcat:accessURL <{{distribution.access_url}}> .\\r\\n {%- endfor -%}\\r\\n {%- endif -%}\\r\\n\";","\r\n\r\n\r\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./AssetCreate.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./AssetCreate.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./AssetCreate.vue?vue&type=template&id=402a299a\"\nimport script from \"./AssetCreate.vue?vue&type=script&lang=js\"\nexport * from \"./AssetCreate.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import Vue from 'vue'\r\nimport Router from 'vue-router'\r\n\r\nimport AssetCreate from './components/AssetCreate.vue'\r\n\r\nVue.use(Router)\r\n\r\n\r\nconst router= new Router({\r\n mode: 'history',\r\n routes: [\r\n {\r\n path: '/mobilitydcatap-ui/',\r\n name: 'asset_create',\r\n component: AssetCreate,\r\n props: {\r\n asset_type : 'mobilityDCAT-AP Generator Tool'\r\n },\r\n meta: {\r\n title: \"Cefriel RDF Metadata Generator\",\r\n }\r\n },\r\n ]\r\n})\r\n\r\nexport default router\r\n","import Vue from 'vue';\r\nimport App from './App.vue';\r\nimport vuetify from './plugins/vuetify';\r\nimport router from './router';\r\nimport Resource from 'vue-resource';\r\nimport moment from 'moment/src/moment';\r\n\r\nVue.config.productionTip = false;\r\nVue.config.ignoredElements = ['rdf-editor']\r\n\r\nVue.use(Resource);\r\n\r\n// Set page title\r\nrouter.beforeEach((to, from, next) => {\r\n const { title } = to.meta;\r\n document.title = typeof title === 'function' ? title(to) : title;\r\n next();\r\n});\r\n\r\n// Vue functions to be used in templates\r\nVue.filter('formatDate', function(value) {\r\n if (value) {\r\n return moment(String(value)).format('MM/DD/YYYY hh:mm')\r\n }\r\n});\r\n\r\nVue.filter('remove_underscore', function (value) {\r\n if (!value) return ''\r\n value = value.toString()\r\n return value.replaceAll(\"_\", \" \")\r\n})\r\n\r\nnew Vue({\r\n vuetify,\r\n router,\r\n render: h => h(App)\r\n}).$mount('#app')\r\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","var getProto = Object.getPrototypeOf ? function(obj) { return Object.getPrototypeOf(obj); } : function(obj) { return obj.__proto__; };\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach(function(key) { def[key] = function() { return value[key]; }; });\n\t}\n\tdef['default'] = function() { return value; };\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"js/\" + chunkId + \".\" + {\"13\":\"6c9a5db4\",\"43\":\"d0b4a88a\",\"49\":\"11942c3a\",\"55\":\"a9b33011\",\"109\":\"8a94cc6b\",\"148\":\"55fc6e6c\",\"200\":\"944c37a3\",\"208\":\"e089da2b\",\"236\":\"aff9ab69\",\"420\":\"14eb6617\",\"564\":\"9497f0a9\",\"590\":\"a00bbba2\",\"595\":\"21fc48c4\",\"611\":\"575aef38\",\"675\":\"39da3138\",\"699\":\"a64bba25\",\"731\":\"bc66358b\",\"733\":\"fefd97ec\",\"818\":\"e865edf8\",\"954\":\"3ce06965\",\"978\":\"c30ec276\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.hmd = function(module) {\n\tmodule = Object.create(module);\n\tif (!module.children) module.children = [];\n\tObject.defineProperty(module, 'exports', {\n\t\tenumerable: true,\n\t\tset: function() {\n\t\t\tthrow new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);\n\t\t}\n\t});\n\treturn module;\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var inProgress = {};\nvar dataWebpackPrefix = \"mobilitydcatap-ui:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.p = \"/mobilitydcatap-ui/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t524: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmobilitydcatap_ui\"] = self[\"webpackChunkmobilitydcatap_ui\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [504], function() { return __webpack_require__(84217); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["attrs","render","staticRenderFns","staticClass","_c","_vm","_v","name","component","data","app_name","app_logo","require","path_items","components","Footer","Topbar","username","window","localStorage","getItem","methods","Vue","use","Vuetify","theme","themes","light","primary","_l","alert_message","value","valid","callback","expression","key","formKey","asset","on","staticStyle","create_object","model","selectedFormat","domProps","saved_asset_rdf","$$v","VJsf","props","schema","Object","options","emits","watch","handler","newValue","deep","immediate","message","String","alert_type","_s","title","type","required","subtitle","third_line","freetext","image","show_breadcrumbs","Boolean","ajv","Ajv","JsonForm","PageTitle","Alert","template_engine","template","asset_schema","initial_asset","saved_asset","serialized_rdf","alert_messages","selectedPdf","pdfUrl","parseError","formats","parsers","keys","editorPrefixes","context","languages","mounted","compile","form_template","onParsingFailed","e","console","error","detail","onPrefixesParsed","prefixes","join","onSerialized","downloadRDF","push","formatToExtension","fileExtension","blob","Blob","url","URL","createObjectURL","link","document","createElement","href","setAttribute","body","appendChild","click","removeChild","revokeObjectURL","set_asset_value","event","slugify","str","normalize","replace","trim","toLowerCase","$refs","form","validate","header","creation_time","Date","toISOString","last_updated","asset_type","id","uuidv4","obj","data_platform_url","log","Router","router","mode","routes","path","AssetCreate","meta","config","productionTip","ignoredElements","Resource","beforeEach","to","from","next","filter","moment","format","toString","replaceAll","vuetify","h","App","$mount","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","loaded","__webpack_modules__","call","m","deferred","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","every","splice","r","n","getter","__esModule","d","a","leafPrototypes","getProto","getPrototypeOf","__proto__","t","this","then","ns","create","def","current","indexOf","getOwnPropertyNames","forEach","definition","o","defineProperty","enumerable","get","f","chunkId","Promise","all","reduce","promises","u","miniCssF","g","globalThis","Function","hmd","children","set","Error","prop","prototype","hasOwnProperty","inProgress","dataWebpackPrefix","l","done","script","needAttach","scripts","getElementsByTagName","s","getAttribute","charset","timeout","nc","src","onScriptComplete","prev","onerror","onload","clearTimeout","doneFns","parentNode","setTimeout","bind","target","head","Symbol","toStringTag","nmd","paths","p","installedChunks","installedChunkData","promise","resolve","reject","loadingEnded","errorType","realSrc","request","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","self","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/chunk-vendors.afa21783.js b/dist/js/chunk-vendors.98f07d13.js similarity index 56% rename from dist/js/chunk-vendors.afa21783.js rename to dist/js/chunk-vendors.98f07d13.js index e48b7e5..12f5a51 100644 --- a/dist/js/chunk-vendors.afa21783.js +++ b/dist/js/chunk-vendors.98f07d13.js @@ -1,71 +1,71 @@ -(self["webpackChunkmobilitydcatap_ui"]=self["webpackChunkmobilitydcatap_ui"]||[]).push([[504],{76063:function(e,t,r){const i=r(91565),n=/([\x00-\x20<>"{}|^`\\]|%(?![0-9A-F][0-9A-F]))/g,s=(e,t)=>{let r=t.codePointAt(0).toString(16)+"";return r.length>4?"\\U"+r.padStart(8,"0"):"\\u"+r.padStart(4,"0")},o=e=>e.replace(n,s),a=/^(?:[\u0000-@[-`{-\u00bf\u00d7\u00f7\u0300-\u306f\u037e\u2000-\u200b\u200e-\u206f\u2190-\u2bff\u2ff0-\u3000\ud800-\uf8ff\ufdd0-\ufddf\ufffe\uffff].+|(?:.+?[\u0000-,\/:-@[-^`{-\u00b6\u00b8-\u00bf\u00d7\u00f7\u037e\u2000-\u200b\u200e-\u203e\u2041-\u206f\u2190-\u2bff\u2ff0-\u3000\ud800-\uf8ff\ufdd0-\ufddf\ufffe\uffff].*)|.+\.)$/,l=/^(?:\\|[\u0000-\/;-@[-^`{-\u00bf\u00d7\u00f7\u0300-\u306f\u037e\u2000-\u200b\u200e-\u206f\u2190-\u2bff\u2ff0-\u3000\ud800-\uf8ff\ufdd0-\ufddf\ufffe\uffff].+|(?:.+?(?:\\|[\u0000-,\/;-@[-^`{-\u00b6\u00b8-\u00bf\u00d7\u00f7\u037e\u2000-\u200b\u200e-\u203e\u2041-\u206f\u2190-\u2bff\u2ff0-\u3000\ud800-\uf8ff\ufdd0-\ufddf\ufffe\uffff]).+)|(?:.+?(?:\\|[\u0000-,.\/;-@[-^`{-\u00b6\u00b8-\u00bf\u00d7\u00f7\u037e\u2000-\u200b\u200e-\u203e\u2041-\u206f\u2190-\u2bff\u2ff0-\u3000\ud800-\uf8ff\ufdd0-\ufddf\ufffe\uffff])))$/,u=/^([Tt](rue)?|TRUE)$/,c=/^([Ff](alse)?|FALSE)$/,h="xxxxxxxx_xxxx_4xxx_yxxx_xxxxxxxxxxxx",d=/[xy]/g,f=()=>{let e=Date.now();return"undefined"!==typeof performance&&(e+=performance.now()),h.replace(d,(t=>{let r=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?r:3&r|8).toString(16)}))},p=Symbol("prefix-cache"),m=/[$^*()+[\\{}|.?]/g,g="((?:[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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]|%[A-Fa-f0-9]{2}|\\\\[_~.\\-!$&'()*+,;=/?#@%])(?:(?:[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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}.:]|%[A-Fa-f0-9]{2}|\\\\[_~.\\-!$&'()*+,;=/?#@%])*(?:[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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}:]|%[A-Fa-f0-9]{2}|\\\\[_~.\\-!$&'()*+,;=/?#@%]))?)$";function v(e,t=!1){let r=[],i={};for(let n in e){let s=e[n];t&&a.test(n)||(i[s]=n,r.push(s.replace(m,"\\$&")))}return r.length?(e[p]={_r_iris:new RegExp(`^(${r.join("|")})${g}`,"u"),_h_inverse:i},Object.freeze(e)):e}const y=(e,t)=>{let r=t[p];if(r){let t=r._r_iris.exec(e);if(t)return r._h_inverse[t[1]]+":"+t[2]}else{let r="",i="",n=-1;for(let s in t){let o=t[s];if(0===e.indexOf(o)&&o.length>n&&!a.test(s)){let t=e.slice(o.length);l.test(t)||(i=t,r=s,n=o.length)}}if(-1!==n)return r+":"+i}return"<"+e+">"},b=(e,t={})=>{let r=t[p];if(r){let t=r._r_iris.exec(e);if(t)return r._h_inverse[t[1]]+":"+t[2]}else{let r="",i=-1;for(let n in t){let s=t[n];e.startsWith(s)&&s.length>i&&(r=n,i=s.length)}if(-1!==i)return r+":"+e.slice(i)}return">"+e},w=/^([^:]*):(.*)$/;function _(e,t={},r=!1){switch(e[0]){case">":return"<"+e.slice(1)+">";case"_":return e.length<=2||"#"===e[2]?(new J)[r?"verbose":"terse"]():e;case'"':return JSON.stringify(e.slice(1));case"@":{let t=e.indexOf('"');return JSON.stringify(e.slice(t+1))+e.slice(0,t)}case"^":{let i=e.indexOf('"');return JSON.stringify(e.slice(i+1))+"^^"+_(e.slice(1,i),t,r)}case"*":return"";case"<":case"`":return ne.c1(e).terse(t);default:{if("a"===e)return r?"":"a";let[,i,n]=w.exec(e);return r||l.test(n)||a.test(i)?"<"+t[i]+n+">":e}}}class k{valueOf(){return this.concise()}toString(){return this.concise()}equals(e){return!!e&&(this===e||e.termType===this.termType&&e.value===this.value)}}Object.assign(k.prototype,{isGraphyTerm:!0});class x extends k{constructor(e){super(),this.value=e}concise(e={}){return b(this.value,e)}terse(e={},t=!1){return y(o(this.value),e,t)}verbose(){return"<"+o(this.value)+">"}isolate(){return{termType:"NamedNode",value:this.value}}}Object.assign(x.prototype,{termType:"NamedNode",isNamedNode:!0});const S=new x("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");S.isRdfTypeAlias=!0;const M=new x("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),E=M.isolate(),A=new x("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),C=new x("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"),$=new x("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"),O=new x("http://www.w3.org/2001/XMLSchema#date"),P=new x("http://www.w3.org/2001/XMLSchema#dateTime"),T=new x("http://www.w3.org/2001/XMLSchema#string");class I extends k{equals(e){return!!e&&(this===e||"Literal"===e.termType&&e.value===this.value&&this.datatype.equals(e.datatype)&&e.language===this.language)}verbose(){return JSON.stringify(this.value)+(this.language?"@"+this.language:"^^"+this.datatype.verbose())}concise(e){return this.language?"@"+this.language+'"'+this.value:"^"+b(this.datatype.value,e)+'"'+this.value}terse(e={}){let t=this.datatype.terse(e);return JSON.stringify(this.value)+(this.language?"@"+this.language:"^^"+t)}isolate(){return{termType:"Literal",value:this.value,language:this.language,datatype:this.datatype.isolate()}}}Object.assign(I.prototype,{datatype:T,language:"",termType:"Literal",isLiteral:!0,isSimple:!1});class D extends I{constructor(e,t){super(),this.value=e,this.language=("@"===t[0]?t.slice(1):t).toLowerCase()}verbose(){return JSON.stringify(this.value)+"@"+this.language}concise(){return"@"+this.language+'"'+this.value}terse(){return JSON.stringify(this.value)+"@"+this.language}isolate(){return{termType:"Literal",value:this.value,language:this.language,datatype:E}}}Object.assign(D.prototype,{datatype:M,isLanguaged:!0});class L extends I{verbose(){return JSON.stringify(this.value)+"^^"+this.datatype.verbose()}concise(e){return"^"+b(this.datatype.value,e)+'"'+this.value}terse(e={}){let t=this.datatype.terse(e);return JSON.stringify(this.value)+"^^"+t}isolate(){return{termType:"Literal",value:this.value,language:this.language,datatype:this.datatype.isolate()}}}Object.assign(L.prototype,{isDatatyped:!0});class R extends L{constructor(e,t){super(),this.value=e,this.datatype=t}}class N extends k{constructor(e){super(),this.value=e}get isSimple(){return!this.language&&!this.datatype.equals(T)}get isLanguaged(){return!!this.language}get isDatatyped(){return T.equals(this.datatype)}equals(e){return!!e&&(this===e||"Literal"===e.termType&&e.value===this.value&&this.datatype.equals(e.datatype)&&e.language===this.language)}verbose(){return JSON.stringify(this.value)+(this.language?"@"+this.language:"^^"+this.datatype.verbose())}concise(e){return this.language?"@"+this.language+'"'+this.value:"^"+b(this.datatype.value,e)+'"'+this.value}terse(e={}){let t=this.datatype.terse(e);return JSON.stringify(this.value)+(this.language?"@"+this.language:"^^"+t)}isolate(){return{termType:"Literal",value:this.value,language:this.language,datatype:this.datatype.isolate()}}}Object.assign(N.prototype,{datatype:T,language:"",termType:"Literal",isLiteral:!0});class j extends I{constructor(e){super(),this.value=e}verbose(){return JSON.stringify(this.value)}concise(){return'"'+this.value}terse(){return JSON.stringify(this.value)}}Object.assign(j.prototype,{isSimple:!0});const B=new x("http://www.w3.org/2001/XMLSchema#integer");class F extends L{static from(e){let t=new F(+e);return t.value=e,t}constructor(e){super(),this.value=e+"",this.number=e}concise(e={}){return"^"+B.concise(e)+'"'+this.value}terse(){return this.value.includes("e")?`"${this.value}"^^`:this.value}}Object.assign(F.prototype,{datatype:B,isNumeric:!0,isInteger:!0});const z=new x("http://www.w3.org/2001/XMLSchema#double");class V extends L{static from(e){let t=new V(+e);return t.value=e,t}constructor(e){super(),this.value=e+"",this.number=e}concise(e={}){return"^"+z.concise(e)+'"'+this.value}terse(){return this.number.toExponential()}}Object.assign(V.prototype,{datatype:z,isNumeric:!0,isDouble:!0});const q=new x("http://www.w3.org/2001/XMLSchema#decimal");class U extends L{static from(e){let t=new U(+e);return t.value=e,t}constructor(e){super(),this.value=e+"",this.number=e}concise(e={}){return"^"+q.concise(e)+'"'+this.value}terse(){return this.value.includes("e")?`"${this.value}"^^`:this.value+(this.value.includes(".")?"":".0")}}Object.assign(U.prototype,{datatype:q,isNumeric:!0,isDecimal:!0});const H=new x("http://www.w3.org/2001/XMLSchema#boolean");class W extends L{static from(e){let t=new W(+e);return t.value=e,t}constructor(e){super(),this.value=e+"",this.boolean=e}concise(e={}){return"^"+H.concise(e)+'"'+this.value}terse(){return this.value+""}}Object.assign(W.prototype,{datatype:H,isBoolean:!0});class K extends V{constructor(){super(1/0),this.value="INF"}terse(e){return'"INF"^^'+z.terse(e)}}Object.assign(K.prototype,{isInfinite:!0});class Y extends V{constructor(){super(-1/0),this.value="-INF"}terse(e){return'"-INF"^^'+z.terse(e)}}Object.assign(Y.prototype,{isInfinite:!0});class G extends V{constructor(){super(NaN),this.value="NaN"}terse(e){return'"NaN"^^'+z.terse(e)}}function Z(e,t=!1){this.value=e,this.isAnonymous=t}function J(){}Object.assign(G.prototype,{isNaN:!0}),Z.prototype=Object.assign(Object.create(k.prototype),{termType:"BlankNode",isBlankNode:!0,concise(){return"_:"+this.value},terse(){return"_:"+this.value},verbose(){return"_:"+this.value},isolate(){return{termType:"BlankNode",value:this.value}}}),J.prototype=Object.assign(Object.create(Z.prototype),{isAnonymous:!0,isEphemeral:!0,concise(){return"_:#"+this.value},terse(){return"[]"},verbose(){return"_:"+this.value},isolate(){return{termType:"BlankNode",value:this.value}},equals(){return!1}}),Object.defineProperty(J.prototype,"value",{get(){return"_"+f()}});class X extends k{constructor(e){super(),this.value=e}concise(){return"?"+this.value}terse(){throw new Error("Cannot call .terse() on 'Variable' term type")}verbose(){throw new Error("Cannot call .verbose() on 'Variable' term type")}isolate(){return{termType:"Variable",value:this.value}}}function Q(){}function ee(){}Object.assign(X.prototype,{termType:"Variable",isVariable:!0}),Q.prototype=Object.assign(Object.create(k.prototype),{value:"",termType:"DefaultGraph",isDefaultGraph:!0,concise(){return"*"},terse(){return""},verbose(){return""},isolate(){return{termType:"DefaultGraph",value:""}}}),ee.prototype=Object.assign(Object.create(k.prototype),{value:"",termType:"NoGraph",concise(){return""},terse(){return""},verbose(){return""},isolate(){return{termType:"NoGraph",value:""}}});const te=new Q;function re(e,t,r,i=te){this.subject=e,this.predicate=t,this.object=r,this.graph=i}Object.assign(re.prototype,{isGraphyQuad:!0,equals(e){return!!e&&(this===e||this.object.equals(e.object)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.graph.equals(e.graph))},valueOf(){return this.verbose()},concise(e={}){return[this.subject.concise(e),this.predicate.concise(e),this.object.concise(e),this.graph.concise(e)]},terse(e){let t=this.graph.isDefaultGraph;return(t?"":this.graph.terse(e)+" { ")+this.subject.terse(e)+" "+this.predicate.terse(e)+" "+this.object.terse(e)+" ."+(t?"":" }")},verbose(){return this.subject.verbose()+" "+this.predicate.verbose()+" "+this.object.verbose()+" "+(this.graph.isDefaultGraph?"":this.graph.verbose()+" ")+"."},isolate(){return{subject:this.subject.isolate(),predicate:this.predicate.isolate(),object:this.object.isolate(),graph:this.graph.isolate()}}});let ie={namedNode(e){return new x(e)},blankNode(e,t){return new Z(e,t)},literal(e){return new N(e)},defaultGraph(){return new Q},quad(e,t,r,i){return new re(e,t,r,i||te)},integer(e){return F.from(e)},double(e){return V.from(e)},decimal(e){return U.from(e)},boolean(e){return new W(e)}};const ne=e.exports={concise:b,adopt(e){let t=Object.create(e),r=!1;if("function"!==typeof e.boolean){let i=e.namedNode("http://www.w3.org/2001/XMLSchema#boolean");t.boolean=t=>e.literal(t+"",i),r=!0}if("function"!==typeof e.double){let i=e.namedNode("http://www.w3.org/2001/XMLSchema#double");t.double=t=>e.literal(t+"",i),r=!0}if("function"!==typeof e.decimal){let i=e.namedNode("http://www.w3.org/2001/XMLSchema#decimal");t.decimal=t=>e.literal(t+"",i),r=!0}if("function"!==typeof e.integer){let i=e.namedNode("http://www.w3.org/2001/XMLSchema#integer");t.integer=t=>e.literal(t+"",i),r=!0}return"function"!==typeof e.simpleLiteral&&(t.simpleLiteral=t=>e.literal(t),r=!0),"function"!==typeof e.languagedLiteral&&(t.languagedLiteral=(t,r)=>e.literal(t,r),r=!0),"function"!==typeof e.datatypedLiteral&&(t.datatypedLiteral=(t,r)=>e.literal(t,r),r=!0),r?t:e},raw:ie,unfiltered:{...ie,literal(e,t){return!t||T.equals(t)?new j(e):"string"===typeof t?new D(e,t):T.equals(t)?new j(e):new R(e,t)},simpleLiteral(e){return new j(e)},languagedLiteral(e,t){return new D(e,t)},datatypedLiteral(e,t){return T.equals(t)?new j(e):new R(e,t)}},number(e){return"number"!==typeof e||Number.isFinite(e)&&!Number.isNaN(e)?Number.isInteger(e)||"bigint"===typeof e?ne.integer(e):ne.decimal(e):ne.double(e)},date(e){return ne.literal(e.toISOString().replace(/T.+$/,"Z"),O)},dateTime(e){return ne.literal(e.toISOString(),P)},namedNode(e){return new x(e)},ephemeral(){return new J},anonymous(){return new J},blankNode(e){if(!e)return new Z("_"+f(),!0);if("string"===typeof e)return new Z(e);throw new TypeError(`factory.blankNode(label) expects 'label' parameter to be falsy or a string; instead found: ${e}`)},literal(e,t){return!t||T.equals(t)?new j(e):"string"===typeof t?new D(e,t):new R(e,t)},integer(e){let t=typeof e;if("number"===t){if(!Number.isFinite(e)){if(Number.isNaN(e))throw new Error("XSD integer cannot encode NaN. Try using double");throw new Error("XSD integer cannot encode +/-infinity. Try using double")}if(!Number.isInteger(e))throw new Error("Number is not an integer: "+e);return new F(e)}if("string"===t){if(""===e)throw new Error("Refusing to serialize empty string as xsd:integer");let t=+e;if(Number.isNaN(t)||!Number.isInteger(t))throw new Error("Invalid integer string: "+e);return new F(t)}if("undefined"===t)throw new Error("Refusing to serialize undefined value as xsd:integer");if(null===e)throw new Error("Refusing to serialize null value as xsd:integer");throw new Error("XSD integer expects a number type or integer string")},double(e){let t=typeof e;if("number"===t)return Number.isFinite(e)?new V(e):Number.isNaN(e)?new G:e>0?new K:new Y;if("string"===t){if(""===e)throw new Error("Refusing to serialize empty string as xsd:double");let t=+e;if(Number.isNaN(t))throw new Error("Invalid decimal string: "+e);return new V(t)}if("undefined"===t)throw new Error("Refusing to serialize undefined value as xsd:double");if(null===e)throw new Error("Refusing to serialize null value as xsd:double");throw new Error("XSD double expects a number type or double string")},decimal(e){let t=typeof e;if("number"===t){if(!Number.isFinite(e)){if(Number.isNaN(e))throw new Error("XSD decimal cannot encode NaN. Try using double");throw new Error("XSD decimal cannot encode +/-infinity. Try using double")}return new U(e)}if("string"===t){if(""===e)throw new Error("Refusing to serialize empty string as xsd:decimal");let t=+e;if(Number.isNaN(t))throw new Error("Invalid decimal string: "+e);return new U(t)}if("undefined"===t)throw new Error("Refusing to serialize undefined value as xsd:decimal");if(null===e)throw new Error("Refusing to serialize null value as xsd:decimal");throw new Error("XSD decimal expects a number type or decimal string")},boolean(e){let t=typeof e;if("boolean"===t)return new W(e);if("number"===t){if(1===e)return new W(!0);if(0===e)return new W(!1);throw new Error("Boolean value 'w_value' must be either a '1' or '0' if using numbers")}if("string"===t){if(u.test(e))return new W(!0);if(c.test(e))return new W(!1);if(""===e)throw new Error("Refusing to serialize empty string as xsd:boolean");throw new Error("Invalid boolean string: "+e)}if("undefined"===t)throw new Error("Refusing to serialize undefined value as xsd:boolean");if(null===e)throw new Error("Refusing to serialize null value as xsd:boolean");throw new Error("XSD boolean expects a boolean type or boolean string")},defaultGraph(){return new Q},variable(e){return new X(e)},triple(e,t,r){let i=new Error("It is strongly encouraged to use .quad() instead of .triple()");return console.warn(i.stack.replace(/^(\s*)Error:/,"$1Warning:")),new re(e,t,r)},quad(e,t,r,i){return new re(e,t,r,i||te)},term(e,t){return"string"===typeof e?ne.c1(e,t):ne.from.rdfjs_term(e)},c1(e,t={}){switch(e[0]){case"^":{let r=e.indexOf('"');if(-1===r)throw new Error(`Invalid concise-term string, no content literal delimiter found: '${e}'`);let i=e.slice(1,r);return ne.literal(e.slice(r+1),ne.c1_node_explicit(i,t))}case"@":{let t=e.indexOf('"');if(-1===t)throw new Error(`Invalid concise-term string, no content literal delimiter found: '${e}'`);let r=e.slice(1,t);return ne.literal(e.slice(t+1),r)}case'"':return ne.literal(e.slice(1));default:return ne.c1_node(e,t)}},c1_node(e,t={}){if("a"===e)return S;if("*"===e)return ne.defaultGraph();if("_"===e[0]){if(":"!==e[1])throw new Error(`Invliad concise-term string, prefixes are not allowed to start with an underscore: '${e}'`);return"#"===e[2]||2===e.length?ne.ephemeral():ne.blankNode(e.slice(2))}return ne.c1_node_explicit(e,t)},c1_named_node(e,t={}){return"a"===e?S:ne.c1_node_explicit(e,t)},c1_node_explicit(e,t={}){switch(e[0]){case">":return ne.namedNode(e.slice(1));case"<":throw new Error(`Whoops! It looks like this concise-term string starts with a '<' character. Remember to use '>' if you are trying to make an absolute IRI reference.\nInvalid concise-term string '${e}'`);case"`":throw new Error(`The backtick character '\`' is reserved for concise-struct key directives and should not be used in the object position.\nInvalid concise-term string '${e}'`);default:return this.c1_prefixed_node(e,t)}},c1_prefixed_node(e,t={}){let r=e.indexOf(":");if(-1===r)throw new Error(`A relative or prefixed node must include a ':' character. \nInvalid concise-term string for node: '${e}'`);let i=e.slice(0,r),n=e.slice(r+1);if(i in t)return ne.namedNode(t[i]+n);throw new Error(`Prefix not defined: '${i}'`)},c1_to_nt:_,*quads(e,t={}){for(let r in e)yield*ne.triples(e[r],t,r)},*triples(e,t={},r="*"){let i=ne.c1(r,t);for(let n in e){let r=ne.c1(n,t),s=e[n];yield*ne.pairs(i,r,s,t)}},*pairs(e,t,r,i={}){for(let n in r){let s=ne.c1(n,i),o=r[n];yield*ne.objects(e,t,s,o,i)}},*collection(e,t,r,i={}){yield*ne.objects(e,t,A,r[0],i);let n=r.slice(1);if(n.length){let r=ne.blankNode();yield new re(t,C,r,e),yield*ne.collection(e,r,n,i)}else yield new re(t,C,$,e)},*objects(e,t,r,i,n,s=!1){let o=typeof i;switch(o){case"string":yield new re(t,r,ne.c1(i,n),e);break;case"number":yield new re(t,r,ne.number(i),e);break;case"object":if(Array.isArray(i))if(s){let s=ne.blankNode();yield new re(t,r,s,e),yield*ne.collection(e,s,i,n)}else for(let s of i)yield*ne.objects(e,t,r,s,n,!0);else{let s=ne.blankNode();yield new re(t,r,s,e),yield*ne.pairs(e,s,i,n)}break;default:throw new Error("invalid object type: "+typeof i)}},from:{term(e){return null===e||e.isGraphyTerm?e:ne.from.rdfjs_term(e)},quad(e){if(null===e)return e;if(e.isGraphyQuad)return e;let t=ne.from;return new re(t.rdfjs_term(e.subject),t.rdfjs_term(e.predicate),t.rdfjs_term(e.object),e.graph?t.rdfjs_term(e.graph):te)},rdfjs_term(e){switch(e.termType){case"NamedNode":return new x(e.value);case"BlankNode":return new Z(e.value);case"Literal":return ne.literal(e.value,e.language?e.language:e.datatype?new x(e.datatype.value):null);case"DefaultGraph":return new Q;default:throw new TypeError(`invalid termType: ${e.termType}`)}},sparql_result(e){switch(e.type){case"uri":return new x(e.value);case"literal":case"typed-literal":return"xml:lang"in e?new D(e.value,e["xml:lang"]):"datatype"in e&&"http://www.w3.org/2001/XMLSchema#string"!==e.datatype?new R(e.value,new x(e.datatype)):new j(e.value);case"bnode":return new Z(e.value);default:throw new Error(`unexpected SPARQL Result JSON Format Term type: ${e.type}`)}}},to:{boolean:e=>W.from(e),integer:e=>F.from(e),decimal:e=>U.from(e),double:e=>V.from(e)},comment(e={}){return`\`[${f()}]${JSON.stringify({...e,type:"comment"})}`},newlines(){return`\`[${f()}]{"type":"newlines"}`},config(e){if("string"!==typeof e)throw new TypeError("Expected 'key' argument to be a string, instead found "+typeof e);return`\`[${f()}]{"type":"config","value":${JSON.stringify(e)}}`},hash(e){let t=ne.from.quad(e),r=i.createHash("sha256");return r.update(t.verbose()),r.digest("hex")},cache_prefixes:v,cachePrefixes:v,terse:y,clean_iri:o,cleanIri:o,$_PREFIX_CACHE:p};Object.assign(ne,{c3:ne.triples,c4:ne.quads,fromTerm:ne.from.term,fromQuad:ne.from.quad})},81656:function(e,t,r){"use strict";function i(e,t,r,i,n,s,o,a){var l,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=r,u._compiled=!0),i&&(u.functional=!0),s&&(u._scopeId="data-v-"+s),o?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=l):n&&(l=a?function(){n.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:n),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(e,t){return l.call(t),c(e,t)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:u}}r.d(t,{A:function(){return i}})},7849:function(e,t,r){"use strict";const{SymbolDispose:i}=r(36152),{AbortError:n,codes:s}=r(16653),{isNodeStream:o,isWebStream:a,kControllerErrorFunction:l}=r(98825),u=r(34756),{ERR_INVALID_ARG_TYPE:c}=s;let h;const d=(e,t)=>{if("object"!==typeof e||!("aborted"in e))throw new c(t,"AbortSignal",e)};e.exports.addAbortSignal=function(t,r){if(d(t,"signal"),!o(r)&&!a(r))throw new c("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 s=o(t)?()=>{t.destroy(new n(void 0,{cause:e.reason}))}:()=>{t[l](new n(void 0,{cause:e.reason}))};if(e.aborted)s();else{h=h||r(23774).addAbortListener;const n=h(e,s);u(t,n[i])}return t}},76491:function(e,t,r){"use strict";const{StringPrototypeSlice:i,SymbolIterator:n,TypedArrayPrototypeSet:s,Uint8Array:o}=r(36152),{Buffer:a}=r(48287),{inspect:l}=r(23774);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;while(null!==(t=t.next))r+=e+t.data;return r}concat(e){if(0===this.length)return a.alloc(0);const t=a.allocUnsafe(e>>>0);let r=this.head,i=0;while(r)s(t,r.data,i),i+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(es.length)){e===s.length?(t+=s,++n,r.next?this.head=r.next:this.head=this.tail=null):(t+=i(s,0,e),this.head=r,r.data=i(s,e));break}t+=s,e-=s.length,++n}while(null!==(r=r.next));return this.length-=n,t}_getBuffer(e){const t=a.allocUnsafe(e),r=e;let i=this.head,n=0;do{const a=i.data;if(!(e>a.length)){e===a.length?(s(t,a,r-e),++n,i.next?this.head=i.next:this.head=this.tail=null):(s(t,new o(a.buffer,a.byteOffset,e),r-e),this.head=i,i.data=a.slice(e));break}s(t,a,r-e),e-=a.length,++n}while(null!==(i=i.next));return this.length-=n,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},57123:function(e,t,r){"use strict";const{pipeline:i}=r(27944),n=r(84656),{destroyer:s}=r(91582),{isNodeStream:o,isReadable:a,isWritable:l,isWebStream:u,isTransformStream:c,isWritableStream:h,isReadableStream:d}=r(98825),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:m}}=r(16653),g=r(34756);e.exports=function(...e){if(0===e.length)throw new m("streams");if(1===e.length)return n.from(e[0]);const t=[...e];if("function"===typeof e[0]&&(e[0]=n.from(e[0])),"function"===typeof e[e.length-1]){const t=e.length-1;e[t]=n.from(e[t])}for(let i=0;i0&&!(l(e[i])||h(e[i])||c(e[i])))throw new p(`streams[${i}]`,t[i],"must be writable")}let r,v,y,b,w;function _(e){const t=b;b=null,t?t(e):e?w.destroy(e):M||S||w.destroy()}const k=e[0],x=i(e,_),S=!!(l(k)||h(k)||c(k)),M=!!(a(x)||d(x)||c(x));if(w=new n({writableObjectMode:!(null===k||void 0===k||!k.writableObjectMode),readableObjectMode:!(null===x||void 0===x||!x.readableObjectMode),writable:S,readable:M}),S){if(o(k))w._write=function(e,t,i){k.write(e,t)?i():r=i},w._final=function(e){k.end(),v=e},k.on("drain",(function(){if(r){const e=r;r=null,e()}}));else if(u(k)){const e=c(k)?k.writable:k,t=e.getWriter();w._write=async function(e,r,i){try{await t.ready,t.write(e).catch((()=>{})),i()}catch(err){i(err)}},w._final=async function(e){try{await t.ready,t.close().catch((()=>{})),v=e}catch(err){e(err)}}}const e=c(x)?x.readable:x;g(e,(()=>{if(v){const e=v;v=null,e()}}))}if(M)if(o(x))x.on("readable",(function(){if(y){const e=y;y=null,e()}})),x.on("end",(function(){w.push(null)})),w._read=function(){while(1){const e=x.read();if(null===e)return void(y=w._read);if(!w.push(e))return}};else if(u(x)){const e=c(x)?x.readable:x,t=e.getReader();w._read=async function(){while(1)try{const{value:e,done:r}=await t.read();if(!w.push(e))return;if(r)return void w.push(null)}catch{return}}}return w._destroy=function(e,t){e||null===b||(e=new f),y=null,r=null,v=null,null===b?t(e):(b=t,o(x)&&s(x,e))},w}},91582:function(e,t,r){"use strict";const i=r(65606),{aggregateTwoErrors:n,codes:{ERR_MULTIPLE_CALLBACK:s},AbortError:o}=r(16653),{Symbol:a}=r(36152),{kIsDestroyed:l,isDestroyed:u,isFinished:c,isServerRequest:h}=r(98825),d=a("kDestroy"),f=a("kConstruct");function p(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function m(e,t){const r=this._readableState,i=this._writableState,s=i||r;return null!==i&&void 0!==i&&i.destroyed||null!==r&&void 0!==r&&r.destroyed?("function"===typeof t&&t(),this):(p(e,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),s.constructed?g(this,e,t):this.once(d,(function(r){g(this,n(r,e),t)})),this)}function g(e,t,r){let n=!1;function s(t){if(n)return;n=!0;const s=e._readableState,o=e._writableState;p(t,o,s),o&&(o.closed=!0),s&&(s.closed=!0),"function"===typeof r&&r(t),t?i.nextTick(v,e,t):i.nextTick(y,e)}try{e._destroy(t||null,s)}catch(t){s(t)}}function v(e,t){b(e,t),y(e)}function y(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!==r&&void 0!==r&&r.emitClose||null!==t&&void 0!==t&&t.emitClose)&&e.emit("close")}function b(e,t){const r=e._readableState,i=e._writableState;null!==i&&void 0!==i&&i.errorEmitted||null!==r&&void 0!==r&&r.errorEmitted||(i&&(i.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function w(){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)}function _(e,t,r){const n=e._readableState,s=e._writableState;if(null!==s&&void 0!==s&&s.destroyed||null!==n&&void 0!==n&&n.destroyed)return this;null!==n&&void 0!==n&&n.autoDestroy||null!==s&&void 0!==s&&s.autoDestroy?e.destroy(t):t&&(t.stack,s&&!s.errored&&(s.errored=t),n&&!n.errored&&(n.errored=t),r?i.nextTick(b,e,t):b(e,t))}function k(e,t){if("function"!==typeof e._construct)return;const r=e._readableState,n=e._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),e.once(f,t),e.listenerCount(f)>1||i.nextTick(x,e)}function x(e){let t=!1;function r(r){if(t)return void _(e,null!==r&&void 0!==r?r:new s);t=!0;const n=e._readableState,o=e._writableState,a=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),a.destroyed?e.emit(d,r):r?_(e,r,!0):i.nextTick(S,e)}try{e._construct((e=>{i.nextTick(r,e)}))}catch(err){i.nextTick(r,err)}}function S(e){e.emit(f)}function M(e){return(null===e||void 0===e?void 0:e.setHeader)&&"function"===typeof e.abort}function E(e){e.emit("close")}function A(e,t){e.emit("error",t),i.nextTick(E,e)}function C(e,t){e&&!u(e)&&(t||c(e)||(t=new o),h(e)?(e.socket=null,e.destroy(t)):M(e)?e.abort():M(e.req)?e.req.abort():"function"===typeof e.destroy?e.destroy(t):"function"===typeof e.close?e.close():t?i.nextTick(A,e,t):i.nextTick(E,e),e.destroyed||(e[l]=!0))}e.exports={construct:k,destroyer:C,destroy:m,undestroy:w,errorOrDestroy:_}},84656:function(e,t,r){"use strict";const{ObjectDefineProperties:i,ObjectGetOwnPropertyDescriptor:n,ObjectKeys:s,ObjectSetPrototypeOf:o}=r(36152);e.exports=u;const a=r(21878),l=r(49498);o(u.prototype,a.prototype),o(u,a);{const e=s(l.prototype);for(let t=0;t{h=!1,e&&y(t,e),d(e)})),u._write=function(e,t,n){r.write(e,t)?n():i=n},u._final=function(e){r.end(),n=e},r.on("drain",(function(){if(i){const e=i;i=null,e()}})),r.on("finish",(function(){if(n){const e=n;n=null,e()}}))),c&&(p(t,(e=>{c=!1,e&&y(t,e),d(e)})),t.on("readable",(function(){if(a){const e=a;a=null,e()}})),t.on("end",(function(){u.push(null)})),u._read=function(){while(1){const e=t.read();if(null===e)return void(a=u._read);if(!u.push(e))return}}),u._destroy=function(e,s){e||null===l||(e=new m),a=null,i=null,n=null,null===l?s(e):(l=s,y(r,e),y(t,e))},u}e.exports=function e(t,r){if(h(t))return t;if(u(t))return O({readable:t});if(c(t))return O({writable:t});if(l(t))return O({writable:!1,readable:!1});if(d(t))return O({readable:w.fromWeb(t)});if(f(t))return O({writable:_.fromWeb(t)});if("function"===typeof t){const{value:e,write:n,final:s,destroy:o}=$(t);if(a(e))return x(C,e,{objectMode:!0,write:n,final:s,destroy:o});const l=null===e||void 0===e?void 0:e.then;if("function"===typeof l){let t;const r=A(l,e,(e=>{if(null!=e)throw new v("nully","body",e)}),(e=>{y(t,e)}));return t=new C({objectMode:!0,readable:!1,write:n,final(e){s((async()=>{try{await r,i.nextTick(e,null)}catch(err){i.nextTick(e,err)}}))},destroy:o})}throw new v("Iterable, AsyncIterable or AsyncFunction",r,e)}if(M(t))return e(t.arrayBuffer());if(a(t))return x(C,t,{objectMode:!0,writable:!1});if(d(null===t||void 0===t?void 0:t.readable)&&f(null===t||void 0===t?void 0:t.writable))return C.fromWeb(t);if("object"===typeof(null===t||void 0===t?void 0:t.writable)||"object"===typeof(null===t||void 0===t?void 0:t.readable)){const r=null!==t&&void 0!==t&&t.readable?u(null===t||void 0===t?void 0:t.readable)?null===t||void 0===t?void 0:t.readable:e(t.readable):void 0,i=null!==t&&void 0!==t&&t.writable?c(null===t||void 0===t?void 0:t.writable)?null===t||void 0===t?void 0:t.writable:e(t.writable):void 0;return O({readable:r,writable:i})}const n=null===t||void 0===t?void 0:t.then;if("function"===typeof n){let e;return A(n,t,(t=>{null!=t&&e.push(t),e.push(null)}),(t=>{y(e,t)})),e=new C({objectMode:!0,writable:!1,read(){}})}throw new g(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},34756:function(e,t,r){const i=r(65606),{AbortError:n,codes:s}=r(16653),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_PREMATURE_CLOSE:a}=s,{kEmptyObject:l,once:u}=r(23774),{validateAbortSignal:c,validateFunction:h,validateObject:d,validateBoolean:f}=r(82091),{Promise:p,PromisePrototypeThen:m,SymbolDispose:g}=r(36152),{isClosed:v,isReadable:y,isReadableNodeStream:b,isReadableStream:w,isReadableFinished:_,isReadableErrored:k,isWritable:x,isWritableNodeStream:S,isWritableStream:M,isWritableFinished:E,isWritableErrored:A,isNodeStream:C,willEmitClose:$,kIsClosedPromise:O}=r(98825);let P;function T(e){return e.setHeader&&"function"===typeof e.abort}const I=()=>{};function D(e,t,s){var f,p;if(2===arguments.length?(s=t,t=l):null==t?t=l:d(t,"options"),h(s,"callback"),c(t.signal,"options.signal"),s=u(s),w(e)||M(e))return L(e,t,s);if(!C(e))throw new o("stream",["ReadableStream","WritableStream","Stream"],e);const m=null!==(f=t.readable)&&void 0!==f?f:b(e),O=null!==(p=t.writable)&&void 0!==p?p:S(e),D=e._writableState,R=e._readableState,N=()=>{e.writable||F()};let j=$(e)&&b(e)===m&&S(e)===O,B=E(e,!1);const F=()=>{B=!0,e.destroyed&&(j=!1),(!j||e.readable&&!m)&&(m&&!z||s.call(e))};let z=_(e,!1);const V=()=>{z=!0,e.destroyed&&(j=!1),(!j||e.writable&&!O)&&(O&&!B||s.call(e))},q=t=>{s.call(e,t)};let U=v(e);const H=()=>{U=!0;const t=A(e)||k(e);return t&&"boolean"!==typeof t?s.call(e,t):m&&!z&&b(e,!0)&&!_(e,!1)?s.call(e,new a):!O||B||E(e,!1)?void s.call(e):s.call(e,new a)},W=()=>{U=!0;const t=A(e)||k(e);if(t&&"boolean"!==typeof t)return s.call(e,t);s.call(e)},K=()=>{e.req.on("finish",F)};T(e)?(e.on("complete",F),j||e.on("abort",H),e.req?K():e.on("request",K)):O&&!D&&(e.on("end",N),e.on("close",N)),j||"boolean"!==typeof e.aborted||e.on("aborted",H),e.on("end",V),e.on("finish",F),!1!==t.error&&e.on("error",q),e.on("close",H),U?i.nextTick(H):null!==D&&void 0!==D&&D.errorEmitted||null!==R&&void 0!==R&&R.errorEmitted?j||i.nextTick(W):(m||j&&!y(e)||!B&&!1!==x(e))&&(O||j&&!x(e)||!z&&!1!==y(e))?R&&e.req&&e.aborted&&i.nextTick(W):i.nextTick(W);const Y=()=>{s=I,e.removeListener("aborted",H),e.removeListener("complete",F),e.removeListener("abort",H),e.removeListener("request",K),e.req&&e.req.removeListener("finish",F),e.removeListener("end",N),e.removeListener("close",N),e.removeListener("finish",F),e.removeListener("end",V),e.removeListener("error",q),e.removeListener("close",H)};if(t.signal&&!U){const o=()=>{const r=s;Y(),r.call(e,new n(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)i.nextTick(o);else{P=P||r(23774).addAbortListener;const i=P(t.signal,o),n=s;s=u(((...t)=>{i[g](),n.apply(e,t)}))}}return Y}function L(e,t,s){let o=!1,a=I;if(t.signal)if(a=()=>{o=!0,s.call(e,new n(void 0,{cause:t.signal.reason}))},t.signal.aborted)i.nextTick(a);else{P=P||r(23774).addAbortListener;const i=P(t.signal,a),n=s;s=u(((...t)=>{i[g](),n.apply(e,t)}))}const l=(...t)=>{o||i.nextTick((()=>s.apply(e,t)))};return m(e[O].promise,l,l),I}function R(e,t){var r;let i=!1;return null===t&&(t=l),null!==(r=t)&&void 0!==r&&r.cleanup&&(f(t.cleanup,"cleanup"),i=t.cleanup),new p(((r,n)=>{const s=D(e,t,(e=>{i&&s(),e?n(e):r()}))}))}e.exports=D,e.exports.finished=R},3854:function(e,t,r){"use strict";const i=r(65606),{PromisePrototypeThen:n,SymbolAsyncIterator:s,SymbolIterator:o}=r(36152),{Buffer:a}=r(48287),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:u}=r(16653).codes;function c(e,t,r){let c,h;if("string"===typeof t||t instanceof a)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});if(t&&t[s])h=!0,c=t[s]();else{if(!t||!t[o])throw new l("iterable",["Iterable"],t);h=!1,c=t[o]()}const d=new e({objectMode:!0,highWaterMark:1,...r});let f=!1;async function p(e){const t=void 0!==e&&null!==e,r="function"===typeof c.throw;if(t&&r){const{value:t,done:r}=await c.throw(e);if(await t,r)return}if("function"===typeof c.return){const{value:e}=await c.return();await e}}async function m(){for(;;){try{const{value:e,done:t}=h?await c.next():c.next();if(t)d.push(null);else{const t=e&&"function"===typeof e.then?await e:e;if(null===t)throw f=!1,new u;if(d.push(t))continue;f=!1}}catch(err){d.destroy(err)}break}}return d._read=function(){f||(f=!0,m())},d._destroy=function(e,t){n(p(e),(()=>i.nextTick(t,e)),(r=>i.nextTick(t,r||e)))},d}e.exports=c},33137:function(e,t,r){"use strict";const{ArrayIsArray:i,ObjectSetPrototypeOf:n}=r(36152),{EventEmitter:s}=r(37007);function o(e){s.call(this,e)}function a(e,t,r){if("function"===typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?i(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}n(o.prototype,s.prototype),n(o,s),o.prototype.pipe=function(e,t){const r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function n(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",n),e._isStdio||t&&!1===t.end||(r.on("end",l),r.on("close",u));let o=!1;function l(){o||(o=!0,e.end())}function u(){o||(o=!0,"function"===typeof e.destroy&&e.destroy())}function c(e){h(),0===s.listenerCount(this,"error")&&this.emit("error",e)}function h(){r.removeListener("data",i),e.removeListener("drain",n),r.removeListener("end",l),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",h),r.removeListener("close",h),e.removeListener("close",h)}return a(r,"error",c),a(e,"error",c),r.on("end",h),r.on("close",h),e.on("close",h),e.emit("pipe",r),e},e.exports={Stream:o,prependListener:a}},5589:function(e,t,r){"use strict";const i=globalThis.AbortController||r(25568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:n,ERR_INVALID_ARG_TYPE:s,ERR_MISSING_ARGS:o,ERR_OUT_OF_RANGE:a},AbortError:l}=r(16653),{validateAbortSignal:u,validateInteger:c,validateObject:h}=r(82091),d=r(36152).Symbol("kWeak"),f=r(36152).Symbol("kResistStopPropagation"),{finished:p}=r(34756),m=r(57123),{addAbortSignalNoValidate:g}=r(7849),{isWritable:v,isNodeStream:y}=r(98825),{deprecate:b}=r(23774),{ArrayPrototypePush:w,Boolean:_,MathFloor:k,Number:x,NumberIsNaN:S,Promise:M,PromiseReject:E,PromiseResolve:A,PromisePrototypeThen:C,Symbol:$}=r(36152),O=$("kEmpty"),P=$("kEof");function T(e,t){if(null!=t&&h(t,"options"),null!=(null===t||void 0===t?void 0:t.signal)&&u(t.signal,"options.signal"),y(e)&&!v(e))throw new n("stream",e,"must be writable");const r=m(this,e);return null!==t&&void 0!==t&&t.signal&&g(t.signal,r),r}function I(e,t){if("function"!==typeof e)throw new s("fn",["Function","AsyncFunction"],e);null!=t&&h(t,"options"),null!=(null===t||void 0===t?void 0:t.signal)&&u(t.signal,"options.signal");let i=1;null!=(null===t||void 0===t?void 0:t.concurrency)&&(i=k(t.concurrency));let n=i-1;return null!=(null===t||void 0===t?void 0:t.highWaterMark)&&(n=k(t.highWaterMark)),c(i,"options.concurrency",1),c(n,"options.highWaterMark",0),n+=i,async function*(){const s=r(23774).AbortSignalAny([null===t||void 0===t?void 0:t.signal].filter(_)),o=this,a=[],u={signal:s};let c,h,d=!1,f=0;function p(){d=!0,m()}function m(){f-=1,g()}function g(){h&&!d&&f=n||f>=i)&&await new M((e=>{h=e}))}a.push(P)}catch(err){const t=E(err);C(t,m,p),a.push(t)}finally{d=!0,c&&(c(),c=null)}}v();try{while(1){while(a.length>0){const e=await a[0];if(e===P)return;if(s.aborted)throw new l;e!==O&&(yield e),a.shift(),g()}await new M((e=>{c=e}))}}finally{d=!0,h&&(h(),h=null)}}.call(this)}function D(e=void 0){return null!=e&&h(e,"options"),null!=(null===e||void 0===e?void 0:e.signal)&&u(e.signal,"options.signal"),async function*(){let t=0;for await(const i of this){var r;if(null!==e&&void 0!==e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l({cause:e.signal.reason});yield[t++,i]}}.call(this)}async function L(e,t=void 0){for await(const r of B.call(this,e,t))return!0;return!1}async function R(e,t=void 0){if("function"!==typeof e)throw new s("fn",["Function","AsyncFunction"],e);return!await L.call(this,(async(...t)=>!await e(...t)),t)}async function N(e,t){for await(const r of B.call(this,e,t))return r}async function j(e,t){if("function"!==typeof e)throw new s("fn",["Function","AsyncFunction"],e);async function r(t,r){return await e(t,r),O}for await(const i of I.call(this,r,t));}function B(e,t){if("function"!==typeof e)throw new s("fn",["Function","AsyncFunction"],e);async function r(t,r){return await e(t,r)?t:O}return I.call(this,r,t)}class F extends o{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function z(e,t,r){var n;if("function"!==typeof e)throw new s("reducer",["Function","AsyncFunction"],e);null!=r&&h(r,"options"),null!=(null===r||void 0===r?void 0:r.signal)&&u(r.signal,"options.signal");let o=arguments.length>1;if(null!==r&&void 0!==r&&null!==(n=r.signal)&&void 0!==n&&n.aborted){const e=new l(void 0,{cause:r.signal.reason});throw this.once("error",(()=>{})),await p(this.destroy(e)),e}const a=new i,c=a.signal;if(null!==r&&void 0!==r&&r.signal){const e={once:!0,[d]:this,[f]:!0};r.signal.addEventListener("abort",(()=>a.abort()),e)}let m=!1;try{for await(const i of this){var g;if(m=!0,null!==r&&void 0!==r&&null!==(g=r.signal)&&void 0!==g&&g.aborted)throw new l;o?t=await e(t,i,{signal:c}):(t=i,o=!0)}if(!m&&!o)throw new F}finally{a.abort()}return t}async function V(e){null!=e&&h(e,"options"),null!=(null===e||void 0===e?void 0:e.signal)&&u(e.signal,"options.signal");const t=[];for await(const i of this){var r;if(null!==e&&void 0!==e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l(void 0,{cause:e.signal.reason});w(t,i)}return t}function q(e,t){const r=I.call(this,e,t);return async function*(){for await(const e of r)yield*e}.call(this)}function U(e){if(e=x(e),S(e))return 0;if(e<0)throw new a("number",">= 0",e);return e}function H(e,t=void 0){return null!=t&&h(t,"options"),null!=(null===t||void 0===t?void 0:t.signal)&&u(t.signal,"options.signal"),e=U(e),async function*(){var r;if(null!==t&&void 0!==t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const n of this){var i;if(null!==t&&void 0!==t&&null!==(i=t.signal)&&void 0!==i&&i.aborted)throw new l;e--<=0&&(yield n)}}.call(this)}function W(e,t=void 0){return null!=t&&h(t,"options"),null!=(null===t||void 0===t?void 0:t.signal)&&u(t.signal,"options.signal"),e=U(e),async function*(){var r;if(null!==t&&void 0!==t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const n of this){var i;if(null!==t&&void 0!==t&&null!==(i=t.signal)&&void 0!==i&&i.aborted)throw new l;if(e-- >0&&(yield n),e<=0)return}}.call(this)}e.exports.streamReturningOperators={asIndexedPairs:b(D,"readable.asIndexedPairs will be removed in a future version."),drop:H,filter:B,flatMap:q,map:I,take:W,compose:T},e.exports.promiseReturningOperators={every:R,forEach:j,reduce:z,toArray:V,some:L,find:N}},15122:function(e,t,r){"use strict";const{ObjectSetPrototypeOf:i}=r(36152);e.exports=s;const n=r(82112);function s(e){if(!(this instanceof s))return new s(e);n.call(this,e)}i(s.prototype,n.prototype),i(s,n),s.prototype._transform=function(e,t,r){r(null,e)}},27944:function(e,t,r){const i=r(65606),{ArrayIsArray:n,Promise:s,SymbolAsyncIterator:o,SymbolDispose:a}=r(36152),l=r(34756),{once:u}=r(23774),c=r(91582),h=r(84656),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:v},AbortError:y}=r(16653),{validateFunction:b,validateAbortSignal:w}=r(82091),{isIterable:_,isReadable:k,isReadableNodeStream:x,isNodeStream:S,isTransformStream:M,isWebStream:E,isReadableStream:A,isReadableFinished:C}=r(98825),$=globalThis.AbortController||r(25568).AbortController;let O,P,T;function I(e,t,r){let i=!1;e.on("close",(()=>{i=!0}));const n=l(e,{readable:t,writable:r},(e=>{i=!e}));return{destroy:t=>{i||(i=!0,c.destroyer(e,t||new g("pipe")))},cleanup:n}}function D(e){return b(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function L(e){if(_(e))return e;if(x(e))return R(e);throw new f("val",["Readable","Iterable","AsyncIterable"],e)}async function*R(e){P||(P=r(21878)),yield*P.prototype[o].call(e)}async function N(e,t,r,{end:i}){let n,o=null;const a=e=>{if(e&&(n=e),o){const e=o;o=null,e()}},u=()=>new s(((e,t)=>{n?t(n):o=()=>{n?t(n):e()}}));t.on("drain",a);const c=l(t,{readable:!1},a);try{t.writableNeedDrain&&await u();for await(const r of e)t.write(r)||await u();i&&(t.end(),await u()),r()}catch(err){r(n!==err?d(n,err):err)}finally{c(),t.off("drain",a)}}async function j(e,t,r,{end:i}){M(t)&&(t=t.writable);const n=t.getWriter();try{for await(const t of e)await n.ready,n.write(t).catch((()=>{}));await n.ready,i&&await n.close(),r()}catch(err){try{await n.abort(err),r(err)}catch(err){r(err)}}}function B(...e){return F(e,u(D(e)))}function F(e,t,s){if(1===e.length&&n(e[0])&&(e=e[0]),e.length<2)throw new m("streams");const o=new $,l=o.signal,u=null===s||void 0===s?void 0:s.signal,c=[];function d(){B(new y)}let g,v,b;w(u,"options.signal"),T=T||r(23774).addAbortListener,u&&(g=T(u,d));const C=[];let P,D=0;function R(e){B(e,0===--D)}function B(e,r){var n;if(!e||v&&"ERR_STREAM_PREMATURE_CLOSE"!==v.code||(v=e),v||r){while(C.length)C.shift()(v);null===(n=g)||void 0===n||n[a](),o.abort(),r&&(v||c.forEach((e=>e())),i.nextTick(t,v,b))}}for(let U=0;U0,Y=W||!1!==(null===s||void 0===s?void 0:s.end),G=U===e.length-1;if(S(H)){if(Y){const{destroy:Z,cleanup:J}=I(H,W,K);C.push(Z),k(H)&&G&&c.push(J)}function F(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&R(e)}H.on("error",F),k(H)&&G&&c.push((()=>{H.removeListener("error",F)}))}if(0===U)if("function"===typeof H){if(P=H({signal:l}),!_(P))throw new p("Iterable, AsyncIterable or Stream","source",P)}else P=_(H)||x(H)||M(H)?H:h.from(H);else if("function"===typeof H){var V;if(M(P))P=L(null===(V=P)||void 0===V?void 0:V.readable);else P=L(P);if(P=H(P,{signal:l}),W){if(!_(P,!0))throw new p("AsyncIterable",`transform[${U-1}]`,P)}else{var q;O||(O=r(15122));const X=new O({objectMode:!0}),Q=null===(q=P)||void 0===q?void 0:q.then;if("function"===typeof Q)D++,Q.call(P,(e=>{b=e,null!=e&&X.write(e),Y&&X.end(),i.nextTick(R)}),(e=>{X.destroy(e),i.nextTick(R,e)}));else if(_(P,!0))D++,N(P,X,R,{end:Y});else{if(!A(P)&&!M(P))throw new p("AsyncIterable or Promise","destination",P);{const re=P.readable||P;D++,N(re,X,R,{end:Y})}}P=X;const{destroy:ee,cleanup:te}=I(P,!1,!0);C.push(ee),G&&c.push(te)}}else if(S(H)){if(x(P)){D+=2;const ie=z(P,H,R,{end:Y});k(H)&&G&&c.push(ie)}else if(M(P)||A(P)){const ne=P.readable||P;D++,N(ne,H,R,{end:Y})}else{if(!_(P))throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],P);D++,N(P,H,R,{end:Y})}P=H}else if(E(H)){if(x(P))D++,j(L(P),H,R,{end:Y});else if(A(P)||_(P))D++,j(P,H,R,{end:Y});else{if(!M(P))throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],P);D++,j(P.readable,H,R,{end:Y})}P=H}else P=h.from(H)}return(null!==l&&void 0!==l&&l.aborted||null!==u&&void 0!==u&&u.aborted)&&i.nextTick(d),P}function z(e,t,r,{end:n}){let s=!1;if(t.on("close",(()=>{s||r(new v)})),e.pipe(t,{end:!1}),n){function o(){s=!0,t.end()}C(e)?i.nextTick(o):e.once("end",o)}else r();return l(e,{readable:!0,writable:!1},(t=>{const i=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&i&&i.ended&&!i.errored&&!i.errorEmitted?e.once("end",r).once("error",r):r(t)})),l(t,{readable:!1,writable:!0},r)}e.exports={pipelineImpl:F,pipeline:B}},21878:function(e,t,r){const i=r(65606),{ArrayPrototypeIndexOf:n,NumberIsInteger:s,NumberIsNaN:o,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:u,ObjectSetPrototypeOf:c,Promise:h,SafeSet:d,SymbolAsyncDispose:f,SymbolAsyncIterator:p,Symbol:m}=r(36152);e.exports=ae,ae.ReadableState=oe;const{EventEmitter:g}=r(37007),{Stream:v,prependListener:y}=r(33137),{Buffer:b}=r(48287),{addAbortSignal:w}=r(7849),_=r(34756);let k=r(23774).debuglog("stream",(e=>{k=e}));const x=r(76491),S=r(91582),{getHighWaterMark:M,getDefaultHighWaterMark:E}=r(49809),{aggregateTwoErrors:A,codes:{ERR_INVALID_ARG_TYPE:C,ERR_METHOD_NOT_IMPLEMENTED:$,ERR_OUT_OF_RANGE:O,ERR_STREAM_PUSH_AFTER_EOF:P,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:T},AbortError:I}=r(16653),{validateObject:D}=r(82091),L=m("kPaused"),{StringDecoder:R}=r(83141),N=r(3854);c(ae.prototype,v.prototype),c(ae,v);const j=()=>{},{errorOrDestroy:B}=S,F=1,z=2,V=4,q=8,U=16,H=32,W=64,K=128,Y=256,G=512,Z=1024,J=2048,X=4096,Q=8192,ee=16384,te=32768,re=65536,ie=1<<17,ne=1<<18;function se(e){return{enumerable:!1,get(){return 0!==(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function oe(e,t,i){"boolean"!==typeof i&&(i=t instanceof r(84656)),this.state=J|X|U|H,e&&e.objectMode&&(this.state|=F),i&&e&&e.readableObjectMode&&(this.state|=F),this.highWaterMark=e?M(this,e,"readableHighWaterMark",i):E(!1),this.buffer=new x,this.length=0,this.pipes=[],this.flowing=null,this[L]=null,e&&!1===e.emitClose&&(this.state&=~J),e&&!1===e.autoDestroy&&(this.state&=~X),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new R(e.encoding),this.encoding=e.encoding)}function ae(e){if(!(this instanceof ae))return new ae(e);const t=this instanceof r(84656);this._readableState=new oe(e,this,t),e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&w(e.signal,this)),v.call(this,e),S.construct(this,(()=>{this._readableState.needReadable&&ge(this,this._readableState)}))}function le(e,t,r,i){k("readableAddChunk",t);const n=e._readableState;let s;if(0===(n.state&F)&&("string"===typeof t?(r=r||n.defaultEncoding,n.encoding!==r&&(i&&n.encoding?t=b.from(t,r).toString(n.encoding):(t=b.from(t,r),r=""))):t instanceof b?r="":v._isUint8Array(t)?(t=v._uint8ArrayToBuffer(t),r=""):null!=t&&(s=new C("chunk",["string","Buffer","Uint8Array"],t))),s)B(e,s);else if(null===t)n.state&=~q,fe(e,n);else if(0!==(n.state&F)||t&&t.length>0)if(i)if(0!==(n.state&V))B(e,new T);else{if(n.destroyed||n.errored)return!1;ue(e,n,t,!0)}else if(n.ended)B(e,new P);else{if(n.destroyed||n.errored)return!1;n.state&=~q,n.decoder&&!r?(t=n.decoder.write(t),n.objectMode||0!==t.length?ue(e,n,t,!1):ge(e,n)):ue(e,n,t,!1)}else i||(n.state&=~q,ge(e,n));return!n.ended&&(n.length0?(0!==(t.state&re)?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),0!==(t.state&W)&&pe(e)),ge(e,t)}l(oe.prototype,{objectMode:se(F),ended:se(z),endEmitted:se(V),reading:se(q),constructed:se(U),sync:se(H),needReadable:se(W),emittedReadable:se(K),readableListening:se(Y),resumeScheduled:se(G),errorEmitted:se(Z),emitClose:se(J),autoDestroy:se(X),destroyed:se(Q),closed:se(ee),closeEmitted:se(te),multiAwaitDrain:se(re),readingMore:se(ie),dataEmitted:se(ne)}),ae.prototype.destroy=S.destroy,ae.prototype._undestroy=S.undestroy,ae.prototype._destroy=function(e,t){t(e)},ae.prototype[g.captureRejectionSymbol]=function(e){this.destroy(e)},ae.prototype[f]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new I,this.destroy(e)),new h(((t,r)=>_(this,(i=>i&&i!==e?r(i):t(null)))))},ae.prototype.push=function(e,t){return le(this,e,t,!1)},ae.prototype.unshift=function(e,t){return le(this,e,t,!0)},ae.prototype.isPaused=function(){const e=this._readableState;return!0===e[L]||!1===e.flowing},ae.prototype.setEncoding=function(e){const t=new R(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const r=this._readableState.buffer;let i="";for(const n of r)i+=t.write(n);return r.clear(),""!==i&&r.push(i),this._readableState.length=i.length,this};const ce=1073741824;function he(e){if(e>ce)throw new O("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}function de(e,t){return e<=0||0===t.length&&t.ended?0:0!==(t.state&F)?1:o(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function fe(e,t){if(k("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?pe(e):(t.needReadable=!1,t.emittedReadable=!0,me(e))}}function pe(e){const t=e._readableState;k("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(k("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(me,e))}function me(e){const t=e._readableState;k("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,xe(e)}function ge(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,i.nextTick(ve,e,t))}function ve(e,t){while(!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!1===t[L]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function we(e){k("readable nexttick read 0"),e.read(0)}function _e(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(ke,e,t))}function ke(e,t){k("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),xe(e),t.flowing&&!t.reading&&e.read(0)}function xe(e){const t=e._readableState;k("flow",t.flowing);while(t.flowing&&null!==e.read());}function Se(e,t){"function"!==typeof e.read&&(e=ae.wrap(e,{objectMode:!0}));const r=Me(e,t);return r.stream=e,r}async function*Me(e,t){let r,i=j;function n(t){this===e?(i(),i=j):i=t}e.on("readable",n);const s=_(e,{writable:!1},(e=>{r=e?A(r,e):null,i(),i=j}));try{while(1){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(r)throw r;if(null===r)return;await new h(n)}}}catch(err){throw r=A(r,err),r}finally{!r&&!1===(null===t||void 0===t?void 0:t.destroyOnReturn)||void 0!==r&&!e._readableState.autoDestroy?(e.off("readable",n),s()):S.destroyer(e,null)}}function Ee(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 Ae(e){const t=e._readableState;k("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(Ce,t,e))}function Ce(e,t){if(k("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)i.nextTick($e,t);else if(e.autoDestroy){const e=t._writableState,r=!e||e.autoDestroy&&(e.finished||!1===e.writable);r&&t.destroy()}}function $e(e){const t=e.writable&&!e.writableEnded&&!e.destroyed;t&&e.end()}let Oe;function Pe(){return void 0===Oe&&(Oe={}),Oe}ae.prototype.read=function(e){k("read",e),void 0===e?e=NaN:s(e)||(e=a(e,10));const t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=he(e)),0!==e&&(t.state&=~K),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return k("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?Ae(this):pe(this),null;if(e=de(e,t),0===e&&t.ended)return 0===t.length&&Ae(this),null;let i,n=0!==(t.state&W);if(k("need readable",n),(0===t.length||t.length-e0?Ee(e,t):null,null===i?(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&&Ae(this)),null===i||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",i)),i},ae.prototype._read=function(e){throw new $("_read()")},ae.prototype.pipe=function(e,t){const r=this,n=this._readableState;1===n.pipes.length&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new d(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(e),k("pipe count=%d opts=%j",n.pipes.length,t);const s=(!t||!1!==t.end)&&e!==i.stdout&&e!==i.stderr,o=s?l:b;function a(e,t){k("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,h())}function l(){k("onend"),e.end()}let u;n.endEmitted?i.nextTick(o):r.once("end",o),e.on("unpipe",a);let c=!1;function h(){k("cleanup"),e.removeListener("close",g),e.removeListener("finish",v),u&&e.removeListener("drain",u),e.removeListener("error",m),e.removeListener("unpipe",a),r.removeListener("end",l),r.removeListener("end",b),r.removeListener("data",p),c=!0,u&&n.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&u()}function f(){c||(1===n.pipes.length&&n.pipes[0]===e?(k("false write response, pause",0),n.awaitDrainWriters=e,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(e)&&(k("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(e)),r.pause()),u||(u=ye(r,e),e.on("drain",u))}function p(t){k("ondata");const r=e.write(t);k("dest.write",r),!1===r&&f()}function m(t){if(k("onerror",t),b(),e.removeListener("error",m),0===e.listenerCount("error")){const r=e._writableState||e._readableState;r&&!r.errorEmitted?B(e,t):e.emit("error",t)}}function g(){e.removeListener("finish",v),b()}function v(){k("onfinish"),e.removeListener("close",g),b()}function b(){k("unpipe"),r.unpipe(e)}return r.on("data",p),y(e,"error",m),e.once("close",g),e.once("finish",v),e.emit("pipe",r),!0===e.writableNeedDrain?f():n.flowing||(k("pipe resume"),r.resume()),e},ae.prototype.unpipe=function(e){const t=this._readableState,r={hasUnpiped:!1};if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,k("on readable",n.length,n.reading),n.length?pe(this):n.reading||i.nextTick(we,this))),r},ae.prototype.addListener=ae.prototype.on,ae.prototype.removeListener=function(e,t){const r=v.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(be,this),r},ae.prototype.off=ae.prototype.removeListener,ae.prototype.removeAllListeners=function(e){const t=v.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(be,this),t},ae.prototype.resume=function(){const e=this._readableState;return e.flowing||(k("resume"),e.flowing=!e.readableListening,_e(this,e)),e[L]=!1,this},ae.prototype.pause=function(){return k("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(k("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[L]=!0,this},ae.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=>{B(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 i=1;i{t?e?e(t):this.destroy(t):(null!=r&&this.push(r),this.push(null),e&&e())}))}function h(){this._final!==c&&c.call(this)}u.prototype._final=c,u.prototype._transform=function(e,t,r){throw new s("_transform()")},u.prototype._write=function(e,t,r){const i=this._readableState,n=this._writableState,s=i.length;this._transform(e,t,((e,t)=>{e?r(e):(null!=t&&this.push(t),n.ended||s===i.length||i.length{const e=this._writableState;e.writing||q(this,e),K(this,e)}))}function L(e,t,r,n){const s=e._writableState;if("function"===typeof r)n=r,r=s.defaultEncoding;else{if(r){if("buffer"!==r&&!m.isEncoding(r))throw new C(r)}else r=s.defaultEncoding;"function"!==typeof n&&(n=O)}if(null===t)throw new E;if(!s.objectMode)if("string"===typeof t)!1!==s.decodeStrings&&(t=m.from(t,r),r="buffer");else if(t instanceof m)r="buffer";else{if(!p._isUint8Array(t))throw new w("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),r="buffer"}let o;return s.ending?o=new A:s.destroyed&&(o=new S("write")),o?(i.nextTick(n,o),$(e,o,!0),o):(s.pendingcb++,R(e,s,t,r,n))}function R(e,t,r,i,n){const s=t.objectMode?1:r.length;t.length+=s;const o=t.lengthr.bufferedIndex&&q(e,r),n?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===s?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:s,stream:e,state:r},i.nextTick(F,r.afterWriteTickInfo)):z(e,r,1,s))):$(e,new k)}function F({stream:e,state:t,count:r,cb:i}){return t.afterWriteTickInfo=null,z(e,t,r,i)}function z(e,t,r,i){const n=!t.ending&&!e.destroyed&&0===t.length&&t.needDrain;n&&(t.needDrain=!1,e.emit("drain"));while(r-- >0)t.pendingcb--,i();t.destroyed&&V(t),K(e,t)}function V(e){if(e.writing)return;for(let n=e.bufferedIndex;n1&&e._writev){t.pendingcb-=o-1;const i=t.allNoop?O:e=>{for(let t=a;t256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function U(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function H(e,t){let r=!1;function n(n){if(r)$(e,null!==n&&void 0!==n?n:k());else if(r=!0,t.pendingcb--,n){const r=t[P].splice(0);for(let e=0;e{U(t)?Y(e,t):t.pendingcb--}),e,t)):U(t)&&(t.pendingcb++,Y(e,t))))}function Y(e,t){t.pendingcb--,t.finished=!0;const r=t[P].splice(0);for(let i=0;i>>0}const $=/^[0-7]+$/,O="must be a 32-bit unsigned integer or an octal string";function P(e,t,r){if("undefined"===typeof e&&(e=r),"string"===typeof e){if(null===f($,e))throw new w(t,e,O);e=h(e,8)}return D(e,t),e}const T=v(((e,t,r=c,i=u)=>{if("number"!==typeof e)throw new b(t,"number",e);if(!a(e))throw new _(t,"an integer",e);if(ei)throw new _(t,`>= ${r} && <= ${i}`,e)})),I=v(((e,t,r=-2147483648,i=2147483647)=>{if("number"!==typeof e)throw new b(t,"number",e);if(!a(e))throw new _(t,"an integer",e);if(ei)throw new _(t,`>= ${r} && <= ${i}`,e)})),D=v(((e,t,r=!1)=>{if("number"!==typeof e)throw new b(t,"number",e);if(!a(e))throw new _(t,"an integer",e);const i=r?1:0,n=4294967295;if(en)throw new _(t,`>= ${i} && <= ${n}`,e)}));function L(e,t){if("string"!==typeof e)throw new b(t,"string",e)}function R(e,t,r=void 0,i){if("number"!==typeof e)throw new b(t,"number",e);if(null!=r&&ei||(null!=r||null!=i)&&l(e))throw new _(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=i?" && ":""}${null!=i?`<= ${i}`:""}`,e)}const N=v(((e,t,r)=>{if(!n(r,e)){const i=s(o(r,(e=>"string"===typeof e?`'${e}'`:p(e))),", "),n="must be one of: "+i;throw new w(t,e,n)}}));function j(e,t){if("boolean"!==typeof e)throw new b(t,"boolean",e)}function B(e,t,r){return null!=e&&d(e,t)?e[t]:r}const F=v(((e,t,r=null)=>{const n=B(r,"allowArray",!1),s=B(r,"allowFunction",!1),o=B(r,"nullable",!1);if(!o&&null===e||!n&&i(e)||"object"!==typeof e&&(!s||"function"!==typeof e))throw new b(t,"Object",e)})),z=v(((e,t)=>{if(null!=e&&"object"!==typeof e&&"function"!==typeof e)throw new b(t,"a dictionary",e)})),V=v(((e,t,r=0)=>{if(!i(e))throw new b(t,"Array",e);if(e.length{if(!M(e))throw new b(t,["Buffer","TypedArray","DataView"],e)}));function Y(e,t){const r=x(t),i=e.length;if("hex"===r&&i%2!==0)throw new w("encoding",t,`is invalid for data of length ${i}`)}function G(e,t="Port",r=!0){if("number"!==typeof e&&"string"!==typeof e||"string"===typeof e&&0===g(e).length||+e!==+e>>>0||e>65535||0===e&&!r)throw new y(t,e,r);return 0|e}const Z=v(((e,t)=>{if(void 0!==e&&(null===e||"object"!==typeof e||!("aborted"in e)))throw new b(t,"AbortSignal",e)})),J=v(((e,t)=>{if("function"!==typeof e)throw new b(t,"Function",e)})),X=v(((e,t)=>{if("function"!==typeof e||S(e))throw new b(t,"Function",e)})),Q=v(((e,t)=>{if(void 0!==e)throw new b(t,"undefined",e)}));function ee(e,t,r){if(!n(r,e))throw new b(t,`('${s(r,"|")}')`,e)}const te=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function re(e,t){if("undefined"===typeof e||!f(te,e))throw new w(t,e,'must be an array or string of format "; rel=preload; as=style"')}function ie(e){if("string"===typeof e)return re(e,"hints"),e;if(i(e)){const t=e.length;let r="";if(0===t)return r;for(let i=0;i; rel=preload; as=style"')}e.exports={isInt32:A,isUint32:C,parseFileMode:P,validateArray:V,validateStringArray:q,validateBooleanArray:U,validateAbortSignalArray:H,validateBoolean:j,validateBuffer:K,validateDictionary:z,validateEncoding:Y,validateFunction:J,validateInt32:I,validateInteger:T,validateNumber:R,validateObject:F,validateOneOf:N,validatePlainFunction:X,validatePort:G,validateSignalName:W,validateString:L,validateUint32:D,validateUndefined:Q,validateUnion:ee,validateAbortSignal:Z,validateLinkHeaderValue:ie}},14088:function(e,t,r){"use strict";const i=r(66836),n=r(67673),s=i.Readable.destroy;e.exports=i.Readable,e.exports._uint8ArrayToBuffer=i._uint8ArrayToBuffer,e.exports._isUint8Array=i._isUint8Array,e.exports.isDisturbed=i.isDisturbed,e.exports.isErrored=i.isErrored,e.exports.isReadable=i.isReadable,e.exports.Readable=i.Readable,e.exports.Writable=i.Writable,e.exports.Duplex=i.Duplex,e.exports.Transform=i.Transform,e.exports.PassThrough=i.PassThrough,e.exports.addAbortSignal=i.addAbortSignal,e.exports.finished=i.finished,e.exports.destroy=i.destroy,e.exports.destroy=s,e.exports.pipeline=i.pipeline,e.exports.compose=i.compose,Object.defineProperty(i,"promises",{configurable:!0,enumerable:!0,get(){return n}}),e.exports.Stream=i.Stream,e.exports["default"]=e.exports},16653:function(e,t,r){"use strict";const{format:i,inspect:n,AggregateError:s}=r(23774),o=globalThis.AggregateError||s,a=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],u=/^([A-Z][a-z0-9]*)+$/,c="__node_internal_",h={};function d(e,t){if(!e)throw new h.ERR_INTERNAL_ASSERTION(t)}function f(e){let t="",r=e.length;const i="-"===e[0]?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function p(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 n=(t.match(/%[dfijoOs]/g)||[]).length;return d(n===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),0===r.length?t:i(t,...r)}function m(e,t,r){r||(r=Error);class i extends r{constructor(...r){super(p(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[a]=!0,h[e]=i}function g(e){const t=c+e.name;return Object.defineProperty(e,"name",{value:t}),e}function v(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}class y extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!==typeof t)throw new h.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}m("ERR_ASSERTION","%s",Error),m("ERR_INVALID_ARG_TYPE",((e,t,r)=>{d("string"===typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let i="The ";e.endsWith(" argument")?i+=`${e} `:i+=`"${e}" ${e.includes(".")?"property":"argument"} `,i+="must be ";const s=[],o=[],a=[];for(const n of t)d("string"===typeof n,"All expected entries have to be of type string"),l.includes(n)?s.push(n.toLowerCase()):u.test(n)?o.push(n):(d("object"!==n,'The value "object" should be written as "Object"'),a.push(n));if(o.length>0){const e=s.indexOf("object");-1!==e&&(s.splice(s,e,1),o.push("Object"))}if(s.length>0){switch(s.length){case 1:i+=`of type ${s[0]}`;break;case 2:i+=`one of type ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();i+=`one of type ${s.join(", ")}, or ${e}`}}(o.length>0||a.length>0)&&(i+=" or ")}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{const e=o.pop();i+=`an instance of ${o.join(", ")}, or ${e}`}}a.length>0&&(i+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(i+="an "),i+=`${a[0]}`;break;case 2:i+=`one of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();i+=`one of ${a.join(", ")}, or ${e}`}}if(null==r)i+=`. Received ${r}`;else if("function"===typeof r&&r.name)i+=`. Received function ${r.name}`;else if("object"===typeof r){var c;if(null!==(c=r.constructor)&&void 0!==c&&c.name)i+=`. Received an instance of ${r.constructor.name}`;else{const e=n(r,{depth:-1});i+=`. Received ${e}`}}else{let e=n(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),i+=`. Received type ${typeof r} (${e})`}return i}),TypeError),m("ERR_INVALID_ARG_VALUE",((e,t,r="is invalid")=>{let i=n(t);i.length>128&&(i=i.slice(0,128)+"...");const s=e.includes(".")?"property":"argument";return`The ${s} '${e}' ${r}. Received ${i}`}),TypeError),m("ERR_INVALID_RETURN_VALUE",((e,t,r)=>{var i;const n=null!==r&&void 0!==r&&null!==(i=r.constructor)&&void 0!==i&&i.name?`instance of ${r.constructor.name}`:"type "+typeof r;return`Expected ${e} to be returned from the "${t}" function but got ${n}.`}),TypeError),m("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`}break}return`${t} must be specified`}),TypeError),m("ERR_OUT_OF_RANGE",((e,t,r)=>{let i;return d(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32?i=f(String(r)):"bigint"===typeof r?(i=String(r),(r>2n**32n||r<-(2n**32n))&&(i=f(i)),i+="n"):i=n(r),`The value of "${e}" is out of range. It must be ${t}. Received ${i}`}),RangeError),m("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),m("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),m("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),m("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),m("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),m("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),m("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),m("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),m("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),m("ERR_STREAM_WRITE_AFTER_END","write after end",Error),m("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:y,aggregateTwoErrors:g(v),hideStackFrames:g,codes:h}},36152:function(e){"use strict";e.exports={ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error:Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number:Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise:Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String:String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol: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){return e.set(t,r)},Boolean:Boolean,Uint8Array:Uint8Array}},23774:function(e,t,r){"use strict";const i=r(48287),{kResistStopPropagation:n,SymbolDispose:s}=r(36152),o=globalThis.AbortSignal||r(25568).AbortSignal,a=globalThis.AbortController||r(25568).AbortController,l=Object.getPrototypeOf((async function(){})).constructor,u=globalThis.Blob||i.Blob,c="undefined"!==typeof u?function(e){return e instanceof u}:function(e){return!1},h=(e,t)=>{if(void 0!==e&&(null===e||"object"!==typeof e||!("aborted"in e)))throw new ERR_INVALID_ARG_TYPE(t,"AbortSignal",e)},d=(e,t)=>{if("function"!==typeof e)throw new ERR_INVALID_ARG_TYPE(t,"Function",e)};class f 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;r{e=r,t=i}));return{promise:r,resolve:e,reject:t}},promisify(e){return new Promise(((t,r)=>{e(((e,...i)=>e?r(e):t(...i)))}))},debuglog(){return function(){}},format(e,...t){return e.replace(/%([sdifj])/g,(function(...[e,r]){const i=t.shift();if("f"===r)return i.toFixed(6);if("j"===r)return JSON.stringify(i);if("s"===r&&"object"===typeof i){const e=i.constructor!==Object?i.constructor.name:"";return`${e} {}`.trim()}return i.toString()}))},inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},types:{isAsyncFunction(e){return e instanceof l},isArrayBufferView(e){return ArrayBuffer.isView(e)}},isBlob:c,deprecate(e,t){return e},addAbortListener:r(37007).addAbortListener||function(e,t){if(void 0===e)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);let r;return h(e,"signal"),d(t,"listener"),e.aborted?queueMicrotask((()=>t())):(e.addEventListener("abort",t,{__proto__:null,once:!0,[n]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[s](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:o.any||function(e){if(1===e.length)return e[0];const t=new a,r=()=>t.abort();return e.forEach((e=>{h(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")},66836:function(e,t,r){const{Buffer:i}=r(48287),{ObjectDefineProperty:n,ObjectKeys:s,ReflectApply:o}=r(36152),{promisify:{custom:a}}=r(23774),{streamReturningOperators:l,promiseReturningOperators:u}=r(5589),{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=r(16653),h=r(57123),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:f}=r(49809),{pipeline:p}=r(27944),{destroyer:m}=r(91582),g=r(34756),v=r(67673),y=r(98825),b=e.exports=r(33137).Stream;b.isDestroyed=y.isDestroyed,b.isDisturbed=y.isDisturbed,b.isErrored=y.isErrored,b.isReadable=y.isReadable,b.isWritable=y.isWritable,b.Readable=r(21878);for(const k of s(l)){const x=l[k];function w(...e){if(new.target)throw c();return b.Readable.from(o(x,this,e))}n(w,"name",{__proto__:null,value:x.name}),n(w,"length",{__proto__:null,value:x.length}),n(b.Readable.prototype,k,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}for(const S of s(u)){const M=u[S];function w(...e){if(new.target)throw c();return o(M,this,e)}n(w,"name",{__proto__:null,value:M.name}),n(w,"length",{__proto__:null,value:M.length}),n(b.Readable.prototype,S,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}b.Writable=r(49498),b.Duplex=r(84656),b.Transform=r(82112),b.PassThrough=r(15122),b.pipeline=p;const{addAbortSignal:_}=r(7849);b.addAbortSignal=_,b.finished=g,b.destroy=m,b.compose=h,b.setDefaultHighWaterMark=d,b.getDefaultHighWaterMark=f,n(b,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return v}}),n(p,a,{__proto__:null,enumerable:!0,get(){return v.pipeline}}),n(g,a,{__proto__:null,enumerable:!0,get(){return v.finished}}),b.Stream=b,b._isUint8Array=function(e){return e instanceof Uint8Array},b._uint8ArrayToBuffer=function(e){return i.from(e.buffer,e.byteOffset,e.byteLength)}},67673:function(e,t,r){"use strict";const{ArrayPrototypePop:i,Promise:n}=r(36152),{isIterable:s,isNodeStream:o,isWebStream:a}=r(98825),{pipelineImpl:l}=r(27944),{finished:u}=r(34756);function c(...e){return new n(((t,r)=>{let n,u;const c=e[e.length-1];if(c&&"object"===typeof c&&!o(c)&&!s(c)&&!a(c)){const t=i(e);n=t.signal,u=t.end}l(e,((e,i)=>{e?r(e):t(i)}),{signal:n,end:u})}))}r(66836),e.exports={finished:u,pipeline:c}},25568:function(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},14018:function(e,t){"use strict";function r(e,t){return{validate:e,compare:t}}function i(e){return e%4===0&&(e%100!==0||e%400===0)}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:r(o,a),time:r(u,c),"date-time":r(d,f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)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a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:M,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:"number",validate:_},int64:{type:"number",validate:k},float:{type:"number",validate:x},double:{type:"number",validate:x},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(e){const t=n.exec(e);if(!t)return!1;const r=+t[1],o=+t[2],a=+t[3];return o>=1&&o<=12&&a>=1&&a<=(2===o&&i(r)?29:s[o])}function a(e,t){if(e&&t)return e>t?1:et?1:e=b}function k(e){return Number.isInteger(e)}function x(){return!0}const S=/[^\\]\\Z/;function M(e){if(S.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}},68182:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(14018),n=r(26461),s=r(93789),o=new s.Name("fullFormats"),a=new s.Name("fastFormats"),l=(e,t={keywords:!0})=>{if(Array.isArray(t))return u(e,t,i.fullFormats,o),e;const[r,s]="fast"===t.mode?[i.fastFormats,a]:[i.fullFormats,o],l=t.formats||i.formatNames;return u(e,l,r,s),t.keywords&&n.default(e),e};function u(e,t,r,i){var n,o;null!==(n=(o=e.opts.code).formats)&&void 0!==n||(o.formats=s._`require("ajv-formats/dist/formats").${i}`);for(const s of t)e.addFormat(s,r[s])}l.get=(e,t="full")=>{const r="fast"===t?i.fastFormats:i.fullFormats,n=r[e];if(!n)throw new Error(`Unknown format "${e}"`);return n},e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=l},26461:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const i=r(22394),n=r(93789),s=n.operators,o={formatMaximum:{okStr:"<=",ok:s.LTE,fail:s.GT},formatMinimum:{okStr:">=",ok:s.GTE,fail:s.LT},formatExclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},formatExclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}},a={message:({keyword:e,schemaCode:t})=>n.str`should be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>n._`{comparison: ${o[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:a,code(e){const{gen:t,data:r,schemaCode:s,keyword:a,it:l}=e,{opts:u,self:c}=l;if(!u.validateFormats)return;const h=new i.KeywordCxt(l,c.RULES.all.format.definition,"format");function d(){const r=t.scopeValue("formats",{ref:c.formats,code:u.code.formats}),i=t.const("fmt",n._`${r}[${h.schemaCode}]`);e.fail$data(n.or(n._`typeof ${i} != "object"`,n._`${i} instanceof RegExp`,n._`typeof ${i}.compare != "function"`,p(i)))}function f(){const r=h.schema,i=c.formats[r];if(!i||!0===i)return;if("object"!=typeof i||i instanceof RegExp||"function"!=typeof i.compare)throw new Error(`"${a}": format "${r}" does not define "compare" function`);const s=t.scopeValue("formats",{key:r,ref:i,code:u.code.formats?n._`${u.code.formats}${n.getProperty(r)}`:void 0});e.fail$data(p(s))}function p(e){return n._`${e}.compare(${r}, ${s}) ${o[a].fail} 0`}h.$data?d():f()},dependencies:["format"]};const l=e=>(e.addKeyword(t.formatLimitDefinition),e);t["default"]=l},22394:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const i=r(17666),n=r(4824),s=r(77013),o=r(92455),a=["/properties"],l="http://json-schema.org/draft-07/schema";class u extends i.default{_addVocabularies(){super._addVocabularies(),n.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=u;var c=r(69810);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var h=r(93789);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return h.CodeGen}});var d=r(99598);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var f=r(70303);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return f.default}})},72104:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class i extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=i;class n extends r{constructor(e){super(),this._items="string"===typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof i&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function s(e,...t){const r=[e[0]];let i=0;while(i"),GTE:new i._Code(">="),LT:new i._Code("<"),LTE:new i._Code("<="),EQ:new i._Code("==="),NEQ:new i._Code("!=="),NOT:new i._Code("!"),OR:new i._Code("||"),AND:new i._Code("&&"),ADD:new i._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends a{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const r=e?n.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=T(this.rhs,e,t)),this}get names(){return this.rhs instanceof i._CodeOrName?this.rhs.names:{}}}class u extends a{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof i.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=T(this.rhs,e,t),this}get names(){const e=this.lhs instanceof i.Name?{}:{...this.lhs.names};return P(e,this.rhs)}}class c extends u{constructor(e,t,r,i){super(e,r,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class h extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){const t=this.label?` ${this.label}`:"";return`break${t};`+e}}class f extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=T(this.code,e,t),this}get names(){return this.code instanceof i._CodeOrName?this.code.names:{}}}class m extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;while(t--){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let i=r.length;while(i--){const n=r[i];n.optimizeNames(e,t)||(I(e,n.names),r.splice(i,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>O(e,t.names)),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class v extends m{}class y extends g{}y.kind="else";class b extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new y(e):e}return t?!1===e?t instanceof b?t:t.nodes:this.nodes.length?this:new b(D(e),t instanceof b?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=T(this.condition,e,t),this}get names(){const e=super.names;return P(e,this.condition),this.else&&O(e,this.else.names),e}}b.kind="if";class w extends g{}w.kind="for";class _ extends w{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=T(this.iteration,e,t),this}get names(){return O(super.names,this.iteration.names)}}class k extends w{constructor(e,t,r,i){super(),this.varKind=e,this.name=t,this.from=r,this.to=i}render(e){const t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:s}=this;return`for(${t} ${r}=${i}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){const e=P(super.names,this.from);return P(e,this.to)}}class x extends w{constructor(e,t,r,i){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=T(this.iterable,e,t),this}get names(){return O(super.names,this.iterable.names)}}class S extends g{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){const t=this.async?"async ":"";return`${t}function ${this.name}(${this.args})`+super.render(e)}}S.kind="func";class M extends m{render(e){return"return "+super.render(e)}}M.kind="return";class E extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,i;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(i=this.finally)||void 0===i||i.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&O(e,this.catch.names),this.finally&&O(e,this.finally.names),e}}class A extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}A.kind="catch";class C extends g{render(e){return"finally"+super.render(e)}}C.kind="finally";class ${constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t),i=this._values[r.prefix]||(this._values[r.prefix]=new Set);return i.add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,i){const n=this._scope.toName(t);return void 0!==r&&i&&(this._constants[n.str]=r),this._leafNode(new l(e,n,r)),n}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new u(e,t,r))}add(e,r){return this._leafNode(new c(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==i.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[r,n]of e)t.length>1&&t.push(","),t.push(r),(r!==n||this.opts.es5)&&(t.push(":"),(0,i.addCodeArg)(t,n));return t.push("}"),new i._Code(t)}if(e,t,r){if(this._blockNode(new b(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new b(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(b,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new _(e),t)}forRange(e,t,r,i,s=(this.opts.es5?n.varKinds.var:n.varKinds.let)){const o=this._scope.toName(e);return this._for(new k(s,o,t,r),(()=>i(o)))}forOf(e,t,r,s=n.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof i.Name?t:this.var("_arr",t);return this.forRange("_i",0,i._`${e}.length`,(t=>{this.var(o,i._`${e}[${t}]`),r(o)}))}return this._for(new x("of",s,o,t),(()=>r(o)))}forIn(e,t,r,s=(this.opts.es5?n.varKinds.var:n.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,i._`Object.keys(${t})`,r);const o=this._scope.toName(e);return this._for(new x("in",s,o,t),(()=>r(o)))}endFor(){return this._endBlockNode(w)}label(e){return this._leafNode(new h(e))}break(e){return this._leafNode(new d(e))}return(e){const t=new M;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(M)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const i=new E;if(this._blockNode(i),this.code(e),t){const e=this.name("e");this._currNode=i.catch=new A(e),t(e)}return r&&(this._currNode=i.finally=new C,this.code(r)),this._endBlockNode(A,C)}throw(e){return this._leafNode(new f(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=i.nil,r,n){return this._blockNode(new S(e,t,r)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof b))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}}function O(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function P(e,t){return t instanceof i._CodeOrName?O(e,t.names):e}function T(e,t,r){return e instanceof i.Name?n(e):s(e)?new i._Code(e._items.reduce(((e,t)=>(t instanceof i.Name&&(t=n(t)),t instanceof i._Code?e.push(...t._items):e.push(t),e)),[])):e;function n(e){const i=r[e.str];return void 0===i||1!==t[e.str]?e:(delete t[e.str],i)}function s(e){return e instanceof i._Code&&e._items.some((e=>e instanceof i.Name&&1===t[e.str]&&void 0!==r[e.str]))}}function I(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function D(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:i._`!${F(e)}`}t.CodeGen=$,t.not=D;const L=B(t.operators.AND);function R(...e){return e.reduce(L)}t.and=R;const N=B(t.operators.OR);function j(...e){return e.reduce(N)}function B(e){return(t,r)=>t===i.nil?r:r===i.nil?t:i._`${F(t)} ${e} ${F(r)}`}function F(e){return e instanceof i.Name?e:i._`(${e})`}t.or=j},45885:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const i=r(72104);class n extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var s;(function(e){e[e["Started"]=0]="Started",e[e["Completed"]=1]="Completed"})(s||(t.UsedValueState=s={})),t.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof i.Name?e:this.name(e)}name(e){return new i.Name(this._newName(e))}_newName(e){const t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=o;class a extends i.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=i._`.${new i.Name(t)}[${r}]`}}t.ValueScopeName=a;const l=i._`\n`;class u extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:i.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const i=this.toName(e),{prefix:n}=i,s=null!==(r=t.key)&&void 0!==r?r:t.ref;let o=this._values[n];if(o){const e=o.get(s);if(e)return e}else o=this._values[n]=new Map;o.set(s,i);const a=this._scope[n]||(this._scope[n]=[]),l=a.length;return a[l]=t.ref,i.setValue(t,{property:n,itemIndex:l}),i}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return i._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(e,r,o={},a){let l=i.nil;for(const u in e){const c=e[u];if(!c)continue;const h=o[u]=o[u]||new Map;c.forEach((e=>{if(h.has(e))return;h.set(e,s.Started);let o=r(e);if(o){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;l=i._`${l}${r} ${e} = ${o};${this.opts._n}`}else{if(!(o=null===a||void 0===a?void 0:a(e)))throw new n(e);l=i._`${l}${o}${this.opts._n}`}h.set(e,s.Completed)}))}return l}}t.ValueScope=u},22796:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const i=r(93789),n=r(7083),s=r(66735);function o(e,r=t.keywordError,n,s){const{it:o}=e,{gen:a,compositeRule:l,allErrors:u}=o,d=f(e,r,n);(null!==s&&void 0!==s?s:l||u)?c(a,d):h(o,i._`[${d}]`)}function a(e,r=t.keywordError,i){const{it:n}=e,{gen:o,compositeRule:a,allErrors:l}=n,u=f(e,r,i);c(o,u),a||l||h(n,s.default.vErrors)}function l(e,t){e.assign(s.default.errors,t),e.if(i._`${s.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(i._`${s.default.vErrors}.length`,t)),(()=>e.assign(s.default.vErrors,null)))))}function u({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:a}){if(void 0===o)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",o,s.default.errors,(o=>{e.const(l,i._`${s.default.vErrors}[${o}]`),e.if(i._`${l}.instancePath === undefined`,(()=>e.assign(i._`${l}.instancePath`,(0,i.strConcat)(s.default.instancePath,a.errorPath)))),e.assign(i._`${l}.schemaPath`,i.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(i._`${l}.schema`,r),e.assign(i._`${l}.data`,n))}))}function c(e,t){const r=e.const("err",t);e.if(i._`${s.default.vErrors} === null`,(()=>e.assign(s.default.vErrors,i._`[${r}]`)),i._`${s.default.vErrors}.push(${r})`),e.code(i._`${s.default.errors}++`)}function h(e,t){const{gen:r,validateName:n,schemaEnv:s}=e;s.$async?r.throw(i._`new ${e.ValidationError}(${t})`):(r.assign(i._`${n}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>i.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?i.str`"${e}" keyword must be ${t} ($data)`:i.str`"${e}" keyword is invalid ($data)`},t.reportError=o,t.reportExtraError=a,t.resetErrorsCount=l,t.extendErrors=u;const d={keyword:new i.Name("keyword"),schemaPath:new i.Name("schemaPath"),params:new i.Name("params"),propertyName:new i.Name("propertyName"),message:new i.Name("message"),schema:new i.Name("schema"),parentSchema:new i.Name("parentSchema")};function f(e,t,r){const{createErrors:n}=e.it;return!1===n?i._`{}`:p(e,t,r)}function p(e,t,r={}){const{gen:i,it:n}=e,s=[m(n,r),g(e,r)];return v(e,t,s),i.object(...s)}function m({errorPath:e},{instancePath:t}){const r=t?i.str`${e}${(0,n.getErrorPath)(t,n.Type.Str)}`:e;return[s.default.instancePath,(0,i.strConcat)(s.default.instancePath,r)]}function g({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:s}){let o=s?t:i.str`${t}/${e}`;return r&&(o=i.str`${o}${(0,n.getErrorPath)(r,n.Type.Str)}`),[d.schemaPath,o]}function v(e,{params:t,message:r},n){const{keyword:o,data:a,schemaValue:l,it:u}=e,{opts:c,propertyName:h,topSchemaRef:f,schemaPath:p}=u;n.push([d.keyword,o],[d.params,"function"==typeof t?t(e):t||i._`{}`]),c.messages&&n.push([d.message,"function"==typeof r?r(e):r]),c.verbose&&n.push([d.schema,l],[d.parentSchema,i._`${f}${p}`],[s.default.data,a]),h&&n.push([d.propertyName,h])}},65219:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const i=r(93789),n=r(99598),s=r(66735),o=r(63043),a=r(7083),l=r(69810);class u{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,o.normalizeId)(null===r||void 0===r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null===r||void 0===r?void 0:r.$async,this.refs={}}}function c(e){const t=f.call(this,e);if(t)return t;const r=(0,o.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:u}=this.opts.code,{ownProperties:c}=this.opts,h=new i.CodeGen(this.scope,{es5:a,lines:u,ownProperties:c});let d;e.$async&&(d=h.scopeValue("Error",{ref:n.default,code:i._`require("ajv/dist/runtime/validation_error").default`}));const p=h.scopeName("validate");e.validateName=p;const m={gen:h,allErrors:this.opts.allErrors,data:s.default.data,parentData:s.default.parentData,parentDataProperty:s.default.parentDataProperty,dataNames:[s.default.data],dataPathArr:[i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:h.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,i.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:d,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:i.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:i._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,l.validateFunctionCode)(m),h.optimize(this.opts.code.optimize);const t=h.toString();g=`${h.scopeRefs(s.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const r=new Function(`${s.default.self}`,`${s.default.scope}`,g),n=r(this,this.scope.get());if(this.scope.value(p,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:p,validateCode:t,scopeValues:h._values}),this.opts.unevaluated){const{props:e,items:t}=m;n.evaluated={props:e instanceof i.Name?void 0:e,items:t instanceof i.Name?void 0:t,dynamicProps:e instanceof i.Name,dynamicItems:t instanceof i.Name},n.source&&(n.source.evaluated=(0,i.stringify)(n.evaluated))}return e.validate=n,e}catch(v){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),v}finally{this._compilations.delete(e)}}function h(e,t,r){var i;r=(0,o.resolveUrl)(this.opts.uriResolver,t,r);const n=e.refs[r];if(n)return n;let s=m.call(this,e,r);if(void 0===s){const n=null===(i=e.localRefs)||void 0===i?void 0:i[r],{schemaId:o}=this.opts;n&&(s=new u({schema:n,schemaId:o,root:e,baseId:t}))}return void 0!==s?e.refs[r]=d.call(this,s):void 0}function d(e){return(0,o.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function f(e){for(const t of this._compilations)if(p(t,e))return t}function p(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function m(e,t){let r;while("string"==typeof(r=this.refs[t]))t=r;return r||this.schemas[t]||g.call(this,e,t)}function g(e,t){const r=this.opts.uriResolver.parse(t),i=(0,o._getFullPath)(this.opts.uriResolver,r);let n=(0,o.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===n)return y.call(this,r,e);const s=(0,o.normalizeId)(i),a=this.refs[s]||this.schemas[s];if("string"==typeof a){const t=g.call(this,e,a);if("object"!==typeof(null===t||void 0===t?void 0:t.schema))return;return y.call(this,r,t)}if("object"===typeof(null===a||void 0===a?void 0:a.schema)){if(a.validate||c.call(this,a),s===(0,o.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,i=t[r];return i&&(n=(0,o.resolveUrl)(this.opts.uriResolver,n,i)),new u({schema:t,schemaId:r,root:e,baseId:n})}return y.call(this,r,a)}}t.SchemaEnv=u,t.compileSchema=c,t.resolveRef=h,t.getCompilingSchema=f,t.resolveSchema=g;const v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(e,{baseId:t,schema:r,root:i}){var n;if("/"!==(null===(n=e.fragment)||void 0===n?void 0:n[0]))return;for(const u of e.fragment.slice(1).split("/")){if("boolean"===typeof r)return;const e=r[(0,a.unescapeFragment)(u)];if(void 0===e)return;r=e;const i="object"===typeof r&&r[this.opts.schemaId];!v.has(u)&&i&&(t=(0,o.resolveUrl)(this.opts.uriResolver,t,i))}let s;if("boolean"!=typeof r&&r.$ref&&!(0,a.schemaHasRulesButRef)(r,this.RULES)){const e=(0,o.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=g.call(this,i,e)}const{schemaId:l}=this.opts;return s=s||new u({schema:r,schemaId:l,root:i,baseId:t}),s.schema!==s.root.schema?s:void 0}},66735:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n={data:new i.Name("data"),valCxt:new i.Name("valCxt"),instancePath:new i.Name("instancePath"),parentData:new i.Name("parentData"),parentDataProperty:new i.Name("parentDataProperty"),rootData:new i.Name("rootData"),dynamicAnchors:new i.Name("dynamicAnchors"),vErrors:new i.Name("vErrors"),errors:new i.Name("errors"),this:new i.Name("this"),self:new i.Name("self"),scope:new i.Name("scope"),json:new i.Name("json"),jsonPos:new i.Name("jsonPos"),jsonLen:new i.Name("jsonLen"),jsonPart:new i.Name("jsonPart")};t["default"]=n},70303:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(63043);class n extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,i.resolveUrl)(e,t,r),this.missingSchema=(0,i.normalizeId)((0,i.getFullPath)(e,this.missingRef))}}t["default"]=n},63043:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const i=r(7083),n=r(32017),s=r(67242),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function a(e,t=!0){return"boolean"==typeof e||(!0===t?!u(e):!!t&&c(e)<=t)}t.inlineRef=a;const l=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function u(e){for(const t in e){if(l.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(u))return!0;if("object"==typeof r&&u(r))return!0}return!1}function c(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!o.has(r)&&("object"==typeof e[r]&&(0,i.eachItem)(e[r],(e=>t+=c(e))),t===1/0))return 1/0}return t}function h(e,t="",r){!1!==r&&(t=p(t));const i=e.parse(t);return d(e,i)}function d(e,t){const r=e.serialize(t);return r.split("#")[0]+"#"}t.getFullPath=h,t._getFullPath=d;const f=/#\/?$/;function p(e){return e?e.replace(f,""):""}function m(e,t,r){return r=p(r),e.resolve(t,r)}t.normalizeId=p,t.resolveUrl=m;const g=/^[a-z_][-a-z0-9._]*$/i;function v(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:i}=this.opts,o=p(e[r]||t),a={"":o},l=h(i,o,!1),u={},c=new Set;return s(e,{allKeys:!0},((e,t,i,n)=>{if(void 0===n)return;const s=l+t;let o=a[n];function h(t){const r=this.opts.uriResolver.resolve;if(t=p(o?r(o,t):t),c.has(t))throw f(t);c.add(t);let i=this.refs[t];return"string"==typeof i&&(i=this.refs[i]),"object"==typeof i?d(e,i.schema,t):t!==p(s)&&("#"===t[0]?(d(e,u[t],t),u[t]=e):this.refs[t]=s),t}function m(e){if("string"==typeof e){if(!g.test(e))throw new Error(`invalid anchor "${e}"`);h.call(this,`#${e}`)}}"string"==typeof e[r]&&(o=h.call(this,e[r])),m.call(this,e.$anchor),m.call(this,e.$dynamicAnchor),a[t]=o})),u;function d(e,t,r){if(void 0!==t&&!n(e,t))throw f(r)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}}t.getSchemaRefs=v},5095:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const r=["string","number","integer","boolean","null","object","array"],i=new Set(r);function n(e){return"string"==typeof e&&i.has(e)}function s(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}t.isJSONType=n,t.getRules=s},7083:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const i=r(93789),n=r(72104);function s(e){const t={};for(const r of e)t[r]=!0;return t}function o(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(a(e,t),!l(t,e.self.RULES.all))}function a(e,t=e.schema){const{opts:r,self:i}=e;if(!r.strictSchema)return;if("boolean"===typeof t)return;const n=i.RULES.keywords;for(const s in t)n[s]||x(e,`unknown keyword: "${s}"`)}function l(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function u(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1}function c({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return i._`${r}`}return i._`${e}${t}${(0,i.getProperty)(n)}`}function h(e){return p(decodeURIComponent(e))}function d(e){return encodeURIComponent(f(e))}function f(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function p(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function m(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)}function g({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,a,l)=>{const u=void 0===a?o:a instanceof i.Name?(o instanceof i.Name?e(s,o,a):t(s,o,a),a):o instanceof i.Name?(t(s,a,o),o):r(o,a);return l!==i.Name||u instanceof i.Name?u:n(s,u)}}function v(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",i._`{}`);return void 0!==t&&y(e,r,t),r}function y(e,t,r){Object.keys(r).forEach((r=>e.assign(i._`${t}${(0,i.getProperty)(r)}`,!0)))}t.toHash=s,t.alwaysValidSchema=o,t.checkUnknownRules=a,t.schemaHasRules=l,t.schemaHasRulesButRef=u,t.schemaRefOrVal=c,t.unescapeFragment=h,t.escapeFragment=d,t.escapeJsonPointer=f,t.unescapeJsonPointer=p,t.eachItem=m,t.mergeEvaluated={props:g({mergeNames:(e,t,r)=>e.if(i._`${r} !== true && ${t} !== undefined`,(()=>{e.if(i._`${t} === true`,(()=>e.assign(r,!0)),(()=>e.assign(r,i._`${r} || {}`).code(i._`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if(i._`${r} !== true`,(()=>{!0===t?e.assign(r,!0):(e.assign(r,i._`${r} || {}`),y(e,r,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:v}),items:g({mergeNames:(e,t,r)=>e.if(i._`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,i._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if(i._`${r} !== true`,(()=>e.assign(r,!0===t||i._`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=v,t.setEvaluated=y;const b={};function w(e,t){return e.scopeValue("func",{ref:t,code:b[t.code]||(b[t.code]=new n._Code(t.code))})}var _;function k(e,t,r){if(e instanceof i.Name){const n=t===_.Num;return r?n?i._`"[" + ${e} + "]"`:i._`"['" + ${e} + "']"`:n?i._`"/" + ${e}`:i._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,i.getProperty)(e).toString():"/"+f(e)}function x(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=w,function(e){e[e["Num"]=0]="Num",e[e["Str"]=1]="Str"}(_||(t.Type=_={})),t.getErrorPath=k,t.checkStrictMode=x},65335:function(e,t){"use strict";function r({schema:e,self:t},r){const n=t.RULES.types[r];return n&&!0!==n&&i(e,n)}function i(e,t){return t.rules.some((t=>n(e,t)))}function n(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=r,t.shouldUseGroup=i,t.shouldUseRule=n},15583:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const i=r(22796),n=r(93789),s=r(66735),o={message:"boolean schema is false"};function a(e){const{gen:t,schema:r,validateName:i}=e;!1===r?u(e,!1):"object"==typeof r&&!0===r.$async?t.return(s.default.data):(t.assign(n._`${i}.errors`,null),t.return(!0))}function l(e,t){const{gen:r,schema:i}=e;!1===i?(r.var(t,!1),u(e)):r.var(t,!0)}function u(e,t){const{gen:r,data:n}=e,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,i.reportError)(s,o,void 0,t)}t.topBoolOrEmptySchema=a,t.boolOrEmptySchema=l},28840:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const i=r(5095),n=r(65335),s=r(22796),o=r(93789),a=r(7083);var l;function u(e){const t=c(e.type),r=t.includes("null");if(r){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t}function c(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(i.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}function h(e,t){const{gen:r,data:i,opts:s}=e,o=f(t,s.coerceTypes),a=t.length>0&&!(0===o.length&&1===t.length&&(0,n.schemaHasRulesForType)(e,t[0]));if(a){const n=v(t,i,s.strictNumbers,l.Wrong);r.if(n,(()=>{o.length?p(e,t,o):b(e)}))}return a}(function(e){e[e["Correct"]=0]="Correct",e[e["Wrong"]=1]="Wrong"})(l||(t.DataType=l={})),t.getSchemaTypes=u,t.getJSONTypes=c,t.coerceAndCheckDataType=h;const d=new Set(["string","number","integer","boolean","null"]);function f(e,t){return t?e.filter((e=>d.has(e)||"array"===t&&"array"===e)):[]}function p(e,t,r){const{gen:i,data:n,opts:s}=e,a=i.let("dataType",o._`typeof ${n}`),l=i.let("coerced",o._`undefined`);"array"===s.coerceTypes&&i.if(o._`${a} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,(()=>i.assign(n,o._`${n}[0]`).assign(a,o._`typeof ${n}`).if(v(t,n,s.strictNumbers),(()=>i.assign(l,n))))),i.if(o._`${l} !== undefined`);for(const o of r)(d.has(o)||"array"===o&&"array"===s.coerceTypes)&&u(o);function u(e){switch(e){case"string":return void i.elseIf(o._`${a} == "number" || ${a} == "boolean"`).assign(l,o._`"" + ${n}`).elseIf(o._`${n} === null`).assign(l,o._`""`);case"number":return void i.elseIf(o._`${a} == "boolean" || ${n} === null +(self["webpackChunkmobilitydcatap_ui"]=self["webpackChunkmobilitydcatap_ui"]||[]).push([[504],{76063:function(e,t,r){const i=r(91565),n=/([\x00-\x20<>"{}|^`\\]|%(?![0-9A-F][0-9A-F]))/g,s=(e,t)=>{let r=t.codePointAt(0).toString(16)+"";return r.length>4?"\\U"+r.padStart(8,"0"):"\\u"+r.padStart(4,"0")},o=e=>e.replace(n,s),a=/^(?:[\u0000-@[-`{-\u00bf\u00d7\u00f7\u0300-\u306f\u037e\u2000-\u200b\u200e-\u206f\u2190-\u2bff\u2ff0-\u3000\ud800-\uf8ff\ufdd0-\ufddf\ufffe\uffff].+|(?:.+?[\u0000-,\/:-@[-^`{-\u00b6\u00b8-\u00bf\u00d7\u00f7\u037e\u2000-\u200b\u200e-\u203e\u2041-\u206f\u2190-\u2bff\u2ff0-\u3000\ud800-\uf8ff\ufdd0-\ufddf\ufffe\uffff].*)|.+\.)$/,l=/^(?:\\|[\u0000-\/;-@[-^`{-\u00bf\u00d7\u00f7\u0300-\u306f\u037e\u2000-\u200b\u200e-\u206f\u2190-\u2bff\u2ff0-\u3000\ud800-\uf8ff\ufdd0-\ufddf\ufffe\uffff].+|(?:.+?(?:\\|[\u0000-,\/;-@[-^`{-\u00b6\u00b8-\u00bf\u00d7\u00f7\u037e\u2000-\u200b\u200e-\u203e\u2041-\u206f\u2190-\u2bff\u2ff0-\u3000\ud800-\uf8ff\ufdd0-\ufddf\ufffe\uffff]).+)|(?:.+?(?:\\|[\u0000-,.\/;-@[-^`{-\u00b6\u00b8-\u00bf\u00d7\u00f7\u037e\u2000-\u200b\u200e-\u203e\u2041-\u206f\u2190-\u2bff\u2ff0-\u3000\ud800-\uf8ff\ufdd0-\ufddf\ufffe\uffff])))$/,u=/^([Tt](rue)?|TRUE)$/,c=/^([Ff](alse)?|FALSE)$/,h="xxxxxxxx_xxxx_4xxx_yxxx_xxxxxxxxxxxx",d=/[xy]/g,f=()=>{let e=Date.now();return"undefined"!==typeof performance&&(e+=performance.now()),h.replace(d,(t=>{let r=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?r:3&r|8).toString(16)}))},p=Symbol("prefix-cache"),m=/[$^*()+[\\{}|.?]/g,g="((?:[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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]|%[A-Fa-f0-9]{2}|\\\\[_~.\\-!$&'()*+,;=/?#@%])(?:(?:[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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}.:]|%[A-Fa-f0-9]{2}|\\\\[_~.\\-!$&'()*+,;=/?#@%])*(?:[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\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}:]|%[A-Fa-f0-9]{2}|\\\\[_~.\\-!$&'()*+,;=/?#@%]))?)$";function v(e,t=!1){let r=[],i={};for(let n in e){let s=e[n];t&&a.test(n)||(i[s]=n,r.push(s.replace(m,"\\$&")))}return r.length?(e[p]={_r_iris:new RegExp(`^(${r.join("|")})${g}`,"u"),_h_inverse:i},Object.freeze(e)):e}const y=(e,t)=>{let r=t[p];if(r){let t=r._r_iris.exec(e);if(t)return r._h_inverse[t[1]]+":"+t[2]}else{let r="",i="",n=-1;for(let s in t){let o=t[s];if(0===e.indexOf(o)&&o.length>n&&!a.test(s)){let t=e.slice(o.length);l.test(t)||(i=t,r=s,n=o.length)}}if(-1!==n)return r+":"+i}return"<"+e+">"},b=(e,t={})=>{let r=t[p];if(r){let t=r._r_iris.exec(e);if(t)return r._h_inverse[t[1]]+":"+t[2]}else{let r="",i=-1;for(let n in t){let s=t[n];e.startsWith(s)&&s.length>i&&(r=n,i=s.length)}if(-1!==i)return r+":"+e.slice(i)}return">"+e},w=/^([^:]*):(.*)$/;function _(e,t={},r=!1){switch(e[0]){case">":return"<"+e.slice(1)+">";case"_":return e.length<=2||"#"===e[2]?(new J)[r?"verbose":"terse"]():e;case'"':return JSON.stringify(e.slice(1));case"@":{let t=e.indexOf('"');return JSON.stringify(e.slice(t+1))+e.slice(0,t)}case"^":{let i=e.indexOf('"');return JSON.stringify(e.slice(i+1))+"^^"+_(e.slice(1,i),t,r)}case"*":return"";case"<":case"`":return ne.c1(e).terse(t);default:{if("a"===e)return r?"":"a";let[,i,n]=w.exec(e);return r||l.test(n)||a.test(i)?"<"+t[i]+n+">":e}}}class k{valueOf(){return this.concise()}toString(){return this.concise()}equals(e){return!!e&&(this===e||e.termType===this.termType&&e.value===this.value)}}Object.assign(k.prototype,{isGraphyTerm:!0});class x extends k{constructor(e){super(),this.value=e}concise(e={}){return b(this.value,e)}terse(e={},t=!1){return y(o(this.value),e,t)}verbose(){return"<"+o(this.value)+">"}isolate(){return{termType:"NamedNode",value:this.value}}}Object.assign(x.prototype,{termType:"NamedNode",isNamedNode:!0});const S=new x("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");S.isRdfTypeAlias=!0;const M=new x("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),E=M.isolate(),A=new x("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),C=new x("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"),$=new x("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"),O=new x("http://www.w3.org/2001/XMLSchema#date"),P=new x("http://www.w3.org/2001/XMLSchema#dateTime"),T=new x("http://www.w3.org/2001/XMLSchema#string");class I extends k{equals(e){return!!e&&(this===e||"Literal"===e.termType&&e.value===this.value&&this.datatype.equals(e.datatype)&&e.language===this.language)}verbose(){return JSON.stringify(this.value)+(this.language?"@"+this.language:"^^"+this.datatype.verbose())}concise(e){return this.language?"@"+this.language+'"'+this.value:"^"+b(this.datatype.value,e)+'"'+this.value}terse(e={}){let t=this.datatype.terse(e);return JSON.stringify(this.value)+(this.language?"@"+this.language:"^^"+t)}isolate(){return{termType:"Literal",value:this.value,language:this.language,datatype:this.datatype.isolate()}}}Object.assign(I.prototype,{datatype:T,language:"",termType:"Literal",isLiteral:!0,isSimple:!1});class D extends I{constructor(e,t){super(),this.value=e,this.language=("@"===t[0]?t.slice(1):t).toLowerCase()}verbose(){return JSON.stringify(this.value)+"@"+this.language}concise(){return"@"+this.language+'"'+this.value}terse(){return JSON.stringify(this.value)+"@"+this.language}isolate(){return{termType:"Literal",value:this.value,language:this.language,datatype:E}}}Object.assign(D.prototype,{datatype:M,isLanguaged:!0});class L extends I{verbose(){return JSON.stringify(this.value)+"^^"+this.datatype.verbose()}concise(e){return"^"+b(this.datatype.value,e)+'"'+this.value}terse(e={}){let t=this.datatype.terse(e);return JSON.stringify(this.value)+"^^"+t}isolate(){return{termType:"Literal",value:this.value,language:this.language,datatype:this.datatype.isolate()}}}Object.assign(L.prototype,{isDatatyped:!0});class N extends L{constructor(e,t){super(),this.value=e,this.datatype=t}}class R extends k{constructor(e){super(),this.value=e}get isSimple(){return!this.language&&!this.datatype.equals(T)}get isLanguaged(){return!!this.language}get isDatatyped(){return T.equals(this.datatype)}equals(e){return!!e&&(this===e||"Literal"===e.termType&&e.value===this.value&&this.datatype.equals(e.datatype)&&e.language===this.language)}verbose(){return JSON.stringify(this.value)+(this.language?"@"+this.language:"^^"+this.datatype.verbose())}concise(e){return this.language?"@"+this.language+'"'+this.value:"^"+b(this.datatype.value,e)+'"'+this.value}terse(e={}){let t=this.datatype.terse(e);return JSON.stringify(this.value)+(this.language?"@"+this.language:"^^"+t)}isolate(){return{termType:"Literal",value:this.value,language:this.language,datatype:this.datatype.isolate()}}}Object.assign(R.prototype,{datatype:T,language:"",termType:"Literal",isLiteral:!0});class j extends I{constructor(e){super(),this.value=e}verbose(){return JSON.stringify(this.value)}concise(){return'"'+this.value}terse(){return JSON.stringify(this.value)}}Object.assign(j.prototype,{isSimple:!0});const B=new x("http://www.w3.org/2001/XMLSchema#integer");class F extends L{static from(e){let t=new F(+e);return t.value=e,t}constructor(e){super(),this.value=e+"",this.number=e}concise(e={}){return"^"+B.concise(e)+'"'+this.value}terse(){return this.value.includes("e")?`"${this.value}"^^`:this.value}}Object.assign(F.prototype,{datatype:B,isNumeric:!0,isInteger:!0});const z=new x("http://www.w3.org/2001/XMLSchema#double");class V extends L{static from(e){let t=new V(+e);return t.value=e,t}constructor(e){super(),this.value=e+"",this.number=e}concise(e={}){return"^"+z.concise(e)+'"'+this.value}terse(){return this.number.toExponential()}}Object.assign(V.prototype,{datatype:z,isNumeric:!0,isDouble:!0});const q=new x("http://www.w3.org/2001/XMLSchema#decimal");class U extends L{static from(e){let t=new U(+e);return t.value=e,t}constructor(e){super(),this.value=e+"",this.number=e}concise(e={}){return"^"+q.concise(e)+'"'+this.value}terse(){return this.value.includes("e")?`"${this.value}"^^`:this.value+(this.value.includes(".")?"":".0")}}Object.assign(U.prototype,{datatype:q,isNumeric:!0,isDecimal:!0});const H=new x("http://www.w3.org/2001/XMLSchema#boolean");class W extends L{static from(e){let t=new W(+e);return t.value=e,t}constructor(e){super(),this.value=e+"",this.boolean=e}concise(e={}){return"^"+H.concise(e)+'"'+this.value}terse(){return this.value+""}}Object.assign(W.prototype,{datatype:H,isBoolean:!0});class K extends V{constructor(){super(1/0),this.value="INF"}terse(e){return'"INF"^^'+z.terse(e)}}Object.assign(K.prototype,{isInfinite:!0});class Y extends V{constructor(){super(-1/0),this.value="-INF"}terse(e){return'"-INF"^^'+z.terse(e)}}Object.assign(Y.prototype,{isInfinite:!0});class G extends V{constructor(){super(NaN),this.value="NaN"}terse(e){return'"NaN"^^'+z.terse(e)}}function Z(e,t=!1){this.value=e,this.isAnonymous=t}function J(){}Object.assign(G.prototype,{isNaN:!0}),Z.prototype=Object.assign(Object.create(k.prototype),{termType:"BlankNode",isBlankNode:!0,concise(){return"_:"+this.value},terse(){return"_:"+this.value},verbose(){return"_:"+this.value},isolate(){return{termType:"BlankNode",value:this.value}}}),J.prototype=Object.assign(Object.create(Z.prototype),{isAnonymous:!0,isEphemeral:!0,concise(){return"_:#"+this.value},terse(){return"[]"},verbose(){return"_:"+this.value},isolate(){return{termType:"BlankNode",value:this.value}},equals(){return!1}}),Object.defineProperty(J.prototype,"value",{get(){return"_"+f()}});class X extends k{constructor(e){super(),this.value=e}concise(){return"?"+this.value}terse(){throw new Error("Cannot call .terse() on 'Variable' term type")}verbose(){throw new Error("Cannot call .verbose() on 'Variable' term type")}isolate(){return{termType:"Variable",value:this.value}}}function Q(){}function ee(){}Object.assign(X.prototype,{termType:"Variable",isVariable:!0}),Q.prototype=Object.assign(Object.create(k.prototype),{value:"",termType:"DefaultGraph",isDefaultGraph:!0,concise(){return"*"},terse(){return""},verbose(){return""},isolate(){return{termType:"DefaultGraph",value:""}}}),ee.prototype=Object.assign(Object.create(k.prototype),{value:"",termType:"NoGraph",concise(){return""},terse(){return""},verbose(){return""},isolate(){return{termType:"NoGraph",value:""}}});const te=new Q;function re(e,t,r,i=te){this.subject=e,this.predicate=t,this.object=r,this.graph=i}Object.assign(re.prototype,{isGraphyQuad:!0,equals(e){return!!e&&(this===e||this.object.equals(e.object)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.graph.equals(e.graph))},valueOf(){return this.verbose()},concise(e={}){return[this.subject.concise(e),this.predicate.concise(e),this.object.concise(e),this.graph.concise(e)]},terse(e){let t=this.graph.isDefaultGraph;return(t?"":this.graph.terse(e)+" { ")+this.subject.terse(e)+" "+this.predicate.terse(e)+" "+this.object.terse(e)+" ."+(t?"":" }")},verbose(){return this.subject.verbose()+" "+this.predicate.verbose()+" "+this.object.verbose()+" "+(this.graph.isDefaultGraph?"":this.graph.verbose()+" ")+"."},isolate(){return{subject:this.subject.isolate(),predicate:this.predicate.isolate(),object:this.object.isolate(),graph:this.graph.isolate()}}});let ie={namedNode(e){return new x(e)},blankNode(e,t){return new Z(e,t)},literal(e){return new R(e)},defaultGraph(){return new Q},quad(e,t,r,i){return new re(e,t,r,i||te)},integer(e){return F.from(e)},double(e){return V.from(e)},decimal(e){return U.from(e)},boolean(e){return new W(e)}};const ne=e.exports={concise:b,adopt(e){let t=Object.create(e),r=!1;if("function"!==typeof e.boolean){let i=e.namedNode("http://www.w3.org/2001/XMLSchema#boolean");t.boolean=t=>e.literal(t+"",i),r=!0}if("function"!==typeof e.double){let i=e.namedNode("http://www.w3.org/2001/XMLSchema#double");t.double=t=>e.literal(t+"",i),r=!0}if("function"!==typeof e.decimal){let i=e.namedNode("http://www.w3.org/2001/XMLSchema#decimal");t.decimal=t=>e.literal(t+"",i),r=!0}if("function"!==typeof e.integer){let i=e.namedNode("http://www.w3.org/2001/XMLSchema#integer");t.integer=t=>e.literal(t+"",i),r=!0}return"function"!==typeof e.simpleLiteral&&(t.simpleLiteral=t=>e.literal(t),r=!0),"function"!==typeof e.languagedLiteral&&(t.languagedLiteral=(t,r)=>e.literal(t,r),r=!0),"function"!==typeof e.datatypedLiteral&&(t.datatypedLiteral=(t,r)=>e.literal(t,r),r=!0),r?t:e},raw:ie,unfiltered:{...ie,literal(e,t){return!t||T.equals(t)?new j(e):"string"===typeof t?new D(e,t):T.equals(t)?new j(e):new N(e,t)},simpleLiteral(e){return new j(e)},languagedLiteral(e,t){return new D(e,t)},datatypedLiteral(e,t){return T.equals(t)?new j(e):new N(e,t)}},number(e){return"number"!==typeof e||Number.isFinite(e)&&!Number.isNaN(e)?Number.isInteger(e)||"bigint"===typeof e?ne.integer(e):ne.decimal(e):ne.double(e)},date(e){return ne.literal(e.toISOString().replace(/T.+$/,"Z"),O)},dateTime(e){return ne.literal(e.toISOString(),P)},namedNode(e){return new x(e)},ephemeral(){return new J},anonymous(){return new J},blankNode(e){if(!e)return new Z("_"+f(),!0);if("string"===typeof e)return new Z(e);throw new TypeError(`factory.blankNode(label) expects 'label' parameter to be falsy or a string; instead found: ${e}`)},literal(e,t){return!t||T.equals(t)?new j(e):"string"===typeof t?new D(e,t):new N(e,t)},integer(e){let t=typeof e;if("number"===t){if(!Number.isFinite(e)){if(Number.isNaN(e))throw new Error("XSD integer cannot encode NaN. Try using double");throw new Error("XSD integer cannot encode +/-infinity. Try using double")}if(!Number.isInteger(e))throw new Error("Number is not an integer: "+e);return new F(e)}if("string"===t){if(""===e)throw new Error("Refusing to serialize empty string as xsd:integer");let t=+e;if(Number.isNaN(t)||!Number.isInteger(t))throw new Error("Invalid integer string: "+e);return new F(t)}if("undefined"===t)throw new Error("Refusing to serialize undefined value as xsd:integer");if(null===e)throw new Error("Refusing to serialize null value as xsd:integer");throw new Error("XSD integer expects a number type or integer string")},double(e){let t=typeof e;if("number"===t)return Number.isFinite(e)?new V(e):Number.isNaN(e)?new G:e>0?new K:new Y;if("string"===t){if(""===e)throw new Error("Refusing to serialize empty string as xsd:double");let t=+e;if(Number.isNaN(t))throw new Error("Invalid decimal string: "+e);return new V(t)}if("undefined"===t)throw new Error("Refusing to serialize undefined value as xsd:double");if(null===e)throw new Error("Refusing to serialize null value as xsd:double");throw new Error("XSD double expects a number type or double string")},decimal(e){let t=typeof e;if("number"===t){if(!Number.isFinite(e)){if(Number.isNaN(e))throw new Error("XSD decimal cannot encode NaN. Try using double");throw new Error("XSD decimal cannot encode +/-infinity. Try using double")}return new U(e)}if("string"===t){if(""===e)throw new Error("Refusing to serialize empty string as xsd:decimal");let t=+e;if(Number.isNaN(t))throw new Error("Invalid decimal string: "+e);return new U(t)}if("undefined"===t)throw new Error("Refusing to serialize undefined value as xsd:decimal");if(null===e)throw new Error("Refusing to serialize null value as xsd:decimal");throw new Error("XSD decimal expects a number type or decimal string")},boolean(e){let t=typeof e;if("boolean"===t)return new W(e);if("number"===t){if(1===e)return new W(!0);if(0===e)return new W(!1);throw new Error("Boolean value 'w_value' must be either a '1' or '0' if using numbers")}if("string"===t){if(u.test(e))return new W(!0);if(c.test(e))return new W(!1);if(""===e)throw new Error("Refusing to serialize empty string as xsd:boolean");throw new Error("Invalid boolean string: "+e)}if("undefined"===t)throw new Error("Refusing to serialize undefined value as xsd:boolean");if(null===e)throw new Error("Refusing to serialize null value as xsd:boolean");throw new Error("XSD boolean expects a boolean type or boolean string")},defaultGraph(){return new Q},variable(e){return new X(e)},triple(e,t,r){let i=new Error("It is strongly encouraged to use .quad() instead of .triple()");return console.warn(i.stack.replace(/^(\s*)Error:/,"$1Warning:")),new re(e,t,r)},quad(e,t,r,i){return new re(e,t,r,i||te)},term(e,t){return"string"===typeof e?ne.c1(e,t):ne.from.rdfjs_term(e)},c1(e,t={}){switch(e[0]){case"^":{let r=e.indexOf('"');if(-1===r)throw new Error(`Invalid concise-term string, no content literal delimiter found: '${e}'`);let i=e.slice(1,r);return ne.literal(e.slice(r+1),ne.c1_node_explicit(i,t))}case"@":{let t=e.indexOf('"');if(-1===t)throw new Error(`Invalid concise-term string, no content literal delimiter found: '${e}'`);let r=e.slice(1,t);return ne.literal(e.slice(t+1),r)}case'"':return ne.literal(e.slice(1));default:return ne.c1_node(e,t)}},c1_node(e,t={}){if("a"===e)return S;if("*"===e)return ne.defaultGraph();if("_"===e[0]){if(":"!==e[1])throw new Error(`Invliad concise-term string, prefixes are not allowed to start with an underscore: '${e}'`);return"#"===e[2]||2===e.length?ne.ephemeral():ne.blankNode(e.slice(2))}return ne.c1_node_explicit(e,t)},c1_named_node(e,t={}){return"a"===e?S:ne.c1_node_explicit(e,t)},c1_node_explicit(e,t={}){switch(e[0]){case">":return ne.namedNode(e.slice(1));case"<":throw new Error(`Whoops! It looks like this concise-term string starts with a '<' character. Remember to use '>' if you are trying to make an absolute IRI reference.\nInvalid concise-term string '${e}'`);case"`":throw new Error(`The backtick character '\`' is reserved for concise-struct key directives and should not be used in the object position.\nInvalid concise-term string '${e}'`);default:return this.c1_prefixed_node(e,t)}},c1_prefixed_node(e,t={}){let r=e.indexOf(":");if(-1===r)throw new Error(`A relative or prefixed node must include a ':' character. \nInvalid concise-term string for node: '${e}'`);let i=e.slice(0,r),n=e.slice(r+1);if(i in t)return ne.namedNode(t[i]+n);throw new Error(`Prefix not defined: '${i}'`)},c1_to_nt:_,*quads(e,t={}){for(let r in e)yield*ne.triples(e[r],t,r)},*triples(e,t={},r="*"){let i=ne.c1(r,t);for(let n in e){let r=ne.c1(n,t),s=e[n];yield*ne.pairs(i,r,s,t)}},*pairs(e,t,r,i={}){for(let n in r){let s=ne.c1(n,i),o=r[n];yield*ne.objects(e,t,s,o,i)}},*collection(e,t,r,i={}){yield*ne.objects(e,t,A,r[0],i);let n=r.slice(1);if(n.length){let r=ne.blankNode();yield new re(t,C,r,e),yield*ne.collection(e,r,n,i)}else yield new re(t,C,$,e)},*objects(e,t,r,i,n,s=!1){let o=typeof i;switch(o){case"string":yield new re(t,r,ne.c1(i,n),e);break;case"number":yield new re(t,r,ne.number(i),e);break;case"object":if(Array.isArray(i))if(s){let s=ne.blankNode();yield new re(t,r,s,e),yield*ne.collection(e,s,i,n)}else for(let s of i)yield*ne.objects(e,t,r,s,n,!0);else{let s=ne.blankNode();yield new re(t,r,s,e),yield*ne.pairs(e,s,i,n)}break;default:throw new Error("invalid object type: "+typeof i)}},from:{term(e){return null===e||e.isGraphyTerm?e:ne.from.rdfjs_term(e)},quad(e){if(null===e)return e;if(e.isGraphyQuad)return e;let t=ne.from;return new re(t.rdfjs_term(e.subject),t.rdfjs_term(e.predicate),t.rdfjs_term(e.object),e.graph?t.rdfjs_term(e.graph):te)},rdfjs_term(e){switch(e.termType){case"NamedNode":return new x(e.value);case"BlankNode":return new Z(e.value);case"Literal":return ne.literal(e.value,e.language?e.language:e.datatype?new x(e.datatype.value):null);case"DefaultGraph":return new Q;default:throw new TypeError(`invalid termType: ${e.termType}`)}},sparql_result(e){switch(e.type){case"uri":return new x(e.value);case"literal":case"typed-literal":return"xml:lang"in e?new D(e.value,e["xml:lang"]):"datatype"in e&&"http://www.w3.org/2001/XMLSchema#string"!==e.datatype?new N(e.value,new x(e.datatype)):new j(e.value);case"bnode":return new Z(e.value);default:throw new Error(`unexpected SPARQL Result JSON Format Term type: ${e.type}`)}}},to:{boolean:e=>W.from(e),integer:e=>F.from(e),decimal:e=>U.from(e),double:e=>V.from(e)},comment(e={}){return`\`[${f()}]${JSON.stringify({...e,type:"comment"})}`},newlines(){return`\`[${f()}]{"type":"newlines"}`},config(e){if("string"!==typeof e)throw new TypeError("Expected 'key' argument to be a string, instead found "+typeof e);return`\`[${f()}]{"type":"config","value":${JSON.stringify(e)}}`},hash(e){let t=ne.from.quad(e),r=i.createHash("sha256");return r.update(t.verbose()),r.digest("hex")},cache_prefixes:v,cachePrefixes:v,terse:y,clean_iri:o,cleanIri:o,$_PREFIX_CACHE:p};Object.assign(ne,{c3:ne.triples,c4:ne.quads,fromTerm:ne.from.term,fromQuad:ne.from.quad})},81656:function(e,t,r){"use strict";function i(e,t,r,i,n,s,o,a){var l,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=r,u._compiled=!0),i&&(u.functional=!0),s&&(u._scopeId="data-v-"+s),o?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=l):n&&(l=a?function(){n.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:n),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(e,t){return l.call(t),c(e,t)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:u}}r.d(t,{A:function(){return i}})},7849:function(e,t,r){"use strict";const{SymbolDispose:i}=r(36152),{AbortError:n,codes:s}=r(16653),{isNodeStream:o,isWebStream:a,kControllerErrorFunction:l}=r(98825),u=r(34756),{ERR_INVALID_ARG_TYPE:c}=s;let h;const d=(e,t)=>{if("object"!==typeof e||!("aborted"in e))throw new c(t,"AbortSignal",e)};e.exports.addAbortSignal=function(t,r){if(d(t,"signal"),!o(r)&&!a(r))throw new c("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 s=o(t)?()=>{t.destroy(new n(void 0,{cause:e.reason}))}:()=>{t[l](new n(void 0,{cause:e.reason}))};if(e.aborted)s();else{h=h||r(23774).addAbortListener;const n=h(e,s);u(t,n[i])}return t}},76491:function(e,t,r){"use strict";const{StringPrototypeSlice:i,SymbolIterator:n,TypedArrayPrototypeSet:s,Uint8Array:o}=r(36152),{Buffer:a}=r(48287),{inspect:l}=r(23774);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;while(null!==(t=t.next))r+=e+t.data;return r}concat(e){if(0===this.length)return a.alloc(0);const t=a.allocUnsafe(e>>>0);let r=this.head,i=0;while(r)s(t,r.data,i),i+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(es.length)){e===s.length?(t+=s,++n,r.next?this.head=r.next:this.head=this.tail=null):(t+=i(s,0,e),this.head=r,r.data=i(s,e));break}t+=s,e-=s.length,++n}while(null!==(r=r.next));return this.length-=n,t}_getBuffer(e){const t=a.allocUnsafe(e),r=e;let i=this.head,n=0;do{const a=i.data;if(!(e>a.length)){e===a.length?(s(t,a,r-e),++n,i.next?this.head=i.next:this.head=this.tail=null):(s(t,new o(a.buffer,a.byteOffset,e),r-e),this.head=i,i.data=a.slice(e));break}s(t,a,r-e),e-=a.length,++n}while(null!==(i=i.next));return this.length-=n,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},57123:function(e,t,r){"use strict";const{pipeline:i}=r(27944),n=r(84656),{destroyer:s}=r(91582),{isNodeStream:o,isReadable:a,isWritable:l,isWebStream:u,isTransformStream:c,isWritableStream:h,isReadableStream:d}=r(98825),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:m}}=r(16653),g=r(34756);e.exports=function(...e){if(0===e.length)throw new m("streams");if(1===e.length)return n.from(e[0]);const t=[...e];if("function"===typeof e[0]&&(e[0]=n.from(e[0])),"function"===typeof e[e.length-1]){const t=e.length-1;e[t]=n.from(e[t])}for(let i=0;i0&&!(l(e[i])||h(e[i])||c(e[i])))throw new p(`streams[${i}]`,t[i],"must be writable")}let r,v,y,b,w;function _(e){const t=b;b=null,t?t(e):e?w.destroy(e):M||S||w.destroy()}const k=e[0],x=i(e,_),S=!!(l(k)||h(k)||c(k)),M=!!(a(x)||d(x)||c(x));if(w=new n({writableObjectMode:!(null===k||void 0===k||!k.writableObjectMode),readableObjectMode:!(null===x||void 0===x||!x.readableObjectMode),writable:S,readable:M}),S){if(o(k))w._write=function(e,t,i){k.write(e,t)?i():r=i},w._final=function(e){k.end(),v=e},k.on("drain",(function(){if(r){const e=r;r=null,e()}}));else if(u(k)){const e=c(k)?k.writable:k,t=e.getWriter();w._write=async function(e,r,i){try{await t.ready,t.write(e).catch((()=>{})),i()}catch(err){i(err)}},w._final=async function(e){try{await t.ready,t.close().catch((()=>{})),v=e}catch(err){e(err)}}}const e=c(x)?x.readable:x;g(e,(()=>{if(v){const e=v;v=null,e()}}))}if(M)if(o(x))x.on("readable",(function(){if(y){const e=y;y=null,e()}})),x.on("end",(function(){w.push(null)})),w._read=function(){while(1){const e=x.read();if(null===e)return void(y=w._read);if(!w.push(e))return}};else if(u(x)){const e=c(x)?x.readable:x,t=e.getReader();w._read=async function(){while(1)try{const{value:e,done:r}=await t.read();if(!w.push(e))return;if(r)return void w.push(null)}catch{return}}}return w._destroy=function(e,t){e||null===b||(e=new f),y=null,r=null,v=null,null===b?t(e):(b=t,o(x)&&s(x,e))},w}},91582:function(e,t,r){"use strict";const i=r(65606),{aggregateTwoErrors:n,codes:{ERR_MULTIPLE_CALLBACK:s},AbortError:o}=r(16653),{Symbol:a}=r(36152),{kIsDestroyed:l,isDestroyed:u,isFinished:c,isServerRequest:h}=r(98825),d=a("kDestroy"),f=a("kConstruct");function p(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function m(e,t){const r=this._readableState,i=this._writableState,s=i||r;return null!==i&&void 0!==i&&i.destroyed||null!==r&&void 0!==r&&r.destroyed?("function"===typeof t&&t(),this):(p(e,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),s.constructed?g(this,e,t):this.once(d,(function(r){g(this,n(r,e),t)})),this)}function g(e,t,r){let n=!1;function s(t){if(n)return;n=!0;const s=e._readableState,o=e._writableState;p(t,o,s),o&&(o.closed=!0),s&&(s.closed=!0),"function"===typeof r&&r(t),t?i.nextTick(v,e,t):i.nextTick(y,e)}try{e._destroy(t||null,s)}catch(t){s(t)}}function v(e,t){b(e,t),y(e)}function y(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!==r&&void 0!==r&&r.emitClose||null!==t&&void 0!==t&&t.emitClose)&&e.emit("close")}function b(e,t){const r=e._readableState,i=e._writableState;null!==i&&void 0!==i&&i.errorEmitted||null!==r&&void 0!==r&&r.errorEmitted||(i&&(i.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function w(){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)}function _(e,t,r){const n=e._readableState,s=e._writableState;if(null!==s&&void 0!==s&&s.destroyed||null!==n&&void 0!==n&&n.destroyed)return this;null!==n&&void 0!==n&&n.autoDestroy||null!==s&&void 0!==s&&s.autoDestroy?e.destroy(t):t&&(t.stack,s&&!s.errored&&(s.errored=t),n&&!n.errored&&(n.errored=t),r?i.nextTick(b,e,t):b(e,t))}function k(e,t){if("function"!==typeof e._construct)return;const r=e._readableState,n=e._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),e.once(f,t),e.listenerCount(f)>1||i.nextTick(x,e)}function x(e){let t=!1;function r(r){if(t)return void _(e,null!==r&&void 0!==r?r:new s);t=!0;const n=e._readableState,o=e._writableState,a=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),a.destroyed?e.emit(d,r):r?_(e,r,!0):i.nextTick(S,e)}try{e._construct((e=>{i.nextTick(r,e)}))}catch(err){i.nextTick(r,err)}}function S(e){e.emit(f)}function M(e){return(null===e||void 0===e?void 0:e.setHeader)&&"function"===typeof e.abort}function E(e){e.emit("close")}function A(e,t){e.emit("error",t),i.nextTick(E,e)}function C(e,t){e&&!u(e)&&(t||c(e)||(t=new o),h(e)?(e.socket=null,e.destroy(t)):M(e)?e.abort():M(e.req)?e.req.abort():"function"===typeof e.destroy?e.destroy(t):"function"===typeof e.close?e.close():t?i.nextTick(A,e,t):i.nextTick(E,e),e.destroyed||(e[l]=!0))}e.exports={construct:k,destroyer:C,destroy:m,undestroy:w,errorOrDestroy:_}},84656:function(e,t,r){"use strict";const{ObjectDefineProperties:i,ObjectGetOwnPropertyDescriptor:n,ObjectKeys:s,ObjectSetPrototypeOf:o}=r(36152);e.exports=u;const a=r(21878),l=r(49498);o(u.prototype,a.prototype),o(u,a);{const e=s(l.prototype);for(let t=0;t{h=!1,e&&y(t,e),d(e)})),u._write=function(e,t,n){r.write(e,t)?n():i=n},u._final=function(e){r.end(),n=e},r.on("drain",(function(){if(i){const e=i;i=null,e()}})),r.on("finish",(function(){if(n){const e=n;n=null,e()}}))),c&&(p(t,(e=>{c=!1,e&&y(t,e),d(e)})),t.on("readable",(function(){if(a){const e=a;a=null,e()}})),t.on("end",(function(){u.push(null)})),u._read=function(){while(1){const e=t.read();if(null===e)return void(a=u._read);if(!u.push(e))return}}),u._destroy=function(e,s){e||null===l||(e=new m),a=null,i=null,n=null,null===l?s(e):(l=s,y(r,e),y(t,e))},u}e.exports=function e(t,r){if(h(t))return t;if(u(t))return O({readable:t});if(c(t))return O({writable:t});if(l(t))return O({writable:!1,readable:!1});if(d(t))return O({readable:w.fromWeb(t)});if(f(t))return O({writable:_.fromWeb(t)});if("function"===typeof t){const{value:e,write:n,final:s,destroy:o}=$(t);if(a(e))return x(C,e,{objectMode:!0,write:n,final:s,destroy:o});const l=null===e||void 0===e?void 0:e.then;if("function"===typeof l){let t;const r=A(l,e,(e=>{if(null!=e)throw new v("nully","body",e)}),(e=>{y(t,e)}));return t=new C({objectMode:!0,readable:!1,write:n,final(e){s((async()=>{try{await r,i.nextTick(e,null)}catch(err){i.nextTick(e,err)}}))},destroy:o})}throw new v("Iterable, AsyncIterable or AsyncFunction",r,e)}if(M(t))return e(t.arrayBuffer());if(a(t))return x(C,t,{objectMode:!0,writable:!1});if(d(null===t||void 0===t?void 0:t.readable)&&f(null===t||void 0===t?void 0:t.writable))return C.fromWeb(t);if("object"===typeof(null===t||void 0===t?void 0:t.writable)||"object"===typeof(null===t||void 0===t?void 0:t.readable)){const r=null!==t&&void 0!==t&&t.readable?u(null===t||void 0===t?void 0:t.readable)?null===t||void 0===t?void 0:t.readable:e(t.readable):void 0,i=null!==t&&void 0!==t&&t.writable?c(null===t||void 0===t?void 0:t.writable)?null===t||void 0===t?void 0:t.writable:e(t.writable):void 0;return O({readable:r,writable:i})}const n=null===t||void 0===t?void 0:t.then;if("function"===typeof n){let e;return A(n,t,(t=>{null!=t&&e.push(t),e.push(null)}),(t=>{y(e,t)})),e=new C({objectMode:!0,writable:!1,read(){}})}throw new g(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},34756:function(e,t,r){const i=r(65606),{AbortError:n,codes:s}=r(16653),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_PREMATURE_CLOSE:a}=s,{kEmptyObject:l,once:u}=r(23774),{validateAbortSignal:c,validateFunction:h,validateObject:d,validateBoolean:f}=r(82091),{Promise:p,PromisePrototypeThen:m,SymbolDispose:g}=r(36152),{isClosed:v,isReadable:y,isReadableNodeStream:b,isReadableStream:w,isReadableFinished:_,isReadableErrored:k,isWritable:x,isWritableNodeStream:S,isWritableStream:M,isWritableFinished:E,isWritableErrored:A,isNodeStream:C,willEmitClose:$,kIsClosedPromise:O}=r(98825);let P;function T(e){return e.setHeader&&"function"===typeof e.abort}const I=()=>{};function D(e,t,s){var f,p;if(2===arguments.length?(s=t,t=l):null==t?t=l:d(t,"options"),h(s,"callback"),c(t.signal,"options.signal"),s=u(s),w(e)||M(e))return L(e,t,s);if(!C(e))throw new o("stream",["ReadableStream","WritableStream","Stream"],e);const m=null!==(f=t.readable)&&void 0!==f?f:b(e),O=null!==(p=t.writable)&&void 0!==p?p:S(e),D=e._writableState,N=e._readableState,R=()=>{e.writable||F()};let j=$(e)&&b(e)===m&&S(e)===O,B=E(e,!1);const F=()=>{B=!0,e.destroyed&&(j=!1),(!j||e.readable&&!m)&&(m&&!z||s.call(e))};let z=_(e,!1);const V=()=>{z=!0,e.destroyed&&(j=!1),(!j||e.writable&&!O)&&(O&&!B||s.call(e))},q=t=>{s.call(e,t)};let U=v(e);const H=()=>{U=!0;const t=A(e)||k(e);return t&&"boolean"!==typeof t?s.call(e,t):m&&!z&&b(e,!0)&&!_(e,!1)?s.call(e,new a):!O||B||E(e,!1)?void s.call(e):s.call(e,new a)},W=()=>{U=!0;const t=A(e)||k(e);if(t&&"boolean"!==typeof t)return s.call(e,t);s.call(e)},K=()=>{e.req.on("finish",F)};T(e)?(e.on("complete",F),j||e.on("abort",H),e.req?K():e.on("request",K)):O&&!D&&(e.on("end",R),e.on("close",R)),j||"boolean"!==typeof e.aborted||e.on("aborted",H),e.on("end",V),e.on("finish",F),!1!==t.error&&e.on("error",q),e.on("close",H),U?i.nextTick(H):null!==D&&void 0!==D&&D.errorEmitted||null!==N&&void 0!==N&&N.errorEmitted?j||i.nextTick(W):(m||j&&!y(e)||!B&&!1!==x(e))&&(O||j&&!x(e)||!z&&!1!==y(e))?N&&e.req&&e.aborted&&i.nextTick(W):i.nextTick(W);const Y=()=>{s=I,e.removeListener("aborted",H),e.removeListener("complete",F),e.removeListener("abort",H),e.removeListener("request",K),e.req&&e.req.removeListener("finish",F),e.removeListener("end",R),e.removeListener("close",R),e.removeListener("finish",F),e.removeListener("end",V),e.removeListener("error",q),e.removeListener("close",H)};if(t.signal&&!U){const o=()=>{const r=s;Y(),r.call(e,new n(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)i.nextTick(o);else{P=P||r(23774).addAbortListener;const i=P(t.signal,o),n=s;s=u(((...t)=>{i[g](),n.apply(e,t)}))}}return Y}function L(e,t,s){let o=!1,a=I;if(t.signal)if(a=()=>{o=!0,s.call(e,new n(void 0,{cause:t.signal.reason}))},t.signal.aborted)i.nextTick(a);else{P=P||r(23774).addAbortListener;const i=P(t.signal,a),n=s;s=u(((...t)=>{i[g](),n.apply(e,t)}))}const l=(...t)=>{o||i.nextTick((()=>s.apply(e,t)))};return m(e[O].promise,l,l),I}function N(e,t){var r;let i=!1;return null===t&&(t=l),null!==(r=t)&&void 0!==r&&r.cleanup&&(f(t.cleanup,"cleanup"),i=t.cleanup),new p(((r,n)=>{const s=D(e,t,(e=>{i&&s(),e?n(e):r()}))}))}e.exports=D,e.exports.finished=N},3854:function(e,t,r){"use strict";const i=r(65606),{PromisePrototypeThen:n,SymbolAsyncIterator:s,SymbolIterator:o}=r(36152),{Buffer:a}=r(48287),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:u}=r(16653).codes;function c(e,t,r){let c,h;if("string"===typeof t||t instanceof a)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});if(t&&t[s])h=!0,c=t[s]();else{if(!t||!t[o])throw new l("iterable",["Iterable"],t);h=!1,c=t[o]()}const d=new e({objectMode:!0,highWaterMark:1,...r});let f=!1;async function p(e){const t=void 0!==e&&null!==e,r="function"===typeof c.throw;if(t&&r){const{value:t,done:r}=await c.throw(e);if(await t,r)return}if("function"===typeof c.return){const{value:e}=await c.return();await e}}async function m(){for(;;){try{const{value:e,done:t}=h?await c.next():c.next();if(t)d.push(null);else{const t=e&&"function"===typeof e.then?await e:e;if(null===t)throw f=!1,new u;if(d.push(t))continue;f=!1}}catch(err){d.destroy(err)}break}}return d._read=function(){f||(f=!0,m())},d._destroy=function(e,t){n(p(e),(()=>i.nextTick(t,e)),(r=>i.nextTick(t,r||e)))},d}e.exports=c},33137:function(e,t,r){"use strict";const{ArrayIsArray:i,ObjectSetPrototypeOf:n}=r(36152),{EventEmitter:s}=r(37007);function o(e){s.call(this,e)}function a(e,t,r){if("function"===typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?i(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}n(o.prototype,s.prototype),n(o,s),o.prototype.pipe=function(e,t){const r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function n(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",n),e._isStdio||t&&!1===t.end||(r.on("end",l),r.on("close",u));let o=!1;function l(){o||(o=!0,e.end())}function u(){o||(o=!0,"function"===typeof e.destroy&&e.destroy())}function c(e){h(),0===s.listenerCount(this,"error")&&this.emit("error",e)}function h(){r.removeListener("data",i),e.removeListener("drain",n),r.removeListener("end",l),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",h),r.removeListener("close",h),e.removeListener("close",h)}return a(r,"error",c),a(e,"error",c),r.on("end",h),r.on("close",h),e.on("close",h),e.emit("pipe",r),e},e.exports={Stream:o,prependListener:a}},5589:function(e,t,r){"use strict";const i=globalThis.AbortController||r(25568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:n,ERR_INVALID_ARG_TYPE:s,ERR_MISSING_ARGS:o,ERR_OUT_OF_RANGE:a},AbortError:l}=r(16653),{validateAbortSignal:u,validateInteger:c,validateObject:h}=r(82091),d=r(36152).Symbol("kWeak"),f=r(36152).Symbol("kResistStopPropagation"),{finished:p}=r(34756),m=r(57123),{addAbortSignalNoValidate:g}=r(7849),{isWritable:v,isNodeStream:y}=r(98825),{deprecate:b}=r(23774),{ArrayPrototypePush:w,Boolean:_,MathFloor:k,Number:x,NumberIsNaN:S,Promise:M,PromiseReject:E,PromiseResolve:A,PromisePrototypeThen:C,Symbol:$}=r(36152),O=$("kEmpty"),P=$("kEof");function T(e,t){if(null!=t&&h(t,"options"),null!=(null===t||void 0===t?void 0:t.signal)&&u(t.signal,"options.signal"),y(e)&&!v(e))throw new n("stream",e,"must be writable");const r=m(this,e);return null!==t&&void 0!==t&&t.signal&&g(t.signal,r),r}function I(e,t){if("function"!==typeof e)throw new s("fn",["Function","AsyncFunction"],e);null!=t&&h(t,"options"),null!=(null===t||void 0===t?void 0:t.signal)&&u(t.signal,"options.signal");let i=1;null!=(null===t||void 0===t?void 0:t.concurrency)&&(i=k(t.concurrency));let n=i-1;return null!=(null===t||void 0===t?void 0:t.highWaterMark)&&(n=k(t.highWaterMark)),c(i,"options.concurrency",1),c(n,"options.highWaterMark",0),n+=i,async function*(){const s=r(23774).AbortSignalAny([null===t||void 0===t?void 0:t.signal].filter(_)),o=this,a=[],u={signal:s};let c,h,d=!1,f=0;function p(){d=!0,m()}function m(){f-=1,g()}function g(){h&&!d&&f=n||f>=i)&&await new M((e=>{h=e}))}a.push(P)}catch(err){const t=E(err);C(t,m,p),a.push(t)}finally{d=!0,c&&(c(),c=null)}}v();try{while(1){while(a.length>0){const e=await a[0];if(e===P)return;if(s.aborted)throw new l;e!==O&&(yield e),a.shift(),g()}await new M((e=>{c=e}))}}finally{d=!0,h&&(h(),h=null)}}.call(this)}function D(e=void 0){return null!=e&&h(e,"options"),null!=(null===e||void 0===e?void 0:e.signal)&&u(e.signal,"options.signal"),async function*(){let t=0;for await(const i of this){var r;if(null!==e&&void 0!==e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l({cause:e.signal.reason});yield[t++,i]}}.call(this)}async function L(e,t=void 0){for await(const r of B.call(this,e,t))return!0;return!1}async function N(e,t=void 0){if("function"!==typeof e)throw new s("fn",["Function","AsyncFunction"],e);return!await L.call(this,(async(...t)=>!await e(...t)),t)}async function R(e,t){for await(const r of B.call(this,e,t))return r}async function j(e,t){if("function"!==typeof e)throw new s("fn",["Function","AsyncFunction"],e);async function r(t,r){return await e(t,r),O}for await(const i of I.call(this,r,t));}function B(e,t){if("function"!==typeof e)throw new s("fn",["Function","AsyncFunction"],e);async function r(t,r){return await e(t,r)?t:O}return I.call(this,r,t)}class F extends o{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function z(e,t,r){var n;if("function"!==typeof e)throw new s("reducer",["Function","AsyncFunction"],e);null!=r&&h(r,"options"),null!=(null===r||void 0===r?void 0:r.signal)&&u(r.signal,"options.signal");let o=arguments.length>1;if(null!==r&&void 0!==r&&null!==(n=r.signal)&&void 0!==n&&n.aborted){const e=new l(void 0,{cause:r.signal.reason});throw this.once("error",(()=>{})),await p(this.destroy(e)),e}const a=new i,c=a.signal;if(null!==r&&void 0!==r&&r.signal){const e={once:!0,[d]:this,[f]:!0};r.signal.addEventListener("abort",(()=>a.abort()),e)}let m=!1;try{for await(const i of this){var g;if(m=!0,null!==r&&void 0!==r&&null!==(g=r.signal)&&void 0!==g&&g.aborted)throw new l;o?t=await e(t,i,{signal:c}):(t=i,o=!0)}if(!m&&!o)throw new F}finally{a.abort()}return t}async function V(e){null!=e&&h(e,"options"),null!=(null===e||void 0===e?void 0:e.signal)&&u(e.signal,"options.signal");const t=[];for await(const i of this){var r;if(null!==e&&void 0!==e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l(void 0,{cause:e.signal.reason});w(t,i)}return t}function q(e,t){const r=I.call(this,e,t);return async function*(){for await(const e of r)yield*e}.call(this)}function U(e){if(e=x(e),S(e))return 0;if(e<0)throw new a("number",">= 0",e);return e}function H(e,t=void 0){return null!=t&&h(t,"options"),null!=(null===t||void 0===t?void 0:t.signal)&&u(t.signal,"options.signal"),e=U(e),async function*(){var r;if(null!==t&&void 0!==t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const n of this){var i;if(null!==t&&void 0!==t&&null!==(i=t.signal)&&void 0!==i&&i.aborted)throw new l;e--<=0&&(yield n)}}.call(this)}function W(e,t=void 0){return null!=t&&h(t,"options"),null!=(null===t||void 0===t?void 0:t.signal)&&u(t.signal,"options.signal"),e=U(e),async function*(){var r;if(null!==t&&void 0!==t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const n of this){var i;if(null!==t&&void 0!==t&&null!==(i=t.signal)&&void 0!==i&&i.aborted)throw new l;if(e-- >0&&(yield n),e<=0)return}}.call(this)}e.exports.streamReturningOperators={asIndexedPairs:b(D,"readable.asIndexedPairs will be removed in a future version."),drop:H,filter:B,flatMap:q,map:I,take:W,compose:T},e.exports.promiseReturningOperators={every:N,forEach:j,reduce:z,toArray:V,some:L,find:R}},15122:function(e,t,r){"use strict";const{ObjectSetPrototypeOf:i}=r(36152);e.exports=s;const n=r(82112);function s(e){if(!(this instanceof s))return new s(e);n.call(this,e)}i(s.prototype,n.prototype),i(s,n),s.prototype._transform=function(e,t,r){r(null,e)}},27944:function(e,t,r){const i=r(65606),{ArrayIsArray:n,Promise:s,SymbolAsyncIterator:o,SymbolDispose:a}=r(36152),l=r(34756),{once:u}=r(23774),c=r(91582),h=r(84656),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:v},AbortError:y}=r(16653),{validateFunction:b,validateAbortSignal:w}=r(82091),{isIterable:_,isReadable:k,isReadableNodeStream:x,isNodeStream:S,isTransformStream:M,isWebStream:E,isReadableStream:A,isReadableFinished:C}=r(98825),$=globalThis.AbortController||r(25568).AbortController;let O,P,T;function I(e,t,r){let i=!1;e.on("close",(()=>{i=!0}));const n=l(e,{readable:t,writable:r},(e=>{i=!e}));return{destroy:t=>{i||(i=!0,c.destroyer(e,t||new g("pipe")))},cleanup:n}}function D(e){return b(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function L(e){if(_(e))return e;if(x(e))return N(e);throw new f("val",["Readable","Iterable","AsyncIterable"],e)}async function*N(e){P||(P=r(21878)),yield*P.prototype[o].call(e)}async function R(e,t,r,{end:i}){let n,o=null;const a=e=>{if(e&&(n=e),o){const e=o;o=null,e()}},u=()=>new s(((e,t)=>{n?t(n):o=()=>{n?t(n):e()}}));t.on("drain",a);const c=l(t,{readable:!1},a);try{t.writableNeedDrain&&await u();for await(const r of e)t.write(r)||await u();i&&(t.end(),await u()),r()}catch(err){r(n!==err?d(n,err):err)}finally{c(),t.off("drain",a)}}async function j(e,t,r,{end:i}){M(t)&&(t=t.writable);const n=t.getWriter();try{for await(const t of e)await n.ready,n.write(t).catch((()=>{}));await n.ready,i&&await n.close(),r()}catch(err){try{await n.abort(err),r(err)}catch(err){r(err)}}}function B(...e){return F(e,u(D(e)))}function F(e,t,s){if(1===e.length&&n(e[0])&&(e=e[0]),e.length<2)throw new m("streams");const o=new $,l=o.signal,u=null===s||void 0===s?void 0:s.signal,c=[];function d(){B(new y)}let g,v,b;w(u,"options.signal"),T=T||r(23774).addAbortListener,u&&(g=T(u,d));const C=[];let P,D=0;function N(e){B(e,0===--D)}function B(e,r){var n;if(!e||v&&"ERR_STREAM_PREMATURE_CLOSE"!==v.code||(v=e),v||r){while(C.length)C.shift()(v);null===(n=g)||void 0===n||n[a](),o.abort(),r&&(v||c.forEach((e=>e())),i.nextTick(t,v,b))}}for(let U=0;U0,Y=W||!1!==(null===s||void 0===s?void 0:s.end),G=U===e.length-1;if(S(H)){if(Y){const{destroy:Z,cleanup:J}=I(H,W,K);C.push(Z),k(H)&&G&&c.push(J)}function F(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&N(e)}H.on("error",F),k(H)&&G&&c.push((()=>{H.removeListener("error",F)}))}if(0===U)if("function"===typeof H){if(P=H({signal:l}),!_(P))throw new p("Iterable, AsyncIterable or Stream","source",P)}else P=_(H)||x(H)||M(H)?H:h.from(H);else if("function"===typeof H){var V;if(M(P))P=L(null===(V=P)||void 0===V?void 0:V.readable);else P=L(P);if(P=H(P,{signal:l}),W){if(!_(P,!0))throw new p("AsyncIterable",`transform[${U-1}]`,P)}else{var q;O||(O=r(15122));const X=new O({objectMode:!0}),Q=null===(q=P)||void 0===q?void 0:q.then;if("function"===typeof Q)D++,Q.call(P,(e=>{b=e,null!=e&&X.write(e),Y&&X.end(),i.nextTick(N)}),(e=>{X.destroy(e),i.nextTick(N,e)}));else if(_(P,!0))D++,R(P,X,N,{end:Y});else{if(!A(P)&&!M(P))throw new p("AsyncIterable or Promise","destination",P);{const re=P.readable||P;D++,R(re,X,N,{end:Y})}}P=X;const{destroy:ee,cleanup:te}=I(P,!1,!0);C.push(ee),G&&c.push(te)}}else if(S(H)){if(x(P)){D+=2;const ie=z(P,H,N,{end:Y});k(H)&&G&&c.push(ie)}else if(M(P)||A(P)){const ne=P.readable||P;D++,R(ne,H,N,{end:Y})}else{if(!_(P))throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],P);D++,R(P,H,N,{end:Y})}P=H}else if(E(H)){if(x(P))D++,j(L(P),H,N,{end:Y});else if(A(P)||_(P))D++,j(P,H,N,{end:Y});else{if(!M(P))throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],P);D++,j(P.readable,H,N,{end:Y})}P=H}else P=h.from(H)}return(null!==l&&void 0!==l&&l.aborted||null!==u&&void 0!==u&&u.aborted)&&i.nextTick(d),P}function z(e,t,r,{end:n}){let s=!1;if(t.on("close",(()=>{s||r(new v)})),e.pipe(t,{end:!1}),n){function o(){s=!0,t.end()}C(e)?i.nextTick(o):e.once("end",o)}else r();return l(e,{readable:!0,writable:!1},(t=>{const i=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&i&&i.ended&&!i.errored&&!i.errorEmitted?e.once("end",r).once("error",r):r(t)})),l(t,{readable:!1,writable:!0},r)}e.exports={pipelineImpl:F,pipeline:B}},21878:function(e,t,r){const i=r(65606),{ArrayPrototypeIndexOf:n,NumberIsInteger:s,NumberIsNaN:o,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:u,ObjectSetPrototypeOf:c,Promise:h,SafeSet:d,SymbolAsyncDispose:f,SymbolAsyncIterator:p,Symbol:m}=r(36152);e.exports=ae,ae.ReadableState=oe;const{EventEmitter:g}=r(37007),{Stream:v,prependListener:y}=r(33137),{Buffer:b}=r(48287),{addAbortSignal:w}=r(7849),_=r(34756);let k=r(23774).debuglog("stream",(e=>{k=e}));const x=r(76491),S=r(91582),{getHighWaterMark:M,getDefaultHighWaterMark:E}=r(49809),{aggregateTwoErrors:A,codes:{ERR_INVALID_ARG_TYPE:C,ERR_METHOD_NOT_IMPLEMENTED:$,ERR_OUT_OF_RANGE:O,ERR_STREAM_PUSH_AFTER_EOF:P,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:T},AbortError:I}=r(16653),{validateObject:D}=r(82091),L=m("kPaused"),{StringDecoder:N}=r(83141),R=r(3854);c(ae.prototype,v.prototype),c(ae,v);const j=()=>{},{errorOrDestroy:B}=S,F=1,z=2,V=4,q=8,U=16,H=32,W=64,K=128,Y=256,G=512,Z=1024,J=2048,X=4096,Q=8192,ee=16384,te=32768,re=65536,ie=1<<17,ne=1<<18;function se(e){return{enumerable:!1,get(){return 0!==(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function oe(e,t,i){"boolean"!==typeof i&&(i=t instanceof r(84656)),this.state=J|X|U|H,e&&e.objectMode&&(this.state|=F),i&&e&&e.readableObjectMode&&(this.state|=F),this.highWaterMark=e?M(this,e,"readableHighWaterMark",i):E(!1),this.buffer=new x,this.length=0,this.pipes=[],this.flowing=null,this[L]=null,e&&!1===e.emitClose&&(this.state&=~J),e&&!1===e.autoDestroy&&(this.state&=~X),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new N(e.encoding),this.encoding=e.encoding)}function ae(e){if(!(this instanceof ae))return new ae(e);const t=this instanceof r(84656);this._readableState=new oe(e,this,t),e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&w(e.signal,this)),v.call(this,e),S.construct(this,(()=>{this._readableState.needReadable&&ge(this,this._readableState)}))}function le(e,t,r,i){k("readableAddChunk",t);const n=e._readableState;let s;if(0===(n.state&F)&&("string"===typeof t?(r=r||n.defaultEncoding,n.encoding!==r&&(i&&n.encoding?t=b.from(t,r).toString(n.encoding):(t=b.from(t,r),r=""))):t instanceof b?r="":v._isUint8Array(t)?(t=v._uint8ArrayToBuffer(t),r=""):null!=t&&(s=new C("chunk",["string","Buffer","Uint8Array"],t))),s)B(e,s);else if(null===t)n.state&=~q,fe(e,n);else if(0!==(n.state&F)||t&&t.length>0)if(i)if(0!==(n.state&V))B(e,new T);else{if(n.destroyed||n.errored)return!1;ue(e,n,t,!0)}else if(n.ended)B(e,new P);else{if(n.destroyed||n.errored)return!1;n.state&=~q,n.decoder&&!r?(t=n.decoder.write(t),n.objectMode||0!==t.length?ue(e,n,t,!1):ge(e,n)):ue(e,n,t,!1)}else i||(n.state&=~q,ge(e,n));return!n.ended&&(n.length0?(0!==(t.state&re)?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),0!==(t.state&W)&&pe(e)),ge(e,t)}l(oe.prototype,{objectMode:se(F),ended:se(z),endEmitted:se(V),reading:se(q),constructed:se(U),sync:se(H),needReadable:se(W),emittedReadable:se(K),readableListening:se(Y),resumeScheduled:se(G),errorEmitted:se(Z),emitClose:se(J),autoDestroy:se(X),destroyed:se(Q),closed:se(ee),closeEmitted:se(te),multiAwaitDrain:se(re),readingMore:se(ie),dataEmitted:se(ne)}),ae.prototype.destroy=S.destroy,ae.prototype._undestroy=S.undestroy,ae.prototype._destroy=function(e,t){t(e)},ae.prototype[g.captureRejectionSymbol]=function(e){this.destroy(e)},ae.prototype[f]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new I,this.destroy(e)),new h(((t,r)=>_(this,(i=>i&&i!==e?r(i):t(null)))))},ae.prototype.push=function(e,t){return le(this,e,t,!1)},ae.prototype.unshift=function(e,t){return le(this,e,t,!0)},ae.prototype.isPaused=function(){const e=this._readableState;return!0===e[L]||!1===e.flowing},ae.prototype.setEncoding=function(e){const t=new N(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const r=this._readableState.buffer;let i="";for(const n of r)i+=t.write(n);return r.clear(),""!==i&&r.push(i),this._readableState.length=i.length,this};const ce=1073741824;function he(e){if(e>ce)throw new O("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}function de(e,t){return e<=0||0===t.length&&t.ended?0:0!==(t.state&F)?1:o(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function fe(e,t){if(k("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?pe(e):(t.needReadable=!1,t.emittedReadable=!0,me(e))}}function pe(e){const t=e._readableState;k("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(k("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(me,e))}function me(e){const t=e._readableState;k("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,xe(e)}function ge(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,i.nextTick(ve,e,t))}function ve(e,t){while(!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!1===t[L]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function we(e){k("readable nexttick read 0"),e.read(0)}function _e(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(ke,e,t))}function ke(e,t){k("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),xe(e),t.flowing&&!t.reading&&e.read(0)}function xe(e){const t=e._readableState;k("flow",t.flowing);while(t.flowing&&null!==e.read());}function Se(e,t){"function"!==typeof e.read&&(e=ae.wrap(e,{objectMode:!0}));const r=Me(e,t);return r.stream=e,r}async function*Me(e,t){let r,i=j;function n(t){this===e?(i(),i=j):i=t}e.on("readable",n);const s=_(e,{writable:!1},(e=>{r=e?A(r,e):null,i(),i=j}));try{while(1){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(r)throw r;if(null===r)return;await new h(n)}}}catch(err){throw r=A(r,err),r}finally{!r&&!1===(null===t||void 0===t?void 0:t.destroyOnReturn)||void 0!==r&&!e._readableState.autoDestroy?(e.off("readable",n),s()):S.destroyer(e,null)}}function Ee(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 Ae(e){const t=e._readableState;k("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(Ce,t,e))}function Ce(e,t){if(k("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)i.nextTick($e,t);else if(e.autoDestroy){const e=t._writableState,r=!e||e.autoDestroy&&(e.finished||!1===e.writable);r&&t.destroy()}}function $e(e){const t=e.writable&&!e.writableEnded&&!e.destroyed;t&&e.end()}let Oe;function Pe(){return void 0===Oe&&(Oe={}),Oe}ae.prototype.read=function(e){k("read",e),void 0===e?e=NaN:s(e)||(e=a(e,10));const t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=he(e)),0!==e&&(t.state&=~K),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return k("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?Ae(this):pe(this),null;if(e=de(e,t),0===e&&t.ended)return 0===t.length&&Ae(this),null;let i,n=0!==(t.state&W);if(k("need readable",n),(0===t.length||t.length-e0?Ee(e,t):null,null===i?(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&&Ae(this)),null===i||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",i)),i},ae.prototype._read=function(e){throw new $("_read()")},ae.prototype.pipe=function(e,t){const r=this,n=this._readableState;1===n.pipes.length&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new d(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(e),k("pipe count=%d opts=%j",n.pipes.length,t);const s=(!t||!1!==t.end)&&e!==i.stdout&&e!==i.stderr,o=s?l:b;function a(e,t){k("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,h())}function l(){k("onend"),e.end()}let u;n.endEmitted?i.nextTick(o):r.once("end",o),e.on("unpipe",a);let c=!1;function h(){k("cleanup"),e.removeListener("close",g),e.removeListener("finish",v),u&&e.removeListener("drain",u),e.removeListener("error",m),e.removeListener("unpipe",a),r.removeListener("end",l),r.removeListener("end",b),r.removeListener("data",p),c=!0,u&&n.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&u()}function f(){c||(1===n.pipes.length&&n.pipes[0]===e?(k("false write response, pause",0),n.awaitDrainWriters=e,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(e)&&(k("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(e)),r.pause()),u||(u=ye(r,e),e.on("drain",u))}function p(t){k("ondata");const r=e.write(t);k("dest.write",r),!1===r&&f()}function m(t){if(k("onerror",t),b(),e.removeListener("error",m),0===e.listenerCount("error")){const r=e._writableState||e._readableState;r&&!r.errorEmitted?B(e,t):e.emit("error",t)}}function g(){e.removeListener("finish",v),b()}function v(){k("onfinish"),e.removeListener("close",g),b()}function b(){k("unpipe"),r.unpipe(e)}return r.on("data",p),y(e,"error",m),e.once("close",g),e.once("finish",v),e.emit("pipe",r),!0===e.writableNeedDrain?f():n.flowing||(k("pipe resume"),r.resume()),e},ae.prototype.unpipe=function(e){const t=this._readableState,r={hasUnpiped:!1};if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,k("on readable",n.length,n.reading),n.length?pe(this):n.reading||i.nextTick(we,this))),r},ae.prototype.addListener=ae.prototype.on,ae.prototype.removeListener=function(e,t){const r=v.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(be,this),r},ae.prototype.off=ae.prototype.removeListener,ae.prototype.removeAllListeners=function(e){const t=v.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(be,this),t},ae.prototype.resume=function(){const e=this._readableState;return e.flowing||(k("resume"),e.flowing=!e.readableListening,_e(this,e)),e[L]=!1,this},ae.prototype.pause=function(){return k("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(k("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[L]=!0,this},ae.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=>{B(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 i=1;i{t?e?e(t):this.destroy(t):(null!=r&&this.push(r),this.push(null),e&&e())}))}function h(){this._final!==c&&c.call(this)}u.prototype._final=c,u.prototype._transform=function(e,t,r){throw new s("_transform()")},u.prototype._write=function(e,t,r){const i=this._readableState,n=this._writableState,s=i.length;this._transform(e,t,((e,t)=>{e?r(e):(null!=t&&this.push(t),n.ended||s===i.length||i.length{const e=this._writableState;e.writing||q(this,e),K(this,e)}))}function L(e,t,r,n){const s=e._writableState;if("function"===typeof r)n=r,r=s.defaultEncoding;else{if(r){if("buffer"!==r&&!m.isEncoding(r))throw new C(r)}else r=s.defaultEncoding;"function"!==typeof n&&(n=O)}if(null===t)throw new E;if(!s.objectMode)if("string"===typeof t)!1!==s.decodeStrings&&(t=m.from(t,r),r="buffer");else if(t instanceof m)r="buffer";else{if(!p._isUint8Array(t))throw new w("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),r="buffer"}let o;return s.ending?o=new A:s.destroyed&&(o=new S("write")),o?(i.nextTick(n,o),$(e,o,!0),o):(s.pendingcb++,N(e,s,t,r,n))}function N(e,t,r,i,n){const s=t.objectMode?1:r.length;t.length+=s;const o=t.lengthr.bufferedIndex&&q(e,r),n?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===s?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:s,stream:e,state:r},i.nextTick(F,r.afterWriteTickInfo)):z(e,r,1,s))):$(e,new k)}function F({stream:e,state:t,count:r,cb:i}){return t.afterWriteTickInfo=null,z(e,t,r,i)}function z(e,t,r,i){const n=!t.ending&&!e.destroyed&&0===t.length&&t.needDrain;n&&(t.needDrain=!1,e.emit("drain"));while(r-- >0)t.pendingcb--,i();t.destroyed&&V(t),K(e,t)}function V(e){if(e.writing)return;for(let n=e.bufferedIndex;n1&&e._writev){t.pendingcb-=o-1;const i=t.allNoop?O:e=>{for(let t=a;t256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function U(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function H(e,t){let r=!1;function n(n){if(r)$(e,null!==n&&void 0!==n?n:k());else if(r=!0,t.pendingcb--,n){const r=t[P].splice(0);for(let e=0;e{U(t)?Y(e,t):t.pendingcb--}),e,t)):U(t)&&(t.pendingcb++,Y(e,t))))}function Y(e,t){t.pendingcb--,t.finished=!0;const r=t[P].splice(0);for(let i=0;i>>0}const $=/^[0-7]+$/,O="must be a 32-bit unsigned integer or an octal string";function P(e,t,r){if("undefined"===typeof e&&(e=r),"string"===typeof e){if(null===f($,e))throw new w(t,e,O);e=h(e,8)}return D(e,t),e}const T=v(((e,t,r=c,i=u)=>{if("number"!==typeof e)throw new b(t,"number",e);if(!a(e))throw new _(t,"an integer",e);if(ei)throw new _(t,`>= ${r} && <= ${i}`,e)})),I=v(((e,t,r=-2147483648,i=2147483647)=>{if("number"!==typeof e)throw new b(t,"number",e);if(!a(e))throw new _(t,"an integer",e);if(ei)throw new _(t,`>= ${r} && <= ${i}`,e)})),D=v(((e,t,r=!1)=>{if("number"!==typeof e)throw new b(t,"number",e);if(!a(e))throw new _(t,"an integer",e);const i=r?1:0,n=4294967295;if(en)throw new _(t,`>= ${i} && <= ${n}`,e)}));function L(e,t){if("string"!==typeof e)throw new b(t,"string",e)}function N(e,t,r=void 0,i){if("number"!==typeof e)throw new b(t,"number",e);if(null!=r&&ei||(null!=r||null!=i)&&l(e))throw new _(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=i?" && ":""}${null!=i?`<= ${i}`:""}`,e)}const R=v(((e,t,r)=>{if(!n(r,e)){const i=s(o(r,(e=>"string"===typeof e?`'${e}'`:p(e))),", "),n="must be one of: "+i;throw new w(t,e,n)}}));function j(e,t){if("boolean"!==typeof e)throw new b(t,"boolean",e)}function B(e,t,r){return null!=e&&d(e,t)?e[t]:r}const F=v(((e,t,r=null)=>{const n=B(r,"allowArray",!1),s=B(r,"allowFunction",!1),o=B(r,"nullable",!1);if(!o&&null===e||!n&&i(e)||"object"!==typeof e&&(!s||"function"!==typeof e))throw new b(t,"Object",e)})),z=v(((e,t)=>{if(null!=e&&"object"!==typeof e&&"function"!==typeof e)throw new b(t,"a dictionary",e)})),V=v(((e,t,r=0)=>{if(!i(e))throw new b(t,"Array",e);if(e.length{if(!M(e))throw new b(t,["Buffer","TypedArray","DataView"],e)}));function Y(e,t){const r=x(t),i=e.length;if("hex"===r&&i%2!==0)throw new w("encoding",t,`is invalid for data of length ${i}`)}function G(e,t="Port",r=!0){if("number"!==typeof e&&"string"!==typeof e||"string"===typeof e&&0===g(e).length||+e!==+e>>>0||e>65535||0===e&&!r)throw new y(t,e,r);return 0|e}const Z=v(((e,t)=>{if(void 0!==e&&(null===e||"object"!==typeof e||!("aborted"in e)))throw new b(t,"AbortSignal",e)})),J=v(((e,t)=>{if("function"!==typeof e)throw new b(t,"Function",e)})),X=v(((e,t)=>{if("function"!==typeof e||S(e))throw new b(t,"Function",e)})),Q=v(((e,t)=>{if(void 0!==e)throw new b(t,"undefined",e)}));function ee(e,t,r){if(!n(r,e))throw new b(t,`('${s(r,"|")}')`,e)}const te=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function re(e,t){if("undefined"===typeof e||!f(te,e))throw new w(t,e,'must be an array or string of format "; rel=preload; as=style"')}function ie(e){if("string"===typeof e)return re(e,"hints"),e;if(i(e)){const t=e.length;let r="";if(0===t)return r;for(let i=0;i; rel=preload; as=style"')}e.exports={isInt32:A,isUint32:C,parseFileMode:P,validateArray:V,validateStringArray:q,validateBooleanArray:U,validateAbortSignalArray:H,validateBoolean:j,validateBuffer:K,validateDictionary:z,validateEncoding:Y,validateFunction:J,validateInt32:I,validateInteger:T,validateNumber:N,validateObject:F,validateOneOf:R,validatePlainFunction:X,validatePort:G,validateSignalName:W,validateString:L,validateUint32:D,validateUndefined:Q,validateUnion:ee,validateAbortSignal:Z,validateLinkHeaderValue:ie}},14088:function(e,t,r){"use strict";const i=r(66836),n=r(67673),s=i.Readable.destroy;e.exports=i.Readable,e.exports._uint8ArrayToBuffer=i._uint8ArrayToBuffer,e.exports._isUint8Array=i._isUint8Array,e.exports.isDisturbed=i.isDisturbed,e.exports.isErrored=i.isErrored,e.exports.isReadable=i.isReadable,e.exports.Readable=i.Readable,e.exports.Writable=i.Writable,e.exports.Duplex=i.Duplex,e.exports.Transform=i.Transform,e.exports.PassThrough=i.PassThrough,e.exports.addAbortSignal=i.addAbortSignal,e.exports.finished=i.finished,e.exports.destroy=i.destroy,e.exports.destroy=s,e.exports.pipeline=i.pipeline,e.exports.compose=i.compose,Object.defineProperty(i,"promises",{configurable:!0,enumerable:!0,get(){return n}}),e.exports.Stream=i.Stream,e.exports["default"]=e.exports},16653:function(e,t,r){"use strict";const{format:i,inspect:n,AggregateError:s}=r(23774),o=globalThis.AggregateError||s,a=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],u=/^([A-Z][a-z0-9]*)+$/,c="__node_internal_",h={};function d(e,t){if(!e)throw new h.ERR_INTERNAL_ASSERTION(t)}function f(e){let t="",r=e.length;const i="-"===e[0]?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function p(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 n=(t.match(/%[dfijoOs]/g)||[]).length;return d(n===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),0===r.length?t:i(t,...r)}function m(e,t,r){r||(r=Error);class i extends r{constructor(...r){super(p(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[a]=!0,h[e]=i}function g(e){const t=c+e.name;return Object.defineProperty(e,"name",{value:t}),e}function v(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}class y extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!==typeof t)throw new h.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}m("ERR_ASSERTION","%s",Error),m("ERR_INVALID_ARG_TYPE",((e,t,r)=>{d("string"===typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let i="The ";e.endsWith(" argument")?i+=`${e} `:i+=`"${e}" ${e.includes(".")?"property":"argument"} `,i+="must be ";const s=[],o=[],a=[];for(const n of t)d("string"===typeof n,"All expected entries have to be of type string"),l.includes(n)?s.push(n.toLowerCase()):u.test(n)?o.push(n):(d("object"!==n,'The value "object" should be written as "Object"'),a.push(n));if(o.length>0){const e=s.indexOf("object");-1!==e&&(s.splice(s,e,1),o.push("Object"))}if(s.length>0){switch(s.length){case 1:i+=`of type ${s[0]}`;break;case 2:i+=`one of type ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();i+=`one of type ${s.join(", ")}, or ${e}`}}(o.length>0||a.length>0)&&(i+=" or ")}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{const e=o.pop();i+=`an instance of ${o.join(", ")}, or ${e}`}}a.length>0&&(i+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(i+="an "),i+=`${a[0]}`;break;case 2:i+=`one of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();i+=`one of ${a.join(", ")}, or ${e}`}}if(null==r)i+=`. Received ${r}`;else if("function"===typeof r&&r.name)i+=`. Received function ${r.name}`;else if("object"===typeof r){var c;if(null!==(c=r.constructor)&&void 0!==c&&c.name)i+=`. Received an instance of ${r.constructor.name}`;else{const e=n(r,{depth:-1});i+=`. Received ${e}`}}else{let e=n(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),i+=`. Received type ${typeof r} (${e})`}return i}),TypeError),m("ERR_INVALID_ARG_VALUE",((e,t,r="is invalid")=>{let i=n(t);i.length>128&&(i=i.slice(0,128)+"...");const s=e.includes(".")?"property":"argument";return`The ${s} '${e}' ${r}. Received ${i}`}),TypeError),m("ERR_INVALID_RETURN_VALUE",((e,t,r)=>{var i;const n=null!==r&&void 0!==r&&null!==(i=r.constructor)&&void 0!==i&&i.name?`instance of ${r.constructor.name}`:"type "+typeof r;return`Expected ${e} to be returned from the "${t}" function but got ${n}.`}),TypeError),m("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`}break}return`${t} must be specified`}),TypeError),m("ERR_OUT_OF_RANGE",((e,t,r)=>{let i;return d(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32?i=f(String(r)):"bigint"===typeof r?(i=String(r),(r>2n**32n||r<-(2n**32n))&&(i=f(i)),i+="n"):i=n(r),`The value of "${e}" is out of range. It must be ${t}. Received ${i}`}),RangeError),m("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),m("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),m("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),m("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),m("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),m("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),m("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),m("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),m("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),m("ERR_STREAM_WRITE_AFTER_END","write after end",Error),m("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:y,aggregateTwoErrors:g(v),hideStackFrames:g,codes:h}},36152:function(e){"use strict";e.exports={ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error:Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number:Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise:Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String:String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol: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){return e.set(t,r)},Boolean:Boolean,Uint8Array:Uint8Array}},23774:function(e,t,r){"use strict";const i=r(48287),{kResistStopPropagation:n,SymbolDispose:s}=r(36152),o=globalThis.AbortSignal||r(25568).AbortSignal,a=globalThis.AbortController||r(25568).AbortController,l=Object.getPrototypeOf((async function(){})).constructor,u=globalThis.Blob||i.Blob,c="undefined"!==typeof u?function(e){return e instanceof u}:function(e){return!1},h=(e,t)=>{if(void 0!==e&&(null===e||"object"!==typeof e||!("aborted"in e)))throw new ERR_INVALID_ARG_TYPE(t,"AbortSignal",e)},d=(e,t)=>{if("function"!==typeof e)throw new ERR_INVALID_ARG_TYPE(t,"Function",e)};class f 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;r{e=r,t=i}));return{promise:r,resolve:e,reject:t}},promisify(e){return new Promise(((t,r)=>{e(((e,...i)=>e?r(e):t(...i)))}))},debuglog(){return function(){}},format(e,...t){return e.replace(/%([sdifj])/g,(function(...[e,r]){const i=t.shift();if("f"===r)return i.toFixed(6);if("j"===r)return JSON.stringify(i);if("s"===r&&"object"===typeof i){const e=i.constructor!==Object?i.constructor.name:"";return`${e} {}`.trim()}return i.toString()}))},inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},types:{isAsyncFunction(e){return e instanceof l},isArrayBufferView(e){return ArrayBuffer.isView(e)}},isBlob:c,deprecate(e,t){return e},addAbortListener:r(37007).addAbortListener||function(e,t){if(void 0===e)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);let r;return h(e,"signal"),d(t,"listener"),e.aborted?queueMicrotask((()=>t())):(e.addEventListener("abort",t,{__proto__:null,once:!0,[n]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[s](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:o.any||function(e){if(1===e.length)return e[0];const t=new a,r=()=>t.abort();return e.forEach((e=>{h(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")},66836:function(e,t,r){const{Buffer:i}=r(48287),{ObjectDefineProperty:n,ObjectKeys:s,ReflectApply:o}=r(36152),{promisify:{custom:a}}=r(23774),{streamReturningOperators:l,promiseReturningOperators:u}=r(5589),{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=r(16653),h=r(57123),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:f}=r(49809),{pipeline:p}=r(27944),{destroyer:m}=r(91582),g=r(34756),v=r(67673),y=r(98825),b=e.exports=r(33137).Stream;b.isDestroyed=y.isDestroyed,b.isDisturbed=y.isDisturbed,b.isErrored=y.isErrored,b.isReadable=y.isReadable,b.isWritable=y.isWritable,b.Readable=r(21878);for(const k of s(l)){const x=l[k];function w(...e){if(new.target)throw c();return b.Readable.from(o(x,this,e))}n(w,"name",{__proto__:null,value:x.name}),n(w,"length",{__proto__:null,value:x.length}),n(b.Readable.prototype,k,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}for(const S of s(u)){const M=u[S];function w(...e){if(new.target)throw c();return o(M,this,e)}n(w,"name",{__proto__:null,value:M.name}),n(w,"length",{__proto__:null,value:M.length}),n(b.Readable.prototype,S,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}b.Writable=r(49498),b.Duplex=r(84656),b.Transform=r(82112),b.PassThrough=r(15122),b.pipeline=p;const{addAbortSignal:_}=r(7849);b.addAbortSignal=_,b.finished=g,b.destroy=m,b.compose=h,b.setDefaultHighWaterMark=d,b.getDefaultHighWaterMark=f,n(b,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return v}}),n(p,a,{__proto__:null,enumerable:!0,get(){return v.pipeline}}),n(g,a,{__proto__:null,enumerable:!0,get(){return v.finished}}),b.Stream=b,b._isUint8Array=function(e){return e instanceof Uint8Array},b._uint8ArrayToBuffer=function(e){return i.from(e.buffer,e.byteOffset,e.byteLength)}},67673:function(e,t,r){"use strict";const{ArrayPrototypePop:i,Promise:n}=r(36152),{isIterable:s,isNodeStream:o,isWebStream:a}=r(98825),{pipelineImpl:l}=r(27944),{finished:u}=r(34756);function c(...e){return new n(((t,r)=>{let n,u;const c=e[e.length-1];if(c&&"object"===typeof c&&!o(c)&&!s(c)&&!a(c)){const t=i(e);n=t.signal,u=t.end}l(e,((e,i)=>{e?r(e):t(i)}),{signal:n,end:u})}))}r(66836),e.exports={finished:u,pipeline:c}},25568:function(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},14018:function(e,t){"use strict";function r(e,t){return{validate:e,compare:t}}function i(e){return e%4===0&&(e%100!==0||e%400===0)}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:r(o,a),time:r(u,c),"date-time":r(d,f),duration:/^P(?!$)((\d+Y)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._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0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json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:"number",validate:_},int64:{type:"number",validate:k},float:{type:"number",validate:x},double:{type:"number",validate:x},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(e){const t=n.exec(e);if(!t)return!1;const r=+t[1],o=+t[2],a=+t[3];return o>=1&&o<=12&&a>=1&&a<=(2===o&&i(r)?29:s[o])}function a(e,t){if(e&&t)return e>t?1:et?1:e=b}function k(e){return Number.isInteger(e)}function x(){return!0}const S=/[^\\]\\Z/;function M(e){if(S.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}},68182:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(14018),n=r(26461),s=r(93789),o=new s.Name("fullFormats"),a=new s.Name("fastFormats"),l=(e,t={keywords:!0})=>{if(Array.isArray(t))return u(e,t,i.fullFormats,o),e;const[r,s]="fast"===t.mode?[i.fastFormats,a]:[i.fullFormats,o],l=t.formats||i.formatNames;return u(e,l,r,s),t.keywords&&n.default(e),e};function u(e,t,r,i){var n,o;null!==(n=(o=e.opts.code).formats)&&void 0!==n||(o.formats=s._`require("ajv-formats/dist/formats").${i}`);for(const s of t)e.addFormat(s,r[s])}l.get=(e,t="full")=>{const r="fast"===t?i.fastFormats:i.fullFormats,n=r[e];if(!n)throw new Error(`Unknown format "${e}"`);return n},e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=l},26461:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const i=r(22394),n=r(93789),s=n.operators,o={formatMaximum:{okStr:"<=",ok:s.LTE,fail:s.GT},formatMinimum:{okStr:">=",ok:s.GTE,fail:s.LT},formatExclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},formatExclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}},a={message:({keyword:e,schemaCode:t})=>n.str`should be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>n._`{comparison: ${o[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:a,code(e){const{gen:t,data:r,schemaCode:s,keyword:a,it:l}=e,{opts:u,self:c}=l;if(!u.validateFormats)return;const h=new i.KeywordCxt(l,c.RULES.all.format.definition,"format");function d(){const r=t.scopeValue("formats",{ref:c.formats,code:u.code.formats}),i=t.const("fmt",n._`${r}[${h.schemaCode}]`);e.fail$data(n.or(n._`typeof ${i} != "object"`,n._`${i} instanceof RegExp`,n._`typeof ${i}.compare != "function"`,p(i)))}function f(){const r=h.schema,i=c.formats[r];if(!i||!0===i)return;if("object"!=typeof i||i instanceof RegExp||"function"!=typeof i.compare)throw new Error(`"${a}": format "${r}" does not define "compare" function`);const s=t.scopeValue("formats",{key:r,ref:i,code:u.code.formats?n._`${u.code.formats}${n.getProperty(r)}`:void 0});e.fail$data(p(s))}function p(e){return n._`${e}.compare(${r}, ${s}) ${o[a].fail} 0`}h.$data?d():f()},dependencies:["format"]};const l=e=>(e.addKeyword(t.formatLimitDefinition),e);t["default"]=l},22394:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const i=r(17666),n=r(4824),s=r(77013),o=r(92455),a=["/properties"],l="http://json-schema.org/draft-07/schema";class u extends i.default{_addVocabularies(){super._addVocabularies(),n.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=u;var c=r(69810);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var h=r(93789);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return h.CodeGen}});var d=r(99598);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var f=r(70303);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return f.default}})},72104:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class i extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=i;class n extends r{constructor(e){super(),this._items="string"===typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof i&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function s(e,...t){const r=[e[0]];let i=0;while(i"),GTE:new i._Code(">="),LT:new i._Code("<"),LTE:new i._Code("<="),EQ:new i._Code("==="),NEQ:new i._Code("!=="),NOT:new i._Code("!"),OR:new i._Code("||"),AND:new i._Code("&&"),ADD:new i._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends a{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const r=e?n.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=T(this.rhs,e,t)),this}get names(){return this.rhs instanceof i._CodeOrName?this.rhs.names:{}}}class u extends a{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof i.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=T(this.rhs,e,t),this}get names(){const e=this.lhs instanceof i.Name?{}:{...this.lhs.names};return P(e,this.rhs)}}class c extends u{constructor(e,t,r,i){super(e,r,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class h extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){const t=this.label?` ${this.label}`:"";return`break${t};`+e}}class f extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=T(this.code,e,t),this}get names(){return this.code instanceof i._CodeOrName?this.code.names:{}}}class m extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;while(t--){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let i=r.length;while(i--){const n=r[i];n.optimizeNames(e,t)||(I(e,n.names),r.splice(i,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>O(e,t.names)),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class v extends m{}class y extends g{}y.kind="else";class b extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new y(e):e}return t?!1===e?t instanceof b?t:t.nodes:this.nodes.length?this:new b(D(e),t instanceof b?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=T(this.condition,e,t),this}get names(){const e=super.names;return P(e,this.condition),this.else&&O(e,this.else.names),e}}b.kind="if";class w extends g{}w.kind="for";class _ extends w{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=T(this.iteration,e,t),this}get names(){return O(super.names,this.iteration.names)}}class k extends w{constructor(e,t,r,i){super(),this.varKind=e,this.name=t,this.from=r,this.to=i}render(e){const t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:s}=this;return`for(${t} ${r}=${i}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){const e=P(super.names,this.from);return P(e,this.to)}}class x extends w{constructor(e,t,r,i){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=T(this.iterable,e,t),this}get names(){return O(super.names,this.iterable.names)}}class S extends g{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){const t=this.async?"async ":"";return`${t}function ${this.name}(${this.args})`+super.render(e)}}S.kind="func";class M extends m{render(e){return"return "+super.render(e)}}M.kind="return";class E extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,i;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(i=this.finally)||void 0===i||i.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&O(e,this.catch.names),this.finally&&O(e,this.finally.names),e}}class A extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}A.kind="catch";class C extends g{render(e){return"finally"+super.render(e)}}C.kind="finally";class ${constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t),i=this._values[r.prefix]||(this._values[r.prefix]=new Set);return i.add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,i){const n=this._scope.toName(t);return void 0!==r&&i&&(this._constants[n.str]=r),this._leafNode(new l(e,n,r)),n}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new u(e,t,r))}add(e,r){return this._leafNode(new c(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==i.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[r,n]of e)t.length>1&&t.push(","),t.push(r),(r!==n||this.opts.es5)&&(t.push(":"),(0,i.addCodeArg)(t,n));return t.push("}"),new i._Code(t)}if(e,t,r){if(this._blockNode(new b(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new b(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(b,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new _(e),t)}forRange(e,t,r,i,s=(this.opts.es5?n.varKinds.var:n.varKinds.let)){const o=this._scope.toName(e);return this._for(new k(s,o,t,r),(()=>i(o)))}forOf(e,t,r,s=n.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof i.Name?t:this.var("_arr",t);return this.forRange("_i",0,i._`${e}.length`,(t=>{this.var(o,i._`${e}[${t}]`),r(o)}))}return this._for(new x("of",s,o,t),(()=>r(o)))}forIn(e,t,r,s=(this.opts.es5?n.varKinds.var:n.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,i._`Object.keys(${t})`,r);const o=this._scope.toName(e);return this._for(new x("in",s,o,t),(()=>r(o)))}endFor(){return this._endBlockNode(w)}label(e){return this._leafNode(new h(e))}break(e){return this._leafNode(new d(e))}return(e){const t=new M;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(M)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const i=new E;if(this._blockNode(i),this.code(e),t){const e=this.name("e");this._currNode=i.catch=new A(e),t(e)}return r&&(this._currNode=i.finally=new C,this.code(r)),this._endBlockNode(A,C)}throw(e){return this._leafNode(new f(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=i.nil,r,n){return this._blockNode(new S(e,t,r)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof b))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}}function O(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function P(e,t){return t instanceof i._CodeOrName?O(e,t.names):e}function T(e,t,r){return e instanceof i.Name?n(e):s(e)?new i._Code(e._items.reduce(((e,t)=>(t instanceof i.Name&&(t=n(t)),t instanceof i._Code?e.push(...t._items):e.push(t),e)),[])):e;function n(e){const i=r[e.str];return void 0===i||1!==t[e.str]?e:(delete t[e.str],i)}function s(e){return e instanceof i._Code&&e._items.some((e=>e instanceof i.Name&&1===t[e.str]&&void 0!==r[e.str]))}}function I(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function D(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:i._`!${F(e)}`}t.CodeGen=$,t.not=D;const L=B(t.operators.AND);function N(...e){return e.reduce(L)}t.and=N;const R=B(t.operators.OR);function j(...e){return e.reduce(R)}function B(e){return(t,r)=>t===i.nil?r:r===i.nil?t:i._`${F(t)} ${e} ${F(r)}`}function F(e){return e instanceof i.Name?e:i._`(${e})`}t.or=j},45885:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const i=r(72104);class n extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var s;(function(e){e[e["Started"]=0]="Started",e[e["Completed"]=1]="Completed"})(s||(t.UsedValueState=s={})),t.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof i.Name?e:this.name(e)}name(e){return new i.Name(this._newName(e))}_newName(e){const t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=o;class a extends i.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=i._`.${new i.Name(t)}[${r}]`}}t.ValueScopeName=a;const l=i._`\n`;class u extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:i.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const i=this.toName(e),{prefix:n}=i,s=null!==(r=t.key)&&void 0!==r?r:t.ref;let o=this._values[n];if(o){const e=o.get(s);if(e)return e}else o=this._values[n]=new Map;o.set(s,i);const a=this._scope[n]||(this._scope[n]=[]),l=a.length;return a[l]=t.ref,i.setValue(t,{property:n,itemIndex:l}),i}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return i._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(e,r,o={},a){let l=i.nil;for(const u in e){const c=e[u];if(!c)continue;const h=o[u]=o[u]||new Map;c.forEach((e=>{if(h.has(e))return;h.set(e,s.Started);let o=r(e);if(o){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;l=i._`${l}${r} ${e} = ${o};${this.opts._n}`}else{if(!(o=null===a||void 0===a?void 0:a(e)))throw new n(e);l=i._`${l}${o}${this.opts._n}`}h.set(e,s.Completed)}))}return l}}t.ValueScope=u},22796:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const i=r(93789),n=r(7083),s=r(66735);function o(e,r=t.keywordError,n,s){const{it:o}=e,{gen:a,compositeRule:l,allErrors:u}=o,d=f(e,r,n);(null!==s&&void 0!==s?s:l||u)?c(a,d):h(o,i._`[${d}]`)}function a(e,r=t.keywordError,i){const{it:n}=e,{gen:o,compositeRule:a,allErrors:l}=n,u=f(e,r,i);c(o,u),a||l||h(n,s.default.vErrors)}function l(e,t){e.assign(s.default.errors,t),e.if(i._`${s.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(i._`${s.default.vErrors}.length`,t)),(()=>e.assign(s.default.vErrors,null)))))}function u({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:a}){if(void 0===o)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",o,s.default.errors,(o=>{e.const(l,i._`${s.default.vErrors}[${o}]`),e.if(i._`${l}.instancePath === undefined`,(()=>e.assign(i._`${l}.instancePath`,(0,i.strConcat)(s.default.instancePath,a.errorPath)))),e.assign(i._`${l}.schemaPath`,i.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(i._`${l}.schema`,r),e.assign(i._`${l}.data`,n))}))}function c(e,t){const r=e.const("err",t);e.if(i._`${s.default.vErrors} === null`,(()=>e.assign(s.default.vErrors,i._`[${r}]`)),i._`${s.default.vErrors}.push(${r})`),e.code(i._`${s.default.errors}++`)}function h(e,t){const{gen:r,validateName:n,schemaEnv:s}=e;s.$async?r.throw(i._`new ${e.ValidationError}(${t})`):(r.assign(i._`${n}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>i.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?i.str`"${e}" keyword must be ${t} ($data)`:i.str`"${e}" keyword is invalid ($data)`},t.reportError=o,t.reportExtraError=a,t.resetErrorsCount=l,t.extendErrors=u;const d={keyword:new i.Name("keyword"),schemaPath:new i.Name("schemaPath"),params:new i.Name("params"),propertyName:new i.Name("propertyName"),message:new i.Name("message"),schema:new i.Name("schema"),parentSchema:new i.Name("parentSchema")};function f(e,t,r){const{createErrors:n}=e.it;return!1===n?i._`{}`:p(e,t,r)}function p(e,t,r={}){const{gen:i,it:n}=e,s=[m(n,r),g(e,r)];return v(e,t,s),i.object(...s)}function m({errorPath:e},{instancePath:t}){const r=t?i.str`${e}${(0,n.getErrorPath)(t,n.Type.Str)}`:e;return[s.default.instancePath,(0,i.strConcat)(s.default.instancePath,r)]}function g({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:s}){let o=s?t:i.str`${t}/${e}`;return r&&(o=i.str`${o}${(0,n.getErrorPath)(r,n.Type.Str)}`),[d.schemaPath,o]}function v(e,{params:t,message:r},n){const{keyword:o,data:a,schemaValue:l,it:u}=e,{opts:c,propertyName:h,topSchemaRef:f,schemaPath:p}=u;n.push([d.keyword,o],[d.params,"function"==typeof t?t(e):t||i._`{}`]),c.messages&&n.push([d.message,"function"==typeof r?r(e):r]),c.verbose&&n.push([d.schema,l],[d.parentSchema,i._`${f}${p}`],[s.default.data,a]),h&&n.push([d.propertyName,h])}},65219:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const i=r(93789),n=r(99598),s=r(66735),o=r(63043),a=r(7083),l=r(69810);class u{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,o.normalizeId)(null===r||void 0===r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null===r||void 0===r?void 0:r.$async,this.refs={}}}function c(e){const t=f.call(this,e);if(t)return t;const r=(0,o.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:u}=this.opts.code,{ownProperties:c}=this.opts,h=new i.CodeGen(this.scope,{es5:a,lines:u,ownProperties:c});let d;e.$async&&(d=h.scopeValue("Error",{ref:n.default,code:i._`require("ajv/dist/runtime/validation_error").default`}));const p=h.scopeName("validate");e.validateName=p;const m={gen:h,allErrors:this.opts.allErrors,data:s.default.data,parentData:s.default.parentData,parentDataProperty:s.default.parentDataProperty,dataNames:[s.default.data],dataPathArr:[i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:h.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,i.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:d,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:i.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:i._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,l.validateFunctionCode)(m),h.optimize(this.opts.code.optimize);const t=h.toString();g=`${h.scopeRefs(s.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const r=new Function(`${s.default.self}`,`${s.default.scope}`,g),n=r(this,this.scope.get());if(this.scope.value(p,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:p,validateCode:t,scopeValues:h._values}),this.opts.unevaluated){const{props:e,items:t}=m;n.evaluated={props:e instanceof i.Name?void 0:e,items:t instanceof i.Name?void 0:t,dynamicProps:e instanceof i.Name,dynamicItems:t instanceof i.Name},n.source&&(n.source.evaluated=(0,i.stringify)(n.evaluated))}return e.validate=n,e}catch(v){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),v}finally{this._compilations.delete(e)}}function h(e,t,r){var i;r=(0,o.resolveUrl)(this.opts.uriResolver,t,r);const n=e.refs[r];if(n)return n;let s=m.call(this,e,r);if(void 0===s){const n=null===(i=e.localRefs)||void 0===i?void 0:i[r],{schemaId:o}=this.opts;n&&(s=new u({schema:n,schemaId:o,root:e,baseId:t}))}return void 0!==s?e.refs[r]=d.call(this,s):void 0}function d(e){return(0,o.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function f(e){for(const t of this._compilations)if(p(t,e))return t}function p(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function m(e,t){let r;while("string"==typeof(r=this.refs[t]))t=r;return r||this.schemas[t]||g.call(this,e,t)}function g(e,t){const r=this.opts.uriResolver.parse(t),i=(0,o._getFullPath)(this.opts.uriResolver,r);let n=(0,o.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===n)return y.call(this,r,e);const s=(0,o.normalizeId)(i),a=this.refs[s]||this.schemas[s];if("string"==typeof a){const t=g.call(this,e,a);if("object"!==typeof(null===t||void 0===t?void 0:t.schema))return;return y.call(this,r,t)}if("object"===typeof(null===a||void 0===a?void 0:a.schema)){if(a.validate||c.call(this,a),s===(0,o.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,i=t[r];return i&&(n=(0,o.resolveUrl)(this.opts.uriResolver,n,i)),new u({schema:t,schemaId:r,root:e,baseId:n})}return y.call(this,r,a)}}t.SchemaEnv=u,t.compileSchema=c,t.resolveRef=h,t.getCompilingSchema=f,t.resolveSchema=g;const v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(e,{baseId:t,schema:r,root:i}){var n;if("/"!==(null===(n=e.fragment)||void 0===n?void 0:n[0]))return;for(const u of e.fragment.slice(1).split("/")){if("boolean"===typeof r)return;const e=r[(0,a.unescapeFragment)(u)];if(void 0===e)return;r=e;const i="object"===typeof r&&r[this.opts.schemaId];!v.has(u)&&i&&(t=(0,o.resolveUrl)(this.opts.uriResolver,t,i))}let s;if("boolean"!=typeof r&&r.$ref&&!(0,a.schemaHasRulesButRef)(r,this.RULES)){const e=(0,o.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=g.call(this,i,e)}const{schemaId:l}=this.opts;return s=s||new u({schema:r,schemaId:l,root:i,baseId:t}),s.schema!==s.root.schema?s:void 0}},66735:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n={data:new i.Name("data"),valCxt:new i.Name("valCxt"),instancePath:new i.Name("instancePath"),parentData:new i.Name("parentData"),parentDataProperty:new i.Name("parentDataProperty"),rootData:new i.Name("rootData"),dynamicAnchors:new i.Name("dynamicAnchors"),vErrors:new i.Name("vErrors"),errors:new i.Name("errors"),this:new i.Name("this"),self:new i.Name("self"),scope:new i.Name("scope"),json:new i.Name("json"),jsonPos:new i.Name("jsonPos"),jsonLen:new i.Name("jsonLen"),jsonPart:new i.Name("jsonPart")};t["default"]=n},70303:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(63043);class n extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,i.resolveUrl)(e,t,r),this.missingSchema=(0,i.normalizeId)((0,i.getFullPath)(e,this.missingRef))}}t["default"]=n},63043:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const i=r(7083),n=r(32017),s=r(67242),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function a(e,t=!0){return"boolean"==typeof e||(!0===t?!u(e):!!t&&c(e)<=t)}t.inlineRef=a;const l=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function u(e){for(const t in e){if(l.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(u))return!0;if("object"==typeof r&&u(r))return!0}return!1}function c(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!o.has(r)&&("object"==typeof e[r]&&(0,i.eachItem)(e[r],(e=>t+=c(e))),t===1/0))return 1/0}return t}function h(e,t="",r){!1!==r&&(t=p(t));const i=e.parse(t);return d(e,i)}function d(e,t){const r=e.serialize(t);return r.split("#")[0]+"#"}t.getFullPath=h,t._getFullPath=d;const f=/#\/?$/;function p(e){return e?e.replace(f,""):""}function m(e,t,r){return r=p(r),e.resolve(t,r)}t.normalizeId=p,t.resolveUrl=m;const g=/^[a-z_][-a-z0-9._]*$/i;function v(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:i}=this.opts,o=p(e[r]||t),a={"":o},l=h(i,o,!1),u={},c=new Set;return s(e,{allKeys:!0},((e,t,i,n)=>{if(void 0===n)return;const s=l+t;let o=a[n];function h(t){const r=this.opts.uriResolver.resolve;if(t=p(o?r(o,t):t),c.has(t))throw f(t);c.add(t);let i=this.refs[t];return"string"==typeof i&&(i=this.refs[i]),"object"==typeof i?d(e,i.schema,t):t!==p(s)&&("#"===t[0]?(d(e,u[t],t),u[t]=e):this.refs[t]=s),t}function m(e){if("string"==typeof e){if(!g.test(e))throw new Error(`invalid anchor "${e}"`);h.call(this,`#${e}`)}}"string"==typeof e[r]&&(o=h.call(this,e[r])),m.call(this,e.$anchor),m.call(this,e.$dynamicAnchor),a[t]=o})),u;function d(e,t,r){if(void 0!==t&&!n(e,t))throw f(r)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}}t.getSchemaRefs=v},27476:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const r=["string","number","integer","boolean","null","object","array"],i=new Set(r);function n(e){return"string"==typeof e&&i.has(e)}function s(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}t.isJSONType=n,t.getRules=s},7083:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const i=r(93789),n=r(72104);function s(e){const t={};for(const r of e)t[r]=!0;return t}function o(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(a(e,t),!l(t,e.self.RULES.all))}function a(e,t=e.schema){const{opts:r,self:i}=e;if(!r.strictSchema)return;if("boolean"===typeof t)return;const n=i.RULES.keywords;for(const s in t)n[s]||x(e,`unknown keyword: "${s}"`)}function l(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function u(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1}function c({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return i._`${r}`}return i._`${e}${t}${(0,i.getProperty)(n)}`}function h(e){return p(decodeURIComponent(e))}function d(e){return encodeURIComponent(f(e))}function f(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function p(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function m(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)}function g({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,a,l)=>{const u=void 0===a?o:a instanceof i.Name?(o instanceof i.Name?e(s,o,a):t(s,o,a),a):o instanceof i.Name?(t(s,a,o),o):r(o,a);return l!==i.Name||u instanceof i.Name?u:n(s,u)}}function v(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",i._`{}`);return void 0!==t&&y(e,r,t),r}function y(e,t,r){Object.keys(r).forEach((r=>e.assign(i._`${t}${(0,i.getProperty)(r)}`,!0)))}t.toHash=s,t.alwaysValidSchema=o,t.checkUnknownRules=a,t.schemaHasRules=l,t.schemaHasRulesButRef=u,t.schemaRefOrVal=c,t.unescapeFragment=h,t.escapeFragment=d,t.escapeJsonPointer=f,t.unescapeJsonPointer=p,t.eachItem=m,t.mergeEvaluated={props:g({mergeNames:(e,t,r)=>e.if(i._`${r} !== true && ${t} !== undefined`,(()=>{e.if(i._`${t} === true`,(()=>e.assign(r,!0)),(()=>e.assign(r,i._`${r} || {}`).code(i._`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if(i._`${r} !== true`,(()=>{!0===t?e.assign(r,!0):(e.assign(r,i._`${r} || {}`),y(e,r,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:v}),items:g({mergeNames:(e,t,r)=>e.if(i._`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,i._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if(i._`${r} !== true`,(()=>e.assign(r,!0===t||i._`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=v,t.setEvaluated=y;const b={};function w(e,t){return e.scopeValue("func",{ref:t,code:b[t.code]||(b[t.code]=new n._Code(t.code))})}var _;function k(e,t,r){if(e instanceof i.Name){const n=t===_.Num;return r?n?i._`"[" + ${e} + "]"`:i._`"['" + ${e} + "']"`:n?i._`"/" + ${e}`:i._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,i.getProperty)(e).toString():"/"+f(e)}function x(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=w,function(e){e[e["Num"]=0]="Num",e[e["Str"]=1]="Str"}(_||(t.Type=_={})),t.getErrorPath=k,t.checkStrictMode=x},65335:function(e,t){"use strict";function r({schema:e,self:t},r){const n=t.RULES.types[r];return n&&!0!==n&&i(e,n)}function i(e,t){return t.rules.some((t=>n(e,t)))}function n(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=r,t.shouldUseGroup=i,t.shouldUseRule=n},15583:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const i=r(22796),n=r(93789),s=r(66735),o={message:"boolean schema is false"};function a(e){const{gen:t,schema:r,validateName:i}=e;!1===r?u(e,!1):"object"==typeof r&&!0===r.$async?t.return(s.default.data):(t.assign(n._`${i}.errors`,null),t.return(!0))}function l(e,t){const{gen:r,schema:i}=e;!1===i?(r.var(t,!1),u(e)):r.var(t,!0)}function u(e,t){const{gen:r,data:n}=e,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,i.reportError)(s,o,void 0,t)}t.topBoolOrEmptySchema=a,t.boolOrEmptySchema=l},28840:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const i=r(27476),n=r(65335),s=r(22796),o=r(93789),a=r(7083);var l;function u(e){const t=c(e.type),r=t.includes("null");if(r){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t}function c(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(i.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}function h(e,t){const{gen:r,data:i,opts:s}=e,o=f(t,s.coerceTypes),a=t.length>0&&!(0===o.length&&1===t.length&&(0,n.schemaHasRulesForType)(e,t[0]));if(a){const n=v(t,i,s.strictNumbers,l.Wrong);r.if(n,(()=>{o.length?p(e,t,o):b(e)}))}return a}(function(e){e[e["Correct"]=0]="Correct",e[e["Wrong"]=1]="Wrong"})(l||(t.DataType=l={})),t.getSchemaTypes=u,t.getJSONTypes=c,t.coerceAndCheckDataType=h;const d=new Set(["string","number","integer","boolean","null"]);function f(e,t){return t?e.filter((e=>d.has(e)||"array"===t&&"array"===e)):[]}function p(e,t,r){const{gen:i,data:n,opts:s}=e,a=i.let("dataType",o._`typeof ${n}`),l=i.let("coerced",o._`undefined`);"array"===s.coerceTypes&&i.if(o._`${a} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,(()=>i.assign(n,o._`${n}[0]`).assign(a,o._`typeof ${n}`).if(v(t,n,s.strictNumbers),(()=>i.assign(l,n))))),i.if(o._`${l} !== undefined`);for(const o of r)(d.has(o)||"array"===o&&"array"===s.coerceTypes)&&u(o);function u(e){switch(e){case"string":return void i.elseIf(o._`${a} == "number" || ${a} == "boolean"`).assign(l,o._`"" + ${n}`).elseIf(o._`${n} === null`).assign(l,o._`""`);case"number":return void i.elseIf(o._`${a} == "boolean" || ${n} === null || (${a} == "string" && ${n} && ${n} == +${n})`).assign(l,o._`+${n}`);case"integer":return void i.elseIf(o._`${a} === "boolean" || ${n} === null || (${a} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(l,o._`+${n}`);case"boolean":return void i.elseIf(o._`${n} === "false" || ${n} === 0 || ${n} === null`).assign(l,!1).elseIf(o._`${n} === "true" || ${n} === 1`).assign(l,!0);case"null":return i.elseIf(o._`${n} === "" || ${n} === 0 || ${n} === false`),void i.assign(l,null);case"array":i.elseIf(o._`${a} === "string" || ${a} === "number" - || ${a} === "boolean" || ${n} === null`).assign(l,o._`[${n}]`)}}i.else(),b(e),i.endIf(),i.if(o._`${l} !== undefined`,(()=>{i.assign(n,l),m(e,l)}))}function m({gen:e,parentData:t,parentDataProperty:r},i){e.if(o._`${t} !== undefined`,(()=>e.assign(o._`${t}[${r}]`,i)))}function g(e,t,r,i=l.Correct){const n=i===l.Correct?o.operators.EQ:o.operators.NEQ;let s;switch(e){case"null":return o._`${t} ${n} null`;case"array":s=o._`Array.isArray(${t})`;break;case"object":s=o._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=a(o._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=a();break;default:return o._`typeof ${t} ${n} ${e}`}return i===l.Correct?s:(0,o.not)(s);function a(e=o.nil){return(0,o.and)(o._`typeof ${t} == "number"`,e,r?o._`isFinite(${t})`:o.nil)}}function v(e,t,r,i){if(1===e.length)return g(e[0],t,r,i);let n;const s=(0,a.toHash)(e);if(s.array&&s.object){const e=o._`typeof ${t} != "object"`;n=s.null?e:o._`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else n=o.nil;s.number&&delete s.integer;for(const a in s)n=(0,o.and)(n,g(a,t,r,i));return n}t.checkDataType=g,t.checkDataTypes=v;const y={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?o._`{type: ${e}}`:o._`{type: ${t}}`};function b(e){const t=w(e);(0,s.reportError)(t,y)}function w(e){const{gen:t,data:r,schema:i}=e,n=(0,a.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:r,schema:i.type,schemaCode:n,schemaValue:n,parentSchema:i,params:{},it:e}}t.reportTypeError=b},75590:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const i=r(93789),n=r(7083);function s(e,t){const{properties:r,items:i}=e.schema;if("object"===t&&r)for(const n in r)o(e,n,r[n].default);else"array"===t&&Array.isArray(i)&&i.forEach(((t,r)=>o(e,r,t.default)))}function o(e,t,r){const{gen:s,compositeRule:o,data:a,opts:l}=e;if(void 0===r)return;const u=i._`${a}${(0,i.getProperty)(t)}`;if(o)return void(0,n.checkStrictMode)(e,`default is ignored for: ${u}`);let c=i._`${u} === undefined`;"empty"===l.useDefaults&&(c=i._`${c} || ${u} === null || ${u} === ""`),s.if(c,i._`${u} = ${(0,i.stringify)(r)}`)}t.assignDefaults=s},69810:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const i=r(15583),n=r(28840),s=r(65335),o=r(28840),a=r(75590),l=r(62657),u=r(19543),c=r(93789),h=r(66735),d=r(63043),f=r(7083),p=r(22796);function m(e){S(e)&&(E(e),x(e))?b(e):g(e,(()=>(0,i.topBoolOrEmptySchema)(e)))}function g({gen:e,validateName:t,schema:r,schemaEnv:i,opts:n},s){n.code.es5?e.func(t,c._`${h.default.data}, ${h.default.valCxt}`,i.$async,(()=>{e.code(c._`"use strict"; ${_(r,n)}`),y(e,n),e.code(s)})):e.func(t,c._`${h.default.data}, ${v(n)}`,i.$async,(()=>e.code(_(r,n)).code(s)))}function v(e){return c._`{${h.default.instancePath}="", ${h.default.parentData}, ${h.default.parentDataProperty}, ${h.default.rootData}=${h.default.data}${e.dynamicRef?c._`, ${h.default.dynamicAnchors}={}`:c.nil}}={}`}function y(e,t){e.if(h.default.valCxt,(()=>{e.var(h.default.instancePath,c._`${h.default.valCxt}.${h.default.instancePath}`),e.var(h.default.parentData,c._`${h.default.valCxt}.${h.default.parentData}`),e.var(h.default.parentDataProperty,c._`${h.default.valCxt}.${h.default.parentDataProperty}`),e.var(h.default.rootData,c._`${h.default.valCxt}.${h.default.rootData}`),t.dynamicRef&&e.var(h.default.dynamicAnchors,c._`${h.default.valCxt}.${h.default.dynamicAnchors}`)}),(()=>{e.var(h.default.instancePath,c._`""`),e.var(h.default.parentData,c._`undefined`),e.var(h.default.parentDataProperty,c._`undefined`),e.var(h.default.rootData,h.default.data),t.dynamicRef&&e.var(h.default.dynamicAnchors,c._`{}`)}))}function b(e){const{schema:t,opts:r,gen:i}=e;g(e,(()=>{r.$comment&&t.$comment&&T(e),$(e),i.let(h.default.vErrors,null),i.let(h.default.errors,0),r.unevaluated&&w(e),A(e),I(e)}))}function w(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",c._`${r}.evaluated`),t.if(c._`${e.evaluated}.dynamicProps`,(()=>t.assign(c._`${e.evaluated}.props`,c._`undefined`))),t.if(c._`${e.evaluated}.dynamicItems`,(()=>t.assign(c._`${e.evaluated}.items`,c._`undefined`)))}function _(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?c._`/*# sourceURL=${r} */`:c.nil}function k(e,t){S(e)&&(E(e),x(e))?M(e,t):(0,i.boolOrEmptySchema)(e,t)}function x({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function S(e){return"boolean"!=typeof e.schema}function M(e,t){const{schema:r,gen:i,opts:n}=e;n.$comment&&r.$comment&&T(e),O(e),P(e);const s=i.const("_errs",h.default.errors);A(e,s),i.var(t,c._`${s} === ${h.default.errors}`)}function E(e){(0,f.checkUnknownRules)(e),C(e)}function A(e,t){if(e.opts.jtd)return L(e,[],!1,t);const r=(0,n.getSchemaTypes)(e.schema),i=(0,n.coerceAndCheckDataType)(e,r);L(e,r,!i,t)}function C(e){const{schema:t,errSchemaPath:r,opts:i,self:n}=e;t.$ref&&i.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(t,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function $(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,f.checkStrictMode)(e,"default is ignored in the schema root")}function O(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,d.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function P(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function T({gen:e,schemaEnv:t,schema:r,errSchemaPath:i,opts:n}){const s=r.$comment;if(!0===n.$comment)e.code(c._`${h.default.self}.logger.log(${s})`);else if("function"==typeof n.$comment){const r=c.str`${i}/$comment`,n=e.scopeValue("root",{ref:t.root});e.code(c._`${h.default.self}.opts.$comment(${s}, ${r}, ${n}.schema)`)}}function I(e){const{gen:t,schemaEnv:r,validateName:i,ValidationError:n,opts:s}=e;r.$async?t.if(c._`${h.default.errors} === 0`,(()=>t.return(h.default.data)),(()=>t.throw(c._`new ${n}(${h.default.vErrors})`))):(t.assign(c._`${i}.errors`,h.default.vErrors),s.unevaluated&&D(e),t.return(c._`${h.default.errors} === 0`))}function D({gen:e,evaluated:t,props:r,items:i}){r instanceof c.Name&&e.assign(c._`${t}.props`,r),i instanceof c.Name&&e.assign(c._`${t}.items`,i)}function L(e,t,r,i){const{gen:n,schema:a,data:l,allErrors:u,opts:d,self:p}=e,{RULES:m}=p;function g(f){(0,s.shouldUseGroup)(a,f)&&(f.type?(n.if((0,o.checkDataType)(f.type,l,d.strictNumbers)),R(e,f),1===t.length&&t[0]===f.type&&r&&(n.else(),(0,o.reportTypeError)(e)),n.endIf()):R(e,f),u||n.if(c._`${h.default.errors} === ${i||0}`))}!a.$ref||!d.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(a,m)?(d.jtd||N(e,t),n.block((()=>{for(const e of m.rules)g(e);g(m.post)}))):n.block((()=>W(e,"$ref",m.all.$ref.definition)))}function R(e,t){const{gen:r,schema:i,opts:{useDefaults:n}}=e;n&&(0,a.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,s.shouldUseRule)(i,r)&&W(e,r.keyword,r.definition,t.type)}))}function N(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(j(e,t),e.opts.allowUnionTypes||B(e,t),F(e,e.dataTypes))}function j(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{V(e.dataTypes,t)||U(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),q(e,t)):e.dataTypes=t)}function B(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&U(e,"use allowUnionTypes to allow union type keyword")}function F(e,t){const r=e.self.RULES.all;for(const i in r){const n=r[i];if("object"==typeof n&&(0,s.shouldUseRule)(e.schema,n)){const{type:r}=n.definition;r.length&&!r.some((e=>z(t,e)))&&U(e,`missing type "${r.join(",")}" for keyword "${i}"`)}}}function z(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function V(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function q(e,t){const r=[];for(const i of e.dataTypes)V(t,i)?r.push(i):t.includes("integer")&&"number"===i&&r.push("integer");e.dataTypes=r}function U(e,t){const r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,f.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=m;class H{constructor(e,t,r){if((0,l.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,f.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",G(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",h.default.errors))}result(e,t,r){this.failResult((0,c.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(c._`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=c.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=c.nil,t=c.nil){if(!this.$data)return;const{gen:r,schemaCode:i,schemaType:n,def:s}=this;r.if((0,c.or)(c._`${i} === undefined`,t)),e!==c.nil&&r.assign(e,!0),(n.length||s.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:i,it:n}=this;return(0,c.or)(s(),a());function s(){if(r.length){if(!(t instanceof c.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return c._`${(0,o.checkDataTypes)(e,t,n.opts.strictNumbers,o.DataType.Wrong)}`}return c.nil}function a(){if(i.validateSchema){const r=e.scopeValue("validate$data",{ref:i.validateSchema});return c._`!${r}(${t})`}return c.nil}}subschema(e,t){const r=(0,u.getSubschema)(this.it,e);(0,u.extendSubschemaData)(r,this.it,e),(0,u.extendSubschemaMode)(r,e);const i={...this.it,...r,items:void 0,props:void 0};return k(i,t),i}mergeEvaluated(e,t){const{it:r,gen:i}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=f.mergeEvaluated.props(i,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=f.mergeEvaluated.items(i,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:i}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return i.if(t,(()=>this.mergeEvaluated(e,c.Name))),!0}}function W(e,t,r,i){const n=new H(e,r,t);"code"in r?r.code(n,i):n.$data&&r.validate?(0,l.funcKeywordCode)(n,r):"macro"in r?(0,l.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,l.funcKeywordCode)(n,r)}t.KeywordCxt=H;const K=/^\/(?:[^~]|~0|~1)*$/,Y=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function G(e,{dataLevel:t,dataNames:r,dataPathArr:i}){let n,s;if(""===e)return h.default.rootData;if("/"===e[0]){if(!K.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);n=e,s=h.default.rootData}else{const o=Y.exec(e);if(!o)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+o[1];if(n=o[2],"#"===n){if(a>=t)throw new Error(l("property/index",a));return i[t-a]}if(a>t)throw new Error(l("data",a));if(s=r[t-a],!n)return s}let o=s;const a=n.split("/");for(const u of a)u&&(s=c._`${s}${(0,c.getProperty)((0,f.unescapeJsonPointer)(u))}`,o=c._`${o} && ${s}`);return o;function l(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=G},62657:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const i=r(93789),n=r(66735),s=r(21085),o=r(22796);function a(e,t){const{gen:r,keyword:n,schema:s,parentSchema:o,it:a}=e,l=t.macro.call(a.self,s,o,a),u=d(r,n,l);!1!==a.opts.validateSchema&&a.self.validateSchema(l,!0);const c=r.name("valid");e.subschema({schema:l,schemaPath:i.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},c),e.pass(c,(()=>e.error(!0)))}function l(e,t){var r;const{gen:o,keyword:a,schema:l,parentSchema:f,$data:p,it:m}=e;h(m,t);const g=!p&&t.compile?t.compile.call(m.self,l,f,m):t.validate,v=d(o,a,g),y=o.let("valid");function b(){if(!1===t.errors)k(),t.modifying&&u(e),x((()=>e.error()));else{const r=t.async?w():_();t.modifying&&u(e),x((()=>c(e,r)))}}function w(){const e=o.let("ruleErrs",null);return o.try((()=>k(i._`await `)),(t=>o.assign(y,!1).if(i._`${t} instanceof ${m.ValidationError}`,(()=>o.assign(e,i._`${t}.errors`)),(()=>o.throw(t))))),e}function _(){const e=i._`${v}.errors`;return o.assign(e,null),k(i.nil),e}function k(r=(t.async?i._`await `:i.nil)){const a=m.opts.passContext?n.default.this:n.default.self,l=!("compile"in t&&!p||!1===t.schema);o.assign(y,i._`${r}${(0,s.callValidateCode)(e,v,a,l)}`,t.modifying)}function x(e){var r;o.if((0,i.not)(null!==(r=t.valid)&&void 0!==r?r:y),e)}e.block$data(y,b),e.ok(null!==(r=t.valid)&&void 0!==r?r:y)}function u(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,(()=>t.assign(r,i._`${n.parentData}[${n.parentDataProperty}]`)))}function c(e,t){const{gen:r}=e;r.if(i._`Array.isArray(${t})`,(()=>{r.assign(n.default.vErrors,i._`${n.default.vErrors} === null ? ${t} : ${n.default.vErrors}.concat(${t})`).assign(n.default.errors,i._`${n.default.vErrors}.length`),(0,o.extendErrors)(e)}),(()=>e.error()))}function h({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function d(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,i.stringify)(r)})}function f(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&"undefined"==typeof e))}function p({schema:e,opts:t,self:r,errSchemaPath:i},n,s){if(Array.isArray(n.keyword)?!n.keyword.includes(s):n.keyword!==s)throw new Error("ajv implementation error");const o=n.dependencies;if(null===o||void 0===o?void 0:o.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(n.validateSchema){const o=n.validateSchema(e[s]);if(!o){const e=`keyword "${s}" value is invalid at path "${i}": `+r.errorsText(n.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}}t.macroKeywordCode=a,t.funcKeywordCode=l,t.validSchemaType=f,t.validateKeywordUsage=p},19543:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const i=r(93789),n=r(7083);function s(e,{keyword:t,schemaProp:r,schema:s,schemaPath:o,errSchemaPath:a,topSchemaRef:l}){if(void 0!==t&&void 0!==s)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const s=e.schema[t];return void 0===r?{schema:s,schemaPath:i._`${e.schemaPath}${(0,i.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[r],schemaPath:i._`${e.schemaPath}${(0,i.getProperty)(t)}${(0,i.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,n.escapeFragment)(r)}`}}if(void 0!==s){if(void 0===o||void 0===a||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:o,topSchemaRef:l,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')}function o(e,t,{dataProp:r,dataPropType:s,data:o,dataTypes:a,propertyName:l}){if(void 0!==o&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:u}=t;if(void 0!==r){const{errorPath:o,dataPathArr:a,opts:l}=t,h=u.let("data",i._`${t.data}${(0,i.getProperty)(r)}`,!0);c(h),e.errorPath=i.str`${o}${(0,n.getErrorPath)(r,s,l.jsPropertySyntax)}`,e.parentDataProperty=i._`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}if(void 0!==o){const t=o instanceof i.Name?o:u.let("data",o,!0);c(t),void 0!==l&&(e.propertyName=l)}function c(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}a&&(e.dataTypes=a)}function a(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:i,createErrors:n,allErrors:s}){void 0!==i&&(e.compositeRule=i),void 0!==n&&(e.createErrors=n),void 0!==s&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=r}t.getSubschema=s,t.extendSubschemaData=o,t.extendSubschemaMode=a},17666:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var i=r(69810);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return i.KeywordCxt}});var n=r(93789);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const s=r(99598),o=r(70303),a=r(5095),l=r(65219),u=r(93789),c=r(63043),h=r(28840),d=r(7083),f=r(37301),p=r(76976),m=(e,t)=>new RegExp(e,t);m.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},b={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},w=200;function _(e){var t,r,i,n,s,o,a,l,u,c,h,d,f,g,v,y,b,_,k,x,S,M,E,A,C;const $=e.strict,O=null===(t=e.code)||void 0===t?void 0:t.optimize,P=!0===O||void 0===O?1:O||0,T=null!==(i=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==i?i:m,I=null!==(n=e.uriResolver)&&void 0!==n?n:p.default;return{strictSchema:null===(o=null!==(s=e.strictSchema)&&void 0!==s?s:$)||void 0===o||o,strictNumbers:null===(l=null!==(a=e.strictNumbers)&&void 0!==a?a:$)||void 0===l||l,strictTypes:null!==(c=null!==(u=e.strictTypes)&&void 0!==u?u:$)&&void 0!==c?c:"log",strictTuples:null!==(d=null!==(h=e.strictTuples)&&void 0!==h?h:$)&&void 0!==d?d:"log",strictRequired:null!==(g=null!==(f=e.strictRequired)&&void 0!==f?f:$)&&void 0!==g&&g,code:e.code?{...e.code,optimize:P,regExp:T}:{optimize:P,regExp:T},loopRequired:null!==(v=e.loopRequired)&&void 0!==v?v:w,loopEnum:null!==(y=e.loopEnum)&&void 0!==y?y:w,meta:null===(b=e.meta)||void 0===b||b,messages:null===(_=e.messages)||void 0===_||_,inlineRefs:null===(k=e.inlineRefs)||void 0===k||k,schemaId:null!==(x=e.schemaId)&&void 0!==x?x:"$id",addUsedSchema:null===(S=e.addUsedSchema)||void 0===S||S,validateSchema:null===(M=e.validateSchema)||void 0===M||M,validateFormats:null===(E=e.validateFormats)||void 0===E||E,unicodeRegExp:null===(A=e.unicodeRegExp)||void 0===A||A,int32range:null===(C=e.int32range)||void 0===C||C,uriResolver:I}}class k{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,..._(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:v,es5:t,lines:r}),this.logger=O(e.logger);const i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),x.call(this,y,e,"NOT SUPPORTED"),x.call(this,b,e,"DEPRECATED","warn"),this._metaOpts=C.call(this),e.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&A.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),M.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let i=f;"id"===r&&(i={...f},i.id=i.$id,delete i.$id),t&&e&&this.addMetaSchema(i,i[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const i=r(t);return"$async"in r||(this.errors=r.errors),i}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return i.call(this,e,t);async function i(e,t){await n.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||s.call(this,r)}async function n(e){e&&!this.getSchema(e)&&await i.call(this,{$ref:e},!0)}async function s(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.default))throw t;return a.call(this,t),await l.call(this,t.missingSchema),s.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){const r=await u.call(this,e);this.refs[e]||await n.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,i=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,i);return this}let n;if("object"===typeof e){const{schemaId:t}=this.opts;if(n=e[t],void 0!==n&&"string"!=typeof n)throw new Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||n),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,i,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const i=this.validate(r,e);if(!i&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return i}getSchema(e){let t;while("string"==typeof(t=S.call(this,e)))e=t;if(void 0===t){const{schemaId:r}=this.opts,i=new l.SchemaEnv({schema:{},schemaId:r});if(t=l.resolveSchema.call(this,i,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=S.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,c.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(T.call(this,r,t),!t)return(0,d.eachItem)(r,(e=>I.call(this,e))),this;L.call(this,t);const i={...t,type:(0,h.getJSONTypes)(t.type),schemaType:(0,h.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(r,0===i.type.length?e=>I.call(this,e,i):e=>i.type.forEach((t=>I.call(this,e,i,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const i of t){const t=i.split("/").slice(1);let n=e;for(const e of t)n=n[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:i}=t.definition,s=n[e];i&&s&&(n[e]=N(s))}}return e}_removeAllSchemas(e,t){for(const r in e){const i=e[r];t&&!t.test(r)||("string"==typeof i?delete e[r]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[r]))}}_addSchema(e,t,r,i=this.opts.validateSchema,n=this.opts.addUsedSchema){let s;const{schemaId:o}=this.opts;if("object"==typeof e)s=e[o];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;r=(0,c.normalizeId)(s||r);const u=c.getSchemaRefs.call(this,e,r);return a=new l.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:r,localRefs:u}),this._cache.set(a.schema,a),n&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),i&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):l.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,e)}finally{this.opts=t}}}function x(e,t,r,i="error"){for(const n in e){const s=n;s in t&&this.logger[i](`${r}: option ${n}. ${e[s]}`)}}function S(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function M(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function E(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function A(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function C(){const e={...this.opts};for(const t of g)delete e[t];return e}k.ValidationError=s.default,k.MissingRefError=o.default,t["default"]=k;const $={log(){},warn(){},error(){}};function O(e){if(!1===e)return $;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}const P=/^[a-z_$][a-z0-9_$:-]*$/i;function T(e,t){const{RULES:r}=this;if((0,d.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!P.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function I(e,t,r){var i;const n=null===t||void 0===t?void 0:t.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:s}=this;let o=n?s.post:s.rules.find((({type:e})=>e===r));if(o||(o={type:r,rules:[]},s.rules.push(o)),s.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,h.getJSONTypes)(t.type),schemaType:(0,h.getJSONTypes)(t.schemaType)}};t.before?D.call(this,o,a,t.before):o.rules.push(a),s.all[e]=a,null===(i=t.implements)||void 0===i||i.forEach((e=>this.addKeyword(e)))}function D(e,t,r){const i=e.rules.findIndex((e=>e.keyword===r));i>=0?e.rules.splice(i,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function L(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=N(t)),e.validateSchema=this.compile(t,!0))}const R={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function N(e){return{anyOf:[e,R]}}},72482:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(32017);i.code='require("ajv/dist/runtime/equal").default',t["default"]=i},82261:function(e,t){"use strict";function r(e){const t=e.length;let r,i=0,n=0;while(n=55296&&r<=56319&&ni.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>i._`{limit: ${e}}`},o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:s,code(e){const{parentSchema:t,it:r}=e,{items:i}=t;Array.isArray(i)?a(e,i):(0,n.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function a(e,t){const{gen:r,schema:s,data:o,keyword:a,it:l}=e;l.items=!0;const u=r.const("len",i._`${o}.length`);if(!1===s)e.setParams({len:t.length}),e.pass(i._`${u} <= ${t.length}`);else if("object"==typeof s&&!(0,n.alwaysValidSchema)(l,s)){const n=r.var("valid",i._`${u} <= ${t.length}`);r.if((0,i.not)(n),(()=>c(n))),e.ok(n)}function c(s){r.forRange("i",t.length,u,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:n.Type.Num},s),l.allErrors||r.if((0,i.not)(s),(()=>r.break()))}))}}t.validateAdditionalItems=a,t["default"]=o},90396:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(21085),n=r(93789),s=r(66735),o=r(7083),a={message:"must NOT have additional properties",params:({params:e})=>n._`{additionalProperty: ${e.additionalProperty}}`},l={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:a,code(e){const{gen:t,schema:r,parentSchema:a,data:l,errsCount:u,it:c}=e;if(!u)throw new Error("ajv implementation error");const{allErrors:h,opts:d}=c;if(c.props=!0,"all"!==d.removeAdditional&&(0,o.alwaysValidSchema)(c,r))return;const f=(0,i.allSchemaProperties)(a.properties),p=(0,i.allSchemaProperties)(a.patternProperties);function m(){t.forIn("key",l,(e=>{f.length||p.length?t.if(g(e),(()=>y(e))):y(e)}))}function g(r){let s;if(f.length>8){const e=(0,o.schemaRefOrVal)(c,a.properties,"properties");s=(0,i.isOwnProperty)(t,e,r)}else s=f.length?(0,n.or)(...f.map((e=>n._`${r} === ${e}`))):n.nil;return p.length&&(s=(0,n.or)(s,...p.map((t=>n._`${(0,i.usePattern)(e,t)}.test(${r})`)))),(0,n.not)(s)}function v(e){t.code(n._`delete ${l}[${e}]`)}function y(i){if("all"===d.removeAdditional||d.removeAdditional&&!1===r)v(i);else{if(!1===r)return e.setParams({additionalProperty:i}),e.error(),void(h||t.break());if("object"==typeof r&&!(0,o.alwaysValidSchema)(c,r)){const r=t.name("valid");"failing"===d.removeAdditional?(b(i,r,!1),t.if((0,n.not)(r),(()=>{e.reset(),v(i)}))):(b(i,r),h||t.if((0,n.not)(r),(()=>t.break())))}}}function b(t,r,i){const n={keyword:"additionalProperties",dataProp:t,dataPropType:o.Type.Str};!1===i&&Object.assign(n,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(n,r)}m(),e.ok(n._`${u} === ${s.default.errors}`)}};t["default"]=l},66636:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(7083),n={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=t.name("valid");r.forEach(((t,r)=>{if((0,i.alwaysValidSchema)(n,t))return;const o=e.subschema({keyword:"allOf",schemaProp:r},s);e.ok(s),e.mergeEvaluated(o)}))}};t["default"]=n},41665:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(21085),n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:i.validateUnion,error:{message:"must match a schema in anyOf"}};t["default"]=n},96925:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n=r(7083),s={message:({params:{min:e,max:t}})=>void 0===t?i.str`must contain at least ${e} valid item(s)`:i.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?i._`{minContains: ${e}}`:i._`{minContains: ${e}, maxContains: ${t}}`},o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:s,code(e){const{gen:t,schema:r,parentSchema:s,data:o,it:a}=e;let l,u;const{minContains:c,maxContains:h}=s;a.opts.next?(l=void 0===c?1:c,u=h):l=1;const d=t.const("len",i._`${o}.length`);if(e.setParams({min:l,max:u}),void 0===u&&0===l)return void(0,n.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==u&&l>u)return(0,n.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,n.alwaysValidSchema)(a,r)){let t=i._`${d} >= ${l}`;return void 0!==u&&(t=i._`${t} && ${d} <= ${u}`),void e.pass(t)}a.items=!0;const f=t.name("valid");function p(){const e=t.name("_valid"),r=t.let("count",0);m(e,(()=>t.if(e,(()=>g(r)))))}function m(r,i){t.forRange("i",0,d,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:n.Type.Num,compositeRule:!0},r),i()}))}function g(e){t.code(i._`${e}++`),void 0===u?t.if(i._`${e} >= ${l}`,(()=>t.assign(f,!0).break())):(t.if(i._`${e} > ${u}`,(()=>t.assign(f,!1).break())),1===l?t.assign(f,!0):t.if(i._`${e} >= ${l}`,(()=>t.assign(f,!0))))}void 0===u&&1===l?m(f,(()=>t.if(f,(()=>t.break())))):0===l?(t.let(f,!0),void 0!==u&&t.if(i._`${o}.length > 0`,p)):(t.let(f,!1),p()),e.result(f,(()=>e.reset()))}};t["default"]=o},71273:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const i=r(93789),n=r(7083),s=r(21085);t.error={message:({params:{property:e,depsCount:t,deps:r}})=>{const n=1===t?"property":"properties";return i.str`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>i._`{property: ${e}, + || ${a} === "boolean" || ${n} === null`).assign(l,o._`[${n}]`)}}i.else(),b(e),i.endIf(),i.if(o._`${l} !== undefined`,(()=>{i.assign(n,l),m(e,l)}))}function m({gen:e,parentData:t,parentDataProperty:r},i){e.if(o._`${t} !== undefined`,(()=>e.assign(o._`${t}[${r}]`,i)))}function g(e,t,r,i=l.Correct){const n=i===l.Correct?o.operators.EQ:o.operators.NEQ;let s;switch(e){case"null":return o._`${t} ${n} null`;case"array":s=o._`Array.isArray(${t})`;break;case"object":s=o._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=a(o._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=a();break;default:return o._`typeof ${t} ${n} ${e}`}return i===l.Correct?s:(0,o.not)(s);function a(e=o.nil){return(0,o.and)(o._`typeof ${t} == "number"`,e,r?o._`isFinite(${t})`:o.nil)}}function v(e,t,r,i){if(1===e.length)return g(e[0],t,r,i);let n;const s=(0,a.toHash)(e);if(s.array&&s.object){const e=o._`typeof ${t} != "object"`;n=s.null?e:o._`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else n=o.nil;s.number&&delete s.integer;for(const a in s)n=(0,o.and)(n,g(a,t,r,i));return n}t.checkDataType=g,t.checkDataTypes=v;const y={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?o._`{type: ${e}}`:o._`{type: ${t}}`};function b(e){const t=w(e);(0,s.reportError)(t,y)}function w(e){const{gen:t,data:r,schema:i}=e,n=(0,a.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:r,schema:i.type,schemaCode:n,schemaValue:n,parentSchema:i,params:{},it:e}}t.reportTypeError=b},75590:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const i=r(93789),n=r(7083);function s(e,t){const{properties:r,items:i}=e.schema;if("object"===t&&r)for(const n in r)o(e,n,r[n].default);else"array"===t&&Array.isArray(i)&&i.forEach(((t,r)=>o(e,r,t.default)))}function o(e,t,r){const{gen:s,compositeRule:o,data:a,opts:l}=e;if(void 0===r)return;const u=i._`${a}${(0,i.getProperty)(t)}`;if(o)return void(0,n.checkStrictMode)(e,`default is ignored for: ${u}`);let c=i._`${u} === undefined`;"empty"===l.useDefaults&&(c=i._`${c} || ${u} === null || ${u} === ""`),s.if(c,i._`${u} = ${(0,i.stringify)(r)}`)}t.assignDefaults=s},69810:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const i=r(15583),n=r(28840),s=r(65335),o=r(28840),a=r(75590),l=r(62657),u=r(19543),c=r(93789),h=r(66735),d=r(63043),f=r(7083),p=r(22796);function m(e){S(e)&&(E(e),x(e))?b(e):g(e,(()=>(0,i.topBoolOrEmptySchema)(e)))}function g({gen:e,validateName:t,schema:r,schemaEnv:i,opts:n},s){n.code.es5?e.func(t,c._`${h.default.data}, ${h.default.valCxt}`,i.$async,(()=>{e.code(c._`"use strict"; ${_(r,n)}`),y(e,n),e.code(s)})):e.func(t,c._`${h.default.data}, ${v(n)}`,i.$async,(()=>e.code(_(r,n)).code(s)))}function v(e){return c._`{${h.default.instancePath}="", ${h.default.parentData}, ${h.default.parentDataProperty}, ${h.default.rootData}=${h.default.data}${e.dynamicRef?c._`, ${h.default.dynamicAnchors}={}`:c.nil}}={}`}function y(e,t){e.if(h.default.valCxt,(()=>{e.var(h.default.instancePath,c._`${h.default.valCxt}.${h.default.instancePath}`),e.var(h.default.parentData,c._`${h.default.valCxt}.${h.default.parentData}`),e.var(h.default.parentDataProperty,c._`${h.default.valCxt}.${h.default.parentDataProperty}`),e.var(h.default.rootData,c._`${h.default.valCxt}.${h.default.rootData}`),t.dynamicRef&&e.var(h.default.dynamicAnchors,c._`${h.default.valCxt}.${h.default.dynamicAnchors}`)}),(()=>{e.var(h.default.instancePath,c._`""`),e.var(h.default.parentData,c._`undefined`),e.var(h.default.parentDataProperty,c._`undefined`),e.var(h.default.rootData,h.default.data),t.dynamicRef&&e.var(h.default.dynamicAnchors,c._`{}`)}))}function b(e){const{schema:t,opts:r,gen:i}=e;g(e,(()=>{r.$comment&&t.$comment&&T(e),$(e),i.let(h.default.vErrors,null),i.let(h.default.errors,0),r.unevaluated&&w(e),A(e),I(e)}))}function w(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",c._`${r}.evaluated`),t.if(c._`${e.evaluated}.dynamicProps`,(()=>t.assign(c._`${e.evaluated}.props`,c._`undefined`))),t.if(c._`${e.evaluated}.dynamicItems`,(()=>t.assign(c._`${e.evaluated}.items`,c._`undefined`)))}function _(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?c._`/*# sourceURL=${r} */`:c.nil}function k(e,t){S(e)&&(E(e),x(e))?M(e,t):(0,i.boolOrEmptySchema)(e,t)}function x({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function S(e){return"boolean"!=typeof e.schema}function M(e,t){const{schema:r,gen:i,opts:n}=e;n.$comment&&r.$comment&&T(e),O(e),P(e);const s=i.const("_errs",h.default.errors);A(e,s),i.var(t,c._`${s} === ${h.default.errors}`)}function E(e){(0,f.checkUnknownRules)(e),C(e)}function A(e,t){if(e.opts.jtd)return L(e,[],!1,t);const r=(0,n.getSchemaTypes)(e.schema),i=(0,n.coerceAndCheckDataType)(e,r);L(e,r,!i,t)}function C(e){const{schema:t,errSchemaPath:r,opts:i,self:n}=e;t.$ref&&i.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(t,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function $(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,f.checkStrictMode)(e,"default is ignored in the schema root")}function O(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,d.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function P(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function T({gen:e,schemaEnv:t,schema:r,errSchemaPath:i,opts:n}){const s=r.$comment;if(!0===n.$comment)e.code(c._`${h.default.self}.logger.log(${s})`);else if("function"==typeof n.$comment){const r=c.str`${i}/$comment`,n=e.scopeValue("root",{ref:t.root});e.code(c._`${h.default.self}.opts.$comment(${s}, ${r}, ${n}.schema)`)}}function I(e){const{gen:t,schemaEnv:r,validateName:i,ValidationError:n,opts:s}=e;r.$async?t.if(c._`${h.default.errors} === 0`,(()=>t.return(h.default.data)),(()=>t.throw(c._`new ${n}(${h.default.vErrors})`))):(t.assign(c._`${i}.errors`,h.default.vErrors),s.unevaluated&&D(e),t.return(c._`${h.default.errors} === 0`))}function D({gen:e,evaluated:t,props:r,items:i}){r instanceof c.Name&&e.assign(c._`${t}.props`,r),i instanceof c.Name&&e.assign(c._`${t}.items`,i)}function L(e,t,r,i){const{gen:n,schema:a,data:l,allErrors:u,opts:d,self:p}=e,{RULES:m}=p;function g(f){(0,s.shouldUseGroup)(a,f)&&(f.type?(n.if((0,o.checkDataType)(f.type,l,d.strictNumbers)),N(e,f),1===t.length&&t[0]===f.type&&r&&(n.else(),(0,o.reportTypeError)(e)),n.endIf()):N(e,f),u||n.if(c._`${h.default.errors} === ${i||0}`))}!a.$ref||!d.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(a,m)?(d.jtd||R(e,t),n.block((()=>{for(const e of m.rules)g(e);g(m.post)}))):n.block((()=>W(e,"$ref",m.all.$ref.definition)))}function N(e,t){const{gen:r,schema:i,opts:{useDefaults:n}}=e;n&&(0,a.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,s.shouldUseRule)(i,r)&&W(e,r.keyword,r.definition,t.type)}))}function R(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(j(e,t),e.opts.allowUnionTypes||B(e,t),F(e,e.dataTypes))}function j(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{V(e.dataTypes,t)||U(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),q(e,t)):e.dataTypes=t)}function B(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&U(e,"use allowUnionTypes to allow union type keyword")}function F(e,t){const r=e.self.RULES.all;for(const i in r){const n=r[i];if("object"==typeof n&&(0,s.shouldUseRule)(e.schema,n)){const{type:r}=n.definition;r.length&&!r.some((e=>z(t,e)))&&U(e,`missing type "${r.join(",")}" for keyword "${i}"`)}}}function z(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function V(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function q(e,t){const r=[];for(const i of e.dataTypes)V(t,i)?r.push(i):t.includes("integer")&&"number"===i&&r.push("integer");e.dataTypes=r}function U(e,t){const r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,f.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=m;class H{constructor(e,t,r){if((0,l.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,f.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",G(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",h.default.errors))}result(e,t,r){this.failResult((0,c.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(c._`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=c.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=c.nil,t=c.nil){if(!this.$data)return;const{gen:r,schemaCode:i,schemaType:n,def:s}=this;r.if((0,c.or)(c._`${i} === undefined`,t)),e!==c.nil&&r.assign(e,!0),(n.length||s.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:i,it:n}=this;return(0,c.or)(s(),a());function s(){if(r.length){if(!(t instanceof c.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return c._`${(0,o.checkDataTypes)(e,t,n.opts.strictNumbers,o.DataType.Wrong)}`}return c.nil}function a(){if(i.validateSchema){const r=e.scopeValue("validate$data",{ref:i.validateSchema});return c._`!${r}(${t})`}return c.nil}}subschema(e,t){const r=(0,u.getSubschema)(this.it,e);(0,u.extendSubschemaData)(r,this.it,e),(0,u.extendSubschemaMode)(r,e);const i={...this.it,...r,items:void 0,props:void 0};return k(i,t),i}mergeEvaluated(e,t){const{it:r,gen:i}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=f.mergeEvaluated.props(i,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=f.mergeEvaluated.items(i,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:i}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return i.if(t,(()=>this.mergeEvaluated(e,c.Name))),!0}}function W(e,t,r,i){const n=new H(e,r,t);"code"in r?r.code(n,i):n.$data&&r.validate?(0,l.funcKeywordCode)(n,r):"macro"in r?(0,l.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,l.funcKeywordCode)(n,r)}t.KeywordCxt=H;const K=/^\/(?:[^~]|~0|~1)*$/,Y=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function G(e,{dataLevel:t,dataNames:r,dataPathArr:i}){let n,s;if(""===e)return h.default.rootData;if("/"===e[0]){if(!K.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);n=e,s=h.default.rootData}else{const o=Y.exec(e);if(!o)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+o[1];if(n=o[2],"#"===n){if(a>=t)throw new Error(l("property/index",a));return i[t-a]}if(a>t)throw new Error(l("data",a));if(s=r[t-a],!n)return s}let o=s;const a=n.split("/");for(const u of a)u&&(s=c._`${s}${(0,c.getProperty)((0,f.unescapeJsonPointer)(u))}`,o=c._`${o} && ${s}`);return o;function l(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=G},62657:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const i=r(93789),n=r(66735),s=r(21085),o=r(22796);function a(e,t){const{gen:r,keyword:n,schema:s,parentSchema:o,it:a}=e,l=t.macro.call(a.self,s,o,a),u=d(r,n,l);!1!==a.opts.validateSchema&&a.self.validateSchema(l,!0);const c=r.name("valid");e.subschema({schema:l,schemaPath:i.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},c),e.pass(c,(()=>e.error(!0)))}function l(e,t){var r;const{gen:o,keyword:a,schema:l,parentSchema:f,$data:p,it:m}=e;h(m,t);const g=!p&&t.compile?t.compile.call(m.self,l,f,m):t.validate,v=d(o,a,g),y=o.let("valid");function b(){if(!1===t.errors)k(),t.modifying&&u(e),x((()=>e.error()));else{const r=t.async?w():_();t.modifying&&u(e),x((()=>c(e,r)))}}function w(){const e=o.let("ruleErrs",null);return o.try((()=>k(i._`await `)),(t=>o.assign(y,!1).if(i._`${t} instanceof ${m.ValidationError}`,(()=>o.assign(e,i._`${t}.errors`)),(()=>o.throw(t))))),e}function _(){const e=i._`${v}.errors`;return o.assign(e,null),k(i.nil),e}function k(r=(t.async?i._`await `:i.nil)){const a=m.opts.passContext?n.default.this:n.default.self,l=!("compile"in t&&!p||!1===t.schema);o.assign(y,i._`${r}${(0,s.callValidateCode)(e,v,a,l)}`,t.modifying)}function x(e){var r;o.if((0,i.not)(null!==(r=t.valid)&&void 0!==r?r:y),e)}e.block$data(y,b),e.ok(null!==(r=t.valid)&&void 0!==r?r:y)}function u(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,(()=>t.assign(r,i._`${n.parentData}[${n.parentDataProperty}]`)))}function c(e,t){const{gen:r}=e;r.if(i._`Array.isArray(${t})`,(()=>{r.assign(n.default.vErrors,i._`${n.default.vErrors} === null ? ${t} : ${n.default.vErrors}.concat(${t})`).assign(n.default.errors,i._`${n.default.vErrors}.length`),(0,o.extendErrors)(e)}),(()=>e.error()))}function h({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function d(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,i.stringify)(r)})}function f(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&"undefined"==typeof e))}function p({schema:e,opts:t,self:r,errSchemaPath:i},n,s){if(Array.isArray(n.keyword)?!n.keyword.includes(s):n.keyword!==s)throw new Error("ajv implementation error");const o=n.dependencies;if(null===o||void 0===o?void 0:o.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(n.validateSchema){const o=n.validateSchema(e[s]);if(!o){const e=`keyword "${s}" value is invalid at path "${i}": `+r.errorsText(n.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}}t.macroKeywordCode=a,t.funcKeywordCode=l,t.validSchemaType=f,t.validateKeywordUsage=p},19543:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const i=r(93789),n=r(7083);function s(e,{keyword:t,schemaProp:r,schema:s,schemaPath:o,errSchemaPath:a,topSchemaRef:l}){if(void 0!==t&&void 0!==s)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const s=e.schema[t];return void 0===r?{schema:s,schemaPath:i._`${e.schemaPath}${(0,i.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[r],schemaPath:i._`${e.schemaPath}${(0,i.getProperty)(t)}${(0,i.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,n.escapeFragment)(r)}`}}if(void 0!==s){if(void 0===o||void 0===a||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:o,topSchemaRef:l,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')}function o(e,t,{dataProp:r,dataPropType:s,data:o,dataTypes:a,propertyName:l}){if(void 0!==o&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:u}=t;if(void 0!==r){const{errorPath:o,dataPathArr:a,opts:l}=t,h=u.let("data",i._`${t.data}${(0,i.getProperty)(r)}`,!0);c(h),e.errorPath=i.str`${o}${(0,n.getErrorPath)(r,s,l.jsPropertySyntax)}`,e.parentDataProperty=i._`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}if(void 0!==o){const t=o instanceof i.Name?o:u.let("data",o,!0);c(t),void 0!==l&&(e.propertyName=l)}function c(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}a&&(e.dataTypes=a)}function a(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:i,createErrors:n,allErrors:s}){void 0!==i&&(e.compositeRule=i),void 0!==n&&(e.createErrors=n),void 0!==s&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=r}t.getSubschema=s,t.extendSubschemaData=o,t.extendSubschemaMode=a},17666:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var i=r(69810);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return i.KeywordCxt}});var n=r(93789);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const s=r(99598),o=r(70303),a=r(27476),l=r(65219),u=r(93789),c=r(63043),h=r(28840),d=r(7083),f=r(37301),p=r(76976),m=(e,t)=>new RegExp(e,t);m.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},b={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},w=200;function _(e){var t,r,i,n,s,o,a,l,u,c,h,d,f,g,v,y,b,_,k,x,S,M,E,A,C;const $=e.strict,O=null===(t=e.code)||void 0===t?void 0:t.optimize,P=!0===O||void 0===O?1:O||0,T=null!==(i=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==i?i:m,I=null!==(n=e.uriResolver)&&void 0!==n?n:p.default;return{strictSchema:null===(o=null!==(s=e.strictSchema)&&void 0!==s?s:$)||void 0===o||o,strictNumbers:null===(l=null!==(a=e.strictNumbers)&&void 0!==a?a:$)||void 0===l||l,strictTypes:null!==(c=null!==(u=e.strictTypes)&&void 0!==u?u:$)&&void 0!==c?c:"log",strictTuples:null!==(d=null!==(h=e.strictTuples)&&void 0!==h?h:$)&&void 0!==d?d:"log",strictRequired:null!==(g=null!==(f=e.strictRequired)&&void 0!==f?f:$)&&void 0!==g&&g,code:e.code?{...e.code,optimize:P,regExp:T}:{optimize:P,regExp:T},loopRequired:null!==(v=e.loopRequired)&&void 0!==v?v:w,loopEnum:null!==(y=e.loopEnum)&&void 0!==y?y:w,meta:null===(b=e.meta)||void 0===b||b,messages:null===(_=e.messages)||void 0===_||_,inlineRefs:null===(k=e.inlineRefs)||void 0===k||k,schemaId:null!==(x=e.schemaId)&&void 0!==x?x:"$id",addUsedSchema:null===(S=e.addUsedSchema)||void 0===S||S,validateSchema:null===(M=e.validateSchema)||void 0===M||M,validateFormats:null===(E=e.validateFormats)||void 0===E||E,unicodeRegExp:null===(A=e.unicodeRegExp)||void 0===A||A,int32range:null===(C=e.int32range)||void 0===C||C,uriResolver:I}}class k{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,..._(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:v,es5:t,lines:r}),this.logger=O(e.logger);const i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),x.call(this,y,e,"NOT SUPPORTED"),x.call(this,b,e,"DEPRECATED","warn"),this._metaOpts=C.call(this),e.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&A.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),M.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let i=f;"id"===r&&(i={...f},i.id=i.$id,delete i.$id),t&&e&&this.addMetaSchema(i,i[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const i=r(t);return"$async"in r||(this.errors=r.errors),i}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return i.call(this,e,t);async function i(e,t){await n.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||s.call(this,r)}async function n(e){e&&!this.getSchema(e)&&await i.call(this,{$ref:e},!0)}async function s(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.default))throw t;return a.call(this,t),await l.call(this,t.missingSchema),s.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){const r=await u.call(this,e);this.refs[e]||await n.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,i=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,i);return this}let n;if("object"===typeof e){const{schemaId:t}=this.opts;if(n=e[t],void 0!==n&&"string"!=typeof n)throw new Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||n),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,i,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const i=this.validate(r,e);if(!i&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return i}getSchema(e){let t;while("string"==typeof(t=S.call(this,e)))e=t;if(void 0===t){const{schemaId:r}=this.opts,i=new l.SchemaEnv({schema:{},schemaId:r});if(t=l.resolveSchema.call(this,i,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=S.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,c.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(T.call(this,r,t),!t)return(0,d.eachItem)(r,(e=>I.call(this,e))),this;L.call(this,t);const i={...t,type:(0,h.getJSONTypes)(t.type),schemaType:(0,h.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(r,0===i.type.length?e=>I.call(this,e,i):e=>i.type.forEach((t=>I.call(this,e,i,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const i of t){const t=i.split("/").slice(1);let n=e;for(const e of t)n=n[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:i}=t.definition,s=n[e];i&&s&&(n[e]=R(s))}}return e}_removeAllSchemas(e,t){for(const r in e){const i=e[r];t&&!t.test(r)||("string"==typeof i?delete e[r]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[r]))}}_addSchema(e,t,r,i=this.opts.validateSchema,n=this.opts.addUsedSchema){let s;const{schemaId:o}=this.opts;if("object"==typeof e)s=e[o];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;r=(0,c.normalizeId)(s||r);const u=c.getSchemaRefs.call(this,e,r);return a=new l.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:r,localRefs:u}),this._cache.set(a.schema,a),n&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),i&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):l.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,e)}finally{this.opts=t}}}function x(e,t,r,i="error"){for(const n in e){const s=n;s in t&&this.logger[i](`${r}: option ${n}. ${e[s]}`)}}function S(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function M(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function E(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function A(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function C(){const e={...this.opts};for(const t of g)delete e[t];return e}k.ValidationError=s.default,k.MissingRefError=o.default,t["default"]=k;const $={log(){},warn(){},error(){}};function O(e){if(!1===e)return $;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}const P=/^[a-z_$][a-z0-9_$:-]*$/i;function T(e,t){const{RULES:r}=this;if((0,d.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!P.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function I(e,t,r){var i;const n=null===t||void 0===t?void 0:t.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:s}=this;let o=n?s.post:s.rules.find((({type:e})=>e===r));if(o||(o={type:r,rules:[]},s.rules.push(o)),s.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,h.getJSONTypes)(t.type),schemaType:(0,h.getJSONTypes)(t.schemaType)}};t.before?D.call(this,o,a,t.before):o.rules.push(a),s.all[e]=a,null===(i=t.implements)||void 0===i||i.forEach((e=>this.addKeyword(e)))}function D(e,t,r){const i=e.rules.findIndex((e=>e.keyword===r));i>=0?e.rules.splice(i,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function L(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=R(t)),e.validateSchema=this.compile(t,!0))}const N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function R(e){return{anyOf:[e,N]}}},72482:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(32017);i.code='require("ajv/dist/runtime/equal").default',t["default"]=i},82261:function(e,t){"use strict";function r(e){const t=e.length;let r,i=0,n=0;while(n=55296&&r<=56319&&ni.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>i._`{limit: ${e}}`},o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:s,code(e){const{parentSchema:t,it:r}=e,{items:i}=t;Array.isArray(i)?a(e,i):(0,n.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function a(e,t){const{gen:r,schema:s,data:o,keyword:a,it:l}=e;l.items=!0;const u=r.const("len",i._`${o}.length`);if(!1===s)e.setParams({len:t.length}),e.pass(i._`${u} <= ${t.length}`);else if("object"==typeof s&&!(0,n.alwaysValidSchema)(l,s)){const n=r.var("valid",i._`${u} <= ${t.length}`);r.if((0,i.not)(n),(()=>c(n))),e.ok(n)}function c(s){r.forRange("i",t.length,u,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:n.Type.Num},s),l.allErrors||r.if((0,i.not)(s),(()=>r.break()))}))}}t.validateAdditionalItems=a,t["default"]=o},90396:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(21085),n=r(93789),s=r(66735),o=r(7083),a={message:"must NOT have additional properties",params:({params:e})=>n._`{additionalProperty: ${e.additionalProperty}}`},l={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:a,code(e){const{gen:t,schema:r,parentSchema:a,data:l,errsCount:u,it:c}=e;if(!u)throw new Error("ajv implementation error");const{allErrors:h,opts:d}=c;if(c.props=!0,"all"!==d.removeAdditional&&(0,o.alwaysValidSchema)(c,r))return;const f=(0,i.allSchemaProperties)(a.properties),p=(0,i.allSchemaProperties)(a.patternProperties);function m(){t.forIn("key",l,(e=>{f.length||p.length?t.if(g(e),(()=>y(e))):y(e)}))}function g(r){let s;if(f.length>8){const e=(0,o.schemaRefOrVal)(c,a.properties,"properties");s=(0,i.isOwnProperty)(t,e,r)}else s=f.length?(0,n.or)(...f.map((e=>n._`${r} === ${e}`))):n.nil;return p.length&&(s=(0,n.or)(s,...p.map((t=>n._`${(0,i.usePattern)(e,t)}.test(${r})`)))),(0,n.not)(s)}function v(e){t.code(n._`delete ${l}[${e}]`)}function y(i){if("all"===d.removeAdditional||d.removeAdditional&&!1===r)v(i);else{if(!1===r)return e.setParams({additionalProperty:i}),e.error(),void(h||t.break());if("object"==typeof r&&!(0,o.alwaysValidSchema)(c,r)){const r=t.name("valid");"failing"===d.removeAdditional?(b(i,r,!1),t.if((0,n.not)(r),(()=>{e.reset(),v(i)}))):(b(i,r),h||t.if((0,n.not)(r),(()=>t.break())))}}}function b(t,r,i){const n={keyword:"additionalProperties",dataProp:t,dataPropType:o.Type.Str};!1===i&&Object.assign(n,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(n,r)}m(),e.ok(n._`${u} === ${s.default.errors}`)}};t["default"]=l},66636:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(7083),n={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=t.name("valid");r.forEach(((t,r)=>{if((0,i.alwaysValidSchema)(n,t))return;const o=e.subschema({keyword:"allOf",schemaProp:r},s);e.ok(s),e.mergeEvaluated(o)}))}};t["default"]=n},41665:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(21085),n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:i.validateUnion,error:{message:"must match a schema in anyOf"}};t["default"]=n},96925:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n=r(7083),s={message:({params:{min:e,max:t}})=>void 0===t?i.str`must contain at least ${e} valid item(s)`:i.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?i._`{minContains: ${e}}`:i._`{minContains: ${e}, maxContains: ${t}}`},o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:s,code(e){const{gen:t,schema:r,parentSchema:s,data:o,it:a}=e;let l,u;const{minContains:c,maxContains:h}=s;a.opts.next?(l=void 0===c?1:c,u=h):l=1;const d=t.const("len",i._`${o}.length`);if(e.setParams({min:l,max:u}),void 0===u&&0===l)return void(0,n.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==u&&l>u)return(0,n.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,n.alwaysValidSchema)(a,r)){let t=i._`${d} >= ${l}`;return void 0!==u&&(t=i._`${t} && ${d} <= ${u}`),void e.pass(t)}a.items=!0;const f=t.name("valid");function p(){const e=t.name("_valid"),r=t.let("count",0);m(e,(()=>t.if(e,(()=>g(r)))))}function m(r,i){t.forRange("i",0,d,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:n.Type.Num,compositeRule:!0},r),i()}))}function g(e){t.code(i._`${e}++`),void 0===u?t.if(i._`${e} >= ${l}`,(()=>t.assign(f,!0).break())):(t.if(i._`${e} > ${u}`,(()=>t.assign(f,!1).break())),1===l?t.assign(f,!0):t.if(i._`${e} >= ${l}`,(()=>t.assign(f,!0))))}void 0===u&&1===l?m(f,(()=>t.if(f,(()=>t.break())))):0===l?(t.let(f,!0),void 0!==u&&t.if(i._`${o}.length > 0`,p)):(t.let(f,!1),p()),e.result(f,(()=>e.reset()))}};t["default"]=o},71273:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const i=r(93789),n=r(7083),s=r(21085);t.error={message:({params:{property:e,depsCount:t,deps:r}})=>{const n=1===t?"property":"properties";return i.str`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>i._`{property: ${e}, missingProperty: ${n}, depsCount: ${t}, - deps: ${r}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,r]=a(e);l(e,t),u(e,r)}};function a({schema:e}){const t={},r={};for(const i in e){if("__proto__"===i)continue;const n=Array.isArray(e[i])?t:r;n[i]=e[i]}return[t,r]}function l(e,t=e.schema){const{gen:r,data:n,it:o}=e;if(0===Object.keys(t).length)return;const a=r.let("missing");for(const l in t){const u=t[l];if(0===u.length)continue;const c=(0,s.propertyInData)(r,n,l,o.opts.ownProperties);e.setParams({property:l,depsCount:u.length,deps:u.join(", ")}),o.allErrors?r.if(c,(()=>{for(const t of u)(0,s.checkReportMissingProp)(e,t)})):(r.if(i._`${c} && (${(0,s.checkMissingProp)(e,u,a)})`),(0,s.reportMissingProp)(e,a),r.else())}}function u(e,t=e.schema){const{gen:r,data:i,keyword:o,it:a}=e,l=r.name("valid");for(const u in t)(0,n.alwaysValidSchema)(a,t[u])||(r.if((0,s.propertyInData)(r,i,u,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:o,schemaProp:u},l);e.mergeValidEvaluated(t,l)}),(()=>r.var(l,!0))),e.ok(l))}t.validatePropertyDeps=l,t.validateSchemaDeps=u,t["default"]=o},7567:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n=r(7083),s={message:({params:e})=>i.str`must match "${e.ifClause}" schema`,params:({params:e})=>i._`{failingKeyword: ${e.ifClause}}`},o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:s,code(e){const{gen:t,parentSchema:r,it:s}=e;void 0===r.then&&void 0===r.else&&(0,n.checkStrictMode)(s,'"if" without "then" and "else" is ignored');const o=a(s,"then"),l=a(s,"else");if(!o&&!l)return;const u=t.let("valid",!0),c=t.name("_valid");if(h(),e.reset(),o&&l){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(c,d("then",r),d("else",r))}else o?t.if(c,d("then")):t.if((0,i.not)(c),d("else"));function h(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);e.mergeEvaluated(t)}function d(r,n){return()=>{const s=e.subschema({keyword:r},c);t.assign(u,c),e.mergeValidEvaluated(s,u),n?t.assign(n,i._`${r}`):e.setParams({ifClause:r})}}e.pass(u,(()=>e.error(!0)))}};function a(e,t){const r=e.schema[t];return void 0!==r&&!(0,n.alwaysValidSchema)(e,r)}t["default"]=o},52610:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(57065),n=r(47394),s=r(67366),o=r(56166),a=r(96925),l=r(71273),u=r(7705),c=r(90396),h=r(55581),d=r(78013),f=r(6939),p=r(41665),m=r(9259),g=r(66636),v=r(7567),y=r(70866);function b(e=!1){const t=[f.default,p.default,m.default,g.default,v.default,y.default,u.default,c.default,l.default,h.default,d.default];return e?t.push(n.default,o.default):t.push(i.default,s.default),t.push(a.default),t}t["default"]=b},67366:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const i=r(93789),n=r(7083),s=r(21085),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return a(e,"additionalItems",t);r.items=!0,(0,n.alwaysValidSchema)(r,t)||e.ok((0,s.validateArray)(e))}};function a(e,t,r=e.schema){const{gen:s,parentSchema:o,data:a,keyword:l,it:u}=e;d(o),u.opts.unevaluated&&r.length&&!0!==u.items&&(u.items=n.mergeEvaluated.items(s,r.length,u.items));const c=s.name("valid"),h=s.const("len",i._`${a}.length`);function d(e){const{opts:i,errSchemaPath:s}=u,o=r.length,a=o===e.minItems&&(o===e.maxItems||!1===e[t]);if(i.strictTuples&&!a){const e=`"${l}" is ${o}-tuple, but minItems or maxItems/${t} are not specified or different at path "${s}"`;(0,n.checkStrictMode)(u,e,i.strictTuples)}}r.forEach(((t,r)=>{(0,n.alwaysValidSchema)(u,t)||(s.if(i._`${h} > ${r}`,(()=>e.subschema({keyword:l,schemaProp:r,dataProp:r},c))),e.ok(c))}))}t.validateTuple=a,t["default"]=o},56166:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n=r(7083),s=r(21085),o=r(57065),a={message:({params:{len:e}})=>i.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>i._`{limit: ${e}}`},l={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:a,code(e){const{schema:t,parentSchema:r,it:i}=e,{prefixItems:a}=r;i.items=!0,(0,n.alwaysValidSchema)(i,t)||(a?(0,o.validateAdditionalItems)(e,a):e.ok((0,s.validateArray)(e)))}};t["default"]=l},6939:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(7083),n={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,i.alwaysValidSchema)(n,r))return void e.fail();const s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t["default"]=n},9259:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n=r(7083),s={message:"must match exactly one schema in oneOf",params:({params:e})=>i._`{passingSchemas: ${e.passing}}`},o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:s,code(e){const{gen:t,schema:r,parentSchema:s,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&s.discriminator)return;const a=r,l=t.let("valid",!1),u=t.let("passing",null),c=t.name("_valid");function h(){a.forEach(((r,s)=>{let a;(0,n.alwaysValidSchema)(o,r)?t.var(c,!0):a=e.subschema({keyword:"oneOf",schemaProp:s,compositeRule:!0},c),s>0&&t.if(i._`${c} && ${l}`).assign(l,!1).assign(u,i._`[${u}, ${s}]`).else(),t.if(c,(()=>{t.assign(l,!0),t.assign(u,s),a&&e.mergeEvaluated(a,i.Name)}))}))}e.setParams({passing:u}),t.block(h),e.result(l,(()=>e.reset()),(()=>e.error(!0)))}};t["default"]=o},78013:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(21085),n=r(93789),s=r(7083),o=r(7083),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:a,parentSchema:l,it:u}=e,{opts:c}=u,h=(0,i.allSchemaProperties)(r),d=h.filter((e=>(0,s.alwaysValidSchema)(u,r[e])));if(0===h.length||d.length===h.length&&(!u.opts.unevaluated||!0===u.props))return;const f=c.strictSchema&&!c.allowMatchingProperties&&l.properties,p=t.name("valid");!0===u.props||u.props instanceof n.Name||(u.props=(0,o.evaluatedPropsToName)(t,u.props));const{props:m}=u;function g(){for(const e of h)f&&v(e),u.allErrors?y(e):(t.var(p,!0),y(e),t.if(p))}function v(e){for(const t in f)new RegExp(e).test(t)&&(0,s.checkStrictMode)(u,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function y(r){t.forIn("key",a,(s=>{t.if(n._`${(0,i.usePattern)(e,r)}.test(${s})`,(()=>{const i=d.includes(r);i||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:s,dataPropType:o.Type.Str},p),u.opts.unevaluated&&!0!==m?t.assign(n._`${m}[${s}]`,!0):i||u.allErrors||t.if((0,n.not)(p),(()=>t.break()))}))}))}g()}};t["default"]=a},47394:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(67366),n={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,i.validateTuple)(e,"items")};t["default"]=n},55581:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(69810),n=r(21085),s=r(7083),o=r(90396),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:a,data:l,it:u}=e;"all"===u.opts.removeAdditional&&void 0===a.additionalProperties&&o.default.code(new i.KeywordCxt(u,o.default,"additionalProperties"));const c=(0,n.allSchemaProperties)(r);for(const i of c)u.definedProperties.add(i);u.opts.unevaluated&&c.length&&!0!==u.props&&(u.props=s.mergeEvaluated.props(t,(0,s.toHash)(c),u.props));const h=c.filter((e=>!(0,s.alwaysValidSchema)(u,r[e])));if(0===h.length)return;const d=t.name("valid");for(const i of h)f(i)?p(i):(t.if((0,n.propertyInData)(t,l,i,u.opts.ownProperties)),p(i),u.allErrors||t.else().var(d,!0),t.endIf()),e.it.definedProperties.add(i),e.ok(d);function f(e){return u.opts.useDefaults&&!u.compositeRule&&void 0!==r[e].default}function p(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},d)}}};t["default"]=a},7705:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n=r(7083),s={message:"property name must be valid",params:({params:e})=>i._`{propertyName: ${e.propertyName}}`},o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:s,code(e){const{gen:t,schema:r,data:s,it:o}=e;if((0,n.alwaysValidSchema)(o,r))return;const a=t.name("valid");t.forIn("key",s,(r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},a),t.if((0,i.not)(a),(()=>{e.error(!0),o.allErrors||t.break()}))})),e.ok(a)}};t["default"]=o},70866:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(7083),n={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,i.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};t["default"]=n},21085:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const i=r(93789),n=r(7083),s=r(66735),o=r(7083);function a(e,t){const{gen:r,data:n,it:s}=e;r.if(f(r,n,t,s.opts.ownProperties),(()=>{e.setParams({missingProperty:i._`${t}`},!0),e.error()}))}function l({gen:e,data:t,it:{opts:r}},n,s){return(0,i.or)(...n.map((n=>(0,i.and)(f(e,t,n,r.ownProperties),i._`${s} = ${n}`))))}function u(e,t){e.setParams({missingProperty:t},!0),e.error()}function c(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:i._`Object.prototype.hasOwnProperty`})}function h(e,t,r){return i._`${c(e)}.call(${t}, ${r})`}function d(e,t,r,n){const s=i._`${t}${(0,i.getProperty)(r)} !== undefined`;return n?i._`${s} && ${h(e,t,r)}`:s}function f(e,t,r,n){const s=i._`${t}${(0,i.getProperty)(r)} === undefined`;return n?(0,i.or)(s,(0,i.not)(h(e,t,r))):s}function p(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}function m(e,t){return p(t).filter((r=>!(0,n.alwaysValidSchema)(e,t[r])))}function g({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:a},it:l},u,c,h){const d=h?i._`${e}, ${t}, ${n}${o}`:t,f=[[s.default.instancePath,(0,i.strConcat)(s.default.instancePath,a)],[s.default.parentData,l.parentData],[s.default.parentDataProperty,l.parentDataProperty],[s.default.rootData,s.default.rootData]];l.opts.dynamicRef&&f.push([s.default.dynamicAnchors,s.default.dynamicAnchors]);const p=i._`${d}, ${r.object(...f)}`;return c!==i.nil?i._`${u}.call(${c}, ${p})`:i._`${u}(${p})`}t.checkReportMissingProp=a,t.checkMissingProp=l,t.reportMissingProp=u,t.hasPropFunc=c,t.isOwnProperty=h,t.propertyInData=d,t.noPropertyInData=f,t.allSchemaProperties=p,t.schemaProperties=m,t.callValidateCode=g;const v=i._`new RegExp`;function y({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,a=s(r,n);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:i._`${"new RegExp"===s.code?v:(0,o.useFunc)(e,s)}(${r}, ${n})`})}function b(e){const{gen:t,data:r,keyword:s,it:o}=e,a=t.name("valid");if(o.allErrors){const e=t.let("valid",!0);return l((()=>t.assign(e,!1))),e}return t.var(a,!0),l((()=>t.break())),a;function l(o){const l=t.const("len",i._`${r}.length`);t.forRange("i",0,l,(r=>{e.subschema({keyword:s,dataProp:r,dataPropType:n.Type.Num},a),t.if((0,i.not)(a),o)}))}}function w(e){const{gen:t,schema:r,keyword:s,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const a=r.some((e=>(0,n.alwaysValidSchema)(o,e)));if(a&&!o.opts.unevaluated)return;const l=t.let("valid",!1),u=t.name("_valid");t.block((()=>r.forEach(((r,n)=>{const o=e.subschema({keyword:s,schemaProp:n,compositeRule:!0},u);t.assign(l,i._`${l} || ${u}`);const a=e.mergeValidEvaluated(o,u);a||t.if((0,i.not)(l))})))),e.result(l,(()=>e.reset()),(()=>e.error(!0)))}t.usePattern=y,t.validateArray=b,t.validateUnion=w},47103:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t["default"]=r},90344:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(47103),n=r(29045),s=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",i.default,n.default];t["default"]=s},29045:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const i=r(70303),n=r(21085),s=r(93789),o=r(66735),a=r(65219),l=r(7083),u={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:l,validateName:u,opts:d,self:f}=n,{root:p}=l;if(("#"===r||"#/"===r)&&o===p.baseId)return g();const m=a.resolveRef.call(f,p,o,r);if(void 0===m)throw new i.default(n.opts.uriResolver,o,r);return m instanceof a.SchemaEnv?v(m):y(m);function g(){if(l===p)return h(e,u,l,l.$async);const r=t.scopeValue("root",{ref:p});return h(e,s._`${r}.validate`,p,p.$async)}function v(t){const r=c(e,t);h(e,r,t,t.$async)}function y(i){const n=t.scopeValue("schema",!0===d.code.source?{ref:i,code:(0,s.stringify)(i)}:{ref:i}),o=t.name("valid"),a=e.subschema({schema:i,dataTypes:[],schemaPath:s.nil,topSchemaRef:n,errSchemaPath:r},o);e.mergeEvaluated(a),e.ok(o)}}};function c(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):s._`${r.scopeValue("wrapper",{ref:t})}.validate`}function h(e,t,r,i){const{gen:a,it:u}=e,{allErrors:c,schemaEnv:h,opts:d}=u,f=d.passContext?o.default.this:s.nil;function p(){if(!h.$async)throw new Error("async schema referenced by sync schema");const r=a.let("valid");a.try((()=>{a.code(s._`await ${(0,n.callValidateCode)(e,t,f)}`),v(t),c||a.assign(r,!0)}),(e=>{a.if(s._`!(${e} instanceof ${u.ValidationError})`,(()=>a.throw(e))),g(e),c||a.assign(r,!1)})),e.ok(r)}function m(){e.result((0,n.callValidateCode)(e,t,f),(()=>v(t)),(()=>g(t)))}function g(e){const t=s._`${e}.errors`;a.assign(o.default.vErrors,s._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`),a.assign(o.default.errors,s._`${o.default.vErrors}.length`)}function v(e){var t;if(!u.opts.unevaluated)return;const i=null===(t=null===r||void 0===r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==u.props)if(i&&!i.dynamicProps)void 0!==i.props&&(u.props=l.mergeEvaluated.props(a,i.props,u.props));else{const t=a.var("props",s._`${e}.evaluated.props`);u.props=l.mergeEvaluated.props(a,t,u.props,s.Name)}if(!0!==u.items)if(i&&!i.dynamicItems)void 0!==i.items&&(u.items=l.mergeEvaluated.items(a,i.items,u.items));else{const t=a.var("items",s._`${e}.evaluated.items`);u.items=l.mergeEvaluated.items(a,t,u.items,s.Name)}}i?p():m()}t.getValidate=c,t.callRef=h,t["default"]=u},77013:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n=r(27420),s=r(65219),o=r(70303),a=r(7083),l={message:({params:{discrError:e,tagName:t}})=>e===n.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>i._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},u={keyword:"discriminator",type:"object",schemaType:"object",error:l,code(e){const{gen:t,data:r,schema:l,parentSchema:u,it:c}=e,{oneOf:h}=u;if(!c.opts.discriminator)throw new Error("discriminator: requires discriminator option");const d=l.propertyName;if("string"!=typeof d)throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!h)throw new Error("discriminator: requires oneOf keyword");const f=t.let("valid",!1),p=t.const("tag",i._`${r}${(0,i.getProperty)(d)}`);function m(){const r=v();t.if(!1);for(const e in r)t.elseIf(i._`${p} === ${e}`),t.assign(f,g(r[e]));t.else(),e.error(!1,{discrError:n.DiscrError.Mapping,tag:p,tagName:d}),t.endIf()}function g(r){const n=t.name("valid"),s=e.subschema({keyword:"oneOf",schemaProp:r},n);return e.mergeEvaluated(s,i.Name),n}function v(){var e;const t={},r=n(u);let i=!0;for(let u=0;um()),(()=>e.error(!1,{discrError:n.DiscrError.Tag,tag:p,tagName:d}))),e.ok(f)}};t["default"]=u},27420:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e["Tag"]="tag",e["Mapping"]="mapping"}(r||(t.DiscrError=r={}))},4824:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(90344),n=r(92348),s=r(52610),o=r(32884),a=r(73929),l=[i.default,n.default,(0,s.default)(),o.default,a.metadataVocabulary,a.contentVocabulary];t["default"]=l},40329:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n={message:({schemaCode:e})=>i.str`must match format "${e}"`,params:({schemaCode:e})=>i._`{format: ${e}}`},s={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:n,code(e,t){const{gen:r,data:n,$data:s,schema:o,schemaCode:a,it:l}=e,{opts:u,errSchemaPath:c,schemaEnv:h,self:d}=l;function f(){const s=r.scopeValue("formats",{ref:d.formats,code:u.code.formats}),o=r.const("fDef",i._`${s}[${a}]`),l=r.let("fType"),c=r.let("format");function f(){return!1===u.strictSchema?i.nil:i._`${a} && !${c}`}function p(){const e=h.$async?i._`(${o}.async ? await ${c}(${n}) : ${c}(${n}))`:i._`${c}(${n})`,r=i._`(typeof ${c} == "function" ? ${e} : ${c}.test(${n}))`;return i._`${c} && ${c} !== true && ${l} === ${t} && !${r}`}r.if(i._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(l,i._`${o}.type || "string"`).assign(c,i._`${o}.validate`)),(()=>r.assign(l,i._`"string"`).assign(c,o))),e.fail$data((0,i.or)(f(),p()))}function p(){const s=d.formats[o];if(!s)return void p();if(!0===s)return;const[a,l,f]=m(s);function p(){if(!1!==u.strictSchema)throw new Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${c}"`}d.logger.warn(e())}function m(e){const t=e instanceof RegExp?(0,i.regexpCode)(e):u.code.formats?i._`${u.code.formats}${(0,i.getProperty)(o)}`:void 0,n=r.scopeValue("formats",{key:o,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,n]:[e.type||"string",e.validate,i._`${n}.validate`]}function g(){if("object"==typeof s&&!(s instanceof RegExp)&&s.async){if(!h.$async)throw new Error("async format in sync schema");return i._`await ${f}(${n})`}return"function"==typeof l?i._`${f}(${n})`:i._`${f}.test(${n})`}a===t&&e.pass(g())}u.validateFormats&&(s?f():p())}};t["default"]=s},32884:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(40329),n=[i.default];t["default"]=n},73929:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},3767:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n=r(7083),s=r(72482),o={message:"must be equal to constant",params:({schemaCode:e})=>i._`{allowedValue: ${e}}`},a={keyword:"const",$data:!0,error:o,code(e){const{gen:t,data:r,$data:o,schemaCode:a,schema:l}=e;o||l&&"object"==typeof l?e.fail$data(i._`!${(0,n.useFunc)(t,s.default)}(${r}, ${a})`):e.fail(i._`${l} !== ${r}`)}};t["default"]=a},64715:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n=r(7083),s=r(72482),o={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>i._`{allowedValues: ${e}}`},a={keyword:"enum",schemaType:"array",$data:!0,error:o,code(e){const{gen:t,data:r,$data:o,schema:a,schemaCode:l,it:u}=e;if(!o&&0===a.length)throw new Error("enum must have non-empty array");const c=a.length>=u.opts.loopEnum;let h;const d=()=>null!==h&&void 0!==h?h:h=(0,n.useFunc)(t,s.default);let f;if(c||o)f=t.let("valid"),e.block$data(f,p);else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",l);f=(0,i.or)(...a.map(((t,r)=>m(e,r))))}function p(){t.assign(f,!1),t.forOf("v",l,(e=>t.if(i._`${d()}(${r}, ${e})`,(()=>t.assign(f,!0).break()))))}function m(e,t){const n=a[t];return"object"===typeof n&&null!==n?i._`${d()}(${r}, ${e}[${t}])`:i._`${r} === ${n}`}e.pass(f)}};t["default"]=a},92348:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(80450),n=r(56711),s=r(83875),o=r(50302),a=r(38094),l=r(4267),u=r(99347),c=r(42785),h=r(3767),d=r(64715),f=[i.default,n.default,s.default,o.default,a.default,l.default,u.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},h.default,d.default];t["default"]=f},99347:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n={message({keyword:e,schemaCode:t}){const r="maxItems"===e?"more":"fewer";return i.str`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>i._`{limit: ${e}}`},s={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:n,code(e){const{keyword:t,data:r,schemaCode:n}=e,s="maxItems"===t?i.operators.GT:i.operators.LT;e.fail$data(i._`${r}.length ${s} ${n}`)}};t["default"]=s},83875:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n=r(7083),s=r(82261),o={message({keyword:e,schemaCode:t}){const r="maxLength"===e?"more":"fewer";return i.str`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>i._`{limit: ${e}}`},a={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:o,code(e){const{keyword:t,data:r,schemaCode:o,it:a}=e,l="maxLength"===t?i.operators.GT:i.operators.LT,u=!1===a.opts.unicode?i._`${r}.length`:i._`${(0,n.useFunc)(e.gen,s.default)}(${r})`;e.fail$data(i._`${u} ${l} ${o}`)}};t["default"]=a},80450:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n=i.operators,s={maximum:{okStr:"<=",ok:n.LTE,fail:n.GT},minimum:{okStr:">=",ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},o={message:({keyword:e,schemaCode:t})=>i.str`must be ${s[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>i._`{comparison: ${s[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(s),type:"number",schemaType:"number",$data:!0,error:o,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data(i._`${r} ${s[t].fail} ${n} || isNaN(${r})`)}};t["default"]=a},38094:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n={message({keyword:e,schemaCode:t}){const r="maxProperties"===e?"more":"fewer";return i.str`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>i._`{limit: ${e}}`},s={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:n,code(e){const{keyword:t,data:r,schemaCode:n}=e,s="maxProperties"===t?i.operators.GT:i.operators.LT;e.fail$data(i._`Object.keys(${r}).length ${s} ${n}`)}};t["default"]=s},56711:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(93789),n={message:({schemaCode:e})=>i.str`must be multiple of ${e}`,params:({schemaCode:e})=>i._`{multipleOf: ${e}}`},s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:n,code(e){const{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,a=t.let("res"),l=o?i._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:i._`${a} !== parseInt(${a})`;e.fail$data(i._`(${n} === 0 || (${a} = ${r}/${n}, ${l}))`)}};t["default"]=s},50302:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(21085),n=r(93789),s={message:({schemaCode:e})=>n.str`must match pattern "${e}"`,params:({schemaCode:e})=>n._`{pattern: ${e}}`},o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:s,code(e){const{data:t,$data:r,schema:s,schemaCode:o,it:a}=e,l=a.opts.unicodeRegExp?"u":"",u=r?n._`(new RegExp(${o}, ${l}))`:(0,i.usePattern)(e,s);e.fail$data(n._`!${u}.test(${t})`)}};t["default"]=o},4267:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(21085),n=r(93789),s=r(7083),o={message:({params:{missingProperty:e}})=>n.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>n._`{missingProperty: ${e}}`},a={keyword:"required",type:"object",schemaType:"array",$data:!0,error:o,code(e){const{gen:t,schema:r,schemaCode:o,data:a,$data:l,it:u}=e,{opts:c}=u;if(!l&&0===r.length)return;const h=r.length>=c.loopRequired;if(u.allErrors?d():f(),c.strictRequired){const t=e.parentSchema.properties,{definedProperties:i}=e.it;for(const e of r)if(void 0===(null===t||void 0===t?void 0:t[e])&&!i.has(e)){const t=u.schemaEnv.baseId+u.errSchemaPath,r=`required property "${e}" is not defined at "${t}" (strictRequired)`;(0,s.checkStrictMode)(u,r,u.opts.strictRequired)}}function d(){if(h||l)e.block$data(n.nil,p);else for(const t of r)(0,i.checkReportMissingProp)(e,t)}function f(){const n=t.let("missing");if(h||l){const r=t.let("valid",!0);e.block$data(r,(()=>m(n,r))),e.ok(r)}else t.if((0,i.checkMissingProp)(e,r,n)),(0,i.reportMissingProp)(e,n),t.else()}function p(){t.forOf("prop",o,(r=>{e.setParams({missingProperty:r}),t.if((0,i.noPropertyInData)(t,a,r,c.ownProperties),(()=>e.error()))}))}function m(r,s){e.setParams({missingProperty:r}),t.forOf(r,o,(()=>{t.assign(s,(0,i.propertyInData)(t,a,r,c.ownProperties)),t.if((0,n.not)(s),(()=>{e.error(),t.break()}))}),n.nil)}}};t["default"]=a},42785:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(28840),n=r(93789),s=r(7083),o=r(72482),a={message:({params:{i:e,j:t}})=>n.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>n._`{i: ${e}, j: ${t}}`},l={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:a,code(e){const{gen:t,data:r,$data:a,schema:l,parentSchema:u,schemaCode:c,it:h}=e;if(!a&&!l)return;const d=t.let("valid"),f=u.items?(0,i.getSchemaTypes)(u.items):[];function p(){const i=t.let("i",n._`${r}.length`),s=t.let("j");e.setParams({i:i,j:s}),t.assign(d,!0),t.if(n._`${i} > 1`,(()=>(m()?g:v)(i,s)))}function m(){return f.length>0&&!f.some((e=>"object"===e||"array"===e))}function g(s,o){const a=t.name("item"),l=(0,i.checkDataTypes)(f,a,h.opts.strictNumbers,i.DataType.Wrong),u=t.const("indices",n._`{}`);t.for(n._`;${s}--;`,(()=>{t.let(a,n._`${r}[${s}]`),t.if(l,n._`continue`),f.length>1&&t.if(n._`typeof ${a} == "string"`,n._`${a} += "_"`),t.if(n._`typeof ${u}[${a}] == "number"`,(()=>{t.assign(o,n._`${u}[${a}]`),e.error(),t.assign(d,!1).break()})).code(n._`${u}[${a}] = ${s}`)}))}function v(i,a){const l=(0,s.useFunc)(t,o.default),u=t.name("outer");t.label(u).for(n._`;${i}--;`,(()=>t.for(n._`${a} = ${i}; ${a}--;`,(()=>t.if(n._`${l}(${r}[${i}], ${r}[${a}])`,(()=>{e.error(),t.assign(d,!1).break(u)}))))))}e.block$data(d,p,n._`${c} === false`),e.ok(d)}};t["default"]=l},67242:function(e){"use strict";var t=e.exports=function(e,t,i){"function"==typeof t&&(i=t,t={}),i=t.cb||i;var n="function"==typeof i?i:i.pre||function(){},s=i.post||function(){};r(t,n,s,e,"",e)};function r(e,n,s,o,a,l,u,c,h,d){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var f in n(o,a,l,u,c,h,d),o){var p=o[f];if(Array.isArray(p)){if(f in t.arrayKeywords)for(var m=0;m%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,h=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,d=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,f=/^(?:\/(?:[^~/]|~0|~1)*)*$/,p=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,m=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function g(e){return e="full"==e?"full":"fast",i.copy(g[e])}function v(e){return e%4===0&&(e%100!==0||e%400===0)}function y(e){var t=e.match(n);if(!t)return!1;var r=+t[1],i=+t[2],o=+t[3];return i>=1&&i<=12&&o>=1&&o<=(2==i&&v(r)?29:s[i])}function b(e,t){var r=e.match(o);if(!r)return!1;var i=r[1],n=r[2],s=r[3],a=r[5];return(i<=23&&n<=59&&s<=59||23==i&&59==n&&60==s)&&(!t||a)}e.exports=g,g.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:h,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:a,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:M,uuid:d,"json-pointer":f,"json-pointer-uri-fragment":p,"relative-json-pointer":m},g.full={date:y,time:b,"date-time":_,uri:x,"uri-reference":u,"uri-template":c,url:h,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:a,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\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0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:M,uuid:d,"json-pointer":f,"json-pointer-uri-fragment":p,"relative-json-pointer":m};var w=/t|\s/i;function _(e){var t=e.split(w);return 2==t.length&&y(t[0])&&b(t[1],!0)}var k=/\/|:/;function x(e){return k.test(e)&&l.test(e)}var S=/[^\\]\\Z/;function M(e){if(S.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}},7354:function(e,t,r){"use strict";var i=r(91030),n=r(96740),s=r(64551),o=r(72492),a=r(51873),l=n.ucs2length,u=r(32017),c=s.Validation;function h(e,t,r,p){var w=this,_=this._opts,k=[void 0],x={},S=[],M={},E=[],A={},C=[];t=t||{schema:e,refVal:k,refs:x};var $=d.call(this,e,t,p),O=this._compilations[$.index];if($.compiling)return O.callValidate=L;var P=this._formats,T=this.RULES;try{var I=R(e,t,r,p);O.validate=I;var D=O.callValidate;return D&&(D.schema=I.schema,D.errors=null,D.refs=I.refs,D.refVal=I.refVal,D.root=I.root,D.$async=I.$async,_.sourceCode&&(D.source=I.source)),I}finally{f.call(this,e,t,p)}function L(){var e=O.validate,t=e.apply(this,arguments);return L.errors=e.errors,t}function R(e,r,o,d){var f=!r||r&&r.schema==e;if(r.schema!=t.schema)return h.call(w,e,r,o,d);var p,M=!0===e.$async,A=a({isTop:!0,schema:e,isRoot:f,baseId:d,root:r,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:s.MissingRef,RULES:T,validate:a,util:n,resolve:i,resolveRef:N,usePattern:V,useDefault:q,useCustomRule:U,opts:_,formats:P,logger:w.logger,self:w});A=b(k,v)+b(S,m)+b(E,g)+b(C,y)+A,_.processCode&&(A=_.processCode(A,e));try{var $=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",A);p=$(w,T,P,t,k,E,C,u,l,c),k[0]=p}catch(O){throw w.logger.error("Error compiling schema, function code:",A),O}return p.schema=e,p.errors=null,p.refs=x,p.refVal=k,p.root=f?p:r,M&&(p.$async=!0),!0===_.sourceCode&&(p.source={code:A,patterns:S,defaults:E}),p}function N(e,n,s){n=i.url(e,n);var o,a,l=x[n];if(void 0!==l)return o=k[l],a="refVal["+l+"]",z(o,a);if(!s&&t.refs){var u=t.refs[n];if(void 0!==u)return o=t.refVal[u],a=j(n,o),z(o,a)}a=j(n);var c=i.call(w,R,t,n);if(void 0===c){var d=r&&r[n];d&&(c=i.inlineRef(d,_.inlineRefs)?d:h.call(w,d,t,r,e))}if(void 0!==c)return F(n,c),z(c,a);B(n)}function j(e,t){var r=k.length;return k[r]=t,x[e]=r,"refVal"+r}function B(e){delete x[e]}function F(e,t){var r=x[e];k[r]=t}function z(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function V(e){var t=M[e];return void 0===t&&(t=M[e]=S.length,S[t]=e),"pattern"+t}function q(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return n.toQuotedString(e);case"object":if(null===e)return"null";var t=o(e),r=A[t];return void 0===r&&(r=A[t]=E.length,E[r]=e),"default"+r}}function U(e,t,r,i){if(!1!==w._opts.validateSchema){var n=e.definition.dependencies;if(n&&!n.every((function(e){return Object.prototype.hasOwnProperty.call(r,e)})))throw new Error("parent schema must have all required keywords: "+n.join(","));var s=e.definition.validateSchema;if(s){var o=s(t);if(!o){var a="keyword schema is invalid: "+w.errorsText(s.errors);if("log"!=w._opts.validateSchema)throw new Error(a);w.logger.error(a)}}}var l,u=e.definition.compile,c=e.definition.inline,h=e.definition.macro;if(u)l=u.call(w,t,r,i);else if(h)l=h.call(w,t,r,i),!1!==_.validateSchema&&w.validateSchema(l,!0);else if(c)l=c.call(w,i,e.keyword,t,r);else if(l=e.definition.validate,!l)return;if(void 0===l)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var d=C.length;return C[d]=l,{code:"customRule"+d,validate:l}}}function d(e,t,r){var i=p.call(this,e,t,r);return i>=0?{index:i,compiling:!0}:(i=this._compilations.length,this._compilations[i]={schema:e,root:t,baseId:r},{index:i,compiling:!1})}function f(e,t,r){var i=p.call(this,e,t,r);i>=0&&this._compilations.splice(i,1)}function p(e,t,r){for(var i=0;i=55296&&t<=56319&&n=t)throw new Error("Cannot access property/index "+i+" levels up, current level is "+t);return r[t-i]}if(i>t)throw new Error("Cannot access data "+i+" levels up, current level is "+t);if(s="data"+(t-i||""),!n)return s}for(var a=s,l=n.split("/"),u=0;u",y=f?">":"<",b=void 0;if(!d&&"number"!=typeof a&&void 0!==a)throw new Error(t+" must be number");if(!g&&void 0!==m&&"number"!=typeof m&&"boolean"!=typeof m)throw new Error(p+" must be number or boolean");if(g){var w=e.util.getData(m.$data,o,e.dataPathArr),_="exclusive"+s,k="exclType"+s,x="exclIsNumber"+s,S="op"+s,M="' + "+S+" + '";n+=" var schemaExcl"+s+" = "+w+"; ",w="schemaExcl"+s,n+=" var "+_+"; var "+k+" = typeof "+w+"; if ("+k+" != 'boolean' && "+k+" != 'undefined' && "+k+" != 'number') { ";b=p;var E=E||[];E.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var A=n;n=E.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+A+"]); ":n+=" validate.errors = ["+A+"]; return false; ":n+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+k+" == 'number' ? ( ("+_+" = "+i+" === undefined || "+w+" "+v+"= "+i+") ? "+h+" "+y+"= "+w+" : "+h+" "+y+" "+i+" ) : ( ("+_+" = "+w+" === true) ? "+h+" "+y+"= "+i+" : "+h+" "+y+" "+i+" ) || "+h+" !== "+h+") { var op"+s+" = "+_+" ? '"+v+"' : '"+v+"='; ",void 0===a&&(b=p,u=e.errSchemaPath+"/"+p,i=w,d=g)}else{x="number"==typeof m,M=v;if(x&&d){S="'"+M+"'";n+=" if ( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ( "+i+" === undefined || "+m+" "+v+"= "+i+" ? "+h+" "+y+"= "+m+" : "+h+" "+y+" "+i+" ) || "+h+" !== "+h+") { "}else{x&&void 0===a?(_=!0,b=p,u=e.errSchemaPath+"/"+p,i=m,y+="="):(x&&(i=Math[f?"min":"max"](m,a)),m===(!x||i)?(_=!0,b=p,u=e.errSchemaPath+"/"+p,y+="="):(_=!1,M+="="));S="'"+M+"'";n+=" if ( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+h+" "+y+" "+i+" || "+h+" !== "+h+") { "}}b=b||t;E=E||[];E.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+S+", limit: "+i+", exclusive: "+_+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+M+" ",n+=d?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+a,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";A=n;return n=E.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+A+"]); ":n+=" validate.errors = ["+A+"]; return false; ":n+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { "),n}},52119:function(e){"use strict";e.exports=function(e,t,r){var i,n=" ",s=e.level,o=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),d=e.opts.$data&&a&&a.$data;if(d?(n+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",i="schema"+s):i=a,!d&&"number"!=typeof a)throw new Error(t+" must be number");var f="maxItems"==t?">":"<";n+="if ( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+h+".length "+f+" "+i+") { ";var p=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(p||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=d?"' + "+i+" + '":""+a,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+a,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},47935:function(e){"use strict";e.exports=function(e,t,r){var i,n=" ",s=e.level,o=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),d=e.opts.$data&&a&&a.$data;if(d?(n+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",i="schema"+s):i=a,!d&&"number"!=typeof a)throw new Error(t+" must be number");var f="maxLength"==t?">":"<";n+="if ( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?n+=" "+h+".length ":n+=" ucs2length("+h+") ",n+=" "+f+" "+i+") { ";var p=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(p||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=d?"' + "+i+" + '":""+a,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+a,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},51298:function(e){"use strict";e.exports=function(e,t,r){var i,n=" ",s=e.level,o=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),d=e.opts.$data&&a&&a.$data;if(d?(n+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",i="schema"+s):i=a,!d&&"number"!=typeof a)throw new Error(t+" must be number");var f="maxProperties"==t?">":"<";n+="if ( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+h+").length "+f+" "+i+") { ";var p=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(p||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=d?"' + "+i+" + '":""+a,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+a,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},80353:function(e){"use strict";e.exports=function(e,t,r){var i=" ",n=e.schema[t],s=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,a=!e.opts.allErrors,l=e.util.copy(e),u="";l.level++;var c="valid"+l.level,h=l.baseId,d=!0,f=n;if(f){var p,m=-1,g=f.length-1;while(m0||!1===p:e.util.schemaHasRules(p,e.RULES.all))&&(d=!1,l.schema=p,l.schemaPath=s+"["+m+"]",l.errSchemaPath=o+"/"+m,i+=" "+e.validate(l)+" ",l.baseId=h,a&&(i+=" if ("+c+") { ",u+="}"))}return a&&(i+=d?" if (true) { ":" "+u.slice(0,-1)+" "),i}},29480:function(e){"use strict";e.exports=function(e,t,r){var i=" ",n=e.level,s=e.dataLevel,o=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(s||""),h="valid"+n,d="errs__"+n,f=e.util.copy(e),p="";f.level++;var m="valid"+f.level,g=o.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0||!1===t:e.util.schemaHasRules(t,e.RULES.all)}));if(g){var v=f.baseId;i+=" var "+d+" = errors; var "+h+" = false; ";var y=e.compositeRule;e.compositeRule=f.compositeRule=!0;var b=o;if(b){var w,_=-1,k=b.length-1;while(_0||!1===o:e.util.schemaHasRules(o,e.RULES.all);if(i+="var "+d+" = errors;var "+h+";",w){var _=e.compositeRule;e.compositeRule=f.compositeRule=!0,f.schema=o,f.schemaPath=a,f.errSchemaPath=l,i+=" var "+m+" = false; for (var "+g+" = 0; "+g+" < "+c+".length; "+g+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);var k=c+"["+g+"]";f.dataPathArr[v]=g;var x=e.validate(f);f.baseId=b,e.util.varOccurences(x,y)<2?i+=" "+e.util.varReplace(x,y,k)+" ":i+=" var "+y+" = "+k+"; "+x+" ",i+=" if ("+m+") break; } ",e.compositeRule=f.compositeRule=_,i+=" "+p+" if (!"+m+") {"}else i+=" if ("+c+".length == 0) {";var S=S||[];S.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should contain a valid item' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var M=i;return i=S.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+M+"]); ":i+=" validate.errors = ["+M+"]; return false; ":i+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { ",w&&(i+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(i+=" } "),i}},7992:function(e){"use strict";e.exports=function(e,t,r){var i,n,s=" ",o=e.level,a=e.dataLevel,l=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,d="data"+(a||""),f="valid"+o,p="errs__"+o,m=e.opts.$data&&l&&l.$data;m?(s+=" var schema"+o+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",n="schema"+o):n=l;var g,v,y,b,w,_=this,k="definition"+o,x=_.definition,S="";if(m&&x.$data){w="keywordValidate"+o;var M=x.validateSchema;s+=" var "+k+" = RULES.custom['"+t+"'].definition; var "+w+" = "+k+".validate;"}else{if(b=e.useCustomRule(_,l,e.schema,e),!b)return;n="validate.schema"+u,w=b.code,g=x.compile,v=x.inline,y=x.macro}var E=w+".errors",A="i"+o,C="ruleErr"+o,$=x.async;if($&&!e.async)throw new Error("async keyword in sync schema");if(v||y||(s+=E+" = null;"),s+="var "+p+" = errors;var "+f+";",m&&x.$data&&(S+="}",s+=" if ("+n+" === undefined) { "+f+" = true; } else { ",M&&(S+="}",s+=" "+f+" = "+k+".validateSchema("+n+"); if ("+f+") { ")),v)x.statements?s+=" "+b.validate+" ":s+=" "+f+" = "+b.validate+"; ";else if(y){var O=e.util.copy(e);S="";O.level++;var P="valid"+O.level;O.schema=b.validate,O.schemaPath="";var T=e.compositeRule;e.compositeRule=O.compositeRule=!0;var I=e.validate(O).replace(/validate\.schema/g,w);e.compositeRule=O.compositeRule=T,s+=" "+I}else{var D=D||[];D.push(s),s="",s+=" "+w+".call( ",e.opts.passContext?s+="this":s+="self",g||!1===x.schema?s+=" , "+d+" ":s+=" , "+n+" , "+d+" , validate.schema"+e.schemaPath+" ",s+=" , (dataPath || '')",'""'!=e.errorPath&&(s+=" + "+e.errorPath);var L=a?"data"+(a-1||""):"parentData",R=a?e.dataPathArr[a]:"parentDataProperty";s+=" , "+L+" , "+R+" , rootData ) ";var N=s;s=D.pop(),!1===x.errors?(s+=" "+f+" = ",$&&(s+="await "),s+=N+"; "):$?(E="customErrors"+o,s+=" var "+E+" = null; try { "+f+" = await "+N+"; } catch (e) { "+f+" = false; if (e instanceof ValidationError) "+E+" = e.errors; else throw e; } "):s+=" "+E+" = null; "+f+" = "+N+"; "}if(x.modifying&&(s+=" if ("+L+") "+d+" = "+L+"["+R+"];"),s+=""+S,x.valid)h&&(s+=" if (true) { ");else{s+=" if ( ",void 0===x.valid?(s+=" !",s+=y?""+P:""+f):s+=" "+!x.valid+" ",s+=") { ",i=_.keyword;D=D||[];D.push(s),s="";D=D||[];D.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(i||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { keyword: '"+_.keyword+"' } ",!1!==e.opts.messages&&(s+=" , message: 'should pass \""+_.keyword+"\" keyword validation' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),s+=" } "):s+=" {} ";var j=s;s=D.pop(),!e.compositeRule&&h?e.async?s+=" throw new ValidationError(["+j+"]); ":s+=" validate.errors = ["+j+"]; return false; ":s+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var B=s;s=D.pop(),v?x.errors?"full"!=x.errors&&(s+=" for (var "+A+"="+p+"; "+A+"0||!1===y:e.util.schemaHasRules(y,e.RULES.all))&&(i+=" "+p+" = true; if ( "+c+e.util.getProperty(_)+" !== undefined ",v&&(i+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(_)+"') "),i+=") { ",d.schema=y,d.schemaPath=a+e.util.getProperty(_),d.errSchemaPath=l+"/"+e.util.escapeFragment(_),i+=" "+e.validate(d)+" ",d.baseId=L,i+=" } ",u&&(i+=" if ("+p+") { ",f+="}"))}return u&&(i+=" "+f+" if ("+h+" == errors) {"),i}},80598:function(e){"use strict";e.exports=function(e,t,r){var i=" ",n=e.level,s=e.dataLevel,o=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(s||""),h="valid"+n,d=e.opts.$data&&o&&o.$data;d&&(i+=" var schema"+n+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ");var f="i"+n,p="schema"+n;d||(i+=" var "+p+" = validate.schema"+a+";"),i+="var "+h+";",d&&(i+=" if (schema"+n+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+n+")) "+h+" = false; else {"),i+=h+" = false;for (var "+f+"=0; "+f+"<"+p+".length; "+f+"++) if (equal("+c+", "+p+"["+f+"])) { "+h+" = true; break; }",d&&(i+=" } "),i+=" if (!"+h+") { ";var m=m||[];m.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { allowedValues: schema"+n+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var g=i;return i=m.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+g+"]); ":i+=" validate.errors = ["+g+"]; return false; ":i+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",u&&(i+=" else { "),i}},80400:function(e){"use strict";e.exports=function(e,t,r){var i=" ",n=e.level,s=e.dataLevel,o=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(s||"");if(!1===e.opts.format)return u&&(i+=" if (true) { "),i;var h,d=e.opts.$data&&o&&o.$data;d?(i+=" var schema"+n+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ",h="schema"+n):h=o;var f=e.opts.unknownFormats,p=Array.isArray(f);if(d){var m="format"+n,g="isObject"+n,v="formatType"+n;i+=" var "+m+" = formats["+h+"]; var "+g+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+v+" = "+g+" && "+m+".type || 'string'; if ("+g+") { ",e.async&&(i+=" var async"+n+" = "+m+".async; "),i+=" "+m+" = "+m+".validate; } if ( ",d&&(i+=" ("+h+" !== undefined && typeof "+h+" != 'string') || "),i+=" (","ignore"!=f&&(i+=" ("+h+" && !"+m+" ",p&&(i+=" && self._opts.unknownFormats.indexOf("+h+") == -1 "),i+=") || "),i+=" ("+m+" && "+v+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?i+=" (async"+n+" ? await "+m+"("+c+") : "+m+"("+c+")) ":i+=" "+m+"("+c+") ",i+=" : "+m+".test("+c+"))))) {"}else{m=e.formats[o];if(!m){if("ignore"==f)return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),u&&(i+=" if (true) { "),i;if(p&&f.indexOf(o)>=0)return u&&(i+=" if (true) { "),i;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}g="object"==typeof m&&!(m instanceof RegExp)&&m.validate,v=g&&m.type||"string";if(g){var y=!0===m.async;m=m.validate}if(v!=r)return u&&(i+=" if (true) { "),i;if(y){if(!e.async)throw new Error("async format in sync schema");var b="formats"+e.util.getProperty(o)+".validate";i+=" if (!(await "+b+"("+c+"))) { "}else{i+=" if (! ";b="formats"+e.util.getProperty(o);g&&(b+=".validate"),i+="function"==typeof m?" "+b+"("+c+") ":" "+b+".test("+c+") ",i+=") { "}}var w=w||[];w.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { format: ",i+=d?""+h:""+e.util.toQuotedString(o),i+=" } ",!1!==e.opts.messages&&(i+=" , message: 'should match format \"",i+=d?"' + "+h+" + '":""+e.util.escapeQuotes(o),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+a:""+e.util.toQuotedString(o),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var _=i;return i=w.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",u&&(i+=" else { "),i}},88532:function(e){"use strict";e.exports=function(e,t,r){var i=" ",n=e.level,s=e.dataLevel,o=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(s||""),h="valid"+n,d="errs__"+n,f=e.util.copy(e);f.level++;var p="valid"+f.level,m=e.schema["then"],g=e.schema["else"],v=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0||!1===m:e.util.schemaHasRules(m,e.RULES.all)),y=void 0!==g&&(e.opts.strictKeywords?"object"==typeof g&&Object.keys(g).length>0||!1===g:e.util.schemaHasRules(g,e.RULES.all)),b=f.baseId;if(v||y){var w;f.createErrors=!1,f.schema=o,f.schemaPath=a,f.errSchemaPath=l,i+=" var "+d+" = errors; var "+h+" = true; ";var _=e.compositeRule;e.compositeRule=f.compositeRule=!0,i+=" "+e.validate(f)+" ",f.baseId=b,f.createErrors=!0,i+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=f.compositeRule=_,v?(i+=" if ("+p+") { ",f.schema=e.schema["then"],f.schemaPath=e.schemaPath+".then",f.errSchemaPath=e.errSchemaPath+"/then",i+=" "+e.validate(f)+" ",f.baseId=b,i+=" "+h+" = "+p+"; ",v&&y?(w="ifClause"+n,i+=" var "+w+" = 'then'; "):w="'then'",i+=" } ",y&&(i+=" else { ")):i+=" if (!"+p+") { ",y&&(f.schema=e.schema["else"],f.schemaPath=e.schemaPath+".else",f.errSchemaPath=e.errSchemaPath+"/else",i+=" "+e.validate(f)+" ",f.baseId=b,i+=" "+h+" = "+p+"; ",v&&y?(w="ifClause"+n,i+=" var "+w+" = 'else'; "):w="'else'",i+=" } "),i+=" if (!"+h+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } ",u&&(i+=" else { ")}else u&&(i+=" if (true) { ");return i}},27403:function(e,t,r){"use strict";e.exports={$ref:r(6990),allOf:r(80353),anyOf:r(29480),$comment:r(14278),const:r(10224),contains:r(35674),dependencies:r(41926),enum:r(80598),format:r(80400),if:r(88532),items:r(54371),maximum:r(74667),minimum:r(74667),maxItems:r(52119),minItems:r(52119),maxLength:r(47935),minLength:r(47935),maxProperties:r(51298),minProperties:r(51298),multipleOf:r(99294),not:r(48914),oneOf:r(95326),pattern:r(8317),properties:r(41374),propertyNames:r(23032),required:r(47850),uniqueItems:r(85898),validate:r(51873)}},54371:function(e){"use strict";e.exports=function(e,t,r){var i=" ",n=e.level,s=e.dataLevel,o=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(s||""),h="valid"+n,d="errs__"+n,f=e.util.copy(e),p="";f.level++;var m="valid"+f.level,g="i"+n,v=f.dataLevel=e.dataLevel+1,y="data"+v,b=e.baseId;if(i+="var "+d+" = errors;var "+h+";",Array.isArray(o)){var w=e.schema.additionalItems;if(!1===w){i+=" "+h+" = "+c+".length <= "+o.length+"; ";var _=l;l=e.errSchemaPath+"/additionalItems",i+=" if (!"+h+") { ";var k=k||[];k.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var x=i;i=k.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+x+"]); ":i+=" validate.errors = ["+x+"]; return false; ":i+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l=_,u&&(p+="}",i+=" else { ")}var S=o;if(S){var M,E=-1,A=S.length-1;while(E0||!1===M:e.util.schemaHasRules(M,e.RULES.all)){i+=" "+m+" = true; if ("+c+".length > "+E+") { ";var C=c+"["+E+"]";f.schema=M,f.schemaPath=a+"["+E+"]",f.errSchemaPath=l+"/"+E,f.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0),f.dataPathArr[v]=E;var $=e.validate(f);f.baseId=b,e.util.varOccurences($,y)<2?i+=" "+e.util.varReplace($,y,C)+" ":i+=" var "+y+" = "+C+"; "+$+" ",i+=" } ",u&&(i+=" if ("+m+") { ",p+="}")}}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0||!1===w:e.util.schemaHasRules(w,e.RULES.all))){f.schema=w,f.schemaPath=e.schemaPath+".additionalItems",f.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+c+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+c+".length; "+g+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);C=c+"["+g+"]";f.dataPathArr[v]=g;$=e.validate(f);f.baseId=b,e.util.varOccurences($,y)<2?i+=" "+e.util.varReplace($,y,C)+" ":i+=" var "+y+" = "+C+"; "+$+" ",u&&(i+=" if (!"+m+") break; "),i+=" } } ",u&&(i+=" if ("+m+") { ",p+="}")}}else if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all)){f.schema=o,f.schemaPath=a,f.errSchemaPath=l,i+=" for (var "+g+" = 0; "+g+" < "+c+".length; "+g+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);C=c+"["+g+"]";f.dataPathArr[v]=g;$=e.validate(f);f.baseId=b,e.util.varOccurences($,y)<2?i+=" "+e.util.varReplace($,y,C)+" ":i+=" var "+y+" = "+C+"; "+$+" ",u&&(i+=" if (!"+m+") break; "),i+=" }"}return u&&(i+=" "+p+" if ("+d+" == errors) {"),i}},99294:function(e){"use strict";e.exports=function(e,t,r){var i,n=" ",s=e.level,o=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),d=e.opts.$data&&a&&a.$data;if(d?(n+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",i="schema"+s):i=a,!d&&"number"!=typeof a)throw new Error(t+" must be number");n+="var division"+s+";if (",d&&(n+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),n+=" (division"+s+" = "+h+" / "+i+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+s+") - division"+s+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+s+" !== parseInt(division"+s+") ",n+=" ) ",d&&(n+=" ) "),n+=" ) { ";var f=f||[];f.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=d?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+a,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var p=n;return n=f.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},48914:function(e){"use strict";e.exports=function(e,t,r){var i=" ",n=e.level,s=e.dataLevel,o=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(s||""),h="errs__"+n,d=e.util.copy(e);d.level++;var f="valid"+d.level;if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=a,d.errSchemaPath=l,i+=" var "+h+" = errors; ";var p,m=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.opts.allErrors&&(p=d.opts.allErrors,d.opts.allErrors=!1),i+=" "+e.validate(d)+" ",d.createErrors=!0,p&&(d.opts.allErrors=p),e.compositeRule=d.compositeRule=m,i+=" if ("+f+") { ";var g=g||[];g.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var v=i;i=g.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ");return i}},95326:function(e){"use strict";e.exports=function(e,t,r){var i=" ",n=e.level,s=e.dataLevel,o=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(s||""),h="valid"+n,d="errs__"+n,f=e.util.copy(e),p="";f.level++;var m="valid"+f.level,g=f.baseId,v="prevValid"+n,y="passingSchemas"+n;i+="var "+d+" = errors , "+v+" = false , "+h+" = false , "+y+" = null; ";var b=e.compositeRule;e.compositeRule=f.compositeRule=!0;var w=o;if(w){var _,k=-1,x=w.length-1;while(k0||!1===_:e.util.schemaHasRules(_,e.RULES.all))?(f.schema=_,f.schemaPath=a+"["+k+"]",f.errSchemaPath=l+"/"+k,i+=" "+e.validate(f)+" ",f.baseId=g):i+=" var "+m+" = true; ",k&&(i+=" if ("+m+" && "+v+") { "+h+" = false; "+y+" = ["+y+", "+k+"]; } else { ",p+="}"),i+=" if ("+m+") { "+h+" = "+v+" = true; "+y+" = "+k+"; }"}return e.compositeRule=f.compositeRule=b,i+=p+"if (!"+h+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",e.opts.allErrors&&(i+=" } "),i}},8317:function(e){"use strict";e.exports=function(e,t,r){var i,n=" ",s=e.level,o=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),d=e.opts.$data&&a&&a.$data;d?(n+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",i="schema"+s):i=a;var f=d?"(new RegExp("+i+"))":e.usePattern(a);n+="if ( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'string') || "),n+=" !"+f+".test("+h+") ) { ";var p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",n+=d?""+i:""+e.util.toQuotedString(a),n+=" } ",!1!==e.opts.messages&&(n+=" , message: 'should match pattern \"",n+=d?"' + "+i+" + '":""+e.util.escapeQuotes(a),n+="\"' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+e.util.toQuotedString(a),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},41374:function(e){"use strict";e.exports=function(e,t,r){var i=" ",n=e.level,s=e.dataLevel,o=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(s||""),h="errs__"+n,d=e.util.copy(e),f="";d.level++;var p="valid"+d.level,m="key"+n,g="idx"+n,v=d.dataLevel=e.dataLevel+1,y="data"+v,b="dataProperties"+n,w=Object.keys(o||{}).filter(I),_=e.schema.patternProperties||{},k=Object.keys(_).filter(I),x=e.schema.additionalProperties,S=w.length||k.length,M=!1===x,E="object"==typeof x&&Object.keys(x).length,A=e.opts.removeAdditional,C=M||E||A,$=e.opts.ownProperties,O=e.baseId,P=e.schema.required;if(P&&(!e.opts.$data||!P.$data)&&P.length8)i+=" || validate.schema"+a+".hasOwnProperty("+m+") ";else{var D=w;if(D){var L=-1,R=D.length-1;while(L0||!1===Q:e.util.schemaHasRules(Q,e.RULES.all)){var ee=e.util.getProperty(Z),te=(W=c+ee,Y&&void 0!==Q.default);d.schema=Q,d.schemaPath=a+ee,d.errSchemaPath=l+"/"+e.util.escapeFragment(Z),d.errorPath=e.util.getPath(e.errorPath,Z,e.opts.jsonPointers),d.dataPathArr[v]=e.util.toQuotedString(Z);K=e.validate(d);if(d.baseId=O,e.util.varOccurences(K,y)<2){K=e.util.varReplace(K,y,W);var re=W}else{re=y;i+=" var "+y+" = "+W+"; "}if(te)i+=" "+K+" ";else{if(T&&T[Z]){i+=" if ( "+re+" === undefined ",$&&(i+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(Z)+"') "),i+=") { "+p+" = false; ";F=e.errorPath,V=l;var ie=e.util.escapeQuotes(Z);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(F,Z,e.opts.jsonPointers)),l=e.errSchemaPath+"/required";q=q||[];q.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+ie+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+ie+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";U=i;i=q.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+U+"]); ":i+=" validate.errors = ["+U+"]; return false; ":i+=" var err = "+U+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l=V,e.errorPath=F,i+=" } else { "}else u?(i+=" if ( "+re+" === undefined ",$&&(i+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(Z)+"') "),i+=") { "+p+" = true; } else { "):(i+=" if ("+re+" !== undefined ",$&&(i+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(Z)+"') "),i+=" ) { ");i+=" "+K+" } "}}u&&(i+=" if ("+p+") { ",f+="}")}}}if(k.length){var ne=k;if(ne){var se,oe=-1,ae=ne.length-1;while(oe0||!1===Q:e.util.schemaHasRules(Q,e.RULES.all)){d.schema=Q,d.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(se),d.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(se),i+=$?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+g+"=0; "+g+"<"+b+".length; "+g+"++) { var "+m+" = "+b+"["+g+"]; ":" for (var "+m+" in "+c+") { ",i+=" if ("+e.usePattern(se)+".test("+m+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);W=c+"["+m+"]";d.dataPathArr[v]=m;K=e.validate(d);d.baseId=O,e.util.varOccurences(K,y)<2?i+=" "+e.util.varReplace(K,y,W)+" ":i+=" var "+y+" = "+W+"; "+K+" ",u&&(i+=" if (!"+p+") break; "),i+=" } ",u&&(i+=" else "+p+" = true; "),i+=" } ",u&&(i+=" if ("+p+") { ",f+="}")}}}}return u&&(i+=" "+f+" if ("+h+" == errors) {"),i}},23032:function(e){"use strict";e.exports=function(e,t,r){var i=" ",n=e.level,s=e.dataLevel,o=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(s||""),h="errs__"+n,d=e.util.copy(e),f="";d.level++;var p="valid"+d.level;if(i+="var "+h+" = errors;",e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=a,d.errSchemaPath=l;var m="key"+n,g="idx"+n,v="i"+n,y="' + "+m+" + '",b=d.dataLevel=e.dataLevel+1,w="data"+b,_="dataProperties"+n,k=e.opts.ownProperties,x=e.baseId;k&&(i+=" var "+_+" = undefined; "),i+=k?" "+_+" = "+_+" || Object.keys("+c+"); for (var "+g+"=0; "+g+"<"+_+".length; "+g+"++) { var "+m+" = "+_+"["+g+"]; ":" for (var "+m+" in "+c+") { ",i+=" var startErrs"+n+" = errors; ";var S=m,M=e.compositeRule;e.compositeRule=d.compositeRule=!0;var E=e.validate(d);d.baseId=x,e.util.varOccurences(E,w)<2?i+=" "+e.util.varReplace(E,w,S)+" ":i+=" var "+w+" = "+S+"; "+E+" ",e.compositeRule=d.compositeRule=M,i+=" if (!"+p+") { for (var "+v+"=startErrs"+n+"; "+v+"0||!1===b:e.util.schemaHasRules(b,e.RULES.all))||(p[p.length]=g)}}}else p=o;if(d||p.length){var w=e.errorPath,_=d||p.length>=e.opts.loopRequired,k=e.opts.ownProperties;if(u)if(i+=" var missing"+n+"; ",_){d||(i+=" var "+f+" = validate.schema"+a+"; ");var x="i"+n,S="schema"+n+"["+x+"]",M="' + "+S+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,S,e.opts.jsonPointers)),i+=" var "+h+" = true; ",d&&(i+=" if (schema"+n+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+n+")) "+h+" = false; else {"),i+=" for (var "+x+" = 0; "+x+" < "+f+".length; "+x+"++) { "+h+" = "+c+"["+f+"["+x+"]] !== undefined ",k&&(i+=" && Object.prototype.hasOwnProperty.call("+c+", "+f+"["+x+"]) "),i+="; if (!"+h+") break; } ",d&&(i+=" } "),i+=" if (!"+h+") { ";var E=E||[];E.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+M+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+M+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var A=i;i=E.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+A+"]); ":i+=" validate.errors = ["+A+"]; return false; ":i+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var C=p;if(C){x=-1;var $=C.length-1;while(x<$){I=C[x+=1],x&&(i+=" || ");var O=e.util.getProperty(I),P=c+O;i+=" ( ( "+P+" === undefined ",k&&(i+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(I)+"') "),i+=") && (missing"+n+" = "+e.util.toQuotedString(e.opts.jsonPointers?I:O)+") ) "}}i+=") { ";S="missing"+n,M="' + "+S+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(w,S,!0):w+" + "+S);E=E||[];E.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+M+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+M+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";A=i;i=E.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+A+"]); ":i+=" validate.errors = ["+A+"]; return false; ":i+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else if(_){d||(i+=" var "+f+" = validate.schema"+a+"; ");x="i"+n,S="schema"+n+"["+x+"]",M="' + "+S+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,S,e.opts.jsonPointers)),d&&(i+=" if ("+f+" && !Array.isArray("+f+")) { var err = ",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+M+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+M+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+f+" !== undefined) { "),i+=" for (var "+x+" = 0; "+x+" < "+f+".length; "+x+"++) { if ("+c+"["+f+"["+x+"]] === undefined ",k&&(i+=" || ! Object.prototype.hasOwnProperty.call("+c+", "+f+"["+x+"]) "),i+=") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+M+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+M+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",d&&(i+=" } ")}else{var T=p;if(T){var I,D=-1,L=T.length-1;while(D 1) { ";var p=e.schema.items&&e.schema.items.type,m=Array.isArray(p);if(!p||"object"==p||"array"==p||m&&(p.indexOf("object")>=0||p.indexOf("array")>=0))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+h+"[i], "+h+"[j])) { "+d+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+h+"[i]; ";var g="checkDataType"+(m?"s":"");n+=" if ("+e.util[g](p,"item",e.opts.strictNumbers,!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",f&&(n+=" } "),n+=" if (!"+d+") { ";var v=v||[];v.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=f?"validate.schema"+l:""+a,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var y=n;n=v.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+y+"]); ":n+=" validate.errors = ["+y+"]; return false; ":n+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { ")}else c&&(n+=" if (true) { ");return n}},51873:function(e){"use strict";e.exports=function(e,t,r){var i="",n=!0===e.schema.$async,s=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),o=e.self._getId(e.schema);if(e.opts.strictKeywords){var a=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(a){var l="unknown keyword: "+a;if("log"!==e.opts.strictKeywords)throw new Error(l);e.logger.warn(l)}}if(e.isTop&&(i+=" var validate = ",n&&(e.async=!0,i+="async "),i+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(e.opts.sourceCode||e.opts.processCode)&&(i+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof e.schema||!s&&!e.schema.$ref){t="false schema";var u=e.level,c=e.dataLevel,h=e.schema[t],d=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(c||""),g="valid"+u;if(!1===e.schema){e.isTop?p=!0:i+=" var "+g+" = false; ";var v=v||[];v.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(_||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'boolean schema is false' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),i+=" } "):i+=" {} ";var y=i;i=v.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?i+=n?" return data; ":" validate.errors = null; return true; ":i+=" var "+g+" = true; ";return e.isTop&&(i+=" }; return validate; "),i}if(e.isTop){var b=e.isTop;u=e.level=0,c=e.dataLevel=0,m="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var w="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(w);e.logger.warn(w)}i+=" var vErrors = null; ",i+=" var errors = 0; ",i+=" if (rootData === undefined) rootData = data; "}else{u=e.level,c=e.dataLevel,m="data"+(c||"");if(o&&(e.baseId=e.resolve.url(e.baseId,o)),n&&!e.async)throw new Error("async schema in sync schema");i+=" var errs_"+u+" = errors;"}g="valid"+u,p=!e.opts.allErrors;var _,k="",x="",S=e.schema.type,M=Array.isArray(S);if(S&&e.opts.nullable&&!0===e.schema.nullable&&(M?-1==S.indexOf("null")&&(S=S.concat("null")):"null"!=S&&(S=[S,"null"],M=!0)),M&&1==S.length&&(S=S[0],M=!1),e.schema.$ref&&s){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(s=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(i+=" "+e.RULES.all.$comment.code(e,"$comment")),S){if(e.opts.coerceTypes)var E=e.util.coerceToTypes(e.opts.coerceTypes,S);var A=e.RULES.types[S];if(E||M||!0===A||A&&!ee(A)){d=e.schemaPath+".type",f=e.errSchemaPath+"/type",d=e.schemaPath+".type",f=e.errSchemaPath+"/type";var C=M?"checkDataTypes":"checkDataType";if(i+=" if ("+e.util[C](S,m,e.opts.strictNumbers,!0)+") { ",E){var $="dataType"+u,O="coerced"+u;i+=" var "+$+" = typeof "+m+"; var "+O+" = undefined; ","array"==e.opts.coerceTypes&&(i+=" if ("+$+" == 'object' && Array.isArray("+m+") && "+m+".length == 1) { "+m+" = "+m+"[0]; "+$+" = typeof "+m+"; if ("+e.util.checkDataType(e.schema.type,m,e.opts.strictNumbers)+") "+O+" = "+m+"; } "),i+=" if ("+O+" !== undefined) ; ";var P=E;if(P){var T,I=-1,D=P.length-1;while(I>6],n=0===(32&r);if(31===(31&r)){var s=r;r=0;while(128===(128&s)){if(s=e.readUInt8(t),e.isError(s))return s;r<<=7,r|=127&s}}else r&=31;var o=a.tag[r];return{cls:i,primitive:n,tag:r,tagStr:o}}function h(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0===(128&i))return i;var n=127&i;if(n>4)return e.error("length octect is too long");i=0;for(var s=0;s=31?i.error("Multi-octet tag encoding unsupported"):(t||(n|=32),n|=a.tagClassByName[r||"universal"]<<6,n)}e.exports=l,l.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},i(u,o.Node),u.prototype._encodeComposite=function(e,t,r,i){var s=h(e,t,r,this.reporter);if(i.length<128){var o=new n(2);return o[0]=s,o[1]=i.length,this._createEncoderBuffer([o,i])}for(var a=1,l=i.length;l>=256;l>>=8)a++;o=new n(2+a);o[0]=s,o[1]=128|a;l=1+a;for(var u=i.length;u>0;l--,u>>=8)o[l]=255&u;return this._createEncoderBuffer([o,i])},u.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new n(2*e.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var s=0;for(i=0;i=128;o>>=7)s++}var a=new n(s),l=a.length-1;for(i=e.length-1;i>=0;i--){o=e[i];a[l--]=127&o;while((o>>=7)>0)a[l--]=128|127&o}return this._createEncoderBuffer(a)},u.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[c(i.getFullYear()),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(i.getFullYear()%100),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(e,t){if("string"===typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!==typeof e&&!n.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new n(r)}if(n.isBuffer(e)){var i=e.length;0===e.length&&i++;var s=new n(i);return e.copy(s),0===e.length&&(s[0]=0),this._createEncoderBuffer(s)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var o=e;o>=256;o>>=8)i++;for(s=new Array(i),o=s.length-1;o>=0;o--)s[o]=255&e,e>>=8;return 128&s[0]&&s.unshift(0),this._createEncoderBuffer(new n(s))},u.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},u.prototype._use=function(e,t){return"function"===typeof e&&(e=e(t)),e._getEncoder("der").tree},u.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n["default"])return!1;var s=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n["default"],t,r).join()),s.length!==n.defaultBuffer.length)return!1;for(i=0;i=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(e,t,r){var i=a(e,r);return r-1>=t&&(i|=a(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,s=Math.min(e.length,r),o=t;o=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(e){return e instanceof s||null!==e&&"object"===typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var n=0;"-"===e[0]&&(n++,this.negative=1),n=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[s]|=o<>>26-a&67108863,a+=24,a>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n>>26-a&67108863,a+=24,a>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)n=l(e,t,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else{var a=e.length-t;for(i=a%2===0?t+1:t;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8}this.strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,l=0,c=r;c1&&0===this.words[this.length-1])this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}function p(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=67108863&o,l=o/67108864|0;r.words[0]=a;for(var u=1;u>>26,h=67108863&l,d=Math.min(u,t.length-1),f=Math.max(0,u-e.length+1);f<=d;f++){var p=u-f|0;n=0|e.words[p],s=0|t.words[f],o=n*s+h,c+=o/67108864|0,h=67108863&o}r.words[u]=0|h,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}s.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,s=0,o=0;o>>24-n&16777215,n+=2,n>=26&&(n-=26,o--),r=0!==s||o!==this.length-1?c[6-l.length]+l+r:l+r}0!==s&&(r=s.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=h[e],f=d[e];r="";var p=this.clone();p.negative=0;while(!p.isZero()){var m=p.modn(f).toString(e);p=p.idivn(f),r=p.isZero()?m+r:c[u-m.length]+m+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return i("undefined"!==typeof o),this.toArrayLike(o,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var o,a,l="le"===t,u=new e(s),c=this.clone();if(l){for(a=0;!c.isZero();a++)o=c.andln(255),c.iushrn(8),u[a]=o;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"===typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,i=e):(r=e,i=this);for(var n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==s&&o>26,this.words[o]=67108863&t;if(0===s&&o>>13,f=0|o[1],p=8191&f,m=f>>>13,g=0|o[2],v=8191&g,y=g>>>13,b=0|o[3],w=8191&b,_=b>>>13,k=0|o[4],x=8191&k,S=k>>>13,M=0|o[5],E=8191&M,A=M>>>13,C=0|o[6],$=8191&C,O=C>>>13,P=0|o[7],T=8191&P,I=P>>>13,D=0|o[8],L=8191&D,R=D>>>13,N=0|o[9],j=8191&N,B=N>>>13,F=0|a[0],z=8191&F,V=F>>>13,q=0|a[1],U=8191&q,H=q>>>13,W=0|a[2],K=8191&W,Y=W>>>13,G=0|a[3],Z=8191&G,J=G>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],se=8191&ne,oe=ne>>>13,ae=0|a[7],le=8191&ae,ue=ae>>>13,ce=0|a[8],he=8191&ce,de=ce>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19,i=Math.imul(h,z),n=Math.imul(h,V),n=n+Math.imul(d,z)|0,s=Math.imul(d,V);var ge=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,z),n=Math.imul(p,V),n=n+Math.imul(m,z)|0,s=Math.imul(m,V),i=i+Math.imul(h,U)|0,n=n+Math.imul(h,H)|0,n=n+Math.imul(d,U)|0,s=s+Math.imul(d,H)|0;var ve=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(v,z),n=Math.imul(v,V),n=n+Math.imul(y,z)|0,s=Math.imul(y,V),i=i+Math.imul(p,U)|0,n=n+Math.imul(p,H)|0,n=n+Math.imul(m,U)|0,s=s+Math.imul(m,H)|0,i=i+Math.imul(h,K)|0,n=n+Math.imul(h,Y)|0,n=n+Math.imul(d,K)|0,s=s+Math.imul(d,Y)|0;var ye=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(w,z),n=Math.imul(w,V),n=n+Math.imul(_,z)|0,s=Math.imul(_,V),i=i+Math.imul(v,U)|0,n=n+Math.imul(v,H)|0,n=n+Math.imul(y,U)|0,s=s+Math.imul(y,H)|0,i=i+Math.imul(p,K)|0,n=n+Math.imul(p,Y)|0,n=n+Math.imul(m,K)|0,s=s+Math.imul(m,Y)|0,i=i+Math.imul(h,Z)|0,n=n+Math.imul(h,J)|0,n=n+Math.imul(d,Z)|0,s=s+Math.imul(d,J)|0;var be=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(x,z),n=Math.imul(x,V),n=n+Math.imul(S,z)|0,s=Math.imul(S,V),i=i+Math.imul(w,U)|0,n=n+Math.imul(w,H)|0,n=n+Math.imul(_,U)|0,s=s+Math.imul(_,H)|0,i=i+Math.imul(v,K)|0,n=n+Math.imul(v,Y)|0,n=n+Math.imul(y,K)|0,s=s+Math.imul(y,Y)|0,i=i+Math.imul(p,Z)|0,n=n+Math.imul(p,J)|0,n=n+Math.imul(m,Z)|0,s=s+Math.imul(m,J)|0,i=i+Math.imul(h,Q)|0,n=n+Math.imul(h,ee)|0,n=n+Math.imul(d,Q)|0,s=s+Math.imul(d,ee)|0;var we=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(E,z),n=Math.imul(E,V),n=n+Math.imul(A,z)|0,s=Math.imul(A,V),i=i+Math.imul(x,U)|0,n=n+Math.imul(x,H)|0,n=n+Math.imul(S,U)|0,s=s+Math.imul(S,H)|0,i=i+Math.imul(w,K)|0,n=n+Math.imul(w,Y)|0,n=n+Math.imul(_,K)|0,s=s+Math.imul(_,Y)|0,i=i+Math.imul(v,Z)|0,n=n+Math.imul(v,J)|0,n=n+Math.imul(y,Z)|0,s=s+Math.imul(y,J)|0,i=i+Math.imul(p,Q)|0,n=n+Math.imul(p,ee)|0,n=n+Math.imul(m,Q)|0,s=s+Math.imul(m,ee)|0,i=i+Math.imul(h,re)|0,n=n+Math.imul(h,ie)|0,n=n+Math.imul(d,re)|0,s=s+Math.imul(d,ie)|0;var _e=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul($,z),n=Math.imul($,V),n=n+Math.imul(O,z)|0,s=Math.imul(O,V),i=i+Math.imul(E,U)|0,n=n+Math.imul(E,H)|0,n=n+Math.imul(A,U)|0,s=s+Math.imul(A,H)|0,i=i+Math.imul(x,K)|0,n=n+Math.imul(x,Y)|0,n=n+Math.imul(S,K)|0,s=s+Math.imul(S,Y)|0,i=i+Math.imul(w,Z)|0,n=n+Math.imul(w,J)|0,n=n+Math.imul(_,Z)|0,s=s+Math.imul(_,J)|0,i=i+Math.imul(v,Q)|0,n=n+Math.imul(v,ee)|0,n=n+Math.imul(y,Q)|0,s=s+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=n+Math.imul(p,ie)|0,n=n+Math.imul(m,re)|0,s=s+Math.imul(m,ie)|0,i=i+Math.imul(h,se)|0,n=n+Math.imul(h,oe)|0,n=n+Math.imul(d,se)|0,s=s+Math.imul(d,oe)|0;var ke=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(T,z),n=Math.imul(T,V),n=n+Math.imul(I,z)|0,s=Math.imul(I,V),i=i+Math.imul($,U)|0,n=n+Math.imul($,H)|0,n=n+Math.imul(O,U)|0,s=s+Math.imul(O,H)|0,i=i+Math.imul(E,K)|0,n=n+Math.imul(E,Y)|0,n=n+Math.imul(A,K)|0,s=s+Math.imul(A,Y)|0,i=i+Math.imul(x,Z)|0,n=n+Math.imul(x,J)|0,n=n+Math.imul(S,Z)|0,s=s+Math.imul(S,J)|0,i=i+Math.imul(w,Q)|0,n=n+Math.imul(w,ee)|0,n=n+Math.imul(_,Q)|0,s=s+Math.imul(_,ee)|0,i=i+Math.imul(v,re)|0,n=n+Math.imul(v,ie)|0,n=n+Math.imul(y,re)|0,s=s+Math.imul(y,ie)|0,i=i+Math.imul(p,se)|0,n=n+Math.imul(p,oe)|0,n=n+Math.imul(m,se)|0,s=s+Math.imul(m,oe)|0,i=i+Math.imul(h,le)|0,n=n+Math.imul(h,ue)|0,n=n+Math.imul(d,le)|0,s=s+Math.imul(d,ue)|0;var xe=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(L,z),n=Math.imul(L,V),n=n+Math.imul(R,z)|0,s=Math.imul(R,V),i=i+Math.imul(T,U)|0,n=n+Math.imul(T,H)|0,n=n+Math.imul(I,U)|0,s=s+Math.imul(I,H)|0,i=i+Math.imul($,K)|0,n=n+Math.imul($,Y)|0,n=n+Math.imul(O,K)|0,s=s+Math.imul(O,Y)|0,i=i+Math.imul(E,Z)|0,n=n+Math.imul(E,J)|0,n=n+Math.imul(A,Z)|0,s=s+Math.imul(A,J)|0,i=i+Math.imul(x,Q)|0,n=n+Math.imul(x,ee)|0,n=n+Math.imul(S,Q)|0,s=s+Math.imul(S,ee)|0,i=i+Math.imul(w,re)|0,n=n+Math.imul(w,ie)|0,n=n+Math.imul(_,re)|0,s=s+Math.imul(_,ie)|0,i=i+Math.imul(v,se)|0,n=n+Math.imul(v,oe)|0,n=n+Math.imul(y,se)|0,s=s+Math.imul(y,oe)|0,i=i+Math.imul(p,le)|0,n=n+Math.imul(p,ue)|0,n=n+Math.imul(m,le)|0,s=s+Math.imul(m,ue)|0,i=i+Math.imul(h,he)|0,n=n+Math.imul(h,de)|0,n=n+Math.imul(d,he)|0,s=s+Math.imul(d,de)|0;var Se=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(j,z),n=Math.imul(j,V),n=n+Math.imul(B,z)|0,s=Math.imul(B,V),i=i+Math.imul(L,U)|0,n=n+Math.imul(L,H)|0,n=n+Math.imul(R,U)|0,s=s+Math.imul(R,H)|0,i=i+Math.imul(T,K)|0,n=n+Math.imul(T,Y)|0,n=n+Math.imul(I,K)|0,s=s+Math.imul(I,Y)|0,i=i+Math.imul($,Z)|0,n=n+Math.imul($,J)|0,n=n+Math.imul(O,Z)|0,s=s+Math.imul(O,J)|0,i=i+Math.imul(E,Q)|0,n=n+Math.imul(E,ee)|0,n=n+Math.imul(A,Q)|0,s=s+Math.imul(A,ee)|0,i=i+Math.imul(x,re)|0,n=n+Math.imul(x,ie)|0,n=n+Math.imul(S,re)|0,s=s+Math.imul(S,ie)|0,i=i+Math.imul(w,se)|0,n=n+Math.imul(w,oe)|0,n=n+Math.imul(_,se)|0,s=s+Math.imul(_,oe)|0,i=i+Math.imul(v,le)|0,n=n+Math.imul(v,ue)|0,n=n+Math.imul(y,le)|0,s=s+Math.imul(y,ue)|0,i=i+Math.imul(p,he)|0,n=n+Math.imul(p,de)|0,n=n+Math.imul(m,he)|0,s=s+Math.imul(m,de)|0,i=i+Math.imul(h,pe)|0,n=n+Math.imul(h,me)|0,n=n+Math.imul(d,pe)|0,s=s+Math.imul(d,me)|0;var Me=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(j,U),n=Math.imul(j,H),n=n+Math.imul(B,U)|0,s=Math.imul(B,H),i=i+Math.imul(L,K)|0,n=n+Math.imul(L,Y)|0,n=n+Math.imul(R,K)|0,s=s+Math.imul(R,Y)|0,i=i+Math.imul(T,Z)|0,n=n+Math.imul(T,J)|0,n=n+Math.imul(I,Z)|0,s=s+Math.imul(I,J)|0,i=i+Math.imul($,Q)|0,n=n+Math.imul($,ee)|0,n=n+Math.imul(O,Q)|0,s=s+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=n+Math.imul(E,ie)|0,n=n+Math.imul(A,re)|0,s=s+Math.imul(A,ie)|0,i=i+Math.imul(x,se)|0,n=n+Math.imul(x,oe)|0,n=n+Math.imul(S,se)|0,s=s+Math.imul(S,oe)|0,i=i+Math.imul(w,le)|0,n=n+Math.imul(w,ue)|0,n=n+Math.imul(_,le)|0,s=s+Math.imul(_,ue)|0,i=i+Math.imul(v,he)|0,n=n+Math.imul(v,de)|0,n=n+Math.imul(y,he)|0,s=s+Math.imul(y,de)|0,i=i+Math.imul(p,pe)|0,n=n+Math.imul(p,me)|0,n=n+Math.imul(m,pe)|0,s=s+Math.imul(m,me)|0;var Ee=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(j,K),n=Math.imul(j,Y),n=n+Math.imul(B,K)|0,s=Math.imul(B,Y),i=i+Math.imul(L,Z)|0,n=n+Math.imul(L,J)|0,n=n+Math.imul(R,Z)|0,s=s+Math.imul(R,J)|0,i=i+Math.imul(T,Q)|0,n=n+Math.imul(T,ee)|0,n=n+Math.imul(I,Q)|0,s=s+Math.imul(I,ee)|0,i=i+Math.imul($,re)|0,n=n+Math.imul($,ie)|0,n=n+Math.imul(O,re)|0,s=s+Math.imul(O,ie)|0,i=i+Math.imul(E,se)|0,n=n+Math.imul(E,oe)|0,n=n+Math.imul(A,se)|0,s=s+Math.imul(A,oe)|0,i=i+Math.imul(x,le)|0,n=n+Math.imul(x,ue)|0,n=n+Math.imul(S,le)|0,s=s+Math.imul(S,ue)|0,i=i+Math.imul(w,he)|0,n=n+Math.imul(w,de)|0,n=n+Math.imul(_,he)|0,s=s+Math.imul(_,de)|0,i=i+Math.imul(v,pe)|0,n=n+Math.imul(v,me)|0,n=n+Math.imul(y,pe)|0,s=s+Math.imul(y,me)|0;var Ae=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(j,Z),n=Math.imul(j,J),n=n+Math.imul(B,Z)|0,s=Math.imul(B,J),i=i+Math.imul(L,Q)|0,n=n+Math.imul(L,ee)|0,n=n+Math.imul(R,Q)|0,s=s+Math.imul(R,ee)|0,i=i+Math.imul(T,re)|0,n=n+Math.imul(T,ie)|0,n=n+Math.imul(I,re)|0,s=s+Math.imul(I,ie)|0,i=i+Math.imul($,se)|0,n=n+Math.imul($,oe)|0,n=n+Math.imul(O,se)|0,s=s+Math.imul(O,oe)|0,i=i+Math.imul(E,le)|0,n=n+Math.imul(E,ue)|0,n=n+Math.imul(A,le)|0,s=s+Math.imul(A,ue)|0,i=i+Math.imul(x,he)|0,n=n+Math.imul(x,de)|0,n=n+Math.imul(S,he)|0,s=s+Math.imul(S,de)|0,i=i+Math.imul(w,pe)|0,n=n+Math.imul(w,me)|0,n=n+Math.imul(_,pe)|0,s=s+Math.imul(_,me)|0;var Ce=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(j,Q),n=Math.imul(j,ee),n=n+Math.imul(B,Q)|0,s=Math.imul(B,ee),i=i+Math.imul(L,re)|0,n=n+Math.imul(L,ie)|0,n=n+Math.imul(R,re)|0,s=s+Math.imul(R,ie)|0,i=i+Math.imul(T,se)|0,n=n+Math.imul(T,oe)|0,n=n+Math.imul(I,se)|0,s=s+Math.imul(I,oe)|0,i=i+Math.imul($,le)|0,n=n+Math.imul($,ue)|0,n=n+Math.imul(O,le)|0,s=s+Math.imul(O,ue)|0,i=i+Math.imul(E,he)|0,n=n+Math.imul(E,de)|0,n=n+Math.imul(A,he)|0,s=s+Math.imul(A,de)|0,i=i+Math.imul(x,pe)|0,n=n+Math.imul(x,me)|0,n=n+Math.imul(S,pe)|0,s=s+Math.imul(S,me)|0;var $e=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+($e>>>26)|0,$e&=67108863,i=Math.imul(j,re),n=Math.imul(j,ie),n=n+Math.imul(B,re)|0,s=Math.imul(B,ie),i=i+Math.imul(L,se)|0,n=n+Math.imul(L,oe)|0,n=n+Math.imul(R,se)|0,s=s+Math.imul(R,oe)|0,i=i+Math.imul(T,le)|0,n=n+Math.imul(T,ue)|0,n=n+Math.imul(I,le)|0,s=s+Math.imul(I,ue)|0,i=i+Math.imul($,he)|0,n=n+Math.imul($,de)|0,n=n+Math.imul(O,he)|0,s=s+Math.imul(O,de)|0,i=i+Math.imul(E,pe)|0,n=n+Math.imul(E,me)|0,n=n+Math.imul(A,pe)|0,s=s+Math.imul(A,me)|0;var Oe=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(j,se),n=Math.imul(j,oe),n=n+Math.imul(B,se)|0,s=Math.imul(B,oe),i=i+Math.imul(L,le)|0,n=n+Math.imul(L,ue)|0,n=n+Math.imul(R,le)|0,s=s+Math.imul(R,ue)|0,i=i+Math.imul(T,he)|0,n=n+Math.imul(T,de)|0,n=n+Math.imul(I,he)|0,s=s+Math.imul(I,de)|0,i=i+Math.imul($,pe)|0,n=n+Math.imul($,me)|0,n=n+Math.imul(O,pe)|0,s=s+Math.imul(O,me)|0;var Pe=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(j,le),n=Math.imul(j,ue),n=n+Math.imul(B,le)|0,s=Math.imul(B,ue),i=i+Math.imul(L,he)|0,n=n+Math.imul(L,de)|0,n=n+Math.imul(R,he)|0,s=s+Math.imul(R,de)|0,i=i+Math.imul(T,pe)|0,n=n+Math.imul(T,me)|0,n=n+Math.imul(I,pe)|0,s=s+Math.imul(I,me)|0;var Te=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(j,he),n=Math.imul(j,de),n=n+Math.imul(B,he)|0,s=Math.imul(B,de),i=i+Math.imul(L,pe)|0,n=n+Math.imul(L,me)|0,n=n+Math.imul(R,pe)|0,s=s+Math.imul(R,me)|0;var Ie=(u+i|0)+((8191&n)<<13)|0;u=(s+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(j,pe),n=Math.imul(j,me),n=n+Math.imul(B,pe)|0,s=Math.imul(B,me);var De=(u+i|0)+((8191&n)<<13)|0;return u=(s+(n>>>13)|0)+(De>>>26)|0,De&=67108863,l[0]=ge,l[1]=ve,l[2]=ye,l[3]=be,l[4]=we,l[5]=_e,l[6]=ke,l[7]=xe,l[8]=Se,l[9]=Me,l[10]=Ee,l[11]=Ae,l[12]=Ce,l[13]=$e,l[14]=Oe,l[15]=Pe,l[16]=Te,l[17]=Ie,l[18]=De,0!==u&&(l[19]=u,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s>>26)|0,n+=o>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}function v(e,t,r){var i=new y;return i.mulp(e,t,r)}function y(e,t){this.x=e,this.y=t}Math.imul||(m=p),s.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?m(this,e,t):i<63?p(this,e,t):i<1024?g(this,e,t):v(this,e,t),r},y.prototype.makeRBT=function(e){for(var t=new Array(e),r=s.prototype._countBits(e)-1,i=0;i>=1;return i},y.prototype.permute=function(e,t,r,i,n,s){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o>=26,t+=n/67108864|0,t+=s>>>26,this.words[r]=67108863&s}return 0!==t&&(this.words[r]=t,this.length++),this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=f(e);if(0===t.length)return new s(1);for(var r=this,i=0;i=0);var t,r=e%26,n=(e-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=n);u--){var h=0|this.words[u];this.words[u]=c<<26-s|h>>>s,c=h&a}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"===typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(l/67108864|0),this.words[n+r]=67108863&s}for(;n>26,this.words[n+r]=67108863&s;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(e,t){var r=this.length-e.length,i=this.clone(),n=e,o=0|n.words[n.length-1],a=this._countBits(o);r=26-a,0!==r&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var l,u=i.length-n.length;if("mod"!==t){l=new s(null),l.length=u+1,l.words=new Array(l.length);for(var c=0;c=0;d--){var f=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);f=Math.min(f/o|0,67108863),i._ishlnsubmul(n,f,d);while(0!==i.negative)f--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);l&&(l.words[d]=f)}return l&&l.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:l||null,mod:i}},s.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,o,a},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},s.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new s(1),o=new s(0),a=new s(0),l=new s(1),u=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++u;var c=r.clone(),h=t.clone();while(!t.isZero()){for(var d=0,f=1;0===(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0){t.iushrn(d);while(d-- >0)(n.isOdd()||o.isOdd())&&(n.iadd(c),o.isub(h)),n.iushrn(1),o.iushrn(1)}for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0){r.iushrn(p);while(p-- >0)(a.isOdd()||l.isOdd())&&(a.iadd(c),l.isub(h)),a.iushrn(1),l.iushrn(1)}t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(l)):(r.isub(t),a.isub(n),l.isub(o))}return{a:a,b:l,gcd:r.iushln(u)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,o=new s(1),a=new s(0),l=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var u=0,c=1;0===(t.words[0]&c)&&u<26;++u,c<<=1);if(u>0){t.iushrn(u);while(u-- >0)o.isOdd()&&o.iadd(l),o.iushrn(1)}for(var h=0,d=1;0===(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0){r.iushrn(h);while(h-- >0)a.isOdd()&&a.iadd(l),a.iushrn(1)}t.cmp(r)>=0?(t.isub(r),o.isub(a)):(r.isub(t),a.isub(o))}return n=0===t.cmpn(1)?o:a,n.cmpn(0)<0&&n.iadd(e),n},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0===(1&this.words[0])},s.prototype.isOdd=function(){return 1===(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"===typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new M(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"===typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},n(_,w),_.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n>>22,s=o}s>>>=22,e.words[n-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new k;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return b[e]=t,t},M.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){i(0===(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2===1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1),o=0;while(!n.isZero()&&0===n.andln(1))o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),l=a.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();c=new s(2*c*c).toRed(this);while(0!==this.pow(c,u).cmp(l))c.redIAdd(l);var h=this.pow(c,n),d=this.pow(e,n.addn(1).iushrn(1)),f=this.pow(e,n),p=o;while(0!==f.cmp(a)){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();i(g=0;n--){for(var c=t.words[n],h=u-1;h>=0;h--){var d=c>>h&1;o!==i[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,l++,(l===r||0===n&&0===h)&&(o=this.mul(o,i[a]),l=0,a=0)):l=0}u=26}return o},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new E(e)},n(E,M),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}}(e,this)},30766:function(e,t,r){"use strict";r.d(t,{A:function(){return Us}});r(44114),r(98992),r(54520),r(72577),r(3949);var i=r(6044),n=r.n(i),s=r(51548),o=r(73668),a=r.n(o);const l={cache:{},extendtoken:"$extend",reftoken:"$ref",pathtoken:"#",debug:!1,clone:function(e){var t,r;if(null===e||"object"!==typeof e||"function"===typeof e)return e;for(t in r=e.constructor(),e)r[t]=l.clone(e[t]);return r},findIds:function(e,t){var r,i,n,s;for(i in r=!1,n={},e)s=e[i],null!=e.id&&(r=e.id),r&&"id"!==i&&(n[i]=s),"object"===typeof s&&l.findIds(s,t);if(r)return t[r]=n,n},get_json_pointer:function(e,t,r){var i;i=e.replace(/\\\//,"#SLASH#").replace(/\//g,".").replace(/#SLASH#/,"/"),i=i.replace(new RegExp("^"+l.pathtoken),""),"."===i[0]&&(i=i.substr(1,i.length-1));var n,s=[i];Object.keys(r).forEach((e=>{const t=Array.isArray(r[e])?r[e]:[r[e]];t.forEach((t=>{s.forEach((r=>{r.includes(e)&&s.push(r.replace(e,t))}))}))}));for(const u of s){l.debug&&console.log("evaluating '"+i+"'");try{var o=a().getter(u)(t);if(o)return o}catch(err){n=err}}return n&&console.error(n),""},replace:function(e,t,r,i){var n,s,o,a,u,c;for(n in u=[],e)c=e[n],l.debug&&"string"===typeof s&&console.log("checking "+n),null!=c&&null!=c[l.reftoken]?(s=c[l.reftoken],l.debug&&"string"===typeof s&&console.log("checking "+n+" -> "+s),Object.keys(c).length>1&&console.error("json-ref-lite error: object '"+n+"' contains reference as well as other properties..ignoring properties"),Array.isArray(s)?s=l.replace(s,t,r,i):null!=t[s]?e[n]=t[s]:String(s).match(new RegExp("^"+l.pathtoken))&&(l.debug&&console.log("checking "+s+" pathtoken"),e[n]=l.get_json_pointer(s,r,i)),null!=(null!=(o=e[n])?o.length:void 0)&&0===(null!=(a=e[n])?a.length:void 0)&&l.debug?u.push(console.log(s+" reference not found")):u.push(void 0)):"object"===typeof c?u.push(l.replace(c,t,r,i)):u.push(void 0);return u},extend:function(e,t){var r,i,n,s,o,a;if("object"===typeof e){for(r in n=[],e){if(a=e[r],r===l.extendtoken&&null!=a[l.reftoken]){for(s in i=l.get_json_pointer(a[l.reftoken],e,t),a)o=a[s],s!==l.reftoken&&(i[s]=o);delete e[r]}"object"===typeof a?n.push(a=l.extend(a)):n.push(void 0)}return n}},resolve:function(e,t){var r;return r={},l.findIds(e,r),l.debug&&Object.keys(r).length&&console.dir(r),l.replace(e,r,e,t),e},evaluate:function(e,t,r){var i,n,s;for(i in null==r&&(r=l.evaluateStr),n=l.clone(e),n)s=n[i],"string"===typeof s&&(e[i]=r(s,t)),"object"===typeof s&&(e[i]=l.evaluate(s,t));return e},evaluateStr:function(e,t){var r;if("string"!==typeof e)return e;if("{"!==e[0]||"}"!==e[e.length-1])return r=e.replace(/(\{)(.*?)(\})/g,(function(e,r,i){var n;if(n="",null==t||null==i)return n;if(null!=t[i]&&"function"===typeof t[i])n=t[i]();else if(null!=t[i])n=t[i];else{try{i=i.replace(new RegExp("^"+l.pathtoken+"/"),"").replace(/\//g,"."),n=a().getter(i)(t)}catch(s){err=s,n=""}null==n&&(n="")}return l.evaluateStr(n,t),n})),r;try{return a().getter(e.replace(/^{/,"").replace(/}$/,""))(t)}catch(i){return null}}};var u=l;r(81454);const c={};var h=c;const d=e=>Object.keys(e||{}).map((t=>({...e[t],key:t}))),f=(e,t)=>{const r=t.split(".");for(let i=0;i{e.required=e.required.concat(t.required||[]),e.properties=e.properties.concat(d(t.properties)),t.oneOf&&(e.oneOf=(e.oneOf||[]).concat(t.oneOf)),t.allOf&&(e.allOf=(e.allOf||[]).concat(t.allOf))};c.prepareFullSchema=(e,t,r)=>{const i=n()(e);if(i.pattern&&(i.patternRegexp=new RegExp(i.pattern)),!i.type&&i.properties&&(i.type="object"),!i.type){const e=i.anyOf||i.oneOf||i.allOf,t=e&&e.find((e=>!!e.type));t&&(i.type=t.type)}if(Array.isArray(i.type)&&(i.nullable=i.type.includes("null"),i.type=i.type.find((e=>"null"!==e)),i.nullable&&i.enum&&(i.enum=i.enum.filter((e=>null!==e)))),i.items&&Array.isArray(i.items)&&i.items.forEach(((e,t)=>{e.key=""+t})),i.enum&&1===i.enum.length&&(i.const=i.enum[0],delete i.enum),"object"!==i.type)return i;if(i.properties=d(i.properties),i.required=i.required||[],i.dependencies=i.dependencies||{},i.dependencies&&Object.keys(i.dependencies).forEach((e=>{const r=i.dependencies[e];if(!t)return;const n=f(t,e);[null,void 0,!1].includes(n)||Array.isArray(n)&&0===n.length||"object"===typeof n&&0===Object.keys(n).length||p(i,r)})),i.if)if(r.validator){const e=r.validator(i.if),n=e(t);!n&&i.then&&p(i,i.then),n&&i.else&&p(i,i.else)}else console.error("v-jsf - The conditional if/then/else syntax requires the ajv or other validator option.");return i};var m="M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z",g="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M16.2,16.2L11,13V7H12.5V12.2L17,14.9L16.2,16.2Z",v="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",y="M11,17H4A2,2 0 0,1 2,15V3A2,2 0 0,1 4,1H16V3H4V15H11V13L15,16L11,19V17M19,21V7H8V13H6V7A2,2 0 0,1 8,5H19A2,2 0 0,1 21,7V21A2,2 0 0,1 19,23H8A2,2 0 0,1 6,21V19H8V21H19Z",b="M19,20H5V4H7V7H17V4H19M12,2A1,1 0 0,1 13,3A1,1 0 0,1 12,4A1,1 0 0,1 11,3A1,1 0 0,1 12,2M19,2H14.82C14.4,0.84 13.3,0 12,0C10.7,0 9.6,0.84 9.18,2H5A2,2 0 0,0 3,4V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V4A2,2 0 0,0 19,2Z",w="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",_="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",k="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",x="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",S="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";const M={locale:"",defaultLocale:"",rootDisplay:"",objectContainerClass:"",sectionsClass:"pl-2 pt-2",sectionsTitlesClasses:["title","subtitle-1","subtitle-2"],arrayItemsTitlesClasses:["title","subtitle-1","subtitle-2"],childrenClass:"",fieldProps:{},fieldColProps:{cols:12},readOnlyFieldProps:{hideDetails:!0},textFieldProps:{},textareaProps:{filled:!0},numberProps:{},sliderProps:{},checkboxProps:{},switchProps:{},comboboxProps:{},selectProps:{},fileInputProps:{},radioGroupProps:{},radioItemProps:{},tabsProps:{grow:!0},expansionPanelsProps:{mandatory:!0},dialogProps:{maxWidth:500},dialogCardProps:{},colorPickerProps:{},timePickerProps:{},datePickerProps:{scrollable:!0},arrayItemCardProps:{},arrayItemColProps:{cols:12},stepperProps:{},verticalStepperProps:{},tooltipProps:{left:!0,openOnHover:!1,openOnClick:!0},removeAdditionalProperties:!0,disableAll:!1,hideReadOnly:!1,hideReadOnlyLabels:!1,hideReadOnlyEmpty:!1,hideReadOnlyTooltips:!1,deleteReadOnly:!1,hideInArrayItem:!1,filesAsDataUrl:!1,hideTooltips:!1,disableSorting:!1,sortableOptions:{},context:{},rules:{},initialValidation:"defined",idPrefix:"",markdownit:{},editMode:"dialog",arrayOperations:["create","update","duplicate","copy","paste","delete"],autofocus:!1,httpOptions:{},selectAll:!1,autoFixArrayItems:!0,useValidator:!1,evalMethod:"propertyExpr",easyMDEOptions:{},maxLengthCounter:!0},E={en:{required:"This information is required",noData:"No matching value found",search:"Search...",minimum:"The value must be greater than or equal to {minimum}",exclusiveMinimum:"The value must be greater than {exclusiveMinimum}",maximum:"The value must be lower than or equal to {maximum}",exclusiveMaximum:"The value must be lower than {exclusiveMaximum}",minLength:"{minLength} characters minimum",maxLength:"{maxLength} characters maximum",minItems:"No less than {minItems} items",maxItems:"No more than {maxItems} items",pattern:"The expected pattern is not satisfied",mdeLink1:"[Link title",mdeLink2:"](link url)",mdeImg1:"![](",mdeImg2:"image url)",mdeTable1:"",mdeTable2:"\n\n| Column 1 | Column 2 | ColoColumnnne 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n",bold:"Bold",italic:"Italic",heading:"Title",quote:"Quote",unorderedList:"Unordered list",orderedList:"Ordered list",createLink:"Create a link",insertImage:"Insert an image",createTable:"Create a table",preview:"Aperçu du rendu",mdeGuide:"Documentation de la syntaxe",undo:"Undo",redo:"Redo",selectAll:"Select all",stepperContinue:"continue",openMenu:"open menu",delete:"delete",duplicate:"duplicate",copy:"copy",paste:"paste"},fr:{required:"Cette information est obligatoire",noData:"Aucun élément correspondant",search:"Recherchez...",minimum:"La valeur doit être supérieure ou égale à {minimum}",exclusiveMinimum:"La valeur doit être supérieure {exclusiveMinimum}",maximum:"La valeur doit être inférieure ou égale à {maximum}",exclusiveMaximum:"La valeur doit être inférieure à {exclusiveMaximum}",minLength:"{minLength} caractères minimum",maxLength:"{maxLength} caractères maximum",minItems:"Au moins {minItems} éléments",maxItems:"Au plus {maxItems} éléments",pattern:"Le format attendu n'est pas respecté",mdeLink1:"[titre du lien",mdeLink2:"](adresse du lien)",mdeImg1:"![](",mdeImg2:"adresse de l'image)",mdeTable1:"",mdeTable2:"\n\n| Colonne 1 | Colonne 2 | Colonne 3 |\n| -------- | -------- | -------- |\n| Texte | Texte | Texte |\n\n",bold:"Gras",italic:"Italique",heading:"Titre",quote:"Citation",unorderedList:"Liste à puce",orderedList:"Liste numérotée",createLink:"Créer un lien",insertImage:"Insérer une image",createTable:"Créer un tableau",preview:"Preview",mdeGuide:"Syntax documentation",undo:"Défaire",redo:"Refaire",selectAll:"Tout sélectionner",stepperContinue:"continuer",openMenu:"ouvrir le menu",delete:"supprimer",duplicate:"dupliquer",copy:"copier",paste:"coller"},es:{required:"Esta información es requerida",noData:"No se encontraron valores coincidentes",search:"Buscar...",minimum:"El valor debe ser mayor o igual que {minimum}",exclusiveMinimum:"El valor debe ser mayor que {exclusiveMinimum}",maximum:"El valor debe ser menor o igual a {maximum}",exclusiveMaximum:"El valor debe ser inferior a {exclusiveMaximum}",minLength:"{minLength} caracteres mínimo",maxLength:"{maxLength} caractères máximo",minItems:"Al menos {minItems} articulos",maxItems:"Hasta {maxItems} articulos",pattern:"El formato esperado no se respeta",selectAll:"Seleccionar todo",stepperContinue:"continuar"},de:{required:"Diese Informationen sind erforderlich",noData:"Keine passenden Artikel",search:"Suche...",minimum:"Der Wert muss größer oder gleich {minimum} sein",exclusiveMinimum:"Der Wert muss größer als {exclusiveMinimum} sein",maximum:"Der Wert muss kleiner oder gleich {maximum} sein",exclusiveMaximum:"Der Wert muss kleiner als {exclusiveMaximum} sein",minLength:"Mindestens {minLength} Zeichen",maxLength:"Maximal {maxLength} Zeichen",minItems:"Mindestens {minItems} Elemente",maxItems:"Bis zu {maxItems} Artikel",pattern:"Das erwartete Format wird nicht eingehalten",selectAll:"Wählen Sie Alle",stepperContinue:"weiter"},ar:{required:"هذه المعلومة مطلوبة",noData:"لم يتم العثور على قيمة",search:"جاري البحث...",minimum:"{exclusiveMinimum} القيمة يجب أن تكون أكبر من",exclusiveMinimum:"{exclusiveMinimum} القيمة يجب أن تكون أكبر من",maximum:"{maximum} القيمة يجب أن تكون أقل من",exclusiveMaximum:"{exclusiveMaximum} القيمة يجب أن تكون أقل من",minLength:"{minLength} الحد الأدنى للحروف المطلوبة هو",maxLength:"{maxLength} الحد الأقصى للحروف المطلوبة هو",minItems:"قطع {minItems} لا يمكن اختيار أقل من ",maxItems:"قطع {maxItems} لا يمكن اختيار أكثر من ",pattern:"لا يوجد تشابه مع النموذج المطلوب",selectAll:"اختر الكل",stepperContinue:"استمر"},tr:{required:"Zorunlu alan",noData:"Bilgi yok",search:"Arıyor...",minimum:"Değer {minimum} dan büyük olmalı",exclusiveMinimum:"Değer {exclusiveMinimum} dan büyük olmalı",maximum:"Değer, {maximum} değerinden küçük veya ona eşit olmalıdır",exclusiveMaximum:"Değer {exclusiveMaximum} dan küçük olmalı",minLength:"{minLength} asgari karakter sayısı",maxLength:"{maxLength} azami karakter sayısı",minItems:"En az seçenek sayısı {minItems}",maxItems:"En çok seçenek sayısı {maxItems}",pattern:"İstenilen paten tutmuyor",selectAll:"Hepsini seç",stepperContinue:"devam et"},nl:{required:"Deze informatie is vereist",noData:"Geen overeenkomstig resultaat gevonden",search:"Zoeken...",minimum:"De waarde moet groter zijn dan of gelijk zijn aan {minimum}",exclusiveMinimum:"Waarde moet meer zijn dan {exclusiveMinimum}",maximum:"De waarde moet lager zijn dan of gelijk zijn aan {maximum}",exclusiveMaximum:"Waarde moet minder zijn dan {exclusiveMaximum}",minLength:"Minimaal {minLength} tekens",maxLength:"Maximaal {maxLength} tekens",minItems:"Minimaal {minItems} antwoorden",maxItems:"Maximaal {maxItems} antwoorden",pattern:"Invoer voldoet niet aan verwachte patroon",selectAll:"Selecteer alles",stepperContinue:"doorgaan"},ja:{required:"この情報は必須です。",noData:"一致する値はありません。",search:"検索...",minimum:"値は{minimum}以上である必要があります。",exclusiveMinimum:"値は{exclusiveMinimum}より大きい必要があります。",maximum:"値は{maximum}以下である必要があります。",exclusiveMaximum:"値は{exclusiveMaximum}より小さい必要があります。",minLength:"最小文字数は{minLength}です。",maxLength:"最大文字数は{maxLength}です。",minItems:"最小項目数は{minItems}です。",maxItems:"最大項目数は{maxItems}です。",pattern:"期待される様式を満たしていません。",mdeTable2:"\n\n| Column 1 | Column 2 | ColoColumnnne 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n",bold:"太字",italic:"イタリック",heading:"タイトル",quote:"引用",unorderedList:"順序なしリスト",orderedList:"順序付きリスト",createLink:"リンクを生成",insertImage:"画像を挿入",createTable:"テーブル作成",preview:"プレビュー",mdeGuide:"構文に関するドキュメント",undo:"元に戻す",redo:"やり直し",selectAll:"全選択",stepperContinue:"コンティニュー",openMenu:"メニューを開く",delete:"削除",duplicate:"重複",copy:"コーピー",paste:"ペースト"}},A={time:(e,t)=>{const r=new Date(`${(new Date).toISOString().split("T")[0]}T${e}`);return new Date(r.getTime()+6e4*r.getTimezoneOffset()).toLocaleTimeString(t)},date:(e,t)=>{const r=new Date(e);return new Date(r.getTime()+6e4*r.getTimezoneOffset()).toLocaleDateString(t)},"date-time":(e,t)=>new Date(e).toLocaleString(t)},C={mdiSvg:{calendar:m,clock:g,info:k,add:S,edit:x,delete:w,arrayMenu:_,duplicate:y,copy:v,paste:b},mdi:{calendar:"mdi-calendar",clock:"mdi-clock",info:"mdi-information",add:"mdi-plus",edit:"mdi-pencil",delete:"mdi-delete",arrayMenu:"mdi-dots-vertical",duplicate:"mdi-plus-circle-multiple-outline",copy:"mdi-content-copy",paste:"mdi-content-paste"},md:{calendar:"event",clock:"clock",info:"info",add:"add",edit:"create",delete:"delete",arrayMenu:"more_vert",duplicate:"control_point_duplicate",copy:"copy",paste:"paste"},fa:{calendar:"fa-calendar",clock:"fa-clock",info:"fa-info",add:"fa-plus",edit:"fa-edit",delete:"fa-trash",arrayMenu:"fa-ellipsis-vertical",duplicate:"fa-layer-plus",copy:"fa-copy",paste:"fa-paste"}},$=(e,t,r,i,n)=>{const o=[];if(i&&o.push((e=>void 0!==e&&null!==e&&""!==e||r.messages.required)),"array"===t.type&&void 0!==t.minItems){const e=r.messages.minItems.replace("{minItems}",t.minItems.toLocaleString(r.locale));o.push((r=>!r||r.length>=t.minItems||e))}if("array"===t.type&&void 0!==t.maxItems){const e=r.messages.maxItems.replace("{maxItems}",t.maxItems.toLocaleString(r.locale));o.push((r=>!r||r.length<=t.maxItems||e))}if("string"===t.type&&void 0!==t.minLength){const e=r.messages.minLength.replace("{minLength}",t.minLength.toLocaleString(r.locale));o.push((r=>void 0===r||null===r||!i&&""===r||r.length>=t.minLength||e))}if("string"===t.type&&void 0!==t.maxLength){const e=r.messages.maxLength.replace("{maxLength}",t.maxLength.toLocaleString(r.locale));o.push((r=>void 0===r||null===r||r.length<=t.maxLength||e))}if("string"===t.type&&void 0!==t.patternRegexp){const e=r.messages.pattern.replace("{pattern}",t.pattern);o.push((r=>void 0===r||null===r||""===r||!!r.match(t.patternRegexp)||e))}if(["number","integer"].includes(t.type)&&void 0!==t.maximum){const e=r.messages.maximum.replace("{maximum}",t.maximum.toLocaleString(r.locale));o.push((r=>void 0===r||null===r||r<=t.maximum||e))}if(["number","integer"].includes(t.type)&&void 0!==t.exclusiveMaximum){const e=r.messages.exclusiveMaximum.replace("{exclusiveMaximum}",t.exclusiveMaximum.toLocaleString(r.locale));o.push((r=>void 0===r||null===r||rvoid 0===r||null===r||r>=t.minimum||e))}if(["number","integer"].includes(t.type)&&void 0!==t.exclusiveMinimum){const e=r.messages.exclusiveMinimum.replace("{exclusiveMinimum}",t.exclusiveMinimum.toLocaleString(r.locale));o.push((r=>void 0===r||null===r||r>t.exclusiveMinimum||e))}t.enum&&o.push((e=>void 0===e||null===e||!!t.enum.find((t=>(0,s.deepEqual)(t,e)))||"")),"array"===t.type&&t.items.enum&&o.push((e=>void 0===e||null===e||!e.find((e=>!t.items.enum.find((t=>(0,s.deepEqual)(t,e)))))||"")),n&&"array"!==t.type&&o.push((e=>void 0===e||null===e||!!t.oneOf.find((t=>(0,s.deepEqual)(t.const,e)))||"")),n&&"array"===t.type&&o.push((e=>void 0===e||null===e||!e.find((e=>!t.items.oneOf.find((t=>(0,s.deepEqual)(t.const,e)))))||"")),r.validator&&r.useValidator&&o.push(O(e,r.validator));const a=(t["x-rules"]||[]).map((e=>{if("string"===typeof e){const t=r.rules&&r.rules[e];return t||console.error(`rule ${e} is referenced but not define in options`),t}console.error("rule should be a string, received "+typeof e)})).filter((e=>!!e));return o.concat(a)},O=(e,t,r)=>{const i=t(e);return e=>{if(null===e||void 0===e)return!0;const t=i(e);return!t||t}};r(8872);var P={data(){return{currentOneOf:null,currentTab:null,showCurrentOneOf:!0,subModels:{},currentStep:1,steps:[]}},computed:{isObjectContainer(){if(this.fullSchema)return!("object"!==this.fullSchema.type&&!Array.isArray(this.fullSchema.items))&&(!this.isSelectProp&&!this.isFileProp)},subSchemas(){if(this.fullSchema)return this.fullSchema.oneOf||this.fullSchema.anyOf},subSchemasConstProp(){if(!this.subSchemas)return;const e=this.subSchemas[0].properties,t=Object.keys(e).find((t=>!!e[t].const));return t?{...e[t],key:t,htmlDescription:this.fullOptions.memMarkdown(e[t].description)}:void 0},subSchemasRequired(){return!(!this.subSchemas||!this.subSchemasConstProp)&&(!!this.fullSchema.oneOf||(!!(this.fullSchema.anyOf&&this.fullSchema.required&&this.fullSchema.required.find((e=>e===this.oneOfConstProp.key)))||void 0))},subSchemasRules(){if(!this.fullSchema)return;const e=[];return this.subSchemasRequired&&e.push((e=>void 0!==e&&null!==e&&""!==e||this.fullOptions.messages.required)),e}},watch:{currentOneOf(e,t){this.showCurrentOneOf=!1,this.$nextTick((()=>{this.showCurrentOneOf=!0,this.currentOneOf?this.input(this.fixProperties(this.value),!1,!1):this.$set(this.subModels,"currentOneOf",{}),this.triggerChangeCurrentOneOf&&this.$nextTick((()=>{this.triggerChangeCurrentOneOf=!1,this.change()}))}))},subModels:{handler(){this.input(this.fixProperties(this.value),!1,!1)},deep:!0}},methods:{isSection(e,t){return!!e&&(!!e.title&&(!(e["x-fromUrl"]||e["x-fromData"]||e["contentMediaType"]||"file"===e["x-display"])&&(!!e.allOf||(!(!t||!e.anyOf&&!e.oneOf)||!(!e.properties&&!Array.isArray(e.items))))))},initObjectContainer(e){"object"===this.fullSchema.type&&(this.fullSchema.allOf&&this.fullSchema.allOf.forEach(((t,r)=>{this.$set(this.subModels,"allOf-"+r,n()(e))})),this.currentOneOf=null,this.subSchemas&&!this.currentOneOf&&this.subSchemasConstProp&&(e&&e[this.subSchemasConstProp.key]?this.currentOneOf=this.subSchemas.find((t=>t.properties[this.subSchemasConstProp.key].const===e[this.subSchemasConstProp.key])):this.fullSchema.default&&(this.currentOneOf=this.subSchemas.find((e=>e.properties[this.subSchemasConstProp.key].const===this.fullSchema.default[this.subSchemasConstProp.key])))),this.currentOneOf?this.$set(this.subModels,"currentOneOf",n()(e)):this.$set(this.subModels,"currentOneOf",{}))},renderStepperStep(e,t,r,i,n,s){if(!i)return;const o=r||t.key,a=this.dedupChildrenWithValidatedErrors.includes(o),l={step:n,editable:n!a]};return[e("v-stepper-step",{props:l},[t.title]),s?null:e("v-divider")]},renderSection(e,t,r,i,n,s){if(!i)return;const o=r||t.key,a="section-"+o;return"hidden"===t["x-display"]||t.readOnly&&this.fullOptions.hideReadOnly?[i]:"expansion-panels"===this.display?[e("v-expansion-panel",{key:a},[e("v-expansion-panel-header",{class:{"error--text":this.dedupChildrenWithValidatedErrors.includes(o)}},[t.title]),e("v-expansion-panel-content",{props:{eager:!0}},[i])])]:"tabs"===this.display?[e("v-tab",{key:a,props:{href:`#tab-${this.fullOptions.idPrefix}${this.dashKey}-${o}`}},[e("span",{class:{"error--text":this.dedupChildrenWithValidatedErrors.includes(o)}},[t.title])]),e("v-tab-item",{key:a,props:{value:`tab-${this.fullOptions.idPrefix}${this.dashKey}-${o}`,eager:!0}},[e("v-card",{props:{tile:!0,flat:!0}},[e("v-card-text",[i])])])]:"stepper"===this.display||"vertical-stepper"===this.display?[e("v-stepper-content",{key:a,props:{step:n,eager:!0}},[e("v-card",{props:{tile:!0,flat:!0}},[e("v-card-text",{class:{"pa-0":!0}},[i]),s?null:e("v-card-actions",{class:{"px-0":!0}},[e("v-btn",{props:{color:"primary"},on:{click:()=>{i.componentInstance.validate(!0)&&(this.currentStep+=1)}}},this.fullOptions.messages.stepperContinue)])])])]:void 0},renderChildProp(e,t,r,i,s,o){let a;this.objectContainerChildrenCount+=1,a=r?this.subModels:Array.isArray(this.value)?[...this.value]:{...this.value};const l=r||t.key;let u=a[l];return u=this.fixValueType(u,t),void 0===u&&(u=this.defaultValue(t),void 0!==t.default&&(u=n()(t.default)),void 0!==u&&null!==u&&(this.$set(a,l,u),r||this.input(a,!1,!1))),e("v-jsf",{props:{schema:{readOnly:this.fullSchema.readOnly,...t},value:u,modelRoot:this.modelRoot||this.value,modelKey:l,parentKey:`${this.fullKey}.`,required:s||!(!this.fullSchema.required||!this.fullSchema.required.includes(t.key)),options:{...this.fullOptions,autofocus:this.fullOptions.autofocus&&1===this.objectContainerChildrenCount},optionsRoot:this.initialOptions,sectionDepth:i,sharedData:this.sharedData,showSectionTitle:o},class:this.fullOptions.childrenClass,scopedSlots:this.childScopedSlots(l),key:l,on:{error:e=>this.$emit("error",e),input:e=>{void 0===e?Array.isArray(a)&&parseInt(l)this.change(!1)}},this.childSlots(e,t.key))},renderObjectContainer(e){if(!this.isObjectContainer)return;if([void 0,null].includes(this.value))return[];const t=[];this.objectContainerChildrenCount=0;const r=[];this.fullSchema.properties&&this.fullSchema.properties.forEach((i=>{this.isSection(i)?r.push({schema:i,subModelKey:null,forceRequired:!1}):t.push(this.renderChildProp(e,i,null,this.sectionDepth,!1,!1))})),Array.isArray(this.fullSchema.items)&&this.fullSchema.items.forEach(((i,n)=>{const s=this.value.length>n||this.fullSchema.minItems&&this.fullSchema.minItems>n;this.isSection(i)?r.push({schema:i,subModelKey:null,forceRequired:s}):t.push(this.renderChildProp(e,i,null,this.sectionDepth,s,!1))})),this.fullSchema.allOf&&this.fullSchema.allOf.forEach(((i,n)=>{const s={...i,type:"object",key:""+n};this.isSection(i,!0)?r.push({schema:s,subModelKey:"allOf-"+n,forceRequired:!1}):t.push(this.renderChildProp(e,s,"allOf-"+n,this.sectionDepth,!1,!1))}));let i=[],n=[];if(r.forEach(((t,s)=>{const o=!["expansion-panels","tabs","stepper","vertical-stepper"].includes(this.display),a=this.renderChildProp(e,t.schema,t.subModelKey,this.sectionDepth+1,t.forceRequired,o);o?i.push(a):i=i.concat(this.renderSection(e,t.schema,t.subModelKey,a,s+1,s===r.length-1)),"stepper"!==this.display&&"vertical-stepper"!==this.display||(n=n.concat(this.renderStepperStep(e,t.schema,t.subModelKey,a,s+1,s===r.length-1)))})),"expansion-panels"===this.display&&i.length){const t={...this.fullOptions.expansionPanelsProps,...this.fullSchema["x-props"]};i=[e("v-expansion-panels",{props:t},i)]}if("tabs"===this.display&&i.length){const t={...this.fullOptions.tabsProps,...this.fullSchema["x-props"]};this.currentTab&&this.dedupChildrenWithValidatedErrors.includes(this.currentTab)&&(t.sliderColor="error"),i=[e("v-tabs",{props:t,on:{change:e=>{this.currentTab=e.split("-").pop()}}},i)]}if("stepper"===this.display&&i.length){const t={...this.fullOptions.stepperProps,...this.fullSchema["x-props"],value:this.currentStep};i=[e("v-stepper",{props:t,style:"width: 100%;",on:{change:e=>{this.currentStep=e}}},[e("v-stepper-header",{},n),e("v-stepper-items",{},i)])]}if("vertical-stepper"===this.display&&i.length){const t={...this.fullOptions.verticalStepperProps,...this.fullSchema["x-props"],vertical:!0,value:this.currentStep},r=[];for(let e=0;e{this.currentStep=e}}},r)]}if(this.subSchemas&&this.subSchemas.length){const r={...this.commonFieldProps,...this.subSchemasConstProp&&this.subSchemasConstProp["x-props"]||{},disabled:this.disabled||this.subSchemasConstProp&&this.subSchemasConstProp.readOnly,value:this.currentOneOf,label:this.subSchemasConstProp&&this.subSchemasConstProp.title||this.fullSchema.title,items:this.subSchemas.filter((e=>!e["x-if"]||!!this.getFromExpr(e["x-if"]))).filter((e=>e.properties&&e.properties[this.subSchemasConstProp.key])),required:this.subSchemasRequired,clearable:!this.subSchemasRequired,itemValue:e=>e.properties[this.subSchemasConstProp.key].const,itemText:e=>e.title||e.properties[this.subSchemasConstProp.key].const,rules:this.subSchemasRules,returnObject:!0},i={input:e=>{this.currentOneOf=e,this.triggerChangeCurrentOneOf=!0}};t.push(e("v-select",{props:r,on:i,style:this.subSchemasConstProp&&this.subSchemasConstProp["x-style"]||""},[this.renderTooltip(e,"append-outer")])),this.currentOneOf&&this.showCurrentOneOf&&t.push(this.renderChildProp(e,{...this.currentOneOf,type:"object",title:null},"currentOneOf",this.sectionDepth+1))}return[e("v-row",{class:`ma-0 ${this.fullOptions.objectContainerClass}`},[this.showSectionTitle&&e("v-col",{props:{cols:12},class:"pa-0"},[e("span",{class:"py-2 "+(this.fullOptions.sectionsTitlesClasses[this.sectionDepth-1]||this.fullOptions.sectionsTitlesClasses[this.fullOptions.sectionsTitlesClasses.length-1])},[`${this.fullSchema.title} `])]),this.localRuleError&&!this.dedupChildrenWithValidatedErrors.length&&e("v-col",{props:{cols:12},class:{"px-0":!0,"error--text":!0}},this.localRuleError),this.fullSchema.description&&!this.subSchemasConstProp&&e("v-col",{props:{cols:12},class:{"pa-0":!0},domProps:{innerHTML:this.htmlDescription}})].concat(t).concat(i))]},childSlots(e,t){return Object.keys(this.$slots).filter((e=>e.startsWith(`${t}.`)||e.startsWith(`${t}-`))).map((r=>{const i=r.startsWith(`${t}.`)?r.replace(`${t}.`,""):r.replace(`${t}-`,"");return e("template",{slot:i},this.$slots[r])}))},childScopedSlots(e){return Object.keys(this.$scopedSlots).filter((t=>t.startsWith("custom-")||t.startsWith(`${e}.`)||t.startsWith(`${e}-`)||t===e)).reduce(((t,r)=>{let i="default";return r.startsWith(`${e}.`)&&(i=r.replace(`${e}.`,"")),r.startsWith(`${e}-`)&&(i=r.replace(`${e}-`,"")),r.startsWith("custom-")&&(i=r),t[i]=this.$scopedSlots[r],t}),{})}}};const T=e=>{const t=""+e;return 1===t.length?"0"+t:t},I=e=>{const t=e.getTimezoneOffset(),r=`${T(parseInt(Math.abs(t/60)))}:${T(Math.abs(t%60))}`;let i;return i=t<0?`+${r}`:t>0?`-${r}`:"Z",`${e.getFullYear()}-${T(e.getMonth()+1)}-${T(e.getDate())}T${T(e.getHours())}:${T(e.getMinutes())}:${T(e.getSeconds())}${i}`},D=e=>[`${e.getFullYear()}-${T(e.getMonth()+1)}-${T(e.getDate())}`,`${T(e.getHours())}:${T(e.getMinutes())}`],L=e=>{const t=new Date,r=e[0].split("-");t.setFullYear(Number(r[0])),t.setMonth(Number(r[1])-1),t.setDate(Number(r[2]));const i=e[1].split(":");return t.setHours(Number(i[0]||"00")),t.setMinutes(Number(i[1]||"00")),t.setSeconds(0),I(t)},R=e=>e?e.slice(0,5):"",N=e=>e+":00Z";var j={data(){return{dateProp:{tab:"tab-date",menu:!1,parts:[null,null],lastValue:null}}},methods:{renderDateProp(e){if("string"!==this.fullSchema.type||!["date","date-time","time"].includes(this.fullSchema.format))return;let t,r=this.fullOptions.icons.calendar;if("time"===this.fullSchema.format)t=e("v-time-picker",{props:{...this.fullOptions.timePickerProps,locale:this.fullOptions.locale,value:R(this.value)},on:{input:e=>this.input(N(e)),change:()=>this.change()}}),r=this.fullOptions.icons.clock;else if("date"===this.fullSchema.format)t=e("v-date-picker",{props:{...this.fullOptions.datePickerProps,locale:this.fullOptions.locale,value:this.value},on:{input:e=>{this.input(e),this.dateProp.menu=!1},change:()=>this.change()}});else{this.value!==this.dateProp.lastValue&&(this.dateProp.parts=D(new Date(this.value))),this.dateProp.lastValue=this.value;const r=()=>{if(this.dateProp.parts[1]){const e=L(this.dateProp.parts);this.input(e),this.change()}},i=[e("v-tab",{props:{href:"#tab-date"}},[e("v-icon",[this.fullOptions.icons.calendar])]),e("v-tab",{props:{href:"#tab-time",disabled:!this.dateProp.parts[0]}},[e("v-icon",[this.fullOptions.icons.clock])]),e("v-tab-item",{props:{value:"tab-date"}},[e("v-date-picker",{props:{...this.fullOptions.datePickerProps,locale:this.fullOptions.locale,value:this.dateProp.parts[0]},on:{input:e=>{this.dateProp.parts[0]=e,this.dateProp.tab="tab-time",r()}}})]),e("v-tab-item",{props:{value:"tab-time"}},[e("v-time-picker",{props:{...this.fullOptions.timePickerProps,locale:this.fullOptions.locale,value:this.dateProp.parts[1]},on:{input:e=>{this.dateProp.parts[1]=e,r()}}})])];t=e("v-tabs",{props:{grow:!0,value:this.dateProp.tab},on:{input:e=>{this.dateProp.tab=e}},class:"vjsf-date-time"},i)}const i={};return i.activator=({on:t})=>e("v-text-field",{props:{...this.commonFieldProps,value:this.formattedValue,clearable:!this.required,readonly:!0,prependIcon:r},on:{...t,input:e=>this.input(e),change:e=>this.change()}},[this.renderTooltip(e,"append-outer")]),[e("v-menu",{scopedSlots:i,props:{value:this.dateProp.menu,disabled:this.disabled,closeOnContentClick:!1,nudgeRight:40,transition:"scale-transition",offsetY:!0,fullWidth:!0,minWidth:"290px"},on:{input:e=>{this.dateProp.menu=e,this.dateProp.tab="tab-date"}}},[t])]}}},B={computed:{isSimpleProp(){return"string"===this.fullSchema.type||["number","integer"].includes(this.fullSchema.type)||"boolean"===this.fullSchema.type||"array"===this.fullSchema.type&&this.fullSchema.items&&["string","number","integer"].includes(this.fullSchema.items.type)}},methods:{parseNumber(e,t){return t+="",t?"-"===t?null:"integer"===this.fullSchema.type?parseInt(t,10):parseFloat(t):null},renderSimpleProp(e){if(!this.isSimpleProp)return;let t;const r={...this.commonFieldProps},i={},n={},s=[...this.renderPropSlots(e)],o={input:e=>this.input(e),change:e=>this.change()},a={};let l="append-outer";if("string"!==this.fullSchema.type||this.separator||("textarea"===this.display||this.fullSchema.maxLength&&this.fullSchema.maxLength>1e3&&"single-line"!==this.display?(t="v-textarea",Object.assign(r,this.fullOptions.textareaProps),i.class="v-text-field--box v-text-field--enclosed"):(t="v-text-field",Object.assign(r,this.fullOptions.textFieldProps),"password"===this.display&&(r.type="password",n.autocomplete="new-password")),this.fullOptions.maxLengthCounter&&this.fullSchema.maxLength&&(r.counter=this.fullSchema.maxLength)),"string"===this.fullSchema.type&&this.separator&&(t="v-combobox",Object.assign(r,this.fullOptions.comboboxProps),r.chips=!0,r.multiple=!0,r.appendIcon="",r.type="string",r.validateOnBlur=!0,a.selection=t=>{const r=()=>{const e=this.value?this.value.split(this.separator):[];e.splice(t.index,1),this.input(e),this.change()};return e("v-chip",{props:{close:!0},on:{"click:close":r}},t.item)}),["number","integer"].includes(this.fullSchema.type)&&("slider"===this.display?(t="v-slider",Object.assign(r,this.fullOptions.sliderProps)):(t="v-text-field",Object.assign(r,this.fullOptions.textFieldProps),Object.assign(r,this.fullOptions.numberProps)),r.type="number",void 0!==this.fullSchema.minimum&&(r.min=this.fullSchema.minimum),void 0!==this.fullSchema.maximum&&(r.max=this.fullSchema.maximum),r.step=this.fullSchema["x-step"]||("integer"===this.fullSchema.type?1:.01),o.input=e=>this.input(this.parseNumber(this.fullSchema.type,e))),"boolean"===this.fullSchema.type&&(l="append","switch"===this.display?(t="v-switch",Object.assign(r,this.fullOptions.switchProps)):(t="v-checkbox",Object.assign(r,this.fullOptions.checkboxProps)),o.change=e=>{this.input(e||!1),this.change()}),"array"===this.fullSchema.type&&["string","number","integer"].includes(this.fullSchema.items.type)){t="v-combobox",Object.assign(r,this.fullOptions.comboboxProps),r.chips=!0,r.multiple=!0,r.appendIcon="",r.type="string",r.validateOnBlur=!0;const i=$(this.fullSchema.items,h.prepareFullSchema(this.fullSchema.items,null,this.fullOptions),this.fullOptions);r.rules=r.rules.concat([e=>{const t=e.map((e=>{const t=i.find((t=>"string"===typeof t(e)));return t&&t(e)})),r=t.find((e=>!!e));return r||!0}]),"string"!==this.fullSchema.items.type&&(r.type="number",o.input=e=>{const t=e.map((e=>this.parseNumber(this.fullSchema.items.type,e))).filter((e=>!isNaN(e)));this.input(t)}),a.selection=t=>{const r=()=>{const e=[...this.value];e.splice(t.index,1),this.input(e),this.change()},n=i.find((e=>"string"===typeof e(t.item)));return e("v-chip",{props:{close:!0,color:n?"error":"default"},on:{"click:close":r}},t.item)}}return this.htmlDescription&&s.push(this.renderTooltip(e,l)),t=this.customTag?this.customTag:t,t?[e(t,{props:r,domProps:i,attrs:n,on:o,scopedSlots:a,directives:this.directives},s)]:null}}};const F=e=>new Promise((t=>{const r=new FileReader;r.onload=()=>t(r.result),r.readAsDataURL(e)})),z=async(e,t,r)=>{let i=e;if("string"===t.type||t.properties&&t.properties.data&&"string"===t.properties.data.type){const t=await F(e);i=r?t:t.split(";base64,")[1]}return"string"===t.type?i:{name:e.name,lastModified:new Date(e.lastModified).toISOString(),size:e.size,type:e.type,data:i}};var V={computed:{isFileProp(){if(this.fullSchema)return!("string"!==this.fullSchema.type||!this.fullSchema.contentMediaType&&"file"!==this.display)||(!("array"!==this.fullSchema.type||!this.fullSchema.items||"string"!==this.fullSchema.items.type||!this.fullSchema.items.contentMediaType&&"file"!==this.display&&"file"!==this.fullSchema.items["x-display"])||(!("object"!==this.fullSchema.type||!this.fullSchema.contentMediaType&&"file"!==this.display)||!("array"!==this.fullSchema.type||!this.fullSchema.items||"object"!==this.fullSchema.items.type||!this.fullSchema.items.contentMediaType&&"file"!==this.display&&"file"!==this.fullSchema.items["x-display"])))}},watch:{isFileProp(){this.isFileProp&&!this.fullSchema.writeOnly&&console.warn("File property should always be used with writeOnly attribute. Files are uploaded but not read in existing data.")}},methods:{renderFileProp(e){if(!this.isFileProp)return;const t={...this.commonFieldProps,...this.fullOptions.fileInputProps};delete t.value,this.value&&this.value.name&&(t.placeholder=this.value.name,t.persistentPlaceholder=!0);const r={};this.fullSchema.contentMediaType&&(r.accept=this.fullSchema.contentMediaType),this.fullSchema.items&&this.fullSchema.items.contentMediaType&&(r.accept=this.fullSchema.items.contentMediaType),"array"===this.fullSchema.type&&(r.multiple=!0);const i=[...this.renderPropSlots(e)],n={change:async e=>{if("array"===this.fullSchema.type){const t=await Promise.all(e.map((e=>z(e,this.fullSchema.items,this.fullOptions.filesAsDataUrl))));this.input(t),this.change()}else{const t=await z(e,this.resolvedSchema,this.fullOptions.filesAsDataUrl);this.input(t),this.change()}}};return this.htmlDescription&&i.push(this.renderTooltip(e,"append-outer")),[e("v-file-input",{props:t,attrs:r,on:n,scopedSlots:this.$scopedSlots},i)]}}},q={computed:{isColorProp(){return"string"===this.resolvedSchema.type&&("hexcolor"===this.resolvedSchema.format||"color-picker"===this.display)}},methods:{renderColorProp(e){if(!this.isColorProp)return;const t=[this.renderTooltip(e,"append")];return t.push(e("v-menu",{props:{closeOnContentClick:!1,closeOneClick:!0,direction:"bottom",offsetY:!0},scopedSlots:{activator:({on:t})=>e("div",{on:t,style:`background-color: ${this.value};margin-left: 10px;`,class:this.value?"color-picker-trigger":"color-picker-trigger color-picker-trigger-empty"}),default:()=>e("v-color-picker",{props:{flat:!0,...this.fullOptions.colorPickerProps,...this.fullSchema["x-props"],value:this.value||""},on:{input:e=>{this.input(e),this.change()}}})}})),[e("v-input",{props:{value:this.value,name:this.fullKey,label:this.label,required:this.required,rules:this.rules,disabled:this.disabled,...this.fullOptions.fieldProps}},t)]}}};r(41795);const U={};var H=U;U.fetchRawItems=async(e,t,r,i)=>{const n=r.replace("{q}",encodeURIComponent(i||"")),s=await e.httpLib.get(n,e.httpOptions),o=s.data||s.body,a=t["x-itemsProp"]?o[t["x-itemsProp"]]:o;if(!Array.isArray(a))throw new Error(`Result of http fetch ${n} is not an array`);return a},U.getSelectItems=(e,t,r,i)=>{const n=[];if(e)if("object"===t.type&&t.properties&&Object.keys(t.properties).length||"array"===t.type&&t.items&&"object"===t.items.type&&t.items.properties&&Object.keys(t.items.properties).length){const r=t.properties?t.properties.map((e=>e.key)):Object.keys(t.items.properties);e.forEach((e=>{const i={};r.forEach((r=>{const n=t.properties?t.properties.find((e=>e.key===r)):t.items.properties[r];void 0!==e[r]&&(i[r]=e[r],"string"===n.type&&(i[r]=""+i[r])),"default"in n&&r in i&&(i[r]=n.default),"const"in n&&(i[r]=n.const)})),n.push(i)}))}else e.forEach((e=>{if("object"===typeof e)n.push(e);else{const t={[r]:e};i&&(t[i]=e),n.push(t)}}));else;return n};const W=(e,t,r)=>![null,void 0].includes(e)&&(![null,void 0].includes(t)&&(0,s.deepEqual)(e[r],t[r])),K=[],Y=async(e,t,r,i,n)=>{const o=K.find((e=>(0,s.deepEqual)(e.key,[r,i,n])));if(o)return o.result||n;const a=await U.fetchRawItems(e,t,i,n[r]),l=a.find((e=>W(e,n,r)));return K.push({key:[r,i,n],result:l}),l||n};U.fillSelectItems=async(e,t,r,i,n,s,o,a)=>{if(r)if(Array.isArray(r))for(let l of r.map((e=>e)).reverse())a||(l={[n]:l}),i.find((e=>W(e,l,n)))||(!a&&o&&(l=await Y(e,t,n,o,l)),i.push(l));else a||(r={[n]:r}),i.find((e=>W(e,r,n)))||(!a&&o&&(r=await Y(e,t,n,o,r)),i.push(r))},U.fillList=(e,t,r,i)=>{if(t)return r.length?(t=[...t],r.forEach((e=>{t.find((t=>W(e,t,i)))||t.push(e)})),t.forEach(((e,n)=>{r.find((t=>W(t,e,i)))||(t[n]=null)})),t.filter((e=>!!e))):[]},U.isOneOfSelect=e=>{if(e)return!("array"!==e.type||!e.items||!["string","integer","number"].includes(e.items.type)||!e.items.oneOf&&!e.items.anyOf)||(!!(["string","integer","number"].includes(e.type)&&e.oneOf&&e.oneOf[0]&&void 0!==e.oneOf[0].const)||!!(["string","integer","number"].includes(e.type)&&e.anyOf&&e.anyOf[0]&&void 0!==e.anyOf[0].const))},U.getObjectTitle=(e,t,r)=>{if(!t)return null;const i=r.items&&r.items.properties&&r.items.properties[t];if(i){const r=U.isOneOfSelect(i);if(r){const r=i.anyOf||i.oneOf,n=r.find((r=>r.const===e[t]||r.enum&&r.enum[0]===e[t]));if(n)return n.title}}if(r.items&&(r.items.oneOf||r.items.anyOf)){const i=r.items.oneOf||r.items.anyOf,n=i[0].properties,s=Object.keys(n).find((e=>"const"in n[e])),o=i.find((r=>r.properties[s].const===e[t]));if(o)return o.title}return e[t]};var G=r(32900),Z=r.n(G),J=r(76459),X=r.n(J),Q={data(){return{rawSelectItems:null,selectItems:[],q:"",fromUrlParams:{}}},computed:{isSelectProp(){if(this.fullSchema)return"list"!==this.display&&(!!this.fullSchema.enum||(!("array"!==this.fullSchema.type||!this.fullSchema.items||!this.fullSchema.items.enum)||(!!this.oneOfSelect||(!!this.examplesSelect||(!!this.fullSchema["x-fromUrl"]||!!this.fromData)))))},oneOfSelect(){return H.isOneOfSelect(this.fullSchema)},examplesSelect(){if(this.fullSchema)return!!("array"===this.fullSchema.type&&this.fullSchema.items&&["string","integer","number"].includes(this.fullSchema.items.type)&&this.fullSchema.items.examples)||!(!["string","integer","number"].includes(this.fullSchema.type)||!this.fullSchema.examples)},fromUrlWithQuery(){if(this.fullSchema)return!(!this.fullSchema["x-fromUrl"]||-1===this.fullSchema["x-fromUrl"].indexOf("{q}"))},fromUrlKeys(){if(this.fullSchema)return this.fullSchema["x-fromUrl"]?Z()(this.fullSchema["x-fromUrl"],/\{(.*?)\}/g).toArray().filter((e=>"q"!==e)):null},fromUrl(){if(!this.fullSchema)return;let e=this.fullSchema["x-fromUrl"];if(e){for(const t of this.fromUrlKeys){if(void 0===this.fromUrlParams[t])return;e=e.replace(`{${t}}`,this.fromUrlParams[t])}return e}},fromData(){if(this.fullSchema)return this.fullSchema["x-fromData"]},itemKey(){if(this.fullSchema)return this.fullSchema["x-itemKey"]||"key"},itemTitle(){if(this.fullSchema)return this.fullSchema["x-itemTitle"]||"title"},itemIcon(){if(this.fullSchema)return this.fullSchema["x-itemIcon"]||("icon"===this.display?this.itemKey:null)},returnObject(){if(this.fullSchema)return"object"===this.fullSchema.type||this.fullSchema.items&&"object"===this.fullSchema.items.type}},watch:{q(){this.value&&this.value[this.itemTitle]===this.q||this.fetchSelectItems()},rawSelectItems:{handler(){this.updateSelectItems()}}},methods:{initSelectProp(e){if(this.fromUrlWithQuery&&e&&void 0!==e[this.itemTitle]&&(this.q=e[this.itemTitle]),this.fromUrl&&this.fetchSelectItems(),this.fullSchema["x-fromUrl"]&&(this.openEndedSelect="v-combobox"===this.customTag||"combobox"===this.fullSchema["x-display"]),("array"===this.fullSchema.type&&this.fullSchema.items&&this.fullSchema.items.enum||this.fullSchema.enum)&&(this.rawSelectItems="array"===this.fullSchema.type?this.fullSchema.items.enum:this.fullSchema.enum),this.oneOfSelect){const e="array"===this.fullSchema.type?this.fullSchema.items:this.fullSchema,t=e.anyOf||e.oneOf;this.openEndedSelect=e.anyOf&&!!e.anyOf.find((e=>!e.const&&!e.enum)),this.rawSelectItems=t.filter((e=>!e["x-if"]||!!this.getFromExpr(e["x-if"]))).filter((e=>"const"in e||!!e.enum)).map((e=>({...e,[this.itemKey]:"const"in e?e.const:e.enum&&e.enum[0],[this.itemTitle]:e.title})))}if(this.examplesSelect){const e="array"===this.fullSchema.type&&this.fullSchema.items.examples||this.fullSchema.examples;this.openEndedSelect=!0,this.rawSelectItems=e.map((e=>({[this.itemKey]:e,[this.itemTitle]:e})))}this.fullSchema["x-fromData"]&&(this.openEndedSelect="v-combobox"===this.customTag||"combobox"===this.fullSchema["x-display"],this.$watch((()=>this.getFromExpr(this.fullSchema["x-fromData"])),(e=>{this.rawSelectItems=e}),{immediate:!0})),this.fromUrlKeys&&this.fromUrlKeys.forEach((e=>{this.$watch((()=>this.getFromExpr(e)),(t=>{this.$set(this.fromUrlParams,e,t),this.fetchSelectItems()}),{immediate:!0})}))},fetchSelectItems(){if(!this.fromUrl)return;if(!this.fullOptions.httpLib)return console.error("No http lib found to perform ajax request"),this.$emit("error","No http lib found to perform ajax request");this.debouncedFetch=this.debouncedFetch||X()((async()=>{this.loading=!0;try{this.rawSelectItems=await H.fetchRawItems(this.fullOptions,this.fullSchema,this.fromUrl,this.q)}catch(err){console.error(err),this.$emit("error",err.message)}this.loading=!1}),250);const e=this.debouncedFetch();this.sharedData.asyncOperations=this.sharedData.asyncOperations||{},this.sharedData.asyncOperations[this.fullKey]=e,e.finally((()=>{this.sharedData.asyncOperations[this.fullKey]===e&&delete this.sharedData.asyncOperations[this.fullKey]}))},async updateSelectItems(){const e=H.getSelectItems(this.rawSelectItems,this.fullSchema,this.itemKey,this.itemIcon);"list"===this.display&&this.rawSelectItems&&this.input(H.fillList(this.fullSchema,this.value,e,this.itemKey)),this.loading=!0,await H.fillSelectItems(this.fullOptions,this.fullSchema,this.separator&&"string"===typeof this.value?this.value.split(this.separator):this.value,e,this.itemKey,this.itemTitle,this.fromUrlWithQuery&&this.fromUrl,this.returnObject),this.loading=!1,(0,s.deepEqual)(e,this.selectItems)||(this.selectItems=e)},renderSelectIcon(e,t){if(!this.itemIcon)return;let r,i=t[this.itemIcon];if(i){if(i.startsWith("http://")||i.startsWith("https://"))r=e("img",{domProps:{src:i},style:"height:100%;width:100%;"});else if(i.startsWith("{this.input(e),this.change()}},s={...this.fullOptions.radioItemProps,label:r,value:i,inputValue:this.separator&&"string"===typeof this.value?this.value.split(this.separator):this.value,multiple:"array"===this.fullSchema.type||!!this.separator,hideDetails:!0};return e(`v-${this.display}`,{props:s,on:n,class:"pb-1"})},renderSelectionControlGroup(e){const t={change:e=>{this.input(e),this.change()}},r={...this.commonFieldProps,multiple:"array"===this.fullSchema.type||!!this.separator,label:null},i=e("legend",{class:`v-label theme--${this.theme.isDark?"dark":"light"} ${this.hasError?"error--text":""}`},this.commonFieldProps.label),n=this.selectItems.map((t=>this.renderSelectionControlItem(e,t)));return[e("v-input",{props:r,on:t,class:"v-input--selection-controls v-input--radio-group v-input--radio-group--column"},[e("div",{class:"v-input--radio-group__input"},[i,...n]),this.renderTooltip(e,"append")])]},renderRadioItem(e,t){const r=t[this.itemTitle]||t[this.itemKey],i=t[this.itemKey];return e("v-radio",{props:{...this.fullOptions.radioItemProps,label:r,value:i}})},renderRadioGroup(e){const t={...this.commonFieldProps,...this.fullOptions.radioGroupProps},r={change:e=>{this.input(e),this.change()}};return[e("v-radio-group",{props:t,on:r},[...this.selectItems.map((t=>this.renderRadioItem(e,t))),this.renderTooltip(e,"append")])]},renderSelectProp(e){if(!this.isSelectProp)return;if("radio"===this.display){if("array"!==this.fullSchema.type&&!this.separator)return this.renderRadioGroup(e);console.error("radio display is not available for arrays, use checkbox or switch")}if(["checkbox","switch"].includes(this.display))return this.renderSelectionControlGroup(e);const t={input:e=>this.input(e),change:e=>this.change()},r={selection:t=>{let r;this.openEndedSelect?(r=(this.selectItems||[]).find((e=>e[this.itemKey]===t.item)),r||(r={[this.itemKey]:t.item,[this.itemTitle]:t.item})):r=t.item;let i=r[this.itemTitle]||r[this.itemKey];return"array"===this.fullSchema.type&&t.index!==this.value.length-1&&(i+=", "),this.separator&&this.commonFieldProps.value&&t.index!==this.commonFieldProps.value.length-1&&(i+=", "),e("div",{class:{"v-select__selection":!0,"v-select__selection--comma":!0,"v-select__selection--disabled":this.disabled}},[this.renderSelectIcon(e,r),e("span",{domProps:{innerHTML:i},class:"mt-1"})])},item:t=>[this.renderSelectIcon(e,t.item),this.renderSelectCheckbox(e,t.attrs.inputValue),this.renderSelectItem(e,t.item)]};let i="v-select";this.customTag?i=this.customTag:this.display?("autocomplete"===this.display&&(i="v-autocomplete"),"select"===this.display&&(i="v-select")):(this.fromUrlWithQuery||this.rawSelectItems&&this.rawSelectItems.length>20)&&(i="v-autocomplete");const n={...this.commonFieldProps,...this.fullOptions.selectProps,validateOnBlur:!0,clearable:!this.required,multiple:"array"===this.fullSchema.type||!!this.separator,itemValue:this.itemKey,itemText:this.itemTitle,items:this.selectItems||[],returnObject:!!this.returnObject,loading:this.loading};"v-autocomplete"===i&&(i="v-autocomplete",n.noDataText=this.fullOptions.messages.noData,n.placeholder=this.fullOptions.messages.search,this.fromUrlWithQuery?(n.filter=()=>!0,n.searchInput=this.q,t["update:search-input"]=e=>{this.q=e}):n.filter=(e,t)=>(e[this.itemTitle]||e[this.itemKey]).toLowerCase().includes(t.toLowerCase())),this.openEndedSelect&&(i="v-combobox",n.multiple||(n.hideSelected=!0,t.input=e=>this.input(e||"")));const s=[...this.renderPropSlots(e)];if("v-select"===i&&n.multiple&&this.fullOptions.selectAll){const t=n.items.length===this.value.length;s.push(e("template",{slot:"prepend-item"},[e("v-list-item",[e("v-list-item-action",[e("v-checkbox",{props:{value:t},on:{click:()=>{t?this.input([]):this.input(n.items.map((e=>this.returnObject?e:e[this.itemKey]))),this.change()}}})]),e("v-list-item-content",[e("v-list-item-title",this.fullOptions.messages.selectAll)])]),e("v-divider")]))}return this.htmlDescription&&s.push(this.renderTooltip(e,"append-outer")),[e(i,{props:n,on:t,scopedSlots:r},s)]}}},ee={data(){return{editabledArrayProp:{currentDialog:null,editItem:null,editedItems:{}}}},computed:{isEditableArray(){if("array"===this.resolvedSchema.type&&this.resolvedSchema.items&&"object"===this.resolvedSchema.items.type)return!0},readonlyItemSchema(){if(!this.fullSchema||!this.fullSchema.items)return;const e=n()(this.fullSchema.items);return this.itemTitle&&(e.properties&&e.properties[this.itemTitle]&&"object"===typeof e.properties[this.itemTitle]&&(e.properties[this.itemTitle]["x-style"]="display: none;"),e.oneOf&&e.oneOf.forEach((e=>{e.properties[this.itemTitle]&&(e.properties[this.itemTitle]["x-style"]="display: none;")})),this.fullSchema.items.allOf&&e.allOf.forEach((e=>{e.properties[this.itemTitle]&&(e.properties[this.itemTitle]["x-style"]="display: none;")}))),e}},methods:{renderArrayItemModal(e,t,r){const i=-1===r;let n;this.editabledArrayProp.currentDialog===r&&(n=this.renderArrayItemEdit(e,r,!0));const s={activator:()=>this.renderArrayItemEditButton(e,t,r)},o=()=>{n.componentInstance.resetValidation(),this.editabledArrayProp.currentDialog=null},a={};return this.fullOptions.dialogProps.persistent||(a["click:outside"]=o),e("v-dialog",{props:{...this.fullOptions.dialogProps,value:this.editabledArrayProp.currentDialog===r,closeOnContentClick:!1},scopedSlots:s,on:a},[e("v-card",{props:this.fullOptions.dialogCardProps},[e("v-card-title",this.itemTitle&&t[this.itemTitle]),e("v-card-text",[n]),e("v-card-actions",[e("v-spacer"),e("v-btn",{props:{text:!0},on:{click:o},attrs:{id:this.fullOptions.idPrefix+this.dashKey+"--dialog-cancel-button"},class:{"vjsf-array-dialog-cancel-button":!0}},"cancel"),e("v-btn",{props:{color:"primary"},on:{click:()=>{if(!n.componentInstance.validate(!0))return;const e=[...this.value];i?(this.editabledArrayProp.editedItems[this.value.length]=!0,e.push(this.editabledArrayProp.editItem)):(this.editabledArrayProp.editedItems[r]=!0,this.$set(e,r,{...this.editabledArrayProp.editItem})),this.input(e),this.change(),this.shouldValidate=!0,this.editabledArrayProp.currentDialog=null}},attrs:{id:this.fullOptions.idPrefix+this.dashKey+"--dialog-ok-button"},class:{"vjsf-array-dialog-ok-button":!0}},"ok")])])])},renderArrayItemRO(e,t,r){const i=`item-${r}`,n={props:{schema:this.readonlyItemSchema,value:t,modelRoot:this.modelRoot||this.value,modelKey:i,parentKey:`${this.fullKey}.`,options:{...this.fullOptions,disableAll:!0,readOnlyArrayItem:!0},optionsRoot:this.initialOptions,sectionDepth:this.sectionDepth+1,separateValidation:!1,sharedData:this.sharedData},ref:i,scopedSlots:this.childScopedSlots(this.fullSchema.key)};return this.options.autoFixArrayItems&&(n.on={input:e=>{if(!this.editabledArrayProp.editedItems[r]){const t=[...this.value];t[r]=e,this.input(t)}}}),e("v-jsf",n,this.childSlots(e,this.fullSchema.key))},renderArrayItemEditButton(e,t,r,i){const s=-1===r,o=i||s;return e("v-btn",{on:{click:()=>{if(s&&"inline"===this.fullOptions.editMode){const e=n()(t),r=[...this.value];r.push(e),this.editabledArrayProp.currentDialog=r.length-1,this.editabledArrayProp.editItem=e,this.input(r),this.change()}else this.editabledArrayProp.currentDialog===r?(this.editabledArrayProp.editItem=null,this.editabledArrayProp.currentDialog=null,this.change()):(this.editabledArrayProp.editItem=n()(t),this.editabledArrayProp.currentDialog=r,"inline"===this.fullOptions.editMode&&this.$nextTick((()=>this.childrenInputs[`item-${r}`].validate(!0))))}},attrs:{id:this.fullOptions.idPrefix+this.dashKey+"-"+(s?"-add":r+"--edit")+"-button"},class:{"vjsf-array-add-button":!0,"ml-3":s},props:{icon:!o,fab:o,small:s,"x-small":i,color:"primary",depressed:i}},[e("v-icon",s?this.fullOptions.icons.add:this.fullOptions.icons.edit)])},renderArrayItemEdit(e,t,r){const i={...this.fullOptions,autofocus:r};return this.fullOptions.idPrefix.endsWith("--dialog--")||(i.idPrefix=this.fullOptions.idPrefix+"--dialog--"),e("v-jsf",{props:{schema:this.fullSchema.items,value:this.editabledArrayProp.editItem,modelRoot:this.modelRoot||this.value,modelKey:`item-${t}`,parentKey:`${this.fullKey}.`,options:i,optionsRoot:this.initialOptions,sectionDepth:this.sectionDepth+1,separateValidation:"inline"!==this.fullOptions.editMode,sharedData:this.sharedData},scopedSlots:this.childScopedSlots(this.fullSchema.key),ref:"item-"+t,on:{error:e=>this.$emit("error",e),input:e=>{if(this.editabledArrayProp.editItem=e,"inline"===this.fullOptions.editMode){const r=[...this.value];this.$set(r,t,e),this.input(r)}},change:()=>{"inline"===this.fullOptions.editMode&&this.change()}}},this.childSlots(e,this.fullSchema.key))},renderArrayItemMenu(e,t,r,i){if(this.disabled||this.fromUrl||this.fullSchema.fromData)return;const n=[];for(const s of this.fullOptions.arrayOperations)"duplicate"===s&&n.push({title:this.fullOptions.messages.duplicate,color:"default",icon:this.fullOptions.icons.duplicate,disabled:!1,on:{click:()=>{const e=this.value.findIndex((e=>e===t)),i=[...this.value];i.splice(e,0,{...t}),this.input(i),this.change(),this.shouldValidate=!0,r.componentInstance.validate()}}}),"delete"===s&&n.push({title:this.fullOptions.messages.delete,color:"warning",icon:this.fullOptions.icons.delete,disabled:i,on:{click:()=>{const e=this.value.filter((e=>e!==t));this.input(e),this.change(),this.shouldValidate=!0,r.componentInstance.validate()}}}),"copy"===s&&this.fullSchema["x-arrayGroup"]&&n.push({title:this.fullOptions.messages.copy,color:"default",icon:this.fullOptions.icons.copy,disabled:!1,on:{click:()=>{this.$set(this.sharedData,"clipboard_"+this.fullSchema["x-arrayGroup"],t)}}}),"paste"===s&&this.fullSchema["x-arrayGroup"]&&n.push({title:this.fullOptions.messages.paste,color:"primary",icon:this.fullOptions.icons.paste,disabled:!this.sharedData["clipboard_"+this.fullSchema["x-arrayGroup"]],on:{click:()=>{"inline"===this.fullOptions.editMode&&(this.editabledArrayProp.editItem=null,this.editabledArrayProp.currentDialog=null);const e=this.value.findIndex((e=>e===t)),i=[...this.value];i[e]=this.sharedData["clipboard_"+this.fullSchema["x-arrayGroup"]],this.input(i),this.change(),this.shouldValidate=!0,r.componentInstance.validate()}}});return n.length?1===n.length?e("v-btn",{props:{icon:!0,disabled:n[0].disabled},on:n[0].on,attrs:{title:n[0].title},class:"ml-1"},[e("v-icon",{props:{color:n[0].color}},[n[0].icon])]):e("v-menu",{props:{offsetY:!0,left:!0},scopedSlots:{activator:({on:t})=>e("v-btn",{props:{icon:!0},attrs:{title:this.fullOptions.messages.openMenu},class:"ml-1",on:t},[e("v-icon",this.fullOptions.icons.arrayMenu)]),default:()=>e("v-list",{class:"pa-0",props:{dense:!0}},n.map((t=>e("v-list-item",{on:t.on,props:{disabled:t.disabled}},[e("v-list-item-icon",{class:"mr-2"},[e("v-icon",{props:{color:t.color,small:!0}},[t.icon])]),e("v-list-item-content",{},[e("v-list-item-title",{},[t.title])])]))))}}):void 0},renderEditableArray(e){if(!this.isEditableArray)return;const t=[];if(!this.disabled&&!this.fromUrl&&!this.fullSchema.fromData&&this.fullOptions.arrayOperations.includes("create")){const r=this.fullSchema.items.default||this.defaultValue(this.fullSchema.items);"inline"===this.fullOptions.editMode?t.push(this.renderArrayItemEditButton(e,r,-1)):t.push(this.renderArrayItemModal(e,r,-1))}const r=e("v-input",{class:"mt-2 mb-3 pr-1 vjsf-array-header",props:{label:this.label,rules:this.rules,value:this.value,validateOnBlur:!this.shouldValidate,hideDetails:"auto"}},t),i=!this.fullOptions.disableSorting&&!this.disabled;let n,s;this.value&&this.value.length&&(n=this.value.filter((e=>!!e)).map(((t,n)=>{let s;const o="inline"===this.fullOptions.editMode&&this.editabledArrayProp.currentDialog===n;!this.disabled&&this.fullOptions.arrayOperations.includes("update")&&(s="inline"===this.fullOptions.editMode?this.renderArrayItemEditButton(e,t,n,o):this.renderArrayItemModal(e,t,n));const a=e("v-card-actions",{class:"pa-0"},[e("v-spacer"),s,this.renderArrayItemMenu(e,t,r,o)]);let l,u,c;o?(l=this.renderArrayItemEdit(e,n,!1),c="item-edit-"+n):(l=this.renderArrayItemRO(e,t,n),c=this.cached(`item-key-${n}`,{item:t},(()=>`${n}-${(new Date).getTime()}`)),i&&(u="cursor: move;"));const h="py-2 pr-2 "+this.fullOptions.arrayItemsTitlesClasses[this.sectionDepth]||0;let d=[e("v-card-title",{props:{primaryTitle:!0},class:h},[H.getObjectTitle(t,this.itemTitle,this.fullSchema),e("v-spacer"),a]),e("v-card-text",[l])];const f=this.dedupChildrenWithValidatedErrors.includes(`item-${n}`);d=o?[e("v-alert",{props:{color:f?"error":"primary","colored-border":!0,border:"left"},class:"pa-0 pl-2 ma-0"},d)]:f?[e("v-alert",{props:{color:"error",outlined:!0},class:"pa-0 ma-0"},d)]:[e("v-alert",{props:{color:"default",outlined:!0},class:"pa-0 ma-0 vjsf-invisible-alert"},d)];const p=[];o&&p.push({name:"click-outside",value:{handler:()=>{this.editabledArrayProp.currentDialog===n&&"inline"===this.fullOptions.editMode&&(this.editabledArrayProp.editItem=null,this.editabledArrayProp.currentDialog=null,this.change())},include:this.getOpenDependentElements}});let m="py-1 vjsf-array-item";return o&&(m+=" vjsf-array-item-active"),e("v-col",{props:this.fullOptions.arrayItemColProps,class:m,key:c},[e("v-card",{props:{...this.fullOptions.arrayItemCardProps},style:u,directives:p},d)])})));const o=i?e("draggable",{props:{value:this.value},attrs:{group:this.fullSchema["x-arrayGroup"]||this.fullKey,...this.fullOptions.sortableOptions},class:"row draggable vjsf-array",on:{change:async e=>{e.added&&await this.$nextTick(),this.editabledArrayProp.editItem=null,this.editabledArrayProp.currentDialog=null,this.input(s),this.change(),this.shouldValidate=!0},input:async e=>{s=e}}},n):e("v-row",{class:"vjsf-array"},n);return[r,o]}}},te={computed:{isMarkdownProp(){if(this.fullSchema)return"markdown"===this.fullSchema["x-display"]}},methods:{renderMarkdownProp(e){if(!this.isMarkdownProp)return;const t=[this.renderTooltip(e,"append")];return this.disabled?t.push(e("v-card",{props:{flat:!0},class:"px-0"},[e("v-card-text",{domProps:{innerHTML:this.fullOptions.markdown(this.value)},class:"px-0 py-1"})])):(t.push(e("v-card",{props:{outlined:!0}},[e("textarea",{attrs:{id:`${this.fullOptions.idPrefix}${this.dashKey}--easymde`}})])),this.$nextTick((()=>this.initEasyMDE()))),[e("v-input",{props:{value:this.value,name:this.fullKey,label:this.label,required:this.required,rules:this.rules,disabled:this.disabled,...this.fullOptions.fieldProps},class:"vjsf-markdown-input"},t)]},initEasyMDE(){if(this.easymde)return;if(!r.g.EasyMDE)return void console.error("VJSF requires EasyMDE to be available to handle the markdown format.");const e=r.g.EasyMDE,t={element:this.$el.querySelector("textarea"),initialValue:this.value,renderingConfig:{},status:!1,autoDownloadFontAwesome:!1,spellChecker:!1,minHeight:"300px",insertTexts:{link:[this.fullOptions.messages.mdeLink1,this.fullOptions.messages.mdeLink2],image:[this.fullOptions.messages.mdeImg1,this.fullOptions.messages.mdeImg2],table:[this.fullOptions.messages.mdeTable1,this.fullOptions.messages.mdeTable2],horizontalRule:["","\n\n-----\n\n"]},toolbar:[{name:"bold",action:e.toggleBold,className:"mdi mdi-format-bold",title:this.fullOptions.messages.bold},{name:"italic",action:e.toggleItalic,className:"mdi mdi-format-italic",title:this.fullOptions.messages.italic},{name:"heading",action:e.toggleHeadingSmaller,className:"mdi mdi-format-title",title:this.fullOptions.messages.heading},"|",{name:"quote",action:e.toggleBlockquote,className:"mdi mdi-format-quote-open",title:this.fullOptions.messages.quote},{name:"unordered-list",action:e.toggleUnorderedList,className:"mdi mdi-format-list-bulleted",title:this.fullOptions.messages.unorderedList},{name:"ordered-list",action:e.toggleOrderedList,className:"mdi mdi-format-list-numbered",title:this.fullOptions.messages.orderedList},"|",{name:"link",action:e.drawLink,className:"mdi mdi-link",title:this.fullOptions.messages.createLink},{name:"image",action:e.drawImage,className:"mdi mdi-image",title:this.fullOptions.messages.insertImage},{name:"table",action:e.drawTable,className:"mdi mdi-table",title:this.fullOptions.messages.createTable},"|",{name:"preview",action:e.togglePreview,className:"mdi mdi-eye accent--text",title:this.fullOptions.messages.preview,noDisable:!0},"|",{name:"undo",action:e.undo,className:"mdi mdi-undo",title:this.fullOptions.messages.undo,noDisable:!0},{name:"redo",action:e.redo,className:"mdi mdi-redo",title:this.fullOptions.messages.redo,noDisable:!0},"|",{name:"guide",action:"https://simplemde.com/markdown-guide",className:"mdi mdi-help-circle success--text",title:this.fullOptions.messages.mdeGuide,noDisable:!0}],...this.fullOptions.easyMDEOptions};this.easymde=new e(t);let i=!1;this.easymde.codemirror.on("change",(()=>{i=!0,this.input(this.easymde.value())})),this.easymde.codemirror.on("blur",(()=>{this.blurTimeout=setTimeout((()=>{i&&this.change(),i=!1}),500)})),this.easymde.codemirror.on("focus",(()=>{clearTimeout(this.blurTimeout)}))}}},re={data(){return{tooltip:{maxWidth:200}}},mounted(){this.htmlDescription&&this.$el&&this.$el.getBoundingClientRect&&(this.tooltip.maxWidth=this.$el.getBoundingClientRect().left-80)},methods:{renderTooltip(e,t){if(!this.fullOptions.hideTooltips&&(!this.fullOptions.hideReadOnlyTooltips||!this.fullSchema.readOnly&&!this.fullOptions.readOnlyArrayItem)&&this.htmlDescription)return e("v-tooltip",{slot:t,props:{contentClass:"vjsf-tooltip",...this.fullOptions.tooltipProps},scopedSlots:{activator:({on:t,attrs:r})=>(this.fullOptions.tooltipProps.openOnClick&&delete t.focus,e("v-btn",{on:t,attrs:r,props:{icon:!0,retainFocusOnClick:!0},style:"pointer-events: auto"},[e("v-icon",{},this.fullOptions.icons.info)]))}},[e("div",{style:`max-width: ${this.tooltip.maxWidth}px`,domProps:{innerHTML:this.htmlDescription}})])}}},ie={inject:["form"],provide(){return{form:{register:this.register,unregister:this.unregister,fastForwardEvent:this.fastForwardEvent,getExprNode:this.getExprNode}}},props:{separateValidation:{type:Boolean,default:!1}},data(){return{inputs:[],validated:!1,shouldValidate:!1,dedupChildrenWithValidatedErrors:[]}},computed:{childrenInputs(){return this.inputs.reduce(((e,t,r)=>(e[t.modelKey||r]=t,e)),{})},hasError(){return!!this.inputs.find((e=>e.hasError))||!!this.localRuleError},hasValidatedError(){return!!this.inputs.find((e=>e.hasValidatedError||e.hasError&&(e.validated||e.shouldValidate)))||this.localRuleError&&(this.validated||this.shouldValidate)},childrenWithValidatedErrors(){return Object.keys(this.childrenInputs).filter((e=>!!this.childrenInputs[e].hasValidatedError))},localRuleError(){if(!this.validated||!this.rules||!this.rules.length)return!1;const e=this.rules.find((e=>"string"===typeof e(this.value)));return e&&e(this.value)}},watch:{childrenWithValidatedErrors(){this.$nextTick((()=>{(0,s.deepEqual)(this.childrenWithValidatedErrors,this.dedupChildrenWithValidatedErrors)||(this.dedupChildrenWithValidatedErrors=this.childrenWithValidatedErrors)}))}},created(){this.separateValidation||this.form&&this.form.register(this)},beforeDestroy(){this.separateValidation||this.form&&this.form.unregister(this)},methods:{register(e){this.validated&&e.validate(!0),this.inputs.push(e)},unregister(e){this.inputs=this.inputs.filter((t=>t._uid!==e._uid))},validate(e){this.validated=!0;const t=this.inputs.map(((t,r)=>({valid:t.validate(e),key:t.modelKey||r})));return!t.find((e=>!e.valid))},reset(){this.inputs.forEach((e=>e.reset()))},resetValidation(){this.shouldValidate=!1,this.validated=!1,this.inputs.forEach((e=>e.resetValidation()))},initValidation(){const e=this.fullOptions.initialValidation;"all"!==e||this.modelRoot||this.validate(!0),"defined"===e&&this.initiallyDefined&&!this.isObjectContainer&&this.validate(!0)},fastForwardEvent(e,t){"root"===this.fullKey?this.$emit(e,t):this.form.fastForwardEvent(e,t)},getExprNode(){const e={value:this.value,key:this.modelKey,fullKey:this.fullKey,schema:this.schema};return this.form&&this.form.getExprNode&&(e.parent=this.form.getExprNode()),e}}};function ne(e){const t=[];for(let r=0;r1)o=u.pop(),s=u.pop(),l=r[d.value],d=new be(oe,l(s.value,o.value)),u.push(d);else if(f===ue&&u.length>2)a=u.pop(),o=u.pop(),s=u.pop(),"?"===d.value?u.push(s.value?o.value:a.value):(l=i[d.value],d=new be(oe,l(s.value,o.value,a.value)),u.push(d));else if(f===ae&&u.length>0)s=u.pop(),l=t[d.value],d=new be(oe,l(s.value)),u.push(d);else if(f===pe){while(u.length>0)c.push(u.shift());c.push(new be(pe,xe(d.value,t,r,i,n)))}else if(f===ge&&u.length>0)s=u.pop(),u.push(new be(oe,s.value[d.value]));else{while(u.length>0)c.push(u.shift());c.push(d)}}while(u.length>0)c.push(u.shift());return c}function Se(e,t,r){for(var i=[],n=0;n0)a.unshift(Ce(u.pop(),r));if(o=u.pop(),!o.apply||!o.call)throw new Error(o+" is not a function");u.push(o.apply(void 0,a))}else if(f===fe)u.push(function(){var e=u.pop(),i=[],n=d.value;while(n-- >0)i.unshift(u.pop());var s=u.pop(),o=function(){for(var n=Object.assign({},r),s=0,o=i.length;s0)a.unshift(u.pop());u.push(a)}}if(u.length>1)throw new Error("invalid Expression (parity)");return 0===u[0]?0:Ce(u[0],r)}function Ee(e,t,r){return Ae(e)?e:{type:me,value:function(r){return Me(e.value,t,r)}}}function Ae(e){return e&&e.type===me}function Ce(e,t){return Ae(e)?e.value(t):e}function $e(e,t){for(var r,i,n,s,o,a,l=[],u=0;u0)o.unshift(l.pop());s=l.pop(),l.push(s+"("+o.join(", ")+")")}else if(h===fe){i=l.pop(),a=c.value,o=[];while(a-- >0)o.unshift(l.pop());r=l.pop(),t?l.push("("+r+" = function("+o.join(", ")+") { return "+i+" })"):l.push("("+r+"("+o.join(", ")+") = "+i+")")}else if(h===ge)r=l.pop(),l.push(r+"."+c.value);else if(h===ye){a=c.value,o=[];while(a-- >0)o.unshift(l.pop());l.push("["+o.join(", ")+"]")}else if(h===pe)l.push("("+$e(c.value,t)+")");else if(h!==ve)throw new Error("invalid Expression")}return l.length>1&&(l=t?[l.join(",")]:[l.join(";")]),String(l[0])}function Oe(e){return"string"===typeof e?JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029"):e}function Pe(e,t){for(var r=0;r=this.expression.length?this.newToken(De,"EOF"):this.isWhitespace()||this.isComment()?this.next():this.isRadixInteger()||this.isNumber()||this.isOperator()||this.isString()||this.isParen()||this.isBracket()||this.isComma()||this.isSemicolon()||this.isNamedOp()||this.isConst()||this.isName()?this.current:void this.parseError('Unknown character "'+this.expression.charAt(this.pos)+'"')},Ue.prototype.isString=function(){var e=!1,t=this.pos,r=this.expression.charAt(t);if("'"===r||'"'===r){var i=this.expression.indexOf(r,t+1);while(i>=0&&this.pos"9")))break}if(t>e){var i=this.expression.substring(e,t);if(i in this.consts)return this.current=this.newToken(Re,this.consts[i]),this.pos+=i.length,!0}return!1},Ue.prototype.isNamedOp=function(){for(var e=this.pos,t=e;t"9")))break}if(t>e){var i=this.expression.substring(e,t);if(this.isOperatorEnabled(i)&&(i in this.binaryOps||i in this.unaryOps||i in this.ternaryOps))return this.current=this.newToken(Le,i),this.pos+=i.length,!0}return!1},Ue.prototype.isName=function(){for(var e=this.pos,t=e,r=!1;t"9"))break}else r=!0}if(r){var n=this.expression.substring(e,t);return this.current=this.newToken(ze,n),this.pos+=n.length,!0}return!1},Ue.prototype.isWhitespace=function(){var e=!1,t=this.expression.charAt(this.pos);while(" "===t||"\t"===t||"\n"===t||"\r"===t){if(e=!0,this.pos++,this.pos>=this.expression.length)break;t=this.expression.charAt(this.pos)}return e};var He=/^[0-9a-f]{4}$/i;function We(e,t,r){this.parser=e,this.tokens=t,this.current=null,this.nextToken=null,this.next(),this.savedCurrent=null,this.savedNextToken=null,this.allowMemberAccess=!1!==r.allowMemberAccess}Ue.prototype.unescape=function(e){var t=e.indexOf("\\");if(t<0)return e;var r=e.substring(0,t);while(t>=0){var i=e.charAt(++t);switch(i){case"'":r+="'";break;case'"':r+='"';break;case"\\":r+="\\";break;case"/":r+="/";break;case"b":r+="\b";break;case"f":r+="\f";break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"u":var n=e.substring(t+1,t+5);He.test(n)||this.parseError("Illegal escape sequence: \\u"+n),r+=String.fromCharCode(parseInt(n,16)),t+=4;break;default:throw this.parseError('Illegal escape sequence: "\\'+i+'"')}++t;var s=e.indexOf("\\",t);r+=e.substring(t,s<0?e.length:s),t=s}return r},Ue.prototype.isComment=function(){var e=this.expression.charAt(this.pos);return"/"===e&&"*"===this.expression.charAt(this.pos+1)&&(this.pos=this.expression.indexOf("*/",this.pos)+2,1===this.pos&&(this.pos=this.expression.length),!0)},Ue.prototype.isRadixInteger=function(){var e,t,r=this.pos;if(r>=this.expression.length-2||"0"!==this.expression.charAt(r))return!1;if(++r,"x"===this.expression.charAt(r))e=16,t=/^[0-9a-f]$/i,++r;else{if("b"!==this.expression.charAt(r))return!1;e=2,t=/^[01]$/i,++r}var i=!1,n=r;while(r="0"&&e<="9"||!s&&"."===e))break;"."===e?s=!0:o=!0,r++,t=o}if(t&&(n=r),"e"===e||"E"===e){r++;var a=!0,l=!1;while(r="0"&&e<="9"))break;l=!0,a=!1}else a=!1;r++}l||(r=n)}return t?(this.current=this.newToken(Re,parseFloat(this.expression.substring(i,r))),this.pos=r):this.pos=n,t},Ue.prototype.isOperator=function(){var e=this.pos,t=this.expression.charAt(this.pos);if("+"===t||"-"===t||"*"===t||"/"===t||"%"===t||"^"===t||"?"===t||":"===t||"."===t)this.current=this.newToken(Le,t);else if("∙"===t||"•"===t)this.current=this.newToken(Le,"*");else if(">"===t)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(Le,">="),this.pos++):this.current=this.newToken(Le,">");else if("<"===t)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(Le,"<="),this.pos++):this.current=this.newToken(Le,"<");else if("|"===t){if("|"!==this.expression.charAt(this.pos+1))return!1;this.current=this.newToken(Le,"||"),this.pos++}else if("="===t)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(Le,"=="),this.pos++):this.current=this.newToken(Le,t);else{if("!"!==t)return!1;"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(Le,"!="),this.pos++):this.current=this.newToken(Le,t)}return this.pos++,!!this.isOperatorEnabled(this.current.value)||(this.pos=e,!1)},Ue.prototype.isOperatorEnabled=function(e){return this.parser.isOperatorEnabled(e)},Ue.prototype.getCoordinates=function(){var e,t=0,r=-1;do{t++,e=this.pos-r,r=this.expression.indexOf("\n",r+1)}while(r>=0&&r=",">","in"];We.prototype.parseComparison=function(e){this.parseAddSub(e);while(this.accept(Le,Ke)){var t=this.current;this.parseAddSub(e),e.push(_e(t.value))}};var Ye=["+","-","||"];We.prototype.parseAddSub=function(e){this.parseTerm(e);while(this.accept(Le,Ye)){var t=this.current;this.parseTerm(e),e.push(_e(t.value))}};var Ge=["*","/","%"];function Ze(e,t){return Number(e)+Number(t)}function Je(e,t){return e-t}function Xe(e,t){return e*t}function Qe(e,t){return e/t}function et(e,t){return e%t}function tt(e,t){return Array.isArray(e)&&Array.isArray(t)?e.concat(t):""+e+t}function rt(e,t){return e===t}function it(e,t){return e!==t}function nt(e,t){return e>t}function st(e,t){return e=t}function at(e,t){return e<=t}function lt(e,t){return Boolean(e&&t)}function ut(e,t){return Boolean(e||t)}function ct(e,t){return Pe(t,e)}function ht(e){return(Math.exp(e)-Math.exp(-e))/2}function dt(e){return(Math.exp(e)+Math.exp(-e))/2}function ft(e){return e===1/0?1:e===-1/0?-1:(Math.exp(e)-Math.exp(-e))/(Math.exp(e)+Math.exp(-e))}function pt(e){return e===-1/0?e:Math.log(e+Math.sqrt(e*e+1))}function mt(e){return Math.log(e+Math.sqrt(e*e-1))}function gt(e){return Math.log((1+e)/(1-e))/2}function vt(e){return Math.log(e)*Math.LOG10E}function yt(e){return-e}function bt(e){return!e}function wt(e){return e<0?Math.ceil(e):Math.floor(e)}function _t(e){return Math.random()*(e||1)}function kt(e){return Et(e+1)}function xt(e){return isFinite(e)&&e===Math.round(e)}We.prototype.parseTerm=function(e){this.parseFactor(e);while(this.accept(Le,Ge)){var t=this.current;this.parseFactor(e),e.push(_e(t.value))}},We.prototype.parseFactor=function(e){var t=this.tokens.unaryOps;function r(e){return e.value in t}if(this.save(),this.accept(Le,r)){if("-"!==this.current.value&&"+"!==this.current.value){if(this.nextToken.type===je&&"("===this.nextToken.value)return this.restore(),void this.parseExponential(e);if(this.nextToken.type===Ve||this.nextToken.type===Fe||this.nextToken.type===De||this.nextToken.type===je&&")"===this.nextToken.value)return this.restore(),void this.parseAtom(e)}var i=this.current;this.parseFactor(e),e.push(we(i.value))}else this.parseExponential(e)},We.prototype.parseExponential=function(e){this.parsePostfixExpression(e);while(this.accept(Le,"^"))this.parseFactor(e),e.push(_e("^"))},We.prototype.parsePostfixExpression=function(e){this.parseFunctionCall(e);while(this.accept(Le,"!"))e.push(we("!"))},We.prototype.parseFunctionCall=function(e){var t=this.tokens.unaryOps;function r(e){return e.value in t}if(this.accept(Le,r)){var i=this.current;this.parseAtom(e),e.push(we(i.value))}else{this.parseMemberExpression(e);while(this.accept(je,"("))if(this.accept(je,")"))e.push(new be(de,0));else{var n=this.parseArgumentList(e);e.push(new be(de,n))}}},We.prototype.parseArgumentList=function(e){var t=0;while(!this.accept(je,")")){this.parseExpression(e),++t;while(this.accept(Fe))this.parseExpression(e),++t}return t},We.prototype.parseMemberExpression=function(e){this.parseAtom(e);while(this.accept(Le,".")||this.accept(Be,"[")){var t=this.current;if("."===t.value){if(!this.allowMemberAccess)throw new Error('unexpected ".", member access is not permitted');this.expect(ze),e.push(new be(ge,this.current.value))}else{if("["!==t.value)throw new Error("unexpected symbol: "+t.value);if(!this.tokens.isOperatorEnabled("["))throw new Error('unexpected "[]", arrays are disabled');this.parseExpression(e),this.expect(Be,"]"),e.push(_e("["))}}};var St=4.7421875,Mt=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function Et(e){var t,r;if(xt(e)){if(e<=0)return isFinite(e)?1/0:NaN;if(e>171)return 1/0;var i=e-2,n=e-1;while(i>1)n*=i,i--;return 0===n&&(n=1),n}if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*Et(1-e));if(e>=171.35)return 1/0;if(e>85){var s=e*e,o=s*e,a=o*e,l=a*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*s)-139/(51840*o)-571/(2488320*a)+163879/(209018880*l)+5246819/(75246796800*l*e))}--e,r=Mt[0];for(var u=1;u0?(i=n/t,e+=i*i):e+=n}return t===1/0?1/0:t*Math.sqrt(e)}function $t(e,t,r){return e?t:r}function Ot(e,t){return"undefined"===typeof t||0===+t?Math.round(e):(e=+e,t=-+t,isNaN(e)||"number"!==typeof t||t%1!==0?NaN:(e=e.toString().split("e"),e=Math.round(+(e[0]+"e"+(e[1]?+e[1]-t:-t))),e=e.toString().split("e"),+(e[0]+"e"+(e[1]?+e[1]+t:t))))}function Pt(e,t,r){return r&&(r[e]=t),t}function Tt(e,t){return e[0|t]}function It(e){return 1===arguments.length&&Array.isArray(e)?Math.max.apply(Math,e):Math.max.apply(Math,arguments)}function Dt(e){return 1===arguments.length&&Array.isArray(e)?Math.min.apply(Math,e):Math.min.apply(Math,arguments)}function Lt(e,t){if("function"!==typeof e)throw new Error("First argument to map is not a function");if(!Array.isArray(t))throw new Error("Second argument to map is not an array");return t.map((function(t,r){return e(t,r)}))}function Rt(e,t,r){if("function"!==typeof e)throw new Error("First argument to fold is not a function");if(!Array.isArray(r))throw new Error("Second argument to fold is not an array");return r.reduce((function(t,r,i){return e(t,r,i)}),t)}function Nt(e,t){if("function"!==typeof e)throw new Error("First argument to filter is not a function");if(!Array.isArray(t))throw new Error("Second argument to filter is not an array");return t.filter((function(t,r){return e(t,r)}))}function jt(e,t){if(!Array.isArray(t)&&"string"!==typeof t)throw new Error("Second argument to indexOf is not a string or array");return t.indexOf(e)}function Bt(e,t){if(!Array.isArray(t))throw new Error("Second argument to join is not an array");return t.join(e)}function Ft(e){return(e>0)-(e<0)||+e}var zt=1/3;function Vt(e){return e<0?-Math.pow(-e,zt):Math.pow(e,zt)}function qt(e){return Math.exp(e)-1}function Ut(e){return Math.log(1+e)}function Ht(e){return Math.log(e)/Math.LN2}function Wt(e){this.options=e||{},this.unaryOps={sin:Math.sin,cos:Math.cos,tan:Math.tan,asin:Math.asin,acos:Math.acos,atan:Math.atan,sinh:Math.sinh||ht,cosh:Math.cosh||dt,tanh:Math.tanh||ft,asinh:Math.asinh||pt,acosh:Math.acosh||mt,atanh:Math.atanh||gt,sqrt:Math.sqrt,cbrt:Math.cbrt||Vt,log:Math.log,log2:Math.log2||Ht,ln:Math.log,lg:Math.log10||vt,log10:Math.log10||vt,expm1:Math.expm1||qt,log1p:Math.log1p||Ut,abs:Math.abs,ceil:Math.ceil,floor:Math.floor,round:Math.round,trunc:Math.trunc||wt,"-":yt,"+":Number,exp:Math.exp,not:bt,length:At,"!":kt,sign:Math.sign||Ft},this.binaryOps={"+":Ze,"-":Je,"*":Xe,"/":Qe,"%":et,"^":Math.pow,"||":tt,"==":rt,"!=":it,">":nt,"<":st,">=":ot,"<=":at,and:lt,or:ut,in:ct,"=":Pt,"[":Tt},this.ternaryOps={"?":$t},this.functions={random:_t,fac:kt,min:Dt,max:It,hypot:Math.hypot||Ct,pyt:Math.hypot||Ct,pow:Math.pow,atan2:Math.atan2,if:$t,gamma:Et,roundTo:Ot,map:Lt,fold:Rt,filter:Nt,indexOf:jt,join:Bt},this.consts={E:Math.E,PI:Math.PI,true:!0,false:!1}}Wt.prototype.parse=function(e){var t=[],r=new We(this,new Ue(this,e),{allowMemberAccess:this.options.allowMemberAccess});return r.parseExpression(t),r.expect(De,"EOF"),new Ie(t,this)},Wt.prototype.evaluate=function(e,t){return this.parse(e).evaluate(t)};var Kt=new Wt;Wt.parse=function(e){return Kt.parse(e)},Wt.evaluate=function(e,t){return Kt.parse(e).evaluate(t)};var Yt={"+":"add","-":"subtract","*":"multiply","/":"divide","%":"remainder","^":"power","!":"factorial","<":"comparison",">":"comparison","<=":"comparison",">=":"comparison","==":"comparison","!=":"comparison","||":"concatenate",and:"logical",or:"logical",not:"logical","?":"conditional",":":"conditional","=":"assignment","[":"array","()=":"fndef"};function Gt(e){return Yt.hasOwnProperty(e)?Yt[e]:e}Wt.prototype.isOperatorEnabled=function(e){var t=Gt(e),r=this.options.operators||{};return!(t in r)||!!r[t]};const Zt=new Wt({add:!0,concatenate:!0,divide:!0,factorial:!0,multiply:!0,power:!0,remainer:!0,substract:!0,assignment:!0,logical:!0,comparison:!0,in:!0});Zt.functions.concatString=function(){let e="";for(let t=0;t({})},showSectionTitle:{type:Boolean,default:!1}},data(){return{loading:!1,fullSchema:null}},computed:{initialOptions(){return"root"===this.fullKey?this.options||{}:this.optionsRoot},fullOptions(){const e="undefined"!==typeof window&&window||"undefined"!==typeof r.g&&r.g||{};M.locale=this.$vuetify.lang&&this.$vuetify.lang.current||"en",M.defaultLocale=this.$vuetify.lang&&this.$vuetify.lang.defaultLocale||"en";const t=Object.assign({},M,this.options||{},this.resolvedSchema["x-options"]||{});if(t.markdown=t.markdown||e.markdownit&&(r=>r?e.markdownit(t.markdownit).render(r):"")||(e=>e||""),t.memMarkdown=t.memMarkdown||(e=>{this._vjsf_markdown=this._vjsf_markdown||{};const r=e+"";return this._vjsf_markdown[r]=this._vjsf_markdown[r]||t.markdown(e),this._vjsf_markdown[r]}),t.httpLib=t.httpLib||this.axios||this.$http||this.$axios||e.axios,!t.validator){const r=t.ajvLocalize||e.ajvLocalize,i=t.ajvAddFormats||e.ajvAddFormats,n=!!r&&t.locale&&r[t.locale];let s=t.ajv;if(!s){const r=t.Ajv||e.Ajv||e.ajv7&&e.ajv7.default||e.ajv2019&&e.ajv2019.default;r&&(s=new r(n?{allErrors:!0,messages:!1,strict:!1}:{strict:!1}),i&&i(s),s.addFormat("hexcolor",/^#[0-9A-Fa-f]{6,8}$/))}s&&(t.validator=e=>{const i=s.compile(e);return e=>{const o=i(e);if(!o)return n&&r[t.locale](i.errors),s.errorsText(i.errors,{dataVar:""})}})}if(t.iconfont=this.$vuetify.icons&&this.$vuetify.icons.iconfont||"mdi",!t.defaultIcons){const e={};for(const[t,r]of Object.entries(this.$vuetify.icons.values))e[t]=r.props?r.props.name:r;t.defaultIcons={...C[t.iconfont],...e},t.icons={...t.defaultIcons,...t.icons}}return t.messages={...E[t.defaultLocale]||E.en,...E[t.locale]||E.en,...t.messages},t.formats={...A,...t.formats},t.deleteReadOnly&&(t.hideReadOnly=!0),t},resolvedSchema(){if("root"===this.modelKey){const e=this.options||{},t=e.locale||e.defaultLocale||"en",r=e.defaultLocale||"en";return u.resolve(this.schema,{"~$locale~":t===r?t:[t,r]})}return this.schema},htmlDescription(){return this.fullOptions.markdown(this.fullSchema&&this.fullSchema.description)},fullKey(){return(this.parentKey+this.modelKey).replace("root.","")},label(){if(this.fullSchema&&(!this.fullSchema.readOnly&&!this.fullOptions.readOnlyArrayItem||!this.fullOptions.hideReadOnlyLabels))return this.fullSchema.title||("string"===typeof this.modelKey?this.modelKey:"")},display(){if(this.fullSchema)return"root"===this.modelKey&&this.fullOptions.rootDisplay?this.fullOptions.rootDisplay:this.fullSchema["x-display"]},customTag(){if(this.fullSchema)return this.fullSchema["x-tag"]},rules(){if(this.fullSchema)return $(this.schema,this.fullSchema,this.fullOptions,this.required,this.isOneOfSelect)},disabled(){if(this.fullSchema)return this.fullOptions.disableAll||this.fullSchema.readOnly},separator(){if(this.fullSchema||"string"===this.fullSchema.type)return this.fullSchema.separator||this.fullSchema["x-separator"]},slotName(){if(this.fullSchema)return this.fullSchema["x-display"]&&this.fullSchema["x-display"].startsWith("custom-")?this.fullSchema["x-display"]:this.fullKey},slotParams(){if(this.fullSchema)return{value:this.value,modelKey:this.modelKey,schema:this.schema,fullKey:this.fullKey,fullSchema:this.fullSchema,label:this.label,disabled:this.disabled,required:this.required,rules:this.rules,options:this.fullOptions,htmlDescription:this.htmlDescription,on:{input:e=>this.input(e instanceof Event?e.target.value:e),change:()=>this.change()}}},dashKey(){return this.fullKey.replace(/\./g,"-")},commonFieldProps(){if(!this.fullSchema)return;const e=this.separator&&"string"===typeof this.value?this.value.split(this.separator):this.value;return{value:e,inputValue:e,label:this.label,name:this.fullKey,id:this.fullOptions.idPrefix+this.dashKey,disabled:this.disabled,rules:this.rules,required:this.required,autofocus:this.fullOptions.autofocus,...this.fullSchema.readOnly||this.fullOptions.readOnlyArrayItem?this.fullOptions.readOnlyFieldProps:{},...this.fullOptions.fieldProps,...this.fullSchema["x-props"]}},propertyClass(){if(this.fullSchema)return`vjsf-property vjsf-property-${this.dashKey} pa-0 ${this.fullSchema["x-class"]||""} ${this.fullSchema.readOnly||this.fullOptions.readOnlyArrayItem?"read-only":""}`.replace(/ {2}/g," ").trim()},xSlots(){if(this.fullSchema)return{...this.fullSchema["x-slots"]}},formattedValue(){if(this.fullSchema)return this.value&&this.fullSchema.format&&this.fullOptions.formats[this.fullSchema.format]&&this.fullOptions.formats[this.fullSchema.format](this.value,this.fullOptions.locale)},directives(){if(this.fullSchema)return this.fullSchema["x-directives"]}},watch:{fullSchema:{handler(){this.fullSchema&&(this.initFromSchema(),this.initValidation(),this.updateSelectItems())}}},mounted(){tr[this.fullKey]=(tr[this.fullKey]||0)+1;let e="resolvedSchema";(this.resolvedSchema.dependencies||this.resolvedSchema.if)&&(e=e=>[e.resolvedSchema,e.value]),this.$watch(e,(()=>{const e=h.prepareFullSchema(this.resolvedSchema,this.value,this.fullOptions);(0,s.deepEqual)(e,this.fullSchema)||(this.fullSchema=e)}),{immediate:!0,deep:!0})},render(e){if(this.renderInc=(this.renderInc||0)+1,!this.fullSchema)return;if(void 0!==this.fullSchema.const)return;if("hidden"===this.display)return;if(this.fullSchema.readOnly&&this.fullOptions.hideReadOnly)return;if(this.fullOptions.readOnlyArrayItem&&this.fullOptions.hideInArrayItem)return;if((this.fullSchema.readOnly||this.fullOptions.readOnlyArrayItem)&&this.fullOptions.hideReadOnlyEmpty&&[null,void 0,""].includes(this.value))return;if(this.fullSchema["x-if"]&&!this.getFromExpr(this.fullSchema["x-if"]))return;const t=[];if(this.$scopedSlots.before?t.push(this.$scopedSlots.before(this.slotParams)):this.$slots.before?this.$slots.before.forEach((e=>t.push(e))):this.xSlots.before&&t.push(e("div",{domProps:{innerHTML:this.fullOptions.memMarkdown(this.xSlots.before)}})),this.$scopedSlots.default)t.push(this.$scopedSlots.default(this.slotParams));else if(this.fullSchema["x-display"]&&this.fullSchema["x-display"]&&this.$scopedSlots[this.fullSchema["x-display"]])t.push(this.$scopedSlots[this.fullSchema["x-display"]](this.slotParams));else{const r=this.renderDateProp(e)||this.renderColorProp(e)||this.renderSelectProp(e)||this.renderFileProp(e)||this.renderMarkdownProp(e)||this.renderSimpleProp(e)||this.renderObjectContainer(e)||this.renderEditableArray(e)||[];r.forEach((e=>t.push(e)))}this.$scopedSlots.after?t.push(this.$scopedSlots.after(this.slotParams)):this.$slots.after?this.$slots.after.forEach((e=>t.push(e))):this.xSlots.after&&t.push(e("div",{domProps:{innerHTML:this.fullOptions.memMarkdown(this.xSlots.after)}}));let r={...this.fullOptions.fieldColProps};return this.fullSchema["x-cols"]&&("object"===typeof this.fullSchema["x-cols"]?r={...r,...this.fullSchema["x-cols"]}:r.cols=this.fullSchema["x-cols"]),e("v-col",{props:r,class:this.propertyClass,style:this.fullSchema["x-style"]||""},t)},methods:{cached(e,t,r){return this._vjsf_cache=this._vjsf_cache||{},this._vjsf_cache[e]&&(0,s.deepEqual)(this._vjsf_cache[e].params,t)||(this._vjsf_cache[e]={params:n()(t),value:r()}),this._vjsf_cache[e].value},getFromExpr(e,t=!1){const r=this.getExprNode();if(r.modelRoot=this.modelRoot,r.root=this.modelRoot,r.model=this.value,r.context=this.options.context,t&&(r.data=r.parent&&r.parent.value),this._vjsf_getters=this._vjsf_getters||{},"newFunction"===this.initialOptions.evalMethod){er(`evaluate expression "${e}" with newFunction method`,r),this._vjsf_getters[e]=this._vjsf_getters[e]||new Function(...Object.keys(r),`return ${e}`);const t=this._vjsf_getters[e](...Object.values(r));return er("result",t),t}if("evalExpr"===this.fullOptions.evalMethod){er(`evaluate expression "${e}" with exprEval method`,r);const t=Jt.evaluate(e,r);return er(t),t}{e=this.prefixExpr(e),er(`evaluate expression "${e}" with propertyExpr method`,r),this._vjsf_getters[e]=this._vjsf_getters[e]||a().getter(e,!0);const t=this._vjsf_getters[e](r);return er("result",t),t}},prefixExpr(e){return e.startsWith("context.")||e.startsWith("model.")||e.startsWith("value.")||e.startsWith("modelRoot.")||e.startsWith("root.")||e.startsWith("parent.")?e:this.modelRoot?"root."+e:"model."+e},renderPropSlots(e){const t=[];return Object.keys(this.xSlots).forEach((r=>{t.push(e("div",{slot:r,domProps:{innerHTML:this.fullOptions.memMarkdown(this.xSlots[r])}}))})),Object.keys(this.$slots).forEach((r=>{t.push(e("template",{slot:r},this.$slots[r]))})),t},async change(e=!0){if(this.changed){await this.$nextTick(),this.sharedData.asyncOperations=this.sharedData.asyncOperations||{};while(Object.keys(this.sharedData.asyncOperations).length){for(const e in this.sharedData.asyncOperations)await this.sharedData.asyncOperations[e];await this.$nextTick()}this.updateSelectItems(),e&&this.fastForwardEvent("change-child",{fullKey:this.fullKey,value:this.value}),this.$emit("change",this.value),this.changed=!1}},input(e,t=!1,r=!0){Array.isArray(e)&&this.separator&&(e=e.join(this.separator)),null===e||void 0===e?this.fullSchema.nullable?null!==this.value?(this.changed=!0,r&&this.fastForwardEvent("input-child",{fullKey:this.fullKey,value:null,oldValue:this.value}),this.$emit("input",null)):t&&(r&&this.fastForwardEvent("input-child",{fullKey:this.fullKey,value:null,oldValue:this.value}),this.$emit("input",null)):void 0!==this.value&&(this.changed=!0,r&&this.fastForwardEvent("input-child",{fullKey:this.fullKey,value:void 0,oldValue:this.value}),this.$emit("input",void 0)):(0,s.deepEqual)(e,this.value)||(this.changed=!0,r&&this.fastForwardEvent("input-child",{fullKey:this.fullKey,value:e,oldValue:this.value}),this.$emit("input",e))},fixValueType(e,t){return[null,void 0].includes(e)?e:"string"===t.type&&"string"!==typeof e||"integer"===t.type&&"number"!==typeof e||"number"===t.type&&"number"!==typeof e||"boolean"===t.type&&"boolean"!==typeof e||"array"===t.type&&!Array.isArray(e)||"object"===t.type&&("object"!==typeof e||Array.isArray(e))?void 0:e},defaultValue(e){if(!e.readOnly||!this.fullOptions.deleteReadOnly)return"object"!==e.type||e["x-fromUrl"]||e["x-fromData"]||e.enum?"array"===e.type?[]:null:{}},fixProperties(e){if("object"!==this.fullSchema.type||!e)return e;const t=(!this.fullSchema.properties||!this.fullSchema.properties.length)&&(!Object.keys(this.subModels).length||!!this.fullSchema["x-fromData"]||!!this.fullSchema["x-fromUrl"]);return t||(e={...e},(this.fullOptions.removeAdditionalProperties||!1===this.fullSchema.additionalProperties)&&Object.keys(e).forEach((t=>{(this.fullSchema.properties||[]).find((e=>e.key===t))||delete e[t]})),Object.keys(this.subModels).forEach((t=>{Object.keys(this.subModels[t]).forEach((r=>{const i=this.fullSchema.properties.find((e=>e.key===r));i&&i.const||e[r]!==this.subModels[t][r]&&(e[r]=this.subModels[t][r])}))}))),e},initFromSchema(){if(this.initiallyDefined=void 0!==this.value&&null!==this.value,"array"===this.fullSchema.type&&(this.initiallyDefined=!(!this.value||!this.value.length)),"object"===this.fullSchema.type&&(this.initiallyDefined=!(!this.value||!Object.keys(this.value).length)),this.fullSchema.readOnly&&this.fullOptions.deleteReadOnly)return this.input(void 0);let e=this.value;if("object"===this.fullSchema.type&&[void 0,null].includes(e)&&!this.isSelectProp&&(e={}),"object"===this.fullSchema.type&&this.isSelectProp&&e&&0===Object.keys(e).length&&(e=void 0),void 0!==this.fullSchema.const&&(e=this.fullSchema.const),this.initSelectProp(e),this.initObjectContainer(e),this.value&&"array"===this.fullSchema.type&&(e=this.value.filter((e=>![void 0,null].includes(e)))),!this.fullSchema["x-constExpr"])return this.input(this.fixProperties(e),!0);this.$watch((()=>this.getFromExpr(this.fullSchema["x-constExpr"],!0)),(e=>{this.input(e,!0)}),{immediate:!0})}}},ir=r(94598),nr=r(69964),sr=r(93469),or=(r(37550),r(81925)),ar=r(18142),lr=r(18041),ur=r(4152);const cr={...or.v,offsetY:!0,offsetOverflow:!0,transition:!1};var hr=or.A.extend({name:"v-autocomplete",props:{autoSelectFirst:{type:Boolean,default:!1},filter:{type:Function,default:(e,t,r)=>r.toLocaleLowerCase().indexOf(t.toLocaleLowerCase())>-1},hideNoData:Boolean,menuProps:{type:or.A.options.props.menuProps.type,default:()=>cr},noFilter:Boolean,searchInput:{type:String}},data(){return{lazySearch:this.searchInput}},computed:{classes(){return{...or.A.options.computed.classes.call(this),"v-autocomplete":!0,"v-autocomplete--is-selecting-index":this.selectedIndex>-1}},computedItems(){return this.filteredItems},selectedValues(){return this.selectedItems.map((e=>this.getValue(e)))},hasDisplayedItems(){return this.hideSelected?this.filteredItems.some((e=>!this.hasItem(e))):this.filteredItems.length>0},currentRange(){return null==this.selectedItem?0:String(this.getText(this.selectedItem)).length},filteredItems(){return!this.isSearching||this.noFilter||null==this.internalSearch?this.allItems:this.allItems.filter((e=>{const t=(0,ur.TD)(e,this.itemText),r=null!=t?String(t):"";return this.filter(e,String(this.internalSearch),r)}))},internalSearch:{get(){return this.lazySearch},set(e){this.lazySearch!==e&&(this.lazySearch=e,this.$emit("update:search-input",e))}},isAnyValueAllowed(){return!1},isDirty(){return this.searchIsDirty||this.selectedItems.length>0},isSearching(){return this.multiple&&this.searchIsDirty||this.searchIsDirty&&this.internalSearch!==this.getText(this.selectedItem)},menuCanShow(){return!!this.isFocused&&(this.hasDisplayedItems||!this.hideNoData)},$_menuProps(){const e=or.A.options.computed.$_menuProps.call(this);return e.contentClass=`v-autocomplete__content ${e.contentClass||""}`.trim(),{...cr,...e}},searchIsDirty(){return null!=this.internalSearch&&""!==this.internalSearch},selectedItem(){return this.multiple?null:this.selectedItems.find((e=>this.valueComparator(this.getValue(e),this.getValue(this.internalValue))))},listData(){const e=or.A.options.computed.listData.call(this);return e.props={...e.props,items:this.virtualizedItems,noFilter:this.noFilter||!this.isSearching||!this.filteredItems.length,searchInput:this.internalSearch},e}},watch:{filteredItems:"onFilteredItemsChanged",internalValue:"setSearch",isFocused(e){e?(document.addEventListener("copy",this.onCopy),this.$refs.input&&this.$refs.input.select()):(document.removeEventListener("copy",this.onCopy),this.blur(),this.updateSelf())},isMenuActive(e){!e&&this.hasSlot&&(this.lazySearch=null)},items(e,t){t&&t.length||!this.hideNoData||!this.isFocused||this.isMenuActive||!e.length||this.activateMenu()},searchInput(e){this.lazySearch=e},internalSearch:"onInternalSearchChanged",itemText:"updateSelf"},created(){this.setSearch()},destroyed(){document.removeEventListener("copy",this.onCopy)},methods:{onFilteredItemsChanged(e,t){if(e!==t){if(!this.autoSelectFirst){const r=t[this.$refs.menu.listIndex];r?this.setMenuIndex(e.findIndex((e=>e===r))):this.setMenuIndex(-1),this.$emit("update:list-index",this.$refs.menu.listIndex)}this.$nextTick((()=>{this.internalSearch&&(1===e.length||this.autoSelectFirst)&&(this.$refs.menu.getTiles(),this.autoSelectFirst&&e.length&&(this.setMenuIndex(0),this.$emit("update:list-index",this.$refs.menu.listIndex)))}))}},onInternalSearchChanged(){this.updateMenuDimensions()},updateMenuDimensions(){this.isMenuActive&&this.$refs.menu&&this.$refs.menu.updateDimensions()},changeSelectedIndex(e){this.searchIsDirty||(this.multiple&&e===ur.uP.left?-1===this.selectedIndex?this.selectedIndex=this.selectedItems.length-1:this.selectedIndex--:this.multiple&&e===ur.uP.right?this.selectedIndex>=this.selectedItems.length-1?this.selectedIndex=-1:this.selectedIndex++:e!==ur.uP.backspace&&e!==ur.uP.delete||this.deleteCurrentItem())},deleteCurrentItem(){const e=this.selectedIndex,t=this.selectedItems[e];if(!this.isInteractive||this.getDisabled(t))return;const r=this.selectedItems.length-1;if(-1===this.selectedIndex&&0!==r)return void(this.selectedIndex=r);const i=this.selectedItems.length,n=e!==i-1?e:e-1,s=this.selectedItems[n];s?this.selectItem(t):this.setValue(this.multiple?[]:null),this.selectedIndex=n},clearableCallback(){this.internalSearch=null,or.A.options.methods.clearableCallback.call(this)},genInput(){const e=ar.A.options.methods.genInput.call(this);return e.data=(0,lr.Ay)(e.data,{attrs:{"aria-activedescendant":(0,ur.no)(this.$refs.menu,"activeTile.id"),autocomplete:(0,ur.no)(e.data,"attrs.autocomplete","off")},domProps:{value:this.internalSearch}}),e},genInputSlot(){const e=or.A.options.methods.genInputSlot.call(this);return e.data.attrs.role="combobox",e},genSelections(){return this.hasSlot||this.multiple?or.A.options.methods.genSelections.call(this):[]},onClick(e){this.isInteractive&&(this.selectedIndex>-1?this.selectedIndex=-1:this.onFocus(),this.isAppendInner(e.target)||this.activateMenu())},onInput(e){if(this.selectedIndex>-1||!e.target)return;const t=e.target,r=t.value;t.value&&this.activateMenu(),this.multiple||""!==r||this.deleteCurrentItem(),this.internalSearch=r,this.badInput=t.validity&&t.validity.badInput},onKeyDown(e){const t=e.keyCode;!e.ctrlKey&&[ur.uP.home,ur.uP.end].includes(t)||or.A.options.methods.onKeyDown.call(this,e),this.changeSelectedIndex(t)},onSpaceDown(e){},onTabDown(e){or.A.options.methods.onTabDown.call(this,e),this.updateSelf()},onUpDown(e){e.preventDefault(),this.activateMenu()},selectItem(e){or.A.options.methods.selectItem.call(this,e),this.setSearch()},setSelectedItems(){or.A.options.methods.setSelectedItems.call(this),this.isFocused||this.setSearch()},setSearch(){this.$nextTick((()=>{this.multiple&&this.internalSearch&&this.isMenuActive||(this.internalSearch=!this.selectedItems.length||this.multiple||this.hasSlot?null:this.getText(this.selectedItem))}))},updateSelf(){(this.searchIsDirty||this.internalValue)&&(this.multiple||this.valueComparator(this.internalSearch,this.getValue(this.internalValue))||this.setSearch())},hasItem(e){return this.selectedValues.indexOf(this.getValue(e))>-1},onCopy(e){var t,r;if(-1===this.selectedIndex)return;const i=this.selectedItems[this.selectedIndex],n=this.getText(i);null===(t=e.clipboardData)||void 0===t||t.setData("text/plain",n),null===(r=e.clipboardData)||void 0===r||r.setData("text/vnd.vuetify.autocomplete.item+plain",n),e.preventDefault()}}}),dr=r(88787),fr=r(3698),pr=r(52938),mr=r(90569),gr=r(27908),vr=r(70132),yr=r(85471),br=yr.Ay.extend({name:"rippleable",directives:{ripple:vr.A},props:{ripple:{type:[Boolean,Object],default:!0}},methods:{genRipple(e={}){return this.ripple?(e.staticClass="v-input--selection-controls__ripple",e.directives=e.directives||[],e.directives.push({name:"ripple",value:{center:!0}}),this.$createElement("div",e)):null}}}),wr=r(98968),_r=r(95803);function kr(e){e.preventDefault()}var xr=(0,_r.A)(gr.A,br,wr.A).extend({name:"selectable",model:{prop:"inputValue",event:"change"},props:{id:String,inputValue:null,falseValue:null,trueValue:null,multiple:{type:Boolean,default:null},label:String},data(){return{hasColor:this.inputValue,lazyValue:this.inputValue}},computed:{computedColor(){if(this.isActive)return this.color?this.color:this.isDark&&!this.appIsDark?"white":"primary"},isMultiple(){return!0===this.multiple||null===this.multiple&&Array.isArray(this.internalValue)},isActive(){const e=this.value,t=this.internalValue;return this.isMultiple?!!Array.isArray(t)&&t.some((t=>this.valueComparator(t,e))):void 0===this.trueValue||void 0===this.falseValue?e?this.valueComparator(e,t):Boolean(t):this.valueComparator(t,this.trueValue)},isDirty(){return this.isActive},rippleState(){return this.isDisabled||this.validationState?this.validationState:void 0}},watch:{inputValue(e){this.lazyValue=e,this.hasColor=e}},methods:{genLabel(){const e=gr.A.options.methods.genLabel.call(this);return e?(e.data.on={click:kr},e):e},genInput(e,t){return this.$createElement("input",{attrs:Object.assign({"aria-checked":this.isActive.toString(),disabled:this.isDisabled,id:this.computedId,role:e,type:e},t),domProps:{value:this.value,checked:this.isActive},on:{blur:this.onBlur,change:this.onChange,focus:this.onFocus,keydown:this.onKeydown,click:kr},ref:"input"})},onClick(e){this.onChange(),this.$emit("click",e)},onChange(){if(!this.isInteractive)return;const e=this.value;let t=this.internalValue;if(this.isMultiple){Array.isArray(t)||(t=[]);const r=t.length;t=t.filter((t=>!this.valueComparator(t,e))),t.length===r&&t.push(e)}else t=void 0!==this.trueValue&&void 0!==this.falseValue?this.valueComparator(t,this.trueValue)?this.falseValue:this.trueValue:e?this.valueComparator(t,e)?null:e:!t;this.validate(!0,t),this.internalValue=t,this.hasColor=t},onFocus(e){this.isFocused=!0,this.$emit("focus",e)},onBlur(e){this.isFocused=!1,this.$emit("blur",e)},onKeydown(e){}}}),Sr=xr.extend({name:"v-checkbox",props:{indeterminate:Boolean,indeterminateIcon:{type:String,default:"$checkboxIndeterminate"},offIcon:{type:String,default:"$checkboxOff"},onIcon:{type:String,default:"$checkboxOn"}},data(){return{inputIndeterminate:this.indeterminate}},computed:{classes(){return{...gr.A.options.computed.classes.call(this),"v-input--selection-controls":!0,"v-input--checkbox":!0,"v-input--indeterminate":this.inputIndeterminate}},computedIcon(){return this.inputIndeterminate?this.indeterminateIcon:this.isActive?this.onIcon:this.offIcon},validationState(){if(!this.isDisabled||this.inputIndeterminate)return this.hasError&&this.shouldValidate?"error":this.hasSuccess?"success":null!==this.hasColor?this.computedColor:void 0}},watch:{indeterminate(e){this.$nextTick((()=>this.inputIndeterminate=e))},inputIndeterminate(e){this.$emit("update:indeterminate",e)},isActive(){this.indeterminate&&(this.inputIndeterminate=!1)}},methods:{genCheckbox(){const{title:e,...t}=this.attrs$;return this.$createElement("div",{staticClass:"v-input--selection-controls__input"},[this.$createElement(mr.A,this.setTextColor(this.validationState,{props:{dense:this.dense,dark:this.dark,light:this.light}}),this.computedIcon),this.genInput("checkbox",{...t,"aria-checked":this.inputIndeterminate?"mixed":this.isActive.toString()}),this.genRipple(this.setTextColor(this.rippleState))])},genDefaultSlot(){return[this.genCheckbox(),this.genLabel()]}}}),Mr=r(75988),Er=r(98790),Ar=r(45961),Cr=r(73074),$r=r(86988),Or=(0,_r.A)(gr.A,Cr.A).extend({name:"v-slider",directives:{ClickOutside:ir.A},mixins:[Cr.A],props:{disabled:Boolean,inverseLabel:Boolean,max:{type:[Number,String],default:100},min:{type:[Number,String],default:0},step:{type:[Number,String],default:1},thumbColor:String,thumbLabel:{type:[Boolean,String],default:void 0,validator:e=>"boolean"===typeof e||"always"===e},thumbSize:{type:[Number,String],default:32},tickLabels:{type:Array,default:()=>[]},ticks:{type:[Boolean,String],default:!1,validator:e=>"boolean"===typeof e||"always"===e},tickSize:{type:[Number,String],default:2},trackColor:String,trackFillColor:String,value:[Number,String],vertical:Boolean},data:()=>({app:null,oldValue:null,thumbPressed:!1,mouseTimeout:-1,isFocused:!1,isActive:!1,noClick:!1,startOffset:0}),computed:{classes(){return{...gr.A.options.computed.classes.call(this),"v-input__slider":!0,"v-input__slider--vertical":this.vertical,"v-input__slider--inverse-label":this.inverseLabel}},internalValue:{get(){return this.lazyValue},set(e){e=isNaN(e)?this.minValue:e;const t=this.roundValue(Math.min(Math.max(e,this.minValue),this.maxValue));t!==this.lazyValue&&(this.lazyValue=t,this.$emit("input",t))}},trackTransition(){return this.thumbPressed?this.showTicks||this.stepNumeric?"0.1s cubic-bezier(0.25, 0.8, 0.5, 1)":"none":""},minValue(){return parseFloat(this.min)},maxValue(){return parseFloat(this.max)},stepNumeric(){return this.step>0?parseFloat(this.step):0},inputWidth(){const e=(this.roundValue(this.internalValue)-this.minValue)/(this.maxValue-this.minValue)*100;return isNaN(e)?0:e},trackFillStyles(){const e=this.vertical?"bottom":"left",t=this.vertical?"top":"right",r=this.vertical?"height":"width",i=this.$vuetify.rtl?"auto":"0",n=this.$vuetify.rtl?"0":"auto",s=this.isDisabled?`calc(${this.inputWidth}% - 10px)`:`${this.inputWidth}%`;return{transition:this.trackTransition,[e]:i,[t]:n,[r]:s}},trackStyles(){const e=this.vertical?this.$vuetify.rtl?"bottom":"top":this.$vuetify.rtl?"left":"right",t=this.vertical?"height":"width",r="0px",i=this.isDisabled?`calc(${100-this.inputWidth}% - 10px)`:`calc(${100-this.inputWidth}%)`;return{transition:this.trackTransition,[e]:r,[t]:i}},showTicks(){return this.tickLabels.length>0||!(this.isDisabled||!this.stepNumeric||!this.ticks)},numTicks(){return Math.ceil((this.maxValue-this.minValue)/this.stepNumeric)},showThumbLabel(){return!this.isDisabled&&!(!this.thumbLabel&&!this.$scopedSlots["thumb-label"])},computedTrackColor(){if(!this.isDisabled)return this.trackColor?this.trackColor:this.isDark?this.validationState:this.validationState||"primary lighten-3"},computedTrackFillColor(){if(!this.isDisabled)return this.trackFillColor?this.trackFillColor:this.validationState||this.computedColor},computedThumbColor(){return this.thumbColor?this.thumbColor:this.validationState||this.computedColor}},watch:{min(e){const t=parseFloat(e);t>this.internalValue&&this.$emit("input",t)},max(e){const t=parseFloat(e);t{const n=[];this.tickLabels[t]&&n.push(this.$createElement("div",{staticClass:"v-slider__tick-label"},this.tickLabels[t]));const s=t*(100/this.numTicks),o=this.$vuetify.rtl?100-this.inputWidth0}},n)},genThumbContainer(e,t,r,i,n,s,o="thumb"){const a=[this.genThumb()],l=this.genThumbLabelContent(e);return this.showThumbLabel&&a.push(this.genThumbLabel(l)),this.$createElement("div",this.setTextColor(this.computedThumbColor,{ref:o,key:o,staticClass:"v-slider__thumb-container",class:{"v-slider__thumb-container--active":r,"v-slider__thumb-container--focused":i,"v-slider__thumb-container--show-label":this.showThumbLabel},style:this.getThumbContainerStyles(t),attrs:{role:"slider",tabindex:this.isDisabled?-1:this.$attrs.tabindex?this.$attrs.tabindex:0,"aria-label":this.$attrs["aria-label"]||this.label,"aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":this.internalValue,"aria-readonly":String(this.isReadonly),"aria-orientation":this.vertical?"vertical":"horizontal"},on:{focus:n,blur:s,keydown:this.onKeyDown}}),a)},genThumbLabelContent(e){return this.$scopedSlots["thumb-label"]?this.$scopedSlots["thumb-label"]({value:e}):[this.$createElement("span",[String(e)])]},genThumbLabel(e){const t=(0,ur.Dg)(this.thumbSize),r=this.vertical?`translateY(20%) translateY(${Number(this.thumbSize)/3-1}px) translateX(55%) rotate(135deg)`:"translateY(-20%) translateY(-12px) translateX(-50%) rotate(45deg)";return this.$createElement(Ar.yX,{props:{origin:"bottom center"}},[this.$createElement("div",{staticClass:"v-slider__thumb-label-container",directives:[{name:"show",value:this.isFocused||this.isActive||"always"===this.thumbLabel}]},[this.$createElement("div",this.setBackgroundColor(this.computedThumbColor,{staticClass:"v-slider__thumb-label",style:{height:t,width:t,transform:r}}),[this.$createElement("div",e)])])])},genThumb(){return this.$createElement("div",this.setBackgroundColor(this.computedThumbColor,{staticClass:"v-slider__thumb"}))},getThumbContainerStyles(e){const t=this.vertical?"top":"left";let r=this.$vuetify.rtl?100-e:e;return r=this.vertical?100-r:r,{transition:this.trackTransition,[t]:`${r}%`}},onSliderMouseDown(e){var t;if(e.preventDefault(),this.oldValue=this.internalValue,this.isActive=!0,null===(t=e.target)||void 0===t?void 0:t.matches(".v-slider__thumb-container, .v-slider__thumb-container *")){this.thumbPressed=!0;const t=e.target.getBoundingClientRect(),r="touches"in e?e.touches[0]:e;this.startOffset=this.vertical?r.clientY-(t.top+t.height/2):r.clientX-(t.left+t.width/2)}else this.startOffset=0,window.clearTimeout(this.mouseTimeout),this.mouseTimeout=window.setTimeout((()=>{this.thumbPressed=!0}),300);const r=!ur.AR||{passive:!0,capture:!0},i=!!ur.AR&&{passive:!0},n="touches"in e;this.onMouseMove(e),this.app.addEventListener(n?"touchmove":"mousemove",this.onMouseMove,i),(0,ur.d7)(this.app,n?"touchend":"mouseup",this.onSliderMouseUp,r),this.$emit("start",this.internalValue)},onSliderMouseUp(e){e.stopPropagation(),window.clearTimeout(this.mouseTimeout),this.thumbPressed=!1;const t=!!ur.AR&&{passive:!0};this.app.removeEventListener("touchmove",this.onMouseMove,t),this.app.removeEventListener("mousemove",this.onMouseMove,t),this.$emit("mouseup",e),this.$emit("end",this.internalValue),(0,ur.bD)(this.oldValue,this.internalValue)||(this.$emit("change",this.internalValue),this.noClick=!0),this.isActive=!1},onMouseMove(e){"mousemove"===e.type&&(this.thumbPressed=!0),this.internalValue=this.parseMouseMove(e)},onKeyDown(e){if(!this.isInteractive)return;const t=this.parseKeyDown(e,this.internalValue);null==t||tthis.maxValue||(this.internalValue=t,this.$emit("change",t))},onSliderClick(e){if(this.noClick)return void(this.noClick=!1);const t=this.$refs.thumb;t.focus(),this.onMouseMove(e),this.$emit("change",this.internalValue)},onBlur(e){this.isFocused=!1,this.$emit("blur",e)},onFocus(e){this.isFocused=!0,this.$emit("focus",e)},parseMouseMove(e){const t=this.vertical?"top":"left",r=this.vertical?"height":"width",i=this.vertical?"clientY":"clientX",{[t]:n,[r]:s}=this.$refs.track.getBoundingClientRect(),o="touches"in e?e.touches[0][i]:e[i];let a=Math.min(Math.max((o-n-this.startOffset)/s,0),1)||0;return this.vertical&&(a=1-a),this.$vuetify.rtl&&(a=1-a),parseFloat(this.min)+a*(this.maxValue-this.minValue)},parseKeyDown(e,t){if(!this.isInteractive)return;const{pageup:r,pagedown:i,end:n,home:s,left:o,right:a,down:l,up:u}=ur.uP;if(![r,i,n,s,o,a,l,u].includes(e.keyCode))return;e.preventDefault();const c=this.stepNumeric||1,h=(this.maxValue-this.minValue)/c;if([o,a,l,u].includes(e.keyCode)){const r=this.$vuetify.rtl?[o,u]:[a,u],i=r.includes(e.keyCode)?1:-1,n=e.shiftKey?3:e.ctrlKey?2:1;t+=i*c*n}else if(e.keyCode===s)t=this.minValue;else if(e.keyCode===n)t=this.maxValue;else{const r=e.keyCode===i?1:-1;t-=r*c*(h>100?h/10:10)}return t},roundValue(e){if(!this.stepNumeric)return e;const t=this.step.toString().trim(),r=t.indexOf(".")>-1?t.length-t.indexOf(".")-1:0,i=this.minValue%this.stepNumeric,n=Math.round((e-i)/this.stepNumeric)*this.stepNumeric+i;return parseFloat(Math.min(n,this.maxValue).toFixed(r))}}}),Pr=r(20517);r(23215);function Tr(e){e={...e};const t=(0,Pr.rF)(e),r=(0,Pr.WZ)(e),i=(0,Pr.Ag)(e);return{alpha:e.a,hex:t.substr(0,7),hexa:t,hsla:r,hsva:e,hue:e.h,rgba:i}}function Ir(e){const t=(0,Pr.gC)(e),r=(0,Pr.rF)(t),i=(0,Pr.Ag)(t);return{alpha:t.a,hex:r.substr(0,7),hexa:r,hsla:e,hsva:t,hue:t.h,rgba:i}}function Dr(e){const t=(0,Pr.aZ)(e),r=(0,Pr.FJ)(e),i=(0,Pr.WZ)(t);return{alpha:t.a,hex:r.substr(0,7),hexa:r,hsla:i,hsva:t,hue:t.h,rgba:e}}function Lr(e){const t=(0,Pr.$q)(e),r=(0,Pr.WZ)(t),i=(0,Pr.Ag)(t);return{alpha:t.a,hex:e.substr(0,7),hexa:e,hsla:r,hsva:t,hue:t.h,rgba:i}}function Rr(e){return Lr((0,Pr.jR)(e))}function Nr(e,t){return t.every((t=>e.hasOwnProperty(t)))}function jr(e,t){if(!e)return Dr({r:255,g:0,b:0,a:1});if("string"===typeof e){if("transparent"===e)return Lr("#00000000");const r=(0,Pr.jR)(e);return t&&r===t.hexa?t:Lr(r)}if("object"===typeof e){if(e.hasOwnProperty("alpha"))return e;const r=e.hasOwnProperty("a")?parseFloat(e.a):1;if(Nr(e,["r","g","b"]))return t&&e===t.rgba?t:Dr({...e,a:r});if(Nr(e,["h","s","l"]))return t&&e===t.hsla?t:Ir({...e,a:r});if(Nr(e,["h","s","v"]))return t&&e===t.hsva?t:Tr({...e,a:r})}return Dr({r:255,g:0,b:0,a:1})}function Br(e,t){if(t){const{a:t,...r}=e;return r}return e}function Fr(e,t){if(null==t)return e;if("string"===typeof t)return 7===t.length?e.hex:e.hexa;if("object"===typeof t){const r="number"===typeof t.a&&0===t.a?!!t.a:!t.a;if(Nr(t,["r","g","b"]))return Br(e.rgba,r);if(Nr(t,["h","s","l"]))return Br(e.hsla,r);if(Nr(t,["h","s","v"]))return Br(e.hsva,r)}return e}function zr(e){return!!e&&("string"===typeof e?e.length>7:"object"===typeof e&&(Nr(e,["a"])||Nr(e,["alpha"])))}var Vr=yr.Ay.extend({name:"v-color-picker-preview",props:{color:Object,disabled:Boolean,hideAlpha:Boolean},methods:{genAlpha(){return this.genTrack({staticClass:"v-color-picker__alpha",props:{thumbColor:"grey lighten-2",hideDetails:!0,value:this.color.alpha,step:0,min:0,max:1},style:{backgroundImage:this.disabled?void 0:`linear-gradient(to ${this.$vuetify.rtl?"left":"right"}, transparent, ${(0,Pr.kH)(this.color.rgba)})`},on:{input:e=>this.color.alpha!==e&&this.$emit("update:color",Tr({...this.color.hsva,a:e}))}})},genSliders(){return this.$createElement("div",{staticClass:"v-color-picker__sliders"},[this.genHue(),!this.hideAlpha&&this.genAlpha()])},genDot(){return this.$createElement("div",{staticClass:"v-color-picker__dot"},[this.$createElement("div",{style:{background:(0,Pr.V6)(this.color.rgba)}})])},genHue(){return this.genTrack({staticClass:"v-color-picker__hue",props:{thumbColor:"grey lighten-2",hideDetails:!0,value:this.color.hue,step:0,min:0,max:360},on:{input:e=>this.color.hue!==e&&this.$emit("update:color",Tr({...this.color.hsva,h:e}))}})},genTrack(e){return this.$createElement(Or,{class:"v-color-picker__track",...e,props:{disabled:this.disabled,...e.props}})}},render(e){return e("div",{staticClass:"v-color-picker__preview",class:{"v-color-picker__preview--hide-alpha":this.hideAlpha}},[this.genDot(),this.genSliders()])}}),qr=yr.Ay.extend({name:"v-color-picker-canvas",props:{color:{type:Object,default:()=>Dr({r:255,g:0,b:0,a:1})},disabled:Boolean,dotSize:{type:[Number,String],default:10},height:{type:[Number,String],default:150},width:{type:[Number,String],default:300}},data(){return{boundingRect:{width:0,height:0,left:0,top:0}}},computed:{dot(){return this.color?{x:this.color.hsva.s*parseInt(this.width,10),y:(1-this.color.hsva.v)*parseInt(this.height,10)}:{x:0,y:0}}},watch:{"color.hue":"updateCanvas"},mounted(){this.updateCanvas()},methods:{emitColor(e,t){const{left:r,top:i,width:n,height:s}=this.boundingRect;this.$emit("update:color",Tr({h:this.color.hue,s:(0,ur.qE)(e-r,0,n)/n,v:1-(0,ur.qE)(t-i,0,s)/s,a:this.color.alpha}))},updateCanvas(){if(!this.color)return;const e=this.$refs.canvas,t=e.getContext("2d");if(!t)return;const r=t.createLinearGradient(0,0,e.width,0);r.addColorStop(0,"hsla(0, 0%, 100%, 1)"),r.addColorStop(1,`hsla(${this.color.hue}, 100%, 50%, 1)`),t.fillStyle=r,t.fillRect(0,0,e.width,e.height);const i=t.createLinearGradient(0,0,0,e.height);i.addColorStop(0,"hsla(0, 0%, 100%, 0)"),i.addColorStop(1,"hsla(0, 0%, 0%, 1)"),t.fillStyle=i,t.fillRect(0,0,e.width,e.height)},handleClick(e){this.disabled||(this.boundingRect=this.$el.getBoundingClientRect(),this.emitColor(e.clientX,e.clientY))},handleMouseDown(e){e.preventDefault(),this.disabled||(this.boundingRect=this.$el.getBoundingClientRect(),window.addEventListener("mousemove",this.handleMouseMove),window.addEventListener("mouseup",this.handleMouseUp))},handleMouseMove(e){this.disabled||this.emitColor(e.clientX,e.clientY)},handleMouseUp(){window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("mouseup",this.handleMouseUp)},genCanvas(){return this.$createElement("canvas",{ref:"canvas",attrs:{width:this.width,height:this.height}})},genDot(){const e=parseInt(this.dotSize,10)/2,t=(0,ur.Dg)(this.dot.x-e),r=(0,ur.Dg)(this.dot.y-e);return this.$createElement("div",{staticClass:"v-color-picker__canvas-dot",class:{"v-color-picker__canvas-dot--disabled":this.disabled},style:{width:(0,ur.Dg)(this.dotSize),height:(0,ur.Dg)(this.dotSize),transform:`translate(${t}, ${r})`}})}},render(e){return e("div",{staticClass:"v-color-picker__canvas",style:{width:(0,ur.Dg)(this.width),height:(0,ur.Dg)(this.height)},on:{click:this.handleClick,mousedown:this.handleMouseDown}},[this.genCanvas(),this.genDot()])}}),Ur=r(54728);const Hr={rgba:{inputs:[["r",255,"int"],["g",255,"int"],["b",255,"int"],["a",1,"float"]],from:Dr},hsla:{inputs:[["h",360,"int"],["s",1,"float"],["l",1,"float"],["a",1,"float"]],from:Ir},hexa:{from:Lr}};var Wr=yr.Ay.extend({name:"v-color-picker-edit",props:{color:Object,disabled:Boolean,hideAlpha:Boolean,hideModeSwitch:Boolean,mode:{type:String,default:"rgba",validator:e=>Object.keys(Hr).includes(e)}},data(){return{modes:Hr,internalMode:this.mode}},computed:{currentMode(){return this.modes[this.internalMode]}},watch:{mode(e){this.internalMode=e}},created(){this.internalMode=this.mode},methods:{getValue(e,t){return"float"===t?Math.round(100*e)/100:"int"===t?Math.round(e):0},parseValue(e,t){return"float"===t?parseFloat(e):"int"===t&&parseInt(e,10)||0},changeMode(){const e=Object.keys(this.modes),t=e.indexOf(this.internalMode),r=e[(t+1)%e.length];this.internalMode=r,this.$emit("update:mode",r)},genInput(e,t,r,i){return this.$createElement("div",{staticClass:"v-color-picker__input"},[this.$createElement("input",{key:e,attrs:t,domProps:{value:r},on:i}),this.$createElement("span",e.toUpperCase())])},genInputs(){if("hexa"===this.internalMode){const e=this.color.hexa,t=this.hideAlpha&&e.endsWith("FF")?e.substr(0,7):e;return this.genInput("hex",{maxlength:this.hideAlpha?7:9,disabled:this.disabled},t,{change:e=>{const t=e.target;this.$emit("update:color",this.currentMode.from((0,Pr.jR)(t.value)))}})}{const e=this.hideAlpha?this.currentMode.inputs.slice(0,-1):this.currentMode.inputs;return e.map((([e,t,r])=>{const i=this.color[this.internalMode];return this.genInput(e,{type:"number",min:0,max:t,step:"float"===r?"0.01":"int"===r?"1":void 0,disabled:this.disabled},this.getValue(i[e],r),{input:t=>{const n=t.target,s=this.parseValue(n.value||"0",r);this.$emit("update:color",this.currentMode.from(Object.assign({},i,{[e]:s}),this.color.alpha))}})}))}},genSwitch(){return this.$createElement(Ur.A,{props:{small:!0,icon:!0,disabled:this.disabled},on:{click:this.changeMode}},[this.$createElement(mr.A,"$unfold")])}},render(e){return e("div",{staticClass:"v-color-picker__edit"},[this.genInputs(),!this.hideModeSwitch&&this.genSwitch()])}});const Kr=Object.freeze({base:"#f44336",lighten5:"#ffebee",lighten4:"#ffcdd2",lighten3:"#ef9a9a",lighten2:"#e57373",lighten1:"#ef5350",darken1:"#e53935",darken2:"#d32f2f",darken3:"#c62828",darken4:"#b71c1c",accent1:"#ff8a80",accent2:"#ff5252",accent3:"#ff1744",accent4:"#d50000"}),Yr=Object.freeze({base:"#e91e63",lighten5:"#fce4ec",lighten4:"#f8bbd0",lighten3:"#f48fb1",lighten2:"#f06292",lighten1:"#ec407a",darken1:"#d81b60",darken2:"#c2185b",darken3:"#ad1457",darken4:"#880e4f",accent1:"#ff80ab",accent2:"#ff4081",accent3:"#f50057",accent4:"#c51162"}),Gr=Object.freeze({base:"#9c27b0",lighten5:"#f3e5f5",lighten4:"#e1bee7",lighten3:"#ce93d8",lighten2:"#ba68c8",lighten1:"#ab47bc",darken1:"#8e24aa",darken2:"#7b1fa2",darken3:"#6a1b9a",darken4:"#4a148c",accent1:"#ea80fc",accent2:"#e040fb",accent3:"#d500f9",accent4:"#aa00ff"}),Zr=Object.freeze({base:"#673ab7",lighten5:"#ede7f6",lighten4:"#d1c4e9",lighten3:"#b39ddb",lighten2:"#9575cd",lighten1:"#7e57c2",darken1:"#5e35b1",darken2:"#512da8",darken3:"#4527a0",darken4:"#311b92",accent1:"#b388ff",accent2:"#7c4dff",accent3:"#651fff",accent4:"#6200ea"}),Jr=Object.freeze({base:"#3f51b5",lighten5:"#e8eaf6",lighten4:"#c5cae9",lighten3:"#9fa8da",lighten2:"#7986cb",lighten1:"#5c6bc0",darken1:"#3949ab",darken2:"#303f9f",darken3:"#283593",darken4:"#1a237e",accent1:"#8c9eff",accent2:"#536dfe",accent3:"#3d5afe",accent4:"#304ffe"}),Xr=Object.freeze({base:"#2196f3",lighten5:"#e3f2fd",lighten4:"#bbdefb",lighten3:"#90caf9",lighten2:"#64b5f6",lighten1:"#42a5f5",darken1:"#1e88e5",darken2:"#1976d2",darken3:"#1565c0",darken4:"#0d47a1",accent1:"#82b1ff",accent2:"#448aff",accent3:"#2979ff",accent4:"#2962ff"}),Qr=Object.freeze({base:"#03a9f4",lighten5:"#e1f5fe",lighten4:"#b3e5fc",lighten3:"#81d4fa",lighten2:"#4fc3f7",lighten1:"#29b6f6",darken1:"#039be5",darken2:"#0288d1",darken3:"#0277bd",darken4:"#01579b",accent1:"#80d8ff",accent2:"#40c4ff",accent3:"#00b0ff",accent4:"#0091ea"}),ei=Object.freeze({base:"#00bcd4",lighten5:"#e0f7fa",lighten4:"#b2ebf2",lighten3:"#80deea",lighten2:"#4dd0e1",lighten1:"#26c6da",darken1:"#00acc1",darken2:"#0097a7",darken3:"#00838f",darken4:"#006064",accent1:"#84ffff",accent2:"#18ffff",accent3:"#00e5ff",accent4:"#00b8d4"}),ti=Object.freeze({base:"#009688",lighten5:"#e0f2f1",lighten4:"#b2dfdb",lighten3:"#80cbc4",lighten2:"#4db6ac",lighten1:"#26a69a",darken1:"#00897b",darken2:"#00796b",darken3:"#00695c",darken4:"#004d40",accent1:"#a7ffeb",accent2:"#64ffda",accent3:"#1de9b6",accent4:"#00bfa5"}),ri=Object.freeze({base:"#4caf50",lighten5:"#e8f5e9",lighten4:"#c8e6c9",lighten3:"#a5d6a7",lighten2:"#81c784",lighten1:"#66bb6a",darken1:"#43a047",darken2:"#388e3c",darken3:"#2e7d32",darken4:"#1b5e20",accent1:"#b9f6ca",accent2:"#69f0ae",accent3:"#00e676",accent4:"#00c853"}),ii=Object.freeze({base:"#8bc34a",lighten5:"#f1f8e9",lighten4:"#dcedc8",lighten3:"#c5e1a5",lighten2:"#aed581",lighten1:"#9ccc65",darken1:"#7cb342",darken2:"#689f38",darken3:"#558b2f",darken4:"#33691e",accent1:"#ccff90",accent2:"#b2ff59",accent3:"#76ff03",accent4:"#64dd17"}),ni=Object.freeze({base:"#cddc39",lighten5:"#f9fbe7",lighten4:"#f0f4c3",lighten3:"#e6ee9c",lighten2:"#dce775",lighten1:"#d4e157",darken1:"#c0ca33",darken2:"#afb42b",darken3:"#9e9d24",darken4:"#827717",accent1:"#f4ff81",accent2:"#eeff41",accent3:"#c6ff00",accent4:"#aeea00"}),si=Object.freeze({base:"#ffeb3b",lighten5:"#fffde7",lighten4:"#fff9c4",lighten3:"#fff59d",lighten2:"#fff176",lighten1:"#ffee58",darken1:"#fdd835",darken2:"#fbc02d",darken3:"#f9a825",darken4:"#f57f17",accent1:"#ffff8d",accent2:"#ffff00",accent3:"#ffea00",accent4:"#ffd600"}),oi=Object.freeze({base:"#ffc107",lighten5:"#fff8e1",lighten4:"#ffecb3",lighten3:"#ffe082",lighten2:"#ffd54f",lighten1:"#ffca28",darken1:"#ffb300",darken2:"#ffa000",darken3:"#ff8f00",darken4:"#ff6f00",accent1:"#ffe57f",accent2:"#ffd740",accent3:"#ffc400",accent4:"#ffab00"}),ai=Object.freeze({base:"#ff9800",lighten5:"#fff3e0",lighten4:"#ffe0b2",lighten3:"#ffcc80",lighten2:"#ffb74d",lighten1:"#ffa726",darken1:"#fb8c00",darken2:"#f57c00",darken3:"#ef6c00",darken4:"#e65100",accent1:"#ffd180",accent2:"#ffab40",accent3:"#ff9100",accent4:"#ff6d00"}),li=Object.freeze({base:"#ff5722",lighten5:"#fbe9e7",lighten4:"#ffccbc",lighten3:"#ffab91",lighten2:"#ff8a65",lighten1:"#ff7043",darken1:"#f4511e",darken2:"#e64a19",darken3:"#d84315",darken4:"#bf360c",accent1:"#ff9e80",accent2:"#ff6e40",accent3:"#ff3d00",accent4:"#dd2c00"}),ui=Object.freeze({base:"#795548",lighten5:"#efebe9",lighten4:"#d7ccc8",lighten3:"#bcaaa4",lighten2:"#a1887f",lighten1:"#8d6e63",darken1:"#6d4c41",darken2:"#5d4037",darken3:"#4e342e",darken4:"#3e2723"}),ci=Object.freeze({base:"#607d8b",lighten5:"#eceff1",lighten4:"#cfd8dc",lighten3:"#b0bec5",lighten2:"#90a4ae",lighten1:"#78909c",darken1:"#546e7a",darken2:"#455a64",darken3:"#37474f",darken4:"#263238"}),hi=Object.freeze({base:"#9e9e9e",lighten5:"#fafafa",lighten4:"#f5f5f5",lighten3:"#eeeeee",lighten2:"#e0e0e0",lighten1:"#bdbdbd",darken1:"#757575",darken2:"#616161",darken3:"#424242",darken4:"#212121"}),di=Object.freeze({black:"#000000",white:"#ffffff",transparent:"transparent"});var fi=Object.freeze({red:Kr,pink:Yr,purple:Gr,deepPurple:Zr,indigo:Jr,blue:Xr,lightBlue:Qr,cyan:ei,teal:ti,green:ri,lightGreen:ii,lime:ni,yellow:si,amber:oi,orange:ai,deepOrange:li,brown:ui,blueGrey:ci,grey:hi,shades:di}),pi=r(73381);function mi(e){return Object.keys(e).map((t=>{const r=e[t];return r.base?[r.base,r.darken4,r.darken3,r.darken2,r.darken1,r.lighten1,r.lighten2,r.lighten3,r.lighten4,r.lighten5]:[r.black,r.white,r.transparent]}))}const gi=Rr("#FFFFFF").rgba,vi=Rr("#000000").rgba;var yi=(0,_r.A)(pi.A).extend({name:"v-color-picker-swatches",props:{swatches:{type:Array,default:()=>mi(fi)},disabled:Boolean,color:Object,maxWidth:[Number,String],maxHeight:[Number,String]},methods:{genColor(e){const t=this.$createElement("div",{style:{background:e}},[(0,ur.bD)(this.color,jr(e,null))&&this.$createElement(mr.A,{props:{small:!0,dark:(0,Pr.yN)(this.color.rgba,gi)>2&&this.color.alpha>.5,light:(0,Pr.yN)(this.color.rgba,vi)>2&&this.color.alpha>.5}},"$success")]);return this.$createElement("div",{staticClass:"v-color-picker__color",on:{click:()=>this.disabled||this.$emit("update:color",Rr("transparent"===e?"#00000000":e))}},[t])},genSwatches(){return this.swatches.map((e=>{const t=e.map(this.genColor);return this.$createElement("div",{staticClass:"v-color-picker__swatch"},t)}))}},render(e){return e("div",{staticClass:"v-color-picker__swatches",style:{maxWidth:(0,ur.Dg)(this.maxWidth),maxHeight:(0,ur.Dg)(this.maxHeight)}},[this.$createElement("div",this.genSwatches())])}}),bi=r(13251),wi=(0,_r.A)(bi.A,pi.A).extend({name:"v-color-picker",props:{canvasHeight:{type:[String,Number],default:150},disabled:Boolean,dotSize:{type:[Number,String],default:10},flat:Boolean,hideCanvas:Boolean,hideSliders:Boolean,hideInputs:Boolean,hideModeSwitch:Boolean,mode:{type:String,default:"rgba",validator:e=>Object.keys(Hr).includes(e)},showSwatches:Boolean,swatches:Array,swatchesMaxHeight:{type:[Number,String],default:150},value:{type:[Object,String]},width:{type:[Number,String],default:300}},data:()=>({internalValue:Dr({r:255,g:0,b:0,a:1})}),computed:{hideAlpha(){return!!this.value&&!zr(this.value)}},watch:{value:{handler(e){this.updateColor(jr(e,this.internalValue))},immediate:!0}},methods:{updateColor(e){this.internalValue=e;const t=Fr(this.internalValue,this.value);(0,ur.bD)(t,this.value)||(this.$emit("input",t),this.$emit("update:color",this.internalValue))},genCanvas(){return this.$createElement(qr,{props:{color:this.internalValue,disabled:this.disabled,dotSize:this.dotSize,width:this.width,height:this.canvasHeight},on:{"update:color":this.updateColor}})},genControls(){return this.$createElement("div",{staticClass:"v-color-picker__controls"},[!this.hideSliders&&this.genPreview(),!this.hideInputs&&this.genEdit()])},genEdit(){return this.$createElement(Wr,{props:{color:this.internalValue,disabled:this.disabled,hideAlpha:this.hideAlpha,hideModeSwitch:this.hideModeSwitch,mode:this.mode},on:{"update:color":this.updateColor,"update:mode":e=>this.$emit("update:mode",e)}})},genPreview(){return this.$createElement(Vr,{props:{color:this.internalValue,disabled:this.disabled,hideAlpha:this.hideAlpha},on:{"update:color":this.updateColor}})},genSwatches(){return this.$createElement(yi,{props:{dark:this.dark,light:this.light,disabled:this.disabled,swatches:this.swatches,color:this.internalValue,maxHeight:this.swatchesMaxHeight},on:{"update:color":this.updateColor}})}},render(e){return e(Er.A,{staticClass:"v-color-picker",class:{"v-color-picker--flat":this.flat,...this.themeClasses,...this.elevationClasses},props:{maxWidth:this.width}},[!this.hideCanvas&&this.genCanvas(),(!this.hideSliders||!this.hideInputs)&&this.genControls(),this.showSwatches&&this.genSwatches()])}}),_i=hr.extend({name:"v-combobox",props:{delimiters:{type:Array,default:()=>[]},returnObject:{type:Boolean,default:!0}},data:()=>({editingIndex:-1}),computed:{computedCounterValue(){return this.multiple?this.selectedItems.length:(this.internalSearch||"").toString().length},hasSlot(){return or.A.options.computed.hasSlot.call(this)||this.multiple},isAnyValueAllowed(){return!0},menuCanShow(){return!!this.isFocused&&(this.hasDisplayedItems||!!this.$slots["no-data"]&&!this.hideNoData)},searchIsDirty(){return null!=this.internalSearch}},methods:{onInternalSearchChanged(e){if(e&&this.multiple&&this.delimiters.length){const t=this.delimiters.find((t=>e.endsWith(t)));null!=t&&(this.internalSearch=e.slice(0,e.length-t.length),this.updateTags())}this.updateMenuDimensions()},genInput(){const e=hr.options.methods.genInput.call(this);return delete e.data.attrs.name,e.data.on.paste=this.onPaste,e},genChipSelection(e,t){const r=or.A.options.methods.genChipSelection.call(this,e,t);return this.multiple&&(r.componentOptions.listeners={...r.componentOptions.listeners,dblclick:()=>{this.editingIndex=t,this.internalSearch=this.getText(e),this.selectedIndex=-1}}),r},onChipInput(e){or.A.options.methods.onChipInput.call(this,e),this.editingIndex=-1},onEnterDown(e){e.preventDefault(),this.getMenuIndex()>-1||this.$nextTick(this.updateSelf)},onKeyDown(e){const t=e.keyCode;!e.ctrlKey&&[ur.uP.home,ur.uP.end].includes(t)||or.A.options.methods.onKeyDown.call(this,e),this.multiple&&t===ur.uP.left&&0===this.$refs.input.selectionStart?this.updateSelf():t===ur.uP.enter&&this.onEnterDown(e),this.changeSelectedIndex(t)},onTabDown(e){if(this.multiple&&this.internalSearch&&-1===this.getMenuIndex())return e.preventDefault(),e.stopPropagation(),this.updateTags();hr.options.methods.onTabDown.call(this,e)},selectItem(e){this.editingIndex>-1?this.updateEditing():(hr.options.methods.selectItem.call(this,e),this.internalSearch&&this.multiple&&this.getText(e).toLocaleLowerCase().includes(this.internalSearch.toLocaleLowerCase())&&(this.internalSearch=null))},setSelectedItems(){null==this.internalValue||""===this.internalValue?this.selectedItems=[]:this.selectedItems=this.multiple?this.internalValue:[this.internalValue]},setValue(e){or.A.options.methods.setValue.call(this,void 0===e?this.internalSearch:e)},updateEditing(){const e=this.internalValue.slice(),t=this.selectedItems.findIndex((e=>this.getText(e)===this.internalSearch));if(t>-1){const r="object"===typeof e[t]?Object.assign({},e[t]):e[t];e.splice(t,1),e.push(r)}else e[this.editingIndex]=this.internalSearch;this.setValue(e),this.editingIndex=-1,this.internalSearch=null},updateCombobox(){if(!this.searchIsDirty)return;this.internalSearch!==this.getText(this.internalValue)&&this.setValue();const e=Boolean(this.$scopedSlots.selection)||this.hasChips;e&&(this.internalSearch=null)},updateSelf(){this.multiple?this.updateTags():this.updateCombobox()},updateTags(){const e=this.getMenuIndex();if(e<0&&!this.searchIsDirty||!this.internalSearch)return;if(this.editingIndex>-1)return this.updateEditing();const t=this.selectedItems.findIndex((e=>this.internalSearch===this.getText(e))),r=t>-1&&"object"===typeof this.selectedItems[t]?Object.assign({},this.selectedItems[t]):this.internalSearch;if(t>-1){const e=this.internalValue.slice();e.splice(t,1),this.setValue(e)}if(e>-1)return this.internalSearch=null;this.selectItem(r),this.internalSearch=null},onPaste(e){var t;if(this.$emit("paste",e),!this.multiple||this.searchIsDirty)return;const r=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/vnd.vuetify.autocomplete.item+plain");r&&-1===this.findExistingIndex(r)&&(e.preventDefault(),or.A.options.methods.selectItem.call(this,r))},clearableCallback(){this.editingIndex=-1,hr.options.methods.clearableCallback.call(this)}}}),ki=r(3449),xi=r(58743),Si=(0,_r.A)(xi.A).extend({methods:{genPickerButton(e,t,r,i=!1,n=""){const s=this[e]===t,o=r=>{r.stopPropagation(),this.$emit(`update:${(0,ur.kW)(e)}`,t)};return this.$createElement("div",{staticClass:`v-picker__title__btn ${n}`.trim(),class:{"v-picker__title__btn--active":s,"v-picker__title__btn--readonly":i},on:s||i?void 0:{click:o}},Array.isArray(r)?r:[r])}}}),Mi=(0,_r.A)(Si).extend({name:"v-date-picker-title",props:{date:{type:String,default:""},disabled:Boolean,readonly:Boolean,selectingYear:Boolean,value:{type:String},year:{type:[Number,String],default:""},yearIcon:{type:String}},data:()=>({isReversing:!1}),computed:{computedTransition(){return this.isReversing?"picker-reverse-transition":"picker-transition"}},watch:{value(e,t){this.isReversing=e(t|=0,e=String(e),r=String(r),e.length>t?String(e):(t-=e.length,t>r.length&&(r+=r.repeat(t/r.length)),r.slice(0,t)+String(e)));var Ci=(e,t=2)=>Ai(e,t,"0");function $i(e,t,r={start:0,length:0}){const i=e=>{const[t,r,i]=e.trim().split(" ")[0].split("-");return[Ci(t,4),Ci(r||1),Ci(i||1)].join("-")};try{const r=new Intl.DateTimeFormat(e||void 0,t);return e=>r.format(new Date(`${i(e)}T00:00:00+00:00`))}catch(n){return r.start||r.length?e=>i(e).substr(r.start||0,r.length):void 0}}var Oi=$i,Pi=(e,t)=>{const[r,i]=e.split("-").map(Number);return i+t===0?r-1+"-12":i+t===13?`${r+1}-01`:`${r}-${Ci(i+t)}`},Ti=(0,_r.A)(xi.A,Ei,pi.A).extend({name:"v-date-picker-header",props:{disabled:Boolean,format:Function,min:String,max:String,nextAriaLabel:String,nextIcon:{type:String,default:"$next"},prevAriaLabel:String,prevIcon:{type:String,default:"$prev"},readonly:Boolean,value:{type:[Number,String],required:!0}},data(){return{isReversing:!1}},computed:{formatter(){return this.format?this.format:String(this.value).split("-")[1]?Oi(this.currentLocale,{month:"long",year:"numeric",timeZone:"UTC"},{length:7}):Oi(this.currentLocale,{year:"numeric",timeZone:"UTC"},{length:4})}},watch:{value(e,t){this.isReversing=e0?this.nextAriaLabel:this.prevAriaLabel,r=t?this.$vuetify.lang.t(t):void 0,i=this.disabled||e<0&&this.min&&this.calculateChange(e)0&&this.max&&this.calculateChange(e)>this.max;return this.$createElement(Ur.A,{attrs:{"aria-label":r},props:{dark:this.dark,disabled:i,icon:!0,light:this.light},on:{click:t=>{t.stopPropagation(),this.$emit("input",this.calculateChange(e))}}},[this.$createElement(mr.A,e<0===!this.$vuetify.rtl?this.prevIcon:this.nextIcon)])},calculateChange(e){const[t,r]=String(this.value).split("-").map(Number);return null==r?`${t+e}`:Pi(String(this.value),e)},genHeader(){const e=!this.disabled&&(this.color||"accent"),t=this.$createElement("div",this.setTextColor(e,{key:String(this.value)}),[this.$createElement("button",{attrs:{type:"button"},on:{click:()=>this.$emit("toggle")}},(0,ur.$c)(this)||[this.formatter(String(this.value))])]),r=this.$createElement("transition",{props:{name:this.isReversing===!this.$vuetify.rtl?"tab-reverse-transition":"tab-transition"}},[t]);return this.$createElement("div",{staticClass:"v-date-picker-header__value",class:{"v-date-picker-header__value--disabled":this.disabled}},[r])}},render(){return this.$createElement("div",{staticClass:"v-date-picker-header",class:{"v-date-picker-header--disabled":this.disabled,...this.themeClasses}},[this.genBtn(-1),this.genHeader(),this.genBtn(1)])}});const Ii=e=>{const{touchstartX:t,touchendX:r,touchstartY:i,touchendY:n}=e,s=.5,o=16;e.offsetX=r-t,e.offsetY=n-i,Math.abs(e.offsetY)t+o&&e.right(e)),Math.abs(e.offsetX)i+o&&e.down(e))};function Di(e,t){const r=e.changedTouches[0];t.touchstartX=r.clientX,t.touchstartY=r.clientY,t.start&&t.start(Object.assign(e,t))}function Li(e,t){const r=e.changedTouches[0];t.touchendX=r.clientX,t.touchendY=r.clientY,t.end&&t.end(Object.assign(e,t)),Ii(t)}function Ri(e,t){const r=e.changedTouches[0];t.touchmoveX=r.clientX,t.touchmoveY=r.clientY,t.move&&t.move(Object.assign(e,t))}function Ni(e){const t={touchstartX:0,touchstartY:0,touchendX:0,touchendY:0,touchmoveX:0,touchmoveY:0,offsetX:0,offsetY:0,left:e.left,right:e.right,up:e.up,down:e.down,start:e.start,move:e.move,end:e.end};return{touchstart:e=>Di(e,t),touchend:e=>Li(e,t),touchmove:e=>Ri(e,t)}}function ji(e,t,r){const i=t.value,n=i.parent?e.parentElement:e,s=i.options||{passive:!0};if(!n)return;const o=Ni(t.value);n._touchHandlers=Object(n._touchHandlers),n._touchHandlers[r.context._uid]=o,(0,ur.HP)(o).forEach((e=>{n.addEventListener(e,o[e],s)}))}function Bi(e,t,r){const i=t.value.parent?e.parentElement:e;if(!i||!i._touchHandlers)return;const n=i._touchHandlers[r.context._uid];(0,ur.HP)(n).forEach((e=>{i.removeEventListener(e,n[e])})),delete i._touchHandlers[r.context._uid]}const Fi={inserted:ji,unbind:Bi};var zi=Fi;function Vi(e,t,r){return Object.keys(e.$listeners).reduce(((i,n)=>(n.endsWith(t)&&(i[n.slice(0,-t.length)]=t=>e.$emit(n,r,t)),i)),{})}function qi(e,t){return Object.keys(e.$listeners).reduce(((r,i)=>(i.endsWith(t)&&(r[i]=e.$listeners[i]),r)),{})}var Ui=(e,t)=>{const[r,i=1,n=1]=e.split("-");return`${r}-${Ci(i)}-${Ci(n)}`.substr(0,{date:10,month:7,year:4}[t])};function Hi(e,t,r,i){return(!i||i(e))&&(!t||e>=t.substr(0,10))&&(!r||e<=r)}var Wi=(0,_r.A)(xi.A,Ei,pi.A).extend({directives:{Touch:zi},props:{allowedDates:Function,current:String,disabled:Boolean,format:Function,events:{type:[Array,Function,Object],default:()=>null},eventColor:{type:[Array,Function,Object,String],default:()=>"warning"},min:String,max:String,range:Boolean,readonly:Boolean,scrollable:Boolean,tableDate:{type:String,required:!0},value:[String,Array]},data:()=>({isReversing:!1,wheelThrottle:null}),computed:{computedTransition(){return this.isReversing===!this.$vuetify.rtl?"tab-reverse-transition":"tab-transition"},displayedMonth(){return Number(this.tableDate.split("-")[1])-1},displayedYear(){return Number(this.tableDate.split("-")[0])}},watch:{tableDate(e,t){this.isReversing=e{t&&!this.readonly&&this.$emit("input",e)}},Vi(this,`:${r}`,e))},genButton(e,t,r,i,n=!1){const s=Hi(e,this.min,this.max,this.allowedDates),o=this.isSelected(e)&&s,a=e===this.current,l=o?this.setBackgroundColor:this.setTextColor,u=(o||a)&&(this.color||"accent");let c=!1,h=!1;return this.range&&this.value&&Array.isArray(this.value)&&(c=e===this.value[0],h=e===this.value[this.value.length-1]),this.$createElement("button",l(u,{staticClass:"v-btn",class:this.genButtonClasses(s&&!n,t,o,a,c,h),attrs:{type:"button"},domProps:{disabled:this.disabled||!s||n},on:this.genButtonEvents(e,s,r)}),[this.$createElement("div",{staticClass:"v-btn__content"},[i(e)]),this.genEvents(e)])},getEventColors(e){const t=e=>Array.isArray(e)?e:[e];let r,i=[];return r=Array.isArray(this.events)?this.events.includes(e):this.events instanceof Function?this.events(e)||!1:this.events&&this.events[e]||!1,r?(i=!0!==r?t(r):"string"===typeof this.eventColor?[this.eventColor]:"function"===typeof this.eventColor?t(this.eventColor(e)):Array.isArray(this.eventColor)?this.eventColor:t(this.eventColor[e]),i.filter((e=>e))):[]},genEvents(e){const t=this.getEventColors(e);return t.length?this.$createElement("div",{staticClass:"v-date-picker-table__events"},t.map((e=>this.$createElement("div",this.setBackgroundColor(e))))):null},isValidScroll(e,t){const r=t(e),i=1===r.split("-").length?"year":"month";return e<0&&(!this.min||r>=Ui(this.min,i))||e>0&&(!this.max||r<=Ui(this.max,i))},wheel(e,t){this.$emit("update:table-date",t(e.deltaY))},touch(e,t){this.$emit("update:table-date",t(e))},genTable(e,t,r){const i=this.$createElement("transition",{props:{name:this.computedTransition}},[this.$createElement("table",{key:this.tableDate},t)]),n={name:"touch",value:{left:e=>e.offsetX<-15&&this.isValidScroll(1,r)&&this.touch(1,r),right:e=>e.offsetX>15&&this.isValidScroll(-1,r)&&this.touch(-1,r)}};return this.$createElement("div",{staticClass:e,class:{"v-date-picker-table--disabled":this.disabled,...this.themeClasses},on:!this.disabled&&this.scrollable?{wheel:e=>{e.preventDefault(),this.isValidScroll(e.deltaY,r)&&this.wheelThrottle(e,r)}}:void 0,directives:[n]},[i])},isSelected(e){if(Array.isArray(this.value)){if(this.range&&2===this.value.length){const[t,r]=[...this.value].sort();return t<=e&&e<=r}return-1!==this.value.indexOf(e)}return e===this.value}}});function Ki(e,t=0,r=1){let i;return e<100&&e>=0?(i=new Date(Date.UTC(e,t,r)),isFinite(i.getUTCFullYear())&&i.setUTCFullYear(e)):i=new Date(Date.UTC(e,t,r)),i}function Yi(e,t,r){const i=7+t-r,n=(7+Ki(e,0,i).getUTCDay()-t)%7;return-n+i-1}function Gi(e,t,r,i){let n=[0,31,59,90,120,151,181,212,243,273,304,334][t];return t>1&&Xi(e)&&n++,n+r}function Zi(e,t,r){const i=Yi(e,t,r),n=Yi(e+1,t,r),s=Xi(e)?366:365;return(s-i+n)/7}function Ji(e,t,r,i,n){const s=Yi(e,i,n),o=Math.ceil((Gi(e,t,r,i)-s)/7);return o<1?o+Zi(e-1,i,n):o>Zi(e,i,n)?o-Zi(e,i,n):o}function Xi(e){return e%4===0&&e%100!==0||e%400===0}var Qi=(0,_r.A)(Wi).extend({name:"v-date-picker-date-table",props:{firstDayOfWeek:{type:[String,Number],default:0},localeFirstDayOfYear:{type:[String,Number],default:0},showAdjacentMonths:Boolean,showWeek:Boolean,weekdayFormat:Function},computed:{formatter(){return this.format||Oi(this.currentLocale,{day:"numeric",timeZone:"UTC"},{start:8,length:2})},weekdayFormatter(){return this.weekdayFormat||Oi(this.currentLocale,{weekday:"narrow",timeZone:"UTC"})},weekDays(){const e=parseInt(this.firstDayOfWeek,10);return this.weekdayFormatter?(0,ur.Sd)(7).map((t=>this.weekdayFormatter(`2017-01-${e+t+15}`))):(0,ur.Sd)(7).map((t=>["S","M","T","W","T","F","S"][(t+e)%7]))}},methods:{calculateTableDate(e){return Pi(this.tableDate,Math.sign(e||1))},genTHead(){const e=this.weekDays.map((e=>this.$createElement("th",e)));return this.showWeek&&e.unshift(this.$createElement("th")),this.$createElement("thead",this.genTR(e))},weekDaysBeforeFirstDayOfTheMonth(){const e=new Date(`${this.displayedYear}-${Ci(this.displayedMonth+1)}-01T00:00:00+00:00`),t=e.getUTCDay();return(t-parseInt(this.firstDayOfWeek)+7)%7},getWeekNumber(e){return Ji(this.displayedYear,this.displayedMonth,e,parseInt(this.firstDayOfWeek),parseInt(this.localeFirstDayOfYear))},genWeekNumber(e){return this.$createElement("td",[this.$createElement("small",{staticClass:"v-date-picker-table--date__week"},String(e).padStart(2,"0"))])},genTBody(){const e=[],t=new Date(this.displayedYear,this.displayedMonth+1,0).getDate();let r=[],i=this.weekDaysBeforeFirstDayOfTheMonth();this.showWeek&&r.push(this.genWeekNumber(this.getWeekNumber(1)));const n=this.displayedMonth?this.displayedYear:this.displayedYear-1,s=(this.displayedMonth+11)%12,o=new Date(this.displayedYear,this.displayedMonth,0).getDate(),a=this.showWeek?8:7;while(i--){const e=`${n}-${Ci(s+1)}-${Ci(o-i)}`;r.push(this.$createElement("td",this.showAdjacentMonths?[this.genButton(e,!0,"date",this.formatter,!0)]:[]))}for(i=1;i<=t;i++){const n=`${this.displayedYear}-${Ci(this.displayedMonth+1)}-${Ci(i)}`;r.push(this.$createElement("td",[this.genButton(n,!0,"date",this.formatter)])),r.length%a===0&&(e.push(this.genTR(r)),r=[],this.showWeek&&(i{const n=i*t.length+r,s=`${this.displayedYear}-${Ci(n+1)}`;return this.$createElement("td",{key:n},[this.genButton(s,!1,"month",this.formatter)])}));e.push(this.$createElement("tr",{key:i},r))}return this.$createElement("tbody",e)}},render(){return this.genTable("v-date-picker-table v-date-picker-table--month",[this.genTBody()],this.calculateTableDate)}}),tn=(0,_r.A)(xi.A,Ei).extend({name:"v-date-picker-years",props:{format:Function,min:[Number,String],max:[Number,String],readonly:Boolean,value:[Number,String]},data(){return{defaultColor:"primary"}},computed:{formatter(){return this.format||Oi(this.currentLocale,{year:"numeric",timeZone:"UTC"},{length:4})}},mounted(){setTimeout((()=>{const e=this.$el.getElementsByClassName("active")[0];e?this.$el.scrollTop=e.offsetTop-this.$el.offsetHeight/2+e.offsetHeight/2:this.min&&!this.max?this.$el.scrollTop=this.$el.scrollHeight:!this.min&&this.max?this.$el.scrollTop=0:this.$el.scrollTop=this.$el.scrollHeight/2-this.$el.offsetHeight/2}))},methods:{genYearItem(e){const t=this.formatter(`${e}`),r=parseInt(this.value,10)===e,i=r&&(this.color||"primary");return this.$createElement("li",this.setTextColor(i,{key:e,class:{active:r},on:(0,lr.wf)({click:()=>this.$emit("input",e)},Vi(this,":year",e))}),t)},genYearItems(){const e=[],t=this.value?parseInt(this.value,10):(new Date).getFullYear(),r=this.max?parseInt(this.max,10):t+100,i=Math.min(r,this.min?parseInt(this.min,10):t-100);for(let n=r;n>=i;n--)e.push(this.genYearItem(n));return e}},render(){return this.$createElement("ul",{staticClass:"v-date-picker-years",ref:"years"},this.genYearItems())}}),rn=(r(31726),(0,_r.A)(xi.A,bi.A,pi.A).extend({name:"v-picker",props:{flat:Boolean,fullWidth:Boolean,landscape:Boolean,noTitle:Boolean,transition:{type:String,default:"fade-transition"},width:{type:[Number,String],default:290}},computed:{computedTitleColor(){const e=!this.isDark&&(this.color||"primary");return this.color||e}},methods:{genTitle(){return this.$createElement("div",this.setBackgroundColor(this.computedTitleColor,{staticClass:"v-picker__title",class:{"v-picker__title--landscape":this.landscape}}),(0,ur.$c)(this,"title"))},genBodyTransition(){return this.$createElement("transition",{props:{name:this.transition}},(0,ur.$c)(this))},genBody(){return this.$createElement("div",{staticClass:"v-picker__body",class:{"v-picker__body--no-title":this.noTitle,...this.themeClasses},style:this.fullWidth?void 0:{width:(0,ur.Dg)(this.width)}},[this.genBodyTransition()])},genActions(){return this.$createElement("div",{staticClass:"v-picker__actions v-card__actions",class:{"v-picker__actions--no-title":this.noTitle}},(0,ur.$c)(this,"actions"))}},render(e){return e("div",{staticClass:"v-picker v-card",class:{"v-picker--flat":this.flat,"v-picker--landscape":this.landscape,"v-picker--full-width":this.fullWidth,...this.themeClasses,...this.elevationClasses}},[this.$slots.title?this.genTitle():null,this.genBody(),this.$slots.actions?this.genActions():null])}})),nn=rn,sn=(0,_r.A)(xi.A,bi.A,pi.A).extend({name:"picker",props:{flat:Boolean,fullWidth:Boolean,headerColor:String,landscape:Boolean,noTitle:Boolean,width:{type:[Number,String],default:290}},methods:{genPickerTitle(){return null},genPickerBody(){return null},genPickerActionsSlot(){return this.$scopedSlots.default?this.$scopedSlots.default({save:this.save,cancel:this.cancel}):(0,ur.$c)(this)},genPicker(e){const t=[];if(!this.noTitle){const e=this.genPickerTitle();e&&t.push(e)}const r=this.genPickerBody();return r&&t.push(r),t.push(this.$createElement("template",{slot:"actions"},[this.genPickerActionsSlot()])),this.$createElement(nn,{staticClass:e,props:{color:this.headerColor||this.color,dark:this.dark,elevation:this.elevation,flat:this.flat,fullWidth:this.fullWidth,landscape:this.landscape,light:this.light,width:this.width,noTitle:this.noTitle}},t)}}});const on=[0,31,28,31,30,31,30,31,31,30,31,30,31],an=[0,31,29,31,30,31,30,31,31,30,31,30,31];function ln(e,t){return Xi(e)?an[t]:on[t]}var un=(0,_r.A)(Ei,sn).extend({name:"v-date-picker",props:{activePicker:String,allowedDates:Function,dayFormat:Function,disabled:Boolean,events:{type:[Array,Function,Object],default:()=>null},eventColor:{type:[Array,Function,Object,String],default:()=>"warning"},firstDayOfWeek:{type:[String,Number],default:0},headerDateFormat:Function,localeFirstDayOfYear:{type:[String,Number],default:0},max:String,min:String,monthFormat:Function,multiple:Boolean,nextIcon:{type:String,default:"$next"},nextMonthAriaLabel:{type:String,default:"$vuetify.datePicker.nextMonthAriaLabel"},nextYearAriaLabel:{type:String,default:"$vuetify.datePicker.nextYearAriaLabel"},pickerDate:String,prevIcon:{type:String,default:"$prev"},prevMonthAriaLabel:{type:String,default:"$vuetify.datePicker.prevMonthAriaLabel"},prevYearAriaLabel:{type:String,default:"$vuetify.datePicker.prevYearAriaLabel"},range:Boolean,reactive:Boolean,readonly:Boolean,scrollable:Boolean,showCurrent:{type:[Boolean,String],default:!0},selectedItemsText:{type:String,default:"$vuetify.datePicker.itemsSelected"},showAdjacentMonths:Boolean,showWeek:Boolean,titleDateFormat:Function,type:{type:String,default:"date",validator:e=>["date","month"].includes(e)},value:[Array,String],weekdayFormat:Function,yearFormat:Function,yearIcon:String},data(){const e=new Date;return{internalActivePicker:this.type.toUpperCase(),inputDay:null,inputMonth:null,inputYear:null,isReversing:!1,now:e,tableDate:(()=>{if(this.pickerDate)return this.pickerDate;const t=(0,ur.BN)(this.value),r=t[t.length-1]||("string"===typeof this.showCurrent?this.showCurrent:`${e.getFullYear()}-${e.getMonth()+1}`);return Ui(r,"date"===this.type?"month":"year")})()}},computed:{multipleValue(){return(0,ur.BN)(this.value)},isMultiple(){return this.multiple||this.range},lastValue(){return this.isMultiple?this.multipleValue[this.multipleValue.length-1]:this.value},selectedMonths(){return this.value&&"month"!==this.type?this.isMultiple?this.multipleValue.map((e=>e.substr(0,7))):this.value.substr(0,7):this.value},current(){return!0===this.showCurrent?Ui(`${this.now.getFullYear()}-${this.now.getMonth()+1}-${this.now.getDate()}`,this.type):this.showCurrent||null},inputDate(){return"date"===this.type?`${this.inputYear}-${Ci(this.inputMonth+1)}-${Ci(this.inputDay)}`:`${this.inputYear}-${Ci(this.inputMonth+1)}`},tableMonth(){return Number((this.pickerDate||this.tableDate).split("-")[1])-1},tableYear(){return Number((this.pickerDate||this.tableDate).split("-")[0])},minMonth(){return this.min?Ui(this.min,"month"):null},maxMonth(){return this.max?Ui(this.max,"month"):null},minYear(){return this.min?Ui(this.min,"year"):null},maxYear(){return this.max?Ui(this.max,"year"):null},formatters(){return{year:this.yearFormat||Oi(this.currentLocale,{year:"numeric",timeZone:"UTC"},{length:4}),titleDate:this.titleDateFormat||(this.isMultiple?this.defaultTitleMultipleDateFormatter:this.defaultTitleDateFormatter)}},defaultTitleMultipleDateFormatter(){return e=>e.length?1===e.length?this.defaultTitleDateFormatter(e[0]):this.$vuetify.lang.t(this.selectedItemsText,e.length):"-"},defaultTitleDateFormatter(){const e={year:{year:"numeric",timeZone:"UTC"},month:{month:"long",timeZone:"UTC"},date:{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}},t=Oi(this.currentLocale,e[this.type],{start:0,length:{date:10,month:7,year:4}[this.type]}),r=e=>t(e).replace(/([^\d\s])([\d])/g,((e,t,r)=>`${t} ${r}`)).replace(", ",",
");return this.landscape?r:t}},watch:{internalActivePicker:{immediate:!0,handler(e){this.$emit("update:active-picker",e)}},activePicker(e){this.internalActivePicker=e},tableDate(e,t){const r="month"===this.type?"year":"month";this.isReversing=Ui(e,r)Ui(t,e))).filter(this.isDateAllowed);this.$emit("input",this.isMultiple?t:t[0])}}},created(){this.checkMultipleProp(),this.pickerDate!==this.tableDate&&this.$emit("update:picker-date",this.tableDate),this.setInputDate()},methods:{emitInput(e){if(this.range){if(1!==this.multipleValue.length)this.$emit("input",[e]);else{const t=[this.multipleValue[0],e];this.$emit("input",t),this.$emit("change",t)}return}const t=this.multiple?-1===this.multipleValue.indexOf(e)?this.multipleValue.concat([e]):this.multipleValue.filter((t=>t!==e)):e;this.$emit("input",t),this.multiple||this.$emit("change",e)},checkMultipleProp(){if(null==this.value)return;const e=this.value.constructor.name,t=this.isMultiple?"Array":"String";e!==t&&(0,$r.OP)(`Value must be ${this.isMultiple?"an":"a"} ${t}, got ${e}`,this)},isDateAllowed(e){return Hi(e,this.min,this.max,this.allowedDates)},yearClick(e){this.inputYear=e,"month"===this.type?this.tableDate=`${e}`:this.tableDate=`${e}-${Ci((this.tableMonth||0)+1)}`,this.internalActivePicker="MONTH",this.reactive&&!this.readonly&&!this.isMultiple&&this.isDateAllowed(this.inputDate)&&this.$emit("input",this.inputDate)},monthClick(e){const[t,r]=e.split("-");this.inputYear=parseInt(t,10),this.inputMonth=parseInt(r,10)-1,"date"===this.type?(this.inputDay&&(this.inputDay=Math.min(this.inputDay,ln(this.inputYear,this.inputMonth+1))),this.tableDate=e,this.internalActivePicker="DATE",this.reactive&&!this.readonly&&!this.isMultiple&&this.isDateAllowed(this.inputDate)&&this.$emit("input",this.inputDate)):this.emitInput(this.inputDate)},dateClick(e){const[t,r,i]=e.split("-");this.inputYear=parseInt(t,10),this.inputMonth=parseInt(r,10)-1,this.inputDay=parseInt(i,10),this.emitInput(this.inputDate)},genPickerTitle(){return this.$createElement(Mi,{props:{date:this.value?this.formatters.titleDate(this.isMultiple?this.multipleValue:this.value):"",disabled:this.disabled,readonly:this.readonly,selectingYear:"YEAR"===this.internalActivePicker,year:this.formatters.year(this.multipleValue.length?`${this.inputYear}`:this.tableDate),yearIcon:this.yearIcon,value:this.multipleValue[0]},slot:"title",on:{"update:selecting-year":e=>this.internalActivePicker=e?"YEAR":this.type.toUpperCase()}})},genTableHeader(){return this.$createElement(Ti,{props:{nextIcon:this.nextIcon,color:this.color,dark:this.dark,disabled:this.disabled,format:this.headerDateFormat,light:this.light,locale:this.locale,min:"DATE"===this.internalActivePicker?this.minMonth:this.minYear,max:"DATE"===this.internalActivePicker?this.maxMonth:this.maxYear,nextAriaLabel:"DATE"===this.internalActivePicker?this.nextMonthAriaLabel:this.nextYearAriaLabel,prevAriaLabel:"DATE"===this.internalActivePicker?this.prevMonthAriaLabel:this.prevYearAriaLabel,prevIcon:this.prevIcon,readonly:this.readonly,value:"DATE"===this.internalActivePicker?`${Ci(this.tableYear,4)}-${Ci(this.tableMonth+1)}`:`${Ci(this.tableYear,4)}`},on:{toggle:()=>this.internalActivePicker="DATE"===this.internalActivePicker?"MONTH":"YEAR",input:e=>this.tableDate=e}})},genDateTable(){return this.$createElement(Qi,{props:{allowedDates:this.allowedDates,color:this.color,current:this.current,dark:this.dark,disabled:this.disabled,events:this.events,eventColor:this.eventColor,firstDayOfWeek:this.firstDayOfWeek,format:this.dayFormat,light:this.light,locale:this.locale,localeFirstDayOfYear:this.localeFirstDayOfYear,min:this.min,max:this.max,range:this.range,readonly:this.readonly,scrollable:this.scrollable,showAdjacentMonths:this.showAdjacentMonths,showWeek:this.showWeek,tableDate:`${Ci(this.tableYear,4)}-${Ci(this.tableMonth+1)}`,value:this.value,weekdayFormat:this.weekdayFormat},ref:"table",on:{input:this.dateClick,"update:table-date":e=>this.tableDate=e,...qi(this,":date")}})},genMonthTable(){return this.$createElement(en,{props:{allowedDates:"month"===this.type?this.allowedDates:null,color:this.color,current:this.current?Ui(this.current,"month"):null,dark:this.dark,disabled:this.disabled,events:"month"===this.type?this.events:null,eventColor:"month"===this.type?this.eventColor:null,format:this.monthFormat,light:this.light,locale:this.locale,min:this.minMonth,max:this.maxMonth,range:this.range,readonly:this.readonly&&"month"===this.type,scrollable:this.scrollable,value:this.selectedMonths,tableDate:`${Ci(this.tableYear,4)}`},ref:"table",on:{input:this.monthClick,"update:table-date":e=>this.tableDate=e,...qi(this,":month")}})},genYears(){return this.$createElement(tn,{props:{color:this.color,format:this.yearFormat,locale:this.locale,min:this.minYear,max:this.maxYear,value:this.tableYear},on:{input:this.yearClick,...qi(this,":year")}})},genPickerBody(){const e="YEAR"===this.internalActivePicker?[this.genYears()]:[this.genTableHeader(),"DATE"===this.internalActivePicker?this.genDateTable():this.genMonthTable()];return this.$createElement("div",{key:this.internalActivePicker},e)},setInputDate(){if(this.lastValue){const e=this.lastValue.split("-");this.inputYear=parseInt(e[0],10),this.inputMonth=parseInt(e[1],10)-1,"date"===this.type&&(this.inputDay=parseInt(e[2],10))}else this.inputYear=this.inputYear||this.now.getFullYear(),this.inputMonth=null==this.inputMonth?this.inputMonth:this.now.getMonth(),this.inputDay=this.inputDay||this.now.getDate()}},render(){return this.genPicker("v-picker--date")}}),cn=r(44596),hn=r(5030),dn=r(32031),fn=r(67631),pn=r(30428),mn=(0,_r.A)(xi.A,pi.A,pn.A).extend({name:"v-overlay",props:{absolute:Boolean,color:{type:String,default:"#212121"},dark:{type:Boolean,default:!0},opacity:{type:[Number,String],default:.46},value:{default:!0},zIndex:{type:[Number,String],default:5}},computed:{__scrim(){const e=this.setBackgroundColor(this.color,{staticClass:"v-overlay__scrim",style:{opacity:this.computedOpacity}});return this.$createElement("div",e)},classes(){return{"v-overlay--absolute":this.absolute,"v-overlay--active":this.isActive,...this.themeClasses}},computedOpacity(){return Number(this.isActive?this.opacity:0)},styles(){return{zIndex:this.zIndex}}},methods:{genContent(){return this.$createElement("div",{staticClass:"v-overlay__content"},(0,ur.$c)(this))}},render(e){const t=[this.__scrim];return this.isActive&&t.push(this.genContent()),e("div",{staticClass:"v-overlay",on:this.$listeners,class:this.classes,style:this.styles},t)}}),gn=mn,vn=yr.Ay.extend().extend({name:"overlayable",props:{hideOverlay:Boolean,overlayColor:String,overlayOpacity:[Number,String]},data(){return{animationFrame:0,overlay:null}},watch:{hideOverlay(e){this.isActive&&(e?this.removeOverlay():this.genOverlay())}},beforeDestroy(){this.removeOverlay()},methods:{createOverlay(){const e=new gn({propsData:{absolute:this.absolute,value:!1,color:this.overlayColor,opacity:this.overlayOpacity}});e.$mount();const t=this.absolute?this.$el.parentNode:document.querySelector("[data-app]");t&&t.insertBefore(e.$el,t.firstChild),this.overlay=e},genOverlay(){if(this.hideScroll(),!this.hideOverlay)return this.overlay||this.createOverlay(),this.animationFrame=requestAnimationFrame((()=>{this.overlay&&(void 0!==this.activeZIndex?this.overlay.zIndex=String(this.activeZIndex-1):this.$el&&(this.overlay.zIndex=(0,ur.fl)(this.$el)),this.overlay.value=!0)})),!0},removeOverlay(e=!0){this.overlay&&((0,ur.d7)(this.overlay.$el,"transitionend",(()=>{this.overlay&&this.overlay.$el&&this.overlay.$el.parentNode&&!this.overlay.value&&!this.isActive&&(this.overlay.$el.parentNode.removeChild(this.overlay.$el),this.overlay.$destroy(),this.overlay=null)})),cancelAnimationFrame(this.animationFrame),this.overlay.value=!1),e&&this.showScroll()},scrollListener(e){if("key"in e){if(["INPUT","TEXTAREA","SELECT"].includes(e.target.tagName)||e.target.isContentEditable)return;const t=[ur.uP.up,ur.uP.pageup],r=[ur.uP.down,ur.uP.pagedown];if(t.includes(e.keyCode))e.deltaY=-1;else{if(!r.includes(e.keyCode))return;e.deltaY=1}}(e.target===this.overlay||"keydown"!==e.type&&e.target===document.body||this.checkPath(e))&&e.preventDefault()},hasScrollbar(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(e);return(["auto","scroll"].includes(t.overflowY)||"SELECT"===e.tagName)&&e.scrollHeight>e.clientHeight||["auto","scroll"].includes(t.overflowX)&&e.scrollWidth>e.clientWidth},shouldScroll(e,t){if(e.hasAttribute("data-app"))return!1;const r=t.shiftKey||t.deltaX?"x":"y",i="y"===r?t.deltaY:t.deltaX||t.deltaY;let n,s;"y"===r?(n=0===e.scrollTop,s=e.scrollTop+e.clientHeight===e.scrollHeight):(n=0===e.scrollLeft,s=e.scrollLeft+e.clientWidth===e.scrollWidth);const o=i<0,a=i>0;return!(n||!o)||(!(s||!a)||!(!n&&!s||!e.parentNode)&&this.shouldScroll(e.parentNode,t))},isInside(e,t){return e===t||null!==e&&e!==document.body&&this.isInside(e.parentNode,t)},checkPath(e){const t=(0,ur.K9)(e);if("keydown"===e.type&&t[0]===document.body){const t=this.$refs.dialog,r=window.getSelection().anchorNode;return!(t&&this.hasScrollbar(t)&&this.isInside(r,t))||!this.shouldScroll(t,e)}for(let r=0;r{this.isBooted=this.isActive,this.isActive&&this.show()}))},beforeDestroy(){"undefined"!==typeof window&&this.unbind()},methods:{animateClick(){this.animate=!1,this.$nextTick((()=>{this.animate=!0,window.clearTimeout(this.animateTimeout),this.animateTimeout=window.setTimeout((()=>this.animate=!1),150)}))},closeConditional(e){const t=e.target;return!(this._isDestroyed||!this.isActive||this.$refs.content.contains(t)||this.overlay&&t&&!this.overlay.$el.contains(t))&&this.activeZIndex>=this.getMaxZIndex()},hideScroll(){this.fullscreen?document.documentElement.classList.add("overflow-y-hidden"):vn.options.methods.hideScroll.call(this)},show(){!this.fullscreen&&!this.hideOverlay&&this.genOverlay(),this.$nextTick((()=>{this.$nextTick((()=>{var e,t;(null===(e=this.$refs.dialog)||void 0===e?void 0:e.contains(document.activeElement))||(this.previousActiveElement=document.activeElement,null===(t=this.$refs.dialog)||void 0===t||t.focus()),this.bind()}))}))},bind(){window.addEventListener("focusin",this.onFocusin)},unbind(){window.removeEventListener("focusin",this.onFocusin)},onClickOutside(e){this.$emit("click:outside",e),this.persistent?this.noClickAnimation||this.animateClick():this.isActive=!1},onKeydown(e){if(e.keyCode===ur.uP.esc&&!this.getOpenDependents().length)if(this.persistent)this.noClickAnimation||this.animateClick();else{this.isActive=!1;const e=this.getActivator();this.$nextTick((()=>e&&e.focus()))}this.$emit("keydown",e)},onFocusin(e){if(!e||!this.retainFocus)return;const t=e.target;if(t&&this.$refs.dialog&&![document,this.$refs.dialog].includes(t)&&!this.$refs.dialog.contains(t)&&this.activeZIndex>=this.getMaxZIndex()&&!this.getOpenDependentElements().some((e=>e.contains(t)))){const e=this.$refs.dialog.querySelectorAll('button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])'),t=[...e].find((e=>!e.hasAttribute("disabled")&&!e.matches('[tabindex="-1"]')));t&&t.focus()}},genContent(){return this.showLazyContent((()=>[this.$createElement(cn.A,{props:{root:!0,light:this.light,dark:this.dark}},[this.$createElement("div",{class:this.contentClasses,attrs:{role:"dialog","aria-modal":this.hideOverlay?void 0:"true",...this.getScopeIdAttrs()},on:{keydown:this.onKeydown},style:{zIndex:this.activeZIndex},ref:"content"},[this.genTransition()])])]))},genTransition(){const e=this.genInnerContent();return this.transition?this.$createElement("transition",{props:{name:this.transition,origin:this.origin,appear:!0}},[e]):e},genInnerContent(){const e={class:this.classes,attrs:{tabindex:this.isActive?0:void 0},ref:"dialog",directives:[{name:"click-outside",value:{handler:this.onClickOutside,closeConditional:this.closeConditional,include:this.getOpenDependentElements}},{name:"show",value:this.isActive}],style:{transformOrigin:this.origin}};return this.fullscreen||(e.style={...e.style,maxWidth:(0,ur.Dg)(this.maxWidth),width:(0,ur.Dg)(this.width)}),this.$createElement("div",e,this.getContentSlot())}},render(e){return e("div",{staticClass:"v-dialog__container",class:{"v-dialog__container--attached":""===this.attach||!0===this.attach||"attach"===this.attach}},[this.genActivator(),this.genContent()])}}),kn=r(40175),xn=r(51878),Sn=xn.C.extend({name:"v-expansion-panels",provide(){return{expansionPanels:this}},props:{accordion:Boolean,disabled:Boolean,flat:Boolean,hover:Boolean,focusable:Boolean,inset:Boolean,popout:Boolean,readonly:Boolean,tile:Boolean},computed:{classes(){return{...xn.C.options.computed.classes.call(this),"v-expansion-panels":!0,"v-expansion-panels--accordion":this.accordion,"v-expansion-panels--flat":this.flat,"v-expansion-panels--hover":this.hover,"v-expansion-panels--focusable":this.focusable,"v-expansion-panels--inset":this.inset,"v-expansion-panels--popout":this.popout,"v-expansion-panels--tile":this.tile}}},created(){this.$attrs.hasOwnProperty("expand")&&(0,$r.q4)("expand","multiple",this),Array.isArray(this.value)&&this.value.length>0&&"boolean"===typeof this.value[0]&&(0,$r.q4)(':value="[true, false, true]"',':value="[0, 2]"',this)},methods:{updateItem(e,t){const r=this.getValue(e,t),i=this.getValue(e,t+1);e.isActive=this.toggleMethod(r),e.nextIsActive=this.toggleMethod(i)}}}),Mn=r(37515),En=r(87540),An=(0,_r.A)((0,Mn.P)("expansionPanels","v-expansion-panel","v-expansion-panels"),(0,En.G)("expansionPanel",!0)).extend({name:"v-expansion-panel",props:{disabled:Boolean,readonly:Boolean},data(){return{content:null,header:null,nextIsActive:!1}},computed:{classes(){return{"v-expansion-panel--active":this.isActive,"v-expansion-panel--next-active":this.nextIsActive,"v-expansion-panel--disabled":this.isDisabled,...this.groupClasses}},isDisabled(){return this.expansionPanels.disabled||this.disabled},isReadonly(){return this.expansionPanels.readonly||this.readonly}},methods:{registerContent(e){this.content=e},unregisterContent(){this.content=null},registerHeader(e){this.header=e,e.$on("click",this.onClick)},unregisterHeader(){this.header=null},onClick(e){e.detail&&this.header.$el.blur(),this.$emit("click",e),this.isReadonly||this.isDisabled||this.toggle()},toggle(){this.$nextTick((()=>this.$emit("change")))}},render(e){return e("div",{staticClass:"v-expansion-panel",class:this.classes,attrs:{"aria-expanded":String(this.isActive)}},(0,ur.$c)(this))}});const Cn=(0,_r.A)(xi.A,(0,En.W)("expansionPanel","v-expansion-panel-header","v-expansion-panel"));var $n=Cn.extend().extend({name:"v-expansion-panel-header",directives:{ripple:vr.A},props:{disableIconRotate:Boolean,expandIcon:{type:String,default:"$expand"},hideActions:Boolean,ripple:{type:[Boolean,Object],default:!1}},data:()=>({hasMousedown:!1}),computed:{classes(){return{"v-expansion-panel-header--active":this.isActive,"v-expansion-panel-header--mousedown":this.hasMousedown}},isActive(){return this.expansionPanel.isActive},isDisabled(){return this.expansionPanel.isDisabled},isReadonly(){return this.expansionPanel.isReadonly}},created(){this.expansionPanel.registerHeader(this)},beforeDestroy(){this.expansionPanel.unregisterHeader()},methods:{onClick(e){this.$emit("click",e)},genIcon(){const e=(0,ur.$c)(this,"actions",{open:this.isActive})||[this.$createElement(mr.A,this.expandIcon)];return this.$createElement(Ar.mM,[this.$createElement("div",{staticClass:"v-expansion-panel-header__icon",class:{"v-expansion-panel-header__icon--disable-rotate":this.disableIconRotate},directives:[{name:"show",value:!this.isDisabled}]},e)])}},render(e){return e("button",this.setBackgroundColor(this.color,{staticClass:"v-expansion-panel-header",class:this.classes,attrs:{tabindex:this.isDisabled?-1:null,type:"button","aria-expanded":this.isActive},directives:[{name:"ripple",value:this.ripple}],on:{...this.$listeners,click:this.onClick,mousedown:()=>this.hasMousedown=!0,mouseup:()=>this.hasMousedown=!1}}),[(0,ur.$c)(this,"default",{open:this.isActive},!0),this.hideActions||this.genIcon()])}}),On=r(80072);const Pn=(0,_r.A)(On.A,xi.A,(0,En.W)("expansionPanel","v-expansion-panel-content","v-expansion-panel"));var Tn=Pn.extend().extend({name:"v-expansion-panel-content",data:()=>({isActive:!1}),computed:{parentIsActive(){return this.expansionPanel.isActive}},watch:{parentIsActive:{immediate:!0,handler(e,t){e&&(this.isBooted=!0),null==t?this.isActive=e:this.$nextTick((()=>this.isActive=e))}}},created(){this.expansionPanel.registerContent(this)},beforeDestroy(){this.expansionPanel.unregisterContent()},render(e){return e(Ar.Qo,this.showLazyContent((()=>[e("div",this.setBackgroundColor(this.color,{staticClass:"v-expansion-panel-content",directives:[{name:"show",value:this.isActive}]}),[e("div",{class:"v-expansion-panel-content__wrap"},(0,ur.$c)(this,"default",{open:this.isActive}))])])))}}),In=r(54414),Dn=ar.A,Ln=Dn.extend({name:"v-file-input",model:{prop:"value",event:"change"},props:{chips:Boolean,clearable:{type:Boolean,default:!0},counterSizeString:{type:String,default:"$vuetify.fileInput.counterSize"},counterString:{type:String,default:"$vuetify.fileInput.counter"},hideInput:Boolean,multiple:Boolean,placeholder:String,prependIcon:{type:String,default:"$file"},readonly:{type:Boolean,default:!1},showSize:{type:[Boolean,Number],default:!1,validator:e=>"boolean"===typeof e||[1e3,1024].includes(e)},smallChips:Boolean,truncateLength:{type:[Number,String],default:22},type:{type:String,default:"file"},value:{default:void 0,validator:e=>(0,ur.BN)(e).every((e=>null!=e&&"object"===typeof e))}},computed:{classes(){return{...Dn.options.computed.classes.call(this),"v-file-input":!0}},computedCounterValue(){const e=this.multiple&&this.lazyValue?this.lazyValue.length:this.lazyValue instanceof File?1:0;if(!this.showSize)return this.$vuetify.lang.t(this.counterString,e);const t=this.internalArrayValue.reduce(((e,{size:t=0})=>e+t),0);return this.$vuetify.lang.t(this.counterSizeString,e,(0,ur.hA)(t,1024===this.base))},internalArrayValue(){return(0,ur.BN)(this.internalValue)},internalValue:{get(){return this.lazyValue},set(e){this.lazyValue=e,this.$emit("change",this.lazyValue)}},isDirty(){return this.internalArrayValue.length>0},isLabelActive(){return this.isDirty},text(){return this.isDirty||!this.persistentPlaceholder&&!this.isFocused&&this.hasLabel?this.internalArrayValue.map((e=>{const{name:t="",size:r=0}=e,i=this.truncateText(t);return this.showSize?`${i} (${(0,ur.hA)(r,1024===this.base)})`:i})):[this.placeholder]},base(){return"boolean"!==typeof this.showSize?this.showSize:void 0},hasChips(){return this.chips||this.smallChips}},watch:{readonly:{handler(e){!0===e&&(0,$r.yA)("readonly is not supported on ",this)},immediate:!0},value(e){const t=this.multiple?e:e?[e]:[];(0,ur.bD)(t,this.$refs.input.files)||(this.$refs.input.value="")}},methods:{clearableCallback(){this.internalValue=this.multiple?[]:null,this.$refs.input.value=""},genChips(){return this.isDirty?this.text.map(((e,t)=>this.$createElement(Mr.A,{props:{small:this.smallChips},on:{"click:close":()=>{const e=this.internalValue;e.splice(t,1),this.internalValue=e}}},[e]))):[]},genControl(){const e=Dn.options.methods.genControl.call(this);return this.hideInput&&(e.data.style=(0,lr.Zq)(e.data.style,{display:"none"})),e},genInput(){const e=Dn.options.methods.genInput.call(this);return e.data.attrs.multiple=this.multiple,delete e.data.domProps.value,delete e.data.on.input,e.data.on.change=this.onInput,[this.genSelections(),e]},genPrependSlot(){if(!this.prependIcon)return null;const e=this.genIcon("prepend",(()=>{this.$refs.input.click()}));return this.genSlot("prepend","outer",[e])},genSelectionText(){const e=this.text.length;return e<2?this.text:this.showSize&&!this.counter?[this.computedCounterValue]:[this.$vuetify.lang.t(this.counterString,e)]},genSelections(){const e=[];return this.isDirty&&this.$scopedSlots.selection?this.internalArrayValue.forEach(((t,r)=>{this.$scopedSlots.selection&&e.push(this.$scopedSlots.selection({text:this.text[r],file:t,index:r}))})):e.push(this.hasChips&&this.isDirty?this.genChips():this.genSelectionText()),this.$createElement("div",{staticClass:"v-file-input__text",class:{"v-file-input__text--placeholder":this.placeholder&&!this.isDirty,"v-file-input__text--chips":this.hasChips&&!this.$scopedSlots.selection}},e)},genTextFieldSlot(){const e=Dn.options.methods.genTextFieldSlot.call(this);return e.data.on={...e.data.on||{},click:e=>{e.target&&"LABEL"===e.target.nodeName||this.$refs.input.click()}},e},onInput(e){const t=[...e.target.files||[]];this.internalValue=this.multiple?t:t[0],this.initialValue=this.internalValue},onKeyDown(e){this.$emit("keydown",e)},truncateText(e){if(e.length({isFocused:!1}),computed:{classes(){return{"v-radio--is-disabled":this.isDisabled,"v-radio--is-focused":this.isFocused,...this.themeClasses,...this.groupClasses}},computedColor(){if(!this.isDisabled)return xr.options.computed.computedColor.call(this)},computedIcon(){return this.isActive?this.onIcon:this.offIcon},computedId(){return gr.A.options.computed.computedId.call(this)},hasLabel:gr.A.options.computed.hasLabel,hasState(){return(this.radioGroup||{}).hasState},isDisabled(){var e;return null!==(e=this.disabled)&&void 0!==e?e:!!this.radioGroup&&this.radioGroup.isDisabled},isReadonly(){var e;return null!==(e=this.readonly)&&void 0!==e?e:!!this.radioGroup&&this.radioGroup.isReadonly},computedName(){return this.name||!this.radioGroup?this.name:this.radioGroup.name||`radio-${this.radioGroup._uid}`},rippleState(){return xr.options.computed.rippleState.call(this)},validationState(){return(this.radioGroup||{}).validationState||this.computedColor}},methods:{genInput(e){return xr.options.methods.genInput.call(this,"radio",e)},genLabel(){return this.hasLabel?this.$createElement(Hn.A,{on:{click:kr},attrs:{for:this.computedId},props:{color:this.validationState,focused:this.hasState}},(0,ur.$c)(this,"label")||this.label):null},genRadio(){const{title:e,...t}=this.attrs$;return this.$createElement("div",{staticClass:"v-input--selection-controls__input"},[this.$createElement(mr.A,this.setTextColor(this.validationState,{props:{dense:this.radioGroup&&this.radioGroup.dense}}),this.computedIcon),this.genInput({name:this.computedName,value:this.value,...t}),this.genRipple(this.setTextColor(this.rippleState))])},onFocus(e){this.isFocused=!0,this.$emit("focus",e)},onBlur(e){this.isFocused=!1,this.$emit("blur",e)},onChange(){this.isDisabled||this.isReadonly||this.isActive||this.toggle()},onKeydown:()=>{}},render(e){const t={staticClass:"v-radio",class:this.classes,on:(0,lr.wf)({click:this.onChange},this.listeners$),attrs:{title:this.attrs$.title}};return e("div",t,[this.genRadio(),this.genLabel()])}});const Gn=(0,_r.A)(xn.C,gr.A);var Zn=Gn.extend({name:"v-radio-group",provide(){return{radioGroup:this}},props:{column:{type:Boolean,default:!0},height:{type:[Number,String],default:"auto"},name:String,row:Boolean,value:null},computed:{classes(){return{...gr.A.options.computed.classes.call(this),"v-input--selection-controls v-input--radio-group":!0,"v-input--radio-group--column":this.column&&!this.row,"v-input--radio-group--row":this.row}}},methods:{genDefaultSlot(){return this.$createElement("div",{staticClass:"v-input--radio-group__input",attrs:{id:this.id,role:"radiogroup","aria-labelledby":this.computedId}},gr.A.options.methods.genDefaultSlot.call(this))},genInputSlot(){const e=gr.A.options.methods.genInputSlot.call(this);return delete e.data.on.click,e},genLabel(){const e=gr.A.options.methods.genLabel.call(this);return e?(e.data.attrs.id=this.computedId,delete e.data.attrs.for,e.tag="legend",e):null},onClick:xn.C.options.methods.onClick},render(e){const t=gr.A.options.render.call(this,e);return this._b(t.data,"div",this.attrs$),t}}),Jn=(r(58097),(0,ur.Gn)("spacer","div","v-spacer")),Xn=r(9375),Qn=r(24632);const es=(0,_r.A)(Xn.A,(0,En.G)("stepper"),Qn.A);var ts=es.extend({name:"v-stepper",provide(){return{stepClick:this.stepClick,isVertical:this.vertical}},props:{altLabels:Boolean,nonLinear:Boolean,flat:Boolean,vertical:Boolean},data(){const e={isBooted:!1,steps:[],content:[],isReverse:!1};return e.internalLazyValue=null!=this.value?this.value:(e[0]||{}).step||1,e},computed:{classes(){return{"v-stepper--flat":this.flat,"v-stepper--is-booted":this.isBooted,"v-stepper--vertical":this.vertical,"v-stepper--alt-labels":this.altLabels,"v-stepper--non-linear":this.nonLinear,...Xn.A.options.computed.classes.call(this)}},styles(){return{...Xn.A.options.computed.styles.call(this)}}},watch:{internalValue(e,t){this.isReverse=Number(e)t!==e)):"v-stepper-content"===e.$options.name&&(e.isVertical=this.vertical,this.content=this.content.filter((t=>t!==e)))},stepClick(e){this.$nextTick((()=>this.internalValue=e))},updateView(){for(let e=this.steps.length;--e>=0;)this.steps[e].toggle(this.internalValue);for(let e=this.content.length;--e>=0;)this.content[e].toggle(this.internalValue,this.isReverse)}},render(e){return e(this.tag,{staticClass:"v-stepper",class:this.classes,style:this.styles},(0,ur.$c)(this))}});const rs=(0,_r.A)((0,En.W)("stepper","v-stepper-content","v-stepper"));var is=rs.extend().extend({name:"v-stepper-content",inject:{isVerticalProvided:{from:"isVertical"}},props:{step:{type:[Number,String],required:!0}},data(){return{height:0,isActive:null,isReverse:!1,isVertical:this.isVerticalProvided}},computed:{computedTransition(){const e=this.$vuetify.rtl?!this.isReverse:this.isReverse;return e?Ar.P1:Ar.Dk},styles(){return this.isVertical?{height:(0,ur.Dg)(this.height)}:{}}},watch:{isActive(e,t){e&&null==t?this.height="auto":this.isVertical&&(this.isActive?this.enter():this.leave())}},mounted(){this.$refs.wrapper.addEventListener("transitionend",this.onTransition,!1),this.stepper&&this.stepper.register(this)},beforeDestroy(){this.$refs.wrapper.removeEventListener("transitionend",this.onTransition,!1),this.stepper&&this.stepper.unregister(this)},methods:{onTransition(e){this.isActive&&"height"===e.propertyName&&(this.height="auto")},enter(){let e=0;requestAnimationFrame((()=>{e=this.$refs.wrapper.scrollHeight})),this.height=0,setTimeout((()=>this.isActive&&(this.height=e||"auto")),450)},leave(){this.height=this.$refs.wrapper.clientHeight,setTimeout((()=>this.height=0),10)},toggle(e,t){this.isActive=e.toString()===this.step.toString(),this.isReverse=t}},render(e){const t={staticClass:"v-stepper__content"},r={staticClass:"v-stepper__wrapper",style:this.styles,ref:"wrapper"};this.isVertical||(t.directives=[{name:"show",value:this.isActive}]);const i=e("div",r,(0,ur.$c)(this)),n=e("div",t,[i]);return e(this.computedTransition,{on:this.$listeners},[n])}});const ns=(0,_r.A)(xi.A,(0,En.W)("stepper","v-stepper-step","v-stepper"));var ss=ns.extend().extend({name:"v-stepper-step",directives:{ripple:vr.A},inject:["stepClick"],props:{color:{type:String,default:"primary"},complete:Boolean,completeIcon:{type:String,default:"$complete"},editable:Boolean,editIcon:{type:String,default:"$edit"},errorIcon:{type:String,default:"$error"},rules:{type:Array,default:()=>[]},step:[Number,String]},data(){return{isActive:!1,isInactive:!0}},computed:{classes(){return{"v-stepper__step--active":this.isActive,"v-stepper__step--editable":this.editable,"v-stepper__step--inactive":this.isInactive,"v-stepper__step--error error--text":this.hasError,"v-stepper__step--complete":this.complete}},hasError(){return this.rules.some((e=>!0!==e()))}},mounted(){this.stepper&&this.stepper.register(this)},beforeDestroy(){this.stepper&&this.stepper.unregister(this)},methods:{click(e){e.stopPropagation(),this.$emit("click",e),this.editable&&this.stepClick(this.step)},genIcon(e){return this.$createElement(mr.A,e)},genLabel(){return this.$createElement("div",{staticClass:"v-stepper__label"},(0,ur.$c)(this))},genStep(){const e=!(this.hasError||!this.complete&&!this.isActive)&&this.color;return this.$createElement("span",this.setBackgroundColor(e,{staticClass:"v-stepper__step__step"}),this.genStepContent())},genStepContent(){const e=[];return this.hasError?e.push(this.genIcon(this.errorIcon)):this.complete?this.editable?e.push(this.genIcon(this.editIcon)):e.push(this.genIcon(this.completeIcon)):e.push(String(this.step)),e},keyboardClick(e){e.keyCode===ur.uP.space&&this.click(e)},toggle(e){this.isActive=e.toString()===this.step.toString(),this.isInactive=Number(e)!isNaN(Number(e))||["xs","sm","md","lg","xl"].includes(String(e))}},computed:{isMobile(){const{mobile:e,width:t,name:r,mobileBreakpoint:i}=this.$vuetify.breakpoint;if(i===this.mobileBreakpoint)return e;const n=parseInt(this.mobileBreakpoint,10),s=!isNaN(n);return s?t"boolean"===typeof e||["always","never","desktop","mobile"].includes(e)}},data:()=>({isOverflowing:!1,resizeTimeout:0,startX:0,isSwipingHorizontal:!1,isSwiping:!1,scrollOffset:0,widths:{content:0,wrapper:0}}),computed:{canTouch(){return"undefined"!==typeof window},__cachedNext(){return this.genTransition("next")},__cachedPrev(){return this.genTransition("prev")},classes(){return{...xn.C.options.computed.classes.call(this),"v-slide-group":!0,"v-slide-group--has-affixes":this.hasAffixes,"v-slide-group--is-overflowing":this.isOverflowing}},hasAffixes(){switch(this.showArrows){case"always":return!0;case"desktop":return!this.isMobile;case!0:return this.isOverflowing||Math.abs(this.scrollOffset)>0;case"mobile":return this.isMobile||this.isOverflowing||Math.abs(this.scrollOffset)>0;case"never":return!1;default:return!this.isMobile&&(this.isOverflowing||Math.abs(this.scrollOffset)>0)}},hasNext(){if(!this.hasAffixes)return!1;const{content:e,wrapper:t}=this.widths;return e>Math.abs(this.scrollOffset)+t},hasPrev(){return this.hasAffixes&&0!==this.scrollOffset}},watch:{internalValue:"setWidths",isOverflowing:"setWidths",scrollOffset(e){this.$vuetify.rtl&&(e=-e);let t=e<=0?fs(-e):e>this.widths.content-this.widths.wrapper?-(this.widths.content-this.widths.wrapper)+fs(this.widths.content-this.widths.wrapper-e):-e;this.$vuetify.rtl&&(t=-t),this.$refs.content.style.transform=`translateX(${t}px)`}},mounted(){if("undefined"!==typeof ResizeObserver){const e=new ResizeObserver((()=>{this.onResize()}));e.observe(this.$el),e.observe(this.$refs.content),this.$on("hook:destroyed",(()=>{e.disconnect()}))}else{let e=0;this.$on("hook:beforeUpdate",(()=>{var t;e=((null===(t=this.$refs.content)||void 0===t?void 0:t.children)||[]).length})),this.$on("hook:updated",(()=>{var t;e!==((null===(t=this.$refs.content)||void 0===t?void 0:t.children)||[]).length&&this.setWidths()}))}},methods:{onScroll(){this.$refs.wrapper.scrollLeft=0},onFocusin(e){if(this.isOverflowing)for(const t of(0,ur.K9)(e))for(const e of this.items)if(e.$el===t)return void(this.scrollOffset=ps(e.$el,this.widths,this.$vuetify.rtl,this.scrollOffset))},genNext(){const e=this.$scopedSlots.next?this.$scopedSlots.next({}):(0,ur.$c)(this,"next")||this.__cachedNext;return this.$createElement("div",{staticClass:"v-slide-group__next",class:{"v-slide-group__next--disabled":!this.hasNext},on:{click:()=>this.onAffixClick("next")},key:"next"},[e])},genContent(){return this.$createElement("div",{staticClass:"v-slide-group__content",ref:"content",on:{focusin:this.onFocusin}},(0,ur.$c)(this))},genData(){return{class:this.classes,directives:[{name:"resize",value:this.onResize}]}},genIcon(e){let t=e;this.$vuetify.rtl&&"prev"===e?t="next":this.$vuetify.rtl&&"next"===e&&(t="prev");const r=`${e[0].toUpperCase()}${e.slice(1)}`,i=this[`has${r}`];return this.showArrows||i?this.$createElement(mr.A,{props:{disabled:!i}},this[`${t}Icon`]):null},genPrev(){const e=this.$scopedSlots.prev?this.$scopedSlots.prev({}):(0,ur.$c)(this,"prev")||this.__cachedPrev;return this.$createElement("div",{staticClass:"v-slide-group__prev",class:{"v-slide-group__prev--disabled":!this.hasPrev},on:{click:()=>this.onAffixClick("prev")},key:"prev"},[e])},genTransition(e){return this.$createElement(Ar.mM,[this.genIcon(e)])},genWrapper(){return this.$createElement("div",{staticClass:"v-slide-group__wrapper",directives:[{name:"touch",value:{start:e=>this.overflowCheck(e,this.onTouchStart),move:e=>this.overflowCheck(e,this.onTouchMove),end:e=>this.overflowCheck(e,this.onTouchEnd)}}],ref:"wrapper",on:{scroll:this.onScroll}},[this.genContent()])},calculateNewOffset(e,t,r,i){const n=r?-1:1,s=n*i+("prev"===e?-1:1)*t.wrapper;return n*Math.max(Math.min(s,t.content-t.wrapper),0)},onAffixClick(e){this.$emit(`click:${e}`),this.scrollTo(e)},onResize(){this._isDestroyed||this.setWidths()},onTouchStart(e){const{content:t}=this.$refs;this.startX=this.scrollOffset+e.touchstartX,t.style.setProperty("transition","none"),t.style.setProperty("willChange","transform")},onTouchMove(e){if(this.canTouch){if(!this.isSwiping){const t=e.touchmoveX-e.touchstartX,r=e.touchmoveY-e.touchstartY;this.isSwipingHorizontal=Math.abs(t)>Math.abs(r),this.isSwiping=!0}this.isSwipingHorizontal&&(this.scrollOffset=this.startX-e.touchmoveX,document.documentElement.style.overflowY="hidden")}},onTouchEnd(){if(!this.canTouch)return;const{content:e,wrapper:t}=this.$refs,r=e.clientWidth-t.clientWidth;e.style.setProperty("transition",null),e.style.setProperty("willChange",null),this.$vuetify.rtl?this.scrollOffset>0||!this.isOverflowing?this.scrollOffset=0:this.scrollOffset<=-r&&(this.scrollOffset=-r):this.scrollOffset<0||!this.isOverflowing?this.scrollOffset=0:this.scrollOffset>=r&&(this.scrollOffset=r),this.isSwiping=!1,document.documentElement.style.removeProperty("overflow-y")},overflowCheck(e,t){e.stopPropagation(),this.isOverflowing&&t(e)},scrollIntoView(){if(!this.selectedItem&&this.items.length){const e=this.items[this.items.length-1].$el.getBoundingClientRect(),t=this.$refs.wrapper.getBoundingClientRect();(this.$vuetify.rtl&&t.righte.left)&&this.scrollTo("prev")}this.selectedItem&&(0===this.selectedIndex||!this.centerActive&&!this.isOverflowing?this.scrollOffset=0:this.centerActive?this.scrollOffset=ms(this.selectedItem.$el,this.widths,this.$vuetify.rtl):this.isOverflowing&&(this.scrollOffset=ps(this.selectedItem.$el,this.widths,this.$vuetify.rtl,this.scrollOffset)))},scrollTo(e){this.scrollOffset=this.calculateNewOffset(e,{content:this.$refs.content?this.$refs.content.clientWidth:0,wrapper:this.$refs.wrapper?this.$refs.wrapper.clientWidth:0},this.$vuetify.rtl,this.scrollOffset)},setWidths(){window.requestAnimationFrame((()=>{if(this._isDestroyed)return;const{content:e,wrapper:t}=this.$refs;this.widths={content:e?e.clientWidth:0,wrapper:t?t.clientWidth:0},this.isOverflowing=this.widths.wrapper+10},classes(){return{...xn.C.options.computed.classes.call(this),"v-window--show-arrows-on-hover":this.showArrowsOnHover}},computedTransition(){if(!this.isBooted)return"";const e=this.vertical?"y":"x",t=this.internalReverse?!this.isReverse:this.isReverse,r=t?"-reverse":"";return`v-window-${e}${r}-transition`},hasActiveItems(){return Boolean(this.items.find((e=>!e.disabled)))},hasNext(){return this.continuous||this.internalIndex0},internalIndex(){return this.items.findIndex(((e,t)=>this.internalValue===this.getValue(e,t)))},internalReverse(){return this.$vuetify.rtl?!this.reverse:this.reverse}},watch:{internalIndex(e,t){this.isReverse=this.updateReverse(e,t)}},mounted(){window.requestAnimationFrame((()=>this.isBooted=!0))},methods:{genDefaultSlot(){return(0,ur.$c)(this)},genContainer(){const e=[this.genDefaultSlot()];return this.showArrows&&e.push(this.genControlIcons()),this.$createElement("div",{staticClass:"v-window__container",class:{"v-window__container--is-active":this.isActive},style:{height:this.internalHeight||this.transitionHeight}},e)},genIcon(e,t,r){var i,n,s;const o={click:e=>{e.stopPropagation(),this.changedByDelimiters=!0,r()}},a={"aria-label":this.$vuetify.lang.t(`$vuetify.carousel.${e}`)},l=null!==(s=null===(n=(i=this.$scopedSlots)[e])||void 0===n?void 0:n.call(i,{on:o,attrs:a}))&&void 0!==s?s:[this.$createElement(Ur.A,{props:{icon:!0},attrs:a,on:o},[this.$createElement(mr.A,{props:{large:!0}},t)])];return this.$createElement("div",{staticClass:`v-window__${e}`},l)},genControlIcons(){const e=[],t=this.$vuetify.rtl?this.nextIcon:this.prevIcon;if(this.hasPrev&&t&&"string"===typeof t){const r=this.genIcon("prev",t,this.prev);r&&e.push(r)}const r=this.$vuetify.rtl?this.prevIcon:this.nextIcon;if(this.hasNext&&r&&"string"===typeof r){const t=this.genIcon("next",r,this.next);t&&e.push(t)}return e},getNextIndex(e){const t=(e+1)%this.items.length,r=this.items[t];return r.disabled?this.getNextIndex(t):t},getPrevIndex(e){const t=(e+this.items.length-1)%this.items.length,r=this.items[t];return r.disabled?this.getPrevIndex(t):t},next(){if(!this.hasActiveItems||!this.hasNext)return;const e=this.getNextIndex(this.internalIndex),t=this.items[e];this.internalValue=this.getValue(t,e)},prev(){if(!this.hasActiveItems||!this.hasPrev)return;const e=this.getPrevIndex(this.internalIndex),t=this.items[e];this.internalValue=this.getValue(t,e)},updateReverse(e,t){const r=this.items.length,i=r-1;return r<=2?e{this.$vuetify.rtl?this.prev():this.next()},right:()=>{this.$vuetify.rtl?this.next():this.prev()},end:e=>{e.stopPropagation()},start:e=>{e.stopPropagation()}};t.directives.push({name:"touch",value:e})}return e("div",t,[this.genContainer()])}}),ws=bs.extend({name:"v-tabs-items",props:{mandatory:{type:Boolean,default:!1}},computed:{classes(){return{...bs.options.computed.classes.call(this),"v-tabs-items":!0}},isDark(){return this.rootIsDark}},methods:{getValue(e,t){return e.id||xn.C.options.methods.getValue.call(this,e,t)}}}),_s=(0,_r.A)(xi.A).extend({name:"v-tabs-slider",render(e){return e("div",this.setBackgroundColor(this.color,{staticClass:"v-tabs-slider"}))}});const ks=(0,_r.A)(xi.A,Qn.A,pi.A);var xs=ks.extend().extend({name:"v-tabs",directives:{Resize:ds.A},props:{activeClass:{type:String,default:""},alignWithTitle:Boolean,backgroundColor:String,centerActive:Boolean,centered:Boolean,fixedTabs:Boolean,grow:Boolean,height:{type:[Number,String],default:void 0},hideSlider:Boolean,iconsAndText:Boolean,mobileBreakpoint:[String,Number],nextIcon:{type:String,default:"$next"},optional:Boolean,prevIcon:{type:String,default:"$prev"},right:Boolean,showArrows:[Boolean,String],sliderColor:String,sliderSize:{type:[Number,String],default:2},vertical:Boolean},data(){return{resizeTimeout:0,slider:{height:null,left:null,right:null,top:null,width:null},transitionTime:300}},computed:{classes(){return{"v-tabs--align-with-title":this.alignWithTitle,"v-tabs--centered":this.centered,"v-tabs--fixed-tabs":this.fixedTabs,"v-tabs--grow":this.grow,"v-tabs--icons-and-text":this.iconsAndText,"v-tabs--right":this.right,"v-tabs--vertical":this.vertical,...this.themeClasses}},isReversed(){return this.$vuetify.rtl&&this.vertical},sliderStyles(){return{height:(0,ur.Dg)(this.slider.height),left:this.isReversed?void 0:(0,ur.Dg)(this.slider.left),right:this.isReversed?(0,ur.Dg)(this.slider.right):void 0,top:this.vertical?(0,ur.Dg)(this.slider.top):void 0,transition:null!=this.slider.left?null:"none",width:(0,ur.Dg)(this.slider.width)}},computedColor(){return this.color?this.color:this.isDark&&!this.appIsDark?"white":"primary"}},watch:{alignWithTitle:"callSlider",centered:"callSlider",centerActive:"callSlider",fixedTabs:"callSlider",grow:"callSlider",iconsAndText:"callSlider",right:"callSlider",showArrows:"callSlider",vertical:"callSlider","$vuetify.application.left":"onResize","$vuetify.application.right":"onResize","$vuetify.rtl":"onResize"},mounted(){if("undefined"!==typeof ResizeObserver){const e=new ResizeObserver((()=>{this.onResize()}));e.observe(this.$el),this.$on("hook:destroyed",(()=>{e.disconnect()}))}this.$nextTick((()=>{window.setTimeout(this.callSlider,30)}))},methods:{callSlider(){return!this.hideSlider&&this.$refs.items&&this.$refs.items.selectedItems.length?(this.$nextTick((()=>{const e=this.$refs.items.selectedItems[0];if(!e||!e.$el)return this.slider.width=0,void(this.slider.left=0);const t=e.$el;this.slider={height:this.vertical?t.scrollHeight:Number(this.sliderSize),left:this.vertical?0:t.offsetLeft,right:this.vertical?0:t.offsetLeft+t.offsetWidth,top:t.offsetTop,width:this.vertical?Number(this.sliderSize):t.scrollWidth}})),!0):(this.slider.width=0,!1)},genBar(e,t){const r={style:{height:(0,ur.Dg)(this.height)},props:{activeClass:this.activeClass,centerActive:this.centerActive,dark:this.dark,light:this.light,mandatory:!this.optional,mobileBreakpoint:this.mobileBreakpoint,nextIcon:this.nextIcon,prevIcon:this.prevIcon,showArrows:this.showArrows,value:this.internalValue},on:{"call:slider":this.callSlider,change:e=>{this.internalValue=e}},ref:"items"};return this.setTextColor(this.computedColor,r),this.setBackgroundColor(this.backgroundColor,r),this.$createElement(ys,r,[this.genSlider(t),e])},genItems(e,t){return e||(t.length?this.$createElement(ws,{props:{value:this.internalValue},on:{change:e=>{this.internalValue=e}}},t):null)},genSlider(e){return this.hideSlider?null:(e||(e=this.$createElement(_s,{props:{color:this.sliderColor}})),this.$createElement("div",{staticClass:"v-tabs-slider-wrapper",style:this.sliderStyles},[e]))},onResize(){this._isDestroyed||(clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(this.callSlider,0))},parseNodes(){let e=null,t=null;const r=[],i=[],n=(0,ur.$c)(this)||[],s=n.length;for(let o=0;o({proxyClass:"v-tab--active"}),computed:{classes(){return{"v-tab":!0,...Ss.A.options.computed.classes.call(this),"v-tab--disabled":this.disabled,...this.groupClasses}},value(){if(null!=this.tabValue)return this.tabValue;let e=this.to||this.href;if(null==e)return e;if(this.$router&&this.to===Object(this.to)){const t=this.$router.resolve(this.to,this.$route,this.append);e=t.href}return e.replace("#","")}},methods:{click(e){this.disabled?e.preventDefault():(this.href&&this.href.indexOf("#")>-1&&e.preventDefault(),e.detail&&this.$el.blur(),this.$emit("click",e),this.to||this.toggle())},toggle(){this.isActive&&(this.tabsBar.mandatory||this.to)||this.$emit("change")}},render(e){const{tag:t,data:r}=this.generateRouteLink();return r.attrs={...r.attrs,"aria-selected":String(this.isActive),role:"tab",tabindex:this.disabled?-1:0},r.on={...r.on,keydown:e=>{e.keyCode===ur.uP.enter&&this.click(e),this.$emit("keydown",e)}},e(t,r,(0,ur.$c)(this))}});const As=(0,_r.A)(On.A,(0,Mn.P)("windowGroup","v-window-item","v-window"));var Cs=As.extend().extend().extend({name:"v-window-item",directives:{Touch:zi},props:{disabled:Boolean,reverseTransition:{type:[Boolean,String],default:void 0},transition:{type:[Boolean,String],default:void 0},value:{required:!1}},data(){return{isActive:!1,inTransition:!1}},computed:{classes(){return this.groupClasses},computedTransition(){return this.windowGroup.internalReverse?"undefined"!==typeof this.reverseTransition?this.reverseTransition||"":this.windowGroup.computedTransition:"undefined"!==typeof this.transition?this.transition||"":this.windowGroup.computedTransition}},methods:{genDefaultSlot(){return(0,ur.$c)(this)},genWindowItem(){return this.$createElement("div",{staticClass:"v-window-item",class:this.classes,directives:[{name:"show",value:this.isActive}],on:this.$listeners},this.genDefaultSlot())},onAfterTransition(){this.inTransition&&(this.inTransition=!1,this.windowGroup.transitionCount>0&&(this.windowGroup.transitionCount--,0===this.windowGroup.transitionCount&&(this.windowGroup.transitionHeight=void 0)))},onBeforeTransition(){this.inTransition||(this.inTransition=!0,0===this.windowGroup.transitionCount&&(this.windowGroup.transitionHeight=(0,ur.Dg)(this.windowGroup.$el.clientHeight)),this.windowGroup.transitionCount++)},onTransitionCancelled(){this.onAfterTransition()},onEnter(e){this.inTransition&&this.$nextTick((()=>{this.computedTransition&&this.inTransition&&(this.windowGroup.transitionHeight=(0,ur.Dg)(e.clientHeight))}))}},render(e){return e("transition",{props:{name:this.computedTransition},on:{beforeEnter:this.onBeforeTransition,afterEnter:this.onAfterTransition,enterCancelled:this.onTransitionCancelled,beforeLeave:this.onBeforeTransition,afterLeave:this.onAfterTransition,leaveCancelled:this.onTransitionCancelled,enter:this.onEnter}},this.showLazyContent((()=>[this.genWindowItem()])))}}),$s=Cs.extend({name:"v-tab-item",props:{id:String},methods:{genWindowItem(){const e=Cs.options.methods.genWindowItem.call(this);return e.data.domProps=e.data.domProps||{},e.data.domProps.id=this.id||this.value,e}}});const Os=(0,_r.A)(ar.A);var Ps,Ts=Os.extend({name:"v-textarea",props:{autoGrow:Boolean,noResize:Boolean,rowHeight:{type:[Number,String],default:24,validator:e=>!isNaN(parseFloat(e))},rows:{type:[Number,String],default:5,validator:e=>!isNaN(parseInt(e,10))}},computed:{classes(){return{"v-textarea":!0,"v-textarea--auto-grow":this.autoGrow,"v-textarea--no-resize":this.noResizeHandle,...ar.A.options.computed.classes.call(this)}},noResizeHandle(){return this.noResize||this.autoGrow}},watch:{autoGrow(e){this.$nextTick((()=>{var t;e?this.calculateInputHeight():null===(t=this.$refs.input)||void 0===t||t.style.removeProperty("height")}))},lazyValue(){this.autoGrow&&this.$nextTick(this.calculateInputHeight)},rowHeight(){this.autoGrow&&this.$nextTick(this.calculateInputHeight)}},mounted(){setTimeout((()=>{this.autoGrow&&this.calculateInputHeight()}),0)},methods:{calculateInputHeight(){const e=this.$refs.input;if(!e)return;e.style.height="0";const t=e.scrollHeight,r=parseInt(this.rows,10)*parseFloat(this.rowHeight);e.style.height=Math.max(r,t)+"px"},genInput(){const e=ar.A.options.methods.genInput.call(this);return e.tag="textarea",delete e.data.attrs.type,e.data.attrs.rows=this.rows,e},onInput(e){ar.A.options.methods.onInput.call(this,e),this.autoGrow&&this.calculateInputHeight()},onKeyDown(e){this.isFocused&&13===e.keyCode&&e.stopPropagation(),this.$emit("keydown",e)}}});(function(e){e[e["Hour"]=1]="Hour",e[e["Minute"]=2]="Minute",e[e["Second"]=3]="Second"})(Ps||(Ps={}));var Is=(0,_r.A)(Si).extend({name:"v-time-picker-title",props:{ampm:Boolean,ampmReadonly:Boolean,disabled:Boolean,hour:Number,minute:Number,second:Number,period:{type:String,validator:e=>"am"===e||"pm"===e},readonly:Boolean,useSeconds:Boolean,selecting:Number},methods:{genTime(){let e=this.hour;this.ampm&&(e=e?(e-1)%12+1:12);const t=null==this.hour?"--":this.ampm?String(e):Ci(e),r=null==this.minute?"--":Ci(this.minute),i=[this.genPickerButton("selecting",Ps.Hour,t,this.disabled),this.$createElement("span",":"),this.genPickerButton("selecting",Ps.Minute,r,this.disabled)];if(this.useSeconds){const e=null==this.second?"--":Ci(this.second);i.push(this.$createElement("span",":")),i.push(this.genPickerButton("selecting",Ps.Second,e,this.disabled))}return this.$createElement("div",{class:"v-time-picker-title__time"},i)},genAmPm(){return this.$createElement("div",{staticClass:"v-time-picker-title__ampm",class:{"v-time-picker-title__ampm--readonly":this.ampmReadonly}},[this.ampmReadonly&&"am"!==this.period?null:this.genPickerButton("period","am",this.$vuetify.lang.t("$vuetify.timePicker.am"),this.disabled||this.readonly),this.ampmReadonly&&"pm"!==this.period?null:this.genPickerButton("period","pm",this.$vuetify.lang.t("$vuetify.timePicker.pm"),this.disabled||this.readonly)])}},render(e){const t=[this.genTime()];return this.ampm&&t.push(this.genAmPm()),e("div",{staticClass:"v-time-picker-title"},t)}}),Ds=(0,_r.A)(xi.A,pi.A).extend({name:"v-time-picker-clock",props:{allowedValues:Function,ampm:Boolean,disabled:Boolean,double:Boolean,format:{type:Function,default:e=>e},max:{type:Number,required:!0},min:{type:Number,required:!0},scrollable:Boolean,readonly:Boolean,rotate:{type:Number,default:0},step:{type:Number,default:1},value:Number},data(){return{inputValue:this.value,isDragging:!1,valueOnMouseDown:null,valueOnMouseUp:null}},computed:{count(){return this.max-this.min+1},degreesPerUnit(){return 360/this.roundCount},degrees(){return this.degreesPerUnit*Math.PI/180},displayedValue(){return null==this.value?this.min:this.value},innerRadiusScale(){return.62},roundCount(){return this.double?this.count/2:this.count}},watch:{value(e){this.inputValue=e}},methods:{wheel(e){e.preventDefault();const t=Math.sign(-e.deltaY||1);let r=this.displayedValue;do{r+=t,r=(r-this.min+this.count)%this.count+this.min}while(!this.isAllowed(r)&&r!==this.displayedValue);r!==this.displayedValue&&this.update(r)},isInner(e){return this.double&&e-this.min>=this.roundCount},handScale(e){return this.isInner(e)?this.innerRadiusScale:1},isAllowed(e){return!this.allowedValues||this.allowedValues(e)},genValues(){const e=[];for(let t=this.min;t<=this.max;t+=this.step){const r=t===this.value&&(this.color||"accent");e.push(this.$createElement("span",this.setBackgroundColor(r,{staticClass:"v-time-picker-clock__item",class:{"v-time-picker-clock__item--active":t===this.displayedValue,"v-time-picker-clock__item--disabled":this.disabled||!this.isAllowed(t)},style:this.getTransform(t),domProps:{innerHTML:`${this.format(t)}`}})))}return e},genHand(){const e=`scaleY(${this.handScale(this.displayedValue)})`,t=this.rotate+this.degreesPerUnit*(this.displayedValue-this.min),r=null!=this.value&&(this.color||"accent");return this.$createElement("div",this.setBackgroundColor(r,{staticClass:"v-time-picker-clock__hand",class:{"v-time-picker-clock__hand--inner":this.isInner(this.value)},style:{transform:`rotate(${t}deg) ${e}`}}))},getTransform(e){const{x:t,y:r}=this.getPosition(e);return{left:50+50*t+"%",top:50+50*r+"%"}},getPosition(e){const t=this.rotate*Math.PI/180;return{x:Math.sin((e-this.min)*this.degrees+t)*this.handScale(e),y:-Math.cos((e-this.min)*this.degrees+t)*this.handScale(e)}},onMouseDown(e){e.preventDefault(),this.valueOnMouseDown=null,this.valueOnMouseUp=null,this.isDragging=!0,this.onDragMove(e)},onMouseUp(e){e.stopPropagation(),this.isDragging=!1,null!==this.valueOnMouseUp&&this.isAllowed(this.valueOnMouseUp)&&this.$emit("change",this.valueOnMouseUp)},onDragMove(e){if(e.preventDefault(),!this.isDragging&&"click"!==e.type||!this.$refs.clock)return;const{width:t,top:r,left:i}=this.$refs.clock.getBoundingClientRect(),{width:n}=this.$refs.innerClock.getBoundingClientRect(),{clientX:s,clientY:o}="touches"in e?e.touches[0]:e,a={x:t/2,y:-t/2},l={x:s-i,y:r-o},u=Math.round(this.angle(a,l)-this.rotate+360)%360,c=this.double&&this.euclidean(a,l)<(n+n*this.innerRadiusScale)/4,h=Math.ceil(15/this.degreesPerUnit);let d;for(let f=0;fthis.isDragging&&this.onMouseUp(e),touchstart:this.onMouseDown,touchend:this.onMouseUp,mousemove:this.onDragMove,touchmove:this.onDragMove},ref:"clock"};return this.scrollable&&t.on&&(t.on.wheel=this.wheel),e("div",t,[e("div",{staticClass:"v-time-picker-clock__inner",ref:"innerClock"},[this.genHand(),this.genValues()])])}});const Ls=(0,ur.Sd)(24),Rs=(0,ur.Sd)(12),Ns=Rs.map((e=>e+12)),js=(0,ur.Sd)(60),Bs={1:"hour",2:"minute",3:"second"};var Fs=(0,_r.A)(sn,Si).extend({name:"v-time-picker",props:{activePicker:String,allowedHours:[Function,Array],allowedMinutes:[Function,Array],allowedSeconds:[Function,Array],disabled:Boolean,format:{type:String,default:"ampm",validator(e){return["ampm","24hr"].includes(e)}},min:String,max:String,readonly:Boolean,scrollable:Boolean,useSeconds:Boolean,value:null,ampmInTitle:Boolean},data(){return{inputHour:null,inputMinute:null,inputSecond:null,lazyInputHour:null,lazyInputMinute:null,lazyInputSecond:null,period:"am",selecting:Ps.Hour}},computed:{selectingHour:{get(){return this.selecting===Ps.Hour},set(e){this.selecting=Ps.Hour}},selectingMinute:{get(){return this.selecting===Ps.Minute},set(e){this.selecting=Ps.Minute}},selectingSecond:{get(){return this.selecting===Ps.Second},set(e){this.selecting=Ps.Second}},isAllowedHourCb(){let e;if(e=this.allowedHours instanceof Array?e=>this.allowedHours.includes(e):this.allowedHours,!this.min&&!this.max)return e;const t=this.min?Number(this.min.split(":")[0]):0,r=this.max?Number(this.max.split(":")[0]):23;return i=>i>=1*t&&i<=1*r&&(!e||e(i))},isAllowedMinuteCb(){let e;const t=!this.isAllowedHourCb||null===this.inputHour||this.isAllowedHourCb(this.inputHour);if(e=this.allowedMinutes instanceof Array?e=>this.allowedMinutes.includes(e):this.allowedMinutes,!this.min&&!this.max)return t?e:()=>!1;const[r,i]=this.min?this.min.split(":").map(Number):[0,0],[n,s]=this.max?this.max.split(":").map(Number):[23,59],o=60*r+1*i,a=60*n+1*s;return r=>{const i=60*this.inputHour+r;return i>=o&&i<=a&&t&&(!e||e(r))}},isAllowedSecondCb(){let e;const t=!this.isAllowedHourCb||null===this.inputHour||this.isAllowedHourCb(this.inputHour),r=t&&(!this.isAllowedMinuteCb||null===this.inputMinute||this.isAllowedMinuteCb(this.inputMinute));if(e=this.allowedSeconds instanceof Array?e=>this.allowedSeconds.includes(e):this.allowedSeconds,!this.min&&!this.max)return r?e:()=>!1;const[i,n,s]=this.min?this.min.split(":").map(Number):[0,0,0],[o,a,l]=this.max?this.max.split(":").map(Number):[23,59,59],u=3600*i+60*n+1*(s||0),c=3600*o+60*a+1*(l||0);return t=>{const i=3600*this.inputHour+60*this.inputMinute+t;return i>=u&&i<=c&&r&&(!e||e(t))}},isAmPm(){return"ampm"===this.format}},watch:{activePicker:"setPicker",selecting:"emitPicker",value:"setInputData"},mounted(){this.setInputData(this.value),this.$on("update:period",this.setPeriod)},methods:{genValue(){return null==this.inputHour||null==this.inputMinute||this.useSeconds&&null==this.inputSecond?null:`${Ci(this.inputHour)}:${Ci(this.inputMinute)}`+(this.useSeconds?`:${Ci(this.inputSecond)}`:"")},emitValue(){const e=this.genValue();null!==e&&this.$emit("input",e)},emitPicker(e){let t="HOUR";e===Ps.Minute?t="MINUTE":e===Ps.Second&&(t="SECOND"),this.$emit("update:active-picker",t)},setPicker(e){"HOUR"===e?this.selecting=Ps.Hour:"MINUTE"===e?this.selecting=Ps.Minute:"SECOND"===e&&this.useSeconds&&(this.selecting=Ps.Second)},setPeriod(e){if(this.period=e,null!=this.inputHour){const t=this.inputHour+("am"===e?-12:12);this.inputHour=this.firstAllowed("hour",t),this.emitValue()}},setInputData(e){if(null==e||""===e)this.inputHour=null,this.inputMinute=null,this.inputSecond=null;else if(e instanceof Date)this.inputHour=e.getHours(),this.inputMinute=e.getMinutes(),this.inputSecond=e.getSeconds();else{const[,t,r,,i,n]=e.trim().toLowerCase().match(/^(\d+):(\d+)(:(\d+))?([ap]m)?$/)||new Array(6);this.inputHour=n?this.convert12to24(parseInt(t,10),n):parseInt(t,10),this.inputMinute=parseInt(r,10),this.inputSecond=parseInt(i||0,10)}this.period=null==this.inputHour||this.inputHour<12?"am":"pm"},convert24to12(e){return e?(e-1)%12+1:12},convert12to24(e,t){return e%12+("pm"===t?12:0)},onInput(e){this.selecting===Ps.Hour?this.inputHour=this.isAmPm?this.convert12to24(e,this.period):e:this.selecting===Ps.Minute?this.inputMinute=e:this.inputSecond=e,this.emitValue()},onChange(e){this.$emit(`click:${Bs[this.selecting]}`,e);const t=this.selecting===(this.useSeconds?Ps.Second:Ps.Minute);if(this.selecting===Ps.Hour?this.selecting=Ps.Minute:this.useSeconds&&this.selecting===Ps.Minute&&(this.selecting=Ps.Second),this.inputHour===this.lazyInputHour&&this.inputMinute===this.lazyInputMinute&&(!this.useSeconds||this.inputSecond===this.lazyInputSecond))return;const r=this.genValue();null!==r&&(this.lazyInputHour=this.inputHour,this.lazyInputMinute=this.inputMinute,this.useSeconds&&(this.lazyInputSecond=this.inputSecond),t&&this.$emit("change",r))},firstAllowed(e,t){const r="hour"===e?this.isAllowedHourCb:"minute"===e?this.isAllowedMinuteCb:this.isAllowedSecondCb;if(!r)return t;const i="minute"===e||"second"===e?js:this.isAmPm?t<12?Rs:Ns:Ls,n=i.find((e=>r((e+t)%i.length+i[0])));return((n||0)+t)%i.length+i[0]},genClock(){return this.$createElement(Ds,{props:{allowedValues:this.selecting===Ps.Hour?this.isAllowedHourCb:this.selecting===Ps.Minute?this.isAllowedMinuteCb:this.isAllowedSecondCb,color:this.color,dark:this.dark,disabled:this.disabled,double:this.selecting===Ps.Hour&&!this.isAmPm,format:this.selecting===Ps.Hour?this.isAmPm?this.convert24to12:e=>e:e=>Ci(e,2),light:this.light,max:this.selecting===Ps.Hour?this.isAmPm&&"am"===this.period?11:23:59,min:this.selecting===Ps.Hour&&this.isAmPm&&"pm"===this.period?12:0,readonly:this.readonly,scrollable:this.scrollable,size:Number(this.width)-(!this.fullWidth&&this.landscape?80:20),step:this.selecting===Ps.Hour?1:5,value:this.selecting===Ps.Hour?this.inputHour:this.selecting===Ps.Minute?this.inputMinute:this.inputSecond},on:{input:this.onInput,change:this.onChange},ref:"clock"})},genClockAmPm(){return this.$createElement("div",this.setTextColor(this.color||"primary",{staticClass:"v-time-picker-clock__ampm"}),[this.genPickerButton("period","am",this.$vuetify.lang.t("$vuetify.timePicker.am"),this.disabled||this.readonly),this.genPickerButton("period","pm",this.$vuetify.lang.t("$vuetify.timePicker.pm"),this.disabled||this.readonly)])},genPickerBody(){return this.$createElement("div",{staticClass:"v-time-picker-clock__container",key:this.selecting},[!this.ampmInTitle&&this.isAmPm&&this.genClockAmPm(),this.genClock()])},genPickerTitle(){return this.$createElement(Is,{props:{ampm:this.isAmPm,ampmReadonly:this.isAmPm&&!this.ampmInTitle,disabled:this.disabled,hour:this.inputHour,minute:this.inputMinute,second:this.inputSecond,period:this.period,readonly:this.readonly,useSeconds:this.useSeconds,selecting:this.selecting},on:{"update:selecting":e=>this.selecting=e,"update:period":e=>this.$emit("update:period",e)},ref:"title",slot:"title"})}},render(){return this.genPicker("v-picker--time")}}),zs=r(97391),Vs=r(39975),qs=(0,_r.A)(xi.A,zs.A,dn.A,Vs.A).extend({name:"v-tooltip",props:{closeDelay:{type:[Number,String],default:0},disabled:Boolean,openDelay:{type:[Number,String],default:0},openOnHover:{type:Boolean,default:!0},openOnFocus:{type:Boolean,default:!0},tag:{type:String,default:"span"},transition:String},data:()=>({calculatedMinWidth:0,closeDependents:!1}),computed:{calculatedLeft(){const{activator:e,content:t}=this.dimensions,r=!this.bottom&&!this.left&&!this.top&&!this.right,i=!1!==this.attach?e.offsetLeft:e.left;let n=0;return this.top||this.bottom||r?n=i+e.width/2-t.width/2:(this.left||this.right)&&(n=i+(this.right?e.width:-t.width)+(this.right?10:-10)),this.nudgeLeft&&(n-=parseInt(this.nudgeLeft)),this.nudgeRight&&(n+=parseInt(this.nudgeRight)),`${this.calcXOverflow(n,this.dimensions.content.width)}px`},calculatedTop(){const{activator:e,content:t}=this.dimensions,r=!1!==this.attach?e.offsetTop:e.top;let i=0;return this.top||this.bottom?i=r+(this.bottom?e.height:-t.height)+(this.bottom?10:-10):(this.left||this.right)&&(i=r+e.height/2-t.height/2),this.nudgeTop&&(i-=parseInt(this.nudgeTop)),this.nudgeBottom&&(i+=parseInt(this.nudgeBottom)),!1===this.attach&&(i+=this.pageYOffset),`${this.calcYOverflow(i)}px`},classes(){return{"v-tooltip--top":this.top,"v-tooltip--right":this.right,"v-tooltip--bottom":this.bottom,"v-tooltip--left":this.left,"v-tooltip--attached":""===this.attach||!0===this.attach||"attach"===this.attach}},computedTransition(){return this.transition?this.transition:this.isActive?"scale-transition":"fade-transition"},offsetY(){return this.top||this.bottom},offsetX(){return this.left||this.right},styles(){return{left:this.calculatedLeft,maxWidth:(0,ur.Dg)(this.maxWidth),minWidth:(0,ur.Dg)(this.minWidth),top:this.calculatedTop,zIndex:this.zIndex||this.activeZIndex}}},beforeMount(){this.$nextTick((()=>{this.value&&this.callActivate()}))},mounted(){"v-slot"===(0,ur.fo)(this,"activator",!0)&&(0,$r.yA)("v-tooltip's activator slot must be bound, try '