@ulb-darmstadt/shacl-form 3.0.2 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/bundle.js +46 -46
- package/dist/index.js +8 -8
- package/dist/loader.d.ts +2 -0
- package/dist/node.d.ts +2 -1
- package/dist/property.d.ts +2 -1
- package/package.json +2 -7
package/dist/bundle.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var qi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rf(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Do={},fr={},Yu;function Sg(){if(Yu)return fr;Yu=1,fr.byteLength=u,fr.toByteArray=h,fr.fromByteArray=d;for(var i=[],e=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=r.length;o<a;++o)i[o]=r[o],e[r.charCodeAt(o)]=o;e[45]=62,e[95]=63;function l(m){var w=m.length;if(w%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=m.indexOf("=");I===-1&&(I=w);var A=I===w?0:4-I%4;return[I,A]}function u(m){var w=l(m),I=w[0],A=w[1];return(I+A)*3/4-A}function f(m,w,I){return(w+I)*3/4-I}function h(m){var w,I=l(m),A=I[0],N=I[1],P=new n(f(m,A,N)),v=0,y=N>0?A-4:A,S;for(S=0;S<y;S+=4)w=e[m.charCodeAt(S)]<<18|e[m.charCodeAt(S+1)]<<12|e[m.charCodeAt(S+2)]<<6|e[m.charCodeAt(S+3)],P[v++]=w>>16&255,P[v++]=w>>8&255,P[v++]=w&255;return N===2&&(w=e[m.charCodeAt(S)]<<2|e[m.charCodeAt(S+1)]>>4,P[v++]=w&255),N===1&&(w=e[m.charCodeAt(S)]<<10|e[m.charCodeAt(S+1)]<<4|e[m.charCodeAt(S+2)]>>2,P[v++]=w>>8&255,P[v++]=w&255),P}function g(m){return i[m>>18&63]+i[m>>12&63]+i[m>>6&63]+i[m&63]}function _(m,w,I){for(var A,N=[],P=w;P<I;P+=3)A=(m[P]<<16&16711680)+(m[P+1]<<8&65280)+(m[P+2]&255),N.push(g(A));return N.join("")}function d(m){for(var w,I=m.length,A=I%3,N=[],P=16383,v=0,y=I-A;v<y;v+=P)N.push(_(m,v,v+P>y?y:v+P));return A===1?(w=m[I-1],N.push(i[w>>2]+i[w<<4&63]+"==")):A===2&&(w=(m[I-2]<<8)+m[I-1],N.push(i[w>>10]+i[w>>4&63]+i[w<<2&63]+"=")),N.join("")}return fr}var ms={};var ec;function Tg(){return ec||(ec=1,ms.read=function(i,e,n,r,o){var a,l,u=o*8-r-1,f=(1<<u)-1,h=f>>1,g=-7,_=n?o-1:0,d=n?-1:1,m=i[e+_];for(_+=d,a=m&(1<<-g)-1,m>>=-g,g+=u;g>0;a=a*256+i[e+_],_+=d,g-=8);for(l=a&(1<<-g)-1,a>>=-g,g+=r;g>0;l=l*256+i[e+_],_+=d,g-=8);if(a===0)a=1-h;else{if(a===f)return l?NaN:(m?-1:1)*(1/0);l=l+Math.pow(2,r),a=a-h}return(m?-1:1)*l*Math.pow(2,a-r)},ms.write=function(i,e,n,r,o,a){var l,u,f,h=a*8-o-1,g=(1<<h)-1,_=g>>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:a-1,w=r?1:-1,I=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,l=g):(l=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-l))<1&&(l--,f*=2),l+_>=1?e+=d/f:e+=d*Math.pow(2,1-_),e*f>=2&&(l++,f/=2),l+_>=g?(u=0,l=g):l+_>=1?(u=(e*f-1)*Math.pow(2,o),l=l+_):(u=e*Math.pow(2,_-1)*Math.pow(2,o),l=0));o>=8;i[n+m]=u&255,m+=w,u/=256,o-=8);for(l=l<<o|u,h+=o;h>0;i[n+m]=l&255,m+=w,l/=256,h-=8);i[n+m-w]|=I*128}),ms}var tc;function Dn(){return tc||(tc=1,(function(i){const e=Sg(),n=Tg(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;i.Buffer=u,i.SlowBuffer=P,i.INSPECT_MAX_BYTES=50;const o=2147483647;i.kMaxLength=o,u.TYPED_ARRAY_SUPPORT=a(),!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{const k=new Uint8Array(1),b={foo:function(){return 42}};return Object.setPrototypeOf(b,Uint8Array.prototype),Object.setPrototypeOf(k,b),k.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function l(k){if(k>o)throw new RangeError('The value "'+k+'" is invalid for option "size"');const b=new Uint8Array(k);return Object.setPrototypeOf(b,u.prototype),b}function u(k,b,x){if(typeof k=="number"){if(typeof b=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return _(k)}return f(k,b,x)}u.poolSize=8192;function f(k,b,x){if(typeof k=="string")return d(k,b);if(ArrayBuffer.isView(k))return w(k);if(k==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k);if(be(k,ArrayBuffer)||k&&be(k.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(be(k,SharedArrayBuffer)||k&&be(k.buffer,SharedArrayBuffer)))return I(k,b,x);if(typeof k=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const H=k.valueOf&&k.valueOf();if(H!=null&&H!==k)return u.from(H,b,x);const ae=A(k);if(ae)return ae;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof k[Symbol.toPrimitive]=="function")return u.from(k[Symbol.toPrimitive]("string"),b,x);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k)}u.from=function(k,b,x){return f(k,b,x)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array);function h(k){if(typeof k!="number")throw new TypeError('"size" argument must be of type number');if(k<0)throw new RangeError('The value "'+k+'" is invalid for option "size"')}function g(k,b,x){return h(k),k<=0?l(k):b!==void 0?typeof x=="string"?l(k).fill(b,x):l(k).fill(b):l(k)}u.alloc=function(k,b,x){return g(k,b,x)};function _(k){return h(k),l(k<0?0:N(k)|0)}u.allocUnsafe=function(k){return _(k)},u.allocUnsafeSlow=function(k){return _(k)};function d(k,b){if((typeof b!="string"||b==="")&&(b="utf8"),!u.isEncoding(b))throw new TypeError("Unknown encoding: "+b);const x=v(k,b)|0;let H=l(x);const ae=H.write(k,b);return ae!==x&&(H=H.slice(0,ae)),H}function m(k){const b=k.length<0?0:N(k.length)|0,x=l(b);for(let H=0;H<b;H+=1)x[H]=k[H]&255;return x}function w(k){if(be(k,Uint8Array)){const b=new Uint8Array(k);return I(b.buffer,b.byteOffset,b.byteLength)}return m(k)}function I(k,b,x){if(b<0||k.byteLength<b)throw new RangeError('"offset" is outside of buffer bounds');if(k.byteLength<b+(x||0))throw new RangeError('"length" is outside of buffer bounds');let H;return b===void 0&&x===void 0?H=new Uint8Array(k):x===void 0?H=new Uint8Array(k,b):H=new Uint8Array(k,b,x),Object.setPrototypeOf(H,u.prototype),H}function A(k){if(u.isBuffer(k)){const b=N(k.length)|0,x=l(b);return x.length===0||k.copy(x,0,0,b),x}if(k.length!==void 0)return typeof k.length!="number"||qe(k.length)?l(0):m(k);if(k.type==="Buffer"&&Array.isArray(k.data))return m(k.data)}function N(k){if(k>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return k|0}function P(k){return+k!=k&&(k=0),u.alloc(+k)}u.isBuffer=function(b){return b!=null&&b._isBuffer===!0&&b!==u.prototype},u.compare=function(b,x){if(be(b,Uint8Array)&&(b=u.from(b,b.offset,b.byteLength)),be(x,Uint8Array)&&(x=u.from(x,x.offset,x.byteLength)),!u.isBuffer(b)||!u.isBuffer(x))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(b===x)return 0;let H=b.length,ae=x.length;for(let _e=0,we=Math.min(H,ae);_e<we;++_e)if(b[_e]!==x[_e]){H=b[_e],ae=x[_e];break}return H<ae?-1:ae<H?1:0},u.isEncoding=function(b){switch(String(b).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(b,x){if(!Array.isArray(b))throw new TypeError('"list" argument must be an Array of Buffers');if(b.length===0)return u.alloc(0);let H;if(x===void 0)for(x=0,H=0;H<b.length;++H)x+=b[H].length;const ae=u.allocUnsafe(x);let _e=0;for(H=0;H<b.length;++H){let we=b[H];if(be(we,Uint8Array))_e+we.length>ae.length?(u.isBuffer(we)||(we=u.from(we)),we.copy(ae,_e)):Uint8Array.prototype.set.call(ae,we,_e);else if(u.isBuffer(we))we.copy(ae,_e);else throw new TypeError('"list" argument must be an Array of Buffers');_e+=we.length}return ae};function v(k,b){if(u.isBuffer(k))return k.length;if(ArrayBuffer.isView(k)||be(k,ArrayBuffer))return k.byteLength;if(typeof k!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof k);const x=k.length,H=arguments.length>2&&arguments[2]===!0;if(!H&&x===0)return 0;let ae=!1;for(;;)switch(b){case"ascii":case"latin1":case"binary":return x;case"utf8":case"utf-8":return Se(k).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x*2;case"hex":return x>>>1;case"base64":return ve(k).length;default:if(ae)return H?-1:Se(k).length;b=(""+b).toLowerCase(),ae=!0}}u.byteLength=v;function y(k,b,x){let H=!1;if((b===void 0||b<0)&&(b=0),b>this.length||((x===void 0||x>this.length)&&(x=this.length),x<=0)||(x>>>=0,b>>>=0,x<=b))return"";for(k||(k="utf8");;)switch(k){case"hex":return oe(this,b,x);case"utf8":case"utf-8":return F(this,b,x);case"ascii":return re(this,b,x);case"latin1":case"binary":return B(this,b,x);case"base64":return j(this,b,x);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,b,x);default:if(H)throw new TypeError("Unknown encoding: "+k);k=(k+"").toLowerCase(),H=!0}}u.prototype._isBuffer=!0;function S(k,b,x){const H=k[b];k[b]=k[x],k[x]=H}u.prototype.swap16=function(){const b=this.length;if(b%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let x=0;x<b;x+=2)S(this,x,x+1);return this},u.prototype.swap32=function(){const b=this.length;if(b%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let x=0;x<b;x+=4)S(this,x,x+3),S(this,x+1,x+2);return this},u.prototype.swap64=function(){const b=this.length;if(b%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let x=0;x<b;x+=8)S(this,x,x+7),S(this,x+1,x+6),S(this,x+2,x+5),S(this,x+3,x+4);return this},u.prototype.toString=function(){const b=this.length;return b===0?"":arguments.length===0?F(this,0,b):y.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(b){if(!u.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b?!0:u.compare(this,b)===0},u.prototype.inspect=function(){let b="";const x=i.INSPECT_MAX_BYTES;return b=this.toString("hex",0,x).replace(/(.{2})/g,"$1 ").trim(),this.length>x&&(b+=" ... "),"<Buffer "+b+">"},r&&(u.prototype[r]=u.prototype.inspect),u.prototype.compare=function(b,x,H,ae,_e){if(be(b,Uint8Array)&&(b=u.from(b,b.offset,b.byteLength)),!u.isBuffer(b))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof b);if(x===void 0&&(x=0),H===void 0&&(H=b?b.length:0),ae===void 0&&(ae=0),_e===void 0&&(_e=this.length),x<0||H>b.length||ae<0||_e>this.length)throw new RangeError("out of range index");if(ae>=_e&&x>=H)return 0;if(ae>=_e)return-1;if(x>=H)return 1;if(x>>>=0,H>>>=0,ae>>>=0,_e>>>=0,this===b)return 0;let we=_e-ae,Oe=H-x;const Ye=Math.min(we,Oe),Qe=this.slice(ae,_e),Ge=b.slice(x,H);for(let Ze=0;Ze<Ye;++Ze)if(Qe[Ze]!==Ge[Ze]){we=Qe[Ze],Oe=Ge[Ze];break}return we<Oe?-1:Oe<we?1:0};function O(k,b,x,H,ae){if(k.length===0)return-1;if(typeof x=="string"?(H=x,x=0):x>2147483647?x=2147483647:x<-2147483648&&(x=-2147483648),x=+x,qe(x)&&(x=ae?0:k.length-1),x<0&&(x=k.length+x),x>=k.length){if(ae)return-1;x=k.length-1}else if(x<0)if(ae)x=0;else return-1;if(typeof b=="string"&&(b=u.from(b,H)),u.isBuffer(b))return b.length===0?-1:X(k,b,x,H,ae);if(typeof b=="number")return b=b&255,typeof Uint8Array.prototype.indexOf=="function"?ae?Uint8Array.prototype.indexOf.call(k,b,x):Uint8Array.prototype.lastIndexOf.call(k,b,x):X(k,[b],x,H,ae);throw new TypeError("val must be string, number or Buffer")}function X(k,b,x,H,ae){let _e=1,we=k.length,Oe=b.length;if(H!==void 0&&(H=String(H).toLowerCase(),H==="ucs2"||H==="ucs-2"||H==="utf16le"||H==="utf-16le")){if(k.length<2||b.length<2)return-1;_e=2,we/=2,Oe/=2,x/=2}function Ye(Ge,Ze){return _e===1?Ge[Ze]:Ge.readUInt16BE(Ze*_e)}let Qe;if(ae){let Ge=-1;for(Qe=x;Qe<we;Qe++)if(Ye(k,Qe)===Ye(b,Ge===-1?0:Qe-Ge)){if(Ge===-1&&(Ge=Qe),Qe-Ge+1===Oe)return Ge*_e}else Ge!==-1&&(Qe-=Qe-Ge),Ge=-1}else for(x+Oe>we&&(x=we-Oe),Qe=x;Qe>=0;Qe--){let Ge=!0;for(let Ze=0;Ze<Oe;Ze++)if(Ye(k,Qe+Ze)!==Ye(b,Ze)){Ge=!1;break}if(Ge)return Qe}return-1}u.prototype.includes=function(b,x,H){return this.indexOf(b,x,H)!==-1},u.prototype.indexOf=function(b,x,H){return O(this,b,x,H,!0)},u.prototype.lastIndexOf=function(b,x,H){return O(this,b,x,H,!1)};function C(k,b,x,H){x=Number(x)||0;const ae=k.length-x;H?(H=Number(H),H>ae&&(H=ae)):H=ae;const _e=b.length;H>_e/2&&(H=_e/2);let we;for(we=0;we<H;++we){const Oe=parseInt(b.substr(we*2,2),16);if(qe(Oe))return we;k[x+we]=Oe}return we}function U(k,b,x,H){return Ae(Se(b,k.length-x),k,x,H)}function R(k,b,x,H){return Ae(Ie(b),k,x,H)}function $(k,b,x,H){return Ae(ve(b),k,x,H)}function G(k,b,x,H){return Ae(le(b,k.length-x),k,x,H)}u.prototype.write=function(b,x,H,ae){if(x===void 0)ae="utf8",H=this.length,x=0;else if(H===void 0&&typeof x=="string")ae=x,H=this.length,x=0;else if(isFinite(x))x=x>>>0,isFinite(H)?(H=H>>>0,ae===void 0&&(ae="utf8")):(ae=H,H=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const _e=this.length-x;if((H===void 0||H>_e)&&(H=_e),b.length>0&&(H<0||x<0)||x>this.length)throw new RangeError("Attempt to write outside buffer bounds");ae||(ae="utf8");let we=!1;for(;;)switch(ae){case"hex":return C(this,b,x,H);case"utf8":case"utf-8":return U(this,b,x,H);case"ascii":case"latin1":case"binary":return R(this,b,x,H);case"base64":return $(this,b,x,H);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,b,x,H);default:if(we)throw new TypeError("Unknown encoding: "+ae);ae=(""+ae).toLowerCase(),we=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j(k,b,x){return b===0&&x===k.length?e.fromByteArray(k):e.fromByteArray(k.slice(b,x))}function F(k,b,x){x=Math.min(k.length,x);const H=[];let ae=b;for(;ae<x;){const _e=k[ae];let we=null,Oe=_e>239?4:_e>223?3:_e>191?2:1;if(ae+Oe<=x){let Ye,Qe,Ge,Ze;switch(Oe){case 1:_e<128&&(we=_e);break;case 2:Ye=k[ae+1],(Ye&192)===128&&(Ze=(_e&31)<<6|Ye&63,Ze>127&&(we=Ze));break;case 3:Ye=k[ae+1],Qe=k[ae+2],(Ye&192)===128&&(Qe&192)===128&&(Ze=(_e&15)<<12|(Ye&63)<<6|Qe&63,Ze>2047&&(Ze<55296||Ze>57343)&&(we=Ze));break;case 4:Ye=k[ae+1],Qe=k[ae+2],Ge=k[ae+3],(Ye&192)===128&&(Qe&192)===128&&(Ge&192)===128&&(Ze=(_e&15)<<18|(Ye&63)<<12|(Qe&63)<<6|Ge&63,Ze>65535&&Ze<1114112&&(we=Ze))}}we===null?(we=65533,Oe=1):we>65535&&(we-=65536,H.push(we>>>10&1023|55296),we=56320|we&1023),H.push(we),ae+=Oe}return M(H)}const se=4096;function M(k){const b=k.length;if(b<=se)return String.fromCharCode.apply(String,k);let x="",H=0;for(;H<b;)x+=String.fromCharCode.apply(String,k.slice(H,H+=se));return x}function re(k,b,x){let H="";x=Math.min(k.length,x);for(let ae=b;ae<x;++ae)H+=String.fromCharCode(k[ae]&127);return H}function B(k,b,x){let H="";x=Math.min(k.length,x);for(let ae=b;ae<x;++ae)H+=String.fromCharCode(k[ae]);return H}function oe(k,b,x){const H=k.length;(!b||b<0)&&(b=0),(!x||x<0||x>H)&&(x=H);let ae="";for(let _e=b;_e<x;++_e)ae+=mt[k[_e]];return ae}function T(k,b,x){const H=k.slice(b,x);let ae="";for(let _e=0;_e<H.length-1;_e+=2)ae+=String.fromCharCode(H[_e]+H[_e+1]*256);return ae}u.prototype.slice=function(b,x){const H=this.length;b=~~b,x=x===void 0?H:~~x,b<0?(b+=H,b<0&&(b=0)):b>H&&(b=H),x<0?(x+=H,x<0&&(x=0)):x>H&&(x=H),x<b&&(x=b);const ae=this.subarray(b,x);return Object.setPrototypeOf(ae,u.prototype),ae};function Q(k,b,x){if(k%1!==0||k<0)throw new RangeError("offset is not uint");if(k+b>x)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(b,x,H){b=b>>>0,x=x>>>0,H||Q(b,x,this.length);let ae=this[b],_e=1,we=0;for(;++we<x&&(_e*=256);)ae+=this[b+we]*_e;return ae},u.prototype.readUintBE=u.prototype.readUIntBE=function(b,x,H){b=b>>>0,x=x>>>0,H||Q(b,x,this.length);let ae=this[b+--x],_e=1;for(;x>0&&(_e*=256);)ae+=this[b+--x]*_e;return ae},u.prototype.readUint8=u.prototype.readUInt8=function(b,x){return b=b>>>0,x||Q(b,1,this.length),this[b]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(b,x){return b=b>>>0,x||Q(b,2,this.length),this[b]|this[b+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(b,x){return b=b>>>0,x||Q(b,2,this.length),this[b]<<8|this[b+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(b,x){return b=b>>>0,x||Q(b,4,this.length),(this[b]|this[b+1]<<8|this[b+2]<<16)+this[b+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(b,x){return b=b>>>0,x||Q(b,4,this.length),this[b]*16777216+(this[b+1]<<16|this[b+2]<<8|this[b+3])},u.prototype.readBigUInt64LE=$e(function(b){b=b>>>0,q(b,"offset");const x=this[b],H=this[b+7];(x===void 0||H===void 0)&&te(b,this.length-8);const ae=x+this[++b]*2**8+this[++b]*2**16+this[++b]*2**24,_e=this[++b]+this[++b]*2**8+this[++b]*2**16+H*2**24;return BigInt(ae)+(BigInt(_e)<<BigInt(32))}),u.prototype.readBigUInt64BE=$e(function(b){b=b>>>0,q(b,"offset");const x=this[b],H=this[b+7];(x===void 0||H===void 0)&&te(b,this.length-8);const ae=x*2**24+this[++b]*2**16+this[++b]*2**8+this[++b],_e=this[++b]*2**24+this[++b]*2**16+this[++b]*2**8+H;return(BigInt(ae)<<BigInt(32))+BigInt(_e)}),u.prototype.readIntLE=function(b,x,H){b=b>>>0,x=x>>>0,H||Q(b,x,this.length);let ae=this[b],_e=1,we=0;for(;++we<x&&(_e*=256);)ae+=this[b+we]*_e;return _e*=128,ae>=_e&&(ae-=Math.pow(2,8*x)),ae},u.prototype.readIntBE=function(b,x,H){b=b>>>0,x=x>>>0,H||Q(b,x,this.length);let ae=x,_e=1,we=this[b+--ae];for(;ae>0&&(_e*=256);)we+=this[b+--ae]*_e;return _e*=128,we>=_e&&(we-=Math.pow(2,8*x)),we},u.prototype.readInt8=function(b,x){return b=b>>>0,x||Q(b,1,this.length),this[b]&128?(255-this[b]+1)*-1:this[b]},u.prototype.readInt16LE=function(b,x){b=b>>>0,x||Q(b,2,this.length);const H=this[b]|this[b+1]<<8;return H&32768?H|4294901760:H},u.prototype.readInt16BE=function(b,x){b=b>>>0,x||Q(b,2,this.length);const H=this[b+1]|this[b]<<8;return H&32768?H|4294901760:H},u.prototype.readInt32LE=function(b,x){return b=b>>>0,x||Q(b,4,this.length),this[b]|this[b+1]<<8|this[b+2]<<16|this[b+3]<<24},u.prototype.readInt32BE=function(b,x){return b=b>>>0,x||Q(b,4,this.length),this[b]<<24|this[b+1]<<16|this[b+2]<<8|this[b+3]},u.prototype.readBigInt64LE=$e(function(b){b=b>>>0,q(b,"offset");const x=this[b],H=this[b+7];(x===void 0||H===void 0)&&te(b,this.length-8);const ae=this[b+4]+this[b+5]*2**8+this[b+6]*2**16+(H<<24);return(BigInt(ae)<<BigInt(32))+BigInt(x+this[++b]*2**8+this[++b]*2**16+this[++b]*2**24)}),u.prototype.readBigInt64BE=$e(function(b){b=b>>>0,q(b,"offset");const x=this[b],H=this[b+7];(x===void 0||H===void 0)&&te(b,this.length-8);const ae=(x<<24)+this[++b]*2**16+this[++b]*2**8+this[++b];return(BigInt(ae)<<BigInt(32))+BigInt(this[++b]*2**24+this[++b]*2**16+this[++b]*2**8+H)}),u.prototype.readFloatLE=function(b,x){return b=b>>>0,x||Q(b,4,this.length),n.read(this,b,!0,23,4)},u.prototype.readFloatBE=function(b,x){return b=b>>>0,x||Q(b,4,this.length),n.read(this,b,!1,23,4)},u.prototype.readDoubleLE=function(b,x){return b=b>>>0,x||Q(b,8,this.length),n.read(this,b,!0,52,8)},u.prototype.readDoubleBE=function(b,x){return b=b>>>0,x||Q(b,8,this.length),n.read(this,b,!1,52,8)};function ie(k,b,x,H,ae,_e){if(!u.isBuffer(k))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>ae||b<_e)throw new RangeError('"value" argument is out of bounds');if(x+H>k.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(b,x,H,ae){if(b=+b,x=x>>>0,H=H>>>0,!ae){const Oe=Math.pow(2,8*H)-1;ie(this,b,x,H,Oe,0)}let _e=1,we=0;for(this[x]=b&255;++we<H&&(_e*=256);)this[x+we]=b/_e&255;return x+H},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(b,x,H,ae){if(b=+b,x=x>>>0,H=H>>>0,!ae){const Oe=Math.pow(2,8*H)-1;ie(this,b,x,H,Oe,0)}let _e=H-1,we=1;for(this[x+_e]=b&255;--_e>=0&&(we*=256);)this[x+_e]=b/we&255;return x+H},u.prototype.writeUint8=u.prototype.writeUInt8=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,1,255,0),this[x]=b&255,x+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,2,65535,0),this[x]=b&255,this[x+1]=b>>>8,x+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,2,65535,0),this[x]=b>>>8,this[x+1]=b&255,x+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,4,4294967295,0),this[x+3]=b>>>24,this[x+2]=b>>>16,this[x+1]=b>>>8,this[x]=b&255,x+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,4,4294967295,0),this[x]=b>>>24,this[x+1]=b>>>16,this[x+2]=b>>>8,this[x+3]=b&255,x+4};function Y(k,b,x,H,ae){Te(b,H,ae,k,x,7);let _e=Number(b&BigInt(4294967295));k[x++]=_e,_e=_e>>8,k[x++]=_e,_e=_e>>8,k[x++]=_e,_e=_e>>8,k[x++]=_e;let we=Number(b>>BigInt(32)&BigInt(4294967295));return k[x++]=we,we=we>>8,k[x++]=we,we=we>>8,k[x++]=we,we=we>>8,k[x++]=we,x}function me(k,b,x,H,ae){Te(b,H,ae,k,x,7);let _e=Number(b&BigInt(4294967295));k[x+7]=_e,_e=_e>>8,k[x+6]=_e,_e=_e>>8,k[x+5]=_e,_e=_e>>8,k[x+4]=_e;let we=Number(b>>BigInt(32)&BigInt(4294967295));return k[x+3]=we,we=we>>8,k[x+2]=we,we=we>>8,k[x+1]=we,we=we>>8,k[x]=we,x+8}u.prototype.writeBigUInt64LE=$e(function(b,x=0){return Y(this,b,x,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=$e(function(b,x=0){return me(this,b,x,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(b,x,H,ae){if(b=+b,x=x>>>0,!ae){const Ye=Math.pow(2,8*H-1);ie(this,b,x,H,Ye-1,-Ye)}let _e=0,we=1,Oe=0;for(this[x]=b&255;++_e<H&&(we*=256);)b<0&&Oe===0&&this[x+_e-1]!==0&&(Oe=1),this[x+_e]=(b/we>>0)-Oe&255;return x+H},u.prototype.writeIntBE=function(b,x,H,ae){if(b=+b,x=x>>>0,!ae){const Ye=Math.pow(2,8*H-1);ie(this,b,x,H,Ye-1,-Ye)}let _e=H-1,we=1,Oe=0;for(this[x+_e]=b&255;--_e>=0&&(we*=256);)b<0&&Oe===0&&this[x+_e+1]!==0&&(Oe=1),this[x+_e]=(b/we>>0)-Oe&255;return x+H},u.prototype.writeInt8=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,1,127,-128),b<0&&(b=255+b+1),this[x]=b&255,x+1},u.prototype.writeInt16LE=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,2,32767,-32768),this[x]=b&255,this[x+1]=b>>>8,x+2},u.prototype.writeInt16BE=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,2,32767,-32768),this[x]=b>>>8,this[x+1]=b&255,x+2},u.prototype.writeInt32LE=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,4,2147483647,-2147483648),this[x]=b&255,this[x+1]=b>>>8,this[x+2]=b>>>16,this[x+3]=b>>>24,x+4},u.prototype.writeInt32BE=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,4,2147483647,-2147483648),b<0&&(b=4294967295+b+1),this[x]=b>>>24,this[x+1]=b>>>16,this[x+2]=b>>>8,this[x+3]=b&255,x+4},u.prototype.writeBigInt64LE=$e(function(b,x=0){return Y(this,b,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=$e(function(b,x=0){return me(this,b,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Z(k,b,x,H,ae,_e){if(x+H>k.length)throw new RangeError("Index out of range");if(x<0)throw new RangeError("Index out of range")}function W(k,b,x,H,ae){return b=+b,x=x>>>0,ae||Z(k,b,x,4),n.write(k,b,x,H,23,4),x+4}u.prototype.writeFloatLE=function(b,x,H){return W(this,b,x,!0,H)},u.prototype.writeFloatBE=function(b,x,H){return W(this,b,x,!1,H)};function ee(k,b,x,H,ae){return b=+b,x=x>>>0,ae||Z(k,b,x,8),n.write(k,b,x,H,52,8),x+8}u.prototype.writeDoubleLE=function(b,x,H){return ee(this,b,x,!0,H)},u.prototype.writeDoubleBE=function(b,x,H){return ee(this,b,x,!1,H)},u.prototype.copy=function(b,x,H,ae){if(!u.isBuffer(b))throw new TypeError("argument should be a Buffer");if(H||(H=0),!ae&&ae!==0&&(ae=this.length),x>=b.length&&(x=b.length),x||(x=0),ae>0&&ae<H&&(ae=H),ae===H||b.length===0||this.length===0)return 0;if(x<0)throw new RangeError("targetStart out of bounds");if(H<0||H>=this.length)throw new RangeError("Index out of range");if(ae<0)throw new RangeError("sourceEnd out of bounds");ae>this.length&&(ae=this.length),b.length-x<ae-H&&(ae=b.length-x+H);const _e=ae-H;return this===b&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(x,H,ae):Uint8Array.prototype.set.call(b,this.subarray(H,ae),x),_e},u.prototype.fill=function(b,x,H,ae){if(typeof b=="string"){if(typeof x=="string"?(ae=x,x=0,H=this.length):typeof H=="string"&&(ae=H,H=this.length),ae!==void 0&&typeof ae!="string")throw new TypeError("encoding must be a string");if(typeof ae=="string"&&!u.isEncoding(ae))throw new TypeError("Unknown encoding: "+ae);if(b.length===1){const we=b.charCodeAt(0);(ae==="utf8"&&we<128||ae==="latin1")&&(b=we)}}else typeof b=="number"?b=b&255:typeof b=="boolean"&&(b=Number(b));if(x<0||this.length<x||this.length<H)throw new RangeError("Out of range index");if(H<=x)return this;x=x>>>0,H=H===void 0?this.length:H>>>0,b||(b=0);let _e;if(typeof b=="number")for(_e=x;_e<H;++_e)this[_e]=b;else{const we=u.isBuffer(b)?b:u.from(b,ae),Oe=we.length;if(Oe===0)throw new TypeError('The value "'+b+'" is invalid for argument "value"');for(_e=0;_e<H-x;++_e)this[_e+x]=we[_e%Oe]}return this};const K={};function ue(k,b,x){K[k]=class extends x{constructor(){super(),Object.defineProperty(this,"message",{value:b.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${k}]`,this.stack,delete this.name}get code(){return k}set code(ae){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ae,writable:!0})}toString(){return`${this.name} [${k}]: ${this.message}`}}}ue("ERR_BUFFER_OUT_OF_BOUNDS",function(k){return k?`${k} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ue("ERR_INVALID_ARG_TYPE",function(k,b){return`The "${k}" argument must be of type number. Received type ${typeof b}`},TypeError),ue("ERR_OUT_OF_RANGE",function(k,b,x){let H=`The value of "${k}" is out of range.`,ae=x;return Number.isInteger(x)&&Math.abs(x)>2**32?ae=ce(String(x)):typeof x=="bigint"&&(ae=String(x),(x>BigInt(2)**BigInt(32)||x<-(BigInt(2)**BigInt(32)))&&(ae=ce(ae)),ae+="n"),H+=` It must be ${b}. Received ${ae}`,H},RangeError);function ce(k){let b="",x=k.length;const H=k[0]==="-"?1:0;for(;x>=H+4;x-=3)b=`_${k.slice(x-3,x)}${b}`;return`${k.slice(0,x)}${b}`}function Ee(k,b,x){q(b,"offset"),(k[b]===void 0||k[b+x]===void 0)&&te(b,k.length-(x+1))}function Te(k,b,x,H,ae,_e){if(k>x||k<b){const we=typeof b=="bigint"?"n":"";let Oe;throw b===0||b===BigInt(0)?Oe=`>= 0${we} and < 2${we} ** ${(_e+1)*8}${we}`:Oe=`>= -(2${we} ** ${(_e+1)*8-1}${we}) and < 2 ** ${(_e+1)*8-1}${we}`,new K.ERR_OUT_OF_RANGE("value",Oe,k)}Ee(H,ae,_e)}function q(k,b){if(typeof k!="number")throw new K.ERR_INVALID_ARG_TYPE(b,"number",k)}function te(k,b,x){throw Math.floor(k)!==k?(q(k,x),new K.ERR_OUT_OF_RANGE("offset","an integer",k)):b<0?new K.ERR_BUFFER_OUT_OF_BOUNDS:new K.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${b}`,k)}const fe=/[^+/0-9A-Za-z-_]/g;function xe(k){if(k=k.split("=")[0],k=k.trim().replace(fe,""),k.length<2)return"";for(;k.length%4!==0;)k=k+"=";return k}function Se(k,b){b=b||1/0;let x;const H=k.length;let ae=null;const _e=[];for(let we=0;we<H;++we){if(x=k.charCodeAt(we),x>55295&&x<57344){if(!ae){if(x>56319){(b-=3)>-1&&_e.push(239,191,189);continue}else if(we+1===H){(b-=3)>-1&&_e.push(239,191,189);continue}ae=x;continue}if(x<56320){(b-=3)>-1&&_e.push(239,191,189),ae=x;continue}x=(ae-55296<<10|x-56320)+65536}else ae&&(b-=3)>-1&&_e.push(239,191,189);if(ae=null,x<128){if((b-=1)<0)break;_e.push(x)}else if(x<2048){if((b-=2)<0)break;_e.push(x>>6|192,x&63|128)}else if(x<65536){if((b-=3)<0)break;_e.push(x>>12|224,x>>6&63|128,x&63|128)}else if(x<1114112){if((b-=4)<0)break;_e.push(x>>18|240,x>>12&63|128,x>>6&63|128,x&63|128)}else throw new Error("Invalid code point")}return _e}function Ie(k){const b=[];for(let x=0;x<k.length;++x)b.push(k.charCodeAt(x)&255);return b}function le(k,b){let x,H,ae;const _e=[];for(let we=0;we<k.length&&!((b-=2)<0);++we)x=k.charCodeAt(we),H=x>>8,ae=x%256,_e.push(ae),_e.push(H);return _e}function ve(k){return e.toByteArray(xe(k))}function Ae(k,b,x,H){let ae;for(ae=0;ae<H&&!(ae+x>=b.length||ae>=k.length);++ae)b[ae+x]=k[ae];return ae}function be(k,b){return k instanceof b||k!=null&&k.constructor!=null&&k.constructor.name!=null&&k.constructor.name===b.name}function qe(k){return k!==k}const mt=(function(){const k="0123456789abcdef",b=new Array(256);for(let x=0;x<16;++x){const H=x*16;for(let ae=0;ae<16;++ae)b[H+ae]=k[x]+k[ae]}return b})();function $e(k){return typeof BigInt>"u"?ft:k}function ft(){throw new Error("BigInt not supported")}})(Do)),Do}var Lg=Dn();const pr="http://www.w3.org/1999/02/22-rdf-syntax-ns#",gr="http://www.w3.org/2001/XMLSchema#",_s="http://www.w3.org/2000/10/swap/",Lt={xsd:{decimal:`${gr}decimal`,boolean:`${gr}boolean`,double:`${gr}double`,integer:`${gr}integer`,string:`${gr}string`},rdf:{type:`${pr}type`,nil:`${pr}nil`,first:`${pr}first`,rest:`${pr}rest`,langString:`${pr}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${_s}reify#forSome`,forAll:`${_s}reify#forAll`},log:{implies:`${_s}log#implies`,isImpliedBy:`${_s}log#isImpliedBy`}},{xsd:ys}=Lt,Ig=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,nc={"\\":"\\","'":"'",'"':'"',n:`
|
|
2
|
-
`,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Ag=/[\x00-\x20<>\\"\{\}\|\^\`]/,Ng={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},Rg=/$0^/;class Cg{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const n in this)!(n in Ng)&&this[n]instanceof RegExp&&(this[n]=Rg)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,n){let r=this._input,o=r.length;for(;;){let u,f;for(;u=this._newline.exec(r);)this.comments&&(f=this._comment.exec(u[0]))&&a("comment",f[1],"",this._line,u[0].length),r=r.substr(u[0].length,r.length),o=r.length,this._line++;if(!u&&(u=this._whitespace.exec(r))&&(r=r.substr(u[0].length,r.length)),this._endOfFile.test(r))return n&&(this.comments&&(f=this._comment.exec(r))&&a("comment",f[1],"",this._line,r.length),r=null,a("eof","","",this._line,0)),this._input=r;const h=this._line,g=r[0];let _="",d="",m="",w=null,I=0,A=!1;switch(g){case"^":if(r.length<3)break;if(r[1]==="^"){if(this._previousMarker="^^",r=r.substr(2),r[0]!=="<"){A=!0;break}}else{this._n3Mode&&(I=1,_="^");break}case"<":if(w=this._unescapedIri.exec(r))_="IRI",d=w[1];else if(w=this._iri.exec(r)){if(d=this._unescape(w[1]),d===null||Ag.test(d))return l(this);_="IRI"}else r.length>1&&r[1]==="<"?(_="<<",I=2):this._n3Mode&&r.length>1&&r[1]==="="&&(I=2,this._isImpliedBy?(_="abbreviation",d="<"):(_="inverse",d=">"));break;case">":r.length>1&&r[1]===">"&&(_=">>",I=2);break;case"_":((w=this._blank.exec(r))||n&&(w=this._blank.exec(`${r} `)))&&(_="blank",m="_",d=w[1]);break;case'"':if(w=this._simpleQuotedString.exec(r))d=w[1];else if({value:d,matchLength:I}=this._parseLiteral(r),d===null)return l(this);(w!==null||I!==0)&&(_="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(w=this._simpleApostropheString.exec(r))d=w[1];else if({value:d,matchLength:I}=this._parseLiteral(r),d===null)return l(this);(w!==null||I!==0)&&(_="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(w=this._variable.exec(r))&&(_="var",d=w[0]);break;case"@":this._previousMarker==="literal"&&(w=this._langcode.exec(r))?(_="langcode",d=w[1]):(w=this._keyword.exec(r))&&(_=w[0]);break;case".":if(r.length===1?n:r[1]<"0"||r[1]>"9"){_=".",I=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(w=this._number.exec(r)||n&&(w=this._number.exec(`${r} `)))&&(_="literal",d=w[0],m=typeof w[1]=="string"?ys.double:typeof w[2]=="string"?ys.decimal:ys.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(w=this._sparqlKeyword.exec(r))?_=w[0].toUpperCase():A=!0;break;case"f":case"t":(w=this._boolean.exec(r))?(_="literal",d=w[0],m=ys.boolean):A=!0;break;case"a":(w=this._shortPredicates.exec(r))?(_="abbreviation",d="a"):A=!0;break;case"=":this._n3Mode&&r.length>1&&(_="abbreviation",r[1]!==">"?(I=1,d="="):(I=2,d=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(I=1,_=g);break;case"{":!this._lineMode&&r.length>=2&&(r[1]==="|"?(_="{|",I=2):(_=g,I=1));break;case"|":r.length>=2&&r[1]==="}"&&(_="|}",I=2);break;default:A=!0}if(A&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(w=this._prefix.exec(r))?(_="prefix",d=w[1]||""):((w=this._prefixed.exec(r))||n&&(w=this._prefixed.exec(`${r} `)))&&(_="prefixed",m=w[1]||"",d=this._unescape(w[2]))),this._previousMarker==="^^")switch(_){case"prefixed":_="type";break;case"IRI":_="typeIRI";break;default:_=""}if(!_)return n||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?l(this):this._input=r;const N=I||w[0].length,P=a(_,d,m,h,N);this.previousToken=P,this._previousMarker=_,r=r.substr(N,r.length)}function a(u,f,h,g,_){const d=r?o-r.length:o,m=d+_,w={type:u,value:f,prefix:h,line:g,start:d,end:m};return e(null,w),w}function l(u){e(u._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let n=!1;const r=e.replace(Ig,(o,a,l,u)=>{if(typeof a=="string")return String.fromCharCode(Number.parseInt(a,16));if(typeof l=="string"){let f=Number.parseInt(l,16);return f<=65535?String.fromCharCode(Number.parseInt(l,16)):String.fromCharCode(55296+((f-=65536)>>10),56320+(f&1023))}return u in nc?nc[u]:(n=!0,"")});return n?null:r}_parseLiteral(e){if(e.length>=3){const n=e.match(/^(?:"""|"|'''|'|)/)[0],r=n.length;let o=Math.max(this._literalClosingPos,r);for(;(o=e.indexOf(n,o))>0;){let a=0;for(;e[o-a-1]==="\\";)a++;if(a%2===0){const l=e.substring(r,o),u=l.split(/\r\n|\r|\n/).length-1,f=o+r;if(r===1&&u!==0||r===3&&this._lineMode)break;return this._line+=u,{value:this._unescape(l),matchLength:f}}o++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const n=new Error(`Unexpected "${e}" on line ${this._line}.`);return n.context={token:void 0,line:this._line,previousToken:this.previousToken},n}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,n){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof n=="function")queueMicrotask(()=>this._tokenizeToEnd(n,!0));else{const r=[];let o;if(this._tokenizeToEnd((a,l)=>a?o=a:r.push(l),!0),o)throw o;return r}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",r=>{this._input!==null&&r.length!==0&&(this._pendingBuffer&&(r=Lg.Buffer.concat([this._pendingBuffer,r]),this._pendingBuffer=null),r[r.length-1]&128?this._pendingBuffer=r:(typeof this._input>"u"?this._input=this._readStartingBom(typeof r=="string"?r:r.toString()):this._input+=r,this._tokenizeToEnd(n,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(n,!0)}),e.on("error",n)}}const{rdf:Pg,xsd:_i}=Lt;let Ji,kg=0;const Be={namedNode:af,blankNode:lf,variable:cf,literal:uf,defaultGraph:Fg,quad:bl,triple:bl,fromTerm:Or,fromQuad:df};class un{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof un?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}let vi=class extends un{get termType(){return"NamedNode"}},ln=class sf extends un{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let n=e.lastIndexOf('"')+1;return n<e.length&&e[n++]==="@"?e.substr(n).toLowerCase():""}get datatype(){return new vi(this.datatypeString)}get datatypeString(){const e=this.id,n=e.lastIndexOf('"')+1,r=n<e.length?e[n]:"";return r==="^"?e.substr(n+2):r!=="@"?_i.string:Pg.langString}equals(e){return e instanceof sf?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}},Dg=class extends un{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},Mg=class extends un{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},Og=class extends un{constructor(){return super(""),Ji||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};Ji=new Og;function Mr(i,e,n){if(e=e||Be,!i)return e.defaultGraph();switch(i[0]){case"?":return e.variable(i.substr(1));case"_":return e.blankNode(i.substr(2));case'"':if(e===Be)return new ln(i);if(i[i.length-1]==='"')return e.literal(i.substr(1,i.length-2));const r=i.lastIndexOf('"',i.length-1);return e.literal(i.substr(1,r-1),i[r+1]==="@"?i.substr(r+2):e.namedNode(i.substr(r+3)));case"[":i=JSON.parse(i);break;default:if(!n||!Array.isArray(i))return e.namedNode(i)}return e.quad(Mr(i[0],e,!0),Mr(i[1],e,!0),Mr(i[2],e,!0),i[3]&&Mr(i[3],e,!0))}function zi(i,e){if(typeof i=="string")return i;if(i instanceof un&&i.termType!=="Quad")return i.id;if(!i)return Ji.id;switch(i.termType){case"NamedNode":return i.value;case"BlankNode":return`_:${i.value}`;case"Variable":return`?${i.value}`;case"DefaultGraph":return"";case"Literal":return`"${i.value}"${i.language?`@${i.language}`:i.datatype&&i.datatype.value!==_i.string?`^^${i.datatype.value}`:""}`;case"Quad":const n=[zi(i.subject,!0),zi(i.predicate,!0),zi(i.object,!0)];return i.graph&&i.graph.termType!=="DefaultGraph"&&n.push(zi(i.graph,!0)),e?n:JSON.stringify(n);default:throw new Error(`Unexpected termType: ${i.termType}`)}}let of=class extends un{constructor(e,n,r,o){super(""),this._subject=e,this._predicate=n,this._object=r,this._graph=o||Ji}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}};function af(i){return new vi(i)}function lf(i){return new Dg(i||`n3-${kg++}`)}function uf(i,e){if(typeof e=="string")return new ln(`"${i}"@${e.toLowerCase()}`);let n=e?e.value:"";return n===""&&(typeof i=="boolean"?n=_i.boolean:typeof i=="number"&&(Number.isFinite(i)?n=Number.isInteger(i)?_i.integer:_i.double:(n=_i.double,Number.isNaN(i)||(i=i>0?"INF":"-INF")))),n===""||n===_i.string?new ln(`"${i}"`):new ln(`"${i}"^^${n}`)}function cf(i){return new Mg(i)}function Fg(){return Ji}function bl(i,e,n,r){return new of(i,e,n,r)}function Or(i){if(i instanceof un)return i;switch(i.termType){case"NamedNode":return af(i.value);case"BlankNode":return lf(i.value);case"Variable":return cf(i.value);case"DefaultGraph":return Ji;case"Literal":return uf(i.value,i.language||i.datatype);case"Quad":return df(i);default:throw new Error(`Unexpected termType: ${i.termType}`)}}function df(i){if(i instanceof of)return i;if(i.termType!=="Quad")throw new Error(`Unexpected termType: ${i.termType}`);return bl(Or(i.subject),Or(i.predicate),Or(i.object),Or(i.graph))}let ic=0;class hf{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&ff(this,e.factory);const n=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(n),o=/trig/.test(n),a=/triple/.test(n),l=/quad/.test(n),u=this._n3Mode=/n3/.test(n),f=a||l;(this._supportsNamedGraphs=!(r||u))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||o||a||u),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=n===""||/star|\*$/.test(n),f&&(this._resolveRelativeIRI=h=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new Cg({lineMode:f,n3:u,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){ic=0}_setBase(e){if(!e)this._base="",this._basePath="";else{const n=e.indexOf("#");n>=0&&(e=e.substr(0,n)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}}_saveContext(e,n,r,o,a){const l=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:o,object:a,graph:n,inverse:l?this._inversePredicate:!1,blankPrefix:l?this._prefixes._:"",quantified:l?this._quantified:null}),l&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,n){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${n.type}`,n);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.quantified)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,n){let r;switch(e.type){case"IRI":case"typeIRI":const o=this._resolveIRI(e.value);if(o===null)return this._error("Invalid IRI",e);r=this._factory.namedNode(o);break;case"type":case"prefixed":const a=this._prefixes[e.prefix];if(a===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._factory.namedNode(a+e.value);break;case"blank":r=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!n&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const n=e.type;switch(n){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${n}`,e):(this._subject=null,n==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._object=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return e.type==="{"?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return e.type!=="{"?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return e.type==="]"?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);const n=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:n?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let n=null,r=null,o=this._readListItem;const a=this._subject,l=this._contextStack,u=l[l.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this._subject=n=this._factory.blankNode()),o=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),l.length!==0&&l[l.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(o=this._readPredicate,this._subject===this.RDF_NIL)return o}else if(o=this._getContextEndReader(),this._object===this.RDF_NIL)return o;r=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,o=this._readListItemDataTypeOrLang):(n=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),o=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if((n=this._readEntity(e))===void 0)return}if(r===null&&(this._subject=r=this._factory.blankNode()),a===null?u.predicate===null?u.subject=r:u.object=r:this._emit(a,this.RDF_REST,r,this._graph),n!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,r,this.RDF_FIRST,n),this._subject=n,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,n,this._graph)}return o}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let n=this._factory.literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(r===void 0)return;n=this._factory.literal(this._literalValue,r),e=null;break;case"langcode":n=this._factory.literal(this._literalValue,e.value),e=null;break}return{token:e,literal:n}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,n){const r=this._completeLiteral(e);if(r)return this._object=r.literal,n&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),r.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let n,r=this._graph;const o=this._subject,a=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,n=this._contextStack.length?this._readSubject:this._readInTopContext,a&&(this._inversePredicate=!1);break;case";":n=this._readPredicate;break;case",":n=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",e);const l=this._predicate,u=this._object;this._subject=this._factory.quad(o,l,u,this.DEFAULTGRAPH),n=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",e);this._subject=null,n=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(r=this._readEntity(e))!==void 0){n=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(o!==null){const l=this._predicate,u=this._object;a?this._emit(u,l,o,r):this._emit(o,l,u,r)}return n}_readBlankNodePunctuation(e){let n;switch(e.type){case";":n=this._readPredicate;break;case",":n=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),n}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const n=this._readEntity(e);return this._prefixes[this._prefix]=n.value,this._prefixCallback(this._prefix,n),this._readDeclarationPunctuation}_readBaseIRI(e){const n=e.type==="IRI"&&this._resolveIRI(e.value);return n?(this._setBase(n),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let n;switch(e.type){case"IRI":case"prefixed":if((n=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,n,this.QUANTIFIERS_GRAPH)):this._quantified[n.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const n=this._contextStack,r=n.length&&n[n.length-1];if(r&&r.type==="item"){const o=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,o,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let n,r;const o=this._factory.blankNode();if((r=this._readEntity(e))!==void 0)return this._predicate===null?(n=this._subject,this._subject=o):(n=this._object,this._object=o),this._emit(n,r,o,this._graph),this._readPath}_readBackwardPath(e){const n=this._factory.blankNode();let r,o;if((r=this._readEntity(e))!==void 0)return this._predicate===null?(o=this._subject,this._subject=n):(o=this._object,this._object=n),this._emit(n,r,o,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);const n=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=n,this._readPredicate):(this._object=n,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,n,r,o){this._callback(null,this._factory.quad(e,n,r,o||this.DEFAULTGRAPH))}_error(e,n){const r=new Error(`${e} on line ${n.line}.`);r.context={token:n,line:n.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=bs}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return(e[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const n=e.length;let r="",o=-1,a=-1,l=0,u="/";for(;o<n;){switch(u){case":":if(a<0&&e[++o]==="/"&&e[++o]==="/")for(;(a=o+1)<n&&e[a]!=="/";)o=a;break;case"?":case"#":o=n;break;case"/":if(e[o+1]===".")switch(u=e[++o+1],u){case"/":r+=e.substring(l,o-1),l=o+1;break;case void 0:case"?":case"#":return r+e.substring(l,o)+e.substr(o+1);case".":if(u=e[++o+1],u===void 0||u==="/"||u==="?"||u==="#"){if(r+=e.substring(l,o-2),(l=r.lastIndexOf("/"))>=a&&(r=r.substr(0,l)),u!=="/")return`${r}/${e.substr(o+1)}`;l=o+1}}}u=e[++o]}return r+e.substring(l)}parse(e,n,r){let o,a,l;if(n&&(n.onQuad||n.onPrefix||n.onComment)?(o=n.onQuad,a=n.onPrefix,l=n.onComment):(o=n,a=r),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${ic++}_`,this._prefixCallback=a||bs,this._inversePredicate=!1,this._quantified=Object.create(null),!o){const f=[];let h;if(this._callback=(g,_)=>{g?h=g:_&&f.push(_)},this._lexer.tokenize(e).every(g=>this._readCallback=this._readCallback(g)),h)throw h;return f}let u=(f,h)=>{f!==null?(this._callback(f),this._callback=bs):this._readCallback&&(this._readCallback=this._readCallback(h))};l&&(this._lexer.comments=!0,u=(f,h)=>{f!==null?(this._callback(f),this._callback=bs):this._readCallback&&(h.type==="comment"?l(h.value):this._readCallback=this._readCallback(h))}),this._callback=o,this._lexer.tokenize(e,u)}}function bs(){}function ff(i,e){i._factory=e,i.DEFAULTGRAPH=e.defaultGraph(),i.RDF_FIRST=e.namedNode(Lt.rdf.first),i.RDF_REST=e.namedNode(Lt.rdf.rest),i.RDF_NIL=e.namedNode(Lt.rdf.nil),i.N3_FORALL=e.namedNode(Lt.r.forAll),i.N3_FORSOME=e.namedNode(Lt.r.forSome),i.ABBREVIATIONS={a:e.namedNode(Lt.rdf.type),"=":e.namedNode(Lt.owl.sameAs),">":e.namedNode(Lt.log.implies),"<":e.namedNode(Lt.log.isImpliedBy)},i.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}ff(hf.prototype,Be);function vl(i){return!!i&&i.termType==="DefaultGraph"}function As(i){return i.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const jg=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,Bg=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,rc="./",$g="../",Mo="?",sc="#";class Pl{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!jg.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!Pl.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],n=["^",As(e)],r=[],o=[],a=/[^/?#]*([/?#])/y;let l,u=0,f=0,h=a.lastIndex=e.length;for(;!u&&!f&&(l=a.exec(this.base));)l[1]===sc?f=a.lastIndex-1:(n.push(As(l[0]),"(?:"),r.push(")?"),l[1]!==Mo?o.push(h=a.lastIndex):(u=h=a.lastIndex,f=this.base.indexOf(sc,u),this._pathReplacements[u]=Mo));for(let g=0;g<o.length;g++)this._pathReplacements[o[g]]=$g.repeat(o.length-g-1);return this._pathReplacements[o[o.length-1]]=rc,this._baseLength=f>0?f:this.base.length,n.push(As(this.base.substring(h,this._baseLength)),u?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...n,...r].join(""))}toRelative(e){const n=this._getBaseMatcher().exec(e);if(!n)return e;const r=n[0].length;if(r===this._baseLength&&r===e.length)return"";const o=this._pathReplacements[r];if(o){const a=e.substring(r);return o!==Mo&&!Bg.test(a)?e:o===rc&&/^[^?#]/.test(a)?a:o+a}return e.substring(r-1)}}const mr=Be.defaultGraph(),{rdf:qg,xsd:Fi}=Lt,oc=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,ac=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,zg={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class _r extends un{equals(e){return e===this}}class kl{constructor(e,n){if(this._prefixRegex=/$0^/,e&&typeof e.write!="function"&&(n=e,e=null),n=n||{},this._lists=n.lists,e)this._outputStream=e,this._endStream=n.end===void 0?!0:!!n.end;else{let r="";this._outputStream={write(o,a,l){r+=o,l&&l()},end:o=>{o&&o(null,r)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(n.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=mr,this._prefixIRIs=Object.create(null),n.prefixes&&this.addPrefixes(n.prefixes),n.baseIRI&&(this._baseIri=new Pl(n.baseIRI)))}get _inDefaultGraph(){return mr.equals(this._graph)}_write(e,n){this._outputStream.write(e,"utf8",n)}_writeQuad(e,n,r,o,a){try{o.equals(this._graph)||(this._write((this._subject===null?"":this._inDefaultGraph?`.
|
|
1
|
+
var qi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rf(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Mo={},fr={},Yu;function Tg(){if(Yu)return fr;Yu=1,fr.byteLength=u,fr.toByteArray=h,fr.fromByteArray=d;for(var i=[],e=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=r.length;o<a;++o)i[o]=r[o],e[r.charCodeAt(o)]=o;e[45]=62,e[95]=63;function l(_){var v=_.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=_.indexOf("=");I===-1&&(I=v);var A=I===v?0:4-I%4;return[I,A]}function u(_){var v=l(_),I=v[0],A=v[1];return(I+A)*3/4-A}function f(_,v,I){return(v+I)*3/4-I}function h(_){var v,I=l(_),A=I[0],N=I[1],P=new n(f(_,A,N)),w=0,y=N>0?A-4:A,S;for(S=0;S<y;S+=4)v=e[_.charCodeAt(S)]<<18|e[_.charCodeAt(S+1)]<<12|e[_.charCodeAt(S+2)]<<6|e[_.charCodeAt(S+3)],P[w++]=v>>16&255,P[w++]=v>>8&255,P[w++]=v&255;return N===2&&(v=e[_.charCodeAt(S)]<<2|e[_.charCodeAt(S+1)]>>4,P[w++]=v&255),N===1&&(v=e[_.charCodeAt(S)]<<10|e[_.charCodeAt(S+1)]<<4|e[_.charCodeAt(S+2)]>>2,P[w++]=v>>8&255,P[w++]=v&255),P}function g(_){return i[_>>18&63]+i[_>>12&63]+i[_>>6&63]+i[_&63]}function m(_,v,I){for(var A,N=[],P=v;P<I;P+=3)A=(_[P]<<16&16711680)+(_[P+1]<<8&65280)+(_[P+2]&255),N.push(g(A));return N.join("")}function d(_){for(var v,I=_.length,A=I%3,N=[],P=16383,w=0,y=I-A;w<y;w+=P)N.push(m(_,w,w+P>y?y:w+P));return A===1?(v=_[I-1],N.push(i[v>>2]+i[v<<4&63]+"==")):A===2&&(v=(_[I-2]<<8)+_[I-1],N.push(i[v>>10]+i[v>>4&63]+i[v<<2&63]+"=")),N.join("")}return fr}var _s={};var ec;function Lg(){return ec||(ec=1,_s.read=function(i,e,n,r,o){var a,l,u=o*8-r-1,f=(1<<u)-1,h=f>>1,g=-7,m=n?o-1:0,d=n?-1:1,_=i[e+m];for(m+=d,a=_&(1<<-g)-1,_>>=-g,g+=u;g>0;a=a*256+i[e+m],m+=d,g-=8);for(l=a&(1<<-g)-1,a>>=-g,g+=r;g>0;l=l*256+i[e+m],m+=d,g-=8);if(a===0)a=1-h;else{if(a===f)return l?NaN:(_?-1:1)*(1/0);l=l+Math.pow(2,r),a=a-h}return(_?-1:1)*l*Math.pow(2,a-r)},_s.write=function(i,e,n,r,o,a){var l,u,f,h=a*8-o-1,g=(1<<h)-1,m=g>>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=r?0:a-1,v=r?1:-1,I=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,l=g):(l=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-l))<1&&(l--,f*=2),l+m>=1?e+=d/f:e+=d*Math.pow(2,1-m),e*f>=2&&(l++,f/=2),l+m>=g?(u=0,l=g):l+m>=1?(u=(e*f-1)*Math.pow(2,o),l=l+m):(u=e*Math.pow(2,m-1)*Math.pow(2,o),l=0));o>=8;i[n+_]=u&255,_+=v,u/=256,o-=8);for(l=l<<o|u,h+=o;h>0;i[n+_]=l&255,_+=v,l/=256,h-=8);i[n+_-v]|=I*128}),_s}var tc;function Dn(){return tc||(tc=1,(function(i){const e=Tg(),n=Lg(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;i.Buffer=u,i.SlowBuffer=P,i.INSPECT_MAX_BYTES=50;const o=2147483647;i.kMaxLength=o,u.TYPED_ARRAY_SUPPORT=a(),!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{const k=new Uint8Array(1),b={foo:function(){return 42}};return Object.setPrototypeOf(b,Uint8Array.prototype),Object.setPrototypeOf(k,b),k.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function l(k){if(k>o)throw new RangeError('The value "'+k+'" is invalid for option "size"');const b=new Uint8Array(k);return Object.setPrototypeOf(b,u.prototype),b}function u(k,b,x){if(typeof k=="number"){if(typeof b=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(k)}return f(k,b,x)}u.poolSize=8192;function f(k,b,x){if(typeof k=="string")return d(k,b);if(ArrayBuffer.isView(k))return v(k);if(k==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k);if(be(k,ArrayBuffer)||k&&be(k.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(be(k,SharedArrayBuffer)||k&&be(k.buffer,SharedArrayBuffer)))return I(k,b,x);if(typeof k=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const H=k.valueOf&&k.valueOf();if(H!=null&&H!==k)return u.from(H,b,x);const ae=A(k);if(ae)return ae;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof k[Symbol.toPrimitive]=="function")return u.from(k[Symbol.toPrimitive]("string"),b,x);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k)}u.from=function(k,b,x){return f(k,b,x)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array);function h(k){if(typeof k!="number")throw new TypeError('"size" argument must be of type number');if(k<0)throw new RangeError('The value "'+k+'" is invalid for option "size"')}function g(k,b,x){return h(k),k<=0?l(k):b!==void 0?typeof x=="string"?l(k).fill(b,x):l(k).fill(b):l(k)}u.alloc=function(k,b,x){return g(k,b,x)};function m(k){return h(k),l(k<0?0:N(k)|0)}u.allocUnsafe=function(k){return m(k)},u.allocUnsafeSlow=function(k){return m(k)};function d(k,b){if((typeof b!="string"||b==="")&&(b="utf8"),!u.isEncoding(b))throw new TypeError("Unknown encoding: "+b);const x=w(k,b)|0;let H=l(x);const ae=H.write(k,b);return ae!==x&&(H=H.slice(0,ae)),H}function _(k){const b=k.length<0?0:N(k.length)|0,x=l(b);for(let H=0;H<b;H+=1)x[H]=k[H]&255;return x}function v(k){if(be(k,Uint8Array)){const b=new Uint8Array(k);return I(b.buffer,b.byteOffset,b.byteLength)}return _(k)}function I(k,b,x){if(b<0||k.byteLength<b)throw new RangeError('"offset" is outside of buffer bounds');if(k.byteLength<b+(x||0))throw new RangeError('"length" is outside of buffer bounds');let H;return b===void 0&&x===void 0?H=new Uint8Array(k):x===void 0?H=new Uint8Array(k,b):H=new Uint8Array(k,b,x),Object.setPrototypeOf(H,u.prototype),H}function A(k){if(u.isBuffer(k)){const b=N(k.length)|0,x=l(b);return x.length===0||k.copy(x,0,0,b),x}if(k.length!==void 0)return typeof k.length!="number"||qe(k.length)?l(0):_(k);if(k.type==="Buffer"&&Array.isArray(k.data))return _(k.data)}function N(k){if(k>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return k|0}function P(k){return+k!=k&&(k=0),u.alloc(+k)}u.isBuffer=function(b){return b!=null&&b._isBuffer===!0&&b!==u.prototype},u.compare=function(b,x){if(be(b,Uint8Array)&&(b=u.from(b,b.offset,b.byteLength)),be(x,Uint8Array)&&(x=u.from(x,x.offset,x.byteLength)),!u.isBuffer(b)||!u.isBuffer(x))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(b===x)return 0;let H=b.length,ae=x.length;for(let _e=0,we=Math.min(H,ae);_e<we;++_e)if(b[_e]!==x[_e]){H=b[_e],ae=x[_e];break}return H<ae?-1:ae<H?1:0},u.isEncoding=function(b){switch(String(b).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(b,x){if(!Array.isArray(b))throw new TypeError('"list" argument must be an Array of Buffers');if(b.length===0)return u.alloc(0);let H;if(x===void 0)for(x=0,H=0;H<b.length;++H)x+=b[H].length;const ae=u.allocUnsafe(x);let _e=0;for(H=0;H<b.length;++H){let we=b[H];if(be(we,Uint8Array))_e+we.length>ae.length?(u.isBuffer(we)||(we=u.from(we)),we.copy(ae,_e)):Uint8Array.prototype.set.call(ae,we,_e);else if(u.isBuffer(we))we.copy(ae,_e);else throw new TypeError('"list" argument must be an Array of Buffers');_e+=we.length}return ae};function w(k,b){if(u.isBuffer(k))return k.length;if(ArrayBuffer.isView(k)||be(k,ArrayBuffer))return k.byteLength;if(typeof k!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof k);const x=k.length,H=arguments.length>2&&arguments[2]===!0;if(!H&&x===0)return 0;let ae=!1;for(;;)switch(b){case"ascii":case"latin1":case"binary":return x;case"utf8":case"utf-8":return Se(k).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x*2;case"hex":return x>>>1;case"base64":return ve(k).length;default:if(ae)return H?-1:Se(k).length;b=(""+b).toLowerCase(),ae=!0}}u.byteLength=w;function y(k,b,x){let H=!1;if((b===void 0||b<0)&&(b=0),b>this.length||((x===void 0||x>this.length)&&(x=this.length),x<=0)||(x>>>=0,b>>>=0,x<=b))return"";for(k||(k="utf8");;)switch(k){case"hex":return oe(this,b,x);case"utf8":case"utf-8":return F(this,b,x);case"ascii":return re(this,b,x);case"latin1":case"binary":return B(this,b,x);case"base64":return j(this,b,x);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,b,x);default:if(H)throw new TypeError("Unknown encoding: "+k);k=(k+"").toLowerCase(),H=!0}}u.prototype._isBuffer=!0;function S(k,b,x){const H=k[b];k[b]=k[x],k[x]=H}u.prototype.swap16=function(){const b=this.length;if(b%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let x=0;x<b;x+=2)S(this,x,x+1);return this},u.prototype.swap32=function(){const b=this.length;if(b%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let x=0;x<b;x+=4)S(this,x,x+3),S(this,x+1,x+2);return this},u.prototype.swap64=function(){const b=this.length;if(b%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let x=0;x<b;x+=8)S(this,x,x+7),S(this,x+1,x+6),S(this,x+2,x+5),S(this,x+3,x+4);return this},u.prototype.toString=function(){const b=this.length;return b===0?"":arguments.length===0?F(this,0,b):y.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(b){if(!u.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b?!0:u.compare(this,b)===0},u.prototype.inspect=function(){let b="";const x=i.INSPECT_MAX_BYTES;return b=this.toString("hex",0,x).replace(/(.{2})/g,"$1 ").trim(),this.length>x&&(b+=" ... "),"<Buffer "+b+">"},r&&(u.prototype[r]=u.prototype.inspect),u.prototype.compare=function(b,x,H,ae,_e){if(be(b,Uint8Array)&&(b=u.from(b,b.offset,b.byteLength)),!u.isBuffer(b))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof b);if(x===void 0&&(x=0),H===void 0&&(H=b?b.length:0),ae===void 0&&(ae=0),_e===void 0&&(_e=this.length),x<0||H>b.length||ae<0||_e>this.length)throw new RangeError("out of range index");if(ae>=_e&&x>=H)return 0;if(ae>=_e)return-1;if(x>=H)return 1;if(x>>>=0,H>>>=0,ae>>>=0,_e>>>=0,this===b)return 0;let we=_e-ae,Oe=H-x;const Ye=Math.min(we,Oe),Qe=this.slice(ae,_e),Ge=b.slice(x,H);for(let Ze=0;Ze<Ye;++Ze)if(Qe[Ze]!==Ge[Ze]){we=Qe[Ze],Oe=Ge[Ze];break}return we<Oe?-1:Oe<we?1:0};function O(k,b,x,H,ae){if(k.length===0)return-1;if(typeof x=="string"?(H=x,x=0):x>2147483647?x=2147483647:x<-2147483648&&(x=-2147483648),x=+x,qe(x)&&(x=ae?0:k.length-1),x<0&&(x=k.length+x),x>=k.length){if(ae)return-1;x=k.length-1}else if(x<0)if(ae)x=0;else return-1;if(typeof b=="string"&&(b=u.from(b,H)),u.isBuffer(b))return b.length===0?-1:X(k,b,x,H,ae);if(typeof b=="number")return b=b&255,typeof Uint8Array.prototype.indexOf=="function"?ae?Uint8Array.prototype.indexOf.call(k,b,x):Uint8Array.prototype.lastIndexOf.call(k,b,x):X(k,[b],x,H,ae);throw new TypeError("val must be string, number or Buffer")}function X(k,b,x,H,ae){let _e=1,we=k.length,Oe=b.length;if(H!==void 0&&(H=String(H).toLowerCase(),H==="ucs2"||H==="ucs-2"||H==="utf16le"||H==="utf-16le")){if(k.length<2||b.length<2)return-1;_e=2,we/=2,Oe/=2,x/=2}function Ye(Ge,Ze){return _e===1?Ge[Ze]:Ge.readUInt16BE(Ze*_e)}let Qe;if(ae){let Ge=-1;for(Qe=x;Qe<we;Qe++)if(Ye(k,Qe)===Ye(b,Ge===-1?0:Qe-Ge)){if(Ge===-1&&(Ge=Qe),Qe-Ge+1===Oe)return Ge*_e}else Ge!==-1&&(Qe-=Qe-Ge),Ge=-1}else for(x+Oe>we&&(x=we-Oe),Qe=x;Qe>=0;Qe--){let Ge=!0;for(let Ze=0;Ze<Oe;Ze++)if(Ye(k,Qe+Ze)!==Ye(b,Ze)){Ge=!1;break}if(Ge)return Qe}return-1}u.prototype.includes=function(b,x,H){return this.indexOf(b,x,H)!==-1},u.prototype.indexOf=function(b,x,H){return O(this,b,x,H,!0)},u.prototype.lastIndexOf=function(b,x,H){return O(this,b,x,H,!1)};function C(k,b,x,H){x=Number(x)||0;const ae=k.length-x;H?(H=Number(H),H>ae&&(H=ae)):H=ae;const _e=b.length;H>_e/2&&(H=_e/2);let we;for(we=0;we<H;++we){const Oe=parseInt(b.substr(we*2,2),16);if(qe(Oe))return we;k[x+we]=Oe}return we}function U(k,b,x,H){return Ae(Se(b,k.length-x),k,x,H)}function R(k,b,x,H){return Ae(Ie(b),k,x,H)}function $(k,b,x,H){return Ae(ve(b),k,x,H)}function G(k,b,x,H){return Ae(le(b,k.length-x),k,x,H)}u.prototype.write=function(b,x,H,ae){if(x===void 0)ae="utf8",H=this.length,x=0;else if(H===void 0&&typeof x=="string")ae=x,H=this.length,x=0;else if(isFinite(x))x=x>>>0,isFinite(H)?(H=H>>>0,ae===void 0&&(ae="utf8")):(ae=H,H=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const _e=this.length-x;if((H===void 0||H>_e)&&(H=_e),b.length>0&&(H<0||x<0)||x>this.length)throw new RangeError("Attempt to write outside buffer bounds");ae||(ae="utf8");let we=!1;for(;;)switch(ae){case"hex":return C(this,b,x,H);case"utf8":case"utf-8":return U(this,b,x,H);case"ascii":case"latin1":case"binary":return R(this,b,x,H);case"base64":return $(this,b,x,H);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,b,x,H);default:if(we)throw new TypeError("Unknown encoding: "+ae);ae=(""+ae).toLowerCase(),we=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j(k,b,x){return b===0&&x===k.length?e.fromByteArray(k):e.fromByteArray(k.slice(b,x))}function F(k,b,x){x=Math.min(k.length,x);const H=[];let ae=b;for(;ae<x;){const _e=k[ae];let we=null,Oe=_e>239?4:_e>223?3:_e>191?2:1;if(ae+Oe<=x){let Ye,Qe,Ge,Ze;switch(Oe){case 1:_e<128&&(we=_e);break;case 2:Ye=k[ae+1],(Ye&192)===128&&(Ze=(_e&31)<<6|Ye&63,Ze>127&&(we=Ze));break;case 3:Ye=k[ae+1],Qe=k[ae+2],(Ye&192)===128&&(Qe&192)===128&&(Ze=(_e&15)<<12|(Ye&63)<<6|Qe&63,Ze>2047&&(Ze<55296||Ze>57343)&&(we=Ze));break;case 4:Ye=k[ae+1],Qe=k[ae+2],Ge=k[ae+3],(Ye&192)===128&&(Qe&192)===128&&(Ge&192)===128&&(Ze=(_e&15)<<18|(Ye&63)<<12|(Qe&63)<<6|Ge&63,Ze>65535&&Ze<1114112&&(we=Ze))}}we===null?(we=65533,Oe=1):we>65535&&(we-=65536,H.push(we>>>10&1023|55296),we=56320|we&1023),H.push(we),ae+=Oe}return M(H)}const se=4096;function M(k){const b=k.length;if(b<=se)return String.fromCharCode.apply(String,k);let x="",H=0;for(;H<b;)x+=String.fromCharCode.apply(String,k.slice(H,H+=se));return x}function re(k,b,x){let H="";x=Math.min(k.length,x);for(let ae=b;ae<x;++ae)H+=String.fromCharCode(k[ae]&127);return H}function B(k,b,x){let H="";x=Math.min(k.length,x);for(let ae=b;ae<x;++ae)H+=String.fromCharCode(k[ae]);return H}function oe(k,b,x){const H=k.length;(!b||b<0)&&(b=0),(!x||x<0||x>H)&&(x=H);let ae="";for(let _e=b;_e<x;++_e)ae+=mt[k[_e]];return ae}function T(k,b,x){const H=k.slice(b,x);let ae="";for(let _e=0;_e<H.length-1;_e+=2)ae+=String.fromCharCode(H[_e]+H[_e+1]*256);return ae}u.prototype.slice=function(b,x){const H=this.length;b=~~b,x=x===void 0?H:~~x,b<0?(b+=H,b<0&&(b=0)):b>H&&(b=H),x<0?(x+=H,x<0&&(x=0)):x>H&&(x=H),x<b&&(x=b);const ae=this.subarray(b,x);return Object.setPrototypeOf(ae,u.prototype),ae};function Q(k,b,x){if(k%1!==0||k<0)throw new RangeError("offset is not uint");if(k+b>x)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(b,x,H){b=b>>>0,x=x>>>0,H||Q(b,x,this.length);let ae=this[b],_e=1,we=0;for(;++we<x&&(_e*=256);)ae+=this[b+we]*_e;return ae},u.prototype.readUintBE=u.prototype.readUIntBE=function(b,x,H){b=b>>>0,x=x>>>0,H||Q(b,x,this.length);let ae=this[b+--x],_e=1;for(;x>0&&(_e*=256);)ae+=this[b+--x]*_e;return ae},u.prototype.readUint8=u.prototype.readUInt8=function(b,x){return b=b>>>0,x||Q(b,1,this.length),this[b]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(b,x){return b=b>>>0,x||Q(b,2,this.length),this[b]|this[b+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(b,x){return b=b>>>0,x||Q(b,2,this.length),this[b]<<8|this[b+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(b,x){return b=b>>>0,x||Q(b,4,this.length),(this[b]|this[b+1]<<8|this[b+2]<<16)+this[b+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(b,x){return b=b>>>0,x||Q(b,4,this.length),this[b]*16777216+(this[b+1]<<16|this[b+2]<<8|this[b+3])},u.prototype.readBigUInt64LE=$e(function(b){b=b>>>0,q(b,"offset");const x=this[b],H=this[b+7];(x===void 0||H===void 0)&&te(b,this.length-8);const ae=x+this[++b]*2**8+this[++b]*2**16+this[++b]*2**24,_e=this[++b]+this[++b]*2**8+this[++b]*2**16+H*2**24;return BigInt(ae)+(BigInt(_e)<<BigInt(32))}),u.prototype.readBigUInt64BE=$e(function(b){b=b>>>0,q(b,"offset");const x=this[b],H=this[b+7];(x===void 0||H===void 0)&&te(b,this.length-8);const ae=x*2**24+this[++b]*2**16+this[++b]*2**8+this[++b],_e=this[++b]*2**24+this[++b]*2**16+this[++b]*2**8+H;return(BigInt(ae)<<BigInt(32))+BigInt(_e)}),u.prototype.readIntLE=function(b,x,H){b=b>>>0,x=x>>>0,H||Q(b,x,this.length);let ae=this[b],_e=1,we=0;for(;++we<x&&(_e*=256);)ae+=this[b+we]*_e;return _e*=128,ae>=_e&&(ae-=Math.pow(2,8*x)),ae},u.prototype.readIntBE=function(b,x,H){b=b>>>0,x=x>>>0,H||Q(b,x,this.length);let ae=x,_e=1,we=this[b+--ae];for(;ae>0&&(_e*=256);)we+=this[b+--ae]*_e;return _e*=128,we>=_e&&(we-=Math.pow(2,8*x)),we},u.prototype.readInt8=function(b,x){return b=b>>>0,x||Q(b,1,this.length),this[b]&128?(255-this[b]+1)*-1:this[b]},u.prototype.readInt16LE=function(b,x){b=b>>>0,x||Q(b,2,this.length);const H=this[b]|this[b+1]<<8;return H&32768?H|4294901760:H},u.prototype.readInt16BE=function(b,x){b=b>>>0,x||Q(b,2,this.length);const H=this[b+1]|this[b]<<8;return H&32768?H|4294901760:H},u.prototype.readInt32LE=function(b,x){return b=b>>>0,x||Q(b,4,this.length),this[b]|this[b+1]<<8|this[b+2]<<16|this[b+3]<<24},u.prototype.readInt32BE=function(b,x){return b=b>>>0,x||Q(b,4,this.length),this[b]<<24|this[b+1]<<16|this[b+2]<<8|this[b+3]},u.prototype.readBigInt64LE=$e(function(b){b=b>>>0,q(b,"offset");const x=this[b],H=this[b+7];(x===void 0||H===void 0)&&te(b,this.length-8);const ae=this[b+4]+this[b+5]*2**8+this[b+6]*2**16+(H<<24);return(BigInt(ae)<<BigInt(32))+BigInt(x+this[++b]*2**8+this[++b]*2**16+this[++b]*2**24)}),u.prototype.readBigInt64BE=$e(function(b){b=b>>>0,q(b,"offset");const x=this[b],H=this[b+7];(x===void 0||H===void 0)&&te(b,this.length-8);const ae=(x<<24)+this[++b]*2**16+this[++b]*2**8+this[++b];return(BigInt(ae)<<BigInt(32))+BigInt(this[++b]*2**24+this[++b]*2**16+this[++b]*2**8+H)}),u.prototype.readFloatLE=function(b,x){return b=b>>>0,x||Q(b,4,this.length),n.read(this,b,!0,23,4)},u.prototype.readFloatBE=function(b,x){return b=b>>>0,x||Q(b,4,this.length),n.read(this,b,!1,23,4)},u.prototype.readDoubleLE=function(b,x){return b=b>>>0,x||Q(b,8,this.length),n.read(this,b,!0,52,8)},u.prototype.readDoubleBE=function(b,x){return b=b>>>0,x||Q(b,8,this.length),n.read(this,b,!1,52,8)};function ie(k,b,x,H,ae,_e){if(!u.isBuffer(k))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>ae||b<_e)throw new RangeError('"value" argument is out of bounds');if(x+H>k.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(b,x,H,ae){if(b=+b,x=x>>>0,H=H>>>0,!ae){const Oe=Math.pow(2,8*H)-1;ie(this,b,x,H,Oe,0)}let _e=1,we=0;for(this[x]=b&255;++we<H&&(_e*=256);)this[x+we]=b/_e&255;return x+H},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(b,x,H,ae){if(b=+b,x=x>>>0,H=H>>>0,!ae){const Oe=Math.pow(2,8*H)-1;ie(this,b,x,H,Oe,0)}let _e=H-1,we=1;for(this[x+_e]=b&255;--_e>=0&&(we*=256);)this[x+_e]=b/we&255;return x+H},u.prototype.writeUint8=u.prototype.writeUInt8=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,1,255,0),this[x]=b&255,x+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,2,65535,0),this[x]=b&255,this[x+1]=b>>>8,x+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,2,65535,0),this[x]=b>>>8,this[x+1]=b&255,x+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,4,4294967295,0),this[x+3]=b>>>24,this[x+2]=b>>>16,this[x+1]=b>>>8,this[x]=b&255,x+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,4,4294967295,0),this[x]=b>>>24,this[x+1]=b>>>16,this[x+2]=b>>>8,this[x+3]=b&255,x+4};function Y(k,b,x,H,ae){Te(b,H,ae,k,x,7);let _e=Number(b&BigInt(4294967295));k[x++]=_e,_e=_e>>8,k[x++]=_e,_e=_e>>8,k[x++]=_e,_e=_e>>8,k[x++]=_e;let we=Number(b>>BigInt(32)&BigInt(4294967295));return k[x++]=we,we=we>>8,k[x++]=we,we=we>>8,k[x++]=we,we=we>>8,k[x++]=we,x}function me(k,b,x,H,ae){Te(b,H,ae,k,x,7);let _e=Number(b&BigInt(4294967295));k[x+7]=_e,_e=_e>>8,k[x+6]=_e,_e=_e>>8,k[x+5]=_e,_e=_e>>8,k[x+4]=_e;let we=Number(b>>BigInt(32)&BigInt(4294967295));return k[x+3]=we,we=we>>8,k[x+2]=we,we=we>>8,k[x+1]=we,we=we>>8,k[x]=we,x+8}u.prototype.writeBigUInt64LE=$e(function(b,x=0){return Y(this,b,x,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=$e(function(b,x=0){return me(this,b,x,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(b,x,H,ae){if(b=+b,x=x>>>0,!ae){const Ye=Math.pow(2,8*H-1);ie(this,b,x,H,Ye-1,-Ye)}let _e=0,we=1,Oe=0;for(this[x]=b&255;++_e<H&&(we*=256);)b<0&&Oe===0&&this[x+_e-1]!==0&&(Oe=1),this[x+_e]=(b/we>>0)-Oe&255;return x+H},u.prototype.writeIntBE=function(b,x,H,ae){if(b=+b,x=x>>>0,!ae){const Ye=Math.pow(2,8*H-1);ie(this,b,x,H,Ye-1,-Ye)}let _e=H-1,we=1,Oe=0;for(this[x+_e]=b&255;--_e>=0&&(we*=256);)b<0&&Oe===0&&this[x+_e+1]!==0&&(Oe=1),this[x+_e]=(b/we>>0)-Oe&255;return x+H},u.prototype.writeInt8=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,1,127,-128),b<0&&(b=255+b+1),this[x]=b&255,x+1},u.prototype.writeInt16LE=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,2,32767,-32768),this[x]=b&255,this[x+1]=b>>>8,x+2},u.prototype.writeInt16BE=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,2,32767,-32768),this[x]=b>>>8,this[x+1]=b&255,x+2},u.prototype.writeInt32LE=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,4,2147483647,-2147483648),this[x]=b&255,this[x+1]=b>>>8,this[x+2]=b>>>16,this[x+3]=b>>>24,x+4},u.prototype.writeInt32BE=function(b,x,H){return b=+b,x=x>>>0,H||ie(this,b,x,4,2147483647,-2147483648),b<0&&(b=4294967295+b+1),this[x]=b>>>24,this[x+1]=b>>>16,this[x+2]=b>>>8,this[x+3]=b&255,x+4},u.prototype.writeBigInt64LE=$e(function(b,x=0){return Y(this,b,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=$e(function(b,x=0){return me(this,b,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Z(k,b,x,H,ae,_e){if(x+H>k.length)throw new RangeError("Index out of range");if(x<0)throw new RangeError("Index out of range")}function W(k,b,x,H,ae){return b=+b,x=x>>>0,ae||Z(k,b,x,4),n.write(k,b,x,H,23,4),x+4}u.prototype.writeFloatLE=function(b,x,H){return W(this,b,x,!0,H)},u.prototype.writeFloatBE=function(b,x,H){return W(this,b,x,!1,H)};function ee(k,b,x,H,ae){return b=+b,x=x>>>0,ae||Z(k,b,x,8),n.write(k,b,x,H,52,8),x+8}u.prototype.writeDoubleLE=function(b,x,H){return ee(this,b,x,!0,H)},u.prototype.writeDoubleBE=function(b,x,H){return ee(this,b,x,!1,H)},u.prototype.copy=function(b,x,H,ae){if(!u.isBuffer(b))throw new TypeError("argument should be a Buffer");if(H||(H=0),!ae&&ae!==0&&(ae=this.length),x>=b.length&&(x=b.length),x||(x=0),ae>0&&ae<H&&(ae=H),ae===H||b.length===0||this.length===0)return 0;if(x<0)throw new RangeError("targetStart out of bounds");if(H<0||H>=this.length)throw new RangeError("Index out of range");if(ae<0)throw new RangeError("sourceEnd out of bounds");ae>this.length&&(ae=this.length),b.length-x<ae-H&&(ae=b.length-x+H);const _e=ae-H;return this===b&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(x,H,ae):Uint8Array.prototype.set.call(b,this.subarray(H,ae),x),_e},u.prototype.fill=function(b,x,H,ae){if(typeof b=="string"){if(typeof x=="string"?(ae=x,x=0,H=this.length):typeof H=="string"&&(ae=H,H=this.length),ae!==void 0&&typeof ae!="string")throw new TypeError("encoding must be a string");if(typeof ae=="string"&&!u.isEncoding(ae))throw new TypeError("Unknown encoding: "+ae);if(b.length===1){const we=b.charCodeAt(0);(ae==="utf8"&&we<128||ae==="latin1")&&(b=we)}}else typeof b=="number"?b=b&255:typeof b=="boolean"&&(b=Number(b));if(x<0||this.length<x||this.length<H)throw new RangeError("Out of range index");if(H<=x)return this;x=x>>>0,H=H===void 0?this.length:H>>>0,b||(b=0);let _e;if(typeof b=="number")for(_e=x;_e<H;++_e)this[_e]=b;else{const we=u.isBuffer(b)?b:u.from(b,ae),Oe=we.length;if(Oe===0)throw new TypeError('The value "'+b+'" is invalid for argument "value"');for(_e=0;_e<H-x;++_e)this[_e+x]=we[_e%Oe]}return this};const K={};function ue(k,b,x){K[k]=class extends x{constructor(){super(),Object.defineProperty(this,"message",{value:b.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${k}]`,this.stack,delete this.name}get code(){return k}set code(ae){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ae,writable:!0})}toString(){return`${this.name} [${k}]: ${this.message}`}}}ue("ERR_BUFFER_OUT_OF_BOUNDS",function(k){return k?`${k} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ue("ERR_INVALID_ARG_TYPE",function(k,b){return`The "${k}" argument must be of type number. Received type ${typeof b}`},TypeError),ue("ERR_OUT_OF_RANGE",function(k,b,x){let H=`The value of "${k}" is out of range.`,ae=x;return Number.isInteger(x)&&Math.abs(x)>2**32?ae=ce(String(x)):typeof x=="bigint"&&(ae=String(x),(x>BigInt(2)**BigInt(32)||x<-(BigInt(2)**BigInt(32)))&&(ae=ce(ae)),ae+="n"),H+=` It must be ${b}. Received ${ae}`,H},RangeError);function ce(k){let b="",x=k.length;const H=k[0]==="-"?1:0;for(;x>=H+4;x-=3)b=`_${k.slice(x-3,x)}${b}`;return`${k.slice(0,x)}${b}`}function Ee(k,b,x){q(b,"offset"),(k[b]===void 0||k[b+x]===void 0)&&te(b,k.length-(x+1))}function Te(k,b,x,H,ae,_e){if(k>x||k<b){const we=typeof b=="bigint"?"n":"";let Oe;throw b===0||b===BigInt(0)?Oe=`>= 0${we} and < 2${we} ** ${(_e+1)*8}${we}`:Oe=`>= -(2${we} ** ${(_e+1)*8-1}${we}) and < 2 ** ${(_e+1)*8-1}${we}`,new K.ERR_OUT_OF_RANGE("value",Oe,k)}Ee(H,ae,_e)}function q(k,b){if(typeof k!="number")throw new K.ERR_INVALID_ARG_TYPE(b,"number",k)}function te(k,b,x){throw Math.floor(k)!==k?(q(k,x),new K.ERR_OUT_OF_RANGE("offset","an integer",k)):b<0?new K.ERR_BUFFER_OUT_OF_BOUNDS:new K.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${b}`,k)}const fe=/[^+/0-9A-Za-z-_]/g;function xe(k){if(k=k.split("=")[0],k=k.trim().replace(fe,""),k.length<2)return"";for(;k.length%4!==0;)k=k+"=";return k}function Se(k,b){b=b||1/0;let x;const H=k.length;let ae=null;const _e=[];for(let we=0;we<H;++we){if(x=k.charCodeAt(we),x>55295&&x<57344){if(!ae){if(x>56319){(b-=3)>-1&&_e.push(239,191,189);continue}else if(we+1===H){(b-=3)>-1&&_e.push(239,191,189);continue}ae=x;continue}if(x<56320){(b-=3)>-1&&_e.push(239,191,189),ae=x;continue}x=(ae-55296<<10|x-56320)+65536}else ae&&(b-=3)>-1&&_e.push(239,191,189);if(ae=null,x<128){if((b-=1)<0)break;_e.push(x)}else if(x<2048){if((b-=2)<0)break;_e.push(x>>6|192,x&63|128)}else if(x<65536){if((b-=3)<0)break;_e.push(x>>12|224,x>>6&63|128,x&63|128)}else if(x<1114112){if((b-=4)<0)break;_e.push(x>>18|240,x>>12&63|128,x>>6&63|128,x&63|128)}else throw new Error("Invalid code point")}return _e}function Ie(k){const b=[];for(let x=0;x<k.length;++x)b.push(k.charCodeAt(x)&255);return b}function le(k,b){let x,H,ae;const _e=[];for(let we=0;we<k.length&&!((b-=2)<0);++we)x=k.charCodeAt(we),H=x>>8,ae=x%256,_e.push(ae),_e.push(H);return _e}function ve(k){return e.toByteArray(xe(k))}function Ae(k,b,x,H){let ae;for(ae=0;ae<H&&!(ae+x>=b.length||ae>=k.length);++ae)b[ae+x]=k[ae];return ae}function be(k,b){return k instanceof b||k!=null&&k.constructor!=null&&k.constructor.name!=null&&k.constructor.name===b.name}function qe(k){return k!==k}const mt=(function(){const k="0123456789abcdef",b=new Array(256);for(let x=0;x<16;++x){const H=x*16;for(let ae=0;ae<16;++ae)b[H+ae]=k[x]+k[ae]}return b})();function $e(k){return typeof BigInt>"u"?ft:k}function ft(){throw new Error("BigInt not supported")}})(Mo)),Mo}var Ig=Dn();const pr="http://www.w3.org/1999/02/22-rdf-syntax-ns#",gr="http://www.w3.org/2001/XMLSchema#",ys="http://www.w3.org/2000/10/swap/",Lt={xsd:{decimal:`${gr}decimal`,boolean:`${gr}boolean`,double:`${gr}double`,integer:`${gr}integer`,string:`${gr}string`},rdf:{type:`${pr}type`,nil:`${pr}nil`,first:`${pr}first`,rest:`${pr}rest`,langString:`${pr}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${ys}reify#forSome`,forAll:`${ys}reify#forAll`},log:{implies:`${ys}log#implies`,isImpliedBy:`${ys}log#isImpliedBy`}},{xsd:bs}=Lt,Ag=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,nc={"\\":"\\","'":"'",'"':'"',n:`
|
|
2
|
+
`,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Ng=/[\x00-\x20<>\\"\{\}\|\^\`]/,Rg={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},Cg=/$0^/;class Pg{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const n in this)!(n in Rg)&&this[n]instanceof RegExp&&(this[n]=Cg)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,n){let r=this._input,o=r.length;for(;;){let u,f;for(;u=this._newline.exec(r);)this.comments&&(f=this._comment.exec(u[0]))&&a("comment",f[1],"",this._line,u[0].length),r=r.substr(u[0].length,r.length),o=r.length,this._line++;if(!u&&(u=this._whitespace.exec(r))&&(r=r.substr(u[0].length,r.length)),this._endOfFile.test(r))return n&&(this.comments&&(f=this._comment.exec(r))&&a("comment",f[1],"",this._line,r.length),r=null,a("eof","","",this._line,0)),this._input=r;const h=this._line,g=r[0];let m="",d="",_="",v=null,I=0,A=!1;switch(g){case"^":if(r.length<3)break;if(r[1]==="^"){if(this._previousMarker="^^",r=r.substr(2),r[0]!=="<"){A=!0;break}}else{this._n3Mode&&(I=1,m="^");break}case"<":if(v=this._unescapedIri.exec(r))m="IRI",d=v[1];else if(v=this._iri.exec(r)){if(d=this._unescape(v[1]),d===null||Ng.test(d))return l(this);m="IRI"}else r.length>1&&r[1]==="<"?(m="<<",I=2):this._n3Mode&&r.length>1&&r[1]==="="&&(I=2,this._isImpliedBy?(m="abbreviation",d="<"):(m="inverse",d=">"));break;case">":r.length>1&&r[1]===">"&&(m=">>",I=2);break;case"_":((v=this._blank.exec(r))||n&&(v=this._blank.exec(`${r} `)))&&(m="blank",_="_",d=v[1]);break;case'"':if(v=this._simpleQuotedString.exec(r))d=v[1];else if({value:d,matchLength:I}=this._parseLiteral(r),d===null)return l(this);(v!==null||I!==0)&&(m="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(v=this._simpleApostropheString.exec(r))d=v[1];else if({value:d,matchLength:I}=this._parseLiteral(r),d===null)return l(this);(v!==null||I!==0)&&(m="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(v=this._variable.exec(r))&&(m="var",d=v[0]);break;case"@":this._previousMarker==="literal"&&(v=this._langcode.exec(r))?(m="langcode",d=v[1]):(v=this._keyword.exec(r))&&(m=v[0]);break;case".":if(r.length===1?n:r[1]<"0"||r[1]>"9"){m=".",I=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(v=this._number.exec(r)||n&&(v=this._number.exec(`${r} `)))&&(m="literal",d=v[0],_=typeof v[1]=="string"?bs.double:typeof v[2]=="string"?bs.decimal:bs.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(v=this._sparqlKeyword.exec(r))?m=v[0].toUpperCase():A=!0;break;case"f":case"t":(v=this._boolean.exec(r))?(m="literal",d=v[0],_=bs.boolean):A=!0;break;case"a":(v=this._shortPredicates.exec(r))?(m="abbreviation",d="a"):A=!0;break;case"=":this._n3Mode&&r.length>1&&(m="abbreviation",r[1]!==">"?(I=1,d="="):(I=2,d=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(I=1,m=g);break;case"{":!this._lineMode&&r.length>=2&&(r[1]==="|"?(m="{|",I=2):(m=g,I=1));break;case"|":r.length>=2&&r[1]==="}"&&(m="|}",I=2);break;default:A=!0}if(A&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(v=this._prefix.exec(r))?(m="prefix",d=v[1]||""):((v=this._prefixed.exec(r))||n&&(v=this._prefixed.exec(`${r} `)))&&(m="prefixed",_=v[1]||"",d=this._unescape(v[2]))),this._previousMarker==="^^")switch(m){case"prefixed":m="type";break;case"IRI":m="typeIRI";break;default:m=""}if(!m)return n||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?l(this):this._input=r;const N=I||v[0].length,P=a(m,d,_,h,N);this.previousToken=P,this._previousMarker=m,r=r.substr(N,r.length)}function a(u,f,h,g,m){const d=r?o-r.length:o,_=d+m,v={type:u,value:f,prefix:h,line:g,start:d,end:_};return e(null,v),v}function l(u){e(u._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let n=!1;const r=e.replace(Ag,(o,a,l,u)=>{if(typeof a=="string")return String.fromCharCode(Number.parseInt(a,16));if(typeof l=="string"){let f=Number.parseInt(l,16);return f<=65535?String.fromCharCode(Number.parseInt(l,16)):String.fromCharCode(55296+((f-=65536)>>10),56320+(f&1023))}return u in nc?nc[u]:(n=!0,"")});return n?null:r}_parseLiteral(e){if(e.length>=3){const n=e.match(/^(?:"""|"|'''|'|)/)[0],r=n.length;let o=Math.max(this._literalClosingPos,r);for(;(o=e.indexOf(n,o))>0;){let a=0;for(;e[o-a-1]==="\\";)a++;if(a%2===0){const l=e.substring(r,o),u=l.split(/\r\n|\r|\n/).length-1,f=o+r;if(r===1&&u!==0||r===3&&this._lineMode)break;return this._line+=u,{value:this._unescape(l),matchLength:f}}o++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const n=new Error(`Unexpected "${e}" on line ${this._line}.`);return n.context={token:void 0,line:this._line,previousToken:this.previousToken},n}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,n){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof n=="function")queueMicrotask(()=>this._tokenizeToEnd(n,!0));else{const r=[];let o;if(this._tokenizeToEnd((a,l)=>a?o=a:r.push(l),!0),o)throw o;return r}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",r=>{this._input!==null&&r.length!==0&&(this._pendingBuffer&&(r=Ig.Buffer.concat([this._pendingBuffer,r]),this._pendingBuffer=null),r[r.length-1]&128?this._pendingBuffer=r:(typeof this._input>"u"?this._input=this._readStartingBom(typeof r=="string"?r:r.toString()):this._input+=r,this._tokenizeToEnd(n,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(n,!0)}),e.on("error",n)}}const{rdf:kg,xsd:_i}=Lt;let Ji,Dg=0;const Be={namedNode:af,blankNode:lf,variable:cf,literal:uf,defaultGraph:jg,quad:bl,triple:bl,fromTerm:Or,fromQuad:df};class un{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof un?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}let vi=class extends un{get termType(){return"NamedNode"}},ln=class sf extends un{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let n=e.lastIndexOf('"')+1;return n<e.length&&e[n++]==="@"?e.substr(n).toLowerCase():""}get datatype(){return new vi(this.datatypeString)}get datatypeString(){const e=this.id,n=e.lastIndexOf('"')+1,r=n<e.length?e[n]:"";return r==="^"?e.substr(n+2):r!=="@"?_i.string:kg.langString}equals(e){return e instanceof sf?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}},Mg=class extends un{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},Og=class extends un{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},Fg=class extends un{constructor(){return super(""),Ji||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};Ji=new Fg;function Mr(i,e,n){if(e=e||Be,!i)return e.defaultGraph();switch(i[0]){case"?":return e.variable(i.substr(1));case"_":return e.blankNode(i.substr(2));case'"':if(e===Be)return new ln(i);if(i[i.length-1]==='"')return e.literal(i.substr(1,i.length-2));const r=i.lastIndexOf('"',i.length-1);return e.literal(i.substr(1,r-1),i[r+1]==="@"?i.substr(r+2):e.namedNode(i.substr(r+3)));case"[":i=JSON.parse(i);break;default:if(!n||!Array.isArray(i))return e.namedNode(i)}return e.quad(Mr(i[0],e,!0),Mr(i[1],e,!0),Mr(i[2],e,!0),i[3]&&Mr(i[3],e,!0))}function zi(i,e){if(typeof i=="string")return i;if(i instanceof un&&i.termType!=="Quad")return i.id;if(!i)return Ji.id;switch(i.termType){case"NamedNode":return i.value;case"BlankNode":return`_:${i.value}`;case"Variable":return`?${i.value}`;case"DefaultGraph":return"";case"Literal":return`"${i.value}"${i.language?`@${i.language}`:i.datatype&&i.datatype.value!==_i.string?`^^${i.datatype.value}`:""}`;case"Quad":const n=[zi(i.subject,!0),zi(i.predicate,!0),zi(i.object,!0)];return i.graph&&i.graph.termType!=="DefaultGraph"&&n.push(zi(i.graph,!0)),e?n:JSON.stringify(n);default:throw new Error(`Unexpected termType: ${i.termType}`)}}let of=class extends un{constructor(e,n,r,o){super(""),this._subject=e,this._predicate=n,this._object=r,this._graph=o||Ji}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}};function af(i){return new vi(i)}function lf(i){return new Mg(i||`n3-${Dg++}`)}function uf(i,e){if(typeof e=="string")return new ln(`"${i}"@${e.toLowerCase()}`);let n=e?e.value:"";return n===""&&(typeof i=="boolean"?n=_i.boolean:typeof i=="number"&&(Number.isFinite(i)?n=Number.isInteger(i)?_i.integer:_i.double:(n=_i.double,Number.isNaN(i)||(i=i>0?"INF":"-INF")))),n===""||n===_i.string?new ln(`"${i}"`):new ln(`"${i}"^^${n}`)}function cf(i){return new Og(i)}function jg(){return Ji}function bl(i,e,n,r){return new of(i,e,n,r)}function Or(i){if(i instanceof un)return i;switch(i.termType){case"NamedNode":return af(i.value);case"BlankNode":return lf(i.value);case"Variable":return cf(i.value);case"DefaultGraph":return Ji;case"Literal":return uf(i.value,i.language||i.datatype);case"Quad":return df(i);default:throw new Error(`Unexpected termType: ${i.termType}`)}}function df(i){if(i instanceof of)return i;if(i.termType!=="Quad")throw new Error(`Unexpected termType: ${i.termType}`);return bl(Or(i.subject),Or(i.predicate),Or(i.object),Or(i.graph))}let ic=0;class hf{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&ff(this,e.factory);const n=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(n),o=/trig/.test(n),a=/triple/.test(n),l=/quad/.test(n),u=this._n3Mode=/n3/.test(n),f=a||l;(this._supportsNamedGraphs=!(r||u))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||o||a||u),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=n===""||/star|\*$/.test(n),f&&(this._resolveRelativeIRI=h=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new Pg({lineMode:f,n3:u,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){ic=0}_setBase(e){if(!e)this._base="",this._basePath="";else{const n=e.indexOf("#");n>=0&&(e=e.substr(0,n)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}}_saveContext(e,n,r,o,a){const l=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:o,object:a,graph:n,inverse:l?this._inversePredicate:!1,blankPrefix:l?this._prefixes._:"",quantified:l?this._quantified:null}),l&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,n){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${n.type}`,n);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.quantified)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,n){let r;switch(e.type){case"IRI":case"typeIRI":const o=this._resolveIRI(e.value);if(o===null)return this._error("Invalid IRI",e);r=this._factory.namedNode(o);break;case"type":case"prefixed":const a=this._prefixes[e.prefix];if(a===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._factory.namedNode(a+e.value);break;case"blank":r=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!n&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const n=e.type;switch(n){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${n}`,e):(this._subject=null,n==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._object=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return e.type==="{"?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return e.type!=="{"?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return e.type==="]"?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);const n=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:n?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let n=null,r=null,o=this._readListItem;const a=this._subject,l=this._contextStack,u=l[l.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this._subject=n=this._factory.blankNode()),o=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),l.length!==0&&l[l.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(o=this._readPredicate,this._subject===this.RDF_NIL)return o}else if(o=this._getContextEndReader(),this._object===this.RDF_NIL)return o;r=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,o=this._readListItemDataTypeOrLang):(n=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),o=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if((n=this._readEntity(e))===void 0)return}if(r===null&&(this._subject=r=this._factory.blankNode()),a===null?u.predicate===null?u.subject=r:u.object=r:this._emit(a,this.RDF_REST,r,this._graph),n!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,r,this.RDF_FIRST,n),this._subject=n,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,n,this._graph)}return o}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let n=this._factory.literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(r===void 0)return;n=this._factory.literal(this._literalValue,r),e=null;break;case"langcode":n=this._factory.literal(this._literalValue,e.value),e=null;break}return{token:e,literal:n}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,n){const r=this._completeLiteral(e);if(r)return this._object=r.literal,n&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),r.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let n,r=this._graph;const o=this._subject,a=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,n=this._contextStack.length?this._readSubject:this._readInTopContext,a&&(this._inversePredicate=!1);break;case";":n=this._readPredicate;break;case",":n=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",e);const l=this._predicate,u=this._object;this._subject=this._factory.quad(o,l,u,this.DEFAULTGRAPH),n=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",e);this._subject=null,n=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(r=this._readEntity(e))!==void 0){n=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(o!==null){const l=this._predicate,u=this._object;a?this._emit(u,l,o,r):this._emit(o,l,u,r)}return n}_readBlankNodePunctuation(e){let n;switch(e.type){case";":n=this._readPredicate;break;case",":n=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),n}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const n=this._readEntity(e);return this._prefixes[this._prefix]=n.value,this._prefixCallback(this._prefix,n),this._readDeclarationPunctuation}_readBaseIRI(e){const n=e.type==="IRI"&&this._resolveIRI(e.value);return n?(this._setBase(n),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let n;switch(e.type){case"IRI":case"prefixed":if((n=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,n,this.QUANTIFIERS_GRAPH)):this._quantified[n.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const n=this._contextStack,r=n.length&&n[n.length-1];if(r&&r.type==="item"){const o=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,o,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let n,r;const o=this._factory.blankNode();if((r=this._readEntity(e))!==void 0)return this._predicate===null?(n=this._subject,this._subject=o):(n=this._object,this._object=o),this._emit(n,r,o,this._graph),this._readPath}_readBackwardPath(e){const n=this._factory.blankNode();let r,o;if((r=this._readEntity(e))!==void 0)return this._predicate===null?(o=this._subject,this._subject=n):(o=this._object,this._object=n),this._emit(n,r,o,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);const n=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=n,this._readPredicate):(this._object=n,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,n,r,o){this._callback(null,this._factory.quad(e,n,r,o||this.DEFAULTGRAPH))}_error(e,n){const r=new Error(`${e} on line ${n.line}.`);r.context={token:n,line:n.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=vs}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return(e[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const n=e.length;let r="",o=-1,a=-1,l=0,u="/";for(;o<n;){switch(u){case":":if(a<0&&e[++o]==="/"&&e[++o]==="/")for(;(a=o+1)<n&&e[a]!=="/";)o=a;break;case"?":case"#":o=n;break;case"/":if(e[o+1]===".")switch(u=e[++o+1],u){case"/":r+=e.substring(l,o-1),l=o+1;break;case void 0:case"?":case"#":return r+e.substring(l,o)+e.substr(o+1);case".":if(u=e[++o+1],u===void 0||u==="/"||u==="?"||u==="#"){if(r+=e.substring(l,o-2),(l=r.lastIndexOf("/"))>=a&&(r=r.substr(0,l)),u!=="/")return`${r}/${e.substr(o+1)}`;l=o+1}}}u=e[++o]}return r+e.substring(l)}parse(e,n,r){let o,a,l;if(n&&(n.onQuad||n.onPrefix||n.onComment)?(o=n.onQuad,a=n.onPrefix,l=n.onComment):(o=n,a=r),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${ic++}_`,this._prefixCallback=a||vs,this._inversePredicate=!1,this._quantified=Object.create(null),!o){const f=[];let h;if(this._callback=(g,m)=>{g?h=g:m&&f.push(m)},this._lexer.tokenize(e).every(g=>this._readCallback=this._readCallback(g)),h)throw h;return f}let u=(f,h)=>{f!==null?(this._callback(f),this._callback=vs):this._readCallback&&(this._readCallback=this._readCallback(h))};l&&(this._lexer.comments=!0,u=(f,h)=>{f!==null?(this._callback(f),this._callback=vs):this._readCallback&&(h.type==="comment"?l(h.value):this._readCallback=this._readCallback(h))}),this._callback=o,this._lexer.tokenize(e,u)}}function vs(){}function ff(i,e){i._factory=e,i.DEFAULTGRAPH=e.defaultGraph(),i.RDF_FIRST=e.namedNode(Lt.rdf.first),i.RDF_REST=e.namedNode(Lt.rdf.rest),i.RDF_NIL=e.namedNode(Lt.rdf.nil),i.N3_FORALL=e.namedNode(Lt.r.forAll),i.N3_FORSOME=e.namedNode(Lt.r.forSome),i.ABBREVIATIONS={a:e.namedNode(Lt.rdf.type),"=":e.namedNode(Lt.owl.sameAs),">":e.namedNode(Lt.log.implies),"<":e.namedNode(Lt.log.isImpliedBy)},i.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}ff(hf.prototype,Be);function vl(i){return!!i&&i.termType==="DefaultGraph"}function Ns(i){return i.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const Bg=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,$g=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,rc="./",qg="../",Oo="?",sc="#";class Pl{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!Bg.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!Pl.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],n=["^",Ns(e)],r=[],o=[],a=/[^/?#]*([/?#])/y;let l,u=0,f=0,h=a.lastIndex=e.length;for(;!u&&!f&&(l=a.exec(this.base));)l[1]===sc?f=a.lastIndex-1:(n.push(Ns(l[0]),"(?:"),r.push(")?"),l[1]!==Oo?o.push(h=a.lastIndex):(u=h=a.lastIndex,f=this.base.indexOf(sc,u),this._pathReplacements[u]=Oo));for(let g=0;g<o.length;g++)this._pathReplacements[o[g]]=qg.repeat(o.length-g-1);return this._pathReplacements[o[o.length-1]]=rc,this._baseLength=f>0?f:this.base.length,n.push(Ns(this.base.substring(h,this._baseLength)),u?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...n,...r].join(""))}toRelative(e){const n=this._getBaseMatcher().exec(e);if(!n)return e;const r=n[0].length;if(r===this._baseLength&&r===e.length)return"";const o=this._pathReplacements[r];if(o){const a=e.substring(r);return o!==Oo&&!$g.test(a)?e:o===rc&&/^[^?#]/.test(a)?a:o+a}return e.substring(r-1)}}const mr=Be.defaultGraph(),{rdf:zg,xsd:Fi}=Lt,oc=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,ac=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Hg={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class _r extends un{equals(e){return e===this}}class kl{constructor(e,n){if(this._prefixRegex=/$0^/,e&&typeof e.write!="function"&&(n=e,e=null),n=n||{},this._lists=n.lists,e)this._outputStream=e,this._endStream=n.end===void 0?!0:!!n.end;else{let r="";this._outputStream={write(o,a,l){r+=o,l&&l()},end:o=>{o&&o(null,r)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(n.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=mr,this._prefixIRIs=Object.create(null),n.prefixes&&this.addPrefixes(n.prefixes),n.baseIRI&&(this._baseIri=new Pl(n.baseIRI)))}get _inDefaultGraph(){return mr.equals(this._graph)}_write(e,n){this._outputStream.write(e,"utf8",n)}_writeQuad(e,n,r,o,a){try{o.equals(this._graph)||(this._write((this._subject===null?"":this._inDefaultGraph?`.
|
|
3
3
|
`:`
|
|
4
4
|
}
|
|
5
5
|
`)+(mr.equals(o)?"":`${this._encodeIriOrBlank(o)} {
|
|
@@ -7,30 +7,30 @@ var qi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"
|
|
|
7
7
|
${this._encodePredicate(this._predicate=n)} ${this._encodeObject(r)}`,a):this._write(`${(this._subject===null?"":`.
|
|
8
8
|
`)+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=n)} ${this._encodeObject(r)}`,a)}catch(l){a&&a(l)}}_writeQuadLine(e,n,r,o,a){delete this._prefixMatch,this._write(this.quadToString(e,n,r,o),a)}quadToString(e,n,r,o){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(n)} ${this._encodeObject(r)}${o&&o.value?` ${this._encodeIriOrBlank(o)} .
|
|
9
9
|
`:` .
|
|
10
|
-
`}`}quadsToString(e){let n="";for(const r of e)n+=this.quadToString(r.subject,r.predicate,r.object,r.graph);return n}_encodeSubject(e){return e.termType==="Quad"?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if(e.termType!=="NamedNode")return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let n=e.value;this._baseIri&&(n=this._baseIri.toRelative(n)),oc.test(n)&&(n=n.replace(ac,lc));const r=this._prefixRegex.exec(n);return r?r[1]?this._prefixIRIs[r[1]]+r[2]:n:`<${n}>`}_encodeLiteral(e){let n=e.value;if(oc.test(n)&&(n=n.replace(ac,lc)),e.language)return`"${n}"@${e.language}`;if(this._lineMode){if(e.datatype.value===Fi.string)return`"${n}"`}else switch(e.datatype.value){case Fi.string:return`"${n}"`;case Fi.boolean:if(n==="true"||n==="false")return n;break;case Fi.integer:if(/^[+-]?\d+$/.test(n))return n;break;case Fi.decimal:if(/^[+-]?\d*\.\d+$/.test(n))return n;break;case Fi.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(n))return n;break}return`"${n}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===
|
|
10
|
+
`}`}quadsToString(e){let n="";for(const r of e)n+=this.quadToString(r.subject,r.predicate,r.object,r.graph);return n}_encodeSubject(e){return e.termType==="Quad"?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if(e.termType!=="NamedNode")return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let n=e.value;this._baseIri&&(n=this._baseIri.toRelative(n)),oc.test(n)&&(n=n.replace(ac,lc));const r=this._prefixRegex.exec(n);return r?r[1]?this._prefixIRIs[r[1]]+r[2]:n:`<${n}>`}_encodeLiteral(e){let n=e.value;if(oc.test(n)&&(n=n.replace(ac,lc)),e.language)return`"${n}"@${e.language}`;if(this._lineMode){if(e.datatype.value===Fi.string)return`"${n}"`}else switch(e.datatype.value){case Fi.string:return`"${n}"`;case Fi.boolean:if(n==="true"||n==="false")return n;break;case Fi.integer:if(/^[+-]?\d+$/.test(n))return n;break;case Fi.decimal:if(/^[+-]?\d*\.\d+$/.test(n))return n;break;case Fi.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(n))return n;break}return`"${n}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===zg.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:n,object:r,graph:o}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(n)} ${this._encodeObject(r)}${vl(o)?"":` ${this._encodeIriOrBlank(o)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,n,r,o,a){r===void 0?this._writeQuad(e.subject,e.predicate,e.object,e.graph,n):typeof o=="function"?this._writeQuad(e,n,r,mr,o):this._writeQuad(e,n,r,o||mr,a)}addQuads(e){for(let n=0;n<e.length;n++)this.addQuad(e[n])}addPrefix(e,n,r){const o={};o[e]=n,this.addPrefixes(o,r)}addPrefixes(e,n){if(!this._prefixIRIs)return n&&n();let r=!1;for(let o in e){let a=e[o];typeof a!="string"&&(a=a.value),r=!0,this._subject!==null&&(this._write(this._inDefaultGraph?`.
|
|
11
11
|
`:`
|
|
12
12
|
}
|
|
13
13
|
`),this._subject=null,this._graph=""),this._prefixIRIs[a]=o+=":",this._write(`@prefix ${o} <${a}>.
|
|
14
|
-
`)}if(r){let o="",a="";for(const l in this._prefixIRIs)o+=o?`|${l}`:l,a+=(a?"|":"")+this._prefixIRIs[l];o=
|
|
14
|
+
`)}if(r){let o="",a="";for(const l in this._prefixIRIs)o+=o?`|${l}`:l,a+=(a?"|":"")+this._prefixIRIs[l];o=Ns(o),this._prefixRegex=new RegExp(`^(?:${a})[^/]*$|^(${o})([_a-zA-Z0-9][\\-_a-zA-Z0-9]*)$`)}this._write(r?`
|
|
15
15
|
`:"",n)}blank(e,n){let r=e,o,a;switch(e===void 0?r=[]:e.termType?r=[{predicate:e,object:n}]:"length"in e||(r=[e]),a=r.length){case 0:return new _r("[]");case 1:if(o=r[0],!(o.object instanceof _r))return new _r(`[ ${this._encodePredicate(o.predicate)} ${this._encodeObject(o.object)} ]`);default:let l="[";for(let u=0;u<a;u++)o=r[u],o.predicate.equals(e)?l+=`, ${this._encodeObject(o.object)}`:(l+=`${(u?`;
|
|
16
16
|
`:`
|
|
17
17
|
`)+this._encodePredicate(o.predicate)} ${this._encodeObject(o.object)}`,e=o.predicate);return new _r(`${l}
|
|
18
18
|
]`)}}list(e){const n=e&&e.length||0,r=new Array(n);for(let o=0;o<n;o++)r[o]=this._encodeObject(e[o]);return new _r(`(${r.join(" ")})`)}end(e){this._subject!==null&&(this._write(this._inDefaultGraph?`.
|
|
19
19
|
`:`
|
|
20
20
|
}
|
|
21
|
-
`),this._subject=null),this._write=this._blockedWrite;let n=e&&((r,o)=>{n=null,e(r,o)});if(this._endStream)try{return this._outputStream.end(n)}catch{}n&&n()}}function lc(i){let e=
|
|
22
|
-
`;super(r),this.name="AggregateError",this.errors=n}}return jo={AggregateError:i,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,n){return e.includes(n)},ArrayPrototypeIndexOf(e,n){return e.indexOf(n)},ArrayPrototypeJoin(e,n){return e.join(n)},ArrayPrototypeMap(e,n){return e.map(n)},ArrayPrototypePop(e,n){return e.pop(n)},ArrayPrototypePush(e,n){return e.push(n)},ArrayPrototypeSlice(e,n,r){return e.slice(n,r)},Error,FunctionPrototypeCall(e,n,...r){return e.call(n,...r)},FunctionPrototypeSymbolHasInstance(e,n){return Function.prototype[Symbol.hasInstance].call(e,n)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,n){return Object.defineProperties(e,n)},ObjectDefineProperty(e,n,r){return Object.defineProperty(e,n,r)},ObjectGetOwnPropertyDescriptor(e,n){return Object.getOwnPropertyDescriptor(e,n)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,n){return Object.setPrototypeOf(e,n)},Promise,PromisePrototypeCatch(e,n){return e.catch(n)},PromisePrototypeThen(e,n,r){return e.then(n,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,n){return e.test(n)},SafeSet:Set,String,StringPrototypeSlice(e,n,r){return e.slice(n,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,n,r){return e.set(n,r)},Boolean,Uint8Array},jo}var Bo={exports:{}},$o,cc;function pf(){return cc||(cc=1,$o={format(i,...e){return i.replace(/%([sdifj])/g,function(...[n,r]){const o=e.shift();return r==="f"?o.toFixed(6):r==="j"?JSON.stringify(o):r==="s"&&typeof o=="object"?`${o.constructor!==Object?o.constructor.name:""} {}`.trim():o.toString()})},inspect(i){switch(typeof i){case"string":if(i.includes("'"))if(i.includes('"')){if(!i.includes("`")&&!i.includes("${"))return`\`${i}\``}else return`"${i}"`;return`'${i}'`;case"number":return isNaN(i)?"NaN":Object.is(i,-0)?String(i):i;case"bigint":return`${String(i)}n`;case"boolean":case"undefined":return String(i);case"object":return"{}"}}}),$o}var qo,dc;function kt(){if(dc)return qo;dc=1;const{format:i,inspect:e}=pf(),{AggregateError:n}=ct(),r=globalThis.AggregateError||n,o=Symbol("kIsNodeError"),a=["string","function","number","object","Function","Object","boolean","bigint","symbol"],l=/^([A-Z][a-z0-9]*)+$/,u="__node_internal_",f={};function h(A,N){if(!A)throw new f.ERR_INTERNAL_ASSERTION(N)}function g(A){let N="",P=A.length;const v=A[0]==="-"?1:0;for(;P>=v+4;P-=3)N=`_${A.slice(P-3,P)}${N}`;return`${A.slice(0,P)}${N}`}function _(A,N,P){if(typeof N=="function")return h(N.length<=P.length,`Code: ${A}; The provided arguments length (${P.length}) does not match the required ones (${N.length}).`),N(...P);const v=(N.match(/%[dfijoOs]/g)||[]).length;return h(v===P.length,`Code: ${A}; The provided arguments length (${P.length}) does not match the required ones (${v}).`),P.length===0?N:i(N,...P)}function d(A,N,P){P||(P=Error);class v extends P{constructor(...S){super(_(A,N,S))}toString(){return`${this.name} [${A}]: ${this.message}`}}Object.defineProperties(v.prototype,{name:{value:P.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${A}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),v.prototype.code=A,v.prototype[o]=!0,f[A]=v}function m(A){const N=u+A.name;return Object.defineProperty(A,"name",{value:N}),A}function w(A,N){if(A&&N&&A!==N){if(Array.isArray(N.errors))return N.errors.push(A),N;const P=new r([N,A],N.message);return P.code=N.code,P}return A||N}class I extends Error{constructor(N="The operation was aborted",P=void 0){if(P!==void 0&&typeof P!="object")throw new f.ERR_INVALID_ARG_TYPE("options","Object",P);super(N,P),this.code="ABORT_ERR",this.name="AbortError"}}return d("ERR_ASSERTION","%s",Error),d("ERR_INVALID_ARG_TYPE",(A,N,P)=>{h(typeof A=="string","'name' must be a string"),Array.isArray(N)||(N=[N]);let v="The ";A.endsWith(" argument")?v+=`${A} `:v+=`"${A}" ${A.includes(".")?"property":"argument"} `,v+="must be ";const y=[],S=[],O=[];for(const C of N)h(typeof C=="string","All expected entries have to be of type string"),a.includes(C)?y.push(C.toLowerCase()):l.test(C)?S.push(C):(h(C!=="object",'The value "object" should be written as "Object"'),O.push(C));if(S.length>0){const C=y.indexOf("object");C!==-1&&(y.splice(y,C,1),S.push("Object"))}if(y.length>0){switch(y.length){case 1:v+=`of type ${y[0]}`;break;case 2:v+=`one of type ${y[0]} or ${y[1]}`;break;default:{const C=y.pop();v+=`one of type ${y.join(", ")}, or ${C}`}}(S.length>0||O.length>0)&&(v+=" or ")}if(S.length>0){switch(S.length){case 1:v+=`an instance of ${S[0]}`;break;case 2:v+=`an instance of ${S[0]} or ${S[1]}`;break;default:{const C=S.pop();v+=`an instance of ${S.join(", ")}, or ${C}`}}O.length>0&&(v+=" or ")}switch(O.length){case 0:break;case 1:O[0].toLowerCase()!==O[0]&&(v+="an "),v+=`${O[0]}`;break;case 2:v+=`one of ${O[0]} or ${O[1]}`;break;default:{const C=O.pop();v+=`one of ${O.join(", ")}, or ${C}`}}if(P==null)v+=`. Received ${P}`;else if(typeof P=="function"&&P.name)v+=`. Received function ${P.name}`;else if(typeof P=="object"){var X;if((X=P.constructor)!==null&&X!==void 0&&X.name)v+=`. Received an instance of ${P.constructor.name}`;else{const C=e(P,{depth:-1});v+=`. Received ${C}`}}else{let C=e(P,{colors:!1});C.length>25&&(C=`${C.slice(0,25)}...`),v+=`. Received type ${typeof P} (${C})`}return v},TypeError),d("ERR_INVALID_ARG_VALUE",(A,N,P="is invalid")=>{let v=e(N);return v.length>128&&(v=v.slice(0,128)+"..."),`The ${A.includes(".")?"property":"argument"} '${A}' ${P}. Received ${v}`},TypeError),d("ERR_INVALID_RETURN_VALUE",(A,N,P)=>{var v;const y=P!=null&&(v=P.constructor)!==null&&v!==void 0&&v.name?`instance of ${P.constructor.name}`:`type ${typeof P}`;return`Expected ${A} to be returned from the "${N}" function but got ${y}.`},TypeError),d("ERR_MISSING_ARGS",(...A)=>{h(A.length>0,"At least one arg needs to be specified");let N;const P=A.length;switch(A=(Array.isArray(A)?A:[A]).map(v=>`"${v}"`).join(" or "),P){case 1:N+=`The ${A[0]} argument`;break;case 2:N+=`The ${A[0]} and ${A[1]} arguments`;break;default:{const v=A.pop();N+=`The ${A.join(", ")}, and ${v} arguments`}break}return`${N} must be specified`},TypeError),d("ERR_OUT_OF_RANGE",(A,N,P)=>{h(N,'Missing "range" argument');let v;if(Number.isInteger(P)&&Math.abs(P)>2**32)v=g(String(P));else if(typeof P=="bigint"){v=String(P);const y=BigInt(2)**BigInt(32);(P>y||P<-y)&&(v=g(v)),v+="n"}else v=e(P);return`The value of "${A}" is out of range. It must be ${N}. Received ${v}`},RangeError),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),d("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),d("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),d("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),d("ERR_STREAM_WRITE_AFTER_END","write after end",Error),d("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),qo={AbortError:I,aggregateTwoErrors:m(w),hideStackFrames:m,codes:f},qo}var yr={exports:{}},hc;function Hr(){if(hc)return yr.exports;hc=1;const{AbortController:i,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return yr.exports=i,yr.exports.AbortSignal=e,yr.exports.default=i,yr.exports}var vs={exports:{}},fc;function Gs(){if(fc)return vs.exports;fc=1;var i=typeof Reflect=="object"?Reflect:null,e=i&&typeof i.apply=="function"?i.apply:function(S,O,X){return Function.prototype.apply.call(S,O,X)},n;i&&typeof i.ownKeys=="function"?n=i.ownKeys:Object.getOwnPropertySymbols?n=function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:n=function(S){return Object.getOwnPropertyNames(S)};function r(y){console&&console.warn&&console.warn(y)}var o=Number.isNaN||function(S){return S!==S};function a(){a.init.call(this)}vs.exports=a,vs.exports.once=N,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var l=10;function u(y){if(typeof y!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof y)}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(y){if(typeof y!="number"||y<0||o(y))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+y+".");l=y}}),a.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||o(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this};function f(y){return y._maxListeners===void 0?a.defaultMaxListeners:y._maxListeners}a.prototype.getMaxListeners=function(){return f(this)},a.prototype.emit=function(S){for(var O=[],X=1;X<arguments.length;X++)O.push(arguments[X]);var C=S==="error",U=this._events;if(U!==void 0)C=C&&U.error===void 0;else if(!C)return!1;if(C){var R;if(O.length>0&&(R=O[0]),R instanceof Error)throw R;var $=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw $.context=R,$}var G=U[S];if(G===void 0)return!1;if(typeof G=="function")e(G,this,O);else for(var j=G.length,F=w(G,j),X=0;X<j;++X)e(F[X],this,O);return!0};function h(y,S,O,X){var C,U,R;if(u(O),U=y._events,U===void 0?(U=y._events=Object.create(null),y._eventsCount=0):(U.newListener!==void 0&&(y.emit("newListener",S,O.listener?O.listener:O),U=y._events),R=U[S]),R===void 0)R=U[S]=O,++y._eventsCount;else if(typeof R=="function"?R=U[S]=X?[O,R]:[R,O]:X?R.unshift(O):R.push(O),C=f(y),C>0&&R.length>C&&!R.warned){R.warned=!0;var $=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");$.name="MaxListenersExceededWarning",$.emitter=y,$.type=S,$.count=R.length,r($)}return y}a.prototype.addListener=function(S,O){return h(this,S,O,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(S,O){return h(this,S,O,!0)};function g(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _(y,S,O){var X={fired:!1,wrapFn:void 0,target:y,type:S,listener:O},C=g.bind(X);return C.listener=O,X.wrapFn=C,C}a.prototype.once=function(S,O){return u(O),this.on(S,_(this,S,O)),this},a.prototype.prependOnceListener=function(S,O){return u(O),this.prependListener(S,_(this,S,O)),this},a.prototype.removeListener=function(S,O){var X,C,U,R,$;if(u(O),C=this._events,C===void 0)return this;if(X=C[S],X===void 0)return this;if(X===O||X.listener===O)--this._eventsCount===0?this._events=Object.create(null):(delete C[S],C.removeListener&&this.emit("removeListener",S,X.listener||O));else if(typeof X!="function"){for(U=-1,R=X.length-1;R>=0;R--)if(X[R]===O||X[R].listener===O){$=X[R].listener,U=R;break}if(U<0)return this;U===0?X.shift():I(X,U),X.length===1&&(C[S]=X[0]),C.removeListener!==void 0&&this.emit("removeListener",S,$||O)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(S){var O,X,C;if(X=this._events,X===void 0)return this;if(X.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):X[S]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete X[S]),this;if(arguments.length===0){var U=Object.keys(X),R;for(C=0;C<U.length;++C)R=U[C],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(O=X[S],typeof O=="function")this.removeListener(S,O);else if(O!==void 0)for(C=O.length-1;C>=0;C--)this.removeListener(S,O[C]);return this};function d(y,S,O){var X=y._events;if(X===void 0)return[];var C=X[S];return C===void 0?[]:typeof C=="function"?O?[C.listener||C]:[C]:O?A(C):w(C,C.length)}a.prototype.listeners=function(S){return d(this,S,!0)},a.prototype.rawListeners=function(S){return d(this,S,!1)},a.listenerCount=function(y,S){return typeof y.listenerCount=="function"?y.listenerCount(S):m.call(y,S)},a.prototype.listenerCount=m;function m(y){var S=this._events;if(S!==void 0){var O=S[y];if(typeof O=="function")return 1;if(O!==void 0)return O.length}return 0}a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function w(y,S){for(var O=new Array(S),X=0;X<S;++X)O[X]=y[X];return O}function I(y,S){for(;S+1<y.length;S++)y[S]=y[S+1];y.pop()}function A(y){for(var S=new Array(y.length),O=0;O<S.length;++O)S[O]=y[O].listener||y[O];return S}function N(y,S){return new Promise(function(O,X){function C(R){y.removeListener(S,U),X(R)}function U(){typeof y.removeListener=="function"&&y.removeListener("error",C),O([].slice.call(arguments))}v(y,S,U,{once:!0}),S!=="error"&&P(y,C,{once:!0})})}function P(y,S,O){typeof y.on=="function"&&v(y,"error",S,O)}function v(y,S,O,X){if(typeof y.on=="function")X.once?y.once(S,O):y.on(S,O);else if(typeof y.addEventListener=="function")y.addEventListener(S,function C(U){X.once&&y.removeEventListener(S,C),O(U)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof y)}return vs.exports}var pc;function jt(){return pc||(pc=1,(function(i){const e=Dn(),{format:n,inspect:r}=pf(),{codes:{ERR_INVALID_ARG_TYPE:o}}=kt(),{kResistStopPropagation:a,AggregateError:l,SymbolDispose:u}=ct(),f=globalThis.AbortSignal||Hr().AbortSignal,h=globalThis.AbortController||Hr().AbortController,g=Object.getPrototypeOf(async function(){}).constructor,_=globalThis.Blob||e.Blob,d=typeof _<"u"?function(A){return A instanceof _}:function(A){return!1},m=(I,A)=>{if(I!==void 0&&(I===null||typeof I!="object"||!("aborted"in I)))throw new o(A,"AbortSignal",I)},w=(I,A)=>{if(typeof I!="function")throw new o(A,"Function",I)};i.exports={AggregateError:l,kEmptyObject:Object.freeze({}),once(I){let A=!1;return function(...N){A||(A=!0,I.apply(this,N))}},createDeferredPromise:function(){let I,A;return{promise:new Promise((P,v)=>{I=P,A=v}),resolve:I,reject:A}},promisify(I){return new Promise((A,N)=>{I((P,...v)=>P?N(P):A(...v))})},debuglog(){return function(){}},format:n,inspect:r,types:{isAsyncFunction(I){return I instanceof g},isArrayBufferView(I){return ArrayBuffer.isView(I)}},isBlob:d,deprecate(I,A){return I},addAbortListener:Gs().addAbortListener||function(A,N){if(A===void 0)throw new o("signal","AbortSignal",A);m(A,"signal"),w(N,"listener");let P;return A.aborted?queueMicrotask(()=>N()):(A.addEventListener("abort",N,{__proto__:null,once:!0,[a]:!0}),P=()=>{A.removeEventListener("abort",N)}),{__proto__:null,[u](){var v;(v=P)===null||v===void 0||v()}}},AbortSignalAny:f.any||function(A){if(A.length===1)return A[0];const N=new h,P=()=>N.abort();return A.forEach(v=>{m(v,"signals"),v.addEventListener("abort",P,{once:!0})}),N.signal.addEventListener("abort",()=>{A.forEach(v=>v.removeEventListener("abort",P))},{once:!0}),N.signal}},i.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(Bo)),Bo.exports}var ws={},zo,gc;function Xr(){if(gc)return zo;gc=1;const{ArrayIsArray:i,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:n,ArrayPrototypeMap:r,NumberIsInteger:o,NumberIsNaN:a,NumberMAX_SAFE_INTEGER:l,NumberMIN_SAFE_INTEGER:u,NumberParseInt:f,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:g,String:_,StringPrototypeToUpperCase:d,StringPrototypeTrim:m}=ct(),{hideStackFrames:w,codes:{ERR_SOCKET_BAD_PORT:I,ERR_INVALID_ARG_TYPE:A,ERR_INVALID_ARG_VALUE:N,ERR_OUT_OF_RANGE:P,ERR_UNKNOWN_SIGNAL:v}}=kt(),{normalizeEncoding:y}=jt(),{isAsyncFunction:S,isArrayBufferView:O}=jt().types,X={};function C(le){return le===(le|0)}function U(le){return le===le>>>0}const R=/^[0-7]+$/,$="must be a 32-bit unsigned integer or an octal string";function G(le,ve,Ae){if(typeof le>"u"&&(le=Ae),typeof le=="string"){if(g(R,le)===null)throw new N(ve,le,$);le=f(le,8)}return se(le,ve),le}const j=w((le,ve,Ae=u,be=l)=>{if(typeof le!="number")throw new A(ve,"number",le);if(!o(le))throw new P(ve,"an integer",le);if(le<Ae||le>be)throw new P(ve,`>= ${Ae} && <= ${be}`,le)}),F=w((le,ve,Ae=-2147483648,be=2147483647)=>{if(typeof le!="number")throw new A(ve,"number",le);if(!o(le))throw new P(ve,"an integer",le);if(le<Ae||le>be)throw new P(ve,`>= ${Ae} && <= ${be}`,le)}),se=w((le,ve,Ae=!1)=>{if(typeof le!="number")throw new A(ve,"number",le);if(!o(le))throw new P(ve,"an integer",le);const be=Ae?1:0,qe=4294967295;if(le<be||le>qe)throw new P(ve,`>= ${be} && <= ${qe}`,le)});function M(le,ve){if(typeof le!="string")throw new A(ve,"string",le)}function re(le,ve,Ae=void 0,be){if(typeof le!="number")throw new A(ve,"number",le);if(Ae!=null&&le<Ae||be!=null&&le>be||(Ae!=null||be!=null)&&a(le))throw new P(ve,`${Ae!=null?`>= ${Ae}`:""}${Ae!=null&&be!=null?" && ":""}${be!=null?`<= ${be}`:""}`,le)}const B=w((le,ve,Ae)=>{if(!e(Ae,le)){const qe="must be one of: "+n(r(Ae,mt=>typeof mt=="string"?`'${mt}'`:_(mt)),", ");throw new N(ve,le,qe)}});function oe(le,ve){if(typeof le!="boolean")throw new A(ve,"boolean",le)}function T(le,ve,Ae){return le==null||!h(le,ve)?Ae:le[ve]}const Q=w((le,ve,Ae=null)=>{const be=T(Ae,"allowArray",!1),qe=T(Ae,"allowFunction",!1);if(!T(Ae,"nullable",!1)&&le===null||!be&&i(le)||typeof le!="object"&&(!qe||typeof le!="function"))throw new A(ve,"Object",le)}),ie=w((le,ve)=>{if(le!=null&&typeof le!="object"&&typeof le!="function")throw new A(ve,"a dictionary",le)}),Y=w((le,ve,Ae=0)=>{if(!i(le))throw new A(ve,"Array",le);if(le.length<Ae){const be=`must be longer than ${Ae}`;throw new N(ve,le,be)}});function me(le,ve){Y(le,ve);for(let Ae=0;Ae<le.length;Ae++)M(le[Ae],`${ve}[${Ae}]`)}function Z(le,ve){Y(le,ve);for(let Ae=0;Ae<le.length;Ae++)oe(le[Ae],`${ve}[${Ae}]`)}function W(le,ve){Y(le,ve);for(let Ae=0;Ae<le.length;Ae++){const be=le[Ae],qe=`${ve}[${Ae}]`;if(be==null)throw new A(qe,"AbortSignal",be);Ee(be,qe)}}function ee(le,ve="signal"){if(M(le,ve),X[le]===void 0)throw X[d(le)]!==void 0?new v(le+" (signals must use all capital letters)"):new v(le)}const K=w((le,ve="buffer")=>{if(!O(le))throw new A(ve,["Buffer","TypedArray","DataView"],le)});function ue(le,ve){const Ae=y(ve),be=le.length;if(Ae==="hex"&&be%2!==0)throw new N("encoding",ve,`is invalid for data of length ${be}`)}function ce(le,ve="Port",Ae=!0){if(typeof le!="number"&&typeof le!="string"||typeof le=="string"&&m(le).length===0||+le!==+le>>>0||le>65535||le===0&&!Ae)throw new I(ve,le,Ae);return le|0}const Ee=w((le,ve)=>{if(le!==void 0&&(le===null||typeof le!="object"||!("aborted"in le)))throw new A(ve,"AbortSignal",le)}),Te=w((le,ve)=>{if(typeof le!="function")throw new A(ve,"Function",le)}),q=w((le,ve)=>{if(typeof le!="function"||S(le))throw new A(ve,"Function",le)}),te=w((le,ve)=>{if(le!==void 0)throw new A(ve,"undefined",le)});function fe(le,ve,Ae){if(!e(Ae,le))throw new A(ve,`('${n(Ae,"|")}')`,le)}const xe=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Se(le,ve){if(typeof le>"u"||!g(xe,le))throw new N(ve,le,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Ie(le){if(typeof le=="string")return Se(le,"hints"),le;if(i(le)){const ve=le.length;let Ae="";if(ve===0)return Ae;for(let be=0;be<ve;be++){const qe=le[be];Se(qe,"hints"),Ae+=qe,be!==ve-1&&(Ae+=", ")}return Ae}throw new N("hints",le,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return zo={isInt32:C,isUint32:U,parseFileMode:G,validateArray:Y,validateStringArray:me,validateBooleanArray:Z,validateAbortSignalArray:W,validateBoolean:oe,validateBuffer:K,validateDictionary:ie,validateEncoding:ue,validateFunction:Te,validateInt32:F,validateInteger:j,validateNumber:re,validateObject:Q,validateOneOf:B,validatePlainFunction:q,validatePort:ce,validateSignalName:ee,validateString:M,validateUint32:se,validateUndefined:te,validateUnion:fe,validateAbortSignal:Ee,validateLinkHeaderValue:Ie},zo}var xs={exports:{}},Ho={exports:{}},mc;function Ti(){if(mc)return Ho.exports;mc=1;var i=Ho.exports={},e,n;function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=r}catch{e=r}try{typeof clearTimeout=="function"?n=clearTimeout:n=o}catch{n=o}})();function a(I){if(e===setTimeout)return setTimeout(I,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(I,0);try{return e(I,0)}catch{try{return e.call(null,I,0)}catch{return e.call(this,I,0)}}}function l(I){if(n===clearTimeout)return clearTimeout(I);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(I);try{return n(I)}catch{try{return n.call(null,I)}catch{return n.call(this,I)}}}var u=[],f=!1,h,g=-1;function _(){!f||!h||(f=!1,h.length?u=h.concat(u):g=-1,u.length&&d())}function d(){if(!f){var I=a(_);f=!0;for(var A=u.length;A;){for(h=u,u=[];++g<A;)h&&h[g].run();g=-1,A=u.length}h=null,f=!1,l(I)}}i.nextTick=function(I){var A=new Array(arguments.length-1);if(arguments.length>1)for(var N=1;N<arguments.length;N++)A[N-1]=arguments[N];u.push(new m(I,A)),u.length===1&&!f&&a(d)};function m(I,A){this.fun=I,this.array=A}m.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={};function w(){}return i.on=w,i.addListener=w,i.once=w,i.off=w,i.removeListener=w,i.removeAllListeners=w,i.emit=w,i.prependListener=w,i.prependOnceListener=w,i.listeners=function(I){return[]},i.binding=function(I){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(I){throw new Error("process.chdir is not supported")},i.umask=function(){return 0},Ho.exports}var Uo,_c;function Mn(){if(_c)return Uo;_c=1;const{SymbolAsyncIterator:i,SymbolIterator:e,SymbolFor:n}=ct(),r=n("nodejs.stream.destroyed"),o=n("nodejs.stream.errored"),a=n("nodejs.stream.readable"),l=n("nodejs.stream.writable"),u=n("nodejs.stream.disturbed"),f=n("nodejs.webstream.isClosedPromise"),h=n("nodejs.webstream.controllerErrorFunction");function g(T,Q=!1){var ie;return!!(T&&typeof T.pipe=="function"&&typeof T.on=="function"&&(!Q||typeof T.pause=="function"&&typeof T.resume=="function")&&(!T._writableState||((ie=T._readableState)===null||ie===void 0?void 0:ie.readable)!==!1)&&(!T._writableState||T._readableState))}function _(T){var Q;return!!(T&&typeof T.write=="function"&&typeof T.on=="function"&&(!T._readableState||((Q=T._writableState)===null||Q===void 0?void 0:Q.writable)!==!1))}function d(T){return!!(T&&typeof T.pipe=="function"&&T._readableState&&typeof T.on=="function"&&typeof T.write=="function")}function m(T){return T&&(T._readableState||T._writableState||typeof T.write=="function"&&typeof T.on=="function"||typeof T.pipe=="function"&&typeof T.on=="function")}function w(T){return!!(T&&!m(T)&&typeof T.pipeThrough=="function"&&typeof T.getReader=="function"&&typeof T.cancel=="function")}function I(T){return!!(T&&!m(T)&&typeof T.getWriter=="function"&&typeof T.abort=="function")}function A(T){return!!(T&&!m(T)&&typeof T.readable=="object"&&typeof T.writable=="object")}function N(T){return w(T)||I(T)||A(T)}function P(T,Q){return T==null?!1:Q===!0?typeof T[i]=="function":Q===!1?typeof T[e]=="function":typeof T[i]=="function"||typeof T[e]=="function"}function v(T){if(!m(T))return null;const Q=T._writableState,ie=T._readableState,Y=Q||ie;return!!(T.destroyed||T[r]||Y!=null&&Y.destroyed)}function y(T){if(!_(T))return null;if(T.writableEnded===!0)return!0;const Q=T._writableState;return Q!=null&&Q.errored?!1:typeof Q?.ended!="boolean"?null:Q.ended}function S(T,Q){if(!_(T))return null;if(T.writableFinished===!0)return!0;const ie=T._writableState;return ie!=null&&ie.errored?!1:typeof ie?.finished!="boolean"?null:!!(ie.finished||Q===!1&&ie.ended===!0&&ie.length===0)}function O(T){if(!g(T))return null;if(T.readableEnded===!0)return!0;const Q=T._readableState;return!Q||Q.errored?!1:typeof Q?.ended!="boolean"?null:Q.ended}function X(T,Q){if(!g(T))return null;const ie=T._readableState;return ie!=null&&ie.errored?!1:typeof ie?.endEmitted!="boolean"?null:!!(ie.endEmitted||Q===!1&&ie.ended===!0&&ie.length===0)}function C(T){return T&&T[a]!=null?T[a]:typeof T?.readable!="boolean"?null:v(T)?!1:g(T)&&T.readable&&!X(T)}function U(T){return T&&T[l]!=null?T[l]:typeof T?.writable!="boolean"?null:v(T)?!1:_(T)&&T.writable&&!y(T)}function R(T,Q){return m(T)?v(T)?!0:!(Q?.readable!==!1&&C(T)||Q?.writable!==!1&&U(T)):null}function $(T){var Q,ie;return m(T)?T.writableErrored?T.writableErrored:(Q=(ie=T._writableState)===null||ie===void 0?void 0:ie.errored)!==null&&Q!==void 0?Q:null:null}function G(T){var Q,ie;return m(T)?T.readableErrored?T.readableErrored:(Q=(ie=T._readableState)===null||ie===void 0?void 0:ie.errored)!==null&&Q!==void 0?Q:null:null}function j(T){if(!m(T))return null;if(typeof T.closed=="boolean")return T.closed;const Q=T._writableState,ie=T._readableState;return typeof Q?.closed=="boolean"||typeof ie?.closed=="boolean"?Q?.closed||ie?.closed:typeof T._closed=="boolean"&&F(T)?T._closed:null}function F(T){return typeof T._closed=="boolean"&&typeof T._defaultKeepAlive=="boolean"&&typeof T._removedConnection=="boolean"&&typeof T._removedContLen=="boolean"}function se(T){return typeof T._sent100=="boolean"&&F(T)}function M(T){var Q;return typeof T._consuming=="boolean"&&typeof T._dumped=="boolean"&&((Q=T.req)===null||Q===void 0?void 0:Q.upgradeOrConnect)===void 0}function re(T){if(!m(T))return null;const Q=T._writableState,ie=T._readableState,Y=Q||ie;return!Y&&se(T)||!!(Y&&Y.autoDestroy&&Y.emitClose&&Y.closed===!1)}function B(T){var Q;return!!(T&&((Q=T[u])!==null&&Q!==void 0?Q:T.readableDidRead||T.readableAborted))}function oe(T){var Q,ie,Y,me,Z,W,ee,K,ue,ce;return!!(T&&((Q=(ie=(Y=(me=(Z=(W=T[o])!==null&&W!==void 0?W:T.readableErrored)!==null&&Z!==void 0?Z:T.writableErrored)!==null&&me!==void 0?me:(ee=T._readableState)===null||ee===void 0?void 0:ee.errorEmitted)!==null&&Y!==void 0?Y:(K=T._writableState)===null||K===void 0?void 0:K.errorEmitted)!==null&&ie!==void 0?ie:(ue=T._readableState)===null||ue===void 0?void 0:ue.errored)!==null&&Q!==void 0?Q:!((ce=T._writableState)===null||ce===void 0)&&ce.errored))}return Uo={isDestroyed:v,kIsDestroyed:r,isDisturbed:B,kIsDisturbed:u,isErrored:oe,kIsErrored:o,isReadable:C,kIsReadable:a,kIsClosedPromise:f,kControllerErrorFunction:h,kIsWritable:l,isClosed:j,isDuplexNodeStream:d,isFinished:R,isIterable:P,isReadableNodeStream:g,isReadableStream:w,isReadableEnded:O,isReadableFinished:X,isReadableErrored:G,isNodeStream:m,isWebStream:N,isWritable:U,isWritableNodeStream:_,isWritableStream:I,isWritableEnded:y,isWritableFinished:S,isWritableErrored:$,isServerRequest:M,isServerResponse:se,willEmitClose:re,isTransformStream:A},Uo}var yc;function Qn(){if(yc)return xs.exports;yc=1;const i=Ti(),{AbortError:e,codes:n}=kt(),{ERR_INVALID_ARG_TYPE:r,ERR_STREAM_PREMATURE_CLOSE:o}=n,{kEmptyObject:a,once:l}=jt(),{validateAbortSignal:u,validateFunction:f,validateObject:h,validateBoolean:g}=Xr(),{Promise:_,PromisePrototypeThen:d,SymbolDispose:m}=ct(),{isClosed:w,isReadable:I,isReadableNodeStream:A,isReadableStream:N,isReadableFinished:P,isReadableErrored:v,isWritable:y,isWritableNodeStream:S,isWritableStream:O,isWritableFinished:X,isWritableErrored:C,isNodeStream:U,willEmitClose:R,kIsClosedPromise:$}=Mn();let G;function j(B){return B.setHeader&&typeof B.abort=="function"}const F=()=>{};function se(B,oe,T){var Q,ie;if(arguments.length===2?(T=oe,oe=a):oe==null?oe=a:h(oe,"options"),f(T,"callback"),u(oe.signal,"options.signal"),T=l(T),N(B)||O(B))return M(B,oe,T);if(!U(B))throw new r("stream",["ReadableStream","WritableStream","Stream"],B);const Y=(Q=oe.readable)!==null&&Q!==void 0?Q:A(B),me=(ie=oe.writable)!==null&&ie!==void 0?ie:S(B),Z=B._writableState,W=B._readableState,ee=()=>{B.writable||ce()};let K=R(B)&&A(B)===Y&&S(B)===me,ue=X(B,!1);const ce=()=>{ue=!0,B.destroyed&&(K=!1),!(K&&(!B.readable||Y))&&(!Y||Ee)&&T.call(B)};let Ee=P(B,!1);const Te=()=>{Ee=!0,B.destroyed&&(K=!1),!(K&&(!B.writable||me))&&(!me||ue)&&T.call(B)},q=le=>{T.call(B,le)};let te=w(B);const fe=()=>{te=!0;const le=C(B)||v(B);if(le&&typeof le!="boolean")return T.call(B,le);if(Y&&!Ee&&A(B,!0)&&!P(B,!1))return T.call(B,new o);if(me&&!ue&&!X(B,!1))return T.call(B,new o);T.call(B)},xe=()=>{te=!0;const le=C(B)||v(B);if(le&&typeof le!="boolean")return T.call(B,le);T.call(B)},Se=()=>{B.req.on("finish",ce)};j(B)?(B.on("complete",ce),K||B.on("abort",fe),B.req?Se():B.on("request",Se)):me&&!Z&&(B.on("end",ee),B.on("close",ee)),!K&&typeof B.aborted=="boolean"&&B.on("aborted",fe),B.on("end",Te),B.on("finish",ce),oe.error!==!1&&B.on("error",q),B.on("close",fe),te?i.nextTick(fe):Z!=null&&Z.errorEmitted||W!=null&&W.errorEmitted?K||i.nextTick(xe):(!Y&&(!K||I(B))&&(ue||y(B)===!1)||!me&&(!K||y(B))&&(Ee||I(B)===!1)||W&&B.req&&B.aborted)&&i.nextTick(xe);const Ie=()=>{T=F,B.removeListener("aborted",fe),B.removeListener("complete",ce),B.removeListener("abort",fe),B.removeListener("request",Se),B.req&&B.req.removeListener("finish",ce),B.removeListener("end",ee),B.removeListener("close",ee),B.removeListener("finish",ce),B.removeListener("end",Te),B.removeListener("error",q),B.removeListener("close",fe)};if(oe.signal&&!te){const le=()=>{const ve=T;Ie(),ve.call(B,new e(void 0,{cause:oe.signal.reason}))};if(oe.signal.aborted)i.nextTick(le);else{G=G||jt().addAbortListener;const ve=G(oe.signal,le),Ae=T;T=l((...be)=>{ve[m](),Ae.apply(B,be)})}}return Ie}function M(B,oe,T){let Q=!1,ie=F;if(oe.signal)if(ie=()=>{Q=!0,T.call(B,new e(void 0,{cause:oe.signal.reason}))},oe.signal.aborted)i.nextTick(ie);else{G=G||jt().addAbortListener;const me=G(oe.signal,ie),Z=T;T=l((...W)=>{me[m](),Z.apply(B,W)})}const Y=(...me)=>{Q||i.nextTick(()=>T.apply(B,me))};return d(B[$].promise,Y,Y),F}function re(B,oe){var T;let Q=!1;return oe===null&&(oe=a),(T=oe)!==null&&T!==void 0&&T.cleanup&&(g(oe.cleanup,"cleanup"),Q=oe.cleanup),new _((ie,Y)=>{const me=se(B,oe,Z=>{Q&&me(),Z?Y(Z):ie()})})}return xs.exports=se,xs.exports.finished=re,xs.exports}var Vo,bc;function Ki(){if(bc)return Vo;bc=1;const i=Ti(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:n},AbortError:r}=kt(),{Symbol:o}=ct(),{kIsDestroyed:a,isDestroyed:l,isFinished:u,isServerRequest:f}=Mn(),h=o("kDestroy"),g=o("kConstruct");function _(R,$,G){R&&(R.stack,$&&!$.errored&&($.errored=R),G&&!G.errored&&(G.errored=R))}function d(R,$){const G=this._readableState,j=this._writableState,F=j||G;return j!=null&&j.destroyed||G!=null&&G.destroyed?(typeof $=="function"&&$(),this):(_(R,j,G),j&&(j.destroyed=!0),G&&(G.destroyed=!0),F.constructed?m(this,R,$):this.once(h,function(se){m(this,e(se,R),$)}),this)}function m(R,$,G){let j=!1;function F(se){if(j)return;j=!0;const M=R._readableState,re=R._writableState;_(se,re,M),re&&(re.closed=!0),M&&(M.closed=!0),typeof G=="function"&&G(se),se?i.nextTick(w,R,se):i.nextTick(I,R)}try{R._destroy($||null,F)}catch(se){F(se)}}function w(R,$){A(R,$),I(R)}function I(R){const $=R._readableState,G=R._writableState;G&&(G.closeEmitted=!0),$&&($.closeEmitted=!0),(G!=null&&G.emitClose||$!=null&&$.emitClose)&&R.emit("close")}function A(R,$){const G=R._readableState,j=R._writableState;j!=null&&j.errorEmitted||G!=null&&G.errorEmitted||(j&&(j.errorEmitted=!0),G&&(G.errorEmitted=!0),R.emit("error",$))}function N(){const R=this._readableState,$=this._writableState;R&&(R.constructed=!0,R.closed=!1,R.closeEmitted=!1,R.destroyed=!1,R.errored=null,R.errorEmitted=!1,R.reading=!1,R.ended=R.readable===!1,R.endEmitted=R.readable===!1),$&&($.constructed=!0,$.destroyed=!1,$.closed=!1,$.closeEmitted=!1,$.errored=null,$.errorEmitted=!1,$.finalCalled=!1,$.prefinished=!1,$.ended=$.writable===!1,$.ending=$.writable===!1,$.finished=$.writable===!1)}function P(R,$,G){const j=R._readableState,F=R._writableState;if(F!=null&&F.destroyed||j!=null&&j.destroyed)return this;j!=null&&j.autoDestroy||F!=null&&F.autoDestroy?R.destroy($):$&&($.stack,F&&!F.errored&&(F.errored=$),j&&!j.errored&&(j.errored=$),G?i.nextTick(A,R,$):A(R,$))}function v(R,$){if(typeof R._construct!="function")return;const G=R._readableState,j=R._writableState;G&&(G.constructed=!1),j&&(j.constructed=!1),R.once(g,$),!(R.listenerCount(g)>1)&&i.nextTick(y,R)}function y(R){let $=!1;function G(j){if($){P(R,j??new n);return}$=!0;const F=R._readableState,se=R._writableState,M=se||F;F&&(F.constructed=!0),se&&(se.constructed=!0),M.destroyed?R.emit(h,j):j?P(R,j,!0):i.nextTick(S,R)}try{R._construct(j=>{i.nextTick(G,j)})}catch(j){i.nextTick(G,j)}}function S(R){R.emit(g)}function O(R){return R?.setHeader&&typeof R.abort=="function"}function X(R){R.emit("close")}function C(R,$){R.emit("error",$),i.nextTick(X,R)}function U(R,$){!R||l(R)||(!$&&!u(R)&&($=new r),f(R)?(R.socket=null,R.destroy($)):O(R)?R.abort():O(R.req)?R.req.abort():typeof R.destroy=="function"?R.destroy($):typeof R.close=="function"?R.close():$?i.nextTick(C,R,$):i.nextTick(X,R),R.destroyed||(R[a]=!0))}return Vo={construct:v,destroyer:U,destroy:d,undestroy:N,errorOrDestroy:P},Vo}var Wo,vc;function Dl(){if(vc)return Wo;vc=1;const{ArrayIsArray:i,ObjectSetPrototypeOf:e}=ct(),{EventEmitter:n}=Gs();function r(a){n.call(this,a)}e(r.prototype,n.prototype),e(r,n),r.prototype.pipe=function(a,l){const u=this;function f(I){a.writable&&a.write(I)===!1&&u.pause&&u.pause()}u.on("data",f);function h(){u.readable&&u.resume&&u.resume()}a.on("drain",h),!a._isStdio&&(!l||l.end!==!1)&&(u.on("end",_),u.on("close",d));let g=!1;function _(){g||(g=!0,a.end())}function d(){g||(g=!0,typeof a.destroy=="function"&&a.destroy())}function m(I){w(),n.listenerCount(this,"error")===0&&this.emit("error",I)}o(u,"error",m),o(a,"error",m);function w(){u.removeListener("data",f),a.removeListener("drain",h),u.removeListener("end",_),u.removeListener("close",d),u.removeListener("error",m),a.removeListener("error",m),u.removeListener("end",w),u.removeListener("close",w),a.removeListener("close",w)}return u.on("end",w),u.on("close",w),a.on("close",w),a.emit("pipe",u),a};function o(a,l,u){if(typeof a.prependListener=="function")return a.prependListener(l,u);!a._events||!a._events[l]?a.on(l,u):i(a._events[l])?a._events[l].unshift(u):a._events[l]=[u,a._events[l]]}return Wo={Stream:r,prependListener:o},Wo}var Go={exports:{}},wc;function Zs(){return wc||(wc=1,(function(i){const{SymbolDispose:e}=ct(),{AbortError:n,codes:r}=kt(),{isNodeStream:o,isWebStream:a,kControllerErrorFunction:l}=Mn(),u=Qn(),{ERR_INVALID_ARG_TYPE:f}=r;let h;const g=(_,d)=>{if(typeof _!="object"||!("aborted"in _))throw new f(d,"AbortSignal",_)};i.exports.addAbortSignal=function(d,m){if(g(d,"signal"),!o(m)&&!a(m))throw new f("stream",["ReadableStream","WritableStream","Stream"],m);return i.exports.addAbortSignalNoValidate(d,m)},i.exports.addAbortSignalNoValidate=function(_,d){if(typeof _!="object"||!("aborted"in _))return d;const m=o(d)?()=>{d.destroy(new n(void 0,{cause:_.reason}))}:()=>{d[l](new n(void 0,{cause:_.reason}))};if(_.aborted)m();else{h=h||jt().addAbortListener;const w=h(_,m);u(d,w[e])}return d}})(Go)),Go.exports}var Zo,xc;function Hg(){if(xc)return Zo;xc=1;const{StringPrototypeSlice:i,SymbolIterator:e,TypedArrayPrototypeSet:n,Uint8Array:r}=ct(),{Buffer:o}=Dn(),{inspect:a}=jt();return Zo=class{constructor(){this.head=null,this.tail=null,this.length=0}push(u){const f={data:u,next:null};this.length>0?this.tail.next=f:this.head=f,this.tail=f,++this.length}unshift(u){const f={data:u,next:this.head};this.length===0&&(this.tail=f),this.head=f,++this.length}shift(){if(this.length===0)return;const u=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,u}clear(){this.head=this.tail=null,this.length=0}join(u){if(this.length===0)return"";let f=this.head,h=""+f.data;for(;(f=f.next)!==null;)h+=u+f.data;return h}concat(u){if(this.length===0)return o.alloc(0);const f=o.allocUnsafe(u>>>0);let h=this.head,g=0;for(;h;)n(f,h.data,g),g+=h.data.length,h=h.next;return f}consume(u,f){const h=this.head.data;if(u<h.length){const g=h.slice(0,u);return this.head.data=h.slice(u),g}return u===h.length?this.shift():f?this._getString(u):this._getBuffer(u)}first(){return this.head.data}*[e](){for(let u=this.head;u;u=u.next)yield u.data}_getString(u){let f="",h=this.head,g=0;do{const _=h.data;if(u>_.length)f+=_,u-=_.length;else{u===_.length?(f+=_,++g,h.next?this.head=h.next:this.head=this.tail=null):(f+=i(_,0,u),this.head=h,h.data=i(_,u));break}++g}while((h=h.next)!==null);return this.length-=g,f}_getBuffer(u){const f=o.allocUnsafe(u),h=u;let g=this.head,_=0;do{const d=g.data;if(u>d.length)n(f,d,h-u),u-=d.length;else{u===d.length?(n(f,d,h-u),++_,g.next?this.head=g.next:this.head=this.tail=null):(n(f,new r(d.buffer,d.byteOffset,u),h-u),this.head=g,g.data=d.slice(u));break}++_}while((g=g.next)!==null);return this.length-=_,f}[Symbol.for("nodejs.util.inspect.custom")](u,f){return a(this,{...f,depth:0,customInspect:!1})}},Zo}var Xo,Ec;function Xs(){if(Ec)return Xo;Ec=1;const{MathFloor:i,NumberIsInteger:e}=ct(),{validateInteger:n}=Xr(),{ERR_INVALID_ARG_VALUE:r}=kt().codes;let o=16*1024,a=16;function l(g,_,d){return g.highWaterMark!=null?g.highWaterMark:_?g[d]:null}function u(g){return g?a:o}function f(g,_){n(_,"value",0),g?a=_:o=_}function h(g,_,d,m){const w=l(_,m,d);if(w!=null){if(!e(w)||w<0){const I=m?`options.${d}`:"options.highWaterMark";throw new r(I,w)}return i(w)}return u(g.objectMode)}return Xo={getHighWaterMark:h,getDefaultHighWaterMark:u,setDefaultHighWaterMark:f},Xo}var Qo={},Es={exports:{}};var Sc;function Ug(){return Sc||(Sc=1,(function(i,e){var n=Dn(),r=n.Buffer;function o(l,u){for(var f in l)u[f]=l[f]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?i.exports=n:(o(n,e),e.Buffer=a);function a(l,u,f){return r(l,u,f)}a.prototype=Object.create(r.prototype),o(r,a),a.from=function(l,u,f){if(typeof l=="number")throw new TypeError("Argument must not be a number");return r(l,u,f)},a.alloc=function(l,u,f){if(typeof l!="number")throw new TypeError("Argument must be a number");var h=r(l);return u!==void 0?typeof f=="string"?h.fill(u,f):h.fill(u):h.fill(0),h},a.allocUnsafe=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return r(l)},a.allocUnsafeSlow=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(l)}})(Es,Es.exports)),Es.exports}var Tc;function Vg(){if(Tc)return Qo;Tc=1;var i=Ug().Buffer,e=i.isEncoding||function(N){switch(N=""+N,N&&N.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(N){if(!N)return"utf8";for(var P;;)switch(N){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return N;default:if(P)return;N=(""+N).toLowerCase(),P=!0}}function r(N){var P=n(N);if(typeof P!="string"&&(i.isEncoding===e||!e(N)))throw new Error("Unknown encoding: "+N);return P||N}Qo.StringDecoder=o;function o(N){this.encoding=r(N);var P;switch(this.encoding){case"utf16le":this.text=_,this.end=d,P=4;break;case"utf8":this.fillLast=f,P=4;break;case"base64":this.text=m,this.end=w,P=3;break;default:this.write=I,this.end=A;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(P)}o.prototype.write=function(N){if(N.length===0)return"";var P,v;if(this.lastNeed){if(P=this.fillLast(N),P===void 0)return"";v=this.lastNeed,this.lastNeed=0}else v=0;return v<N.length?P?P+this.text(N,v):this.text(N,v):P||""},o.prototype.end=g,o.prototype.text=h,o.prototype.fillLast=function(N){if(this.lastNeed<=N.length)return N.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);N.copy(this.lastChar,this.lastTotal-this.lastNeed,0,N.length),this.lastNeed-=N.length};function a(N){return N<=127?0:N>>5===6?2:N>>4===14?3:N>>3===30?4:N>>6===2?-1:-2}function l(N,P,v){var y=P.length-1;if(y<v)return 0;var S=a(P[y]);return S>=0?(S>0&&(N.lastNeed=S-1),S):--y<v||S===-2?0:(S=a(P[y]),S>=0?(S>0&&(N.lastNeed=S-2),S):--y<v||S===-2?0:(S=a(P[y]),S>=0?(S>0&&(S===2?S=0:N.lastNeed=S-3),S):0))}function u(N,P,v){if((P[0]&192)!==128)return N.lastNeed=0,"�";if(N.lastNeed>1&&P.length>1){if((P[1]&192)!==128)return N.lastNeed=1,"�";if(N.lastNeed>2&&P.length>2&&(P[2]&192)!==128)return N.lastNeed=2,"�"}}function f(N){var P=this.lastTotal-this.lastNeed,v=u(this,N);if(v!==void 0)return v;if(this.lastNeed<=N.length)return N.copy(this.lastChar,P,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);N.copy(this.lastChar,P,0,N.length),this.lastNeed-=N.length}function h(N,P){var v=l(this,N,P);if(!this.lastNeed)return N.toString("utf8",P);this.lastTotal=v;var y=N.length-(v-this.lastNeed);return N.copy(this.lastChar,0,y),N.toString("utf8",P,y)}function g(N){var P=N&&N.length?this.write(N):"";return this.lastNeed?P+"�":P}function _(N,P){if((N.length-P)%2===0){var v=N.toString("utf16le",P);if(v){var y=v.charCodeAt(v.length-1);if(y>=55296&&y<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=N[N.length-2],this.lastChar[1]=N[N.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=N[N.length-1],N.toString("utf16le",P,N.length-1)}function d(N){var P=N&&N.length?this.write(N):"";if(this.lastNeed){var v=this.lastTotal-this.lastNeed;return P+this.lastChar.toString("utf16le",0,v)}return P}function m(N,P){var v=(N.length-P)%3;return v===0?N.toString("base64",P):(this.lastNeed=3-v,this.lastTotal=3,v===1?this.lastChar[0]=N[N.length-1]:(this.lastChar[0]=N[N.length-2],this.lastChar[1]=N[N.length-1]),N.toString("base64",P,N.length-v))}function w(N){var P=N&&N.length?this.write(N):"";return this.lastNeed?P+this.lastChar.toString("base64",0,3-this.lastNeed):P}function I(N){return N.toString(this.encoding)}function A(N){return N&&N.length?this.write(N):""}return Qo}var Jo,Lc;function gf(){if(Lc)return Jo;Lc=1;const i=Ti(),{PromisePrototypeThen:e,SymbolAsyncIterator:n,SymbolIterator:r}=ct(),{Buffer:o}=Dn(),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_NULL_VALUES:l}=kt().codes;function u(f,h,g){let _;if(typeof h=="string"||h instanceof o)return new f({objectMode:!0,...g,read(){this.push(h),this.push(null)}});let d;if(h&&h[n])d=!0,_=h[n]();else if(h&&h[r])d=!1,_=h[r]();else throw new a("iterable",["Iterable"],h);const m=new f({objectMode:!0,highWaterMark:1,...g});let w=!1;m._read=function(){w||(w=!0,A())},m._destroy=function(N,P){e(I(N),()=>i.nextTick(P,N),v=>i.nextTick(P,v||N))};async function I(N){const P=N!=null,v=typeof _.throw=="function";if(P&&v){const{value:y,done:S}=await _.throw(N);if(await y,S)return}if(typeof _.return=="function"){const{value:y}=await _.return();await y}}async function A(){for(;;){try{const{value:N,done:P}=d?await _.next():_.next();if(P)m.push(null);else{const v=N&&typeof N.then=="function"?await N:N;if(v===null)throw w=!1,new l;if(m.push(v))continue;w=!1}}catch(N){m.destroy(N)}break}}return m}return Jo=u,Jo}var Ko,Ic;function Qs(){if(Ic)return Ko;Ic=1;const i=Ti(),{ArrayPrototypeIndexOf:e,NumberIsInteger:n,NumberIsNaN:r,NumberParseInt:o,ObjectDefineProperties:a,ObjectKeys:l,ObjectSetPrototypeOf:u,Promise:f,SafeSet:h,SymbolAsyncDispose:g,SymbolAsyncIterator:_,Symbol:d}=ct();Ko=be,be.ReadableState=Ae;const{EventEmitter:m}=Gs(),{Stream:w,prependListener:I}=Dl(),{Buffer:A}=Dn(),{addAbortSignal:N}=Zs(),P=Qn();let v=jt().debuglog("stream",z=>{v=z});const y=Hg(),S=Ki(),{getHighWaterMark:O,getDefaultHighWaterMark:X}=Xs(),{aggregateTwoErrors:C,codes:{ERR_INVALID_ARG_TYPE:U,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_OUT_OF_RANGE:$,ERR_STREAM_PUSH_AFTER_EOF:G,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:j},AbortError:F}=kt(),{validateObject:se}=Xr(),M=d("kPaused"),{StringDecoder:re}=Vg(),B=gf();u(be.prototype,w.prototype),u(be,w);const oe=()=>{},{errorOrDestroy:T}=S,Q=1,ie=2,Y=4,me=8,Z=16,W=32,ee=64,K=128,ue=256,ce=512,Ee=1024,Te=2048,q=4096,te=8192,fe=16384,xe=32768,Se=65536,Ie=1<<17,le=1<<18;function ve(z){return{enumerable:!1,get(){return(this.state&z)!==0},set(J){J?this.state|=z:this.state&=~z}}}a(Ae.prototype,{objectMode:ve(Q),ended:ve(ie),endEmitted:ve(Y),reading:ve(me),constructed:ve(Z),sync:ve(W),needReadable:ve(ee),emittedReadable:ve(K),readableListening:ve(ue),resumeScheduled:ve(ce),errorEmitted:ve(Ee),emitClose:ve(Te),autoDestroy:ve(q),destroyed:ve(te),closed:ve(fe),closeEmitted:ve(xe),multiAwaitDrain:ve(Se),readingMore:ve(Ie),dataEmitted:ve(le)});function Ae(z,J,Ne){typeof Ne!="boolean"&&(Ne=J instanceof Pn()),this.state=Te|q|Z|W,z&&z.objectMode&&(this.state|=Q),Ne&&z&&z.readableObjectMode&&(this.state|=Q),this.highWaterMark=z?O(this,z,"readableHighWaterMark",Ne):X(!1),this.buffer=new y,this.length=0,this.pipes=[],this.flowing=null,this[M]=null,z&&z.emitClose===!1&&(this.state&=~Te),z&&z.autoDestroy===!1&&(this.state&=~q),this.errored=null,this.defaultEncoding=z&&z.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,z&&z.encoding&&(this.decoder=new re(z.encoding),this.encoding=z.encoding)}function be(z){if(!(this instanceof be))return new be(z);const J=this instanceof Pn();this._readableState=new Ae(z,this,J),z&&(typeof z.read=="function"&&(this._read=z.read),typeof z.destroy=="function"&&(this._destroy=z.destroy),typeof z.construct=="function"&&(this._construct=z.construct),z.signal&&!J&&N(z.signal,this)),w.call(this,z),S.construct(this,()=>{this._readableState.needReadable&&ae(this,this._readableState)})}be.prototype.destroy=S.destroy,be.prototype._undestroy=S.undestroy,be.prototype._destroy=function(z,J){J(z)},be.prototype[m.captureRejectionSymbol]=function(z){this.destroy(z)},be.prototype[g]=function(){let z;return this.destroyed||(z=this.readableEnded?null:new F,this.destroy(z)),new f((J,Ne)=>P(this,Re=>Re&&Re!==z?Ne(Re):J(null)))},be.prototype.push=function(z,J){return qe(this,z,J,!1)},be.prototype.unshift=function(z,J){return qe(this,z,J,!0)};function qe(z,J,Ne,Re){v("readableAddChunk",J);const De=z._readableState;let _t;if((De.state&Q)===0&&(typeof J=="string"?(Ne=Ne||De.defaultEncoding,De.encoding!==Ne&&(Re&&De.encoding?J=A.from(J,Ne).toString(De.encoding):(J=A.from(J,Ne),Ne=""))):J instanceof A?Ne="":w._isUint8Array(J)?(J=w._uint8ArrayToBuffer(J),Ne=""):J!=null&&(_t=new U("chunk",["string","Buffer","Uint8Array"],J))),_t)T(z,_t);else if(J===null)De.state&=~me,b(z,De);else if((De.state&Q)!==0||J&&J.length>0)if(Re)if((De.state&Y)!==0)T(z,new j);else{if(De.destroyed||De.errored)return!1;mt(z,De,J,!0)}else if(De.ended)T(z,new G);else{if(De.destroyed||De.errored)return!1;De.state&=~me,De.decoder&&!Ne?(J=De.decoder.write(J),De.objectMode||J.length!==0?mt(z,De,J,!1):ae(z,De)):mt(z,De,J,!1)}else Re||(De.state&=~me,ae(z,De));return!De.ended&&(De.length<De.highWaterMark||De.length===0)}function mt(z,J,Ne,Re){J.flowing&&J.length===0&&!J.sync&&z.listenerCount("data")>0?((J.state&Se)!==0?J.awaitDrainWriters.clear():J.awaitDrainWriters=null,J.dataEmitted=!0,z.emit("data",Ne)):(J.length+=J.objectMode?1:Ne.length,Re?J.buffer.unshift(Ne):J.buffer.push(Ne),(J.state&ee)!==0&&x(z)),ae(z,J)}be.prototype.isPaused=function(){const z=this._readableState;return z[M]===!0||z.flowing===!1},be.prototype.setEncoding=function(z){const J=new re(z);this._readableState.decoder=J,this._readableState.encoding=this._readableState.decoder.encoding;const Ne=this._readableState.buffer;let Re="";for(const De of Ne)Re+=J.write(De);return Ne.clear(),Re!==""&&Ne.push(Re),this._readableState.length=Re.length,this};const $e=1073741824;function ft(z){if(z>$e)throw new $("size","<= 1GiB",z);return z--,z|=z>>>1,z|=z>>>2,z|=z>>>4,z|=z>>>8,z|=z>>>16,z++,z}function k(z,J){return z<=0||J.length===0&&J.ended?0:(J.state&Q)!==0?1:r(z)?J.flowing&&J.length?J.buffer.first().length:J.length:z<=J.length?z:J.ended?J.length:0}be.prototype.read=function(z){v("read",z),z===void 0?z=NaN:n(z)||(z=o(z,10));const J=this._readableState,Ne=z;if(z>J.highWaterMark&&(J.highWaterMark=ft(z)),z!==0&&(J.state&=~K),z===0&&J.needReadable&&((J.highWaterMark!==0?J.length>=J.highWaterMark:J.length>0)||J.ended))return v("read: emitReadable",J.length,J.ended),J.length===0&&J.ended?at(this):x(this),null;if(z=k(z,J),z===0&&J.ended)return J.length===0&&at(this),null;let Re=(J.state&ee)!==0;if(v("need readable",Re),(J.length===0||J.length-z<J.highWaterMark)&&(Re=!0,v("length less than watermark",Re)),J.ended||J.reading||J.destroyed||J.errored||!J.constructed)Re=!1,v("reading, ended or constructing",Re);else if(Re){v("do read"),J.state|=me|W,J.length===0&&(J.state|=ee);try{this._read(J.highWaterMark)}catch(_t){T(this,_t)}J.state&=~W,J.reading||(z=k(Ne,J))}let De;return z>0?De=st(z,J):De=null,De===null?(J.needReadable=J.length<=J.highWaterMark,z=0):(J.length-=z,J.multiAwaitDrain?J.awaitDrainWriters.clear():J.awaitDrainWriters=null),J.length===0&&(J.ended||(J.needReadable=!0),Ne!==z&&J.ended&&at(this)),De!==null&&!J.errorEmitted&&!J.closeEmitted&&(J.dataEmitted=!0,this.emit("data",De)),De};function b(z,J){if(v("onEofChunk"),!J.ended){if(J.decoder){const Ne=J.decoder.end();Ne&&Ne.length&&(J.buffer.push(Ne),J.length+=J.objectMode?1:Ne.length)}J.ended=!0,J.sync?x(z):(J.needReadable=!1,J.emittedReadable=!0,H(z))}}function x(z){const J=z._readableState;v("emitReadable",J.needReadable,J.emittedReadable),J.needReadable=!1,J.emittedReadable||(v("emitReadable",J.flowing),J.emittedReadable=!0,i.nextTick(H,z))}function H(z){const J=z._readableState;v("emitReadable_",J.destroyed,J.length,J.ended),!J.destroyed&&!J.errored&&(J.length||J.ended)&&(z.emit("readable"),J.emittedReadable=!1),J.needReadable=!J.flowing&&!J.ended&&J.length<=J.highWaterMark,Ze(z)}function ae(z,J){!J.readingMore&&J.constructed&&(J.readingMore=!0,i.nextTick(_e,z,J))}function _e(z,J){for(;!J.reading&&!J.ended&&(J.length<J.highWaterMark||J.flowing&&J.length===0);){const Ne=J.length;if(v("maybeReadMore read 0"),z.read(0),Ne===J.length)break}J.readingMore=!1}be.prototype._read=function(z){throw new R("_read()")},be.prototype.pipe=function(z,J){const Ne=this,Re=this._readableState;Re.pipes.length===1&&(Re.multiAwaitDrain||(Re.multiAwaitDrain=!0,Re.awaitDrainWriters=new h(Re.awaitDrainWriters?[Re.awaitDrainWriters]:[]))),Re.pipes.push(z),v("pipe count=%d opts=%j",Re.pipes.length,J);const _t=(!J||J.end!==!1)&&z!==i.stdout&&z!==i.stderr?At:V;Re.endEmitted?i.nextTick(_t):Ne.once("end",_t),z.on("unpipe",wt);function wt(de,pe){v("onunpipe"),de===Ne&&pe&&pe.hasUnpiped===!1&&(pe.hasUnpiped=!0,Wt())}function At(){v("onend"),z.end()}let ke,ti=!1;function Wt(){v("cleanup"),z.removeListener("close",Bn),z.removeListener("finish",it),ke&&z.removeListener("drain",ke),z.removeListener("error",fn),z.removeListener("unpipe",wt),Ne.removeListener("end",At),Ne.removeListener("end",V),Ne.removeListener("data",En),ti=!0,ke&&Re.awaitDrainWriters&&(!z._writableState||z._writableState.needDrain)&&ke()}function jn(){ti||(Re.pipes.length===1&&Re.pipes[0]===z?(v("false write response, pause",0),Re.awaitDrainWriters=z,Re.multiAwaitDrain=!1):Re.pipes.length>1&&Re.pipes.includes(z)&&(v("false write response, pause",Re.awaitDrainWriters.size),Re.awaitDrainWriters.add(z)),Ne.pause()),ke||(ke=we(Ne,z),z.on("drain",ke))}Ne.on("data",En);function En(de){v("ondata");const pe=z.write(de);v("dest.write",pe),pe===!1&&jn()}function fn(de){if(v("onerror",de),V(),z.removeListener("error",fn),z.listenerCount("error")===0){const pe=z._writableState||z._readableState;pe&&!pe.errorEmitted?T(z,de):z.emit("error",de)}}I(z,"error",fn);function Bn(){z.removeListener("finish",it),V()}z.once("close",Bn);function it(){v("onfinish"),z.removeListener("close",Bn),V()}z.once("finish",it);function V(){v("unpipe"),Ne.unpipe(z)}return z.emit("pipe",Ne),z.writableNeedDrain===!0?jn():Re.flowing||(v("pipe resume"),Ne.resume()),z};function we(z,J){return function(){const Re=z._readableState;Re.awaitDrainWriters===J?(v("pipeOnDrain",1),Re.awaitDrainWriters=null):Re.multiAwaitDrain&&(v("pipeOnDrain",Re.awaitDrainWriters.size),Re.awaitDrainWriters.delete(J)),(!Re.awaitDrainWriters||Re.awaitDrainWriters.size===0)&&z.listenerCount("data")&&z.resume()}}be.prototype.unpipe=function(z){const J=this._readableState,Ne={hasUnpiped:!1};if(J.pipes.length===0)return this;if(!z){const De=J.pipes;J.pipes=[],this.pause();for(let _t=0;_t<De.length;_t++)De[_t].emit("unpipe",this,{hasUnpiped:!1});return this}const Re=e(J.pipes,z);return Re===-1?this:(J.pipes.splice(Re,1),J.pipes.length===0&&this.pause(),z.emit("unpipe",this,Ne),this)},be.prototype.on=function(z,J){const Ne=w.prototype.on.call(this,z,J),Re=this._readableState;return z==="data"?(Re.readableListening=this.listenerCount("readable")>0,Re.flowing!==!1&&this.resume()):z==="readable"&&!Re.endEmitted&&!Re.readableListening&&(Re.readableListening=Re.needReadable=!0,Re.flowing=!1,Re.emittedReadable=!1,v("on readable",Re.length,Re.reading),Re.length?x(this):Re.reading||i.nextTick(Ye,this)),Ne},be.prototype.addListener=be.prototype.on,be.prototype.removeListener=function(z,J){const Ne=w.prototype.removeListener.call(this,z,J);return z==="readable"&&i.nextTick(Oe,this),Ne},be.prototype.off=be.prototype.removeListener,be.prototype.removeAllListeners=function(z){const J=w.prototype.removeAllListeners.apply(this,arguments);return(z==="readable"||z===void 0)&&i.nextTick(Oe,this),J};function Oe(z){const J=z._readableState;J.readableListening=z.listenerCount("readable")>0,J.resumeScheduled&&J[M]===!1?J.flowing=!0:z.listenerCount("data")>0?z.resume():J.readableListening||(J.flowing=null)}function Ye(z){v("readable nexttick read 0"),z.read(0)}be.prototype.resume=function(){const z=this._readableState;return z.flowing||(v("resume"),z.flowing=!z.readableListening,Qe(this,z)),z[M]=!1,this};function Qe(z,J){J.resumeScheduled||(J.resumeScheduled=!0,i.nextTick(Ge,z,J))}function Ge(z,J){v("resume",J.reading),J.reading||z.read(0),J.resumeScheduled=!1,z.emit("resume"),Ze(z),J.flowing&&!J.reading&&z.read(0)}be.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[M]=!0,this};function Ze(z){const J=z._readableState;for(v("flow",J.flowing);J.flowing&&z.read()!==null;);}be.prototype.wrap=function(z){let J=!1;z.on("data",Re=>{!this.push(Re)&&z.pause&&(J=!0,z.pause())}),z.on("end",()=>{this.push(null)}),z.on("error",Re=>{T(this,Re)}),z.on("close",()=>{this.destroy()}),z.on("destroy",()=>{this.destroy()}),this._read=()=>{J&&z.resume&&(J=!1,z.resume())};const Ne=l(z);for(let Re=1;Re<Ne.length;Re++){const De=Ne[Re];this[De]===void 0&&typeof z[De]=="function"&&(this[De]=z[De].bind(z))}return this},be.prototype[_]=function(){return $t(this)},be.prototype.iterator=function(z){return z!==void 0&&se(z,"options"),$t(this,z)};function $t(z,J){typeof z.read!="function"&&(z=be.wrap(z,{objectMode:!0}));const Ne=en(z,J);return Ne.stream=z,Ne}async function*en(z,J){let Ne=oe;function Re(wt){this===z?(Ne(),Ne=oe):Ne=wt}z.on("readable",Re);let De;const _t=P(z,{writable:!1},wt=>{De=wt?C(De,wt):null,Ne(),Ne=oe});try{for(;;){const wt=z.destroyed?null:z.read();if(wt!==null)yield wt;else{if(De)throw De;if(De===null)return;await new f(Re)}}}catch(wt){throw De=C(De,wt),De}finally{(De||J?.destroyOnReturn!==!1)&&(De===void 0||z._readableState.autoDestroy)?S.destroyer(z,null):(z.off("readable",Re),_t())}}a(be.prototype,{readable:{__proto__:null,get(){const z=this._readableState;return!!z&&z.readable!==!1&&!z.destroyed&&!z.errorEmitted&&!z.endEmitted},set(z){this._readableState&&(this._readableState.readable=!!z)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(z){this._readableState&&(this._readableState.flowing=z)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(z){this._readableState&&(this._readableState.destroyed=z)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),a(Ae.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[M]!==!1},set(z){this[M]=!!z}}}),be._fromList=st;function st(z,J){if(J.length===0)return null;let Ne;return J.objectMode?Ne=J.buffer.shift():!z||z>=J.length?(J.decoder?Ne=J.buffer.join(""):J.buffer.length===1?Ne=J.buffer.first():Ne=J.buffer.concat(J.length),J.buffer.clear()):Ne=J.buffer.consume(z,J.decoder),Ne}function at(z){const J=z._readableState;v("endReadable",J.endEmitted),J.endEmitted||(J.ended=!0,i.nextTick(Ai,J,z))}function Ai(z,J){if(v("endReadableNT",z.endEmitted,z.length),!z.errored&&!z.closeEmitted&&!z.endEmitted&&z.length===0){if(z.endEmitted=!0,J.emit("end"),J.writable&&J.allowHalfOpen===!1)i.nextTick(hn,J);else if(z.autoDestroy){const Ne=J._writableState;(!Ne||Ne.autoDestroy&&(Ne.finished||Ne.writable===!1))&&J.destroy()}}}function hn(z){z.writable&&!z.writableEnded&&!z.destroyed&&z.end()}be.from=function(z,J){return B(be,z,J)};let Fn;function ei(){return Fn===void 0&&(Fn={}),Fn}return be.fromWeb=function(z,J){return ei().newStreamReadableFromReadableStream(z,J)},be.toWeb=function(z,J){return ei().newReadableStreamFromStreamReadable(z,J)},be.wrap=function(z,J){var Ne,Re;return new be({objectMode:(Ne=(Re=z.readableObjectMode)!==null&&Re!==void 0?Re:z.objectMode)!==null&&Ne!==void 0?Ne:!0,...J,destroy(De,_t){S.destroyer(z,De),_t(De)}}).wrap(z)},Ko}var Yo,Ac;function Ml(){if(Ac)return Yo;Ac=1;const i=Ti(),{ArrayPrototypeSlice:e,Error:n,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:o,ObjectDefineProperties:a,ObjectSetPrototypeOf:l,StringPrototypeToLowerCase:u,Symbol:f,SymbolHasInstance:h}=ct();Yo=se,se.WritableState=j;const{EventEmitter:g}=Gs(),_=Dl().Stream,{Buffer:d}=Dn(),m=Ki(),{addAbortSignal:w}=Zs(),{getHighWaterMark:I,getDefaultHighWaterMark:A}=Xs(),{ERR_INVALID_ARG_TYPE:N,ERR_METHOD_NOT_IMPLEMENTED:P,ERR_MULTIPLE_CALLBACK:v,ERR_STREAM_CANNOT_PIPE:y,ERR_STREAM_DESTROYED:S,ERR_STREAM_ALREADY_FINISHED:O,ERR_STREAM_NULL_VALUES:X,ERR_STREAM_WRITE_AFTER_END:C,ERR_UNKNOWN_ENCODING:U}=kt().codes,{errorOrDestroy:R}=m;l(se.prototype,_.prototype),l(se,_);function $(){}const G=f("kOnFinished");function j(q,te,fe){typeof fe!="boolean"&&(fe=te instanceof Pn()),this.objectMode=!!(q&&q.objectMode),fe&&(this.objectMode=this.objectMode||!!(q&&q.writableObjectMode)),this.highWaterMark=q?I(this,q,"writableHighWaterMark",fe):A(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const xe=!!(q&&q.decodeStrings===!1);this.decodeStrings=!xe,this.defaultEncoding=q&&q.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=T.bind(void 0,te),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,F(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!q||q.emitClose!==!1,this.autoDestroy=!q||q.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[G]=[]}function F(q){q.buffered=[],q.bufferedIndex=0,q.allBuffers=!0,q.allNoop=!0}j.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},o(j.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function se(q){const te=this instanceof Pn();if(!te&&!r(se,this))return new se(q);this._writableState=new j(q,this,te),q&&(typeof q.write=="function"&&(this._write=q.write),typeof q.writev=="function"&&(this._writev=q.writev),typeof q.destroy=="function"&&(this._destroy=q.destroy),typeof q.final=="function"&&(this._final=q.final),typeof q.construct=="function"&&(this._construct=q.construct),q.signal&&w(q.signal,this)),_.call(this,q),m.construct(this,()=>{const fe=this._writableState;fe.writing||me(this,fe),K(this,fe)})}o(se,h,{__proto__:null,value:function(q){return r(this,q)?!0:this!==se?!1:q&&q._writableState instanceof j}}),se.prototype.pipe=function(){R(this,new y)};function M(q,te,fe,xe){const Se=q._writableState;if(typeof fe=="function")xe=fe,fe=Se.defaultEncoding;else{if(!fe)fe=Se.defaultEncoding;else if(fe!=="buffer"&&!d.isEncoding(fe))throw new U(fe);typeof xe!="function"&&(xe=$)}if(te===null)throw new X;if(!Se.objectMode)if(typeof te=="string")Se.decodeStrings!==!1&&(te=d.from(te,fe),fe="buffer");else if(te instanceof d)fe="buffer";else if(_._isUint8Array(te))te=_._uint8ArrayToBuffer(te),fe="buffer";else throw new N("chunk",["string","Buffer","Uint8Array"],te);let Ie;return Se.ending?Ie=new C:Se.destroyed&&(Ie=new S("write")),Ie?(i.nextTick(xe,Ie),R(q,Ie,!0),Ie):(Se.pendingcb++,re(q,Se,te,fe,xe))}se.prototype.write=function(q,te,fe){return M(this,q,te,fe)===!0},se.prototype.cork=function(){this._writableState.corked++},se.prototype.uncork=function(){const q=this._writableState;q.corked&&(q.corked--,q.writing||me(this,q))},se.prototype.setDefaultEncoding=function(te){if(typeof te=="string"&&(te=u(te)),!d.isEncoding(te))throw new U(te);return this._writableState.defaultEncoding=te,this};function re(q,te,fe,xe,Se){const Ie=te.objectMode?1:fe.length;te.length+=Ie;const le=te.length<te.highWaterMark;return le||(te.needDrain=!0),te.writing||te.corked||te.errored||!te.constructed?(te.buffered.push({chunk:fe,encoding:xe,callback:Se}),te.allBuffers&&xe!=="buffer"&&(te.allBuffers=!1),te.allNoop&&Se!==$&&(te.allNoop=!1)):(te.writelen=Ie,te.writecb=Se,te.writing=!0,te.sync=!0,q._write(fe,xe,te.onwrite),te.sync=!1),le&&!te.errored&&!te.destroyed}function B(q,te,fe,xe,Se,Ie,le){te.writelen=xe,te.writecb=le,te.writing=!0,te.sync=!0,te.destroyed?te.onwrite(new S("write")):fe?q._writev(Se,te.onwrite):q._write(Se,Ie,te.onwrite),te.sync=!1}function oe(q,te,fe,xe){--te.pendingcb,xe(fe),Y(te),R(q,fe)}function T(q,te){const fe=q._writableState,xe=fe.sync,Se=fe.writecb;if(typeof Se!="function"){R(q,new v);return}fe.writing=!1,fe.writecb=null,fe.length-=fe.writelen,fe.writelen=0,te?(te.stack,fe.errored||(fe.errored=te),q._readableState&&!q._readableState.errored&&(q._readableState.errored=te),xe?i.nextTick(oe,q,fe,te,Se):oe(q,fe,te,Se)):(fe.buffered.length>fe.bufferedIndex&&me(q,fe),xe?fe.afterWriteTickInfo!==null&&fe.afterWriteTickInfo.cb===Se?fe.afterWriteTickInfo.count++:(fe.afterWriteTickInfo={count:1,cb:Se,stream:q,state:fe},i.nextTick(Q,fe.afterWriteTickInfo)):ie(q,fe,1,Se))}function Q({stream:q,state:te,count:fe,cb:xe}){return te.afterWriteTickInfo=null,ie(q,te,fe,xe)}function ie(q,te,fe,xe){for(!te.ending&&!q.destroyed&&te.length===0&&te.needDrain&&(te.needDrain=!1,q.emit("drain"));fe-- >0;)te.pendingcb--,xe();te.destroyed&&Y(te),K(q,te)}function Y(q){if(q.writing)return;for(let Se=q.bufferedIndex;Se<q.buffered.length;++Se){var te;const{chunk:Ie,callback:le}=q.buffered[Se],ve=q.objectMode?1:Ie.length;q.length-=ve,le((te=q.errored)!==null&&te!==void 0?te:new S("write"))}const fe=q[G].splice(0);for(let Se=0;Se<fe.length;Se++){var xe;fe[Se]((xe=q.errored)!==null&&xe!==void 0?xe:new S("end"))}F(q)}function me(q,te){if(te.corked||te.bufferProcessing||te.destroyed||!te.constructed)return;const{buffered:fe,bufferedIndex:xe,objectMode:Se}=te,Ie=fe.length-xe;if(!Ie)return;let le=xe;if(te.bufferProcessing=!0,Ie>1&&q._writev){te.pendingcb-=Ie-1;const ve=te.allNoop?$:be=>{for(let qe=le;qe<fe.length;++qe)fe[qe].callback(be)},Ae=te.allNoop&&le===0?fe:e(fe,le);Ae.allBuffers=te.allBuffers,B(q,te,!0,te.length,Ae,"",ve),F(te)}else{do{const{chunk:ve,encoding:Ae,callback:be}=fe[le];fe[le++]=null;const qe=Se?1:ve.length;B(q,te,!1,qe,ve,Ae,be)}while(le<fe.length&&!te.writing);le===fe.length?F(te):le>256?(fe.splice(0,le),te.bufferedIndex=0):te.bufferedIndex=le}te.bufferProcessing=!1}se.prototype._write=function(q,te,fe){if(this._writev)this._writev([{chunk:q,encoding:te}],fe);else throw new P("_write()")},se.prototype._writev=null,se.prototype.end=function(q,te,fe){const xe=this._writableState;typeof q=="function"?(fe=q,q=null,te=null):typeof te=="function"&&(fe=te,te=null);let Se;if(q!=null){const Ie=M(this,q,te);Ie instanceof n&&(Se=Ie)}return xe.corked&&(xe.corked=1,this.uncork()),Se||(!xe.errored&&!xe.ending?(xe.ending=!0,K(this,xe,!0),xe.ended=!0):xe.finished?Se=new O("end"):xe.destroyed&&(Se=new S("end"))),typeof fe=="function"&&(Se||xe.finished?i.nextTick(fe,Se):xe[G].push(fe)),this};function Z(q){return q.ending&&!q.destroyed&&q.constructed&&q.length===0&&!q.errored&&q.buffered.length===0&&!q.finished&&!q.writing&&!q.errorEmitted&&!q.closeEmitted}function W(q,te){let fe=!1;function xe(Se){if(fe){R(q,Se??v());return}if(fe=!0,te.pendingcb--,Se){const Ie=te[G].splice(0);for(let le=0;le<Ie.length;le++)Ie[le](Se);R(q,Se,te.sync)}else Z(te)&&(te.prefinished=!0,q.emit("prefinish"),te.pendingcb++,i.nextTick(ue,q,te))}te.sync=!0,te.pendingcb++;try{q._final(xe)}catch(Se){xe(Se)}te.sync=!1}function ee(q,te){!te.prefinished&&!te.finalCalled&&(typeof q._final=="function"&&!te.destroyed?(te.finalCalled=!0,W(q,te)):(te.prefinished=!0,q.emit("prefinish")))}function K(q,te,fe){Z(te)&&(ee(q,te),te.pendingcb===0&&(fe?(te.pendingcb++,i.nextTick((xe,Se)=>{Z(Se)?ue(xe,Se):Se.pendingcb--},q,te)):Z(te)&&(te.pendingcb++,ue(q,te))))}function ue(q,te){te.pendingcb--,te.finished=!0;const fe=te[G].splice(0);for(let xe=0;xe<fe.length;xe++)fe[xe]();if(q.emit("finish"),te.autoDestroy){const xe=q._readableState;(!xe||xe.autoDestroy&&(xe.endEmitted||xe.readable===!1))&&q.destroy()}}a(se.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(q){this._writableState&&(this._writableState.destroyed=q)}},writable:{__proto__:null,get(){const q=this._writableState;return!!q&&q.writable!==!1&&!q.destroyed&&!q.errored&&!q.ending&&!q.ended},set(q){this._writableState&&(this._writableState.writable=!!q)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const q=this._writableState;return q?!q.destroyed&&!q.ending&&q.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const ce=m.destroy;se.prototype.destroy=function(q,te){const fe=this._writableState;return!fe.destroyed&&(fe.bufferedIndex<fe.buffered.length||fe[G].length)&&i.nextTick(Y,fe),ce.call(this,q,te),this},se.prototype._undestroy=m.undestroy,se.prototype._destroy=function(q,te){te(q)},se.prototype[g.captureRejectionSymbol]=function(q){this.destroy(q)};let Ee;function Te(){return Ee===void 0&&(Ee={}),Ee}return se.fromWeb=function(q,te){return Te().newStreamWritableFromWritableStream(q,te)},se.toWeb=function(q){return Te().newWritableStreamFromStreamWritable(q)},Yo}var ea,Nc;function Wg(){if(Nc)return ea;Nc=1;const i=Ti(),e=Dn(),{isReadable:n,isWritable:r,isIterable:o,isNodeStream:a,isReadableNodeStream:l,isWritableNodeStream:u,isDuplexNodeStream:f,isReadableStream:h,isWritableStream:g}=Mn(),_=Qn(),{AbortError:d,codes:{ERR_INVALID_ARG_TYPE:m,ERR_INVALID_RETURN_VALUE:w}}=kt(),{destroyer:I}=Ki(),A=Pn(),N=Qs(),P=Ml(),{createDeferredPromise:v}=jt(),y=gf(),S=globalThis.Blob||e.Blob,O=typeof S<"u"?function(j){return j instanceof S}:function(j){return!1},X=globalThis.AbortController||Hr().AbortController,{FunctionPrototypeCall:C}=ct();class U extends A{constructor(j){super(j),j?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),j?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}ea=function G(j,F){if(f(j))return j;if(l(j))return $({readable:j});if(u(j))return $({writable:j});if(a(j))return $({writable:!1,readable:!1});if(h(j))return $({readable:N.fromWeb(j)});if(g(j))return $({writable:P.fromWeb(j)});if(typeof j=="function"){const{value:M,write:re,final:B,destroy:oe}=R(j);if(o(M))return y(U,M,{objectMode:!0,write:re,final:B,destroy:oe});const T=M?.then;if(typeof T=="function"){let Q;const ie=C(T,M,Y=>{if(Y!=null)throw new w("nully","body",Y)},Y=>{I(Q,Y)});return Q=new U({objectMode:!0,readable:!1,write:re,final(Y){B(async()=>{try{await ie,i.nextTick(Y,null)}catch(me){i.nextTick(Y,me)}})},destroy:oe})}throw new w("Iterable, AsyncIterable or AsyncFunction",F,M)}if(O(j))return G(j.arrayBuffer());if(o(j))return y(U,j,{objectMode:!0,writable:!1});if(h(j?.readable)&&g(j?.writable))return U.fromWeb(j);if(typeof j?.writable=="object"||typeof j?.readable=="object"){const M=j!=null&&j.readable?l(j?.readable)?j?.readable:G(j.readable):void 0,re=j!=null&&j.writable?u(j?.writable)?j?.writable:G(j.writable):void 0;return $({readable:M,writable:re})}const se=j?.then;if(typeof se=="function"){let M;return C(se,j,re=>{re!=null&&M.push(re),M.push(null)},re=>{I(M,re)}),M=new U({objectMode:!0,writable:!1,read(){}})}throw new m(F,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],j)};function R(G){let{promise:j,resolve:F}=v();const se=new X,M=se.signal;return{value:G((async function*(){for(;;){const B=j;j=null;const{chunk:oe,done:T,cb:Q}=await B;if(i.nextTick(Q),T)return;if(M.aborted)throw new d(void 0,{cause:M.reason});({promise:j,resolve:F}=v()),yield oe}})(),{signal:M}),write(B,oe,T){const Q=F;F=null,Q({chunk:B,done:!1,cb:T})},final(B){const oe=F;F=null,oe({done:!0,cb:B})},destroy(B,oe){se.abort(),oe(B)}}}function $(G){const j=G.readable&&typeof G.readable.read!="function"?N.wrap(G.readable):G.readable,F=G.writable;let se=!!n(j),M=!!r(F),re,B,oe,T,Q;function ie(Y){const me=T;T=null,me?me(Y):Y&&Q.destroy(Y)}return Q=new U({readableObjectMode:!!(j!=null&&j.readableObjectMode),writableObjectMode:!!(F!=null&&F.writableObjectMode),readable:se,writable:M}),M&&(_(F,Y=>{M=!1,Y&&I(j,Y),ie(Y)}),Q._write=function(Y,me,Z){F.write(Y,me)?Z():re=Z},Q._final=function(Y){F.end(),B=Y},F.on("drain",function(){if(re){const Y=re;re=null,Y()}}),F.on("finish",function(){if(B){const Y=B;B=null,Y()}})),se&&(_(j,Y=>{se=!1,Y&&I(j,Y),ie(Y)}),j.on("readable",function(){if(oe){const Y=oe;oe=null,Y()}}),j.on("end",function(){Q.push(null)}),Q._read=function(){for(;;){const Y=j.read();if(Y===null){oe=Q._read;return}if(!Q.push(Y))return}}),Q._destroy=function(Y,me){!Y&&T!==null&&(Y=new d),oe=null,re=null,B=null,T===null?me(Y):(T=me,I(F,Y),I(j,Y))},Q}return ea}var ta,Rc;function Pn(){if(Rc)return ta;Rc=1;const{ObjectDefineProperties:i,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:n,ObjectSetPrototypeOf:r}=ct();ta=l;const o=Qs(),a=Ml();r(l.prototype,o.prototype),r(l,o);{const g=n(a.prototype);for(let _=0;_<g.length;_++){const d=g[_];l.prototype[d]||(l.prototype[d]=a.prototype[d])}}function l(g){if(!(this instanceof l))return new l(g);o.call(this,g),a.call(this,g),g?(this.allowHalfOpen=g.allowHalfOpen!==!1,g.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),g.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}i(l.prototype,{writable:{__proto__:null,...e(a.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(a.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(a.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(a.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(a.prototype,"writableLength")},writableFinished:{__proto__:null,...e(a.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(a.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(a.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(a.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(g){this._readableState&&this._writableState&&(this._readableState.destroyed=g,this._writableState.destroyed=g)}}});let u;function f(){return u===void 0&&(u={}),u}l.fromWeb=function(g,_){return f().newStreamDuplexFromReadableWritablePair(g,_)},l.toWeb=function(g){return f().newReadableWritablePairFromDuplex(g)};let h;return l.from=function(g){return h||(h=Wg()),h(g,"body")},ta}var na,Cc;function mf(){if(Cc)return na;Cc=1;const{ObjectSetPrototypeOf:i,Symbol:e}=ct();na=l;const{ERR_METHOD_NOT_IMPLEMENTED:n}=kt().codes,r=Pn(),{getHighWaterMark:o}=Xs();i(l.prototype,r.prototype),i(l,r);const a=e("kCallback");function l(h){if(!(this instanceof l))return new l(h);const g=h?o(this,h,"readableHighWaterMark",!0):null;g===0&&(h={...h,highWaterMark:null,readableHighWaterMark:g,writableHighWaterMark:h.writableHighWaterMark||0}),r.call(this,h),this._readableState.sync=!1,this[a]=null,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",f)}function u(h){typeof this._flush=="function"&&!this.destroyed?this._flush((g,_)=>{if(g){h?h(g):this.destroy(g);return}_!=null&&this.push(_),this.push(null),h&&h()}):(this.push(null),h&&h())}function f(){this._final!==u&&u.call(this)}return l.prototype._final=u,l.prototype._transform=function(h,g,_){throw new n("_transform()")},l.prototype._write=function(h,g,_){const d=this._readableState,m=this._writableState,w=d.length;this._transform(h,g,(I,A)=>{if(I){_(I);return}A!=null&&this.push(A),m.ended||w===d.length||d.length<d.highWaterMark?_():this[a]=_})},l.prototype._read=function(){if(this[a]){const h=this[a];this[a]=null,h()}},na}var ia,Pc;function _f(){if(Pc)return ia;Pc=1;const{ObjectSetPrototypeOf:i}=ct();ia=n;const e=mf();i(n.prototype,e.prototype),i(n,e);function n(r){if(!(this instanceof n))return new n(r);e.call(this,r)}return n.prototype._transform=function(r,o,a){a(null,r)},ia}var ra,kc;function Ol(){if(kc)return ra;kc=1;const i=Ti(),{ArrayIsArray:e,Promise:n,SymbolAsyncIterator:r,SymbolDispose:o}=ct(),a=Qn(),{once:l}=jt(),u=Ki(),f=Pn(),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:_,ERR_MISSING_ARGS:d,ERR_STREAM_DESTROYED:m,ERR_STREAM_PREMATURE_CLOSE:w},AbortError:I}=kt(),{validateFunction:A,validateAbortSignal:N}=Xr(),{isIterable:P,isReadable:v,isReadableNodeStream:y,isNodeStream:S,isTransformStream:O,isWebStream:X,isReadableStream:C,isReadableFinished:U}=Mn(),R=globalThis.AbortController||Hr().AbortController;let $,G,j;function F(Y,me,Z){let W=!1;Y.on("close",()=>{W=!0});const ee=a(Y,{readable:me,writable:Z},K=>{W=!K});return{destroy:K=>{W||(W=!0,u.destroyer(Y,K||new m("pipe")))},cleanup:ee}}function se(Y){return A(Y[Y.length-1],"streams[stream.length - 1]"),Y.pop()}function M(Y){if(P(Y))return Y;if(y(Y))return re(Y);throw new g("val",["Readable","Iterable","AsyncIterable"],Y)}async function*re(Y){G||(G=Qs()),yield*G.prototype[r].call(Y)}async function B(Y,me,Z,{end:W}){let ee,K=null;const ue=Te=>{if(Te&&(ee=Te),K){const q=K;K=null,q()}},ce=()=>new n((Te,q)=>{ee?q(ee):K=()=>{ee?q(ee):Te()}});me.on("drain",ue);const Ee=a(me,{readable:!1},ue);try{me.writableNeedDrain&&await ce();for await(const Te of Y)me.write(Te)||await ce();W&&(me.end(),await ce()),Z()}catch(Te){Z(ee!==Te?h(ee,Te):Te)}finally{Ee(),me.off("drain",ue)}}async function oe(Y,me,Z,{end:W}){O(me)&&(me=me.writable);const ee=me.getWriter();try{for await(const K of Y)await ee.ready,ee.write(K).catch(()=>{});await ee.ready,W&&await ee.close(),Z()}catch(K){try{await ee.abort(K),Z(K)}catch(ue){Z(ue)}}}function T(...Y){return Q(Y,l(se(Y)))}function Q(Y,me,Z){if(Y.length===1&&e(Y[0])&&(Y=Y[0]),Y.length<2)throw new d("streams");const W=new R,ee=W.signal,K=Z?.signal,ue=[];N(K,"options.signal");function ce(){Se(new I)}j=j||jt().addAbortListener;let Ee;K&&(Ee=j(K,ce));let Te,q;const te=[];let fe=0;function xe(Ae){Se(Ae,--fe===0)}function Se(Ae,be){var qe;if(Ae&&(!Te||Te.code==="ERR_STREAM_PREMATURE_CLOSE")&&(Te=Ae),!(!Te&&!be)){for(;te.length;)te.shift()(Te);(qe=Ee)===null||qe===void 0||qe[o](),W.abort(),be&&(Te||ue.forEach(mt=>mt()),i.nextTick(me,Te,q))}}let Ie;for(let Ae=0;Ae<Y.length;Ae++){const be=Y[Ae],qe=Ae<Y.length-1,mt=Ae>0,$e=qe||Z?.end!==!1,ft=Ae===Y.length-1;if(S(be)){let k=function(b){b&&b.name!=="AbortError"&&b.code!=="ERR_STREAM_PREMATURE_CLOSE"&&xe(b)};if($e){const{destroy:b,cleanup:x}=F(be,qe,mt);te.push(b),v(be)&&ft&&ue.push(x)}be.on("error",k),v(be)&&ft&&ue.push(()=>{be.removeListener("error",k)})}if(Ae===0)if(typeof be=="function"){if(Ie=be({signal:ee}),!P(Ie))throw new _("Iterable, AsyncIterable or Stream","source",Ie)}else P(be)||y(be)||O(be)?Ie=be:Ie=f.from(be);else if(typeof be=="function"){if(O(Ie)){var le;Ie=M((le=Ie)===null||le===void 0?void 0:le.readable)}else Ie=M(Ie);if(Ie=be(Ie,{signal:ee}),qe){if(!P(Ie,!0))throw new _("AsyncIterable",`transform[${Ae-1}]`,Ie)}else{var ve;$||($=_f());const k=new $({objectMode:!0}),b=(ve=Ie)===null||ve===void 0?void 0:ve.then;if(typeof b=="function")fe++,b.call(Ie,ae=>{q=ae,ae!=null&&k.write(ae),$e&&k.end(),i.nextTick(xe)},ae=>{k.destroy(ae),i.nextTick(xe,ae)});else if(P(Ie,!0))fe++,B(Ie,k,xe,{end:$e});else if(C(Ie)||O(Ie)){const ae=Ie.readable||Ie;fe++,B(ae,k,xe,{end:$e})}else throw new _("AsyncIterable or Promise","destination",Ie);Ie=k;const{destroy:x,cleanup:H}=F(Ie,!1,!0);te.push(x),ft&&ue.push(H)}}else if(S(be)){if(y(Ie)){fe+=2;const k=ie(Ie,be,xe,{end:$e});v(be)&&ft&&ue.push(k)}else if(O(Ie)||C(Ie)){const k=Ie.readable||Ie;fe++,B(k,be,xe,{end:$e})}else if(P(Ie))fe++,B(Ie,be,xe,{end:$e});else throw new g("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Ie);Ie=be}else if(X(be)){if(y(Ie))fe++,oe(M(Ie),be,xe,{end:$e});else if(C(Ie)||P(Ie))fe++,oe(Ie,be,xe,{end:$e});else if(O(Ie))fe++,oe(Ie.readable,be,xe,{end:$e});else throw new g("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Ie);Ie=be}else Ie=f.from(be)}return(ee!=null&&ee.aborted||K!=null&&K.aborted)&&i.nextTick(ce),Ie}function ie(Y,me,Z,{end:W}){let ee=!1;if(me.on("close",()=>{ee||Z(new w)}),Y.pipe(me,{end:!1}),W){let K=function(){ee=!0,me.end()};U(Y)?i.nextTick(K):Y.once("end",K)}else Z();return a(Y,{readable:!0,writable:!1},K=>{const ue=Y._readableState;K&&K.code==="ERR_STREAM_PREMATURE_CLOSE"&&ue&&ue.ended&&!ue.errored&&!ue.errorEmitted?Y.once("end",Z).once("error",Z):Z(K)}),a(me,{readable:!1,writable:!0},Z)}return ra={pipelineImpl:Q,pipeline:T},ra}var sa,Dc;function yf(){if(Dc)return sa;Dc=1;const{pipeline:i}=Ol(),e=Pn(),{destroyer:n}=Ki(),{isNodeStream:r,isReadable:o,isWritable:a,isWebStream:l,isTransformStream:u,isWritableStream:f,isReadableStream:h}=Mn(),{AbortError:g,codes:{ERR_INVALID_ARG_VALUE:_,ERR_MISSING_ARGS:d}}=kt(),m=Qn();return sa=function(...I){if(I.length===0)throw new d("streams");if(I.length===1)return e.from(I[0]);const A=[...I];if(typeof I[0]=="function"&&(I[0]=e.from(I[0])),typeof I[I.length-1]=="function"){const $=I.length-1;I[$]=e.from(I[$])}for(let $=0;$<I.length;++$)if(!(!r(I[$])&&!l(I[$]))){if($<I.length-1&&!(o(I[$])||h(I[$])||u(I[$])))throw new _(`streams[${$}]`,A[$],"must be readable");if($>0&&!(a(I[$])||f(I[$])||u(I[$])))throw new _(`streams[${$}]`,A[$],"must be writable")}let N,P,v,y,S;function O($){const G=y;y=null,G?G($):$?S.destroy($):!R&&!U&&S.destroy()}const X=I[0],C=i(I,O),U=!!(a(X)||f(X)||u(X)),R=!!(o(C)||h(C)||u(C));if(S=new e({writableObjectMode:!!(X!=null&&X.writableObjectMode),readableObjectMode:!!(C!=null&&C.readableObjectMode),writable:U,readable:R}),U){if(r(X))S._write=function(G,j,F){X.write(G,j)?F():N=F},S._final=function(G){X.end(),P=G},X.on("drain",function(){if(N){const G=N;N=null,G()}});else if(l(X)){const j=(u(X)?X.writable:X).getWriter();S._write=async function(F,se,M){try{await j.ready,j.write(F).catch(()=>{}),M()}catch(re){M(re)}},S._final=async function(F){try{await j.ready,j.close().catch(()=>{}),P=F}catch(se){F(se)}}}const $=u(C)?C.readable:C;m($,()=>{if(P){const G=P;P=null,G()}})}if(R){if(r(C))C.on("readable",function(){if(v){const $=v;v=null,$()}}),C.on("end",function(){S.push(null)}),S._read=function(){for(;;){const $=C.read();if($===null){v=S._read;return}if(!S.push($))return}};else if(l(C)){const G=(u(C)?C.readable:C).getReader();S._read=async function(){for(;;)try{const{value:j,done:F}=await G.read();if(!S.push(j))return;if(F){S.push(null);return}}catch{return}}}}return S._destroy=function($,G){!$&&y!==null&&($=new g),v=null,N=null,P=null,y===null?G($):(y=G,r(C)&&n(C,$))},S},sa}var Mc;function Gg(){if(Mc)return ws;Mc=1;const i=globalThis.AbortController||Hr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:n,ERR_MISSING_ARGS:r,ERR_OUT_OF_RANGE:o},AbortError:a}=kt(),{validateAbortSignal:l,validateInteger:u,validateObject:f}=Xr(),h=ct().Symbol("kWeak"),g=ct().Symbol("kResistStopPropagation"),{finished:_}=Qn(),d=yf(),{addAbortSignalNoValidate:m}=Zs(),{isWritable:w,isNodeStream:I}=Mn(),{deprecate:A}=jt(),{ArrayPrototypePush:N,Boolean:P,MathFloor:v,Number:y,NumberIsNaN:S,Promise:O,PromiseReject:X,PromiseResolve:C,PromisePrototypeThen:U,Symbol:R}=ct(),$=R("kEmpty"),G=R("kEof");function j(K,ue){if(ue!=null&&f(ue,"options"),ue?.signal!=null&&l(ue.signal,"options.signal"),I(K)&&!w(K))throw new e("stream",K,"must be writable");const ce=d(this,K);return ue!=null&&ue.signal&&m(ue.signal,ce),ce}function F(K,ue){if(typeof K!="function")throw new n("fn",["Function","AsyncFunction"],K);ue!=null&&f(ue,"options"),ue?.signal!=null&&l(ue.signal,"options.signal");let ce=1;ue?.concurrency!=null&&(ce=v(ue.concurrency));let Ee=ce-1;return ue?.highWaterMark!=null&&(Ee=v(ue.highWaterMark)),u(ce,"options.concurrency",1),u(Ee,"options.highWaterMark",0),Ee+=ce,(async function*(){const q=jt().AbortSignalAny([ue?.signal].filter(P)),te=this,fe=[],xe={signal:q};let Se,Ie,le=!1,ve=0;function Ae(){le=!0,be()}function be(){ve-=1,qe()}function qe(){Ie&&!le&&ve<ce&&fe.length<Ee&&(Ie(),Ie=null)}async function mt(){try{for await(let $e of te){if(le)return;if(q.aborted)throw new a;try{if($e=K($e,xe),$e===$)continue;$e=C($e)}catch(ft){$e=X(ft)}ve+=1,U($e,be,Ae),fe.push($e),Se&&(Se(),Se=null),!le&&(fe.length>=Ee||ve>=ce)&&await new O(ft=>{Ie=ft})}fe.push(G)}catch($e){const ft=X($e);U(ft,be,Ae),fe.push(ft)}finally{le=!0,Se&&(Se(),Se=null)}}mt();try{for(;;){for(;fe.length>0;){const $e=await fe[0];if($e===G)return;if(q.aborted)throw new a;$e!==$&&(yield $e),fe.shift(),qe()}await new O($e=>{Se=$e})}}finally{le=!0,Ie&&(Ie(),Ie=null)}}).call(this)}function se(K=void 0){return K!=null&&f(K,"options"),K?.signal!=null&&l(K.signal,"options.signal"),(async function*(){let ce=0;for await(const Te of this){var Ee;if(K!=null&&(Ee=K.signal)!==null&&Ee!==void 0&&Ee.aborted)throw new a({cause:K.signal.reason});yield[ce++,Te]}}).call(this)}async function M(K,ue=void 0){for await(const ce of T.call(this,K,ue))return!0;return!1}async function re(K,ue=void 0){if(typeof K!="function")throw new n("fn",["Function","AsyncFunction"],K);return!await M.call(this,async(...ce)=>!await K(...ce),ue)}async function B(K,ue){for await(const ce of T.call(this,K,ue))return ce}async function oe(K,ue){if(typeof K!="function")throw new n("fn",["Function","AsyncFunction"],K);async function ce(Ee,Te){return await K(Ee,Te),$}for await(const Ee of F.call(this,ce,ue));}function T(K,ue){if(typeof K!="function")throw new n("fn",["Function","AsyncFunction"],K);async function ce(Ee,Te){return await K(Ee,Te)?Ee:$}return F.call(this,ce,ue)}class Q extends r{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function ie(K,ue,ce){var Ee;if(typeof K!="function")throw new n("reducer",["Function","AsyncFunction"],K);ce!=null&&f(ce,"options"),ce?.signal!=null&&l(ce.signal,"options.signal");let Te=arguments.length>1;if(ce!=null&&(Ee=ce.signal)!==null&&Ee!==void 0&&Ee.aborted){const Se=new a(void 0,{cause:ce.signal.reason});throw this.once("error",()=>{}),await _(this.destroy(Se)),Se}const q=new i,te=q.signal;if(ce!=null&&ce.signal){const Se={once:!0,[h]:this,[g]:!0};ce.signal.addEventListener("abort",()=>q.abort(),Se)}let fe=!1;try{for await(const Se of this){var xe;if(fe=!0,ce!=null&&(xe=ce.signal)!==null&&xe!==void 0&&xe.aborted)throw new a;Te?ue=await K(ue,Se,{signal:te}):(ue=Se,Te=!0)}if(!fe&&!Te)throw new Q}finally{q.abort()}return ue}async function Y(K){K!=null&&f(K,"options"),K?.signal!=null&&l(K.signal,"options.signal");const ue=[];for await(const Ee of this){var ce;if(K!=null&&(ce=K.signal)!==null&&ce!==void 0&&ce.aborted)throw new a(void 0,{cause:K.signal.reason});N(ue,Ee)}return ue}function me(K,ue){const ce=F.call(this,K,ue);return(async function*(){for await(const Te of ce)yield*Te}).call(this)}function Z(K){if(K=y(K),S(K))return 0;if(K<0)throw new o("number",">= 0",K);return K}function W(K,ue=void 0){return ue!=null&&f(ue,"options"),ue?.signal!=null&&l(ue.signal,"options.signal"),K=Z(K),(async function*(){var Ee;if(ue!=null&&(Ee=ue.signal)!==null&&Ee!==void 0&&Ee.aborted)throw new a;for await(const q of this){var Te;if(ue!=null&&(Te=ue.signal)!==null&&Te!==void 0&&Te.aborted)throw new a;K--<=0&&(yield q)}}).call(this)}function ee(K,ue=void 0){return ue!=null&&f(ue,"options"),ue?.signal!=null&&l(ue.signal,"options.signal"),K=Z(K),(async function*(){var Ee;if(ue!=null&&(Ee=ue.signal)!==null&&Ee!==void 0&&Ee.aborted)throw new a;for await(const q of this){var Te;if(ue!=null&&(Te=ue.signal)!==null&&Te!==void 0&&Te.aborted)throw new a;if(K-- >0&&(yield q),K<=0)return}}).call(this)}return ws.streamReturningOperators={asIndexedPairs:A(se,"readable.asIndexedPairs will be removed in a future version."),drop:W,filter:T,flatMap:me,map:F,take:ee,compose:j},ws.promiseReturningOperators={every:re,forEach:oe,reduce:ie,toArray:Y,some:M,find:B},ws}var oa,Oc;function bf(){if(Oc)return oa;Oc=1;const{ArrayPrototypePop:i,Promise:e}=ct(),{isIterable:n,isNodeStream:r,isWebStream:o}=Mn(),{pipelineImpl:a}=Ol(),{finished:l}=Qn();vf();function u(...f){return new e((h,g)=>{let _,d;const m=f[f.length-1];if(m&&typeof m=="object"&&!r(m)&&!n(m)&&!o(m)){const w=i(f);_=w.signal,d=w.end}a(f,(w,I)=>{w?g(w):h(I)},{signal:_,end:d})})}return oa={finished:l,pipeline:u},oa}var Fc;function vf(){if(Fc)return Fo.exports;Fc=1;const{Buffer:i}=Dn(),{ObjectDefineProperty:e,ObjectKeys:n,ReflectApply:r}=ct(),{promisify:{custom:o}}=jt(),{streamReturningOperators:a,promiseReturningOperators:l}=Gg(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=kt(),f=yf(),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:g}=Xs(),{pipeline:_}=Ol(),{destroyer:d}=Ki(),m=Qn(),w=bf(),I=Mn(),A=Fo.exports=Dl().Stream;A.isDestroyed=I.isDestroyed,A.isDisturbed=I.isDisturbed,A.isErrored=I.isErrored,A.isReadable=I.isReadable,A.isWritable=I.isWritable,A.Readable=Qs();for(const P of n(a)){let y=function(...S){if(new.target)throw u();return A.Readable.from(r(v,this,S))};const v=a[P];e(y,"name",{__proto__:null,value:v.name}),e(y,"length",{__proto__:null,value:v.length}),e(A.Readable.prototype,P,{__proto__:null,value:y,enumerable:!1,configurable:!0,writable:!0})}for(const P of n(l)){let y=function(...S){if(new.target)throw u();return r(v,this,S)};const v=l[P];e(y,"name",{__proto__:null,value:v.name}),e(y,"length",{__proto__:null,value:v.length}),e(A.Readable.prototype,P,{__proto__:null,value:y,enumerable:!1,configurable:!0,writable:!0})}A.Writable=Ml(),A.Duplex=Pn(),A.Transform=mf(),A.PassThrough=_f(),A.pipeline=_;const{addAbortSignal:N}=Zs();return A.addAbortSignal=N,A.finished=m,A.destroy=d,A.compose=f,A.setDefaultHighWaterMark=h,A.getDefaultHighWaterMark=g,e(A,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return w}}),e(_,o,{__proto__:null,enumerable:!0,get(){return w.pipeline}}),e(m,o,{__proto__:null,enumerable:!0,get(){return w.finished}}),A.Stream=A,A._isUint8Array=function(v){return v instanceof Uint8Array},A._uint8ArrayToBuffer=function(v){return i.from(v.buffer,v.byteOffset,v.byteLength)},Fo.exports}var jc;function wf(){return jc||(jc=1,(function(i){const e=vf(),n=bf(),r=e.Readable.destroy;i.exports=e.Readable,i.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,i.exports._isUint8Array=e._isUint8Array,i.exports.isDisturbed=e.isDisturbed,i.exports.isErrored=e.isErrored,i.exports.isReadable=e.isReadable,i.exports.Readable=e.Readable,i.exports.Writable=e.Writable,i.exports.Duplex=e.Duplex,i.exports.Transform=e.Transform,i.exports.PassThrough=e.PassThrough,i.exports.addAbortSignal=e.addAbortSignal,i.exports.finished=e.finished,i.exports.destroy=e.destroy,i.exports.destroy=r,i.exports.pipeline=e.pipeline,i.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return n}}),i.exports.Stream=e.Stream,i.exports.default=i.exports})(Oo)),Oo.exports}var Fl=wf();const aa=Symbol("iter");function $r(i,e,n=4){if(n===0)return Object.assign(i,e);for(const r in e)i[r]=$r(i[r]||Object.create(null),e[r],n-1);return i}function xf(i,e,n=4){let r=!1;for(const o in i)if(o in e){const a=n===0?null:xf(i[o],e[o],n-1);if(a!==!1)r=r||Object.create(null),r[o]=a;else if(n===3)return!1}return r}function Ef(i,e,n=4){let r=!1;for(const o in i)if(!(o in e))r=r||Object.create(null),r[o]=n===0?null:$r({},i[o],n-1);else if(n!==0){const a=Ef(i[o],e[o],n-1);if(a!==!1)r=r||Object.create(null),r[o]=a;else if(n===3)return!1}return r}class Zg{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||Be}_termFromId(e){if(e[0]==="."){const n=this._entities,r=e.split(".");return this._factory.quad(this._termFromId(n[r[1]]),this._termFromId(n[r[2]]),this._termFromId(n[r[3]]),r[4]&&this._termFromId(n[r[4]]))}return Mr(e,this._factory)}_termToNumericId(e){if(e.termType==="Quad"){const n=this._termToNumericId(e.subject),r=this._termToNumericId(e.predicate),o=this._termToNumericId(e.object);let a;return n&&r&&o&&(vl(e.graph)||(a=this._termToNumericId(e.graph)))&&this._ids[a?`.${n}.${r}.${o}.${a}`:`.${n}.${r}.${o}`]}return this._ids[zi(e)]}_termToNewNumericId(e){const n=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${vl(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:zi(e);return this._ids[n]||(this._ids[this._entities[++this._id]=n]=this._id)}createBlankNode(e){let n,r;if(e)for(n=e=`_:${e}`,r=1;this._ids[n];)n=e+r++;else do n=`_:b${this._blankNodeIndex++}`;while(this._ids[n]);return this._ids[n]=++this._id,this._entities[this._id]=n,this._factory.blankNode(n.substr(2))}}class It{constructor(e,n){this._size=0,this._graphs=Object.create(null),!n&&e&&!e[0]&&typeof e.match!="function"&&(n=e,e=null),n=n||{},this._factory=n.factory||Be,this._entityIndex=n.entityIndex||new Zg({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),e&&this.addAll(e)}get size(){let e=this._size;if(e!==null)return e;e=0;const n=this._graphs;let r,o;for(const a in n)for(const l in r=n[a].subjects)for(const u in o=r[l])e+=Object.keys(o[u]).length;return this._size=e}_addToIndex(e,n,r,o){const a=e[n]||(e[n]={}),l=a[r]||(a[r]={}),u=o in l;return u||(l[o]=null),!u}_removeFromIndex(e,n,r,o){const a=e[n],l=a[r];delete l[o];for(const u in l)return;delete a[r];for(const u in a)return;delete e[n]}*_findInIndex(e,n,r,o,a,l,u,f){let h,g,_;const d=this._entities,m=this._termFromId(d[f]),w={subject:null,predicate:null,object:null};n&&((h=e,e={})[n]=h[n]);for(const I in e)if(g=e[I]){w[a]=this._termFromId(d[I]),r&&((h=g,g={})[r]=h[r]);for(const A in g)if(_=g[A]){w[l]=this._termFromId(d[A]);const N=o?o in _?[o]:[]:Object.keys(_);for(let P=0;P<N.length;P++)w[u]=this._termFromId(d[N[P]]),yield this._factory.quad(w.subject,w.predicate,w.object,m)}}}_loop(e,n){for(const r in e)n(r)}_loopByKey0(e,n,r){let o,a;if(o=e[n])for(a in o)r(a)}_loopByKey1(e,n,r){let o,a;for(o in e)a=e[o],a[n]&&r(o)}_loopBy2Keys(e,n,r,o){let a,l,u;if((a=e[n])&&(l=a[r]))for(u in l)o(u)}_countInIndex(e,n,r,o){let a=0,l,u,f;n&&((l=e,e={})[n]=l[n]);for(const h in e)if(u=e[h]){r&&((l=u,u={})[r]=l[r]);for(const g in u)(f=u[g])&&(o?o in f&&a++:a+=Object.keys(f).length)}return a}_getGraphs(e){return e=e===""?1:e&&(this._termToNumericId(e)||-1),typeof e!="number"?this._graphs:{[e]:this._graphs[e]}}_uniqueEntities(e){const n=Object.create(null);return r=>{r in n||(n[r]=!0,e(this._termFromId(this._entities[r],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,n,r,o){n||(o=e.graph,r=e.object,n=e.predicate,e=e.subject),o=o?this._termToNewNumericId(o):1;let a=this._graphs[o];return a||(a=this._graphs[o]={subjects:{},predicates:{},objects:{}},Object.freeze(a)),e=this._termToNewNumericId(e),n=this._termToNewNumericId(n),r=this._termToNewNumericId(r),this._addToIndex(a.subjects,e,n,r)?(this._addToIndex(a.predicates,n,r,e),this._addToIndex(a.objects,r,e,n),this._size=null,!0):!1}addQuads(e){for(let n=0;n<e.length;n++)this.addQuad(e[n])}delete(e){return this.removeQuad(e),this}has(e,n,r,o){return e&&e.subject&&({subject:e,predicate:n,object:r,graph:o}=e),!this.readQuads(e,n,r,o).next().done}import(e){return e.on("data",n=>{this.addQuad(n)}),e}removeQuad(e,n,r,o){n||({subject:e,predicate:n,object:r,graph:o}=e),o=o?this._termToNumericId(o):1;const a=this._graphs;let l,u,f;if(!(e=e&&this._termToNumericId(e))||!(n=n&&this._termToNumericId(n))||!(r=r&&this._termToNumericId(r))||!(l=a[o])||!(u=l.subjects[e])||!(f=u[n])||!(r in f))return!1;this._removeFromIndex(l.subjects,e,n,r),this._removeFromIndex(l.predicates,n,r,e),this._removeFromIndex(l.objects,r,e,n),this._size!==null&&this._size--;for(e in l.subjects)return!0;return delete a[o],!0}removeQuads(e){for(let n=0;n<e.length;n++)this.removeQuad(e[n])}remove(e){return e.on("data",n=>{this.removeQuad(n)}),e}removeMatches(e,n,r,o){const a=new Fl.Readable({objectMode:!0}),l=this.readQuads(e,n,r,o);return a._read=u=>{for(;--u>=0;){const{done:f,value:h}=l.next();if(f){a.push(null);return}a.push(h)}},this.remove(a)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,n,r,o){return[...this.readQuads(e,n,r,o)]}*readQuads(e,n,r,o){const a=this._getGraphs(o);let l,u,f,h;if(!(e&&!(u=this._termToNumericId(e))||n&&!(f=this._termToNumericId(n))||r&&!(h=this._termToNumericId(r))))for(const g in a)(l=a[g])&&(u?h?yield*this._findInIndex(l.objects,h,u,f,"object","subject","predicate",g):yield*this._findInIndex(l.subjects,u,f,null,"subject","predicate","object",g):f?yield*this._findInIndex(l.predicates,f,h,null,"predicate","object","subject",g):h?yield*this._findInIndex(l.objects,h,null,null,"object","subject","predicate",g):yield*this._findInIndex(l.subjects,null,null,null,"subject","predicate","object",g))}match(e,n,r,o){return new Un(this,e,n,r,o,{entityIndex:this._entityIndex})}countQuads(e,n,r,o){const a=this._getGraphs(o);let l=0,u,f,h,g;if(e&&!(f=this._termToNumericId(e))||n&&!(h=this._termToNumericId(n))||r&&!(g=this._termToNumericId(r)))return 0;for(const _ in a)(u=a[_])&&(e?r?l+=this._countInIndex(u.objects,g,f,h):l+=this._countInIndex(u.subjects,f,h,g):n?l+=this._countInIndex(u.predicates,h,g,f):l+=this._countInIndex(u.objects,g,f,h));return l}forEach(e,n,r,o,a){this.some(l=>(e(l,this),!1),n,r,o,a)}every(e,n,r,o,a){return!this.some(l=>!e(l,this),n,r,o,a)}some(e,n,r,o,a){for(const l of this.readQuads(n,r,o,a))if(e(l,this))return!0;return!1}getSubjects(e,n,r){const o=[];return this.forSubjects(a=>{o.push(a)},e,n,r),o}forSubjects(e,n,r,o){const a=this._getGraphs(o);let l,u,f;if(e=this._uniqueEntities(e),!(n&&!(u=this._termToNumericId(n))||r&&!(f=this._termToNumericId(r))))for(o in a)(l=a[o])&&(u?f?this._loopBy2Keys(l.predicates,u,f,e):this._loopByKey1(l.subjects,u,e):f?this._loopByKey0(l.objects,f,e):this._loop(l.subjects,e))}getPredicates(e,n,r){const o=[];return this.forPredicates(a=>{o.push(a)},e,n,r),o}forPredicates(e,n,r,o){const a=this._getGraphs(o);let l,u,f;if(e=this._uniqueEntities(e),!(n&&!(u=this._termToNumericId(n))||r&&!(f=this._termToNumericId(r))))for(o in a)(l=a[o])&&(u?f?this._loopBy2Keys(l.objects,f,u,e):this._loopByKey0(l.subjects,u,e):f?this._loopByKey1(l.predicates,f,e):this._loop(l.predicates,e))}getObjects(e,n,r){const o=[];return this.forObjects(a=>{o.push(a)},e,n,r),o}forObjects(e,n,r,o){const a=this._getGraphs(o);let l,u,f;if(e=this._uniqueEntities(e),!(n&&!(u=this._termToNumericId(n))||r&&!(f=this._termToNumericId(r))))for(o in a)(l=a[o])&&(u?f?this._loopBy2Keys(l.subjects,u,f,e):this._loopByKey1(l.objects,u,e):f?this._loopByKey0(l.predicates,f,e):this._loop(l.objects,e))}getGraphs(e,n,r){const o=[];return this.forGraphs(a=>{o.push(a)},e,n,r),o}forGraphs(e,n,r,o){for(const a in this._graphs)this.some(l=>(e(l.graph),!0),n,r,o,this._termFromId(this._entities[a]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:n=!1}={}){const r={},o=n?(()=>!0):((u,f)=>{throw new Error(`${u.value} ${f}`)}),a=this.getQuads(null,Lt.rdf.rest,Lt.rdf.nil,null),l=e?[...a]:[];return a.forEach(u=>{const f=[];let h=!1,g,_;const d=u.graph;let m=u.subject;for(;m&&!h;){const w=this.getQuads(null,null,m,null),I=this.getQuads(m,null,null,null);let A,N=null,P=null,v=null;for(let y=0;y<I.length&&!h;y++)A=I[y],A.graph.equals(d)?g?h=o(m,"has non-list arcs out"):A.predicate.value===Lt.rdf.first?N?h=o(m,"has multiple rdf:first arcs"):l.push(N=A):A.predicate.value===Lt.rdf.rest?P?h=o(m,"has multiple rdf:rest arcs"):l.push(P=A):w.length?h=o(m,"can't be subject and object"):(g=A,_="subject"):h=o(m,"not confined to single graph");for(let y=0;y<w.length&&!h;++y)A=w[y],g?h=o(m,"can't have coreferences"):A.predicate.value===Lt.rdf.rest?v?h=o(m,"has incoming rdf:rest arcs"):v=A:(g=A,_="object");N?f.unshift(N.object):h=o(m,"has no list head"),m=v&&v.subject}h?e=!1:g&&(r[g[_].value]=f)}),e&&this.removeQuads(l),r}addAll(e){if(e instanceof Un&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof It&&e._entityIndex===this._entityIndex)e._size!==0&&(this._graphs=$r(this._graphs,e._graphs),this._size=null);else for(const n of e)this.add(n);return this}contains(e){if(e instanceof Un&&(e=e.filtered),e===this)return!0;if(!(e instanceof It)||this._entityIndex!==e._entityIndex)return e.every(h=>this.has(h));const n=this._graphs,r=e._graphs;let o,a,l,u,f;for(const h in r){if(!(o=n[h]))return!1;o=o.subjects;for(const g in a=r[h].subjects){if(!(l=o[g]))return!1;for(const _ in u=a[g]){if(!(f=l[_]))return!1;for(const d in u[_])if(!(d in f))return!1}}}return!0}deleteMatches(e,n,r,o){for(const a of this.match(e,n,r,o))this.removeQuad(a);return this}difference(e){if(e&&e instanceof Un&&(e=e.filtered),e===this)return new It({entityIndex:this._entityIndex});if(e instanceof It&&e._entityIndex===this._entityIndex){const n=new It({entityIndex:this._entityIndex}),r=Ef(this._graphs,e._graphs);return r&&(n._graphs=r,n._size=null),n}return this.filter(n=>!e.has(n))}equals(e){return e instanceof Un&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const n=new It({entityIndex:this._entityIndex});for(const r of this)e(r,this)&&n.add(r);return n}intersection(e){if(e instanceof Un&&(e=e.filtered),e===this){const n=new It({entityIndex:this._entityIndex});return n._graphs=$r(Object.create(null),this._graphs),n._size=this._size,n}else if(e instanceof It&&this._entityIndex===e._entityIndex){const n=new It({entityIndex:this._entityIndex}),r=xf(e._graphs,this._graphs);return r&&(n._graphs=r,n._size=null),n}return this.filter(n=>e.has(n))}map(e){const n=new It({entityIndex:this._entityIndex});for(const r of this)n.add(e(r,this));return n}reduce(e,n){const r=this.readQuads();let o=n===void 0?r.next().value:n;for(const a of r)o=e(o,a,this);return o}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return new kl().quadsToString(this)}union(e){const n=new It({entityIndex:this._entityIndex});return n._graphs=$r(Object.create(null),this._graphs),n._size=this._size,n.addAll(e),n}*[Symbol.iterator](){yield*this.readQuads()}}function yn(i,e,n=0){const r=e[n];if(r&&!(r in i))return!1;let o=!1;for(const a in r?{[r]:i[r]}:i){const l=n===2?null:yn(i[a],e,n+1);l!==!1&&(o=o||Object.create(null),o[a]=l)}return o}class Un extends Fl.Readable{constructor(e,n,r,o,a,l){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:n,predicate:r,object:o,graph:a,options:l})}get filtered(){if(!this._filtered){const{n3Store:e,graph:n,object:r,predicate:o,subject:a}=this,l=this._filtered=new It({factory:e._factory,entityIndex:this.options.entityIndex});let u,f,h;if(a&&!(u=l._termToNumericId(a))||o&&!(f=l._termToNumericId(o))||r&&!(h=l._termToNumericId(r)))return l;const g=e._getGraphs(n);for(const _ in g){let d,m,w,I;(I=g[_])&&(!u&&f?(m=yn(I.predicates,[f,h,u]))&&(d=yn(I.subjects,[u,f,h]),w=yn(I.objects,[h,u,f])):h?(w=yn(I.objects,[h,u,f]))&&(d=yn(I.subjects,[u,f,h]),m=yn(I.predicates,[f,h,u])):(d=yn(I.subjects,[u,f,h]))&&(m=yn(I.predicates,[f,h,u]),w=yn(I.objects,[h,u,f])),d&&(l._graphs[_]={subjects:d,predicates:m,objects:w}))}l._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[aa]&&(this[aa]=this[Symbol.iterator]());const n=this[aa];for(;--e>=0;){const{done:r,value:o}=n.next();if(r){this.push(null);return}this.push(o)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,n,r,o){return this.filtered.deleteMatches(e,n,r,o)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,n,r,o,a){return this.filtered.every(e,n,r,o,a)}filter(e){return this.filtered.filter(e)}forEach(e,n,r,o,a){return this.filtered.forEach(e,n,r,o,a)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,n,r,o,a){return this.filtered.some(e,n,r,o,a)}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,n){return this.filtered.reduce(e,n)}toString(){return new kl().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,n,r,o){return new Un(this.filtered,e,n,r,o,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}class Xg extends Fl.Transform{constructor(e){super({decodeStrings:!0}),this._readableState.objectMode=!0;const n=new hf(e);let r,o;const a={onQuad:(l,u)=>{l&&this.emit("error",l)||u&&this.push(u)},onPrefix:(l,u)=>{this.emit("prefix",l,u)}};e&&e.comments&&(a.onComment=l=>{this.emit("comment",l)}),n.parse({on:(l,u)=>{switch(l){case"data":r=u;break;case"end":o=u;break}}},a),this._transform=(l,u,f)=>{r(l),f()},this._flush=l=>{o(),l()}}import(e){return e.on("data",n=>{this.write(n)}),e.on("end",()=>{this.end()}),e.on("error",n=>{this.emit("error",n)}),this}}const Fe="http://www.w3.org/ns/shacl#",Bc="http://datashapes.org/dash#",Cn="http://www.w3.org/2001/XMLSchema#",yi="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Js="http://www.w3.org/2000/01/rdf-schema#",jl="http://www.w3.org/2004/02/skos/core#",Qg="http://www.w3.org/2002/07/owl#",Jg="http://www.w3.org/ns/oa#",Bl="http://purl.org/dc/terms/",Kg="http://xmlns.com/foaf/0.1/",an=Be.namedNode("loaded-shapes"),Ft=Be.namedNode("loaded-data"),Rt=Be.namedNode(yi+"type"),Sf=Be.namedNode(yi+"langString"),Fs=Be.namedNode(Bl+"conformsTo"),$c=Be.namedNode(Js+"subClassOf"),$l=Be.namedNode(Qg+"imports"),Yg=Be.namedNode(jl+"broader"),em=Be.namedNode(jl+"narrower"),la=Be.namedNode(Fe+"NodeShape"),Tf=Be.namedNode(Fe+"IRI"),wl=Be.namedNode(Fe+"property"),ql=Be.namedNode(Fe+"class"),tm=Be.namedNode(Fe+"node"),Ks=Be.namedNode(Fe+"targetClass"),nm=Be.namedNode(Fe+"nodeKind"),im=Be.namedNode(Cn+"string"),rm=Be.namedNode(Cn+"boolean");function Hi(i,e,n=Fe,r){let o="";const a=sm(i,e,n,r);return a&&(o=a.value),o}function sm(i,e,n=Fe,r){let o;const a=n+e;if(r?.length){for(const l of r)for(const u of i)if(u.predicate.value===a){if(u.object.id.endsWith(`@${l}`))return u.object;u.object.id.indexOf("@")<0?o=u.object:o||(o=u.object)}}else for(const l of i)if(l.predicate.value===a)return l.object;return o}function om(i){i.querySelector(".editor")?.focus()}function Zn(i,e){return Hi(i,"prefLabel",jl,e)||Hi(i,"label",Js,e)||Hi(i,"title",Bl,e)||Hi(i,"name",Kg,e)}function Lf(i,e,n){const r=[];for(const o of i)r.push({value:o,label:Zn(e.getQuads(o,null,null,null),n),children:[]});return r}function xl(i,e){for(const n in e){const r=e[n];i.startsWith(r)&&(i=i.slice(r.length))}return i}function If(i,e,n,r,o=new Set){for(const a of e.owlImports)o.has(a.id)||(o.add(a.id),r.push(...n.getSubjects(Rt,i,a)));e.parent&&If(i,e.parent,n,r,o)}function Af(i,e){if(e.in){const n=e.config.lists[e.in];return Lf(n?.length?n:[],e.config.store,e.config.languages)}else{const n=e.config.store.getSubjects(Rt,i,an);n.push(...e.config.store.getSubjects(Rt,i,Ft)),If(i,e,e.config.store,n);const r=new Map,o=new Map;for(const l of n)r.set(l.id,{value:l,label:Zn(e.config.store.getQuads(l,null,null,null),e.config.languages),children:[]});for(const l of n){for(const u of e.config.store.getObjects(l,Yg,null))r.has(u.id)&&o.set(l.id,u.id);for(const u of e.config.store.getObjects(l,em,null))r.has(u.id)&&o.set(u.id,l.id);for(const u of e.config.store.getObjects(l,$c,null))r.has(u.id)&&o.set(l.id,u.id)}for(const[l,u]of o.entries())r.get(u)?.children?.push(r.get(l));const a=[];for(const[l,u]of r.entries())o.has(l)||a.push(u);for(const l of e.config.store.getSubjects($c,i,null))a.push(...Af(l,e));return a}}function El(i){let e;try{e=new URL(i)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function js(i,e,n){if(e===void 0)return n;if(n===void 0)return e;const r=i.indexOf(e.language);if(r<0)return n;const o=i.indexOf(n.language);return o<0||o>r?e:n}function am(i){const e=new Set;for(const n of i.getObjects(null,ql,an))e.add(n.value);for(const n of i.getObjects(null,Ks,an))e.add(n.value);return e}function lm(i,e){return i instanceof Set?[...e].filter(n=>!i.has(n)):[...e].filter(n=>!i.includes(n))}function um(i,{remove:e=!1,ignoreErrors:n=!1}={}){const r={},o=n?(()=>!0):((u,f)=>{throw new Error(`${u.value} ${f}`)}),a=i.getQuads(null,yi+"rest",yi+"nil",null),l=e?[...a]:[];return a.forEach(u=>{const f=[];let h=!1,g,_;const d=u.graph;let m=u.subject;for(;m&&!h;){const w=i.getQuads(null,null,m,null),I=i.getQuads(m,null,null,null).filter(y=>!y.predicate.equals(Rt));let A,N=null,P=null,v=null;for(let y=0;y<I.length&&!h;y++)A=I[y],A.graph.equals(d)?g?h=o(m,"has non-list arcs out"):A.predicate.value===yi+"first"?N?h=o(m,"has multiple rdf:first arcs"):l.push(N=A):A.predicate.value===yi+"rest"?P?h=o(m,"has multiple rdf:rest arcs"):l.push(P=A):w.length?h=o(m,"can't be subject and object"):(g=A,_="subject"):h=o(m,"not confined to single graph");for(let y=0;y<w.length&&!h;++y)A=w[y],g?h=o(m,"can't have coreferences"):A.predicate.value===yi+"rest"?v?h=o(m,"has incoming rdf:rest arcs"):v=A:(g=A,_="object");N?f.unshift(N.object):h=o(m,"has no list head"),m=v&&v.subject}h?e=!1:g&&(r[g[_].value]=f)}),e&&i.removeQuads(l),r}var li={},ui={},ci={},An={},qc;function cm(){if(qc)return An;qc=1,Object.defineProperty(An,"__esModule",{value:!0}),An.removeDotSegmentsOfPath=An.removeDotSegments=An.resolve=void 0;function i(o,a){a=a||"";const l=a.indexOf("#");if(l>0&&(a=a.substr(0,l)),!o.length){if(a.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${a}' for value '${o}'`);return a}if(o.startsWith("?")){const m=a.indexOf("?");return m>0&&(a=a.substr(0,m)),a+o}if(o.startsWith("#"))return a+o;if(!a.length){const m=o.indexOf(":");if(m<0)throw new Error(`Found invalid relative IRI '${o}' for a missing baseIRI`);return n(o,m)}const u=o.indexOf(":");if(u>=0)return n(o,u);const f=a.indexOf(":");if(f<0)throw new Error(`Found invalid baseIRI '${a}' for value '${o}'`);const h=a.substr(0,f+1);if(o.indexOf("//")===0)return h+n(o,u);let g;if(a.indexOf("//",f)===f+1){if(g=a.indexOf("/",f+3),g<0)return a.length>f+3?a+"/"+n(o,u):h+n(o,u)}else if(g=a.indexOf("/",f+1),g<0)return h+n(o,u);if(o.indexOf("/")===0)return a.substr(0,g)+e(o);let _=a.substr(g);const d=_.lastIndexOf("/");return d>=0&&d<_.length-1&&(_=_.substr(0,d+1),o[0]==="."&&o[1]!=="."&&o[1]!=="/"&&o[2]&&(o=o.substr(1))),o=_+o,o=e(o),a.substr(0,g)+o}An.resolve=i;function e(o){const a=[];let l=0;for(;l<o.length;)switch(o[l]){case"/":if(o[l+1]===".")if(o[l+2]==="."){if(!r(o[l+3])){a.push([]),l++;break}a.pop(),o[l+3]||a.push([]),l+=3}else{if(!r(o[l+2])){a.push([]),l++;break}o[l+2]||a.push([]),l+=2}else a.push([]),l++;break;case"#":case"?":a.length||a.push([]),a[a.length-1].push(o.substr(l)),l=o.length;break;default:a.length||a.push([]),a[a.length-1].push(o[l]),l++;break}return"/"+a.map(u=>u.join("")).join("/")}An.removeDotSegments=e;function n(o,a){let l=a+1;a>=0?o[a+1]==="/"&&o[a+2]==="/"&&(l=a+3):o[0]==="/"&&o[1]==="/"&&(l=2);const u=o.indexOf("/",l);if(u<0)return o;const f=o.substr(0,u),h=o.substr(u);return f+e(h)}An.removeDotSegmentsOfPath=n;function r(o){return!o||o==="#"||o==="?"||o==="/"}return An}var zc;function dm(){return zc||(zc=1,(function(i){var e=ci&&ci.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a),Object.defineProperty(r,l,{enumerable:!0,get:function(){return o[a]}})}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),n=ci&&ci.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(i,"__esModule",{value:!0}),n(cm(),i)})(ci)),ci}var di={},ua={},Hc;function hm(){return Hc||(Hc=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.CHAR=`
|
|
21
|
+
`),this._subject=null),this._write=this._blockedWrite;let n=e&&((r,o)=>{n=null,e(r,o)});if(this._endStream)try{return this._outputStream.end(n)}catch{}n&&n()}}function lc(i){let e=Hg[i];return e===void 0&&(i.length===1?(e=i.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}var Fo={exports:{}},jo={exports:{}},Bo,uc;function ct(){if(uc)return Bo;uc=1;class i extends Error{constructor(n){if(!Array.isArray(n))throw new TypeError(`Expected input to be an Array, got ${typeof n}`);let r="";for(let o=0;o<n.length;o++)r+=` ${n[o].stack}
|
|
22
|
+
`;super(r),this.name="AggregateError",this.errors=n}}return Bo={AggregateError:i,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,n){return e.includes(n)},ArrayPrototypeIndexOf(e,n){return e.indexOf(n)},ArrayPrototypeJoin(e,n){return e.join(n)},ArrayPrototypeMap(e,n){return e.map(n)},ArrayPrototypePop(e,n){return e.pop(n)},ArrayPrototypePush(e,n){return e.push(n)},ArrayPrototypeSlice(e,n,r){return e.slice(n,r)},Error,FunctionPrototypeCall(e,n,...r){return e.call(n,...r)},FunctionPrototypeSymbolHasInstance(e,n){return Function.prototype[Symbol.hasInstance].call(e,n)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,n){return Object.defineProperties(e,n)},ObjectDefineProperty(e,n,r){return Object.defineProperty(e,n,r)},ObjectGetOwnPropertyDescriptor(e,n){return Object.getOwnPropertyDescriptor(e,n)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,n){return Object.setPrototypeOf(e,n)},Promise,PromisePrototypeCatch(e,n){return e.catch(n)},PromisePrototypeThen(e,n,r){return e.then(n,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,n){return e.test(n)},SafeSet:Set,String,StringPrototypeSlice(e,n,r){return e.slice(n,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,n,r){return e.set(n,r)},Boolean,Uint8Array},Bo}var $o={exports:{}},qo,cc;function pf(){return cc||(cc=1,qo={format(i,...e){return i.replace(/%([sdifj])/g,function(...[n,r]){const o=e.shift();return r==="f"?o.toFixed(6):r==="j"?JSON.stringify(o):r==="s"&&typeof o=="object"?`${o.constructor!==Object?o.constructor.name:""} {}`.trim():o.toString()})},inspect(i){switch(typeof i){case"string":if(i.includes("'"))if(i.includes('"')){if(!i.includes("`")&&!i.includes("${"))return`\`${i}\``}else return`"${i}"`;return`'${i}'`;case"number":return isNaN(i)?"NaN":Object.is(i,-0)?String(i):i;case"bigint":return`${String(i)}n`;case"boolean":case"undefined":return String(i);case"object":return"{}"}}}),qo}var zo,dc;function Dt(){if(dc)return zo;dc=1;const{format:i,inspect:e}=pf(),{AggregateError:n}=ct(),r=globalThis.AggregateError||n,o=Symbol("kIsNodeError"),a=["string","function","number","object","Function","Object","boolean","bigint","symbol"],l=/^([A-Z][a-z0-9]*)+$/,u="__node_internal_",f={};function h(A,N){if(!A)throw new f.ERR_INTERNAL_ASSERTION(N)}function g(A){let N="",P=A.length;const w=A[0]==="-"?1:0;for(;P>=w+4;P-=3)N=`_${A.slice(P-3,P)}${N}`;return`${A.slice(0,P)}${N}`}function m(A,N,P){if(typeof N=="function")return h(N.length<=P.length,`Code: ${A}; The provided arguments length (${P.length}) does not match the required ones (${N.length}).`),N(...P);const w=(N.match(/%[dfijoOs]/g)||[]).length;return h(w===P.length,`Code: ${A}; The provided arguments length (${P.length}) does not match the required ones (${w}).`),P.length===0?N:i(N,...P)}function d(A,N,P){P||(P=Error);class w extends P{constructor(...S){super(m(A,N,S))}toString(){return`${this.name} [${A}]: ${this.message}`}}Object.defineProperties(w.prototype,{name:{value:P.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${A}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),w.prototype.code=A,w.prototype[o]=!0,f[A]=w}function _(A){const N=u+A.name;return Object.defineProperty(A,"name",{value:N}),A}function v(A,N){if(A&&N&&A!==N){if(Array.isArray(N.errors))return N.errors.push(A),N;const P=new r([N,A],N.message);return P.code=N.code,P}return A||N}class I extends Error{constructor(N="The operation was aborted",P=void 0){if(P!==void 0&&typeof P!="object")throw new f.ERR_INVALID_ARG_TYPE("options","Object",P);super(N,P),this.code="ABORT_ERR",this.name="AbortError"}}return d("ERR_ASSERTION","%s",Error),d("ERR_INVALID_ARG_TYPE",(A,N,P)=>{h(typeof A=="string","'name' must be a string"),Array.isArray(N)||(N=[N]);let w="The ";A.endsWith(" argument")?w+=`${A} `:w+=`"${A}" ${A.includes(".")?"property":"argument"} `,w+="must be ";const y=[],S=[],O=[];for(const C of N)h(typeof C=="string","All expected entries have to be of type string"),a.includes(C)?y.push(C.toLowerCase()):l.test(C)?S.push(C):(h(C!=="object",'The value "object" should be written as "Object"'),O.push(C));if(S.length>0){const C=y.indexOf("object");C!==-1&&(y.splice(y,C,1),S.push("Object"))}if(y.length>0){switch(y.length){case 1:w+=`of type ${y[0]}`;break;case 2:w+=`one of type ${y[0]} or ${y[1]}`;break;default:{const C=y.pop();w+=`one of type ${y.join(", ")}, or ${C}`}}(S.length>0||O.length>0)&&(w+=" or ")}if(S.length>0){switch(S.length){case 1:w+=`an instance of ${S[0]}`;break;case 2:w+=`an instance of ${S[0]} or ${S[1]}`;break;default:{const C=S.pop();w+=`an instance of ${S.join(", ")}, or ${C}`}}O.length>0&&(w+=" or ")}switch(O.length){case 0:break;case 1:O[0].toLowerCase()!==O[0]&&(w+="an "),w+=`${O[0]}`;break;case 2:w+=`one of ${O[0]} or ${O[1]}`;break;default:{const C=O.pop();w+=`one of ${O.join(", ")}, or ${C}`}}if(P==null)w+=`. Received ${P}`;else if(typeof P=="function"&&P.name)w+=`. Received function ${P.name}`;else if(typeof P=="object"){var X;if((X=P.constructor)!==null&&X!==void 0&&X.name)w+=`. Received an instance of ${P.constructor.name}`;else{const C=e(P,{depth:-1});w+=`. Received ${C}`}}else{let C=e(P,{colors:!1});C.length>25&&(C=`${C.slice(0,25)}...`),w+=`. Received type ${typeof P} (${C})`}return w},TypeError),d("ERR_INVALID_ARG_VALUE",(A,N,P="is invalid")=>{let w=e(N);return w.length>128&&(w=w.slice(0,128)+"..."),`The ${A.includes(".")?"property":"argument"} '${A}' ${P}. Received ${w}`},TypeError),d("ERR_INVALID_RETURN_VALUE",(A,N,P)=>{var w;const y=P!=null&&(w=P.constructor)!==null&&w!==void 0&&w.name?`instance of ${P.constructor.name}`:`type ${typeof P}`;return`Expected ${A} to be returned from the "${N}" function but got ${y}.`},TypeError),d("ERR_MISSING_ARGS",(...A)=>{h(A.length>0,"At least one arg needs to be specified");let N;const P=A.length;switch(A=(Array.isArray(A)?A:[A]).map(w=>`"${w}"`).join(" or "),P){case 1:N+=`The ${A[0]} argument`;break;case 2:N+=`The ${A[0]} and ${A[1]} arguments`;break;default:{const w=A.pop();N+=`The ${A.join(", ")}, and ${w} arguments`}break}return`${N} must be specified`},TypeError),d("ERR_OUT_OF_RANGE",(A,N,P)=>{h(N,'Missing "range" argument');let w;if(Number.isInteger(P)&&Math.abs(P)>2**32)w=g(String(P));else if(typeof P=="bigint"){w=String(P);const y=BigInt(2)**BigInt(32);(P>y||P<-y)&&(w=g(w)),w+="n"}else w=e(P);return`The value of "${A}" is out of range. It must be ${N}. Received ${w}`},RangeError),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),d("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),d("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),d("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),d("ERR_STREAM_WRITE_AFTER_END","write after end",Error),d("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),zo={AbortError:I,aggregateTwoErrors:_(v),hideStackFrames:_,codes:f},zo}var yr={exports:{}},hc;function Hr(){if(hc)return yr.exports;hc=1;const{AbortController:i,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return yr.exports=i,yr.exports.AbortSignal=e,yr.exports.default=i,yr.exports}var ws={exports:{}},fc;function Zs(){if(fc)return ws.exports;fc=1;var i=typeof Reflect=="object"?Reflect:null,e=i&&typeof i.apply=="function"?i.apply:function(S,O,X){return Function.prototype.apply.call(S,O,X)},n;i&&typeof i.ownKeys=="function"?n=i.ownKeys:Object.getOwnPropertySymbols?n=function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:n=function(S){return Object.getOwnPropertyNames(S)};function r(y){console&&console.warn&&console.warn(y)}var o=Number.isNaN||function(S){return S!==S};function a(){a.init.call(this)}ws.exports=a,ws.exports.once=N,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var l=10;function u(y){if(typeof y!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof y)}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(y){if(typeof y!="number"||y<0||o(y))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+y+".");l=y}}),a.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||o(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this};function f(y){return y._maxListeners===void 0?a.defaultMaxListeners:y._maxListeners}a.prototype.getMaxListeners=function(){return f(this)},a.prototype.emit=function(S){for(var O=[],X=1;X<arguments.length;X++)O.push(arguments[X]);var C=S==="error",U=this._events;if(U!==void 0)C=C&&U.error===void 0;else if(!C)return!1;if(C){var R;if(O.length>0&&(R=O[0]),R instanceof Error)throw R;var $=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw $.context=R,$}var G=U[S];if(G===void 0)return!1;if(typeof G=="function")e(G,this,O);else for(var j=G.length,F=v(G,j),X=0;X<j;++X)e(F[X],this,O);return!0};function h(y,S,O,X){var C,U,R;if(u(O),U=y._events,U===void 0?(U=y._events=Object.create(null),y._eventsCount=0):(U.newListener!==void 0&&(y.emit("newListener",S,O.listener?O.listener:O),U=y._events),R=U[S]),R===void 0)R=U[S]=O,++y._eventsCount;else if(typeof R=="function"?R=U[S]=X?[O,R]:[R,O]:X?R.unshift(O):R.push(O),C=f(y),C>0&&R.length>C&&!R.warned){R.warned=!0;var $=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");$.name="MaxListenersExceededWarning",$.emitter=y,$.type=S,$.count=R.length,r($)}return y}a.prototype.addListener=function(S,O){return h(this,S,O,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(S,O){return h(this,S,O,!0)};function g(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(y,S,O){var X={fired:!1,wrapFn:void 0,target:y,type:S,listener:O},C=g.bind(X);return C.listener=O,X.wrapFn=C,C}a.prototype.once=function(S,O){return u(O),this.on(S,m(this,S,O)),this},a.prototype.prependOnceListener=function(S,O){return u(O),this.prependListener(S,m(this,S,O)),this},a.prototype.removeListener=function(S,O){var X,C,U,R,$;if(u(O),C=this._events,C===void 0)return this;if(X=C[S],X===void 0)return this;if(X===O||X.listener===O)--this._eventsCount===0?this._events=Object.create(null):(delete C[S],C.removeListener&&this.emit("removeListener",S,X.listener||O));else if(typeof X!="function"){for(U=-1,R=X.length-1;R>=0;R--)if(X[R]===O||X[R].listener===O){$=X[R].listener,U=R;break}if(U<0)return this;U===0?X.shift():I(X,U),X.length===1&&(C[S]=X[0]),C.removeListener!==void 0&&this.emit("removeListener",S,$||O)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(S){var O,X,C;if(X=this._events,X===void 0)return this;if(X.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):X[S]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete X[S]),this;if(arguments.length===0){var U=Object.keys(X),R;for(C=0;C<U.length;++C)R=U[C],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(O=X[S],typeof O=="function")this.removeListener(S,O);else if(O!==void 0)for(C=O.length-1;C>=0;C--)this.removeListener(S,O[C]);return this};function d(y,S,O){var X=y._events;if(X===void 0)return[];var C=X[S];return C===void 0?[]:typeof C=="function"?O?[C.listener||C]:[C]:O?A(C):v(C,C.length)}a.prototype.listeners=function(S){return d(this,S,!0)},a.prototype.rawListeners=function(S){return d(this,S,!1)},a.listenerCount=function(y,S){return typeof y.listenerCount=="function"?y.listenerCount(S):_.call(y,S)},a.prototype.listenerCount=_;function _(y){var S=this._events;if(S!==void 0){var O=S[y];if(typeof O=="function")return 1;if(O!==void 0)return O.length}return 0}a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function v(y,S){for(var O=new Array(S),X=0;X<S;++X)O[X]=y[X];return O}function I(y,S){for(;S+1<y.length;S++)y[S]=y[S+1];y.pop()}function A(y){for(var S=new Array(y.length),O=0;O<S.length;++O)S[O]=y[O].listener||y[O];return S}function N(y,S){return new Promise(function(O,X){function C(R){y.removeListener(S,U),X(R)}function U(){typeof y.removeListener=="function"&&y.removeListener("error",C),O([].slice.call(arguments))}w(y,S,U,{once:!0}),S!=="error"&&P(y,C,{once:!0})})}function P(y,S,O){typeof y.on=="function"&&w(y,"error",S,O)}function w(y,S,O,X){if(typeof y.on=="function")X.once?y.once(S,O):y.on(S,O);else if(typeof y.addEventListener=="function")y.addEventListener(S,function C(U){X.once&&y.removeEventListener(S,C),O(U)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof y)}return ws.exports}var pc;function jt(){return pc||(pc=1,(function(i){const e=Dn(),{format:n,inspect:r}=pf(),{codes:{ERR_INVALID_ARG_TYPE:o}}=Dt(),{kResistStopPropagation:a,AggregateError:l,SymbolDispose:u}=ct(),f=globalThis.AbortSignal||Hr().AbortSignal,h=globalThis.AbortController||Hr().AbortController,g=Object.getPrototypeOf(async function(){}).constructor,m=globalThis.Blob||e.Blob,d=typeof m<"u"?function(A){return A instanceof m}:function(A){return!1},_=(I,A)=>{if(I!==void 0&&(I===null||typeof I!="object"||!("aborted"in I)))throw new o(A,"AbortSignal",I)},v=(I,A)=>{if(typeof I!="function")throw new o(A,"Function",I)};i.exports={AggregateError:l,kEmptyObject:Object.freeze({}),once(I){let A=!1;return function(...N){A||(A=!0,I.apply(this,N))}},createDeferredPromise:function(){let I,A;return{promise:new Promise((P,w)=>{I=P,A=w}),resolve:I,reject:A}},promisify(I){return new Promise((A,N)=>{I((P,...w)=>P?N(P):A(...w))})},debuglog(){return function(){}},format:n,inspect:r,types:{isAsyncFunction(I){return I instanceof g},isArrayBufferView(I){return ArrayBuffer.isView(I)}},isBlob:d,deprecate(I,A){return I},addAbortListener:Zs().addAbortListener||function(A,N){if(A===void 0)throw new o("signal","AbortSignal",A);_(A,"signal"),v(N,"listener");let P;return A.aborted?queueMicrotask(()=>N()):(A.addEventListener("abort",N,{__proto__:null,once:!0,[a]:!0}),P=()=>{A.removeEventListener("abort",N)}),{__proto__:null,[u](){var w;(w=P)===null||w===void 0||w()}}},AbortSignalAny:f.any||function(A){if(A.length===1)return A[0];const N=new h,P=()=>N.abort();return A.forEach(w=>{_(w,"signals"),w.addEventListener("abort",P,{once:!0})}),N.signal.addEventListener("abort",()=>{A.forEach(w=>w.removeEventListener("abort",P))},{once:!0}),N.signal}},i.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})($o)),$o.exports}var xs={},Ho,gc;function Xr(){if(gc)return Ho;gc=1;const{ArrayIsArray:i,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:n,ArrayPrototypeMap:r,NumberIsInteger:o,NumberIsNaN:a,NumberMAX_SAFE_INTEGER:l,NumberMIN_SAFE_INTEGER:u,NumberParseInt:f,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:g,String:m,StringPrototypeToUpperCase:d,StringPrototypeTrim:_}=ct(),{hideStackFrames:v,codes:{ERR_SOCKET_BAD_PORT:I,ERR_INVALID_ARG_TYPE:A,ERR_INVALID_ARG_VALUE:N,ERR_OUT_OF_RANGE:P,ERR_UNKNOWN_SIGNAL:w}}=Dt(),{normalizeEncoding:y}=jt(),{isAsyncFunction:S,isArrayBufferView:O}=jt().types,X={};function C(le){return le===(le|0)}function U(le){return le===le>>>0}const R=/^[0-7]+$/,$="must be a 32-bit unsigned integer or an octal string";function G(le,ve,Ae){if(typeof le>"u"&&(le=Ae),typeof le=="string"){if(g(R,le)===null)throw new N(ve,le,$);le=f(le,8)}return se(le,ve),le}const j=v((le,ve,Ae=u,be=l)=>{if(typeof le!="number")throw new A(ve,"number",le);if(!o(le))throw new P(ve,"an integer",le);if(le<Ae||le>be)throw new P(ve,`>= ${Ae} && <= ${be}`,le)}),F=v((le,ve,Ae=-2147483648,be=2147483647)=>{if(typeof le!="number")throw new A(ve,"number",le);if(!o(le))throw new P(ve,"an integer",le);if(le<Ae||le>be)throw new P(ve,`>= ${Ae} && <= ${be}`,le)}),se=v((le,ve,Ae=!1)=>{if(typeof le!="number")throw new A(ve,"number",le);if(!o(le))throw new P(ve,"an integer",le);const be=Ae?1:0,qe=4294967295;if(le<be||le>qe)throw new P(ve,`>= ${be} && <= ${qe}`,le)});function M(le,ve){if(typeof le!="string")throw new A(ve,"string",le)}function re(le,ve,Ae=void 0,be){if(typeof le!="number")throw new A(ve,"number",le);if(Ae!=null&&le<Ae||be!=null&&le>be||(Ae!=null||be!=null)&&a(le))throw new P(ve,`${Ae!=null?`>= ${Ae}`:""}${Ae!=null&&be!=null?" && ":""}${be!=null?`<= ${be}`:""}`,le)}const B=v((le,ve,Ae)=>{if(!e(Ae,le)){const qe="must be one of: "+n(r(Ae,mt=>typeof mt=="string"?`'${mt}'`:m(mt)),", ");throw new N(ve,le,qe)}});function oe(le,ve){if(typeof le!="boolean")throw new A(ve,"boolean",le)}function T(le,ve,Ae){return le==null||!h(le,ve)?Ae:le[ve]}const Q=v((le,ve,Ae=null)=>{const be=T(Ae,"allowArray",!1),qe=T(Ae,"allowFunction",!1);if(!T(Ae,"nullable",!1)&&le===null||!be&&i(le)||typeof le!="object"&&(!qe||typeof le!="function"))throw new A(ve,"Object",le)}),ie=v((le,ve)=>{if(le!=null&&typeof le!="object"&&typeof le!="function")throw new A(ve,"a dictionary",le)}),Y=v((le,ve,Ae=0)=>{if(!i(le))throw new A(ve,"Array",le);if(le.length<Ae){const be=`must be longer than ${Ae}`;throw new N(ve,le,be)}});function me(le,ve){Y(le,ve);for(let Ae=0;Ae<le.length;Ae++)M(le[Ae],`${ve}[${Ae}]`)}function Z(le,ve){Y(le,ve);for(let Ae=0;Ae<le.length;Ae++)oe(le[Ae],`${ve}[${Ae}]`)}function W(le,ve){Y(le,ve);for(let Ae=0;Ae<le.length;Ae++){const be=le[Ae],qe=`${ve}[${Ae}]`;if(be==null)throw new A(qe,"AbortSignal",be);Ee(be,qe)}}function ee(le,ve="signal"){if(M(le,ve),X[le]===void 0)throw X[d(le)]!==void 0?new w(le+" (signals must use all capital letters)"):new w(le)}const K=v((le,ve="buffer")=>{if(!O(le))throw new A(ve,["Buffer","TypedArray","DataView"],le)});function ue(le,ve){const Ae=y(ve),be=le.length;if(Ae==="hex"&&be%2!==0)throw new N("encoding",ve,`is invalid for data of length ${be}`)}function ce(le,ve="Port",Ae=!0){if(typeof le!="number"&&typeof le!="string"||typeof le=="string"&&_(le).length===0||+le!==+le>>>0||le>65535||le===0&&!Ae)throw new I(ve,le,Ae);return le|0}const Ee=v((le,ve)=>{if(le!==void 0&&(le===null||typeof le!="object"||!("aborted"in le)))throw new A(ve,"AbortSignal",le)}),Te=v((le,ve)=>{if(typeof le!="function")throw new A(ve,"Function",le)}),q=v((le,ve)=>{if(typeof le!="function"||S(le))throw new A(ve,"Function",le)}),te=v((le,ve)=>{if(le!==void 0)throw new A(ve,"undefined",le)});function fe(le,ve,Ae){if(!e(Ae,le))throw new A(ve,`('${n(Ae,"|")}')`,le)}const xe=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Se(le,ve){if(typeof le>"u"||!g(xe,le))throw new N(ve,le,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Ie(le){if(typeof le=="string")return Se(le,"hints"),le;if(i(le)){const ve=le.length;let Ae="";if(ve===0)return Ae;for(let be=0;be<ve;be++){const qe=le[be];Se(qe,"hints"),Ae+=qe,be!==ve-1&&(Ae+=", ")}return Ae}throw new N("hints",le,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return Ho={isInt32:C,isUint32:U,parseFileMode:G,validateArray:Y,validateStringArray:me,validateBooleanArray:Z,validateAbortSignalArray:W,validateBoolean:oe,validateBuffer:K,validateDictionary:ie,validateEncoding:ue,validateFunction:Te,validateInt32:F,validateInteger:j,validateNumber:re,validateObject:Q,validateOneOf:B,validatePlainFunction:q,validatePort:ce,validateSignalName:ee,validateString:M,validateUint32:se,validateUndefined:te,validateUnion:fe,validateAbortSignal:Ee,validateLinkHeaderValue:Ie},Ho}var Es={exports:{}},Uo={exports:{}},mc;function Ti(){if(mc)return Uo.exports;mc=1;var i=Uo.exports={},e,n;function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=r}catch{e=r}try{typeof clearTimeout=="function"?n=clearTimeout:n=o}catch{n=o}})();function a(I){if(e===setTimeout)return setTimeout(I,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(I,0);try{return e(I,0)}catch{try{return e.call(null,I,0)}catch{return e.call(this,I,0)}}}function l(I){if(n===clearTimeout)return clearTimeout(I);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(I);try{return n(I)}catch{try{return n.call(null,I)}catch{return n.call(this,I)}}}var u=[],f=!1,h,g=-1;function m(){!f||!h||(f=!1,h.length?u=h.concat(u):g=-1,u.length&&d())}function d(){if(!f){var I=a(m);f=!0;for(var A=u.length;A;){for(h=u,u=[];++g<A;)h&&h[g].run();g=-1,A=u.length}h=null,f=!1,l(I)}}i.nextTick=function(I){var A=new Array(arguments.length-1);if(arguments.length>1)for(var N=1;N<arguments.length;N++)A[N-1]=arguments[N];u.push(new _(I,A)),u.length===1&&!f&&a(d)};function _(I,A){this.fun=I,this.array=A}_.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={};function v(){}return i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(I){return[]},i.binding=function(I){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(I){throw new Error("process.chdir is not supported")},i.umask=function(){return 0},Uo.exports}var Vo,_c;function Mn(){if(_c)return Vo;_c=1;const{SymbolAsyncIterator:i,SymbolIterator:e,SymbolFor:n}=ct(),r=n("nodejs.stream.destroyed"),o=n("nodejs.stream.errored"),a=n("nodejs.stream.readable"),l=n("nodejs.stream.writable"),u=n("nodejs.stream.disturbed"),f=n("nodejs.webstream.isClosedPromise"),h=n("nodejs.webstream.controllerErrorFunction");function g(T,Q=!1){var ie;return!!(T&&typeof T.pipe=="function"&&typeof T.on=="function"&&(!Q||typeof T.pause=="function"&&typeof T.resume=="function")&&(!T._writableState||((ie=T._readableState)===null||ie===void 0?void 0:ie.readable)!==!1)&&(!T._writableState||T._readableState))}function m(T){var Q;return!!(T&&typeof T.write=="function"&&typeof T.on=="function"&&(!T._readableState||((Q=T._writableState)===null||Q===void 0?void 0:Q.writable)!==!1))}function d(T){return!!(T&&typeof T.pipe=="function"&&T._readableState&&typeof T.on=="function"&&typeof T.write=="function")}function _(T){return T&&(T._readableState||T._writableState||typeof T.write=="function"&&typeof T.on=="function"||typeof T.pipe=="function"&&typeof T.on=="function")}function v(T){return!!(T&&!_(T)&&typeof T.pipeThrough=="function"&&typeof T.getReader=="function"&&typeof T.cancel=="function")}function I(T){return!!(T&&!_(T)&&typeof T.getWriter=="function"&&typeof T.abort=="function")}function A(T){return!!(T&&!_(T)&&typeof T.readable=="object"&&typeof T.writable=="object")}function N(T){return v(T)||I(T)||A(T)}function P(T,Q){return T==null?!1:Q===!0?typeof T[i]=="function":Q===!1?typeof T[e]=="function":typeof T[i]=="function"||typeof T[e]=="function"}function w(T){if(!_(T))return null;const Q=T._writableState,ie=T._readableState,Y=Q||ie;return!!(T.destroyed||T[r]||Y!=null&&Y.destroyed)}function y(T){if(!m(T))return null;if(T.writableEnded===!0)return!0;const Q=T._writableState;return Q!=null&&Q.errored?!1:typeof Q?.ended!="boolean"?null:Q.ended}function S(T,Q){if(!m(T))return null;if(T.writableFinished===!0)return!0;const ie=T._writableState;return ie!=null&&ie.errored?!1:typeof ie?.finished!="boolean"?null:!!(ie.finished||Q===!1&&ie.ended===!0&&ie.length===0)}function O(T){if(!g(T))return null;if(T.readableEnded===!0)return!0;const Q=T._readableState;return!Q||Q.errored?!1:typeof Q?.ended!="boolean"?null:Q.ended}function X(T,Q){if(!g(T))return null;const ie=T._readableState;return ie!=null&&ie.errored?!1:typeof ie?.endEmitted!="boolean"?null:!!(ie.endEmitted||Q===!1&&ie.ended===!0&&ie.length===0)}function C(T){return T&&T[a]!=null?T[a]:typeof T?.readable!="boolean"?null:w(T)?!1:g(T)&&T.readable&&!X(T)}function U(T){return T&&T[l]!=null?T[l]:typeof T?.writable!="boolean"?null:w(T)?!1:m(T)&&T.writable&&!y(T)}function R(T,Q){return _(T)?w(T)?!0:!(Q?.readable!==!1&&C(T)||Q?.writable!==!1&&U(T)):null}function $(T){var Q,ie;return _(T)?T.writableErrored?T.writableErrored:(Q=(ie=T._writableState)===null||ie===void 0?void 0:ie.errored)!==null&&Q!==void 0?Q:null:null}function G(T){var Q,ie;return _(T)?T.readableErrored?T.readableErrored:(Q=(ie=T._readableState)===null||ie===void 0?void 0:ie.errored)!==null&&Q!==void 0?Q:null:null}function j(T){if(!_(T))return null;if(typeof T.closed=="boolean")return T.closed;const Q=T._writableState,ie=T._readableState;return typeof Q?.closed=="boolean"||typeof ie?.closed=="boolean"?Q?.closed||ie?.closed:typeof T._closed=="boolean"&&F(T)?T._closed:null}function F(T){return typeof T._closed=="boolean"&&typeof T._defaultKeepAlive=="boolean"&&typeof T._removedConnection=="boolean"&&typeof T._removedContLen=="boolean"}function se(T){return typeof T._sent100=="boolean"&&F(T)}function M(T){var Q;return typeof T._consuming=="boolean"&&typeof T._dumped=="boolean"&&((Q=T.req)===null||Q===void 0?void 0:Q.upgradeOrConnect)===void 0}function re(T){if(!_(T))return null;const Q=T._writableState,ie=T._readableState,Y=Q||ie;return!Y&&se(T)||!!(Y&&Y.autoDestroy&&Y.emitClose&&Y.closed===!1)}function B(T){var Q;return!!(T&&((Q=T[u])!==null&&Q!==void 0?Q:T.readableDidRead||T.readableAborted))}function oe(T){var Q,ie,Y,me,Z,W,ee,K,ue,ce;return!!(T&&((Q=(ie=(Y=(me=(Z=(W=T[o])!==null&&W!==void 0?W:T.readableErrored)!==null&&Z!==void 0?Z:T.writableErrored)!==null&&me!==void 0?me:(ee=T._readableState)===null||ee===void 0?void 0:ee.errorEmitted)!==null&&Y!==void 0?Y:(K=T._writableState)===null||K===void 0?void 0:K.errorEmitted)!==null&&ie!==void 0?ie:(ue=T._readableState)===null||ue===void 0?void 0:ue.errored)!==null&&Q!==void 0?Q:!((ce=T._writableState)===null||ce===void 0)&&ce.errored))}return Vo={isDestroyed:w,kIsDestroyed:r,isDisturbed:B,kIsDisturbed:u,isErrored:oe,kIsErrored:o,isReadable:C,kIsReadable:a,kIsClosedPromise:f,kControllerErrorFunction:h,kIsWritable:l,isClosed:j,isDuplexNodeStream:d,isFinished:R,isIterable:P,isReadableNodeStream:g,isReadableStream:v,isReadableEnded:O,isReadableFinished:X,isReadableErrored:G,isNodeStream:_,isWebStream:N,isWritable:U,isWritableNodeStream:m,isWritableStream:I,isWritableEnded:y,isWritableFinished:S,isWritableErrored:$,isServerRequest:M,isServerResponse:se,willEmitClose:re,isTransformStream:A},Vo}var yc;function Qn(){if(yc)return Es.exports;yc=1;const i=Ti(),{AbortError:e,codes:n}=Dt(),{ERR_INVALID_ARG_TYPE:r,ERR_STREAM_PREMATURE_CLOSE:o}=n,{kEmptyObject:a,once:l}=jt(),{validateAbortSignal:u,validateFunction:f,validateObject:h,validateBoolean:g}=Xr(),{Promise:m,PromisePrototypeThen:d,SymbolDispose:_}=ct(),{isClosed:v,isReadable:I,isReadableNodeStream:A,isReadableStream:N,isReadableFinished:P,isReadableErrored:w,isWritable:y,isWritableNodeStream:S,isWritableStream:O,isWritableFinished:X,isWritableErrored:C,isNodeStream:U,willEmitClose:R,kIsClosedPromise:$}=Mn();let G;function j(B){return B.setHeader&&typeof B.abort=="function"}const F=()=>{};function se(B,oe,T){var Q,ie;if(arguments.length===2?(T=oe,oe=a):oe==null?oe=a:h(oe,"options"),f(T,"callback"),u(oe.signal,"options.signal"),T=l(T),N(B)||O(B))return M(B,oe,T);if(!U(B))throw new r("stream",["ReadableStream","WritableStream","Stream"],B);const Y=(Q=oe.readable)!==null&&Q!==void 0?Q:A(B),me=(ie=oe.writable)!==null&&ie!==void 0?ie:S(B),Z=B._writableState,W=B._readableState,ee=()=>{B.writable||ce()};let K=R(B)&&A(B)===Y&&S(B)===me,ue=X(B,!1);const ce=()=>{ue=!0,B.destroyed&&(K=!1),!(K&&(!B.readable||Y))&&(!Y||Ee)&&T.call(B)};let Ee=P(B,!1);const Te=()=>{Ee=!0,B.destroyed&&(K=!1),!(K&&(!B.writable||me))&&(!me||ue)&&T.call(B)},q=le=>{T.call(B,le)};let te=v(B);const fe=()=>{te=!0;const le=C(B)||w(B);if(le&&typeof le!="boolean")return T.call(B,le);if(Y&&!Ee&&A(B,!0)&&!P(B,!1))return T.call(B,new o);if(me&&!ue&&!X(B,!1))return T.call(B,new o);T.call(B)},xe=()=>{te=!0;const le=C(B)||w(B);if(le&&typeof le!="boolean")return T.call(B,le);T.call(B)},Se=()=>{B.req.on("finish",ce)};j(B)?(B.on("complete",ce),K||B.on("abort",fe),B.req?Se():B.on("request",Se)):me&&!Z&&(B.on("end",ee),B.on("close",ee)),!K&&typeof B.aborted=="boolean"&&B.on("aborted",fe),B.on("end",Te),B.on("finish",ce),oe.error!==!1&&B.on("error",q),B.on("close",fe),te?i.nextTick(fe):Z!=null&&Z.errorEmitted||W!=null&&W.errorEmitted?K||i.nextTick(xe):(!Y&&(!K||I(B))&&(ue||y(B)===!1)||!me&&(!K||y(B))&&(Ee||I(B)===!1)||W&&B.req&&B.aborted)&&i.nextTick(xe);const Ie=()=>{T=F,B.removeListener("aborted",fe),B.removeListener("complete",ce),B.removeListener("abort",fe),B.removeListener("request",Se),B.req&&B.req.removeListener("finish",ce),B.removeListener("end",ee),B.removeListener("close",ee),B.removeListener("finish",ce),B.removeListener("end",Te),B.removeListener("error",q),B.removeListener("close",fe)};if(oe.signal&&!te){const le=()=>{const ve=T;Ie(),ve.call(B,new e(void 0,{cause:oe.signal.reason}))};if(oe.signal.aborted)i.nextTick(le);else{G=G||jt().addAbortListener;const ve=G(oe.signal,le),Ae=T;T=l((...be)=>{ve[_](),Ae.apply(B,be)})}}return Ie}function M(B,oe,T){let Q=!1,ie=F;if(oe.signal)if(ie=()=>{Q=!0,T.call(B,new e(void 0,{cause:oe.signal.reason}))},oe.signal.aborted)i.nextTick(ie);else{G=G||jt().addAbortListener;const me=G(oe.signal,ie),Z=T;T=l((...W)=>{me[_](),Z.apply(B,W)})}const Y=(...me)=>{Q||i.nextTick(()=>T.apply(B,me))};return d(B[$].promise,Y,Y),F}function re(B,oe){var T;let Q=!1;return oe===null&&(oe=a),(T=oe)!==null&&T!==void 0&&T.cleanup&&(g(oe.cleanup,"cleanup"),Q=oe.cleanup),new m((ie,Y)=>{const me=se(B,oe,Z=>{Q&&me(),Z?Y(Z):ie()})})}return Es.exports=se,Es.exports.finished=re,Es.exports}var Wo,bc;function Ki(){if(bc)return Wo;bc=1;const i=Ti(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:n},AbortError:r}=Dt(),{Symbol:o}=ct(),{kIsDestroyed:a,isDestroyed:l,isFinished:u,isServerRequest:f}=Mn(),h=o("kDestroy"),g=o("kConstruct");function m(R,$,G){R&&(R.stack,$&&!$.errored&&($.errored=R),G&&!G.errored&&(G.errored=R))}function d(R,$){const G=this._readableState,j=this._writableState,F=j||G;return j!=null&&j.destroyed||G!=null&&G.destroyed?(typeof $=="function"&&$(),this):(m(R,j,G),j&&(j.destroyed=!0),G&&(G.destroyed=!0),F.constructed?_(this,R,$):this.once(h,function(se){_(this,e(se,R),$)}),this)}function _(R,$,G){let j=!1;function F(se){if(j)return;j=!0;const M=R._readableState,re=R._writableState;m(se,re,M),re&&(re.closed=!0),M&&(M.closed=!0),typeof G=="function"&&G(se),se?i.nextTick(v,R,se):i.nextTick(I,R)}try{R._destroy($||null,F)}catch(se){F(se)}}function v(R,$){A(R,$),I(R)}function I(R){const $=R._readableState,G=R._writableState;G&&(G.closeEmitted=!0),$&&($.closeEmitted=!0),(G!=null&&G.emitClose||$!=null&&$.emitClose)&&R.emit("close")}function A(R,$){const G=R._readableState,j=R._writableState;j!=null&&j.errorEmitted||G!=null&&G.errorEmitted||(j&&(j.errorEmitted=!0),G&&(G.errorEmitted=!0),R.emit("error",$))}function N(){const R=this._readableState,$=this._writableState;R&&(R.constructed=!0,R.closed=!1,R.closeEmitted=!1,R.destroyed=!1,R.errored=null,R.errorEmitted=!1,R.reading=!1,R.ended=R.readable===!1,R.endEmitted=R.readable===!1),$&&($.constructed=!0,$.destroyed=!1,$.closed=!1,$.closeEmitted=!1,$.errored=null,$.errorEmitted=!1,$.finalCalled=!1,$.prefinished=!1,$.ended=$.writable===!1,$.ending=$.writable===!1,$.finished=$.writable===!1)}function P(R,$,G){const j=R._readableState,F=R._writableState;if(F!=null&&F.destroyed||j!=null&&j.destroyed)return this;j!=null&&j.autoDestroy||F!=null&&F.autoDestroy?R.destroy($):$&&($.stack,F&&!F.errored&&(F.errored=$),j&&!j.errored&&(j.errored=$),G?i.nextTick(A,R,$):A(R,$))}function w(R,$){if(typeof R._construct!="function")return;const G=R._readableState,j=R._writableState;G&&(G.constructed=!1),j&&(j.constructed=!1),R.once(g,$),!(R.listenerCount(g)>1)&&i.nextTick(y,R)}function y(R){let $=!1;function G(j){if($){P(R,j??new n);return}$=!0;const F=R._readableState,se=R._writableState,M=se||F;F&&(F.constructed=!0),se&&(se.constructed=!0),M.destroyed?R.emit(h,j):j?P(R,j,!0):i.nextTick(S,R)}try{R._construct(j=>{i.nextTick(G,j)})}catch(j){i.nextTick(G,j)}}function S(R){R.emit(g)}function O(R){return R?.setHeader&&typeof R.abort=="function"}function X(R){R.emit("close")}function C(R,$){R.emit("error",$),i.nextTick(X,R)}function U(R,$){!R||l(R)||(!$&&!u(R)&&($=new r),f(R)?(R.socket=null,R.destroy($)):O(R)?R.abort():O(R.req)?R.req.abort():typeof R.destroy=="function"?R.destroy($):typeof R.close=="function"?R.close():$?i.nextTick(C,R,$):i.nextTick(X,R),R.destroyed||(R[a]=!0))}return Wo={construct:w,destroyer:U,destroy:d,undestroy:N,errorOrDestroy:P},Wo}var Go,vc;function Dl(){if(vc)return Go;vc=1;const{ArrayIsArray:i,ObjectSetPrototypeOf:e}=ct(),{EventEmitter:n}=Zs();function r(a){n.call(this,a)}e(r.prototype,n.prototype),e(r,n),r.prototype.pipe=function(a,l){const u=this;function f(I){a.writable&&a.write(I)===!1&&u.pause&&u.pause()}u.on("data",f);function h(){u.readable&&u.resume&&u.resume()}a.on("drain",h),!a._isStdio&&(!l||l.end!==!1)&&(u.on("end",m),u.on("close",d));let g=!1;function m(){g||(g=!0,a.end())}function d(){g||(g=!0,typeof a.destroy=="function"&&a.destroy())}function _(I){v(),n.listenerCount(this,"error")===0&&this.emit("error",I)}o(u,"error",_),o(a,"error",_);function v(){u.removeListener("data",f),a.removeListener("drain",h),u.removeListener("end",m),u.removeListener("close",d),u.removeListener("error",_),a.removeListener("error",_),u.removeListener("end",v),u.removeListener("close",v),a.removeListener("close",v)}return u.on("end",v),u.on("close",v),a.on("close",v),a.emit("pipe",u),a};function o(a,l,u){if(typeof a.prependListener=="function")return a.prependListener(l,u);!a._events||!a._events[l]?a.on(l,u):i(a._events[l])?a._events[l].unshift(u):a._events[l]=[u,a._events[l]]}return Go={Stream:r,prependListener:o},Go}var Zo={exports:{}},wc;function Xs(){return wc||(wc=1,(function(i){const{SymbolDispose:e}=ct(),{AbortError:n,codes:r}=Dt(),{isNodeStream:o,isWebStream:a,kControllerErrorFunction:l}=Mn(),u=Qn(),{ERR_INVALID_ARG_TYPE:f}=r;let h;const g=(m,d)=>{if(typeof m!="object"||!("aborted"in m))throw new f(d,"AbortSignal",m)};i.exports.addAbortSignal=function(d,_){if(g(d,"signal"),!o(_)&&!a(_))throw new f("stream",["ReadableStream","WritableStream","Stream"],_);return i.exports.addAbortSignalNoValidate(d,_)},i.exports.addAbortSignalNoValidate=function(m,d){if(typeof m!="object"||!("aborted"in m))return d;const _=o(d)?()=>{d.destroy(new n(void 0,{cause:m.reason}))}:()=>{d[l](new n(void 0,{cause:m.reason}))};if(m.aborted)_();else{h=h||jt().addAbortListener;const v=h(m,_);u(d,v[e])}return d}})(Zo)),Zo.exports}var Xo,xc;function Ug(){if(xc)return Xo;xc=1;const{StringPrototypeSlice:i,SymbolIterator:e,TypedArrayPrototypeSet:n,Uint8Array:r}=ct(),{Buffer:o}=Dn(),{inspect:a}=jt();return Xo=class{constructor(){this.head=null,this.tail=null,this.length=0}push(u){const f={data:u,next:null};this.length>0?this.tail.next=f:this.head=f,this.tail=f,++this.length}unshift(u){const f={data:u,next:this.head};this.length===0&&(this.tail=f),this.head=f,++this.length}shift(){if(this.length===0)return;const u=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,u}clear(){this.head=this.tail=null,this.length=0}join(u){if(this.length===0)return"";let f=this.head,h=""+f.data;for(;(f=f.next)!==null;)h+=u+f.data;return h}concat(u){if(this.length===0)return o.alloc(0);const f=o.allocUnsafe(u>>>0);let h=this.head,g=0;for(;h;)n(f,h.data,g),g+=h.data.length,h=h.next;return f}consume(u,f){const h=this.head.data;if(u<h.length){const g=h.slice(0,u);return this.head.data=h.slice(u),g}return u===h.length?this.shift():f?this._getString(u):this._getBuffer(u)}first(){return this.head.data}*[e](){for(let u=this.head;u;u=u.next)yield u.data}_getString(u){let f="",h=this.head,g=0;do{const m=h.data;if(u>m.length)f+=m,u-=m.length;else{u===m.length?(f+=m,++g,h.next?this.head=h.next:this.head=this.tail=null):(f+=i(m,0,u),this.head=h,h.data=i(m,u));break}++g}while((h=h.next)!==null);return this.length-=g,f}_getBuffer(u){const f=o.allocUnsafe(u),h=u;let g=this.head,m=0;do{const d=g.data;if(u>d.length)n(f,d,h-u),u-=d.length;else{u===d.length?(n(f,d,h-u),++m,g.next?this.head=g.next:this.head=this.tail=null):(n(f,new r(d.buffer,d.byteOffset,u),h-u),this.head=g,g.data=d.slice(u));break}++m}while((g=g.next)!==null);return this.length-=m,f}[Symbol.for("nodejs.util.inspect.custom")](u,f){return a(this,{...f,depth:0,customInspect:!1})}},Xo}var Qo,Ec;function Qs(){if(Ec)return Qo;Ec=1;const{MathFloor:i,NumberIsInteger:e}=ct(),{validateInteger:n}=Xr(),{ERR_INVALID_ARG_VALUE:r}=Dt().codes;let o=16*1024,a=16;function l(g,m,d){return g.highWaterMark!=null?g.highWaterMark:m?g[d]:null}function u(g){return g?a:o}function f(g,m){n(m,"value",0),g?a=m:o=m}function h(g,m,d,_){const v=l(m,_,d);if(v!=null){if(!e(v)||v<0){const I=_?`options.${d}`:"options.highWaterMark";throw new r(I,v)}return i(v)}return u(g.objectMode)}return Qo={getHighWaterMark:h,getDefaultHighWaterMark:u,setDefaultHighWaterMark:f},Qo}var Jo={},Ss={exports:{}};var Sc;function Vg(){return Sc||(Sc=1,(function(i,e){var n=Dn(),r=n.Buffer;function o(l,u){for(var f in l)u[f]=l[f]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?i.exports=n:(o(n,e),e.Buffer=a);function a(l,u,f){return r(l,u,f)}a.prototype=Object.create(r.prototype),o(r,a),a.from=function(l,u,f){if(typeof l=="number")throw new TypeError("Argument must not be a number");return r(l,u,f)},a.alloc=function(l,u,f){if(typeof l!="number")throw new TypeError("Argument must be a number");var h=r(l);return u!==void 0?typeof f=="string"?h.fill(u,f):h.fill(u):h.fill(0),h},a.allocUnsafe=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return r(l)},a.allocUnsafeSlow=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(l)}})(Ss,Ss.exports)),Ss.exports}var Tc;function Wg(){if(Tc)return Jo;Tc=1;var i=Vg().Buffer,e=i.isEncoding||function(N){switch(N=""+N,N&&N.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(N){if(!N)return"utf8";for(var P;;)switch(N){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return N;default:if(P)return;N=(""+N).toLowerCase(),P=!0}}function r(N){var P=n(N);if(typeof P!="string"&&(i.isEncoding===e||!e(N)))throw new Error("Unknown encoding: "+N);return P||N}Jo.StringDecoder=o;function o(N){this.encoding=r(N);var P;switch(this.encoding){case"utf16le":this.text=m,this.end=d,P=4;break;case"utf8":this.fillLast=f,P=4;break;case"base64":this.text=_,this.end=v,P=3;break;default:this.write=I,this.end=A;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(P)}o.prototype.write=function(N){if(N.length===0)return"";var P,w;if(this.lastNeed){if(P=this.fillLast(N),P===void 0)return"";w=this.lastNeed,this.lastNeed=0}else w=0;return w<N.length?P?P+this.text(N,w):this.text(N,w):P||""},o.prototype.end=g,o.prototype.text=h,o.prototype.fillLast=function(N){if(this.lastNeed<=N.length)return N.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);N.copy(this.lastChar,this.lastTotal-this.lastNeed,0,N.length),this.lastNeed-=N.length};function a(N){return N<=127?0:N>>5===6?2:N>>4===14?3:N>>3===30?4:N>>6===2?-1:-2}function l(N,P,w){var y=P.length-1;if(y<w)return 0;var S=a(P[y]);return S>=0?(S>0&&(N.lastNeed=S-1),S):--y<w||S===-2?0:(S=a(P[y]),S>=0?(S>0&&(N.lastNeed=S-2),S):--y<w||S===-2?0:(S=a(P[y]),S>=0?(S>0&&(S===2?S=0:N.lastNeed=S-3),S):0))}function u(N,P,w){if((P[0]&192)!==128)return N.lastNeed=0,"�";if(N.lastNeed>1&&P.length>1){if((P[1]&192)!==128)return N.lastNeed=1,"�";if(N.lastNeed>2&&P.length>2&&(P[2]&192)!==128)return N.lastNeed=2,"�"}}function f(N){var P=this.lastTotal-this.lastNeed,w=u(this,N);if(w!==void 0)return w;if(this.lastNeed<=N.length)return N.copy(this.lastChar,P,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);N.copy(this.lastChar,P,0,N.length),this.lastNeed-=N.length}function h(N,P){var w=l(this,N,P);if(!this.lastNeed)return N.toString("utf8",P);this.lastTotal=w;var y=N.length-(w-this.lastNeed);return N.copy(this.lastChar,0,y),N.toString("utf8",P,y)}function g(N){var P=N&&N.length?this.write(N):"";return this.lastNeed?P+"�":P}function m(N,P){if((N.length-P)%2===0){var w=N.toString("utf16le",P);if(w){var y=w.charCodeAt(w.length-1);if(y>=55296&&y<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=N[N.length-2],this.lastChar[1]=N[N.length-1],w.slice(0,-1)}return w}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=N[N.length-1],N.toString("utf16le",P,N.length-1)}function d(N){var P=N&&N.length?this.write(N):"";if(this.lastNeed){var w=this.lastTotal-this.lastNeed;return P+this.lastChar.toString("utf16le",0,w)}return P}function _(N,P){var w=(N.length-P)%3;return w===0?N.toString("base64",P):(this.lastNeed=3-w,this.lastTotal=3,w===1?this.lastChar[0]=N[N.length-1]:(this.lastChar[0]=N[N.length-2],this.lastChar[1]=N[N.length-1]),N.toString("base64",P,N.length-w))}function v(N){var P=N&&N.length?this.write(N):"";return this.lastNeed?P+this.lastChar.toString("base64",0,3-this.lastNeed):P}function I(N){return N.toString(this.encoding)}function A(N){return N&&N.length?this.write(N):""}return Jo}var Ko,Lc;function gf(){if(Lc)return Ko;Lc=1;const i=Ti(),{PromisePrototypeThen:e,SymbolAsyncIterator:n,SymbolIterator:r}=ct(),{Buffer:o}=Dn(),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_NULL_VALUES:l}=Dt().codes;function u(f,h,g){let m;if(typeof h=="string"||h instanceof o)return new f({objectMode:!0,...g,read(){this.push(h),this.push(null)}});let d;if(h&&h[n])d=!0,m=h[n]();else if(h&&h[r])d=!1,m=h[r]();else throw new a("iterable",["Iterable"],h);const _=new f({objectMode:!0,highWaterMark:1,...g});let v=!1;_._read=function(){v||(v=!0,A())},_._destroy=function(N,P){e(I(N),()=>i.nextTick(P,N),w=>i.nextTick(P,w||N))};async function I(N){const P=N!=null,w=typeof m.throw=="function";if(P&&w){const{value:y,done:S}=await m.throw(N);if(await y,S)return}if(typeof m.return=="function"){const{value:y}=await m.return();await y}}async function A(){for(;;){try{const{value:N,done:P}=d?await m.next():m.next();if(P)_.push(null);else{const w=N&&typeof N.then=="function"?await N:N;if(w===null)throw v=!1,new l;if(_.push(w))continue;v=!1}}catch(N){_.destroy(N)}break}}return _}return Ko=u,Ko}var Yo,Ic;function Js(){if(Ic)return Yo;Ic=1;const i=Ti(),{ArrayPrototypeIndexOf:e,NumberIsInteger:n,NumberIsNaN:r,NumberParseInt:o,ObjectDefineProperties:a,ObjectKeys:l,ObjectSetPrototypeOf:u,Promise:f,SafeSet:h,SymbolAsyncDispose:g,SymbolAsyncIterator:m,Symbol:d}=ct();Yo=be,be.ReadableState=Ae;const{EventEmitter:_}=Zs(),{Stream:v,prependListener:I}=Dl(),{Buffer:A}=Dn(),{addAbortSignal:N}=Xs(),P=Qn();let w=jt().debuglog("stream",z=>{w=z});const y=Ug(),S=Ki(),{getHighWaterMark:O,getDefaultHighWaterMark:X}=Qs(),{aggregateTwoErrors:C,codes:{ERR_INVALID_ARG_TYPE:U,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_OUT_OF_RANGE:$,ERR_STREAM_PUSH_AFTER_EOF:G,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:j},AbortError:F}=Dt(),{validateObject:se}=Xr(),M=d("kPaused"),{StringDecoder:re}=Wg(),B=gf();u(be.prototype,v.prototype),u(be,v);const oe=()=>{},{errorOrDestroy:T}=S,Q=1,ie=2,Y=4,me=8,Z=16,W=32,ee=64,K=128,ue=256,ce=512,Ee=1024,Te=2048,q=4096,te=8192,fe=16384,xe=32768,Se=65536,Ie=1<<17,le=1<<18;function ve(z){return{enumerable:!1,get(){return(this.state&z)!==0},set(J){J?this.state|=z:this.state&=~z}}}a(Ae.prototype,{objectMode:ve(Q),ended:ve(ie),endEmitted:ve(Y),reading:ve(me),constructed:ve(Z),sync:ve(W),needReadable:ve(ee),emittedReadable:ve(K),readableListening:ve(ue),resumeScheduled:ve(ce),errorEmitted:ve(Ee),emitClose:ve(Te),autoDestroy:ve(q),destroyed:ve(te),closed:ve(fe),closeEmitted:ve(xe),multiAwaitDrain:ve(Se),readingMore:ve(Ie),dataEmitted:ve(le)});function Ae(z,J,Ne){typeof Ne!="boolean"&&(Ne=J instanceof Pn()),this.state=Te|q|Z|W,z&&z.objectMode&&(this.state|=Q),Ne&&z&&z.readableObjectMode&&(this.state|=Q),this.highWaterMark=z?O(this,z,"readableHighWaterMark",Ne):X(!1),this.buffer=new y,this.length=0,this.pipes=[],this.flowing=null,this[M]=null,z&&z.emitClose===!1&&(this.state&=~Te),z&&z.autoDestroy===!1&&(this.state&=~q),this.errored=null,this.defaultEncoding=z&&z.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,z&&z.encoding&&(this.decoder=new re(z.encoding),this.encoding=z.encoding)}function be(z){if(!(this instanceof be))return new be(z);const J=this instanceof Pn();this._readableState=new Ae(z,this,J),z&&(typeof z.read=="function"&&(this._read=z.read),typeof z.destroy=="function"&&(this._destroy=z.destroy),typeof z.construct=="function"&&(this._construct=z.construct),z.signal&&!J&&N(z.signal,this)),v.call(this,z),S.construct(this,()=>{this._readableState.needReadable&&ae(this,this._readableState)})}be.prototype.destroy=S.destroy,be.prototype._undestroy=S.undestroy,be.prototype._destroy=function(z,J){J(z)},be.prototype[_.captureRejectionSymbol]=function(z){this.destroy(z)},be.prototype[g]=function(){let z;return this.destroyed||(z=this.readableEnded?null:new F,this.destroy(z)),new f((J,Ne)=>P(this,Re=>Re&&Re!==z?Ne(Re):J(null)))},be.prototype.push=function(z,J){return qe(this,z,J,!1)},be.prototype.unshift=function(z,J){return qe(this,z,J,!0)};function qe(z,J,Ne,Re){w("readableAddChunk",J);const De=z._readableState;let _t;if((De.state&Q)===0&&(typeof J=="string"?(Ne=Ne||De.defaultEncoding,De.encoding!==Ne&&(Re&&De.encoding?J=A.from(J,Ne).toString(De.encoding):(J=A.from(J,Ne),Ne=""))):J instanceof A?Ne="":v._isUint8Array(J)?(J=v._uint8ArrayToBuffer(J),Ne=""):J!=null&&(_t=new U("chunk",["string","Buffer","Uint8Array"],J))),_t)T(z,_t);else if(J===null)De.state&=~me,b(z,De);else if((De.state&Q)!==0||J&&J.length>0)if(Re)if((De.state&Y)!==0)T(z,new j);else{if(De.destroyed||De.errored)return!1;mt(z,De,J,!0)}else if(De.ended)T(z,new G);else{if(De.destroyed||De.errored)return!1;De.state&=~me,De.decoder&&!Ne?(J=De.decoder.write(J),De.objectMode||J.length!==0?mt(z,De,J,!1):ae(z,De)):mt(z,De,J,!1)}else Re||(De.state&=~me,ae(z,De));return!De.ended&&(De.length<De.highWaterMark||De.length===0)}function mt(z,J,Ne,Re){J.flowing&&J.length===0&&!J.sync&&z.listenerCount("data")>0?((J.state&Se)!==0?J.awaitDrainWriters.clear():J.awaitDrainWriters=null,J.dataEmitted=!0,z.emit("data",Ne)):(J.length+=J.objectMode?1:Ne.length,Re?J.buffer.unshift(Ne):J.buffer.push(Ne),(J.state&ee)!==0&&x(z)),ae(z,J)}be.prototype.isPaused=function(){const z=this._readableState;return z[M]===!0||z.flowing===!1},be.prototype.setEncoding=function(z){const J=new re(z);this._readableState.decoder=J,this._readableState.encoding=this._readableState.decoder.encoding;const Ne=this._readableState.buffer;let Re="";for(const De of Ne)Re+=J.write(De);return Ne.clear(),Re!==""&&Ne.push(Re),this._readableState.length=Re.length,this};const $e=1073741824;function ft(z){if(z>$e)throw new $("size","<= 1GiB",z);return z--,z|=z>>>1,z|=z>>>2,z|=z>>>4,z|=z>>>8,z|=z>>>16,z++,z}function k(z,J){return z<=0||J.length===0&&J.ended?0:(J.state&Q)!==0?1:r(z)?J.flowing&&J.length?J.buffer.first().length:J.length:z<=J.length?z:J.ended?J.length:0}be.prototype.read=function(z){w("read",z),z===void 0?z=NaN:n(z)||(z=o(z,10));const J=this._readableState,Ne=z;if(z>J.highWaterMark&&(J.highWaterMark=ft(z)),z!==0&&(J.state&=~K),z===0&&J.needReadable&&((J.highWaterMark!==0?J.length>=J.highWaterMark:J.length>0)||J.ended))return w("read: emitReadable",J.length,J.ended),J.length===0&&J.ended?at(this):x(this),null;if(z=k(z,J),z===0&&J.ended)return J.length===0&&at(this),null;let Re=(J.state&ee)!==0;if(w("need readable",Re),(J.length===0||J.length-z<J.highWaterMark)&&(Re=!0,w("length less than watermark",Re)),J.ended||J.reading||J.destroyed||J.errored||!J.constructed)Re=!1,w("reading, ended or constructing",Re);else if(Re){w("do read"),J.state|=me|W,J.length===0&&(J.state|=ee);try{this._read(J.highWaterMark)}catch(_t){T(this,_t)}J.state&=~W,J.reading||(z=k(Ne,J))}let De;return z>0?De=st(z,J):De=null,De===null?(J.needReadable=J.length<=J.highWaterMark,z=0):(J.length-=z,J.multiAwaitDrain?J.awaitDrainWriters.clear():J.awaitDrainWriters=null),J.length===0&&(J.ended||(J.needReadable=!0),Ne!==z&&J.ended&&at(this)),De!==null&&!J.errorEmitted&&!J.closeEmitted&&(J.dataEmitted=!0,this.emit("data",De)),De};function b(z,J){if(w("onEofChunk"),!J.ended){if(J.decoder){const Ne=J.decoder.end();Ne&&Ne.length&&(J.buffer.push(Ne),J.length+=J.objectMode?1:Ne.length)}J.ended=!0,J.sync?x(z):(J.needReadable=!1,J.emittedReadable=!0,H(z))}}function x(z){const J=z._readableState;w("emitReadable",J.needReadable,J.emittedReadable),J.needReadable=!1,J.emittedReadable||(w("emitReadable",J.flowing),J.emittedReadable=!0,i.nextTick(H,z))}function H(z){const J=z._readableState;w("emitReadable_",J.destroyed,J.length,J.ended),!J.destroyed&&!J.errored&&(J.length||J.ended)&&(z.emit("readable"),J.emittedReadable=!1),J.needReadable=!J.flowing&&!J.ended&&J.length<=J.highWaterMark,Ze(z)}function ae(z,J){!J.readingMore&&J.constructed&&(J.readingMore=!0,i.nextTick(_e,z,J))}function _e(z,J){for(;!J.reading&&!J.ended&&(J.length<J.highWaterMark||J.flowing&&J.length===0);){const Ne=J.length;if(w("maybeReadMore read 0"),z.read(0),Ne===J.length)break}J.readingMore=!1}be.prototype._read=function(z){throw new R("_read()")},be.prototype.pipe=function(z,J){const Ne=this,Re=this._readableState;Re.pipes.length===1&&(Re.multiAwaitDrain||(Re.multiAwaitDrain=!0,Re.awaitDrainWriters=new h(Re.awaitDrainWriters?[Re.awaitDrainWriters]:[]))),Re.pipes.push(z),w("pipe count=%d opts=%j",Re.pipes.length,J);const _t=(!J||J.end!==!1)&&z!==i.stdout&&z!==i.stderr?Nt:V;Re.endEmitted?i.nextTick(_t):Ne.once("end",_t),z.on("unpipe",wt);function wt(de,pe){w("onunpipe"),de===Ne&&pe&&pe.hasUnpiped===!1&&(pe.hasUnpiped=!0,Wt())}function Nt(){w("onend"),z.end()}let ke,ti=!1;function Wt(){w("cleanup"),z.removeListener("close",Bn),z.removeListener("finish",it),ke&&z.removeListener("drain",ke),z.removeListener("error",fn),z.removeListener("unpipe",wt),Ne.removeListener("end",Nt),Ne.removeListener("end",V),Ne.removeListener("data",En),ti=!0,ke&&Re.awaitDrainWriters&&(!z._writableState||z._writableState.needDrain)&&ke()}function jn(){ti||(Re.pipes.length===1&&Re.pipes[0]===z?(w("false write response, pause",0),Re.awaitDrainWriters=z,Re.multiAwaitDrain=!1):Re.pipes.length>1&&Re.pipes.includes(z)&&(w("false write response, pause",Re.awaitDrainWriters.size),Re.awaitDrainWriters.add(z)),Ne.pause()),ke||(ke=we(Ne,z),z.on("drain",ke))}Ne.on("data",En);function En(de){w("ondata");const pe=z.write(de);w("dest.write",pe),pe===!1&&jn()}function fn(de){if(w("onerror",de),V(),z.removeListener("error",fn),z.listenerCount("error")===0){const pe=z._writableState||z._readableState;pe&&!pe.errorEmitted?T(z,de):z.emit("error",de)}}I(z,"error",fn);function Bn(){z.removeListener("finish",it),V()}z.once("close",Bn);function it(){w("onfinish"),z.removeListener("close",Bn),V()}z.once("finish",it);function V(){w("unpipe"),Ne.unpipe(z)}return z.emit("pipe",Ne),z.writableNeedDrain===!0?jn():Re.flowing||(w("pipe resume"),Ne.resume()),z};function we(z,J){return function(){const Re=z._readableState;Re.awaitDrainWriters===J?(w("pipeOnDrain",1),Re.awaitDrainWriters=null):Re.multiAwaitDrain&&(w("pipeOnDrain",Re.awaitDrainWriters.size),Re.awaitDrainWriters.delete(J)),(!Re.awaitDrainWriters||Re.awaitDrainWriters.size===0)&&z.listenerCount("data")&&z.resume()}}be.prototype.unpipe=function(z){const J=this._readableState,Ne={hasUnpiped:!1};if(J.pipes.length===0)return this;if(!z){const De=J.pipes;J.pipes=[],this.pause();for(let _t=0;_t<De.length;_t++)De[_t].emit("unpipe",this,{hasUnpiped:!1});return this}const Re=e(J.pipes,z);return Re===-1?this:(J.pipes.splice(Re,1),J.pipes.length===0&&this.pause(),z.emit("unpipe",this,Ne),this)},be.prototype.on=function(z,J){const Ne=v.prototype.on.call(this,z,J),Re=this._readableState;return z==="data"?(Re.readableListening=this.listenerCount("readable")>0,Re.flowing!==!1&&this.resume()):z==="readable"&&!Re.endEmitted&&!Re.readableListening&&(Re.readableListening=Re.needReadable=!0,Re.flowing=!1,Re.emittedReadable=!1,w("on readable",Re.length,Re.reading),Re.length?x(this):Re.reading||i.nextTick(Ye,this)),Ne},be.prototype.addListener=be.prototype.on,be.prototype.removeListener=function(z,J){const Ne=v.prototype.removeListener.call(this,z,J);return z==="readable"&&i.nextTick(Oe,this),Ne},be.prototype.off=be.prototype.removeListener,be.prototype.removeAllListeners=function(z){const J=v.prototype.removeAllListeners.apply(this,arguments);return(z==="readable"||z===void 0)&&i.nextTick(Oe,this),J};function Oe(z){const J=z._readableState;J.readableListening=z.listenerCount("readable")>0,J.resumeScheduled&&J[M]===!1?J.flowing=!0:z.listenerCount("data")>0?z.resume():J.readableListening||(J.flowing=null)}function Ye(z){w("readable nexttick read 0"),z.read(0)}be.prototype.resume=function(){const z=this._readableState;return z.flowing||(w("resume"),z.flowing=!z.readableListening,Qe(this,z)),z[M]=!1,this};function Qe(z,J){J.resumeScheduled||(J.resumeScheduled=!0,i.nextTick(Ge,z,J))}function Ge(z,J){w("resume",J.reading),J.reading||z.read(0),J.resumeScheduled=!1,z.emit("resume"),Ze(z),J.flowing&&!J.reading&&z.read(0)}be.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[M]=!0,this};function Ze(z){const J=z._readableState;for(w("flow",J.flowing);J.flowing&&z.read()!==null;);}be.prototype.wrap=function(z){let J=!1;z.on("data",Re=>{!this.push(Re)&&z.pause&&(J=!0,z.pause())}),z.on("end",()=>{this.push(null)}),z.on("error",Re=>{T(this,Re)}),z.on("close",()=>{this.destroy()}),z.on("destroy",()=>{this.destroy()}),this._read=()=>{J&&z.resume&&(J=!1,z.resume())};const Ne=l(z);for(let Re=1;Re<Ne.length;Re++){const De=Ne[Re];this[De]===void 0&&typeof z[De]=="function"&&(this[De]=z[De].bind(z))}return this},be.prototype[m]=function(){return $t(this)},be.prototype.iterator=function(z){return z!==void 0&&se(z,"options"),$t(this,z)};function $t(z,J){typeof z.read!="function"&&(z=be.wrap(z,{objectMode:!0}));const Ne=en(z,J);return Ne.stream=z,Ne}async function*en(z,J){let Ne=oe;function Re(wt){this===z?(Ne(),Ne=oe):Ne=wt}z.on("readable",Re);let De;const _t=P(z,{writable:!1},wt=>{De=wt?C(De,wt):null,Ne(),Ne=oe});try{for(;;){const wt=z.destroyed?null:z.read();if(wt!==null)yield wt;else{if(De)throw De;if(De===null)return;await new f(Re)}}}catch(wt){throw De=C(De,wt),De}finally{(De||J?.destroyOnReturn!==!1)&&(De===void 0||z._readableState.autoDestroy)?S.destroyer(z,null):(z.off("readable",Re),_t())}}a(be.prototype,{readable:{__proto__:null,get(){const z=this._readableState;return!!z&&z.readable!==!1&&!z.destroyed&&!z.errorEmitted&&!z.endEmitted},set(z){this._readableState&&(this._readableState.readable=!!z)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(z){this._readableState&&(this._readableState.flowing=z)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(z){this._readableState&&(this._readableState.destroyed=z)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),a(Ae.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[M]!==!1},set(z){this[M]=!!z}}}),be._fromList=st;function st(z,J){if(J.length===0)return null;let Ne;return J.objectMode?Ne=J.buffer.shift():!z||z>=J.length?(J.decoder?Ne=J.buffer.join(""):J.buffer.length===1?Ne=J.buffer.first():Ne=J.buffer.concat(J.length),J.buffer.clear()):Ne=J.buffer.consume(z,J.decoder),Ne}function at(z){const J=z._readableState;w("endReadable",J.endEmitted),J.endEmitted||(J.ended=!0,i.nextTick(Ai,J,z))}function Ai(z,J){if(w("endReadableNT",z.endEmitted,z.length),!z.errored&&!z.closeEmitted&&!z.endEmitted&&z.length===0){if(z.endEmitted=!0,J.emit("end"),J.writable&&J.allowHalfOpen===!1)i.nextTick(hn,J);else if(z.autoDestroy){const Ne=J._writableState;(!Ne||Ne.autoDestroy&&(Ne.finished||Ne.writable===!1))&&J.destroy()}}}function hn(z){z.writable&&!z.writableEnded&&!z.destroyed&&z.end()}be.from=function(z,J){return B(be,z,J)};let Fn;function ei(){return Fn===void 0&&(Fn={}),Fn}return be.fromWeb=function(z,J){return ei().newStreamReadableFromReadableStream(z,J)},be.toWeb=function(z,J){return ei().newReadableStreamFromStreamReadable(z,J)},be.wrap=function(z,J){var Ne,Re;return new be({objectMode:(Ne=(Re=z.readableObjectMode)!==null&&Re!==void 0?Re:z.objectMode)!==null&&Ne!==void 0?Ne:!0,...J,destroy(De,_t){S.destroyer(z,De),_t(De)}}).wrap(z)},Yo}var ea,Ac;function Ml(){if(Ac)return ea;Ac=1;const i=Ti(),{ArrayPrototypeSlice:e,Error:n,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:o,ObjectDefineProperties:a,ObjectSetPrototypeOf:l,StringPrototypeToLowerCase:u,Symbol:f,SymbolHasInstance:h}=ct();ea=se,se.WritableState=j;const{EventEmitter:g}=Zs(),m=Dl().Stream,{Buffer:d}=Dn(),_=Ki(),{addAbortSignal:v}=Xs(),{getHighWaterMark:I,getDefaultHighWaterMark:A}=Qs(),{ERR_INVALID_ARG_TYPE:N,ERR_METHOD_NOT_IMPLEMENTED:P,ERR_MULTIPLE_CALLBACK:w,ERR_STREAM_CANNOT_PIPE:y,ERR_STREAM_DESTROYED:S,ERR_STREAM_ALREADY_FINISHED:O,ERR_STREAM_NULL_VALUES:X,ERR_STREAM_WRITE_AFTER_END:C,ERR_UNKNOWN_ENCODING:U}=Dt().codes,{errorOrDestroy:R}=_;l(se.prototype,m.prototype),l(se,m);function $(){}const G=f("kOnFinished");function j(q,te,fe){typeof fe!="boolean"&&(fe=te instanceof Pn()),this.objectMode=!!(q&&q.objectMode),fe&&(this.objectMode=this.objectMode||!!(q&&q.writableObjectMode)),this.highWaterMark=q?I(this,q,"writableHighWaterMark",fe):A(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const xe=!!(q&&q.decodeStrings===!1);this.decodeStrings=!xe,this.defaultEncoding=q&&q.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=T.bind(void 0,te),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,F(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!q||q.emitClose!==!1,this.autoDestroy=!q||q.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[G]=[]}function F(q){q.buffered=[],q.bufferedIndex=0,q.allBuffers=!0,q.allNoop=!0}j.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},o(j.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function se(q){const te=this instanceof Pn();if(!te&&!r(se,this))return new se(q);this._writableState=new j(q,this,te),q&&(typeof q.write=="function"&&(this._write=q.write),typeof q.writev=="function"&&(this._writev=q.writev),typeof q.destroy=="function"&&(this._destroy=q.destroy),typeof q.final=="function"&&(this._final=q.final),typeof q.construct=="function"&&(this._construct=q.construct),q.signal&&v(q.signal,this)),m.call(this,q),_.construct(this,()=>{const fe=this._writableState;fe.writing||me(this,fe),K(this,fe)})}o(se,h,{__proto__:null,value:function(q){return r(this,q)?!0:this!==se?!1:q&&q._writableState instanceof j}}),se.prototype.pipe=function(){R(this,new y)};function M(q,te,fe,xe){const Se=q._writableState;if(typeof fe=="function")xe=fe,fe=Se.defaultEncoding;else{if(!fe)fe=Se.defaultEncoding;else if(fe!=="buffer"&&!d.isEncoding(fe))throw new U(fe);typeof xe!="function"&&(xe=$)}if(te===null)throw new X;if(!Se.objectMode)if(typeof te=="string")Se.decodeStrings!==!1&&(te=d.from(te,fe),fe="buffer");else if(te instanceof d)fe="buffer";else if(m._isUint8Array(te))te=m._uint8ArrayToBuffer(te),fe="buffer";else throw new N("chunk",["string","Buffer","Uint8Array"],te);let Ie;return Se.ending?Ie=new C:Se.destroyed&&(Ie=new S("write")),Ie?(i.nextTick(xe,Ie),R(q,Ie,!0),Ie):(Se.pendingcb++,re(q,Se,te,fe,xe))}se.prototype.write=function(q,te,fe){return M(this,q,te,fe)===!0},se.prototype.cork=function(){this._writableState.corked++},se.prototype.uncork=function(){const q=this._writableState;q.corked&&(q.corked--,q.writing||me(this,q))},se.prototype.setDefaultEncoding=function(te){if(typeof te=="string"&&(te=u(te)),!d.isEncoding(te))throw new U(te);return this._writableState.defaultEncoding=te,this};function re(q,te,fe,xe,Se){const Ie=te.objectMode?1:fe.length;te.length+=Ie;const le=te.length<te.highWaterMark;return le||(te.needDrain=!0),te.writing||te.corked||te.errored||!te.constructed?(te.buffered.push({chunk:fe,encoding:xe,callback:Se}),te.allBuffers&&xe!=="buffer"&&(te.allBuffers=!1),te.allNoop&&Se!==$&&(te.allNoop=!1)):(te.writelen=Ie,te.writecb=Se,te.writing=!0,te.sync=!0,q._write(fe,xe,te.onwrite),te.sync=!1),le&&!te.errored&&!te.destroyed}function B(q,te,fe,xe,Se,Ie,le){te.writelen=xe,te.writecb=le,te.writing=!0,te.sync=!0,te.destroyed?te.onwrite(new S("write")):fe?q._writev(Se,te.onwrite):q._write(Se,Ie,te.onwrite),te.sync=!1}function oe(q,te,fe,xe){--te.pendingcb,xe(fe),Y(te),R(q,fe)}function T(q,te){const fe=q._writableState,xe=fe.sync,Se=fe.writecb;if(typeof Se!="function"){R(q,new w);return}fe.writing=!1,fe.writecb=null,fe.length-=fe.writelen,fe.writelen=0,te?(te.stack,fe.errored||(fe.errored=te),q._readableState&&!q._readableState.errored&&(q._readableState.errored=te),xe?i.nextTick(oe,q,fe,te,Se):oe(q,fe,te,Se)):(fe.buffered.length>fe.bufferedIndex&&me(q,fe),xe?fe.afterWriteTickInfo!==null&&fe.afterWriteTickInfo.cb===Se?fe.afterWriteTickInfo.count++:(fe.afterWriteTickInfo={count:1,cb:Se,stream:q,state:fe},i.nextTick(Q,fe.afterWriteTickInfo)):ie(q,fe,1,Se))}function Q({stream:q,state:te,count:fe,cb:xe}){return te.afterWriteTickInfo=null,ie(q,te,fe,xe)}function ie(q,te,fe,xe){for(!te.ending&&!q.destroyed&&te.length===0&&te.needDrain&&(te.needDrain=!1,q.emit("drain"));fe-- >0;)te.pendingcb--,xe();te.destroyed&&Y(te),K(q,te)}function Y(q){if(q.writing)return;for(let Se=q.bufferedIndex;Se<q.buffered.length;++Se){var te;const{chunk:Ie,callback:le}=q.buffered[Se],ve=q.objectMode?1:Ie.length;q.length-=ve,le((te=q.errored)!==null&&te!==void 0?te:new S("write"))}const fe=q[G].splice(0);for(let Se=0;Se<fe.length;Se++){var xe;fe[Se]((xe=q.errored)!==null&&xe!==void 0?xe:new S("end"))}F(q)}function me(q,te){if(te.corked||te.bufferProcessing||te.destroyed||!te.constructed)return;const{buffered:fe,bufferedIndex:xe,objectMode:Se}=te,Ie=fe.length-xe;if(!Ie)return;let le=xe;if(te.bufferProcessing=!0,Ie>1&&q._writev){te.pendingcb-=Ie-1;const ve=te.allNoop?$:be=>{for(let qe=le;qe<fe.length;++qe)fe[qe].callback(be)},Ae=te.allNoop&&le===0?fe:e(fe,le);Ae.allBuffers=te.allBuffers,B(q,te,!0,te.length,Ae,"",ve),F(te)}else{do{const{chunk:ve,encoding:Ae,callback:be}=fe[le];fe[le++]=null;const qe=Se?1:ve.length;B(q,te,!1,qe,ve,Ae,be)}while(le<fe.length&&!te.writing);le===fe.length?F(te):le>256?(fe.splice(0,le),te.bufferedIndex=0):te.bufferedIndex=le}te.bufferProcessing=!1}se.prototype._write=function(q,te,fe){if(this._writev)this._writev([{chunk:q,encoding:te}],fe);else throw new P("_write()")},se.prototype._writev=null,se.prototype.end=function(q,te,fe){const xe=this._writableState;typeof q=="function"?(fe=q,q=null,te=null):typeof te=="function"&&(fe=te,te=null);let Se;if(q!=null){const Ie=M(this,q,te);Ie instanceof n&&(Se=Ie)}return xe.corked&&(xe.corked=1,this.uncork()),Se||(!xe.errored&&!xe.ending?(xe.ending=!0,K(this,xe,!0),xe.ended=!0):xe.finished?Se=new O("end"):xe.destroyed&&(Se=new S("end"))),typeof fe=="function"&&(Se||xe.finished?i.nextTick(fe,Se):xe[G].push(fe)),this};function Z(q){return q.ending&&!q.destroyed&&q.constructed&&q.length===0&&!q.errored&&q.buffered.length===0&&!q.finished&&!q.writing&&!q.errorEmitted&&!q.closeEmitted}function W(q,te){let fe=!1;function xe(Se){if(fe){R(q,Se??w());return}if(fe=!0,te.pendingcb--,Se){const Ie=te[G].splice(0);for(let le=0;le<Ie.length;le++)Ie[le](Se);R(q,Se,te.sync)}else Z(te)&&(te.prefinished=!0,q.emit("prefinish"),te.pendingcb++,i.nextTick(ue,q,te))}te.sync=!0,te.pendingcb++;try{q._final(xe)}catch(Se){xe(Se)}te.sync=!1}function ee(q,te){!te.prefinished&&!te.finalCalled&&(typeof q._final=="function"&&!te.destroyed?(te.finalCalled=!0,W(q,te)):(te.prefinished=!0,q.emit("prefinish")))}function K(q,te,fe){Z(te)&&(ee(q,te),te.pendingcb===0&&(fe?(te.pendingcb++,i.nextTick((xe,Se)=>{Z(Se)?ue(xe,Se):Se.pendingcb--},q,te)):Z(te)&&(te.pendingcb++,ue(q,te))))}function ue(q,te){te.pendingcb--,te.finished=!0;const fe=te[G].splice(0);for(let xe=0;xe<fe.length;xe++)fe[xe]();if(q.emit("finish"),te.autoDestroy){const xe=q._readableState;(!xe||xe.autoDestroy&&(xe.endEmitted||xe.readable===!1))&&q.destroy()}}a(se.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(q){this._writableState&&(this._writableState.destroyed=q)}},writable:{__proto__:null,get(){const q=this._writableState;return!!q&&q.writable!==!1&&!q.destroyed&&!q.errored&&!q.ending&&!q.ended},set(q){this._writableState&&(this._writableState.writable=!!q)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const q=this._writableState;return q?!q.destroyed&&!q.ending&&q.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const ce=_.destroy;se.prototype.destroy=function(q,te){const fe=this._writableState;return!fe.destroyed&&(fe.bufferedIndex<fe.buffered.length||fe[G].length)&&i.nextTick(Y,fe),ce.call(this,q,te),this},se.prototype._undestroy=_.undestroy,se.prototype._destroy=function(q,te){te(q)},se.prototype[g.captureRejectionSymbol]=function(q){this.destroy(q)};let Ee;function Te(){return Ee===void 0&&(Ee={}),Ee}return se.fromWeb=function(q,te){return Te().newStreamWritableFromWritableStream(q,te)},se.toWeb=function(q){return Te().newWritableStreamFromStreamWritable(q)},ea}var ta,Nc;function Gg(){if(Nc)return ta;Nc=1;const i=Ti(),e=Dn(),{isReadable:n,isWritable:r,isIterable:o,isNodeStream:a,isReadableNodeStream:l,isWritableNodeStream:u,isDuplexNodeStream:f,isReadableStream:h,isWritableStream:g}=Mn(),m=Qn(),{AbortError:d,codes:{ERR_INVALID_ARG_TYPE:_,ERR_INVALID_RETURN_VALUE:v}}=Dt(),{destroyer:I}=Ki(),A=Pn(),N=Js(),P=Ml(),{createDeferredPromise:w}=jt(),y=gf(),S=globalThis.Blob||e.Blob,O=typeof S<"u"?function(j){return j instanceof S}:function(j){return!1},X=globalThis.AbortController||Hr().AbortController,{FunctionPrototypeCall:C}=ct();class U extends A{constructor(j){super(j),j?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),j?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}ta=function G(j,F){if(f(j))return j;if(l(j))return $({readable:j});if(u(j))return $({writable:j});if(a(j))return $({writable:!1,readable:!1});if(h(j))return $({readable:N.fromWeb(j)});if(g(j))return $({writable:P.fromWeb(j)});if(typeof j=="function"){const{value:M,write:re,final:B,destroy:oe}=R(j);if(o(M))return y(U,M,{objectMode:!0,write:re,final:B,destroy:oe});const T=M?.then;if(typeof T=="function"){let Q;const ie=C(T,M,Y=>{if(Y!=null)throw new v("nully","body",Y)},Y=>{I(Q,Y)});return Q=new U({objectMode:!0,readable:!1,write:re,final(Y){B(async()=>{try{await ie,i.nextTick(Y,null)}catch(me){i.nextTick(Y,me)}})},destroy:oe})}throw new v("Iterable, AsyncIterable or AsyncFunction",F,M)}if(O(j))return G(j.arrayBuffer());if(o(j))return y(U,j,{objectMode:!0,writable:!1});if(h(j?.readable)&&g(j?.writable))return U.fromWeb(j);if(typeof j?.writable=="object"||typeof j?.readable=="object"){const M=j!=null&&j.readable?l(j?.readable)?j?.readable:G(j.readable):void 0,re=j!=null&&j.writable?u(j?.writable)?j?.writable:G(j.writable):void 0;return $({readable:M,writable:re})}const se=j?.then;if(typeof se=="function"){let M;return C(se,j,re=>{re!=null&&M.push(re),M.push(null)},re=>{I(M,re)}),M=new U({objectMode:!0,writable:!1,read(){}})}throw new _(F,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],j)};function R(G){let{promise:j,resolve:F}=w();const se=new X,M=se.signal;return{value:G((async function*(){for(;;){const B=j;j=null;const{chunk:oe,done:T,cb:Q}=await B;if(i.nextTick(Q),T)return;if(M.aborted)throw new d(void 0,{cause:M.reason});({promise:j,resolve:F}=w()),yield oe}})(),{signal:M}),write(B,oe,T){const Q=F;F=null,Q({chunk:B,done:!1,cb:T})},final(B){const oe=F;F=null,oe({done:!0,cb:B})},destroy(B,oe){se.abort(),oe(B)}}}function $(G){const j=G.readable&&typeof G.readable.read!="function"?N.wrap(G.readable):G.readable,F=G.writable;let se=!!n(j),M=!!r(F),re,B,oe,T,Q;function ie(Y){const me=T;T=null,me?me(Y):Y&&Q.destroy(Y)}return Q=new U({readableObjectMode:!!(j!=null&&j.readableObjectMode),writableObjectMode:!!(F!=null&&F.writableObjectMode),readable:se,writable:M}),M&&(m(F,Y=>{M=!1,Y&&I(j,Y),ie(Y)}),Q._write=function(Y,me,Z){F.write(Y,me)?Z():re=Z},Q._final=function(Y){F.end(),B=Y},F.on("drain",function(){if(re){const Y=re;re=null,Y()}}),F.on("finish",function(){if(B){const Y=B;B=null,Y()}})),se&&(m(j,Y=>{se=!1,Y&&I(j,Y),ie(Y)}),j.on("readable",function(){if(oe){const Y=oe;oe=null,Y()}}),j.on("end",function(){Q.push(null)}),Q._read=function(){for(;;){const Y=j.read();if(Y===null){oe=Q._read;return}if(!Q.push(Y))return}}),Q._destroy=function(Y,me){!Y&&T!==null&&(Y=new d),oe=null,re=null,B=null,T===null?me(Y):(T=me,I(F,Y),I(j,Y))},Q}return ta}var na,Rc;function Pn(){if(Rc)return na;Rc=1;const{ObjectDefineProperties:i,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:n,ObjectSetPrototypeOf:r}=ct();na=l;const o=Js(),a=Ml();r(l.prototype,o.prototype),r(l,o);{const g=n(a.prototype);for(let m=0;m<g.length;m++){const d=g[m];l.prototype[d]||(l.prototype[d]=a.prototype[d])}}function l(g){if(!(this instanceof l))return new l(g);o.call(this,g),a.call(this,g),g?(this.allowHalfOpen=g.allowHalfOpen!==!1,g.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),g.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}i(l.prototype,{writable:{__proto__:null,...e(a.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(a.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(a.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(a.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(a.prototype,"writableLength")},writableFinished:{__proto__:null,...e(a.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(a.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(a.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(a.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(g){this._readableState&&this._writableState&&(this._readableState.destroyed=g,this._writableState.destroyed=g)}}});let u;function f(){return u===void 0&&(u={}),u}l.fromWeb=function(g,m){return f().newStreamDuplexFromReadableWritablePair(g,m)},l.toWeb=function(g){return f().newReadableWritablePairFromDuplex(g)};let h;return l.from=function(g){return h||(h=Gg()),h(g,"body")},na}var ia,Cc;function mf(){if(Cc)return ia;Cc=1;const{ObjectSetPrototypeOf:i,Symbol:e}=ct();ia=l;const{ERR_METHOD_NOT_IMPLEMENTED:n}=Dt().codes,r=Pn(),{getHighWaterMark:o}=Qs();i(l.prototype,r.prototype),i(l,r);const a=e("kCallback");function l(h){if(!(this instanceof l))return new l(h);const g=h?o(this,h,"readableHighWaterMark",!0):null;g===0&&(h={...h,highWaterMark:null,readableHighWaterMark:g,writableHighWaterMark:h.writableHighWaterMark||0}),r.call(this,h),this._readableState.sync=!1,this[a]=null,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",f)}function u(h){typeof this._flush=="function"&&!this.destroyed?this._flush((g,m)=>{if(g){h?h(g):this.destroy(g);return}m!=null&&this.push(m),this.push(null),h&&h()}):(this.push(null),h&&h())}function f(){this._final!==u&&u.call(this)}return l.prototype._final=u,l.prototype._transform=function(h,g,m){throw new n("_transform()")},l.prototype._write=function(h,g,m){const d=this._readableState,_=this._writableState,v=d.length;this._transform(h,g,(I,A)=>{if(I){m(I);return}A!=null&&this.push(A),_.ended||v===d.length||d.length<d.highWaterMark?m():this[a]=m})},l.prototype._read=function(){if(this[a]){const h=this[a];this[a]=null,h()}},ia}var ra,Pc;function _f(){if(Pc)return ra;Pc=1;const{ObjectSetPrototypeOf:i}=ct();ra=n;const e=mf();i(n.prototype,e.prototype),i(n,e);function n(r){if(!(this instanceof n))return new n(r);e.call(this,r)}return n.prototype._transform=function(r,o,a){a(null,r)},ra}var sa,kc;function Ol(){if(kc)return sa;kc=1;const i=Ti(),{ArrayIsArray:e,Promise:n,SymbolAsyncIterator:r,SymbolDispose:o}=ct(),a=Qn(),{once:l}=jt(),u=Ki(),f=Pn(),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:m,ERR_MISSING_ARGS:d,ERR_STREAM_DESTROYED:_,ERR_STREAM_PREMATURE_CLOSE:v},AbortError:I}=Dt(),{validateFunction:A,validateAbortSignal:N}=Xr(),{isIterable:P,isReadable:w,isReadableNodeStream:y,isNodeStream:S,isTransformStream:O,isWebStream:X,isReadableStream:C,isReadableFinished:U}=Mn(),R=globalThis.AbortController||Hr().AbortController;let $,G,j;function F(Y,me,Z){let W=!1;Y.on("close",()=>{W=!0});const ee=a(Y,{readable:me,writable:Z},K=>{W=!K});return{destroy:K=>{W||(W=!0,u.destroyer(Y,K||new _("pipe")))},cleanup:ee}}function se(Y){return A(Y[Y.length-1],"streams[stream.length - 1]"),Y.pop()}function M(Y){if(P(Y))return Y;if(y(Y))return re(Y);throw new g("val",["Readable","Iterable","AsyncIterable"],Y)}async function*re(Y){G||(G=Js()),yield*G.prototype[r].call(Y)}async function B(Y,me,Z,{end:W}){let ee,K=null;const ue=Te=>{if(Te&&(ee=Te),K){const q=K;K=null,q()}},ce=()=>new n((Te,q)=>{ee?q(ee):K=()=>{ee?q(ee):Te()}});me.on("drain",ue);const Ee=a(me,{readable:!1},ue);try{me.writableNeedDrain&&await ce();for await(const Te of Y)me.write(Te)||await ce();W&&(me.end(),await ce()),Z()}catch(Te){Z(ee!==Te?h(ee,Te):Te)}finally{Ee(),me.off("drain",ue)}}async function oe(Y,me,Z,{end:W}){O(me)&&(me=me.writable);const ee=me.getWriter();try{for await(const K of Y)await ee.ready,ee.write(K).catch(()=>{});await ee.ready,W&&await ee.close(),Z()}catch(K){try{await ee.abort(K),Z(K)}catch(ue){Z(ue)}}}function T(...Y){return Q(Y,l(se(Y)))}function Q(Y,me,Z){if(Y.length===1&&e(Y[0])&&(Y=Y[0]),Y.length<2)throw new d("streams");const W=new R,ee=W.signal,K=Z?.signal,ue=[];N(K,"options.signal");function ce(){Se(new I)}j=j||jt().addAbortListener;let Ee;K&&(Ee=j(K,ce));let Te,q;const te=[];let fe=0;function xe(Ae){Se(Ae,--fe===0)}function Se(Ae,be){var qe;if(Ae&&(!Te||Te.code==="ERR_STREAM_PREMATURE_CLOSE")&&(Te=Ae),!(!Te&&!be)){for(;te.length;)te.shift()(Te);(qe=Ee)===null||qe===void 0||qe[o](),W.abort(),be&&(Te||ue.forEach(mt=>mt()),i.nextTick(me,Te,q))}}let Ie;for(let Ae=0;Ae<Y.length;Ae++){const be=Y[Ae],qe=Ae<Y.length-1,mt=Ae>0,$e=qe||Z?.end!==!1,ft=Ae===Y.length-1;if(S(be)){let k=function(b){b&&b.name!=="AbortError"&&b.code!=="ERR_STREAM_PREMATURE_CLOSE"&&xe(b)};if($e){const{destroy:b,cleanup:x}=F(be,qe,mt);te.push(b),w(be)&&ft&&ue.push(x)}be.on("error",k),w(be)&&ft&&ue.push(()=>{be.removeListener("error",k)})}if(Ae===0)if(typeof be=="function"){if(Ie=be({signal:ee}),!P(Ie))throw new m("Iterable, AsyncIterable or Stream","source",Ie)}else P(be)||y(be)||O(be)?Ie=be:Ie=f.from(be);else if(typeof be=="function"){if(O(Ie)){var le;Ie=M((le=Ie)===null||le===void 0?void 0:le.readable)}else Ie=M(Ie);if(Ie=be(Ie,{signal:ee}),qe){if(!P(Ie,!0))throw new m("AsyncIterable",`transform[${Ae-1}]`,Ie)}else{var ve;$||($=_f());const k=new $({objectMode:!0}),b=(ve=Ie)===null||ve===void 0?void 0:ve.then;if(typeof b=="function")fe++,b.call(Ie,ae=>{q=ae,ae!=null&&k.write(ae),$e&&k.end(),i.nextTick(xe)},ae=>{k.destroy(ae),i.nextTick(xe,ae)});else if(P(Ie,!0))fe++,B(Ie,k,xe,{end:$e});else if(C(Ie)||O(Ie)){const ae=Ie.readable||Ie;fe++,B(ae,k,xe,{end:$e})}else throw new m("AsyncIterable or Promise","destination",Ie);Ie=k;const{destroy:x,cleanup:H}=F(Ie,!1,!0);te.push(x),ft&&ue.push(H)}}else if(S(be)){if(y(Ie)){fe+=2;const k=ie(Ie,be,xe,{end:$e});w(be)&&ft&&ue.push(k)}else if(O(Ie)||C(Ie)){const k=Ie.readable||Ie;fe++,B(k,be,xe,{end:$e})}else if(P(Ie))fe++,B(Ie,be,xe,{end:$e});else throw new g("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Ie);Ie=be}else if(X(be)){if(y(Ie))fe++,oe(M(Ie),be,xe,{end:$e});else if(C(Ie)||P(Ie))fe++,oe(Ie,be,xe,{end:$e});else if(O(Ie))fe++,oe(Ie.readable,be,xe,{end:$e});else throw new g("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Ie);Ie=be}else Ie=f.from(be)}return(ee!=null&&ee.aborted||K!=null&&K.aborted)&&i.nextTick(ce),Ie}function ie(Y,me,Z,{end:W}){let ee=!1;if(me.on("close",()=>{ee||Z(new v)}),Y.pipe(me,{end:!1}),W){let K=function(){ee=!0,me.end()};U(Y)?i.nextTick(K):Y.once("end",K)}else Z();return a(Y,{readable:!0,writable:!1},K=>{const ue=Y._readableState;K&&K.code==="ERR_STREAM_PREMATURE_CLOSE"&&ue&&ue.ended&&!ue.errored&&!ue.errorEmitted?Y.once("end",Z).once("error",Z):Z(K)}),a(me,{readable:!1,writable:!0},Z)}return sa={pipelineImpl:Q,pipeline:T},sa}var oa,Dc;function yf(){if(Dc)return oa;Dc=1;const{pipeline:i}=Ol(),e=Pn(),{destroyer:n}=Ki(),{isNodeStream:r,isReadable:o,isWritable:a,isWebStream:l,isTransformStream:u,isWritableStream:f,isReadableStream:h}=Mn(),{AbortError:g,codes:{ERR_INVALID_ARG_VALUE:m,ERR_MISSING_ARGS:d}}=Dt(),_=Qn();return oa=function(...I){if(I.length===0)throw new d("streams");if(I.length===1)return e.from(I[0]);const A=[...I];if(typeof I[0]=="function"&&(I[0]=e.from(I[0])),typeof I[I.length-1]=="function"){const $=I.length-1;I[$]=e.from(I[$])}for(let $=0;$<I.length;++$)if(!(!r(I[$])&&!l(I[$]))){if($<I.length-1&&!(o(I[$])||h(I[$])||u(I[$])))throw new m(`streams[${$}]`,A[$],"must be readable");if($>0&&!(a(I[$])||f(I[$])||u(I[$])))throw new m(`streams[${$}]`,A[$],"must be writable")}let N,P,w,y,S;function O($){const G=y;y=null,G?G($):$?S.destroy($):!R&&!U&&S.destroy()}const X=I[0],C=i(I,O),U=!!(a(X)||f(X)||u(X)),R=!!(o(C)||h(C)||u(C));if(S=new e({writableObjectMode:!!(X!=null&&X.writableObjectMode),readableObjectMode:!!(C!=null&&C.readableObjectMode),writable:U,readable:R}),U){if(r(X))S._write=function(G,j,F){X.write(G,j)?F():N=F},S._final=function(G){X.end(),P=G},X.on("drain",function(){if(N){const G=N;N=null,G()}});else if(l(X)){const j=(u(X)?X.writable:X).getWriter();S._write=async function(F,se,M){try{await j.ready,j.write(F).catch(()=>{}),M()}catch(re){M(re)}},S._final=async function(F){try{await j.ready,j.close().catch(()=>{}),P=F}catch(se){F(se)}}}const $=u(C)?C.readable:C;_($,()=>{if(P){const G=P;P=null,G()}})}if(R){if(r(C))C.on("readable",function(){if(w){const $=w;w=null,$()}}),C.on("end",function(){S.push(null)}),S._read=function(){for(;;){const $=C.read();if($===null){w=S._read;return}if(!S.push($))return}};else if(l(C)){const G=(u(C)?C.readable:C).getReader();S._read=async function(){for(;;)try{const{value:j,done:F}=await G.read();if(!S.push(j))return;if(F){S.push(null);return}}catch{return}}}}return S._destroy=function($,G){!$&&y!==null&&($=new g),w=null,N=null,P=null,y===null?G($):(y=G,r(C)&&n(C,$))},S},oa}var Mc;function Zg(){if(Mc)return xs;Mc=1;const i=globalThis.AbortController||Hr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:n,ERR_MISSING_ARGS:r,ERR_OUT_OF_RANGE:o},AbortError:a}=Dt(),{validateAbortSignal:l,validateInteger:u,validateObject:f}=Xr(),h=ct().Symbol("kWeak"),g=ct().Symbol("kResistStopPropagation"),{finished:m}=Qn(),d=yf(),{addAbortSignalNoValidate:_}=Xs(),{isWritable:v,isNodeStream:I}=Mn(),{deprecate:A}=jt(),{ArrayPrototypePush:N,Boolean:P,MathFloor:w,Number:y,NumberIsNaN:S,Promise:O,PromiseReject:X,PromiseResolve:C,PromisePrototypeThen:U,Symbol:R}=ct(),$=R("kEmpty"),G=R("kEof");function j(K,ue){if(ue!=null&&f(ue,"options"),ue?.signal!=null&&l(ue.signal,"options.signal"),I(K)&&!v(K))throw new e("stream",K,"must be writable");const ce=d(this,K);return ue!=null&&ue.signal&&_(ue.signal,ce),ce}function F(K,ue){if(typeof K!="function")throw new n("fn",["Function","AsyncFunction"],K);ue!=null&&f(ue,"options"),ue?.signal!=null&&l(ue.signal,"options.signal");let ce=1;ue?.concurrency!=null&&(ce=w(ue.concurrency));let Ee=ce-1;return ue?.highWaterMark!=null&&(Ee=w(ue.highWaterMark)),u(ce,"options.concurrency",1),u(Ee,"options.highWaterMark",0),Ee+=ce,(async function*(){const q=jt().AbortSignalAny([ue?.signal].filter(P)),te=this,fe=[],xe={signal:q};let Se,Ie,le=!1,ve=0;function Ae(){le=!0,be()}function be(){ve-=1,qe()}function qe(){Ie&&!le&&ve<ce&&fe.length<Ee&&(Ie(),Ie=null)}async function mt(){try{for await(let $e of te){if(le)return;if(q.aborted)throw new a;try{if($e=K($e,xe),$e===$)continue;$e=C($e)}catch(ft){$e=X(ft)}ve+=1,U($e,be,Ae),fe.push($e),Se&&(Se(),Se=null),!le&&(fe.length>=Ee||ve>=ce)&&await new O(ft=>{Ie=ft})}fe.push(G)}catch($e){const ft=X($e);U(ft,be,Ae),fe.push(ft)}finally{le=!0,Se&&(Se(),Se=null)}}mt();try{for(;;){for(;fe.length>0;){const $e=await fe[0];if($e===G)return;if(q.aborted)throw new a;$e!==$&&(yield $e),fe.shift(),qe()}await new O($e=>{Se=$e})}}finally{le=!0,Ie&&(Ie(),Ie=null)}}).call(this)}function se(K=void 0){return K!=null&&f(K,"options"),K?.signal!=null&&l(K.signal,"options.signal"),(async function*(){let ce=0;for await(const Te of this){var Ee;if(K!=null&&(Ee=K.signal)!==null&&Ee!==void 0&&Ee.aborted)throw new a({cause:K.signal.reason});yield[ce++,Te]}}).call(this)}async function M(K,ue=void 0){for await(const ce of T.call(this,K,ue))return!0;return!1}async function re(K,ue=void 0){if(typeof K!="function")throw new n("fn",["Function","AsyncFunction"],K);return!await M.call(this,async(...ce)=>!await K(...ce),ue)}async function B(K,ue){for await(const ce of T.call(this,K,ue))return ce}async function oe(K,ue){if(typeof K!="function")throw new n("fn",["Function","AsyncFunction"],K);async function ce(Ee,Te){return await K(Ee,Te),$}for await(const Ee of F.call(this,ce,ue));}function T(K,ue){if(typeof K!="function")throw new n("fn",["Function","AsyncFunction"],K);async function ce(Ee,Te){return await K(Ee,Te)?Ee:$}return F.call(this,ce,ue)}class Q extends r{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function ie(K,ue,ce){var Ee;if(typeof K!="function")throw new n("reducer",["Function","AsyncFunction"],K);ce!=null&&f(ce,"options"),ce?.signal!=null&&l(ce.signal,"options.signal");let Te=arguments.length>1;if(ce!=null&&(Ee=ce.signal)!==null&&Ee!==void 0&&Ee.aborted){const Se=new a(void 0,{cause:ce.signal.reason});throw this.once("error",()=>{}),await m(this.destroy(Se)),Se}const q=new i,te=q.signal;if(ce!=null&&ce.signal){const Se={once:!0,[h]:this,[g]:!0};ce.signal.addEventListener("abort",()=>q.abort(),Se)}let fe=!1;try{for await(const Se of this){var xe;if(fe=!0,ce!=null&&(xe=ce.signal)!==null&&xe!==void 0&&xe.aborted)throw new a;Te?ue=await K(ue,Se,{signal:te}):(ue=Se,Te=!0)}if(!fe&&!Te)throw new Q}finally{q.abort()}return ue}async function Y(K){K!=null&&f(K,"options"),K?.signal!=null&&l(K.signal,"options.signal");const ue=[];for await(const Ee of this){var ce;if(K!=null&&(ce=K.signal)!==null&&ce!==void 0&&ce.aborted)throw new a(void 0,{cause:K.signal.reason});N(ue,Ee)}return ue}function me(K,ue){const ce=F.call(this,K,ue);return(async function*(){for await(const Te of ce)yield*Te}).call(this)}function Z(K){if(K=y(K),S(K))return 0;if(K<0)throw new o("number",">= 0",K);return K}function W(K,ue=void 0){return ue!=null&&f(ue,"options"),ue?.signal!=null&&l(ue.signal,"options.signal"),K=Z(K),(async function*(){var Ee;if(ue!=null&&(Ee=ue.signal)!==null&&Ee!==void 0&&Ee.aborted)throw new a;for await(const q of this){var Te;if(ue!=null&&(Te=ue.signal)!==null&&Te!==void 0&&Te.aborted)throw new a;K--<=0&&(yield q)}}).call(this)}function ee(K,ue=void 0){return ue!=null&&f(ue,"options"),ue?.signal!=null&&l(ue.signal,"options.signal"),K=Z(K),(async function*(){var Ee;if(ue!=null&&(Ee=ue.signal)!==null&&Ee!==void 0&&Ee.aborted)throw new a;for await(const q of this){var Te;if(ue!=null&&(Te=ue.signal)!==null&&Te!==void 0&&Te.aborted)throw new a;if(K-- >0&&(yield q),K<=0)return}}).call(this)}return xs.streamReturningOperators={asIndexedPairs:A(se,"readable.asIndexedPairs will be removed in a future version."),drop:W,filter:T,flatMap:me,map:F,take:ee,compose:j},xs.promiseReturningOperators={every:re,forEach:oe,reduce:ie,toArray:Y,some:M,find:B},xs}var aa,Oc;function bf(){if(Oc)return aa;Oc=1;const{ArrayPrototypePop:i,Promise:e}=ct(),{isIterable:n,isNodeStream:r,isWebStream:o}=Mn(),{pipelineImpl:a}=Ol(),{finished:l}=Qn();vf();function u(...f){return new e((h,g)=>{let m,d;const _=f[f.length-1];if(_&&typeof _=="object"&&!r(_)&&!n(_)&&!o(_)){const v=i(f);m=v.signal,d=v.end}a(f,(v,I)=>{v?g(v):h(I)},{signal:m,end:d})})}return aa={finished:l,pipeline:u},aa}var Fc;function vf(){if(Fc)return jo.exports;Fc=1;const{Buffer:i}=Dn(),{ObjectDefineProperty:e,ObjectKeys:n,ReflectApply:r}=ct(),{promisify:{custom:o}}=jt(),{streamReturningOperators:a,promiseReturningOperators:l}=Zg(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=Dt(),f=yf(),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:g}=Qs(),{pipeline:m}=Ol(),{destroyer:d}=Ki(),_=Qn(),v=bf(),I=Mn(),A=jo.exports=Dl().Stream;A.isDestroyed=I.isDestroyed,A.isDisturbed=I.isDisturbed,A.isErrored=I.isErrored,A.isReadable=I.isReadable,A.isWritable=I.isWritable,A.Readable=Js();for(const P of n(a)){let y=function(...S){if(new.target)throw u();return A.Readable.from(r(w,this,S))};const w=a[P];e(y,"name",{__proto__:null,value:w.name}),e(y,"length",{__proto__:null,value:w.length}),e(A.Readable.prototype,P,{__proto__:null,value:y,enumerable:!1,configurable:!0,writable:!0})}for(const P of n(l)){let y=function(...S){if(new.target)throw u();return r(w,this,S)};const w=l[P];e(y,"name",{__proto__:null,value:w.name}),e(y,"length",{__proto__:null,value:w.length}),e(A.Readable.prototype,P,{__proto__:null,value:y,enumerable:!1,configurable:!0,writable:!0})}A.Writable=Ml(),A.Duplex=Pn(),A.Transform=mf(),A.PassThrough=_f(),A.pipeline=m;const{addAbortSignal:N}=Xs();return A.addAbortSignal=N,A.finished=_,A.destroy=d,A.compose=f,A.setDefaultHighWaterMark=h,A.getDefaultHighWaterMark=g,e(A,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return v}}),e(m,o,{__proto__:null,enumerable:!0,get(){return v.pipeline}}),e(_,o,{__proto__:null,enumerable:!0,get(){return v.finished}}),A.Stream=A,A._isUint8Array=function(w){return w instanceof Uint8Array},A._uint8ArrayToBuffer=function(w){return i.from(w.buffer,w.byteOffset,w.byteLength)},jo.exports}var jc;function wf(){return jc||(jc=1,(function(i){const e=vf(),n=bf(),r=e.Readable.destroy;i.exports=e.Readable,i.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,i.exports._isUint8Array=e._isUint8Array,i.exports.isDisturbed=e.isDisturbed,i.exports.isErrored=e.isErrored,i.exports.isReadable=e.isReadable,i.exports.Readable=e.Readable,i.exports.Writable=e.Writable,i.exports.Duplex=e.Duplex,i.exports.Transform=e.Transform,i.exports.PassThrough=e.PassThrough,i.exports.addAbortSignal=e.addAbortSignal,i.exports.finished=e.finished,i.exports.destroy=e.destroy,i.exports.destroy=r,i.exports.pipeline=e.pipeline,i.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return n}}),i.exports.Stream=e.Stream,i.exports.default=i.exports})(Fo)),Fo.exports}var Fl=wf();const la=Symbol("iter");function $r(i,e,n=4){if(n===0)return Object.assign(i,e);for(const r in e)i[r]=$r(i[r]||Object.create(null),e[r],n-1);return i}function xf(i,e,n=4){let r=!1;for(const o in i)if(o in e){const a=n===0?null:xf(i[o],e[o],n-1);if(a!==!1)r=r||Object.create(null),r[o]=a;else if(n===3)return!1}return r}function Ef(i,e,n=4){let r=!1;for(const o in i)if(!(o in e))r=r||Object.create(null),r[o]=n===0?null:$r({},i[o],n-1);else if(n!==0){const a=Ef(i[o],e[o],n-1);if(a!==!1)r=r||Object.create(null),r[o]=a;else if(n===3)return!1}return r}class Xg{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||Be}_termFromId(e){if(e[0]==="."){const n=this._entities,r=e.split(".");return this._factory.quad(this._termFromId(n[r[1]]),this._termFromId(n[r[2]]),this._termFromId(n[r[3]]),r[4]&&this._termFromId(n[r[4]]))}return Mr(e,this._factory)}_termToNumericId(e){if(e.termType==="Quad"){const n=this._termToNumericId(e.subject),r=this._termToNumericId(e.predicate),o=this._termToNumericId(e.object);let a;return n&&r&&o&&(vl(e.graph)||(a=this._termToNumericId(e.graph)))&&this._ids[a?`.${n}.${r}.${o}.${a}`:`.${n}.${r}.${o}`]}return this._ids[zi(e)]}_termToNewNumericId(e){const n=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${vl(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:zi(e);return this._ids[n]||(this._ids[this._entities[++this._id]=n]=this._id)}createBlankNode(e){let n,r;if(e)for(n=e=`_:${e}`,r=1;this._ids[n];)n=e+r++;else do n=`_:b${this._blankNodeIndex++}`;while(this._ids[n]);return this._ids[n]=++this._id,this._entities[this._id]=n,this._factory.blankNode(n.substr(2))}}class It{constructor(e,n){this._size=0,this._graphs=Object.create(null),!n&&e&&!e[0]&&typeof e.match!="function"&&(n=e,e=null),n=n||{},this._factory=n.factory||Be,this._entityIndex=n.entityIndex||new Xg({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),e&&this.addAll(e)}get size(){let e=this._size;if(e!==null)return e;e=0;const n=this._graphs;let r,o;for(const a in n)for(const l in r=n[a].subjects)for(const u in o=r[l])e+=Object.keys(o[u]).length;return this._size=e}_addToIndex(e,n,r,o){const a=e[n]||(e[n]={}),l=a[r]||(a[r]={}),u=o in l;return u||(l[o]=null),!u}_removeFromIndex(e,n,r,o){const a=e[n],l=a[r];delete l[o];for(const u in l)return;delete a[r];for(const u in a)return;delete e[n]}*_findInIndex(e,n,r,o,a,l,u,f){let h,g,m;const d=this._entities,_=this._termFromId(d[f]),v={subject:null,predicate:null,object:null};n&&((h=e,e={})[n]=h[n]);for(const I in e)if(g=e[I]){v[a]=this._termFromId(d[I]),r&&((h=g,g={})[r]=h[r]);for(const A in g)if(m=g[A]){v[l]=this._termFromId(d[A]);const N=o?o in m?[o]:[]:Object.keys(m);for(let P=0;P<N.length;P++)v[u]=this._termFromId(d[N[P]]),yield this._factory.quad(v.subject,v.predicate,v.object,_)}}}_loop(e,n){for(const r in e)n(r)}_loopByKey0(e,n,r){let o,a;if(o=e[n])for(a in o)r(a)}_loopByKey1(e,n,r){let o,a;for(o in e)a=e[o],a[n]&&r(o)}_loopBy2Keys(e,n,r,o){let a,l,u;if((a=e[n])&&(l=a[r]))for(u in l)o(u)}_countInIndex(e,n,r,o){let a=0,l,u,f;n&&((l=e,e={})[n]=l[n]);for(const h in e)if(u=e[h]){r&&((l=u,u={})[r]=l[r]);for(const g in u)(f=u[g])&&(o?o in f&&a++:a+=Object.keys(f).length)}return a}_getGraphs(e){return e=e===""?1:e&&(this._termToNumericId(e)||-1),typeof e!="number"?this._graphs:{[e]:this._graphs[e]}}_uniqueEntities(e){const n=Object.create(null);return r=>{r in n||(n[r]=!0,e(this._termFromId(this._entities[r],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,n,r,o){n||(o=e.graph,r=e.object,n=e.predicate,e=e.subject),o=o?this._termToNewNumericId(o):1;let a=this._graphs[o];return a||(a=this._graphs[o]={subjects:{},predicates:{},objects:{}},Object.freeze(a)),e=this._termToNewNumericId(e),n=this._termToNewNumericId(n),r=this._termToNewNumericId(r),this._addToIndex(a.subjects,e,n,r)?(this._addToIndex(a.predicates,n,r,e),this._addToIndex(a.objects,r,e,n),this._size=null,!0):!1}addQuads(e){for(let n=0;n<e.length;n++)this.addQuad(e[n])}delete(e){return this.removeQuad(e),this}has(e,n,r,o){return e&&e.subject&&({subject:e,predicate:n,object:r,graph:o}=e),!this.readQuads(e,n,r,o).next().done}import(e){return e.on("data",n=>{this.addQuad(n)}),e}removeQuad(e,n,r,o){n||({subject:e,predicate:n,object:r,graph:o}=e),o=o?this._termToNumericId(o):1;const a=this._graphs;let l,u,f;if(!(e=e&&this._termToNumericId(e))||!(n=n&&this._termToNumericId(n))||!(r=r&&this._termToNumericId(r))||!(l=a[o])||!(u=l.subjects[e])||!(f=u[n])||!(r in f))return!1;this._removeFromIndex(l.subjects,e,n,r),this._removeFromIndex(l.predicates,n,r,e),this._removeFromIndex(l.objects,r,e,n),this._size!==null&&this._size--;for(e in l.subjects)return!0;return delete a[o],!0}removeQuads(e){for(let n=0;n<e.length;n++)this.removeQuad(e[n])}remove(e){return e.on("data",n=>{this.removeQuad(n)}),e}removeMatches(e,n,r,o){const a=new Fl.Readable({objectMode:!0}),l=this.readQuads(e,n,r,o);return a._read=u=>{for(;--u>=0;){const{done:f,value:h}=l.next();if(f){a.push(null);return}a.push(h)}},this.remove(a)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,n,r,o){return[...this.readQuads(e,n,r,o)]}*readQuads(e,n,r,o){const a=this._getGraphs(o);let l,u,f,h;if(!(e&&!(u=this._termToNumericId(e))||n&&!(f=this._termToNumericId(n))||r&&!(h=this._termToNumericId(r))))for(const g in a)(l=a[g])&&(u?h?yield*this._findInIndex(l.objects,h,u,f,"object","subject","predicate",g):yield*this._findInIndex(l.subjects,u,f,null,"subject","predicate","object",g):f?yield*this._findInIndex(l.predicates,f,h,null,"predicate","object","subject",g):h?yield*this._findInIndex(l.objects,h,null,null,"object","subject","predicate",g):yield*this._findInIndex(l.subjects,null,null,null,"subject","predicate","object",g))}match(e,n,r,o){return new Un(this,e,n,r,o,{entityIndex:this._entityIndex})}countQuads(e,n,r,o){const a=this._getGraphs(o);let l=0,u,f,h,g;if(e&&!(f=this._termToNumericId(e))||n&&!(h=this._termToNumericId(n))||r&&!(g=this._termToNumericId(r)))return 0;for(const m in a)(u=a[m])&&(e?r?l+=this._countInIndex(u.objects,g,f,h):l+=this._countInIndex(u.subjects,f,h,g):n?l+=this._countInIndex(u.predicates,h,g,f):l+=this._countInIndex(u.objects,g,f,h));return l}forEach(e,n,r,o,a){this.some(l=>(e(l,this),!1),n,r,o,a)}every(e,n,r,o,a){return!this.some(l=>!e(l,this),n,r,o,a)}some(e,n,r,o,a){for(const l of this.readQuads(n,r,o,a))if(e(l,this))return!0;return!1}getSubjects(e,n,r){const o=[];return this.forSubjects(a=>{o.push(a)},e,n,r),o}forSubjects(e,n,r,o){const a=this._getGraphs(o);let l,u,f;if(e=this._uniqueEntities(e),!(n&&!(u=this._termToNumericId(n))||r&&!(f=this._termToNumericId(r))))for(o in a)(l=a[o])&&(u?f?this._loopBy2Keys(l.predicates,u,f,e):this._loopByKey1(l.subjects,u,e):f?this._loopByKey0(l.objects,f,e):this._loop(l.subjects,e))}getPredicates(e,n,r){const o=[];return this.forPredicates(a=>{o.push(a)},e,n,r),o}forPredicates(e,n,r,o){const a=this._getGraphs(o);let l,u,f;if(e=this._uniqueEntities(e),!(n&&!(u=this._termToNumericId(n))||r&&!(f=this._termToNumericId(r))))for(o in a)(l=a[o])&&(u?f?this._loopBy2Keys(l.objects,f,u,e):this._loopByKey0(l.subjects,u,e):f?this._loopByKey1(l.predicates,f,e):this._loop(l.predicates,e))}getObjects(e,n,r){const o=[];return this.forObjects(a=>{o.push(a)},e,n,r),o}forObjects(e,n,r,o){const a=this._getGraphs(o);let l,u,f;if(e=this._uniqueEntities(e),!(n&&!(u=this._termToNumericId(n))||r&&!(f=this._termToNumericId(r))))for(o in a)(l=a[o])&&(u?f?this._loopBy2Keys(l.subjects,u,f,e):this._loopByKey1(l.objects,u,e):f?this._loopByKey0(l.predicates,f,e):this._loop(l.objects,e))}getGraphs(e,n,r){const o=[];return this.forGraphs(a=>{o.push(a)},e,n,r),o}forGraphs(e,n,r,o){for(const a in this._graphs)this.some(l=>(e(l.graph),!0),n,r,o,this._termFromId(this._entities[a]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:n=!1}={}){const r={},o=n?(()=>!0):((u,f)=>{throw new Error(`${u.value} ${f}`)}),a=this.getQuads(null,Lt.rdf.rest,Lt.rdf.nil,null),l=e?[...a]:[];return a.forEach(u=>{const f=[];let h=!1,g,m;const d=u.graph;let _=u.subject;for(;_&&!h;){const v=this.getQuads(null,null,_,null),I=this.getQuads(_,null,null,null);let A,N=null,P=null,w=null;for(let y=0;y<I.length&&!h;y++)A=I[y],A.graph.equals(d)?g?h=o(_,"has non-list arcs out"):A.predicate.value===Lt.rdf.first?N?h=o(_,"has multiple rdf:first arcs"):l.push(N=A):A.predicate.value===Lt.rdf.rest?P?h=o(_,"has multiple rdf:rest arcs"):l.push(P=A):v.length?h=o(_,"can't be subject and object"):(g=A,m="subject"):h=o(_,"not confined to single graph");for(let y=0;y<v.length&&!h;++y)A=v[y],g?h=o(_,"can't have coreferences"):A.predicate.value===Lt.rdf.rest?w?h=o(_,"has incoming rdf:rest arcs"):w=A:(g=A,m="object");N?f.unshift(N.object):h=o(_,"has no list head"),_=w&&w.subject}h?e=!1:g&&(r[g[m].value]=f)}),e&&this.removeQuads(l),r}addAll(e){if(e instanceof Un&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof It&&e._entityIndex===this._entityIndex)e._size!==0&&(this._graphs=$r(this._graphs,e._graphs),this._size=null);else for(const n of e)this.add(n);return this}contains(e){if(e instanceof Un&&(e=e.filtered),e===this)return!0;if(!(e instanceof It)||this._entityIndex!==e._entityIndex)return e.every(h=>this.has(h));const n=this._graphs,r=e._graphs;let o,a,l,u,f;for(const h in r){if(!(o=n[h]))return!1;o=o.subjects;for(const g in a=r[h].subjects){if(!(l=o[g]))return!1;for(const m in u=a[g]){if(!(f=l[m]))return!1;for(const d in u[m])if(!(d in f))return!1}}}return!0}deleteMatches(e,n,r,o){for(const a of this.match(e,n,r,o))this.removeQuad(a);return this}difference(e){if(e&&e instanceof Un&&(e=e.filtered),e===this)return new It({entityIndex:this._entityIndex});if(e instanceof It&&e._entityIndex===this._entityIndex){const n=new It({entityIndex:this._entityIndex}),r=Ef(this._graphs,e._graphs);return r&&(n._graphs=r,n._size=null),n}return this.filter(n=>!e.has(n))}equals(e){return e instanceof Un&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const n=new It({entityIndex:this._entityIndex});for(const r of this)e(r,this)&&n.add(r);return n}intersection(e){if(e instanceof Un&&(e=e.filtered),e===this){const n=new It({entityIndex:this._entityIndex});return n._graphs=$r(Object.create(null),this._graphs),n._size=this._size,n}else if(e instanceof It&&this._entityIndex===e._entityIndex){const n=new It({entityIndex:this._entityIndex}),r=xf(e._graphs,this._graphs);return r&&(n._graphs=r,n._size=null),n}return this.filter(n=>e.has(n))}map(e){const n=new It({entityIndex:this._entityIndex});for(const r of this)n.add(e(r,this));return n}reduce(e,n){const r=this.readQuads();let o=n===void 0?r.next().value:n;for(const a of r)o=e(o,a,this);return o}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return new kl().quadsToString(this)}union(e){const n=new It({entityIndex:this._entityIndex});return n._graphs=$r(Object.create(null),this._graphs),n._size=this._size,n.addAll(e),n}*[Symbol.iterator](){yield*this.readQuads()}}function yn(i,e,n=0){const r=e[n];if(r&&!(r in i))return!1;let o=!1;for(const a in r?{[r]:i[r]}:i){const l=n===2?null:yn(i[a],e,n+1);l!==!1&&(o=o||Object.create(null),o[a]=l)}return o}class Un extends Fl.Readable{constructor(e,n,r,o,a,l){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:n,predicate:r,object:o,graph:a,options:l})}get filtered(){if(!this._filtered){const{n3Store:e,graph:n,object:r,predicate:o,subject:a}=this,l=this._filtered=new It({factory:e._factory,entityIndex:this.options.entityIndex});let u,f,h;if(a&&!(u=l._termToNumericId(a))||o&&!(f=l._termToNumericId(o))||r&&!(h=l._termToNumericId(r)))return l;const g=e._getGraphs(n);for(const m in g){let d,_,v,I;(I=g[m])&&(!u&&f?(_=yn(I.predicates,[f,h,u]))&&(d=yn(I.subjects,[u,f,h]),v=yn(I.objects,[h,u,f])):h?(v=yn(I.objects,[h,u,f]))&&(d=yn(I.subjects,[u,f,h]),_=yn(I.predicates,[f,h,u])):(d=yn(I.subjects,[u,f,h]))&&(_=yn(I.predicates,[f,h,u]),v=yn(I.objects,[h,u,f])),d&&(l._graphs[m]={subjects:d,predicates:_,objects:v}))}l._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[la]&&(this[la]=this[Symbol.iterator]());const n=this[la];for(;--e>=0;){const{done:r,value:o}=n.next();if(r){this.push(null);return}this.push(o)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,n,r,o){return this.filtered.deleteMatches(e,n,r,o)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,n,r,o,a){return this.filtered.every(e,n,r,o,a)}filter(e){return this.filtered.filter(e)}forEach(e,n,r,o,a){return this.filtered.forEach(e,n,r,o,a)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,n,r,o,a){return this.filtered.some(e,n,r,o,a)}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,n){return this.filtered.reduce(e,n)}toString(){return new kl().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,n,r,o){return new Un(this.filtered,e,n,r,o,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}class Qg extends Fl.Transform{constructor(e){super({decodeStrings:!0}),this._readableState.objectMode=!0;const n=new hf(e);let r,o;const a={onQuad:(l,u)=>{l&&this.emit("error",l)||u&&this.push(u)},onPrefix:(l,u)=>{this.emit("prefix",l,u)}};e&&e.comments&&(a.onComment=l=>{this.emit("comment",l)}),n.parse({on:(l,u)=>{switch(l){case"data":r=u;break;case"end":o=u;break}}},a),this._transform=(l,u,f)=>{r(l),f()},this._flush=l=>{o(),l()}}import(e){return e.on("data",n=>{this.write(n)}),e.on("end",()=>{this.end()}),e.on("error",n=>{this.emit("error",n)}),this}}const Fe="http://www.w3.org/ns/shacl#",Bc="http://datashapes.org/dash#",Cn="http://www.w3.org/2001/XMLSchema#",yi="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Ks="http://www.w3.org/2000/01/rdf-schema#",jl="http://www.w3.org/2004/02/skos/core#",Jg="http://www.w3.org/2002/07/owl#",Kg="http://www.w3.org/ns/oa#",Bl="http://purl.org/dc/terms/",Yg="http://xmlns.com/foaf/0.1/",an=Be.namedNode("loaded-shapes"),Ct=Be.namedNode("loaded-data"),At=Be.namedNode(yi+"type"),Sf=Be.namedNode(yi+"langString"),Qr=Be.namedNode(Bl+"conformsTo"),$c=Be.namedNode(Ks+"subClassOf"),$l=Be.namedNode(Jg+"imports"),em=Be.namedNode(jl+"broader"),tm=Be.namedNode(jl+"narrower"),Rs=Be.namedNode(Fe+"NodeShape"),Tf=Be.namedNode(Fe+"IRI"),wl=Be.namedNode(Fe+"property"),ql=Be.namedNode(Fe+"class"),nm=Be.namedNode(Fe+"node"),Ys=Be.namedNode(Fe+"targetClass"),im=Be.namedNode(Fe+"nodeKind"),rm=Be.namedNode(Cn+"string"),sm=Be.namedNode(Cn+"boolean");function Hi(i,e,n=Fe,r){let o="";const a=om(i,e,n,r);return a&&(o=a.value),o}function om(i,e,n=Fe,r){let o;const a=n+e;if(r?.length){for(const l of r)for(const u of i)if(u.predicate.value===a){if(u.object.id.endsWith(`@${l}`))return u.object;u.object.id.indexOf("@")<0?o=u.object:o||(o=u.object)}}else for(const l of i)if(l.predicate.value===a)return l.object;return o}function am(i){i.querySelector(".editor")?.focus()}function Zn(i,e){return Hi(i,"prefLabel",jl,e)||Hi(i,"label",Ks,e)||Hi(i,"title",Bl,e)||Hi(i,"name",Yg,e)}function Lf(i,e,n){const r=[];for(const o of i)r.push({value:o,label:Zn(e.getQuads(o,null,null,null),n),children:[]});return r}function xl(i,e){for(const n in e){const r=e[n];i.startsWith(r)&&(i=i.slice(r.length))}return i}function If(i,e,n,r,o=new Set){for(const a of e.owlImports)o.has(a.id)||(o.add(a.id),r.push(...n.getSubjects(At,i,a)));e.parent&&If(i,e.parent,n,r,o)}function Af(i,e){if(e.in){const n=e.config.lists[e.in];return Lf(n?.length?n:[],e.config.store,e.config.languages)}else{const n=e.config.store.getSubjects(At,i,an);n.push(...e.config.store.getSubjects(At,i,Ct)),If(i,e,e.config.store,n);const r=new Map,o=new Map;for(const l of n)r.set(l.id,{value:l,label:Zn(e.config.store.getQuads(l,null,null,null),e.config.languages),children:[]});for(const l of n){for(const u of e.config.store.getObjects(l,em,null))r.has(u.id)&&o.set(l.id,u.id);for(const u of e.config.store.getObjects(l,tm,null))r.has(u.id)&&o.set(u.id,l.id);for(const u of e.config.store.getObjects(l,$c,null))r.has(u.id)&&o.set(l.id,u.id)}for(const[l,u]of o.entries())r.get(u)?.children?.push(r.get(l));const a=[];for(const[l,u]of r.entries())o.has(l)||a.push(u);for(const l of e.config.store.getSubjects($c,i,null))a.push(...Af(l,e));return a}}function El(i){let e;try{e=new URL(i)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function Bs(i,e,n){if(e===void 0)return n;if(n===void 0)return e;const r=i.indexOf(e.language);if(r<0)return n;const o=i.indexOf(n.language);return o<0||o>r?e:n}function lm(i){const e=new Set;for(const n of i.getObjects(null,ql,an))e.add(n.value);for(const n of i.getObjects(null,Ys,an))e.add(n.value);return e}function um(i,e){return i instanceof Set?[...e].filter(n=>!i.has(n)):[...e].filter(n=>!i.includes(n))}function cm(i,{remove:e=!1,ignoreErrors:n=!1}={}){const r={},o=n?(()=>!0):((u,f)=>{throw new Error(`${u.value} ${f}`)}),a=i.getQuads(null,yi+"rest",yi+"nil",null),l=e?[...a]:[];return a.forEach(u=>{const f=[];let h=!1,g,m;const d=u.graph;let _=u.subject;for(;_&&!h;){const v=i.getQuads(null,null,_,null),I=i.getQuads(_,null,null,null).filter(y=>!y.predicate.equals(At));let A,N=null,P=null,w=null;for(let y=0;y<I.length&&!h;y++)A=I[y],A.graph.equals(d)?g?h=o(_,"has non-list arcs out"):A.predicate.value===yi+"first"?N?h=o(_,"has multiple rdf:first arcs"):l.push(N=A):A.predicate.value===yi+"rest"?P?h=o(_,"has multiple rdf:rest arcs"):l.push(P=A):v.length?h=o(_,"can't be subject and object"):(g=A,m="subject"):h=o(_,"not confined to single graph");for(let y=0;y<v.length&&!h;++y)A=v[y],g?h=o(_,"can't have coreferences"):A.predicate.value===yi+"rest"?w?h=o(_,"has incoming rdf:rest arcs"):w=A:(g=A,m="object");N?f.unshift(N.object):h=o(_,"has no list head"),_=w&&w.subject}h?e=!1:g&&(r[g[m].value]=f)}),e&&i.removeQuads(l),r}var li={},ui={},ci={},An={},qc;function dm(){if(qc)return An;qc=1,Object.defineProperty(An,"__esModule",{value:!0}),An.removeDotSegmentsOfPath=An.removeDotSegments=An.resolve=void 0;function i(o,a){a=a||"";const l=a.indexOf("#");if(l>0&&(a=a.substr(0,l)),!o.length){if(a.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${a}' for value '${o}'`);return a}if(o.startsWith("?")){const _=a.indexOf("?");return _>0&&(a=a.substr(0,_)),a+o}if(o.startsWith("#"))return a+o;if(!a.length){const _=o.indexOf(":");if(_<0)throw new Error(`Found invalid relative IRI '${o}' for a missing baseIRI`);return n(o,_)}const u=o.indexOf(":");if(u>=0)return n(o,u);const f=a.indexOf(":");if(f<0)throw new Error(`Found invalid baseIRI '${a}' for value '${o}'`);const h=a.substr(0,f+1);if(o.indexOf("//")===0)return h+n(o,u);let g;if(a.indexOf("//",f)===f+1){if(g=a.indexOf("/",f+3),g<0)return a.length>f+3?a+"/"+n(o,u):h+n(o,u)}else if(g=a.indexOf("/",f+1),g<0)return h+n(o,u);if(o.indexOf("/")===0)return a.substr(0,g)+e(o);let m=a.substr(g);const d=m.lastIndexOf("/");return d>=0&&d<m.length-1&&(m=m.substr(0,d+1),o[0]==="."&&o[1]!=="."&&o[1]!=="/"&&o[2]&&(o=o.substr(1))),o=m+o,o=e(o),a.substr(0,g)+o}An.resolve=i;function e(o){const a=[];let l=0;for(;l<o.length;)switch(o[l]){case"/":if(o[l+1]===".")if(o[l+2]==="."){if(!r(o[l+3])){a.push([]),l++;break}a.pop(),o[l+3]||a.push([]),l+=3}else{if(!r(o[l+2])){a.push([]),l++;break}o[l+2]||a.push([]),l+=2}else a.push([]),l++;break;case"#":case"?":a.length||a.push([]),a[a.length-1].push(o.substr(l)),l=o.length;break;default:a.length||a.push([]),a[a.length-1].push(o[l]),l++;break}return"/"+a.map(u=>u.join("")).join("/")}An.removeDotSegments=e;function n(o,a){let l=a+1;a>=0?o[a+1]==="/"&&o[a+2]==="/"&&(l=a+3):o[0]==="/"&&o[1]==="/"&&(l=2);const u=o.indexOf("/",l);if(u<0)return o;const f=o.substr(0,u),h=o.substr(u);return f+e(h)}An.removeDotSegmentsOfPath=n;function r(o){return!o||o==="#"||o==="?"||o==="/"}return An}var zc;function hm(){return zc||(zc=1,(function(i){var e=ci&&ci.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a),Object.defineProperty(r,l,{enumerable:!0,get:function(){return o[a]}})}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),n=ci&&ci.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(i,"__esModule",{value:!0}),n(dm(),i)})(ci)),ci}var di={},ua={},Hc;function fm(){return Hc||(Hc=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.CHAR=`
|
|
23
23
|
\r --�𐀀-`,i.S=` \r
|
|
24
|
-
`,i.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",i.NAME_CHAR="-"+i.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",i.CHAR_RE=new RegExp("^["+i.CHAR+"]$","u"),i.S_RE=new RegExp("^["+i.S+"]+$","u"),i.NAME_START_CHAR_RE=new RegExp("^["+i.NAME_START_CHAR+"]$","u"),i.NAME_CHAR_RE=new RegExp("^["+i.NAME_CHAR+"]$","u"),i.NAME_RE=new RegExp("^["+i.NAME_START_CHAR+"]["+i.NAME_CHAR+"]*$","u"),i.NMTOKEN_RE=new RegExp("^["+i.NAME_CHAR+"]+$","u");var e=9,n=10,r=13,o=32;i.S_LIST=[o,n,r,e];function a(h){return h>=o&&h<=55295||h===n||h===r||h===e||h>=57344&&h<=65533||h>=65536&&h<=1114111}i.isChar=a;function l(h){return h===o||h===n||h===r||h===e}i.isS=l;function u(h){return h>=65&&h<=90||h>=97&&h<=122||h===58||h===95||h===8204||h===8205||h>=192&&h<=214||h>=216&&h<=246||h>=248&&h<=767||h>=880&&h<=893||h>=895&&h<=8191||h>=8304&&h<=8591||h>=11264&&h<=12271||h>=12289&&h<=55295||h>=63744&&h<=64975||h>=65008&&h<=65533||h>=65536&&h<=983039}i.isNameStartChar=u;function f(h){return u(h)||h>=48&&h<=57||h===45||h===46||h===183||h>=768&&h<=879||h>=8255&&h<=8256}i.isNameChar=f})(ua)),ua}var ca={},Uc;function
|
|
25
|
-
`,i.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",i.NAME_CHAR="-"+i.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",i.CHAR_RE=new RegExp("^["+i.CHAR+"]$","u"),i.RESTRICTED_CHAR_RE=new RegExp("^["+i.RESTRICTED_CHAR+"]$","u"),i.S_RE=new RegExp("^["+i.S+"]+$","u"),i.NAME_START_CHAR_RE=new RegExp("^["+i.NAME_START_CHAR+"]$","u"),i.NAME_CHAR_RE=new RegExp("^["+i.NAME_CHAR+"]$","u"),i.NAME_RE=new RegExp("^["+i.NAME_START_CHAR+"]["+i.NAME_CHAR+"]*$","u"),i.NMTOKEN_RE=new RegExp("^["+i.NAME_CHAR+"]+$","u");var e=9,n=10,r=13,o=32;i.S_LIST=[o,n,r,e];function a(
|
|
24
|
+
`,i.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",i.NAME_CHAR="-"+i.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",i.CHAR_RE=new RegExp("^["+i.CHAR+"]$","u"),i.S_RE=new RegExp("^["+i.S+"]+$","u"),i.NAME_START_CHAR_RE=new RegExp("^["+i.NAME_START_CHAR+"]$","u"),i.NAME_CHAR_RE=new RegExp("^["+i.NAME_CHAR+"]$","u"),i.NAME_RE=new RegExp("^["+i.NAME_START_CHAR+"]["+i.NAME_CHAR+"]*$","u"),i.NMTOKEN_RE=new RegExp("^["+i.NAME_CHAR+"]+$","u");var e=9,n=10,r=13,o=32;i.S_LIST=[o,n,r,e];function a(h){return h>=o&&h<=55295||h===n||h===r||h===e||h>=57344&&h<=65533||h>=65536&&h<=1114111}i.isChar=a;function l(h){return h===o||h===n||h===r||h===e}i.isS=l;function u(h){return h>=65&&h<=90||h>=97&&h<=122||h===58||h===95||h===8204||h===8205||h>=192&&h<=214||h>=216&&h<=246||h>=248&&h<=767||h>=880&&h<=893||h>=895&&h<=8191||h>=8304&&h<=8591||h>=11264&&h<=12271||h>=12289&&h<=55295||h>=63744&&h<=64975||h>=65008&&h<=65533||h>=65536&&h<=983039}i.isNameStartChar=u;function f(h){return u(h)||h>=48&&h<=57||h===45||h===46||h===183||h>=768&&h<=879||h>=8255&&h<=8256}i.isNameChar=f})(ua)),ua}var ca={},Uc;function pm(){return Uc||(Uc=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.CHAR="--�𐀀-",i.RESTRICTED_CHAR="-\b\v\f---",i.S=` \r
|
|
25
|
+
`,i.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",i.NAME_CHAR="-"+i.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",i.CHAR_RE=new RegExp("^["+i.CHAR+"]$","u"),i.RESTRICTED_CHAR_RE=new RegExp("^["+i.RESTRICTED_CHAR+"]$","u"),i.S_RE=new RegExp("^["+i.S+"]+$","u"),i.NAME_START_CHAR_RE=new RegExp("^["+i.NAME_START_CHAR+"]$","u"),i.NAME_CHAR_RE=new RegExp("^["+i.NAME_CHAR+"]$","u"),i.NAME_RE=new RegExp("^["+i.NAME_START_CHAR+"]["+i.NAME_CHAR+"]*$","u"),i.NMTOKEN_RE=new RegExp("^["+i.NAME_CHAR+"]+$","u");var e=9,n=10,r=13,o=32;i.S_LIST=[o,n,r,e];function a(m){return m>=1&&m<=55295||m>=57344&&m<=65533||m>=65536&&m<=1114111}i.isChar=a;function l(m){return m>=1&&m<=8||m===11||m===12||m>=14&&m<=31||m>=127&&m<=132||m>=134&&m<=159}i.isRestrictedChar=l;function u(m){return m===9||m===10||m===13||m>31&&m<127||m===133||m>159&&m<=55295||m>=57344&&m<=65533||m>=65536&&m<=1114111}i.isCharAndNotRestricted=u;function f(m){return m===o||m===n||m===r||m===e}i.isS=f;function h(m){return m>=65&&m<=90||m>=97&&m<=122||m===58||m===95||m===8204||m===8205||m>=192&&m<=214||m>=216&&m<=246||m>=248&&m<=767||m>=880&&m<=893||m>=895&&m<=8191||m>=8304&&m<=8591||m>=11264&&m<=12271||m>=12289&&m<=55295||m>=63744&&m<=64975||m>=65008&&m<=65533||m>=65536&&m<=983039}i.isNameStartChar=h;function g(m){return h(m)||m>=48&&m<=57||m===45||m===46||m===183||m>=768&&m<=879||m>=8255&&m<=8256}i.isNameChar=g})(ca)),ca}var da={},Vc;function gm(){return Vc||(Vc=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",i.NC_NAME_CHAR="-"+i.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",i.NC_NAME_START_CHAR_RE=new RegExp("^["+i.NC_NAME_START_CHAR+"]$","u"),i.NC_NAME_CHAR_RE=new RegExp("^["+i.NC_NAME_CHAR+"]$","u"),i.NC_NAME_RE=new RegExp("^["+i.NC_NAME_START_CHAR+"]["+i.NC_NAME_CHAR+"]*$","u");function e(r){return r>=65&&r<=90||r===95||r>=97&&r<=122||r>=192&&r<=214||r>=216&&r<=246||r>=248&&r<=767||r>=880&&r<=893||r>=895&&r<=8191||r>=8204&&r<=8205||r>=8304&&r<=8591||r>=11264&&r<=12271||r>=12289&&r<=55295||r>=63744&&r<=64975||r>=65008&&r<=65533||r>=65536&&r<=983039}i.isNCNameStartChar=e;function n(r){return e(r)||r===45||r===46||r>=48&&r<=57||r===183||r>=768&&r<=879||r>=8255&&r<=8256}i.isNCNameChar=n})(da)),da}var Wc;function mm(){if(Wc)return di;Wc=1,Object.defineProperty(di,"__esModule",{value:!0}),di.SaxesParser=di.EVENTS=void 0;const i=fm(),e=pm(),n=gm();var r=i.isS,o=i.isChar,a=i.isNameStartChar,l=i.isNameChar,u=i.S_LIST,f=i.NAME_RE,h=e.isChar,g=n.isNCNameStartChar,m=n.isNCNameChar,d=n.NC_NAME_RE;const _="http://www.w3.org/XML/1998/namespace",v="http://www.w3.org/2000/xmlns/",I={__proto__:null,xml:_,xmlns:v},A={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},N=-1,P=-2,w=0,y=1,S=2,O=3,X=4,C=5,U=6,R=7,$=8,G=9,j=10,F=11,se=12,M=13,re=14,B=15,oe=16,T=17,Q=18,ie=19,Y=20,me=21,Z=22,W=23,ee=24,K=25,ue=26,ce=27,Ee=28,Te=29,q=30,te=31,fe=32,xe=33,Se=34,Ie=35,le=36,ve=37,Ae=38,be=39,qe=40,mt=41,$e=42,ft=43,k=44,b=9,x=10,H=13,ae=32,_e=33,we=34,Oe=38,Ye=39,Qe=45,Ge=47,Ze=59,$t=60,en=61,st=62,at=63,Ai=91,hn=93,Fn=133,ei=8232,z=it=>it===we||it===Ye,J=[we,Ye],Ne=[...J,Ai,st],Re=[...J,$t,hn],De=[en,at,...u],_t=[...u,st,Oe,$t];function wt(it,V,de){switch(V){case"xml":de!==_&&it.fail(`xml prefix must be bound to ${_}.`);break;case"xmlns":de!==v&&it.fail(`xmlns prefix must be bound to ${v}.`);break}switch(de){case v:it.fail(V===""?`the default namespace may not be set to ${de}.`:`may not assign a prefix (even "xmlns") to the URI ${v}.`);break;case _:switch(V){case"xml":break;case"":it.fail(`the default namespace may not be set to ${de}.`);break;default:it.fail("may not assign the xml namespace to another prefix.")}break}}function Nt(it,V){for(const de of Object.keys(V))wt(it,de,V[de])}const ke=it=>d.test(it),ti=it=>f.test(it),Wt=0,jn=1,En=2;di.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];const fn={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class Bn{get closed(){return this._closed}constructor(V){this.opt=V??{},this.fragmentOpt=!!this.opt.fragment;const de=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,de){this.nameStartCheck=g,this.nameCheck=m,this.isName=ke,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},I);const pe=this.opt.additionalNamespaces;pe!=null&&(Nt(this,pe),Object.assign(this.ns,pe))}else this.nameStartCheck=a,this.nameCheck=l,this.isName=ti,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}_init(){var V;this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=Wt,this.attribList=[];const{fragmentOpt:de}=this;this.state=de?M:w,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=de,this.xmlDeclPossible=!de,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:pe}=this.opt;if(pe===void 0){if(this.opt.forceXMLVersion===!0)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");pe="1.0"}this.setXMLVersion(pe),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(A),(V=this.readyHandler)===null||V===void 0||V.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(V,de){this[fn[V]]=de}off(V){this[fn[V]]=void 0}makeError(V){var de;let pe=(de=this.fileName)!==null&&de!==void 0?de:"";return this.trackPosition&&(pe.length>0&&(pe+=":"),pe+=`${this.line}:${this.column}`),pe.length>0&&(pe+=": "),new Error(pe+V)}fail(V){const de=this.makeError(V),pe=this.errorHandler;if(pe===void 0)throw de;return pe(de),this}write(V){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let de=!1;V===null?(de=!0,V=""):typeof V=="object"&&(V=V.toString()),this.carriedFromPrevious!==void 0&&(V=`${this.carriedFromPrevious}${V}`,this.carriedFromPrevious=void 0);let pe=V.length;const Pe=V.charCodeAt(pe-1);!de&&(Pe===H||Pe>=55296&&Pe<=56319)&&(this.carriedFromPrevious=V[pe-1],pe--,V=V.slice(0,pe));const{stateTable:Ue}=this;for(this.chunk=V,this.i=0;this.i<pe;)Ue[this.state].call(this);return this.chunkPosition+=pe,de?this.end():this}close(){return this.write(null)}getCode10(){const{chunk:V,i:de}=this;if(this.prevI=de,this.i=de+1,de>=V.length)return N;const pe=V.charCodeAt(de);if(this.column++,pe<55296){if(pe>=ae||pe===b)return pe;switch(pe){case x:return this.line++,this.column=0,this.positionAtNewLine=this.position,x;case H:return V.charCodeAt(de+1)===x&&(this.i=de+2),this.line++,this.column=0,this.positionAtNewLine=this.position,P;default:return this.fail("disallowed character."),pe}}if(pe>56319)return pe>=57344&&pe<=65533||this.fail("disallowed character."),pe;const Pe=65536+(pe-55296)*1024+(V.charCodeAt(de+1)-56320);return this.i=de+2,Pe>1114111&&this.fail("disallowed character."),Pe}getCode11(){const{chunk:V,i:de}=this;if(this.prevI=de,this.i=de+1,de>=V.length)return N;const pe=V.charCodeAt(de);if(this.column++,pe<55296){if(pe>31&&pe<127||pe>159&&pe!==ei||pe===b)return pe;switch(pe){case x:return this.line++,this.column=0,this.positionAtNewLine=this.position,x;case H:{const Ue=V.charCodeAt(de+1);(Ue===x||Ue===Fn)&&(this.i=de+2)}case Fn:case ei:return this.line++,this.column=0,this.positionAtNewLine=this.position,P;default:return this.fail("disallowed character."),pe}}if(pe>56319)return pe>=57344&&pe<=65533||this.fail("disallowed character."),pe;const Pe=65536+(pe-55296)*1024+(V.charCodeAt(de+1)-56320);return this.i=de+2,Pe>1114111&&this.fail("disallowed character."),Pe}getCodeNorm(){const V=this.getCode();return V===P?x:V}unget(){this.i=this.prevI,this.column--}captureTo(V){let{i:de}=this;const{chunk:pe}=this;for(;;){const Pe=this.getCode(),Ue=Pe===P,Je=Ue?x:Pe;if(Je===N||V.includes(Je))return this.text+=pe.slice(de,this.prevI),Je;Ue&&(this.text+=`${pe.slice(de,this.prevI)}
|
|
26
26
|
`,de=this.i)}}captureToChar(V){let{i:de}=this;const{chunk:pe}=this;for(;;){let Pe=this.getCode();switch(Pe){case P:this.text+=`${pe.slice(de,this.prevI)}
|
|
27
27
|
`,de=this.i,Pe=x;break;case N:return this.text+=pe.slice(de),!1}if(Pe===V)return this.text+=pe.slice(de,this.prevI),!0}}captureNameChars(){const{chunk:V,i:de}=this;for(;;){const pe=this.getCode();if(pe===N)return this.name+=V.slice(de),N;if(!l(pe))return this.name+=V.slice(de,this.prevI),pe===P?x:pe}}skipSpaces(){for(;;){const V=this.getCodeNorm();if(V===N||!r(V))return V}}setXMLVersion(V){this.currentXMLVersion=V,V==="1.0"?(this.isChar=o,this.getCode=this.getCode10):(this.isChar=h,this.getCode=this.getCode11)}sBegin(){this.chunk.charCodeAt(0)===65279&&(this.i++,this.column++),this.state=y}sBeginWhitespace(){const V=this.i,de=this.skipSpaces();switch(this.prevI!==V&&(this.xmlDeclPossible=!1),de){case $t:if(this.state=B,this.text.length!==0)throw new Error("no-empty text at start");break;case N:break;default:this.unget(),this.state=M,this.xmlDeclPossible=!1}}sDoctype(){var V;const de=this.captureTo(Ne);switch(de){case st:{(V=this.doctypeHandler)===null||V===void 0||V.call(this,this.text),this.text="",this.state=M,this.doctype=!0;break}case N:break;default:this.text+=String.fromCodePoint(de),de===Ai?this.state=X:z(de)&&(this.state=O,this.q=de)}}sDoctypeQuote(){const V=this.q;this.captureToChar(V)&&(this.text+=String.fromCodePoint(V),this.q=null,this.state=S)}sDTD(){const V=this.captureTo(Re);V!==N&&(this.text+=String.fromCodePoint(V),V===hn?this.state=S:V===$t?this.state=U:z(V)&&(this.state=C,this.q=V))}sDTDQuoted(){const V=this.q;this.captureToChar(V)&&(this.text+=String.fromCodePoint(V),this.state=X,this.q=null)}sDTDOpenWaka(){const V=this.getCodeNorm();switch(this.text+=String.fromCodePoint(V),V){case _e:this.state=R,this.openWakaBang="";break;case at:this.state=F;break;default:this.state=X}}sDTDOpenWakaBang(){const V=String.fromCodePoint(this.getCodeNorm()),de=this.openWakaBang+=V;this.text+=V,de!=="-"&&(this.state=de==="--"?$:X,this.openWakaBang="")}sDTDComment(){this.captureToChar(Qe)&&(this.text+="-",this.state=G)}sDTDCommentEnding(){const V=this.getCodeNorm();this.text+=String.fromCodePoint(V),this.state=V===Qe?j:$}sDTDCommentEnded(){const V=this.getCodeNorm();this.text+=String.fromCodePoint(V),V===st?this.state=X:(this.fail("malformed comment."),this.state=$)}sDTDPI(){this.captureToChar(at)&&(this.text+="?",this.state=se)}sDTDPIEnding(){const V=this.getCodeNorm();this.text+=String.fromCodePoint(V),V===st&&(this.state=X)}sText(){this.tags.length!==0?this.handleTextInRoot():this.handleTextOutsideRoot()}sEntity(){let{i:V}=this;const{chunk:de}=this;e:for(;;)switch(this.getCode()){case P:this.entity+=`${de.slice(V,this.prevI)}
|
|
28
28
|
`,V=this.i;break;case Ze:{const{entityReturnState:pe}=this,Pe=this.entity+de.slice(V,this.prevI);this.state=pe;let Ue;Pe===""?(this.fail("empty entity name."),Ue="&;"):(Ue=this.parseEntity(Pe),this.entity=""),(pe!==M||this.textHandler!==void 0)&&(this.text+=Ue);break e}case N:this.entity+=de.slice(V);break e}}sOpenWaka(){const V=this.getCode();if(a(V))this.state=Se,this.unget(),this.xmlDeclPossible=!1;else switch(V){case Ge:this.state=ft,this.xmlDeclPossible=!1;break;case _e:this.state=oe,this.openWakaBang="",this.xmlDeclPossible=!1;break;case at:this.state=W;break;default:this.fail("disallowed character in tag name"),this.state=M,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0),this.state=Y,this.openWakaBang="";break;case"--":this.state=T,this.openWakaBang="";break;case"DOCTYPE":this.state=S,(this.doctype||this.sawRoot)&&this.fail("inappropriately located doctype declaration."),this.openWakaBang="";break;default:this.openWakaBang.length>=7&&this.fail("incorrect syntax.")}}sComment(){this.captureToChar(Qe)&&(this.state=Q)}sCommentEnding(){var V;const de=this.getCodeNorm();de===Qe?(this.state=ie,(V=this.commentHandler)===null||V===void 0||V.call(this,this.text),this.text=""):(this.text+=`-${String.fromCodePoint(de)}`,this.state=T)}sCommentEnded(){const V=this.getCodeNorm();V!==st?(this.fail("malformed comment."),this.text+=`--${String.fromCodePoint(V)}`,this.state=T):this.state=M}sCData(){this.captureToChar(hn)&&(this.state=me)}sCDataEnding(){const V=this.getCodeNorm();V===hn?this.state=Z:(this.text+=`]${String.fromCodePoint(V)}`,this.state=Y)}sCDataEnding2(){var V;const de=this.getCodeNorm();switch(de){case st:{(V=this.cdataHandler)===null||V===void 0||V.call(this,this.text),this.text="",this.state=M;break}case hn:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(de)}`,this.state=Y}}sPIFirstChar(){const V=this.getCodeNorm();this.nameStartCheck(V)?(this.piTarget+=String.fromCodePoint(V),this.state=ee):V===at||r(V)?(this.fail("processing instruction without a target."),this.state=V===at?ue:K):(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(V),this.state=ee)}sPIRest(){const{chunk:V,i:de}=this;for(;;){const pe=this.getCodeNorm();if(pe===N){this.piTarget+=V.slice(de);return}if(!this.nameCheck(pe)){this.piTarget+=V.slice(de,this.prevI);const Pe=pe===at;Pe||r(pe)?this.piTarget==="xml"?(this.xmlDeclPossible||this.fail("an XML declaration must be at the start of the document."),this.state=Pe?xe:ce):this.state=Pe?ue:K:(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(pe));break}}}sPIBody(){if(this.text.length===0){const V=this.getCodeNorm();V===at?this.state=ue:r(V)||(this.text=String.fromCodePoint(V))}else this.captureToChar(at)&&(this.state=ue)}sPIEnding(){var V;const de=this.getCodeNorm();if(de===st){const{piTarget:pe}=this;pe.toLowerCase()==="xml"&&this.fail("the XML declaration must appear at the start of the document."),(V=this.piHandler)===null||V===void 0||V.call(this,{target:pe,body:this.text}),this.piTarget=this.text="",this.state=M}else de===at?this.text+="?":(this.text+=`?${String.fromCodePoint(de)}`,this.state=K);this.xmlDeclPossible=!1}sXMLDeclNameStart(){const V=this.skipSpaces();if(V===at){this.state=xe;return}V!==N&&(this.state=Ee,this.name=String.fromCodePoint(V))}sXMLDeclName(){const V=this.captureTo(De);if(V===at){this.state=xe,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(r(V)||V===en){if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=V===en?q:Te}}sXMLDeclEq(){const V=this.getCodeNorm();if(V===at){this.state=xe,this.fail("XML declaration is incomplete.");return}r(V)||(V!==en&&this.fail("value required."),this.state=q)}sXMLDeclValueStart(){const V=this.getCodeNorm();if(V===at){this.state=xe,this.fail("XML declaration is incomplete.");return}r(V)||(z(V)?this.q=V:(this.fail("value must be quoted."),this.q=ae),this.state=te)}sXMLDeclValue(){const V=this.captureTo([this.q,at]);if(V===at){this.state=xe,this.text="",this.fail("XML declaration is incomplete.");return}if(V===N)return;const de=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];const pe=de;this.xmlDecl.version=pe,/^1\.[0-9]+$/.test(pe)?this.opt.forceXMLVersion||this.setXMLVersion(pe):this.fail("version number must match /^1\\.[0-9]+$/.");break}case"encoding":/^[A-Za-z][A-Za-z0-9._-]*$/.test(de)||this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."),this.xmlDeclExpects=["standalone"],this.xmlDecl.encoding=de;break;case"standalone":de!=="yes"&&de!=="no"&&this.fail('standalone value must match "yes" or "no".'),this.xmlDeclExpects=[],this.xmlDecl.standalone=de;break}this.name="",this.state=fe}sXMLDeclSeparator(){const V=this.getCodeNorm();if(V===at){this.state=xe;return}r(V)||(this.fail("whitespace required."),this.unget()),this.state=ce}sXMLDeclEnding(){var V;this.getCodeNorm()===st?(this.piTarget!=="xml"?this.fail("processing instructions are not allowed before root."):this.name!=="version"&&this.xmlDeclExpects.includes("version")&&this.fail("XML declaration must contain a version."),(V=this.xmldeclHandler)===null||V===void 0||V.call(this,this.xmlDecl),this.name="",this.piTarget=this.text="",this.state=M):this.fail("The character ? is disallowed anywhere in XML declarations."),this.xmlDeclPossible=!1}sOpenTag(){var V;const de=this.captureNameChars();if(de===N)return;const pe=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name="",this.xmlnsOpt&&(this.topNS=pe.ns=Object.create(null)),(V=this.openTagStartHandler)===null||V===void 0||V.call(this,pe),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail("documents may contain only one root."),de){case st:this.openTag();break;case Ge:this.state=Ie;break;default:r(de)||this.fail("disallowed character in tag name."),this.state=le}}sOpenTagSlash(){this.getCode()===st?this.openSelfClosingTag():(this.fail("forward-slash in opening tag not followed by >."),this.state=le)}sAttrib(){const V=this.skipSpaces();V!==N&&(a(V)?(this.unget(),this.state=ve):V===st?this.openTag():V===Ge?this.state=Ie:this.fail("disallowed character in attribute name."))}sAttribName(){const V=this.captureNameChars();V===en?this.state=be:r(V)?this.state=Ae:V===st?(this.fail("attribute without value."),this.pushAttrib(this.name,this.name),this.name=this.text="",this.openTag()):V!==N&&this.fail("disallowed character in attribute name.")}sAttribNameSawWhite(){const V=this.skipSpaces();switch(V){case N:return;case en:this.state=be;break;default:this.fail("attribute without value."),this.text="",this.name="",V===st?this.openTag():a(V)?(this.unget(),this.state=ve):(this.fail("disallowed character in attribute name."),this.state=le)}}sAttribValue(){const V=this.getCodeNorm();z(V)?(this.q=V,this.state=qe):r(V)||(this.fail("unquoted attribute value."),this.state=$e,this.unget())}sAttribValueQuoted(){const{q:V,chunk:de}=this;let{i:pe}=this;for(;;)switch(this.getCode()){case V:this.pushAttrib(this.name,this.text+de.slice(pe,this.prevI)),this.name=this.text="",this.q=null,this.state=mt;return;case Oe:this.text+=de.slice(pe,this.prevI),this.state=re,this.entityReturnState=qe;return;case x:case P:case b:this.text+=`${de.slice(pe,this.prevI)} `,pe=this.i;break;case $t:this.text+=de.slice(pe,this.prevI),this.fail("disallowed character.");return;case N:this.text+=de.slice(pe);return}}sAttribValueClosed(){const V=this.getCodeNorm();r(V)?this.state=le:V===st?this.openTag():V===Ge?this.state=Ie:a(V)?(this.fail("no whitespace between attributes."),this.unget(),this.state=ve):this.fail("disallowed character in attribute name.")}sAttribValueUnquoted(){const V=this.captureTo(_t);switch(V){case Oe:this.state=re,this.entityReturnState=$e;break;case $t:this.fail("disallowed character.");break;case N:break;default:this.text.includes("]]>")&&this.fail('the string "]]>" is disallowed in char data.'),this.pushAttrib(this.name,this.text),this.name=this.text="",V===st?this.openTag():this.state=le}}sCloseTag(){const V=this.captureNameChars();V===st?this.closeTag():r(V)?this.state=k:V!==N&&this.fail("disallowed character in closing tag.")}sCloseTagSawWhite(){switch(this.skipSpaces()){case st:this.closeTag();break;case N:break;default:this.fail("disallowed character in closing tag.")}}handleTextInRoot(){let{i:V,forbiddenState:de}=this;const{chunk:pe,textHandler:Pe}=this;e:for(;;)switch(this.getCode()){case $t:{if(this.state=B,Pe!==void 0){const{text:Ue}=this,Je=pe.slice(V,this.prevI);Ue.length!==0?(Pe(Ue+Je),this.text=""):Je.length!==0&&Pe(Je)}de=Wt;break e}case Oe:this.state=re,this.entityReturnState=M,Pe!==void 0&&(this.text+=pe.slice(V,this.prevI)),de=Wt;break e;case hn:switch(de){case Wt:de=jn;break;case jn:de=En;break;case En:break;default:throw new Error("impossible state")}break;case st:de===En&&this.fail('the string "]]>" is disallowed in char data.'),de=Wt;break;case P:Pe!==void 0&&(this.text+=`${pe.slice(V,this.prevI)}
|
|
29
29
|
`),V=this.i,de=Wt;break;case N:Pe!==void 0&&(this.text+=pe.slice(V));break e;default:de=Wt}this.forbiddenState=de}handleTextOutsideRoot(){let{i:V}=this;const{chunk:de,textHandler:pe}=this;let Pe=!1;e:for(;;){const Ue=this.getCode();switch(Ue){case $t:{if(this.state=B,pe!==void 0){const{text:Je}=this,xt=de.slice(V,this.prevI);Je.length!==0?(pe(Je+xt),this.text=""):xt.length!==0&&pe(xt)}break e}case Oe:this.state=re,this.entityReturnState=M,pe!==void 0&&(this.text+=de.slice(V,this.prevI)),Pe=!0;break e;case P:pe!==void 0&&(this.text+=`${de.slice(V,this.prevI)}
|
|
30
|
-
`),V=this.i;break;case N:pe!==void 0&&(this.text+=de.slice(V));break e;default:r(Ue)||(Pe=!0)}}Pe&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(V,de){var pe;const{prefix:Pe,local:Ue}=this.qname(V),Je={name:V,prefix:Pe,local:Ue,value:de};if(this.attribList.push(Je),(pe=this.attributeHandler)===null||pe===void 0||pe.call(this,Je),Pe==="xmlns"){const xt=de.trim();this.currentXMLVersion==="1.0"&&xt===""&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[Ue]=xt,wt(this,Ue,xt)}else if(V==="xmlns"){const xt=de.trim();this.topNS[""]=xt,wt(this,"",xt)}}pushAttribPlain(V,de){var pe;const Pe={name:V,value:de};this.attribList.push(Pe),(pe=this.attributeHandler)===null||pe===void 0||pe.call(this,Pe)}end(){var V,de;this.sawRoot||this.fail("document must contain a root element.");const{tags:pe}=this;for(;pe.length>0;){const Ue=pe.pop();this.fail(`unclosed tag: ${Ue.name}`)}this.state!==v&&this.state!==M&&this.fail("unexpected end.");const{text:Pe}=this;return Pe.length!==0&&((V=this.textHandler)===null||V===void 0||V.call(this,Pe),this.text=""),this._closed=!0,(de=this.endHandler)===null||de===void 0||de.call(this),this._init(),this}resolve(V){var de,pe;let Pe=this.topNS[V];if(Pe!==void 0)return Pe;const{tags:Ue}=this;for(let Je=Ue.length-1;Je>=0;Je--)if(Pe=Ue[Je].ns[V],Pe!==void 0)return Pe;return Pe=this.ns[V],Pe!==void 0?Pe:(pe=(de=this.opt).resolvePrefix)===null||pe===void 0?void 0:pe.call(de,V)}qname(V){const de=V.indexOf(":");if(de===-1)return{prefix:"",local:V};const pe=V.slice(de+1),Pe=V.slice(0,de);return(Pe===""||pe===""||pe.includes(":"))&&this.fail(`malformed name: ${V}.`),{prefix:Pe,local:pe}}processAttribsNS(){var V;const{attribList:de}=this,pe=this.tag;{const{prefix:Je,local:xt}=this.qname(pe.name);pe.prefix=Je,pe.local=xt;const tn=pe.uri=(V=this.resolve(Je))!==null&&V!==void 0?V:"";Je!==""&&(Je==="xmlns"&&this.fail('tags may not have "xmlns" as prefix.'),tn===""&&(this.fail(`unbound namespace prefix: ${JSON.stringify(Je)}.`),pe.uri=Je))}if(de.length===0)return;const{attributes:Pe}=pe,Ue=new Set;for(const Je of de){const{name:xt,prefix:tn,local:ao}=Je;let $n,ni;tn===""?($n=xt==="xmlns"?w:"",ni=xt):($n=this.resolve(tn),$n===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(tn)}.`),$n=tn),ni=`{${$n}}${ao}`),Ue.has(ni)&&this.fail(`duplicate attribute: ${ni}.`),Ue.add(ni),Je.uri=$n,Pe[xt]=Je}this.attribList=[]}processAttribsPlain(){const{attribList:V}=this,de=this.tag.attributes;for(const{name:pe,value:Pe}of V)de[pe]!==void 0&&this.fail(`duplicate attribute: ${pe}.`),de[pe]=Pe;this.attribList=[]}openTag(){var V;this.processAttribs();const{tags:de}=this,pe=this.tag;pe.isSelfClosing=!1,(V=this.openTagHandler)===null||V===void 0||V.call(this,pe),de.push(pe),this.state=M,this.name=""}openSelfClosingTag(){var V,de,pe;this.processAttribs();const{tags:Pe}=this,Ue=this.tag;Ue.isSelfClosing=!0,(V=this.openTagHandler)===null||V===void 0||V.call(this,Ue),(de=this.closeTagHandler)===null||de===void 0||de.call(this,Ue),(this.tag=(pe=Pe[Pe.length-1])!==null&&pe!==void 0?pe:null)===null&&(this.closedRoot=!0),this.state=M,this.name=""}closeTag(){const{tags:V,name:de}=this;if(this.state=M,this.name="",de===""){this.fail("weird empty close tag."),this.text+="</>";return}const pe=this.closeTagHandler;let Pe=V.length;for(;Pe-- >0;){const Ue=this.tag=V.pop();if(this.topNS=Ue.ns,pe?.(Ue),Ue.name===de)break;this.fail("unexpected close tag.")}Pe===0?this.closedRoot=!0:Pe<0&&(this.fail(`unmatched closing tag: ${de}.`),this.text+=`</${de}>`)}parseEntity(V){if(V[0]!=="#"){const pe=this.ENTITIES[V];return pe!==void 0?pe:(this.fail(this.isName(V)?"undefined entity.":"disallowed character in entity name."),`&${V};`)}let de=NaN;return V[1]==="x"&&/^#x[0-9a-f]+$/i.test(V)?de=parseInt(V.slice(2),16):/^#[0-9]+$/.test(V)&&(de=parseInt(V.slice(1),10)),this.isChar(de)?String.fromCodePoint(de):(this.fail("malformed character entity."),`&${V};`)}}return di.SaxesParser=Bn,di}var br={},Gc;function mm(){if(Gc)return br;Gc=1,Object.defineProperty(br,"__esModule",{value:!0}),br.ParseError=void 0;let i=class extends Error{constructor(n,r){const o=n.saxParser;super(n.trackPosition?`Line ${o.line} column ${o.column+1}: ${r}`:r)}};return br.ParseError=i,br}var hi={},vr={},Zc;function Nf(){if(Zc)return vr;Zc=1,Object.defineProperty(vr,"__esModule",{value:!0}),vr.BlankNode=void 0;class i{constructor(n){this.termType="BlankNode",this.value=n}equals(n){return!!n&&n.termType==="BlankNode"&&n.value===this.value}}return vr.BlankNode=i,vr}var wr={},xr={},Xc;function Rf(){if(Xc)return xr;Xc=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.DefaultGraph=void 0;class i{constructor(){this.termType="DefaultGraph",this.value=""}equals(n){return!!n&&n.termType==="DefaultGraph"}}return xr.DefaultGraph=i,i.INSTANCE=new i,xr}var Er={},Sr={},Qc;function zl(){if(Qc)return Sr;Qc=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.NamedNode=void 0;class i{constructor(n){this.termType="NamedNode",this.value=n}equals(n){return!!n&&n.termType==="NamedNode"&&n.value===this.value}}return Sr.NamedNode=i,Sr}var Jc;function Cf(){if(Jc)return Er;Jc=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.Literal=void 0;const i=zl();class e{constructor(r,o){this.termType="Literal",this.value=r,typeof o=="string"?(this.language=o,this.datatype=e.RDF_LANGUAGE_STRING,this.direction=""):o?"termType"in o?(this.language="",this.datatype=o,this.direction=""):(this.language=o.language,this.datatype=o.direction?e.RDF_DIRECTIONAL_LANGUAGE_STRING:e.RDF_LANGUAGE_STRING,this.direction=o.direction||""):(this.language="",this.datatype=e.XSD_STRING,this.direction="")}equals(r){return!!r&&r.termType==="Literal"&&r.value===this.value&&r.language===this.language&&(r.direction===this.direction||!r.direction&&this.direction==="")&&this.datatype.equals(r.datatype)}}return Er.Literal=e,e.RDF_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),e.RDF_DIRECTIONAL_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),e.XSD_STRING=new i.NamedNode("http://www.w3.org/2001/XMLSchema#string"),Er}var Tr={},Kc;function Pf(){if(Kc)return Tr;Kc=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.Quad=void 0;class i{constructor(n,r,o,a){this.termType="Quad",this.value="",this.subject=n,this.predicate=r,this.object=o,this.graph=a}equals(n){return!!n&&(n.termType==="Quad"||!n.termType)&&this.subject.equals(n.subject)&&this.predicate.equals(n.predicate)&&this.object.equals(n.object)&&this.graph.equals(n.graph)}}return Tr.Quad=i,Tr}var Lr={},Yc;function kf(){if(Yc)return Lr;Yc=1,Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.Variable=void 0;class i{constructor(n){this.termType="Variable",this.value=n}equals(n){return!!n&&n.termType==="Variable"&&n.value===this.value}}return Lr.Variable=i,Lr}var ed;function _m(){if(ed)return wr;ed=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.DataFactory=void 0;const i=Nf(),e=Rf(),n=Cf(),r=zl(),o=Pf(),a=kf();let l=0;class u{constructor(h){this.blankNodeCounter=0,h=h||{},this.blankNodePrefix=h.blankNodePrefix||`df_${l++}_`}namedNode(h){return new r.NamedNode(h)}blankNode(h){return new i.BlankNode(h||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(h,g){return new n.Literal(h,g)}variable(h){return new a.Variable(h)}defaultGraph(){return e.DefaultGraph.INSTANCE}quad(h,g,_,d){return new o.Quad(h,g,_,d||this.defaultGraph())}fromTerm(h){switch(h.termType){case"NamedNode":return this.namedNode(h.value);case"BlankNode":return this.blankNode(h.value);case"Literal":return h.language?this.literal(h.value,h.language):h.datatype.equals(n.Literal.XSD_STRING)?this.literal(h.value):this.literal(h.value,this.fromTerm(h.datatype));case"Variable":return this.variable(h.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(h.subject),this.fromTerm(h.predicate),this.fromTerm(h.object),this.fromTerm(h.graph))}}fromQuad(h){return this.fromTerm(h)}resetBlankNodeCounter(){this.blankNodeCounter=0}}return wr.DataFactory=u,wr}var td;function Df(){return td||(td=1,(function(i){var e=hi&&hi.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,l,u)}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),n=hi&&hi.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(i,"__esModule",{value:!0}),n(Nf(),i),n(_m(),i),n(Rf(),i),n(Cf(),i),n(zl(),i),n(Pf(),i),n(kf(),i)})(hi)),hi}var fi={},ha={},nd;function ym(){return nd||(nd=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.validateIri=i.IriValidationStrategy=void 0;function e(){const u="[!$&'()*+,;=]",f="%[a-fA-F0-9]{2}",h="([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",g=`${h}\\.${h}\\.${h}\\.${h}`,_="[a-fA-F0-9]{1,4}",d=`(${_}:${_}|${g})`,m=`((${_}:){6}${d}|::(${_}:){5}${d}|(${_})?::(${_}:){4}${d}|((${_}:){0,1}${_})?::(${_}:){3}${d}|((${_}:){0,2}${_})?::(${_}:){2}${d}|((${_}:){0,3}${_})?::${_}:${d}|((${_}:){0,4}${_})?::${d}|((${_}:){0,5}${_})?::${_}|((${_}:){0,6}${_})?::)`,w=`v[a-fA-F0-9]+\\.(${u}|${u}|":)+`,I=`\\[(${m}|${w})\\]`,A="[0-9]*",N="[a-zA-Z][a-zA-Z0-9+\\-.]*",v="[---]",O="[a-zA-Z0-9\\-._~ -豈-﷏ﷰ-𐀀-𠀀-𰀀------------]",X=`(${O}|${f}|${u}|[:@])*`,C=`(${X}|[\\/?])*`,U=`(${X}|${v}|[\\/?])*`,R=`(${X})+`,$=`(${X})*`,G="",j=`${R}(\\/${$})*`,F=`\\/(${R}(\\/${$})*)?`,se=`(\\/${$})*`,M=`(${O}|${f}|${u})*`,re=`(${I}|${g}|${M})`,T=`(\\/\\/${`(${`(${O}|${f}|${u}|:)*`}@)?${re}(:${A})?`}${se}|${F}|${j}|${G})`,Q=`^${N}:${T}(\\?${U})?(#${C})?$`;return new RegExp(Q,"u")}const n=e(),r=/^[A-Za-z][\d+-.A-Za-z]*:[^\u0000-\u0020"<>\\^`{|}]*$/u;var o;(function(l){l.Strict="strict",l.Pragmatic="pragmatic",l.None="none"})(o=i.IriValidationStrategy||(i.IriValidationStrategy={}));function a(l,u=o.Strict){switch(u){case o.Strict:return n.test(l)?void 0:new Error(`Invalid IRI according to RFC 3987: '${l}'`);case o.Pragmatic:return r.test(l)?void 0:new Error(`Invalid IRI according to RDF Turtle: '${l}'`);case o.None:return;default:return new Error(`Not supported validation strategy "${u}"`)}}i.validateIri=a})(ha)),ha}var id;function bm(){return id||(id=1,(function(i){var e=fi&&fi.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,l,u)}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),n=fi&&fi.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(i,"__esModule",{value:!0}),n(ym(),i)})(fi)),fi}var rd;function vm(){if(rd)return ui;rd=1,Object.defineProperty(ui,"__esModule",{value:!0}),ui.ParseType=ui.RdfXmlParser=void 0;const i=dm(),e=gm(),n=wf(),r=mm(),o=Df(),a=bm();let l=class et extends n.Transform{constructor(h){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},h&&(Object.assign(this,h),this.options=h),this.dataFactory||(this.dataFactory=new o.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.validateUri!==!1&&(this.validateUri=!0),this.iriValidationStrategy||(this.iriValidationStrategy=this.validateUri?a.IriValidationStrategy.Pragmatic:a.IriValidationStrategy.None),this.parseUnsupportedVersions=!!h?.parseUnsupportedVersions,this.version=h?.version,this.saxParser=new e.SaxesParser({xmlns:!0,position:this.trackPosition}),this.attachSaxListeners()}import(h){const g=new n.PassThrough({readableObjectMode:!0});h.on("error",d=>_.emit("error",d)),h.on("data",d=>g.push(d)),h.on("end",()=>g.push(null));const _=g.pipe(new et(this.options));return _}_transform(h,g,_){if(this.version){const d=this.version;if(this.version=void 0,!this.isValidVersion(d))return _(this.newParseError(`Detected unsupported version as media type parameter: ${d}`))}try{this.saxParser.write(h)}catch(d){return _(d)}_()}newParseError(h){return new r.ParseError(this,h)}valueToUri(h,g){return this.uriToNamedNode((0,i.resolve)(h,g.baseIRI))}uriToNamedNode(h){const g=(0,a.validateIri)(h,this.iriValidationStrategy);if(g instanceof Error)throw this.newParseError(g.message);return this.dataFactory.namedNode(h)}validateNcname(h){if(!et.NCNAME_MATCHER.test(h))throw this.newParseError(`Not a valid NCName: ${h}`)}createLiteral(h,g){return this.dataFactory.literal(h,g.datatype?g.datatype:g.language?{language:g.language,direction:g.rdfVersion?g.direction:void 0}:void 0)}isValidVersion(h){return this.parseUnsupportedVersions||et.SUPPORTED_VERSIONS.includes(h)}attachSaxListeners(){this.saxParser.on("error",h=>this.emit("error",h)),this.saxParser.on("opentag",this.onTag.bind(this)),this.saxParser.on("text",this.onText.bind(this)),this.saxParser.on("cdata",this.onText.bind(this)),this.saxParser.on("closetag",this.onCloseTag.bind(this)),this.saxParser.on("doctype",this.onDoctype.bind(this))}onTag(h){const g=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let _=u.RESOURCE;if(g&&(g.hadChildren=!0,_=g.childrenParseType),g&&g.childrenStringTags){const m=h.name;let w="";for(const{key:P,value:v}of g.namespaces||[])w+=` ${P}="${v}"`;for(const P in h.attributes)w+=` ${P}="${h.attributes[P].value}"`;const A=`<${`${m}${w}`}>`;g.childrenStringTags.push(A);const N={childrenStringTags:g.childrenStringTags};N.childrenStringEmitClosingTag=`</${m}>`,this.activeTagStack.push(N);return}const d={};g?(d.language=g.language,d.direction=g.direction,d.baseIRI=g.baseIRI,d.childrenTripleTerms=g.childrenTripleTerms,d.rdfVersion=g.rdfVersion):d.baseIRI=this.baseIRI,this.activeTagStack.push(d),_===u.RESOURCE?this.onTagResource(h,d,g,!g):this.onTagProperty(h,d,g);for(const m in h.attributes){const w=h.attributes[m];w.prefix==="xmlns"&&(d.namespaces||(d.namespaces=[]),d.namespaces.push({key:`${w.prefix}:${w.local}`,value:w.value}))}g&&g.namespaces&&(d.namespaces=[...d.namespaces||[],...g.namespaces])}onTagResource(h,g,_,d){g.childrenParseType=u.PROPERTY;let m=!0;if(h.uri===et.RDF){if(!d&&et.FORBIDDEN_NODE_ELEMENTS.indexOf(h.local)>=0)throw this.newParseError(`Illegal node element name: ${h.local}`);switch(h.local){case"RDF":g.childrenParseType=u.RESOURCE;case"Description":m=!1}}const w=[],I=[];let A=null,N=!1,P=!1,v=null;for(const y in h.attributes){const S=h.attributes[y];if(S.uri===et.RDF&&S.local==="version"){this.setVersion(g,S.value);continue}else if(_&&S.uri===et.RDF)switch(S.local){case"about":if(A)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${S.value} and ${A} where found.`);A=S.value;continue;case"ID":if(A)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${S.value} and ${A} where found.`);this.validateNcname(S.value),A="#"+S.value,N=!0;continue;case"nodeID":if(A)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${S.value} and ${A} where found.`);this.validateNcname(S.value),A=S.value,P=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":v=S.value;continue;case"aboutEach":throw this.newParseError("rdf:aboutEach is not supported.");case"aboutEachPrefix":throw this.newParseError("rdf:aboutEachPrefix is not supported.");case"li":throw this.newParseError("rdf:li on node elements are not supported.")}else if(S.uri===et.XML){if(S.local==="lang"){g.language=S.value===""?null:S.value.toLowerCase();continue}else if(S.local==="base"){g.baseIRI=(0,i.resolve)(S.value,g.baseIRI);continue}}else if(S.uri===et.ITS&&S.local==="dir"){this.setDirection(g,S.value);continue}S.prefix!=="xml"&&S.prefix!=="xmlns"&&(S.prefix!==""||S.local!=="xmlns")&&S.uri&&(w.push(this.uriToNamedNode(S.uri+S.local)),I.push(S.value))}if(A!==null&&(g.subject=P?this.dataFactory.blankNode(A):this.valueToUri(A,g),N&&this.claimNodeId(g.subject)),g.subject||(g.subject=this.dataFactory.blankNode()),m){const y=this.uriToNamedNode(h.uri+h.local);this.emitTriple(g.subject,this.dataFactory.namedNode(et.RDF+"type"),y,_?_.reifiedStatementId:null,g.childrenTripleTerms,g.reifier)}if(_){if(_.predicate)if(_.childrenCollectionSubject){const y=this.dataFactory.blankNode(),S=this.dataFactory.namedNode(et.RDF+"rest"),O=_.childrenCollectionPredicate.equals(S);this.emitTriple(_.childrenCollectionSubject,_.childrenCollectionPredicate,y,O?null:_.reifiedStatementId,_.childrenTripleTerms,O?null:_.reifier),this.emitTriple(y,this.dataFactory.namedNode(et.RDF+"first"),g.subject,null,g.childrenTripleTerms),_.childrenCollectionSubject=y,_.childrenCollectionPredicate=S}else{_.childrenTagsToTripleTerms||(this.emitTriple(_.subject,_.predicate,g.subject,_.reifiedStatementId,_.childrenTripleTerms,_.reifier),_.predicateEmitted=!0);for(let y=0;y<_.predicateSubPredicates.length;y++)this.emitTriple(g.subject,_.predicateSubPredicates[y],_.predicateSubObjects[y],null,_.childrenTripleTerms,_.reifier);_.predicateSubPredicates=[],_.predicateSubObjects=[]}for(let y=0;y<w.length;y++){const S=this.createLiteral(I[y],g);this.emitTriple(g.subject,w[y],S,_.reifiedStatementId,_.childrenTripleTerms,_.reifier)}v&&this.emitTriple(g.subject,this.dataFactory.namedNode(et.RDF+"type"),this.uriToNamedNode(v),null,g.childrenTripleTerms,g.reifier)}}onTagProperty(h,g,_){if(g.childrenParseType=u.RESOURCE,g.subject=_.subject,h.uri===et.RDF&&h.local==="li"?(_.listItemCounter||(_.listItemCounter=1),g.predicate=this.uriToNamedNode(h.uri+"_"+_.listItemCounter++)):g.predicate=this.uriToNamedNode(h.uri+h.local),h.uri===et.RDF&&et.FORBIDDEN_PROPERTY_ELEMENTS.indexOf(h.local)>=0)throw this.newParseError(`Illegal property element name: ${h.local}`);g.predicateSubPredicates=[],g.predicateSubObjects=[];let d=!1,m=!1,w=null,I=!0;const A=[],N=[];for(const P in h.attributes){const v=h.attributes[P];if(v.uri===et.RDF&&v.local==="version"){this.setVersion(g,v.value);continue}else if(v.uri===et.RDF)switch(v.local){case"resource":if(w)throw this.newParseError(`Found both rdf:resource (${v.value}) and rdf:nodeID (${w}).`);if(d)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${v.value})`);g.hadChildren=!0,w=v.value,I=!1;continue;case"datatype":if(m)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${v.value}).`);if(d)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${v.value})`);g.datatype=this.valueToUri(v.value,g);continue;case"nodeID":if(m)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${v.value}).`);if(g.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${v.value}).`);if(d)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${v.value})`);this.validateNcname(v.value),g.hadChildren=!0,w=v.value,I=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(m)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(g.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${g.datatype.value})`);if(w)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${w})`);if(v.value==="Resource"){d=!0,g.childrenParseType=u.PROPERTY;const y=this.dataFactory.blankNode();this.emitTriple(g.subject,g.predicate,y,g.reifiedStatementId,g.childrenTripleTerms,g.reifier),g.subject=y,g.predicate=null}else v.value==="Collection"?(d=!0,g.hadChildren=!0,g.childrenCollectionSubject=g.subject,g.childrenCollectionPredicate=g.predicate,I=!1):v.value==="Literal"?(d=!0,g.childrenTagsToString=!0,g.childrenStringTags=[]):v.value==="Triple"&&(d=!0,g.childrenTagsToTripleTerms=!0,g.childrenTripleTerms=[]);continue;case"ID":this.validateNcname(v.value),g.reifiedStatementId=this.valueToUri("#"+v.value,g),this.claimNodeId(g.reifiedStatementId);continue;case"annotation":g.reifier=this.dataFactory.namedNode(v.value);continue;case"annotationNodeID":g.reifier=this.dataFactory.blankNode(v.value);continue}else if(v.uri===et.XML&&v.local==="lang"){g.language=v.value===""?null:v.value.toLowerCase();continue}else if(v.uri===et.ITS&&v.local==="dir"){this.setDirection(g,v.value);continue}else if(v.uri===et.ITS&&v.local==="version")continue;if(v.prefix!=="xml"&&v.prefix!=="xmlns"&&(v.prefix!==""||v.local!=="xmlns")&&v.uri){if(d||g.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${v.value}`);g.hadChildren=!0,m=!0,A.push(this.uriToNamedNode(v.uri+v.local)),N.push(this.createLiteral(v.value,g))}}if(w!==null){const P=g.subject;g.subject=I?this.dataFactory.blankNode(w):this.valueToUri(w,g),this.emitTriple(P,g.predicate,g.subject,g.reifiedStatementId,g.childrenTripleTerms,g.reifier);for(let v=0;v<A.length;v++)this.emitTriple(g.subject,A[v],N[v],null,g.childrenTripleTerms,g.reifier);g.predicateEmitted=!0}else I&&(g.predicateSubPredicates=A,g.predicateSubObjects=N,g.predicateEmitted=!1)}emitTriple(h,g,_,d,m,w){const I=this.dataFactory.quad(h,g,_,this.defaultGraph);m?m.push(I):this.push(I),w&&this.push(this.dataFactory.quad(w,this.dataFactory.namedNode(et.RDF+"reifies"),I)),d&&(this.push(this.dataFactory.quad(d,this.dataFactory.namedNode(et.RDF+"type"),this.dataFactory.namedNode(et.RDF+"Statement"),this.defaultGraph)),this.push(this.dataFactory.quad(d,this.dataFactory.namedNode(et.RDF+"subject"),h,this.defaultGraph)),this.push(this.dataFactory.quad(d,this.dataFactory.namedNode(et.RDF+"predicate"),g,this.defaultGraph)),this.push(this.dataFactory.quad(d,this.dataFactory.namedNode(et.RDF+"object"),_,this.defaultGraph)))}claimNodeId(h){if(!this.allowDuplicateRdfIds){if(this.nodeIds[h.value])throw this.newParseError(`Found multiple occurrences of rdf:ID='${h.value}'.`);this.nodeIds[h.value]=!0}}onText(h){const g=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;g&&(g.childrenStringTags?g.childrenStringTags.push(h):g.predicate&&(g.text=h))}onCloseTag(){const h=this.activeTagStack.pop(),g=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;if(h.childrenStringEmitClosingTag&&h.childrenStringTags.push(h.childrenStringEmitClosingTag),h.childrenTagsToString&&(h.datatype=this.dataFactory.namedNode(et.RDF+"XMLLiteral"),h.text=h.childrenStringTags.join(""),h.hadChildren=!1),h.childrenTagsToTripleTerms&&h.predicate&&h.rdfVersion){if(h.childrenTripleTerms.length!==1)throw this.newParseError(`Expected exactly one triple term in rdf:parseType="Triple" but got ${h.childrenTripleTerms.length}`);for(const _ of h.childrenTripleTerms)this.emitTriple(h.subject,h.predicate,_,null,g.childrenTripleTerms,g.reifier);h.predicateEmitted=!0}if(h.childrenCollectionSubject)this.emitTriple(h.childrenCollectionSubject,h.childrenCollectionPredicate,this.dataFactory.namedNode(et.RDF+"nil"),null,h.childrenTripleTerms);else if(h.predicate){if(!h.hadChildren&&h.childrenParseType!==u.PROPERTY)this.emitTriple(h.subject,h.predicate,this.createLiteral(h.text||"",h),h.reifiedStatementId,h.childrenTripleTerms,h.reifier);else if(!h.predicateEmitted){const _=this.dataFactory.blankNode();this.emitTriple(h.subject,h.predicate,_,h.reifiedStatementId,h.childrenTripleTerms,h.reifier);for(let d=0;d<h.predicateSubPredicates.length;d++)this.emitTriple(_,h.predicateSubPredicates[d],h.predicateSubObjects[d],null,h.childrenTripleTerms)}}}onDoctype(h){h.replace(/<!ENTITY\s+([^\s]+)\s+["']([^"']+)["']\s*>/g,(g,_,d)=>(this.saxParser.ENTITIES[_]=d,""))}setDirection(h,g){if(g){if(g!=="ltr"&&g!=="rtl")throw this.newParseError(`Base directions must either be 'ltr' or 'rtl', while '${g}' was found.`);h.direction=g}else delete h.direction}setVersion(h,g){if(h.rdfVersion=g,this.emit("version",g),!this.isValidVersion(g))throw this.newParseError(`Detected unsupported version: ${g}`)}};ui.RdfXmlParser=l,l.MIME_TYPE="application/rdf+xml",l.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",l.XML="http://www.w3.org/XML/1998/namespace",l.ITS="http://www.w3.org/2005/11/its",l.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],l.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],l.NCNAME_MATCHER=/^([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_])([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_\-.0-9#xB7\u{0300}-\u{036F}\u{203F}-\u{2040}])*$/u,l.SUPPORTED_VERSIONS=["1.2","1.2-basic","1.1"];var u;return(function(f){f[f.RESOURCE=0]="RESOURCE",f[f.PROPERTY=1]="PROPERTY"})(u||(ui.ParseType=u={})),ui}var sd;function wm(){return sd||(sd=1,(function(i){var e=li&&li.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,l,u)}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),n=li&&li.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(i,"__esModule",{value:!0}),n(vm(),i)})(li)),li}var xm=wm(),fa={},pa,od;function Hl(){return od||(od=1,pa=class Mf{constructor(e,n=new Map,r=0){this.prefix=e,this._existing=n,this.counter=r}clone(){const{prefix:e,_existing:n,counter:r}=this;return new Mf(e,new Map(n),r)}getId(e){const n=e&&this._existing.get(e);if(n)return n;const r=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,r),r}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}),pa}var Ir={},ga={},ad;function Em(){return ad||(ad=1,(function(i,e){if(i.setImmediate)return;var n=1,r={},o=!1,a=i.document,l;function u(P){typeof P!="function"&&(P=new Function(""+P));for(var v=new Array(arguments.length-1),y=0;y<v.length;y++)v[y]=arguments[y+1];var S={callback:P,args:v};return r[n]=S,l(n),n++}function f(P){delete r[P]}function h(P){var v=P.callback,y=P.args;switch(y.length){case 0:v();break;case 1:v(y[0]);break;case 2:v(y[0],y[1]);break;case 3:v(y[0],y[1],y[2]);break;default:v.apply(e,y);break}}function g(P){if(o)setTimeout(g,0,P);else{var v=r[P];if(v){o=!0;try{h(v)}finally{f(P),o=!1}}}}function _(){l=function(P){process.nextTick(function(){g(P)})}}function d(){if(i.postMessage&&!i.importScripts){var P=!0,v=i.onmessage;return i.onmessage=function(){P=!1},i.postMessage("","*"),i.onmessage=v,P}}function m(){var P="setImmediate$"+Math.random()+"$",v=function(y){y.source===i&&typeof y.data=="string"&&y.data.indexOf(P)===0&&g(+y.data.slice(P.length))};i.addEventListener?i.addEventListener("message",v,!1):i.attachEvent("onmessage",v),l=function(y){i.postMessage(P+y,"*")}}function w(){var P=new MessageChannel;P.port1.onmessage=function(v){var y=v.data;g(y)},l=function(v){P.port2.postMessage(v)}}function I(){var P=a.documentElement;l=function(v){var y=a.createElement("script");y.onreadystatechange=function(){g(v),y.onreadystatechange=null,P.removeChild(y),y=null},P.appendChild(y)}}function A(){l=function(P){setTimeout(g,0,P)}}var N=Object.getPrototypeOf&&Object.getPrototypeOf(i);N=N&&N.setTimeout?N:i,{}.toString.call(i.process)==="[object process]"?_():d()?m():i.MessageChannel?w():a&&"onreadystatechange"in a.createElement("script")?I():A(),N.setImmediate=u,N.clearImmediate=f})(typeof self>"u"?typeof qi>"u"?ga:qi:self)),ga}var ld;function Of(){if(ld)return Ir;ld=1,Em(),Ir.setImmediate=setImmediate,Ir.crypto=globalThis.crypto;const i=[];for(let e=0;e<=255;++e)i.push(e.toString(16).padStart(2,"0"));return Ir.bufferToHex=function(n){let r="";const o=new Uint8Array(n);for(let a=0;a<o.length;++a)r+=i[o[a]];return r},Ir}var ma,ud;function Ff(){if(ud)return ma;ud=1;const{bufferToHex:i,crypto:e}=Of(),n=new Map([["sha256","SHA-256"],["SHA256","SHA-256"],["SHA-256","SHA-256"],["sha384","SHA-384"],["SHA384","SHA-384"],["SHA-384","SHA-384"],["sha512","SHA-512"],["SHA512","SHA-512"],["SHA-512","SHA-512"]]);return ma=class{constructor(o){if(!(e&&e.subtle))throw new Error("crypto.subtle not found.");if(!n.has(o))throw new Error(`Unsupported algorithm "${o}".`);this.algorithm=n.get(o),this._content=""}update(o){this._content+=o}async digest(){const o=new TextEncoder().encode(this._content),a=await e.subtle.digest(this.algorithm,o);return i(a)}},ma}var _a,cd;function jf(){return cd||(cd=1,_a=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let n=0;n<e.length;++n)this.dir.set(e[n],!0)}hasNext(){return!this.done}next(){const{current:e,dir:n}=this,r=e.slice();let o=null,a=0;const l=e.length;for(let u=0;u<l;++u){const f=e[u],h=n.get(f);(o===null||f>o)&&(h&&u>0&&f>e[u-1]||!h&&u<l-1&&f>e[u+1])&&(o=f,a=u)}if(o===null)this.done=!0;else{const u=n.get(o)?a-1:a+1;e[a]=e[u],e[u]=o;for(const f of e)f>o&&n.set(f,!n.get(f))}return r}}),_a}var ya,dd;function Ul(){if(dd)return ya;dd=1;const e="http://www.w3.org/1999/02/22-rdf-syntax-ns#"+"langString",n="http://www.w3.org/2001/XMLSchema#string",r="NamedNode",o="BlankNode",a="Literal",l="DefaultGraph",u={};(()=>{const y="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�"+"_",S=y+"0-9-·̀-ͯ‿-⁀",O="_:((?:["+y+"0-9])(?:(?:["+S+".])*(?:["+S+"]))?)",U='(?:<((?:[^\0- <>"{}|^`\\\\]|'+"\\\\u[0-9A-Fa-f]{4}"+"|"+"\\\\U[0-9A-Fa-f]{8}"+")*)>)",R=O,$='"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"',G="(?:\\^\\^"+U+")",F="(?:"+$+"(?:"+G+"|"+"(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*))"+")?)",se="[ \\t]+",M="[ \\t]*",re="(?:"+U+"|"+R+")"+se,B=U+se,oe="(?:"+U+"|"+R+"|"+F+")"+M,T="(?:\\.|(?:(?:"+U+"|"+R+")"+M+"\\.))";u.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,u.empty=new RegExp("^"+M+"$"),u.quad=new RegExp("^"+M+re+B+oe+T+M+"$")})(),ya=class Sl{static parse(y){const S=[],O={},X=y.split(u.eoln);let C=0;for(const U of X){if(C++,u.empty.test(U))continue;const R=U.match(u.quad);if(R===null)throw new Error("N-Quads parse error on line "+C+".");const $={subject:null,predicate:null,object:null,graph:null};if(R[1]!==void 0?$.subject={termType:r,value:P(R[1])}:$.subject={termType:o,value:R[2]},$.predicate={termType:r,value:P(R[3])},R[4]!==void 0?$.object={termType:r,value:P(R[4])}:R[5]!==void 0?$.object={termType:o,value:R[5]}:($.object={termType:a,value:void 0,datatype:{termType:r}},R[7]!==void 0?$.object.datatype.value=P(R[7]):R[8]!==void 0?($.object.datatype.value=e,$.object.language=R[8]):$.object.datatype.value=n,$.object.value=m(R[6])),R[9]!==void 0?$.graph={termType:r,value:P(R[9])}:R[10]!==void 0?$.graph={termType:o,value:R[10]}:$.graph={termType:l,value:""},!($.graph.value in O))O[$.graph.value]=[$],S.push($);else{let G=!0;const j=O[$.graph.value];for(const F of j)if(f(F,$)){G=!1;break}G&&(j.push($),S.push($))}}return S}static serialize(y){const S=[];for(const O of y)S.push(Sl.serializeQuad(O));return S.sort().join("")}static serializeQuadComponents(y,S,O,X){let C="";return y.termType===r?C+=`<${A(y.value)}>`:C+=`_:${y.value}`,S.termType===r?C+=` <${A(S.value)}> `:C+=` _:${S.value} `,O.termType===r?C+=`<${A(O.value)}>`:O.termType===o?C+=`_:${O.value}`:(C+=`"${_(O.value)}"`,O.datatype.value===e?O.language&&(C+=`@${O.language}`):O.datatype.value!==n&&(C+=`^^<${A(O.datatype.value)}>`)),X.termType===r?C+=` <${A(X.value)}>`:X.termType===o&&(C+=` _:${X.value}`),C+=` .
|
|
31
|
-
`,C}static serializeQuad(y){return Sl.serializeQuadComponents(y.subject,y.predicate,y.object,y.graph)}};function f(
|
|
32
|
-
`.codePointAt(0)]="\\n",g["\f".codePointAt(0)]="\\f",g["\r".codePointAt(0)]="\\r",g['"'.codePointAt(0)]='\\"',g["\\".codePointAt(0)]="\\\\";function
|
|
33
|
-
`;case"f":return"\f";case"r":return"\r";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(O)return String.fromCharCode(parseInt(O,16));if(X)return String.fromCodePoint(parseInt(X,16))}):v}const w=/[\u0000-\u0020<>"{}|^`\\]/g,I=[];for(let v=0;v<=127;++v)w.test(String.fromCharCode(v))&&(I[v]="\\u"+v.toString(16).toUpperCase().padStart(4,"0"),w.lastIndex=0);function A(v){return w.test(v)?v.replace(w,function(y){return I[y.codePointAt(0)]}):v}const N=/(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function P(v){return N.test(v)?v.replace(N,function(y,S,O){if(S)return String.fromCharCode(parseInt(S,16));if(O)return String.fromCodePoint(parseInt(O,16))}):v}return ya}var ba,hd;function Sm(){if(hd)return ba;hd=1;const i=Hl(),e=Ff(),n=jf(),r=Ul(),{setImmediate:o}=Of();ba=class{constructor({createMessageDigest:u=null,messageDigestAlgorithm:f="sha256",canonicalIdMap:h=new Map,maxWorkFactor:g=1,maxDeepIterations:_=-1,signal:d=null}={}){this.name="RDFC-1.0",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("c14n",h),this.createMessageDigest=u||(()=>new e(f)),this.maxWorkFactor=g,this.maxDeepIterations=_,this.remainingDeepIterations=0,this.signal=d,this.quads=null}async main(u){this.quads=u;for(const w of u)this._addBlankNodeQuadInfo({quad:w,component:w.subject}),this._addBlankNodeQuadInfo({quad:w,component:w.object}),this._addBlankNodeQuadInfo({quad:w,component:w.graph});const f=new Map,h=[...this.blankNodeInfo.keys()];let g=0;for(const w of h)++g%100===0&&await this._yield(),await this._hashAndTrackBlankNode({id:w,hashToBlankNodes:f});const _=[...f.keys()].sort(),d=[];for(const w of _){const I=f.get(w);if(I.length>1){d.push(I);continue}const A=I[0];this.canonicalIssuer.getId(A)}if(this.maxDeepIterations<0)if(this.maxWorkFactor===0)this.maxDeepIterations=0;else if(this.maxWorkFactor===1/0)this.maxDeepIterations=1/0;else{const w=d.reduce((I,A)=>I+A.length,0);this.maxDeepIterations=w**this.maxWorkFactor}this.maxDeepIterations>Number.MAX_SAFE_INTEGER&&(this.maxDeepIterations=1/0),this.remainingDeepIterations=this.maxDeepIterations;for(const w of d){const I=[];for(const A of w){if(this.canonicalIssuer.hasId(A))continue;const N=new i("b");N.getId(A);const P=await this.hashNDegreeQuads(A,N);I.push(P)}I.sort(a);for(const A of I){const N=A.issuer.getOldIds();for(const P of N)this.canonicalIssuer.getId(P)}}const m=[];for(const w of this.quads){const I=r.serializeQuadComponents(this._componentWithCanonicalId(w.subject),w.predicate,this._componentWithCanonicalId(w.object),this._componentWithCanonicalId(w.graph));m.push(I)}return m.sort(),m.join("")}async hashFirstDegreeQuads(u){const f=[],h=this.blankNodeInfo.get(u),g=h.quads;for(const d of g)f.push(r.serializeQuadComponents(this.modifyFirstDegreeComponent(u,d.subject,"subject"),d.predicate,this.modifyFirstDegreeComponent(u,d.object,"object"),this.modifyFirstDegreeComponent(u,d.graph,"graph")));f.sort();const _=this.createMessageDigest();for(const d of f)_.update(d);return h.hash=await _.digest(),h.hash}async hashRelatedBlankNode(u,f,h,g){const _=this.createMessageDigest();_.update(g),g!=="g"&&_.update(this.getRelatedPredicate(f));let d;return this.canonicalIssuer.hasId(u)?d="_:"+this.canonicalIssuer.getId(u):h.hasId(u)?d="_:"+h.getId(u):d=this.blankNodeInfo.get(u).hash,_.update(d),_.digest()}async hashNDegreeQuads(u,f){if(this.remainingDeepIterations===0)throw new Error(`Maximum deep iterations exceeded (${this.maxDeepIterations}).`);this.remainingDeepIterations--;const h=this.createMessageDigest(),g=await this.createHashToRelated(u,f),_=[...g.keys()].sort();for(const d of _){h.update(d);let m="",w;const I=new n(g.get(d));let A=0;for(;I.hasNext();){const N=I.next();if(++A%3===0){if(this.signal&&this.signal.aborted)throw new Error(`Abort signal received: "${this.signal.reason}".`);await this._yield()}let P=f.clone(),v="";const y=[];let S=!1;for(const O of N)if(this.canonicalIssuer.hasId(O)?v+="_:"+this.canonicalIssuer.getId(O):(P.hasId(O)||y.push(O),v+="_:"+P.getId(O)),m.length!==0&&v>m){S=!0;break}if(!S){for(const O of y){const X=await this.hashNDegreeQuads(O,P);if(v+="_:"+P.getId(O),v+=`<${X.hash}>`,P=X.issuer,m.length!==0&&v>m){S=!0;break}}S||(m.length===0||v<m)&&(m=v,w=P)}}h.update(m),f=w}return{hash:await h.digest(),issuer:f}}modifyFirstDegreeComponent(u,f){return f.termType!=="BlankNode"?f:{termType:"BlankNode",value:f.value===u?"a":"z"}}getRelatedPredicate(u){return`<${u.predicate.value}>`}async createHashToRelated(u,f){const h=new Map,g=this.blankNodeInfo.get(u).quads;let _=0;for(const d of g)++_%100===0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:d,component:d.subject,position:"s",id:u,issuer:f,hashToRelated:h}),this._addRelatedBlankNodeHash({quad:d,component:d.object,position:"o",id:u,issuer:f,hashToRelated:h}),this._addRelatedBlankNodeHash({quad:d,component:d.graph,position:"g",id:u,issuer:f,hashToRelated:h})]);return h}async _hashAndTrackBlankNode({id:u,hashToBlankNodes:f}){const h=await this.hashFirstDegreeQuads(u),g=f.get(h);g?g.push(u):f.set(h,[u])}_addBlankNodeQuadInfo({quad:u,component:f}){if(f.termType!=="BlankNode")return;const h=f.value,g=this.blankNodeInfo.get(h);g?g.quads.add(u):this.blankNodeInfo.set(h,{quads:new Set([u]),hash:null})}async _addRelatedBlankNodeHash({quad:u,component:f,position:h,id:g,issuer:_,hashToRelated:d}){if(!(f.termType==="BlankNode"&&f.value!==g))return;const m=f.value,w=await this.hashRelatedBlankNode(m,u,_,h),I=d.get(w);I?I.push(m):d.set(w,[m])}_componentWithCanonicalId(u){return u.termType==="BlankNode"&&!u.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(u.value)}:u}async _yield(){return new Promise(u=>o(u))}};function a(l,u){return l.hash<u.hash?-1:l.hash>u.hash?1:0}return ba}var va,fd;function Tm(){if(fd)return va;fd=1;const i=Hl(),e=Ff(),n=jf(),r=Ul();va=class{constructor({createMessageDigest:l=null,messageDigestAlgorithm:u="sha256",canonicalIdMap:f=new Map,maxWorkFactor:h=1,maxDeepIterations:g=-1,timeout:_=0}={}){this.name="RDFC-1.0",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("c14n",f),this.createMessageDigest=l||(()=>new e(u)),this.maxWorkFactor=h,this.maxDeepIterations=g,this.remainingDeepIterations=0,this.timeout=_,_>0&&(this.startTime=Date.now()),this.quads=null}main(l){this.quads=l;for(const d of l)this._addBlankNodeQuadInfo({quad:d,component:d.subject}),this._addBlankNodeQuadInfo({quad:d,component:d.object}),this._addBlankNodeQuadInfo({quad:d,component:d.graph});const u=new Map,f=[...this.blankNodeInfo.keys()];for(const d of f)this._hashAndTrackBlankNode({id:d,hashToBlankNodes:u});const h=[...u.keys()].sort(),g=[];for(const d of h){const m=u.get(d);if(m.length>1){g.push(m);continue}const w=m[0];this.canonicalIssuer.getId(w)}if(this.maxDeepIterations<0)if(this.maxWorkFactor===0)this.maxDeepIterations=0;else if(this.maxWorkFactor===1/0)this.maxDeepIterations=1/0;else{const d=g.reduce((m,w)=>m+w.length,0);this.maxDeepIterations=d**this.maxWorkFactor}this.maxDeepIterations>Number.MAX_SAFE_INTEGER&&(this.maxDeepIterations=1/0),this.remainingDeepIterations=this.maxDeepIterations;for(const d of g){const m=[];for(const w of d){if(this.canonicalIssuer.hasId(w))continue;const I=new i("b");I.getId(w);const A=this.hashNDegreeQuads(w,I);m.push(A)}m.sort(o);for(const w of m){const I=w.issuer.getOldIds();for(const A of I)this.canonicalIssuer.getId(A)}}const _=[];for(const d of this.quads){const m=r.serializeQuadComponents(this._componentWithCanonicalId(d.subject),d.predicate,this._componentWithCanonicalId(d.object),this._componentWithCanonicalId(d.graph));_.push(m)}return _.sort(),_.join("")}hashFirstDegreeQuads(l){const u=[],f=this.blankNodeInfo.get(l),h=f.quads;for(const _ of h)u.push(r.serializeQuadComponents(this.modifyFirstDegreeComponent(l,_.subject,"subject"),_.predicate,this.modifyFirstDegreeComponent(l,_.object,"object"),this.modifyFirstDegreeComponent(l,_.graph,"graph")));u.sort();const g=this.createMessageDigest();for(const _ of u)g.update(_);return f.hash=g.digest(),f.hash}hashRelatedBlankNode(l,u,f,h){const g=this.createMessageDigest();g.update(h),h!=="g"&&g.update(this.getRelatedPredicate(u));let _;return this.canonicalIssuer.hasId(l)?_="_:"+this.canonicalIssuer.getId(l):f.hasId(l)?_="_:"+f.getId(l):_=this.blankNodeInfo.get(l).hash,g.update(_),g.digest()}hashNDegreeQuads(l,u){if(this.remainingDeepIterations===0)throw new Error(`Maximum deep iterations exceeded (${this.maxDeepIterations}).`);this.remainingDeepIterations--;const f=this.createMessageDigest(),h=this.createHashToRelated(l,u),g=[...h.keys()].sort();for(const _ of g){f.update(_);let d="",m;const w=new n(h.get(_));let I=0;for(;w.hasNext();){const A=w.next();if(++I%3===0&&this.timeout>0&&Date.now()-this.startTime>this.timeout)throw new Error("Canonize timeout.");let N=u.clone(),P="";const v=[];let y=!1;for(const S of A)if(this.canonicalIssuer.hasId(S)?P+="_:"+this.canonicalIssuer.getId(S):(N.hasId(S)||v.push(S),P+="_:"+N.getId(S)),d.length!==0&&P>d){y=!0;break}if(!y){for(const S of v){const O=this.hashNDegreeQuads(S,N);if(P+="_:"+N.getId(S),P+=`<${O.hash}>`,N=O.issuer,d.length!==0&&P>d){y=!0;break}}y||(d.length===0||P<d)&&(d=P,m=N)}}f.update(d),u=m}return{hash:f.digest(),issuer:u}}modifyFirstDegreeComponent(l,u){return u.termType!=="BlankNode"?u:{termType:"BlankNode",value:u.value===l?"a":"z"}}getRelatedPredicate(l){return`<${l.predicate.value}>`}createHashToRelated(l,u){const f=new Map,h=this.blankNodeInfo.get(l).quads;for(const g of h)this._addRelatedBlankNodeHash({quad:g,component:g.subject,position:"s",id:l,issuer:u,hashToRelated:f}),this._addRelatedBlankNodeHash({quad:g,component:g.object,position:"o",id:l,issuer:u,hashToRelated:f}),this._addRelatedBlankNodeHash({quad:g,component:g.graph,position:"g",id:l,issuer:u,hashToRelated:f});return f}_hashAndTrackBlankNode({id:l,hashToBlankNodes:u}){const f=this.hashFirstDegreeQuads(l),h=u.get(f);h?h.push(l):u.set(f,[l])}_addBlankNodeQuadInfo({quad:l,component:u}){if(u.termType!=="BlankNode")return;const f=u.value,h=this.blankNodeInfo.get(f);h?h.quads.add(l):this.blankNodeInfo.set(f,{quads:new Set([l]),hash:null})}_addRelatedBlankNodeHash({quad:l,component:u,position:f,id:h,issuer:g,hashToRelated:_}){if(!(u.termType==="BlankNode"&&u.value!==h))return;const d=u.value,m=this.hashRelatedBlankNode(d,l,g,f),w=_.get(m);w?w.push(d):_.set(m,[d])}_componentWithCanonicalId(l){return l.termType==="BlankNode"&&!l.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(l.value)}:l}};function o(a,l){return a.hash<l.hash?-1:a.hash>l.hash?1:0}return va}var pd;function Lm(){return pd||(pd=1,(function(i){const e=Sm(),n=Tm();function r(l,u){if(u.inputFormat){if(u.inputFormat==="application/n-quads"){if(typeof l!="string")throw new Error("N-Quads input must be a string.");return i.NQuads.parse(l)}throw new Error(`Unknown canonicalization input format: "${u.inputFormat}".`)}return l}function o(l){if(l.format&&l.format!=="application/n-quads")throw new Error(`Unknown canonicalization output format: "${l.format}".`)}function a(){globalThis.RDF_CANONIZE_TRACE_URDNA2015&&console.trace("[rdf-canonize] URDNA2015 is deprecated, use RDFC-1.0")}i.NQuads=Ul(),i.IdentifierIssuer=Hl(),i.canonize=async function(l,u={}){const f=r(l,u);if(o(u),!("algorithm"in u))throw new Error("No RDF Dataset Canonicalization algorithm specified.");if(u.algorithm==="RDFC-1.0")return new e(u).main(f);if(u.algorithm==="URDNA2015"&&!u.rejectURDNA2015)return a(),new e(u).main(f);throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+u.algorithm)},i._canonizeSync=function(l,u={}){const f=r(l,u);if(o(u),!("algorithm"in u))throw new Error("No RDF Dataset Canonicalization algorithm specified.");if(u.algorithm==="RDFC-1.0")return new n(u).main(f);if(u.algorithm==="URDNA2015"&&!u.rejectURDNA2015)return a(),new n(u).main(f);throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+u.algorithm)}})(fa)),fa}var wa,gd;function Vl(){return gd||(gd=1,wa=Lm()),wa}var xa,md;function zt(){if(md)return xa;md=1;const i={};return xa=i,i.isArray=Array.isArray,i.isBoolean=e=>typeof e=="boolean"||Object.prototype.toString.call(e)==="[object Boolean]",i.isDouble=e=>i.isNumber(e)&&(String(e).indexOf(".")!==-1||Math.abs(e)>=1e21),i.isEmptyObject=e=>i.isObject(e)&&Object.keys(e).length===0,i.isNumber=e=>typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]",i.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),i.isObject=e=>Object.prototype.toString.call(e)==="[object Object]",i.isString=e=>typeof e=="string"||Object.prototype.toString.call(e)==="[object String]",i.isUndefined=e=>typeof e>"u",xa}var Ea,_d;function On(){if(_d)return Ea;_d=1;const i=zt(),e={};return Ea=e,e.isSubject=n=>i.isObject(n)&&!("@value"in n||"@set"in n||"@list"in n)?Object.keys(n).length>1||!("@id"in n):!1,e.isSubjectReference=n=>i.isObject(n)&&Object.keys(n).length===1&&"@id"in n,e.isValue=n=>i.isObject(n)&&"@value"in n,e.isList=n=>i.isObject(n)&&"@list"in n,e.isGraph=n=>i.isObject(n)&&"@graph"in n&&Object.keys(n).filter(r=>r!=="@id"&&r!=="@index").length===1,e.isSimpleGraph=n=>e.isGraph(n)&&!("@id"in n),e.isBlankNode=n=>{if(i.isObject(n)){if("@id"in n){const r=n["@id"];return!i.isString(r)||r.indexOf("_:")===0}return Object.keys(n).length===0||!("@value"in n||"@set"in n||"@list"in n)}return!1},Ea}var Sa,yd;function Kt(){return yd||(yd=1,Sa=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",n="jsonld.Error",r={}){super(e),this.name=n,this.message=e,this.details=r}}),Sa}var Ta,bd;function Qt(){if(bd)return Ta;bd=1;const i=On(),e=zt(),n=Vl().IdentifierIssuer,r=Kt(),o=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,u=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,f=/^@[a-zA-Z]+$/,h={headers:{accept:"application/ld+json, application/json"}},g={};Ta=g,g.IdentifierIssuer=n,g.REGEX_BCP47=o,g.REGEX_KEYWORD=f,g.clone=function(d){if(d&&typeof d=="object"){let m;if(e.isArray(d)){m=[];for(let w=0;w<d.length;++w)m[w]=g.clone(d[w])}else if(d instanceof Map){m=new Map;for(const[w,I]of d)m.set(w,g.clone(I))}else if(d instanceof Set){m=new Set;for(const w of d)m.add(g.clone(w))}else if(e.isObject(d)){m={};for(const w in d)m[w]=g.clone(d[w])}else m=d.toString();return m}return d},g.asArray=function(d){return Array.isArray(d)?d:[d]},g.buildHeaders=(d={})=>{if(Object.keys(d).some(w=>w.toLowerCase()==="accept"))throw new RangeError('Accept header may not be specified; only "'+h.headers.accept+'" is supported.');return Object.assign({Accept:h.headers.accept},d)},g.parseLinkHeader=d=>{const m={},w=d.match(a);for(let I=0;I<w.length;++I){let A=w[I].match(l);if(!A)continue;const N={target:A[1]},P=A[2];for(;A=u.exec(P);)N[A[1]]=A[2]===void 0?A[3]:A[2];const v=N.rel||"";Array.isArray(m[v])?m[v].push(N):m.hasOwnProperty(v)?m[v]=[m[v],N]:m[v]=N}return m},g.validateTypeValue=(d,m)=>{if(!e.isString(d)&&!(e.isArray(d)&&d.every(w=>e.isString(w)))){if(m&&e.isObject(d))switch(Object.keys(d).length){case 0:return;case 1:if("@default"in d&&g.asArray(d["@default"]).every(w=>e.isString(w)))return}throw new r('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:d})}},g.hasProperty=(d,m)=>{if(d.hasOwnProperty(m)){const w=d[m];return!e.isArray(w)||w.length>0}return!1},g.hasValue=(d,m,w)=>{if(g.hasProperty(d,m)){let I=d[m];const A=i.isList(I);if(e.isArray(I)||A){A&&(I=I["@list"]);for(let N=0;N<I.length;++N)if(g.compareValues(w,I[N]))return!0}else if(!e.isArray(w))return g.compareValues(w,I)}return!1},g.addValue=(d,m,w,I)=>{if(I=I||{},"propertyIsArray"in I||(I.propertyIsArray=!1),"valueIsArray"in I||(I.valueIsArray=!1),"allowDuplicate"in I||(I.allowDuplicate=!0),"prependValue"in I||(I.prependValue=!1),I.valueIsArray)d[m]=w;else if(e.isArray(w)){w.length===0&&I.propertyIsArray&&!d.hasOwnProperty(m)&&(d[m]=[]),I.prependValue&&(w=w.concat(d[m]),d[m]=[]);for(let A=0;A<w.length;++A)g.addValue(d,m,w[A],I)}else if(d.hasOwnProperty(m)){const A=!I.allowDuplicate&&g.hasValue(d,m,w);!e.isArray(d[m])&&(!A||I.propertyIsArray)&&(d[m]=[d[m]]),A||(I.prependValue?d[m].unshift(w):d[m].push(w))}else d[m]=I.propertyIsArray?[w]:w},g.getValues=(d,m)=>[].concat(d[m]||[]),g.removeProperty=(d,m)=>{delete d[m]},g.removeValue=(d,m,w,I)=>{I=I||{},"propertyIsArray"in I||(I.propertyIsArray=!1);const A=g.getValues(d,m).filter(N=>!g.compareValues(N,w));A.length===0?g.removeProperty(d,m):A.length===1&&!I.propertyIsArray?d[m]=A[0]:d[m]=A},g.relabelBlankNodes=(d,m)=>{m=m||{};const w=m.issuer||new n("_:b");return _(w,d)},g.compareValues=(d,m)=>d===m||i.isValue(d)&&i.isValue(m)&&d["@value"]===m["@value"]&&d["@type"]===m["@type"]&&d["@language"]===m["@language"]&&d["@index"]===m["@index"]?!0:e.isObject(d)&&"@id"in d&&e.isObject(m)&&"@id"in m?d["@id"]===m["@id"]:!1,g.compareShortestLeast=(d,m)=>d.length<m.length?-1:m.length<d.length?1:d===m?0:d<m?-1:1;function _(d,m){if(e.isArray(m))for(let w=0;w<m.length;++w)m[w]=_(d,m[w]);else if(i.isList(m))m["@list"]=_(d,m["@list"]);else if(e.isObject(m)){i.isBlankNode(m)&&(m["@id"]=d.getId(m["@id"]));const w=Object.keys(m).sort();for(let I=0;I<w.length;++I){const A=w[I];A!=="@id"&&(m[A]=_(d,m[A]))}}return m}return Ta}var La,vd;function Wl(){if(vd)return La;vd=1;const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",e="http://www.w3.org/2001/XMLSchema#";return La={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:i,RDF_LIST:i+"List",RDF_FIRST:i+"first",RDF_REST:i+"rest",RDF_NIL:i+"nil",RDF_TYPE:i+"type",RDF_PLAIN_LITERAL:i+"PlainLiteral",RDF_XML_LITERAL:i+"XMLLiteral",RDF_JSON_LITERAL:i+"JSON",RDF_OBJECT:i+"object",RDF_LANGSTRING:i+"langString",XSD:e,XSD_BOOLEAN:e+"boolean",XSD_DOUBLE:e+"double",XSD_INTEGER:e+"integer",XSD_STRING:e+"string"},La}var Ia,wd;function Bf(){return wd||(wd=1,Ia=class{constructor(){this._requests={}}wrapLoader(e){const n=this;return n._loader=e,function(){return n.add.apply(n,arguments)}}async add(e){let n=this._requests[e];if(n)return Promise.resolve(n);n=this._requests[e]=this._loader(e);try{return await n}finally{delete this._requests[e]}}}),Ia}var Aa,xd;function Jn(){if(xd)return Aa;xd=1;const i=zt(),e={};Aa=e,e.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},e.parse=(r,o)=>{const a={},l=e.parsers[o||"full"],u=l.regex.exec(r);let f=l.keys.length;for(;f--;)a[l.keys[f]]=u[f]===void 0?null:u[f];return(a.scheme==="https"&&a.port==="443"||a.scheme==="http"&&a.port==="80")&&(a.href=a.href.replace(":"+a.port,""),a.authority=a.authority.replace(":"+a.port,""),a.port=null),a.normalizedPath=e.removeDotSegments(a.path),a},e.prependBase=(r,o)=>{if(r===null||e.isAbsolute(o))return o;(!r||i.isString(r))&&(r=e.parse(r||""));const a=e.parse(o),l={protocol:r.protocol||""};if(a.authority!==null)l.authority=a.authority,l.path=a.path,l.query=a.query;else if(l.authority=r.authority,a.path==="")l.path=r.path,a.query!==null?l.query=a.query:l.query=r.query;else{if(a.path.indexOf("/")===0)l.path=a.path;else{let f=r.path;f=f.substr(0,f.lastIndexOf("/")+1),(f.length>0||r.authority)&&f.substr(-1)!=="/"&&(f+="/"),f+=a.path,l.path=f}l.query=a.query}a.path!==""&&(l.path=e.removeDotSegments(l.path));let u=l.protocol;return l.authority!==null&&(u+="//"+l.authority),u+=l.path,l.query!==null&&(u+="?"+l.query),a.fragment!==null&&(u+="#"+a.fragment),u===""&&(u="./"),u},e.removeBase=(r,o)=>{if(r===null)return o;(!r||i.isString(r))&&(r=e.parse(r||""));let a="";if(r.href!==""?a+=(r.protocol||"")+"//"+(r.authority||""):o.indexOf("//")&&(a+="//"),o.indexOf(a)!==0)return o;const l=e.parse(o.substr(a.length)),u=r.normalizedPath.split("/"),f=l.normalizedPath.split("/"),h=l.fragment||l.query?0:1;for(;u.length>0&&f.length>h&&u[0]===f[0];)u.shift(),f.shift();let g="";if(u.length>0){u.pop();for(let _=0;_<u.length;++_)g+="../"}return g+=f.join("/"),l.query!==null&&(g+="?"+l.query),l.fragment!==null&&(g+="#"+l.fragment),g===""&&(g="./"),g},e.removeDotSegments=r=>{if(r.length===0)return"";const o=r.split("/"),a=[];for(;o.length>0;){const l=o.shift(),u=o.length===0;if(l==="."){u&&a.push("");continue}if(l===".."){a.pop(),u&&a.push("");continue}a.push(l)}return r[0]==="/"&&a.length>0&&a[0]!==""&&a.unshift(""),a.length===1&&a[0]===""?"/":a.join("/")};const n=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;return e.isAbsolute=r=>i.isString(r)&&n.test(r),e.isRelative=r=>i.isString(r),Aa}var Na,Ed;function Im(){if(Ed)return Na;Ed=1;const{parseLinkHeader:i,buildHeaders:e}=Qt(),{LINK_HEADER_CONTEXT:n}=Wl(),r=Kt(),o=Bf(),{prependBase:a}=Jn(),l=/(^|(\r\n))link:/i;Na=({secure:f,headers:h={},xhr:g}={headers:{}})=>{return h=e(h),new o().wrapLoader(d);async function d(m){if(m.indexOf("http:")!==0&&m.indexOf("https:")!==0)throw new r('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:m});if(f&&m.indexOf("https")!==0)throw new r(`URL could not be dereferenced; secure mode is enabled and the URL's scheme is not "https".`,"jsonld.InvalidUrl",{code:"loading document failed",url:m});let w;try{w=await u(g,m,h)}catch(v){throw new r("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:m,cause:v})}if(w.status>=400)throw new r("URL could not be dereferenced: "+w.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:m,httpStatusCode:w.status});let I={contextUrl:null,documentUrl:m,document:w.response},A=null;const N=w.getResponseHeader("Content-Type");let P;if(l.test(w.getAllResponseHeaders())&&(P=w.getResponseHeader("Link")),P&&N!=="application/ld+json"){const v=i(P),y=v[n];if(Array.isArray(y))throw new r("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:m});y&&(I.contextUrl=y.target),A=v.alternate,A&&A.type=="application/ld+json"&&!(N||"").match(/^application\/(\w*\+)?json$/)&&(I=await d(a(m,A.target)))}return I}};function u(f,h,g){f=f||XMLHttpRequest;const _=new f;return new Promise((d,m)=>{_.onload=()=>d(_),_.onerror=w=>m(w),_.open("GET",h,!0);for(const w in g)_.setRequestHeader(w,g[w]);_.send()})}return Na}var Ra,Sd;function Am(){if(Sd)return Ra;Sd=1;const i=Im(),e={};return Ra=e,e.setupDocumentLoaders=function(n){typeof XMLHttpRequest<"u"&&(n.documentLoaders.xhr=i,n.useDocumentLoader("xhr"))},e.setupGlobals=function(n){typeof globalThis.JsonLdProcessor>"u"&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:n.JsonLdProcessor})},Ra}var Ca,Td;function Nm(){return Td||(Td=1,Ca=function(i){i.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Ca}var Pa,Ld;function Rm(){if(Ld)return Pa;Ld=1,Pa=i,i.Node=o,i.create=i;function i(a){var l=this;if(l instanceof i||(l=new i),l.tail=null,l.head=null,l.length=0,a&&typeof a.forEach=="function")a.forEach(function(h){l.push(h)});else if(arguments.length>0)for(var u=0,f=arguments.length;u<f;u++)l.push(arguments[u]);return l}i.prototype.removeNode=function(a){if(a.list!==this)throw new Error("removing node which does not belong to this list");var l=a.next,u=a.prev;return l&&(l.prev=u),u&&(u.next=l),a===this.head&&(this.head=l),a===this.tail&&(this.tail=u),a.list.length--,a.next=null,a.prev=null,a.list=null,l},i.prototype.unshiftNode=function(a){if(a!==this.head){a.list&&a.list.removeNode(a);var l=this.head;a.list=this,a.next=l,l&&(l.prev=a),this.head=a,this.tail||(this.tail=a),this.length++}},i.prototype.pushNode=function(a){if(a!==this.tail){a.list&&a.list.removeNode(a);var l=this.tail;a.list=this,a.prev=l,l&&(l.next=a),this.tail=a,this.head||(this.head=a),this.length++}},i.prototype.push=function(){for(var a=0,l=arguments.length;a<l;a++)n(this,arguments[a]);return this.length},i.prototype.unshift=function(){for(var a=0,l=arguments.length;a<l;a++)r(this,arguments[a]);return this.length},i.prototype.pop=function(){if(this.tail){var a=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,a}},i.prototype.shift=function(){if(this.head){var a=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,a}},i.prototype.forEach=function(a,l){l=l||this;for(var u=this.head,f=0;u!==null;f++)a.call(l,u.value,f,this),u=u.next},i.prototype.forEachReverse=function(a,l){l=l||this;for(var u=this.tail,f=this.length-1;u!==null;f--)a.call(l,u.value,f,this),u=u.prev},i.prototype.get=function(a){for(var l=0,u=this.head;u!==null&&l<a;l++)u=u.next;if(l===a&&u!==null)return u.value},i.prototype.getReverse=function(a){for(var l=0,u=this.tail;u!==null&&l<a;l++)u=u.prev;if(l===a&&u!==null)return u.value},i.prototype.map=function(a,l){l=l||this;for(var u=new i,f=this.head;f!==null;)u.push(a.call(l,f.value,this)),f=f.next;return u},i.prototype.mapReverse=function(a,l){l=l||this;for(var u=new i,f=this.tail;f!==null;)u.push(a.call(l,f.value,this)),f=f.prev;return u},i.prototype.reduce=function(a,l){var u,f=this.head;if(arguments.length>1)u=l;else if(this.head)f=this.head.next,u=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=0;f!==null;h++)u=a(u,f.value,h),f=f.next;return u},i.prototype.reduceReverse=function(a,l){var u,f=this.tail;if(arguments.length>1)u=l;else if(this.tail)f=this.tail.prev,u=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=this.length-1;f!==null;h--)u=a(u,f.value,h),f=f.prev;return u},i.prototype.toArray=function(){for(var a=new Array(this.length),l=0,u=this.head;u!==null;l++)a[l]=u.value,u=u.next;return a},i.prototype.toArrayReverse=function(){for(var a=new Array(this.length),l=0,u=this.tail;u!==null;l++)a[l]=u.value,u=u.prev;return a},i.prototype.slice=function(a,l){l=l||this.length,l<0&&(l+=this.length),a=a||0,a<0&&(a+=this.length);var u=new i;if(l<a||l<0)return u;a<0&&(a=0),l>this.length&&(l=this.length);for(var f=0,h=this.head;h!==null&&f<a;f++)h=h.next;for(;h!==null&&f<l;f++,h=h.next)u.push(h.value);return u},i.prototype.sliceReverse=function(a,l){l=l||this.length,l<0&&(l+=this.length),a=a||0,a<0&&(a+=this.length);var u=new i;if(l<a||l<0)return u;a<0&&(a=0),l>this.length&&(l=this.length);for(var f=this.length,h=this.tail;h!==null&&f>l;f--)h=h.prev;for(;h!==null&&f>a;f--,h=h.prev)u.push(h.value);return u},i.prototype.splice=function(a,l,...u){a>this.length&&(a=this.length-1),a<0&&(a=this.length+a);for(var f=0,h=this.head;h!==null&&f<a;f++)h=h.next;for(var g=[],f=0;h&&f<l;f++)g.push(h.value),h=this.removeNode(h);h===null&&(h=this.tail),h!==this.head&&h!==this.tail&&(h=h.prev);for(var f=0;f<u.length;f++)h=e(this,h,u[f]);return g},i.prototype.reverse=function(){for(var a=this.head,l=this.tail,u=a;u!==null;u=u.prev){var f=u.prev;u.prev=u.next,u.next=f}return this.head=l,this.tail=a,this};function e(a,l,u){var f=l===a.head?new o(u,null,l,a):new o(u,l,l.next,a);return f.next===null&&(a.tail=f),f.prev===null&&(a.head=f),a.length++,f}function n(a,l){a.tail=new o(l,a.tail,null,a),a.head||(a.head=a.tail),a.length++}function r(a,l){a.head=new o(l,null,a.head,a),a.tail||(a.tail=a.head),a.length++}function o(a,l,u,f){if(!(this instanceof o))return new o(a,l,u,f);this.list=f,this.value=a,l?(l.next=this,this.prev=l):this.prev=null,u?(u.prev=this,this.next=u):this.next=null}try{Nm()(i)}catch{}return Pa}var ka,Id;function $f(){if(Id)return ka;Id=1;const i=Rm(),e=Symbol("max"),n=Symbol("length"),r=Symbol("lengthCalculator"),o=Symbol("allowStale"),a=Symbol("maxAge"),l=Symbol("dispose"),u=Symbol("noDisposeOnSet"),f=Symbol("lruList"),h=Symbol("cache"),g=Symbol("updateAgeOnGet"),_=()=>1;class d{constructor(y){if(typeof y=="number"&&(y={max:y}),y||(y={}),y.max&&(typeof y.max!="number"||y.max<0))throw new TypeError("max must be a non-negative number");this[e]=y.max||1/0;const S=y.length||_;if(this[r]=typeof S!="function"?_:S,this[o]=y.stale||!1,y.maxAge&&typeof y.maxAge!="number")throw new TypeError("maxAge must be a number");this[a]=y.maxAge||0,this[l]=y.dispose,this[u]=y.noDisposeOnSet||!1,this[g]=y.updateAgeOnGet||!1,this.reset()}set max(y){if(typeof y!="number"||y<0)throw new TypeError("max must be a non-negative number");this[e]=y||1/0,I(this)}get max(){return this[e]}set allowStale(y){this[o]=!!y}get allowStale(){return this[o]}set maxAge(y){if(typeof y!="number")throw new TypeError("maxAge must be a non-negative number");this[a]=y,I(this)}get maxAge(){return this[a]}set lengthCalculator(y){typeof y!="function"&&(y=_),y!==this[r]&&(this[r]=y,this[n]=0,this[f].forEach(S=>{S.length=this[r](S.value,S.key),this[n]+=S.length})),I(this)}get lengthCalculator(){return this[r]}get length(){return this[n]}get itemCount(){return this[f].length}rforEach(y,S){S=S||this;for(let O=this[f].tail;O!==null;){const X=O.prev;P(this,y,O,S),O=X}}forEach(y,S){S=S||this;for(let O=this[f].head;O!==null;){const X=O.next;P(this,y,O,S),O=X}}keys(){return this[f].toArray().map(y=>y.key)}values(){return this[f].toArray().map(y=>y.value)}reset(){this[l]&&this[f]&&this[f].length&&this[f].forEach(y=>this[l](y.key,y.value)),this[h]=new Map,this[f]=new i,this[n]=0}dump(){return this[f].map(y=>w(this,y)?!1:{k:y.key,v:y.value,e:y.now+(y.maxAge||0)}).toArray().filter(y=>y)}dumpLru(){return this[f]}set(y,S,O){if(O=O||this[a],O&&typeof O!="number")throw new TypeError("maxAge must be a number");const X=O?Date.now():0,C=this[r](S,y);if(this[h].has(y)){if(C>this[e])return A(this,this[h].get(y)),!1;const $=this[h].get(y).value;return this[l]&&(this[u]||this[l](y,$.value)),$.now=X,$.maxAge=O,$.value=S,this[n]+=C-$.length,$.length=C,this.get(y),I(this),!0}const U=new N(y,S,C,X,O);return U.length>this[e]?(this[l]&&this[l](y,S),!1):(this[n]+=U.length,this[f].unshift(U),this[h].set(y,this[f].head),I(this),!0)}has(y){if(!this[h].has(y))return!1;const S=this[h].get(y).value;return!w(this,S)}get(y){return m(this,y,!0)}peek(y){return m(this,y,!1)}pop(){const y=this[f].tail;return y?(A(this,y),y.value):null}del(y){A(this,this[h].get(y))}load(y){this.reset();const S=Date.now();for(let O=y.length-1;O>=0;O--){const X=y[O],C=X.e||0;if(C===0)this.set(X.k,X.v);else{const U=C-S;U>0&&this.set(X.k,X.v,U)}}}prune(){this[h].forEach((y,S)=>m(this,S,!1))}}const m=(v,y,S)=>{const O=v[h].get(y);if(O){const X=O.value;if(w(v,X)){if(A(v,O),!v[o])return}else S&&(v[g]&&(O.value.now=Date.now()),v[f].unshiftNode(O));return X.value}},w=(v,y)=>{if(!y||!y.maxAge&&!v[a])return!1;const S=Date.now()-y.now;return y.maxAge?S>y.maxAge:v[a]&&S>v[a]},I=v=>{if(v[n]>v[e])for(let y=v[f].tail;v[n]>v[e]&&y!==null;){const S=y.prev;A(v,y),y=S}},A=(v,y)=>{if(y){const S=y.value;v[l]&&v[l](S.key,S.value),v[n]-=S.length,v[h].delete(S.key),v[f].removeNode(y)}};class N{constructor(y,S,O,X,C){this.key=y,this.value=S,this.length=O,this.now=X,this.maxAge=C||0}}const P=(v,y,S,O)=>{let X=S.value;w(v,X)&&(A(v,S),v[o]||(X=void 0)),X&&y.call(O,X.value,X.key,v)};return ka=d,ka}var Da,Ad;function Cm(){if(Ad)return Da;Ad=1;const i=$f(),e=10;return Da=class{constructor({document:r}){this.document=r,this.cache=new i({max:e})}getProcessed(r){return this.cache.get(r)}setProcessed(r,o){this.cache.set(r,o)}},Da}var Ma,Nd;function Pm(){if(Nd)return Ma;Nd=1;const{isArray:i,isObject:e,isString:n}=zt(),{asArray:r}=Qt(),{prependBase:o}=Jn(),a=Kt(),l=Cm(),u=10;Ma=class{constructor({sharedCache:_}){this.perOpCache=new Map,this.sharedCache=_}async resolve({activeCtx:_,context:d,documentLoader:m,base:w,cycles:I=new Set}){d&&e(d)&&d["@context"]&&(d=d["@context"]),d=r(d);const A=[];for(const N of d){if(n(N)){let y=this._get(N);y||(y=await this._resolveRemoteContext({activeCtx:_,url:N,documentLoader:m,base:w,cycles:I})),i(y)?A.push(...y):A.push(y);continue}if(N===null){A.push(new l({document:null}));continue}e(N)||f(d);const P=JSON.stringify(N);let v=this._get(P);v||(v=new l({document:N}),this._cacheResolvedContext({key:P,resolved:v,tag:"static"})),A.push(v)}return A}_get(_){let d=this.perOpCache.get(_);if(!d){const m=this.sharedCache.get(_);m&&(d=m.get("static"),d&&this.perOpCache.set(_,d))}return d}_cacheResolvedContext({key:_,resolved:d,tag:m}){if(this.perOpCache.set(_,d),m!==void 0){let w=this.sharedCache.get(_);w||(w=new Map,this.sharedCache.set(_,w)),w.set(m,d)}return d}async _resolveRemoteContext({activeCtx:_,url:d,documentLoader:m,base:w,cycles:I}){d=o(w,d);const{context:A,remoteDoc:N}=await this._fetchContext({activeCtx:_,url:d,documentLoader:m,cycles:I});w=N.documentUrl||d,h({context:A,base:w});const P=await this.resolve({activeCtx:_,context:A,documentLoader:m,base:w,cycles:I});return this._cacheResolvedContext({key:d,resolved:P,tag:N.tag}),P}async _fetchContext({activeCtx:_,url:d,documentLoader:m,cycles:w}){if(w.size>u)throw new a("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:_.processingMode==="json-ld-1.0"?"loading remote context failed":"context overflow",max:u});if(w.has(d))throw new a("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:_.processingMode==="json-ld-1.0"?"recursive context inclusion":"context overflow",url:d});w.add(d);let I,A;try{A=await m(d),I=A.document||null,n(I)&&(I=JSON.parse(I))}catch(N){throw new a(`Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context. URL: "${d}".`,"jsonld.InvalidUrl",{code:"loading remote context failed",url:d,cause:N})}if(!e(I))throw new a(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${d}".`,"jsonld.InvalidUrl",{code:"invalid remote context",url:d});return"@context"in I?I={"@context":I["@context"]}:I={"@context":{}},A.contextUrl&&(i(I["@context"])||(I["@context"]=[I["@context"]]),I["@context"].push(A.contextUrl)),{context:I,remoteDoc:A}}};function f(g){throw new a("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:g})}function h({context:g,base:_}){if(!g)return;const d=g["@context"];if(n(d)){g["@context"]=o(_,d);return}if(i(d)){for(let m=0;m<d.length;++m){const w=d[m];if(n(w)){d[m]=o(_,w);continue}e(w)&&h({context:{"@context":w},base:_})}return}if(e(d))for(const m in d)h({context:d[m],base:_})}return Ma}var Oa,Rd;function km(){return Rd||(Rd=1,Oa=Vl().NQuads),Oa}var Fa,Cd;function Qr(){if(Cd)return Fa;Cd=1;const i=Kt(),{isArray:e}=zt(),{asArray:n}=Qt(),r={};Fa=r,r.defaultEventHandler=null,r.setupEventHandler=({options:l={}})=>{const u=[].concat(l.safe?r.safeEventHandler:[],l.eventHandler?n(l.eventHandler):[],r.defaultEventHandler?r.defaultEventHandler:[]);return u.length===0?null:u},r.handleEvent=({event:l,options:u})=>{o({event:l,handlers:u.eventHandler})};function o({event:l,handlers:u}){let f=!0;for(let h=0;f&&h<u.length;++h){f=!1;const g=u[h];if(e(g))f=o({event:l,handlers:g});else if(typeof g=="function")g({event:l,next:()=>{f=!0}});else if(typeof g=="object")l.code in g?g[l.code]({event:l,next:()=>{f=!0}}):f=!0;else throw new i("Invalid event handler.","jsonld.InvalidEventHandler",{event:l})}return f}const a=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference","rdfDirection not set"]);return r.safeEventHandler=function({event:u,next:f}){if(u.level==="warning"&&a.has(u.code))throw new i("Safe mode validation error.","jsonld.ValidationError",{event:u});f()},r.logEventHandler=function({event:u,next:f}){console.log(`EVENT: ${u.message}`,{event:u}),f()},r.logWarningEventHandler=function({event:u,next:f}){u.level==="warning"&&console.warn(`WARNING: ${u.message}`,{event:u}),f()},r.unhandledEventHandler=function({event:u}){throw new i("No handler for event.","jsonld.UnhandledEvent",{event:u})},r.setDefaultEventHandler=function({eventHandler:l}={}){r.defaultEventHandler=l?n(l):null},Fa}var ja,Pd;function wi(){if(Pd)return ja;Pd=1;const i=Qt(),e=Kt(),{isArray:n,isObject:r,isString:o,isUndefined:a}=zt(),{isAbsolute:l,isRelative:u,prependBase:f}=Jn(),{handleEvent:h}=Qr(),{REGEX_BCP47:g,REGEX_KEYWORD:_,asArray:d,compareShortestLeast:m}=Qt(),w=new Map,I=1e4,A={};ja=A,A.process=async({activeCtx:v,localCtx:y,options:S,propagate:O=!0,overrideProtected:X=!1,cycles:C=new Set})=>{if(r(y)&&"@context"in y&&n(y["@context"])&&(y=y["@context"]),d(y).length===0)return v;const R=[],$=[({event:se,next:M})=>{R.push(se),M()}];S.eventHandler&&$.push(S.eventHandler);const G=S;S={...S,eventHandler:$};const j=await S.contextResolver.resolve({activeCtx:v,context:y,documentLoader:S.documentLoader,base:S.base});r(j[0].document)&&typeof j[0].document["@propagate"]=="boolean"&&(O=j[0].document["@propagate"]);let F=v;!O&&!F.previousContext&&(F=F.clone(),F.previousContext=v);for(const se of j){let{document:M}=se;if(v=F,M===null){if(!X&&Object.keys(v.protected).length!==0)throw new e("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});F=v=A.getInitialContext(S).clone();continue}const re=se.getProcessed(v);if(re){if(G.eventHandler)for(const oe of re.events)h({event:oe,options:G});F=v=re.context;continue}if(r(M)&&"@context"in M&&(M=M["@context"]),!r(M))throw new e("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:M});F=F.clone();const B=new Map;if("@version"in M){if(M["@version"]!==1.1)throw new e("Unsupported JSON-LD version: "+M["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:M});if(v.processingMode&&v.processingMode==="json-ld-1.0")throw new e("@version: "+M["@version"]+" not compatible with "+v.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:M});F.processingMode="json-ld-1.1",F["@version"]=M["@version"],B.set("@version",!0)}if(F.processingMode=F.processingMode||v.processingMode,"@base"in M){let oe=M["@base"];if(!(oe===null||l(oe)))if(u(oe))oe=f(F["@base"],oe);else throw new e('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:M});F["@base"]=oe,B.set("@base",!0)}if("@vocab"in M){const oe=M["@vocab"];if(oe===null)delete F["@vocab"];else if(o(oe)){if(!l(oe)&&A.processingMode(F,1))throw new e('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:M});{const T=N(F,oe,{vocab:!0,base:!0},void 0,void 0,S);l(T)||S.eventHandler&&h({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:T}},options:S}),F["@vocab"]=T}}else throw new e('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:M});B.set("@vocab",!0)}if("@language"in M){const oe=M["@language"];if(oe===null)delete F["@language"];else if(o(oe))oe.match(g)||S.eventHandler&&h({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:oe}},options:S}),F["@language"]=oe.toLowerCase();else throw new e('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:M});B.set("@language",!0)}if("@direction"in M){const oe=M["@direction"];if(v.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @direction not compatible with "+v.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:M});if(oe===null)delete F["@direction"];else{if(oe!=="ltr"&&oe!=="rtl")throw new e('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:M});F["@direction"]=oe}B.set("@direction",!0)}if("@propagate"in M){const oe=M["@propagate"];if(v.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @propagate not compatible with "+v.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:M});if(typeof oe!="boolean")throw new e("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:y});B.set("@propagate",!0)}if("@import"in M){const oe=M["@import"];if(v.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @import not compatible with "+v.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:M});if(!o(oe))throw new e("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:y});const T=await S.contextResolver.resolve({activeCtx:v,context:oe,documentLoader:S.documentLoader,base:S.base});if(T.length!==1)throw new e("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:y});const Q=T[0].getProcessed(v);if(Q)M=Q;else{const ie=T[0].document;if("@import"in ie)throw new e("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:y});for(const Y in ie)M.hasOwnProperty(Y)||(M[Y]=ie[Y]);T[0].setProcessed(v,M)}B.set("@import",!0)}B.set("@protected",M["@protected"]||!1);for(const oe in M)if(A.createTermDefinition({activeCtx:F,localCtx:M,term:oe,defined:B,options:S,overrideProtected:X}),r(M[oe])&&"@context"in M[oe]){const T=M[oe]["@context"];let Q=!0;if(o(T)){const ie=f(S.base,T);C.has(ie)?Q=!1:C.add(ie)}if(Q)try{await A.process({activeCtx:F.clone(),localCtx:M[oe]["@context"],overrideProtected:!0,options:S,cycles:C})}catch{throw new e("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:M[oe]["@context"],term:oe})}}se.setProcessed(v,{context:F,events:R})}return F},A.createTermDefinition=({activeCtx:v,localCtx:y,term:S,defined:O,options:X,overrideProtected:C=!1})=>{if(O.has(S)){if(O.get(S))return;throw new e("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:y,term:S})}O.set(S,!1);let U;if(y.hasOwnProperty(S)&&(U=y[S]),S==="@type"&&r(U)&&(U["@container"]||"@set")==="@set"&&A.processingMode(v,1.1)){const M=["@container","@id","@protected"],re=Object.keys(U);if(re.length===0||re.some(B=>!M.includes(B)))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:y,term:S})}else{if(A.isKeyword(S))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:y,term:S});if(S.match(_)){X.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:S}},options:X});return}else if(S==="")throw new e("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:y})}const R=v.mappings.get(S);v.mappings.has(S)&&v.mappings.delete(S);let $=!1;if((o(U)||U===null)&&($=!0,U={"@id":U}),!r(U))throw new e("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:y});const G={};v.mappings.set(S,G),G.reverse=!1;const j=["@container","@id","@language","@reverse","@type"];A.processingMode(v,1.1)&&j.push("@context","@direction","@index","@nest","@prefix","@protected");for(const M in U)if(!j.includes(M))throw new e("Invalid JSON-LD syntax; a term definition must not contain "+M,"jsonld.SyntaxError",{code:"invalid term definition",context:y});const F=S.indexOf(":");if(G._termHasColon=F>0,"@reverse"in U){if("@id"in U)throw new e("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:y});if("@nest"in U)throw new e("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:y});const M=U["@reverse"];if(!o(M))throw new e("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});if(M.match(_)){X.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:M}},options:X}),R?v.mappings.set(S,R):v.mappings.delete(S);return}const re=N(v,M,{vocab:!0,base:!1},y,O,X);if(!l(re))throw new e("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});G["@id"]=re,G.reverse=!0}else if("@id"in U){let M=U["@id"];if(M&&!o(M))throw new e("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});if(M===null)G["@id"]=null;else if(!A.isKeyword(M)&&M.match(_)){X.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:M}},options:X}),R?v.mappings.set(S,R):v.mappings.delete(S);return}else if(M!==S){if(M=N(v,M,{vocab:!0,base:!1},y,O,X),!l(M)&&!A.isKeyword(M))throw new e("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});if(S.match(/(?::[^:])|\//)){const re=new Map(O).set(S,!0);if(N(v,S,{vocab:!0,base:!1},y,re,X)!==M)throw new e("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y})}G["@id"]=M,G._prefix=$&&!G._termHasColon&&M.match(/[:\/\?#\[\]@]$/)!==null}}if(!("@id"in G))if(G._termHasColon){const M=S.substr(0,F);if(y.hasOwnProperty(M)&&A.createTermDefinition({activeCtx:v,localCtx:y,term:M,defined:O,options:X}),v.mappings.has(M)){const re=S.substr(F+1);G["@id"]=v.mappings.get(M)["@id"]+re}else G["@id"]=S}else if(S==="@type")G["@id"]=S;else{if(!("@vocab"in v))throw new e("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y,term:S});G["@id"]=v["@vocab"]+S}if((U["@protected"]===!0||O.get("@protected")===!0&&U["@protected"]!==!1)&&(v.protected[S]=!0,G.protected=!0),O.set(S,!0),"@type"in U){let M=U["@type"];if(!o(M))throw new e("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:y});if(M==="@json"||M==="@none"){if(A.processingMode(v,1))throw new e(`Invalid JSON-LD syntax; an @context @type value must not be "${M}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:y})}else if(M!=="@id"&&M!=="@vocab"){if(M=N(v,M,{vocab:!0,base:!1},y,O,X),!l(M))throw new e("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:y});if(M.indexOf("_:")===0)throw new e("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:y})}G["@type"]=M}if("@container"in U){const M=o(U["@container"])?[U["@container"]]:U["@container"]||[],re=["@list","@set","@index","@language"];let B=!0;const oe=M.includes("@set");if(A.processingMode(v,1.1)){if(re.push("@graph","@id","@type"),M.includes("@list")){if(M.length!==1)throw new e("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:y})}else if(M.includes("@graph")){if(M.some(T=>T!=="@graph"&&T!=="@id"&&T!=="@index"&&T!=="@set"))throw new e("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:y})}else B&=M.length<=(oe?2:1);if(M.includes("@type")&&(G["@type"]=G["@type"]||"@id",!["@id","@vocab"].includes(G["@type"])))throw new e("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:y})}else B&=!n(U["@container"]),B&=M.length<=1;if(B&=M.every(T=>re.includes(T)),B&=!(oe&&M.includes("@list")),!B)throw new e("Invalid JSON-LD syntax; @context @container value must be one of the following: "+re.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:y});if(G.reverse&&!M.every(T=>["@index","@set"].includes(T)))throw new e("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:y});G["@container"]=M}if("@index"in U){if(!("@container"in U)||!G["@container"].includes("@index"))throw new e(`Invalid JSON-LD syntax; @index without @index in @container: "${U["@index"]}" on term "${S}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:y});if(!o(U["@index"])||U["@index"].indexOf("@")===0)throw new e(`Invalid JSON-LD syntax; @index must expand to an IRI: "${U["@index"]}" on term "${S}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:y});G["@index"]=U["@index"]}if("@context"in U&&(G["@context"]=U["@context"]),"@language"in U&&!("@type"in U)){let M=U["@language"];if(M!==null&&!o(M))throw new e("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:y});M!==null&&(M=M.toLowerCase()),G["@language"]=M}if("@prefix"in U){if(S.match(/:|\//))throw new e("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:y});if(A.isKeyword(G["@id"]))throw new e("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:y});if(typeof U["@prefix"]=="boolean")G._prefix=U["@prefix"]===!0;else throw new e("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:y})}if("@direction"in U){const M=U["@direction"];if(M!==null&&M!=="ltr"&&M!=="rtl")throw new e('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:y});G["@direction"]=M}if("@nest"in U){const M=U["@nest"];if(!o(M)||M!=="@nest"&&M.indexOf("@")===0)throw new e("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:y});G["@nest"]=M}const se=G["@id"];if(se==="@context"||se==="@preserve")throw new e("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:y});if(R&&R.protected&&!C&&(v.protected[S]=!0,G.protected=!0,!P(R,G)))throw new e("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:y,term:S})},A.expandIri=(v,y,S,O)=>N(v,y,S,void 0,void 0,O);function N(v,y,S,O,X,C){if(y===null||!o(y)||A.isKeyword(y))return y;if(y.match(_))return null;if(O&&O.hasOwnProperty(y)&&X.get(y)!==!0&&A.createTermDefinition({activeCtx:v,localCtx:O,term:y,defined:X,options:C}),S=S||{},S.vocab){const R=v.mappings.get(y);if(R===null)return null;if(r(R)&&"@id"in R)return R["@id"]}const U=y.indexOf(":");if(U>0){const R=y.substr(0,U),$=y.substr(U+1);if(R==="_"||$.indexOf("//")===0)return y;O&&O.hasOwnProperty(R)&&A.createTermDefinition({activeCtx:v,localCtx:O,term:R,defined:X,options:C});const G=v.mappings.get(R);if(G&&G._prefix)return G["@id"]+$;if(l(y))return y}if(S.vocab&&"@vocab"in v)y=v["@vocab"]+y;else if(S.base){let R,$;"@base"in v?v["@base"]?($=f(C.base,v["@base"]),R=f($,y)):($=v["@base"],R=y):($=C.base,R=f(C.base,y)),y=R}return y}A.getInitialContext=v=>{const y=JSON.stringify({processingMode:v.processingMode}),S=w.get(y);if(S)return S;const O={processingMode:v.processingMode,mappings:new Map,inverse:null,getInverse:X,clone:R,revertToPreviousContext:$,protected:{}};return w.size===I&&w.clear(),w.set(y,O),O;function X(){const G=this;if(G.inverse)return G.inverse;const j=G.inverse={},F=G.fastCurieMap={},se={},M=(G["@language"]||"@none").toLowerCase(),re=G["@direction"],B=G.mappings,oe=[...B.keys()].sort(m);for(const T of oe){const Q=B.get(T);if(Q===null)continue;let ie=Q["@container"]||"@none";if(ie=[].concat(ie).sort().join(""),Q["@id"]===null)continue;const Y=d(Q["@id"]);for(const me of Y){let Z=j[me];const W=A.isKeyword(me);if(Z)!W&&!Q._termHasColon&&se[me].push(T);else if(j[me]=Z={},!W&&!Q._termHasColon){se[me]=[T];const ee={iri:me,terms:se[me]};me[0]in F?F[me[0]].push(ee):F[me[0]]=[ee]}if(Z[ie]||(Z[ie]={"@language":{},"@type":{},"@any":{}}),Z=Z[ie],U(T,Z["@any"],"@none"),Q.reverse)U(T,Z["@type"],"@reverse");else if(Q["@type"]==="@none")U(T,Z["@any"],"@none"),U(T,Z["@language"],"@none"),U(T,Z["@type"],"@none");else if("@type"in Q)U(T,Z["@type"],Q["@type"]);else if("@language"in Q&&"@direction"in Q){const ee=Q["@language"],K=Q["@direction"];ee&&K?U(T,Z["@language"],`${ee}_${K}`.toLowerCase()):ee?U(T,Z["@language"],ee.toLowerCase()):K?U(T,Z["@language"],`_${K}`):U(T,Z["@language"],"@null")}else"@language"in Q?U(T,Z["@language"],(Q["@language"]||"@null").toLowerCase()):"@direction"in Q?Q["@direction"]?U(T,Z["@language"],`_${Q["@direction"]}`):U(T,Z["@language"],"@none"):re?(U(T,Z["@language"],`_${re}`),U(T,Z["@language"],"@none"),U(T,Z["@type"],"@none")):(U(T,Z["@language"],M),U(T,Z["@language"],"@none"),U(T,Z["@type"],"@none"))}}for(const T in F)C(F,T,1);return j}function C(G,j,F){const se=G[j],M=G[j]={};let re,B;for(const oe of se)re=oe.iri,F>=re.length?B="":B=re[F],B in M?M[B].push(oe):M[B]=[oe];for(const oe in M)oe!==""&&C(M,oe,F+1)}function U(G,j,F){j.hasOwnProperty(F)||(j[F]=G)}function R(){const G={};return G.mappings=i.clone(this.mappings),G.clone=this.clone,G.inverse=null,G.getInverse=this.getInverse,G.protected=i.clone(this.protected),this.previousContext&&(G.previousContext=this.previousContext.clone()),G.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(G["@base"]=this["@base"]),"@language"in this&&(G["@language"]=this["@language"]),"@vocab"in this&&(G["@vocab"]=this["@vocab"]),G}function $(){return this.previousContext?this.previousContext.clone():this}},A.getContextValue=(v,y,S)=>{if(y===null)return S==="@context"?void 0:null;if(v.mappings.has(y)){const O=v.mappings.get(y);if(a(S))return O;if(O.hasOwnProperty(S))return O[S]}if(S==="@language"&&S in v||S==="@direction"&&S in v)return v[S];if(S!=="@context")return null},A.processingMode=(v,y)=>y.toString()>="1.1"?!v.processingMode||v.processingMode>="json-ld-"+y.toString():v.processingMode==="json-ld-1.0",A.isKeyword=v=>{if(!o(v)||v[0]!=="@")return!1;switch(v){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1};function P(v,y){if(!(v&&typeof v=="object")||!(y&&typeof y=="object"))return v===y;const S=Array.isArray(v);if(S!==Array.isArray(y))return!1;if(S){if(v.length!==y.length)return!1;for(let C=0;C<v.length;++C)if(!P(v[C],y[C]))return!1;return!0}const O=Object.keys(v),X=Object.keys(y);if(O.length!==X.length)return!1;for(const C in v){let U=v[C],R=y[C];if(C==="@container"&&Array.isArray(U)&&Array.isArray(R)&&(U=U.slice().sort(),R=R.slice().sort()),!P(U,R))return!1}return!0}return ja}var Ba,kd;function Dm(){if(kd)return Ba;kd=1;const i=Kt(),{isArray:e,isObject:n,isEmptyObject:r,isString:o,isUndefined:a}=zt(),{isList:l,isValue:u,isGraph:f,isSubject:h}=On(),{expandIri:g,getContextValue:_,isKeyword:d,process:m,processingMode:w}=wi(),{isAbsolute:I}=Jn(),{REGEX_BCP47:A,REGEX_KEYWORD:N,addValue:P,asArray:v,getValues:y,validateTypeValue:S}=Qt(),{handleEvent:O}=Qr(),X={};Ba=X,X.expand=async({activeCtx:j,activeProperty:F=null,element:se,options:M={},insideList:re=!1,insideIndex:B=!1,typeScopedContext:oe=null})=>{if(se==null)return null;if(F==="@default"&&(M=Object.assign({},M,{isFrame:!1})),!e(se)&&!n(se))return!re&&(F===null||g(j,F,{vocab:!0},M)==="@graph")?(M.eventHandler&&O({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:se}},options:M}),null):R({activeCtx:j,activeProperty:F,value:se,options:M});if(e(se)){let ee=[];const K=_(j,F,"@container")||[];re=re||K.includes("@list");for(let ue=0;ue<se.length;++ue){let ce=await X.expand({activeCtx:j,activeProperty:F,element:se[ue],options:M,insideIndex:B,typeScopedContext:oe});re&&e(ce)&&(ce={"@list":ce}),ce!==null&&(e(ce)?ee=ee.concat(ce):ee.push(ce))}return ee}const T=g(j,F,{vocab:!0},M),Q=_(j,F,"@context");oe=oe||(j.previousContext?j:null);let ie=Object.keys(se).sort(),Y=!B;if(Y&&oe&&ie.length<=2&&!ie.includes("@context"))for(const ee of ie){const K=g(oe,ee,{vocab:!0},M);if(K==="@value"){Y=!1,j=oe;break}if(K==="@id"&&ie.length===1){Y=!1;break}}Y&&(j=j.revertToPreviousContext()),a(Q)||(j=await m({activeCtx:j,localCtx:Q,propagate:!0,overrideProtected:!0,options:M})),"@context"in se&&(j=await m({activeCtx:j,localCtx:se["@context"],options:M})),oe=j;let me=null;for(const ee of ie)if(g(j,ee,{vocab:!0},M)==="@type"){me=me||ee;const ue=se[ee],ce=Array.isArray(ue)?ue.length>1?ue.slice().sort():ue:[ue];for(const Ee of ce){const Te=_(oe,Ee,"@context");a(Te)||(j=await m({activeCtx:j,localCtx:Te,options:M,propagate:!1}))}}let Z={};await U({activeCtx:j,activeProperty:F,expandedActiveProperty:T,element:se,expandedParent:Z,options:M,insideList:re,typeKey:me,typeScopedContext:oe}),ie=Object.keys(Z);let W=ie.length;if("@value"in Z){if("@type"in Z&&("@language"in Z||"@direction"in Z))throw new i('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:Z});let ee=W-1;if("@type"in Z&&(ee-=1),"@index"in Z&&(ee-=1),"@language"in Z&&(ee-=1),"@direction"in Z&&(ee-=1),ee!==0)throw new i('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:Z});const K=Z["@value"]===null?[]:v(Z["@value"]),ue=y(Z,"@type");if(!(w(j,1.1)&&ue.includes("@json")&&ue.length===1))if(K.length===0)M.eventHandler&&O({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:Z}},options:M}),Z=null;else{if(!K.every(ce=>o(ce)||r(ce))&&"@language"in Z)throw new i("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:Z});if(!ue.every(ce=>I(ce)&&!(o(ce)&&ce.indexOf("_:")===0)||r(ce)))throw new i('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:Z})}}else if("@type"in Z&&!e(Z["@type"]))Z["@type"]=[Z["@type"]];else if("@set"in Z||"@list"in Z){if(W>1&&!(W===2&&"@index"in Z))throw new i('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:Z});"@set"in Z&&(Z=Z["@set"],ie=Object.keys(Z),W=ie.length)}else W===1&&"@language"in Z&&(M.eventHandler&&O({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:Z}},options:M}),Z=null);return n(Z)&&!M.keepFreeFloatingNodes&&!re&&(F===null||T==="@graph"||(_(j,F,"@container")||[]).includes("@graph"))&&(Z=C({value:Z,count:W,options:M})),Z};function C({value:j,count:F,options:se}){if(F===0||"@value"in j||"@list"in j||F===1&&"@id"in j){if(se.eventHandler){let M,re;F===0?(M="empty object",re="Dropping empty object."):"@value"in j?(M="object with only @value",re="Dropping object with only @value."):"@list"in j?(M="object with only @list",re="Dropping object with only @list."):F===1&&"@id"in j&&(M="object with only @id",re="Dropping object with only @id."),O({event:{type:["JsonLdEvent"],code:M,level:"warning",message:re,details:{value:j}},options:se})}return null}return j}async function U({activeCtx:j,activeProperty:F,expandedActiveProperty:se,element:M,expandedParent:re,options:B={},insideList:oe,typeKey:T,typeScopedContext:Q}){const ie=Object.keys(M).sort(),Y=[];let me;const Z=M[T]&&g(j,e(M[T])?M[T][0]:M[T],{vocab:!0},{...B,typeExpansion:!0})==="@json";for(const W of ie){let ee=M[W],K;if(W==="@context")continue;const ue=g(j,W,{vocab:!0},B);if(ue===null||!(I(ue)||d(ue))){B.eventHandler&&O({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:W,expandedProperty:ue}},options:B});continue}if(d(ue)){if(se==="@reverse")throw new i("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:ee});if(ue in re&&ue!=="@included"&&ue!=="@type")throw new i("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:ue})}if(ue==="@id"){if(!o(ee)){if(!B.isFrame)throw new i('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:ee});if(n(ee)){if(!r(ee))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:ee})}else if(e(ee)){if(!ee.every(q=>o(q)))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:ee})}else throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:ee})}P(re,"@id",v(ee).map(q=>{if(o(q)){const te=g(j,q,{base:!0},B);return B.eventHandler&&(te===null?O(q===null?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:q}},options:B}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:q}},options:B}):I(te)||O({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:q,expandedId:te}},options:B})),te}return q}),{propertyIsArray:B.isFrame});continue}if(ue==="@type"){n(ee)&&(ee=Object.fromEntries(Object.entries(ee).map(([q,te])=>[g(Q,q,{vocab:!0}),v(te).map(fe=>g(Q,fe,{base:!0,vocab:!0},{...B,typeExpansion:!0}))]))),S(ee,B.isFrame),P(re,"@type",v(ee).map(q=>{if(o(q)){const te=g(Q,q,{base:!0,vocab:!0},{...B,typeExpansion:!0});return te!=="@json"&&!I(te)&&B.eventHandler&&O({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:q}},options:B}),te}return q}),{propertyIsArray:!!B.isFrame});continue}if(ue==="@included"&&w(j,1.1)){const q=v(await X.expand({activeCtx:j,activeProperty:F,element:ee,options:B}));if(!q.every(te=>h(te)))throw new i("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:ee});P(re,"@included",q,{propertyIsArray:!0});continue}if(ue==="@graph"&&!(n(ee)||e(ee)))throw new i('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:ee});if(ue==="@value"){me=ee,Z&&w(j,1.1)?re["@value"]=ee:P(re,"@value",ee,{propertyIsArray:B.isFrame});continue}if(ue==="@language"){if(ee===null)continue;if(!o(ee)&&!B.isFrame)throw new i('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:ee});ee=v(ee).map(q=>o(q)?q.toLowerCase():q);for(const q of ee)o(q)&&!q.match(A)&&B.eventHandler&&O({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:q}},options:B});P(re,"@language",ee,{propertyIsArray:B.isFrame});continue}if(ue==="@direction"){if(!o(ee)&&!B.isFrame)throw new i('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:ee});ee=v(ee);for(const q of ee)if(o(q)&&q!=="ltr"&&q!=="rtl")throw new i('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:ee});P(re,"@direction",ee,{propertyIsArray:B.isFrame});continue}if(ue==="@index"){if(!o(ee))throw new i('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:ee});P(re,"@index",ee);continue}if(ue==="@reverse"){if(!n(ee))throw new i('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:ee});if(K=await X.expand({activeCtx:j,activeProperty:"@reverse",element:ee,options:B}),"@reverse"in K)for(const te in K["@reverse"])P(re,te,K["@reverse"][te],{propertyIsArray:!0});let q=re["@reverse"]||null;for(const te in K){if(te==="@reverse")continue;q===null&&(q=re["@reverse"]={}),P(q,te,[],{propertyIsArray:!0});const fe=K[te];for(let xe=0;xe<fe.length;++xe){const Se=fe[xe];if(u(Se)||l(Se))throw new i('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:K});P(q,te,Se,{propertyIsArray:!0})}}continue}if(ue==="@nest"){Y.push(W);continue}let ce=j;const Ee=_(j,W,"@context");a(Ee)||(ce=await m({activeCtx:j,localCtx:Ee,propagate:!0,overrideProtected:!0,options:B}));const Te=_(j,W,"@container")||[];if(Te.includes("@language")&&n(ee)){const q=_(ce,W,"@direction");K=$(ce,ee,q,B)}else if(Te.includes("@index")&&n(ee)){const q=Te.includes("@graph"),te=_(ce,W,"@index")||"@index",fe=te!=="@index"&&g(j,te,{vocab:!0},B);K=await G({activeCtx:ce,options:B,activeProperty:W,value:ee,asGraph:q,indexKey:te,propertyIndex:fe})}else if(Te.includes("@id")&&n(ee)){const q=Te.includes("@graph");K=await G({activeCtx:ce,options:B,activeProperty:W,value:ee,asGraph:q,indexKey:"@id"})}else if(Te.includes("@type")&&n(ee))K=await G({activeCtx:ce.revertToPreviousContext(),options:B,activeProperty:W,value:ee,asGraph:!1,indexKey:"@type"});else{const q=ue==="@list";if(q||ue==="@set"){let te=F;q&&se==="@graph"&&(te=null),K=await X.expand({activeCtx:ce,activeProperty:te,element:ee,options:B,insideList:q})}else _(j,W,"@type")==="@json"?K={"@type":"@json","@value":ee}:K=await X.expand({activeCtx:ce,activeProperty:W,element:ee,options:B,insideList:!1})}if(!(K===null&&ue!=="@value")){if(ue!=="@list"&&!l(K)&&Te.includes("@list")&&(K={"@list":v(K)}),Te.includes("@graph")&&!Te.some(q=>q==="@id"||q==="@index")){if(K=v(K),B.isFrame||(K=K.filter(q=>{const te=Object.keys(q).length;return C({value:q,count:te,options:B})!==null})),K.length===0)continue;K=K.map(q=>({"@graph":v(q)}))}if(ce.mappings.has(W)&&ce.mappings.get(W).reverse){const q=re["@reverse"]=re["@reverse"]||{};K=v(K);for(let te=0;te<K.length;++te){const fe=K[te];if(u(fe)||l(fe))throw new i('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:K});P(q,ue,fe,{propertyIsArray:!0})}continue}P(re,ue,K,{propertyIsArray:!0})}}if("@value"in re&&!(re["@type"]==="@json"&&w(j,1.1))){if((n(me)||e(me))&&!B.isFrame)throw new i('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:me})}for(const W of Y){const ee=e(M[W])?M[W]:[M[W]];for(const K of ee){if(!n(K)||Object.keys(K).some(ue=>g(j,ue,{vocab:!0},B)==="@value"))throw new i("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:K});await U({activeCtx:j,activeProperty:F,expandedActiveProperty:se,element:K,expandedParent:re,options:B,insideList:oe,typeScopedContext:Q,typeKey:T})}}}function R({activeCtx:j,activeProperty:F,value:se,options:M}){if(se==null)return null;const re=g(j,F,{vocab:!0},M);if(re==="@id")return g(j,se,{base:!0},M);if(re==="@type")return g(j,se,{vocab:!0,base:!0},{...M,typeExpansion:!0});const B=_(j,F,"@type");if((B==="@id"||re==="@graph")&&o(se)){const T=g(j,se,{base:!0},M);return T===null&&se.match(N)&&M.eventHandler&&O({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:F}},options:M}),{"@id":T}}if(B==="@vocab"&&o(se))return{"@id":g(j,se,{vocab:!0,base:!0},M)};if(d(re))return se;const oe={};if(B&&!["@id","@vocab","@none"].includes(B))oe["@type"]=B;else if(o(se)){const T=_(j,F,"@language");T!==null&&(oe["@language"]=T);const Q=_(j,F,"@direction");Q!==null&&(oe["@direction"]=Q)}return["boolean","number","string"].includes(typeof se)||(se=se.toString()),oe["@value"]=se,oe}function $(j,F,se,M){const re=[],B=Object.keys(F).sort();for(const oe of B){const T=g(j,oe,{vocab:!0},M);let Q=F[oe];e(Q)||(Q=[Q]);for(const ie of Q){if(ie===null)continue;if(!o(ie))throw new i("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:F});const Y={"@value":ie};T!=="@none"&&(oe.match(A)||M.eventHandler&&O({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:oe}},options:M}),Y["@language"]=oe.toLowerCase()),se&&(Y["@direction"]=se),re.push(Y)}}return re}async function G({activeCtx:j,options:F,activeProperty:se,value:M,asGraph:re,indexKey:B,propertyIndex:oe}){const T=[],Q=Object.keys(M).sort(),ie=B==="@type";for(let Y of Q){if(ie){const W=_(j,Y,"@context");a(W)||(j=await m({activeCtx:j,localCtx:W,propagate:!1,options:F}))}let me=M[Y];e(me)||(me=[me]),me=await X.expand({activeCtx:j,activeProperty:se,element:me,options:F,insideList:!1,insideIndex:!0});let Z;oe?Y==="@none"?Z="@none":Z=R({activeCtx:j,activeProperty:B,value:Y,options:F}):Z=g(j,Y,{vocab:!0},F),B==="@id"?Y=g(j,Y,{base:!0},F):ie&&(Y=Z);for(let W of me){if(re&&!f(W)&&(W={"@graph":[W]}),B==="@type")Z==="@none"||(W["@type"]?W["@type"]=[Y].concat(W["@type"]):W["@type"]=[Y]);else{if(u(W)&&!["@language","@type","@index"].includes(B))throw new i(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${B}".`,"jsonld.SyntaxError",{code:"invalid value object",value:W});oe?Z!=="@none"&&P(W,oe,Z,{propertyIsArray:!0,prependValue:!0}):Z!=="@none"&&!(B in W)&&(W[B]=Y)}T.push(W)}}return T}return Ba}var $a,Dd;function Ys(){if(Dd)return $a;Dd=1;const{isKeyword:i}=wi(),e=On(),n=zt(),r=Qt(),o=Kt(),a={};return $a=a,a.createMergedNodeMap=(l,u)=>{u=u||{};const f=u.issuer||new r.IdentifierIssuer("_:b"),h={"@default":{}};return a.createNodeMap(l,h,"@default",f),a.mergeNodeMaps(h)},a.createNodeMap=(l,u,f,h,g,_)=>{if(n.isArray(l)){for(const I of l)a.createNodeMap(I,u,f,h,void 0,_);return}if(!n.isObject(l)){_&&_.push(l);return}if(e.isValue(l)){if("@type"in l){let I=l["@type"];I.indexOf("_:")===0&&(l["@type"]=I=h.getId(I))}_&&_.push(l);return}else if(_&&e.isList(l)){const I=[];a.createNodeMap(l["@list"],u,f,h,g,I),_.push({"@list":I});return}if("@type"in l){const I=l["@type"];for(const A of I)A.indexOf("_:")===0&&h.getId(A)}n.isUndefined(g)&&(g=e.isBlankNode(l)?h.getId(l["@id"]):l["@id"]),_&&_.push({"@id":g});const d=u[f],m=d[g]=d[g]||{};m["@id"]=g;const w=Object.keys(l).sort();for(let I of w){if(I==="@id")continue;if(I==="@reverse"){const N={"@id":g},P=l["@reverse"];for(const v in P){const y=P[v];for(const S of y){let O=S["@id"];e.isBlankNode(S)&&(O=h.getId(O)),a.createNodeMap(S,u,f,h,O),r.addValue(d[O],v,N,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if(I==="@graph"){g in u||(u[g]={}),a.createNodeMap(l[I],u,g,h);continue}if(I==="@included"){a.createNodeMap(l[I],u,f,h);continue}if(I!=="@type"&&i(I)){if(I==="@index"&&I in m&&(l[I]!==m[I]||l[I]["@id"]!==m[I]["@id"]))throw new o("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:m});m[I]=l[I];continue}const A=l[I];if(I.indexOf("_:")===0&&(I=h.getId(I)),A.length===0){r.addValue(m,I,[],{propertyIsArray:!0});continue}for(let N of A)if(I==="@type"&&(N=N.indexOf("_:")===0?h.getId(N):N),e.isSubject(N)||e.isSubjectReference(N)){if("@id"in N&&!N["@id"])continue;const P=e.isBlankNode(N)?h.getId(N["@id"]):N["@id"];r.addValue(m,I,{"@id":P},{propertyIsArray:!0,allowDuplicate:!1}),a.createNodeMap(N,u,f,h,P)}else if(e.isValue(N))r.addValue(m,I,N,{propertyIsArray:!0,allowDuplicate:!1});else if(e.isList(N)){const P=[];a.createNodeMap(N["@list"],u,f,h,g,P),N={"@list":P},r.addValue(m,I,N,{propertyIsArray:!0,allowDuplicate:!1})}else a.createNodeMap(N,u,f,h,g),r.addValue(m,I,N,{propertyIsArray:!0,allowDuplicate:!1})}},a.mergeNodeMapGraphs=l=>{const u={};for(const f of Object.keys(l).sort())for(const h of Object.keys(l[f]).sort()){const g=l[f][h];h in u||(u[h]={"@id":h});const _=u[h];for(const d of Object.keys(g).sort())if(i(d)&&d!=="@type")_[d]=r.clone(g[d]);else for(const m of g[d])r.addValue(_,d,r.clone(m),{propertyIsArray:!0,allowDuplicate:!1})}return u},a.mergeNodeMaps=l=>{const u=l["@default"],f=Object.keys(l).sort();for(const h of f){if(h==="@default")continue;const g=l[h];let _=u[h];_?"@graph"in _||(_["@graph"]=[]):u[h]=_={"@id":h,"@graph":[]};const d=_["@graph"];for(const m of Object.keys(g).sort()){const w=g[m];e.isSubjectReference(w)||d.push(w)}}return u},$a}var qa,Md;function Mm(){if(Md)return qa;Md=1;const{isSubjectReference:i}=On(),{createMergedNodeMap:e}=Ys(),n={};return qa=n,n.flatten=r=>{const o=e(r),a=[],l=Object.keys(o).sort();for(let u=0;u<l.length;++u){const f=o[l[u]];i(f)||a.push(f)}return a},qa}var za,Od;function Om(){if(Od)return za;Od=1;const i=Kt(),e=On(),n=zt(),{REGEX_BCP47:r,addValue:o}=Qt(),{handleEvent:a}=Qr(),{RDF_LIST:l,RDF_FIRST:u,RDF_REST:f,RDF_NIL:h,RDF_TYPE:g,RDF_JSON_LITERAL:_,XSD_BOOLEAN:d,XSD_DOUBLE:m,XSD_INTEGER:w,XSD_STRING:I}=Wl(),A={};za=A,A.fromRDF=async(v,y)=>{const{useRdfType:S=!1,useNativeTypes:O=!1,rdfDirection:X=null}=y,C={},U={"@default":C},R={};if(X){if(X==="compound-literal")throw new i("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:X});if(X!=="i18n-datatype")throw new i("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:X})}for(const j of v){const F=j.graph.termType==="DefaultGraph"?"@default":j.graph.value;F in U||(U[F]={}),F!=="@default"&&!(F in C)&&(C[F]={"@id":F});const se=U[F],M=P(j.subject),re=j.predicate.value,B=j.object;M in se||(se[M]={"@id":M});const oe=se[M],T=P(B),Q=!!T;if(Q&&!(T in se)&&(se[T]={"@id":T}),re===g&&!S&&Q){o(oe,"@type",T,{propertyIsArray:!0});continue}const ie=N(B,O,X,y);if(o(oe,re,ie,{propertyIsArray:!0}),Q)if(T===h){const Y=se[T];"usages"in Y||(Y.usages=[]),Y.usages.push({node:oe,property:re,value:ie})}else T in R?R[T]=!1:R[T]={node:oe,property:re,value:ie}}for(const j in U){const F=U[j];if(!(h in F))continue;const se=F[h];if(se.usages){for(let M of se.usages){let re=M.node,B=M.property,oe=M.value;const T=[],Q=[];let ie=Object.keys(re).length;for(;B===f&&n.isObject(R[re["@id"]])&&n.isArray(re[u])&&re[u].length===1&&n.isArray(re[f])&&re[f].length===1&&(ie===3||ie===4&&n.isArray(re["@type"])&&re["@type"].length===1&&re["@type"][0]===l)&&(T.push(re[u][0]),Q.push(re["@id"]),M=R[re["@id"]],re=M.node,B=M.property,oe=M.value,ie=Object.keys(re).length,!!e.isBlankNode(re)););delete oe["@id"],oe["@list"]=T.reverse();for(const Y of Q)delete F[Y]}delete se.usages}}const $=[],G=Object.keys(C).sort();for(const j of G){const F=C[j];if(j in U){const se=F["@graph"]=[],M=U[j],re=Object.keys(M).sort();for(const B of re){const oe=M[B];e.isSubjectReference(oe)||se.push(oe)}}e.isSubjectReference(F)||$.push(F)}return $};function N(v,y,S,O){const X=P(v);if(X)return{"@id":X};const C={"@value":v.value};if(v.language)v.language.match(r)||O.eventHandler&&a({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:v.language}},options:O}),C["@language"]=v.language;else{let U=v.datatype.value;if(U||(U=I),U===_){U="@json";try{C["@value"]=JSON.parse(C["@value"])}catch(R){throw new i("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:C["@value"],cause:R})}}if(y)if(U===d)C["@value"]==="true"||C["@value"]==="1"?C["@value"]=!0:C["@value"]==="false"||C["@value"]==="0"?C["@value"]=!1:C["@type"]=U;else if(U===w)if(n.isNumeric(C["@value"])){const R=parseInt(C["@value"],10);R.toFixed(0)===C["@value"]&&(C["@value"]=R)}else C["@type"]=U;else U===m&&n.isNumeric(C["@value"])?C["@value"]=parseFloat(C["@value"]):C["@type"]=U;else if(S==="i18n-datatype"&&U.startsWith("https://www.w3.org/ns/i18n#")){const[,R,$]=U.split(/[#_]/);R.length>0&&(C["@language"]=R,R.match(r)||O.eventHandler&&a({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:R}},options:O})),C["@direction"]=$}else U!==I&&(C["@type"]=U)}return C}function P(v){return v.termType==="NamedNode"?v.value:v.termType==="BlankNode"?"_:"+v.value:null}return za}var Ha,Fd;function Fm(){return Fd||(Fd=1,Ha=function i(e){if(typeof e=="number"&&isNaN(e))throw new Error("NaN is not allowed");if(typeof e=="number"&&!isFinite(e))throw new Error("Infinity is not allowed");return e===null||typeof e!="object"?JSON.stringify(e):e.toJSON instanceof Function?i(e.toJSON()):Array.isArray(e)?`[${e.reduce((o,a,l)=>`${o}${l===0?"":","}${i(a===void 0||typeof a=="symbol"?null:a)}`,"")}]`:`{${Object.keys(e).sort().reduce((r,o)=>{if(e[o]===void 0||typeof e[o]=="symbol")return r;const a=r.length===0?"":",";return`${r}${a}${i(o)}:${i(e[o])}`},"")}}`}),Ha}var Ua,jd;function jm(){if(jd)return Ua;jd=1;const{createNodeMap:i}=Ys(),{isKeyword:e}=wi(),n=On(),r=Fm(),o=Kt(),a=zt(),l=Qt(),{handleEvent:u}=Qr(),{RDF_FIRST:f,RDF_REST:h,RDF_NIL:g,RDF_TYPE:_,RDF_JSON_LITERAL:d,RDF_LANGSTRING:m,XSD_BOOLEAN:w,XSD_DOUBLE:I,XSD_INTEGER:A,XSD_STRING:N}=Wl(),{isAbsolute:P}=Jn(),v={};Ua=v,v.toRDF=(C,U)=>{const R=new l.IdentifierIssuer("_:b"),$={"@default":{}};i(C,$,"@default",R);const G=[],j=Object.keys($).sort();for(const F of j){let se;if(F==="@default")se={termType:"DefaultGraph",value:""};else if(P(F))se=X(F);else{U.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:F}},options:U});continue}y(G,$[F],se,R,U)}return G};function y(C,U,R,$,G){const j=Object.keys(U).sort();for(const F of j){const se=U[F],M=Object.keys(se).sort();for(let re of M){const B=se[re];if(re==="@type")re=_;else if(e(re))continue;for(const oe of B){const T=X(F);if(!P(F)){G.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:F}},options:G});continue}const Q=X(re);if(!P(re)){G.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:re}},options:G});continue}if(Q.termType==="BlankNode"&&!G.produceGeneralizedRdf){G.eventHandler&&u({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:$.getOldIds().find(Y=>$.getId(Y)===re)}},options:G});continue}const ie=O(oe,$,C,R,G.rdfDirection,G);ie&&C.push({subject:T,predicate:Q,object:ie,graph:R})}}}}function S(C,U,R,$,G,j){const F={termType:"NamedNode",value:f},se={termType:"NamedNode",value:h},M={termType:"NamedNode",value:g},re=C.pop(),B=re?{termType:"BlankNode",value:U.getId().slice(2)}:M;let oe=B;for(const T of C){const Q=O(T,U,R,$,G,j),ie={termType:"BlankNode",value:U.getId().slice(2)};R.push({subject:oe,predicate:F,object:Q,graph:$}),R.push({subject:oe,predicate:se,object:ie,graph:$}),oe=ie}if(re){const T=O(re,U,R,$,G,j);R.push({subject:oe,predicate:F,object:T,graph:$}),R.push({subject:oe,predicate:se,object:M,graph:$})}return B}function O(C,U,R,$,G,j){let F;if(n.isValue(C)){F={termType:"Literal",value:void 0,datatype:{termType:"NamedNode"}};let se=C["@value"];const M=C["@type"]||null;if(M==="@json")F.value=r(se),F.datatype.value=d;else if(a.isBoolean(se))F.value=se.toString(),F.datatype.value=M||w;else if(a.isDouble(se)||M===I)a.isDouble(se)||(se=parseFloat(se)),F.value=se.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),F.datatype.value=M||I;else if(a.isNumber(se))F.value=se.toFixed(0),F.datatype.value=M||A;else if("@direction"in C&&G==="i18n-datatype"){const re=(C["@language"]||"").toLowerCase(),B=C["@direction"],oe=`https://www.w3.org/ns/i18n#${re}_${B}`;F.datatype.value=oe,F.value=se}else{if("@direction"in C&&G==="compound-literal")throw new o("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:G});if("@direction"in C&&G)throw new o("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:G});"@language"in C?("@direction"in C&&!G&&j.eventHandler&&u({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:F.value}},options:j}),F.value=se,F.datatype.value=M||m,F.language=C["@language"]):("@direction"in C&&!G&&j.eventHandler&&u({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:F.value}},options:j}),F.value=se,F.datatype.value=M||N)}}else if(n.isList(C)){const se=S(C["@list"],U,R,$,G,j);F={termType:se.termType,value:se.value}}else{const se=a.isObject(C)?C["@id"]:C;F=X(se)}return F.termType==="NamedNode"&&!P(F.value)?(j.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:F.value}},options:j}),null):F}function X(C){return C.startsWith("_:")?{termType:"BlankNode",value:C.slice(2)}:{termType:"NamedNode",value:C}}return Ua}var Va,Bd;function Bm(){if(Bd)return Va;Bd=1;const{isKeyword:i}=wi(),e=On(),n=zt(),r=Qt(),o=Jn(),a=Kt(),{createNodeMap:l,mergeNodeMapGraphs:u}=Ys(),f={};Va=f,f.frameMergedOrDefault=(y,S,O)=>{const X={options:O,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},C=new r.IdentifierIssuer("_:b");l(y,X.graphMap,"@default",C),O.merged&&(X.graphMap["@merged"]=u(X.graphMap),X.graph="@merged"),X.subjects=X.graphMap[X.graph];const U=[];f.frame(X,Object.keys(X.subjects).sort(),S,U),O.pruneBlankNodeIdentifiers&&(O.bnodesToClear=Object.keys(X.bnodeMap).filter(R=>X.bnodeMap[R].length===1));return O.link={},A(U,O)},f.frame=(y,S,O,X,C=null)=>{d(O),O=O[0];const U=y.options,R={embed:_(O,U,"embed"),explicit:_(O,U,"explicit"),requireAll:_(O,U,"requireAll")};y.link.hasOwnProperty(y.graph)||(y.link[y.graph]={});const $=y.link[y.graph],G=m(y,S,O,R),j=Object.keys(G).sort();for(const F of j){const se=G[F];if(C===null?y.uniqueEmbeds={[y.graph]:{}}:y.uniqueEmbeds[y.graph]=y.uniqueEmbeds[y.graph]||{},R.embed==="@link"&&F in $){N(X,C,$[F]);continue}const M={"@id":F};if(F.indexOf("_:")===0&&r.addValue(y.bnodeMap,F,M,{propertyIsArray:!0}),$[F]=M,(R.embed==="@first"||R.embed==="@last")&&y.is11)throw new a("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:O});if(!(!y.embedded&&y.uniqueEmbeds[y.graph].hasOwnProperty(F))){if(y.embedded&&(R.embed==="@never"||g(se,y.graph,y.subjectStack))){N(X,C,M);continue}if(y.embedded&&(R.embed=="@first"||R.embed=="@once")&&y.uniqueEmbeds[y.graph].hasOwnProperty(F)){N(X,C,M);continue}if(R.embed==="@last"&&F in y.uniqueEmbeds[y.graph]&&I(y,F),y.uniqueEmbeds[y.graph][F]={parent:X,property:C},y.subjectStack.push({subject:se,graph:y.graph}),F in y.graphMap){let re=!1,B=null;"@graph"in O?(B=O["@graph"][0],re=!(F==="@merged"||F==="@default"),n.isObject(B)||(B={})):(re=y.graph!=="@merged",B={}),re&&f.frame({...y,graph:F,embedded:!1},Object.keys(y.graphMap[F]).sort(),[B],M,"@graph")}"@included"in O&&f.frame({...y,embedded:!1},S,O["@included"],M,"@included");for(const re of Object.keys(se).sort()){if(i(re)){if(M[re]=r.clone(se[re]),re==="@type")for(const B of se["@type"])B.indexOf("_:")===0&&r.addValue(y.bnodeMap,B,M,{propertyIsArray:!0});continue}if(!(R.explicit&&!(re in O)))for(const B of se[re]){const oe=re in O?O[re]:h(R);if(e.isList(B)){const T=O[re]&&O[re][0]&&O[re][0]["@list"]?O[re][0]["@list"]:h(R),Q={"@list":[]};N(M,re,Q);const ie=B["@list"];for(const Y of ie)e.isSubjectReference(Y)?f.frame({...y,embedded:!0},[Y["@id"]],T,Q,"@list"):N(Q,"@list",r.clone(Y))}else e.isSubjectReference(B)?f.frame({...y,embedded:!0},[B["@id"]],oe,M,re):v(oe[0],B)&&N(M,re,r.clone(B))}}for(const re of Object.keys(O).sort()){if(re==="@type"){if(!n.isObject(O[re][0])||!("@default"in O[re][0]))continue}else if(i(re))continue;const B=O[re][0]||{};if(!_(B,U,"omitDefault")&&!(re in M)){let T="@null";"@default"in B&&(T=r.clone(B["@default"])),n.isArray(T)||(T=[T]),M[re]=[{"@preserve":T}]}}for(const re of Object.keys(O["@reverse"]||{}).sort()){const B=O["@reverse"][re];for(const oe of Object.keys(y.subjects))r.getValues(y.subjects[oe],re).some(Q=>Q["@id"]===F)&&(M["@reverse"]=M["@reverse"]||{},r.addValue(M["@reverse"],re,[],{propertyIsArray:!0}),f.frame({...y,embedded:!0},[oe],B,M["@reverse"][re],C))}N(X,C,M),y.subjectStack.pop()}}},f.cleanupNull=(y,S)=>{if(n.isArray(y))return y.map(X=>f.cleanupNull(X,S)).filter(X=>X);if(y==="@null")return null;if(n.isObject(y)){if("@id"in y){const O=y["@id"];if(S.link.hasOwnProperty(O)){const X=S.link[O].indexOf(y);if(X!==-1)return S.link[O][X];S.link[O].push(y)}else S.link[O]=[y]}for(const O in y)y[O]=f.cleanupNull(y[O],S)}return y};function h(y){const S={};for(const O in y)y[O]!==void 0&&(S["@"+O]=[y[O]]);return[S]}function g(y,S,O){for(let X=O.length-1;X>=0;--X){const C=O[X];if(C.graph===S&&C.subject["@id"]===y["@id"])return!0}return!1}function _(y,S,O){const X="@"+O;let C=X in y?y[X][0]:S[O];if(O==="embed"){if(C===!0)C="@once";else if(C===!1)C="@never";else if(C!=="@always"&&C!=="@never"&&C!=="@link"&&C!=="@first"&&C!=="@last"&&C!=="@once")throw new a("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:y})}return C}function d(y){if(!n.isArray(y)||y.length!==1||!n.isObject(y[0]))throw new a("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:y});if("@id"in y[0]){for(const S of r.asArray(y[0]["@id"]))if(!(n.isObject(S)||o.isAbsolute(S))||n.isString(S)&&S.indexOf("_:")===0)throw new a("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:y})}if("@type"in y[0]){for(const S of r.asArray(y[0]["@type"]))if(!(n.isObject(S)||o.isAbsolute(S)||S==="@json")||n.isString(S)&&S.indexOf("_:")===0)throw new a("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:y})}}function m(y,S,O,X){const C={};for(const U of S){const R=y.graphMap[y.graph][U];w(y,R,O,X)&&(C[U]=R)}return C}function w(y,S,O,X){let C=!0,U=!1;for(const R in O){let $=!1;const G=r.getValues(S,R),j=r.getValues(O,R).length===0;if(R==="@id"){if(n.isEmptyObject(O["@id"][0]||{})?$=!0:O["@id"].length>=0&&($=O["@id"].includes(G[0])),!X.requireAll)return $}else if(R==="@type"){if(C=!1,j){if(G.length>0)return!1;$=!0}else if(O["@type"].length===1&&n.isEmptyObject(O["@type"][0]))$=G.length>0;else for(const F of O["@type"])n.isObject(F)&&"@default"in F?$=!0:$=$||G.some(se=>se===F);if(!X.requireAll)return $}else{if(i(R))continue;{const F=r.getValues(O,R)[0];let se=!1;if(F&&(d([F]),se="@default"in F),C=!1,G.length===0&&se)continue;if(G.length>0&&j)return!1;if(F===void 0){if(G.length>0)return!1;$=!0}else if(e.isList(F)){const M=F["@list"][0];if(e.isList(G[0])){const re=G[0]["@list"];e.isValue(M)?$=re.some(B=>v(M,B)):(e.isSubject(M)||e.isSubjectReference(M))&&($=re.some(B=>P(y,M,B,X)))}}else e.isValue(F)?$=G.some(M=>v(F,M)):e.isSubjectReference(F)?$=G.some(M=>P(y,F,M,X)):n.isObject(F)?$=G.length>0:$=!1}}if(!$&&X.requireAll)return!1;U=U||$}return C||U}function I(y,S){const O=y.uniqueEmbeds[y.graph],X=O[S],C=X.parent,U=X.property,R={"@id":S};if(n.isArray(C)){for(let G=0;G<C.length;++G)if(r.compareValues(C[G],R)){C[G]=R;break}}else{const G=n.isArray(C[U]);r.removeValue(C,U,R,{propertyIsArray:G}),r.addValue(C,U,R,{propertyIsArray:G})}const $=G=>{const j=Object.keys(O);for(const F of j)F in O&&n.isObject(O[F].parent)&&O[F].parent["@id"]===G&&(delete O[F],$(F))};$(S)}function A(y,S){if(n.isArray(y))return y.map(O=>A(O,S));if(n.isObject(y)){if("@preserve"in y)return y["@preserve"][0];if(e.isValue(y))return y;if(e.isList(y))return y["@list"]=A(y["@list"],S),y;if("@id"in y){const O=y["@id"];if(S.link.hasOwnProperty(O)){const X=S.link[O].indexOf(y);if(X!==-1)return S.link[O][X];S.link[O].push(y)}else S.link[O]=[y]}for(const O in y){if(O==="@id"&&S.bnodesToClear.includes(y[O])){delete y["@id"];continue}y[O]=A(y[O],S)}}return y}function N(y,S,O){n.isObject(y)?r.addValue(y,S,O,{propertyIsArray:!0}):y.push(O)}function P(y,S,O,X){if(!("@id"in O))return!1;const C=y.subjects[O["@id"]];return C&&w(y,C,S,X)}function v(y,S){const O=S["@value"],X=S["@type"],C=S["@language"],U=y["@value"]?n.isArray(y["@value"])?y["@value"]:[y["@value"]]:[],R=y["@type"]?n.isArray(y["@type"])?y["@type"]:[y["@type"]]:[],$=y["@language"]?n.isArray(y["@language"])?y["@language"]:[y["@language"]]:[];return U.length===0&&R.length===0&&$.length===0?!0:!(!(U.includes(O)||n.isEmptyObject(U[0]))||!(!X&&R.length===0||R.includes(X)||X&&n.isEmptyObject(R[0]))||!(!C&&$.length===0||$.includes(C)||C&&n.isEmptyObject($[0])))}return Va}var Wa,$d;function $m(){if($d)return Wa;$d=1;const i=Kt(),{isArray:e,isObject:n,isString:r,isUndefined:o}=zt(),{isList:a,isValue:l,isGraph:u,isSimpleGraph:f,isSubjectReference:h}=On(),{expandIri:g,getContextValue:_,isKeyword:d,process:m,processingMode:w}=wi(),{removeBase:I,prependBase:A}=Jn(),{REGEX_KEYWORD:N,addValue:P,asArray:v,compareShortestLeast:y}=Qt(),S={};Wa=S,S.compact=async({activeCtx:C,activeProperty:U=null,element:R,options:$={}})=>{if(e(R)){let j=[];for(let F=0;F<R.length;++F){const se=await S.compact({activeCtx:C,activeProperty:U,element:R[F],options:$});se!==null&&j.push(se)}return $.compactArrays&&j.length===1&&(_(C,U,"@container")||[]).length===0&&(j=j[0]),j}const G=_(C,U,"@context");if(o(G)||(C=await m({activeCtx:C,localCtx:G,propagate:!0,overrideProtected:!0,options:$})),n(R)){if($.link&&"@id"in R&&$.link.hasOwnProperty(R["@id"])){const T=$.link[R["@id"]];for(let Q=0;Q<T.length;++Q)if(T[Q].expanded===R)return T[Q].compacted}if(l(R)||h(R)){const T=S.compactValue({activeCtx:C,activeProperty:U,value:R,options:$});return $.link&&h(R)&&($.link.hasOwnProperty(R["@id"])||($.link[R["@id"]]=[]),$.link[R["@id"]].push({expanded:R,compacted:T})),T}if(a(R)&&(_(C,U,"@container")||[]).includes("@list"))return S.compact({activeCtx:C,activeProperty:U,element:R["@list"],options:$});const j=U==="@reverse",F={},se=C;!l(R)&&!h(R)&&(C=C.revertToPreviousContext());const M=_(se,U,"@context");o(M)||(C=await m({activeCtx:C,localCtx:M,propagate:!0,overrideProtected:!0,options:$})),$.link&&"@id"in R&&($.link.hasOwnProperty(R["@id"])||($.link[R["@id"]]=[]),$.link[R["@id"]].push({expanded:R,compacted:F}));let re=R["@type"]||[];re.length>1&&(re=Array.from(re).sort());const B=C;for(const T of re){const Q=S.compactIri({activeCtx:B,iri:T,relativeTo:{vocab:!0}}),ie=_(se,Q,"@context");o(ie)||(C=await m({activeCtx:C,localCtx:ie,options:$,propagate:!1}))}const oe=Object.keys(R).sort();for(const T of oe){const Q=R[T];if(T==="@id"){let ie=v(Q).map(me=>S.compactIri({activeCtx:C,iri:me,relativeTo:{vocab:!1},base:$.base}));ie.length===1&&(ie=ie[0]);const Y=S.compactIri({activeCtx:C,iri:"@id",relativeTo:{vocab:!0}});F[Y]=ie;continue}if(T==="@type"){let ie=v(Q).map(ee=>S.compactIri({activeCtx:se,iri:ee,relativeTo:{vocab:!0}}));ie.length===1&&(ie=ie[0]);const Y=S.compactIri({activeCtx:C,iri:"@type",relativeTo:{vocab:!0}}),W=(_(C,Y,"@container")||[]).includes("@set")&&w(C,1.1)||e(ie)&&Q.length===0;P(F,Y,ie,{propertyIsArray:W});continue}if(T==="@reverse"){const ie=await S.compact({activeCtx:C,activeProperty:"@reverse",element:Q,options:$});for(const Y in ie)if(C.mappings.has(Y)&&C.mappings.get(Y).reverse){const me=ie[Y],W=(_(C,Y,"@container")||[]).includes("@set")||!$.compactArrays;P(F,Y,me,{propertyIsArray:W}),delete ie[Y]}if(Object.keys(ie).length>0){const Y=S.compactIri({activeCtx:C,iri:T,relativeTo:{vocab:!0}});P(F,Y,ie)}continue}if(T==="@preserve"){const ie=await S.compact({activeCtx:C,activeProperty:U,element:Q,options:$});e(ie)&&ie.length===0||P(F,T,ie);continue}if(T==="@index"){if((_(C,U,"@container")||[]).includes("@index"))continue;const Y=S.compactIri({activeCtx:C,iri:T,relativeTo:{vocab:!0}});P(F,Y,Q);continue}if(T!=="@graph"&&T!=="@list"&&T!=="@included"&&d(T)){const ie=S.compactIri({activeCtx:C,iri:T,relativeTo:{vocab:!0}});P(F,ie,Q);continue}if(!e(Q))throw new i("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(Q.length===0){const ie=S.compactIri({activeCtx:C,iri:T,value:Q,relativeTo:{vocab:!0},reverse:j}),Y=C.mappings.has(ie)?C.mappings.get(ie)["@nest"]:null;let me=F;Y&&(X(C,Y,$),n(F[Y])||(F[Y]={}),me=F[Y]),P(me,ie,Q,{propertyIsArray:!0})}for(const ie of Q){const Y=S.compactIri({activeCtx:C,iri:T,value:ie,relativeTo:{vocab:!0},reverse:j}),me=C.mappings.has(Y)?C.mappings.get(Y)["@nest"]:null;let Z=F;me&&(X(C,me,$),n(F[me])||(F[me]={}),Z=F[me]);const W=_(C,Y,"@container")||[],ee=u(ie),K=a(ie);let ue;K?ue=ie["@list"]:ee&&(ue=ie["@graph"]);let ce=await S.compact({activeCtx:C,activeProperty:Y,element:K||ee?ue:ie,options:$});if(K)if(e(ce)||(ce=[ce]),!W.includes("@list"))ce={[S.compactIri({activeCtx:C,iri:"@list",relativeTo:{vocab:!0}})]:ce},"@index"in ie&&(ce[S.compactIri({activeCtx:C,iri:"@index",relativeTo:{vocab:!0}})]=ie["@index"]);else{P(Z,Y,ce,{valueIsArray:!0,allowDuplicate:!0});continue}if(ee)if(W.includes("@graph")&&(W.includes("@id")||W.includes("@index")&&f(ie))){let Ee;Z.hasOwnProperty(Y)?Ee=Z[Y]:Z[Y]=Ee={};const Te=(W.includes("@id")?ie["@id"]:ie["@index"])||S.compactIri({activeCtx:C,iri:"@none",relativeTo:{vocab:!0}});P(Ee,Te,ce,{propertyIsArray:!$.compactArrays||W.includes("@set")})}else W.includes("@graph")&&f(ie)?(e(ce)&&ce.length>1&&(ce={"@included":ce}),P(Z,Y,ce,{propertyIsArray:!$.compactArrays||W.includes("@set")})):(e(ce)&&ce.length===1&&$.compactArrays&&(ce=ce[0]),ce={[S.compactIri({activeCtx:C,iri:"@graph",relativeTo:{vocab:!0}})]:ce},"@id"in ie&&(ce[S.compactIri({activeCtx:C,iri:"@id",relativeTo:{vocab:!0}})]=ie["@id"]),"@index"in ie&&(ce[S.compactIri({activeCtx:C,iri:"@index",relativeTo:{vocab:!0}})]=ie["@index"]),P(Z,Y,ce,{propertyIsArray:!$.compactArrays||W.includes("@set")}));else if(W.includes("@language")||W.includes("@index")||W.includes("@id")||W.includes("@type")){let Ee;Z.hasOwnProperty(Y)?Ee=Z[Y]:Z[Y]=Ee={};let Te;if(W.includes("@language"))l(ce)&&(ce=ce["@value"]),Te=ie["@language"];else if(W.includes("@index")){const q=_(C,Y,"@index")||"@index",te=S.compactIri({activeCtx:C,iri:q,relativeTo:{vocab:!0}});if(q==="@index")Te=ie["@index"],delete ce[te];else{let fe;if([Te,...fe]=v(ce[q]||[]),!r(Te))Te=null;else switch(fe.length){case 0:delete ce[q];break;case 1:ce[q]=fe[0];break;default:ce[q]=fe;break}}}else if(W.includes("@id")){const q=S.compactIri({activeCtx:C,iri:"@id",relativeTo:{vocab:!0}});Te=ce[q],delete ce[q]}else if(W.includes("@type")){const q=S.compactIri({activeCtx:C,iri:"@type",relativeTo:{vocab:!0}});let te;switch([Te,...te]=v(ce[q]||[]),te.length){case 0:delete ce[q];break;case 1:ce[q]=te[0];break;default:ce[q]=te;break}Object.keys(ce).length===1&&"@id"in ie&&(ce=await S.compact({activeCtx:C,activeProperty:Y,element:{"@id":ie["@id"]},options:$}))}Te||(Te=S.compactIri({activeCtx:C,iri:"@none",relativeTo:{vocab:!0}})),P(Ee,Te,ce,{propertyIsArray:W.includes("@set")})}else{const Ee=!$.compactArrays||W.includes("@set")||W.includes("@list")||e(ce)&&ce.length===0||T==="@list"||T==="@graph";P(Z,Y,ce,{propertyIsArray:Ee})}}}return F}return R},S.compactIri=({activeCtx:C,iri:U,value:R=null,relativeTo:$={vocab:!1},reverse:G=!1,base:j=null})=>{if(U===null)return U;C.isPropertyTermScoped&&C.previousContext&&(C=C.previousContext);const F=C.getInverse();if(d(U)&&U in F&&"@none"in F[U]&&"@type"in F[U]["@none"]&&"@none"in F[U]["@none"]["@type"])return F[U]["@none"]["@type"]["@none"];if($.vocab&&U in F){const oe=C["@language"]||"@none",T=[];n(R)&&"@index"in R&&!("@graph"in R)&&T.push("@index","@index@set"),n(R)&&"@preserve"in R&&(R=R["@preserve"][0]),u(R)?("@index"in R&&T.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in R&&T.push("@graph@id","@graph@id@set"),T.push("@graph","@graph@set","@set"),"@index"in R||T.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in R||T.push("@graph@id","@graph@id@set")):n(R)&&!l(R)&&T.push("@id","@id@set","@type","@set@type");let Q="@language",ie="@null";if(G)Q="@type",ie="@reverse",T.push("@set");else if(a(R)){"@index"in R||T.push("@list");const me=R["@list"];if(me.length===0)Q="@any",ie="@none";else{let Z=me.length===0?oe:null,W=null;for(let ee=0;ee<me.length;++ee){const K=me[ee];let ue="@none",ce="@none";if(l(K))if("@direction"in K){const Ee=(K["@language"]||"").toLowerCase(),Te=K["@direction"];ue=`${Ee}_${Te}`}else"@language"in K?ue=K["@language"].toLowerCase():"@type"in K?ce=K["@type"]:ue="@null";else ce="@id";if(Z===null?Z=ue:ue!==Z&&l(K)&&(Z="@none"),W===null?W=ce:ce!==W&&(W="@none"),Z==="@none"&&W==="@none")break}Z=Z||"@none",W=W||"@none",W!=="@none"?(Q="@type",ie=W):ie=Z}}else{if(l(R))if("@language"in R&&!("@index"in R)){T.push("@language","@language@set"),ie=R["@language"];const me=R["@direction"];me&&(ie=`${ie}_${me}`)}else"@direction"in R&&!("@index"in R)?ie=`_${R["@direction"]}`:"@type"in R&&(Q="@type",ie=R["@type"]);else Q="@type",ie="@id";T.push("@set")}T.push("@none"),n(R)&&!("@index"in R)&&T.push("@index","@index@set"),l(R)&&Object.keys(R).length===1&&T.push("@language","@language@set");const Y=O(C,U,R,T,Q,ie);if(Y!==null)return Y}if($.vocab&&"@vocab"in C){const oe=C["@vocab"];if(U.indexOf(oe)===0&&U!==oe){const T=U.substr(oe.length);if(!C.mappings.has(T))return T}}let se=null;const M=[];let re=C.fastCurieMap;const B=U.length-1;for(let oe=0;oe<B&&U[oe]in re;++oe)re=re[U[oe]],""in re&&M.push(re[""][0]);for(let oe=M.length-1;oe>=0;--oe){const T=M[oe],Q=T.terms;for(const ie of Q){const Y=ie+":"+U.substr(T.iri.length);C.mappings.get(ie)._prefix&&(!C.mappings.has(Y)||R===null&&C.mappings.get(Y)["@id"]===U)&&(se===null||y(Y,se)<0)&&(se=Y)}}if(se!==null)return se;for(const[oe,T]of C.mappings)if(T&&T._prefix&&U.startsWith(oe+":"))throw new i(`Absolute IRI "${U}" confused with prefix "${oe}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:C});if(!$.vocab)if("@base"in C)if(C["@base"]){const oe=I(A(j,C["@base"]),U);return N.test(oe)?`./${oe}`:oe}else return U;else return I(j,U);return U},S.compactValue=({activeCtx:C,activeProperty:U,value:R,options:$})=>{if(l(R)){const se=_(C,U,"@type"),M=_(C,U,"@language"),re=_(C,U,"@direction"),B=_(C,U,"@container")||[],oe="@index"in R&&!B.includes("@index");if(!oe&&se!=="@none"&&(R["@type"]===se||"@language"in R&&R["@language"]===M&&"@direction"in R&&R["@direction"]===re||"@language"in R&&R["@language"]===M||"@direction"in R&&R["@direction"]===re))return R["@value"];const T=Object.keys(R).length,Q=T===1||T===2&&"@index"in R&&!oe,ie="@language"in C,Y=r(R["@value"]),me=C.mappings.has(U)&&C.mappings.get(U)["@language"]===null;if(Q&&se!=="@none"&&(!ie||!Y||me))return R["@value"];const Z={};return oe&&(Z[S.compactIri({activeCtx:C,iri:"@index",relativeTo:{vocab:!0}})]=R["@index"]),"@type"in R?Z[S.compactIri({activeCtx:C,iri:"@type",relativeTo:{vocab:!0}})]=S.compactIri({activeCtx:C,iri:R["@type"],relativeTo:{vocab:!0}}):"@language"in R&&(Z[S.compactIri({activeCtx:C,iri:"@language",relativeTo:{vocab:!0}})]=R["@language"]),"@direction"in R&&(Z[S.compactIri({activeCtx:C,iri:"@direction",relativeTo:{vocab:!0}})]=R["@direction"]),Z[S.compactIri({activeCtx:C,iri:"@value",relativeTo:{vocab:!0}})]=R["@value"],Z}const G=g(C,U,{vocab:!0},$),j=_(C,U,"@type"),F=S.compactIri({activeCtx:C,iri:R["@id"],relativeTo:{vocab:j==="@vocab"},base:$.base});return j==="@id"||j==="@vocab"||G==="@graph"?F:{[S.compactIri({activeCtx:C,iri:"@id",relativeTo:{vocab:!0}})]:F}};function O(C,U,R,$,G,j){j===null&&(j="@null");const F=[];if((j==="@id"||j==="@reverse")&&n(R)&&"@id"in R){j==="@reverse"&&F.push("@reverse");const M=S.compactIri({activeCtx:C,iri:R["@id"],relativeTo:{vocab:!0}});C.mappings.has(M)&&C.mappings.get(M)&&C.mappings.get(M)["@id"]===R["@id"]?F.push.apply(F,["@vocab","@id"]):F.push.apply(F,["@id","@vocab"])}else{F.push(j);const M=F.find(re=>re.includes("_"));M&&F.push(M.replace(/^[^_]+_/,"_"))}F.push("@none");const se=C.inverse[U];for(const M of $){if(!(M in se))continue;const re=se[M][G];for(const B of F)if(B in re)return re[B]}return null}function X(C,U,R){if(g(C,U,{vocab:!0},R)!=="@nest")throw new i("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}return Wa}var Ga,qd;function qm(){return qd||(qd=1,Ga=i=>{class e{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(e,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(e.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:e}),e.compact=function(n,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):i.compact(n,r)},e.expand=function(n){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):i.expand(n)},e.flatten=function(n){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):i.flatten(n)},e}),Ga}var Za,zd;function zm(){if(zd)return Za;zd=1;const i=Vl(),e=Am(),n=Qt(),r=Pm(),o=n.IdentifierIssuer,a=Kt(),l=$f(),u=km(),{expand:f}=Dm(),{flatten:h}=Mm(),{fromRDF:g}=Om(),{toRDF:_}=jm(),{frameMergedOrDefault:d,cleanupNull:m}=Bm(),{isArray:w,isObject:I,isString:A}=zt(),{isSubjectReference:N}=On(),{expandIri:P,getInitialContext:v,process:y,processingMode:S}=wi(),{compact:O,compactIri:X}=$m(),{createNodeMap:C,createMergedNodeMap:U,mergeNodeMaps:R}=Ys(),{logEventHandler:$,logWarningEventHandler:G,safeEventHandler:j,setDefaultEventHandler:F,setupEventHandler:se,strictEventHandler:M,unhandledEventHandler:re}=Qr(),B=function(T){const Q={},Y=new l({max:100});T.compact=async function(Z,W,ee){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(W===null)throw new a("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(Z===null)return null;ee=me(ee,{base:A(Z)?Z:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new o("_:b"),contextResolver:new r({sharedCache:Y})}),ee.link&&(ee.skipExpansion=!0),ee.compactToRelative||delete ee.base;let K;ee.skipExpansion?K=Z:K=await T.expand(Z,ee);const ue=await T.processContext(v(ee),W,ee);let ce=await O({activeCtx:ue,element:K,options:ee});ee.compactArrays&&!ee.graph&&w(ce)?ce.length===1?ce=ce[0]:ce.length===0&&(ce={}):ee.graph&&I(ce)&&(ce=[ce]),I(W)&&"@context"in W&&(W=W["@context"]),W=n.clone(W),w(W)||(W=[W]);const Ee=W;W=[];for(let q=0;q<Ee.length;++q)(!I(Ee[q])||Object.keys(Ee[q]).length>0)&&W.push(Ee[q]);const Te=W.length>0;if(W.length===1&&(W=W[0]),w(ce)){const q=X({activeCtx:ue,iri:"@graph",relativeTo:{vocab:!0}}),te=ce;ce={},Te&&(ce["@context"]=W),ce[q]=te}else if(I(ce)&&Te){const q=ce;ce={"@context":W};for(const te in q)ce[te]=q[te]}return ce},T.expand=async function(Z,W){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");W=me(W,{keepFreeFloatingNodes:!1,contextResolver:new r({sharedCache:Y})});const ee={},K=[];if("expandContext"in W){const Te=n.clone(W.expandContext);I(Te)&&"@context"in Te?ee.expandContext=Te:ee.expandContext={"@context":Te},K.push(ee.expandContext)}let ue;if(!A(Z))ee.input=n.clone(Z);else{const Te=await T.get(Z,W);ue=Te.documentUrl,ee.input=Te.document,Te.contextUrl&&(ee.remoteContext={"@context":Te.contextUrl},K.push(ee.remoteContext))}"base"in W||(W.base=ue||"");let ce=v(W);for(const Te of K)ce=await y({activeCtx:ce,localCtx:Te,options:W});let Ee=await f({activeCtx:ce,element:ee.input,options:W});return I(Ee)&&"@graph"in Ee&&Object.keys(Ee).length===1?Ee=Ee["@graph"]:Ee===null&&(Ee=[]),w(Ee)||(Ee=[Ee]),Ee},T.flatten=async function(Z,W,ee){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");typeof W=="function"?W=null:W=W||null,ee=me(ee,{base:A(Z)?Z:"",contextResolver:new r({sharedCache:Y})});const K=await T.expand(Z,ee),ue=h(K);return W===null?ue:(ee.graph=!0,ee.skipExpansion=!0,await T.compact(ue,W,ee))},T.frame=async function(Z,W,ee){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(ee=me(ee,{base:A(Z)?Z:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new r({sharedCache:Y})}),A(W)){const xe=await T.get(W,ee);if(W=xe.document,xe.contextUrl){let Se=W["@context"];Se?w(Se)?Se.push(xe.contextUrl):Se=[Se,xe.contextUrl]:Se=xe.contextUrl,W["@context"]=Se}}const K=W?W["@context"]||{}:{},ue=await T.processContext(v(ee),K,ee);ee.hasOwnProperty("omitGraph")||(ee.omitGraph=S(ue,1.1)),ee.hasOwnProperty("pruneBlankNodeIdentifiers")||(ee.pruneBlankNodeIdentifiers=S(ue,1.1));const ce=await T.expand(Z,ee),Ee={...ee};Ee.isFrame=!0,Ee.keepFreeFloatingNodes=!0;const Te=await T.expand(W,Ee),q=Object.keys(W).map(xe=>P(ue,xe,{vocab:!0}));Ee.merged=!q.includes("@graph"),Ee.is11=S(ue,1.1);const te=d(ce,Te,Ee);Ee.graph=!ee.omitGraph,Ee.skipExpansion=!0,Ee.link={},Ee.framing=!0;let fe=await T.compact(te,K,Ee);return Ee.link={},fe=m(fe,Ee),fe},T.link=async function(Z,W,ee){const K={};return W&&(K["@context"]=W),K["@embed"]="@link",T.frame(Z,K,ee)},T.normalize=T.canonize=async function(Z,W){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");W=me(W,{skipExpansion:!1,safe:!0,contextResolver:new r({sharedCache:Y})});const ee=Object.assign({},{algorithm:"RDFC-1.0"},W.canonizeOptions||null);if("inputFormat"in W){if(W.inputFormat!=="application/n-quads")throw new a("Unknown canonicalization input format.","jsonld.CanonizeError");const ce=u.parse(Z);return i.canonize(ce,ee)}const K={...W};delete K.format,delete K.canonizeOptions,K.produceGeneralizedRdf=!1;const ue=await T.toRDF(Z,K);return i.canonize(ue,ee)},T.fromRDF=async function(Z,W){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");W=me(W,{format:A(Z)?"application/n-quads":void 0});const{format:ee}=W;let{rdfParser:K}=W;if(ee){if(K=K||Q[ee],!K)throw new a("Unknown input format.","jsonld.UnknownFormat",{format:ee})}else K=()=>Z;const ue=await K(Z);return g(ue,W)},T.toRDF=async function(Z,W){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");W=me(W,{skipExpansion:!1,contextResolver:new r({sharedCache:Y})});let ee;W.skipExpansion?ee=Z:ee=await T.expand(Z,W);const K=_(ee,W);if(W.format){if(W.format==="application/n-quads")return u.serialize(K);throw new a("Unknown output format.","jsonld.UnknownFormat",{format:W.format})}return K},T.createNodeMap=async function(Z,W){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");W=me(W,{base:A(Z)?Z:"",contextResolver:new r({sharedCache:Y})});const ee=await T.expand(Z,W);return U(ee,W)},T.merge=async function(Z,W,ee){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!w(Z))throw new TypeError('Could not merge, "docs" must be an array.');typeof W=="function"?W=null:W=W||null,ee=me(ee,{contextResolver:new r({sharedCache:Y})});const K=await Promise.all(Z.map(xe=>{const Se={...ee};return T.expand(xe,Se)}));let ue=!0;"mergeNodes"in ee&&(ue=ee.mergeNodes);const ce=ee.issuer||new o("_:b"),Ee={"@default":{}};for(let xe=0;xe<K.length;++xe){const Se=n.relabelBlankNodes(K[xe],{issuer:new o("_:b"+xe+"-")}),Ie=ue||xe===0?Ee:{"@default":{}};if(C(Se,Ie,"@default",ce),Ie!==Ee)for(const le in Ie){const ve=Ie[le];if(!(le in Ee)){Ee[le]=ve;continue}const Ae=Ee[le];for(const be in ve)be in Ae||(Ae[be]=ve[be])}}const Te=R(Ee),q=[],te=Object.keys(Te).sort();for(let xe=0;xe<te.length;++xe){const Se=Te[te[xe]];N(Se)||q.push(Se)}return W===null?q:(ee.graph=!0,ee.skipExpansion=!0,await T.compact(q,W,ee))},Object.defineProperty(T,"documentLoader",{get:()=>T._documentLoader,set:Z=>T._documentLoader=Z}),T.documentLoader=async Z=>{throw new a("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:Z})},T.get=async function(Z,W){let ee;typeof W.documentLoader=="function"?ee=W.documentLoader:ee=T.documentLoader;const K=await ee(Z);try{if(!K.document)throw new a("No remote document found at the given URL.","jsonld.NullRemoteDocument");A(K.document)&&(K.document=JSON.parse(K.document))}catch(ue){throw new a("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:ue,remoteDoc:K})}return K},T.processContext=async function(Z,W,ee){return ee=me(ee,{base:"",contextResolver:new r({sharedCache:Y})}),W===null?v(ee):(W=n.clone(W),I(W)&&"@context"in W||(W={"@context":W}),y({activeCtx:Z,localCtx:W,options:ee}))},T.getContextValue=wi().getContextValue,T.documentLoaders={},T.useDocumentLoader=function(Z){if(!(Z in T.documentLoaders))throw new a('Unknown document loader type: "'+Z+'"',"jsonld.UnknownDocumentLoader",{type:Z});T.documentLoader=T.documentLoaders[Z].apply(T,Array.prototype.slice.call(arguments,1))},T.registerRDFParser=function(Z,W){Q[Z]=W},T.unregisterRDFParser=function(Z){delete Q[Z]},T.registerRDFParser("application/n-quads",u.parse),T.url=Jn(),T.logEventHandler=$,T.logWarningEventHandler=G,T.safeEventHandler=j,T.setDefaultEventHandler=F,T.strictEventHandler=M,T.unhandledEventHandler=re,T.util=n,Object.assign(T,n),T.promises=T,T.RequestQueue=Bf(),T.JsonLdProcessor=qm()(T),e.setupGlobals(T),e.setupDocumentLoaders(T);function me(Z,{documentLoader:W=T.documentLoader,...ee}){if(Z&&"compactionMap"in Z)throw new a('"compactionMap" not supported.',"jsonld.OptionsError");if(Z&&"expansionMap"in Z)throw new a('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:W},ee,Z,{eventHandler:se({options:Z})})}return T},oe=function(){return B(function(){return oe()})};return B(oe),Za=oe,Za}var Hm=zm();const Um=rf(Hm),Ss={},Vi={};async function Vm(i){const e={store:new It,importedUrls:[],atts:i},n=[];if(i.shapes?n.push(Rn(Ui(i.shapes),e,an)):i.shapesUrl&&n.push(Rn(Ns(i.shapesUrl,e.atts.proxy),e,an)),i.values?n.push(Rn(Ui(i.values),e,Ft)):i.valuesUrl&&n.push(Rn(Ns(i.valuesUrl,e.atts.proxy),e,Ft)),await Promise.all(n),i.classInstanceProvider)try{const r=am(e.store),o=await i.classInstanceProvider(r);o&&await Rn(Ui(o),e,an)}catch(r){console.error("failed loading class instances",r)}if(i.valuesSubject&&e.store.countQuads(null,null,null,an)===0){const r=[...e.store.getObjects(i.valuesSubject,Rt,Ft),...e.store.getObjects(i.valuesSubject,Fs,Ft)],o=[];for(const a of r){let l=qf(a.value);!l&&a.value.startsWith("urn:")&&e.atts.proxy&&(l=a.value),l&&e.importedUrls.indexOf(l)<0&&(e.importedUrls.push(l),o.push(Rn(Ns(l,e.atts.proxy),e,an)))}try{await Promise.allSettled(o)}catch(a){console.warn(a)}}return e.store}async function Rn(i,e,n){const r=await i,o=[];for(const a of r){let l=n;if(e.atts.valuesSubject&&Ft.equals(n)&&a.graph.id&&a.graph.id!==e.atts.valuesSubject&&(l=a.graph),e.store.add(Be.quad(a.subject,a.predicate,a.object,l)),e.atts.loadOwlImports&&$l.equals(a.predicate)){const u=qf(a.object.value);u&&e.importedUrls.indexOf(u)<0&&(e.importedUrls.push(u),o.push(Rn(Ns(u,e.atts.proxy),e,Be.namedNode(u))))}}await Promise.allSettled(o)}async function Ns(i,e){return i in Ss||(Ss[i]=(async()=>{let n=i;e&&(n=e+encodeURIComponent(i));const r=await fetch(n,{headers:{Accept:"text/turtle, application/trig, application/n-triples, application/n-quads, text/n3, application/ld+json"}});if(r.ok){const o=await r.text();return Ui(o)}else return console.warn("failed fetching RDF from",i),[]})()),Ss[i]}async function Ui(i){if(!i.trim())return[];const e=Wm(i);if(e==="json")try{i=await Um.toRDF(JSON.parse(i),{format:"application/n-quads"})}catch(r){console.error(r)}const n=[];return await new Promise((r,o)=>{const a=e==="xml"?new xm.RdfXmlParser:new Xg;a.on("data",l=>{n.push(Be.quad(l.subject,l.predicate,l.object,l.graph))}).on("error",l=>{o(l)}).on("prefix",(l,u)=>{l&&(Vi[l]=u)}).on("end",()=>{r(null)}),a.write(i),a.end()}),n}function qf(i){if(El(i))return i;const e=i.split(":");if(e.length===2){const n=Vi[e[0]];if(n&&(i=i.replace(`${e[0]}:`,n),El(i)))return i}return null}function Wm(i){return/^\s*[\\[{]/.test(i)?"json":/^\s*<\?xml/.test(i)?"xml":"ttl"}const Gm={[`${Fe}name`]:(i,e)=>{const n=e;i.name=js(i.config.languages,i.name,n)},[`${Fe}description`]:(i,e)=>{const n=e;i.description=js(i.config.languages,i.description,n)},[`${Fe}path`]:(i,e)=>{i.path=e.value},[`${Fe}group`]:(i,e)=>{i.group=e.id},[`${Fe}datatype`]:(i,e)=>{i.datatype=e},[`${Fe}nodeKind`]:(i,e)=>{i.nodeKind=e},[`${Fe}minCount`]:(i,e)=>{i.minCount=parseInt(e.value)},[`${Fe}maxCount`]:(i,e)=>{i.maxCount=parseInt(e.value)},[`${Fe}minLength`]:(i,e)=>{i.minLength=parseInt(e.value)},[`${Fe}maxLength`]:(i,e)=>{i.maxLength=parseInt(e.value)},[`${Fe}minInclusive`]:(i,e)=>{i.minInclusive=parseInt(e.value)},[`${Fe}maxInclusive`]:(i,e)=>{i.maxInclusive=parseInt(e.value)},[`${Fe}minExclusive`]:(i,e)=>{i.minExclusive=parseInt(e.value)},[`${Fe}maxExclusive`]:(i,e)=>{i.maxExclusive=parseInt(e.value)},[`${Fe}pattern`]:(i,e)=>{i.pattern=e.value},[`${Fe}order`]:(i,e)=>{i.order=parseInt(e.value)},[`${Bc}singleLine`]:(i,e)=>{i.singleLine=e.value==="true"},[`${Bc}readonly`]:(i,e)=>{i.readonly=e.value==="true"},[`${Jg}styleClass`]:(i,e)=>{i.cssClass=e.value},[`${Fe}in`]:(i,e)=>{i.in=e.value},[`${Fe}languageIn`]:(i,e)=>{i.languageIn=i.config.lists[e.value],i.datatype=Sf},[`${Fe}defaultValue`]:(i,e)=>{i.defaultValue=e},[`${Fe}hasValue`]:(i,e)=>{i.hasValue=e},[`${Fe}node`]:(i,e)=>{i.node=e,i.nodeShapes.add(i.config.getNodeTemplate(e,i))},[`${Fe}and`]:(i,e)=>{i.and=e.value;const n=i.config.lists[i.and];if(n?.length)for(const r of n)i.nodeShapes.add(i.config.getNodeTemplate(r,i))},[`${Fe}qualifiedValueShape`]:(i,e)=>{const n=i.config.getNodeTemplate(e,i);i.qualifiedValueShape=n,i.nodeShapes.add(n)},[`${Fe}qualifiedMinCount`]:(i,e)=>{i.qualifiedMinCount=parseInt(e.value)},[`${Fe}qualifiedMaxCount`]:(i,e)=>{i.qualifiedMaxCount=parseInt(e.value)},[$l.id]:(i,e)=>{i.owlImports.add(e)},[ql.id]:(i,e)=>{i.class=e;const n=i.config.store.getSubjects(Ks,e,null);n.length>0&&(i.node=n[0])},[`${Fe}or`]:(i,e)=>{const n=i.config.lists[e.value];n?.length?i.or=n:console.error("list for sh:or not found:",e.value,"existing lists:",i.config.lists)},[`${Fe}xone`]:(i,e)=>{const n=i.config.lists[e.value];n?.length?i.xone=n:console.error("list for sh:xone not found:",e.value,"existing lists:",i.config.lists)}};class Hd{constructor(e,n){this.label="",this.nodeShapes=new Set,this.owlImports=new Set,this.id=e,this.parent=n,this.config=n.config,this.config.registerPropertyTemplate(this),Gl(this,this.config.store.getQuads(e,null,null,null))}}function Ur(i){return Math.max(i.minCount??0,i.qualifiedMinCount??0)}function Zm(i){return Math.min(i.maxCount??Number.MAX_SAFE_INTEGER,i.qualifiedMaxCount??Number.MAX_SAFE_INTEGER)}function zf(i){const e=Object.assign({},i);return e.nodeShapes=new Set(i.nodeShapes),e.owlImports=new Set(i.owlImports),i.languageIn&&(e.languageIn=[...i.languageIn]),i.or&&(e.or=[...i.or]),i.xone&&(e.xone=[...i.xone]),e}function Gl(i,e){for(const n of e)Gm[n.predicate.id]?.call(i,i,n.object);return i.label=i.name?.value||Zn(e,i.config.languages),i.label||(i.label=i.path?xl(i.path,Vi):"unknown"),i}function Hf(i,e){const n=e,r=i;for(const o in e)if(o!=="parent"&&o!=="config"&&o!=="id"){const a=n[o];if(a!==void 0&&a!=="")if(Array.isArray(a)){const l=r[o];Array.isArray(l)?l.push(...a):r[o]=[...a]}else if(a instanceof Set&&a.size){const l=r[o];r[o]=new Set([...l instanceof Set?l:[],...a])}else r[o]=a}}function Uf(i,e,n){const r=document.createElement("div");r.classList.add("shacl-or-constraint"),r.setAttribute("part","constraint");const o=[];if(e instanceof Li){const a=[];let l=!1;i.length&&(l=n.store.countQuads(i[0],wl,null,null)>0);for(let h=0;h<i.length;h++)if(l){const g=n.store.getObjects(i[h],wl,null),_=[];let d="";for(const m of g){const w=n.getPropertyTemplate(m,e.template),I=new zs(w,e);_.push(I),d+=(d.length>1?" / ":"")+I.template.label}a.push(_),o.push({label:d,value:h.toString()})}else{const g=i[h],_=n.getPropertyTemplate(g,e.template),d=new zs(_,e);a.push([d]),o.push({label:d.template.label,value:h.toString()})}const u=n.theme.createListEditor("Please choose",null,!1,o);u.setAttribute("part","constraint-editor");const f=u.querySelector(".editor");f.onchange=()=>{if(f.value){const h=a[parseInt(f.value)];let g;h.length&&(g=h[0],r.replaceWith(h[0]));for(let _=1;_<h.length;_++)g.after(h[_]),g=h[_]}},r.appendChild(u)}else{const a=[];for(let f=0;f<i.length;f++){const h=n.store.getQuads(i[f],null,null,null);if(h.length){a.push(h);let g=Zn(h,n.languages);for(const _ of h)_.predicate.equals(tm)&&(g=Zn(n.store.getQuads(_.object,null,null,null),n.languages));o.push({label:g||xl(h[0].predicate.value,Vi)+" = "+xl(h[0].object.value,Vi),value:f.toString()})}}const l=n.theme.createListEditor(e.template.label+"?",null,!1,o,e.template);l.setAttribute("part","constraint-editor");const u=l.querySelector(".editor");u.onchange=async()=>{if(u.value){const f=Gl(zf(e.template),a[parseInt(u.value)]),h=await Hs(f,void 0,!0),g=h.querySelector(":scope > label");g&&g.classList.add("persistent"),r.replaceWith(h)}},r.appendChild(l)}return r}function Xm(i,e,n){if(e.termType==="Literal"){const r=e.datatype;for(const o of i){const a=n.store.getQuads(o,null,null,null);for(const l of a)if(l.predicate.value===`${Fe}datatype`&&l.object.equals(r))return a}}else{const r=n.store.getObjects(e,Rt,null);for(const o of i){const a=n.store.getQuads(o,null,null,null);for(const l of a)if(r.length>0){if(l.predicate.value===`${Fe}node`){for(const u of r)if(n.store.getQuads(l.object,Ks,u,null).length>0)return a}if(l.predicate.equals(ql)){for(const u of r)if(l.object.equals(u))return a}}else if(l.predicate.equals(nm)&&l.object.equals(Tf))return a}}return console.error("couldn't resolve sh:or/sh:xone on property for value",e),[]}function Qm(i,e,n){for(const r of i){let o=!1;const a=n.store.getObjects(r,wl,null);for(const l of a){const u=n.store.getObjects(l,`${Fe}path`,null);for(const f of u)if(o=n.store.countQuads(e,f,null,null)>0,o)break}if(o)return a}return console.error("couldn't resolve sh:or/sh:xone on node for value",e),[]}const Jm=`:host {
|
|
30
|
+
`),V=this.i;break;case N:pe!==void 0&&(this.text+=de.slice(V));break e;default:r(Ue)||(Pe=!0)}}Pe&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(V,de){var pe;const{prefix:Pe,local:Ue}=this.qname(V),Je={name:V,prefix:Pe,local:Ue,value:de};if(this.attribList.push(Je),(pe=this.attributeHandler)===null||pe===void 0||pe.call(this,Je),Pe==="xmlns"){const xt=de.trim();this.currentXMLVersion==="1.0"&&xt===""&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[Ue]=xt,wt(this,Ue,xt)}else if(V==="xmlns"){const xt=de.trim();this.topNS[""]=xt,wt(this,"",xt)}}pushAttribPlain(V,de){var pe;const Pe={name:V,value:de};this.attribList.push(Pe),(pe=this.attributeHandler)===null||pe===void 0||pe.call(this,Pe)}end(){var V,de;this.sawRoot||this.fail("document must contain a root element.");const{tags:pe}=this;for(;pe.length>0;){const Ue=pe.pop();this.fail(`unclosed tag: ${Ue.name}`)}this.state!==w&&this.state!==M&&this.fail("unexpected end.");const{text:Pe}=this;return Pe.length!==0&&((V=this.textHandler)===null||V===void 0||V.call(this,Pe),this.text=""),this._closed=!0,(de=this.endHandler)===null||de===void 0||de.call(this),this._init(),this}resolve(V){var de,pe;let Pe=this.topNS[V];if(Pe!==void 0)return Pe;const{tags:Ue}=this;for(let Je=Ue.length-1;Je>=0;Je--)if(Pe=Ue[Je].ns[V],Pe!==void 0)return Pe;return Pe=this.ns[V],Pe!==void 0?Pe:(pe=(de=this.opt).resolvePrefix)===null||pe===void 0?void 0:pe.call(de,V)}qname(V){const de=V.indexOf(":");if(de===-1)return{prefix:"",local:V};const pe=V.slice(de+1),Pe=V.slice(0,de);return(Pe===""||pe===""||pe.includes(":"))&&this.fail(`malformed name: ${V}.`),{prefix:Pe,local:pe}}processAttribsNS(){var V;const{attribList:de}=this,pe=this.tag;{const{prefix:Je,local:xt}=this.qname(pe.name);pe.prefix=Je,pe.local=xt;const tn=pe.uri=(V=this.resolve(Je))!==null&&V!==void 0?V:"";Je!==""&&(Je==="xmlns"&&this.fail('tags may not have "xmlns" as prefix.'),tn===""&&(this.fail(`unbound namespace prefix: ${JSON.stringify(Je)}.`),pe.uri=Je))}if(de.length===0)return;const{attributes:Pe}=pe,Ue=new Set;for(const Je of de){const{name:xt,prefix:tn,local:lo}=Je;let $n,ni;tn===""?($n=xt==="xmlns"?v:"",ni=xt):($n=this.resolve(tn),$n===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(tn)}.`),$n=tn),ni=`{${$n}}${lo}`),Ue.has(ni)&&this.fail(`duplicate attribute: ${ni}.`),Ue.add(ni),Je.uri=$n,Pe[xt]=Je}this.attribList=[]}processAttribsPlain(){const{attribList:V}=this,de=this.tag.attributes;for(const{name:pe,value:Pe}of V)de[pe]!==void 0&&this.fail(`duplicate attribute: ${pe}.`),de[pe]=Pe;this.attribList=[]}openTag(){var V;this.processAttribs();const{tags:de}=this,pe=this.tag;pe.isSelfClosing=!1,(V=this.openTagHandler)===null||V===void 0||V.call(this,pe),de.push(pe),this.state=M,this.name=""}openSelfClosingTag(){var V,de,pe;this.processAttribs();const{tags:Pe}=this,Ue=this.tag;Ue.isSelfClosing=!0,(V=this.openTagHandler)===null||V===void 0||V.call(this,Ue),(de=this.closeTagHandler)===null||de===void 0||de.call(this,Ue),(this.tag=(pe=Pe[Pe.length-1])!==null&&pe!==void 0?pe:null)===null&&(this.closedRoot=!0),this.state=M,this.name=""}closeTag(){const{tags:V,name:de}=this;if(this.state=M,this.name="",de===""){this.fail("weird empty close tag."),this.text+="</>";return}const pe=this.closeTagHandler;let Pe=V.length;for(;Pe-- >0;){const Ue=this.tag=V.pop();if(this.topNS=Ue.ns,pe?.(Ue),Ue.name===de)break;this.fail("unexpected close tag.")}Pe===0?this.closedRoot=!0:Pe<0&&(this.fail(`unmatched closing tag: ${de}.`),this.text+=`</${de}>`)}parseEntity(V){if(V[0]!=="#"){const pe=this.ENTITIES[V];return pe!==void 0?pe:(this.fail(this.isName(V)?"undefined entity.":"disallowed character in entity name."),`&${V};`)}let de=NaN;return V[1]==="x"&&/^#x[0-9a-f]+$/i.test(V)?de=parseInt(V.slice(2),16):/^#[0-9]+$/.test(V)&&(de=parseInt(V.slice(1),10)),this.isChar(de)?String.fromCodePoint(de):(this.fail("malformed character entity."),`&${V};`)}}return di.SaxesParser=Bn,di}var br={},Gc;function _m(){if(Gc)return br;Gc=1,Object.defineProperty(br,"__esModule",{value:!0}),br.ParseError=void 0;let i=class extends Error{constructor(n,r){const o=n.saxParser;super(n.trackPosition?`Line ${o.line} column ${o.column+1}: ${r}`:r)}};return br.ParseError=i,br}var hi={},vr={},Zc;function Nf(){if(Zc)return vr;Zc=1,Object.defineProperty(vr,"__esModule",{value:!0}),vr.BlankNode=void 0;class i{constructor(n){this.termType="BlankNode",this.value=n}equals(n){return!!n&&n.termType==="BlankNode"&&n.value===this.value}}return vr.BlankNode=i,vr}var wr={},xr={},Xc;function Rf(){if(Xc)return xr;Xc=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.DefaultGraph=void 0;class i{constructor(){this.termType="DefaultGraph",this.value=""}equals(n){return!!n&&n.termType==="DefaultGraph"}}return xr.DefaultGraph=i,i.INSTANCE=new i,xr}var Er={},Sr={},Qc;function zl(){if(Qc)return Sr;Qc=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.NamedNode=void 0;class i{constructor(n){this.termType="NamedNode",this.value=n}equals(n){return!!n&&n.termType==="NamedNode"&&n.value===this.value}}return Sr.NamedNode=i,Sr}var Jc;function Cf(){if(Jc)return Er;Jc=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.Literal=void 0;const i=zl();class e{constructor(r,o){this.termType="Literal",this.value=r,typeof o=="string"?(this.language=o,this.datatype=e.RDF_LANGUAGE_STRING,this.direction=""):o?"termType"in o?(this.language="",this.datatype=o,this.direction=""):(this.language=o.language,this.datatype=o.direction?e.RDF_DIRECTIONAL_LANGUAGE_STRING:e.RDF_LANGUAGE_STRING,this.direction=o.direction||""):(this.language="",this.datatype=e.XSD_STRING,this.direction="")}equals(r){return!!r&&r.termType==="Literal"&&r.value===this.value&&r.language===this.language&&(r.direction===this.direction||!r.direction&&this.direction==="")&&this.datatype.equals(r.datatype)}}return Er.Literal=e,e.RDF_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),e.RDF_DIRECTIONAL_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),e.XSD_STRING=new i.NamedNode("http://www.w3.org/2001/XMLSchema#string"),Er}var Tr={},Kc;function Pf(){if(Kc)return Tr;Kc=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.Quad=void 0;class i{constructor(n,r,o,a){this.termType="Quad",this.value="",this.subject=n,this.predicate=r,this.object=o,this.graph=a}equals(n){return!!n&&(n.termType==="Quad"||!n.termType)&&this.subject.equals(n.subject)&&this.predicate.equals(n.predicate)&&this.object.equals(n.object)&&this.graph.equals(n.graph)}}return Tr.Quad=i,Tr}var Lr={},Yc;function kf(){if(Yc)return Lr;Yc=1,Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.Variable=void 0;class i{constructor(n){this.termType="Variable",this.value=n}equals(n){return!!n&&n.termType==="Variable"&&n.value===this.value}}return Lr.Variable=i,Lr}var ed;function ym(){if(ed)return wr;ed=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.DataFactory=void 0;const i=Nf(),e=Rf(),n=Cf(),r=zl(),o=Pf(),a=kf();let l=0;class u{constructor(h){this.blankNodeCounter=0,h=h||{},this.blankNodePrefix=h.blankNodePrefix||`df_${l++}_`}namedNode(h){return new r.NamedNode(h)}blankNode(h){return new i.BlankNode(h||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(h,g){return new n.Literal(h,g)}variable(h){return new a.Variable(h)}defaultGraph(){return e.DefaultGraph.INSTANCE}quad(h,g,m,d){return new o.Quad(h,g,m,d||this.defaultGraph())}fromTerm(h){switch(h.termType){case"NamedNode":return this.namedNode(h.value);case"BlankNode":return this.blankNode(h.value);case"Literal":return h.language?this.literal(h.value,h.language):h.datatype.equals(n.Literal.XSD_STRING)?this.literal(h.value):this.literal(h.value,this.fromTerm(h.datatype));case"Variable":return this.variable(h.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(h.subject),this.fromTerm(h.predicate),this.fromTerm(h.object),this.fromTerm(h.graph))}}fromQuad(h){return this.fromTerm(h)}resetBlankNodeCounter(){this.blankNodeCounter=0}}return wr.DataFactory=u,wr}var td;function Df(){return td||(td=1,(function(i){var e=hi&&hi.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,l,u)}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),n=hi&&hi.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(i,"__esModule",{value:!0}),n(Nf(),i),n(ym(),i),n(Rf(),i),n(Cf(),i),n(zl(),i),n(Pf(),i),n(kf(),i)})(hi)),hi}var fi={},ha={},nd;function bm(){return nd||(nd=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.validateIri=i.IriValidationStrategy=void 0;function e(){const u="[!$&'()*+,;=]",f="%[a-fA-F0-9]{2}",h="([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",g=`${h}\\.${h}\\.${h}\\.${h}`,m="[a-fA-F0-9]{1,4}",d=`(${m}:${m}|${g})`,_=`((${m}:){6}${d}|::(${m}:){5}${d}|(${m})?::(${m}:){4}${d}|((${m}:){0,1}${m})?::(${m}:){3}${d}|((${m}:){0,2}${m})?::(${m}:){2}${d}|((${m}:){0,3}${m})?::${m}:${d}|((${m}:){0,4}${m})?::${d}|((${m}:){0,5}${m})?::${m}|((${m}:){0,6}${m})?::)`,v=`v[a-fA-F0-9]+\\.(${u}|${u}|":)+`,I=`\\[(${_}|${v})\\]`,A="[0-9]*",N="[a-zA-Z][a-zA-Z0-9+\\-.]*",w="[---]",O="[a-zA-Z0-9\\-._~ -豈-﷏ﷰ-𐀀-𠀀-𰀀------------]",X=`(${O}|${f}|${u}|[:@])*`,C=`(${X}|[\\/?])*`,U=`(${X}|${w}|[\\/?])*`,R=`(${X})+`,$=`(${X})*`,G="",j=`${R}(\\/${$})*`,F=`\\/(${R}(\\/${$})*)?`,se=`(\\/${$})*`,M=`(${O}|${f}|${u})*`,re=`(${I}|${g}|${M})`,T=`(\\/\\/${`(${`(${O}|${f}|${u}|:)*`}@)?${re}(:${A})?`}${se}|${F}|${j}|${G})`,Q=`^${N}:${T}(\\?${U})?(#${C})?$`;return new RegExp(Q,"u")}const n=e(),r=/^[A-Za-z][\d+-.A-Za-z]*:[^\u0000-\u0020"<>\\^`{|}]*$/u;var o;(function(l){l.Strict="strict",l.Pragmatic="pragmatic",l.None="none"})(o=i.IriValidationStrategy||(i.IriValidationStrategy={}));function a(l,u=o.Strict){switch(u){case o.Strict:return n.test(l)?void 0:new Error(`Invalid IRI according to RFC 3987: '${l}'`);case o.Pragmatic:return r.test(l)?void 0:new Error(`Invalid IRI according to RDF Turtle: '${l}'`);case o.None:return;default:return new Error(`Not supported validation strategy "${u}"`)}}i.validateIri=a})(ha)),ha}var id;function vm(){return id||(id=1,(function(i){var e=fi&&fi.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,l,u)}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),n=fi&&fi.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(i,"__esModule",{value:!0}),n(bm(),i)})(fi)),fi}var rd;function wm(){if(rd)return ui;rd=1,Object.defineProperty(ui,"__esModule",{value:!0}),ui.ParseType=ui.RdfXmlParser=void 0;const i=hm(),e=mm(),n=wf(),r=_m(),o=Df(),a=vm();let l=class et extends n.Transform{constructor(h){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},h&&(Object.assign(this,h),this.options=h),this.dataFactory||(this.dataFactory=new o.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.validateUri!==!1&&(this.validateUri=!0),this.iriValidationStrategy||(this.iriValidationStrategy=this.validateUri?a.IriValidationStrategy.Pragmatic:a.IriValidationStrategy.None),this.parseUnsupportedVersions=!!h?.parseUnsupportedVersions,this.version=h?.version,this.saxParser=new e.SaxesParser({xmlns:!0,position:this.trackPosition}),this.attachSaxListeners()}import(h){const g=new n.PassThrough({readableObjectMode:!0});h.on("error",d=>m.emit("error",d)),h.on("data",d=>g.push(d)),h.on("end",()=>g.push(null));const m=g.pipe(new et(this.options));return m}_transform(h,g,m){if(this.version){const d=this.version;if(this.version=void 0,!this.isValidVersion(d))return m(this.newParseError(`Detected unsupported version as media type parameter: ${d}`))}try{this.saxParser.write(h)}catch(d){return m(d)}m()}newParseError(h){return new r.ParseError(this,h)}valueToUri(h,g){return this.uriToNamedNode((0,i.resolve)(h,g.baseIRI))}uriToNamedNode(h){const g=(0,a.validateIri)(h,this.iriValidationStrategy);if(g instanceof Error)throw this.newParseError(g.message);return this.dataFactory.namedNode(h)}validateNcname(h){if(!et.NCNAME_MATCHER.test(h))throw this.newParseError(`Not a valid NCName: ${h}`)}createLiteral(h,g){return this.dataFactory.literal(h,g.datatype?g.datatype:g.language?{language:g.language,direction:g.rdfVersion?g.direction:void 0}:void 0)}isValidVersion(h){return this.parseUnsupportedVersions||et.SUPPORTED_VERSIONS.includes(h)}attachSaxListeners(){this.saxParser.on("error",h=>this.emit("error",h)),this.saxParser.on("opentag",this.onTag.bind(this)),this.saxParser.on("text",this.onText.bind(this)),this.saxParser.on("cdata",this.onText.bind(this)),this.saxParser.on("closetag",this.onCloseTag.bind(this)),this.saxParser.on("doctype",this.onDoctype.bind(this))}onTag(h){const g=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let m=u.RESOURCE;if(g&&(g.hadChildren=!0,m=g.childrenParseType),g&&g.childrenStringTags){const _=h.name;let v="";for(const{key:P,value:w}of g.namespaces||[])v+=` ${P}="${w}"`;for(const P in h.attributes)v+=` ${P}="${h.attributes[P].value}"`;const A=`<${`${_}${v}`}>`;g.childrenStringTags.push(A);const N={childrenStringTags:g.childrenStringTags};N.childrenStringEmitClosingTag=`</${_}>`,this.activeTagStack.push(N);return}const d={};g?(d.language=g.language,d.direction=g.direction,d.baseIRI=g.baseIRI,d.childrenTripleTerms=g.childrenTripleTerms,d.rdfVersion=g.rdfVersion):d.baseIRI=this.baseIRI,this.activeTagStack.push(d),m===u.RESOURCE?this.onTagResource(h,d,g,!g):this.onTagProperty(h,d,g);for(const _ in h.attributes){const v=h.attributes[_];v.prefix==="xmlns"&&(d.namespaces||(d.namespaces=[]),d.namespaces.push({key:`${v.prefix}:${v.local}`,value:v.value}))}g&&g.namespaces&&(d.namespaces=[...d.namespaces||[],...g.namespaces])}onTagResource(h,g,m,d){g.childrenParseType=u.PROPERTY;let _=!0;if(h.uri===et.RDF){if(!d&&et.FORBIDDEN_NODE_ELEMENTS.indexOf(h.local)>=0)throw this.newParseError(`Illegal node element name: ${h.local}`);switch(h.local){case"RDF":g.childrenParseType=u.RESOURCE;case"Description":_=!1}}const v=[],I=[];let A=null,N=!1,P=!1,w=null;for(const y in h.attributes){const S=h.attributes[y];if(S.uri===et.RDF&&S.local==="version"){this.setVersion(g,S.value);continue}else if(m&&S.uri===et.RDF)switch(S.local){case"about":if(A)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${S.value} and ${A} where found.`);A=S.value;continue;case"ID":if(A)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${S.value} and ${A} where found.`);this.validateNcname(S.value),A="#"+S.value,N=!0;continue;case"nodeID":if(A)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${S.value} and ${A} where found.`);this.validateNcname(S.value),A=S.value,P=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":w=S.value;continue;case"aboutEach":throw this.newParseError("rdf:aboutEach is not supported.");case"aboutEachPrefix":throw this.newParseError("rdf:aboutEachPrefix is not supported.");case"li":throw this.newParseError("rdf:li on node elements are not supported.")}else if(S.uri===et.XML){if(S.local==="lang"){g.language=S.value===""?null:S.value.toLowerCase();continue}else if(S.local==="base"){g.baseIRI=(0,i.resolve)(S.value,g.baseIRI);continue}}else if(S.uri===et.ITS&&S.local==="dir"){this.setDirection(g,S.value);continue}S.prefix!=="xml"&&S.prefix!=="xmlns"&&(S.prefix!==""||S.local!=="xmlns")&&S.uri&&(v.push(this.uriToNamedNode(S.uri+S.local)),I.push(S.value))}if(A!==null&&(g.subject=P?this.dataFactory.blankNode(A):this.valueToUri(A,g),N&&this.claimNodeId(g.subject)),g.subject||(g.subject=this.dataFactory.blankNode()),_){const y=this.uriToNamedNode(h.uri+h.local);this.emitTriple(g.subject,this.dataFactory.namedNode(et.RDF+"type"),y,m?m.reifiedStatementId:null,g.childrenTripleTerms,g.reifier)}if(m){if(m.predicate)if(m.childrenCollectionSubject){const y=this.dataFactory.blankNode(),S=this.dataFactory.namedNode(et.RDF+"rest"),O=m.childrenCollectionPredicate.equals(S);this.emitTriple(m.childrenCollectionSubject,m.childrenCollectionPredicate,y,O?null:m.reifiedStatementId,m.childrenTripleTerms,O?null:m.reifier),this.emitTriple(y,this.dataFactory.namedNode(et.RDF+"first"),g.subject,null,g.childrenTripleTerms),m.childrenCollectionSubject=y,m.childrenCollectionPredicate=S}else{m.childrenTagsToTripleTerms||(this.emitTriple(m.subject,m.predicate,g.subject,m.reifiedStatementId,m.childrenTripleTerms,m.reifier),m.predicateEmitted=!0);for(let y=0;y<m.predicateSubPredicates.length;y++)this.emitTriple(g.subject,m.predicateSubPredicates[y],m.predicateSubObjects[y],null,m.childrenTripleTerms,m.reifier);m.predicateSubPredicates=[],m.predicateSubObjects=[]}for(let y=0;y<v.length;y++){const S=this.createLiteral(I[y],g);this.emitTriple(g.subject,v[y],S,m.reifiedStatementId,m.childrenTripleTerms,m.reifier)}w&&this.emitTriple(g.subject,this.dataFactory.namedNode(et.RDF+"type"),this.uriToNamedNode(w),null,g.childrenTripleTerms,g.reifier)}}onTagProperty(h,g,m){if(g.childrenParseType=u.RESOURCE,g.subject=m.subject,h.uri===et.RDF&&h.local==="li"?(m.listItemCounter||(m.listItemCounter=1),g.predicate=this.uriToNamedNode(h.uri+"_"+m.listItemCounter++)):g.predicate=this.uriToNamedNode(h.uri+h.local),h.uri===et.RDF&&et.FORBIDDEN_PROPERTY_ELEMENTS.indexOf(h.local)>=0)throw this.newParseError(`Illegal property element name: ${h.local}`);g.predicateSubPredicates=[],g.predicateSubObjects=[];let d=!1,_=!1,v=null,I=!0;const A=[],N=[];for(const P in h.attributes){const w=h.attributes[P];if(w.uri===et.RDF&&w.local==="version"){this.setVersion(g,w.value);continue}else if(w.uri===et.RDF)switch(w.local){case"resource":if(v)throw this.newParseError(`Found both rdf:resource (${w.value}) and rdf:nodeID (${v}).`);if(d)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${w.value})`);g.hadChildren=!0,v=w.value,I=!1;continue;case"datatype":if(_)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${w.value}).`);if(d)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${w.value})`);g.datatype=this.valueToUri(w.value,g);continue;case"nodeID":if(_)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${w.value}).`);if(g.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${w.value}).`);if(d)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${w.value})`);this.validateNcname(w.value),g.hadChildren=!0,v=w.value,I=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(_)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(g.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${g.datatype.value})`);if(v)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${v})`);if(w.value==="Resource"){d=!0,g.childrenParseType=u.PROPERTY;const y=this.dataFactory.blankNode();this.emitTriple(g.subject,g.predicate,y,g.reifiedStatementId,g.childrenTripleTerms,g.reifier),g.subject=y,g.predicate=null}else w.value==="Collection"?(d=!0,g.hadChildren=!0,g.childrenCollectionSubject=g.subject,g.childrenCollectionPredicate=g.predicate,I=!1):w.value==="Literal"?(d=!0,g.childrenTagsToString=!0,g.childrenStringTags=[]):w.value==="Triple"&&(d=!0,g.childrenTagsToTripleTerms=!0,g.childrenTripleTerms=[]);continue;case"ID":this.validateNcname(w.value),g.reifiedStatementId=this.valueToUri("#"+w.value,g),this.claimNodeId(g.reifiedStatementId);continue;case"annotation":g.reifier=this.dataFactory.namedNode(w.value);continue;case"annotationNodeID":g.reifier=this.dataFactory.blankNode(w.value);continue}else if(w.uri===et.XML&&w.local==="lang"){g.language=w.value===""?null:w.value.toLowerCase();continue}else if(w.uri===et.ITS&&w.local==="dir"){this.setDirection(g,w.value);continue}else if(w.uri===et.ITS&&w.local==="version")continue;if(w.prefix!=="xml"&&w.prefix!=="xmlns"&&(w.prefix!==""||w.local!=="xmlns")&&w.uri){if(d||g.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${w.value}`);g.hadChildren=!0,_=!0,A.push(this.uriToNamedNode(w.uri+w.local)),N.push(this.createLiteral(w.value,g))}}if(v!==null){const P=g.subject;g.subject=I?this.dataFactory.blankNode(v):this.valueToUri(v,g),this.emitTriple(P,g.predicate,g.subject,g.reifiedStatementId,g.childrenTripleTerms,g.reifier);for(let w=0;w<A.length;w++)this.emitTriple(g.subject,A[w],N[w],null,g.childrenTripleTerms,g.reifier);g.predicateEmitted=!0}else I&&(g.predicateSubPredicates=A,g.predicateSubObjects=N,g.predicateEmitted=!1)}emitTriple(h,g,m,d,_,v){const I=this.dataFactory.quad(h,g,m,this.defaultGraph);_?_.push(I):this.push(I),v&&this.push(this.dataFactory.quad(v,this.dataFactory.namedNode(et.RDF+"reifies"),I)),d&&(this.push(this.dataFactory.quad(d,this.dataFactory.namedNode(et.RDF+"type"),this.dataFactory.namedNode(et.RDF+"Statement"),this.defaultGraph)),this.push(this.dataFactory.quad(d,this.dataFactory.namedNode(et.RDF+"subject"),h,this.defaultGraph)),this.push(this.dataFactory.quad(d,this.dataFactory.namedNode(et.RDF+"predicate"),g,this.defaultGraph)),this.push(this.dataFactory.quad(d,this.dataFactory.namedNode(et.RDF+"object"),m,this.defaultGraph)))}claimNodeId(h){if(!this.allowDuplicateRdfIds){if(this.nodeIds[h.value])throw this.newParseError(`Found multiple occurrences of rdf:ID='${h.value}'.`);this.nodeIds[h.value]=!0}}onText(h){const g=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;g&&(g.childrenStringTags?g.childrenStringTags.push(h):g.predicate&&(g.text=h))}onCloseTag(){const h=this.activeTagStack.pop(),g=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;if(h.childrenStringEmitClosingTag&&h.childrenStringTags.push(h.childrenStringEmitClosingTag),h.childrenTagsToString&&(h.datatype=this.dataFactory.namedNode(et.RDF+"XMLLiteral"),h.text=h.childrenStringTags.join(""),h.hadChildren=!1),h.childrenTagsToTripleTerms&&h.predicate&&h.rdfVersion){if(h.childrenTripleTerms.length!==1)throw this.newParseError(`Expected exactly one triple term in rdf:parseType="Triple" but got ${h.childrenTripleTerms.length}`);for(const m of h.childrenTripleTerms)this.emitTriple(h.subject,h.predicate,m,null,g.childrenTripleTerms,g.reifier);h.predicateEmitted=!0}if(h.childrenCollectionSubject)this.emitTriple(h.childrenCollectionSubject,h.childrenCollectionPredicate,this.dataFactory.namedNode(et.RDF+"nil"),null,h.childrenTripleTerms);else if(h.predicate){if(!h.hadChildren&&h.childrenParseType!==u.PROPERTY)this.emitTriple(h.subject,h.predicate,this.createLiteral(h.text||"",h),h.reifiedStatementId,h.childrenTripleTerms,h.reifier);else if(!h.predicateEmitted){const m=this.dataFactory.blankNode();this.emitTriple(h.subject,h.predicate,m,h.reifiedStatementId,h.childrenTripleTerms,h.reifier);for(let d=0;d<h.predicateSubPredicates.length;d++)this.emitTriple(m,h.predicateSubPredicates[d],h.predicateSubObjects[d],null,h.childrenTripleTerms)}}}onDoctype(h){h.replace(/<!ENTITY\s+([^\s]+)\s+["']([^"']+)["']\s*>/g,(g,m,d)=>(this.saxParser.ENTITIES[m]=d,""))}setDirection(h,g){if(g){if(g!=="ltr"&&g!=="rtl")throw this.newParseError(`Base directions must either be 'ltr' or 'rtl', while '${g}' was found.`);h.direction=g}else delete h.direction}setVersion(h,g){if(h.rdfVersion=g,this.emit("version",g),!this.isValidVersion(g))throw this.newParseError(`Detected unsupported version: ${g}`)}};ui.RdfXmlParser=l,l.MIME_TYPE="application/rdf+xml",l.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",l.XML="http://www.w3.org/XML/1998/namespace",l.ITS="http://www.w3.org/2005/11/its",l.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],l.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],l.NCNAME_MATCHER=/^([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_])([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_\-.0-9#xB7\u{0300}-\u{036F}\u{203F}-\u{2040}])*$/u,l.SUPPORTED_VERSIONS=["1.2","1.2-basic","1.1"];var u;return(function(f){f[f.RESOURCE=0]="RESOURCE",f[f.PROPERTY=1]="PROPERTY"})(u||(ui.ParseType=u={})),ui}var sd;function xm(){return sd||(sd=1,(function(i){var e=li&&li.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,l,u)}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),n=li&&li.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(i,"__esModule",{value:!0}),n(wm(),i)})(li)),li}var Em=xm(),fa={},pa,od;function Hl(){return od||(od=1,pa=class Mf{constructor(e,n=new Map,r=0){this.prefix=e,this._existing=n,this.counter=r}clone(){const{prefix:e,_existing:n,counter:r}=this;return new Mf(e,new Map(n),r)}getId(e){const n=e&&this._existing.get(e);if(n)return n;const r=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,r),r}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}),pa}var Ir={},ga={},ad;function Sm(){return ad||(ad=1,(function(i,e){if(i.setImmediate)return;var n=1,r={},o=!1,a=i.document,l;function u(P){typeof P!="function"&&(P=new Function(""+P));for(var w=new Array(arguments.length-1),y=0;y<w.length;y++)w[y]=arguments[y+1];var S={callback:P,args:w};return r[n]=S,l(n),n++}function f(P){delete r[P]}function h(P){var w=P.callback,y=P.args;switch(y.length){case 0:w();break;case 1:w(y[0]);break;case 2:w(y[0],y[1]);break;case 3:w(y[0],y[1],y[2]);break;default:w.apply(e,y);break}}function g(P){if(o)setTimeout(g,0,P);else{var w=r[P];if(w){o=!0;try{h(w)}finally{f(P),o=!1}}}}function m(){l=function(P){process.nextTick(function(){g(P)})}}function d(){if(i.postMessage&&!i.importScripts){var P=!0,w=i.onmessage;return i.onmessage=function(){P=!1},i.postMessage("","*"),i.onmessage=w,P}}function _(){var P="setImmediate$"+Math.random()+"$",w=function(y){y.source===i&&typeof y.data=="string"&&y.data.indexOf(P)===0&&g(+y.data.slice(P.length))};i.addEventListener?i.addEventListener("message",w,!1):i.attachEvent("onmessage",w),l=function(y){i.postMessage(P+y,"*")}}function v(){var P=new MessageChannel;P.port1.onmessage=function(w){var y=w.data;g(y)},l=function(w){P.port2.postMessage(w)}}function I(){var P=a.documentElement;l=function(w){var y=a.createElement("script");y.onreadystatechange=function(){g(w),y.onreadystatechange=null,P.removeChild(y),y=null},P.appendChild(y)}}function A(){l=function(P){setTimeout(g,0,P)}}var N=Object.getPrototypeOf&&Object.getPrototypeOf(i);N=N&&N.setTimeout?N:i,{}.toString.call(i.process)==="[object process]"?m():d()?_():i.MessageChannel?v():a&&"onreadystatechange"in a.createElement("script")?I():A(),N.setImmediate=u,N.clearImmediate=f})(typeof self>"u"?typeof qi>"u"?ga:qi:self)),ga}var ld;function Of(){if(ld)return Ir;ld=1,Sm(),Ir.setImmediate=setImmediate,Ir.crypto=globalThis.crypto;const i=[];for(let e=0;e<=255;++e)i.push(e.toString(16).padStart(2,"0"));return Ir.bufferToHex=function(n){let r="";const o=new Uint8Array(n);for(let a=0;a<o.length;++a)r+=i[o[a]];return r},Ir}var ma,ud;function Ff(){if(ud)return ma;ud=1;const{bufferToHex:i,crypto:e}=Of(),n=new Map([["sha256","SHA-256"],["SHA256","SHA-256"],["SHA-256","SHA-256"],["sha384","SHA-384"],["SHA384","SHA-384"],["SHA-384","SHA-384"],["sha512","SHA-512"],["SHA512","SHA-512"],["SHA-512","SHA-512"]]);return ma=class{constructor(o){if(!(e&&e.subtle))throw new Error("crypto.subtle not found.");if(!n.has(o))throw new Error(`Unsupported algorithm "${o}".`);this.algorithm=n.get(o),this._content=""}update(o){this._content+=o}async digest(){const o=new TextEncoder().encode(this._content),a=await e.subtle.digest(this.algorithm,o);return i(a)}},ma}var _a,cd;function jf(){return cd||(cd=1,_a=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let n=0;n<e.length;++n)this.dir.set(e[n],!0)}hasNext(){return!this.done}next(){const{current:e,dir:n}=this,r=e.slice();let o=null,a=0;const l=e.length;for(let u=0;u<l;++u){const f=e[u],h=n.get(f);(o===null||f>o)&&(h&&u>0&&f>e[u-1]||!h&&u<l-1&&f>e[u+1])&&(o=f,a=u)}if(o===null)this.done=!0;else{const u=n.get(o)?a-1:a+1;e[a]=e[u],e[u]=o;for(const f of e)f>o&&n.set(f,!n.get(f))}return r}}),_a}var ya,dd;function Ul(){if(dd)return ya;dd=1;const e="http://www.w3.org/1999/02/22-rdf-syntax-ns#"+"langString",n="http://www.w3.org/2001/XMLSchema#string",r="NamedNode",o="BlankNode",a="Literal",l="DefaultGraph",u={};(()=>{const y="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�"+"_",S=y+"0-9-·̀-ͯ‿-⁀",O="_:((?:["+y+"0-9])(?:(?:["+S+".])*(?:["+S+"]))?)",U='(?:<((?:[^\0- <>"{}|^`\\\\]|'+"\\\\u[0-9A-Fa-f]{4}"+"|"+"\\\\U[0-9A-Fa-f]{8}"+")*)>)",R=O,$='"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"',G="(?:\\^\\^"+U+")",F="(?:"+$+"(?:"+G+"|"+"(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*))"+")?)",se="[ \\t]+",M="[ \\t]*",re="(?:"+U+"|"+R+")"+se,B=U+se,oe="(?:"+U+"|"+R+"|"+F+")"+M,T="(?:\\.|(?:(?:"+U+"|"+R+")"+M+"\\.))";u.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,u.empty=new RegExp("^"+M+"$"),u.quad=new RegExp("^"+M+re+B+oe+T+M+"$")})(),ya=class Sl{static parse(y){const S=[],O={},X=y.split(u.eoln);let C=0;for(const U of X){if(C++,u.empty.test(U))continue;const R=U.match(u.quad);if(R===null)throw new Error("N-Quads parse error on line "+C+".");const $={subject:null,predicate:null,object:null,graph:null};if(R[1]!==void 0?$.subject={termType:r,value:P(R[1])}:$.subject={termType:o,value:R[2]},$.predicate={termType:r,value:P(R[3])},R[4]!==void 0?$.object={termType:r,value:P(R[4])}:R[5]!==void 0?$.object={termType:o,value:R[5]}:($.object={termType:a,value:void 0,datatype:{termType:r}},R[7]!==void 0?$.object.datatype.value=P(R[7]):R[8]!==void 0?($.object.datatype.value=e,$.object.language=R[8]):$.object.datatype.value=n,$.object.value=_(R[6])),R[9]!==void 0?$.graph={termType:r,value:P(R[9])}:R[10]!==void 0?$.graph={termType:o,value:R[10]}:$.graph={termType:l,value:""},!($.graph.value in O))O[$.graph.value]=[$],S.push($);else{let G=!0;const j=O[$.graph.value];for(const F of j)if(f(F,$)){G=!1;break}G&&(j.push($),S.push($))}}return S}static serialize(y){const S=[];for(const O of y)S.push(Sl.serializeQuad(O));return S.sort().join("")}static serializeQuadComponents(y,S,O,X){let C="";return y.termType===r?C+=`<${A(y.value)}>`:C+=`_:${y.value}`,S.termType===r?C+=` <${A(S.value)}> `:C+=` _:${S.value} `,O.termType===r?C+=`<${A(O.value)}>`:O.termType===o?C+=`_:${O.value}`:(C+=`"${m(O.value)}"`,O.datatype.value===e?O.language&&(C+=`@${O.language}`):O.datatype.value!==n&&(C+=`^^<${A(O.datatype.value)}>`)),X.termType===r?C+=` <${A(X.value)}>`:X.termType===o&&(C+=` _:${X.value}`),C+=` .
|
|
31
|
+
`,C}static serializeQuad(y){return Sl.serializeQuadComponents(y.subject,y.predicate,y.object,y.graph)}};function f(w,y){return!(w.subject.termType===y.subject.termType&&w.object.termType===y.object.termType)||!(w.subject.value===y.subject.value&&w.predicate.value===y.predicate.value&&w.object.value===y.object.value)?!1:w.object.termType!==a?!0:w.object.datatype.termType===y.object.datatype.termType&&w.object.language===y.object.language&&w.object.datatype.value===y.object.datatype.value}const h=/[\u0000-\u001F\u007F"\\]/g,g=[];for(let w=0;w<=127;++w)h.test(String.fromCharCode(w))&&(g[w]="\\u"+w.toString(16).toUpperCase().padStart(4,"0"),h.lastIndex=0);g["\b".codePointAt(0)]="\\b",g[" ".codePointAt(0)]="\\t",g[`
|
|
32
|
+
`.codePointAt(0)]="\\n",g["\f".codePointAt(0)]="\\f",g["\r".codePointAt(0)]="\\r",g['"'.codePointAt(0)]='\\"',g["\\".codePointAt(0)]="\\\\";function m(w){return h.test(w)?w.replace(h,function(y){return g[y.codePointAt(0)]}):w}const d=/(?:\\([btnfr"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function _(w){return d.test(w)?w.replace(d,function(y,S,O,X){if(S)switch(S){case"b":return"\b";case"t":return" ";case"n":return`
|
|
33
|
+
`;case"f":return"\f";case"r":return"\r";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(O)return String.fromCharCode(parseInt(O,16));if(X)return String.fromCodePoint(parseInt(X,16))}):w}const v=/[\u0000-\u0020<>"{}|^`\\]/g,I=[];for(let w=0;w<=127;++w)v.test(String.fromCharCode(w))&&(I[w]="\\u"+w.toString(16).toUpperCase().padStart(4,"0"),v.lastIndex=0);function A(w){return v.test(w)?w.replace(v,function(y){return I[y.codePointAt(0)]}):w}const N=/(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function P(w){return N.test(w)?w.replace(N,function(y,S,O){if(S)return String.fromCharCode(parseInt(S,16));if(O)return String.fromCodePoint(parseInt(O,16))}):w}return ya}var ba,hd;function Tm(){if(hd)return ba;hd=1;const i=Hl(),e=Ff(),n=jf(),r=Ul(),{setImmediate:o}=Of();ba=class{constructor({createMessageDigest:u=null,messageDigestAlgorithm:f="sha256",canonicalIdMap:h=new Map,maxWorkFactor:g=1,maxDeepIterations:m=-1,signal:d=null}={}){this.name="RDFC-1.0",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("c14n",h),this.createMessageDigest=u||(()=>new e(f)),this.maxWorkFactor=g,this.maxDeepIterations=m,this.remainingDeepIterations=0,this.signal=d,this.quads=null}async main(u){this.quads=u;for(const v of u)this._addBlankNodeQuadInfo({quad:v,component:v.subject}),this._addBlankNodeQuadInfo({quad:v,component:v.object}),this._addBlankNodeQuadInfo({quad:v,component:v.graph});const f=new Map,h=[...this.blankNodeInfo.keys()];let g=0;for(const v of h)++g%100===0&&await this._yield(),await this._hashAndTrackBlankNode({id:v,hashToBlankNodes:f});const m=[...f.keys()].sort(),d=[];for(const v of m){const I=f.get(v);if(I.length>1){d.push(I);continue}const A=I[0];this.canonicalIssuer.getId(A)}if(this.maxDeepIterations<0)if(this.maxWorkFactor===0)this.maxDeepIterations=0;else if(this.maxWorkFactor===1/0)this.maxDeepIterations=1/0;else{const v=d.reduce((I,A)=>I+A.length,0);this.maxDeepIterations=v**this.maxWorkFactor}this.maxDeepIterations>Number.MAX_SAFE_INTEGER&&(this.maxDeepIterations=1/0),this.remainingDeepIterations=this.maxDeepIterations;for(const v of d){const I=[];for(const A of v){if(this.canonicalIssuer.hasId(A))continue;const N=new i("b");N.getId(A);const P=await this.hashNDegreeQuads(A,N);I.push(P)}I.sort(a);for(const A of I){const N=A.issuer.getOldIds();for(const P of N)this.canonicalIssuer.getId(P)}}const _=[];for(const v of this.quads){const I=r.serializeQuadComponents(this._componentWithCanonicalId(v.subject),v.predicate,this._componentWithCanonicalId(v.object),this._componentWithCanonicalId(v.graph));_.push(I)}return _.sort(),_.join("")}async hashFirstDegreeQuads(u){const f=[],h=this.blankNodeInfo.get(u),g=h.quads;for(const d of g)f.push(r.serializeQuadComponents(this.modifyFirstDegreeComponent(u,d.subject,"subject"),d.predicate,this.modifyFirstDegreeComponent(u,d.object,"object"),this.modifyFirstDegreeComponent(u,d.graph,"graph")));f.sort();const m=this.createMessageDigest();for(const d of f)m.update(d);return h.hash=await m.digest(),h.hash}async hashRelatedBlankNode(u,f,h,g){const m=this.createMessageDigest();m.update(g),g!=="g"&&m.update(this.getRelatedPredicate(f));let d;return this.canonicalIssuer.hasId(u)?d="_:"+this.canonicalIssuer.getId(u):h.hasId(u)?d="_:"+h.getId(u):d=this.blankNodeInfo.get(u).hash,m.update(d),m.digest()}async hashNDegreeQuads(u,f){if(this.remainingDeepIterations===0)throw new Error(`Maximum deep iterations exceeded (${this.maxDeepIterations}).`);this.remainingDeepIterations--;const h=this.createMessageDigest(),g=await this.createHashToRelated(u,f),m=[...g.keys()].sort();for(const d of m){h.update(d);let _="",v;const I=new n(g.get(d));let A=0;for(;I.hasNext();){const N=I.next();if(++A%3===0){if(this.signal&&this.signal.aborted)throw new Error(`Abort signal received: "${this.signal.reason}".`);await this._yield()}let P=f.clone(),w="";const y=[];let S=!1;for(const O of N)if(this.canonicalIssuer.hasId(O)?w+="_:"+this.canonicalIssuer.getId(O):(P.hasId(O)||y.push(O),w+="_:"+P.getId(O)),_.length!==0&&w>_){S=!0;break}if(!S){for(const O of y){const X=await this.hashNDegreeQuads(O,P);if(w+="_:"+P.getId(O),w+=`<${X.hash}>`,P=X.issuer,_.length!==0&&w>_){S=!0;break}}S||(_.length===0||w<_)&&(_=w,v=P)}}h.update(_),f=v}return{hash:await h.digest(),issuer:f}}modifyFirstDegreeComponent(u,f){return f.termType!=="BlankNode"?f:{termType:"BlankNode",value:f.value===u?"a":"z"}}getRelatedPredicate(u){return`<${u.predicate.value}>`}async createHashToRelated(u,f){const h=new Map,g=this.blankNodeInfo.get(u).quads;let m=0;for(const d of g)++m%100===0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:d,component:d.subject,position:"s",id:u,issuer:f,hashToRelated:h}),this._addRelatedBlankNodeHash({quad:d,component:d.object,position:"o",id:u,issuer:f,hashToRelated:h}),this._addRelatedBlankNodeHash({quad:d,component:d.graph,position:"g",id:u,issuer:f,hashToRelated:h})]);return h}async _hashAndTrackBlankNode({id:u,hashToBlankNodes:f}){const h=await this.hashFirstDegreeQuads(u),g=f.get(h);g?g.push(u):f.set(h,[u])}_addBlankNodeQuadInfo({quad:u,component:f}){if(f.termType!=="BlankNode")return;const h=f.value,g=this.blankNodeInfo.get(h);g?g.quads.add(u):this.blankNodeInfo.set(h,{quads:new Set([u]),hash:null})}async _addRelatedBlankNodeHash({quad:u,component:f,position:h,id:g,issuer:m,hashToRelated:d}){if(!(f.termType==="BlankNode"&&f.value!==g))return;const _=f.value,v=await this.hashRelatedBlankNode(_,u,m,h),I=d.get(v);I?I.push(_):d.set(v,[_])}_componentWithCanonicalId(u){return u.termType==="BlankNode"&&!u.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(u.value)}:u}async _yield(){return new Promise(u=>o(u))}};function a(l,u){return l.hash<u.hash?-1:l.hash>u.hash?1:0}return ba}var va,fd;function Lm(){if(fd)return va;fd=1;const i=Hl(),e=Ff(),n=jf(),r=Ul();va=class{constructor({createMessageDigest:l=null,messageDigestAlgorithm:u="sha256",canonicalIdMap:f=new Map,maxWorkFactor:h=1,maxDeepIterations:g=-1,timeout:m=0}={}){this.name="RDFC-1.0",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("c14n",f),this.createMessageDigest=l||(()=>new e(u)),this.maxWorkFactor=h,this.maxDeepIterations=g,this.remainingDeepIterations=0,this.timeout=m,m>0&&(this.startTime=Date.now()),this.quads=null}main(l){this.quads=l;for(const d of l)this._addBlankNodeQuadInfo({quad:d,component:d.subject}),this._addBlankNodeQuadInfo({quad:d,component:d.object}),this._addBlankNodeQuadInfo({quad:d,component:d.graph});const u=new Map,f=[...this.blankNodeInfo.keys()];for(const d of f)this._hashAndTrackBlankNode({id:d,hashToBlankNodes:u});const h=[...u.keys()].sort(),g=[];for(const d of h){const _=u.get(d);if(_.length>1){g.push(_);continue}const v=_[0];this.canonicalIssuer.getId(v)}if(this.maxDeepIterations<0)if(this.maxWorkFactor===0)this.maxDeepIterations=0;else if(this.maxWorkFactor===1/0)this.maxDeepIterations=1/0;else{const d=g.reduce((_,v)=>_+v.length,0);this.maxDeepIterations=d**this.maxWorkFactor}this.maxDeepIterations>Number.MAX_SAFE_INTEGER&&(this.maxDeepIterations=1/0),this.remainingDeepIterations=this.maxDeepIterations;for(const d of g){const _=[];for(const v of d){if(this.canonicalIssuer.hasId(v))continue;const I=new i("b");I.getId(v);const A=this.hashNDegreeQuads(v,I);_.push(A)}_.sort(o);for(const v of _){const I=v.issuer.getOldIds();for(const A of I)this.canonicalIssuer.getId(A)}}const m=[];for(const d of this.quads){const _=r.serializeQuadComponents(this._componentWithCanonicalId(d.subject),d.predicate,this._componentWithCanonicalId(d.object),this._componentWithCanonicalId(d.graph));m.push(_)}return m.sort(),m.join("")}hashFirstDegreeQuads(l){const u=[],f=this.blankNodeInfo.get(l),h=f.quads;for(const m of h)u.push(r.serializeQuadComponents(this.modifyFirstDegreeComponent(l,m.subject,"subject"),m.predicate,this.modifyFirstDegreeComponent(l,m.object,"object"),this.modifyFirstDegreeComponent(l,m.graph,"graph")));u.sort();const g=this.createMessageDigest();for(const m of u)g.update(m);return f.hash=g.digest(),f.hash}hashRelatedBlankNode(l,u,f,h){const g=this.createMessageDigest();g.update(h),h!=="g"&&g.update(this.getRelatedPredicate(u));let m;return this.canonicalIssuer.hasId(l)?m="_:"+this.canonicalIssuer.getId(l):f.hasId(l)?m="_:"+f.getId(l):m=this.blankNodeInfo.get(l).hash,g.update(m),g.digest()}hashNDegreeQuads(l,u){if(this.remainingDeepIterations===0)throw new Error(`Maximum deep iterations exceeded (${this.maxDeepIterations}).`);this.remainingDeepIterations--;const f=this.createMessageDigest(),h=this.createHashToRelated(l,u),g=[...h.keys()].sort();for(const m of g){f.update(m);let d="",_;const v=new n(h.get(m));let I=0;for(;v.hasNext();){const A=v.next();if(++I%3===0&&this.timeout>0&&Date.now()-this.startTime>this.timeout)throw new Error("Canonize timeout.");let N=u.clone(),P="";const w=[];let y=!1;for(const S of A)if(this.canonicalIssuer.hasId(S)?P+="_:"+this.canonicalIssuer.getId(S):(N.hasId(S)||w.push(S),P+="_:"+N.getId(S)),d.length!==0&&P>d){y=!0;break}if(!y){for(const S of w){const O=this.hashNDegreeQuads(S,N);if(P+="_:"+N.getId(S),P+=`<${O.hash}>`,N=O.issuer,d.length!==0&&P>d){y=!0;break}}y||(d.length===0||P<d)&&(d=P,_=N)}}f.update(d),u=_}return{hash:f.digest(),issuer:u}}modifyFirstDegreeComponent(l,u){return u.termType!=="BlankNode"?u:{termType:"BlankNode",value:u.value===l?"a":"z"}}getRelatedPredicate(l){return`<${l.predicate.value}>`}createHashToRelated(l,u){const f=new Map,h=this.blankNodeInfo.get(l).quads;for(const g of h)this._addRelatedBlankNodeHash({quad:g,component:g.subject,position:"s",id:l,issuer:u,hashToRelated:f}),this._addRelatedBlankNodeHash({quad:g,component:g.object,position:"o",id:l,issuer:u,hashToRelated:f}),this._addRelatedBlankNodeHash({quad:g,component:g.graph,position:"g",id:l,issuer:u,hashToRelated:f});return f}_hashAndTrackBlankNode({id:l,hashToBlankNodes:u}){const f=this.hashFirstDegreeQuads(l),h=u.get(f);h?h.push(l):u.set(f,[l])}_addBlankNodeQuadInfo({quad:l,component:u}){if(u.termType!=="BlankNode")return;const f=u.value,h=this.blankNodeInfo.get(f);h?h.quads.add(l):this.blankNodeInfo.set(f,{quads:new Set([l]),hash:null})}_addRelatedBlankNodeHash({quad:l,component:u,position:f,id:h,issuer:g,hashToRelated:m}){if(!(u.termType==="BlankNode"&&u.value!==h))return;const d=u.value,_=this.hashRelatedBlankNode(d,l,g,f),v=m.get(_);v?v.push(d):m.set(_,[d])}_componentWithCanonicalId(l){return l.termType==="BlankNode"&&!l.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(l.value)}:l}};function o(a,l){return a.hash<l.hash?-1:a.hash>l.hash?1:0}return va}var pd;function Im(){return pd||(pd=1,(function(i){const e=Tm(),n=Lm();function r(l,u){if(u.inputFormat){if(u.inputFormat==="application/n-quads"){if(typeof l!="string")throw new Error("N-Quads input must be a string.");return i.NQuads.parse(l)}throw new Error(`Unknown canonicalization input format: "${u.inputFormat}".`)}return l}function o(l){if(l.format&&l.format!=="application/n-quads")throw new Error(`Unknown canonicalization output format: "${l.format}".`)}function a(){globalThis.RDF_CANONIZE_TRACE_URDNA2015&&console.trace("[rdf-canonize] URDNA2015 is deprecated, use RDFC-1.0")}i.NQuads=Ul(),i.IdentifierIssuer=Hl(),i.canonize=async function(l,u={}){const f=r(l,u);if(o(u),!("algorithm"in u))throw new Error("No RDF Dataset Canonicalization algorithm specified.");if(u.algorithm==="RDFC-1.0")return new e(u).main(f);if(u.algorithm==="URDNA2015"&&!u.rejectURDNA2015)return a(),new e(u).main(f);throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+u.algorithm)},i._canonizeSync=function(l,u={}){const f=r(l,u);if(o(u),!("algorithm"in u))throw new Error("No RDF Dataset Canonicalization algorithm specified.");if(u.algorithm==="RDFC-1.0")return new n(u).main(f);if(u.algorithm==="URDNA2015"&&!u.rejectURDNA2015)return a(),new n(u).main(f);throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+u.algorithm)}})(fa)),fa}var wa,gd;function Vl(){return gd||(gd=1,wa=Im()),wa}var xa,md;function zt(){if(md)return xa;md=1;const i={};return xa=i,i.isArray=Array.isArray,i.isBoolean=e=>typeof e=="boolean"||Object.prototype.toString.call(e)==="[object Boolean]",i.isDouble=e=>i.isNumber(e)&&(String(e).indexOf(".")!==-1||Math.abs(e)>=1e21),i.isEmptyObject=e=>i.isObject(e)&&Object.keys(e).length===0,i.isNumber=e=>typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]",i.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),i.isObject=e=>Object.prototype.toString.call(e)==="[object Object]",i.isString=e=>typeof e=="string"||Object.prototype.toString.call(e)==="[object String]",i.isUndefined=e=>typeof e>"u",xa}var Ea,_d;function On(){if(_d)return Ea;_d=1;const i=zt(),e={};return Ea=e,e.isSubject=n=>i.isObject(n)&&!("@value"in n||"@set"in n||"@list"in n)?Object.keys(n).length>1||!("@id"in n):!1,e.isSubjectReference=n=>i.isObject(n)&&Object.keys(n).length===1&&"@id"in n,e.isValue=n=>i.isObject(n)&&"@value"in n,e.isList=n=>i.isObject(n)&&"@list"in n,e.isGraph=n=>i.isObject(n)&&"@graph"in n&&Object.keys(n).filter(r=>r!=="@id"&&r!=="@index").length===1,e.isSimpleGraph=n=>e.isGraph(n)&&!("@id"in n),e.isBlankNode=n=>{if(i.isObject(n)){if("@id"in n){const r=n["@id"];return!i.isString(r)||r.indexOf("_:")===0}return Object.keys(n).length===0||!("@value"in n||"@set"in n||"@list"in n)}return!1},Ea}var Sa,yd;function Kt(){return yd||(yd=1,Sa=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",n="jsonld.Error",r={}){super(e),this.name=n,this.message=e,this.details=r}}),Sa}var Ta,bd;function Qt(){if(bd)return Ta;bd=1;const i=On(),e=zt(),n=Vl().IdentifierIssuer,r=Kt(),o=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,u=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,f=/^@[a-zA-Z]+$/,h={headers:{accept:"application/ld+json, application/json"}},g={};Ta=g,g.IdentifierIssuer=n,g.REGEX_BCP47=o,g.REGEX_KEYWORD=f,g.clone=function(d){if(d&&typeof d=="object"){let _;if(e.isArray(d)){_=[];for(let v=0;v<d.length;++v)_[v]=g.clone(d[v])}else if(d instanceof Map){_=new Map;for(const[v,I]of d)_.set(v,g.clone(I))}else if(d instanceof Set){_=new Set;for(const v of d)_.add(g.clone(v))}else if(e.isObject(d)){_={};for(const v in d)_[v]=g.clone(d[v])}else _=d.toString();return _}return d},g.asArray=function(d){return Array.isArray(d)?d:[d]},g.buildHeaders=(d={})=>{if(Object.keys(d).some(v=>v.toLowerCase()==="accept"))throw new RangeError('Accept header may not be specified; only "'+h.headers.accept+'" is supported.');return Object.assign({Accept:h.headers.accept},d)},g.parseLinkHeader=d=>{const _={},v=d.match(a);for(let I=0;I<v.length;++I){let A=v[I].match(l);if(!A)continue;const N={target:A[1]},P=A[2];for(;A=u.exec(P);)N[A[1]]=A[2]===void 0?A[3]:A[2];const w=N.rel||"";Array.isArray(_[w])?_[w].push(N):_.hasOwnProperty(w)?_[w]=[_[w],N]:_[w]=N}return _},g.validateTypeValue=(d,_)=>{if(!e.isString(d)&&!(e.isArray(d)&&d.every(v=>e.isString(v)))){if(_&&e.isObject(d))switch(Object.keys(d).length){case 0:return;case 1:if("@default"in d&&g.asArray(d["@default"]).every(v=>e.isString(v)))return}throw new r('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:d})}},g.hasProperty=(d,_)=>{if(d.hasOwnProperty(_)){const v=d[_];return!e.isArray(v)||v.length>0}return!1},g.hasValue=(d,_,v)=>{if(g.hasProperty(d,_)){let I=d[_];const A=i.isList(I);if(e.isArray(I)||A){A&&(I=I["@list"]);for(let N=0;N<I.length;++N)if(g.compareValues(v,I[N]))return!0}else if(!e.isArray(v))return g.compareValues(v,I)}return!1},g.addValue=(d,_,v,I)=>{if(I=I||{},"propertyIsArray"in I||(I.propertyIsArray=!1),"valueIsArray"in I||(I.valueIsArray=!1),"allowDuplicate"in I||(I.allowDuplicate=!0),"prependValue"in I||(I.prependValue=!1),I.valueIsArray)d[_]=v;else if(e.isArray(v)){v.length===0&&I.propertyIsArray&&!d.hasOwnProperty(_)&&(d[_]=[]),I.prependValue&&(v=v.concat(d[_]),d[_]=[]);for(let A=0;A<v.length;++A)g.addValue(d,_,v[A],I)}else if(d.hasOwnProperty(_)){const A=!I.allowDuplicate&&g.hasValue(d,_,v);!e.isArray(d[_])&&(!A||I.propertyIsArray)&&(d[_]=[d[_]]),A||(I.prependValue?d[_].unshift(v):d[_].push(v))}else d[_]=I.propertyIsArray?[v]:v},g.getValues=(d,_)=>[].concat(d[_]||[]),g.removeProperty=(d,_)=>{delete d[_]},g.removeValue=(d,_,v,I)=>{I=I||{},"propertyIsArray"in I||(I.propertyIsArray=!1);const A=g.getValues(d,_).filter(N=>!g.compareValues(N,v));A.length===0?g.removeProperty(d,_):A.length===1&&!I.propertyIsArray?d[_]=A[0]:d[_]=A},g.relabelBlankNodes=(d,_)=>{_=_||{};const v=_.issuer||new n("_:b");return m(v,d)},g.compareValues=(d,_)=>d===_||i.isValue(d)&&i.isValue(_)&&d["@value"]===_["@value"]&&d["@type"]===_["@type"]&&d["@language"]===_["@language"]&&d["@index"]===_["@index"]?!0:e.isObject(d)&&"@id"in d&&e.isObject(_)&&"@id"in _?d["@id"]===_["@id"]:!1,g.compareShortestLeast=(d,_)=>d.length<_.length?-1:_.length<d.length?1:d===_?0:d<_?-1:1;function m(d,_){if(e.isArray(_))for(let v=0;v<_.length;++v)_[v]=m(d,_[v]);else if(i.isList(_))_["@list"]=m(d,_["@list"]);else if(e.isObject(_)){i.isBlankNode(_)&&(_["@id"]=d.getId(_["@id"]));const v=Object.keys(_).sort();for(let I=0;I<v.length;++I){const A=v[I];A!=="@id"&&(_[A]=m(d,_[A]))}}return _}return Ta}var La,vd;function Wl(){if(vd)return La;vd=1;const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",e="http://www.w3.org/2001/XMLSchema#";return La={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:i,RDF_LIST:i+"List",RDF_FIRST:i+"first",RDF_REST:i+"rest",RDF_NIL:i+"nil",RDF_TYPE:i+"type",RDF_PLAIN_LITERAL:i+"PlainLiteral",RDF_XML_LITERAL:i+"XMLLiteral",RDF_JSON_LITERAL:i+"JSON",RDF_OBJECT:i+"object",RDF_LANGSTRING:i+"langString",XSD:e,XSD_BOOLEAN:e+"boolean",XSD_DOUBLE:e+"double",XSD_INTEGER:e+"integer",XSD_STRING:e+"string"},La}var Ia,wd;function Bf(){return wd||(wd=1,Ia=class{constructor(){this._requests={}}wrapLoader(e){const n=this;return n._loader=e,function(){return n.add.apply(n,arguments)}}async add(e){let n=this._requests[e];if(n)return Promise.resolve(n);n=this._requests[e]=this._loader(e);try{return await n}finally{delete this._requests[e]}}}),Ia}var Aa,xd;function Jn(){if(xd)return Aa;xd=1;const i=zt(),e={};Aa=e,e.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},e.parse=(r,o)=>{const a={},l=e.parsers[o||"full"],u=l.regex.exec(r);let f=l.keys.length;for(;f--;)a[l.keys[f]]=u[f]===void 0?null:u[f];return(a.scheme==="https"&&a.port==="443"||a.scheme==="http"&&a.port==="80")&&(a.href=a.href.replace(":"+a.port,""),a.authority=a.authority.replace(":"+a.port,""),a.port=null),a.normalizedPath=e.removeDotSegments(a.path),a},e.prependBase=(r,o)=>{if(r===null||e.isAbsolute(o))return o;(!r||i.isString(r))&&(r=e.parse(r||""));const a=e.parse(o),l={protocol:r.protocol||""};if(a.authority!==null)l.authority=a.authority,l.path=a.path,l.query=a.query;else if(l.authority=r.authority,a.path==="")l.path=r.path,a.query!==null?l.query=a.query:l.query=r.query;else{if(a.path.indexOf("/")===0)l.path=a.path;else{let f=r.path;f=f.substr(0,f.lastIndexOf("/")+1),(f.length>0||r.authority)&&f.substr(-1)!=="/"&&(f+="/"),f+=a.path,l.path=f}l.query=a.query}a.path!==""&&(l.path=e.removeDotSegments(l.path));let u=l.protocol;return l.authority!==null&&(u+="//"+l.authority),u+=l.path,l.query!==null&&(u+="?"+l.query),a.fragment!==null&&(u+="#"+a.fragment),u===""&&(u="./"),u},e.removeBase=(r,o)=>{if(r===null)return o;(!r||i.isString(r))&&(r=e.parse(r||""));let a="";if(r.href!==""?a+=(r.protocol||"")+"//"+(r.authority||""):o.indexOf("//")&&(a+="//"),o.indexOf(a)!==0)return o;const l=e.parse(o.substr(a.length)),u=r.normalizedPath.split("/"),f=l.normalizedPath.split("/"),h=l.fragment||l.query?0:1;for(;u.length>0&&f.length>h&&u[0]===f[0];)u.shift(),f.shift();let g="";if(u.length>0){u.pop();for(let m=0;m<u.length;++m)g+="../"}return g+=f.join("/"),l.query!==null&&(g+="?"+l.query),l.fragment!==null&&(g+="#"+l.fragment),g===""&&(g="./"),g},e.removeDotSegments=r=>{if(r.length===0)return"";const o=r.split("/"),a=[];for(;o.length>0;){const l=o.shift(),u=o.length===0;if(l==="."){u&&a.push("");continue}if(l===".."){a.pop(),u&&a.push("");continue}a.push(l)}return r[0]==="/"&&a.length>0&&a[0]!==""&&a.unshift(""),a.length===1&&a[0]===""?"/":a.join("/")};const n=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;return e.isAbsolute=r=>i.isString(r)&&n.test(r),e.isRelative=r=>i.isString(r),Aa}var Na,Ed;function Am(){if(Ed)return Na;Ed=1;const{parseLinkHeader:i,buildHeaders:e}=Qt(),{LINK_HEADER_CONTEXT:n}=Wl(),r=Kt(),o=Bf(),{prependBase:a}=Jn(),l=/(^|(\r\n))link:/i;Na=({secure:f,headers:h={},xhr:g}={headers:{}})=>{return h=e(h),new o().wrapLoader(d);async function d(_){if(_.indexOf("http:")!==0&&_.indexOf("https:")!==0)throw new r('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:_});if(f&&_.indexOf("https")!==0)throw new r(`URL could not be dereferenced; secure mode is enabled and the URL's scheme is not "https".`,"jsonld.InvalidUrl",{code:"loading document failed",url:_});let v;try{v=await u(g,_,h)}catch(w){throw new r("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:_,cause:w})}if(v.status>=400)throw new r("URL could not be dereferenced: "+v.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:_,httpStatusCode:v.status});let I={contextUrl:null,documentUrl:_,document:v.response},A=null;const N=v.getResponseHeader("Content-Type");let P;if(l.test(v.getAllResponseHeaders())&&(P=v.getResponseHeader("Link")),P&&N!=="application/ld+json"){const w=i(P),y=w[n];if(Array.isArray(y))throw new r("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:_});y&&(I.contextUrl=y.target),A=w.alternate,A&&A.type=="application/ld+json"&&!(N||"").match(/^application\/(\w*\+)?json$/)&&(I=await d(a(_,A.target)))}return I}};function u(f,h,g){f=f||XMLHttpRequest;const m=new f;return new Promise((d,_)=>{m.onload=()=>d(m),m.onerror=v=>_(v),m.open("GET",h,!0);for(const v in g)m.setRequestHeader(v,g[v]);m.send()})}return Na}var Ra,Sd;function Nm(){if(Sd)return Ra;Sd=1;const i=Am(),e={};return Ra=e,e.setupDocumentLoaders=function(n){typeof XMLHttpRequest<"u"&&(n.documentLoaders.xhr=i,n.useDocumentLoader("xhr"))},e.setupGlobals=function(n){typeof globalThis.JsonLdProcessor>"u"&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:n.JsonLdProcessor})},Ra}var Ca,Td;function Rm(){return Td||(Td=1,Ca=function(i){i.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Ca}var Pa,Ld;function Cm(){if(Ld)return Pa;Ld=1,Pa=i,i.Node=o,i.create=i;function i(a){var l=this;if(l instanceof i||(l=new i),l.tail=null,l.head=null,l.length=0,a&&typeof a.forEach=="function")a.forEach(function(h){l.push(h)});else if(arguments.length>0)for(var u=0,f=arguments.length;u<f;u++)l.push(arguments[u]);return l}i.prototype.removeNode=function(a){if(a.list!==this)throw new Error("removing node which does not belong to this list");var l=a.next,u=a.prev;return l&&(l.prev=u),u&&(u.next=l),a===this.head&&(this.head=l),a===this.tail&&(this.tail=u),a.list.length--,a.next=null,a.prev=null,a.list=null,l},i.prototype.unshiftNode=function(a){if(a!==this.head){a.list&&a.list.removeNode(a);var l=this.head;a.list=this,a.next=l,l&&(l.prev=a),this.head=a,this.tail||(this.tail=a),this.length++}},i.prototype.pushNode=function(a){if(a!==this.tail){a.list&&a.list.removeNode(a);var l=this.tail;a.list=this,a.prev=l,l&&(l.next=a),this.tail=a,this.head||(this.head=a),this.length++}},i.prototype.push=function(){for(var a=0,l=arguments.length;a<l;a++)n(this,arguments[a]);return this.length},i.prototype.unshift=function(){for(var a=0,l=arguments.length;a<l;a++)r(this,arguments[a]);return this.length},i.prototype.pop=function(){if(this.tail){var a=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,a}},i.prototype.shift=function(){if(this.head){var a=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,a}},i.prototype.forEach=function(a,l){l=l||this;for(var u=this.head,f=0;u!==null;f++)a.call(l,u.value,f,this),u=u.next},i.prototype.forEachReverse=function(a,l){l=l||this;for(var u=this.tail,f=this.length-1;u!==null;f--)a.call(l,u.value,f,this),u=u.prev},i.prototype.get=function(a){for(var l=0,u=this.head;u!==null&&l<a;l++)u=u.next;if(l===a&&u!==null)return u.value},i.prototype.getReverse=function(a){for(var l=0,u=this.tail;u!==null&&l<a;l++)u=u.prev;if(l===a&&u!==null)return u.value},i.prototype.map=function(a,l){l=l||this;for(var u=new i,f=this.head;f!==null;)u.push(a.call(l,f.value,this)),f=f.next;return u},i.prototype.mapReverse=function(a,l){l=l||this;for(var u=new i,f=this.tail;f!==null;)u.push(a.call(l,f.value,this)),f=f.prev;return u},i.prototype.reduce=function(a,l){var u,f=this.head;if(arguments.length>1)u=l;else if(this.head)f=this.head.next,u=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=0;f!==null;h++)u=a(u,f.value,h),f=f.next;return u},i.prototype.reduceReverse=function(a,l){var u,f=this.tail;if(arguments.length>1)u=l;else if(this.tail)f=this.tail.prev,u=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=this.length-1;f!==null;h--)u=a(u,f.value,h),f=f.prev;return u},i.prototype.toArray=function(){for(var a=new Array(this.length),l=0,u=this.head;u!==null;l++)a[l]=u.value,u=u.next;return a},i.prototype.toArrayReverse=function(){for(var a=new Array(this.length),l=0,u=this.tail;u!==null;l++)a[l]=u.value,u=u.prev;return a},i.prototype.slice=function(a,l){l=l||this.length,l<0&&(l+=this.length),a=a||0,a<0&&(a+=this.length);var u=new i;if(l<a||l<0)return u;a<0&&(a=0),l>this.length&&(l=this.length);for(var f=0,h=this.head;h!==null&&f<a;f++)h=h.next;for(;h!==null&&f<l;f++,h=h.next)u.push(h.value);return u},i.prototype.sliceReverse=function(a,l){l=l||this.length,l<0&&(l+=this.length),a=a||0,a<0&&(a+=this.length);var u=new i;if(l<a||l<0)return u;a<0&&(a=0),l>this.length&&(l=this.length);for(var f=this.length,h=this.tail;h!==null&&f>l;f--)h=h.prev;for(;h!==null&&f>a;f--,h=h.prev)u.push(h.value);return u},i.prototype.splice=function(a,l,...u){a>this.length&&(a=this.length-1),a<0&&(a=this.length+a);for(var f=0,h=this.head;h!==null&&f<a;f++)h=h.next;for(var g=[],f=0;h&&f<l;f++)g.push(h.value),h=this.removeNode(h);h===null&&(h=this.tail),h!==this.head&&h!==this.tail&&(h=h.prev);for(var f=0;f<u.length;f++)h=e(this,h,u[f]);return g},i.prototype.reverse=function(){for(var a=this.head,l=this.tail,u=a;u!==null;u=u.prev){var f=u.prev;u.prev=u.next,u.next=f}return this.head=l,this.tail=a,this};function e(a,l,u){var f=l===a.head?new o(u,null,l,a):new o(u,l,l.next,a);return f.next===null&&(a.tail=f),f.prev===null&&(a.head=f),a.length++,f}function n(a,l){a.tail=new o(l,a.tail,null,a),a.head||(a.head=a.tail),a.length++}function r(a,l){a.head=new o(l,null,a.head,a),a.tail||(a.tail=a.head),a.length++}function o(a,l,u,f){if(!(this instanceof o))return new o(a,l,u,f);this.list=f,this.value=a,l?(l.next=this,this.prev=l):this.prev=null,u?(u.prev=this,this.next=u):this.next=null}try{Rm()(i)}catch{}return Pa}var ka,Id;function $f(){if(Id)return ka;Id=1;const i=Cm(),e=Symbol("max"),n=Symbol("length"),r=Symbol("lengthCalculator"),o=Symbol("allowStale"),a=Symbol("maxAge"),l=Symbol("dispose"),u=Symbol("noDisposeOnSet"),f=Symbol("lruList"),h=Symbol("cache"),g=Symbol("updateAgeOnGet"),m=()=>1;class d{constructor(y){if(typeof y=="number"&&(y={max:y}),y||(y={}),y.max&&(typeof y.max!="number"||y.max<0))throw new TypeError("max must be a non-negative number");this[e]=y.max||1/0;const S=y.length||m;if(this[r]=typeof S!="function"?m:S,this[o]=y.stale||!1,y.maxAge&&typeof y.maxAge!="number")throw new TypeError("maxAge must be a number");this[a]=y.maxAge||0,this[l]=y.dispose,this[u]=y.noDisposeOnSet||!1,this[g]=y.updateAgeOnGet||!1,this.reset()}set max(y){if(typeof y!="number"||y<0)throw new TypeError("max must be a non-negative number");this[e]=y||1/0,I(this)}get max(){return this[e]}set allowStale(y){this[o]=!!y}get allowStale(){return this[o]}set maxAge(y){if(typeof y!="number")throw new TypeError("maxAge must be a non-negative number");this[a]=y,I(this)}get maxAge(){return this[a]}set lengthCalculator(y){typeof y!="function"&&(y=m),y!==this[r]&&(this[r]=y,this[n]=0,this[f].forEach(S=>{S.length=this[r](S.value,S.key),this[n]+=S.length})),I(this)}get lengthCalculator(){return this[r]}get length(){return this[n]}get itemCount(){return this[f].length}rforEach(y,S){S=S||this;for(let O=this[f].tail;O!==null;){const X=O.prev;P(this,y,O,S),O=X}}forEach(y,S){S=S||this;for(let O=this[f].head;O!==null;){const X=O.next;P(this,y,O,S),O=X}}keys(){return this[f].toArray().map(y=>y.key)}values(){return this[f].toArray().map(y=>y.value)}reset(){this[l]&&this[f]&&this[f].length&&this[f].forEach(y=>this[l](y.key,y.value)),this[h]=new Map,this[f]=new i,this[n]=0}dump(){return this[f].map(y=>v(this,y)?!1:{k:y.key,v:y.value,e:y.now+(y.maxAge||0)}).toArray().filter(y=>y)}dumpLru(){return this[f]}set(y,S,O){if(O=O||this[a],O&&typeof O!="number")throw new TypeError("maxAge must be a number");const X=O?Date.now():0,C=this[r](S,y);if(this[h].has(y)){if(C>this[e])return A(this,this[h].get(y)),!1;const $=this[h].get(y).value;return this[l]&&(this[u]||this[l](y,$.value)),$.now=X,$.maxAge=O,$.value=S,this[n]+=C-$.length,$.length=C,this.get(y),I(this),!0}const U=new N(y,S,C,X,O);return U.length>this[e]?(this[l]&&this[l](y,S),!1):(this[n]+=U.length,this[f].unshift(U),this[h].set(y,this[f].head),I(this),!0)}has(y){if(!this[h].has(y))return!1;const S=this[h].get(y).value;return!v(this,S)}get(y){return _(this,y,!0)}peek(y){return _(this,y,!1)}pop(){const y=this[f].tail;return y?(A(this,y),y.value):null}del(y){A(this,this[h].get(y))}load(y){this.reset();const S=Date.now();for(let O=y.length-1;O>=0;O--){const X=y[O],C=X.e||0;if(C===0)this.set(X.k,X.v);else{const U=C-S;U>0&&this.set(X.k,X.v,U)}}}prune(){this[h].forEach((y,S)=>_(this,S,!1))}}const _=(w,y,S)=>{const O=w[h].get(y);if(O){const X=O.value;if(v(w,X)){if(A(w,O),!w[o])return}else S&&(w[g]&&(O.value.now=Date.now()),w[f].unshiftNode(O));return X.value}},v=(w,y)=>{if(!y||!y.maxAge&&!w[a])return!1;const S=Date.now()-y.now;return y.maxAge?S>y.maxAge:w[a]&&S>w[a]},I=w=>{if(w[n]>w[e])for(let y=w[f].tail;w[n]>w[e]&&y!==null;){const S=y.prev;A(w,y),y=S}},A=(w,y)=>{if(y){const S=y.value;w[l]&&w[l](S.key,S.value),w[n]-=S.length,w[h].delete(S.key),w[f].removeNode(y)}};class N{constructor(y,S,O,X,C){this.key=y,this.value=S,this.length=O,this.now=X,this.maxAge=C||0}}const P=(w,y,S,O)=>{let X=S.value;v(w,X)&&(A(w,S),w[o]||(X=void 0)),X&&y.call(O,X.value,X.key,w)};return ka=d,ka}var Da,Ad;function Pm(){if(Ad)return Da;Ad=1;const i=$f(),e=10;return Da=class{constructor({document:r}){this.document=r,this.cache=new i({max:e})}getProcessed(r){return this.cache.get(r)}setProcessed(r,o){this.cache.set(r,o)}},Da}var Ma,Nd;function km(){if(Nd)return Ma;Nd=1;const{isArray:i,isObject:e,isString:n}=zt(),{asArray:r}=Qt(),{prependBase:o}=Jn(),a=Kt(),l=Pm(),u=10;Ma=class{constructor({sharedCache:m}){this.perOpCache=new Map,this.sharedCache=m}async resolve({activeCtx:m,context:d,documentLoader:_,base:v,cycles:I=new Set}){d&&e(d)&&d["@context"]&&(d=d["@context"]),d=r(d);const A=[];for(const N of d){if(n(N)){let y=this._get(N);y||(y=await this._resolveRemoteContext({activeCtx:m,url:N,documentLoader:_,base:v,cycles:I})),i(y)?A.push(...y):A.push(y);continue}if(N===null){A.push(new l({document:null}));continue}e(N)||f(d);const P=JSON.stringify(N);let w=this._get(P);w||(w=new l({document:N}),this._cacheResolvedContext({key:P,resolved:w,tag:"static"})),A.push(w)}return A}_get(m){let d=this.perOpCache.get(m);if(!d){const _=this.sharedCache.get(m);_&&(d=_.get("static"),d&&this.perOpCache.set(m,d))}return d}_cacheResolvedContext({key:m,resolved:d,tag:_}){if(this.perOpCache.set(m,d),_!==void 0){let v=this.sharedCache.get(m);v||(v=new Map,this.sharedCache.set(m,v)),v.set(_,d)}return d}async _resolveRemoteContext({activeCtx:m,url:d,documentLoader:_,base:v,cycles:I}){d=o(v,d);const{context:A,remoteDoc:N}=await this._fetchContext({activeCtx:m,url:d,documentLoader:_,cycles:I});v=N.documentUrl||d,h({context:A,base:v});const P=await this.resolve({activeCtx:m,context:A,documentLoader:_,base:v,cycles:I});return this._cacheResolvedContext({key:d,resolved:P,tag:N.tag}),P}async _fetchContext({activeCtx:m,url:d,documentLoader:_,cycles:v}){if(v.size>u)throw new a("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:m.processingMode==="json-ld-1.0"?"loading remote context failed":"context overflow",max:u});if(v.has(d))throw new a("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:m.processingMode==="json-ld-1.0"?"recursive context inclusion":"context overflow",url:d});v.add(d);let I,A;try{A=await _(d),I=A.document||null,n(I)&&(I=JSON.parse(I))}catch(N){throw new a(`Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context. URL: "${d}".`,"jsonld.InvalidUrl",{code:"loading remote context failed",url:d,cause:N})}if(!e(I))throw new a(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${d}".`,"jsonld.InvalidUrl",{code:"invalid remote context",url:d});return"@context"in I?I={"@context":I["@context"]}:I={"@context":{}},A.contextUrl&&(i(I["@context"])||(I["@context"]=[I["@context"]]),I["@context"].push(A.contextUrl)),{context:I,remoteDoc:A}}};function f(g){throw new a("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:g})}function h({context:g,base:m}){if(!g)return;const d=g["@context"];if(n(d)){g["@context"]=o(m,d);return}if(i(d)){for(let _=0;_<d.length;++_){const v=d[_];if(n(v)){d[_]=o(m,v);continue}e(v)&&h({context:{"@context":v},base:m})}return}if(e(d))for(const _ in d)h({context:d[_],base:m})}return Ma}var Oa,Rd;function Dm(){return Rd||(Rd=1,Oa=Vl().NQuads),Oa}var Fa,Cd;function Jr(){if(Cd)return Fa;Cd=1;const i=Kt(),{isArray:e}=zt(),{asArray:n}=Qt(),r={};Fa=r,r.defaultEventHandler=null,r.setupEventHandler=({options:l={}})=>{const u=[].concat(l.safe?r.safeEventHandler:[],l.eventHandler?n(l.eventHandler):[],r.defaultEventHandler?r.defaultEventHandler:[]);return u.length===0?null:u},r.handleEvent=({event:l,options:u})=>{o({event:l,handlers:u.eventHandler})};function o({event:l,handlers:u}){let f=!0;for(let h=0;f&&h<u.length;++h){f=!1;const g=u[h];if(e(g))f=o({event:l,handlers:g});else if(typeof g=="function")g({event:l,next:()=>{f=!0}});else if(typeof g=="object")l.code in g?g[l.code]({event:l,next:()=>{f=!0}}):f=!0;else throw new i("Invalid event handler.","jsonld.InvalidEventHandler",{event:l})}return f}const a=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference","rdfDirection not set"]);return r.safeEventHandler=function({event:u,next:f}){if(u.level==="warning"&&a.has(u.code))throw new i("Safe mode validation error.","jsonld.ValidationError",{event:u});f()},r.logEventHandler=function({event:u,next:f}){console.log(`EVENT: ${u.message}`,{event:u}),f()},r.logWarningEventHandler=function({event:u,next:f}){u.level==="warning"&&console.warn(`WARNING: ${u.message}`,{event:u}),f()},r.unhandledEventHandler=function({event:u}){throw new i("No handler for event.","jsonld.UnhandledEvent",{event:u})},r.setDefaultEventHandler=function({eventHandler:l}={}){r.defaultEventHandler=l?n(l):null},Fa}var ja,Pd;function wi(){if(Pd)return ja;Pd=1;const i=Qt(),e=Kt(),{isArray:n,isObject:r,isString:o,isUndefined:a}=zt(),{isAbsolute:l,isRelative:u,prependBase:f}=Jn(),{handleEvent:h}=Jr(),{REGEX_BCP47:g,REGEX_KEYWORD:m,asArray:d,compareShortestLeast:_}=Qt(),v=new Map,I=1e4,A={};ja=A,A.process=async({activeCtx:w,localCtx:y,options:S,propagate:O=!0,overrideProtected:X=!1,cycles:C=new Set})=>{if(r(y)&&"@context"in y&&n(y["@context"])&&(y=y["@context"]),d(y).length===0)return w;const R=[],$=[({event:se,next:M})=>{R.push(se),M()}];S.eventHandler&&$.push(S.eventHandler);const G=S;S={...S,eventHandler:$};const j=await S.contextResolver.resolve({activeCtx:w,context:y,documentLoader:S.documentLoader,base:S.base});r(j[0].document)&&typeof j[0].document["@propagate"]=="boolean"&&(O=j[0].document["@propagate"]);let F=w;!O&&!F.previousContext&&(F=F.clone(),F.previousContext=w);for(const se of j){let{document:M}=se;if(w=F,M===null){if(!X&&Object.keys(w.protected).length!==0)throw new e("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});F=w=A.getInitialContext(S).clone();continue}const re=se.getProcessed(w);if(re){if(G.eventHandler)for(const oe of re.events)h({event:oe,options:G});F=w=re.context;continue}if(r(M)&&"@context"in M&&(M=M["@context"]),!r(M))throw new e("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:M});F=F.clone();const B=new Map;if("@version"in M){if(M["@version"]!==1.1)throw new e("Unsupported JSON-LD version: "+M["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:M});if(w.processingMode&&w.processingMode==="json-ld-1.0")throw new e("@version: "+M["@version"]+" not compatible with "+w.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:M});F.processingMode="json-ld-1.1",F["@version"]=M["@version"],B.set("@version",!0)}if(F.processingMode=F.processingMode||w.processingMode,"@base"in M){let oe=M["@base"];if(!(oe===null||l(oe)))if(u(oe))oe=f(F["@base"],oe);else throw new e('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:M});F["@base"]=oe,B.set("@base",!0)}if("@vocab"in M){const oe=M["@vocab"];if(oe===null)delete F["@vocab"];else if(o(oe)){if(!l(oe)&&A.processingMode(F,1))throw new e('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:M});{const T=N(F,oe,{vocab:!0,base:!0},void 0,void 0,S);l(T)||S.eventHandler&&h({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:T}},options:S}),F["@vocab"]=T}}else throw new e('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:M});B.set("@vocab",!0)}if("@language"in M){const oe=M["@language"];if(oe===null)delete F["@language"];else if(o(oe))oe.match(g)||S.eventHandler&&h({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:oe}},options:S}),F["@language"]=oe.toLowerCase();else throw new e('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:M});B.set("@language",!0)}if("@direction"in M){const oe=M["@direction"];if(w.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @direction not compatible with "+w.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:M});if(oe===null)delete F["@direction"];else{if(oe!=="ltr"&&oe!=="rtl")throw new e('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:M});F["@direction"]=oe}B.set("@direction",!0)}if("@propagate"in M){const oe=M["@propagate"];if(w.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @propagate not compatible with "+w.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:M});if(typeof oe!="boolean")throw new e("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:y});B.set("@propagate",!0)}if("@import"in M){const oe=M["@import"];if(w.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @import not compatible with "+w.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:M});if(!o(oe))throw new e("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:y});const T=await S.contextResolver.resolve({activeCtx:w,context:oe,documentLoader:S.documentLoader,base:S.base});if(T.length!==1)throw new e("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:y});const Q=T[0].getProcessed(w);if(Q)M=Q;else{const ie=T[0].document;if("@import"in ie)throw new e("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:y});for(const Y in ie)M.hasOwnProperty(Y)||(M[Y]=ie[Y]);T[0].setProcessed(w,M)}B.set("@import",!0)}B.set("@protected",M["@protected"]||!1);for(const oe in M)if(A.createTermDefinition({activeCtx:F,localCtx:M,term:oe,defined:B,options:S,overrideProtected:X}),r(M[oe])&&"@context"in M[oe]){const T=M[oe]["@context"];let Q=!0;if(o(T)){const ie=f(S.base,T);C.has(ie)?Q=!1:C.add(ie)}if(Q)try{await A.process({activeCtx:F.clone(),localCtx:M[oe]["@context"],overrideProtected:!0,options:S,cycles:C})}catch{throw new e("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:M[oe]["@context"],term:oe})}}se.setProcessed(w,{context:F,events:R})}return F},A.createTermDefinition=({activeCtx:w,localCtx:y,term:S,defined:O,options:X,overrideProtected:C=!1})=>{if(O.has(S)){if(O.get(S))return;throw new e("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:y,term:S})}O.set(S,!1);let U;if(y.hasOwnProperty(S)&&(U=y[S]),S==="@type"&&r(U)&&(U["@container"]||"@set")==="@set"&&A.processingMode(w,1.1)){const M=["@container","@id","@protected"],re=Object.keys(U);if(re.length===0||re.some(B=>!M.includes(B)))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:y,term:S})}else{if(A.isKeyword(S))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:y,term:S});if(S.match(m)){X.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:S}},options:X});return}else if(S==="")throw new e("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:y})}const R=w.mappings.get(S);w.mappings.has(S)&&w.mappings.delete(S);let $=!1;if((o(U)||U===null)&&($=!0,U={"@id":U}),!r(U))throw new e("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:y});const G={};w.mappings.set(S,G),G.reverse=!1;const j=["@container","@id","@language","@reverse","@type"];A.processingMode(w,1.1)&&j.push("@context","@direction","@index","@nest","@prefix","@protected");for(const M in U)if(!j.includes(M))throw new e("Invalid JSON-LD syntax; a term definition must not contain "+M,"jsonld.SyntaxError",{code:"invalid term definition",context:y});const F=S.indexOf(":");if(G._termHasColon=F>0,"@reverse"in U){if("@id"in U)throw new e("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:y});if("@nest"in U)throw new e("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:y});const M=U["@reverse"];if(!o(M))throw new e("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});if(M.match(m)){X.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:M}},options:X}),R?w.mappings.set(S,R):w.mappings.delete(S);return}const re=N(w,M,{vocab:!0,base:!1},y,O,X);if(!l(re))throw new e("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});G["@id"]=re,G.reverse=!0}else if("@id"in U){let M=U["@id"];if(M&&!o(M))throw new e("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});if(M===null)G["@id"]=null;else if(!A.isKeyword(M)&&M.match(m)){X.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:M}},options:X}),R?w.mappings.set(S,R):w.mappings.delete(S);return}else if(M!==S){if(M=N(w,M,{vocab:!0,base:!1},y,O,X),!l(M)&&!A.isKeyword(M))throw new e("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});if(S.match(/(?::[^:])|\//)){const re=new Map(O).set(S,!0);if(N(w,S,{vocab:!0,base:!1},y,re,X)!==M)throw new e("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y})}G["@id"]=M,G._prefix=$&&!G._termHasColon&&M.match(/[:\/\?#\[\]@]$/)!==null}}if(!("@id"in G))if(G._termHasColon){const M=S.substr(0,F);if(y.hasOwnProperty(M)&&A.createTermDefinition({activeCtx:w,localCtx:y,term:M,defined:O,options:X}),w.mappings.has(M)){const re=S.substr(F+1);G["@id"]=w.mappings.get(M)["@id"]+re}else G["@id"]=S}else if(S==="@type")G["@id"]=S;else{if(!("@vocab"in w))throw new e("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y,term:S});G["@id"]=w["@vocab"]+S}if((U["@protected"]===!0||O.get("@protected")===!0&&U["@protected"]!==!1)&&(w.protected[S]=!0,G.protected=!0),O.set(S,!0),"@type"in U){let M=U["@type"];if(!o(M))throw new e("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:y});if(M==="@json"||M==="@none"){if(A.processingMode(w,1))throw new e(`Invalid JSON-LD syntax; an @context @type value must not be "${M}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:y})}else if(M!=="@id"&&M!=="@vocab"){if(M=N(w,M,{vocab:!0,base:!1},y,O,X),!l(M))throw new e("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:y});if(M.indexOf("_:")===0)throw new e("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:y})}G["@type"]=M}if("@container"in U){const M=o(U["@container"])?[U["@container"]]:U["@container"]||[],re=["@list","@set","@index","@language"];let B=!0;const oe=M.includes("@set");if(A.processingMode(w,1.1)){if(re.push("@graph","@id","@type"),M.includes("@list")){if(M.length!==1)throw new e("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:y})}else if(M.includes("@graph")){if(M.some(T=>T!=="@graph"&&T!=="@id"&&T!=="@index"&&T!=="@set"))throw new e("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:y})}else B&=M.length<=(oe?2:1);if(M.includes("@type")&&(G["@type"]=G["@type"]||"@id",!["@id","@vocab"].includes(G["@type"])))throw new e("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:y})}else B&=!n(U["@container"]),B&=M.length<=1;if(B&=M.every(T=>re.includes(T)),B&=!(oe&&M.includes("@list")),!B)throw new e("Invalid JSON-LD syntax; @context @container value must be one of the following: "+re.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:y});if(G.reverse&&!M.every(T=>["@index","@set"].includes(T)))throw new e("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:y});G["@container"]=M}if("@index"in U){if(!("@container"in U)||!G["@container"].includes("@index"))throw new e(`Invalid JSON-LD syntax; @index without @index in @container: "${U["@index"]}" on term "${S}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:y});if(!o(U["@index"])||U["@index"].indexOf("@")===0)throw new e(`Invalid JSON-LD syntax; @index must expand to an IRI: "${U["@index"]}" on term "${S}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:y});G["@index"]=U["@index"]}if("@context"in U&&(G["@context"]=U["@context"]),"@language"in U&&!("@type"in U)){let M=U["@language"];if(M!==null&&!o(M))throw new e("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:y});M!==null&&(M=M.toLowerCase()),G["@language"]=M}if("@prefix"in U){if(S.match(/:|\//))throw new e("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:y});if(A.isKeyword(G["@id"]))throw new e("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:y});if(typeof U["@prefix"]=="boolean")G._prefix=U["@prefix"]===!0;else throw new e("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:y})}if("@direction"in U){const M=U["@direction"];if(M!==null&&M!=="ltr"&&M!=="rtl")throw new e('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:y});G["@direction"]=M}if("@nest"in U){const M=U["@nest"];if(!o(M)||M!=="@nest"&&M.indexOf("@")===0)throw new e("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:y});G["@nest"]=M}const se=G["@id"];if(se==="@context"||se==="@preserve")throw new e("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:y});if(R&&R.protected&&!C&&(w.protected[S]=!0,G.protected=!0,!P(R,G)))throw new e("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:y,term:S})},A.expandIri=(w,y,S,O)=>N(w,y,S,void 0,void 0,O);function N(w,y,S,O,X,C){if(y===null||!o(y)||A.isKeyword(y))return y;if(y.match(m))return null;if(O&&O.hasOwnProperty(y)&&X.get(y)!==!0&&A.createTermDefinition({activeCtx:w,localCtx:O,term:y,defined:X,options:C}),S=S||{},S.vocab){const R=w.mappings.get(y);if(R===null)return null;if(r(R)&&"@id"in R)return R["@id"]}const U=y.indexOf(":");if(U>0){const R=y.substr(0,U),$=y.substr(U+1);if(R==="_"||$.indexOf("//")===0)return y;O&&O.hasOwnProperty(R)&&A.createTermDefinition({activeCtx:w,localCtx:O,term:R,defined:X,options:C});const G=w.mappings.get(R);if(G&&G._prefix)return G["@id"]+$;if(l(y))return y}if(S.vocab&&"@vocab"in w)y=w["@vocab"]+y;else if(S.base){let R,$;"@base"in w?w["@base"]?($=f(C.base,w["@base"]),R=f($,y)):($=w["@base"],R=y):($=C.base,R=f(C.base,y)),y=R}return y}A.getInitialContext=w=>{const y=JSON.stringify({processingMode:w.processingMode}),S=v.get(y);if(S)return S;const O={processingMode:w.processingMode,mappings:new Map,inverse:null,getInverse:X,clone:R,revertToPreviousContext:$,protected:{}};return v.size===I&&v.clear(),v.set(y,O),O;function X(){const G=this;if(G.inverse)return G.inverse;const j=G.inverse={},F=G.fastCurieMap={},se={},M=(G["@language"]||"@none").toLowerCase(),re=G["@direction"],B=G.mappings,oe=[...B.keys()].sort(_);for(const T of oe){const Q=B.get(T);if(Q===null)continue;let ie=Q["@container"]||"@none";if(ie=[].concat(ie).sort().join(""),Q["@id"]===null)continue;const Y=d(Q["@id"]);for(const me of Y){let Z=j[me];const W=A.isKeyword(me);if(Z)!W&&!Q._termHasColon&&se[me].push(T);else if(j[me]=Z={},!W&&!Q._termHasColon){se[me]=[T];const ee={iri:me,terms:se[me]};me[0]in F?F[me[0]].push(ee):F[me[0]]=[ee]}if(Z[ie]||(Z[ie]={"@language":{},"@type":{},"@any":{}}),Z=Z[ie],U(T,Z["@any"],"@none"),Q.reverse)U(T,Z["@type"],"@reverse");else if(Q["@type"]==="@none")U(T,Z["@any"],"@none"),U(T,Z["@language"],"@none"),U(T,Z["@type"],"@none");else if("@type"in Q)U(T,Z["@type"],Q["@type"]);else if("@language"in Q&&"@direction"in Q){const ee=Q["@language"],K=Q["@direction"];ee&&K?U(T,Z["@language"],`${ee}_${K}`.toLowerCase()):ee?U(T,Z["@language"],ee.toLowerCase()):K?U(T,Z["@language"],`_${K}`):U(T,Z["@language"],"@null")}else"@language"in Q?U(T,Z["@language"],(Q["@language"]||"@null").toLowerCase()):"@direction"in Q?Q["@direction"]?U(T,Z["@language"],`_${Q["@direction"]}`):U(T,Z["@language"],"@none"):re?(U(T,Z["@language"],`_${re}`),U(T,Z["@language"],"@none"),U(T,Z["@type"],"@none")):(U(T,Z["@language"],M),U(T,Z["@language"],"@none"),U(T,Z["@type"],"@none"))}}for(const T in F)C(F,T,1);return j}function C(G,j,F){const se=G[j],M=G[j]={};let re,B;for(const oe of se)re=oe.iri,F>=re.length?B="":B=re[F],B in M?M[B].push(oe):M[B]=[oe];for(const oe in M)oe!==""&&C(M,oe,F+1)}function U(G,j,F){j.hasOwnProperty(F)||(j[F]=G)}function R(){const G={};return G.mappings=i.clone(this.mappings),G.clone=this.clone,G.inverse=null,G.getInverse=this.getInverse,G.protected=i.clone(this.protected),this.previousContext&&(G.previousContext=this.previousContext.clone()),G.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(G["@base"]=this["@base"]),"@language"in this&&(G["@language"]=this["@language"]),"@vocab"in this&&(G["@vocab"]=this["@vocab"]),G}function $(){return this.previousContext?this.previousContext.clone():this}},A.getContextValue=(w,y,S)=>{if(y===null)return S==="@context"?void 0:null;if(w.mappings.has(y)){const O=w.mappings.get(y);if(a(S))return O;if(O.hasOwnProperty(S))return O[S]}if(S==="@language"&&S in w||S==="@direction"&&S in w)return w[S];if(S!=="@context")return null},A.processingMode=(w,y)=>y.toString()>="1.1"?!w.processingMode||w.processingMode>="json-ld-"+y.toString():w.processingMode==="json-ld-1.0",A.isKeyword=w=>{if(!o(w)||w[0]!=="@")return!1;switch(w){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1};function P(w,y){if(!(w&&typeof w=="object")||!(y&&typeof y=="object"))return w===y;const S=Array.isArray(w);if(S!==Array.isArray(y))return!1;if(S){if(w.length!==y.length)return!1;for(let C=0;C<w.length;++C)if(!P(w[C],y[C]))return!1;return!0}const O=Object.keys(w),X=Object.keys(y);if(O.length!==X.length)return!1;for(const C in w){let U=w[C],R=y[C];if(C==="@container"&&Array.isArray(U)&&Array.isArray(R)&&(U=U.slice().sort(),R=R.slice().sort()),!P(U,R))return!1}return!0}return ja}var Ba,kd;function Mm(){if(kd)return Ba;kd=1;const i=Kt(),{isArray:e,isObject:n,isEmptyObject:r,isString:o,isUndefined:a}=zt(),{isList:l,isValue:u,isGraph:f,isSubject:h}=On(),{expandIri:g,getContextValue:m,isKeyword:d,process:_,processingMode:v}=wi(),{isAbsolute:I}=Jn(),{REGEX_BCP47:A,REGEX_KEYWORD:N,addValue:P,asArray:w,getValues:y,validateTypeValue:S}=Qt(),{handleEvent:O}=Jr(),X={};Ba=X,X.expand=async({activeCtx:j,activeProperty:F=null,element:se,options:M={},insideList:re=!1,insideIndex:B=!1,typeScopedContext:oe=null})=>{if(se==null)return null;if(F==="@default"&&(M=Object.assign({},M,{isFrame:!1})),!e(se)&&!n(se))return!re&&(F===null||g(j,F,{vocab:!0},M)==="@graph")?(M.eventHandler&&O({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:se}},options:M}),null):R({activeCtx:j,activeProperty:F,value:se,options:M});if(e(se)){let ee=[];const K=m(j,F,"@container")||[];re=re||K.includes("@list");for(let ue=0;ue<se.length;++ue){let ce=await X.expand({activeCtx:j,activeProperty:F,element:se[ue],options:M,insideIndex:B,typeScopedContext:oe});re&&e(ce)&&(ce={"@list":ce}),ce!==null&&(e(ce)?ee=ee.concat(ce):ee.push(ce))}return ee}const T=g(j,F,{vocab:!0},M),Q=m(j,F,"@context");oe=oe||(j.previousContext?j:null);let ie=Object.keys(se).sort(),Y=!B;if(Y&&oe&&ie.length<=2&&!ie.includes("@context"))for(const ee of ie){const K=g(oe,ee,{vocab:!0},M);if(K==="@value"){Y=!1,j=oe;break}if(K==="@id"&&ie.length===1){Y=!1;break}}Y&&(j=j.revertToPreviousContext()),a(Q)||(j=await _({activeCtx:j,localCtx:Q,propagate:!0,overrideProtected:!0,options:M})),"@context"in se&&(j=await _({activeCtx:j,localCtx:se["@context"],options:M})),oe=j;let me=null;for(const ee of ie)if(g(j,ee,{vocab:!0},M)==="@type"){me=me||ee;const ue=se[ee],ce=Array.isArray(ue)?ue.length>1?ue.slice().sort():ue:[ue];for(const Ee of ce){const Te=m(oe,Ee,"@context");a(Te)||(j=await _({activeCtx:j,localCtx:Te,options:M,propagate:!1}))}}let Z={};await U({activeCtx:j,activeProperty:F,expandedActiveProperty:T,element:se,expandedParent:Z,options:M,insideList:re,typeKey:me,typeScopedContext:oe}),ie=Object.keys(Z);let W=ie.length;if("@value"in Z){if("@type"in Z&&("@language"in Z||"@direction"in Z))throw new i('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:Z});let ee=W-1;if("@type"in Z&&(ee-=1),"@index"in Z&&(ee-=1),"@language"in Z&&(ee-=1),"@direction"in Z&&(ee-=1),ee!==0)throw new i('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:Z});const K=Z["@value"]===null?[]:w(Z["@value"]),ue=y(Z,"@type");if(!(v(j,1.1)&&ue.includes("@json")&&ue.length===1))if(K.length===0)M.eventHandler&&O({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:Z}},options:M}),Z=null;else{if(!K.every(ce=>o(ce)||r(ce))&&"@language"in Z)throw new i("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:Z});if(!ue.every(ce=>I(ce)&&!(o(ce)&&ce.indexOf("_:")===0)||r(ce)))throw new i('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:Z})}}else if("@type"in Z&&!e(Z["@type"]))Z["@type"]=[Z["@type"]];else if("@set"in Z||"@list"in Z){if(W>1&&!(W===2&&"@index"in Z))throw new i('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:Z});"@set"in Z&&(Z=Z["@set"],ie=Object.keys(Z),W=ie.length)}else W===1&&"@language"in Z&&(M.eventHandler&&O({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:Z}},options:M}),Z=null);return n(Z)&&!M.keepFreeFloatingNodes&&!re&&(F===null||T==="@graph"||(m(j,F,"@container")||[]).includes("@graph"))&&(Z=C({value:Z,count:W,options:M})),Z};function C({value:j,count:F,options:se}){if(F===0||"@value"in j||"@list"in j||F===1&&"@id"in j){if(se.eventHandler){let M,re;F===0?(M="empty object",re="Dropping empty object."):"@value"in j?(M="object with only @value",re="Dropping object with only @value."):"@list"in j?(M="object with only @list",re="Dropping object with only @list."):F===1&&"@id"in j&&(M="object with only @id",re="Dropping object with only @id."),O({event:{type:["JsonLdEvent"],code:M,level:"warning",message:re,details:{value:j}},options:se})}return null}return j}async function U({activeCtx:j,activeProperty:F,expandedActiveProperty:se,element:M,expandedParent:re,options:B={},insideList:oe,typeKey:T,typeScopedContext:Q}){const ie=Object.keys(M).sort(),Y=[];let me;const Z=M[T]&&g(j,e(M[T])?M[T][0]:M[T],{vocab:!0},{...B,typeExpansion:!0})==="@json";for(const W of ie){let ee=M[W],K;if(W==="@context")continue;const ue=g(j,W,{vocab:!0},B);if(ue===null||!(I(ue)||d(ue))){B.eventHandler&&O({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:W,expandedProperty:ue}},options:B});continue}if(d(ue)){if(se==="@reverse")throw new i("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:ee});if(ue in re&&ue!=="@included"&&ue!=="@type")throw new i("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:ue})}if(ue==="@id"){if(!o(ee)){if(!B.isFrame)throw new i('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:ee});if(n(ee)){if(!r(ee))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:ee})}else if(e(ee)){if(!ee.every(q=>o(q)))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:ee})}else throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:ee})}P(re,"@id",w(ee).map(q=>{if(o(q)){const te=g(j,q,{base:!0},B);return B.eventHandler&&(te===null?O(q===null?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:q}},options:B}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:q}},options:B}):I(te)||O({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:q,expandedId:te}},options:B})),te}return q}),{propertyIsArray:B.isFrame});continue}if(ue==="@type"){n(ee)&&(ee=Object.fromEntries(Object.entries(ee).map(([q,te])=>[g(Q,q,{vocab:!0}),w(te).map(fe=>g(Q,fe,{base:!0,vocab:!0},{...B,typeExpansion:!0}))]))),S(ee,B.isFrame),P(re,"@type",w(ee).map(q=>{if(o(q)){const te=g(Q,q,{base:!0,vocab:!0},{...B,typeExpansion:!0});return te!=="@json"&&!I(te)&&B.eventHandler&&O({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:q}},options:B}),te}return q}),{propertyIsArray:!!B.isFrame});continue}if(ue==="@included"&&v(j,1.1)){const q=w(await X.expand({activeCtx:j,activeProperty:F,element:ee,options:B}));if(!q.every(te=>h(te)))throw new i("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:ee});P(re,"@included",q,{propertyIsArray:!0});continue}if(ue==="@graph"&&!(n(ee)||e(ee)))throw new i('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:ee});if(ue==="@value"){me=ee,Z&&v(j,1.1)?re["@value"]=ee:P(re,"@value",ee,{propertyIsArray:B.isFrame});continue}if(ue==="@language"){if(ee===null)continue;if(!o(ee)&&!B.isFrame)throw new i('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:ee});ee=w(ee).map(q=>o(q)?q.toLowerCase():q);for(const q of ee)o(q)&&!q.match(A)&&B.eventHandler&&O({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:q}},options:B});P(re,"@language",ee,{propertyIsArray:B.isFrame});continue}if(ue==="@direction"){if(!o(ee)&&!B.isFrame)throw new i('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:ee});ee=w(ee);for(const q of ee)if(o(q)&&q!=="ltr"&&q!=="rtl")throw new i('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:ee});P(re,"@direction",ee,{propertyIsArray:B.isFrame});continue}if(ue==="@index"){if(!o(ee))throw new i('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:ee});P(re,"@index",ee);continue}if(ue==="@reverse"){if(!n(ee))throw new i('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:ee});if(K=await X.expand({activeCtx:j,activeProperty:"@reverse",element:ee,options:B}),"@reverse"in K)for(const te in K["@reverse"])P(re,te,K["@reverse"][te],{propertyIsArray:!0});let q=re["@reverse"]||null;for(const te in K){if(te==="@reverse")continue;q===null&&(q=re["@reverse"]={}),P(q,te,[],{propertyIsArray:!0});const fe=K[te];for(let xe=0;xe<fe.length;++xe){const Se=fe[xe];if(u(Se)||l(Se))throw new i('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:K});P(q,te,Se,{propertyIsArray:!0})}}continue}if(ue==="@nest"){Y.push(W);continue}let ce=j;const Ee=m(j,W,"@context");a(Ee)||(ce=await _({activeCtx:j,localCtx:Ee,propagate:!0,overrideProtected:!0,options:B}));const Te=m(j,W,"@container")||[];if(Te.includes("@language")&&n(ee)){const q=m(ce,W,"@direction");K=$(ce,ee,q,B)}else if(Te.includes("@index")&&n(ee)){const q=Te.includes("@graph"),te=m(ce,W,"@index")||"@index",fe=te!=="@index"&&g(j,te,{vocab:!0},B);K=await G({activeCtx:ce,options:B,activeProperty:W,value:ee,asGraph:q,indexKey:te,propertyIndex:fe})}else if(Te.includes("@id")&&n(ee)){const q=Te.includes("@graph");K=await G({activeCtx:ce,options:B,activeProperty:W,value:ee,asGraph:q,indexKey:"@id"})}else if(Te.includes("@type")&&n(ee))K=await G({activeCtx:ce.revertToPreviousContext(),options:B,activeProperty:W,value:ee,asGraph:!1,indexKey:"@type"});else{const q=ue==="@list";if(q||ue==="@set"){let te=F;q&&se==="@graph"&&(te=null),K=await X.expand({activeCtx:ce,activeProperty:te,element:ee,options:B,insideList:q})}else m(j,W,"@type")==="@json"?K={"@type":"@json","@value":ee}:K=await X.expand({activeCtx:ce,activeProperty:W,element:ee,options:B,insideList:!1})}if(!(K===null&&ue!=="@value")){if(ue!=="@list"&&!l(K)&&Te.includes("@list")&&(K={"@list":w(K)}),Te.includes("@graph")&&!Te.some(q=>q==="@id"||q==="@index")){if(K=w(K),B.isFrame||(K=K.filter(q=>{const te=Object.keys(q).length;return C({value:q,count:te,options:B})!==null})),K.length===0)continue;K=K.map(q=>({"@graph":w(q)}))}if(ce.mappings.has(W)&&ce.mappings.get(W).reverse){const q=re["@reverse"]=re["@reverse"]||{};K=w(K);for(let te=0;te<K.length;++te){const fe=K[te];if(u(fe)||l(fe))throw new i('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:K});P(q,ue,fe,{propertyIsArray:!0})}continue}P(re,ue,K,{propertyIsArray:!0})}}if("@value"in re&&!(re["@type"]==="@json"&&v(j,1.1))){if((n(me)||e(me))&&!B.isFrame)throw new i('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:me})}for(const W of Y){const ee=e(M[W])?M[W]:[M[W]];for(const K of ee){if(!n(K)||Object.keys(K).some(ue=>g(j,ue,{vocab:!0},B)==="@value"))throw new i("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:K});await U({activeCtx:j,activeProperty:F,expandedActiveProperty:se,element:K,expandedParent:re,options:B,insideList:oe,typeScopedContext:Q,typeKey:T})}}}function R({activeCtx:j,activeProperty:F,value:se,options:M}){if(se==null)return null;const re=g(j,F,{vocab:!0},M);if(re==="@id")return g(j,se,{base:!0},M);if(re==="@type")return g(j,se,{vocab:!0,base:!0},{...M,typeExpansion:!0});const B=m(j,F,"@type");if((B==="@id"||re==="@graph")&&o(se)){const T=g(j,se,{base:!0},M);return T===null&&se.match(N)&&M.eventHandler&&O({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:F}},options:M}),{"@id":T}}if(B==="@vocab"&&o(se))return{"@id":g(j,se,{vocab:!0,base:!0},M)};if(d(re))return se;const oe={};if(B&&!["@id","@vocab","@none"].includes(B))oe["@type"]=B;else if(o(se)){const T=m(j,F,"@language");T!==null&&(oe["@language"]=T);const Q=m(j,F,"@direction");Q!==null&&(oe["@direction"]=Q)}return["boolean","number","string"].includes(typeof se)||(se=se.toString()),oe["@value"]=se,oe}function $(j,F,se,M){const re=[],B=Object.keys(F).sort();for(const oe of B){const T=g(j,oe,{vocab:!0},M);let Q=F[oe];e(Q)||(Q=[Q]);for(const ie of Q){if(ie===null)continue;if(!o(ie))throw new i("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:F});const Y={"@value":ie};T!=="@none"&&(oe.match(A)||M.eventHandler&&O({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:oe}},options:M}),Y["@language"]=oe.toLowerCase()),se&&(Y["@direction"]=se),re.push(Y)}}return re}async function G({activeCtx:j,options:F,activeProperty:se,value:M,asGraph:re,indexKey:B,propertyIndex:oe}){const T=[],Q=Object.keys(M).sort(),ie=B==="@type";for(let Y of Q){if(ie){const W=m(j,Y,"@context");a(W)||(j=await _({activeCtx:j,localCtx:W,propagate:!1,options:F}))}let me=M[Y];e(me)||(me=[me]),me=await X.expand({activeCtx:j,activeProperty:se,element:me,options:F,insideList:!1,insideIndex:!0});let Z;oe?Y==="@none"?Z="@none":Z=R({activeCtx:j,activeProperty:B,value:Y,options:F}):Z=g(j,Y,{vocab:!0},F),B==="@id"?Y=g(j,Y,{base:!0},F):ie&&(Y=Z);for(let W of me){if(re&&!f(W)&&(W={"@graph":[W]}),B==="@type")Z==="@none"||(W["@type"]?W["@type"]=[Y].concat(W["@type"]):W["@type"]=[Y]);else{if(u(W)&&!["@language","@type","@index"].includes(B))throw new i(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${B}".`,"jsonld.SyntaxError",{code:"invalid value object",value:W});oe?Z!=="@none"&&P(W,oe,Z,{propertyIsArray:!0,prependValue:!0}):Z!=="@none"&&!(B in W)&&(W[B]=Y)}T.push(W)}}return T}return Ba}var $a,Dd;function eo(){if(Dd)return $a;Dd=1;const{isKeyword:i}=wi(),e=On(),n=zt(),r=Qt(),o=Kt(),a={};return $a=a,a.createMergedNodeMap=(l,u)=>{u=u||{};const f=u.issuer||new r.IdentifierIssuer("_:b"),h={"@default":{}};return a.createNodeMap(l,h,"@default",f),a.mergeNodeMaps(h)},a.createNodeMap=(l,u,f,h,g,m)=>{if(n.isArray(l)){for(const I of l)a.createNodeMap(I,u,f,h,void 0,m);return}if(!n.isObject(l)){m&&m.push(l);return}if(e.isValue(l)){if("@type"in l){let I=l["@type"];I.indexOf("_:")===0&&(l["@type"]=I=h.getId(I))}m&&m.push(l);return}else if(m&&e.isList(l)){const I=[];a.createNodeMap(l["@list"],u,f,h,g,I),m.push({"@list":I});return}if("@type"in l){const I=l["@type"];for(const A of I)A.indexOf("_:")===0&&h.getId(A)}n.isUndefined(g)&&(g=e.isBlankNode(l)?h.getId(l["@id"]):l["@id"]),m&&m.push({"@id":g});const d=u[f],_=d[g]=d[g]||{};_["@id"]=g;const v=Object.keys(l).sort();for(let I of v){if(I==="@id")continue;if(I==="@reverse"){const N={"@id":g},P=l["@reverse"];for(const w in P){const y=P[w];for(const S of y){let O=S["@id"];e.isBlankNode(S)&&(O=h.getId(O)),a.createNodeMap(S,u,f,h,O),r.addValue(d[O],w,N,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if(I==="@graph"){g in u||(u[g]={}),a.createNodeMap(l[I],u,g,h);continue}if(I==="@included"){a.createNodeMap(l[I],u,f,h);continue}if(I!=="@type"&&i(I)){if(I==="@index"&&I in _&&(l[I]!==_[I]||l[I]["@id"]!==_[I]["@id"]))throw new o("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:_});_[I]=l[I];continue}const A=l[I];if(I.indexOf("_:")===0&&(I=h.getId(I)),A.length===0){r.addValue(_,I,[],{propertyIsArray:!0});continue}for(let N of A)if(I==="@type"&&(N=N.indexOf("_:")===0?h.getId(N):N),e.isSubject(N)||e.isSubjectReference(N)){if("@id"in N&&!N["@id"])continue;const P=e.isBlankNode(N)?h.getId(N["@id"]):N["@id"];r.addValue(_,I,{"@id":P},{propertyIsArray:!0,allowDuplicate:!1}),a.createNodeMap(N,u,f,h,P)}else if(e.isValue(N))r.addValue(_,I,N,{propertyIsArray:!0,allowDuplicate:!1});else if(e.isList(N)){const P=[];a.createNodeMap(N["@list"],u,f,h,g,P),N={"@list":P},r.addValue(_,I,N,{propertyIsArray:!0,allowDuplicate:!1})}else a.createNodeMap(N,u,f,h,g),r.addValue(_,I,N,{propertyIsArray:!0,allowDuplicate:!1})}},a.mergeNodeMapGraphs=l=>{const u={};for(const f of Object.keys(l).sort())for(const h of Object.keys(l[f]).sort()){const g=l[f][h];h in u||(u[h]={"@id":h});const m=u[h];for(const d of Object.keys(g).sort())if(i(d)&&d!=="@type")m[d]=r.clone(g[d]);else for(const _ of g[d])r.addValue(m,d,r.clone(_),{propertyIsArray:!0,allowDuplicate:!1})}return u},a.mergeNodeMaps=l=>{const u=l["@default"],f=Object.keys(l).sort();for(const h of f){if(h==="@default")continue;const g=l[h];let m=u[h];m?"@graph"in m||(m["@graph"]=[]):u[h]=m={"@id":h,"@graph":[]};const d=m["@graph"];for(const _ of Object.keys(g).sort()){const v=g[_];e.isSubjectReference(v)||d.push(v)}}return u},$a}var qa,Md;function Om(){if(Md)return qa;Md=1;const{isSubjectReference:i}=On(),{createMergedNodeMap:e}=eo(),n={};return qa=n,n.flatten=r=>{const o=e(r),a=[],l=Object.keys(o).sort();for(let u=0;u<l.length;++u){const f=o[l[u]];i(f)||a.push(f)}return a},qa}var za,Od;function Fm(){if(Od)return za;Od=1;const i=Kt(),e=On(),n=zt(),{REGEX_BCP47:r,addValue:o}=Qt(),{handleEvent:a}=Jr(),{RDF_LIST:l,RDF_FIRST:u,RDF_REST:f,RDF_NIL:h,RDF_TYPE:g,RDF_JSON_LITERAL:m,XSD_BOOLEAN:d,XSD_DOUBLE:_,XSD_INTEGER:v,XSD_STRING:I}=Wl(),A={};za=A,A.fromRDF=async(w,y)=>{const{useRdfType:S=!1,useNativeTypes:O=!1,rdfDirection:X=null}=y,C={},U={"@default":C},R={};if(X){if(X==="compound-literal")throw new i("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:X});if(X!=="i18n-datatype")throw new i("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:X})}for(const j of w){const F=j.graph.termType==="DefaultGraph"?"@default":j.graph.value;F in U||(U[F]={}),F!=="@default"&&!(F in C)&&(C[F]={"@id":F});const se=U[F],M=P(j.subject),re=j.predicate.value,B=j.object;M in se||(se[M]={"@id":M});const oe=se[M],T=P(B),Q=!!T;if(Q&&!(T in se)&&(se[T]={"@id":T}),re===g&&!S&&Q){o(oe,"@type",T,{propertyIsArray:!0});continue}const ie=N(B,O,X,y);if(o(oe,re,ie,{propertyIsArray:!0}),Q)if(T===h){const Y=se[T];"usages"in Y||(Y.usages=[]),Y.usages.push({node:oe,property:re,value:ie})}else T in R?R[T]=!1:R[T]={node:oe,property:re,value:ie}}for(const j in U){const F=U[j];if(!(h in F))continue;const se=F[h];if(se.usages){for(let M of se.usages){let re=M.node,B=M.property,oe=M.value;const T=[],Q=[];let ie=Object.keys(re).length;for(;B===f&&n.isObject(R[re["@id"]])&&n.isArray(re[u])&&re[u].length===1&&n.isArray(re[f])&&re[f].length===1&&(ie===3||ie===4&&n.isArray(re["@type"])&&re["@type"].length===1&&re["@type"][0]===l)&&(T.push(re[u][0]),Q.push(re["@id"]),M=R[re["@id"]],re=M.node,B=M.property,oe=M.value,ie=Object.keys(re).length,!!e.isBlankNode(re)););delete oe["@id"],oe["@list"]=T.reverse();for(const Y of Q)delete F[Y]}delete se.usages}}const $=[],G=Object.keys(C).sort();for(const j of G){const F=C[j];if(j in U){const se=F["@graph"]=[],M=U[j],re=Object.keys(M).sort();for(const B of re){const oe=M[B];e.isSubjectReference(oe)||se.push(oe)}}e.isSubjectReference(F)||$.push(F)}return $};function N(w,y,S,O){const X=P(w);if(X)return{"@id":X};const C={"@value":w.value};if(w.language)w.language.match(r)||O.eventHandler&&a({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:w.language}},options:O}),C["@language"]=w.language;else{let U=w.datatype.value;if(U||(U=I),U===m){U="@json";try{C["@value"]=JSON.parse(C["@value"])}catch(R){throw new i("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:C["@value"],cause:R})}}if(y)if(U===d)C["@value"]==="true"||C["@value"]==="1"?C["@value"]=!0:C["@value"]==="false"||C["@value"]==="0"?C["@value"]=!1:C["@type"]=U;else if(U===v)if(n.isNumeric(C["@value"])){const R=parseInt(C["@value"],10);R.toFixed(0)===C["@value"]&&(C["@value"]=R)}else C["@type"]=U;else U===_&&n.isNumeric(C["@value"])?C["@value"]=parseFloat(C["@value"]):C["@type"]=U;else if(S==="i18n-datatype"&&U.startsWith("https://www.w3.org/ns/i18n#")){const[,R,$]=U.split(/[#_]/);R.length>0&&(C["@language"]=R,R.match(r)||O.eventHandler&&a({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:R}},options:O})),C["@direction"]=$}else U!==I&&(C["@type"]=U)}return C}function P(w){return w.termType==="NamedNode"?w.value:w.termType==="BlankNode"?"_:"+w.value:null}return za}var Ha,Fd;function jm(){return Fd||(Fd=1,Ha=function i(e){if(typeof e=="number"&&isNaN(e))throw new Error("NaN is not allowed");if(typeof e=="number"&&!isFinite(e))throw new Error("Infinity is not allowed");return e===null||typeof e!="object"?JSON.stringify(e):e.toJSON instanceof Function?i(e.toJSON()):Array.isArray(e)?`[${e.reduce((o,a,l)=>`${o}${l===0?"":","}${i(a===void 0||typeof a=="symbol"?null:a)}`,"")}]`:`{${Object.keys(e).sort().reduce((r,o)=>{if(e[o]===void 0||typeof e[o]=="symbol")return r;const a=r.length===0?"":",";return`${r}${a}${i(o)}:${i(e[o])}`},"")}}`}),Ha}var Ua,jd;function Bm(){if(jd)return Ua;jd=1;const{createNodeMap:i}=eo(),{isKeyword:e}=wi(),n=On(),r=jm(),o=Kt(),a=zt(),l=Qt(),{handleEvent:u}=Jr(),{RDF_FIRST:f,RDF_REST:h,RDF_NIL:g,RDF_TYPE:m,RDF_JSON_LITERAL:d,RDF_LANGSTRING:_,XSD_BOOLEAN:v,XSD_DOUBLE:I,XSD_INTEGER:A,XSD_STRING:N}=Wl(),{isAbsolute:P}=Jn(),w={};Ua=w,w.toRDF=(C,U)=>{const R=new l.IdentifierIssuer("_:b"),$={"@default":{}};i(C,$,"@default",R);const G=[],j=Object.keys($).sort();for(const F of j){let se;if(F==="@default")se={termType:"DefaultGraph",value:""};else if(P(F))se=X(F);else{U.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:F}},options:U});continue}y(G,$[F],se,R,U)}return G};function y(C,U,R,$,G){const j=Object.keys(U).sort();for(const F of j){const se=U[F],M=Object.keys(se).sort();for(let re of M){const B=se[re];if(re==="@type")re=m;else if(e(re))continue;for(const oe of B){const T=X(F);if(!P(F)){G.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:F}},options:G});continue}const Q=X(re);if(!P(re)){G.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:re}},options:G});continue}if(Q.termType==="BlankNode"&&!G.produceGeneralizedRdf){G.eventHandler&&u({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:$.getOldIds().find(Y=>$.getId(Y)===re)}},options:G});continue}const ie=O(oe,$,C,R,G.rdfDirection,G);ie&&C.push({subject:T,predicate:Q,object:ie,graph:R})}}}}function S(C,U,R,$,G,j){const F={termType:"NamedNode",value:f},se={termType:"NamedNode",value:h},M={termType:"NamedNode",value:g},re=C.pop(),B=re?{termType:"BlankNode",value:U.getId().slice(2)}:M;let oe=B;for(const T of C){const Q=O(T,U,R,$,G,j),ie={termType:"BlankNode",value:U.getId().slice(2)};R.push({subject:oe,predicate:F,object:Q,graph:$}),R.push({subject:oe,predicate:se,object:ie,graph:$}),oe=ie}if(re){const T=O(re,U,R,$,G,j);R.push({subject:oe,predicate:F,object:T,graph:$}),R.push({subject:oe,predicate:se,object:M,graph:$})}return B}function O(C,U,R,$,G,j){let F;if(n.isValue(C)){F={termType:"Literal",value:void 0,datatype:{termType:"NamedNode"}};let se=C["@value"];const M=C["@type"]||null;if(M==="@json")F.value=r(se),F.datatype.value=d;else if(a.isBoolean(se))F.value=se.toString(),F.datatype.value=M||v;else if(a.isDouble(se)||M===I)a.isDouble(se)||(se=parseFloat(se)),F.value=se.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),F.datatype.value=M||I;else if(a.isNumber(se))F.value=se.toFixed(0),F.datatype.value=M||A;else if("@direction"in C&&G==="i18n-datatype"){const re=(C["@language"]||"").toLowerCase(),B=C["@direction"],oe=`https://www.w3.org/ns/i18n#${re}_${B}`;F.datatype.value=oe,F.value=se}else{if("@direction"in C&&G==="compound-literal")throw new o("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:G});if("@direction"in C&&G)throw new o("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:G});"@language"in C?("@direction"in C&&!G&&j.eventHandler&&u({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:F.value}},options:j}),F.value=se,F.datatype.value=M||_,F.language=C["@language"]):("@direction"in C&&!G&&j.eventHandler&&u({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:F.value}},options:j}),F.value=se,F.datatype.value=M||N)}}else if(n.isList(C)){const se=S(C["@list"],U,R,$,G,j);F={termType:se.termType,value:se.value}}else{const se=a.isObject(C)?C["@id"]:C;F=X(se)}return F.termType==="NamedNode"&&!P(F.value)?(j.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:F.value}},options:j}),null):F}function X(C){return C.startsWith("_:")?{termType:"BlankNode",value:C.slice(2)}:{termType:"NamedNode",value:C}}return Ua}var Va,Bd;function $m(){if(Bd)return Va;Bd=1;const{isKeyword:i}=wi(),e=On(),n=zt(),r=Qt(),o=Jn(),a=Kt(),{createNodeMap:l,mergeNodeMapGraphs:u}=eo(),f={};Va=f,f.frameMergedOrDefault=(y,S,O)=>{const X={options:O,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},C=new r.IdentifierIssuer("_:b");l(y,X.graphMap,"@default",C),O.merged&&(X.graphMap["@merged"]=u(X.graphMap),X.graph="@merged"),X.subjects=X.graphMap[X.graph];const U=[];f.frame(X,Object.keys(X.subjects).sort(),S,U),O.pruneBlankNodeIdentifiers&&(O.bnodesToClear=Object.keys(X.bnodeMap).filter(R=>X.bnodeMap[R].length===1));return O.link={},A(U,O)},f.frame=(y,S,O,X,C=null)=>{d(O),O=O[0];const U=y.options,R={embed:m(O,U,"embed"),explicit:m(O,U,"explicit"),requireAll:m(O,U,"requireAll")};y.link.hasOwnProperty(y.graph)||(y.link[y.graph]={});const $=y.link[y.graph],G=_(y,S,O,R),j=Object.keys(G).sort();for(const F of j){const se=G[F];if(C===null?y.uniqueEmbeds={[y.graph]:{}}:y.uniqueEmbeds[y.graph]=y.uniqueEmbeds[y.graph]||{},R.embed==="@link"&&F in $){N(X,C,$[F]);continue}const M={"@id":F};if(F.indexOf("_:")===0&&r.addValue(y.bnodeMap,F,M,{propertyIsArray:!0}),$[F]=M,(R.embed==="@first"||R.embed==="@last")&&y.is11)throw new a("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:O});if(!(!y.embedded&&y.uniqueEmbeds[y.graph].hasOwnProperty(F))){if(y.embedded&&(R.embed==="@never"||g(se,y.graph,y.subjectStack))){N(X,C,M);continue}if(y.embedded&&(R.embed=="@first"||R.embed=="@once")&&y.uniqueEmbeds[y.graph].hasOwnProperty(F)){N(X,C,M);continue}if(R.embed==="@last"&&F in y.uniqueEmbeds[y.graph]&&I(y,F),y.uniqueEmbeds[y.graph][F]={parent:X,property:C},y.subjectStack.push({subject:se,graph:y.graph}),F in y.graphMap){let re=!1,B=null;"@graph"in O?(B=O["@graph"][0],re=!(F==="@merged"||F==="@default"),n.isObject(B)||(B={})):(re=y.graph!=="@merged",B={}),re&&f.frame({...y,graph:F,embedded:!1},Object.keys(y.graphMap[F]).sort(),[B],M,"@graph")}"@included"in O&&f.frame({...y,embedded:!1},S,O["@included"],M,"@included");for(const re of Object.keys(se).sort()){if(i(re)){if(M[re]=r.clone(se[re]),re==="@type")for(const B of se["@type"])B.indexOf("_:")===0&&r.addValue(y.bnodeMap,B,M,{propertyIsArray:!0});continue}if(!(R.explicit&&!(re in O)))for(const B of se[re]){const oe=re in O?O[re]:h(R);if(e.isList(B)){const T=O[re]&&O[re][0]&&O[re][0]["@list"]?O[re][0]["@list"]:h(R),Q={"@list":[]};N(M,re,Q);const ie=B["@list"];for(const Y of ie)e.isSubjectReference(Y)?f.frame({...y,embedded:!0},[Y["@id"]],T,Q,"@list"):N(Q,"@list",r.clone(Y))}else e.isSubjectReference(B)?f.frame({...y,embedded:!0},[B["@id"]],oe,M,re):w(oe[0],B)&&N(M,re,r.clone(B))}}for(const re of Object.keys(O).sort()){if(re==="@type"){if(!n.isObject(O[re][0])||!("@default"in O[re][0]))continue}else if(i(re))continue;const B=O[re][0]||{};if(!m(B,U,"omitDefault")&&!(re in M)){let T="@null";"@default"in B&&(T=r.clone(B["@default"])),n.isArray(T)||(T=[T]),M[re]=[{"@preserve":T}]}}for(const re of Object.keys(O["@reverse"]||{}).sort()){const B=O["@reverse"][re];for(const oe of Object.keys(y.subjects))r.getValues(y.subjects[oe],re).some(Q=>Q["@id"]===F)&&(M["@reverse"]=M["@reverse"]||{},r.addValue(M["@reverse"],re,[],{propertyIsArray:!0}),f.frame({...y,embedded:!0},[oe],B,M["@reverse"][re],C))}N(X,C,M),y.subjectStack.pop()}}},f.cleanupNull=(y,S)=>{if(n.isArray(y))return y.map(X=>f.cleanupNull(X,S)).filter(X=>X);if(y==="@null")return null;if(n.isObject(y)){if("@id"in y){const O=y["@id"];if(S.link.hasOwnProperty(O)){const X=S.link[O].indexOf(y);if(X!==-1)return S.link[O][X];S.link[O].push(y)}else S.link[O]=[y]}for(const O in y)y[O]=f.cleanupNull(y[O],S)}return y};function h(y){const S={};for(const O in y)y[O]!==void 0&&(S["@"+O]=[y[O]]);return[S]}function g(y,S,O){for(let X=O.length-1;X>=0;--X){const C=O[X];if(C.graph===S&&C.subject["@id"]===y["@id"])return!0}return!1}function m(y,S,O){const X="@"+O;let C=X in y?y[X][0]:S[O];if(O==="embed"){if(C===!0)C="@once";else if(C===!1)C="@never";else if(C!=="@always"&&C!=="@never"&&C!=="@link"&&C!=="@first"&&C!=="@last"&&C!=="@once")throw new a("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:y})}return C}function d(y){if(!n.isArray(y)||y.length!==1||!n.isObject(y[0]))throw new a("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:y});if("@id"in y[0]){for(const S of r.asArray(y[0]["@id"]))if(!(n.isObject(S)||o.isAbsolute(S))||n.isString(S)&&S.indexOf("_:")===0)throw new a("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:y})}if("@type"in y[0]){for(const S of r.asArray(y[0]["@type"]))if(!(n.isObject(S)||o.isAbsolute(S)||S==="@json")||n.isString(S)&&S.indexOf("_:")===0)throw new a("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:y})}}function _(y,S,O,X){const C={};for(const U of S){const R=y.graphMap[y.graph][U];v(y,R,O,X)&&(C[U]=R)}return C}function v(y,S,O,X){let C=!0,U=!1;for(const R in O){let $=!1;const G=r.getValues(S,R),j=r.getValues(O,R).length===0;if(R==="@id"){if(n.isEmptyObject(O["@id"][0]||{})?$=!0:O["@id"].length>=0&&($=O["@id"].includes(G[0])),!X.requireAll)return $}else if(R==="@type"){if(C=!1,j){if(G.length>0)return!1;$=!0}else if(O["@type"].length===1&&n.isEmptyObject(O["@type"][0]))$=G.length>0;else for(const F of O["@type"])n.isObject(F)&&"@default"in F?$=!0:$=$||G.some(se=>se===F);if(!X.requireAll)return $}else{if(i(R))continue;{const F=r.getValues(O,R)[0];let se=!1;if(F&&(d([F]),se="@default"in F),C=!1,G.length===0&&se)continue;if(G.length>0&&j)return!1;if(F===void 0){if(G.length>0)return!1;$=!0}else if(e.isList(F)){const M=F["@list"][0];if(e.isList(G[0])){const re=G[0]["@list"];e.isValue(M)?$=re.some(B=>w(M,B)):(e.isSubject(M)||e.isSubjectReference(M))&&($=re.some(B=>P(y,M,B,X)))}}else e.isValue(F)?$=G.some(M=>w(F,M)):e.isSubjectReference(F)?$=G.some(M=>P(y,F,M,X)):n.isObject(F)?$=G.length>0:$=!1}}if(!$&&X.requireAll)return!1;U=U||$}return C||U}function I(y,S){const O=y.uniqueEmbeds[y.graph],X=O[S],C=X.parent,U=X.property,R={"@id":S};if(n.isArray(C)){for(let G=0;G<C.length;++G)if(r.compareValues(C[G],R)){C[G]=R;break}}else{const G=n.isArray(C[U]);r.removeValue(C,U,R,{propertyIsArray:G}),r.addValue(C,U,R,{propertyIsArray:G})}const $=G=>{const j=Object.keys(O);for(const F of j)F in O&&n.isObject(O[F].parent)&&O[F].parent["@id"]===G&&(delete O[F],$(F))};$(S)}function A(y,S){if(n.isArray(y))return y.map(O=>A(O,S));if(n.isObject(y)){if("@preserve"in y)return y["@preserve"][0];if(e.isValue(y))return y;if(e.isList(y))return y["@list"]=A(y["@list"],S),y;if("@id"in y){const O=y["@id"];if(S.link.hasOwnProperty(O)){const X=S.link[O].indexOf(y);if(X!==-1)return S.link[O][X];S.link[O].push(y)}else S.link[O]=[y]}for(const O in y){if(O==="@id"&&S.bnodesToClear.includes(y[O])){delete y["@id"];continue}y[O]=A(y[O],S)}}return y}function N(y,S,O){n.isObject(y)?r.addValue(y,S,O,{propertyIsArray:!0}):y.push(O)}function P(y,S,O,X){if(!("@id"in O))return!1;const C=y.subjects[O["@id"]];return C&&v(y,C,S,X)}function w(y,S){const O=S["@value"],X=S["@type"],C=S["@language"],U=y["@value"]?n.isArray(y["@value"])?y["@value"]:[y["@value"]]:[],R=y["@type"]?n.isArray(y["@type"])?y["@type"]:[y["@type"]]:[],$=y["@language"]?n.isArray(y["@language"])?y["@language"]:[y["@language"]]:[];return U.length===0&&R.length===0&&$.length===0?!0:!(!(U.includes(O)||n.isEmptyObject(U[0]))||!(!X&&R.length===0||R.includes(X)||X&&n.isEmptyObject(R[0]))||!(!C&&$.length===0||$.includes(C)||C&&n.isEmptyObject($[0])))}return Va}var Wa,$d;function qm(){if($d)return Wa;$d=1;const i=Kt(),{isArray:e,isObject:n,isString:r,isUndefined:o}=zt(),{isList:a,isValue:l,isGraph:u,isSimpleGraph:f,isSubjectReference:h}=On(),{expandIri:g,getContextValue:m,isKeyword:d,process:_,processingMode:v}=wi(),{removeBase:I,prependBase:A}=Jn(),{REGEX_KEYWORD:N,addValue:P,asArray:w,compareShortestLeast:y}=Qt(),S={};Wa=S,S.compact=async({activeCtx:C,activeProperty:U=null,element:R,options:$={}})=>{if(e(R)){let j=[];for(let F=0;F<R.length;++F){const se=await S.compact({activeCtx:C,activeProperty:U,element:R[F],options:$});se!==null&&j.push(se)}return $.compactArrays&&j.length===1&&(m(C,U,"@container")||[]).length===0&&(j=j[0]),j}const G=m(C,U,"@context");if(o(G)||(C=await _({activeCtx:C,localCtx:G,propagate:!0,overrideProtected:!0,options:$})),n(R)){if($.link&&"@id"in R&&$.link.hasOwnProperty(R["@id"])){const T=$.link[R["@id"]];for(let Q=0;Q<T.length;++Q)if(T[Q].expanded===R)return T[Q].compacted}if(l(R)||h(R)){const T=S.compactValue({activeCtx:C,activeProperty:U,value:R,options:$});return $.link&&h(R)&&($.link.hasOwnProperty(R["@id"])||($.link[R["@id"]]=[]),$.link[R["@id"]].push({expanded:R,compacted:T})),T}if(a(R)&&(m(C,U,"@container")||[]).includes("@list"))return S.compact({activeCtx:C,activeProperty:U,element:R["@list"],options:$});const j=U==="@reverse",F={},se=C;!l(R)&&!h(R)&&(C=C.revertToPreviousContext());const M=m(se,U,"@context");o(M)||(C=await _({activeCtx:C,localCtx:M,propagate:!0,overrideProtected:!0,options:$})),$.link&&"@id"in R&&($.link.hasOwnProperty(R["@id"])||($.link[R["@id"]]=[]),$.link[R["@id"]].push({expanded:R,compacted:F}));let re=R["@type"]||[];re.length>1&&(re=Array.from(re).sort());const B=C;for(const T of re){const Q=S.compactIri({activeCtx:B,iri:T,relativeTo:{vocab:!0}}),ie=m(se,Q,"@context");o(ie)||(C=await _({activeCtx:C,localCtx:ie,options:$,propagate:!1}))}const oe=Object.keys(R).sort();for(const T of oe){const Q=R[T];if(T==="@id"){let ie=w(Q).map(me=>S.compactIri({activeCtx:C,iri:me,relativeTo:{vocab:!1},base:$.base}));ie.length===1&&(ie=ie[0]);const Y=S.compactIri({activeCtx:C,iri:"@id",relativeTo:{vocab:!0}});F[Y]=ie;continue}if(T==="@type"){let ie=w(Q).map(ee=>S.compactIri({activeCtx:se,iri:ee,relativeTo:{vocab:!0}}));ie.length===1&&(ie=ie[0]);const Y=S.compactIri({activeCtx:C,iri:"@type",relativeTo:{vocab:!0}}),W=(m(C,Y,"@container")||[]).includes("@set")&&v(C,1.1)||e(ie)&&Q.length===0;P(F,Y,ie,{propertyIsArray:W});continue}if(T==="@reverse"){const ie=await S.compact({activeCtx:C,activeProperty:"@reverse",element:Q,options:$});for(const Y in ie)if(C.mappings.has(Y)&&C.mappings.get(Y).reverse){const me=ie[Y],W=(m(C,Y,"@container")||[]).includes("@set")||!$.compactArrays;P(F,Y,me,{propertyIsArray:W}),delete ie[Y]}if(Object.keys(ie).length>0){const Y=S.compactIri({activeCtx:C,iri:T,relativeTo:{vocab:!0}});P(F,Y,ie)}continue}if(T==="@preserve"){const ie=await S.compact({activeCtx:C,activeProperty:U,element:Q,options:$});e(ie)&&ie.length===0||P(F,T,ie);continue}if(T==="@index"){if((m(C,U,"@container")||[]).includes("@index"))continue;const Y=S.compactIri({activeCtx:C,iri:T,relativeTo:{vocab:!0}});P(F,Y,Q);continue}if(T!=="@graph"&&T!=="@list"&&T!=="@included"&&d(T)){const ie=S.compactIri({activeCtx:C,iri:T,relativeTo:{vocab:!0}});P(F,ie,Q);continue}if(!e(Q))throw new i("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(Q.length===0){const ie=S.compactIri({activeCtx:C,iri:T,value:Q,relativeTo:{vocab:!0},reverse:j}),Y=C.mappings.has(ie)?C.mappings.get(ie)["@nest"]:null;let me=F;Y&&(X(C,Y,$),n(F[Y])||(F[Y]={}),me=F[Y]),P(me,ie,Q,{propertyIsArray:!0})}for(const ie of Q){const Y=S.compactIri({activeCtx:C,iri:T,value:ie,relativeTo:{vocab:!0},reverse:j}),me=C.mappings.has(Y)?C.mappings.get(Y)["@nest"]:null;let Z=F;me&&(X(C,me,$),n(F[me])||(F[me]={}),Z=F[me]);const W=m(C,Y,"@container")||[],ee=u(ie),K=a(ie);let ue;K?ue=ie["@list"]:ee&&(ue=ie["@graph"]);let ce=await S.compact({activeCtx:C,activeProperty:Y,element:K||ee?ue:ie,options:$});if(K)if(e(ce)||(ce=[ce]),!W.includes("@list"))ce={[S.compactIri({activeCtx:C,iri:"@list",relativeTo:{vocab:!0}})]:ce},"@index"in ie&&(ce[S.compactIri({activeCtx:C,iri:"@index",relativeTo:{vocab:!0}})]=ie["@index"]);else{P(Z,Y,ce,{valueIsArray:!0,allowDuplicate:!0});continue}if(ee)if(W.includes("@graph")&&(W.includes("@id")||W.includes("@index")&&f(ie))){let Ee;Z.hasOwnProperty(Y)?Ee=Z[Y]:Z[Y]=Ee={};const Te=(W.includes("@id")?ie["@id"]:ie["@index"])||S.compactIri({activeCtx:C,iri:"@none",relativeTo:{vocab:!0}});P(Ee,Te,ce,{propertyIsArray:!$.compactArrays||W.includes("@set")})}else W.includes("@graph")&&f(ie)?(e(ce)&&ce.length>1&&(ce={"@included":ce}),P(Z,Y,ce,{propertyIsArray:!$.compactArrays||W.includes("@set")})):(e(ce)&&ce.length===1&&$.compactArrays&&(ce=ce[0]),ce={[S.compactIri({activeCtx:C,iri:"@graph",relativeTo:{vocab:!0}})]:ce},"@id"in ie&&(ce[S.compactIri({activeCtx:C,iri:"@id",relativeTo:{vocab:!0}})]=ie["@id"]),"@index"in ie&&(ce[S.compactIri({activeCtx:C,iri:"@index",relativeTo:{vocab:!0}})]=ie["@index"]),P(Z,Y,ce,{propertyIsArray:!$.compactArrays||W.includes("@set")}));else if(W.includes("@language")||W.includes("@index")||W.includes("@id")||W.includes("@type")){let Ee;Z.hasOwnProperty(Y)?Ee=Z[Y]:Z[Y]=Ee={};let Te;if(W.includes("@language"))l(ce)&&(ce=ce["@value"]),Te=ie["@language"];else if(W.includes("@index")){const q=m(C,Y,"@index")||"@index",te=S.compactIri({activeCtx:C,iri:q,relativeTo:{vocab:!0}});if(q==="@index")Te=ie["@index"],delete ce[te];else{let fe;if([Te,...fe]=w(ce[q]||[]),!r(Te))Te=null;else switch(fe.length){case 0:delete ce[q];break;case 1:ce[q]=fe[0];break;default:ce[q]=fe;break}}}else if(W.includes("@id")){const q=S.compactIri({activeCtx:C,iri:"@id",relativeTo:{vocab:!0}});Te=ce[q],delete ce[q]}else if(W.includes("@type")){const q=S.compactIri({activeCtx:C,iri:"@type",relativeTo:{vocab:!0}});let te;switch([Te,...te]=w(ce[q]||[]),te.length){case 0:delete ce[q];break;case 1:ce[q]=te[0];break;default:ce[q]=te;break}Object.keys(ce).length===1&&"@id"in ie&&(ce=await S.compact({activeCtx:C,activeProperty:Y,element:{"@id":ie["@id"]},options:$}))}Te||(Te=S.compactIri({activeCtx:C,iri:"@none",relativeTo:{vocab:!0}})),P(Ee,Te,ce,{propertyIsArray:W.includes("@set")})}else{const Ee=!$.compactArrays||W.includes("@set")||W.includes("@list")||e(ce)&&ce.length===0||T==="@list"||T==="@graph";P(Z,Y,ce,{propertyIsArray:Ee})}}}return F}return R},S.compactIri=({activeCtx:C,iri:U,value:R=null,relativeTo:$={vocab:!1},reverse:G=!1,base:j=null})=>{if(U===null)return U;C.isPropertyTermScoped&&C.previousContext&&(C=C.previousContext);const F=C.getInverse();if(d(U)&&U in F&&"@none"in F[U]&&"@type"in F[U]["@none"]&&"@none"in F[U]["@none"]["@type"])return F[U]["@none"]["@type"]["@none"];if($.vocab&&U in F){const oe=C["@language"]||"@none",T=[];n(R)&&"@index"in R&&!("@graph"in R)&&T.push("@index","@index@set"),n(R)&&"@preserve"in R&&(R=R["@preserve"][0]),u(R)?("@index"in R&&T.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in R&&T.push("@graph@id","@graph@id@set"),T.push("@graph","@graph@set","@set"),"@index"in R||T.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in R||T.push("@graph@id","@graph@id@set")):n(R)&&!l(R)&&T.push("@id","@id@set","@type","@set@type");let Q="@language",ie="@null";if(G)Q="@type",ie="@reverse",T.push("@set");else if(a(R)){"@index"in R||T.push("@list");const me=R["@list"];if(me.length===0)Q="@any",ie="@none";else{let Z=me.length===0?oe:null,W=null;for(let ee=0;ee<me.length;++ee){const K=me[ee];let ue="@none",ce="@none";if(l(K))if("@direction"in K){const Ee=(K["@language"]||"").toLowerCase(),Te=K["@direction"];ue=`${Ee}_${Te}`}else"@language"in K?ue=K["@language"].toLowerCase():"@type"in K?ce=K["@type"]:ue="@null";else ce="@id";if(Z===null?Z=ue:ue!==Z&&l(K)&&(Z="@none"),W===null?W=ce:ce!==W&&(W="@none"),Z==="@none"&&W==="@none")break}Z=Z||"@none",W=W||"@none",W!=="@none"?(Q="@type",ie=W):ie=Z}}else{if(l(R))if("@language"in R&&!("@index"in R)){T.push("@language","@language@set"),ie=R["@language"];const me=R["@direction"];me&&(ie=`${ie}_${me}`)}else"@direction"in R&&!("@index"in R)?ie=`_${R["@direction"]}`:"@type"in R&&(Q="@type",ie=R["@type"]);else Q="@type",ie="@id";T.push("@set")}T.push("@none"),n(R)&&!("@index"in R)&&T.push("@index","@index@set"),l(R)&&Object.keys(R).length===1&&T.push("@language","@language@set");const Y=O(C,U,R,T,Q,ie);if(Y!==null)return Y}if($.vocab&&"@vocab"in C){const oe=C["@vocab"];if(U.indexOf(oe)===0&&U!==oe){const T=U.substr(oe.length);if(!C.mappings.has(T))return T}}let se=null;const M=[];let re=C.fastCurieMap;const B=U.length-1;for(let oe=0;oe<B&&U[oe]in re;++oe)re=re[U[oe]],""in re&&M.push(re[""][0]);for(let oe=M.length-1;oe>=0;--oe){const T=M[oe],Q=T.terms;for(const ie of Q){const Y=ie+":"+U.substr(T.iri.length);C.mappings.get(ie)._prefix&&(!C.mappings.has(Y)||R===null&&C.mappings.get(Y)["@id"]===U)&&(se===null||y(Y,se)<0)&&(se=Y)}}if(se!==null)return se;for(const[oe,T]of C.mappings)if(T&&T._prefix&&U.startsWith(oe+":"))throw new i(`Absolute IRI "${U}" confused with prefix "${oe}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:C});if(!$.vocab)if("@base"in C)if(C["@base"]){const oe=I(A(j,C["@base"]),U);return N.test(oe)?`./${oe}`:oe}else return U;else return I(j,U);return U},S.compactValue=({activeCtx:C,activeProperty:U,value:R,options:$})=>{if(l(R)){const se=m(C,U,"@type"),M=m(C,U,"@language"),re=m(C,U,"@direction"),B=m(C,U,"@container")||[],oe="@index"in R&&!B.includes("@index");if(!oe&&se!=="@none"&&(R["@type"]===se||"@language"in R&&R["@language"]===M&&"@direction"in R&&R["@direction"]===re||"@language"in R&&R["@language"]===M||"@direction"in R&&R["@direction"]===re))return R["@value"];const T=Object.keys(R).length,Q=T===1||T===2&&"@index"in R&&!oe,ie="@language"in C,Y=r(R["@value"]),me=C.mappings.has(U)&&C.mappings.get(U)["@language"]===null;if(Q&&se!=="@none"&&(!ie||!Y||me))return R["@value"];const Z={};return oe&&(Z[S.compactIri({activeCtx:C,iri:"@index",relativeTo:{vocab:!0}})]=R["@index"]),"@type"in R?Z[S.compactIri({activeCtx:C,iri:"@type",relativeTo:{vocab:!0}})]=S.compactIri({activeCtx:C,iri:R["@type"],relativeTo:{vocab:!0}}):"@language"in R&&(Z[S.compactIri({activeCtx:C,iri:"@language",relativeTo:{vocab:!0}})]=R["@language"]),"@direction"in R&&(Z[S.compactIri({activeCtx:C,iri:"@direction",relativeTo:{vocab:!0}})]=R["@direction"]),Z[S.compactIri({activeCtx:C,iri:"@value",relativeTo:{vocab:!0}})]=R["@value"],Z}const G=g(C,U,{vocab:!0},$),j=m(C,U,"@type"),F=S.compactIri({activeCtx:C,iri:R["@id"],relativeTo:{vocab:j==="@vocab"},base:$.base});return j==="@id"||j==="@vocab"||G==="@graph"?F:{[S.compactIri({activeCtx:C,iri:"@id",relativeTo:{vocab:!0}})]:F}};function O(C,U,R,$,G,j){j===null&&(j="@null");const F=[];if((j==="@id"||j==="@reverse")&&n(R)&&"@id"in R){j==="@reverse"&&F.push("@reverse");const M=S.compactIri({activeCtx:C,iri:R["@id"],relativeTo:{vocab:!0}});C.mappings.has(M)&&C.mappings.get(M)&&C.mappings.get(M)["@id"]===R["@id"]?F.push.apply(F,["@vocab","@id"]):F.push.apply(F,["@id","@vocab"])}else{F.push(j);const M=F.find(re=>re.includes("_"));M&&F.push(M.replace(/^[^_]+_/,"_"))}F.push("@none");const se=C.inverse[U];for(const M of $){if(!(M in se))continue;const re=se[M][G];for(const B of F)if(B in re)return re[B]}return null}function X(C,U,R){if(g(C,U,{vocab:!0},R)!=="@nest")throw new i("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}return Wa}var Ga,qd;function zm(){return qd||(qd=1,Ga=i=>{class e{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(e,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(e.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:e}),e.compact=function(n,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):i.compact(n,r)},e.expand=function(n){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):i.expand(n)},e.flatten=function(n){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):i.flatten(n)},e}),Ga}var Za,zd;function Hm(){if(zd)return Za;zd=1;const i=Vl(),e=Nm(),n=Qt(),r=km(),o=n.IdentifierIssuer,a=Kt(),l=$f(),u=Dm(),{expand:f}=Mm(),{flatten:h}=Om(),{fromRDF:g}=Fm(),{toRDF:m}=Bm(),{frameMergedOrDefault:d,cleanupNull:_}=$m(),{isArray:v,isObject:I,isString:A}=zt(),{isSubjectReference:N}=On(),{expandIri:P,getInitialContext:w,process:y,processingMode:S}=wi(),{compact:O,compactIri:X}=qm(),{createNodeMap:C,createMergedNodeMap:U,mergeNodeMaps:R}=eo(),{logEventHandler:$,logWarningEventHandler:G,safeEventHandler:j,setDefaultEventHandler:F,setupEventHandler:se,strictEventHandler:M,unhandledEventHandler:re}=Jr(),B=function(T){const Q={},Y=new l({max:100});T.compact=async function(Z,W,ee){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(W===null)throw new a("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(Z===null)return null;ee=me(ee,{base:A(Z)?Z:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new o("_:b"),contextResolver:new r({sharedCache:Y})}),ee.link&&(ee.skipExpansion=!0),ee.compactToRelative||delete ee.base;let K;ee.skipExpansion?K=Z:K=await T.expand(Z,ee);const ue=await T.processContext(w(ee),W,ee);let ce=await O({activeCtx:ue,element:K,options:ee});ee.compactArrays&&!ee.graph&&v(ce)?ce.length===1?ce=ce[0]:ce.length===0&&(ce={}):ee.graph&&I(ce)&&(ce=[ce]),I(W)&&"@context"in W&&(W=W["@context"]),W=n.clone(W),v(W)||(W=[W]);const Ee=W;W=[];for(let q=0;q<Ee.length;++q)(!I(Ee[q])||Object.keys(Ee[q]).length>0)&&W.push(Ee[q]);const Te=W.length>0;if(W.length===1&&(W=W[0]),v(ce)){const q=X({activeCtx:ue,iri:"@graph",relativeTo:{vocab:!0}}),te=ce;ce={},Te&&(ce["@context"]=W),ce[q]=te}else if(I(ce)&&Te){const q=ce;ce={"@context":W};for(const te in q)ce[te]=q[te]}return ce},T.expand=async function(Z,W){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");W=me(W,{keepFreeFloatingNodes:!1,contextResolver:new r({sharedCache:Y})});const ee={},K=[];if("expandContext"in W){const Te=n.clone(W.expandContext);I(Te)&&"@context"in Te?ee.expandContext=Te:ee.expandContext={"@context":Te},K.push(ee.expandContext)}let ue;if(!A(Z))ee.input=n.clone(Z);else{const Te=await T.get(Z,W);ue=Te.documentUrl,ee.input=Te.document,Te.contextUrl&&(ee.remoteContext={"@context":Te.contextUrl},K.push(ee.remoteContext))}"base"in W||(W.base=ue||"");let ce=w(W);for(const Te of K)ce=await y({activeCtx:ce,localCtx:Te,options:W});let Ee=await f({activeCtx:ce,element:ee.input,options:W});return I(Ee)&&"@graph"in Ee&&Object.keys(Ee).length===1?Ee=Ee["@graph"]:Ee===null&&(Ee=[]),v(Ee)||(Ee=[Ee]),Ee},T.flatten=async function(Z,W,ee){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");typeof W=="function"?W=null:W=W||null,ee=me(ee,{base:A(Z)?Z:"",contextResolver:new r({sharedCache:Y})});const K=await T.expand(Z,ee),ue=h(K);return W===null?ue:(ee.graph=!0,ee.skipExpansion=!0,await T.compact(ue,W,ee))},T.frame=async function(Z,W,ee){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(ee=me(ee,{base:A(Z)?Z:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new r({sharedCache:Y})}),A(W)){const xe=await T.get(W,ee);if(W=xe.document,xe.contextUrl){let Se=W["@context"];Se?v(Se)?Se.push(xe.contextUrl):Se=[Se,xe.contextUrl]:Se=xe.contextUrl,W["@context"]=Se}}const K=W?W["@context"]||{}:{},ue=await T.processContext(w(ee),K,ee);ee.hasOwnProperty("omitGraph")||(ee.omitGraph=S(ue,1.1)),ee.hasOwnProperty("pruneBlankNodeIdentifiers")||(ee.pruneBlankNodeIdentifiers=S(ue,1.1));const ce=await T.expand(Z,ee),Ee={...ee};Ee.isFrame=!0,Ee.keepFreeFloatingNodes=!0;const Te=await T.expand(W,Ee),q=Object.keys(W).map(xe=>P(ue,xe,{vocab:!0}));Ee.merged=!q.includes("@graph"),Ee.is11=S(ue,1.1);const te=d(ce,Te,Ee);Ee.graph=!ee.omitGraph,Ee.skipExpansion=!0,Ee.link={},Ee.framing=!0;let fe=await T.compact(te,K,Ee);return Ee.link={},fe=_(fe,Ee),fe},T.link=async function(Z,W,ee){const K={};return W&&(K["@context"]=W),K["@embed"]="@link",T.frame(Z,K,ee)},T.normalize=T.canonize=async function(Z,W){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");W=me(W,{skipExpansion:!1,safe:!0,contextResolver:new r({sharedCache:Y})});const ee=Object.assign({},{algorithm:"RDFC-1.0"},W.canonizeOptions||null);if("inputFormat"in W){if(W.inputFormat!=="application/n-quads")throw new a("Unknown canonicalization input format.","jsonld.CanonizeError");const ce=u.parse(Z);return i.canonize(ce,ee)}const K={...W};delete K.format,delete K.canonizeOptions,K.produceGeneralizedRdf=!1;const ue=await T.toRDF(Z,K);return i.canonize(ue,ee)},T.fromRDF=async function(Z,W){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");W=me(W,{format:A(Z)?"application/n-quads":void 0});const{format:ee}=W;let{rdfParser:K}=W;if(ee){if(K=K||Q[ee],!K)throw new a("Unknown input format.","jsonld.UnknownFormat",{format:ee})}else K=()=>Z;const ue=await K(Z);return g(ue,W)},T.toRDF=async function(Z,W){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");W=me(W,{skipExpansion:!1,contextResolver:new r({sharedCache:Y})});let ee;W.skipExpansion?ee=Z:ee=await T.expand(Z,W);const K=m(ee,W);if(W.format){if(W.format==="application/n-quads")return u.serialize(K);throw new a("Unknown output format.","jsonld.UnknownFormat",{format:W.format})}return K},T.createNodeMap=async function(Z,W){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");W=me(W,{base:A(Z)?Z:"",contextResolver:new r({sharedCache:Y})});const ee=await T.expand(Z,W);return U(ee,W)},T.merge=async function(Z,W,ee){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!v(Z))throw new TypeError('Could not merge, "docs" must be an array.');typeof W=="function"?W=null:W=W||null,ee=me(ee,{contextResolver:new r({sharedCache:Y})});const K=await Promise.all(Z.map(xe=>{const Se={...ee};return T.expand(xe,Se)}));let ue=!0;"mergeNodes"in ee&&(ue=ee.mergeNodes);const ce=ee.issuer||new o("_:b"),Ee={"@default":{}};for(let xe=0;xe<K.length;++xe){const Se=n.relabelBlankNodes(K[xe],{issuer:new o("_:b"+xe+"-")}),Ie=ue||xe===0?Ee:{"@default":{}};if(C(Se,Ie,"@default",ce),Ie!==Ee)for(const le in Ie){const ve=Ie[le];if(!(le in Ee)){Ee[le]=ve;continue}const Ae=Ee[le];for(const be in ve)be in Ae||(Ae[be]=ve[be])}}const Te=R(Ee),q=[],te=Object.keys(Te).sort();for(let xe=0;xe<te.length;++xe){const Se=Te[te[xe]];N(Se)||q.push(Se)}return W===null?q:(ee.graph=!0,ee.skipExpansion=!0,await T.compact(q,W,ee))},Object.defineProperty(T,"documentLoader",{get:()=>T._documentLoader,set:Z=>T._documentLoader=Z}),T.documentLoader=async Z=>{throw new a("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:Z})},T.get=async function(Z,W){let ee;typeof W.documentLoader=="function"?ee=W.documentLoader:ee=T.documentLoader;const K=await ee(Z);try{if(!K.document)throw new a("No remote document found at the given URL.","jsonld.NullRemoteDocument");A(K.document)&&(K.document=JSON.parse(K.document))}catch(ue){throw new a("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:ue,remoteDoc:K})}return K},T.processContext=async function(Z,W,ee){return ee=me(ee,{base:"",contextResolver:new r({sharedCache:Y})}),W===null?w(ee):(W=n.clone(W),I(W)&&"@context"in W||(W={"@context":W}),y({activeCtx:Z,localCtx:W,options:ee}))},T.getContextValue=wi().getContextValue,T.documentLoaders={},T.useDocumentLoader=function(Z){if(!(Z in T.documentLoaders))throw new a('Unknown document loader type: "'+Z+'"',"jsonld.UnknownDocumentLoader",{type:Z});T.documentLoader=T.documentLoaders[Z].apply(T,Array.prototype.slice.call(arguments,1))},T.registerRDFParser=function(Z,W){Q[Z]=W},T.unregisterRDFParser=function(Z){delete Q[Z]},T.registerRDFParser("application/n-quads",u.parse),T.url=Jn(),T.logEventHandler=$,T.logWarningEventHandler=G,T.safeEventHandler=j,T.setDefaultEventHandler=F,T.strictEventHandler=M,T.unhandledEventHandler=re,T.util=n,Object.assign(T,n),T.promises=T,T.RequestQueue=Bf(),T.JsonLdProcessor=zm()(T),e.setupGlobals(T),e.setupDocumentLoaders(T);function me(Z,{documentLoader:W=T.documentLoader,...ee}){if(Z&&"compactionMap"in Z)throw new a('"compactionMap" not supported.',"jsonld.OptionsError");if(Z&&"expansionMap"in Z)throw new a('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:W},ee,Z,{eventHandler:se({options:Z})})}return T},oe=function(){return B(function(){return oe()})};return B(oe),Za=oe,Za}var Um=Hm();const Vm=rf(Um),Ts={},Vi={};function qf(i){const e=new Set;for(const n of i.getQuads(null,Qr,null,Ct))n.subject.termType==="NamedNode"&&e.add(n.subject.value);if(e.size===1)return e.values().next().value}function Wm(i,e){const n=Be.namedNode(e);for(const r of i.getObjects(n,Qr,Ct))if(r.termType==="NamedNode"&&i.getQuads(r,At,Rs,null).length>0)return r}async function Gm(i){const e={store:new It,importedUrls:[],atts:i},n=[];if(i.shapes?n.push(Rn(Ui(i.shapes),e,an)):i.shapesUrl&&n.push(Rn(Cs(i.shapesUrl,e.atts.proxy),e,an)),i.values?n.push(Rn(Ui(i.values),e,Ct)):i.valuesUrl&&n.push(Rn(Cs(i.valuesUrl,e.atts.proxy),e,Ct)),await Promise.all(n),i.classInstanceProvider)try{const r=lm(e.store),o=await i.classInstanceProvider(r);o&&await Rn(Ui(o),e,an)}catch(r){console.error("failed loading class instances",r)}if(i.valuesSubject||(i.valuesSubject=qf(e.store)||null),i.valuesSubject&&e.store.countQuads(null,null,null,an)===0){const r=[...e.store.getObjects(i.valuesSubject,At,Ct),...e.store.getObjects(i.valuesSubject,Qr,Ct)],o=[];for(const a of r){let l=zf(a.value);!l&&a.value.startsWith("urn:")&&e.atts.proxy&&(l=a.value),l&&e.importedUrls.indexOf(l)<0&&(e.importedUrls.push(l),o.push(Rn(Cs(l,e.atts.proxy),e,an)))}try{await Promise.allSettled(o)}catch(a){console.warn(a)}}return e.store}async function Rn(i,e,n){const r=await i,o=[];for(const a of r){let l=n;if(e.atts.valuesSubject&&Ct.equals(n)&&a.graph.id&&a.graph.id!==e.atts.valuesSubject&&(l=a.graph),e.store.add(Be.quad(a.subject,a.predicate,a.object,l)),e.atts.loadOwlImports&&$l.equals(a.predicate)){const u=zf(a.object.value);u&&e.importedUrls.indexOf(u)<0&&(e.importedUrls.push(u),o.push(Rn(Cs(u,e.atts.proxy),e,Be.namedNode(u))))}}await Promise.allSettled(o)}async function Cs(i,e){return i in Ts||(Ts[i]=(async()=>{let n=i;e&&(n=e+encodeURIComponent(i));const r=await fetch(n,{headers:{Accept:"text/turtle, application/trig, application/n-triples, application/n-quads, text/n3, application/ld+json"}});if(r.ok){const o=await r.text();return Ui(o)}else return console.warn("failed fetching RDF from",i),[]})()),Ts[i]}async function Ui(i){if(!i.trim())return[];const e=Zm(i);if(e==="json")try{i=await Vm.toRDF(JSON.parse(i),{format:"application/n-quads"})}catch(r){console.error(r)}const n=[];return await new Promise((r,o)=>{const a=e==="xml"?new Em.RdfXmlParser:new Qg;a.on("data",l=>{n.push(Be.quad(l.subject,l.predicate,l.object,l.graph))}).on("error",l=>{o(l)}).on("prefix",(l,u)=>{l&&(Vi[l]=u)}).on("end",()=>{r(null)}),a.write(i),a.end()}),n}function zf(i){if(El(i))return i;const e=i.split(":");if(e.length===2){const n=Vi[e[0]];if(n&&(i=i.replace(`${e[0]}:`,n),El(i)))return i}return null}function Zm(i){return/^\s*[\\[{]/.test(i)?"json":/^\s*<\?xml/.test(i)?"xml":"ttl"}const Xm={[`${Fe}name`]:(i,e)=>{const n=e;i.name=Bs(i.config.languages,i.name,n)},[`${Fe}description`]:(i,e)=>{const n=e;i.description=Bs(i.config.languages,i.description,n)},[`${Fe}path`]:(i,e)=>{i.path=e.value},[`${Fe}group`]:(i,e)=>{i.group=e.id},[`${Fe}datatype`]:(i,e)=>{i.datatype=e},[`${Fe}nodeKind`]:(i,e)=>{i.nodeKind=e},[`${Fe}minCount`]:(i,e)=>{i.minCount=parseInt(e.value)},[`${Fe}maxCount`]:(i,e)=>{i.maxCount=parseInt(e.value)},[`${Fe}minLength`]:(i,e)=>{i.minLength=parseInt(e.value)},[`${Fe}maxLength`]:(i,e)=>{i.maxLength=parseInt(e.value)},[`${Fe}minInclusive`]:(i,e)=>{i.minInclusive=parseInt(e.value)},[`${Fe}maxInclusive`]:(i,e)=>{i.maxInclusive=parseInt(e.value)},[`${Fe}minExclusive`]:(i,e)=>{i.minExclusive=parseInt(e.value)},[`${Fe}maxExclusive`]:(i,e)=>{i.maxExclusive=parseInt(e.value)},[`${Fe}pattern`]:(i,e)=>{i.pattern=e.value},[`${Fe}order`]:(i,e)=>{i.order=parseInt(e.value)},[`${Bc}singleLine`]:(i,e)=>{i.singleLine=e.value==="true"},[`${Bc}readonly`]:(i,e)=>{i.readonly=e.value==="true"},[`${Kg}styleClass`]:(i,e)=>{i.cssClass=e.value},[`${Fe}in`]:(i,e)=>{i.in=e.value},[`${Fe}languageIn`]:(i,e)=>{i.languageIn=i.config.lists[e.value],i.datatype=Sf},[`${Fe}defaultValue`]:(i,e)=>{i.defaultValue=e},[`${Fe}hasValue`]:(i,e)=>{i.hasValue=e},[`${Fe}node`]:(i,e)=>{i.node=e,i.nodeShapes.add(i.config.getNodeTemplate(e,i))},[`${Fe}and`]:(i,e)=>{i.and=e.value;const n=i.config.lists[i.and];if(n?.length)for(const r of n)i.nodeShapes.add(i.config.getNodeTemplate(r,i))},[`${Fe}qualifiedValueShape`]:(i,e)=>{const n=i.config.getNodeTemplate(e,i);i.qualifiedValueShape=n,i.nodeShapes.add(n)},[`${Fe}qualifiedMinCount`]:(i,e)=>{i.qualifiedMinCount=parseInt(e.value)},[`${Fe}qualifiedMaxCount`]:(i,e)=>{i.qualifiedMaxCount=parseInt(e.value)},[$l.id]:(i,e)=>{i.owlImports.add(e)},[ql.id]:(i,e)=>{i.class=e;const n=i.config.store.getSubjects(Ys,e,null);n.length>0&&(i.node=n[0])},[`${Fe}or`]:(i,e)=>{const n=i.config.lists[e.value];n?.length?i.or=n:console.error("list for sh:or not found:",e.value,"existing lists:",i.config.lists)},[`${Fe}xone`]:(i,e)=>{const n=i.config.lists[e.value];n?.length?i.xone=n:console.error("list for sh:xone not found:",e.value,"existing lists:",i.config.lists)}};class Hd{constructor(e,n){this.label="",this.nodeShapes=new Set,this.owlImports=new Set,this.id=e,this.parent=n,this.config=n.config,this.config.registerPropertyTemplate(this),Gl(this,this.config.store.getQuads(e,null,null,null))}}function Ur(i){return Math.max(i.minCount??0,i.qualifiedMinCount??0)}function Qm(i){return Math.min(i.maxCount??Number.MAX_SAFE_INTEGER,i.qualifiedMaxCount??Number.MAX_SAFE_INTEGER)}function Hf(i){const e=Object.assign({},i);return e.nodeShapes=new Set(i.nodeShapes),e.owlImports=new Set(i.owlImports),i.languageIn&&(e.languageIn=[...i.languageIn]),i.or&&(e.or=[...i.or]),i.xone&&(e.xone=[...i.xone]),e}function Gl(i,e){for(const n of e)Xm[n.predicate.id]?.call(i,i,n.object);return i.label=i.name?.value||Zn(e,i.config.languages),i.label||(i.label=i.path?xl(i.path,Vi):"unknown"),i}function Uf(i,e){const n=e,r=i;for(const o in e)if(o!=="parent"&&o!=="config"&&o!=="id"){const a=n[o];if(a!==void 0&&a!=="")if(Array.isArray(a)){const l=r[o];Array.isArray(l)?l.push(...a):r[o]=[...a]}else if(a instanceof Set&&a.size){const l=r[o];r[o]=new Set([...l instanceof Set?l:[],...a])}else r[o]=a}}function Vf(i,e,n){const r=document.createElement("div");r.classList.add("shacl-or-constraint"),r.setAttribute("part","constraint");const o=[];if(e instanceof Li){const a=[];let l=!1;i.length&&(l=n.store.countQuads(i[0],wl,null,null)>0);for(let h=0;h<i.length;h++)if(l){const g=n.store.getObjects(i[h],wl,null),m=[];let d="";for(const _ of g){const v=n.getPropertyTemplate(_,e.template),I=new Hs(v,e);m.push(I),d+=(d.length>0?" / ":"")+I.template.label}a.push(m),o.push({label:d,value:h.toString()})}else{const g=i[h],m=n.getPropertyTemplate(g,e.template),d=new Hs(m,e);a.push([d]),o.push({label:d.template.label,value:h.toString()})}const u=n.theme.createListEditor("Please choose",null,!1,o);u.setAttribute("part","constraint-editor");const f=u.querySelector(".editor");f.onchange=()=>{if(f.value){const h=a[parseInt(f.value)];let g;h.length&&(g=h[0],r.replaceWith(h[0]),g.updateControls());for(let m=1;m<h.length;m++)g.after(h[m]),g=h[m],g.updateControls()}},r.appendChild(u)}else{const a=[];for(let f=0;f<i.length;f++){const h=n.store.getQuads(i[f],null,null,null);if(h.length){a.push(h);let g=Zn(h,n.languages);for(const m of h)m.predicate.equals(nm)&&(g=Zn(n.store.getQuads(m.object,null,null,null),n.languages));o.push({label:g||xl(h[0].predicate.value,Vi)+" = "+xl(h[0].object.value,Vi),value:f.toString()})}}const l=n.theme.createListEditor(e.template.label+"?",null,!1,o,e.template);l.setAttribute("part","constraint-editor");const u=l.querySelector(".editor");u.onchange=async()=>{if(u.value){const f=Gl(Hf(e.template),a[parseInt(u.value)]),h=await Us(f,void 0,!0),g=h.querySelector(":scope > label");g&&g.classList.add("persistent"),r.replaceWith(h)}},r.appendChild(l)}return r}function Jm(i,e,n){if(e.termType==="Literal"){const r=e.datatype;for(const o of i){const a=n.store.getQuads(o,null,null,null);for(const l of a)if(l.predicate.value===`${Fe}datatype`&&l.object.equals(r))return a}}else{const r=n.store.getObjects(e,At,null);for(const o of i){const a=n.store.getQuads(o,null,null,null);for(const l of a)if(r.length>0){if(l.predicate.value===`${Fe}node`){for(const u of r)if(n.store.getQuads(l.object,Ys,u,null).length>0)return a}if(l.predicate.equals(ql)){for(const u of r)if(l.object.equals(u))return a}}else if(l.predicate.equals(im)&&l.object.equals(Tf))return a}}return console.error("couldn't resolve sh:or/sh:xone on property for value",e),[]}function Km(i,e,n){for(const r of i){let o=!1;const a=n.store.getObjects(r,wl,null);for(const l of a){const u=n.store.getObjects(l,`${Fe}path`,null);for(const f of u)if(o=n.store.countQuads(e,f,null,null)>0,o)break}if(o)return a}return console.error("couldn't resolve sh:or/sh:xone on node for value",e),[]}const Ym=`:host {
|
|
34
34
|
--shacl-font-family: inherit;
|
|
35
35
|
--shacl-font-size: 14px;
|
|
36
36
|
--shacl-text-color: #333;
|
|
@@ -111,10 +111,10 @@ h3 { margin-top: 0; }
|
|
|
111
111
|
.link-option { padding: 10px; }
|
|
112
112
|
.link-option:hover { background-color: #F5F5F5; cursor: pointer; }
|
|
113
113
|
rokit-dialog.link-chooser::part(dialog) { min-height: min(434px, 90vh); width: min(90vw, 600px); }
|
|
114
|
-
`;class
|
|
115
|
-
`+e),this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(n)}apply(e){}setDense(e){this.dense=e}createViewer(e,n,r){const o=document.createElement("div"),a=document.createElement("label");a.innerHTML=e+":",r.description&&a.setAttribute("title",r.description.value),o.appendChild(a);let l=n.value,u=null;if(n instanceof vi){const h=r.config.store.getQuads(l,null,null,null);if(h.length){const g=Zn(h,r.config.languages);g&&(l=g)}}else n instanceof ln&&(n.language?(u=document.createElement("span"),u.classList.add("lang"),u.innerText=`@${n.language}`):n.datatype.value===`${Cn}date`?l=new Date(Date.parse(n.value)).toDateString():n.datatype.value===`${Cn}dateTime`&&(l=new Date(Date.parse(n.value)).toLocaleString()));let f;return El(n.value)?(f=document.createElement("a"),f.setAttribute("href",n.value)):f=document.createElement("div"),f.classList.add("d-flex"),f.innerText=l,u&&f.appendChild(u),o.appendChild(f),o}}function Vf(i,e,n){if(n){const r=Ur(i)>0;if(i.class&&!i.hasValue)return i.config.theme.createListEditor(i.label,e,r,Af(i.class,i),i);if(i.in){const o=i.config.lists[i.in];if(o?.length){const a=Lf(o,i.config.store,i.config.languages);return i.config.theme.createListEditor(i.label,e,r,a,i)}else console.error("list not found:",i.in,"existing lists:",i.config.lists)}if(i.datatype?.equals(Sf)||i.languageIn?.length||i.datatype===void 0&&e instanceof ln&&e.language)return i.config.theme.createLangStringEditor(i.label,e,r,i);switch(i.datatype?.value.replace(Cn,"")){case"integer":case"float":case"double":case"decimal":return i.config.theme.createNumberEditor(i.label,e,r,i);case"date":case"dateTime":return i.config.theme.createDateEditor(i.label,e,r,i);case"boolean":return i.config.theme.createBooleanEditor(i.label,e,r,i);case"base64Binary":return i.config.theme.createFileEditor(i.label,e,r,i)}return i.config.theme.createTextEditor(i.label,e,r,i)}else return e?i.config.theme.createViewer(i.label,e,i):document.createElement("div")}function Ym(i,e,n){if(e==="application/ld+json")return e_(i);{const r=new kl({format:e,prefixes:n});r.addQuads(i);let o="";return r.end((a,l)=>{a&&console.error(a),o=l}),o}}function e_(i){const e=[];for(const n of i){const r={"@id":n.subject.id};if(n.predicate===Rt)r["@type"]=n.object.id;else{let o=n.object.value;n.object instanceof ln?n.object.language?o={"@language":n.object.language,"@value":n.object.value}:n.object.datatype&&n.object.datatype.value!==`${Cn}#string`&&(o={"@type":n.object.datatype.value,"@value":n.object.value}):o={"@id":n.object.id},r[n.predicate.value]=o}e.push(r)}return JSON.stringify(e)}function Ud(i){let e=i.shaclDatatype,n=i.dataset.value||i.value;if(i.type==="checkbox"||i.getAttribute("type")==="checkbox"){if(i.checked||parseInt(i.dataset.minCount||"0")>0)return Be.literal(i.checked?"true":"false",e)}else if(n){if(n.startsWith("<")&&n.endsWith(">")&&n.indexOf(":")>-1)return Be.namedNode(n.substring(1,n.length-1));if(i.dataset.class||i.dataset.nodeKind===Fe+"IRI")return Be.namedNode(n);if(i.dataset.link)return JSON.parse(i.dataset.link);if(i.dataset.lang?e=i.dataset.lang:i.type==="number"?n=parseFloat(n):i.type==="file"&&i.binaryData?n=i.binaryData:i.type==="datetime-local"&&(n=new Date(n).toISOString().slice(0,19)),(!e||e instanceof vi&&im.equals(e))&&typeof n=="string"){let r=n.split("^^");r.length===2&&r[0].startsWith('"')&&r[0].endsWith('"')&&r[1].split(":").length===2?(n=r[0].substring(1,r[0].length-1),e=Be.namedNode(r[1])):(r=n.split("@"),r.length===2&&r[0].startsWith('"')&&r[0].endsWith('"')?(n=r[0].substring(1,r[0].length-1),e=r[1]):n.startsWith('"')&&n.endsWith('"')&&(n=n.substring(1,n.length-1)))}return Be.literal(n,e)}}const qr={};function t_(i){i.predicate===void 0&&i.datatype===void 0?console.warn('not registering plugin because it does neither define "predicate" nor "datatype"',i):qr[`${i.predicate}^${i.datatype}`]=i}function n_(){return Object.entries(qr).map(i=>i[1])}function i_(i,e){let n=qr[`${i}^${e}`];return n||(n=qr[`${i}^undefined`],n)?n:qr[`undefined^${e}`]}class Wf{constructor(e,n){this.predicate=e.predicate,this.datatype=e.datatype,n&&(this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(n))}createViewer(e,n){return e.config.theme.createViewer(e.label,n,e)}}const Rs=globalThis,Zl=Rs.ShadowRoot&&(Rs.ShadyCSS===void 0||Rs.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Xl=Symbol(),Vd=new WeakMap;let Gf=class{constructor(e,n,r){if(this._$cssResult$=!0,r!==Xl)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(Zl&&e===void 0){const r=n!==void 0&&n.length===1;r&&(e=Vd.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Vd.set(n,e))}return e}toString(){return this.cssText}};const Zf=i=>new Gf(typeof i=="string"?i:i+"",void 0,Xl),Ht=(i,...e)=>{const n=i.length===1?i[0]:e.reduce((r,o,a)=>r+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+i[a+1],i[0]);return new Gf(n,i,Xl)},r_=(i,e)=>{if(Zl)i.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const r=document.createElement("style"),o=Rs.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=n.cssText,i.appendChild(r)}},Wd=Zl?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let n="";for(const r of e.cssRules)n+=r.cssText;return Zf(n)})(i):i;const{is:s_,defineProperty:o_,getOwnPropertyDescriptor:a_,getOwnPropertyNames:l_,getOwnPropertySymbols:u_,getPrototypeOf:c_}=Object,eo=globalThis,Gd=eo.trustedTypes,d_=Gd?Gd.emptyScript:"",h_=eo.reactiveElementPolyfillSupport,zr=(i,e)=>i,Bs={toAttribute(i,e){switch(e){case Boolean:i=i?d_:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let n=i;switch(e){case Boolean:n=i!==null;break;case Number:n=i===null?null:Number(i);break;case Object:case Array:try{n=JSON.parse(i)}catch{n=null}}return n}},Ql=(i,e)=>!s_(i,e),Zd={attribute:!0,type:String,converter:Bs,reflect:!1,useDefault:!1,hasChanged:Ql};Symbol.metadata??=Symbol("metadata"),eo.litPropertyMetadata??=new WeakMap;let ji=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=Zd){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){const r=Symbol(),o=this.getPropertyDescriptor(e,r,n);o!==void 0&&o_(this.prototype,e,o)}}static getPropertyDescriptor(e,n,r){const{get:o,set:a}=a_(this.prototype,e)??{get(){return this[n]},set(l){this[n]=l}};return{get:o,set(l){const u=o?.call(this);a?.call(this,l),this.requestUpdate(e,u,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Zd}static _$Ei(){if(this.hasOwnProperty(zr("elementProperties")))return;const e=c_(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(zr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(zr("properties"))){const n=this.properties,r=[...l_(n),...u_(n)];for(const o of r)this.createProperty(o,n[o])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[r,o]of n)this.elementProperties.set(r,o)}this._$Eh=new Map;for(const[n,r]of this.elementProperties){const o=this._$Eu(n,r);o!==void 0&&this._$Eh.set(o,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const o of r)n.unshift(Wd(o))}else e!==void 0&&n.push(Wd(e));return n}static _$Eu(e,n){const r=n.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,n=this.constructor.elementProperties;for(const r of n.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return r_(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,n,r){this._$AK(e,r)}_$ET(e,n){const r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){const a=(r.converter?.toAttribute!==void 0?r.converter:Bs).toAttribute(n,r.type);this._$Em=e,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$Em=null}}_$AK(e,n){const r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){const a=r.getPropertyOptions(o),l=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:Bs;this._$Em=o;const u=l.fromAttribute(n,a.type);this[o]=u??this._$Ej?.get(o)??u,this._$Em=null}}requestUpdate(e,n,r,o=!1,a){if(e!==void 0){const l=this.constructor;if(o===!1&&(a=this[e]),r??=l.getPropertyOptions(e),!((r.hasChanged??Ql)(a,n)||r.useDefault&&r.reflect&&a===this._$Ej?.get(e)&&!this.hasAttribute(l._$Eu(e,r))))return;this.C(e,n,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:r,reflect:o,wrapped:a},l){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,l??n??this[e]),a!==!0||l!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(n=void 0),this._$AL.set(e,n)),o===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[o,a]of r){const{wrapped:l}=a,u=this[o];l!==!0||this._$AL.has(o)||u===void 0||this.C(o,void 0,a,u)}}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(n)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};ji.elementStyles=[],ji.shadowRootOptions={mode:"open"},ji[zr("elementProperties")]=new Map,ji[zr("finalized")]=new Map,h_?.({ReactiveElement:ji}),(eo.reactiveElementVersions??=[]).push("2.1.2");const Jl=globalThis,Xd=i=>i,$s=Jl.trustedTypes,Qd=$s?$s.createPolicy("lit-html",{createHTML:i=>i}):void 0,Xf="$lit$",Vn=`lit$${Math.random().toFixed(9).slice(2)}$`,Qf="?"+Vn,f_=`<${Qf}>`,xi=document,Vr=()=>xi.createComment(""),Wr=i=>i===null||typeof i!="object"&&typeof i!="function",Kl=Array.isArray,p_=i=>Kl(i)||typeof i?.[Symbol.iterator]=="function",Xa=`[
|
|
114
|
+
`;class e_{constructor(e){this.dense=!0;let n=Ym;e&&(n+=`
|
|
115
|
+
`+e),this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(n)}apply(e){}setDense(e){this.dense=e}createViewer(e,n,r){const o=document.createElement("div"),a=document.createElement("label");a.textContent=`${e}:`,r.description&&a.setAttribute("title",r.description.value),o.appendChild(a);let l=n.value,u=null;if(n instanceof vi){const h=r.config.store.getQuads(l,null,null,null);if(h.length){const g=Zn(h,r.config.languages);g&&(l=g)}}else n instanceof ln&&(n.language?(u=document.createElement("span"),u.classList.add("lang"),u.innerText=`@${n.language}`):n.datatype.value===`${Cn}date`?l=new Date(Date.parse(n.value)).toDateString():n.datatype.value===`${Cn}dateTime`&&(l=new Date(Date.parse(n.value)).toLocaleString()));let f;return El(n.value)?(f=document.createElement("a"),f.setAttribute("href",n.value)):f=document.createElement("div"),f.classList.add("d-flex"),f.innerText=l,u&&f.appendChild(u),o.appendChild(f),o}}function Wf(i,e,n){if(n){const r=Ur(i)>0;if(i.class&&!i.hasValue)return i.config.theme.createListEditor(i.label,e,r,Af(i.class,i),i);if(i.in){const o=i.config.lists[i.in];if(o?.length){const a=Lf(o,i.config.store,i.config.languages);return i.config.theme.createListEditor(i.label,e,r,a,i)}else console.error("list not found:",i.in,"existing lists:",i.config.lists)}if(i.datatype?.equals(Sf)||i.languageIn?.length||i.datatype===void 0&&e instanceof ln&&e.language)return i.config.theme.createLangStringEditor(i.label,e,r,i);switch(i.datatype?.value.replace(Cn,"")){case"integer":case"float":case"double":case"decimal":return i.config.theme.createNumberEditor(i.label,e,r,i);case"date":case"dateTime":return i.config.theme.createDateEditor(i.label,e,r,i);case"boolean":return i.config.theme.createBooleanEditor(i.label,e,r,i);case"base64Binary":return i.config.theme.createFileEditor(i.label,e,r,i)}return i.config.theme.createTextEditor(i.label,e,r,i)}else return e?i.config.theme.createViewer(i.label,e,i):document.createElement("div")}function t_(i,e,n){if(e==="application/ld+json")return n_(i);{const r=new kl({format:e,prefixes:n});r.addQuads(i);let o="";return r.end((a,l)=>{a&&console.error(a),o=l}),o}}function n_(i){const e=[];for(const n of i){const r={"@id":n.subject.id};if(n.predicate===At)r["@type"]=n.object.id;else{let o=n.object.value;n.object instanceof ln?n.object.language?o={"@language":n.object.language,"@value":n.object.value}:n.object.datatype&&n.object.datatype.value!==`${Cn}#string`&&(o={"@type":n.object.datatype.value,"@value":n.object.value}):o={"@id":n.object.id},r[n.predicate.value]=o}e.push(r)}return JSON.stringify(e)}function Ud(i){let e=i.shaclDatatype,n=i.dataset.value||i.value;if(i.type==="checkbox"||i.getAttribute("type")==="checkbox"){if(i.checked||parseInt(i.dataset.minCount||"0")>0)return Be.literal(i.checked?"true":"false",e)}else if(n){if(n.startsWith("<")&&n.endsWith(">")&&n.indexOf(":")>-1)return Be.namedNode(n.substring(1,n.length-1));if(i.dataset.class||i.dataset.nodeKind===Fe+"IRI")return Be.namedNode(n);if(i.dataset.link)return JSON.parse(i.dataset.link);if(i.dataset.lang?e=i.dataset.lang:i.type==="number"?n=parseFloat(n):i.type==="file"&&i.binaryData?n=i.binaryData:i.type==="datetime-local"&&(n=new Date(n).toISOString().slice(0,19)),(!e||e instanceof vi&&rm.equals(e))&&typeof n=="string"){let r=n.split("^^");r.length===2&&r[0].startsWith('"')&&r[0].endsWith('"')&&r[1].split(":").length===2?(n=r[0].substring(1,r[0].length-1),e=Be.namedNode(r[1])):(r=n.split("@"),r.length===2&&r[0].startsWith('"')&&r[0].endsWith('"')?(n=r[0].substring(1,r[0].length-1),e=r[1]):n.startsWith('"')&&n.endsWith('"')&&(n=n.substring(1,n.length-1)))}return Be.literal(n,e)}}const qr={};function i_(i){i.predicate===void 0&&i.datatype===void 0?console.warn('not registering plugin because it does neither define "predicate" nor "datatype"',i):qr[`${i.predicate}^${i.datatype}`]=i}function r_(){return Object.entries(qr).map(i=>i[1])}function s_(i,e){let n=qr[`${i}^${e}`];return n||(n=qr[`${i}^undefined`],n)?n:qr[`undefined^${e}`]}class Gf{constructor(e,n){this.predicate=e.predicate,this.datatype=e.datatype,n&&(this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(n))}createViewer(e,n){return e.config.theme.createViewer(e.label,n,e)}}const Ps=globalThis,Zl=Ps.ShadowRoot&&(Ps.ShadyCSS===void 0||Ps.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Xl=Symbol(),Vd=new WeakMap;let Zf=class{constructor(e,n,r){if(this._$cssResult$=!0,r!==Xl)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(Zl&&e===void 0){const r=n!==void 0&&n.length===1;r&&(e=Vd.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Vd.set(n,e))}return e}toString(){return this.cssText}};const Xf=i=>new Zf(typeof i=="string"?i:i+"",void 0,Xl),Ht=(i,...e)=>{const n=i.length===1?i[0]:e.reduce((r,o,a)=>r+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+i[a+1],i[0]);return new Zf(n,i,Xl)},o_=(i,e)=>{if(Zl)i.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const r=document.createElement("style"),o=Ps.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=n.cssText,i.appendChild(r)}},Wd=Zl?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let n="";for(const r of e.cssRules)n+=r.cssText;return Xf(n)})(i):i;const{is:a_,defineProperty:l_,getOwnPropertyDescriptor:u_,getOwnPropertyNames:c_,getOwnPropertySymbols:d_,getPrototypeOf:h_}=Object,to=globalThis,Gd=to.trustedTypes,f_=Gd?Gd.emptyScript:"",p_=to.reactiveElementPolyfillSupport,zr=(i,e)=>i,$s={toAttribute(i,e){switch(e){case Boolean:i=i?f_:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let n=i;switch(e){case Boolean:n=i!==null;break;case Number:n=i===null?null:Number(i);break;case Object:case Array:try{n=JSON.parse(i)}catch{n=null}}return n}},Ql=(i,e)=>!a_(i,e),Zd={attribute:!0,type:String,converter:$s,reflect:!1,useDefault:!1,hasChanged:Ql};Symbol.metadata??=Symbol("metadata"),to.litPropertyMetadata??=new WeakMap;let ji=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=Zd){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){const r=Symbol(),o=this.getPropertyDescriptor(e,r,n);o!==void 0&&l_(this.prototype,e,o)}}static getPropertyDescriptor(e,n,r){const{get:o,set:a}=u_(this.prototype,e)??{get(){return this[n]},set(l){this[n]=l}};return{get:o,set(l){const u=o?.call(this);a?.call(this,l),this.requestUpdate(e,u,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Zd}static _$Ei(){if(this.hasOwnProperty(zr("elementProperties")))return;const e=h_(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(zr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(zr("properties"))){const n=this.properties,r=[...c_(n),...d_(n)];for(const o of r)this.createProperty(o,n[o])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[r,o]of n)this.elementProperties.set(r,o)}this._$Eh=new Map;for(const[n,r]of this.elementProperties){const o=this._$Eu(n,r);o!==void 0&&this._$Eh.set(o,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const o of r)n.unshift(Wd(o))}else e!==void 0&&n.push(Wd(e));return n}static _$Eu(e,n){const r=n.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,n=this.constructor.elementProperties;for(const r of n.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return o_(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,n,r){this._$AK(e,r)}_$ET(e,n){const r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){const a=(r.converter?.toAttribute!==void 0?r.converter:$s).toAttribute(n,r.type);this._$Em=e,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$Em=null}}_$AK(e,n){const r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){const a=r.getPropertyOptions(o),l=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:$s;this._$Em=o;const u=l.fromAttribute(n,a.type);this[o]=u??this._$Ej?.get(o)??u,this._$Em=null}}requestUpdate(e,n,r,o=!1,a){if(e!==void 0){const l=this.constructor;if(o===!1&&(a=this[e]),r??=l.getPropertyOptions(e),!((r.hasChanged??Ql)(a,n)||r.useDefault&&r.reflect&&a===this._$Ej?.get(e)&&!this.hasAttribute(l._$Eu(e,r))))return;this.C(e,n,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:r,reflect:o,wrapped:a},l){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,l??n??this[e]),a!==!0||l!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(n=void 0),this._$AL.set(e,n)),o===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[o,a]of r){const{wrapped:l}=a,u=this[o];l!==!0||this._$AL.has(o)||u===void 0||this.C(o,void 0,a,u)}}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(n)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};ji.elementStyles=[],ji.shadowRootOptions={mode:"open"},ji[zr("elementProperties")]=new Map,ji[zr("finalized")]=new Map,p_?.({ReactiveElement:ji}),(to.reactiveElementVersions??=[]).push("2.1.2");const Jl=globalThis,Xd=i=>i,qs=Jl.trustedTypes,Qd=qs?qs.createPolicy("lit-html",{createHTML:i=>i}):void 0,Qf="$lit$",Vn=`lit$${Math.random().toFixed(9).slice(2)}$`,Jf="?"+Vn,g_=`<${Jf}>`,xi=document,Vr=()=>xi.createComment(""),Wr=i=>i===null||typeof i!="object"&&typeof i!="function",Kl=Array.isArray,m_=i=>Kl(i)||typeof i?.[Symbol.iterator]=="function",Xa=`[
|
|
116
116
|
\f\r]`,Ar=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Jd=/-->/g,Kd=/>/g,pi=RegExp(`>|${Xa}(?:([^\\s"'>=/]+)(${Xa}*=${Xa}*(?:[^
|
|
117
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Yd=/'/g,eh=/"/g,
|
|
117
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Yd=/'/g,eh=/"/g,Kf=/^(?:script|style|textarea|title)$/i,__=i=>(e,...n)=>({_$litType$:i,strings:e,values:n}),Pt=__(1),Wi=Symbol.for("lit-noChange"),gt=Symbol.for("lit-nothing"),th=new WeakMap,bi=xi.createTreeWalker(xi,129);function Yf(i,e){if(!Kl(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Qd!==void 0?Qd.createHTML(e):e}const y_=(i,e)=>{const n=i.length-1,r=[];let o,a=e===2?"<svg>":e===3?"<math>":"",l=Ar;for(let u=0;u<n;u++){const f=i[u];let h,g,m=-1,d=0;for(;d<f.length&&(l.lastIndex=d,g=l.exec(f),g!==null);)d=l.lastIndex,l===Ar?g[1]==="!--"?l=Jd:g[1]!==void 0?l=Kd:g[2]!==void 0?(Kf.test(g[2])&&(o=RegExp("</"+g[2],"g")),l=pi):g[3]!==void 0&&(l=pi):l===pi?g[0]===">"?(l=o??Ar,m=-1):g[1]===void 0?m=-2:(m=l.lastIndex-g[2].length,h=g[1],l=g[3]===void 0?pi:g[3]==='"'?eh:Yd):l===eh||l===Yd?l=pi:l===Jd||l===Kd?l=Ar:(l=pi,o=void 0);const _=l===pi&&i[u+1].startsWith("/>")?" ":"";a+=l===Ar?f+g_:m>=0?(r.push(h),f.slice(0,m)+Qf+f.slice(m)+Vn+_):f+Vn+(m===-2?u:_)}return[Yf(i,a+(i[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};let Tl=class ep{constructor({strings:e,_$litType$:n},r){let o;this.parts=[];let a=0,l=0;const u=e.length-1,f=this.parts,[h,g]=y_(e,n);if(this.el=ep.createElement(h,r),bi.currentNode=this.el.content,n===2||n===3){const m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(o=bi.nextNode())!==null&&f.length<u;){if(o.nodeType===1){if(o.hasAttributes())for(const m of o.getAttributeNames())if(m.endsWith(Qf)){const d=g[l++],_=o.getAttribute(m).split(Vn),v=/([.?@])?(.*)/.exec(d);f.push({type:1,index:a,name:v[2],strings:_,ctor:v[1]==="."?v_:v[1]==="?"?w_:v[1]==="@"?x_:no}),o.removeAttribute(m)}else m.startsWith(Vn)&&(f.push({type:6,index:a}),o.removeAttribute(m));if(Kf.test(o.tagName)){const m=o.textContent.split(Vn),d=m.length-1;if(d>0){o.textContent=qs?qs.emptyScript:"";for(let _=0;_<d;_++)o.append(m[_],Vr()),bi.nextNode(),f.push({type:2,index:++a});o.append(m[d],Vr())}}}else if(o.nodeType===8)if(o.data===Jf)f.push({type:2,index:a});else{let m=-1;for(;(m=o.data.indexOf(Vn,m+1))!==-1;)f.push({type:7,index:a}),m+=Vn.length-1}a++}}static createElement(e,n){const r=xi.createElement("template");return r.innerHTML=e,r}};function Gi(i,e,n=i,r){if(e===Wi)return e;let o=r!==void 0?n._$Co?.[r]:n._$Cl;const a=Wr(e)?void 0:e._$litDirective$;return o?.constructor!==a&&(o?._$AO?.(!1),a===void 0?o=void 0:(o=new a(i),o._$AT(i,n,r)),r!==void 0?(n._$Co??=[])[r]=o:n._$Cl=o),o!==void 0&&(e=Gi(i,o._$AS(i,e.values),o,r)),e}let b_=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:n},parts:r}=this._$AD,o=(e?.creationScope??xi).importNode(n,!0);bi.currentNode=o;let a=bi.nextNode(),l=0,u=0,f=r[0];for(;f!==void 0;){if(l===f.index){let h;f.type===2?h=new Yl(a,a.nextSibling,this,e):f.type===1?h=new f.ctor(a,f.name,f.strings,this,e):f.type===6&&(h=new E_(a,this,e)),this._$AV.push(h),f=r[++u]}l!==f?.index&&(a=bi.nextNode(),l++)}return bi.currentNode=xi,o}p(e){let n=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,n),n+=r.strings.length-2):r._$AI(e[n])),n++}},Yl=class tp{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,r,o){this.type=2,this._$AH=gt,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=r,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=Gi(this,e,n),Wr(e)?e===gt||e==null||e===""?(this._$AH!==gt&&this._$AR(),this._$AH=gt):e!==this._$AH&&e!==Wi&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):m_(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==gt&&Wr(this._$AH)?this._$AA.nextSibling.data=e:this.T(xi.createTextNode(e)),this._$AH=e}$(e){const{values:n,_$litType$:r}=e,o=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=Tl.createElement(Yf(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===o)this._$AH.p(n);else{const a=new b_(o,this),l=a.u(this.options);a.p(n),this.T(l),this._$AH=a}}_$AC(e){let n=th.get(e.strings);return n===void 0&&th.set(e.strings,n=new Tl(e)),n}k(e){Kl(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let r,o=0;for(const a of e)o===n.length?n.push(r=new tp(this.O(Vr()),this.O(Vr()),this,this.options)):r=n[o],r._$AI(a),o++;o<n.length&&(this._$AR(r&&r._$AB.nextSibling,o),n.length=o)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){const r=Xd(e).nextSibling;Xd(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},no=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,r,o,a){this.type=1,this._$AH=gt,this._$AN=void 0,this.element=e,this.name=n,this._$AM=o,this.options=a,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=gt}_$AI(e,n=this,r,o){const a=this.strings;let l=!1;if(a===void 0)e=Gi(this,e,n,0),l=!Wr(e)||e!==this._$AH&&e!==Wi,l&&(this._$AH=e);else{const u=e;let f,h;for(e=a[0],f=0;f<a.length-1;f++)h=Gi(this,u[r+f],n,f),h===Wi&&(h=this._$AH[f]),l||=!Wr(h)||h!==this._$AH[f],h===gt?e=gt:e!==gt&&(e+=(h??"")+a[f+1]),this._$AH[f]=h}l&&!o&&this.j(e)}j(e){e===gt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},v_=class extends no{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===gt?void 0:e}},w_=class extends no{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==gt)}},x_=class extends no{constructor(e,n,r,o,a){super(e,n,r,o,a),this.type=5}_$AI(e,n=this){if((e=Gi(this,e,n,0)??gt)===Wi)return;const r=this._$AH,o=e===gt&&r!==gt||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,a=e!==gt&&(r===gt||o);o&&this.element.removeEventListener(this.name,this,r),a&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}};class E_{constructor(e,n,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Gi(this,e)}}const S_=Jl.litHtmlPolyfillSupport;S_?.(Tl,Yl),(Jl.litHtmlVersions??=[]).push("3.3.2");const T_=(i,e,n)=>{const r=n?.renderBefore??e;let o=r._$litPart$;if(o===void 0){const a=n?.renderBefore??null;r._$litPart$=o=new Yl(e.insertBefore(Vr(),a),a,void 0,n??{})}return o._$AI(i),o};const eu=globalThis;class Gn extends ji{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=T_(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Wi}}Gn._$litElement$=!0,Gn.finalized=!0,eu.litElementHydrateSupport?.({LitElement:Gn});const L_=eu.litElementPolyfillSupport;L_?.({LitElement:Gn});(eu.litElementVersions??=[]).push("4.2.2");const cn=i=>(e,n)=>{n!==void 0?n.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};const I_={attribute:!0,type:String,converter:$s,reflect:!1,hasChanged:Ql},A_=(i=I_,e,n)=>{const{kind:r,metadata:o}=n;let a=globalThis.litPropertyMetadata.get(o);if(a===void 0&&globalThis.litPropertyMetadata.set(o,a=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),a.set(n.name,i),r==="accessor"){const{name:l}=n;return{set(u){const f=e.get.call(this);e.set.call(this,u),this.requestUpdate(l,f,i,!0,u)},init(u){return u!==void 0&&this.C(l,void 0,i,u),u}}}if(r==="setter"){const{name:l}=n;return function(u){const f=this[l];e.call(this,u),this.requestUpdate(l,f,i,!0,u)}}throw Error("Unsupported decorator location: "+r)};function Me(i){return(e,n)=>typeof n=="object"?A_(i,e,n):((r,o,a)=>{const l=o.hasOwnProperty(a);return o.constructor.createProperty(a,r),l?Object.getOwnPropertyDescriptor(o,a):void 0})(i,e,n)}function io(i){return Me({...i,state:!0,attribute:!1})}const N_=(i,e,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(i,e,n),n);function Ut(i,e){return(n,r,o)=>{const a=l=>l.renderRoot?.querySelector(i)??null;return N_(n,r,{get(){return a(this)}})}}var np=i=>{throw TypeError(i)},ip=(i,e,n)=>e.has(i)||np("Cannot "+n),Hn=(i,e,n)=>(ip(i,e,"read from private field"),n?n.call(i):e.get(i)),R_=(i,e,n)=>e.has(i)?np("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,n),C_=(i,e,n,r)=>(ip(i,e,"write to private field"),e.set(i,n),n),P_=Object.defineProperty,Kn=(i,e,n,r)=>{for(var o=void 0,a=i.length-1,l;a>=0;a--)(l=i[a])&&(o=l(e,n,o)||o);return o&&P_(e,n,o),o};const Ll=class extends Gn{constructor(){super(...arguments),this.dense=!1}};Ll.shadowRootOptions={...Gn.shadowRootOptions,delegatesFocus:!0},Ll.styles=[Ht`
|
|
118
118
|
:host {
|
|
119
119
|
--rokit-primary-color-inner: var(--rokit-primary-color, #008877);
|
|
120
120
|
--rokit-primary-color-transparent-inner: color-mix(in srgb, var(--rokit-primary-color-inner) 40%, transparent);
|
|
@@ -145,11 +145,11 @@ rokit-dialog.link-chooser::part(dialog) { min-height: min(434px, 90vh); width: m
|
|
|
145
145
|
0% { transform: rotate(0deg); }
|
|
146
146
|
100% { transform: rotate(360deg); }
|
|
147
147
|
}
|
|
148
|
-
`];let Vt=Ll;Kn([Me({type:Boolean,reflect:!0})],Vt.prototype,"dense");var sn;const Il=class extends Vt{constructor(){super(),
|
|
148
|
+
`];let Vt=Ll;Kn([Me({type:Boolean,reflect:!0})],Vt.prototype,"dense");var sn;const Il=class extends Vt{constructor(){super(),R_(this,sn),this.value="",this.clearable=!1,this.required=!1,this.disabled=!1,C_(this,sn,this.attachInternals())}checkValidity(){return Hn(this,sn).checkValidity()}reportValidity(){const e=Hn(this,sn).reportValidity();return this.classList.toggle("invalid",!e),e}get validity(){return Hn(this,sn).validity}get validationMessage(){return Hn(this,sn).validationMessage}setCustomValidity(e,n){e?Hn(this,sn).setValidity({customError:!0},e,n):Hn(this,sn).setValidity(void 0)}updateValidity(e,n,r){Hn(this,sn).setValidity(e,n,r)}setFormValue(e,n){Hn(this,sn).setFormValue(e,n)}};sn=new WeakMap,Il.formAssociated=!0,Il.styles=[...Vt.styles,Ht`
|
|
149
149
|
:host { align-items: center; padding: 6px 8px; border-bottom: 2px solid var(--rokit-light-background-darker-color-inner); box-sizing: border-box; }
|
|
150
150
|
:host(:focus) { border-color: var(--rokit-primary-color-inner); }
|
|
151
151
|
:host(.invalid) { border-color: var(--rokit-error-color-inner); }
|
|
152
|
-
`];let dn=Il;Kn([Me()],dn.prototype,"name");Kn([Me()],dn.prototype,"value");Kn([Me({type:Boolean})],dn.prototype,"clearable");Kn([Me({type:Boolean})],dn.prototype,"required");Kn([Me({type:Boolean})],dn.prototype,"disabled");Kn([Me()],dn.prototype,"label");Kn([Me()],dn.prototype,"placeholder");function
|
|
152
|
+
`];let dn=Il;Kn([Me()],dn.prototype,"name");Kn([Me()],dn.prototype,"value");Kn([Me({type:Boolean})],dn.prototype,"clearable");Kn([Me({type:Boolean})],dn.prototype,"required");Kn([Me({type:Boolean})],dn.prototype,"disabled");Kn([Me()],dn.prototype,"label");Kn([Me()],dn.prototype,"placeholder");function rp(i){const e=parseFloat(i),n=i.match(/m?s/);let r=0;if(n)switch(n[0]){case"s":r=e*1e3;break;case"ms":r=e;break;default:r=0;break}return r}var k_=Object.defineProperty,D_=Object.getOwnPropertyDescriptor,ro=(i,e,n,r)=>{for(var o=r>1?void 0:r?D_(e,n):e,a=i.length-1,l;a>=0;a--)(l=i[a])&&(o=(r?l(e,n,o):l(o))||o);return r&&o&&k_(e,n,o),o};let bn=class extends Vt{constructor(){super(...arguments),this.icon=!1,this.disabled=!1,this.href=""}render(){return this.href?Pt`<a part="button loader" class="button" href="${this.disabled?"":this.href}"><slot></slot></a>`:Pt`<button part="button loader" class="button" ?disabled="${this.disabled}"><slot></slot></button>`}};bn.styles=[...Vt.styles,Ht`
|
|
153
153
|
:host { display: inline-flex; align-items: center; }
|
|
154
154
|
:host([disabled]) { pointer-events: none; opacity: 0.5; }
|
|
155
155
|
:host([rounded]) .button { border-radius: 200px; }
|
|
@@ -194,7 +194,7 @@ rokit-dialog.link-chooser::part(dialog) { min-height: min(434px, 90vh); width: m
|
|
|
194
194
|
border-radius: 3px;
|
|
195
195
|
}
|
|
196
196
|
.button:hover { filter: brightness(102%); }
|
|
197
|
-
`];
|
|
197
|
+
`];ro([Me({type:Boolean,reflect:!0})],bn.prototype,"icon",2);ro([Me({type:Boolean,reflect:!0})],bn.prototype,"disabled",2);ro([Me()],bn.prototype,"href",2);bn=ro([cn("rokit-button")],bn);var M_=Object.defineProperty,O_=Object.getOwnPropertyDescriptor,sp=i=>{throw TypeError(i)},wn=(i,e,n,r)=>{for(var o=r>1?void 0:r?O_(e,n):e,a=i.length-1,l;a>=0;a--)(l=i[a])&&(o=(r?l(e,n,o):l(o))||o);return r&&o&&M_(e,n,o),o},F_=(i,e,n)=>e.has(i)||sp("Cannot "+n),nh=(i,e,n)=>(F_(i,e,"read from private field"),n?n.call(i):e.get(i)),j_=(i,e,n)=>e.has(i)?sp("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,n),ks;let kt=class extends Vt{constructor(){super(...arguments),this.open=!1,this.disabled=!1,this.headerInactive=!1,this.transitioning=!1,this.closedBeforeTransition=!1,j_(this,ks,new MutationObserver(()=>this.updateContentHeight())),this.onMouseDown=(()=>{this.closedBeforeTransition=!this.open&&!this.transitioning}).bind(this),this.onClickToggles=(()=>{this.toggle(this.closedBeforeTransition,!0)}).bind(this),this.onClickOpens=(()=>{this.toggle(!0,!0)}).bind(this)}firstUpdated(){this.transitionDuration=rp(getComputedStyle(this).getPropertyValue("--rokit-transition-duration-inner")),new IntersectionObserver(i=>{i.length&&i[0].isIntersecting&&this.updateContentHeight()}).observe(this)}updated(i){i.has("transitioning")&&this.classList.toggle("transitioning",this.transitioning),(i.has("disabled")||i.has("headerInactive"))&&(this.toggleButton.disabled=this.disabled,this.disabled?(this.header.removeEventListener("mousedown",this.onMouseDown),this.header.removeEventListener("click",this.onClickToggles),this.header.removeEventListener("click",this.onClickOpens),this.toggleButton.removeEventListener("mousedown",this.onMouseDown),this.toggleButton.removeEventListener("click",this.onClickToggles)):this.headerInactive?(this.toggleButton.addEventListener("mousedown",this.onMouseDown),this.toggleButton.addEventListener("click",this.onClickToggles),this.header.removeEventListener("click",this.onClickOpens)):(this.header.addEventListener("mousedown",this.onMouseDown),this.header.addEventListener("click",this.onClickToggles))),i.has("open")&&!this.transitioning&&!this.disabled&&this.toggle(this.open)}updateContentHeight(){setTimeout(()=>{this.content.style.maxHeight=(this.maxHeight!==void 0?Math.min(this.maxHeight,this.content.scrollHeight):this.content.scrollHeight)+"px",this.classList.toggle("has-content",this.content.style.maxHeight!=="0px")})}onSlotChange(){const i=this.shadowRoot.querySelector("#content > slot").assignedNodes();nh(this,ks).disconnect();for(const e of i)nh(this,ks).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0});this.updateContentHeight()}toggle(i=!this.open,e=!1){this.disabled||(this.transitioning=this.open!==i,this.open=i,this.toggleButton.classList.toggle("down",i),setTimeout(()=>{this.transitioning=!1,this.open&&e&&this.content.scrollIntoView({block:"nearest"})},this.transitionDuration))}render(){return Pt`
|
|
198
198
|
<header part="header">
|
|
199
199
|
<slot name="prefix" part="prefix"></slot>
|
|
200
200
|
<span class="label"><slot name="label" part="label">${this.label}</slot></span>
|
|
@@ -205,7 +205,7 @@ rokit-dialog.link-chooser::part(dialog) { min-height: min(434px, 90vh); width: m
|
|
|
205
205
|
<div id="content" part="content">
|
|
206
206
|
<slot @slotchange=${this.onSlotChange}></slot>
|
|
207
207
|
</div>
|
|
208
|
-
`}};
|
|
208
|
+
`}};ks=new WeakMap;kt.styles=[...Vt.styles,Ht`
|
|
209
209
|
:host { display: flex; flex-direction: column; align-items: stretch; border-bottom: 2px solid var(--rokit-light-background-darker-color-inner); }
|
|
210
210
|
:host header { cursor: pointer; }
|
|
211
211
|
:host([dense]) header { padding: 2px 4px; }
|
|
@@ -217,12 +217,12 @@ rokit-dialog.link-chooser::part(dialog) { min-height: min(434px, 90vh); width: m
|
|
|
217
217
|
.label { flex-grow: 1; overflow: hidden; }
|
|
218
218
|
#content { display: flex; transition: max-height var(--rokit-transition-duration-inner) ease-in-out; position: relative; scrollbar-width: thin; }
|
|
219
219
|
#toggle { margin-left: 3px; }
|
|
220
|
-
`];wn([Me({type:Boolean,reflect:!0})],
|
|
220
|
+
`];wn([Me({type:Boolean,reflect:!0})],kt.prototype,"open",2);wn([Me()],kt.prototype,"label",2);wn([Me({reflect:!0})],kt.prototype,"maxHeight",2);wn([Me({type:Boolean})],kt.prototype,"disabled",2);wn([Me({type:Boolean})],kt.prototype,"headerInactive",2);wn([Ut("#content")],kt.prototype,"content",2);wn([Ut("#toggle")],kt.prototype,"toggleButton",2);wn([Ut("header")],kt.prototype,"header",2);wn([io()],kt.prototype,"transitioning",2);kt=wn([cn("rokit-collapsible")],kt);var B_=Object.defineProperty,$_=Object.getOwnPropertyDescriptor,op=i=>{throw TypeError(i)},Bt=(i,e,n,r)=>{for(var o=r>1?void 0:r?$_(e,n):e,a=i.length-1,l;a>=0;a--)(l=i[a])&&(o=(r?l(e,n,o):l(o))||o);return r&&o&&B_(e,n,o),o},ap=(i,e,n)=>e.has(i)||op("Cannot "+n),q_=(i,e,n)=>(ap(i,e,"read from private field"),e.get(i)),z_=(i,e,n)=>e.has(i)?op("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,n),ih=(i,e,n,r)=>(ap(i,e,"write to private field"),e.set(i,n),n),Fr;let dt=class extends dn{constructor(){super(),this.type="text",this.readonly=!1,this.sticky=!1,this.minWidth=80,this.autoGrowLabelWidth=!1,z_(this,Fr,""),this.addEventListener("keydown",i=>{i.code==="Escape"&&this.blur()}),this.addEventListener("focus",()=>{this.classList.add("has-focus")}),this.addEventListener("blur",()=>{this.inputElement.scrollLeft=0,this.classList.remove("has-focus")})}firstUpdated(){ih(this,Fr,this.value),this.inputElement.addEventListener("change",()=>{this.value=this.inputElement.value}),this.autoGrowLabelWidth&&new IntersectionObserver(i=>{i.length&&i[0].isIntersecting&&this.updateMinWidth()}).observe(this)}updateMinWidth(){const i=this.shadowRoot.querySelector(".wrapper");if(i){const e=this.shadowRoot?.querySelector("label")?.scrollWidth||0,n=this.minWidth>e?this.minWidth:e;i.style.minWidth=n>0?n+"px":""}}updated(i){i.has("label")&&(this.classList.toggle("has-label",this.label!==void 0),this.autoGrowLabelWidth&&this.updateMinWidth()),i.has("min")&&(this.inputElement.min=this.min||""),i.has("max")&&(this.inputElement.max=this.max||""),i.has("step")&&(this.inputElement.step=this.step||""),i.has("placeholder")&&(this.inputElement.placeholder=this.placeholder||""),i.has("pattern")&&(this.inputElement.pattern=this.pattern||""),i.has("minLength")&&(this.inputElement.minLength=this.minLength===void 0?-1:this.minLength),i.has("maxLength")&&(this.inputElement.maxLength=this.maxLength===void 0?-1:this.maxLength),i.has("value")&&(this.classList.toggle("has-value",this.value!==""),this.setFormValue(this.value),this.updateValidity(this.inputElement.validity,this.inputElement.validationMessage,this.inputElement),this.value!==q_(this,Fr)&&(ih(this,Fr,this.value),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))))}clear(){this.inputElement.value="",this.value="",this.blur()}renderInput(){return Pt`<input id="input" part="input" size="1" name="${this.name}" type="${this.type}" autocomplete="off" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" .value="${this.type==="file"?"":this.value}">`}render(){return Pt`
|
|
221
221
|
<slot name="prefix" part="prefix"></slot>
|
|
222
222
|
<div class="wrapper">
|
|
223
223
|
<label for="input" part="label">${this.label}</label>
|
|
224
224
|
${this.renderInput()}
|
|
225
|
-
${this.clearable?
|
|
225
|
+
${this.clearable?Pt`
|
|
226
226
|
<rokit-button class="clear" icon ?dense="${this.dense}" @mousedown="${i=>{i.preventDefault()}}" @click="${i=>{i.stopPropagation(),this.clear()}}" title="Clear"></rokit-button>
|
|
227
227
|
`:gt}
|
|
228
228
|
</div>
|
|
@@ -245,7 +245,7 @@ rokit-dialog.link-chooser::part(dialog) { min-height: min(434px, 90vh); width: m
|
|
|
245
245
|
:host(.has-label:not(.has-focus):not(.has-value):not([sticky])) #input { clip-path: polygon(0 0, 0 0, 0 0, 0 0); }
|
|
246
246
|
:host(:not(.has-value)) .clear { visibility: hidden; }
|
|
247
247
|
.supporting-text { width: 100%; font-size: 0.8em; }
|
|
248
|
-
`];Bt([Me()],dt.prototype,"type",2);Bt([Me({type:Boolean,reflect:!0})],dt.prototype,"readonly",2);Bt([Me({type:Boolean,reflect:!0})],dt.prototype,"sticky",2);Bt([Me()],dt.prototype,"pattern",2);Bt([Me()],dt.prototype,"minLength",2);Bt([Me()],dt.prototype,"maxLength",2);Bt([Me()],dt.prototype,"min",2);Bt([Me()],dt.prototype,"max",2);Bt([Me()],dt.prototype,"step",2);Bt([Me()],dt.prototype,"minWidth",2);Bt([Me({type:Boolean})],dt.prototype,"autoGrowLabelWidth",2);Bt([Me()],dt.prototype,"supportingText",2);Bt([Ut("#input")],dt.prototype,"inputElement",2);dt=Bt([cn("rokit-input")],dt);var
|
|
248
|
+
`];Bt([Me()],dt.prototype,"type",2);Bt([Me({type:Boolean,reflect:!0})],dt.prototype,"readonly",2);Bt([Me({type:Boolean,reflect:!0})],dt.prototype,"sticky",2);Bt([Me()],dt.prototype,"pattern",2);Bt([Me()],dt.prototype,"minLength",2);Bt([Me()],dt.prototype,"maxLength",2);Bt([Me()],dt.prototype,"min",2);Bt([Me()],dt.prototype,"max",2);Bt([Me()],dt.prototype,"step",2);Bt([Me()],dt.prototype,"minWidth",2);Bt([Me({type:Boolean})],dt.prototype,"autoGrowLabelWidth",2);Bt([Me()],dt.prototype,"supportingText",2);Bt([Ut("#input")],dt.prototype,"inputElement",2);dt=Bt([cn("rokit-input")],dt);var H_=Object.defineProperty,U_=Object.getOwnPropertyDescriptor,lp=i=>{throw TypeError(i)},vt=(i,e,n,r)=>{for(var o=r>1?void 0:r?U_(e,n):e,a=i.length-1,l;a>=0;a--)(l=i[a])&&(o=(r?l(e,n,o):l(o))||o);return r&&o&&H_(e,n,o),o},up=(i,e,n)=>e.has(i)||lp("Cannot "+n),Ls=(i,e,n)=>(up(i,e,"read from private field"),n?n.call(i):e.get(i)),Qa=(i,e,n)=>e.has(i)?lp("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,n),Is=(i,e,n,r)=>(up(i,e,"write to private field"),e.set(i,n),n),Bi,Ds,Ms;let ht=class extends dn{constructor(){super(),this.emptyMessage="Nothing to select",this.collapsibleOrientationLeft="0",this.collapsibleOrientationRight="0",this.collapsibleWidth="",this.autoGrowLabelWidth=!1,this.fixedOpen=!1,this.collapse=!1,this.filterableThreshold=15,this.itemCount=0,this.toggleOnHeaderClick=!0,Qa(this,Bi,""),Qa(this,Ds,""),Qa(this,Ms,new MutationObserver(()=>this.onSlotChange())),this.addEventListener("focus",()=>{this.collapsible.toggle(!0),this.input.focus()}),this.addEventListener("blur",()=>{this.checkInputValue(),this.collapsible.toggle(!1)}),this.addEventListener("input",()=>{this.collapsible.toggle(!0)})}firstUpdated(){Is(this,Bi,this.value),Is(this,Ds,getComputedStyle(this).getPropertyValue("--rokit-list-indent-inner")),this.input.placeholder=this.placeholder===void 0?"Type to filter list...":this.placeholder,this.input.label=this.label,this.inputMinWidth!==void 0&&(this.input.minWidth=this.inputMinWidth),setTimeout(()=>{this.collapsible.maxHeight=parseInt(this.collapsibleMaxHeight!==void 0?this.collapsibleMaxHeight:getComputedStyle(this).getPropertyValue("--rokit-list-max-height-inner")),this.collapsible.content.style.width=this.collapsibleWidth,this.collapsible.content.style.left=this.collapsibleOrientationLeft,this.collapsible.content.style.right=this.collapsibleOrientationRight})}updated(i){if(i.has("selectedItem")){const e=this.value;this.value=this.selectedItem?this.itemValue(this.selectedItem):"",this.input.value=this.selectedItem?this.itemText(this.selectedItem):this.value,this.title||(this.input.title=this.input.value),this.classList.toggle("has-value",this.value!==""),this.setFormValue(this.value),this.required&&this.value===""?this.updateValidity({valueMissing:!0},"Please select a value",this.listContainer):this.updateValidity(),e!==this.value&&this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}i.has("value")&&this.selectItem(this.findItem(this.value)),i.has("disabled")&&(this.input.disabled=this.disabled,this.collapsible.disabled=this.disabled),i.has("supportingText")&&(this.input.supportingText=this.supportingText),(i.has("filterableThreshold")||i.has("itemCount"))&&(this.input.readonly=this.filterableThreshold<0||this.itemCount<this.filterableThreshold,this.toggleOnHeaderClick=this.input.readonly),this.collapsible?.toggleButton&&(this.collapsible.toggleButton.style.display=this.listContainer.childElementCount===0?"none":""),i.has("fixedOpen")&&(this.collapsible.open=this.fixedOpen,this.collapsible.disabled=this.fixedOpen)}checkInputValue(i=!0){if(this.input.value){if(this.selectedItem&&this.itemText(this.selectedItem)===this.input.value)return;const e=this.findItem(this.input.value);if(e){this.selectItem(e);return}}i&&(this.input.value="",this.input.title="",Is(this,Bi,""),this.selectItem(null,!1))}filter(i){i=i.toLowerCase();let e=!0;for(const n of this.listContainer.querySelectorAll("li"))if(n.id!=="noresult"){const r=this.itemText(n).toLowerCase().indexOf(i)==-1&&(!n.dataset.value||n.dataset.value.toLowerCase().indexOf(i)==-1);n.classList.toggle("hidden",r),this.collapse&&(n.classList.remove("open"),n.querySelector("ul")?.classList.remove("open")),r||(e=!1)}for(const n of this.listContainer.querySelectorAll("li:has(li:not(.hidden))"))n.classList.remove("hidden"),i&&this.collapse&&(n.classList.add("open"),n.querySelector("ul")?.classList.add("open")),e=!1;this.highlightItem(null),this.listContainer.querySelector("#noresult")?.classList.toggle("hidden",!e)}selectItem(i,e=!0,n=!1){i?.getAttribute("disabled")!==null&&(i=null),this.selectedItem=i,this.filter(""),this.highlightItem(i,!1),e&&this.value&&Is(this,Bi,this.value),n&&setTimeout(()=>this.blur())}findItem(i){let e=null;if(i)for(const n of this.listContainer.querySelectorAll("li")){if(n.dataset.value===i)return n;this.itemText(n)===i&&(e=n)}return e}highlightItem(i,e=!0){if(this.listContainer.querySelector("li.active")?.classList.remove("active"),i){if(e&&this.listContainer.focus(),i.classList.add("active"),this.collapse)for(let n=i.closest("ul");n;n=n.parentElement.closest("ul"))n.classList.add("open"),n.closest("li")?.classList.add("open");this.collapsible.open&&i.scrollIntoView({block:"nearest"})}}highlightNextItem(){const i=this.listContainer.querySelector("li.active");let e=i;const n=this.listContainer.querySelectorAll("ul.open > li:not([disabled]):not(.hidden):not(.divider)");if(i){for(let r=0;r<n.length;r++)if(n[r]===i&&r<n.length-1){e=n[r+1];break}}else n.length>0&&(e=n[0]);this.highlightItem(e)}highlightPreviousItem(){const i=this.listContainer.querySelector("li.active");let e=null;if(i){const n=this.listContainer.querySelectorAll("ul.open > li:not([disabled]):not(.hidden):not(.divider)");for(let r=0;r<n.length;r++)if(n[r]===i&&r>0){e=n[r-1];break}}this.highlightItem(e),e||this.input.focus()}itemValue(i){return i.dataset.value||this.itemText(i)||""}itemText(i){return i.querySelector("div > div")?.innerText||""}elementText(i){let e="";for(const n of i.childNodes)n.nodeType==3&&(e+=n.nodeValue?.trim());return e}onSlotChange(){this.listContainer.replaceChildren(),this.itemCount=0;let i=null;const e=this.shadowRoot.querySelector("#list-container-slot").assignedElements();if(e?.length===1&&(i=Array.prototype.slice.call(e[0].querySelectorAll(":scope > li")),this.copyItems(i,this.listContainer),Ls(this,Ms).disconnect(),Ls(this,Ms).observe(e[0],{subtree:!0,childList:!0,characterData:!0,attributes:!0})),this.emptyMessage){const n=document.createElement("li");n.id="noresult",n.setAttribute("disabled",""),n.innerText=this.emptyMessage,this.listContainer.appendChild(n),i&&i.length>0&&n.classList.add("hidden")}this.value=this.value||Ls(this,Bi),this.selectItem(this.findItem(this.value))}copyItems(i,e,n=0){if(this.sort!==void 0){const o=this.sort||"asc";i=i.sort((a,l)=>o==="desc"?(this.elementText(l)||this.itemValue(l)).localeCompare(this.elementText(a)||this.itemValue(a)):(this.elementText(a)||this.itemValue(a)).localeCompare(this.elementText(l)||this.itemValue(l)))}let r="";n>0&&(r=`calc(0.3em + ${n}*${Ls(this,Ds)})`);for(const o of i){const a=o.cloneNode();a.replaceChildren();const l=document.createElement("div");r&&(l.style.paddingLeft=r);const u=document.createElement("div");l.appendChild(u);for(const h of o.childNodes)if(h.nodeName!=="UL"){const g=h.cloneNode(!0);g.nodeType===3&&g.nodeValue&&(g.nodeValue=g.nodeValue.trim()),u.appendChild(g)}a.appendChild(l),a.title=a.title||this.itemText(a);const f=o.querySelector("ul");if(f?.childElementCount){const h=document.createElement("ul");if(a.appendChild(h),this.copyItems(Array.prototype.slice.call(f.children),h,n+1),this.collapse){const g=new bn;g.dense=!0,g.icon=!0,g.classList.add("toggle-node","caret"),g.addEventListener("click",m=>{m.stopPropagation(),a.classList.toggle("open"),h.classList.toggle("open"),this.collapsible.updateContentHeight()}),l.prepend(g)}else h.classList.add("open")}e.appendChild(a),this.itemCount++}}render(){return Pt`
|
|
249
249
|
<rokit-collapsible ?dense="${this.dense}" part="collapsible" ?headerInactive="${!this.toggleOnHeaderClick}">
|
|
250
250
|
<slot name="prefix" part="prefix" slot="prefix"></slot>
|
|
251
251
|
<slot name="suffix" part="suffix loader" slot="suffix"></slot>
|
|
@@ -264,7 +264,7 @@ rokit-dialog.link-chooser::part(dialog) { min-height: min(434px, 90vh); width: m
|
|
|
264
264
|
</ul>
|
|
265
265
|
<slot id="list-container-slot" @slotchange=${this.onSlotChange}></slot>
|
|
266
266
|
</rokit-collapsible>
|
|
267
|
-
`}};Bi=new WeakMap;
|
|
267
|
+
`}};Bi=new WeakMap;Ds=new WeakMap;Ms=new WeakMap;ht.styles=[...dn.styles,Ht`
|
|
268
268
|
:host { background-color: var(--rokit-light-background-color-inner); user-select: none; padding: 0; }
|
|
269
269
|
:host([dense]) {
|
|
270
270
|
li > div { padding: 4px 2px; }
|
|
@@ -295,19 +295,19 @@ rokit-dialog.link-chooser::part(dialog) { min-height: min(434px, 90vh); width: m
|
|
|
295
295
|
:host([collapse]) li > div > div { padding-left: 1.8em; }
|
|
296
296
|
:host([collapse]) ul:not(.open) { display: none; }
|
|
297
297
|
:host([collapse]) li:not(.open) > div > .toggle-node::part(button):before { transform: translate(0, 0) rotate(-45deg); }
|
|
298
|
-
`];vt([Me()],ht.prototype,"emptyMessage",2);vt([Me()],ht.prototype,"sort",2);vt([Me()],ht.prototype,"collapsibleMaxHeight",2);vt([Me()],ht.prototype,"collapsibleOrientationLeft",2);vt([Me()],ht.prototype,"collapsibleOrientationRight",2);vt([Me()],ht.prototype,"collapsibleWidth",2);vt([Me({type:Boolean})],ht.prototype,"autoGrowLabelWidth",2);vt([Me({type:Boolean,reflect:!0})],ht.prototype,"fixedOpen",2);vt([Me()],ht.prototype,"inputMinWidth",2);vt([Me({type:Boolean,reflect:!0})],ht.prototype,"collapse",2);vt([Me()],ht.prototype,"filterableThreshold",2);vt([Me()],ht.prototype,"supportingText",2);vt([Ut("rokit-collapsible")],ht.prototype,"collapsible",2);vt([Ut("#input")],ht.prototype,"input",2);vt([Ut("#list-container")],ht.prototype,"listContainer",2);vt([
|
|
298
|
+
`];vt([Me()],ht.prototype,"emptyMessage",2);vt([Me()],ht.prototype,"sort",2);vt([Me()],ht.prototype,"collapsibleMaxHeight",2);vt([Me()],ht.prototype,"collapsibleOrientationLeft",2);vt([Me()],ht.prototype,"collapsibleOrientationRight",2);vt([Me()],ht.prototype,"collapsibleWidth",2);vt([Me({type:Boolean})],ht.prototype,"autoGrowLabelWidth",2);vt([Me({type:Boolean,reflect:!0})],ht.prototype,"fixedOpen",2);vt([Me()],ht.prototype,"inputMinWidth",2);vt([Me({type:Boolean,reflect:!0})],ht.prototype,"collapse",2);vt([Me()],ht.prototype,"filterableThreshold",2);vt([Me()],ht.prototype,"supportingText",2);vt([Ut("rokit-collapsible")],ht.prototype,"collapsible",2);vt([Ut("#input")],ht.prototype,"input",2);vt([Ut("#list-container")],ht.prototype,"listContainer",2);vt([io()],ht.prototype,"selectedItem",2);vt([io()],ht.prototype,"itemCount",2);vt([io()],ht.prototype,"toggleOnHeaderClick",2);ht=vt([cn("rokit-select")],ht);var V_=Object.defineProperty,W_=Object.getOwnPropertyDescriptor,so=(i,e,n,r)=>{for(var o=r>1?void 0:r?W_(e,n):e,a=i.length-1,l;a>=0;a--)(l=i[a])&&(o=(r?l(e,n,o):l(o))||o);return r&&o&&V_(e,n,o),o};let Ei=class extends dt{constructor(){super(...arguments),this.resize="none",this.rows=3}firstUpdated(){super.firstUpdated(),this.inputElement.rows=this.rows,this.cols!==void 0&&(this.inputElement.cols=this.cols),this.resize==="auto"?(this.inputElement.style.resize="none",this.inputElement.addEventListener("input",()=>this.autoResize())):this.inputElement.style.resize=this.resize}updated(i){super.updated(i),this.resize==="auto"&&i.has("resize")&&new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this.autoResize()}).observe(this),this.resize==="auto"&&i.has("value")&&this.autoResize()}autoResize(){this.inputElement.style.height="",this.inputElement.style.height=this.inputElement.scrollHeight+"px"}onSlotChange(){const i=this.shadowRoot.querySelector("#content").assignedNodes().map(e=>e.textContent).join("");i.trim()!==""&&(this.value=i)}renderInput(){return Pt`
|
|
299
299
|
<textarea id="input" part="input" autocomplete="off" name="${this.name}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" .value="${this.value}"></textarea>
|
|
300
300
|
<slot id="content" @slotchange=${this.onSlotChange}></slot>
|
|
301
301
|
`}};Ei.styles=[...dt.styles,Ht`
|
|
302
302
|
:host, .wrapper { align-items: flex-start; }
|
|
303
303
|
#input { height: initial; }
|
|
304
304
|
#content { display: none; }
|
|
305
|
-
`];
|
|
305
|
+
`];so([Me()],Ei.prototype,"resize",2);so([Me()],Ei.prototype,"rows",2);so([Me()],Ei.prototype,"cols",2);Ei=so([cn("rokit-textarea")],Ei);var G_=Object.defineProperty,Z_=Object.getOwnPropertyDescriptor,cp=i=>{throw TypeError(i)},xn=(i,e,n,r)=>{for(var o=r>1?void 0:r?Z_(e,n):e,a=i.length-1,l;a>=0;a--)(l=i[a])&&(o=(r?l(e,n,o):l(o))||o);return r&&o&&G_(e,n,o),o},dp=(i,e,n)=>e.has(i)||cp("Cannot "+n),tt=(i,e,n)=>(dp(i,e,"read from private field"),n?n.call(i):e.get(i)),Ja=(i,e,n)=>e.has(i)?cp("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,n),As=(i,e,n,r)=>(dp(i,e,"write to private field"),e.set(i,n),n),lt,Nn,$i;const Wn=18;let kn=class extends dt{constructor(){super(...arguments),this.labelFormatter=i=>String(Math.round(i*1e3)/1e3),Ja(this,lt,[0,1]),Ja(this,Nn,[tt(this,lt)[0],tt(this,lt)[1]]),Ja(this,$i)}firstUpdated(){super.firstUpdated(),this.sliderElement.addEventListener("mousedown",i=>this.onKnobDrag(i)),this.sliderElement.addEventListener("touchstart",i=>this.onKnobDrag(i)),new ResizeObserver(()=>{this.updateKnobPositions()}).observe(this.sliderElement)}updated(i){if(super.updated(i),i.has("min")&&(tt(this,lt)[0]=parseFloat(this.min||"0"),tt(this,lt)[1]=Math.max(tt(this,lt)[0],tt(this,lt)[1])),i.has("max")&&(tt(this,lt)[1]=parseFloat(this.max||"1"),tt(this,lt)[0]=Math.min(tt(this,lt)[0],tt(this,lt)[1])),i.has("step")&&As(this,$i,this.step?parseFloat(this.step):void 0),i.has("value")||i.has("min")||i.has("max"))if(this.value)if(this.range!==void 0){const e=JSON.parse(this.value);As(this,Nn,[this.applyConstraints(e[0]),this.applyConstraints(e[1])])}else As(this,Nn,[this.applyConstraints(parseFloat(this.value))]);else As(this,Nn,[tt(this,lt)[0],tt(this,lt)[1]]);this.updateKnobPositions()}updateValidity(i,e){super.updateValidity(i,e,this.sliderElement)}chooseKnob(i){if(!this.endKnob)return this.startKnob;let e=Math.abs(i-this.startKnob.offsetLeft)<Math.abs(i-this.endKnob.offsetLeft)?this.startKnob:this.endKnob;return this.startKnob.value===this.endKnob.value&&(e.id==="start"&&e.value===tt(this,lt)[0]?e=this.endKnob:e.id==="end"&&e.value===tt(this,lt)[1]&&(e=this.startKnob)),e}toScreenSpace(i){return(i-tt(this,lt)[0])/(tt(this,lt)[1]-tt(this,lt)[0])*this.track.offsetWidth}toValueSpace(i){return i/this.track.offsetWidth*(tt(this,lt)[1]-tt(this,lt)[0])+tt(this,lt)[0]}applyConstraints(i,e){let n=Math.min(Math.max(i,tt(this,lt)[0]),tt(this,lt)[1]);return tt(this,$i)&&(n=Math.round(n/tt(this,$i))*tt(this,$i)),e!==void 0&&this.endKnob&&(n=e?Math.min(n,this.endKnob.value):Math.max(n,this.startKnob.value)),n}updateKnob(i,e){i.value=e,i.offset=this.toScreenSpace(e),i.label=this.labelFormatter(e),this.endKnob&&(i.id==="start"?this.track.style.borderLeftWidth=i.offset+"px":this.track.style.borderRightWidth=this.track.offsetWidth-i.offset+"px")}updateKnobPositions(){this.updateKnob(this.startKnob,tt(this,Nn)[0]),this.endKnob&&this.updateKnob(this.endKnob,tt(this,Nn)[1])}onKnobDrag(i){if(i.target instanceof Zi||this.classList.contains("has-value")||this.classList.contains("has-focus")){let e;const n=o=>{let a=0;o.type==="touchmove"||o.type==="touchstart"?a=o.touches[0].clientX:a=o.clientX,a=a-this.track.getBoundingClientRect().left,e||(e=this.chooseKnob(a),e.classList.add("focus")),this.updateKnob(e,this.applyConstraints(this.toValueSpace(a),e.id==="start"))},r=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("touchmove",n),document.removeEventListener("mouseup",r),document.removeEventListener("touchend",r),e&&(e.classList.remove("focus"),this.range!==void 0?e.id==="end"?this.value=JSON.stringify([tt(this,Nn)[0],e.value]):this.value=JSON.stringify([e.value,tt(this,Nn)[1]]):this.value=String(e.value)),e=void 0};this.sliderElement.focus(),document.addEventListener("mousemove",n),document.addEventListener("touchmove",n),document.addEventListener("mouseup",r),document.addEventListener("touchend",r),n(i)}}renderInput(){return Pt`
|
|
306
306
|
${super.renderInput()}
|
|
307
307
|
<div id="slider" part="slider" tabindex="0" ?range="${this.range!==void 0}">
|
|
308
308
|
<div id="track"></div>
|
|
309
309
|
<rokit-slider-knob id="start"></rokit-slider-knob>
|
|
310
|
-
${this.range===void 0?gt:
|
|
310
|
+
${this.range===void 0?gt:Pt`
|
|
311
311
|
<rokit-slider-knob id="end"></rokit-slider-knob>
|
|
312
312
|
`}
|
|
313
313
|
</div>
|
|
@@ -320,7 +320,7 @@ rokit-dialog.link-chooser::part(dialog) { min-height: min(434px, 90vh); width: m
|
|
|
320
320
|
:host(:not([sticky])) #slider:not(:focus) rokit-slider-knob::part(label) { color: transparent; background-color: transparent; border-color: transparent; top: 0; }
|
|
321
321
|
#track { height: 2px; flex-grow: 1; background-color: #CCC; }
|
|
322
322
|
#slider[range] #track { background-color: color-mix(in srgb, var(--rokit-primary-color-inner) 60%, transparent); border-width: 0; border-color: #CCC; border-style: solid; }
|
|
323
|
-
`];xn([Me()],kn.prototype,"range",2);xn([Me()],kn.prototype,"labelFormatter",2);xn([Ut("#slider")],kn.prototype,"sliderElement",2);xn([Ut("#track")],kn.prototype,"track",2);xn([Ut("#start")],kn.prototype,"startKnob",2);xn([Ut("#end")],kn.prototype,"endKnob",2);kn=xn([cn("rokit-slider")],kn);let Zi=class extends Gn{constructor(){super(...arguments),this.offset=0,this.label="",this.value=0}updated(i){i.has("offset")&&(this.style.left=this.offset+"px")}render(){return
|
|
323
|
+
`];xn([Me()],kn.prototype,"range",2);xn([Me()],kn.prototype,"labelFormatter",2);xn([Ut("#slider")],kn.prototype,"sliderElement",2);xn([Ut("#track")],kn.prototype,"track",2);xn([Ut("#start")],kn.prototype,"startKnob",2);xn([Ut("#end")],kn.prototype,"endKnob",2);kn=xn([cn("rokit-slider")],kn);let Zi=class extends Gn{constructor(){super(...arguments),this.offset=0,this.label="",this.value=0}updated(i){i.has("offset")&&(this.style.left=this.offset+"px")}render(){return Pt`<label part="label">${this.label}</label>`}};Zi.styles=[Ht`
|
|
324
324
|
:host { position: absolute; width: ${Wn}px; height: ${Wn}px; border-radius: ${Wn}px; background-color: var(--rokit-primary-color-inner); }
|
|
325
325
|
:host(.focus), :host(:hover) { box-shadow: 0 0 0 ${Wn/2}px var(--rokit-primary-color-transparent-inner); z-index: 1; }
|
|
326
326
|
label {
|
|
@@ -350,13 +350,13 @@ rokit-dialog.link-chooser::part(dialog) { min-height: min(434px, 90vh); width: m
|
|
|
350
350
|
background-color: inherit;
|
|
351
351
|
clip-path: polygon(50% 50%, 100% 50%, 50% 100%, 0 50%);
|
|
352
352
|
}
|
|
353
|
-
`];xn([Me()],Zi.prototype,"offset",2);xn([Me()],Zi.prototype,"label",2);Zi=xn([cn("rokit-slider-knob")],Zi);var
|
|
353
|
+
`];xn([Me()],Zi.prototype,"offset",2);xn([Me()],Zi.prototype,"label",2);Zi=xn([cn("rokit-slider-knob")],Zi);var X_=Object.defineProperty,Q_=Object.getOwnPropertyDescriptor,Kr=(i,e,n,r)=>{for(var o=r>1?void 0:r?Q_(e,n):e,a=i.length-1,l;a>=0;a--)(l=i[a])&&(o=(r?l(e,n,o):l(o))||o);return r&&o&&X_(e,n,o),o};let Xn=class extends Vt{constructor(){super(...arguments),this.open=!1,this.closable=!1,this.title="",this.previousBodyPaddingRight="",this.layoutLocked=!1}lockLayout(){if(this.layoutLocked)return;this.layoutLocked=!0;const i=window.innerWidth-document.documentElement.clientWidth;this.previousBodyPaddingRight=document.body.style.paddingRight,document.body.classList.add("dialog-open"),document.body.style.paddingRight=i>0?`${i}px`:this.previousBodyPaddingRight,document.body.style.left=`-${window.scrollX}px`,document.body.style.top=`-${window.scrollY}px`,document.body.style.position="fixed"}unlockLayout(){if(!this.layoutLocked)return;this.layoutLocked=!1;const i=document.body.style.left,e=document.body.style.top;document.body.style.position="",document.body.style.left="",document.body.style.top="",document.body.classList.remove("dialog-open"),document.body.style.paddingRight=this.previousBodyPaddingRight,this.previousBodyPaddingRight="",window.scrollTo(parseInt(i||"0")*-1,parseInt(e||"0")*-1)}firstUpdated(){this.dialogElement.addEventListener("close",()=>{this.open=!1,this.dispatchEvent(new Event("close"))})}updated(i){i.has("open")&&(this.open?(this.lockLayout(),this.dialogElement.showModal()):(this.unlockLayout(),this.dialogElement.close()))}render(){return Pt`
|
|
354
354
|
<dialog id="dialog" part="dialog">
|
|
355
355
|
<header>
|
|
356
356
|
<div class="title" part="title">
|
|
357
357
|
<slot name="header">${this.title}</slot>
|
|
358
358
|
</div>
|
|
359
|
-
${this.closable?
|
|
359
|
+
${this.closable?Pt`
|
|
360
360
|
<rokit-button class="clear" icon ?dense="${this.dense}" @click="${()=>{this.open=!1}}" title="Close"></rokit-button>
|
|
361
361
|
`:gt}
|
|
362
362
|
</header>
|
|
@@ -371,7 +371,7 @@ rokit-dialog.link-chooser::part(dialog) { min-height: min(434px, 90vh); width: m
|
|
|
371
371
|
.title { font-weight: 600; flex-grow: 1; text-align: center; }
|
|
372
372
|
.clear { justify-self: flex-end; }
|
|
373
373
|
main { flex-grow: 1; overflow: auto; display: flex; flex-direction: column; padding: 0 16px 14px 16px; }
|
|
374
|
-
`];
|
|
374
|
+
`];Kr([Me({type:Boolean,reflect:!0})],Xn.prototype,"open",2);Kr([Me({type:Boolean})],Xn.prototype,"closable",2);Kr([Me()],Xn.prototype,"title",2);Kr([Ut("#dialog")],Xn.prototype,"dialogElement",2);Xn=Kr([cn("rokit-dialog")],Xn);var J_=Object.defineProperty,K_=Object.getOwnPropertyDescriptor,tu=(i,e,n,r)=>{for(var o=r>1?void 0:r?K_(e,n):e,a=i.length-1,l;a>=0;a--)(l=i[a])&&(o=(r?l(e,n,o):l(o))||o);return r&&o&&J_(e,n,o),o};let Gr=class extends Vt{updated(i){i.has("percent")&&(this.bar.style.width=this.percent?this.percent+"%":"")}render(){return Pt`<div part="bar" class="bar"></div>`}};Gr.styles=[...Vt.styles,Ht`
|
|
375
375
|
:host { display: flex; background-color: var(--rokit-primary-color-transparent-inner); color: var(--rokit-primary-color-inner); }
|
|
376
376
|
.bar { height: 3px; background-color: var(--rokit-primary-color-inner); }
|
|
377
377
|
:host(:not([percent])) .bar { width: 100%; --c: no-repeat linear-gradient(currentColor 0 0); background: var(--c), var(--c); background-size: 60% 100%; animation: indeterminate 3s infinite; }
|
|
@@ -380,21 +380,21 @@ rokit-dialog.link-chooser::part(dialog) { min-height: min(434px, 90vh); width: m
|
|
|
380
380
|
66% { background-position: 250% 0,-150% 0 }
|
|
381
381
|
100% { background-position: 250% 0, 250% 0 }
|
|
382
382
|
}
|
|
383
|
-
`];tu([Me({reflect:!0})],Gr.prototype,"percent",2);tu([Ut(".bar")],Gr.prototype,"bar",2);Gr=tu([cn("rokit-progressbar")],Gr);var
|
|
383
|
+
`];tu([Me({reflect:!0})],Gr.prototype,"percent",2);tu([Ut(".bar")],Gr.prototype,"bar",2);Gr=tu([cn("rokit-progressbar")],Gr);var Y_=(i,e,n,r)=>{for(var o=e,a=i.length-1,l;a>=0;a--)(l=i[a])&&(o=l(o)||o);return o};const rh="RokitSnackbarEvent",hp="0.2s",ey=rp(hp),ty=3e3;let zs=class extends Gn{constructor(){super(),this.listener=i=>{i.stopImmediatePropagation(),ny(i.detail,this)},this.container=document.createElement("div"),this.container.classList.add("snackbar"),this.container.part="snackbar"}connectedCallback(){super.connectedCallback(),this.shadowRoot.appendChild(this.container),document.addEventListener(rh,this.listener)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(rh,this.listener)}};zs.styles=Ht`
|
|
384
384
|
:host { display: flex; justify-content: center; width: 100%; position: fixed; bottom: 10px; pointer-events: none; }
|
|
385
385
|
:host(.left) { right: auto; left: 10px; width: auto; }
|
|
386
386
|
:host(.right) { right: 10px; left: auto; width: auto; }
|
|
387
387
|
:host(.top) { top: 10px; bottom: auto; }
|
|
388
388
|
:host(.top) .snackbar { flex-direction: column-reverse; }
|
|
389
389
|
.snackbar { display: flex; flex-direction: column; width: 300px; }
|
|
390
|
-
.message { max-height: 0; margin-bottom: 0; overflow: hidden; background-color: #333; color: #FFF; border-radius: 4px; transition: all ${
|
|
390
|
+
.message { max-height: 0; margin-bottom: 0; overflow: hidden; background-color: #333; color: #FFF; border-radius: 4px; transition: all ${Xf(hp)} ease-in-out; font-weight: 500; pointer-events: auto; }
|
|
391
391
|
.message.error { background-color: #C22; }
|
|
392
392
|
.message.success { background-color: #0a8f0a; }
|
|
393
393
|
.message:not(.closable) .text { text-align: center; }
|
|
394
394
|
.inner { display: flex; padding: 10px; }
|
|
395
395
|
.text { flex-grow: 1; word-break: break-all; }
|
|
396
396
|
.text a { color: inherit; }
|
|
397
|
-
`;
|
|
397
|
+
`;zs=Y_([cn("rokit-snackbar")],zs);function ny(i,e){e||(e=document.querySelector("rokit-snackbar")||void 0,e||(e=new zs,document.body.appendChild(e)));const n=document.createElement("div");n.classList.add("message");const r=document.createElement("div");r.classList.add("inner");const o=document.createElement("div");if(o.classList.add("text"),o.innerHTML=i.message,r.appendChild(o),n.appendChild(r),i.closable!==void 0?i.closable:i.ttl===0){n.classList.add("closable");const l=new bn;l.setAttribute("icon",""),l.setAttribute("dense",""),l.classList.add("clear"),l.title="Dismiss",l.addEventListener("click",()=>{a(n)}),r.append(l)}i.cssStyle&&(n.style=i.cssStyle),i.cssClass&&n.classList.add(i.cssClass),e.container.appendChild(n),setTimeout(()=>{n.style.maxHeight=n.scrollHeight+"px",n.style.marginBottom="10px"}),i.ttl!==0&&setTimeout(()=>{a(n)},i.ttl||ty);const a=l=>{l.style.maxHeight="",l.style.marginBottom="",setTimeout(()=>{l.remove()},ey)}}var iy=Object.defineProperty,ry=Object.getOwnPropertyDescriptor,Yn=(i,e,n,r)=>{for(var o=r>1?void 0:r?ry(e,n):e,a=i.length-1,l;a>=0;a--)(l=i[a])&&(o=(r?l(e,n,o):l(o))||o);return r&&o&&iy(e,n,o),o};let vn=class extends Vt{constructor(){super(...arguments),this.pos="50%",this.minPos=10,this.maxPos=90,this.dir="horizontal",this.sep="4px",this.dragging=!1,this.storageKey=`rokit-splitpane:${this.id}`,this._restored=!1,this._activePointerId=null,this.posFromPointer=e=>{const n=this.getBoundingClientRect(),r=this.dir==="horizontal"?e.clientX-n.left:e.clientY-n.top,o=this.dir==="horizontal"?n.width:n.height,a=o>0?r/o*100:50;return`${Math.min(this.maxPos,Math.max(this.minPos,a))}%`},this.startDrag=e=>{e.button==0&&(this.dragging=!0,this._activePointerId=e.pointerId,e.currentTarget.setPointerCapture(e.pointerId),this.pos=this.posFromPointer(e))},this.drag=e=>{this.dragging&&this._activePointerId==e.pointerId&&(this.pos=this.posFromPointer(e))},this.endDrag=e=>{this._activePointerId==e.pointerId&&(this.dragging=!1,this._activePointerId=null)}}updated(e){if(this.storageKey&&!this._restored){const n=localStorage.getItem(this.storageKey);n&&(this.pos=n),this._restored=!0}e.has("minPos")&&(this.minPos=Math.max(0,Math.min(100,this.minPos))),e.has("maxPos")&&(this.maxPos=Math.max(0,Math.min(100,this.maxPos))),(e.has("pos")||e.has("dir"))&&(this.dir==="horizontal"?this.style.gridTemplateColumns=this.template():this.style.gridTemplateRows=this.template(),this.storageKey&&localStorage.setItem(this.storageKey,this.pos))}template(){return`${this.pos} ${this.sep} 1fr`}render(){return Pt`
|
|
398
398
|
<div><slot name="pane1"></slot></div>
|
|
399
399
|
<div
|
|
400
400
|
id="separator"
|
|
@@ -419,24 +419,24 @@ rokit-dialog.link-chooser::part(dialog) { min-height: min(434px, 90vh); width: m
|
|
|
419
419
|
#separator { cursor: row-resize; }
|
|
420
420
|
}
|
|
421
421
|
#separator { background-color: var(--rokit-light-background-darker-color-inner); }
|
|
422
|
-
`];Yn([Me()],vn.prototype,"pos",2);Yn([Me()],vn.prototype,"minPos",2);Yn([Me()],vn.prototype,"maxPos",2);Yn([Me({reflect:!0})],vn.prototype,"dir",2);Yn([Me()],vn.prototype,"sep",2);Yn([Me({reflect:!0,type:Boolean})],vn.prototype,"dragging",2);Yn([Me()],vn.prototype,"storageKey",2);vn=Yn([cn("rokit-splitpane")],vn);async function iy(i){if(i.template.nodeShapes.size===0)return;const e=i.template.config.resourceLinkProvider;if((!e||e&&!e.lazyLoad)&&(await oh(i.template),sh(i).length===0))return;const n=i.template.config.theme.createButton(i.template.label,!1);n.title="Link existing "+i.template.label,n.classList.add("link-button"),n.setAttribute("text","");const r=n.getAttribute("part");return n.setAttribute("part",`${r?r+" ":""}link-button`),n.addEventListener("click",async()=>{e?.lazyLoad&&(n.classList.add("loading"),await oh(i.template),n.classList.remove("loading"));const o=sh(i);if(o.length===0)n.innerText="No linkable resources found",n.setAttribute("disabled",""),setTimeout(()=>n.remove(),2e3);else{let a=i.template.config.form.querySelector("#dialog");a||(a=new Xn,a.classList.add("link-chooser"),a.closable=!0,i.template.config.form.appendChild(a)),a.title="Link existing "+i.template.label,ry(a,i,o),a.open=!0}}),n}function ry(i,e,n){const r=document.createElement("div");for(const o of n){const a=document.createElement("div");a.classList.add("link-option"),a.title="Link this resource",a.innerText=o.label||o.value,a.addEventListener("click",()=>{sy(o.value,e),i.open=!1}),r.appendChild(a)}i.replaceChildren(r)}function sh(i){const e=[];if(i.template.config.resourceLinkProvider){for(const n of i.template.nodeShapes)if(i.template.config.providedConformingResourceIds[n.id.value])for(const r of i.template.config.providedConformingResourceIds[n.id.value])i.querySelector(`:scope > .property-instance > shacl-node[data-node-id='${r}'], :scope > .collapsible > .property-instance > shacl-node[data-node-id='${r}']`)===null&&e.push({value:r,label:Zn(i.template.config.store.getQuads(Be.namedNode(r),null,null,null),i.template.config.languages),children:[]})}return e}async function sy(i,e){const n=Be.namedNode(i);if(fp(n,e.template.config.store)){if(e.template.config.providedResources[i]?.length>0){const o={store:e.template.config.store,importedUrls:[],atts:{loadOwlImports:!1}};await Rn(Ui(e.template.config.providedResources[i]),o,an),e.template.config.providedResources[i]=""}const r=await Hs(e.template,n,!0,!0);e.container.insertBefore(r,e.querySelector(":scope > .add-button-wrapper")),await e.updateControls()}}async function oh(i){const e=i.config.resourceLinkProvider;if(!e)return;const n=new Set(Array.from(i.nodeShapes).map(o=>o.id.value));if(n.size===0)return;const r=lm(Object.keys(i.config.providedConformingResourceIds),n);if(r.length!==0)try{const o=await e.listConformingResources(r,i);if(o){for(const a of Object.keys(o)){const l=new Set(o[a]);i.config.providedConformingResourceIds[a]=l,await hp(l,!1,i.config)}for(const a of r)i.config.providedConformingResourceIds[a]||(i.config.providedConformingResourceIds[a]=new Set)}}catch(o){console.error("failed loading conforming resources",o)}}async function hp(i,e,n){if(n.resourceLinkProvider&&i.size>0){const r=[];for(const o of i)n.providedResources[o]||r.push(o);if(r.length===0)return[];try{const o=await n.resourceLinkProvider.loadResources(r);if(o){const a={store:n.store,importedUrls:[],atts:{loadOwlImports:!1}};for(const l of o)n.providedResources[l.resourceId]=l.resourceRDF,e&&await Rn(Ui(l.resourceRDF),a,an);return o}for(const a of r)n.providedResources[a]||(n.providedResources[a]="")}catch(o){console.error("failed loading resources",o)}}return[]}async function oy(i){const e=new Set;for(const n of i.store.getQuads(null,null,null,Ft))fp(n.object,i.store)&&e.add(n.object.value);await hp(e,!0,i)}function fp(i,e){return i.termType==="NamedNode"&&e.countQuads(i,null,null,null)===0}const Ka=":scope > .add-button-wrapper, :scope > .collapsible > .add-button-wrapper",ay=":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node, :scope > .collapsible > .property-instance";class zs extends HTMLElement{constructor(e,n){if(super(),this.template=e,this.parent=n,this.container=this,this.setAttribute("part","property"),this.template.nodeShapes.size&&this.template.config.attributes.collapse!==null&&(this.template.maxCount===void 0||this.template.maxCount>1)){const r=new Pt;r.classList.add("collapsible","shacl-group"),r.open=e.config.attributes.collapse==="open",r.label=this.template.label,r.setAttribute("part","collapsible"),this.container=r,this.appendChild(this.container)}this.template.order!==void 0&&(this.style.order=`${this.template.order}`),this.template.cssClass&&this.classList.add(this.template.cssClass),e.config.editMode&&!n.linked&&this.addEventListener("change",async()=>{await this.updateControls()})}async bindValues(e,n){if(this.template.path){let r=!1;if(e){let o=this.template.config.store.getQuads(e,this.template.path,null,this.parent.linked?null:Ft);n&&(o=await this.filterValidValues(o,e));for(const a of o)this.parent.linked||this.template.config.store.delete(a),await this.addPropertyInstance(a.object,!Ft.equals(a.graph)||this.template.config.providedResources[a.object.value]!==void 0,this.template.config.providedResources[a.object.value]!==void 0),this.template.hasValue&&a.object.equals(this.template.hasValue)&&(r=!0)}this.template.config.editMode&&this.template.hasValue&&!r&&!this.parent.linked&&await this.addPropertyInstance(this.template.hasValue)}}async addPropertyInstance(e,n,r=!1){let o;if(this.template.or?.length||this.template.xone?.length){const a=this.template.or?.length?this.template.or:this.template.xone;let l=!1;if(e){const u=Xm(a,e,this.template.config);if(u.length){const f=Gl(zf(this.template),u);o=await Hs(f,e,!this.parent.linked,this.parent.linked),l=!0}}!l&&this.template.config.editMode&&(o=Uf(a,this,this.template.config),pp(o,"",this.template.config.theme.dense,this.template.config.hierarchyColorsStyleSheet!==void 0))}else o=await Hs(this.template,e,r,n||this.parent.linked);return o&&this.container.insertBefore(o,this.querySelector(Ka)),o}async updateControls(){this.template.config.editMode&&!this.parent.linked&&!this.querySelector(Ka)&&this.container.appendChild(await this.createAddControls());const e=Ur(this.template),n=this.template.nodeShapes.size===0,r=this.querySelector(":scope > .add-button-wrapper > .link-button, :scope > .collapsible > .add-button-wrapper > .link-button")===null;let o=this.instanceCount();o===0&&(n||r&&e>0)&&(await this.addPropertyInstance(),o=1),n||this.querySelector(Ka)?.classList.toggle("required",o<e);let a;e>0?a=o>e:a=!n||o>1;const l=o<Zm(this.template);this.classList.toggle("may-remove",a),this.classList.toggle("may-add",l)}instanceCount(){return this.querySelectorAll(ay).length}toRDF(e,n){const r=Be.namedNode(this.template.path);for(const o of this.querySelectorAll(":scope > .property-instance, :scope > .collapsible > .property-instance"))if(o.firstChild instanceof Li){const a=o.firstChild.toRDF(e);e.addQuad(n,r,a,this.template.config.valuesGraphId)}else if(this.template.config.editMode)for(const a of o.querySelectorAll(":scope > .editor")){const l=Ud(a);l&&e.addQuad(n,r,l,this.template.config.valuesGraphId)}else{const a=Ud(o);a&&e.addQuad(n,r,a,this.template.config.valuesGraphId)}}async filterValidValues(e,n){let r=this.template.id,o=[n];if(this.template.qualifiedValueShape){r=this.template.qualifiedValueShape.id,o=[];for(const u of e)o.push(u.object)}const a=await this.template.config.validator.validate({dataset:this.template.config.store,terms:o},[{terms:[r]}]),l=new Set;for(const u of a.results){const f=this.template.qualifiedValueShape?u.focusNode:u.value;f?.ptrs?.length&&l.add(f.ptrs[0]._term.id)}return e.filter(u=>!l.has(u.object.id))}async createAddControls(){const e=document.createElement("div");e.classList.add("add-button-wrapper"),e.setAttribute("part","add-controls");const n=await iy(this);n&&e.appendChild(n);const r=this.template.config.theme.createButton(this.template.label,!1);r.title="Add "+this.template.label,r.classList.add("add-button"),r.setAttribute("text","");const o=r.getAttribute("part");return r.setAttribute("part",`${o?o+" ":""}add-button`),r.addEventListener("click",async()=>{const a=await this.addPropertyInstance();a&&(a.classList.add("fadeIn"),await this.updateControls(),setTimeout(()=>{om(a),a.classList.remove("fadeIn")},200))}),e.appendChild(r),e}}async function Hs(i,e,n=!1,r=!1){let o;if(i.nodeShapes.size){o=document.createElement("div"),o.classList.add("property-instance"),o.setAttribute("part","property-instance");for(const a of i.nodeShapes){const l=new Li(a,e,i.nodeKind,i.label,r);o.appendChild(l),await l.ready}}else{const a=i_(i.path,i.datatype?.value);a?i.config.editMode&&!r?o=a.createEditor(i,e):o=a.createViewer(i,e):o=Vf(i,e||null,i.config.editMode&&!r),o.childNodes.length>0&&(o.classList.add("property-instance"),o.setAttribute("part","property-instance")),r&&o.classList.add("linked")}return i.config.editMode&&(!r||n)?pp(o,i.label,i.config.theme.dense,i.config.hierarchyColorsStyleSheet!==void 0,n):i.config.hierarchyColorsStyleSheet!==void 0&&o.appendChild(gp(!0)),e&&!i.config.editMode&&(e instanceof ln?(o.dataset.value=e.value,e.language.length>0?o.dataset.lang=e.language:o.shaclDatatype=e.datatype):o.dataset.value="<"+e.value+">"),o.dataset.path=i.path,o}function pp(i,e,n,r,o=!1){const a=gp(r),l=new bn;l.classList.add("remove-button","clear"),l.title="Remove "+e,l.dense=n,l.icon=!0;const u=l.getAttribute("part");l.setAttribute("part",`${u?u+" ":""}remove-button`),l.addEventListener("click",()=>{i.classList.remove("fadeIn"),i.classList.add("fadeOut"),setTimeout(()=>{const f=i.parentElement;i.remove(),f?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},200)}),o&&l.classList.add("persistent"),a.appendChild(l),i.appendChild(a)}function gp(i){const e=document.createElement("div");return e.className="remove-button-wrapper",e.setAttribute("part","remove-controls"),i&&e.classList.add("colorize"),e}window.customElements.define("shacl-property",zs);function ly(i,e){let n=i;const r=e.store.getQuads(i,null,null,null),o=Hi(r,"label",Js,e.languages);o&&(n=o);let a;if(e.attributes.collapse!==null)a=new Pt,a.classList.add("collapsible"),a.open=e.attributes.collapse==="open",a.label=n,a.setAttribute("part","group collapsible");else{a=document.createElement("div");const u=document.createElement("h1");u.innerText=n,u.setAttribute("part","group-title"),a.appendChild(u),a.setAttribute("part","group")}a.dataset.subject=i,a.classList.add("shacl-group");const l=Hi(r,"order");return l&&(a.style.order=l),a}const Tt=[];for(let i=0;i<256;++i)Tt.push((i+256).toString(16).slice(1));function uy(i,e=0){return(Tt[i[e+0]]+Tt[i[e+1]]+Tt[i[e+2]]+Tt[i[e+3]]+"-"+Tt[i[e+4]]+Tt[i[e+5]]+"-"+Tt[i[e+6]]+Tt[i[e+7]]+"-"+Tt[i[e+8]]+Tt[i[e+9]]+"-"+Tt[i[e+10]]+Tt[i[e+11]]+Tt[i[e+12]]+Tt[i[e+13]]+Tt[i[e+14]]+Tt[i[e+15]]).toLowerCase()}let Ya;const cy=new Uint8Array(16);function dy(){if(!Ya){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ya=crypto.getRandomValues.bind(crypto)}return Ya(cy)}const hy=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ah={randomUUID:hy};function fy(i,e,n){i=i||{};const r=i.random??i.rng?.()??dy();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,uy(r)}function lh(i,e,n){return ah.randomUUID&&!i?ah.randomUUID():fy(i)}class Li extends HTMLElement{constructor(e,n,r,o,a){super(),this.template=e,this.linked=a??!1,this.setAttribute("part","node");let l=n;l||(!r&&e.nodeKind&&(r=e.nodeKind),r===void 0&&e.config.attributes.valuesNamespace||r?.value===`${Fe}IRI`?l=Be.namedNode(e.config.attributes.valuesNamespace+lh()):l=Be.blankNode(lh())),this.nodeId=l;const u=JSON.stringify([e.id,n]);if(n&&e.config.renderedNodes.has(u)){o=o||"Link";const f=document.createElement("label");f.innerText=o,f.classList.add("linked"),this.appendChild(f);const h=this.getAttribute("part");this.setAttribute("part",`${h?h+" ":""}linked-node`);const g=document.createElement("a"),_=n.termType==="BlankNode"?"_:"+n.value:n.value;g.innerText=_,g.classList.add("ref-link"),g.onclick=()=>{this.template.config.form.querySelector(`shacl-node[data-node-id='${_}']`)?.scrollIntoView()},this.appendChild(g),this.style.flexDirection="row",this.ready=Promise.resolve()}else{if(n&&e.config.renderedNodes.add(u),this.dataset.nodeId=this.nodeId.id,this.template.config.attributes.showNodeIds!==null){const f=document.createElement("div");f.innerText=`id: ${this.nodeId.id}`,f.classList.add("node-id-display"),this.appendChild(f)}this.ready=(async()=>{for(const[f,h]of Object.entries(e.properties))for(const g of h)await this.addPropertyInstance(g,n,h.length>1);for(const f of e.extendedShapes){const h=new Li(f,n,void 0,void 0,a);this.prepend(h),await h.ready}if(e.or?.length&&await this.tryResolve(e.or,n,e.config),e.xone?.length&&await this.tryResolve(e.xone,n,e.config),o){const f=document.createElement("h1");f.innerText=o,f.setAttribute("part","node-title"),this.prepend(f)}})()}}toRDF(e,n,r=""){if(n||(n=this.nodeId),!this.linked){for(const o of this.querySelectorAll(":scope > shacl-node, :scope > .shacl-group > shacl-node, :scope > shacl-property, :scope > .shacl-group > shacl-property"))o.toRDF(e,n);this.template.targetClass&&e.addQuad(n,Rt,this.template.targetClass,this.template.config.valuesGraphId),r&&e.addQuad(n,Be.namedNode(r),this.template.id,this.template.config.valuesGraphId)}return n}async addPropertyInstance(e,n,r){let o=null;if(e.group)if(e.config.groups.indexOf(e.group)>-1){let l=this.querySelector(`:scope > .shacl-group[data-subject='${e.group}']`);l||(l=ly(e.group,e.config),this.appendChild(l)),o=l}else console.warn("ignoring unknown group reference",e.group,"existing groups:",e.config.groups);const a=new zs(e,this);await a.bindValues(n,r),(e.config.editMode||a.instanceCount()>0)&&(o?o.appendChild(a):this.appendChild(a),await a.updateControls())}async tryResolve(e,n,r){let o=!1;if(n){const a=Qm(e,n,r);if(a.length){for(const l of a)await this.addPropertyInstance(r.getPropertyTemplate(l,this.template),n);o=!0}}o||this.appendChild(Uf(e,this,r))}}window.customElements.define("shacl-node",Li);const py=`
|
|
422
|
+
`];Yn([Me()],vn.prototype,"pos",2);Yn([Me()],vn.prototype,"minPos",2);Yn([Me()],vn.prototype,"maxPos",2);Yn([Me({reflect:!0})],vn.prototype,"dir",2);Yn([Me()],vn.prototype,"sep",2);Yn([Me({reflect:!0,type:Boolean})],vn.prototype,"dragging",2);Yn([Me()],vn.prototype,"storageKey",2);vn=Yn([cn("rokit-splitpane")],vn);async function sy(i){if(i.template.nodeShapes.size===0)return;const e=i.template.config.resourceLinkProvider;if((!e||e&&!e.lazyLoad)&&(await oh(i.template),sh(i).length===0))return;const n=i.template.config.theme.createButton(i.template.label,!1);n.title="Link existing "+i.template.label,n.classList.add("link-button"),n.setAttribute("text","");const r=n.getAttribute("part");return n.setAttribute("part",`${r?r+" ":""}link-button`),n.addEventListener("click",async()=>{e?.lazyLoad&&(n.classList.add("loading"),await oh(i.template),n.classList.remove("loading"));const o=sh(i);if(o.length===0)n.innerText="No linkable resources found",n.setAttribute("disabled",""),setTimeout(()=>n.remove(),2e3);else{let a=i.template.config.form.querySelector("#dialog");a||(a=new Xn,a.classList.add("link-chooser"),a.closable=!0,i.template.config.form.appendChild(a)),a.title="Link existing "+i.template.label,oy(a,i,o),a.open=!0}}),n}function oy(i,e,n){const r=document.createElement("div");for(const o of n){const a=document.createElement("div");a.classList.add("link-option"),a.title="Link this resource",a.innerText=o.label||o.value,a.addEventListener("click",()=>{ay(o.value,e),i.open=!1}),r.appendChild(a)}i.replaceChildren(r)}function sh(i){const e=[];if(i.template.config.resourceLinkProvider){for(const n of i.template.nodeShapes)if(i.template.config.providedConformingResourceIds[n.id.value])for(const r of i.template.config.providedConformingResourceIds[n.id.value])i.querySelector(`:scope > .property-instance > shacl-node[data-node-id='${r}'], :scope > .collapsible > .property-instance > shacl-node[data-node-id='${r}']`)===null&&e.push({value:r,label:Zn(i.template.config.store.getQuads(Be.namedNode(r),null,null,null),i.template.config.languages),children:[]})}return e}async function ay(i,e){const n=Be.namedNode(i);if(pp(n,e.template.config.store)){if(e.template.config.providedResources[i]?.length>0){const o={store:e.template.config.store,importedUrls:[],atts:{loadOwlImports:!1}};await Rn(Ui(e.template.config.providedResources[i]),o,an),e.template.config.providedResources[i]=""}const r=await Us(e.template,n,!0,!0);e.container.insertBefore(r,e.querySelector(":scope > .add-button-wrapper")),await e.updateControls()}}async function oh(i){const e=i.config.resourceLinkProvider;if(!e)return;const n=new Set(Array.from(i.nodeShapes).map(o=>o.id.value));if(n.size===0)return;const r=um(Object.keys(i.config.providedConformingResourceIds),n);if(r.length!==0)try{const o=await e.listConformingResources(r,i);if(o){for(const a of Object.keys(o)){const l=new Set(o[a]);i.config.providedConformingResourceIds[a]=l,await fp(l,!1,i.config)}for(const a of r)i.config.providedConformingResourceIds[a]||(i.config.providedConformingResourceIds[a]=new Set)}}catch(o){console.error("failed loading conforming resources",o)}}async function fp(i,e,n){if(n.resourceLinkProvider&&i.size>0){const r=[];for(const o of i)n.providedResources[o]||r.push(o);if(r.length===0)return[];try{const o=await n.resourceLinkProvider.loadResources(r);if(o){const a={store:n.store,importedUrls:[],atts:{loadOwlImports:!1}};for(const l of o)n.providedResources[l.resourceId]=l.resourceRDF,e&&await Rn(Ui(l.resourceRDF),a,an);return o}for(const a of r)n.providedResources[a]||(n.providedResources[a]="")}catch(o){console.error("failed loading resources",o)}}return[]}async function ly(i){const e=new Set;for(const n of i.store.getQuads(null,null,null,Ct))pp(n.object,i.store)&&e.add(n.object.value);await fp(e,!0,i)}function pp(i,e){return i.termType==="NamedNode"&&e.countQuads(i,null,null,null)===0}const Ka=":scope > .add-button-wrapper, :scope > .collapsible > .add-button-wrapper",uy=":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node, :scope > .collapsible > .property-instance";class Hs extends HTMLElement{constructor(e,n){if(super(),this.template=e,this.parent=n,this.container=this,this.setAttribute("part","property"),this.template.nodeShapes.size&&this.template.config.attributes.collapse!==null&&(this.template.maxCount===void 0||this.template.maxCount>1)){const r=new kt;r.classList.add("collapsible","shacl-group"),r.open=e.config.attributes.collapse==="open",r.label=this.template.label,r.setAttribute("part","collapsible"),this.container=r,this.appendChild(this.container)}this.template.order!==void 0&&(this.style.order=`${this.template.order}`),this.template.cssClass&&this.classList.add(this.template.cssClass),e.config.editMode&&!n.linked&&this.addEventListener("change",async()=>{await this.updateControls()})}async bindValues(e,n){if(this.template.path){let r=!1;if(e){let o=this.template.config.store.getQuads(e,this.template.path,null,this.parent.linked?null:Ct);n&&(o=await this.filterValidValues(o,e));for(const a of o)this.parent.linked||this.template.config.store.delete(a),await this.addPropertyInstance(a.object,!Ct.equals(a.graph)||this.template.config.providedResources[a.object.value]!==void 0,this.template.config.providedResources[a.object.value]!==void 0),this.template.hasValue&&a.object.equals(this.template.hasValue)&&(r=!0)}this.template.config.editMode&&this.template.hasValue&&!r&&!this.parent.linked&&await this.addPropertyInstance(this.template.hasValue)}}async addPropertyInstance(e,n,r=!1){let o;if(this.template.or?.length||this.template.xone?.length){const a=this.template.or?.length?this.template.or:this.template.xone;let l=!1;if(e){const u=Jm(a,e,this.template.config);if(u.length){const f=Gl(Hf(this.template),u);o=await Us(f,e,!this.parent.linked,this.parent.linked,this.parent),l=!0}}!l&&this.template.config.editMode&&(o=Vf(a,this,this.template.config),gp(o,"",this.template.config.theme.dense,this.template.config.hierarchyColorsStyleSheet!==void 0))}else o=await Us(this.template,e,r,n||this.parent.linked,this.parent);return o&&this.container.insertBefore(o,this.querySelector(Ka)),o}async updateControls(){this.template.config.editMode&&!this.parent.linked&&!this.querySelector(Ka)&&this.container.appendChild(await this.createAddControls());const e=Ur(this.template),n=this.template.nodeShapes.size===0,r=this.querySelector(":scope > .add-button-wrapper > .link-button, :scope > .collapsible > .add-button-wrapper > .link-button")===null,o=n||!this.hasRecursiveNodeShape();let a=this.instanceCount();a===0&&o&&(n||r&&e>0)&&(await this.addPropertyInstance(),a=1),n||this.querySelector(Ka)?.classList.toggle("required",a<e);let l;e>0?l=a>e:l=!n||a>1;const u=a<Qm(this.template);this.classList.toggle("may-remove",l),this.classList.toggle("may-add",u)}instanceCount(){return this.querySelectorAll(uy).length}hasRecursiveNodeShape(){const e=new Set;this.parent.ancestorShapeIds.forEach(n=>e.add(n)),e.add(this.parent.template.id.value);for(const n of this.template.nodeShapes)if(e.has(n.id.value))return!0;return!1}toRDF(e,n){const r=Be.namedNode(this.template.path);for(const o of this.querySelectorAll(":scope > .property-instance, :scope > .collapsible > .property-instance"))if(o.firstChild instanceof Li){const a=o.firstChild.toRDF(e);e.addQuad(n,r,a,this.template.config.valuesGraphId)}else if(this.template.config.editMode)for(const a of o.querySelectorAll(":scope > .editor")){const l=Ud(a);l&&e.addQuad(n,r,l,this.template.config.valuesGraphId)}else{const a=Ud(o);a&&e.addQuad(n,r,a,this.template.config.valuesGraphId)}}async filterValidValues(e,n){let r=this.template.id,o=[n];if(this.template.qualifiedValueShape){r=this.template.qualifiedValueShape.id,o=[];for(const u of e)o.push(u.object)}const a=await this.template.config.validator.validate({dataset:this.template.config.store,terms:o},[{terms:[r]}]),l=new Set;for(const u of a.results){const f=this.template.qualifiedValueShape?u.focusNode:u.value;f?.ptrs?.length&&l.add(f.ptrs[0]._term.id)}return e.filter(u=>!l.has(u.object.id))}async createAddControls(){const e=document.createElement("div");e.classList.add("add-button-wrapper"),e.setAttribute("part","add-controls");const n=await sy(this);n&&e.appendChild(n);const r=this.template.config.theme.createButton(this.template.label,!1);r.title="Add "+this.template.label,r.classList.add("add-button"),r.setAttribute("text","");const o=r.getAttribute("part");return r.setAttribute("part",`${o?o+" ":""}add-button`),r.addEventListener("click",async()=>{const a=await this.addPropertyInstance();a&&(a.classList.add("fadeIn"),await this.updateControls(),setTimeout(()=>{am(a),a.classList.remove("fadeIn")},200))}),e.appendChild(r),e}}async function Us(i,e,n=!1,r=!1,o){let a;if(i.nodeShapes.size){a=document.createElement("div"),a.classList.add("property-instance"),a.setAttribute("part","property-instance");const l=new Set(o?.ancestorShapeIds??[]);o&&l.add(o.template.id.value);for(const u of i.nodeShapes){const f=new Li(u,e,i.nodeKind,i.label,r,l);a.appendChild(f),await f.ready}}else{const l=s_(i.path,i.datatype?.value);l?i.config.editMode&&!r?a=l.createEditor(i,e):a=l.createViewer(i,e):a=Wf(i,e||null,i.config.editMode&&!r),a.childNodes.length>0&&(a.classList.add("property-instance"),a.setAttribute("part","property-instance")),r&&a.classList.add("linked")}return i.config.editMode&&(!r||n)?gp(a,i.label,i.config.theme.dense,i.config.hierarchyColorsStyleSheet!==void 0,n):i.config.hierarchyColorsStyleSheet!==void 0&&a.appendChild(mp(!0)),e&&!i.config.editMode&&(e instanceof ln?(a.dataset.value=e.value,e.language.length>0?a.dataset.lang=e.language:a.shaclDatatype=e.datatype):a.dataset.value="<"+e.value+">"),a.dataset.path=i.path,a}function gp(i,e,n,r,o=!1){const a=mp(r),l=new bn;l.classList.add("remove-button","clear"),l.title="Remove "+e,l.dense=n,l.icon=!0;const u=l.getAttribute("part");l.setAttribute("part",`${u?u+" ":""}remove-button`),l.addEventListener("click",()=>{i.classList.remove("fadeIn"),i.classList.add("fadeOut"),setTimeout(()=>{const f=i.parentElement;i.remove(),f?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},200)}),o&&l.classList.add("persistent"),a.appendChild(l),i.appendChild(a)}function mp(i){const e=document.createElement("div");return e.className="remove-button-wrapper",e.setAttribute("part","remove-controls"),i&&e.classList.add("colorize"),e}window.customElements.define("shacl-property",Hs);function cy(i,e){let n=i;const r=e.store.getQuads(i,null,null,null),o=Hi(r,"label",Ks,e.languages);o&&(n=o);let a;if(e.attributes.collapse!==null)a=new kt,a.classList.add("collapsible"),a.open=e.attributes.collapse==="open",a.label=n,a.setAttribute("part","group collapsible");else{a=document.createElement("div");const u=document.createElement("h1");u.innerText=n,u.setAttribute("part","group-title"),a.appendChild(u),a.setAttribute("part","group")}a.dataset.subject=i,a.classList.add("shacl-group");const l=Hi(r,"order");return l&&(a.style.order=l),a}const Tt=[];for(let i=0;i<256;++i)Tt.push((i+256).toString(16).slice(1));function dy(i,e=0){return(Tt[i[e+0]]+Tt[i[e+1]]+Tt[i[e+2]]+Tt[i[e+3]]+"-"+Tt[i[e+4]]+Tt[i[e+5]]+"-"+Tt[i[e+6]]+Tt[i[e+7]]+"-"+Tt[i[e+8]]+Tt[i[e+9]]+"-"+Tt[i[e+10]]+Tt[i[e+11]]+Tt[i[e+12]]+Tt[i[e+13]]+Tt[i[e+14]]+Tt[i[e+15]]).toLowerCase()}let Ya;const hy=new Uint8Array(16);function fy(){if(!Ya){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ya=crypto.getRandomValues.bind(crypto)}return Ya(hy)}const py=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ah={randomUUID:py};function gy(i,e,n){i=i||{};const r=i.random??i.rng?.()??fy();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,dy(r)}function lh(i,e,n){return ah.randomUUID&&!i?ah.randomUUID():gy(i)}class Li extends HTMLElement{constructor(e,n,r,o,a,l=new Set){super(),this.template=e,this.linked=a??!1,this.ancestorShapeIds=l,this.setAttribute("part","node");let u=n;u||(!r&&e.nodeKind&&(r=e.nodeKind),r===void 0&&e.config.attributes.valuesNamespace||r?.value===`${Fe}IRI`?u=Be.namedNode(e.config.attributes.valuesNamespace+lh()):u=Be.blankNode(lh())),this.nodeId=u;const f=JSON.stringify([e.id,n]);if(n&&e.config.renderedNodes.has(f)){o=o||"Link";const h=document.createElement("label");h.innerText=o,h.classList.add("linked"),this.appendChild(h);const g=this.getAttribute("part");this.setAttribute("part",`${g?g+" ":""}linked-node`);const m=document.createElement("a"),d=n.termType==="BlankNode"?"_:"+n.value:n.value;m.innerText=d,m.classList.add("ref-link"),m.onclick=()=>{this.template.config.form.querySelector(`shacl-node[data-node-id='${d}']`)?.scrollIntoView()},this.appendChild(m),this.style.flexDirection="row",this.ready=Promise.resolve()}else{n&&e.config.renderedNodes.add(f);const h=this.ancestorShapeIds,g=this.template.id.value;if(this.dataset.nodeId=this.nodeId.id,this.template.config.attributes.showNodeIds!==null){const m=document.createElement("div");m.innerText=`id: ${this.nodeId.id}`,m.classList.add("node-id-display"),this.appendChild(m)}this.ready=(async()=>{const m=new Set(h);m.add(g);for(const[d,_]of Object.entries(e.properties))for(const v of _)await this.addPropertyInstance(v,n,_.length>1);for(const d of e.extendedShapes){const _=new Li(d,n,void 0,void 0,a,m);this.prepend(_),await _.ready}if(e.or?.length&&await this.tryResolve(e.or,n,e.config),e.xone?.length&&await this.tryResolve(e.xone,n,e.config),o){const d=document.createElement("h1");d.innerText=o,d.setAttribute("part","node-title"),this.prepend(d)}})()}}toRDF(e,n,r=""){if(n||(n=this.nodeId),!this.linked){for(const o of this.querySelectorAll(":scope > shacl-node, :scope > .shacl-group > shacl-node, :scope > shacl-property, :scope > .shacl-group > shacl-property"))o.toRDF(e,n);this.template.targetClass&&e.addQuad(n,At,this.template.targetClass,this.template.config.valuesGraphId),r&&e.addQuad(n,Be.namedNode(r),this.template.id,this.template.config.valuesGraphId)}return n}async addPropertyInstance(e,n,r){let o=null;if(e.group)if(e.config.groups.indexOf(e.group)>-1){let l=this.querySelector(`:scope > .shacl-group[data-subject='${e.group}']`);l||(l=cy(e.group,e.config),this.appendChild(l)),o=l}else console.warn("ignoring unknown group reference",e.group,"existing groups:",e.config.groups);const a=new Hs(e,this);await a.bindValues(n,r),(e.config.editMode||a.instanceCount()>0)&&(o?o.appendChild(a):this.appendChild(a),await a.updateControls())}async tryResolve(e,n,r){let o=!1;if(n){const a=Km(e,n,r);if(a.length){for(const l of a)await this.addPropertyInstance(r.getPropertyTemplate(l,this.template),n);o=!0}}o||this.appendChild(Vf(e,this,r))}}window.customElements.define("shacl-node",Li);const my=`
|
|
423
423
|
.editor:not([type='checkbox']) { border: 1px solid var(--shacl-border-color, #DDD); }
|
|
424
424
|
.property-instance label { display: inline-flex; word-break: break-word; line-height: 1em; padding-top: 0.15em; padding-right: 1em; flex-shrink: 0; position: relative; }
|
|
425
425
|
.property-instance:not(:first-child) > label:not(.persistent) { visibility: hidden; max-height: 0; }
|
|
426
426
|
.mode-edit .property-instance label { width: var(--label-width); }
|
|
427
|
-
`;class
|
|
427
|
+
`;class _y extends e_{constructor(e){super(e||my),this.idCtr=0}createDefaultTemplate(e,n,r,o,a){if(o.id=`e${this.idCtr++}`,o.classList.add("editor"),o.setAttribute("part","editor"),a?.datatype?o.shaclDatatype=a.datatype:n instanceof ln&&(o.shaclDatatype=n.datatype),a&&Ur(a)>0&&(o.dataset.minCount=String(Ur(a))),a?.class&&(o.dataset.class=a.class.value),a?.nodeKind)o.dataset.nodeKind=a.nodeKind.value;else if(n&&(n instanceof vi||a?.nodeKind?.equals(Tf))&&(o.dataset.nodeKind=Fe+"IRI",a)){const h=Zn(a.config.store.getQuads(n,null,null,null),a.config.languages);h&&(o.dataset.value="<"+n.value+">",n=Be.literal(h))}(a?.hasValue&&n||a?.readonly)&&(o.disabled=!0),a?.datatype?.equals(sm)?o.checked=n?.value==="true"||a?.defaultValue?.value==="true":o.value=n?.value||a?.defaultValue?.value||"";const l=document.createElement("label");l.htmlFor=o.id,l.innerText=e,l.setAttribute("part","label"),a?.description&&l.setAttribute("title",a.description.value);const u=a?.description?a.description.value:a?.pattern?a.pattern:null;u&&o.setAttribute("placeholder",u),r&&(o.setAttribute("required","true"),l.classList.add("required"));const f=document.createElement("div");return f.setAttribute("part","field"),f.appendChild(l),f.appendChild(o),f}createDateEditor(e,n,r,o){const a=new dt;o.datatype?.value===Cn+"dateTime"?(a.type="datetime-local",a.setAttribute("step","1")):a.type="date",a.clearable=!0,a.dense=this.dense,a.classList.add("pr-0");const l=this.createDefaultTemplate(e,null,r,a,o);if(n)try{let u=new Date(n.value).toISOString();o.datatype?.value===Cn+"dateTime"?u=u.slice(0,19):u=u.slice(0,10),a.value=u}catch(u){console.error(u,n)}return l}createTextEditor(e,n,r,o){let a;return o.singleLine===!1?(a=new Ei,a.resize="auto"):a=new dt,a.dense=this.dense,o.pattern&&(a.pattern=o.pattern),o.minLength&&(a.minLength=o.minLength),o.maxLength&&(a.maxLength=o.maxLength),this.createDefaultTemplate(e,n,r,a,o)}createLangStringEditor(e,n,r,o){const a=this.createTextEditor(e,n,r,o),l=a.querySelector(":scope .editor");let u;if(o.languageIn?.length){u=document.createElement("select");for(const f of o.languageIn){const h=document.createElement("option");h.innerText=f.value,u.appendChild(h)}}else u=document.createElement("input"),u.maxLength=5,u.size=5,u.placeholder="lang?";return u.title="Language of the text",u.classList.add("lang-chooser"),u.setAttribute("part","lang-chooser"),u.slot="suffix",u.addEventListener("change",f=>{f.stopPropagation(),l&&(l.dataset.lang=u.value,l.dispatchEvent(new Event("change",{bubbles:!0})))}),n instanceof ln&&(u.value=n.language),l.dataset.lang=u.value,l.appendChild(u),a}createBooleanEditor(e,n,r,o){const a=document.createElement("input");a.type="checkbox",a.classList.add("ml-0");const l=this.createDefaultTemplate(e,null,r,a,o);return a.removeAttribute("required"),l.querySelector(":scope label")?.classList.remove("required"),n instanceof ln&&(a.checked=n.value==="true"),l}createFileEditor(e,n,r,o){const a=document.createElement("input");return a.type="file",a.addEventListener("change",l=>{if(a.files?.length){l.stopPropagation();const u=new FileReader;u.readAsDataURL(a.files[0]),u.onload=()=>{a.binaryData=btoa(u.result),a.parentElement?.dispatchEvent(new Event("change",{bubbles:!0}))}}else a.binaryData=void 0}),this.createDefaultTemplate(e,n,r,a,o)}createNumberEditor(e,n,r,o){const a=new dt;a.type="number",a.clearable=!0,a.dense=this.dense,a.classList.add("pr-0");const l=o.minInclusive!==void 0?o.minInclusive:o.minExclusive!==void 0?o.minExclusive+1:void 0,u=o.maxInclusive!==void 0?o.maxInclusive:o.maxExclusive!==void 0?o.maxExclusive-1:void 0;return l!==void 0&&(a.min=String(l)),u!==void 0&&(a.max=String(u)),o.datatype?.value!==Cn+"integer"&&(a.step="0.1"),this.createDefaultTemplate(e,n,r,a,o)}createListEditor(e,n,r,o,a){const l=new ht;l.clearable=!0,l.dense=this.dense;const u=this.createDefaultTemplate(e,null,r,l,a),f=document.createElement("ul");let h=!0;const g=(m,d)=>{const _=document.createElement("li");if(typeof m.value=="string"?(_.dataset.value=m.value,_.innerText=m.label?m.label:m.value):(_.dataset.value=m.value.id,m.value instanceof vi&&(_.dataset.value="<"+_.dataset.value+">"),_.innerText=m.label?m.label:m.value.value),d.appendChild(_),m.children?.length){h=!1;const v=document.createElement("ul");_.appendChild(v);for(const I of m.children)g(I,v)}};for(const m of o)g(m,f);return h||(l.collapse=!0),l.appendChild(f),n&&(l.value=n.id,n instanceof vi&&(l.value="<"+l.value+">")),u}createButton(e,n){const r=new bn;return r.dense=this.dense,r.innerHTML=e,n?(r.setAttribute("primary",""),r.setAttribute("part","button primary")):r.setAttribute("part","button"),r}}function yy(i){return"_:"+i.value}function by(i,e){return[...i].map(n=>e(n)).join(`
|
|
428
428
|
`)+`
|
|
429
|
-
`}function yy(){return""}function mp(i){return"<"+i.value+">"}const by=/["\\\\\n\r]/,vy=/["\\\\\n\r]/g,wy={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function xy(i){return wy[i]}function Ey(i){return by.test(i)?i.replace(vy,xy):i}function Sy(i){const e=Ey(i.value);return i.datatype.value==="http://www.w3.org/2001/XMLSchema#string"?'"'+e+'"':i.datatype.value==="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"?'"'+e+'"@'+i.language:'"'+e+'"^^'+mp(i.datatype)}function Ty(i,e){const n=e(i.subject),r=e(i.predicate),o=e(i.object),a=e(i.graph);return`${n} ${r} ${o} ${a?a+" ":""}.`}function Ly(i){return"?"+i.value}function qt(i){if(!i)return null;if(i.termType==="BlankNode")return my(i);if(i.termType==="DefaultGraph")return yy();if(i.termType==="Literal")return Sy(i);if(i.termType==="NamedNode")return mp(i);if(i.termType==="Quad"||i.subject&&i.predicate&&i.object&&i.graph)return Ty(i,qt);if(i.termType==="Variable")return Ly(i);if(i[Symbol.iterator])return _y(i,qt);throw new Error(`unknown termType ${i.termType}`)}class Ii{constructor(e){if(this.index=new Map,e)for(const[n,r]of e)this.set(n,r)}get size(){return this.index.size}clear(){this.index.clear()}delete(e){return this.index.delete(qt(e))}*entries(){for(const[,{term:e,value:n}]of this.index)yield[e,n]}forEach(e,n){for(const r of this.entries())e.call(n,r[1],r[0],this)}get(e){const n=this.index.get(qt(e));return n&&n.value}has(e){return this.index.has(qt(e))}*keys(){for(const[,{term:e}]of this.index)yield e}set(e,n){const r=qt(e);return this.index.set(r,{term:e,value:n}),this}*values(){for(const[,{value:e}]of this.index)yield e}[Symbol.iterator](){return this.entries()[Symbol.iterator]()}}class uh{constructor({dataset:e,end:n,quad:r,start:o}){this.dataset=e,this.end=n,this.quad=r,this.start=o}get term(){return this.quad[this.end]}get graph(){return this.quad.graph}get startTerm(){return this.quad[this.start]}}function ch(i){try{return qt(i)}catch{return null}}class Jt{constructor(e){if(this.index=new Map,e)for(const n of e)this.add(n)}get size(){return this.index.size}add(e){const n=qt(e);return this.index.has(n)||this.index.set(n,e),this}clear(){this.index.clear()}delete(e){return e?this.index.delete(ch(e)):!1}entries(){return this.values().entries()}forEach(e,n){return this.values().forEach(e,n)}has(e){return e?this.index.has(ch(e)):!1}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}}class _p{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}_p.prototype.termType="BlankNode";class nu{equals(e){return!!e&&e.termType===this.termType}}nu.prototype.termType="DefaultGraph";nu.prototype.value="";function dh(i,e){if(!e)return null;if(e.termType==="BlankNode")return i.blankNode(e.value);if(e.termType==="DefaultGraph")return i.defaultGraph();if(e.termType==="Literal")return i.literal(e.value,e.language||i.namedNode(e.datatype.value));if(e.termType==="NamedNode")return i.namedNode(e.value);if(e.termType==="Quad"){const n=i.fromTerm(e.subject),r=i.fromTerm(e.predicate),o=i.fromTerm(e.object),a=i.fromTerm(e.graph);return i.quad(n,r,o,a)}if(e.termType==="Variable")return i.variable(e.value);throw new Error(`unknown termType ${e.termType}`)}class Ds{constructor(e,n,r,o=""){this.value=e,this.language=n,this.datatype=r,this.direction=o}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)&&(e.direction||"")===this.direction}}Ds.prototype.termType="Literal";class Kr{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}Kr.prototype.termType="NamedNode";class iu{constructor(e,n,r,o){this.subject=e,this.predicate=n,this.object=r,this.graph=o}equals(e){return!!e&&(e.termType==="Quad"||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}}iu.prototype.termType="Quad";iu.prototype.value="";class yp{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}yp.prototype.termType="Variable";const Iy=new Kr("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),hh=new Kr("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),Ay=new Kr("http://www.w3.org/2001/XMLSchema#string");class bp{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new nu}}namedNode(e){return new Kr(e)}blankNode(e){return e=e||"b"+ ++this._data.blankNodeCounter,new _p(e)}literal(e,n){return typeof n=="string"?new Ds(e,n,hh):typeof n?.language=="string"?new Ds(e,n.language,n.direction?Iy:hh,n.direction):new Ds(e,"",n||Ay)}variable(e){return new yp(e)}defaultGraph(){return this._data.defaultGraph}quad(e,n,r,o=this.defaultGraph()){return new iu(e,n,r,o)}fromTerm(e){return dh(this,e)}fromQuad(e){return dh(this,e)}}bp.exports=["blankNode","defaultGraph","fromQuad","fromTerm","literal","namedNode","quad","variable"];const ru=new bp,Ny={apply:(i,e,n)=>i(n[0]),get:(i,e)=>i(e)};function Yt(i,{factory:e=ru}={}){const n=(r="")=>e.namedNode(`${i}${r.raw||r}`);return typeof Proxy>"u"?n:new Proxy(n,Ny)}Yt("http://www.w3.org/2001/XMLSchema#");const _n=Yt("http://www.w3.org/1999/02/22-rdf-syntax-ns#");Yt("http://www.w3.org/2000/01/rdf-schema#");class nt{static add({ptr:e,start:n,end:r,subjects:o=[null],predicates:a=[null],objects:l=[null],graphs:u,callback:f}={}){if(!e.factory)throw new Error("add operation requires a factory");let h=()=>{};f&&(h=g=>{f(new uh({dataset:e.dataset,start:n,end:r,quad:g}))});for(const g of o)for(const _ of a)for(const d of l)for(const m of u){const w={subject:g,predicate:_,object:d,graph:m};w[n]=e.term;const I=e.factory.quad(w.subject,w.predicate,w.object,w.graph);e.dataset.add(I),h(I)}return e}static addList({ptr:e,predicates:n,items:r,graphs:o}){if(e.isAny())throw new Error("can't attach a list to an any ptr");for(const a of n)for(const l of o){const u=r.map(()=>e.factory.blankNode());e.dataset.add(e.factory.quad(e.term,a,u[0]||_n.nil,l));for(let f=0;f<u.length;f++)e.dataset.add(e.factory.quad(u[f],_n.first,r[f],l)),e.dataset.add(e.factory.quad(u[f],_n.rest,u[f+1]||_n.nil,l))}return e}static delete({ptr:e,start:n,subjects:r=[null],predicates:o=[null],objects:a=[null]}){for(const l of r)for(const u of o)for(const f of a){const h={subject:l,predicate:u,object:f};h[n]=e.term;const g=e.dataset.match(h.subject,h.predicate,h.object);for(const _ of g)e.dataset.delete(_)}return e}static deleteList({ptr:e,predicates:n}){const r=[];for(const o of n)for(const a of e.dataset.match(e.term,o)){let l=a.object;for(r.push(a);!_n.nil.equals(l);){l=r[r.length-1].object;const u=e.dataset.match(l);if(u.size===0)break;for(const f of u)r.push(f)}}for(const o of r)e.dataset.delete(o);return e}static execute({ptr:e,operation:n="traverse",quantifier:r,start:o,end:a,subjects:l,predicates:u,objects:f,graphs:h,items:g,callback:_}={}){if(n==="add")return nt.add({ptr:e,start:o,end:a,subjects:l,predicates:u,objects:f,graphs:h,callback:_});if(n==="addList")return nt.addList({ptr:e,predicates:u,items:g,graphs:h});if(n==="delete")return nt.delete({ptr:e,start:o,subjects:l,predicates:u,objects:f});if(n==="deleteList")return nt.deleteList({ptr:e,predicates:u});if(n==="isList")return nt.isList({ptr:e});if(n==="list")return nt.list({ptr:e});if(n==="traverse")return nt.traverse({ptr:e,quantifier:r,start:o,end:a,subjects:l,predicates:u,objects:f,graphs:h});throw new Error(`unknown operation ${n}`)}static isList({ptr:e}){return e.isAny()?!1:!!(_n.nil.equals(e.term)||nt.traverse({ptr:e,predicates:[_n.first]}).length===1)}static list({ptr:e}){if(e.isList())return{*[Symbol.iterator](){for(;e&&!e.term.equals(_n.nil);){const n=e.out([_n.first]);if(n.length!==1)throw new Error(`Invalid list: rdf:first count not equals one on ${e.value}`);const r=e.out([_n.rest]);if(r.length!==1)throw new Error(`Invalid list: rdf:rest count not equals one on ${e.value}`);yield n[0],e=r[0]}}}}static traverse({ptr:e,quantifier:n="one",start:r="subject",end:o="object",subjects:a=[null],predicates:l=[null],objects:u=[null],graphs:f=[null],callback:h}){if(n==="one")return nt.traverseOne({ptr:e,start:r,end:o,subjects:a,predicates:l,objects:u,graphs:f,callback:h});if(n==="oneOrMore"){const g=nt.traverse({ptr:e,end:o,start:r,subjects:a,predicates:l,objects:u,graphs:f,callback:h});return nt.traverseMore({ptrs:g,end:o,start:r,subjects:a,predicates:l,objects:u,graphs:f,callback:h})}if(n==="zeroOrMore")return nt.traverseMore({ptrs:[e],end:o,start:r,subjects:a,predicates:l,objects:u,graphs:f,callback:h});if(n==="zeroOrOne")return[e,...nt.traverse({ptr:e,end:o,start:r,subjects:a,predicates:l,objects:u,graphs:f,callback:h})];throw new Error(`unknown quantifier ${n}`)}static traverseMore({ptrs:e,end:n,start:r,subjects:o,predicates:a,objects:l,graphs:u,callback:f}={}){let h=[...e],g,_;do{g=[];for(const d of e)g=[...g,...nt.traverseOne({ptr:d,end:n,start:r,subjects:o,predicates:a,objects:l,graphs:u,callback:f})];_&&(g=g.filter(d=>!_.has(d.term))),e=g,h=[...h,...g],_=new Jt(h.map(d=>d.term))}while(g.length>0);return h}static traverseOne({ptr:e,start:n,end:r,subjects:o,predicates:a,objects:l,graphs:u,callback:f=(h,g)=>g.extend(h)}={}){const h=[];for(const g of o)for(const _ of a)for(const d of l)for(const m of u){const w={subject:g,predicate:_,object:d,graph:m};w[n]=e.term;for(const I of e.dataset.match(w.subject,w.predicate,w.object,w.graph))h.push(f(new uh({dataset:e.dataset,end:r,quad:I,start:n}),e))}return h}}function fh(i,e){return e?n=>e(i.extend(n)):()=>{}}class ph{constructor({dataset:e,edges:n=[],factory:r,graph:o,term:a}){if(!e&&n.length===0)throw new Error("dataset or edges is required");if(n.length===0&&typeof a>"u")throw new Error("edges or term must be given");if(n.length>0&&a)throw new Error("edges or term must be given");this.dataset=e||n[n.length-1].dataset,this.edges=n,this.factory=r,this._graph=o,n.length===0&&(this._term=a)}get edge(){return this.edges[this.edges.length-1]}get graph(){return typeof this._graph=="object"?this._graph:this.edge&&this.edge.graph}get length(){return this._term!==void 0?1:this.edges.length+1}get startTerm(){return this._term||this.edges[0].startTerm}get term(){return this._term!==void 0?this._term:this.edge.term}get value(){const e=this.term;return e===null?void 0:e.value}addIn(e,n,r){return nt.add({ptr:this,start:"object",end:"subject",subjects:n,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],callback:fh(this,r)})}addList(e,n){return nt.addList({ptr:this,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],items:n})}addOut(e,n,r){return nt.add({ptr:this,start:"subject",end:"object",predicates:e,objects:n,graphs:[this.graph||this.factory.defaultGraph()],callback:fh(this,r)})}deleteIn(e,n){return nt.delete({ptr:this,start:"object",subjects:n,predicates:e})}deleteList(e){return nt.deleteList({ptr:this,predicates:e})}deleteOut(e,n){return nt.delete({ptr:this,start:"subject",predicates:e,objects:n})}execute({operation:e,quantifier:n,start:r,end:o,subjects:a,predicates:l,objects:u,graphs:f,items:h,callback:g}){return nt.execute({ptr:this,operation:e,quantifier:n,start:r,end:o,subjects:a,predicates:l,objects:u,graphs:f,items:h,callback:g})}extend(e){return new this.constructor({dataset:this.dataset,edges:[...this.edges,e],factory:this.factory,graph:this._graph})}hasIn(e,n){return nt.traverse({ptr:this,start:"object",end:"object",subjects:n,predicates:e,graphs:[this.graph]})}hasOut(e,n){return nt.traverse({ptr:this,start:"subject",end:"subject",predicates:e,objects:n,graphs:[this.graph]})}in(e,n){return nt.traverse({ptr:this,start:"object",end:"subject",subjects:n,predicates:e,graphs:[this.graph]})}isAny(){return!this.term}isList(){return nt.isList({ptr:this})}list(){return nt.list({ptr:this})}*nodes(){for(let e=0;e<this.length;e++)this._term!==void 0?yield{dataset:this.dataset,term:this._term}:this.edges.length>e?yield{dataset:this.edges[e].dataset,term:this.edges[e].startTerm}:this.edges.length===e&&(yield{dataset:this.edges[e-1].dataset,term:this.edges[e-1].term})}out(e,n){return nt.traverse({ptr:this,predicates:e,objects:n,graphs:[this.graph]})}*quads(){for(const{quad:e}of this.edges)yield e}trim(){return new this.constructor({dataset:this.dataset,factory:this.factory,graph:this.graph,term:this.term})}}function gh(i,e){return i?i.equals(e):i===e}function Ry(i,e){return!(i.dataset!==e.dataset||!gh(i.graph,e.graph)||!gh(i.term,e.term))}function mh(i,e){return e?n=>e(new i.constructor({factory:i.factory,ptrs:[n]})):()=>{}}class Us{constructor({dataset:e,factory:n,ptrs:r,terms:o,graphs:a}){if(this.factory=n,r)this.ptrs=[...r];else{this.ptrs=[];for(const l of o||[null])for(const u of a||[null])this.ptrs.push(new ph({dataset:e,factory:n,graph:u,term:l}))}}get dataset(){const e=new Set(this.datasets);return e.size!==1?null:e[Symbol.iterator]().next().value}get datasets(){return this.ptrs.map(e=>e.dataset)}get term(){const e=new Jt(this.terms);if(e.size===1)return e[Symbol.iterator]().next().value}get terms(){return this.ptrs.map(e=>e.term)}get value(){const e=this.term;return e?.value}get values(){return this.ptrs.map(e=>e.value)}addIn(e,n,r){const o=mh(this,r);for(const a of this.ptrs)a.addIn(e,n,o);return this}addList(e,n){if(this.isAny())throw new Error("can't attach a list to an any ptr");for(const r of this.ptrs)r.addList(e,n);return this}addOut(e,n,r){const o=mh(this,r);for(const a of this.ptrs)a.addOut(e,n,o);return this}clone(e){return new this.constructor({factory:this.factory,ptrs:this.ptrs,...e})}deleteIn(e,n){for(const r of this.ptrs)r.deleteIn(e,n);return this}deleteList(e){for(const n of this.ptrs)n.deleteList(e);return this}deleteOut(e,n){for(const r of this.ptrs)r.deleteOut(e,n);return this}distinct(){const e=this.ptrs.reduce((n,r)=>(n.some(o=>Ry(o,r))||n.push(r.trim()),n),[]);return this.clone({ptrs:e})}execute(e){return this.clone({ptrs:this.ptrs.flatMap(n=>n.execute(e))})}executeAll(e){let n=this;for(const r of e)n=n.execute(r);return n}filter(e){return this.clone({ptrs:[...this].filter(e).map(n=>n.ptrs[0])})}hasIn(e,n){return this.clone({ptrs:this.ptrs.flatMap(r=>r.hasIn(e,n))})}hasOut(e,n){return this.clone({ptrs:this.ptrs.flatMap(r=>r.hasOut(e,n))})}in(e,n){return this.clone({ptrs:this.ptrs.flatMap(r=>r.in(e,n))})}isAny(){return this.ptrs.length>0&&this.ptrs.some(e=>e.isAny())}isList(){return this.ptrs.length!==1?!1:this.ptrs[0].isList()}list(){if(!this.isList())return;const e=this.ptrs[0].list(),n=this;return(function*(){for(const r of e)yield n.clone({ptrs:[r]})})()}map(e){return[...this].map(e)}node(e){const n=this.dataset,r=[...e].map(o=>new ph({dataset:n,factory:this.factory,term:o}));return this.clone({ptrs:r})}out(e,n){return this.clone({ptrs:this.ptrs.flatMap(r=>r.out(e,n))})}*quads(){for(const{edges:e}of this.ptrs)for(const{quad:n}of e)yield n}trim(){return this.clone({ptrs:this.ptrs.map(e=>e.trim())})}*[Symbol.iterator](){for(const e of this.ptrs)yield this.clone({ptrs:[e]})}}Yt("http://www.w3.org/2002/07/owl#");const Si=Yt("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),Cy=Yt("http://www.w3.org/2000/01/rdf-schema#"),ge=Yt("http://www.w3.org/ns/shacl#"),Al=Yt("https://schemas.link/shacl-next#"),su=Yt("http://www.w3.org/2001/XMLSchema#");function Py(i){return i?`{${[...i.quads()].map(e=>qt(e)).join(" ")}}`:"{}"}function ky(i){return i?`{${i.map(e=>Py(e)).join(" ")}}`:"{}"}var el,_h;function Dy(){if(_h)return el;_h=1;var i=/\s/;function e(n){for(var r=n.length;r--&&i.test(n.charAt(r)););return r}return el=e,el}var tl,yh;function My(){if(yh)return tl;yh=1;var i=Dy(),e=/^\s+/;function n(r){return r&&r.slice(0,i(r)+1).replace(e,"")}return tl=n,tl}var nl,bh;function Oy(){if(bh)return nl;bh=1;function i(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return nl=i,nl}var il,vh;function Fy(){if(vh)return il;vh=1;var i=typeof qi=="object"&&qi&&qi.Object===Object&&qi;return il=i,il}var rl,wh;function jy(){if(wh)return rl;wh=1;var i=Fy(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=i||e||Function("return this")();return rl=n,rl}var sl,xh;function vp(){if(xh)return sl;xh=1;var i=jy(),e=i.Symbol;return sl=e,sl}var ol,Eh;function By(){if(Eh)return ol;Eh=1;var i=vp(),e=Object.prototype,n=e.hasOwnProperty,r=e.toString,o=i?i.toStringTag:void 0;function a(l){var u=n.call(l,o),f=l[o];try{l[o]=void 0;var h=!0}catch{}var g=r.call(l);return h&&(u?l[o]=f:delete l[o]),g}return ol=a,ol}var al,Sh;function $y(){if(Sh)return al;Sh=1;var i=Object.prototype,e=i.toString;function n(r){return e.call(r)}return al=n,al}var ll,Th;function qy(){if(Th)return ll;Th=1;var i=vp(),e=By(),n=$y(),r="[object Null]",o="[object Undefined]",a=i?i.toStringTag:void 0;function l(u){return u==null?u===void 0?o:r:a&&a in Object(u)?e(u):n(u)}return ll=l,ll}var ul,Lh;function zy(){if(Lh)return ul;Lh=1;function i(e){return e!=null&&typeof e=="object"}return ul=i,ul}var cl,Ih;function Hy(){if(Ih)return cl;Ih=1;var i=qy(),e=zy(),n="[object Symbol]";function r(o){return typeof o=="symbol"||e(o)&&i(o)==n}return cl=r,cl}var dl,Ah;function Uy(){if(Ah)return dl;Ah=1;var i=My(),e=Oy(),n=Hy(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;function f(h){if(typeof h=="number")return h;if(n(h))return r;if(e(h)){var g=typeof h.valueOf=="function"?h.valueOf():h;h=e(g)?g+"":g}if(typeof h!="string")return h===0?h:+h;h=i(h);var _=a.test(h);return _||l.test(h)?u(h.slice(2),_?2:8):o.test(h)?r:+h}return dl=f,dl}var hl,Nh;function Vy(){if(Nh)return hl;Nh=1;var i=Uy(),e=1/0,n=17976931348623157e292;function r(o){if(!o)return o===0?o:0;if(o=i(o),o===e||o===-e){var a=o<0?-1:1;return a*n}return o===o?o:0}return hl=r,hl}var fl,Rh;function Wy(){if(Rh)return fl;Rh=1;var i=Vy();function e(n){var r=i(n),o=r%1;return r===r?o?r-o:r:0}return fl=e,fl}var pl,Ch;function Gy(){if(Ch)return pl;Ch=1;var i=Wy(),e="Expected a function";function n(r,o){var a;if(typeof o!="function")throw new TypeError(e);return r=i(r),function(){return--r>0&&(a=o.apply(this,arguments)),r<=1&&(o=void 0),a}}return pl=n,pl}var gl,Ph;function Zy(){if(Ph)return gl;Ph=1;var i=Gy();function e(n){return i(2,n)}return gl=e,gl}var Xy=Zy();const on=rf(Xy);let kh=class{constructor({details:e,factory:n,options:r,results:o=[]}={}){this.details=e,this.factory=n,this.options=r,this.results=o,this._conforms=on(()=>!this.results.some(a=>a.severity.equals(ge.Info)||a.severity.equals(ge.Violation)||a.severity.equals(ge.Warning))),this._ptr=on(()=>this.build())}get conforms(){return this._conforms()}get dataset(){return this.ptr.dataset}get ptr(){return this._ptr()}get term(){return this.ptr.term}build(){const e=new Us({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});e.addOut([Si.type],[ge.ValidationReport]).addOut([ge.conforms],[this.factory.literal(this.conforms.toString(),su.boolean)]);for(const n of this.results)e.addOut([ge.result],[this.factory.blankNode()],r=>{n.build(r,this.options)});return e}coverage(){return this.results.flatMap(e=>e.coverage())}};function Qy(i,e){return Object.entries(e).reduce((n,[r,o])=>(o&&o.termType&&(o=qt(o)),n.replace(`{$${r}}`,o).replace(`{?${r}}`,o)),i)}let Jy=class{constructor({args:e={},constraintComponent:n,factory:r,focusNode:o,message:a=[],path:l,results:u=[],severity:f,shape:h,source:g=[],value:_,valuePaths:d=[]}={}){this.args=e,this.constraintComponent=n,this.factory=r,this.focusNode=o,this.path=l||h.path,this.results=u,this.severity=f,this.shape=h,this.source=g,this.value=_,this.valuePaths=d,this._message=on(()=>(this.shape.message.length>0&&(a=this.shape.message),a.length===0&&(a=this.shape.ptr.node([this.constraintComponent]).out([ge.message]).terms),a.map(m=>r.literal(Qy(m.value,e),m.language||null))))}get message(){return this._message()}build(e,{details:n}={}){e.addOut([Si.type],[ge.ValidationResult]).addOut([ge.focusNode],this.focusNode.terms).addOut([ge.resultSeverity],[this.severity]).addOut([ge.sourceConstraint],this.source).addOut([ge.sourceConstraintComponent],[this.constraintComponent]).addOut([ge.sourceShape],this.shape.ptr.terms),this.message&&e.addOut([ge.resultMessage],this.message);const r=o=>{if(o.quantifier==="one")return o.predicates.length>1?e.node([this.factory.blankNode()]).addList([ge.alternativePath],o.predicates):o.start==="object"?e.node([this.factory.blankNode()]).addOut([ge.inversePath],[o.predicates[0]]):e.node([o.predicates[0]]);if(o.quantifier==="oneOrMore")return e.node([this.factory.blankNode()]).addOut([ge.oneOrMorePath],[o.predicates[0]]);if(o.quantifier==="zeroOrMore")return e.node([this.factory.blankNode()]).addOut([ge.zeroOrMorePath],[o.predicates[0]]);if(o.quantifier==="zeroOrOne")return e.node([this.factory.blankNode()]).addOut([ge.zeroOrOnePath],[o.predicates[0]])};if(this.path&&(this.path.length===1?e.addOut([ge.resultPath],r(this.path[0]).terms):e.addList([ge.resultPath],this.path.map(o=>r(o).term))),typeof this.value<"u"&&e.addOut([ge.value],this.value.terms),n)for(const o of this.results)e.addOut([ge.detail],[this.factory.blankNode()],a=>{o.build(a,{details:n})})}coverage(){return[...this.valuePaths.flatMap(e=>[...e.quads()]),...this.results.flatMap(e=>e.coverage())]}};class ou{constructor({factory:e,focusNode:n,options:r={debug:!1,details:!1},processed:o=new Set,report:a=new kh({factory:e,options:r}),results:l=new Map,shape:u,value:f,valueOrNode:h,valuePaths:g,values:_}={}){this.factory=e,this.focusNode=n,this.options=r,this.processed=o,this.report=a,this.results=l,this.shape=u,this.value=f,this.valuePaths=g,this.valueOrNode=h,this.values=_}create({child:e,focusNode:n=this.focusNode,shape:r=this.shape,value:o=this.value,valueOrNode:a=this.valueOrNode,valuePaths:l=this.valuePaths,values:u=this.values}={}){return new ou({factory:this.factory,focusNode:n,options:this.options,processed:this.processed,report:e?new kh({factory:this.factory,options:this.options}):this.report,results:this.results,shape:r,value:o,valueOrNode:a,valuePaths:l,values:u})}id({shape:e=this.shape}={}){return`${qt(e.ptr.term)} - ${qt(this.focusNode.term)} - ${ky(this.valuePaths)}`}result(e){const n=new Jy({factory:this.factory,focusNode:this.focusNode,shape:this.shape,value:this.value,valuePaths:this.valuePaths,...e}),r=this.id();this.results.has(r)?this.results.get(r).add(n):this.results.set(r,new Set([n])),this.report.results.push(n)}debug(e,n){this.options.debug&&this.result({severity:Al.Debug,constraintComponent:e,...n})}trace(e,n){this.options.trace&&this.result({severity:Al.Trace,constraintComponent:e,...n})}test(e,n,r){e?this.debug(n,r):this.violation(n,r)}violation(e,n){this.result({constraintComponent:e,severity:this.shape.severity||ge.Violation,...n})}}function Ky(){return{generic:Yy()}}function Yy(){return i=>{i.trace(Al.TraversalConstraintComponent,{args:{},message:[i.factory.literal("Traversal")],value:i.valueOrNode})}}class eb{constructor(e){this.validations=new Ii(e)}compile(e){const n=e.validator.options.coverage;if(e.deactivated)return[];let r=!1;const o=new Set;for(const a of e.ptr.execute({start:"subject",end:"predicate"})){const l=this.validations.get(a.term);l&&(o.add(l),a.term.equals(ge.property)&&(r=!0))}return n&&e.isPropertyShape&&!r&&o.add(Ky),[...o].map(a=>a(e)).filter(Boolean)}}var gi={},mi={},Nr={},Rr={},Dh;function Xi(){if(Dh)return Rr;Dh=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.Translator=void 0;let i=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(n){throw new Error(`Invalid RDF ${n.datatype.value} value: '${n.value}'`)}registerHandler(n,r,o){for(const a of r)this.supportedRdfDatatypes.push(a),this.fromRdfHandlers[a.value]=n;for(const a of o){let l=this.toRdfHandlers[a];l||(this.toRdfHandlers[a]=l=[]),l.push(n)}}fromRdf(n,r){const o=this.fromRdfHandlers[n.datatype.value];return o?o.fromRdf(n,r):n.value}toRdf(n,r){const o=this.toRdfHandlers[typeof n];if(o)for(const a of o){const l=a.toRdf(n,r);if(l)return l}throw new Error(`Invalid JavaScript value: '${n}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}};return Rr.Translator=i,Rr}var Mh;function tb(){if(Mh)return Nr;Mh=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.TypeHandlerBoolean=void 0;const i=Xi();let e=class wp{fromRdf(r,o){switch(r.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return o&&i.Translator.incorrectRdfDataType(r),!1}toRdf(r,{datatype:o,dataFactory:a}){return a.literal(r?"true":"false",o||a.namedNode(wp.TYPE))}};return Nr.TypeHandlerBoolean=e,e.TYPE="http://www.w3.org/2001/XMLSchema#boolean",Nr}var Cr={},Oh;function nb(){if(Oh)return Cr;Oh=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.TypeHandlerDate=void 0;const i=Xi();let e=class Nl{fromRdf(r,o){switch(o&&!r.value.match(Nl.VALIDATORS[r.datatype.value.substr(33,r.datatype.value.length)])&&i.Translator.incorrectRdfDataType(r),r.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(r.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const a=r.value.split("-");return new Date(0,parseInt(a[0],10)-1,parseInt(a[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(r.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(r.value+"-01");default:return new Date(r.value)}}toRdf(r,{datatype:o,dataFactory:a}){if(o=o||a.namedNode(Nl.TYPES[0]),!(r instanceof Date))return null;const l=r;let u;switch(o.value){case"http://www.w3.org/2001/XMLSchema#gDay":u=String(l.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":u=l.getUTCMonth()+1+"-"+l.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":u=String(l.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":u=l.getUTCFullYear()+"-"+(l.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":u=l.toISOString().replace(/T.*$/,"");break;default:u=l.toISOString()}return a.literal(u,o)}};return Cr.TypeHandlerDate=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],e.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/},Cr}var Pr={},Fh;function ib(){if(Fh)return Pr;Fh=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.TypeHandlerNumberDouble=void 0;const i=Xi();let e=class xp{fromRdf(r,o){const a=parseFloat(r.value);return o&&isNaN(a)&&i.Translator.incorrectRdfDataType(r),a}toRdf(r,{datatype:o,dataFactory:a}){return o=o||a.namedNode(xp.TYPES[0]),isNaN(r)?a.literal("NaN",o):isFinite(r)?r%1===0?null:a.literal(r.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),o):a.literal(r>0?"INF":"-INF",o)}};return Pr.TypeHandlerNumberDouble=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"],Pr}var kr={},jh;function rb(){if(jh)return kr;jh=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.TypeHandlerNumberInteger=void 0;const i=Xi();let e=class jr{fromRdf(r,o){const a=parseInt(r.value,10);return o&&(isNaN(a)||r.value.indexOf(".")>=0)&&i.Translator.incorrectRdfDataType(r),a}toRdf(r,{datatype:o,dataFactory:a}){return a.literal(String(r),o||(r<=jr.MAX_INT&&r>=jr.MIN_INT?a.namedNode(jr.TYPES[0]):a.namedNode(jr.TYPES[1])))}};return kr.TypeHandlerNumberInteger=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],e.MAX_INT=2147483647,e.MIN_INT=-2147483648,kr}var Dr={},Bh;function sb(){if(Bh)return Dr;Bh=1,Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.TypeHandlerString=void 0;let i=class{fromRdf(n){return n.value}toRdf(n,{datatype:r,dataFactory:o}){return o.literal(n,r)}};return Dr.TypeHandlerString=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"],Dr}var $h;function qh(){return $h||($h=1,(function(i){var e=mi&&mi.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,l,u)}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),n=mi&&mi.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(i,"__esModule",{value:!0}),n(tb(),i),n(nb(),i),n(ib(),i),n(rb(),i),n(sb(),i)})(mi)),mi}var ml={},zh;function ob(){return zh||(zh=1,Object.defineProperty(ml,"__esModule",{value:!0})),ml}var Hh;function ab(){return Hh||(Hh=1,(function(i){var e=gi&&gi.__createBinding||(Object.create?(function(m,w,I,A){A===void 0&&(A=I);var N=Object.getOwnPropertyDescriptor(w,I);(!N||("get"in N?!w.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return w[I]}}),Object.defineProperty(m,A,N)}):(function(m,w,I,A){A===void 0&&(A=I),m[A]=w[I]})),n=gi&&gi.__exportStar||function(m,w){for(var I in m)I!=="default"&&!Object.prototype.hasOwnProperty.call(w,I)&&e(w,m,I)};Object.defineProperty(i,"__esModule",{value:!0}),i.fromRdf=f,i.toRdf=h,i.getTermRaw=g,i.getSupportedRdfDatatypes=_,i.getSupportedJavaScriptPrimitives=d;const r=Df(),o=qh(),a=Xi();n(qh(),i),n(ob(),i),n(Xi(),i);const l=new r.DataFactory,u=new a.Translator;u.registerHandler(new o.TypeHandlerString,o.TypeHandlerString.TYPES.map(m=>l.namedNode(m)),["string"]),u.registerHandler(new o.TypeHandlerBoolean,[o.TypeHandlerBoolean.TYPE].map(m=>l.namedNode(m)),["boolean"]),u.registerHandler(new o.TypeHandlerNumberDouble,o.TypeHandlerNumberDouble.TYPES.map(m=>l.namedNode(m)),["number"]),u.registerHandler(new o.TypeHandlerNumberInteger,o.TypeHandlerNumberInteger.TYPES.map(m=>l.namedNode(m)),["number"]),u.registerHandler(new o.TypeHandlerDate,o.TypeHandlerDate.TYPES.map(m=>l.namedNode(m)),["object"]);function f(m,w){return u.fromRdf(m,w)}function h(m,w){return w&&"namedNode"in w&&(w={dataFactory:w}),w=w||{},w&&!w.dataFactory&&(w.dataFactory=l),u.toRdf(m,w)}function g(m,w){return m.termType==="Literal"?f(m,w):m.value}function _(){return u.getSupportedRdfDatatypes()}function d(){return u.getSupportedJavaScriptPrimitives()}})(gi)),gi}var Zr=ab();function Uh(i){if(i.term.termType!=="BlankNode")return{quantifier:"one",start:"subject",end:"object",predicates:[i.term]};const e=i.out([ge.alternativePath]);if(e.ptrs.length===1&&e.ptrs[0].isList())return{quantifier:"one",start:"subject",end:"object",predicates:[...e.list()].map(l=>l.term)};const n=i.out([ge.inversePath]);if(n.term)return{quantifier:"one",start:"object",end:"subject",predicates:[n.term]};const r=i.out([ge.oneOrMorePath]);if(r.term)return{quantifier:"oneOrMore",start:"subject",end:"object",predicates:[r.term]};const o=i.out([ge.zeroOrMorePath]);if(o.term)return{quantifier:"zeroOrMore",start:"subject",end:"object",predicates:[o.term]};const a=i.out([ge.zeroOrOnePath]);if(a.term)return{quantifier:"zeroOrOne",start:"subject",end:"object",predicates:[a.term]}}function lb(i){return i.terms.length===0?null:i.ptrs[0].isList()?[...i.list()].map(e=>Uh(e)):[Uh(i)]}class ub{constructor(e){this.shape=e,this._compiled=on(()=>this.shape.validator.registry.compile(e))}get compiled(){return this._compiled()}async validate(e){return e.focusNode.dataset.size===0||(this.shape.isPropertyShape?await this.validateProperty(e):await this.validateNode(e)),e}async validateNode(e){const n=e.create({shape:this.shape,valueOrNode:e.value||e.focusNode});for(const r of this.compiled)r.node&&await r.node(n),r.generic&&await r.generic(n)}async validateProperty(e){let n;this.shape.isSparqlShape?n=e.focusNode:n=e.focusNode.executeAll(this.shape.path);const r=n.node(new Jt(n.terms)),o=[...n].reduce((l,u)=>{const f=u.term,h=n.node([f]);return l.has(f)||l.set(f,{value:h,valuePaths:[]}),l.get(f).valuePaths.push(u),l},new Ii).values(),a=e.create({shape:this.shape,values:r});for(const l of this.compiled)l.property&&await l.property(a);for(const{value:l,valuePaths:u}of o){const f=e.create({shape:this.shape,value:l,valueOrNode:l,valuePaths:u});for(const h of this.compiled)h.generic&&await h.generic(f)}}}function Rl(i){const e=new Jt,r=new Us({dataset:i.dataset,terms:i.terms}).execute({quantifier:"zeroOrMore",start:"object",end:"subject",predicates:[Cy.subClassOf]});for(const o of r.ptrs)for(const{term:a}of o.nodes())e.add(a);return e}class cb{constructor(e,{registry:n}){this.registry=n,this.targetClass=new Jt([...Rl(e.hasOut([Si.type],[ge.NodeShape])),...Rl(e.out([ge.targetClass]))]),this.targetNode=e.out([ge.targetNode]).terms,this.targetObjectsOf=e.out([ge.targetObjectsOf]).terms,this.targetSubjectsOf=e.out([ge.targetSubjectsOf]).terms,this.targets=[...e.out([ge.target])]}async resolve(e){const n=e.focusNode.node([null]),r=[...e.focusNode.hasOut([Si.type],this.targetClass).ptrs,...e.focusNode.node(this.targetNode).ptrs,...n.execute({start:"object",end:"object",predicates:this.targetObjectsOf}).ptrs,...n.execute({start:"subject",end:"subject",predicates:this.targetSubjectsOf}).ptrs];for(const a of this.targets)for(const[,l]of this.registry.targetResolvers){const u=await l(a,e);r.push(...e.focusNode.node(u).ptrs)}const o=e.focusNode.clone({ptrs:r});return o.node([...new Jt(o.terms)])}}class db{constructor(e,{validator:n}){this.ptr=e,this.validator=n,this._deactivated=on(()=>{const r=this.ptr.out([ge.deactivated]).term;return r&&Zr.fromRdf(r)}),this._message=on(()=>this.ptr.out([ge.message]).terms),this._path=on(()=>lb(this.ptr.out([ge.path]))),this._severity=on(()=>this.ptr.out([ge.severity]).term),this._shapeValidator=on(()=>new ub(this)),this._sparql=on(()=>this.ptr.out([ge.sparql])),this._targetResolver=on(()=>new cb(this.ptr,{registry:this.validator.targetResolverRegistry}))}get deactivated(){return this._deactivated()}get isPropertyShape(){return!!this.path}get isSparqlShape(){return this.sparql.terms.length>0}get path(){return this._path()}get targetResolver(){return this._targetResolver()}get message(){return this._message()}get severity(){return this._severity()}get shapeValidator(){return this._shapeValidator()}get sparql(){return this._sparql()}async resolveTargets(e){return this.targetResolver.resolve(e)}async validate(e){const n=e.id({shape:this});if(e.processed.has(n)){if(e.results.has(n))for(const r of e.results.get(n))e.report.results.push(r);return e}return e.processed.add(n),this.shapeValidator.validate(e)}}class hb{constructor(e){this.targetResolvers=new Ii(e)}}function fb(i){const e=parseInt(i.ptr.out([ge.maxCount]).value);return{property:pb(e)}}function pb(i){return e=>{e.test(e.values.terms.length<=i,ge.MaxCountConstraintComponent,{args:{maxCount:i},message:[e.factory.literal("More than {$maxCount} values")]})}}function gb(i){const e=parseInt(i.ptr.out([ge.minCount]).value);return{property:mb(e)}}function mb(i){return e=>{e.test(e.values.terms.length>=i,ge.MinCountConstraintComponent,{args:{minCount:i},message:[e.factory.literal("Less than {$minCount} values")]})}}async function _b(i,e){for(const n of i)if(!await e(n))return!1;return!0}async function yb(i,e){return(await Promise.all(i.map(n=>e(n)))).filter(Boolean)}async function so(i,e){return Promise.all(i.map(e))}async function bb(i,e){for(const n of i)if(await e(n))return!0;return!1}function vb(i){const e=[...i.ptr.out([ge.and])].flatMap(n=>[...n.list()]).map(n=>i.validator.shape(n));return{generic:wb(e)}}function wb(i){return async e=>{const n=await so(i,async o=>(await o.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report),r=n.every(o=>o.conforms);e.test(r,ge.AndConstraintComponent,{results:n.flatMap(o=>o.results),value:e.valueOrNode})}}function xb(i){const e=i.validator.shape(i.ptr.out([ge.not]));return{generic:Eb(e)}}function Eb(i){return async e=>{const n=(await i.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report,r=!n.conforms;e.test(r,ge.NotConstraintComponent,{args:{not:i.ptr.term},message:[e.factory.literal("Value does have shape {$not}")],results:n.results,value:e.valueOrNode})}}function Sb(i){const e=[...i.ptr.out([ge.or])].flatMap(n=>[...n.list()]).map(n=>i.validator.shape(n));return{generic:Tb(e)}}function Tb(i){return async e=>{let n=[],r;if(e.options.debug||e.options.details){const o=await so(i,async a=>(await a.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report);n=o.flatMap(a=>a.results),r=o.some(a=>a.conforms)}else r=await bb(i,async o=>(await o.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report.conforms);e.test(r,ge.OrConstraintComponent,{results:n,value:e.valueOrNode})}}function Lb(i){const e=[...i.ptr.out([ge.xone])].flatMap(n=>[...n.list()]).map(n=>i.validator.shape(n));return{generic:Ib(e)}}function Ib(i){return async e=>{const n=await so(i,async o=>(await o.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report),r=n.filter(o=>o.conforms).length===1;e.test(r,ge.XoneConstraintComponent,{results:n.flatMap(o=>o.results),value:e.valueOrNode})}}function Ab(i){if(!Zr.fromRdf(i.ptr.out([ge.closed]).term))return null;const n=i.ptr.out([ge.property]).map(a=>i.validator.shape(a)),r=new Jt(n.filter(a=>!a.deactivated).map(a=>a.path[0].predicates[0])),o=new Jt([...i.ptr.out([ge.ignoredProperties]).list()||[]].map(a=>a.term));return{node:Nb(r,o)}}function Nb(i,e){return n=>{const r=n.focusNode.execute({start:"subject",end:"predicate"}).filter(o=>e.has(o.term)?!1:!i.has(o.term));if(r.ptrs.length>0)for(const o of r)n.violation(ge.ClosedConstraintComponent,{message:[n.factory.literal("Predicate is not allowed (closed shape)")],path:[{quantifier:"one",start:"subject",end:"object",predicates:[o.term]}],value:n.focusNode.node([[...o.quads()][0].object])});else n.debug(ge.ClosedConstraintComponent)}}function Rb(i){const e=i.ptr.out([ge.hasValue]).term;return{node:Cb(e),property:Pb(e)}}function Cb(i){return e=>{e.test(i.equals(e.valueOrNode.term),ge.HasValueConstraintComponent,{args:{hasValue:i},message:[e.factory.literal("Value must be {$hasValue}")]})}}function Pb(i){return e=>{const n=[...e.values].some(r=>i.equals(r.term));e.test(n,ge.HasValueConstraintComponent,{args:{hasValue:i},message:[e.factory.literal("Missing expected value {$hasValue}")]})}}function kb(i){const e=new Jt([...i.ptr.out([ge.in]).list()].map(n=>n.term));return{generic:Db(e)}}function Db(i){return e=>{e.test(i.has(e.valueOrNode.term),ge.InConstraintComponent,{args:{in:[...i].map(n=>n.value).join(", ")},message:[e.factory.literal("Value is not in {$in}")],value:e.valueOrNode})}}function Yi(i,e){if(!i||i.termType!=="Literal"||!e||e.termType!=="Literal"||Vh(i)!==Vh(e))return null;const n=Zr.fromRdf(i),r=Zr.fromRdf(e);return typeof n!=typeof r?null:typeof n=="string"?n.localeCompare(r):n-r}function Vh(i){const e=/^.*(((\+|-)\d{2}:\d{2})|Z)$/;return su.dateTime.equals(i.datatype)&&e.test(i.value)}function Mb(i){const e=i.ptr.out([ge.disjoint]).term;return{generic:Ob(e)}}function Ob(i){return e=>{const n=e.focusNode.dataset.match(e.focusNode.term,i,e.valueOrNode.term);e.test(n.size===0,ge.DisjointConstraintComponent,{args:{disjoint:i},message:[e.factory.literal("Value node must not also be one of the values of {$disjoint}")],value:e.valueOrNode})}}function Fb(i){const e=i.ptr.out([ge.equals]).term;return{node:jb(e),property:Bb(e)}}function jb(i){return e=>{const n=e.focusNode.out([i]),r=n.filter(a=>!a.term.equals(e.focusNode.term)),o=n.terms.length!==0&&r.terms.length===0;e.test(o,ge.EqualsConstraintComponent,{args:{equals:i},message:[e.factory.literal("Must have same values as {$equals}")],value:r.terms[0]&&e.focusNode.node([r.terms[0]])||e.focusNode})}}function Bb(i){return e=>{const n=new Jt(e.focusNode.out([i]).terms),r=new Jt(e.values.terms),o=[...r].filter(u=>!n.has(u)),a=[...n].filter(u=>!r.has(u)),l=[...o,...a];for(const u of l)e.violation(ge.EqualsConstraintComponent,{args:{equals:i},message:[e.factory.literal("Must have same values as {$equals}")],value:e.focusNode.node([u])});l.length===0&&e.debug(ge.EqualsConstraintComponent,{args:{equals:i},message:[e.factory.literal("Must have same values as {$equals}")]})}}function $b(i){const e=i.ptr.out([ge.lessThan]).term;return{property:qb(e)}}function qb(i){return e=>{const n=e.focusNode.out([i]).terms;for(const r of e.values)for(const o of n){const a=Yi(r.term,o);a===null||a>=0?e.violation(ge.LessThanConstraintComponent,{args:{lessThan:i},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:r}):e.debug(ge.LessThanConstraintComponent,{args:{lessThan:i},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:r})}}}function zb(i){const e=i.ptr.out([ge.lessThanOrEquals]).term;return{property:Hb(e)}}function Hb(i){return e=>{const n=e.focusNode.out([i]).terms;for(const r of e.values)for(const o of n){const a=Yi(r.term,o);a===null||a>0?e.violation(ge.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:i},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:r}):e.debug(ge.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:i},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:r})}}}function Ub(i){const e=i.ptr.out([ge.maxExclusive]).term;return{generic:Vb(e)}}function Vb(i){return e=>{const n=Yi(e.valueOrNode.term,i);e.test(n!==null&&n<0,ge.MaxExclusiveConstraintComponent,{args:{maxExclusive:i},message:[e.factory.literal("Value is not less than {$maxExclusive}")],value:e.valueOrNode})}}function Wb(i){const e=i.ptr.out([ge.maxInclusive]).term;return{generic:Gb(e)}}function Gb(i){return e=>{const n=Yi(e.valueOrNode.term,i);e.test(n!==null&&n<=0,ge.MaxInclusiveConstraintComponent,{args:{maxInclusive:i},message:[e.factory.literal("Value is not less than or equal to {$maxInclusive}")],value:e.valueOrNode})}}function Zb(i){const e=i.ptr.out([ge.minExclusive]).term;return{generic:Xb(e)}}function Xb(i){return e=>{const n=Yi(e.valueOrNode.term,i);e.test(n!==null&&n>0,ge.MinExclusiveConstraintComponent,{args:{minExclusive:i},message:[e.factory.literal("Value is not greater than {$minExclusive}")],value:e.valueOrNode})}}function Qb(i){const e=i.ptr.out([ge.minInclusive]).term;return{generic:Jb(e)}}function Jb(i){return e=>{const n=Yi(e.valueOrNode.term,i);e.test(n!==null&&n>=0,ge.MinInclusiveConstraintComponent,{args:{minInclusive:i},message:[e.factory.literal("Value is not greater than or equal to {$minInclusive}")],value:e.valueOrNode})}}function Kb(i){const e=[...i.ptr.out([ge.node])].map(n=>i.validator.shape(n));return{generic:Yb(e)}}function Yb(i){return async e=>{for(const n of i){const r=await n.validate(e.create({child:!0,focusNode:e.valueOrNode}));e.test(r.report.conforms,ge.NodeConstraintComponent,{args:{node:n.ptr.term},message:[e.factory.literal("Value does not have shape {$node}")],results:r.report.results,value:e.valueOrNode})}}}function ev(i){const e=[...i.ptr.out([ge.property])].map(n=>i.validator.shape(n));return{generic:tv(e)}}function tv(i){return async e=>{const n=e.create({focusNode:e.valueOrNode});for(const r of i)await r.validate(n)}}function nv(i){const e=i.validator.shape(i.ptr.out([ge.qualifiedValueShape])),n=i.ptr.out([ge.qualifiedValueShapesDisjoint]).term,r=n?Zr.fromRdf(n):!1,o=i.ptr.out([ge.qualifiedMaxCount]).term,a=o?parseInt(o.value):null,l=i.ptr.out([ge.qualifiedMinCount]).term,u=l?parseInt(l.value):null;return{property:iv(e,r,a,u)}}function iv(i,e,n,r){return async o=>{const a=[];let l=[];e&&(l=new Set(o.shape.ptr.in([ge.property]).out([ge.property]).out([ge.qualifiedValueShape]).filter(f=>!f.term.equals(i.ptr.term)).map(f=>o.shape.validator.shape(f))));const u=(await yb(o.values,async f=>{const h=(await i.validate(o.create({child:!0,focusNode:f}))).report;if(a.push(h.results),!h.conforms)return!1;if(l.length===0)return!0;if(o.options.debug||o.options.details){const g=await so([...l],async _=>(await _.validate(o.create({child:!0,focusNode:f}))).report);return a.push(g.flatMap(_=>_.results)),!g.every(_=>_.conforms)}else return!await _b([...l],async g=>(await g.validate(o.create({child:!0,focusNode:f}))).report.conforms)})).length;n!==null&&o.test(u<=n,ge.QualifiedMaxCountConstraintComponent,{args:{qualifiedMaxCount:n,qualifiedValueShape:i.ptr.term,qualifiedValueShapesDisjoint:e},message:[o.factory.literal("More than {$qualifiedMaxCount} values have shape {$qualifiedValueShape}")],results:a.flat()}),r!==null&&o.test(u>=r,ge.QualifiedMinCountConstraintComponent,{args:{qualifiedMinCount:r,qualifiedValueShape:i.ptr.term,qualifiedValueShapesDisjoint:e},message:[o.factory.literal("Less than {$qualifiedMinCount} values have shape {$qualifiedValueShape}")],results:a.flat()})}}function rv(i,e){return e?e.slice(0,i.length)===i:!1}function sv(i){const e=[...new Set([...i.ptr.out([ge.languageIn]).list()].map(n=>n.value))];return{generic:ov(e)}}function ov(i){return e=>{const n=i.some(r=>rv(r,e.valueOrNode.term.language));e.test(n,ge.LanguageInConstraintComponent,{args:{languageIn:i.join(", ")},message:[e.factory.literal("Language does not match any of {$languageIn}")],value:e.valueOrNode})}}function av(i){const e=parseInt(i.ptr.out([ge.maxLength]).value);return{generic:lv(e)}}function lv(i){return e=>{const n=e.valueOrNode.term.termType!=="BlankNode"&&e.valueOrNode.value.length<=i;e.test(n,ge.MaxLengthConstraintComponent,{args:{maxLength:i},message:[e.factory.literal("Value has more than {$maxLength} characters")],value:e.valueOrNode})}}function uv(i){const e=parseInt(i.ptr.out([ge.minLength]).value);return{generic:cv(e)}}function cv(i){return e=>{const n=e.valueOrNode.term.termType!=="BlankNode"&&e.valueOrNode.value.length>=i;e.test(n,ge.MinLengthConstraintComponent,{args:{minLength:i},message:[e.factory.literal("Value has less than {$minLength} characters")],value:e.valueOrNode})}}function dv(i){const e=i.ptr.out([ge.pattern]).value,n=i.ptr.out([ge.flags]).value,r=new RegExp(e,n);return{generic:hv(e,n,r)}}function hv(i,e,n){return r=>{r.test(n.test(r.valueOrNode.term.value),ge.PatternConstraintComponent,{args:{flags:e,pattern:i},message:[r.factory.literal('Value does not match pattern "{$pattern}"')],value:r.valueOrNode})}}function fv(i){const e=i.ptr.out([ge.uniqueLang]).term;return e.value==="true"&&su.boolean.equals(e.datatype)?{property:pv()}:null}function pv(){return i=>{const n=Object.entries(i.values.terms.reduce((r,o)=>(o.language&&(r[o.language]=(r[o.language]||0)+1),r),{})).filter(([,r])=>r>1);for(const[r]of n)i.violation(ge.UniqueLangConstraintComponent,{args:{lang:r},message:[i.factory.literal('Language "{?lang}" used more than once')]});n.length===0&&i.debug(ge.UniqueLangConstraintComponent)}}const Ms=Yt("http://www.w3.org/ns/shacl#"),Ep=Yt("https://schemas.link/shacl-next#");class Qi{constructor({results:e=[]}={}){this.results=e}get conforms(){return!this.results.some(e=>e.severity.equals(Ms.Info)||e.severity.equals(Ms.Violation)||e.severity.equals(Ms.Warning))}}function gv(i,e){return Object.entries(e).reduce((n,[r,o])=>(o&&o.termType&&(o=qt(o)),n.replace(`{$${r}}`,o).replace(`{?${r}}`,o)),i)}class Vs{constructor({args:e={},factory:n,message:r=[],severity:o=Ms.Violation}={}){this.severity=o,this.message=r.map(a=>n.literal(gv(a.value,e),a.language||null))}}class au{constructor({factory:e=ru}={}){this.factory=e}clone({factory:e}={}){return new au({factory:e||this.factory})}validate(){return new Qi}validateSimple(){return!0}}class er extends au{constructor({datatypes:e,factory:n}={}){super({factory:n}),this.datatypes=[];for(const r of Array.isArray(e)?e:[e])r&&this.datatypes.push(this.factory.fromTerm(r))}clone({factory:e}={}){return new er({datatypes:this.datatypes,factory:e||this.factory})}}class mv{constructor({factory:e=ru,validations:n}={}){if(this.factory=e,this.validations=new Ii,n)for(const r of Object.values(n)){const o=r.clone({factory:this.factory});for(const a of o.datatypes)this.validations.set(a,o)}}validate(e){const n=this.validations.get(e.datatype);return n?n.validate(e):new Qi}validateSimple(e){const n=this.validations.get(e.datatype);return n?n.validateSimple(e):!0}}class ot extends er{constructor(e,n,{factory:r}={}){super({datatypes:n,factory:r}),this.message=[this.factory.literal("term value {$this} matches pattern {$pattern}")],this.patterns=Array.isArray(e)?e:[e]}clone({factory:e}={}){return new ot(this.patterns,this.datatypes,{factory:e||this.factory})}validate(e){const n=this.patterns.map(r=>{let o;r.test(e.value)&&(o=Ep.Debug);const a={pattern:this.factory.literal(r.toString()),this:e};return new Vs({args:a,factory:this.factory,message:this.message,severity:o})});return new Qi({results:n})}validateSimple(e){return this.patterns.every(n=>n.test(e.value))}}const _v=/^([-+]?[0-9]+)$/;class Dt extends ot{constructor(e=null,n=null,r,{factory:o}={}){super(_v,r,{factory:o}),this.maxInclusive=null,this.minInclusive=null,typeof n=="string"&&(this.maxInclusive=BigInt(n)),typeof e=="string"&&(this.minInclusive=BigInt(e))}clone({factory:e}={}){return new Dt(this.minInclusive?.toString(),this.maxInclusive?.toString(),this.datatypes,{factory:e||this.factory})}validate(e){const n=super.validate(e).results;if(!Ep.Debug.equals(n[0].severity))return new Qi({results:n});const r=BigInt(e.value);if(this.minInclusive!==null&&r<this.minInclusive){const o=`term value "${e.value}" is less than "${this.minInclusive.toString()}"`,a=[this.factory.literal(o)];n.push(new Vs({factory:this.factory,message:a}))}if(this.maxInclusive!==null&&r>this.maxInclusive){const o=`term value "${e.value}" is greater than "${this.maxInclusive.toString()}"`,a=[this.factory.literal(o)];n.push(new Vs({factory:this.factory,message:a}))}return new Qi({results:n})}validateSimple(e){if(!super.validateSimple(e))return!1;const n=BigInt(e.value);return!(this.minInclusive!==null&&n<this.minInclusive||this.maxInclusive!==null&&n>this.maxInclusive)}}class lu extends er{constructor(e,n,{factory:r}={}){super({datatypes:n,factory:r}),this.values=new Set(e)}clone({factory:e}={}){return new lu(this.values,this.datatypes,{factory:e||this.factory})}validate(e){const n=[];if(!this.values.has(e.value)){const r=`term value "${e.value}" is not included in the list: ${[...this.values].join(",")}`,o=[this.factory.literal(r)];n.push(new Vs({factory:this.factory,message:o}))}return new Qi({results:n})}validateSimple(e){return this.values.has(e.value)}}const We={xsd:Yt("http://www.w3.org/2001/XMLSchema#")},yv=new er({datatypes:We.xsd.anySimpleType}),bv=new er({datatypes:We.xsd.anyAtomicType}),oo=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,vv=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,Sp=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,uu=/^(-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))))$/,Tp=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,wv=/^((([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,xv=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Ev=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Sv=/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Tv=/^(--(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Lv=/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Iv=/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Av=/^(([0-9a-fA-F]{2})*)$/,Nv=/^(((([A-Za-z0-9+/] ?){4})*(([A-Za-z0-9+/] ?){3}[A-Za-z0-9+/]|([A-Za-z0-9+/] ?){2}[AEIMQUYcgkosw048] ?=|[A-Za-z0-9+/] ?[AQgw] ?= ?=))?)$/,Rv=new ot(oo,We.xsd.string),Cv=new lu(["1","true","0","false"],We.xsd.boolean),Pv=new ot(vv,We.xsd.decimal),kv=new ot(Sp,We.xsd.float),Dv=new ot(Sp,We.xsd.double),Mv=new ot(uu,We.xsd.duration),Ov=new ot(Tp,We.xsd.dateTime),Fv=new ot(wv,We.xsd.time),jv=new ot(xv,We.xsd.date),Bv=new ot(Ev,We.xsd.gYearMonth),$v=new ot(Sv,We.xsd.gYear),qv=new ot(Tv,We.xsd.gMonthDay),zv=new ot(Lv,We.xsd.gDay),Hv=new ot(Iv,We.xsd.gMonth),Uv=new ot(Av,We.xsd.hexBinary),Vv=new ot(Nv,We.xsd.base64Binary),Wv=new ot(oo,We.xsd.anyURI),Lp=/^([^\u000d\u000a\u0009]*)$/,Gv=/^([^ ]+( [^ ]+)*)*$/,Zv=/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,Xv=/^([^DT]*)$/,Qv=/^([^YM]*[DT].*)$/,Jv=/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/,Kv=new ot([oo,Lp],We.xsd.normalizedString),Yv=new ot([oo,Lp,Gv],We.xsd.token),e0=new ot(Zv,We.xsd.language),t0=new Dt(null,null,We.xsd.integer),n0=new Dt(null,"0",We.xsd.nonPositiveInteger),i0=new Dt(null,"-1",We.xsd.negativeInteger),r0=new Dt("-9223372036854775808","9223372036854775807",We.xsd.long),s0=new Dt("-2147483648","2147483647",We.xsd.int),o0=new Dt("-32768","32767",We.xsd.short),a0=new Dt("-128","127",We.xsd.byte),l0=new Dt("0",null,We.xsd.nonNegativeInteger),u0=new Dt("0","18446744073709551615",We.xsd.unsignedLong),c0=new Dt("0","4294967295",We.xsd.unsignedInt),d0=new Dt("0","65535",We.xsd.unsignedShort),h0=new Dt("0","255",We.xsd.unsignedByte),f0=new Dt("1",null,We.xsd.positiveInteger),p0=new ot([uu,Xv],We.xsd.yearMonthDuration),g0=new ot([uu,Qv],We.xsd.dayTimeDuration),m0=new ot([Tp,Jv],We.xsd.dateTimeStamp),_0=Object.freeze(Object.defineProperty({__proto__:null,anyAtomicType:bv,anySimpleType:yv,anyURI:Wv,base64Binary:Vv,boolean:Cv,byte:a0,date:jv,dateTime:Ov,dateTimeStamp:m0,dayTimeDuration:g0,decimal:Pv,double:Dv,duration:Mv,float:kv,gDay:zv,gMonth:Hv,gMonthDay:qv,gYear:$v,gYearMonth:Bv,hexBinary:Uv,int:s0,integer:t0,language:e0,long:r0,negativeInteger:i0,nonNegativeInteger:l0,nonPositiveInteger:n0,normalizedString:Kv,positiveInteger:f0,short:o0,string:Rv,time:Fv,token:Yv,unsignedByte:h0,unsignedInt:c0,unsignedLong:u0,unsignedShort:d0,yearMonthDuration:p0},Symbol.toStringTag,{value:"Module"}));class y0 extends mv{constructor({factory:e}={}){super({factory:e,validations:{..._0}})}}const b0=new Ii([[ge.BlankNode,new Set(["BlankNode"])],[ge.BlankNodeOrIRI,new Set(["BlankNode","NamedNode"])],[ge.BlankNodeOrLiteral,new Set(["BlankNode","Literal"])],[ge.IRI,new Set(["NamedNode"])],[ge.IRIOrLiteral,new Set(["NamedNode","Literal"])],[ge.Literal,new Set(["Literal"])]]);function v0(i){const e=i.ptr.out([ge.class]).map(n=>Rl(n));return{generic:w0(e)}}function w0(i){return e=>{const n=new Jt(e.valueOrNode.out([Si.type]).terms);for(const r of i){const o=[...n].some(a=>r.has(a));e.test(o,ge.ClassConstraintComponent,{value:e.valueOrNode})}}}function x0(i){const e=i.ptr.out([ge.datatype]).term,n=new y0;return{generic:E0(e,n)}}function E0(i,e){return n=>{const r=i.equals(n.valueOrNode.term.datatype)&&e.validateSimple(n.valueOrNode.term);n.test(r,ge.DatatypeConstraintComponent,{args:{datatype:i},message:[n.factory.literal("Value does not have datatype {$datatype}")],value:n.valueOrNode})}}function S0(i){const e=i.ptr.out([ge.nodeKind]).term,n=b0.get(e);return{generic:T0(e,n)}}function T0(i,e){return n=>{n.test(e.has(n.valueOrNode.term.termType),ge.NodeKindConstraintComponent,{args:{nodeKind:i},message:[n.factory.literal("Value does not have node kind {$nodeKind}")],value:n.valueOrNode})}}const L0=new Ii([[ge.maxCount,fb],[ge.minCount,gb],[ge.and,vb],[ge.not,xb],[ge.or,Sb],[ge.xone,Lb],[ge.closed,Ab],[ge.hasValue,Rb],[ge.in,kb],[ge.disjoint,Mb],[ge.equals,Fb],[ge.lessThan,$b],[ge.lessThanOrEquals,zb],[ge.maxExclusive,Ub],[ge.maxInclusive,Wb],[ge.minExclusive,Zb],[ge.minInclusive,Qb],[ge.node,Kb],[ge.property,ev],[ge.qualifiedValueShape,nv],[ge.languageIn,sv],[ge.maxLength,av],[ge.minLength,uv],[ge.pattern,dv],[ge.uniqueLang,fv],[ge.class,v0],[ge.datatype,x0],[ge.nodeKind,S0]]);class Wh{constructor(e,{factory:n,...r}){if(this.factory=n,this.options=r,this.registry=new eb(L0),this.targetResolverRegistry=new hb(this.options.targetResolvers||[]),this.shapesPtr=new Us({dataset:e,factory:n}),this.shapes=new Ii,this.options.coverage&&(this.options.debug=!0,this.options.details=!0,this.options.trace=!0),this.options.validations)for(const[a,l]of this.options.validations)this.registry.validations.set(a,l);const o=[...this.shapesPtr.hasOut([ge.targetClass]),...this.shapesPtr.hasOut([ge.targetNode]),...this.shapesPtr.hasOut([ge.targetObjectsOf]),...this.shapesPtr.hasOut([ge.targetSubjectsOf]),...this.shapesPtr.hasOut([ge.target]),...this.shapesPtr.hasOut([Si.type],[ge.NodeShape]),...this.shapesPtr.hasOut([Si.type],[ge.PropertyShape])];for(const a of o)this.shape(a)}shape(e){if(!e.term)return null;let n=this.shapes.get(e.term);return n||(n=new db(e,{validator:this}),this.shapes.set(e.term,n)),n}async validate(e,n){const r=new Us({...e,factory:this.factory}),o=new ou({factory:this.factory,focusNode:r,options:this.options,validator:this});n?n=n.map(a=>this.shape(this.shapesPtr.node(a.terms))):n=this.shapes.values();for(const a of n){const l=o.create({shape:a});let u;r.isAny()?u=await a.resolveTargets(l):u=r;for(const f of u)await a.validate(l.create({focusNode:f}))}return o.report}}const I0={[`${Fe}node`]:(i,e)=>{i.extendedShapes.add(new Ws(e,i.config,i))},[`${Fe}and`]:(i,e)=>{for(const n of i.config.lists[e.value])i.extendedShapes.add(new Ws(n,i.config,i))},[`${Fe}property`]:(i,e)=>{const n=i.config.getPropertyTemplate(e,i);if(n.path){let r=i.properties[n.path];if(r||(r=[],i.properties[n.path]=r),n.qualifiedValueShape)r.push(n);else{let o;for(let a=0;a<i.properties[n.path].length&&!o;a++)i.properties[n.path][a].qualifiedValueShape||(o=i.properties[n.path][a]);o?Hf(o,n):r.push(n)}}},[`${Fe}nodeKind`]:(i,e)=>{i.nodeKind=e},[`${Fe}targetClass`]:(i,e)=>{i.targetClass=e},[`${Fe}or`]:(i,e)=>{i.or=i.config.lists[e.value]},[`${Fe}xone`]:(i,e)=>{i.xone=i.config.lists[e.value]},[$l.id]:(i,e)=>{i.owlImports.add(e)},[`${Bl}title`]:(i,e)=>{const n=e;i.label=js(i.config.languages,i.label,n)},[`${Js}label`]:(i,e)=>{const n=e;i.label=js(i.config.languages,i.label,n)}};class Ws{constructor(e,n,r){this.extendedShapes=new Set,this.properties={},this.owlImports=new Set,this.id=e,this.config=n,this.parent=r,n.registerNodeTemplate(this),A0(this,this.config.store.getQuads(e,null,null,null))}}function A0(i,e){for(const n of e)I0[n.predicate.id]?.call(i,i,n.object);return i}function N0(i){for(const e of Object.values(i.properties))for(const n of e){const[r,o]=Cl(i,n.path);if(r.length>1&&o){const a=r[r.length-1];for(let l=r.length-2;l>=0;l--){const u=r[l];delete u.parent.properties[u.path],Hf(a,u)}}}}function Cl(i,e,n=new Set,r=[],o=!1){if(!n.has(i.id.value)){n.add(i.id.value);const a=i.properties[e];if(a?.length===1){r.push(a[0]),o=o||a[0].maxCount===1;for(const l of a[0].nodeShapes){const[u,f]=Cl(l,e,n,r,o);o=o||f}}for(const l of i.extendedShapes){const[u,f]=Cl(l,e,n,r,o);o=o||f}}return[r,o]}class _l{constructor(){this.shapes=null,this.shapesUrl=null,this.shapeSubject=null,this.values=null,this.valuesUrl=null,this.valueSubject=null,this.valuesSubject=null,this.valuesNamespace="",this.valuesGraph=null,this.view=null,this.language=null,this.loading="Loading…",this.proxy=null,this.ignoreOwlImports=null,this.collapse=null,this.hierarchyColors=null,this.submitButton=null,this.generateNodeShapeReference=Fs.value,this.showNodeIds=null,this.showRootShapeLabel=null,this.dense="true",this.useShadowRoot="true"}}const R0="#4c93d785, #f85e9a85, #00327385, #87001f85";class Gh{constructor(e){this.attributes=new _l,this.editMode=!0,this.lists={},this.groups=[],this.renderedNodes=new Set,this._store=new It,this._nodeTemplates={},this._propertyTemplates={},this.validator=new Wh(this._store,{details:!0,factory:Be}),this.providedConformingResourceIds={},this.providedResources={},this.form=e,this._theme=new gy,this.languages=[...new Set(navigator.languages.flatMap(n=>n.length>2?[n.toLocaleLowerCase(),n.substring(0,2)]:n)),""]}reset(){this.lists={},this.groups=[],this.renderedNodes.clear(),this.providedConformingResourceIds={},this.providedResources={},this._nodeTemplates={},this._propertyTemplates={}}updateAttributes(e){const n=new _l;if(Object.keys(n).forEach(r=>{const o=e.dataset[r];o!==void 0&&(n[r]=o)}),this.editMode=n.view===null,this.theme.setDense(n.dense==="true"),this.attributes=n,this.attributes.valueSubject&&!this.attributes.valuesSubject&&(this.attributes.valuesSubject=this.attributes.valueSubject),n.language){const r=this.languages.indexOf(n.language);r>-1&&this.languages.splice(r,1),this.languages.unshift(n.language)}if(n.valuesGraph&&(this.valuesGraphId=Be.namedNode(n.valuesGraph)),n.hierarchyColors!=null){const r=n.hierarchyColors.length?n.hierarchyColors:R0;let o=`:host { --hierarchy-colors: ${r}; --hierarchy-colors-length: ${r.split(",").length} }`;for(let a=8;a>=0;a--){let l=`shacl-property { --hierarchy-level: ${a} }`;for(let u=0;u<a;u++)l="shacl-property "+l;o=o+`
|
|
430
|
-
`+l}this.hierarchyColorsStyleSheet=new CSSStyleSheet,this.hierarchyColorsStyleSheet.replaceSync(o)}}static dataAttributes(){const e=new _l;return Object.keys(e).map(n=>(n=n.replace(/[A-Z]/g,r=>"-"+r.toLowerCase()),"data-"+n))}buildTemplateKey(e,n){let r=e.value;return n&&(n instanceof Hd?r+="*"+n.id.value:r+="*"+this.buildTemplateKey(n.id,n.parent)),r}registerNodeTemplate(e){this._nodeTemplates[this.buildTemplateKey(e.id,e.parent)]=e}registerPropertyTemplate(e){this._propertyTemplates[this.buildTemplateKey(e.id,e.parent)]=e}getNodeTemplateIds(){const e=new Set;for(const n of Object.values(this._nodeTemplates))e.add(n.id.value);return e}getNodeTemplate(e,n){const r=this.buildTemplateKey(e,n);let o=this._nodeTemplates[r];return o||(o=new
|
|
429
|
+
`}function vy(){return""}function _p(i){return"<"+i.value+">"}const wy=/["\\\\\n\r]/,xy=/["\\\\\n\r]/g,Ey={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function Sy(i){return Ey[i]}function Ty(i){return wy.test(i)?i.replace(xy,Sy):i}function Ly(i){const e=Ty(i.value);return i.datatype.value==="http://www.w3.org/2001/XMLSchema#string"?'"'+e+'"':i.datatype.value==="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"?'"'+e+'"@'+i.language:'"'+e+'"^^'+_p(i.datatype)}function Iy(i,e){const n=e(i.subject),r=e(i.predicate),o=e(i.object),a=e(i.graph);return`${n} ${r} ${o} ${a?a+" ":""}.`}function Ay(i){return"?"+i.value}function qt(i){if(!i)return null;if(i.termType==="BlankNode")return yy(i);if(i.termType==="DefaultGraph")return vy();if(i.termType==="Literal")return Ly(i);if(i.termType==="NamedNode")return _p(i);if(i.termType==="Quad"||i.subject&&i.predicate&&i.object&&i.graph)return Iy(i,qt);if(i.termType==="Variable")return Ay(i);if(i[Symbol.iterator])return by(i,qt);throw new Error(`unknown termType ${i.termType}`)}class Ii{constructor(e){if(this.index=new Map,e)for(const[n,r]of e)this.set(n,r)}get size(){return this.index.size}clear(){this.index.clear()}delete(e){return this.index.delete(qt(e))}*entries(){for(const[,{term:e,value:n}]of this.index)yield[e,n]}forEach(e,n){for(const r of this.entries())e.call(n,r[1],r[0],this)}get(e){const n=this.index.get(qt(e));return n&&n.value}has(e){return this.index.has(qt(e))}*keys(){for(const[,{term:e}]of this.index)yield e}set(e,n){const r=qt(e);return this.index.set(r,{term:e,value:n}),this}*values(){for(const[,{value:e}]of this.index)yield e}[Symbol.iterator](){return this.entries()[Symbol.iterator]()}}class uh{constructor({dataset:e,end:n,quad:r,start:o}){this.dataset=e,this.end=n,this.quad=r,this.start=o}get term(){return this.quad[this.end]}get graph(){return this.quad.graph}get startTerm(){return this.quad[this.start]}}function ch(i){try{return qt(i)}catch{return null}}class Jt{constructor(e){if(this.index=new Map,e)for(const n of e)this.add(n)}get size(){return this.index.size}add(e){const n=qt(e);return this.index.has(n)||this.index.set(n,e),this}clear(){this.index.clear()}delete(e){return e?this.index.delete(ch(e)):!1}entries(){return this.values().entries()}forEach(e,n){return this.values().forEach(e,n)}has(e){return e?this.index.has(ch(e)):!1}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}}class yp{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}yp.prototype.termType="BlankNode";class nu{equals(e){return!!e&&e.termType===this.termType}}nu.prototype.termType="DefaultGraph";nu.prototype.value="";function dh(i,e){if(!e)return null;if(e.termType==="BlankNode")return i.blankNode(e.value);if(e.termType==="DefaultGraph")return i.defaultGraph();if(e.termType==="Literal")return i.literal(e.value,e.language||i.namedNode(e.datatype.value));if(e.termType==="NamedNode")return i.namedNode(e.value);if(e.termType==="Quad"){const n=i.fromTerm(e.subject),r=i.fromTerm(e.predicate),o=i.fromTerm(e.object),a=i.fromTerm(e.graph);return i.quad(n,r,o,a)}if(e.termType==="Variable")return i.variable(e.value);throw new Error(`unknown termType ${e.termType}`)}class Os{constructor(e,n,r,o=""){this.value=e,this.language=n,this.datatype=r,this.direction=o}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)&&(e.direction||"")===this.direction}}Os.prototype.termType="Literal";class Yr{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}Yr.prototype.termType="NamedNode";class iu{constructor(e,n,r,o){this.subject=e,this.predicate=n,this.object=r,this.graph=o}equals(e){return!!e&&(e.termType==="Quad"||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}}iu.prototype.termType="Quad";iu.prototype.value="";class bp{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}bp.prototype.termType="Variable";const Ny=new Yr("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),hh=new Yr("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),Ry=new Yr("http://www.w3.org/2001/XMLSchema#string");class vp{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new nu}}namedNode(e){return new Yr(e)}blankNode(e){return e=e||"b"+ ++this._data.blankNodeCounter,new yp(e)}literal(e,n){return typeof n=="string"?new Os(e,n,hh):typeof n?.language=="string"?new Os(e,n.language,n.direction?Ny:hh,n.direction):new Os(e,"",n||Ry)}variable(e){return new bp(e)}defaultGraph(){return this._data.defaultGraph}quad(e,n,r,o=this.defaultGraph()){return new iu(e,n,r,o)}fromTerm(e){return dh(this,e)}fromQuad(e){return dh(this,e)}}vp.exports=["blankNode","defaultGraph","fromQuad","fromTerm","literal","namedNode","quad","variable"];const ru=new vp,Cy={apply:(i,e,n)=>i(n[0]),get:(i,e)=>i(e)};function Yt(i,{factory:e=ru}={}){const n=(r="")=>e.namedNode(`${i}${r.raw||r}`);return typeof Proxy>"u"?n:new Proxy(n,Cy)}Yt("http://www.w3.org/2001/XMLSchema#");const _n=Yt("http://www.w3.org/1999/02/22-rdf-syntax-ns#");Yt("http://www.w3.org/2000/01/rdf-schema#");class nt{static add({ptr:e,start:n,end:r,subjects:o=[null],predicates:a=[null],objects:l=[null],graphs:u,callback:f}={}){if(!e.factory)throw new Error("add operation requires a factory");let h=()=>{};f&&(h=g=>{f(new uh({dataset:e.dataset,start:n,end:r,quad:g}))});for(const g of o)for(const m of a)for(const d of l)for(const _ of u){const v={subject:g,predicate:m,object:d,graph:_};v[n]=e.term;const I=e.factory.quad(v.subject,v.predicate,v.object,v.graph);e.dataset.add(I),h(I)}return e}static addList({ptr:e,predicates:n,items:r,graphs:o}){if(e.isAny())throw new Error("can't attach a list to an any ptr");for(const a of n)for(const l of o){const u=r.map(()=>e.factory.blankNode());e.dataset.add(e.factory.quad(e.term,a,u[0]||_n.nil,l));for(let f=0;f<u.length;f++)e.dataset.add(e.factory.quad(u[f],_n.first,r[f],l)),e.dataset.add(e.factory.quad(u[f],_n.rest,u[f+1]||_n.nil,l))}return e}static delete({ptr:e,start:n,subjects:r=[null],predicates:o=[null],objects:a=[null]}){for(const l of r)for(const u of o)for(const f of a){const h={subject:l,predicate:u,object:f};h[n]=e.term;const g=e.dataset.match(h.subject,h.predicate,h.object);for(const m of g)e.dataset.delete(m)}return e}static deleteList({ptr:e,predicates:n}){const r=[];for(const o of n)for(const a of e.dataset.match(e.term,o)){let l=a.object;for(r.push(a);!_n.nil.equals(l);){l=r[r.length-1].object;const u=e.dataset.match(l);if(u.size===0)break;for(const f of u)r.push(f)}}for(const o of r)e.dataset.delete(o);return e}static execute({ptr:e,operation:n="traverse",quantifier:r,start:o,end:a,subjects:l,predicates:u,objects:f,graphs:h,items:g,callback:m}={}){if(n==="add")return nt.add({ptr:e,start:o,end:a,subjects:l,predicates:u,objects:f,graphs:h,callback:m});if(n==="addList")return nt.addList({ptr:e,predicates:u,items:g,graphs:h});if(n==="delete")return nt.delete({ptr:e,start:o,subjects:l,predicates:u,objects:f});if(n==="deleteList")return nt.deleteList({ptr:e,predicates:u});if(n==="isList")return nt.isList({ptr:e});if(n==="list")return nt.list({ptr:e});if(n==="traverse")return nt.traverse({ptr:e,quantifier:r,start:o,end:a,subjects:l,predicates:u,objects:f,graphs:h});throw new Error(`unknown operation ${n}`)}static isList({ptr:e}){return e.isAny()?!1:!!(_n.nil.equals(e.term)||nt.traverse({ptr:e,predicates:[_n.first]}).length===1)}static list({ptr:e}){if(e.isList())return{*[Symbol.iterator](){for(;e&&!e.term.equals(_n.nil);){const n=e.out([_n.first]);if(n.length!==1)throw new Error(`Invalid list: rdf:first count not equals one on ${e.value}`);const r=e.out([_n.rest]);if(r.length!==1)throw new Error(`Invalid list: rdf:rest count not equals one on ${e.value}`);yield n[0],e=r[0]}}}}static traverse({ptr:e,quantifier:n="one",start:r="subject",end:o="object",subjects:a=[null],predicates:l=[null],objects:u=[null],graphs:f=[null],callback:h}){if(n==="one")return nt.traverseOne({ptr:e,start:r,end:o,subjects:a,predicates:l,objects:u,graphs:f,callback:h});if(n==="oneOrMore"){const g=nt.traverse({ptr:e,end:o,start:r,subjects:a,predicates:l,objects:u,graphs:f,callback:h});return nt.traverseMore({ptrs:g,end:o,start:r,subjects:a,predicates:l,objects:u,graphs:f,callback:h})}if(n==="zeroOrMore")return nt.traverseMore({ptrs:[e],end:o,start:r,subjects:a,predicates:l,objects:u,graphs:f,callback:h});if(n==="zeroOrOne")return[e,...nt.traverse({ptr:e,end:o,start:r,subjects:a,predicates:l,objects:u,graphs:f,callback:h})];throw new Error(`unknown quantifier ${n}`)}static traverseMore({ptrs:e,end:n,start:r,subjects:o,predicates:a,objects:l,graphs:u,callback:f}={}){let h=[...e],g,m;do{g=[];for(const d of e)g=[...g,...nt.traverseOne({ptr:d,end:n,start:r,subjects:o,predicates:a,objects:l,graphs:u,callback:f})];m&&(g=g.filter(d=>!m.has(d.term))),e=g,h=[...h,...g],m=new Jt(h.map(d=>d.term))}while(g.length>0);return h}static traverseOne({ptr:e,start:n,end:r,subjects:o,predicates:a,objects:l,graphs:u,callback:f=(h,g)=>g.extend(h)}={}){const h=[];for(const g of o)for(const m of a)for(const d of l)for(const _ of u){const v={subject:g,predicate:m,object:d,graph:_};v[n]=e.term;for(const I of e.dataset.match(v.subject,v.predicate,v.object,v.graph))h.push(f(new uh({dataset:e.dataset,end:r,quad:I,start:n}),e))}return h}}function fh(i,e){return e?n=>e(i.extend(n)):()=>{}}class ph{constructor({dataset:e,edges:n=[],factory:r,graph:o,term:a}){if(!e&&n.length===0)throw new Error("dataset or edges is required");if(n.length===0&&typeof a>"u")throw new Error("edges or term must be given");if(n.length>0&&a)throw new Error("edges or term must be given");this.dataset=e||n[n.length-1].dataset,this.edges=n,this.factory=r,this._graph=o,n.length===0&&(this._term=a)}get edge(){return this.edges[this.edges.length-1]}get graph(){return typeof this._graph=="object"?this._graph:this.edge&&this.edge.graph}get length(){return this._term!==void 0?1:this.edges.length+1}get startTerm(){return this._term||this.edges[0].startTerm}get term(){return this._term!==void 0?this._term:this.edge.term}get value(){const e=this.term;return e===null?void 0:e.value}addIn(e,n,r){return nt.add({ptr:this,start:"object",end:"subject",subjects:n,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],callback:fh(this,r)})}addList(e,n){return nt.addList({ptr:this,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],items:n})}addOut(e,n,r){return nt.add({ptr:this,start:"subject",end:"object",predicates:e,objects:n,graphs:[this.graph||this.factory.defaultGraph()],callback:fh(this,r)})}deleteIn(e,n){return nt.delete({ptr:this,start:"object",subjects:n,predicates:e})}deleteList(e){return nt.deleteList({ptr:this,predicates:e})}deleteOut(e,n){return nt.delete({ptr:this,start:"subject",predicates:e,objects:n})}execute({operation:e,quantifier:n,start:r,end:o,subjects:a,predicates:l,objects:u,graphs:f,items:h,callback:g}){return nt.execute({ptr:this,operation:e,quantifier:n,start:r,end:o,subjects:a,predicates:l,objects:u,graphs:f,items:h,callback:g})}extend(e){return new this.constructor({dataset:this.dataset,edges:[...this.edges,e],factory:this.factory,graph:this._graph})}hasIn(e,n){return nt.traverse({ptr:this,start:"object",end:"object",subjects:n,predicates:e,graphs:[this.graph]})}hasOut(e,n){return nt.traverse({ptr:this,start:"subject",end:"subject",predicates:e,objects:n,graphs:[this.graph]})}in(e,n){return nt.traverse({ptr:this,start:"object",end:"subject",subjects:n,predicates:e,graphs:[this.graph]})}isAny(){return!this.term}isList(){return nt.isList({ptr:this})}list(){return nt.list({ptr:this})}*nodes(){for(let e=0;e<this.length;e++)this._term!==void 0?yield{dataset:this.dataset,term:this._term}:this.edges.length>e?yield{dataset:this.edges[e].dataset,term:this.edges[e].startTerm}:this.edges.length===e&&(yield{dataset:this.edges[e-1].dataset,term:this.edges[e-1].term})}out(e,n){return nt.traverse({ptr:this,predicates:e,objects:n,graphs:[this.graph]})}*quads(){for(const{quad:e}of this.edges)yield e}trim(){return new this.constructor({dataset:this.dataset,factory:this.factory,graph:this.graph,term:this.term})}}function gh(i,e){return i?i.equals(e):i===e}function Py(i,e){return!(i.dataset!==e.dataset||!gh(i.graph,e.graph)||!gh(i.term,e.term))}function mh(i,e){return e?n=>e(new i.constructor({factory:i.factory,ptrs:[n]})):()=>{}}class Vs{constructor({dataset:e,factory:n,ptrs:r,terms:o,graphs:a}){if(this.factory=n,r)this.ptrs=[...r];else{this.ptrs=[];for(const l of o||[null])for(const u of a||[null])this.ptrs.push(new ph({dataset:e,factory:n,graph:u,term:l}))}}get dataset(){const e=new Set(this.datasets);return e.size!==1?null:e[Symbol.iterator]().next().value}get datasets(){return this.ptrs.map(e=>e.dataset)}get term(){const e=new Jt(this.terms);if(e.size===1)return e[Symbol.iterator]().next().value}get terms(){return this.ptrs.map(e=>e.term)}get value(){const e=this.term;return e?.value}get values(){return this.ptrs.map(e=>e.value)}addIn(e,n,r){const o=mh(this,r);for(const a of this.ptrs)a.addIn(e,n,o);return this}addList(e,n){if(this.isAny())throw new Error("can't attach a list to an any ptr");for(const r of this.ptrs)r.addList(e,n);return this}addOut(e,n,r){const o=mh(this,r);for(const a of this.ptrs)a.addOut(e,n,o);return this}clone(e){return new this.constructor({factory:this.factory,ptrs:this.ptrs,...e})}deleteIn(e,n){for(const r of this.ptrs)r.deleteIn(e,n);return this}deleteList(e){for(const n of this.ptrs)n.deleteList(e);return this}deleteOut(e,n){for(const r of this.ptrs)r.deleteOut(e,n);return this}distinct(){const e=this.ptrs.reduce((n,r)=>(n.some(o=>Py(o,r))||n.push(r.trim()),n),[]);return this.clone({ptrs:e})}execute(e){return this.clone({ptrs:this.ptrs.flatMap(n=>n.execute(e))})}executeAll(e){let n=this;for(const r of e)n=n.execute(r);return n}filter(e){return this.clone({ptrs:[...this].filter(e).map(n=>n.ptrs[0])})}hasIn(e,n){return this.clone({ptrs:this.ptrs.flatMap(r=>r.hasIn(e,n))})}hasOut(e,n){return this.clone({ptrs:this.ptrs.flatMap(r=>r.hasOut(e,n))})}in(e,n){return this.clone({ptrs:this.ptrs.flatMap(r=>r.in(e,n))})}isAny(){return this.ptrs.length>0&&this.ptrs.some(e=>e.isAny())}isList(){return this.ptrs.length!==1?!1:this.ptrs[0].isList()}list(){if(!this.isList())return;const e=this.ptrs[0].list(),n=this;return(function*(){for(const r of e)yield n.clone({ptrs:[r]})})()}map(e){return[...this].map(e)}node(e){const n=this.dataset,r=[...e].map(o=>new ph({dataset:n,factory:this.factory,term:o}));return this.clone({ptrs:r})}out(e,n){return this.clone({ptrs:this.ptrs.flatMap(r=>r.out(e,n))})}*quads(){for(const{edges:e}of this.ptrs)for(const{quad:n}of e)yield n}trim(){return this.clone({ptrs:this.ptrs.map(e=>e.trim())})}*[Symbol.iterator](){for(const e of this.ptrs)yield this.clone({ptrs:[e]})}}Yt("http://www.w3.org/2002/07/owl#");const Si=Yt("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),ky=Yt("http://www.w3.org/2000/01/rdf-schema#"),ge=Yt("http://www.w3.org/ns/shacl#"),Al=Yt("https://schemas.link/shacl-next#"),su=Yt("http://www.w3.org/2001/XMLSchema#");function Dy(i){return i?`{${[...i.quads()].map(e=>qt(e)).join(" ")}}`:"{}"}function My(i){return i?`{${i.map(e=>Dy(e)).join(" ")}}`:"{}"}var el,_h;function Oy(){if(_h)return el;_h=1;var i=/\s/;function e(n){for(var r=n.length;r--&&i.test(n.charAt(r)););return r}return el=e,el}var tl,yh;function Fy(){if(yh)return tl;yh=1;var i=Oy(),e=/^\s+/;function n(r){return r&&r.slice(0,i(r)+1).replace(e,"")}return tl=n,tl}var nl,bh;function jy(){if(bh)return nl;bh=1;function i(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return nl=i,nl}var il,vh;function By(){if(vh)return il;vh=1;var i=typeof qi=="object"&&qi&&qi.Object===Object&&qi;return il=i,il}var rl,wh;function $y(){if(wh)return rl;wh=1;var i=By(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=i||e||Function("return this")();return rl=n,rl}var sl,xh;function wp(){if(xh)return sl;xh=1;var i=$y(),e=i.Symbol;return sl=e,sl}var ol,Eh;function qy(){if(Eh)return ol;Eh=1;var i=wp(),e=Object.prototype,n=e.hasOwnProperty,r=e.toString,o=i?i.toStringTag:void 0;function a(l){var u=n.call(l,o),f=l[o];try{l[o]=void 0;var h=!0}catch{}var g=r.call(l);return h&&(u?l[o]=f:delete l[o]),g}return ol=a,ol}var al,Sh;function zy(){if(Sh)return al;Sh=1;var i=Object.prototype,e=i.toString;function n(r){return e.call(r)}return al=n,al}var ll,Th;function Hy(){if(Th)return ll;Th=1;var i=wp(),e=qy(),n=zy(),r="[object Null]",o="[object Undefined]",a=i?i.toStringTag:void 0;function l(u){return u==null?u===void 0?o:r:a&&a in Object(u)?e(u):n(u)}return ll=l,ll}var ul,Lh;function Uy(){if(Lh)return ul;Lh=1;function i(e){return e!=null&&typeof e=="object"}return ul=i,ul}var cl,Ih;function Vy(){if(Ih)return cl;Ih=1;var i=Hy(),e=Uy(),n="[object Symbol]";function r(o){return typeof o=="symbol"||e(o)&&i(o)==n}return cl=r,cl}var dl,Ah;function Wy(){if(Ah)return dl;Ah=1;var i=Fy(),e=jy(),n=Vy(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;function f(h){if(typeof h=="number")return h;if(n(h))return r;if(e(h)){var g=typeof h.valueOf=="function"?h.valueOf():h;h=e(g)?g+"":g}if(typeof h!="string")return h===0?h:+h;h=i(h);var m=a.test(h);return m||l.test(h)?u(h.slice(2),m?2:8):o.test(h)?r:+h}return dl=f,dl}var hl,Nh;function Gy(){if(Nh)return hl;Nh=1;var i=Wy(),e=1/0,n=17976931348623157e292;function r(o){if(!o)return o===0?o:0;if(o=i(o),o===e||o===-e){var a=o<0?-1:1;return a*n}return o===o?o:0}return hl=r,hl}var fl,Rh;function Zy(){if(Rh)return fl;Rh=1;var i=Gy();function e(n){var r=i(n),o=r%1;return r===r?o?r-o:r:0}return fl=e,fl}var pl,Ch;function Xy(){if(Ch)return pl;Ch=1;var i=Zy(),e="Expected a function";function n(r,o){var a;if(typeof o!="function")throw new TypeError(e);return r=i(r),function(){return--r>0&&(a=o.apply(this,arguments)),r<=1&&(o=void 0),a}}return pl=n,pl}var gl,Ph;function Qy(){if(Ph)return gl;Ph=1;var i=Xy();function e(n){return i(2,n)}return gl=e,gl}var Jy=Qy();const on=rf(Jy);let kh=class{constructor({details:e,factory:n,options:r,results:o=[]}={}){this.details=e,this.factory=n,this.options=r,this.results=o,this._conforms=on(()=>!this.results.some(a=>a.severity.equals(ge.Info)||a.severity.equals(ge.Violation)||a.severity.equals(ge.Warning))),this._ptr=on(()=>this.build())}get conforms(){return this._conforms()}get dataset(){return this.ptr.dataset}get ptr(){return this._ptr()}get term(){return this.ptr.term}build(){const e=new Vs({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});e.addOut([Si.type],[ge.ValidationReport]).addOut([ge.conforms],[this.factory.literal(this.conforms.toString(),su.boolean)]);for(const n of this.results)e.addOut([ge.result],[this.factory.blankNode()],r=>{n.build(r,this.options)});return e}coverage(){return this.results.flatMap(e=>e.coverage())}};function Ky(i,e){return Object.entries(e).reduce((n,[r,o])=>(o&&o.termType&&(o=qt(o)),n.replace(`{$${r}}`,o).replace(`{?${r}}`,o)),i)}let Yy=class{constructor({args:e={},constraintComponent:n,factory:r,focusNode:o,message:a=[],path:l,results:u=[],severity:f,shape:h,source:g=[],value:m,valuePaths:d=[]}={}){this.args=e,this.constraintComponent=n,this.factory=r,this.focusNode=o,this.path=l||h.path,this.results=u,this.severity=f,this.shape=h,this.source=g,this.value=m,this.valuePaths=d,this._message=on(()=>(this.shape.message.length>0&&(a=this.shape.message),a.length===0&&(a=this.shape.ptr.node([this.constraintComponent]).out([ge.message]).terms),a.map(_=>r.literal(Ky(_.value,e),_.language||null))))}get message(){return this._message()}build(e,{details:n}={}){e.addOut([Si.type],[ge.ValidationResult]).addOut([ge.focusNode],this.focusNode.terms).addOut([ge.resultSeverity],[this.severity]).addOut([ge.sourceConstraint],this.source).addOut([ge.sourceConstraintComponent],[this.constraintComponent]).addOut([ge.sourceShape],this.shape.ptr.terms),this.message&&e.addOut([ge.resultMessage],this.message);const r=o=>{if(o.quantifier==="one")return o.predicates.length>1?e.node([this.factory.blankNode()]).addList([ge.alternativePath],o.predicates):o.start==="object"?e.node([this.factory.blankNode()]).addOut([ge.inversePath],[o.predicates[0]]):e.node([o.predicates[0]]);if(o.quantifier==="oneOrMore")return e.node([this.factory.blankNode()]).addOut([ge.oneOrMorePath],[o.predicates[0]]);if(o.quantifier==="zeroOrMore")return e.node([this.factory.blankNode()]).addOut([ge.zeroOrMorePath],[o.predicates[0]]);if(o.quantifier==="zeroOrOne")return e.node([this.factory.blankNode()]).addOut([ge.zeroOrOnePath],[o.predicates[0]])};if(this.path&&(this.path.length===1?e.addOut([ge.resultPath],r(this.path[0]).terms):e.addList([ge.resultPath],this.path.map(o=>r(o).term))),typeof this.value<"u"&&e.addOut([ge.value],this.value.terms),n)for(const o of this.results)e.addOut([ge.detail],[this.factory.blankNode()],a=>{o.build(a,{details:n})})}coverage(){return[...this.valuePaths.flatMap(e=>[...e.quads()]),...this.results.flatMap(e=>e.coverage())]}};class ou{constructor({factory:e,focusNode:n,options:r={debug:!1,details:!1},processed:o=new Set,report:a=new kh({factory:e,options:r}),results:l=new Map,shape:u,value:f,valueOrNode:h,valuePaths:g,values:m}={}){this.factory=e,this.focusNode=n,this.options=r,this.processed=o,this.report=a,this.results=l,this.shape=u,this.value=f,this.valuePaths=g,this.valueOrNode=h,this.values=m}create({child:e,focusNode:n=this.focusNode,shape:r=this.shape,value:o=this.value,valueOrNode:a=this.valueOrNode,valuePaths:l=this.valuePaths,values:u=this.values}={}){return new ou({factory:this.factory,focusNode:n,options:this.options,processed:this.processed,report:e?new kh({factory:this.factory,options:this.options}):this.report,results:this.results,shape:r,value:o,valueOrNode:a,valuePaths:l,values:u})}id({shape:e=this.shape}={}){return`${qt(e.ptr.term)} - ${qt(this.focusNode.term)} - ${My(this.valuePaths)}`}result(e){const n=new Yy({factory:this.factory,focusNode:this.focusNode,shape:this.shape,value:this.value,valuePaths:this.valuePaths,...e}),r=this.id();this.results.has(r)?this.results.get(r).add(n):this.results.set(r,new Set([n])),this.report.results.push(n)}debug(e,n){this.options.debug&&this.result({severity:Al.Debug,constraintComponent:e,...n})}trace(e,n){this.options.trace&&this.result({severity:Al.Trace,constraintComponent:e,...n})}test(e,n,r){e?this.debug(n,r):this.violation(n,r)}violation(e,n){this.result({constraintComponent:e,severity:this.shape.severity||ge.Violation,...n})}}function eb(){return{generic:tb()}}function tb(){return i=>{i.trace(Al.TraversalConstraintComponent,{args:{},message:[i.factory.literal("Traversal")],value:i.valueOrNode})}}class nb{constructor(e){this.validations=new Ii(e)}compile(e){const n=e.validator.options.coverage;if(e.deactivated)return[];let r=!1;const o=new Set;for(const a of e.ptr.execute({start:"subject",end:"predicate"})){const l=this.validations.get(a.term);l&&(o.add(l),a.term.equals(ge.property)&&(r=!0))}return n&&e.isPropertyShape&&!r&&o.add(eb),[...o].map(a=>a(e)).filter(Boolean)}}var gi={},mi={},Nr={},Rr={},Dh;function Xi(){if(Dh)return Rr;Dh=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.Translator=void 0;let i=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(n){throw new Error(`Invalid RDF ${n.datatype.value} value: '${n.value}'`)}registerHandler(n,r,o){for(const a of r)this.supportedRdfDatatypes.push(a),this.fromRdfHandlers[a.value]=n;for(const a of o){let l=this.toRdfHandlers[a];l||(this.toRdfHandlers[a]=l=[]),l.push(n)}}fromRdf(n,r){const o=this.fromRdfHandlers[n.datatype.value];return o?o.fromRdf(n,r):n.value}toRdf(n,r){const o=this.toRdfHandlers[typeof n];if(o)for(const a of o){const l=a.toRdf(n,r);if(l)return l}throw new Error(`Invalid JavaScript value: '${n}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}};return Rr.Translator=i,Rr}var Mh;function ib(){if(Mh)return Nr;Mh=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.TypeHandlerBoolean=void 0;const i=Xi();let e=class xp{fromRdf(r,o){switch(r.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return o&&i.Translator.incorrectRdfDataType(r),!1}toRdf(r,{datatype:o,dataFactory:a}){return a.literal(r?"true":"false",o||a.namedNode(xp.TYPE))}};return Nr.TypeHandlerBoolean=e,e.TYPE="http://www.w3.org/2001/XMLSchema#boolean",Nr}var Cr={},Oh;function rb(){if(Oh)return Cr;Oh=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.TypeHandlerDate=void 0;const i=Xi();let e=class Nl{fromRdf(r,o){switch(o&&!r.value.match(Nl.VALIDATORS[r.datatype.value.substr(33,r.datatype.value.length)])&&i.Translator.incorrectRdfDataType(r),r.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(r.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const a=r.value.split("-");return new Date(0,parseInt(a[0],10)-1,parseInt(a[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(r.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(r.value+"-01");default:return new Date(r.value)}}toRdf(r,{datatype:o,dataFactory:a}){if(o=o||a.namedNode(Nl.TYPES[0]),!(r instanceof Date))return null;const l=r;let u;switch(o.value){case"http://www.w3.org/2001/XMLSchema#gDay":u=String(l.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":u=l.getUTCMonth()+1+"-"+l.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":u=String(l.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":u=l.getUTCFullYear()+"-"+(l.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":u=l.toISOString().replace(/T.*$/,"");break;default:u=l.toISOString()}return a.literal(u,o)}};return Cr.TypeHandlerDate=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],e.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/},Cr}var Pr={},Fh;function sb(){if(Fh)return Pr;Fh=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.TypeHandlerNumberDouble=void 0;const i=Xi();let e=class Ep{fromRdf(r,o){const a=parseFloat(r.value);return o&&isNaN(a)&&i.Translator.incorrectRdfDataType(r),a}toRdf(r,{datatype:o,dataFactory:a}){return o=o||a.namedNode(Ep.TYPES[0]),isNaN(r)?a.literal("NaN",o):isFinite(r)?r%1===0?null:a.literal(r.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),o):a.literal(r>0?"INF":"-INF",o)}};return Pr.TypeHandlerNumberDouble=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"],Pr}var kr={},jh;function ob(){if(jh)return kr;jh=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.TypeHandlerNumberInteger=void 0;const i=Xi();let e=class jr{fromRdf(r,o){const a=parseInt(r.value,10);return o&&(isNaN(a)||r.value.indexOf(".")>=0)&&i.Translator.incorrectRdfDataType(r),a}toRdf(r,{datatype:o,dataFactory:a}){return a.literal(String(r),o||(r<=jr.MAX_INT&&r>=jr.MIN_INT?a.namedNode(jr.TYPES[0]):a.namedNode(jr.TYPES[1])))}};return kr.TypeHandlerNumberInteger=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],e.MAX_INT=2147483647,e.MIN_INT=-2147483648,kr}var Dr={},Bh;function ab(){if(Bh)return Dr;Bh=1,Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.TypeHandlerString=void 0;let i=class{fromRdf(n){return n.value}toRdf(n,{datatype:r,dataFactory:o}){return o.literal(n,r)}};return Dr.TypeHandlerString=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"],Dr}var $h;function qh(){return $h||($h=1,(function(i){var e=mi&&mi.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,l,u)}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),n=mi&&mi.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(i,"__esModule",{value:!0}),n(ib(),i),n(rb(),i),n(sb(),i),n(ob(),i),n(ab(),i)})(mi)),mi}var ml={},zh;function lb(){return zh||(zh=1,Object.defineProperty(ml,"__esModule",{value:!0})),ml}var Hh;function ub(){return Hh||(Hh=1,(function(i){var e=gi&&gi.__createBinding||(Object.create?(function(_,v,I,A){A===void 0&&(A=I);var N=Object.getOwnPropertyDescriptor(v,I);(!N||("get"in N?!v.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return v[I]}}),Object.defineProperty(_,A,N)}):(function(_,v,I,A){A===void 0&&(A=I),_[A]=v[I]})),n=gi&&gi.__exportStar||function(_,v){for(var I in _)I!=="default"&&!Object.prototype.hasOwnProperty.call(v,I)&&e(v,_,I)};Object.defineProperty(i,"__esModule",{value:!0}),i.fromRdf=f,i.toRdf=h,i.getTermRaw=g,i.getSupportedRdfDatatypes=m,i.getSupportedJavaScriptPrimitives=d;const r=Df(),o=qh(),a=Xi();n(qh(),i),n(lb(),i),n(Xi(),i);const l=new r.DataFactory,u=new a.Translator;u.registerHandler(new o.TypeHandlerString,o.TypeHandlerString.TYPES.map(_=>l.namedNode(_)),["string"]),u.registerHandler(new o.TypeHandlerBoolean,[o.TypeHandlerBoolean.TYPE].map(_=>l.namedNode(_)),["boolean"]),u.registerHandler(new o.TypeHandlerNumberDouble,o.TypeHandlerNumberDouble.TYPES.map(_=>l.namedNode(_)),["number"]),u.registerHandler(new o.TypeHandlerNumberInteger,o.TypeHandlerNumberInteger.TYPES.map(_=>l.namedNode(_)),["number"]),u.registerHandler(new o.TypeHandlerDate,o.TypeHandlerDate.TYPES.map(_=>l.namedNode(_)),["object"]);function f(_,v){return u.fromRdf(_,v)}function h(_,v){return v&&"namedNode"in v&&(v={dataFactory:v}),v=v||{},v&&!v.dataFactory&&(v.dataFactory=l),u.toRdf(_,v)}function g(_,v){return _.termType==="Literal"?f(_,v):_.value}function m(){return u.getSupportedRdfDatatypes()}function d(){return u.getSupportedJavaScriptPrimitives()}})(gi)),gi}var Zr=ub();function Uh(i){if(i.term.termType!=="BlankNode")return{quantifier:"one",start:"subject",end:"object",predicates:[i.term]};const e=i.out([ge.alternativePath]);if(e.ptrs.length===1&&e.ptrs[0].isList())return{quantifier:"one",start:"subject",end:"object",predicates:[...e.list()].map(l=>l.term)};const n=i.out([ge.inversePath]);if(n.term)return{quantifier:"one",start:"object",end:"subject",predicates:[n.term]};const r=i.out([ge.oneOrMorePath]);if(r.term)return{quantifier:"oneOrMore",start:"subject",end:"object",predicates:[r.term]};const o=i.out([ge.zeroOrMorePath]);if(o.term)return{quantifier:"zeroOrMore",start:"subject",end:"object",predicates:[o.term]};const a=i.out([ge.zeroOrOnePath]);if(a.term)return{quantifier:"zeroOrOne",start:"subject",end:"object",predicates:[a.term]}}function cb(i){return i.terms.length===0?null:i.ptrs[0].isList()?[...i.list()].map(e=>Uh(e)):[Uh(i)]}class db{constructor(e){this.shape=e,this._compiled=on(()=>this.shape.validator.registry.compile(e))}get compiled(){return this._compiled()}async validate(e){return e.focusNode.dataset.size===0||(this.shape.isPropertyShape?await this.validateProperty(e):await this.validateNode(e)),e}async validateNode(e){const n=e.create({shape:this.shape,valueOrNode:e.value||e.focusNode});for(const r of this.compiled)r.node&&await r.node(n),r.generic&&await r.generic(n)}async validateProperty(e){let n;this.shape.isSparqlShape?n=e.focusNode:n=e.focusNode.executeAll(this.shape.path);const r=n.node(new Jt(n.terms)),o=[...n].reduce((l,u)=>{const f=u.term,h=n.node([f]);return l.has(f)||l.set(f,{value:h,valuePaths:[]}),l.get(f).valuePaths.push(u),l},new Ii).values(),a=e.create({shape:this.shape,values:r});for(const l of this.compiled)l.property&&await l.property(a);for(const{value:l,valuePaths:u}of o){const f=e.create({shape:this.shape,value:l,valueOrNode:l,valuePaths:u});for(const h of this.compiled)h.generic&&await h.generic(f)}}}function Rl(i){const e=new Jt,r=new Vs({dataset:i.dataset,terms:i.terms}).execute({quantifier:"zeroOrMore",start:"object",end:"subject",predicates:[ky.subClassOf]});for(const o of r.ptrs)for(const{term:a}of o.nodes())e.add(a);return e}class hb{constructor(e,{registry:n}){this.registry=n,this.targetClass=new Jt([...Rl(e.hasOut([Si.type],[ge.NodeShape])),...Rl(e.out([ge.targetClass]))]),this.targetNode=e.out([ge.targetNode]).terms,this.targetObjectsOf=e.out([ge.targetObjectsOf]).terms,this.targetSubjectsOf=e.out([ge.targetSubjectsOf]).terms,this.targets=[...e.out([ge.target])]}async resolve(e){const n=e.focusNode.node([null]),r=[...e.focusNode.hasOut([Si.type],this.targetClass).ptrs,...e.focusNode.node(this.targetNode).ptrs,...n.execute({start:"object",end:"object",predicates:this.targetObjectsOf}).ptrs,...n.execute({start:"subject",end:"subject",predicates:this.targetSubjectsOf}).ptrs];for(const a of this.targets)for(const[,l]of this.registry.targetResolvers){const u=await l(a,e);r.push(...e.focusNode.node(u).ptrs)}const o=e.focusNode.clone({ptrs:r});return o.node([...new Jt(o.terms)])}}class fb{constructor(e,{validator:n}){this.ptr=e,this.validator=n,this._deactivated=on(()=>{const r=this.ptr.out([ge.deactivated]).term;return r&&Zr.fromRdf(r)}),this._message=on(()=>this.ptr.out([ge.message]).terms),this._path=on(()=>cb(this.ptr.out([ge.path]))),this._severity=on(()=>this.ptr.out([ge.severity]).term),this._shapeValidator=on(()=>new db(this)),this._sparql=on(()=>this.ptr.out([ge.sparql])),this._targetResolver=on(()=>new hb(this.ptr,{registry:this.validator.targetResolverRegistry}))}get deactivated(){return this._deactivated()}get isPropertyShape(){return!!this.path}get isSparqlShape(){return this.sparql.terms.length>0}get path(){return this._path()}get targetResolver(){return this._targetResolver()}get message(){return this._message()}get severity(){return this._severity()}get shapeValidator(){return this._shapeValidator()}get sparql(){return this._sparql()}async resolveTargets(e){return this.targetResolver.resolve(e)}async validate(e){const n=e.id({shape:this});if(e.processed.has(n)){if(e.results.has(n))for(const r of e.results.get(n))e.report.results.push(r);return e}return e.processed.add(n),this.shapeValidator.validate(e)}}class pb{constructor(e){this.targetResolvers=new Ii(e)}}function gb(i){const e=parseInt(i.ptr.out([ge.maxCount]).value);return{property:mb(e)}}function mb(i){return e=>{e.test(e.values.terms.length<=i,ge.MaxCountConstraintComponent,{args:{maxCount:i},message:[e.factory.literal("More than {$maxCount} values")]})}}function _b(i){const e=parseInt(i.ptr.out([ge.minCount]).value);return{property:yb(e)}}function yb(i){return e=>{e.test(e.values.terms.length>=i,ge.MinCountConstraintComponent,{args:{minCount:i},message:[e.factory.literal("Less than {$minCount} values")]})}}async function bb(i,e){for(const n of i)if(!await e(n))return!1;return!0}async function vb(i,e){return(await Promise.all(i.map(n=>e(n)))).filter(Boolean)}async function oo(i,e){return Promise.all(i.map(e))}async function wb(i,e){for(const n of i)if(await e(n))return!0;return!1}function xb(i){const e=[...i.ptr.out([ge.and])].flatMap(n=>[...n.list()]).map(n=>i.validator.shape(n));return{generic:Eb(e)}}function Eb(i){return async e=>{const n=await oo(i,async o=>(await o.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report),r=n.every(o=>o.conforms);e.test(r,ge.AndConstraintComponent,{results:n.flatMap(o=>o.results),value:e.valueOrNode})}}function Sb(i){const e=i.validator.shape(i.ptr.out([ge.not]));return{generic:Tb(e)}}function Tb(i){return async e=>{const n=(await i.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report,r=!n.conforms;e.test(r,ge.NotConstraintComponent,{args:{not:i.ptr.term},message:[e.factory.literal("Value does have shape {$not}")],results:n.results,value:e.valueOrNode})}}function Lb(i){const e=[...i.ptr.out([ge.or])].flatMap(n=>[...n.list()]).map(n=>i.validator.shape(n));return{generic:Ib(e)}}function Ib(i){return async e=>{let n=[],r;if(e.options.debug||e.options.details){const o=await oo(i,async a=>(await a.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report);n=o.flatMap(a=>a.results),r=o.some(a=>a.conforms)}else r=await wb(i,async o=>(await o.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report.conforms);e.test(r,ge.OrConstraintComponent,{results:n,value:e.valueOrNode})}}function Ab(i){const e=[...i.ptr.out([ge.xone])].flatMap(n=>[...n.list()]).map(n=>i.validator.shape(n));return{generic:Nb(e)}}function Nb(i){return async e=>{const n=await oo(i,async o=>(await o.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report),r=n.filter(o=>o.conforms).length===1;e.test(r,ge.XoneConstraintComponent,{results:n.flatMap(o=>o.results),value:e.valueOrNode})}}function Rb(i){if(!Zr.fromRdf(i.ptr.out([ge.closed]).term))return null;const n=i.ptr.out([ge.property]).map(a=>i.validator.shape(a)),r=new Jt(n.filter(a=>!a.deactivated).map(a=>a.path[0].predicates[0])),o=new Jt([...i.ptr.out([ge.ignoredProperties]).list()||[]].map(a=>a.term));return{node:Cb(r,o)}}function Cb(i,e){return n=>{const r=n.focusNode.execute({start:"subject",end:"predicate"}).filter(o=>e.has(o.term)?!1:!i.has(o.term));if(r.ptrs.length>0)for(const o of r)n.violation(ge.ClosedConstraintComponent,{message:[n.factory.literal("Predicate is not allowed (closed shape)")],path:[{quantifier:"one",start:"subject",end:"object",predicates:[o.term]}],value:n.focusNode.node([[...o.quads()][0].object])});else n.debug(ge.ClosedConstraintComponent)}}function Pb(i){const e=i.ptr.out([ge.hasValue]).term;return{node:kb(e),property:Db(e)}}function kb(i){return e=>{e.test(i.equals(e.valueOrNode.term),ge.HasValueConstraintComponent,{args:{hasValue:i},message:[e.factory.literal("Value must be {$hasValue}")]})}}function Db(i){return e=>{const n=[...e.values].some(r=>i.equals(r.term));e.test(n,ge.HasValueConstraintComponent,{args:{hasValue:i},message:[e.factory.literal("Missing expected value {$hasValue}")]})}}function Mb(i){const e=new Jt([...i.ptr.out([ge.in]).list()].map(n=>n.term));return{generic:Ob(e)}}function Ob(i){return e=>{e.test(i.has(e.valueOrNode.term),ge.InConstraintComponent,{args:{in:[...i].map(n=>n.value).join(", ")},message:[e.factory.literal("Value is not in {$in}")],value:e.valueOrNode})}}function Yi(i,e){if(!i||i.termType!=="Literal"||!e||e.termType!=="Literal"||Vh(i)!==Vh(e))return null;const n=Zr.fromRdf(i),r=Zr.fromRdf(e);return typeof n!=typeof r?null:typeof n=="string"?n.localeCompare(r):n-r}function Vh(i){const e=/^.*(((\+|-)\d{2}:\d{2})|Z)$/;return su.dateTime.equals(i.datatype)&&e.test(i.value)}function Fb(i){const e=i.ptr.out([ge.disjoint]).term;return{generic:jb(e)}}function jb(i){return e=>{const n=e.focusNode.dataset.match(e.focusNode.term,i,e.valueOrNode.term);e.test(n.size===0,ge.DisjointConstraintComponent,{args:{disjoint:i},message:[e.factory.literal("Value node must not also be one of the values of {$disjoint}")],value:e.valueOrNode})}}function Bb(i){const e=i.ptr.out([ge.equals]).term;return{node:$b(e),property:qb(e)}}function $b(i){return e=>{const n=e.focusNode.out([i]),r=n.filter(a=>!a.term.equals(e.focusNode.term)),o=n.terms.length!==0&&r.terms.length===0;e.test(o,ge.EqualsConstraintComponent,{args:{equals:i},message:[e.factory.literal("Must have same values as {$equals}")],value:r.terms[0]&&e.focusNode.node([r.terms[0]])||e.focusNode})}}function qb(i){return e=>{const n=new Jt(e.focusNode.out([i]).terms),r=new Jt(e.values.terms),o=[...r].filter(u=>!n.has(u)),a=[...n].filter(u=>!r.has(u)),l=[...o,...a];for(const u of l)e.violation(ge.EqualsConstraintComponent,{args:{equals:i},message:[e.factory.literal("Must have same values as {$equals}")],value:e.focusNode.node([u])});l.length===0&&e.debug(ge.EqualsConstraintComponent,{args:{equals:i},message:[e.factory.literal("Must have same values as {$equals}")]})}}function zb(i){const e=i.ptr.out([ge.lessThan]).term;return{property:Hb(e)}}function Hb(i){return e=>{const n=e.focusNode.out([i]).terms;for(const r of e.values)for(const o of n){const a=Yi(r.term,o);a===null||a>=0?e.violation(ge.LessThanConstraintComponent,{args:{lessThan:i},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:r}):e.debug(ge.LessThanConstraintComponent,{args:{lessThan:i},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:r})}}}function Ub(i){const e=i.ptr.out([ge.lessThanOrEquals]).term;return{property:Vb(e)}}function Vb(i){return e=>{const n=e.focusNode.out([i]).terms;for(const r of e.values)for(const o of n){const a=Yi(r.term,o);a===null||a>0?e.violation(ge.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:i},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:r}):e.debug(ge.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:i},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:r})}}}function Wb(i){const e=i.ptr.out([ge.maxExclusive]).term;return{generic:Gb(e)}}function Gb(i){return e=>{const n=Yi(e.valueOrNode.term,i);e.test(n!==null&&n<0,ge.MaxExclusiveConstraintComponent,{args:{maxExclusive:i},message:[e.factory.literal("Value is not less than {$maxExclusive}")],value:e.valueOrNode})}}function Zb(i){const e=i.ptr.out([ge.maxInclusive]).term;return{generic:Xb(e)}}function Xb(i){return e=>{const n=Yi(e.valueOrNode.term,i);e.test(n!==null&&n<=0,ge.MaxInclusiveConstraintComponent,{args:{maxInclusive:i},message:[e.factory.literal("Value is not less than or equal to {$maxInclusive}")],value:e.valueOrNode})}}function Qb(i){const e=i.ptr.out([ge.minExclusive]).term;return{generic:Jb(e)}}function Jb(i){return e=>{const n=Yi(e.valueOrNode.term,i);e.test(n!==null&&n>0,ge.MinExclusiveConstraintComponent,{args:{minExclusive:i},message:[e.factory.literal("Value is not greater than {$minExclusive}")],value:e.valueOrNode})}}function Kb(i){const e=i.ptr.out([ge.minInclusive]).term;return{generic:Yb(e)}}function Yb(i){return e=>{const n=Yi(e.valueOrNode.term,i);e.test(n!==null&&n>=0,ge.MinInclusiveConstraintComponent,{args:{minInclusive:i},message:[e.factory.literal("Value is not greater than or equal to {$minInclusive}")],value:e.valueOrNode})}}function ev(i){const e=[...i.ptr.out([ge.node])].map(n=>i.validator.shape(n));return{generic:tv(e)}}function tv(i){return async e=>{for(const n of i){const r=await n.validate(e.create({child:!0,focusNode:e.valueOrNode}));e.test(r.report.conforms,ge.NodeConstraintComponent,{args:{node:n.ptr.term},message:[e.factory.literal("Value does not have shape {$node}")],results:r.report.results,value:e.valueOrNode})}}}function nv(i){const e=[...i.ptr.out([ge.property])].map(n=>i.validator.shape(n));return{generic:iv(e)}}function iv(i){return async e=>{const n=e.create({focusNode:e.valueOrNode});for(const r of i)await r.validate(n)}}function rv(i){const e=i.validator.shape(i.ptr.out([ge.qualifiedValueShape])),n=i.ptr.out([ge.qualifiedValueShapesDisjoint]).term,r=n?Zr.fromRdf(n):!1,o=i.ptr.out([ge.qualifiedMaxCount]).term,a=o?parseInt(o.value):null,l=i.ptr.out([ge.qualifiedMinCount]).term,u=l?parseInt(l.value):null;return{property:sv(e,r,a,u)}}function sv(i,e,n,r){return async o=>{const a=[];let l=[];e&&(l=new Set(o.shape.ptr.in([ge.property]).out([ge.property]).out([ge.qualifiedValueShape]).filter(f=>!f.term.equals(i.ptr.term)).map(f=>o.shape.validator.shape(f))));const u=(await vb(o.values,async f=>{const h=(await i.validate(o.create({child:!0,focusNode:f}))).report;if(a.push(h.results),!h.conforms)return!1;if(l.length===0)return!0;if(o.options.debug||o.options.details){const g=await oo([...l],async m=>(await m.validate(o.create({child:!0,focusNode:f}))).report);return a.push(g.flatMap(m=>m.results)),!g.every(m=>m.conforms)}else return!await bb([...l],async g=>(await g.validate(o.create({child:!0,focusNode:f}))).report.conforms)})).length;n!==null&&o.test(u<=n,ge.QualifiedMaxCountConstraintComponent,{args:{qualifiedMaxCount:n,qualifiedValueShape:i.ptr.term,qualifiedValueShapesDisjoint:e},message:[o.factory.literal("More than {$qualifiedMaxCount} values have shape {$qualifiedValueShape}")],results:a.flat()}),r!==null&&o.test(u>=r,ge.QualifiedMinCountConstraintComponent,{args:{qualifiedMinCount:r,qualifiedValueShape:i.ptr.term,qualifiedValueShapesDisjoint:e},message:[o.factory.literal("Less than {$qualifiedMinCount} values have shape {$qualifiedValueShape}")],results:a.flat()})}}function ov(i,e){return e?e.slice(0,i.length)===i:!1}function av(i){const e=[...new Set([...i.ptr.out([ge.languageIn]).list()].map(n=>n.value))];return{generic:lv(e)}}function lv(i){return e=>{const n=i.some(r=>ov(r,e.valueOrNode.term.language));e.test(n,ge.LanguageInConstraintComponent,{args:{languageIn:i.join(", ")},message:[e.factory.literal("Language does not match any of {$languageIn}")],value:e.valueOrNode})}}function uv(i){const e=parseInt(i.ptr.out([ge.maxLength]).value);return{generic:cv(e)}}function cv(i){return e=>{const n=e.valueOrNode.term.termType!=="BlankNode"&&e.valueOrNode.value.length<=i;e.test(n,ge.MaxLengthConstraintComponent,{args:{maxLength:i},message:[e.factory.literal("Value has more than {$maxLength} characters")],value:e.valueOrNode})}}function dv(i){const e=parseInt(i.ptr.out([ge.minLength]).value);return{generic:hv(e)}}function hv(i){return e=>{const n=e.valueOrNode.term.termType!=="BlankNode"&&e.valueOrNode.value.length>=i;e.test(n,ge.MinLengthConstraintComponent,{args:{minLength:i},message:[e.factory.literal("Value has less than {$minLength} characters")],value:e.valueOrNode})}}function fv(i){const e=i.ptr.out([ge.pattern]).value,n=i.ptr.out([ge.flags]).value,r=new RegExp(e,n);return{generic:pv(e,n,r)}}function pv(i,e,n){return r=>{r.test(n.test(r.valueOrNode.term.value),ge.PatternConstraintComponent,{args:{flags:e,pattern:i},message:[r.factory.literal('Value does not match pattern "{$pattern}"')],value:r.valueOrNode})}}function gv(i){const e=i.ptr.out([ge.uniqueLang]).term;return e.value==="true"&&su.boolean.equals(e.datatype)?{property:mv()}:null}function mv(){return i=>{const n=Object.entries(i.values.terms.reduce((r,o)=>(o.language&&(r[o.language]=(r[o.language]||0)+1),r),{})).filter(([,r])=>r>1);for(const[r]of n)i.violation(ge.UniqueLangConstraintComponent,{args:{lang:r},message:[i.factory.literal('Language "{?lang}" used more than once')]});n.length===0&&i.debug(ge.UniqueLangConstraintComponent)}}const Fs=Yt("http://www.w3.org/ns/shacl#"),Sp=Yt("https://schemas.link/shacl-next#");class Qi{constructor({results:e=[]}={}){this.results=e}get conforms(){return!this.results.some(e=>e.severity.equals(Fs.Info)||e.severity.equals(Fs.Violation)||e.severity.equals(Fs.Warning))}}function _v(i,e){return Object.entries(e).reduce((n,[r,o])=>(o&&o.termType&&(o=qt(o)),n.replace(`{$${r}}`,o).replace(`{?${r}}`,o)),i)}class Ws{constructor({args:e={},factory:n,message:r=[],severity:o=Fs.Violation}={}){this.severity=o,this.message=r.map(a=>n.literal(_v(a.value,e),a.language||null))}}class au{constructor({factory:e=ru}={}){this.factory=e}clone({factory:e}={}){return new au({factory:e||this.factory})}validate(){return new Qi}validateSimple(){return!0}}class er extends au{constructor({datatypes:e,factory:n}={}){super({factory:n}),this.datatypes=[];for(const r of Array.isArray(e)?e:[e])r&&this.datatypes.push(this.factory.fromTerm(r))}clone({factory:e}={}){return new er({datatypes:this.datatypes,factory:e||this.factory})}}class yv{constructor({factory:e=ru,validations:n}={}){if(this.factory=e,this.validations=new Ii,n)for(const r of Object.values(n)){const o=r.clone({factory:this.factory});for(const a of o.datatypes)this.validations.set(a,o)}}validate(e){const n=this.validations.get(e.datatype);return n?n.validate(e):new Qi}validateSimple(e){const n=this.validations.get(e.datatype);return n?n.validateSimple(e):!0}}class ot extends er{constructor(e,n,{factory:r}={}){super({datatypes:n,factory:r}),this.message=[this.factory.literal("term value {$this} matches pattern {$pattern}")],this.patterns=Array.isArray(e)?e:[e]}clone({factory:e}={}){return new ot(this.patterns,this.datatypes,{factory:e||this.factory})}validate(e){const n=this.patterns.map(r=>{let o;r.test(e.value)&&(o=Sp.Debug);const a={pattern:this.factory.literal(r.toString()),this:e};return new Ws({args:a,factory:this.factory,message:this.message,severity:o})});return new Qi({results:n})}validateSimple(e){return this.patterns.every(n=>n.test(e.value))}}const bv=/^([-+]?[0-9]+)$/;class Mt extends ot{constructor(e=null,n=null,r,{factory:o}={}){super(bv,r,{factory:o}),this.maxInclusive=null,this.minInclusive=null,typeof n=="string"&&(this.maxInclusive=BigInt(n)),typeof e=="string"&&(this.minInclusive=BigInt(e))}clone({factory:e}={}){return new Mt(this.minInclusive?.toString(),this.maxInclusive?.toString(),this.datatypes,{factory:e||this.factory})}validate(e){const n=super.validate(e).results;if(!Sp.Debug.equals(n[0].severity))return new Qi({results:n});const r=BigInt(e.value);if(this.minInclusive!==null&&r<this.minInclusive){const o=`term value "${e.value}" is less than "${this.minInclusive.toString()}"`,a=[this.factory.literal(o)];n.push(new Ws({factory:this.factory,message:a}))}if(this.maxInclusive!==null&&r>this.maxInclusive){const o=`term value "${e.value}" is greater than "${this.maxInclusive.toString()}"`,a=[this.factory.literal(o)];n.push(new Ws({factory:this.factory,message:a}))}return new Qi({results:n})}validateSimple(e){if(!super.validateSimple(e))return!1;const n=BigInt(e.value);return!(this.minInclusive!==null&&n<this.minInclusive||this.maxInclusive!==null&&n>this.maxInclusive)}}class lu extends er{constructor(e,n,{factory:r}={}){super({datatypes:n,factory:r}),this.values=new Set(e)}clone({factory:e}={}){return new lu(this.values,this.datatypes,{factory:e||this.factory})}validate(e){const n=[];if(!this.values.has(e.value)){const r=`term value "${e.value}" is not included in the list: ${[...this.values].join(",")}`,o=[this.factory.literal(r)];n.push(new Ws({factory:this.factory,message:o}))}return new Qi({results:n})}validateSimple(e){return this.values.has(e.value)}}const We={xsd:Yt("http://www.w3.org/2001/XMLSchema#")},vv=new er({datatypes:We.xsd.anySimpleType}),wv=new er({datatypes:We.xsd.anyAtomicType}),ao=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,xv=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,Tp=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,uu=/^(-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))))$/,Lp=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Ev=/^((([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Sv=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Tv=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Lv=/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Iv=/^(--(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Av=/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Nv=/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Rv=/^(([0-9a-fA-F]{2})*)$/,Cv=/^(((([A-Za-z0-9+/] ?){4})*(([A-Za-z0-9+/] ?){3}[A-Za-z0-9+/]|([A-Za-z0-9+/] ?){2}[AEIMQUYcgkosw048] ?=|[A-Za-z0-9+/] ?[AQgw] ?= ?=))?)$/,Pv=new ot(ao,We.xsd.string),kv=new lu(["1","true","0","false"],We.xsd.boolean),Dv=new ot(xv,We.xsd.decimal),Mv=new ot(Tp,We.xsd.float),Ov=new ot(Tp,We.xsd.double),Fv=new ot(uu,We.xsd.duration),jv=new ot(Lp,We.xsd.dateTime),Bv=new ot(Ev,We.xsd.time),$v=new ot(Sv,We.xsd.date),qv=new ot(Tv,We.xsd.gYearMonth),zv=new ot(Lv,We.xsd.gYear),Hv=new ot(Iv,We.xsd.gMonthDay),Uv=new ot(Av,We.xsd.gDay),Vv=new ot(Nv,We.xsd.gMonth),Wv=new ot(Rv,We.xsd.hexBinary),Gv=new ot(Cv,We.xsd.base64Binary),Zv=new ot(ao,We.xsd.anyURI),Ip=/^([^\u000d\u000a\u0009]*)$/,Xv=/^([^ ]+( [^ ]+)*)*$/,Qv=/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,Jv=/^([^DT]*)$/,Kv=/^([^YM]*[DT].*)$/,Yv=/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/,e0=new ot([ao,Ip],We.xsd.normalizedString),t0=new ot([ao,Ip,Xv],We.xsd.token),n0=new ot(Qv,We.xsd.language),i0=new Mt(null,null,We.xsd.integer),r0=new Mt(null,"0",We.xsd.nonPositiveInteger),s0=new Mt(null,"-1",We.xsd.negativeInteger),o0=new Mt("-9223372036854775808","9223372036854775807",We.xsd.long),a0=new Mt("-2147483648","2147483647",We.xsd.int),l0=new Mt("-32768","32767",We.xsd.short),u0=new Mt("-128","127",We.xsd.byte),c0=new Mt("0",null,We.xsd.nonNegativeInteger),d0=new Mt("0","18446744073709551615",We.xsd.unsignedLong),h0=new Mt("0","4294967295",We.xsd.unsignedInt),f0=new Mt("0","65535",We.xsd.unsignedShort),p0=new Mt("0","255",We.xsd.unsignedByte),g0=new Mt("1",null,We.xsd.positiveInteger),m0=new ot([uu,Jv],We.xsd.yearMonthDuration),_0=new ot([uu,Kv],We.xsd.dayTimeDuration),y0=new ot([Lp,Yv],We.xsd.dateTimeStamp),b0=Object.freeze(Object.defineProperty({__proto__:null,anyAtomicType:wv,anySimpleType:vv,anyURI:Zv,base64Binary:Gv,boolean:kv,byte:u0,date:$v,dateTime:jv,dateTimeStamp:y0,dayTimeDuration:_0,decimal:Dv,double:Ov,duration:Fv,float:Mv,gDay:Uv,gMonth:Vv,gMonthDay:Hv,gYear:zv,gYearMonth:qv,hexBinary:Wv,int:a0,integer:i0,language:n0,long:o0,negativeInteger:s0,nonNegativeInteger:c0,nonPositiveInteger:r0,normalizedString:e0,positiveInteger:g0,short:l0,string:Pv,time:Bv,token:t0,unsignedByte:p0,unsignedInt:h0,unsignedLong:d0,unsignedShort:f0,yearMonthDuration:m0},Symbol.toStringTag,{value:"Module"}));class v0 extends yv{constructor({factory:e}={}){super({factory:e,validations:{...b0}})}}const w0=new Ii([[ge.BlankNode,new Set(["BlankNode"])],[ge.BlankNodeOrIRI,new Set(["BlankNode","NamedNode"])],[ge.BlankNodeOrLiteral,new Set(["BlankNode","Literal"])],[ge.IRI,new Set(["NamedNode"])],[ge.IRIOrLiteral,new Set(["NamedNode","Literal"])],[ge.Literal,new Set(["Literal"])]]);function x0(i){const e=i.ptr.out([ge.class]).map(n=>Rl(n));return{generic:E0(e)}}function E0(i){return e=>{const n=new Jt(e.valueOrNode.out([Si.type]).terms);for(const r of i){const o=[...n].some(a=>r.has(a));e.test(o,ge.ClassConstraintComponent,{value:e.valueOrNode})}}}function S0(i){const e=i.ptr.out([ge.datatype]).term,n=new v0;return{generic:T0(e,n)}}function T0(i,e){return n=>{const r=i.equals(n.valueOrNode.term.datatype)&&e.validateSimple(n.valueOrNode.term);n.test(r,ge.DatatypeConstraintComponent,{args:{datatype:i},message:[n.factory.literal("Value does not have datatype {$datatype}")],value:n.valueOrNode})}}function L0(i){const e=i.ptr.out([ge.nodeKind]).term,n=w0.get(e);return{generic:I0(e,n)}}function I0(i,e){return n=>{n.test(e.has(n.valueOrNode.term.termType),ge.NodeKindConstraintComponent,{args:{nodeKind:i},message:[n.factory.literal("Value does not have node kind {$nodeKind}")],value:n.valueOrNode})}}const A0=new Ii([[ge.maxCount,gb],[ge.minCount,_b],[ge.and,xb],[ge.not,Sb],[ge.or,Lb],[ge.xone,Ab],[ge.closed,Rb],[ge.hasValue,Pb],[ge.in,Mb],[ge.disjoint,Fb],[ge.equals,Bb],[ge.lessThan,zb],[ge.lessThanOrEquals,Ub],[ge.maxExclusive,Wb],[ge.maxInclusive,Zb],[ge.minExclusive,Qb],[ge.minInclusive,Kb],[ge.node,ev],[ge.property,nv],[ge.qualifiedValueShape,rv],[ge.languageIn,av],[ge.maxLength,uv],[ge.minLength,dv],[ge.pattern,fv],[ge.uniqueLang,gv],[ge.class,x0],[ge.datatype,S0],[ge.nodeKind,L0]]);class Wh{constructor(e,{factory:n,...r}){if(this.factory=n,this.options=r,this.registry=new nb(A0),this.targetResolverRegistry=new pb(this.options.targetResolvers||[]),this.shapesPtr=new Vs({dataset:e,factory:n}),this.shapes=new Ii,this.options.coverage&&(this.options.debug=!0,this.options.details=!0,this.options.trace=!0),this.options.validations)for(const[a,l]of this.options.validations)this.registry.validations.set(a,l);const o=[...this.shapesPtr.hasOut([ge.targetClass]),...this.shapesPtr.hasOut([ge.targetNode]),...this.shapesPtr.hasOut([ge.targetObjectsOf]),...this.shapesPtr.hasOut([ge.targetSubjectsOf]),...this.shapesPtr.hasOut([ge.target]),...this.shapesPtr.hasOut([Si.type],[ge.NodeShape]),...this.shapesPtr.hasOut([Si.type],[ge.PropertyShape])];for(const a of o)this.shape(a)}shape(e){if(!e.term)return null;let n=this.shapes.get(e.term);return n||(n=new fb(e,{validator:this}),this.shapes.set(e.term,n)),n}async validate(e,n){const r=new Vs({...e,factory:this.factory}),o=new ou({factory:this.factory,focusNode:r,options:this.options,validator:this});n?n=n.map(a=>this.shape(this.shapesPtr.node(a.terms))):n=this.shapes.values();for(const a of n){const l=o.create({shape:a});let u;r.isAny()?u=await a.resolveTargets(l):u=r;for(const f of u)await a.validate(l.create({focusNode:f}))}return o.report}}const N0={[`${Fe}node`]:(i,e)=>{i.extendedShapes.add(new Gs(e,i.config,i))},[`${Fe}and`]:(i,e)=>{for(const n of i.config.lists[e.value])i.extendedShapes.add(new Gs(n,i.config,i))},[`${Fe}property`]:(i,e)=>{const n=i.config.getPropertyTemplate(e,i);if(n.path){let r=i.properties[n.path];if(r||(r=[],i.properties[n.path]=r),n.qualifiedValueShape)r.push(n);else{let o;for(let a=0;a<i.properties[n.path].length&&!o;a++)i.properties[n.path][a].qualifiedValueShape||(o=i.properties[n.path][a]);o?Uf(o,n):r.push(n)}}},[`${Fe}nodeKind`]:(i,e)=>{i.nodeKind=e},[`${Fe}targetClass`]:(i,e)=>{i.targetClass=e},[`${Fe}or`]:(i,e)=>{i.or=i.config.lists[e.value]},[`${Fe}xone`]:(i,e)=>{i.xone=i.config.lists[e.value]},[$l.id]:(i,e)=>{i.owlImports.add(e)},[`${Bl}title`]:(i,e)=>{const n=e;i.label=Bs(i.config.languages,i.label,n)},[`${Ks}label`]:(i,e)=>{const n=e;i.label=Bs(i.config.languages,i.label,n)}};class Gs{constructor(e,n,r){this.extendedShapes=new Set,this.properties={},this.owlImports=new Set,this.id=e,this.config=n,this.parent=r,n.registerNodeTemplate(this),R0(this,this.config.store.getQuads(e,null,null,null))}}function R0(i,e){for(const n of e)N0[n.predicate.id]?.call(i,i,n.object);return i}function C0(i){for(const e of Object.values(i.properties))for(const n of e){const[r,o]=Cl(i,n.path);if(r.length>1&&o){const a=r[r.length-1];for(let l=r.length-2;l>=0;l--){const u=r[l];delete u.parent.properties[u.path],Uf(a,u)}}}}function Cl(i,e,n=new Set,r=[],o=!1){if(!n.has(i.id.value)){n.add(i.id.value);const a=i.properties[e];if(a?.length===1){r.push(a[0]),o=o||a[0].maxCount===1;for(const l of a[0].nodeShapes){const[u,f]=Cl(l,e,n,r,o);o=o||f}}for(const l of i.extendedShapes){const[u,f]=Cl(l,e,n,r,o);o=o||f}}return[r,o]}class _l{constructor(){this.shapes=null,this.shapesUrl=null,this.shapeSubject=null,this.values=null,this.valuesUrl=null,this.valueSubject=null,this.valuesSubject=null,this.valuesNamespace="",this.valuesGraph=null,this.view=null,this.language=null,this.loading="Loading…",this.proxy=null,this.ignoreOwlImports=null,this.collapse=null,this.hierarchyColors=null,this.submitButton=null,this.generateNodeShapeReference=Qr.value,this.showNodeIds=null,this.showRootShapeLabel=null,this.dense="true",this.useShadowRoot="true"}}const P0="#4c93d785, #f85e9a85, #00327385, #87001f85";class Gh{constructor(e){this.attributes=new _l,this.editMode=!0,this.lists={},this.groups=[],this.renderedNodes=new Set,this._store=new It,this._nodeTemplates={},this._propertyTemplates={},this.validator=new Wh(this._store,{details:!0,factory:Be}),this.providedConformingResourceIds={},this.providedResources={},this.form=e,this._theme=new _y,this.languages=[...new Set(navigator.languages.flatMap(n=>n.length>2?[n.toLocaleLowerCase(),n.substring(0,2)]:n)),""]}reset(){this.lists={},this.groups=[],this.renderedNodes.clear(),this.providedConformingResourceIds={},this.providedResources={},this._nodeTemplates={},this._propertyTemplates={}}updateAttributes(e){const n=new _l;if(Object.keys(n).forEach(r=>{const o=e.dataset[r];o!==void 0&&(n[r]=o)}),this.editMode=n.view===null,this.theme.setDense(n.dense==="true"),this.attributes=n,this.attributes.valueSubject&&!this.attributes.valuesSubject&&(this.attributes.valuesSubject=this.attributes.valueSubject),n.language){const r=this.languages.indexOf(n.language);r>-1&&this.languages.splice(r,1),this.languages.unshift(n.language)}if(n.valuesGraph&&(this.valuesGraphId=Be.namedNode(n.valuesGraph)),n.hierarchyColors!=null){const r=n.hierarchyColors.length?n.hierarchyColors:P0;let o=`:host { --hierarchy-colors: ${r}; --hierarchy-colors-length: ${r.split(",").length} }`;for(let a=8;a>=0;a--){let l=`shacl-property { --hierarchy-level: ${a} }`;for(let u=0;u<a;u++)l="shacl-property "+l;o=o+`
|
|
430
|
+
`+l}this.hierarchyColorsStyleSheet=new CSSStyleSheet,this.hierarchyColorsStyleSheet.replaceSync(o)}}static dataAttributes(){const e=new _l;return Object.keys(e).map(n=>(n=n.replace(/[A-Z]/g,r=>"-"+r.toLowerCase()),"data-"+n))}buildTemplateKey(e,n){let r=e.value;return n&&(n instanceof Hd?r+="*"+n.id.value:r+="*"+this.buildTemplateKey(n.id,n.parent)),r}registerNodeTemplate(e){this._nodeTemplates[this.buildTemplateKey(e.id,e.parent)]=e}registerPropertyTemplate(e){this._propertyTemplates[this.buildTemplateKey(e.id,e.parent)]=e}getNodeTemplateIds(){const e=new Set;for(const n of Object.values(this._nodeTemplates))e.add(n.id.value);return e}getNodeTemplate(e,n){const r=this.buildTemplateKey(e,n);let o=this._nodeTemplates[r];return o||(o=new Gs(e,this,n)),o}getPropertyTemplate(e,n){const r=this.buildTemplateKey(e,n);let o=this._propertyTemplates[r];return o||(o=new Hd(e,n)),o}get nodeTemplates(){return Object.values(this._nodeTemplates)}get theme(){return this._theme}set theme(e){this._theme=e,e.setDense(this.attributes.dense==="true")}get store(){return this._store}set store(e){this._store=e,this.lists=cm(e,{ignoreErrors:!0}),this.groups=[],e.forSubjects(n=>{this.groups.push(n.id)},At,`${Fe}PropertyGroup`,null),this.validator=new Wh(e,{details:!0,factory:Be})}}const k0=200;class D0 extends HTMLElement{constructor(){super(),this.shape=null,this.styleElement=null,this.form=document.createElement("form"),this.form.setAttribute("part","form"),this.config=new Gh(this.form),this.form.addEventListener("change",e=>{e.stopPropagation(),this.config.editMode&&this.validate(!0).then(n=>{this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,composed:!0,detail:{valid:n.conforms,report:n}}))}).catch(n=>{console.warn(n)})})}static get observedAttributes(){return Gh.dataAttributes()}connectedCallback(){this.config.updateAttributes(this),this.ensureRenderRoot(),this.initialize()}attributeChangedCallback(){this.config.updateAttributes(this),this.ensureRenderRoot(),this.initialize()}initialize(){clearTimeout(this.initDebounceTimeout),this.setAttribute("loading",""),this.form.replaceChildren(document.createTextNode(this.config.attributes.loading)),this.initDebounceTimeout=setTimeout(async()=>{try{this.config.reset(),this.config.store=await Gm({shapes:this.config.attributes.shapes,shapesUrl:this.config.attributes.shapesUrl,values:this.config.attributes.values,valuesUrl:this.config.attributes.valuesUrl,valuesSubject:this.config.attributes.valuesSubject,loadOwlImports:this.config.attributes.ignoreOwlImports===null,classInstanceProvider:this.config.classInstanceProvider,proxy:this.config.attributes.proxy}),this.config.resourceLinkProvider&&await ly(this.config),this.config.attributes.valuesSubject||(this.config.attributes.valuesSubject=qf(this.config.store)||null),this.form.replaceChildren();const e=this.findRootShaclShapeSubject();if(e){this.form.classList.forEach(o=>{this.form.classList.remove(o)}),this.form.classList.toggle("mode-edit",this.config.editMode),this.form.classList.toggle("mode-view",!this.config.editMode),this.config.theme.apply(this.form);const n=[this.config.theme.stylesheet];this.config.hierarchyColorsStyleSheet&&n.push(this.config.hierarchyColorsStyleSheet);for(const o of r_())o.stylesheet&&n.push(o.stylesheet);this.applyStyles(n);const r=new Gs(e,this.config);for(const o of this.config.nodeTemplates)C0(o);if(this.shape=new Li(r,this.config.attributes.valuesSubject?Be.namedNode(this.config.attributes.valuesSubject):void 0),this.form.appendChild(this.shape),this.config.attributes.showRootShapeLabel!==null&&r.label){const o=document.createElement("h3");o.innerText=r.label.value,this.form.prepend(o)}if(this.config.editMode){if(this.config.attributes.submitButton!==null){const o=this.config.theme.createButton(this.config.attributes.submitButton||"Submit",!0);o.classList.add("submit-button");const a=o.getAttribute("part");o.setAttribute("part",`${a?a+" ":""}submit-button`),o.addEventListener("click",l=>{l.preventDefault(),this.form.reportValidity()&&this.validate().then(u=>{if(u?.conforms)this.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0}));else{const f=this.form.querySelector(":scope .invalid > .editor");f?f.focus():this.form.querySelector(":scope .invalid")?.scrollIntoView()}})}),this.form.appendChild(o)}(async()=>(await this.shape?.ready,this.config.attributes.valuesSubject&&this.removeFromDataGraph(Be.namedNode(this.config.attributes.valuesSubject)),this.validate(!0)))()}}else if(this.config.store.countQuads(null,null,null,an)>0)throw new Error("shacl root node shape not found")}catch(e){console.error(e);const n=document.createElement("div");n.innerText=String(e),this.form.replaceChildren(n)}this.removeAttribute("loading"),await this.shape?.ready,this.dispatchEvent(new Event("ready"))},k0)}ensureRenderRoot(){this.config.attributes.useShadowRoot!=="false"?(this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot.contains(this.form)||this.shadowRoot.prepend(this.form)):(this.shadowRoot?.contains(this.form)&&this.shadowRoot.removeChild(this.form),this.contains(this.form)||this.prepend(this.form))}applyStyles(e){if(this.config.attributes.useShadowRoot!=="false"&&this.shadowRoot){this.shadowRoot.adoptedStyleSheets=e,this.styleElement&&(this.styleElement.remove(),this.styleElement=null);return}const r=e.map(o=>Array.from(o.cssRules).map(l=>l.cssText).join(`
|
|
431
431
|
`).replace(/:host\b/g,"shacl-form")).join(`
|
|
432
|
-
`);this.styleElement||(this.styleElement=document.createElement("style"),this.prepend(this.styleElement)),this.styleElement.textContent=r}serialize(e="text/turtle",n=this.toRDF()){const r=n.getQuads(null,null,null,null);return
|
|
432
|
+
`);this.styleElement||(this.styleElement=document.createElement("style"),this.prepend(this.styleElement)),this.styleElement.textContent=r}serialize(e="text/turtle",n=this.toRDF()){const r=n.getQuads(null,null,null,null);return t_(r,e,Vi)}toRDF(e=new It){return this.shape?.toRDF(e,void 0,this.config.attributes.generateNodeShapeReference),e}registerPlugin(e){i_(e),this.initialize()}setTheme(e){this.config.theme=e,this.initialize()}setClassInstanceProvider(e){this.config.classInstanceProvider=e,this.initialize()}setResourceLinkProvider(e){this.config.resourceLinkProvider=e,this.initialize()}async validate(e=!1){for(const o of this.form.querySelectorAll(":scope .validation-error"))o.remove();for(const o of this.form.querySelectorAll(":scope .property-instance"))o.classList.remove("invalid"),o.querySelector(":scope > .editor")?.value?o.classList.add("valid"):o.classList.remove("valid");for(const o of this.form.querySelectorAll(".add-button-wrapper"))o.classList.remove("invalid","validation-error");if(!this.shape)return{conforms:!0,results:[]};if(!e){const o=this.form.querySelectorAll(".add-button-wrapper.required");for(const a of o)a.classList.add("invalid"),a.after(this.createValidationErrorDisplay("Value is required","node"));if(o.length>0)return{conforms:!1,results:[]}}const n=this.shape;return new Promise(o=>{this.config.store.deleteGraph(this.config.valuesGraphId||"").on("end",async()=>{n.toRDF(this.config.store,void 0,this.config.attributes.generateNodeShapeReference);try{const a=await this.config.validator.validate({dataset:this.config.store,terms:[n.nodeId]},[{terms:[n.template.id]}]);for(const l of a.results)if(l.focusNode?.ptrs?.length)for(const u of l.focusNode.ptrs){const f=u._term;if(l.path?.length){const h=l.path[0].predicates[0];let g=this.form.querySelectorAll(`
|
|
433
433
|
:scope shacl-node[data-node-id='${f.id}'] > shacl-property > .property-instance[data-path='${h.id}'] > .editor,
|
|
434
434
|
:scope shacl-node[data-node-id='${f.id}'] > shacl-property > .shacl-group > .property-instance[data-path='${h.id}'] > .editor,
|
|
435
435
|
:scope shacl-node[data-node-id='${f.id}'] > .shacl-group > shacl-property > .property-instance[data-path='${h.id}'] > .editor,
|
|
436
436
|
:scope shacl-node[data-node-id='${f.id}'] > .shacl-group > shacl-property > .shacl-group > .property-instance[data-path='${h.id}'] > .editor`);g.length===0&&(g=this.form.querySelectorAll(`
|
|
437
437
|
:scope [data-node-id='${f.id}'] > shacl-property > .property-instance[data-path='${h.id}'],
|
|
438
|
-
:scope [data-node-id='${f.id}'] > shacl-property > .shacl-group > .property-instance[data-path='${h.id}']`));for(const
|
|
439
|
-
`;else o.sourceConstraintComponent?.value&&(r.title=o.sourceConstraintComponent.value);else typeof e=="string"&&(r.title=e);return r}findRootShaclShapeSubject(){if(this.config.attributes.shapeSubject){const e=Be.namedNode(this.config.attributes.shapeSubject);if(this.config.store.getQuads(e,Rt,la,null).length===0){console.warn(`shapes graph does not contain requested node shape ${this.config.attributes.shapeSubject}`);return}else return e}else{if(this.config.attributes.valuesSubject&&this.config.store.countQuads(null,null,null,Ft)>0){const n=Be.namedNode(this.config.attributes.valuesSubject),r=[...this.config.store.getQuads(n,Rt,null,Ft),...this.config.store.getQuads(n,Fs,null,Ft)];if(r.length===0)console.warn(`value subject '${this.config.attributes.valuesSubject}' has neither ${Rt.id} nor ${Fs.id} statement`);else for(const a of r)if(this.config.store.getQuads(a.object,Rt,la,null).length>0)return a.object;const o=this.config.store.getObjects(n,Rt,Ft);for(const a of o)for(const l of this.config.store.getQuads(null,Ks,a,null))return l.subject}const e=this.config.store.getQuads(null,Rt,la,null);if(e.length==0){console.warn("shapes graph does not contain any node shapes");return}return e.length>1&&(console.warn("shapes graph contains",e.length,"node shapes. choosing first found which is",e[0].subject.value),console.info('hint: set the node shape to use with element attribute "data-shape-subject"')),e[0].subject}}removeFromDataGraph(e){for(const n of this.config.store.getQuads(e,null,null,Ft))this.config.store.delete(n),(n.object.termType==="NamedNode"||n.object.termType==="BlankNode")&&this.removeFromDataGraph(n.object)}}window.customElements.define("shacl-form",P0);class yw extends Wf{constructor(e,n,r){super(e),this.onChange=n,this.fileType=r}createEditor(e){const n=Ur(e)>0,r=e.config.theme.createFileEditor(e.label,null,n,e);return r.addEventListener("change",o=>{o.stopPropagation(),this.onChange(o)}),this.fileType&&r.querySelector('input[type="file"]')?.setAttribute("accept",this.fileType),r}}var Br={exports:{}};var k0=Br.exports,Zh;function cu(){return Zh||(Zh=1,(function(i,e){(function(n,r){r(e)})(k0,(function(n){var r="1.9.4";function o(t){var s,c,p,E;for(c=1,p=arguments.length;c<p;c++){E=arguments[c];for(s in E)t[s]=E[s]}return t}var a=Object.create||(function(){function t(){}return function(s){return t.prototype=s,new t}})();function l(t,s){var c=Array.prototype.slice;if(t.bind)return t.bind.apply(t,c.call(arguments,1));var p=c.call(arguments,2);return function(){return t.apply(s,p.length?p.concat(c.call(arguments)):arguments)}}var u=0;function f(t){return"_leaflet_id"in t||(t._leaflet_id=++u),t._leaflet_id}function h(t,s,c){var p,E,D,ne;return ne=function(){p=!1,E&&(D.apply(c,E),E=!1)},D=function(){p?E=arguments:(t.apply(c,arguments),setTimeout(ne,s),p=!0)},D}function g(t,s,c){var p=s[1],E=s[0],D=p-E;return t===p&&c?t:((t-E)%D+D)%D+E}function _(){return!1}function d(t,s){if(s===!1)return t;var c=Math.pow(10,s===void 0?6:s);return Math.round(t*c)/c}function m(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function w(t){return m(t).split(/\s+/)}function I(t,s){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?a(t.options):{});for(var c in s)t.options[c]=s[c];return t.options}function A(t,s,c){var p=[];for(var E in t)p.push(encodeURIComponent(c?E.toUpperCase():E)+"="+encodeURIComponent(t[E]));return(!s||s.indexOf("?")===-1?"?":"&")+p.join("&")}var N=/\{ *([\w_ -]+) *\}/g;function P(t,s){return t.replace(N,function(c,p){var E=s[p];if(E===void 0)throw new Error("No value provided for variable "+c);return typeof E=="function"&&(E=E(s)),E})}var v=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function y(t,s){for(var c=0;c<t.length;c++)if(t[c]===s)return c;return-1}var S="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function O(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var X=0;function C(t){var s=+new Date,c=Math.max(0,16-(s-X));return X=s+c,window.setTimeout(t,c)}var U=window.requestAnimationFrame||O("RequestAnimationFrame")||C,R=window.cancelAnimationFrame||O("CancelAnimationFrame")||O("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function $(t,s,c){if(c&&U===C)t.call(s);else return U.call(window,l(t,s))}function G(t){t&&R.call(window,t)}var j={__proto__:null,extend:o,create:a,bind:l,get lastId(){return u},stamp:f,throttle:h,wrapNum:g,falseFn:_,formatNum:d,trim:m,splitWords:w,setOptions:I,getParamString:A,template:P,isArray:v,indexOf:y,emptyImageUrl:S,requestFn:U,cancelFn:R,requestAnimFrame:$,cancelAnimFrame:G};function F(){}F.extend=function(t){var s=function(){I(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},c=s.__super__=this.prototype,p=a(c);p.constructor=s,s.prototype=p;for(var E in this)Object.prototype.hasOwnProperty.call(this,E)&&E!=="prototype"&&E!=="__super__"&&(s[E]=this[E]);return t.statics&&o(s,t.statics),t.includes&&(se(t.includes),o.apply(null,[p].concat(t.includes))),o(p,t),delete p.statics,delete p.includes,p.options&&(p.options=c.options?a(c.options):{},o(p.options,t.options)),p._initHooks=[],p.callInitHooks=function(){if(!this._initHooksCalled){c.callInitHooks&&c.callInitHooks.call(this),this._initHooksCalled=!0;for(var D=0,ne=p._initHooks.length;D<ne;D++)p._initHooks[D].call(this)}},s},F.include=function(t){var s=this.prototype.options;return o(this.prototype,t),t.options&&(this.prototype.options=s,this.mergeOptions(t.options)),this},F.mergeOptions=function(t){return o(this.prototype.options,t),this},F.addInitHook=function(t){var s=Array.prototype.slice.call(arguments,1),c=typeof t=="function"?t:function(){this[t].apply(this,s)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(c),this};function se(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=v(t)?t:[t];for(var s=0;s<t.length;s++)t[s]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var M={on:function(t,s,c){if(typeof t=="object")for(var p in t)this._on(p,t[p],s);else{t=w(t);for(var E=0,D=t.length;E<D;E++)this._on(t[E],s,c)}return this},off:function(t,s,c){if(!arguments.length)delete this._events;else if(typeof t=="object")for(var p in t)this._off(p,t[p],s);else{t=w(t);for(var E=arguments.length===1,D=0,ne=t.length;D<ne;D++)E?this._off(t[D]):this._off(t[D],s,c)}return this},_on:function(t,s,c,p){if(typeof s!="function"){console.warn("wrong listener type: "+typeof s);return}if(this._listens(t,s,c)===!1){c===this&&(c=void 0);var E={fn:s,ctx:c};p&&(E.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(E)}},_off:function(t,s,c){var p,E,D;if(this._events&&(p=this._events[t],!!p)){if(arguments.length===1){if(this._firingCount)for(E=0,D=p.length;E<D;E++)p[E].fn=_;delete this._events[t];return}if(typeof s!="function"){console.warn("wrong listener type: "+typeof s);return}var ne=this._listens(t,s,c);if(ne!==!1){var he=p[ne];this._firingCount&&(he.fn=_,this._events[t]=p=p.slice()),p.splice(ne,1)}}},fire:function(t,s,c){if(!this.listens(t,c))return this;var p=o({},s,{type:t,target:this,sourceTarget:s&&s.sourceTarget||this});if(this._events){var E=this._events[t];if(E){this._firingCount=this._firingCount+1||1;for(var D=0,ne=E.length;D<ne;D++){var he=E[D],ye=he.fn;he.once&&this.off(t,ye,he.ctx),ye.call(he.ctx||this,p)}this._firingCount--}}return c&&this._propagateEvent(p),this},listens:function(t,s,c,p){typeof t!="string"&&console.warn('"string" type argument expected');var E=s;typeof s!="function"&&(p=!!s,E=void 0,c=void 0);var D=this._events&&this._events[t];if(D&&D.length&&this._listens(t,E,c)!==!1)return!0;if(p){for(var ne in this._eventParents)if(this._eventParents[ne].listens(t,s,c,p))return!0}return!1},_listens:function(t,s,c){if(!this._events)return!1;var p=this._events[t]||[];if(!s)return!!p.length;c===this&&(c=void 0);for(var E=0,D=p.length;E<D;E++)if(p[E].fn===s&&p[E].ctx===c)return E;return!1},once:function(t,s,c){if(typeof t=="object")for(var p in t)this._on(p,t[p],s,!0);else{t=w(t);for(var E=0,D=t.length;E<D;E++)this._on(t[E],s,c,!0)}return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[f(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[f(t)],this},_propagateEvent:function(t){for(var s in this._eventParents)this._eventParents[s].fire(t.type,o({layer:t.target,propagatedFrom:t.target},t),!0)}};M.addEventListener=M.on,M.removeEventListener=M.clearAllEventListeners=M.off,M.addOneTimeEventListener=M.once,M.fireEvent=M.fire,M.hasEventListeners=M.listens;var re=F.extend(M);function B(t,s,c){this.x=c?Math.round(t):t,this.y=c?Math.round(s):s}var oe=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};B.prototype={clone:function(){return new B(this.x,this.y)},add:function(t){return this.clone()._add(T(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(T(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new B(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new B(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=oe(this.x),this.y=oe(this.y),this},distanceTo:function(t){t=T(t);var s=t.x-this.x,c=t.y-this.y;return Math.sqrt(s*s+c*c)},equals:function(t){return t=T(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=T(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+d(this.x)+", "+d(this.y)+")"}};function T(t,s,c){return t instanceof B?t:v(t)?new B(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new B(t.x,t.y):new B(t,s,c)}function Q(t,s){if(t)for(var c=s?[t,s]:t,p=0,E=c.length;p<E;p++)this.extend(c[p])}Q.prototype={extend:function(t){var s,c;if(!t)return this;if(t instanceof B||typeof t[0]=="number"||"x"in t)s=c=T(t);else if(t=ie(t),s=t.min,c=t.max,!s||!c)return this;return!this.min&&!this.max?(this.min=s.clone(),this.max=c.clone()):(this.min.x=Math.min(s.x,this.min.x),this.max.x=Math.max(c.x,this.max.x),this.min.y=Math.min(s.y,this.min.y),this.max.y=Math.max(c.y,this.max.y)),this},getCenter:function(t){return T((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return T(this.min.x,this.max.y)},getTopRight:function(){return T(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var s,c;return typeof t[0]=="number"||t instanceof B?t=T(t):t=ie(t),t instanceof Q?(s=t.min,c=t.max):s=c=t,s.x>=this.min.x&&c.x<=this.max.x&&s.y>=this.min.y&&c.y<=this.max.y},intersects:function(t){t=ie(t);var s=this.min,c=this.max,p=t.min,E=t.max,D=E.x>=s.x&&p.x<=c.x,ne=E.y>=s.y&&p.y<=c.y;return D&&ne},overlaps:function(t){t=ie(t);var s=this.min,c=this.max,p=t.min,E=t.max,D=E.x>s.x&&p.x<c.x,ne=E.y>s.y&&p.y<c.y;return D&&ne},isValid:function(){return!!(this.min&&this.max)},pad:function(t){var s=this.min,c=this.max,p=Math.abs(s.x-c.x)*t,E=Math.abs(s.y-c.y)*t;return ie(T(s.x-p,s.y-E),T(c.x+p,c.y+E))},equals:function(t){return t?(t=ie(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight())):!1}};function ie(t,s){return!t||t instanceof Q?t:new Q(t,s)}function Y(t,s){if(t)for(var c=s?[t,s]:t,p=0,E=c.length;p<E;p++)this.extend(c[p])}Y.prototype={extend:function(t){var s=this._southWest,c=this._northEast,p,E;if(t instanceof Z)p=t,E=t;else if(t instanceof Y){if(p=t._southWest,E=t._northEast,!p||!E)return this}else return t?this.extend(W(t)||me(t)):this;return!s&&!c?(this._southWest=new Z(p.lat,p.lng),this._northEast=new Z(E.lat,E.lng)):(s.lat=Math.min(p.lat,s.lat),s.lng=Math.min(p.lng,s.lng),c.lat=Math.max(E.lat,c.lat),c.lng=Math.max(E.lng,c.lng)),this},pad:function(t){var s=this._southWest,c=this._northEast,p=Math.abs(s.lat-c.lat)*t,E=Math.abs(s.lng-c.lng)*t;return new Y(new Z(s.lat-p,s.lng-E),new Z(c.lat+p,c.lng+E))},getCenter:function(){return new Z((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new Z(this.getNorth(),this.getWest())},getSouthEast:function(){return new Z(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){typeof t[0]=="number"||t instanceof Z||"lat"in t?t=W(t):t=me(t);var s=this._southWest,c=this._northEast,p,E;return t instanceof Y?(p=t.getSouthWest(),E=t.getNorthEast()):p=E=t,p.lat>=s.lat&&E.lat<=c.lat&&p.lng>=s.lng&&E.lng<=c.lng},intersects:function(t){t=me(t);var s=this._southWest,c=this._northEast,p=t.getSouthWest(),E=t.getNorthEast(),D=E.lat>=s.lat&&p.lat<=c.lat,ne=E.lng>=s.lng&&p.lng<=c.lng;return D&&ne},overlaps:function(t){t=me(t);var s=this._southWest,c=this._northEast,p=t.getSouthWest(),E=t.getNorthEast(),D=E.lat>s.lat&&p.lat<c.lat,ne=E.lng>s.lng&&p.lng<c.lng;return D&&ne},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,s){return t?(t=me(t),this._southWest.equals(t.getSouthWest(),s)&&this._northEast.equals(t.getNorthEast(),s)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function me(t,s){return t instanceof Y?t:new Y(t,s)}function Z(t,s,c){if(isNaN(t)||isNaN(s))throw new Error("Invalid LatLng object: ("+t+", "+s+")");this.lat=+t,this.lng=+s,c!==void 0&&(this.alt=+c)}Z.prototype={equals:function(t,s){if(!t)return!1;t=W(t);var c=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return c<=(s===void 0?1e-9:s)},toString:function(t){return"LatLng("+d(this.lat,t)+", "+d(this.lng,t)+")"},distanceTo:function(t){return K.distance(this,W(t))},wrap:function(){return K.wrapLatLng(this)},toBounds:function(t){var s=180*t/40075017,c=s/Math.cos(Math.PI/180*this.lat);return me([this.lat-s,this.lng-c],[this.lat+s,this.lng+c])},clone:function(){return new Z(this.lat,this.lng,this.alt)}};function W(t,s,c){return t instanceof Z?t:v(t)&&typeof t[0]!="object"?t.length===3?new Z(t[0],t[1],t[2]):t.length===2?new Z(t[0],t[1]):null:t==null?t:typeof t=="object"&&"lat"in t?new Z(t.lat,"lng"in t?t.lng:t.lon,t.alt):s===void 0?null:new Z(t,s,c)}var ee={latLngToPoint:function(t,s){var c=this.projection.project(t),p=this.scale(s);return this.transformation._transform(c,p)},pointToLatLng:function(t,s){var c=this.scale(s),p=this.transformation.untransform(t,c);return this.projection.unproject(p)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var s=this.projection.bounds,c=this.scale(t),p=this.transformation.transform(s.min,c),E=this.transformation.transform(s.max,c);return new Q(p,E)},infinite:!1,wrapLatLng:function(t){var s=this.wrapLng?g(t.lng,this.wrapLng,!0):t.lng,c=this.wrapLat?g(t.lat,this.wrapLat,!0):t.lat,p=t.alt;return new Z(c,s,p)},wrapLatLngBounds:function(t){var s=t.getCenter(),c=this.wrapLatLng(s),p=s.lat-c.lat,E=s.lng-c.lng;if(p===0&&E===0)return t;var D=t.getSouthWest(),ne=t.getNorthEast(),he=new Z(D.lat-p,D.lng-E),ye=new Z(ne.lat-p,ne.lng-E);return new Y(he,ye)}},K=o({},ee,{wrapLng:[-180,180],R:6371e3,distance:function(t,s){var c=Math.PI/180,p=t.lat*c,E=s.lat*c,D=Math.sin((s.lat-t.lat)*c/2),ne=Math.sin((s.lng-t.lng)*c/2),he=D*D+Math.cos(p)*Math.cos(E)*ne*ne,ye=2*Math.atan2(Math.sqrt(he),Math.sqrt(1-he));return this.R*ye}}),ue=6378137,ce={R:ue,MAX_LATITUDE:85.0511287798,project:function(t){var s=Math.PI/180,c=this.MAX_LATITUDE,p=Math.max(Math.min(c,t.lat),-c),E=Math.sin(p*s);return new B(this.R*t.lng*s,this.R*Math.log((1+E)/(1-E))/2)},unproject:function(t){var s=180/Math.PI;return new Z((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*s,t.x*s/this.R)},bounds:(function(){var t=ue*Math.PI;return new Q([-t,-t],[t,t])})()};function Ee(t,s,c,p){if(v(t)){this._a=t[0],this._b=t[1],this._c=t[2],this._d=t[3];return}this._a=t,this._b=s,this._c=c,this._d=p}Ee.prototype={transform:function(t,s){return this._transform(t.clone(),s)},_transform:function(t,s){return s=s||1,t.x=s*(this._a*t.x+this._b),t.y=s*(this._c*t.y+this._d),t},untransform:function(t,s){return s=s||1,new B((t.x/s-this._b)/this._a,(t.y/s-this._d)/this._c)}};function Te(t,s,c,p){return new Ee(t,s,c,p)}var q=o({},K,{code:"EPSG:3857",projection:ce,transformation:(function(){var t=.5/(Math.PI*ce.R);return Te(t,.5,-t,.5)})()}),te=o({},q,{code:"EPSG:900913"});function fe(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function xe(t,s){var c="",p,E,D,ne,he,ye;for(p=0,D=t.length;p<D;p++){for(he=t[p],E=0,ne=he.length;E<ne;E++)ye=he[E],c+=(E?"L":"M")+ye.x+" "+ye.y;c+=s?ke.svg?"z":"x":""}return c||"M0 0"}var Se=document.documentElement.style,Ie="ActiveXObject"in window,le=Ie&&!document.addEventListener,ve="msLaunchUri"in navigator&&!("documentMode"in document),Ae=At("webkit"),be=At("android"),qe=At("android 2")||At("android 3"),mt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),$e=be&&At("Google")&&mt<537&&!("AudioNode"in window),ft=!!window.opera,k=!ve&&At("chrome"),b=At("gecko")&&!Ae&&!ft&&!Ie,x=!k&&At("safari"),H=At("phantom"),ae="OTransition"in Se,_e=navigator.platform.indexOf("Win")===0,we=Ie&&"transition"in Se,Oe="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!qe,Ye="MozPerspective"in Se,Qe=!window.L_DISABLE_3D&&(we||Oe||Ye)&&!ae&&!H,Ge=typeof orientation<"u"||At("mobile"),Ze=Ge&&Ae,$t=Ge&&Oe,en=!window.PointerEvent&&window.MSPointerEvent,st=!!(window.PointerEvent||en),at="ontouchstart"in window||!!window.TouchEvent,Ai=!window.L_NO_TOUCH&&(at||st),hn=Ge&&ft,Fn=Ge&&b,ei=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,z=(function(){var t=!1;try{var s=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",_,s),window.removeEventListener("testPassiveEventSupport",_,s)}catch{}return t})(),J=(function(){return!!document.createElement("canvas").getContext})(),Ne=!!(document.createElementNS&&fe("svg").createSVGRect),Re=!!Ne&&(function(){var t=document.createElement("div");return t.innerHTML="<svg/>",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),De=!Ne&&(function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var s=t.firstChild;return s.style.behavior="url(#default#VML)",s&&typeof s.adj=="object"}catch{return!1}})(),_t=navigator.platform.indexOf("Mac")===0,wt=navigator.platform.indexOf("Linux")===0;function At(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var ke={ie:Ie,ielt9:le,edge:ve,webkit:Ae,android:be,android23:qe,androidStock:$e,opera:ft,chrome:k,gecko:b,safari:x,phantom:H,opera12:ae,win:_e,ie3d:we,webkit3d:Oe,gecko3d:Ye,any3d:Qe,mobile:Ge,mobileWebkit:Ze,mobileWebkit3d:$t,msPointer:en,pointer:st,touch:Ai,touchNative:at,mobileOpera:hn,mobileGecko:Fn,retina:ei,passiveEvents:z,canvas:J,svg:Ne,vml:De,inlineSvg:Re,mac:_t,linux:wt},ti=ke.msPointer?"MSPointerDown":"pointerdown",Wt=ke.msPointer?"MSPointerMove":"pointermove",jn=ke.msPointer?"MSPointerUp":"pointerup",En=ke.msPointer?"MSPointerCancel":"pointercancel",fn={touchstart:ti,touchmove:Wt,touchend:jn,touchcancel:En},Bn={touchstart:ao,touchmove:tn,touchend:tn,touchcancel:tn},it={},V=!1;function de(t,s,c){return s==="touchstart"&&xt(),Bn[s]?(c=Bn[s].bind(this,c),t.addEventListener(fn[s],c,!1),c):(console.warn("wrong event specified:",s),_)}function pe(t,s,c){if(!fn[s]){console.warn("wrong event specified:",s);return}t.removeEventListener(fn[s],c,!1)}function Pe(t){it[t.pointerId]=t}function Ue(t){it[t.pointerId]&&(it[t.pointerId]=t)}function Je(t){delete it[t.pointerId]}function xt(){V||(document.addEventListener(ti,Pe,!0),document.addEventListener(Wt,Ue,!0),document.addEventListener(jn,Je,!0),document.addEventListener(En,Je,!0),V=!0)}function tn(t,s){if(s.pointerType!==(s.MSPOINTER_TYPE_MOUSE||"mouse")){s.touches=[];for(var c in it)s.touches.push(it[c]);s.changedTouches=[s],t(s)}}function ao(t,s){s.MSPOINTER_TYPE_TOUCH&&s.pointerType===s.MSPOINTER_TYPE_TOUCH&&St(s),tn(t,s)}function $n(t){var s={},c,p;for(p in t)c=t[p],s[p]=c&&c.bind?c.bind(t):c;return t=s,s.type="dblclick",s.detail=2,s.isTrusted=!1,s._simulated=!0,s}var ni=200;function Ip(t,s){t.addEventListener("dblclick",s);var c=0,p;function E(D){if(D.detail!==1){p=D.detail;return}if(!(D.pointerType==="mouse"||D.sourceCapabilities&&!D.sourceCapabilities.firesTouchEvents)){var ne=gu(D);if(!(ne.some(function(ye){return ye instanceof HTMLLabelElement&&ye.attributes.for})&&!ne.some(function(ye){return ye instanceof HTMLInputElement||ye instanceof HTMLSelectElement}))){var he=Date.now();he-c<=ni?(p++,p===2&&s($n(D))):p=1,c=he}}}return t.addEventListener("click",E),{dblclick:s,simDblclick:E}}function Ap(t,s){t.removeEventListener("dblclick",s.dblclick),t.removeEventListener("click",s.simDblclick)}var lo=ts(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),tr=ts(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),du=tr==="webkitTransition"||tr==="OTransition"?tr+"End":"transitionend";function hu(t){return typeof t=="string"?document.getElementById(t):t}function nr(t,s){var c=t.style[s]||t.currentStyle&&t.currentStyle[s];if((!c||c==="auto")&&document.defaultView){var p=document.defaultView.getComputedStyle(t,null);c=p?p[s]:null}return c==="auto"?null:c}function Ke(t,s,c){var p=document.createElement(t);return p.className=s||"",c&&c.appendChild(p),p}function ut(t){var s=t.parentNode;s&&s.removeChild(t)}function Yr(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Ni(t){var s=t.parentNode;s&&s.lastChild!==t&&s.appendChild(t)}function Ri(t){var s=t.parentNode;s&&s.firstChild!==t&&s.insertBefore(t,s.firstChild)}function uo(t,s){if(t.classList!==void 0)return t.classList.contains(s);var c=es(t);return c.length>0&&new RegExp("(^|\\s)"+s+"(\\s|$)").test(c)}function He(t,s){if(t.classList!==void 0)for(var c=w(s),p=0,E=c.length;p<E;p++)t.classList.add(c[p]);else if(!uo(t,s)){var D=es(t);co(t,(D?D+" ":"")+s)}}function pt(t,s){t.classList!==void 0?t.classList.remove(s):co(t,m((" "+es(t)+" ").replace(" "+s+" "," ")))}function co(t,s){t.className.baseVal===void 0?t.className=s:t.className.baseVal=s}function es(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}function Gt(t,s){"opacity"in t.style?t.style.opacity=s:"filter"in t.style&&Np(t,s)}function Np(t,s){var c=!1,p="DXImageTransform.Microsoft.Alpha";try{c=t.filters.item(p)}catch{if(s===1)return}s=Math.round(s*100),c?(c.Enabled=s!==100,c.Opacity=s):t.style.filter+=" progid:"+p+"(opacity="+s+")"}function ts(t){for(var s=document.documentElement.style,c=0;c<t.length;c++)if(t[c]in s)return t[c];return!1}function ii(t,s,c){var p=s||new B(0,0);t.style[lo]=(ke.ie3d?"translate("+p.x+"px,"+p.y+"px)":"translate3d("+p.x+"px,"+p.y+"px,0)")+(c?" scale("+c+")":"")}function yt(t,s){t._leaflet_pos=s,ke.any3d?ii(t,s):(t.style.left=s.x+"px",t.style.top=s.y+"px")}function ri(t){return t._leaflet_pos||new B(0,0)}var ir,rr,ho;if("onselectstart"in document)ir=function(){ze(window,"selectstart",St)},rr=function(){rt(window,"selectstart",St)};else{var sr=ts(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ir=function(){if(sr){var t=document.documentElement.style;ho=t[sr],t[sr]="none"}},rr=function(){sr&&(document.documentElement.style[sr]=ho,ho=void 0)}}function fo(){ze(window,"dragstart",St)}function po(){rt(window,"dragstart",St)}var ns,go;function mo(t){for(;t.tabIndex===-1;)t=t.parentNode;t.style&&(is(),ns=t,go=t.style.outlineStyle,t.style.outlineStyle="none",ze(window,"keydown",is))}function is(){ns&&(ns.style.outlineStyle=go,ns=void 0,go=void 0,rt(window,"keydown",is))}function fu(t){do t=t.parentNode;while((!t.offsetWidth||!t.offsetHeight)&&t!==document.body);return t}function _o(t){var s=t.getBoundingClientRect();return{x:s.width/t.offsetWidth||1,y:s.height/t.offsetHeight||1,boundingClientRect:s}}var Rp={__proto__:null,TRANSFORM:lo,TRANSITION:tr,TRANSITION_END:du,get:hu,getStyle:nr,create:Ke,remove:ut,empty:Yr,toFront:Ni,toBack:Ri,hasClass:uo,addClass:He,removeClass:pt,setClass:co,getClass:es,setOpacity:Gt,testProp:ts,setTransform:ii,setPosition:yt,getPosition:ri,get disableTextSelection(){return ir},get enableTextSelection(){return rr},disableImageDrag:fo,enableImageDrag:po,preventOutline:mo,restoreOutline:is,getSizedParentNode:fu,getScale:_o};function ze(t,s,c,p){if(s&&typeof s=="object")for(var E in s)bo(t,E,s[E],c);else{s=w(s);for(var D=0,ne=s.length;D<ne;D++)bo(t,s[D],c,p)}return this}var pn="_leaflet_events";function rt(t,s,c,p){if(arguments.length===1)pu(t),delete t[pn];else if(s&&typeof s=="object")for(var E in s)vo(t,E,s[E],c);else if(s=w(s),arguments.length===2)pu(t,function(he){return y(s,he)!==-1});else for(var D=0,ne=s.length;D<ne;D++)vo(t,s[D],c,p);return this}function pu(t,s){for(var c in t[pn]){var p=c.split(/\d/)[0];(!s||s(p))&&vo(t,p,null,null,c)}}var yo={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function bo(t,s,c,p){var E=s+f(c)+(p?"_"+f(p):"");if(t[pn]&&t[pn][E])return this;var D=function(he){return c.call(p||t,he||window.event)},ne=D;!ke.touchNative&&ke.pointer&&s.indexOf("touch")===0?D=de(t,s,D):ke.touch&&s==="dblclick"?D=Ip(t,D):"addEventListener"in t?s==="touchstart"||s==="touchmove"||s==="wheel"||s==="mousewheel"?t.addEventListener(yo[s]||s,D,ke.passiveEvents?{passive:!1}:!1):s==="mouseenter"||s==="mouseleave"?(D=function(he){he=he||window.event,xo(t,he)&&ne(he)},t.addEventListener(yo[s],D,!1)):t.addEventListener(s,ne,!1):t.attachEvent("on"+s,D),t[pn]=t[pn]||{},t[pn][E]=D}function vo(t,s,c,p,E){E=E||s+f(c)+(p?"_"+f(p):"");var D=t[pn]&&t[pn][E];if(!D)return this;!ke.touchNative&&ke.pointer&&s.indexOf("touch")===0?pe(t,s,D):ke.touch&&s==="dblclick"?Ap(t,D):"removeEventListener"in t?t.removeEventListener(yo[s]||s,D,!1):t.detachEvent("on"+s,D),t[pn][E]=null}function si(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function wo(t){return bo(t,"wheel",si),this}function or(t){return ze(t,"mousedown touchstart dblclick contextmenu",si),t._leaflet_disable_click=!0,this}function St(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function oi(t){return St(t),si(t),this}function gu(t){if(t.composedPath)return t.composedPath();for(var s=[],c=t.target;c;)s.push(c),c=c.parentNode;return s}function mu(t,s){if(!s)return new B(t.clientX,t.clientY);var c=_o(s),p=c.boundingClientRect;return new B((t.clientX-p.left)/c.x-s.clientLeft,(t.clientY-p.top)/c.y-s.clientTop)}var Cp=ke.linux&&ke.chrome?window.devicePixelRatio:ke.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function _u(t){return ke.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/Cp:t.deltaY&&t.deltaMode===1?-t.deltaY*20:t.deltaY&&t.deltaMode===2?-t.deltaY*60:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?-t.detail*20:t.detail?t.detail/-32765*60:0}function xo(t,s){var c=s.relatedTarget;if(!c)return!0;try{for(;c&&c!==t;)c=c.parentNode}catch{return!1}return c!==t}var Pp={__proto__:null,on:ze,off:rt,stopPropagation:si,disableScrollPropagation:wo,disableClickPropagation:or,preventDefault:St,stop:oi,getPropagationPath:gu,getMousePosition:mu,getWheelDelta:_u,isExternalTarget:xo,addListener:ze,removeListener:rt},yu=re.extend({run:function(t,s,c,p){this.stop(),this._el=t,this._inProgress=!0,this._duration=c||.25,this._easeOutPower=1/Math.max(p||.5,.2),this._startPos=ri(t),this._offset=s.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=$(this._animate,this),this._step()},_step:function(t){var s=+new Date-this._startTime,c=this._duration*1e3;s<c?this._runFrame(this._easeOut(s/c),t):(this._runFrame(1),this._complete())},_runFrame:function(t,s){var c=this._startPos.add(this._offset.multiplyBy(t));s&&c._round(),yt(this._el,c),this.fire("step")},_complete:function(){G(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),Xe=re.extend({options:{crs:q,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,s){s=I(this,s),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=l(this._onResize,this),this._initEvents(),s.maxBounds&&this.setMaxBounds(s.maxBounds),s.zoom!==void 0&&(this._zoom=this._limitZoom(s.zoom)),s.center&&s.zoom!==void 0&&this.setView(W(s.center),s.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=tr&&ke.any3d&&!ke.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),ze(this._proxy,du,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,s,c){if(s=s===void 0?this._zoom:this._limitZoom(s),t=this._limitCenter(W(t),s,this.options.maxBounds),c=c||{},this._stop(),this._loaded&&!c.reset&&c!==!0){c.animate!==void 0&&(c.zoom=o({animate:c.animate},c.zoom),c.pan=o({animate:c.animate,duration:c.duration},c.pan));var p=this._zoom!==s?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,s,c.zoom):this._tryAnimatedPan(t,c.pan);if(p)return clearTimeout(this._sizeTimer),this}return this._resetView(t,s,c.pan&&c.pan.noMoveStart),this},setZoom:function(t,s){return this._loaded?this.setView(this.getCenter(),t,{zoom:s}):(this._zoom=t,this)},zoomIn:function(t,s){return t=t||(ke.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,s)},zoomOut:function(t,s){return t=t||(ke.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,s)},setZoomAround:function(t,s,c){var p=this.getZoomScale(s),E=this.getSize().divideBy(2),D=t instanceof B?t:this.latLngToContainerPoint(t),ne=D.subtract(E).multiplyBy(1-1/p),he=this.containerPointToLatLng(E.add(ne));return this.setView(he,s,{zoom:c})},_getBoundsCenterZoom:function(t,s){s=s||{},t=t.getBounds?t.getBounds():me(t);var c=T(s.paddingTopLeft||s.padding||[0,0]),p=T(s.paddingBottomRight||s.padding||[0,0]),E=this.getBoundsZoom(t,!1,c.add(p));if(E=typeof s.maxZoom=="number"?Math.min(s.maxZoom,E):E,E===1/0)return{center:t.getCenter(),zoom:E};var D=p.subtract(c).divideBy(2),ne=this.project(t.getSouthWest(),E),he=this.project(t.getNorthEast(),E),ye=this.unproject(ne.add(he).divideBy(2).add(D),E);return{center:ye,zoom:E}},fitBounds:function(t,s){if(t=me(t),!t.isValid())throw new Error("Bounds are not valid.");var c=this._getBoundsCenterZoom(t,s);return this.setView(c.center,c.zoom,s)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,s){return this.setView(t,this._zoom,{pan:s})},panBy:function(t,s){if(t=T(t).round(),s=s||{},!t.x&&!t.y)return this.fire("moveend");if(s.animate!==!0&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new yu,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),s.noMoveStart||this.fire("movestart"),s.animate!==!1){He(this._mapPane,"leaflet-pan-anim");var c=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,c,s.duration||.25,s.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,s,c){if(c=c||{},c.animate===!1||!ke.any3d)return this.setView(t,s,c);this._stop();var p=this.project(this.getCenter()),E=this.project(t),D=this.getSize(),ne=this._zoom;t=W(t),s=s===void 0?ne:s;var he=Math.max(D.x,D.y),ye=he*this.getZoomScale(ne,s),Le=E.distanceTo(p)||1,Ce=1.42,je=Ce*Ce;function Ve(bt){var gs=bt?-1:1,vg=bt?ye:he,wg=ye*ye-he*he+gs*je*je*Le*Le,xg=2*vg*je*Le,ko=wg/xg,Ku=Math.sqrt(ko*ko+1)-ko,Eg=Ku<1e-9?-18:Math.log(Ku);return Eg}function Nt(bt){return(Math.exp(bt)-Math.exp(-bt))/2}function Et(bt){return(Math.exp(bt)+Math.exp(-bt))/2}function Xt(bt){return Nt(bt)/Et(bt)}var Mt=Ve(0);function Oi(bt){return he*(Et(Mt)/Et(Mt+Ce*bt))}function mg(bt){return he*(Et(Mt)*Xt(Mt+Ce*bt)-Nt(Mt))/je}function _g(bt){return 1-Math.pow(1-bt,1.5)}var yg=Date.now(),Qu=(Ve(1)-Mt)/Ce,bg=c.duration?1e3*c.duration:1e3*Qu*.8;function Ju(){var bt=(Date.now()-yg)/bg,gs=_g(bt)*Qu;bt<=1?(this._flyToFrame=$(Ju,this),this._move(this.unproject(p.add(E.subtract(p).multiplyBy(mg(gs)/Le)),ne),this.getScaleZoom(he/Oi(gs),ne),{flyTo:!0})):this._move(t,s)._moveEnd(!0)}return this._moveStart(!0,c.noMoveStart),Ju.call(this),this},flyToBounds:function(t,s){var c=this._getBoundsCenterZoom(t,s);return this.flyTo(c.center,c.zoom,s)},setMaxBounds:function(t){return t=me(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(t){var s=this.options.minZoom;return this.options.minZoom=t,this._loaded&&s!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var s=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&s!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,s){this._enforcingBounds=!0;var c=this.getCenter(),p=this._limitCenter(c,this._zoom,me(t));return c.equals(p)||this.panTo(p,s),this._enforcingBounds=!1,this},panInside:function(t,s){s=s||{};var c=T(s.paddingTopLeft||s.padding||[0,0]),p=T(s.paddingBottomRight||s.padding||[0,0]),E=this.project(this.getCenter()),D=this.project(t),ne=this.getPixelBounds(),he=ie([ne.min.add(c),ne.max.subtract(p)]),ye=he.getSize();if(!he.contains(D)){this._enforcingBounds=!0;var Le=D.subtract(he.getCenter()),Ce=he.extend(D).getSize().subtract(ye);E.x+=Le.x<0?-Ce.x:Ce.x,E.y+=Le.y<0?-Ce.y:Ce.y,this.panTo(this.unproject(E),s),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=o({animate:!1,pan:!0},t===!0?{animate:!0}:t);var s=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var c=this.getSize(),p=s.divideBy(2).round(),E=c.divideBy(2).round(),D=p.subtract(E);return!D.x&&!D.y?this:(t.animate&&t.pan?this.panBy(D):(t.pan&&this._rawPanBy(D),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(l(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:s,newSize:c}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=o({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var s=l(this._handleGeolocationResponse,this),c=l(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(s,c,t):navigator.geolocation.getCurrentPosition(s,c,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var s=t.code,c=t.message||(s===1?"permission denied":s===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:s,message:"Geolocation error: "+c+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var s=t.coords.latitude,c=t.coords.longitude,p=new Z(s,c),E=p.toBounds(t.coords.accuracy*2),D=this._locateOptions;if(D.setView){var ne=this.getBoundsZoom(E);this.setView(p,D.maxZoom?Math.min(ne,D.maxZoom):ne)}var he={latlng:p,bounds:E,timestamp:t.timestamp};for(var ye in t.coords)typeof t.coords[ye]=="number"&&(he[ye]=t.coords[ye]);this.fire("locationfound",he)}},addHandler:function(t,s){if(!s)return this;var c=this[t]=new s(this);return this._handlers.push(c),this.options[t]&&c.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),ut(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(G(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)ut(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,s){var c="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),p=Ke("div",c,s||this._mapPane);return t&&(this._panes[t]=p),p},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),s=this.unproject(t.getBottomLeft()),c=this.unproject(t.getTopRight());return new Y(s,c)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,s,c){t=me(t),c=T(c||[0,0]);var p=this.getZoom()||0,E=this.getMinZoom(),D=this.getMaxZoom(),ne=t.getNorthWest(),he=t.getSouthEast(),ye=this.getSize().subtract(c),Le=ie(this.project(he,p),this.project(ne,p)).getSize(),Ce=ke.any3d?this.options.zoomSnap:1,je=ye.x/Le.x,Ve=ye.y/Le.y,Nt=s?Math.max(je,Ve):Math.min(je,Ve);return p=this.getScaleZoom(Nt,p),Ce&&(p=Math.round(p/(Ce/100))*(Ce/100),p=s?Math.ceil(p/Ce)*Ce:Math.floor(p/Ce)*Ce),Math.max(E,Math.min(D,p))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new B(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,s){var c=this._getTopLeftPoint(t,s);return new Q(c,c.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(t===void 0?this.getZoom():t)},getPane:function(t){return typeof t=="string"?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,s){var c=this.options.crs;return s=s===void 0?this._zoom:s,c.scale(t)/c.scale(s)},getScaleZoom:function(t,s){var c=this.options.crs;s=s===void 0?this._zoom:s;var p=c.zoom(t*c.scale(s));return isNaN(p)?1/0:p},project:function(t,s){return s=s===void 0?this._zoom:s,this.options.crs.latLngToPoint(W(t),s)},unproject:function(t,s){return s=s===void 0?this._zoom:s,this.options.crs.pointToLatLng(T(t),s)},layerPointToLatLng:function(t){var s=T(t).add(this.getPixelOrigin());return this.unproject(s)},latLngToLayerPoint:function(t){var s=this.project(W(t))._round();return s._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(W(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(me(t))},distance:function(t,s){return this.options.crs.distance(W(t),W(s))},containerPointToLayerPoint:function(t){return T(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return T(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var s=this.containerPointToLayerPoint(T(t));return this.layerPointToLatLng(s)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(W(t)))},mouseEventToContainerPoint:function(t){return mu(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var s=this._container=hu(t);if(s){if(s._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");ze(s,"scroll",this._onScroll,this),this._containerId=f(s)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&ke.any3d,He(t,"leaflet-container"+(ke.touch?" leaflet-touch":"")+(ke.retina?" leaflet-retina":"")+(ke.ielt9?" leaflet-oldie":"")+(ke.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var s=nr(t,"position");s!=="absolute"&&s!=="relative"&&s!=="fixed"&&s!=="sticky"&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),yt(this._mapPane,new B(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(He(t.markerPane,"leaflet-zoom-hide"),He(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,s,c){yt(this._mapPane,new B(0,0));var p=!this._loaded;this._loaded=!0,s=this._limitZoom(s),this.fire("viewprereset");var E=this._zoom!==s;this._moveStart(E,c)._move(t,s)._moveEnd(E),this.fire("viewreset"),p&&this.fire("load")},_moveStart:function(t,s){return t&&this.fire("zoomstart"),s||this.fire("movestart"),this},_move:function(t,s,c,p){s===void 0&&(s=this._zoom);var E=this._zoom!==s;return this._zoom=s,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),p?c&&c.pinch&&this.fire("zoom",c):((E||c&&c.pinch)&&this.fire("zoom",c),this.fire("move",c)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return G(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){yt(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[f(this._container)]=this;var s=t?rt:ze;s(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&s(window,"resize",this._onResize,this),ke.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){G(this._resizeRequest),this._resizeRequest=$(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,s){for(var c=[],p,E=s==="mouseout"||s==="mouseover",D=t.target||t.srcElement,ne=!1;D;){if(p=this._targets[f(D)],p&&(s==="click"||s==="preclick")&&this._draggableMoved(p)){ne=!0;break}if(p&&p.listens(s,!0)&&(E&&!xo(D,t)||(c.push(p),E))||D===this._container)break;D=D.parentNode}return!c.length&&!ne&&!E&&this.listens(s,!0)&&(c=[this]),c},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var s=t.target||t.srcElement;if(!(!this._loaded||s._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(s))){var c=t.type;c==="mousedown"&&mo(s),this._fireDOMEvent(t,c)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,s,c){if(t.type==="click"){var p=o({},t);p.type="preclick",this._fireDOMEvent(p,p.type,c)}var E=this._findEventTargets(t,s);if(c){for(var D=[],ne=0;ne<c.length;ne++)c[ne].listens(s,!0)&&D.push(c[ne]);E=D.concat(E)}if(E.length){s==="contextmenu"&&St(t);var he=E[0],ye={originalEvent:t};if(t.type!=="keypress"&&t.type!=="keydown"&&t.type!=="keyup"){var Le=he.getLatLng&&(!he._radius||he._radius<=10);ye.containerPoint=Le?this.latLngToContainerPoint(he.getLatLng()):this.mouseEventToContainerPoint(t),ye.layerPoint=this.containerPointToLayerPoint(ye.containerPoint),ye.latlng=Le?he.getLatLng():this.layerPointToLatLng(ye.layerPoint)}for(ne=0;ne<E.length;ne++)if(E[ne].fire(s,ye,!0),ye.originalEvent._stopped||E[ne].options.bubblingMouseEvents===!1&&y(this._mouseEvents,s)!==-1)return}},_draggableMoved:function(t){return t=t.dragging&&t.dragging.enabled()?t:this,t.dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,s=this._handlers.length;t<s;t++)this._handlers[t].disable()},whenReady:function(t,s){return this._loaded?t.call(s||this,{target:this}):this.on("load",t,s),this},_getMapPanePos:function(){return ri(this._mapPane)||new B(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,s){var c=t&&s!==void 0?this._getNewPixelOrigin(t,s):this.getPixelOrigin();return c.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,s){var c=this.getSize()._divideBy(2);return this.project(t,s)._subtract(c)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,s,c){var p=this._getNewPixelOrigin(c,s);return this.project(t,s)._subtract(p)},_latLngBoundsToNewLayerBounds:function(t,s,c){var p=this._getNewPixelOrigin(c,s);return ie([this.project(t.getSouthWest(),s)._subtract(p),this.project(t.getNorthWest(),s)._subtract(p),this.project(t.getSouthEast(),s)._subtract(p),this.project(t.getNorthEast(),s)._subtract(p)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,s,c){if(!c)return t;var p=this.project(t,s),E=this.getSize().divideBy(2),D=new Q(p.subtract(E),p.add(E)),ne=this._getBoundsOffset(D,c,s);return Math.abs(ne.x)<=1&&Math.abs(ne.y)<=1?t:this.unproject(p.add(ne),s)},_limitOffset:function(t,s){if(!s)return t;var c=this.getPixelBounds(),p=new Q(c.min.add(t),c.max.add(t));return t.add(this._getBoundsOffset(p,s))},_getBoundsOffset:function(t,s,c){var p=ie(this.project(s.getNorthEast(),c),this.project(s.getSouthWest(),c)),E=p.min.subtract(t.min),D=p.max.subtract(t.max),ne=this._rebound(E.x,-D.x),he=this._rebound(E.y,-D.y);return new B(ne,he)},_rebound:function(t,s){return t+s>0?Math.round(t-s)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(s))},_limitZoom:function(t){var s=this.getMinZoom(),c=this.getMaxZoom(),p=ke.any3d?this.options.zoomSnap:1;return p&&(t=Math.round(t/p)*p),Math.max(s,Math.min(c,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){pt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,s){var c=this._getCenterOffset(t)._trunc();return(s&&s.animate)!==!0&&!this.getSize().contains(c)?!1:(this.panBy(c,s),!0)},_createAnimProxy:function(){var t=this._proxy=Ke("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(s){var c=lo,p=this._proxy.style[c];ii(this._proxy,this.project(s.center,s.zoom),this.getZoomScale(s.zoom,1)),p===this._proxy.style[c]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ut(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),s=this.getZoom();ii(this._proxy,this.project(t,s),this.getZoomScale(s,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,s,c){if(this._animatingZoom)return!0;if(c=c||{},!this._zoomAnimated||c.animate===!1||this._nothingToAnimate()||Math.abs(s-this._zoom)>this.options.zoomAnimationThreshold)return!1;var p=this.getZoomScale(s),E=this._getCenterOffset(t)._divideBy(1-1/p);return c.animate!==!0&&!this.getSize().contains(E)?!1:($(function(){this._moveStart(!0,c.noMoveStart||!1)._animateZoom(t,s,!0)},this),!0)},_animateZoom:function(t,s,c,p){this._mapPane&&(c&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=s,He(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:s,noUpdate:p}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(l(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&pt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function kp(t,s){return new Xe(t,s)}var nn=F.extend({options:{position:"topright"},initialize:function(t){I(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var s=this._map;return s&&s.removeControl(this),this.options.position=t,s&&s.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var s=this._container=this.onAdd(t),c=this.getPosition(),p=t._controlCorners[c];return He(s,"leaflet-control"),c.indexOf("bottom")!==-1?p.insertBefore(s,p.firstChild):p.appendChild(s),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ut(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ar=function(t){return new nn(t)};Xe.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},s="leaflet-",c=this._controlContainer=Ke("div",s+"control-container",this._container);function p(E,D){var ne=s+E+" "+s+D;t[E+D]=Ke("div",ne,c)}p("top","left"),p("top","right"),p("bottom","left"),p("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ut(this._controlCorners[t]);ut(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var bu=nn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,s,c,p){return c<p?-1:p<c?1:0}},initialize:function(t,s,c){I(this,c),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var p in t)this._addLayer(t[p],p);for(p in s)this._addLayer(s[p],p,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var s=0;s<this._layers.length;s++)this._layers[s].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return nn.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,s){return this._addLayer(t,s),this._map?this._update():this},addOverlay:function(t,s){return this._addLayer(t,s,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var s=this._getLayer(f(t));return s&&this._layers.splice(this._layers.indexOf(s),1),this._map?this._update():this},expand:function(){He(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(He(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):pt(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return pt(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",s=this._container=Ke("div",t),c=this.options.collapsed;s.setAttribute("aria-haspopup",!0),or(s),wo(s);var p=this._section=Ke("section",t+"-list");c&&(this._map.on("click",this.collapse,this),ze(s,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var E=this._layersLink=Ke("a",t+"-toggle",s);E.href="#",E.title="Layers",E.setAttribute("role","button"),ze(E,{keydown:function(D){D.keyCode===13&&this._expandSafely()},click:function(D){St(D),this._expandSafely()}},this),c||this.expand(),this._baseLayersList=Ke("div",t+"-base",p),this._separator=Ke("div",t+"-separator",p),this._overlaysList=Ke("div",t+"-overlays",p),s.appendChild(p)},_getLayer:function(t){for(var s=0;s<this._layers.length;s++)if(this._layers[s]&&f(this._layers[s].layer)===t)return this._layers[s]},_addLayer:function(t,s,c){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:s,overlay:c}),this.options.sortLayers&&this._layers.sort(l(function(p,E){return this.options.sortFunction(p.layer,E.layer,p.name,E.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Yr(this._baseLayersList),Yr(this._overlaysList),this._layerControlInputs=[];var t,s,c,p,E=0;for(c=0;c<this._layers.length;c++)p=this._layers[c],this._addItem(p),s=s||p.overlay,t=t||!p.overlay,E+=p.overlay?0:1;return this.options.hideSingleBase&&(t=t&&E>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=s&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var s=this._getLayer(f(t.target)),c=s.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;c&&this._map.fire(c,s)},_createRadioElement:function(t,s){var c='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(s?' checked="checked"':"")+"/>",p=document.createElement("div");return p.innerHTML=c,p.firstChild},_addItem:function(t){var s=document.createElement("label"),c=this._map.hasLayer(t.layer),p;t.overlay?(p=document.createElement("input"),p.type="checkbox",p.className="leaflet-control-layers-selector",p.defaultChecked=c):p=this._createRadioElement("leaflet-base-layers_"+f(this),c),this._layerControlInputs.push(p),p.layerId=f(t.layer),ze(p,"click",this._onInputClick,this);var E=document.createElement("span");E.innerHTML=" "+t.name;var D=document.createElement("span");s.appendChild(D),D.appendChild(p),D.appendChild(E);var ne=t.overlay?this._overlaysList:this._baseLayersList;return ne.appendChild(s),this._checkDisabledLayers(),s},_onInputClick:function(){if(!this._preventClick){var t=this._layerControlInputs,s,c,p=[],E=[];this._handlingClick=!0;for(var D=t.length-1;D>=0;D--)s=t[D],c=this._getLayer(s.layerId).layer,s.checked?p.push(c):s.checked||E.push(c);for(D=0;D<E.length;D++)this._map.hasLayer(E[D])&&this._map.removeLayer(E[D]);for(D=0;D<p.length;D++)this._map.hasLayer(p[D])||this._map.addLayer(p[D]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var t=this._layerControlInputs,s,c,p=this._map.getZoom(),E=t.length-1;E>=0;E--)s=t[E],c=this._getLayer(s.layerId).layer,s.disabled=c.options.minZoom!==void 0&&p<c.options.minZoom||c.options.maxZoom!==void 0&&p>c.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,ze(t,"click",St),this.expand();var s=this;setTimeout(function(){rt(t,"click",St),s._preventClick=!1})}}),Dp=function(t,s,c){return new bu(t,s,c)},Eo=nn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var s="leaflet-control-zoom",c=Ke("div",s+" leaflet-bar"),p=this.options;return this._zoomInButton=this._createButton(p.zoomInText,p.zoomInTitle,s+"-in",c,this._zoomIn),this._zoomOutButton=this._createButton(p.zoomOutText,p.zoomOutTitle,s+"-out",c,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),c},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,s,c,p,E){var D=Ke("a",c,p);return D.innerHTML=t,D.href="#",D.title=s,D.setAttribute("role","button"),D.setAttribute("aria-label",s),or(D),ze(D,"click",oi),ze(D,"click",E,this),ze(D,"click",this._refocusOnMap,this),D},_updateDisabled:function(){var t=this._map,s="leaflet-disabled";pt(this._zoomInButton,s),pt(this._zoomOutButton,s),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(He(this._zoomOutButton,s),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(He(this._zoomInButton,s),this._zoomInButton.setAttribute("aria-disabled","true"))}});Xe.mergeOptions({zoomControl:!0}),Xe.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Eo,this.addControl(this.zoomControl))});var Mp=function(t){return new Eo(t)},vu=nn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var s="leaflet-control-scale",c=Ke("div",s),p=this.options;return this._addScales(p,s+"-line",c),t.on(p.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),c},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,s,c){t.metric&&(this._mScale=Ke("div",s,c)),t.imperial&&(this._iScale=Ke("div",s,c))},_update:function(){var t=this._map,s=t.getSize().y/2,c=t.distance(t.containerPointToLatLng([0,s]),t.containerPointToLatLng([this.options.maxWidth,s]));this._updateScales(c)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var s=this._getRoundNum(t),c=s<1e3?s+" m":s/1e3+" km";this._updateScale(this._mScale,c,s/t)},_updateImperial:function(t){var s=t*3.2808399,c,p,E;s>5280?(c=s/5280,p=this._getRoundNum(c),this._updateScale(this._iScale,p+" mi",p/c)):(E=this._getRoundNum(s),this._updateScale(this._iScale,E+" ft",E/s))},_updateScale:function(t,s,c){t.style.width=Math.round(this.options.maxWidth*c)+"px",t.innerHTML=s},_getRoundNum:function(t){var s=Math.pow(10,(Math.floor(t)+"").length-1),c=t/s;return c=c>=10?10:c>=5?5:c>=3?3:c>=2?2:1,s*c}}),Op=function(t){return new vu(t)},Fp='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',So=nn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(ke.inlineSvg?Fp+" ":"")+"Leaflet</a>"},initialize:function(t){I(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=Ke("div","leaflet-control-attribution"),or(this._container);for(var s in t._layers)t._layers[s].getAttribution&&this.addAttribution(t._layers[s].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var s in this._attributions)this._attributions[s]&&t.push(s);var c=[];this.options.prefix&&c.push(this.options.prefix),t.length&&c.push(t.join(", ")),this._container.innerHTML=c.join(' <span aria-hidden="true">|</span> ')}}});Xe.mergeOptions({attributionControl:!0}),Xe.addInitHook(function(){this.options.attributionControl&&new So().addTo(this)});var jp=function(t){return new So(t)};nn.Layers=bu,nn.Zoom=Eo,nn.Scale=vu,nn.Attribution=So,ar.layers=Dp,ar.zoom=Mp,ar.scale=Op,ar.attribution=jp;var gn=F.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});gn.addTo=function(t,s){return t.addHandler(s,this),this};var Bp={Events:M},wu=ke.touch?"touchstart mousedown":"mousedown",qn=re.extend({options:{clickTolerance:3},initialize:function(t,s,c,p){I(this,p),this._element=t,this._dragStartTarget=s||t,this._preventOutline=c},enable:function(){this._enabled||(ze(this._dragStartTarget,wu,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(qn._dragging===this&&this.finishDrag(!0),rt(this._dragStartTarget,wu,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!uo(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){qn._dragging===this&&this.finishDrag();return}if(!(qn._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(qn._dragging=this,this._preventOutline&&mo(this._element),fo(),ir(),!this._moving)){this.fire("down");var s=t.touches?t.touches[0]:t,c=fu(this._element);this._startPoint=new B(s.clientX,s.clientY),this._startPos=ri(this._element),this._parentScale=_o(c);var p=t.type==="mousedown";ze(document,p?"mousemove":"touchmove",this._onMove,this),ze(document,p?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var s=t.touches&&t.touches.length===1?t.touches[0]:t,c=new B(s.clientX,s.clientY)._subtract(this._startPoint);!c.x&&!c.y||Math.abs(c.x)+Math.abs(c.y)<this.options.clickTolerance||(c.x/=this._parentScale.x,c.y/=this._parentScale.y,St(t),this._moved||(this.fire("dragstart"),this._moved=!0,He(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),He(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(c),this._moving=!0,this._lastEvent=t,this._updatePosition())}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),yt(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){pt(document.body,"leaflet-dragging"),this._lastTarget&&(pt(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),rt(document,"mousemove touchmove",this._onMove,this),rt(document,"mouseup touchend touchcancel",this._onUp,this),po(),rr();var s=this._moved&&this._moving;this._moving=!1,qn._dragging=!1,s&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function xu(t,s,c){var p,E=[1,4,2,8],D,ne,he,ye,Le,Ce,je,Ve;for(D=0,Ce=t.length;D<Ce;D++)t[D]._code=ai(t[D],s);for(he=0;he<4;he++){for(je=E[he],p=[],D=0,Ce=t.length,ne=Ce-1;D<Ce;ne=D++)ye=t[D],Le=t[ne],ye._code&je?Le._code&je||(Ve=rs(Le,ye,je,s,c),Ve._code=ai(Ve,s),p.push(Ve)):(Le._code&je&&(Ve=rs(Le,ye,je,s,c),Ve._code=ai(Ve,s),p.push(Ve)),p.push(ye));t=p}return t}function Eu(t,s){var c,p,E,D,ne,he,ye,Le,Ce;if(!t||t.length===0)throw new Error("latlngs not passed");Zt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var je=W([0,0]),Ve=me(t),Nt=Ve.getNorthWest().distanceTo(Ve.getSouthWest())*Ve.getNorthEast().distanceTo(Ve.getNorthWest());Nt<1700&&(je=To(t));var Et=t.length,Xt=[];for(c=0;c<Et;c++){var Mt=W(t[c]);Xt.push(s.project(W([Mt.lat-je.lat,Mt.lng-je.lng])))}for(he=ye=Le=0,c=0,p=Et-1;c<Et;p=c++)E=Xt[c],D=Xt[p],ne=E.y*D.x-D.y*E.x,ye+=(E.x+D.x)*ne,Le+=(E.y+D.y)*ne,he+=ne*3;he===0?Ce=Xt[0]:Ce=[ye/he,Le/he];var Oi=s.unproject(T(Ce));return W([Oi.lat+je.lat,Oi.lng+je.lng])}function To(t){for(var s=0,c=0,p=0,E=0;E<t.length;E++){var D=W(t[E]);s+=D.lat,c+=D.lng,p++}return W([s/p,c/p])}var $p={__proto__:null,clipPolygon:xu,polygonCenter:Eu,centroid:To};function Su(t,s){if(!s||!t.length)return t.slice();var c=s*s;return t=Hp(t,c),t=zp(t,c),t}function Tu(t,s,c){return Math.sqrt(lr(t,s,c,!0))}function qp(t,s,c){return lr(t,s,c)}function zp(t,s){var c=t.length,p=typeof Uint8Array<"u"?Uint8Array:Array,E=new p(c);E[0]=E[c-1]=1,Lo(t,E,s,0,c-1);var D,ne=[];for(D=0;D<c;D++)E[D]&&ne.push(t[D]);return ne}function Lo(t,s,c,p,E){var D=0,ne,he,ye;for(he=p+1;he<=E-1;he++)ye=lr(t[he],t[p],t[E],!0),ye>D&&(ne=he,D=ye);D>c&&(s[ne]=1,Lo(t,s,c,p,ne),Lo(t,s,c,ne,E))}function Hp(t,s){for(var c=[t[0]],p=1,E=0,D=t.length;p<D;p++)Up(t[p],t[E])>s&&(c.push(t[p]),E=p);return E<D-1&&c.push(t[D-1]),c}var Lu;function Iu(t,s,c,p,E){var D=p?Lu:ai(t,c),ne=ai(s,c),he,ye,Le;for(Lu=ne;;){if(!(D|ne))return[t,s];if(D&ne)return!1;he=D||ne,ye=rs(t,s,he,c,E),Le=ai(ye,c),he===D?(t=ye,D=Le):(s=ye,ne=Le)}}function rs(t,s,c,p,E){var D=s.x-t.x,ne=s.y-t.y,he=p.min,ye=p.max,Le,Ce;return c&8?(Le=t.x+D*(ye.y-t.y)/ne,Ce=ye.y):c&4?(Le=t.x+D*(he.y-t.y)/ne,Ce=he.y):c&2?(Le=ye.x,Ce=t.y+ne*(ye.x-t.x)/D):c&1&&(Le=he.x,Ce=t.y+ne*(he.x-t.x)/D),new B(Le,Ce,E)}function ai(t,s){var c=0;return t.x<s.min.x?c|=1:t.x>s.max.x&&(c|=2),t.y<s.min.y?c|=4:t.y>s.max.y&&(c|=8),c}function Up(t,s){var c=s.x-t.x,p=s.y-t.y;return c*c+p*p}function lr(t,s,c,p){var E=s.x,D=s.y,ne=c.x-E,he=c.y-D,ye=ne*ne+he*he,Le;return ye>0&&(Le=((t.x-E)*ne+(t.y-D)*he)/ye,Le>1?(E=c.x,D=c.y):Le>0&&(E+=ne*Le,D+=he*Le)),ne=t.x-E,he=t.y-D,p?ne*ne+he*he:new B(E,D)}function Zt(t){return!v(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function Au(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Zt(t)}function Nu(t,s){var c,p,E,D,ne,he,ye,Le;if(!t||t.length===0)throw new Error("latlngs not passed");Zt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var Ce=W([0,0]),je=me(t),Ve=je.getNorthWest().distanceTo(je.getSouthWest())*je.getNorthEast().distanceTo(je.getNorthWest());Ve<1700&&(Ce=To(t));var Nt=t.length,Et=[];for(c=0;c<Nt;c++){var Xt=W(t[c]);Et.push(s.project(W([Xt.lat-Ce.lat,Xt.lng-Ce.lng])))}for(c=0,p=0;c<Nt-1;c++)p+=Et[c].distanceTo(Et[c+1])/2;if(p===0)Le=Et[0];else for(c=0,D=0;c<Nt-1;c++)if(ne=Et[c],he=Et[c+1],E=ne.distanceTo(he),D+=E,D>p){ye=(D-p)/E,Le=[he.x-ye*(he.x-ne.x),he.y-ye*(he.y-ne.y)];break}var Mt=s.unproject(T(Le));return W([Mt.lat+Ce.lat,Mt.lng+Ce.lng])}var Vp={__proto__:null,simplify:Su,pointToSegmentDistance:Tu,closestPointOnSegment:qp,clipSegment:Iu,_getEdgeIntersection:rs,_getBitCode:ai,_sqClosestPointOnSegment:lr,isFlat:Zt,_flat:Au,polylineCenter:Nu},Io={project:function(t){return new B(t.lng,t.lat)},unproject:function(t){return new Z(t.y,t.x)},bounds:new Q([-180,-90],[180,90])},Ao={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Q([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var s=Math.PI/180,c=this.R,p=t.lat*s,E=this.R_MINOR/c,D=Math.sqrt(1-E*E),ne=D*Math.sin(p),he=Math.tan(Math.PI/4-p/2)/Math.pow((1-ne)/(1+ne),D/2);return p=-c*Math.log(Math.max(he,1e-10)),new B(t.lng*s*c,p)},unproject:function(t){for(var s=180/Math.PI,c=this.R,p=this.R_MINOR/c,E=Math.sqrt(1-p*p),D=Math.exp(-t.y/c),ne=Math.PI/2-2*Math.atan(D),he=0,ye=.1,Le;he<15&&Math.abs(ye)>1e-7;he++)Le=E*Math.sin(ne),Le=Math.pow((1-Le)/(1+Le),E/2),ye=Math.PI/2-2*Math.atan(D*Le)-ne,ne+=ye;return new Z(ne*s,t.x*s/c)}},Wp={__proto__:null,LonLat:Io,Mercator:Ao,SphericalMercator:ce},Gp=o({},K,{code:"EPSG:3395",projection:Ao,transformation:(function(){var t=.5/(Math.PI*Ao.R);return Te(t,.5,-t,.5)})()}),Ru=o({},K,{code:"EPSG:4326",projection:Io,transformation:Te(1/180,1,-1/180,.5)}),Zp=o({},ee,{projection:Io,transformation:Te(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,s){var c=s.lng-t.lng,p=s.lat-t.lat;return Math.sqrt(c*c+p*p)},infinite:!0});ee.Earth=K,ee.EPSG3395=Gp,ee.EPSG3857=q,ee.EPSG900913=te,ee.EPSG4326=Ru,ee.Simple=Zp;var rn=re.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[f(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[f(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var s=t.target;if(s.hasLayer(this)){if(this._map=s,this._zoomAnimated=s._zoomAnimated,this.getEvents){var c=this.getEvents();s.on(c,this),this.once("remove",function(){s.off(c,this)},this)}this.onAdd(s),this.fire("add"),s.fire("layeradd",{layer:this})}}});Xe.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var s=f(t);return this._layers[s]?this:(this._layers[s]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var s=f(t);return this._layers[s]?(this._loaded&&t.onRemove(this),delete this._layers[s],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return f(t)in this._layers},eachLayer:function(t,s){for(var c in this._layers)t.call(s,this._layers[c]);return this},_addLayers:function(t){t=t?v(t)?t:[t]:[];for(var s=0,c=t.length;s<c;s++)this.addLayer(t[s])},_addZoomLimit:function(t){(!isNaN(t.options.maxZoom)||!isNaN(t.options.minZoom))&&(this._zoomBoundLayers[f(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var s=f(t);this._zoomBoundLayers[s]&&(delete this._zoomBoundLayers[s],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,s=-1/0,c=this._getZoomSpan();for(var p in this._zoomBoundLayers){var E=this._zoomBoundLayers[p].options;t=E.minZoom===void 0?t:Math.min(t,E.minZoom),s=E.maxZoom===void 0?s:Math.max(s,E.maxZoom)}this._layersMaxZoom=s===-1/0?void 0:s,this._layersMinZoom=t===1/0?void 0:t,c!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Ci=rn.extend({initialize:function(t,s){I(this,s),this._layers={};var c,p;if(t)for(c=0,p=t.length;c<p;c++)this.addLayer(t[c])},addLayer:function(t){var s=this.getLayerId(t);return this._layers[s]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var s=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[s]&&this._map.removeLayer(this._layers[s]),delete this._layers[s],this},hasLayer:function(t){var s=typeof t=="number"?t:this.getLayerId(t);return s in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var s=Array.prototype.slice.call(arguments,1),c,p;for(c in this._layers)p=this._layers[c],p[t]&&p[t].apply(p,s);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,s){for(var c in this._layers)t.call(s,this._layers[c]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return f(t)}}),Xp=function(t,s){return new Ci(t,s)},Sn=Ci.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Ci.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Ci.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new Y;for(var s in this._layers){var c=this._layers[s];t.extend(c.getBounds?c.getBounds():c.getLatLng())}return t}}),Qp=function(t,s){return new Sn(t,s)},Pi=F.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){I(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,s){var c=this._getIconUrl(t);if(!c){if(t==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var p=this._createImg(c,s&&s.tagName==="IMG"?s:null);return this._setIconStyles(p,t),(this.options.crossOrigin||this.options.crossOrigin==="")&&(p.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),p},_setIconStyles:function(t,s){var c=this.options,p=c[s+"Size"];typeof p=="number"&&(p=[p,p]);var E=T(p),D=T(s==="shadow"&&c.shadowAnchor||c.iconAnchor||E&&E.divideBy(2,!0));t.className="leaflet-marker-"+s+" "+(c.className||""),D&&(t.style.marginLeft=-D.x+"px",t.style.marginTop=-D.y+"px"),E&&(t.style.width=E.x+"px",t.style.height=E.y+"px")},_createImg:function(t,s){return s=s||document.createElement("img"),s.src=t,s},_getIconUrl:function(t){return ke.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Jp(t){return new Pi(t)}var ur=Pi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return typeof ur.imagePath!="string"&&(ur.imagePath=this._detectIconPath()),(this.options.imagePath||ur.imagePath)+Pi.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){var s=function(c,p,E){var D=p.exec(c);return D&&D[E]};return t=s(t,/^url\((['"])?(.+)\1\)$/,2),t&&s(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=Ke("div","leaflet-default-icon-path",document.body),s=nr(t,"background-image")||nr(t,"backgroundImage");if(document.body.removeChild(t),s=this._stripUrl(s),s)return s;var c=document.querySelector('link[href$="leaflet.css"]');return c?c.href.substring(0,c.href.length-11-1):""}}),Cu=gn.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new qn(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),He(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&pt(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var s=this._marker,c=s._map,p=this._marker.options.autoPanSpeed,E=this._marker.options.autoPanPadding,D=ri(s._icon),ne=c.getPixelBounds(),he=c.getPixelOrigin(),ye=ie(ne.min._subtract(he).add(E),ne.max._subtract(he).subtract(E));if(!ye.contains(D)){var Le=T((Math.max(ye.max.x,D.x)-ye.max.x)/(ne.max.x-ye.max.x)-(Math.min(ye.min.x,D.x)-ye.min.x)/(ne.min.x-ye.min.x),(Math.max(ye.max.y,D.y)-ye.max.y)/(ne.max.y-ye.max.y)-(Math.min(ye.min.y,D.y)-ye.min.y)/(ne.min.y-ye.min.y)).multiplyBy(p);c.panBy(Le,{animate:!1}),this._draggable._newPos._add(Le),this._draggable._startPos._add(Le),yt(s._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=$(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(G(this._panRequest),this._panRequest=$(this._adjustPan.bind(this,t)))},_onDrag:function(t){var s=this._marker,c=s._shadow,p=ri(s._icon),E=s._map.layerPointToLatLng(p);c&&yt(c,p),s._latlng=E,t.latlng=E,t.oldLatLng=this._oldLatLng,s.fire("move",t).fire("drag",t)},_onDragEnd:function(t){G(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),ss=rn.extend({options:{icon:new ur,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,s){I(this,s),this._latlng=W(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var s=this._latlng;return this._latlng=W(t),this.update(),this.fire("move",{oldLatLng:s,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,s="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),c=t.icon.createIcon(this._icon),p=!1;c!==this._icon&&(this._icon&&this._removeIcon(),p=!0,t.title&&(c.title=t.title),c.tagName==="IMG"&&(c.alt=t.alt||"")),He(c,s),t.keyboard&&(c.tabIndex="0",c.setAttribute("role","button")),this._icon=c,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&ze(c,"focus",this._panOnFocus,this);var E=t.icon.createShadow(this._shadow),D=!1;E!==this._shadow&&(this._removeShadow(),D=!0),E&&(He(E,s),E.alt=""),this._shadow=E,t.opacity<1&&this._updateOpacity(),p&&this.getPane().appendChild(this._icon),this._initInteraction(),E&&D&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&rt(this._icon,"focus",this._panOnFocus,this),ut(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ut(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&yt(this._icon,t),this._shadow&&yt(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var s=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(s)},_initInteraction:function(){if(this.options.interactive&&(He(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Cu)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Cu(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&Gt(this._icon,t),this._shadow&&Gt(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t=this._map;if(t){var s=this.options.icon.options,c=s.iconSize?T(s.iconSize):T(0,0),p=s.iconAnchor?T(s.iconAnchor):T(0,0);t.panInside(this._latlng,{paddingTopLeft:p,paddingBottomRight:c.subtract(p)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Kp(t,s){return new ss(t,s)}var zn=rn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return I(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),os=zn.extend({options:{fill:!0,radius:10},initialize:function(t,s){I(this,s),this._latlng=W(t),this._radius=this.options.radius},setLatLng:function(t){var s=this._latlng;return this._latlng=W(t),this.redraw(),this.fire("move",{oldLatLng:s,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var s=t&&t.radius||this._radius;return zn.prototype.setStyle.call(this,t),this.setRadius(s),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,s=this._radiusY||t,c=this._clickTolerance(),p=[t+c,s+c];this._pxBounds=new Q(this._point.subtract(p),this._point.add(p))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function Yp(t,s){return new os(t,s)}var No=os.extend({initialize:function(t,s,c){if(typeof s=="number"&&(s=o({},c,{radius:s})),I(this,s),this._latlng=W(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new Y(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:zn.prototype.setStyle,_project:function(){var t=this._latlng.lng,s=this._latlng.lat,c=this._map,p=c.options.crs;if(p.distance===K.distance){var E=Math.PI/180,D=this._mRadius/K.R/E,ne=c.project([s+D,t]),he=c.project([s-D,t]),ye=ne.add(he).divideBy(2),Le=c.unproject(ye).lat,Ce=Math.acos((Math.cos(D*E)-Math.sin(s*E)*Math.sin(Le*E))/(Math.cos(s*E)*Math.cos(Le*E)))/E;(isNaN(Ce)||Ce===0)&&(Ce=D/Math.cos(Math.PI/180*s)),this._point=ye.subtract(c.getPixelOrigin()),this._radius=isNaN(Ce)?0:ye.x-c.project([Le,t-Ce]).x,this._radiusY=ye.y-ne.y}else{var je=p.unproject(p.project(this._latlng).subtract([this._mRadius,0]));this._point=c.latLngToLayerPoint(this._latlng),this._radius=this._point.x-c.latLngToLayerPoint(je).x}this._updateBounds()}});function eg(t,s,c){return new No(t,s,c)}var Tn=zn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,s){I(this,s),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var s=1/0,c=null,p=lr,E,D,ne=0,he=this._parts.length;ne<he;ne++)for(var ye=this._parts[ne],Le=1,Ce=ye.length;Le<Ce;Le++){E=ye[Le-1],D=ye[Le];var je=p(t,E,D,!0);je<s&&(s=je,c=p(t,E,D))}return c&&(c.distance=Math.sqrt(s)),c},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Nu(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(t,s){return s=s||this._defaultShape(),t=W(t),s.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new Y,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Zt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var s=[],c=Zt(t),p=0,E=t.length;p<E;p++)c?(s[p]=W(t[p]),this._bounds.extend(s[p])):s[p]=this._convertLatLngs(t[p]);return s},_project:function(){var t=new Q;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),s=new B(t,t);this._rawPxBounds&&(this._pxBounds=new Q([this._rawPxBounds.min.subtract(s),this._rawPxBounds.max.add(s)]))},_projectLatlngs:function(t,s,c){var p=t[0]instanceof Z,E=t.length,D,ne;if(p){for(ne=[],D=0;D<E;D++)ne[D]=this._map.latLngToLayerPoint(t[D]),c.extend(ne[D]);s.push(ne)}else for(D=0;D<E;D++)this._projectLatlngs(t[D],s,c)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}var s=this._parts,c,p,E,D,ne,he,ye;for(c=0,E=0,D=this._rings.length;c<D;c++)for(ye=this._rings[c],p=0,ne=ye.length;p<ne-1;p++)he=Iu(ye[p],ye[p+1],t,p,!0),he&&(s[E]=s[E]||[],s[E].push(he[0]),(he[1]!==ye[p+1]||p===ne-2)&&(s[E].push(he[1]),E++))}},_simplifyPoints:function(){for(var t=this._parts,s=this.options.smoothFactor,c=0,p=t.length;c<p;c++)t[c]=Su(t[c],s)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,s){var c,p,E,D,ne,he,ye=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(c=0,D=this._parts.length;c<D;c++)for(he=this._parts[c],p=0,ne=he.length,E=ne-1;p<ne;E=p++)if(!(!s&&p===0)&&Tu(t,he[E],he[p])<=ye)return!0;return!1}});function tg(t,s){return new Tn(t,s)}Tn._flat=Au;var ki=Tn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Eu(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(t){var s=Tn.prototype._convertLatLngs.call(this,t),c=s.length;return c>=2&&s[0]instanceof Z&&s[0].equals(s[c-1])&&s.pop(),s},_setLatLngs:function(t){Tn.prototype._setLatLngs.call(this,t),Zt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Zt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,s=this.options.weight,c=new B(s,s);if(t=new Q(t.min.subtract(c),t.max.add(c)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(var p=0,E=this._rings.length,D;p<E;p++)D=xu(this._rings[p],t,!0),D.length&&this._parts.push(D)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var s=!1,c,p,E,D,ne,he,ye,Le;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(D=0,ye=this._parts.length;D<ye;D++)for(c=this._parts[D],ne=0,Le=c.length,he=Le-1;ne<Le;he=ne++)p=c[ne],E=c[he],p.y>t.y!=E.y>t.y&&t.x<(E.x-p.x)*(t.y-p.y)/(E.y-p.y)+p.x&&(s=!s);return s||Tn.prototype._containsPoint.call(this,t,!0)}});function ng(t,s){return new ki(t,s)}var Ln=Sn.extend({initialize:function(t,s){I(this,s),this._layers={},t&&this.addData(t)},addData:function(t){var s=v(t)?t:t.features,c,p,E;if(s){for(c=0,p=s.length;c<p;c++)E=s[c],(E.geometries||E.geometry||E.features||E.coordinates)&&this.addData(E);return this}var D=this.options;if(D.filter&&!D.filter(t))return this;var ne=as(t,D);return ne?(ne.feature=cs(t),ne.defaultOptions=ne.options,this.resetStyle(ne),D.onEachFeature&&D.onEachFeature(t,ne),this.addLayer(ne)):this},resetStyle:function(t){return t===void 0?this.eachLayer(this.resetStyle,this):(t.options=o({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer(function(s){this._setLayerStyle(s,t)},this)},_setLayerStyle:function(t,s){t.setStyle&&(typeof s=="function"&&(s=s(t.feature)),t.setStyle(s))}});function as(t,s){var c=t.type==="Feature"?t.geometry:t,p=c?c.coordinates:null,E=[],D=s&&s.pointToLayer,ne=s&&s.coordsToLatLng||Ro,he,ye,Le,Ce;if(!p&&!c)return null;switch(c.type){case"Point":return he=ne(p),Pu(D,t,he,s);case"MultiPoint":for(Le=0,Ce=p.length;Le<Ce;Le++)he=ne(p[Le]),E.push(Pu(D,t,he,s));return new Sn(E);case"LineString":case"MultiLineString":return ye=ls(p,c.type==="LineString"?0:1,ne),new Tn(ye,s);case"Polygon":case"MultiPolygon":return ye=ls(p,c.type==="Polygon"?1:2,ne),new ki(ye,s);case"GeometryCollection":for(Le=0,Ce=c.geometries.length;Le<Ce;Le++){var je=as({geometry:c.geometries[Le],type:"Feature",properties:t.properties},s);je&&E.push(je)}return new Sn(E);case"FeatureCollection":for(Le=0,Ce=c.features.length;Le<Ce;Le++){var Ve=as(c.features[Le],s);Ve&&E.push(Ve)}return new Sn(E);default:throw new Error("Invalid GeoJSON object.")}}function Pu(t,s,c,p){return t?t(s,c):new ss(c,p&&p.markersInheritOptions&&p)}function Ro(t){return new Z(t[1],t[0],t[2])}function ls(t,s,c){for(var p=[],E=0,D=t.length,ne;E<D;E++)ne=s?ls(t[E],s-1,c):(c||Ro)(t[E]),p.push(ne);return p}function Co(t,s){return t=W(t),t.alt!==void 0?[d(t.lng,s),d(t.lat,s),d(t.alt,s)]:[d(t.lng,s),d(t.lat,s)]}function us(t,s,c,p){for(var E=[],D=0,ne=t.length;D<ne;D++)E.push(s?us(t[D],Zt(t[D])?0:s-1,c,p):Co(t[D],p));return!s&&c&&E.length>0&&E.push(E[0].slice()),E}function Di(t,s){return t.feature?o({},t.feature,{geometry:s}):cs(s)}function cs(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var Po={toGeoJSON:function(t){return Di(this,{type:"Point",coordinates:Co(this.getLatLng(),t)})}};ss.include(Po),No.include(Po),os.include(Po),Tn.include({toGeoJSON:function(t){var s=!Zt(this._latlngs),c=us(this._latlngs,s?1:0,!1,t);return Di(this,{type:(s?"Multi":"")+"LineString",coordinates:c})}}),ki.include({toGeoJSON:function(t){var s=!Zt(this._latlngs),c=s&&!Zt(this._latlngs[0]),p=us(this._latlngs,c?2:s?1:0,!0,t);return s||(p=[p]),Di(this,{type:(c?"Multi":"")+"Polygon",coordinates:p})}}),Ci.include({toMultiPoint:function(t){var s=[];return this.eachLayer(function(c){s.push(c.toGeoJSON(t).geometry.coordinates)}),Di(this,{type:"MultiPoint",coordinates:s})},toGeoJSON:function(t){var s=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(s==="MultiPoint")return this.toMultiPoint(t);var c=s==="GeometryCollection",p=[];return this.eachLayer(function(E){if(E.toGeoJSON){var D=E.toGeoJSON(t);if(c)p.push(D.geometry);else{var ne=cs(D);ne.type==="FeatureCollection"?p.push.apply(p,ne.features):p.push(ne)}}}),c?Di(this,{geometries:p,type:"GeometryCollection"}):{type:"FeatureCollection",features:p}}});function ku(t,s){return new Ln(t,s)}var ig=ku,ds=rn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,s,c){this._url=t,this._bounds=me(s),I(this,c)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(He(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ut(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&Ni(this._image),this},bringToBack:function(){return this._map&&Ri(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=me(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._url.tagName==="IMG",s=this._image=t?this._url:Ke("img");if(He(s,"leaflet-image-layer"),this._zoomAnimated&&He(s,"leaflet-zoom-animated"),this.options.className&&He(s,this.options.className),s.onselectstart=_,s.onmousemove=_,s.onload=l(this.fire,this,"load"),s.onerror=l(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(s.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=s.src;return}s.src=this._url,s.alt=this.options.alt},_animateZoom:function(t){var s=this._map.getZoomScale(t.zoom),c=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;ii(this._image,c,s)},_reset:function(){var t=this._image,s=new Q(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),c=s.getSize();yt(t,s.min),t.style.width=c.x+"px",t.style.height=c.y+"px"},_updateOpacity:function(){Gt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),rg=function(t,s,c){return new ds(t,s,c)},Du=ds.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t=this._url.tagName==="VIDEO",s=this._image=t?this._url:Ke("video");if(He(s,"leaflet-image-layer"),this._zoomAnimated&&He(s,"leaflet-zoom-animated"),this.options.className&&He(s,this.options.className),s.onselectstart=_,s.onmousemove=_,s.onloadeddata=l(this.fire,this,"load"),t){for(var c=s.getElementsByTagName("source"),p=[],E=0;E<c.length;E++)p.push(c[E].src);this._url=c.length>0?p:[s.src];return}v(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(s.style,"objectFit")&&(s.style.objectFit="fill"),s.autoplay=!!this.options.autoplay,s.loop=!!this.options.loop,s.muted=!!this.options.muted,s.playsInline=!!this.options.playsInline;for(var D=0;D<this._url.length;D++){var ne=Ke("source");ne.src=this._url[D],s.appendChild(ne)}}});function sg(t,s,c){return new Du(t,s,c)}var Mu=ds.extend({_initImage:function(){var t=this._image=this._url;He(t,"leaflet-image-layer"),this._zoomAnimated&&He(t,"leaflet-zoom-animated"),this.options.className&&He(t,this.options.className),t.onselectstart=_,t.onmousemove=_}});function og(t,s,c){return new Mu(t,s,c)}var mn=rn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,s){t&&(t instanceof Z||v(t))?(this._latlng=W(t),I(this,s)):(I(this,t),this._source=s),this.options.content&&(this._content=this.options.content)},openOn:function(t){return t=arguments.length?t:this._source._map,t.hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&Gt(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&Gt(this._container,1),this.bringToFront(),this.options.interactive&&(He(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(Gt(this._container,0),this._removeTimeout=setTimeout(l(ut,void 0,this._container),200)):ut(this._container),this.options.interactive&&(pt(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=W(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Ni(this._container),this},bringToBack:function(){return this._map&&Ri(this._container),this},_prepareOpen:function(t){var s=this._source;if(!s._map)return!1;if(s instanceof Sn){s=null;var c=this._source._layers;for(var p in c)if(c[p]._map){s=c[p];break}if(!s)return!1;this._source=s}if(!t)if(s.getCenter)t=s.getCenter();else if(s.getLatLng)t=s.getLatLng();else if(s.getBounds)t=s.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,s=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof s=="string")t.innerHTML=s;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(s)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),s=T(this.options.offset),c=this._getAnchor();this._zoomAnimated?yt(this._container,t.add(c)):s=s.add(t).add(c);var p=this._containerBottom=-s.y,E=this._containerLeft=-Math.round(this._containerWidth/2)+s.x;this._container.style.bottom=p+"px",this._container.style.left=E+"px"}},_getAnchor:function(){return[0,0]}});Xe.include({_initOverlay:function(t,s,c,p){var E=s;return E instanceof t||(E=new t(p).setContent(s)),c&&E.setLatLng(c),E}}),rn.include({_initOverlay:function(t,s,c,p){var E=c;return E instanceof t?(I(E,p),E._source=this):(E=s&&!p?s:new t(p,this),E.setContent(c)),E}});var hs=mn.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t=arguments.length?t:this._source._map,!t.hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,mn.prototype.openOn.call(this,t)},onAdd:function(t){mn.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof zn||this._source.on("preclick",si))},onRemove:function(t){mn.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof zn||this._source.off("preclick",si))},getEvents:function(){var t=mn.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",s=this._container=Ke("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),c=this._wrapper=Ke("div",t+"-content-wrapper",s);if(this._contentNode=Ke("div",t+"-content",c),or(s),wo(this._contentNode),ze(s,"contextmenu",si),this._tipContainer=Ke("div",t+"-tip-container",s),this._tip=Ke("div",t+"-tip",this._tipContainer),this.options.closeButton){var p=this._closeButton=Ke("a",t+"-close-button",s);p.setAttribute("role","button"),p.setAttribute("aria-label","Close popup"),p.href="#close",p.innerHTML='<span aria-hidden="true">×</span>',ze(p,"click",function(E){St(E),this.close()},this)}},_updateLayout:function(){var t=this._contentNode,s=t.style;s.width="",s.whiteSpace="nowrap";var c=t.offsetWidth;c=Math.min(c,this.options.maxWidth),c=Math.max(c,this.options.minWidth),s.width=c+1+"px",s.whiteSpace="",s.height="";var p=t.offsetHeight,E=this.options.maxHeight,D="leaflet-popup-scrolled";E&&p>E?(s.height=E+"px",He(t,D)):pt(t,D),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var s=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),c=this._getAnchor();yt(this._container,s.add(c))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,s=parseInt(nr(this._container,"marginBottom"),10)||0,c=this._container.offsetHeight+s,p=this._containerWidth,E=new B(this._containerLeft,-c-this._containerBottom);E._add(ri(this._container));var D=t.layerPointToContainerPoint(E),ne=T(this.options.autoPanPadding),he=T(this.options.autoPanPaddingTopLeft||ne),ye=T(this.options.autoPanPaddingBottomRight||ne),Le=t.getSize(),Ce=0,je=0;D.x+p+ye.x>Le.x&&(Ce=D.x+p-Le.x+ye.x),D.x-Ce-he.x<0&&(Ce=D.x-he.x),D.y+c+ye.y>Le.y&&(je=D.y+c-Le.y+ye.y),D.y-je-he.y<0&&(je=D.y-he.y),(Ce||je)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([Ce,je]))}},_getAnchor:function(){return T(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),ag=function(t,s){return new hs(t,s)};Xe.mergeOptions({closePopupOnClick:!0}),Xe.include({openPopup:function(t,s,c){return this._initOverlay(hs,t,s,c).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),rn.include({bindPopup:function(t,s){return this._popup=this._initOverlay(hs,this._popup,t,s),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Sn||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(!(!this._popup||!this._map)){oi(t);var s=t.layer||t.target;if(this._popup._source===s&&!(s instanceof zn)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng);return}this._popup._source=s,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){t.originalEvent.keyCode===13&&this._openPopup(t)}});var fs=mn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){mn.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){mn.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=mn.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip",s=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Ke("div",s),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+f(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var s,c,p=this._map,E=this._container,D=p.latLngToContainerPoint(p.getCenter()),ne=p.layerPointToContainerPoint(t),he=this.options.direction,ye=E.offsetWidth,Le=E.offsetHeight,Ce=T(this.options.offset),je=this._getAnchor();he==="top"?(s=ye/2,c=Le):he==="bottom"?(s=ye/2,c=0):he==="center"?(s=ye/2,c=Le/2):he==="right"?(s=0,c=Le/2):he==="left"?(s=ye,c=Le/2):ne.x<D.x?(he="right",s=0,c=Le/2):(he="left",s=ye+(Ce.x+je.x)*2,c=Le/2),t=t.subtract(T(s,c,!0)).add(Ce).add(je),pt(E,"leaflet-tooltip-right"),pt(E,"leaflet-tooltip-left"),pt(E,"leaflet-tooltip-top"),pt(E,"leaflet-tooltip-bottom"),He(E,"leaflet-tooltip-"+he),yt(E,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&Gt(this._container,t)},_animateZoom:function(t){var s=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(s)},_getAnchor:function(){return T(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),lg=function(t,s){return new fs(t,s)};Xe.include({openTooltip:function(t,s,c){return this._initOverlay(fs,t,s,c).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),rn.include({bindTooltip:function(t,s){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(fs,this._tooltip,t,s),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(!(!t&&this._tooltipHandlersAdded)){var s=t?"off":"on",c={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?c.add=this._openTooltip:(c.mouseover=this._openTooltip,c.mouseout=this.closeTooltip,c.click=this._openTooltip,this._map?this._addFocusListeners():c.add=this._addFocusListeners),this._tooltip.options.sticky&&(c.mousemove=this._moveTooltip),this[s](c),this._tooltipHandlersAdded=!t}},openTooltip:function(t){return this._tooltip&&(this instanceof Sn||(this._tooltip._source=this),this._tooltip._prepareOpen(t)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var s=typeof t.getElement=="function"&&t.getElement();s&&(ze(s,"focus",function(){this._tooltip._source=t,this.openTooltip()},this),ze(s,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){var s=typeof t.getElement=="function"&&t.getElement();s&&s.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var s=this;this._map.once("moveend",function(){s._openOnceFlag=!1,s._openTooltip(t)});return}this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0)}},_moveTooltip:function(t){var s=t.latlng,c,p;this._tooltip.options.sticky&&t.originalEvent&&(c=this._map.mouseEventToContainerPoint(t.originalEvent),p=this._map.containerPointToLayerPoint(c),s=this._map.layerPointToLatLng(p)),this._tooltip.setLatLng(s)}});var Ou=Pi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var s=t&&t.tagName==="DIV"?t:document.createElement("div"),c=this.options;if(c.html instanceof Element?(Yr(s),s.appendChild(c.html)):s.innerHTML=c.html!==!1?c.html:"",c.bgPos){var p=T(c.bgPos);s.style.backgroundPosition=-p.x+"px "+-p.y+"px"}return this._setIconStyles(s,"icon"),s},createShadow:function(){return null}});function ug(t){return new Ou(t)}Pi.Default=ur;var cr=rn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:ke.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){I(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ut(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Ni(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Ri(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var t=this._clampZoom(this._map.getZoom());t!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()}return this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=h(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof B?t:new B(t,t)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var s=this.getPane().children,c=-t(-1/0,1/0),p=0,E=s.length,D;p<E;p++)D=s[p].style.zIndex,s[p]!==this._container&&D&&(c=t(c,+D));isFinite(c)&&(this.options.zIndex=c+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!ke.ielt9){Gt(this._container,this.options.opacity);var t=+new Date,s=!1,c=!1;for(var p in this._tiles){var E=this._tiles[p];if(!(!E.current||!E.loaded)){var D=Math.min(1,(t-E.loaded)/200);Gt(E.el,D),D<1?s=!0:(E.active?c=!0:this._onOpaqueTile(E),E.active=!0)}}c&&!this._noPrune&&this._pruneTiles(),s&&(G(this._fadeFrame),this._fadeFrame=$(this._updateOpacity,this))}},_onOpaqueTile:_,_initContainer:function(){this._container||(this._container=Ke("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,s=this.options.maxZoom;if(t!==void 0){for(var c in this._levels)c=Number(c),this._levels[c].el.children.length||c===t?(this._levels[c].el.style.zIndex=s-Math.abs(t-c),this._onUpdateLevel(c)):(ut(this._levels[c].el),this._removeTilesAtZoom(c),this._onRemoveLevel(c),delete this._levels[c]);var p=this._levels[t],E=this._map;return p||(p=this._levels[t]={},p.el=Ke("div","leaflet-tile-container leaflet-zoom-animated",this._container),p.el.style.zIndex=s,p.origin=E.project(E.unproject(E.getPixelOrigin()),t).round(),p.zoom=t,this._setZoomTransform(p,E.getCenter(),E.getZoom()),_(p.el.offsetWidth),this._onCreateLevel(p)),this._level=p,p}},_onUpdateLevel:_,_onRemoveLevel:_,_onCreateLevel:_,_pruneTiles:function(){if(this._map){var t,s,c=this._map.getZoom();if(c>this.options.maxZoom||c<this.options.minZoom){this._removeAllTiles();return}for(t in this._tiles)s=this._tiles[t],s.retain=s.current;for(t in this._tiles)if(s=this._tiles[t],s.current&&!s.active){var p=s.coords;this._retainParent(p.x,p.y,p.z,p.z-5)||this._retainChildren(p.x,p.y,p.z,p.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}},_removeTilesAtZoom:function(t){for(var s in this._tiles)this._tiles[s].coords.z===t&&this._removeTile(s)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ut(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,s,c,p){var E=Math.floor(t/2),D=Math.floor(s/2),ne=c-1,he=new B(+E,+D);he.z=+ne;var ye=this._tileCoordsToKey(he),Le=this._tiles[ye];return Le&&Le.active?(Le.retain=!0,!0):(Le&&Le.loaded&&(Le.retain=!0),ne>p?this._retainParent(E,D,ne,p):!1)},_retainChildren:function(t,s,c,p){for(var E=2*t;E<2*t+2;E++)for(var D=2*s;D<2*s+2;D++){var ne=new B(E,D);ne.z=c+1;var he=this._tileCoordsToKey(ne),ye=this._tiles[he];if(ye&&ye.active){ye.retain=!0;continue}else ye&&ye.loaded&&(ye.retain=!0);c+1<p&&this._retainChildren(E,D,c+1,p)}},_resetView:function(t){var s=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),s,s)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var s=this.options;return s.minNativeZoom!==void 0&&t<s.minNativeZoom?s.minNativeZoom:s.maxNativeZoom!==void 0&&s.maxNativeZoom<t?s.maxNativeZoom:t},_setView:function(t,s,c,p){var E=Math.round(s);this.options.maxZoom!==void 0&&E>this.options.maxZoom||this.options.minZoom!==void 0&&E<this.options.minZoom?E=void 0:E=this._clampZoom(E);var D=this.options.updateWhenZooming&&E!==this._tileZoom;(!p||D)&&(this._tileZoom=E,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),E!==void 0&&this._update(t),c||this._pruneTiles(),this._noPrune=!!c),this._setZoomTransforms(t,s)},_setZoomTransforms:function(t,s){for(var c in this._levels)this._setZoomTransform(this._levels[c],t,s)},_setZoomTransform:function(t,s,c){var p=this._map.getZoomScale(c,t.zoom),E=t.origin.multiplyBy(p).subtract(this._map._getNewPixelOrigin(s,c)).round();ke.any3d?ii(t.el,E,p):yt(t.el,E)},_resetGrid:function(){var t=this._map,s=t.options.crs,c=this._tileSize=this.getTileSize(),p=this._tileZoom,E=this._map.getPixelWorldBounds(this._tileZoom);E&&(this._globalTileRange=this._pxBoundsToTileRange(E)),this._wrapX=s.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,s.wrapLng[0]],p).x/c.x),Math.ceil(t.project([0,s.wrapLng[1]],p).x/c.y)],this._wrapY=s.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([s.wrapLat[0],0],p).y/c.x),Math.ceil(t.project([s.wrapLat[1],0],p).y/c.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(t){var s=this._map,c=s._animatingZoom?Math.max(s._animateToZoom,s.getZoom()):s.getZoom(),p=s.getZoomScale(c,this._tileZoom),E=s.project(t,this._tileZoom).floor(),D=s.getSize().divideBy(p*2);return new Q(E.subtract(D),E.add(D))},_update:function(t){var s=this._map;if(s){var c=this._clampZoom(s.getZoom());if(t===void 0&&(t=s.getCenter()),this._tileZoom!==void 0){var p=this._getTiledPixelBounds(t),E=this._pxBoundsToTileRange(p),D=E.getCenter(),ne=[],he=this.options.keepBuffer,ye=new Q(E.getBottomLeft().subtract([he,-he]),E.getTopRight().add([he,-he]));if(!(isFinite(E.min.x)&&isFinite(E.min.y)&&isFinite(E.max.x)&&isFinite(E.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var Le in this._tiles){var Ce=this._tiles[Le].coords;(Ce.z!==this._tileZoom||!ye.contains(new B(Ce.x,Ce.y)))&&(this._tiles[Le].current=!1)}if(Math.abs(c-this._tileZoom)>1){this._setView(t,c);return}for(var je=E.min.y;je<=E.max.y;je++)for(var Ve=E.min.x;Ve<=E.max.x;Ve++){var Nt=new B(Ve,je);if(Nt.z=this._tileZoom,!!this._isValidTile(Nt)){var Et=this._tiles[this._tileCoordsToKey(Nt)];Et?Et.current=!0:ne.push(Nt)}}if(ne.sort(function(Mt,Oi){return Mt.distanceTo(D)-Oi.distanceTo(D)}),ne.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Xt=document.createDocumentFragment();for(Ve=0;Ve<ne.length;Ve++)this._addTile(ne[Ve],Xt);this._level.el.appendChild(Xt)}}}},_isValidTile:function(t){var s=this._map.options.crs;if(!s.infinite){var c=this._globalTileRange;if(!s.wrapLng&&(t.x<c.min.x||t.x>c.max.x)||!s.wrapLat&&(t.y<c.min.y||t.y>c.max.y))return!1}if(!this.options.bounds)return!0;var p=this._tileCoordsToBounds(t);return me(this.options.bounds).overlaps(p)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var s=this._map,c=this.getTileSize(),p=t.scaleBy(c),E=p.add(c),D=s.unproject(p,t.z),ne=s.unproject(E,t.z);return[D,ne]},_tileCoordsToBounds:function(t){var s=this._tileCoordsToNwSe(t),c=new Y(s[0],s[1]);return this.options.noWrap||(c=this._map.wrapLatLngBounds(c)),c},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var s=t.split(":"),c=new B(+s[0],+s[1]);return c.z=+s[2],c},_removeTile:function(t){var s=this._tiles[t];s&&(ut(s.el),delete this._tiles[t],this.fire("tileunload",{tile:s.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){He(t,"leaflet-tile");var s=this.getTileSize();t.style.width=s.x+"px",t.style.height=s.y+"px",t.onselectstart=_,t.onmousemove=_,ke.ielt9&&this.options.opacity<1&&Gt(t,this.options.opacity)},_addTile:function(t,s){var c=this._getTilePos(t),p=this._tileCoordsToKey(t),E=this.createTile(this._wrapCoords(t),l(this._tileReady,this,t));this._initTile(E),this.createTile.length<2&&$(l(this._tileReady,this,t,null,E)),yt(E,c),this._tiles[p]={el:E,coords:t,current:!0},s.appendChild(E),this.fire("tileloadstart",{tile:E,coords:t})},_tileReady:function(t,s,c){s&&this.fire("tileerror",{error:s,tile:c,coords:t});var p=this._tileCoordsToKey(t);c=this._tiles[p],c&&(c.loaded=+new Date,this._map._fadeAnimated?(Gt(c.el,0),G(this._fadeFrame),this._fadeFrame=$(this._updateOpacity,this)):(c.active=!0,this._pruneTiles()),s||(He(c.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:c.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ke.ielt9||!this._map._fadeAnimated?$(this._pruneTiles,this):setTimeout(l(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var s=new B(this._wrapX?g(t.x,this._wrapX):t.x,this._wrapY?g(t.y,this._wrapY):t.y);return s.z=t.z,s},_pxBoundsToTileRange:function(t){var s=this.getTileSize();return new Q(t.min.unscaleBy(s).floor(),t.max.unscaleBy(s).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function cg(t){return new cr(t)}var Mi=cr.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,s){this._url=t,s=I(this,s),s.detectRetina&&ke.retina&&s.maxZoom>0?(s.tileSize=Math.floor(s.tileSize/2),s.zoomReverse?(s.zoomOffset--,s.minZoom=Math.min(s.maxZoom,s.minZoom+1)):(s.zoomOffset++,s.maxZoom=Math.max(s.minZoom,s.maxZoom-1)),s.minZoom=Math.max(0,s.minZoom)):s.zoomReverse?s.minZoom=Math.min(s.maxZoom,s.minZoom):s.maxZoom=Math.max(s.minZoom,s.maxZoom),typeof s.subdomains=="string"&&(s.subdomains=s.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,s){return this._url===t&&s===void 0&&(s=!0),this._url=t,s||this.redraw(),this},createTile:function(t,s){var c=document.createElement("img");return ze(c,"load",l(this._tileOnLoad,this,s,c)),ze(c,"error",l(this._tileOnError,this,s,c)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(c.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(c.referrerPolicy=this.options.referrerPolicy),c.alt="",c.src=this.getTileUrl(t),c},getTileUrl:function(t){var s={r:ke.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var c=this._globalTileRange.max.y-t.y;this.options.tms&&(s.y=c),s["-y"]=c}return P(this._url,o(s,this.options))},_tileOnLoad:function(t,s){ke.ielt9?setTimeout(l(t,this,null,s),0):t(null,s)},_tileOnError:function(t,s,c){var p=this.options.errorTileUrl;p&&s.getAttribute("src")!==p&&(s.src=p),t(c,s)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,s=this.options.maxZoom,c=this.options.zoomReverse,p=this.options.zoomOffset;return c&&(t=s-t),t+p},_getSubdomain:function(t){var s=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[s]},_abortLoading:function(){var t,s;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&(s=this._tiles[t].el,s.onload=_,s.onerror=_,!s.complete)){s.src=S;var c=this._tiles[t].coords;ut(s),delete this._tiles[t],this.fire("tileabort",{tile:s,coords:c})}},_removeTile:function(t){var s=this._tiles[t];if(s)return s.el.setAttribute("src",S),cr.prototype._removeTile.call(this,t)},_tileReady:function(t,s,c){if(!(!this._map||c&&c.getAttribute("src")===S))return cr.prototype._tileReady.call(this,t,s,c)}});function Fu(t,s){return new Mi(t,s)}var ju=Mi.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,s){this._url=t;var c=o({},this.defaultWmsParams);for(var p in s)p in this.options||(c[p]=s[p]);s=I(this,s);var E=s.detectRetina&&ke.retina?2:1,D=this.getTileSize();c.width=D.x*E,c.height=D.y*E,this.wmsParams=c},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var s=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[s]=this._crs.code,Mi.prototype.onAdd.call(this,t)},getTileUrl:function(t){var s=this._tileCoordsToNwSe(t),c=this._crs,p=ie(c.project(s[0]),c.project(s[1])),E=p.min,D=p.max,ne=(this._wmsVersion>=1.3&&this._crs===Ru?[E.y,E.x,D.y,D.x]:[E.x,E.y,D.x,D.y]).join(","),he=Mi.prototype.getTileUrl.call(this,t);return he+A(this.wmsParams,he,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+ne},setParams:function(t,s){return o(this.wmsParams,t),s||this.redraw(),this}});function dg(t,s){return new ju(t,s)}Mi.WMS=ju,Fu.wms=dg;var In=rn.extend({options:{padding:.1},initialize:function(t){I(this,t),f(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),He(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,s){var c=this._map.getZoomScale(s,this._zoom),p=this._map.getSize().multiplyBy(.5+this.options.padding),E=this._map.project(this._center,s),D=p.multiplyBy(-c).add(E).subtract(this._map._getNewPixelOrigin(t,s));ke.any3d?ii(this._container,D,c):yt(this._container,D)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,s=this._map.getSize(),c=this._map.containerPointToLayerPoint(s.multiplyBy(-t)).round();this._bounds=new Q(c,c.add(s.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Bu=In.extend({options:{tolerance:0},getEvents:function(){var t=In.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){In.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");ze(t,"mousemove",this._onMouseMove,this),ze(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ze(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){G(this._redrawRequest),delete this._ctx,ut(this._container),rt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;this._redrawBounds=null;for(var s in this._layers)t=this._layers[s],t._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){In.prototype._update.call(this);var t=this._bounds,s=this._container,c=t.getSize(),p=ke.retina?2:1;yt(s,t.min),s.width=p*c.x,s.height=p*c.y,s.style.width=c.x+"px",s.style.height=c.y+"px",ke.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){In.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[f(t)]=t;var s=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=s),this._drawLast=s,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var s=t._order,c=s.next,p=s.prev;c?c.prev=p:this._drawLast=p,p?p.next=c:this._drawFirst=c,delete t._order,delete this._layers[f(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(typeof t.options.dashArray=="string"){var s=t.options.dashArray.split(/[, ]+/),c=[],p,E;for(E=0;E<s.length;E++){if(p=Number(s[E]),isNaN(p))return;c.push(p)}t.options._dashArray=c}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||$(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var s=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Q,this._redrawBounds.extend(t._pxBounds.min.subtract([s,s])),this._redrawBounds.extend(t._pxBounds.max.add([s,s]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var s=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,s.x,s.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,s=this._redrawBounds;if(this._ctx.save(),s){var c=s.getSize();this._ctx.beginPath(),this._ctx.rect(s.min.x,s.min.y,c.x,c.y),this._ctx.clip()}this._drawing=!0;for(var p=this._drawFirst;p;p=p.next)t=p.layer,(!s||t._pxBounds&&t._pxBounds.intersects(s))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,s){if(this._drawing){var c,p,E,D,ne=t._parts,he=ne.length,ye=this._ctx;if(he){for(ye.beginPath(),c=0;c<he;c++){for(p=0,E=ne[c].length;p<E;p++)D=ne[c][p],ye[p?"lineTo":"moveTo"](D.x,D.y);s&&ye.closePath()}this._fillStroke(ye,t)}}},_updateCircle:function(t){if(!(!this._drawing||t._empty())){var s=t._point,c=this._ctx,p=Math.max(Math.round(t._radius),1),E=(Math.max(Math.round(t._radiusY),1)||p)/p;E!==1&&(c.save(),c.scale(1,E)),c.beginPath(),c.arc(s.x,s.y/E,p,0,Math.PI*2,!1),E!==1&&c.restore(),this._fillStroke(c,t)}},_fillStroke:function(t,s){var c=s.options;c.fill&&(t.globalAlpha=c.fillOpacity,t.fillStyle=c.fillColor||c.color,t.fill(c.fillRule||"evenodd")),c.stroke&&c.weight!==0&&(t.setLineDash&&t.setLineDash(s.options&&s.options._dashArray||[]),t.globalAlpha=c.opacity,t.lineWidth=c.weight,t.strokeStyle=c.color,t.lineCap=c.lineCap,t.lineJoin=c.lineJoin,t.stroke())},_onClick:function(t){for(var s=this._map.mouseEventToLayerPoint(t),c,p,E=this._drawFirst;E;E=E.next)c=E.layer,c.options.interactive&&c._containsPoint(s)&&(!(t.type==="click"||t.type==="preclick")||!this._map._draggableMoved(c))&&(p=c);this._fireEvent(p?[p]:!1,t)},_onMouseMove:function(t){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var s=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,s)}},_handleMouseOut:function(t){var s=this._hoveredLayer;s&&(pt(this._container,"leaflet-interactive"),this._fireEvent([s],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,s){if(!this._mouseHoverThrottled){for(var c,p,E=this._drawFirst;E;E=E.next)c=E.layer,c.options.interactive&&c._containsPoint(s)&&(p=c);p!==this._hoveredLayer&&(this._handleMouseOut(t),p&&(He(this._container,"leaflet-interactive"),this._fireEvent([p],t,"mouseover"),this._hoveredLayer=p)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,t),this._mouseHoverThrottled=!0,setTimeout(l(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,s,c){this._map._fireDOMEvent(s,c||s.type,t)},_bringToFront:function(t){var s=t._order;if(s){var c=s.next,p=s.prev;if(c)c.prev=p;else return;p?p.next=c:c&&(this._drawFirst=c),s.prev=this._drawLast,this._drawLast.next=s,s.next=null,this._drawLast=s,this._requestRedraw(t)}},_bringToBack:function(t){var s=t._order;if(s){var c=s.next,p=s.prev;if(p)p.next=c;else return;c?c.prev=p:p&&(this._drawLast=p),s.prev=null,s.next=this._drawFirst,this._drawFirst.prev=s,this._drawFirst=s,this._requestRedraw(t)}}});function $u(t){return ke.canvas?new Bu(t):null}var dr=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch{}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),hg={_initContainer:function(){this._container=Ke("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(In.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var s=t._container=dr("shape");He(s,"leaflet-vml-shape "+(this.options.className||"")),s.coordsize="1 1",t._path=dr("path"),s.appendChild(t._path),this._updateStyle(t),this._layers[f(t)]=t},_addPath:function(t){var s=t._container;this._container.appendChild(s),t.options.interactive&&t.addInteractiveTarget(s)},_removePath:function(t){var s=t._container;ut(s),t.removeInteractiveTarget(s),delete this._layers[f(t)]},_updateStyle:function(t){var s=t._stroke,c=t._fill,p=t.options,E=t._container;E.stroked=!!p.stroke,E.filled=!!p.fill,p.stroke?(s||(s=t._stroke=dr("stroke")),E.appendChild(s),s.weight=p.weight+"px",s.color=p.color,s.opacity=p.opacity,p.dashArray?s.dashStyle=v(p.dashArray)?p.dashArray.join(" "):p.dashArray.replace(/( *, *)/g," "):s.dashStyle="",s.endcap=p.lineCap.replace("butt","flat"),s.joinstyle=p.lineJoin):s&&(E.removeChild(s),t._stroke=null),p.fill?(c||(c=t._fill=dr("fill")),E.appendChild(c),c.color=p.fillColor||p.color,c.opacity=p.fillOpacity):c&&(E.removeChild(c),t._fill=null)},_updateCircle:function(t){var s=t._point.round(),c=Math.round(t._radius),p=Math.round(t._radiusY||c);this._setPath(t,t._empty()?"M0 0":"AL "+s.x+","+s.y+" "+c+","+p+" 0,"+65535*360)},_setPath:function(t,s){t._path.v=s},_bringToFront:function(t){Ni(t._container)},_bringToBack:function(t){Ri(t._container)}},ps=ke.vml?dr:fe,hr=In.extend({_initContainer:function(){this._container=ps("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=ps("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ut(this._container),rt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){In.prototype._update.call(this);var t=this._bounds,s=t.getSize(),c=this._container;(!this._svgSize||!this._svgSize.equals(s))&&(this._svgSize=s,c.setAttribute("width",s.x),c.setAttribute("height",s.y)),yt(c,t.min),c.setAttribute("viewBox",[t.min.x,t.min.y,s.x,s.y].join(" ")),this.fire("update")}},_initPath:function(t){var s=t._path=ps("path");t.options.className&&He(s,t.options.className),t.options.interactive&&He(s,"leaflet-interactive"),this._updateStyle(t),this._layers[f(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ut(t._path),t.removeInteractiveTarget(t._path),delete this._layers[f(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var s=t._path,c=t.options;s&&(c.stroke?(s.setAttribute("stroke",c.color),s.setAttribute("stroke-opacity",c.opacity),s.setAttribute("stroke-width",c.weight),s.setAttribute("stroke-linecap",c.lineCap),s.setAttribute("stroke-linejoin",c.lineJoin),c.dashArray?s.setAttribute("stroke-dasharray",c.dashArray):s.removeAttribute("stroke-dasharray"),c.dashOffset?s.setAttribute("stroke-dashoffset",c.dashOffset):s.removeAttribute("stroke-dashoffset")):s.setAttribute("stroke","none"),c.fill?(s.setAttribute("fill",c.fillColor||c.color),s.setAttribute("fill-opacity",c.fillOpacity),s.setAttribute("fill-rule",c.fillRule||"evenodd")):s.setAttribute("fill","none"))},_updatePoly:function(t,s){this._setPath(t,xe(t._parts,s))},_updateCircle:function(t){var s=t._point,c=Math.max(Math.round(t._radius),1),p=Math.max(Math.round(t._radiusY),1)||c,E="a"+c+","+p+" 0 1,0 ",D=t._empty()?"M0 0":"M"+(s.x-c)+","+s.y+E+c*2+",0 "+E+-c*2+",0 ";this._setPath(t,D)},_setPath:function(t,s){t._path.setAttribute("d",s)},_bringToFront:function(t){Ni(t._path)},_bringToBack:function(t){Ri(t._path)}});ke.vml&&hr.include(hg);function qu(t){return ke.svg||ke.vml?new hr(t):null}Xe.include({getRenderer:function(t){var s=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return s||(s=this._renderer=this._createRenderer()),this.hasLayer(s)||this.addLayer(s),s},_getPaneRenderer:function(t){if(t==="overlayPane"||t===void 0)return!1;var s=this._paneRenderers[t];return s===void 0&&(s=this._createRenderer({pane:t}),this._paneRenderers[t]=s),s},_createRenderer:function(t){return this.options.preferCanvas&&$u(t)||qu(t)}});var zu=ki.extend({initialize:function(t,s){ki.prototype.initialize.call(this,this._boundsToLatLngs(t),s)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=me(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function fg(t,s){return new zu(t,s)}hr.create=ps,hr.pointsToPath=xe,Ln.geometryToLayer=as,Ln.coordsToLatLng=Ro,Ln.coordsToLatLngs=ls,Ln.latLngToCoords=Co,Ln.latLngsToCoords=us,Ln.getFeature=Di,Ln.asFeature=cs,Xe.mergeOptions({boxZoom:!0});var Hu=gn.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){ze(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){rt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ut(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||t.which!==1&&t.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),ir(),fo(),this._startPoint=this._map.mouseEventToContainerPoint(t),ze(document,{contextmenu:oi,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=Ke("div","leaflet-zoom-box",this._container),He(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var s=new Q(this._point,this._startPoint),c=s.getSize();yt(this._box,s.min),this._box.style.width=c.x+"px",this._box.style.height=c.y+"px"},_finish:function(){this._moved&&(ut(this._box),pt(this._container,"leaflet-crosshair")),rr(),po(),rt(document,{contextmenu:oi,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if(!(t.which!==1&&t.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(l(this._resetState,this),0);var s=new Y(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(s).fire("boxzoomend",{boxZoomBounds:s})}},_onKeyDown:function(t){t.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Xe.addInitHook("addHandler","boxZoom",Hu),Xe.mergeOptions({doubleClickZoom:!0});var Uu=gn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var s=this._map,c=s.getZoom(),p=s.options.zoomDelta,E=t.originalEvent.shiftKey?c-p:c+p;s.options.doubleClickZoom==="center"?s.setZoom(E):s.setZoomAround(t.containerPoint,E)}});Xe.addInitHook("addHandler","doubleClickZoom",Uu),Xe.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Vu=gn.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new qn(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}He(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){pt(this._map._container,"leaflet-grab"),pt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var s=me(this._map.options.maxBounds);this._offsetLimit=ie(this._map.latLngToContainerPoint(s.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(s.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var s=this._lastTime=+new Date,c=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(c),this._times.push(s),this._prunePositions(s)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),s=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=s.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,s){return t-(t-s)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var t=this._draggable._newPos.subtract(this._draggable._startPos),s=this._offsetLimit;t.x<s.min.x&&(t.x=this._viscousLimit(t.x,s.min.x)),t.y<s.min.y&&(t.y=this._viscousLimit(t.y,s.min.y)),t.x>s.max.x&&(t.x=this._viscousLimit(t.x,s.max.x)),t.y>s.max.y&&(t.y=this._viscousLimit(t.y,s.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,s=Math.round(t/2),c=this._initialWorldOffset,p=this._draggable._newPos.x,E=(p-s+c)%t+s-c,D=(p+s+c)%t-s-c,ne=Math.abs(E+c)<Math.abs(D+c)?E:D;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=ne},_onDragEnd:function(t){var s=this._map,c=s.options,p=!c.inertia||t.noInertia||this._times.length<2;if(s.fire("dragend",t),p)s.fire("moveend");else{this._prunePositions(+new Date);var E=this._lastPos.subtract(this._positions[0]),D=(this._lastTime-this._times[0])/1e3,ne=c.easeLinearity,he=E.multiplyBy(ne/D),ye=he.distanceTo([0,0]),Le=Math.min(c.inertiaMaxSpeed,ye),Ce=he.multiplyBy(Le/ye),je=Le/(c.inertiaDeceleration*ne),Ve=Ce.multiplyBy(-je/2).round();!Ve.x&&!Ve.y?s.fire("moveend"):(Ve=s._limitOffset(Ve,s.options.maxBounds),$(function(){s.panBy(Ve,{duration:je,easeLinearity:ne,noMoveStart:!0,animate:!0})}))}}});Xe.addInitHook("addHandler","dragging",Vu),Xe.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Wu=gn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),ze(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),rt(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,s=document.documentElement,c=t.scrollTop||s.scrollTop,p=t.scrollLeft||s.scrollLeft;this._map._container.focus(),window.scrollTo(p,c)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var s=this._panKeys={},c=this.keyCodes,p,E;for(p=0,E=c.left.length;p<E;p++)s[c.left[p]]=[-1*t,0];for(p=0,E=c.right.length;p<E;p++)s[c.right[p]]=[t,0];for(p=0,E=c.down.length;p<E;p++)s[c.down[p]]=[0,t];for(p=0,E=c.up.length;p<E;p++)s[c.up[p]]=[0,-1*t]},_setZoomDelta:function(t){var s=this._zoomKeys={},c=this.keyCodes,p,E;for(p=0,E=c.zoomIn.length;p<E;p++)s[c.zoomIn[p]]=t;for(p=0,E=c.zoomOut.length;p<E;p++)s[c.zoomOut[p]]=-t},_addHooks:function(){ze(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){rt(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var s=t.keyCode,c=this._map,p;if(s in this._panKeys){if(!c._panAnim||!c._panAnim._inProgress)if(p=this._panKeys[s],t.shiftKey&&(p=T(p).multiplyBy(3)),c.options.maxBounds&&(p=c._limitOffset(T(p),c.options.maxBounds)),c.options.worldCopyJump){var E=c.wrapLatLng(c.unproject(c.project(c.getCenter()).add(p)));c.panTo(E)}else c.panBy(p)}else if(s in this._zoomKeys)c.setZoom(c.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[s]);else if(s===27&&c._popup&&c._popup.options.closeOnEscapeKey)c.closePopup();else return;oi(t)}}});Xe.addInitHook("addHandler","keyboard",Wu),Xe.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Gu=gn.extend({addHooks:function(){ze(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){rt(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var s=_u(t),c=this._map.options.wheelDebounceTime;this._delta+=s,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var p=Math.max(c-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(l(this._performZoom,this),p),oi(t)},_performZoom:function(){var t=this._map,s=t.getZoom(),c=this._map.options.zoomSnap||0;t._stop();var p=this._delta/(this._map.options.wheelPxPerZoomLevel*4),E=4*Math.log(2/(1+Math.exp(-Math.abs(p))))/Math.LN2,D=c?Math.ceil(E/c)*c:E,ne=t._limitZoom(s+(this._delta>0?D:-D))-s;this._delta=0,this._startTime=null,ne&&(t.options.scrollWheelZoom==="center"?t.setZoom(s+ne):t.setZoomAround(this._lastMousePos,s+ne))}});Xe.addInitHook("addHandler","scrollWheelZoom",Gu);var pg=600;Xe.mergeOptions({tapHold:ke.touchNative&&ke.safari&&ke.mobile,tapTolerance:15});var Zu=gn.extend({addHooks:function(){ze(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){rt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),t.touches.length===1){var s=t.touches[0];this._startPos=this._newPos=new B(s.clientX,s.clientY),this._holdTimeout=setTimeout(l(function(){this._cancel(),this._isTapValid()&&(ze(document,"touchend",St),ze(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",s))},this),pg),ze(document,"touchend touchcancel contextmenu",this._cancel,this),ze(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){rt(document,"touchend",St),rt(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),rt(document,"touchend touchcancel contextmenu",this._cancel,this),rt(document,"touchmove",this._onMove,this)},_onMove:function(t){var s=t.touches[0];this._newPos=new B(s.clientX,s.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,s){var c=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:s.screenX,screenY:s.screenY,clientX:s.clientX,clientY:s.clientY});c._simulated=!0,s.target.dispatchEvent(c)}});Xe.addInitHook("addHandler","tapHold",Zu),Xe.mergeOptions({touchZoom:ke.touch,bounceAtZoomLimits:!0});var Xu=gn.extend({addHooks:function(){He(this._map._container,"leaflet-touch-zoom"),ze(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){pt(this._map._container,"leaflet-touch-zoom"),rt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var s=this._map;if(!(!t.touches||t.touches.length!==2||s._animatingZoom||this._zooming)){var c=s.mouseEventToContainerPoint(t.touches[0]),p=s.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=s.getSize()._divideBy(2),this._startLatLng=s.containerPointToLatLng(this._centerPoint),s.options.touchZoom!=="center"&&(this._pinchStartLatLng=s.containerPointToLatLng(c.add(p)._divideBy(2))),this._startDist=c.distanceTo(p),this._startZoom=s.getZoom(),this._moved=!1,this._zooming=!0,s._stop(),ze(document,"touchmove",this._onTouchMove,this),ze(document,"touchend touchcancel",this._onTouchEnd,this),St(t)}},_onTouchMove:function(t){if(!(!t.touches||t.touches.length!==2||!this._zooming)){var s=this._map,c=s.mouseEventToContainerPoint(t.touches[0]),p=s.mouseEventToContainerPoint(t.touches[1]),E=c.distanceTo(p)/this._startDist;if(this._zoom=s.getScaleZoom(E,this._startZoom),!s.options.bounceAtZoomLimits&&(this._zoom<s.getMinZoom()&&E<1||this._zoom>s.getMaxZoom()&&E>1)&&(this._zoom=s._limitZoom(this._zoom)),s.options.touchZoom==="center"){if(this._center=this._startLatLng,E===1)return}else{var D=c._add(p)._divideBy(2)._subtract(this._centerPoint);if(E===1&&D.x===0&&D.y===0)return;this._center=s.unproject(s.project(this._pinchStartLatLng,this._zoom).subtract(D),this._zoom)}this._moved||(s._moveStart(!0,!1),this._moved=!0),G(this._animRequest);var ne=l(s._move,s,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=$(ne,this,!0),St(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,G(this._animRequest),rt(document,"touchmove",this._onTouchMove,this),rt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Xe.addInitHook("addHandler","touchZoom",Xu),Xe.BoxZoom=Hu,Xe.DoubleClickZoom=Uu,Xe.Drag=Vu,Xe.Keyboard=Wu,Xe.ScrollWheelZoom=Gu,Xe.TapHold=Zu,Xe.TouchZoom=Xu,n.Bounds=Q,n.Browser=ke,n.CRS=ee,n.Canvas=Bu,n.Circle=No,n.CircleMarker=os,n.Class=F,n.Control=nn,n.DivIcon=Ou,n.DivOverlay=mn,n.DomEvent=Pp,n.DomUtil=Rp,n.Draggable=qn,n.Evented=re,n.FeatureGroup=Sn,n.GeoJSON=Ln,n.GridLayer=cr,n.Handler=gn,n.Icon=Pi,n.ImageOverlay=ds,n.LatLng=Z,n.LatLngBounds=Y,n.Layer=rn,n.LayerGroup=Ci,n.LineUtil=Vp,n.Map=Xe,n.Marker=ss,n.Mixin=Bp,n.Path=zn,n.Point=B,n.PolyUtil=$p,n.Polygon=ki,n.Polyline=Tn,n.Popup=hs,n.PosAnimation=yu,n.Projection=Wp,n.Rectangle=zu,n.Renderer=In,n.SVG=hr,n.SVGOverlay=Mu,n.TileLayer=Mi,n.Tooltip=fs,n.Transformation=Ee,n.Util=j,n.VideoOverlay=Du,n.bind=l,n.bounds=ie,n.canvas=$u,n.circle=eg,n.circleMarker=Yp,n.control=ar,n.divIcon=ug,n.extend=o,n.featureGroup=Qp,n.geoJSON=ku,n.geoJson=ig,n.gridLayer=cg,n.icon=Jp,n.imageOverlay=rg,n.latLng=W,n.latLngBounds=me,n.layerGroup=Xp,n.map=kp,n.marker=Kp,n.point=T,n.polygon=ng,n.polyline=tg,n.popup=ag,n.rectangle=fg,n.setOptions=I,n.stamp=f,n.svg=qu,n.svgOverlay=og,n.tileLayer=Fu,n.tooltip=lg,n.transformation=Te,n.version=r,n.videoOverlay=sg;var gg=window.L;n.noConflict=function(){return window.L=gg,this},window.L=n}))})(Br,Br.exports)),Br.exports}var Ot=cu(),yl={exports:{}},Xh;function D0(){return Xh||(Xh=1,(function(i,e){((n,r)=>{i.exports=n(cu()),typeof r<"u"&&r.L&&n(r.L)})(n=>{n.Editable=n.Evented.extend({statics:{FORWARD:1,BACKWARD:-1},options:{zIndex:1e3,polygonClass:n.Polygon,polylineClass:n.Polyline,markerClass:n.Marker,circleMarkerClass:n.CircleMarker,rectangleClass:n.Rectangle,circleClass:n.Circle,drawingCSSClass:"leaflet-editable-drawing",drawingCursor:"crosshair",editLayer:void 0,featuresLayer:void 0,polylineEditorClass:void 0,polygonEditorClass:void 0,markerEditorClass:void 0,circleMarkerEditorClass:void 0,rectangleEditorClass:void 0,circleEditorClass:void 0,lineGuideOptions:{},skipMiddleMarkers:!1},initialize:function(d,m){n.setOptions(this,m),this._lastZIndex=this.options.zIndex,this.map=d,this.editLayer=this.createEditLayer(),this.featuresLayer=this.createFeaturesLayer(),this.forwardLineGuide=this.createLineGuide(),this.backwardLineGuide=this.createLineGuide()},fireAndForward:function(d,m){m=m||{},m.editTools=this,this.fire(d,m),this.map.fire(d,m)},createLineGuide:function(){const d=n.extend({dashArray:"5,10",weight:1,interactive:!1},this.options.lineGuideOptions);return n.polyline([],d)},createVertexIcon:d=>n.Browser.mobile&&n.Browser.touch?new n.Editable.TouchVertexIcon(d):new n.Editable.VertexIcon(d),createEditLayer:function(){return this.options.editLayer||new n.LayerGroup().addTo(this.map)},createFeaturesLayer:function(){return this.options.featuresLayer||new n.LayerGroup().addTo(this.map)},moveForwardLineGuide:function(d){this.forwardLineGuide._latlngs.length&&(this.forwardLineGuide._latlngs[1]=d,this.forwardLineGuide._bounds.extend(d),this.forwardLineGuide.redraw())},moveBackwardLineGuide:function(d){this.backwardLineGuide._latlngs.length&&(this.backwardLineGuide._latlngs[1]=d,this.backwardLineGuide._bounds.extend(d),this.backwardLineGuide.redraw())},anchorForwardLineGuide:function(d){this.forwardLineGuide._latlngs[0]=d,this.forwardLineGuide._bounds.extend(d),this.forwardLineGuide.redraw()},anchorBackwardLineGuide:function(d){this.backwardLineGuide._latlngs[0]=d,this.backwardLineGuide._bounds.extend(d),this.backwardLineGuide.redraw()},attachForwardLineGuide:function(){this.editLayer.addLayer(this.forwardLineGuide)},attachBackwardLineGuide:function(){this.editLayer.addLayer(this.backwardLineGuide)},detachForwardLineGuide:function(){this.forwardLineGuide.setLatLngs([]),this.editLayer.removeLayer(this.forwardLineGuide)},detachBackwardLineGuide:function(){this.backwardLineGuide.setLatLngs([]),this.editLayer.removeLayer(this.backwardLineGuide)},blockEvents:function(){this._oldTargets||(this._oldTargets=this.map._targets,this.map._targets={})},unblockEvents:function(){this._oldTargets&&(this.map._targets=n.extend(this.map._targets,this._oldTargets),delete this._oldTargets)},registerForDrawing:function(d){this._drawingEditor&&this.unregisterForDrawing(this._drawingEditor),this.blockEvents(),d.reset(),this._drawingEditor=d,this.map.on("mousemove touchmove",d.onDrawingMouseMove,d),this.map.on("mousedown",this.onMousedown,this),this.map.on("mouseup",this.onMouseup,this),n.DomUtil.addClass(this.map._container,this.options.drawingCSSClass),this.defaultMapCursor=this.map._container.style.cursor,this.map._container.style.cursor=this.options.drawingCursor},unregisterForDrawing:function(d){this.unblockEvents(),n.DomUtil.removeClass(this.map._container,this.options.drawingCSSClass),this.map._container.style.cursor=this.defaultMapCursor,d=d||this._drawingEditor,d&&(this.map.off("mousemove touchmove",d.onDrawingMouseMove,d),this.map.off("mousedown",this.onMousedown,this),this.map.off("mouseup",this.onMouseup,this),d===this._drawingEditor&&(delete this._drawingEditor,d._drawing&&d.cancelDrawing()))},onMousedown:function(d){d.originalEvent.which==1&&(this._mouseDown=d,this._drawingEditor.onDrawingMouseDown(d))},onMouseup:function(d){if(this._mouseDown){const m=this._drawingEditor,w=this._mouseDown;if(this._mouseDown=null,m.onDrawingMouseUp(d),this._drawingEditor!==m)return;const I=n.point(w.originalEvent.clientX,w.originalEvent.clientY),A=n.point(d.originalEvent.clientX,d.originalEvent.clientY).distanceTo(I);Math.abs(A)<9*(window.devicePixelRatio||1)&&this._drawingEditor.onDrawingClick(d)}},drawing:function(){return this._drawingEditor?.drawing()},stopDrawing:function(){this.unregisterForDrawing()},commitDrawing:function(d){this._drawingEditor&&this._drawingEditor.commitDrawing(d)},connectCreatedToMap:function(d){return this.featuresLayer.addLayer(d)},startPolyline:function(d,m){const w=this.createPolyline([],m);return w.enableEdit(this.map).newShape(d),w},startPolygon:function(d,m){const w=this.createPolygon([],m);return w.enableEdit(this.map).newShape(d),w},startMarker:function(d,m){d=d||this.map.getCenter().clone();const w=this.createMarker(d,m);return w.enableEdit(this.map).startDrawing(),w},startCircleMarker:function(d,m){d=d||this.map.getCenter().clone();const w=this.createCircleMarker(d,m);return w.enableEdit(this.map).startDrawing(),w},startRectangle:function(d,m){const w=d||n.latLng([0,0]),I=new n.LatLngBounds(w,w),A=this.createRectangle(I,m);return A.enableEdit(this.map).startDrawing(),A},startCircle:function(d,m){d=d||this.map.getCenter().clone();const w=this.createCircle(d,m);return w.enableEdit(this.map).startDrawing(),w},startHole:(d,m)=>{d.newHole(m)},createLayer:function(d,m,w){w=n.Util.extend({editOptions:{editTools:this}},w);const I=new d(m,w);return this.fireAndForward("editable:created",{layer:I}),I},createPolyline:function(d,m){return this.createLayer(m?.polylineClass||this.options.polylineClass,d,m)},createPolygon:function(d,m){return this.createLayer(m?.polygonClass||this.options.polygonClass,d,m)},createMarker:function(d,m){return this.createLayer(m?.markerClass||this.options.markerClass,d,m)},createCircleMarker:function(d,m){return this.createLayer(m?.circleMarkerClass||this.options.circleMarkerClass,d,m)},createRectangle:function(d,m){return this.createLayer(m?.rectangleClass||this.options.rectangleClass,d,m)},createCircle:function(d,m){return this.createLayer(m?.circleClass||this.options.circleClass,d,m)}}),n.extend(n.Editable,{makeCancellable:d=>{d.cancel=()=>{d._cancelled=!0}}}),n.Map.mergeOptions({editToolsClass:n.Editable,editable:!1,editOptions:{}}),n.Map.addInitHook(function(){this.whenReady(function(){this.options.editable&&(this.editTools=new this.options.editToolsClass(this,this.options.editOptions))})}),n.Editable.VertexIcon=n.DivIcon.extend({options:{iconSize:new n.Point(8,8)}}),n.Editable.TouchVertexIcon=n.Editable.VertexIcon.extend({options:{iconSize:new n.Point(20,20)}}),n.Editable.VertexMarker=n.Marker.extend({options:{draggable:!0,className:"leaflet-div-icon leaflet-vertex-icon"},initialize:function(d,m,w,I){this.latlng=d,this.latlngs=m,this.editor=w,n.Marker.prototype.initialize.call(this,d,I),this.options.icon=this.editor.tools.createVertexIcon({className:this.options.className}),this.latlng.__vertex=this,this.connect(),this.setZIndexOffset(w.tools._lastZIndex+1)},connect:function(){this.editor.editLayer.addLayer(this)},onAdd:function(d){n.Marker.prototype.onAdd.call(this,d),this.on("drag",this.onDrag),this.on("dragstart",this.onDragStart),this.on("dragend",this.onDragEnd),this.on("mouseup",this.onMouseup),this.on("click",this.onClick),this.on("contextmenu",this.onContextMenu),this.on("mousedown touchstart",this.onMouseDown),this.on("mouseover",this.onMouseOver),this.on("mouseout",this.onMouseOut),this.addMiddleMarkers()},onRemove:function(d){this.middleMarker&&this.middleMarker.delete(),delete this.latlng.__vertex,this.off("drag",this.onDrag),this.off("dragstart",this.onDragStart),this.off("dragend",this.onDragEnd),this.off("mouseup",this.onMouseup),this.off("click",this.onClick),this.off("contextmenu",this.onContextMenu),this.off("mousedown touchstart",this.onMouseDown),this.off("mouseover",this.onMouseOver),this.off("mouseout",this.onMouseOut),n.Marker.prototype.onRemove.call(this,d)},onDrag:function(d){d.vertex=this,this.editor.onVertexMarkerDrag(d);const m=n.DomUtil.getPosition(this._icon),w=this._map.layerPointToLatLng(m);this.latlng.update(w),this._latlng=this.latlng,this.editor.refresh(),this.middleMarker&&this.middleMarker.updateLatLng();const I=this.getNext();I?.middleMarker&&I.middleMarker.updateLatLng()},onDragStart:function(d){d.vertex=this,this.editor.onVertexMarkerDragStart(d)},onDragEnd:function(d){d.vertex=this,this.editor.onVertexMarkerDragEnd(d)},onClick:function(d){d.vertex=this,this.editor.onVertexMarkerClick(d)},onMouseup:function(d){n.DomEvent.stop(d),d.vertex=this,this.editor.map.fire("mouseup",d)},onContextMenu:function(d){d.vertex=this,this.editor.onVertexMarkerContextMenu(d)},onMouseDown:function(d){d.vertex=this,this.editor.onVertexMarkerMouseDown(d)},onMouseOver:function(d){d.vertex=this,this.editor.onVertexMarkerMouseOver(d)},onMouseOut:function(d){d.vertex=this,this.editor.onVertexMarkerMouseOut(d)},delete:function(){const d=this.getNext();this.latlngs.splice(this.getIndex(),1),this.editor.editLayer.removeLayer(this),this.editor.onVertexDeleted({latlng:this.latlng,vertex:this}),this.latlngs.length||this.editor.deleteShape(this.latlngs),d&&d.resetMiddleMarker(),this.editor.refresh()},getIndex:function(){return this.latlngs.indexOf(this.latlng)},getLastIndex:function(){return this.latlngs.length-1},getPrevious:function(){if(this.latlngs.length<2)return;const d=this.getIndex();let m=d-1;d===0&&this.editor.CLOSED&&(m=this.getLastIndex());const w=this.latlngs[m];if(w)return w.__vertex},getNext:function(){if(this.latlngs.length<2)return;const d=this.getIndex();let m=d+1;d===this.getLastIndex()&&this.editor.CLOSED&&(m=0);const w=this.latlngs[m];if(w)return w.__vertex},addMiddleMarker:function(d){this.editor.hasMiddleMarkers()&&(d=d||this.getPrevious(),d&&!this.middleMarker&&(this.middleMarker=this.editor.addMiddleMarker(d,this,this.latlngs,this.editor)))},addMiddleMarkers:function(){if(!this.editor.hasMiddleMarkers())return;const d=this.getPrevious();d&&this.addMiddleMarker(d);const m=this.getNext();m&&m.resetMiddleMarker()},resetMiddleMarker:function(){this.middleMarker&&this.middleMarker.delete(),this.addMiddleMarker()},split:function(){this.editor.splitShape&&this.editor.splitShape(this.latlngs,this.getIndex())},continue:function(){if(!this.editor.continueBackward)return;const d=this.getIndex();d===0?this.editor.continueBackward(this.latlngs):d===this.getLastIndex()&&this.editor.continueForward(this.latlngs)}}),n.Editable.mergeOptions({vertexMarkerClass:n.Editable.VertexMarker}),n.Editable.MiddleMarker=n.Marker.extend({options:{opacity:.5,className:"leaflet-div-icon leaflet-middle-icon",draggable:!0},initialize:function(d,m,w,I,A){this.left=d,this.right=m,this.editor=I,this.latlngs=w,n.Marker.prototype.initialize.call(this,this.computeLatLng(),A),this._opacity=this.options.opacity,this.options.icon=this.editor.tools.createVertexIcon({className:this.options.className}),this.editor.editLayer.addLayer(this),this.setVisibility()},setVisibility:function(){const d=this._map.latLngToContainerPoint(this.left.latlng),m=this._map.latLngToContainerPoint(this.right.latlng),w=n.point(this.options.icon.options.iconSize);d.distanceTo(m)<w.x*3?this.hide():this.show()},show:function(){this.setOpacity(this._opacity)},hide:function(){this.setOpacity(0)},updateLatLng:function(){this.setLatLng(this.computeLatLng()),this.setVisibility()},computeLatLng:function(){const d=this.editor.map.latLngToContainerPoint(this.left.latlng),m=this.editor.map.latLngToContainerPoint(this.right.latlng),w=(d.y+m.y)/2,I=(d.x+m.x)/2;return this.editor.map.containerPointToLatLng([I,w])},onAdd:function(d){n.Marker.prototype.onAdd.call(this,d),n.DomEvent.on(this._icon,"mousedown touchstart",this.onMouseDown,this),d.on("zoomend",this.setVisibility,this)},onRemove:function(d){delete this.right.middleMarker,n.DomEvent.off(this._icon,"mousedown touchstart",this.onMouseDown,this),d.off("zoomend",this.setVisibility,this),n.Marker.prototype.onRemove.call(this,d)},onMouseDown:function(d){const m=n.DomUtil.getPosition(this._icon),w=this.editor.map.layerPointToLatLng(m);if(d={originalEvent:d,latlng:w},this.options.opacity===0||(n.Editable.makeCancellable(d),this.editor.onMiddleMarkerMouseDown(d),d._cancelled))return;this.latlngs.splice(this.index(),0,d.latlng),this.editor.refresh();const I=this._icon,A=this.editor.addVertexMarker(d.latlng,this.latlngs);this.editor.onNewVertex(A);const N=A._icon.parentNode;N.removeChild(A._icon),A._icon=I,N.appendChild(A._icon),A._initIcon(),A._initInteraction(),A.setOpacity(1),n.Draggable._dragging=!1,A.dragging._draggable._onDown(d.originalEvent),this.delete()},delete:function(){this.editor.editLayer.removeLayer(this)},index:function(){return this.latlngs.indexOf(this.right.latlng)}}),n.Editable.mergeOptions({middleMarkerClass:n.Editable.MiddleMarker}),n.Editable.BaseEditor=n.Handler.extend({initialize:function(d,m,w){n.setOptions(this,w),this.map=d,this.feature=m,this.feature.editor=this,this.editLayer=new n.LayerGroup,this.tools=this.options.editTools||d.editTools},addHooks:function(){this.isConnected()?this.onFeatureAdd():this.feature.once("add",this.onFeatureAdd,this),this.onEnable(),this.feature.on(this._getEvents(),this)},removeHooks:function(){this.feature.off(this._getEvents(),this),this.feature.dragging&&this.feature.dragging.disable(),this.editLayer.clearLayers(),this.tools.editLayer.removeLayer(this.editLayer),this.onDisable(),this._drawing&&this.cancelDrawing()},drawing:function(){return!!this._drawing},reset:()=>{},onFeatureAdd:function(){this.tools.editLayer.addLayer(this.editLayer),this.feature.dragging&&this.options.draggable!=!1&&this.feature.dragging.enable()},hasMiddleMarkers:function(){return!this.options.skipMiddleMarkers&&!this.tools.options.skipMiddleMarkers},fireAndForward:function(d,m){m=m||{},m.layer=this.feature,this.feature.fire(d,m),this.tools.fireAndForward(d,m)},onEnable:function(){this.fireAndForward("editable:enable")},onDisable:function(){this.fireAndForward("editable:disable")},onEditing:function(){this.fireAndForward("editable:editing")},onEdited:function(){this.fireAndForward("editable:edited")},onStartDrawing:function(){this.fireAndForward("editable:drawing:start")},onEndDrawing:function(){this.fireAndForward("editable:drawing:end")},onCancelDrawing:function(){this.fireAndForward("editable:drawing:cancel")},onCommitDrawing:function(d){this.fireAndForward("editable:drawing:commit",d),this.onEdited()},onDrawingMouseDown:function(d){this.fireAndForward("editable:drawing:mousedown",d)},onDrawingMouseUp:function(d){this.fireAndForward("editable:drawing:mouseup",d)},startDrawing:function(){this._drawing||(this._drawing=n.Editable.FORWARD),this.tools.registerForDrawing(this),this.onStartDrawing()},commitDrawing:function(d){this.onCommitDrawing(d),this.endDrawing()},cancelDrawing:function(){n.Draggable._dragging=!1,this.onCancelDrawing(),this.endDrawing()},endDrawing:function(){this._drawing=!1,this.tools.unregisterForDrawing(this),this.onEndDrawing()},onDrawingClick:function(d){this.drawing()&&(n.Editable.makeCancellable(d),this.fireAndForward("editable:drawing:click",d),!d._cancelled&&(this.isConnected()||this.connect(d),this.processDrawingClick(d)))},isConnected:function(){return this.map.hasLayer(this.feature)},connect:function(){this.tools.connectCreatedToMap(this.feature),this.tools.editLayer.addLayer(this.editLayer)},onMove:function(d){this.fireAndForward("editable:drawing:move",d)},onDrawingMouseMove:function(d){this.onMove(d)},_getEvents:function(){return{dragstart:this.onDragStart,drag:this.onDrag,dragend:this.onDragEnd,remove:this.disable}},onDragStart:function(d){this.onEditing(),this.fireAndForward("editable:dragstart",d)},onDrag:function(d){this.onMove(d),this.fireAndForward("editable:drag",d)},onDragEnd:function(d){this.fireAndForward("editable:dragend",d),this.onEdited()}}),n.Editable.MarkerEditor=n.Editable.BaseEditor.extend({onDrawingMouseMove:function(d){n.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,d),this._drawing&&this.feature.setLatLng(d.latlng)},processDrawingClick:function(d){this.fireAndForward("editable:drawing:clicked",d),this.commitDrawing(d)},connect:function(d){d&&(this.feature._latlng=d.latlng),n.Editable.BaseEditor.prototype.connect.call(this,d)}}),n.Editable.CircleMarkerEditor=n.Editable.BaseEditor.extend({onDrawingMouseMove:function(d){n.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,d),this._drawing&&this.feature.setLatLng(d.latlng)},processDrawingClick:function(d){this.fireAndForward("editable:drawing:clicked",d),this.commitDrawing(d)},connect:function(d){d&&(this.feature._latlng=d.latlng),n.Editable.BaseEditor.prototype.connect.call(this,d)}}),n.Editable.PathEditor=n.Editable.BaseEditor.extend({CLOSED:!1,MIN_VERTEX:2,addHooks:function(){return n.Editable.BaseEditor.prototype.addHooks.call(this),this.feature&&(this.initVertexMarkers(),this.map.on("moveend",this.onMoveEnd,this)),this},removeHooks:function(){n.Editable.BaseEditor.prototype.removeHooks.call(this),this.feature&&this.map.off("moveend",this.onMoveEnd,this)},onMoveEnd:function(){this.initVertexMarkers()},initVertexMarkers:function(d){if(this.enabled())if(d=d||this.getLatLngs(),_(d))this.addVertexMarkers(d);else for(const m of d)this.initVertexMarkers(m)},getLatLngs:function(){return this.feature.getLatLngs()},reset:function(){this.editLayer.clearLayers(),this.initVertexMarkers()},addVertexMarker:function(d,m){return d.__vertex?(d.__vertex.connect(),d.__vertex):new this.tools.options.vertexMarkerClass(d,m,this)},onNewVertex:function(d){this.fireAndForward("editable:vertex:new",{latlng:d.latlng,vertex:d})},addVertexMarkers:function(d){const m=this.map.getBounds();for(const w of d)m.contains(w)&&this.addVertexMarker(w,d)},refreshVertexMarkers:function(d){d=d||this.getDefaultLatLngs();for(const m of d)m.__vertex.update()},addMiddleMarker:function(d,m,w){return new this.tools.options.middleMarkerClass(d,m,w,this)},onVertexMarkerClick:function(d){if(n.Editable.makeCancellable(d),this.fireAndForward("editable:vertex:click",d),d._cancelled||this.tools.drawing()&&this.tools._drawingEditor!==this)return;const m=d.vertex.getIndex();let w;d.originalEvent.ctrlKey?this.onVertexMarkerCtrlClick(d):d.originalEvent.altKey?this.onVertexMarkerAltClick(d):d.originalEvent.shiftKey?this.onVertexMarkerShiftClick(d):d.originalEvent.metaKey?this.onVertexMarkerMetaKeyClick(d):m===d.vertex.getLastIndex()&&this._drawing===n.Editable.FORWARD?m>=this.MIN_VERTEX-1&&(w=!0):m===0&&this._drawing===n.Editable.BACKWARD&&this._drawnLatLngs.length>=this.MIN_VERTEX||m===0&&this._drawing===n.Editable.FORWARD&&this._drawnLatLngs.length>=this.MIN_VERTEX&&this.CLOSED?w=!0:this.onVertexRawMarkerClick(d),this.fireAndForward("editable:vertex:clicked",d),w&&this.commitDrawing(d)},onVertexRawMarkerClick:function(d){this.fireAndForward("editable:vertex:rawclick",d),!d._cancelled&&this.vertexCanBeDeleted(d.vertex)&&d.vertex.delete()},vertexCanBeDeleted:function(d){return d.latlngs.length>this.MIN_VERTEX},onVertexDeleted:function(d){this.fireAndForward("editable:vertex:deleted",d),this.onEdited()},onVertexMarkerCtrlClick:function(d){this.fireAndForward("editable:vertex:ctrlclick",d)},onVertexMarkerShiftClick:function(d){this.fireAndForward("editable:vertex:shiftclick",d)},onVertexMarkerMetaKeyClick:function(d){this.fireAndForward("editable:vertex:metakeyclick",d)},onVertexMarkerAltClick:function(d){this.fireAndForward("editable:vertex:altclick",d)},onVertexMarkerContextMenu:function(d){this.fireAndForward("editable:vertex:contextmenu",d)},onVertexMarkerMouseDown:function(d){this.fireAndForward("editable:vertex:mousedown",d)},onVertexMarkerMouseOver:function(d){this.fireAndForward("editable:vertex:mouseover",d)},onVertexMarkerMouseOut:function(d){this.fireAndForward("editable:vertex:mouseout",d)},onMiddleMarkerMouseDown:function(d){this.fireAndForward("editable:middlemarker:mousedown",d)},onVertexMarkerDrag:function(d){this.onMove(d),this.feature._bounds&&this.extendBounds(d),this.fireAndForward("editable:vertex:drag",d)},onVertexMarkerDragStart:function(d){this.fireAndForward("editable:vertex:dragstart",d)},onVertexMarkerDragEnd:function(d){this.fireAndForward("editable:vertex:dragend",d),this.onEdited()},setDrawnLatLngs:function(d){this._drawnLatLngs=d||this.getDefaultLatLngs()},startDrawing:function(){this._drawnLatLngs||this.setDrawnLatLngs(),n.Editable.BaseEditor.prototype.startDrawing.call(this)},startDrawingForward:function(){this.startDrawing()},endDrawing:function(){this.tools.detachForwardLineGuide(),this.tools.detachBackwardLineGuide(),this._drawnLatLngs&&this._drawnLatLngs.length<this.MIN_VERTEX&&this.deleteShape(this._drawnLatLngs),n.Editable.BaseEditor.prototype.endDrawing.call(this),delete this._drawnLatLngs},addLatLng:function(d){this._drawing===n.Editable.FORWARD?this._drawnLatLngs.push(d):this._drawnLatLngs.unshift(d),this.feature._bounds.extend(d);const m=this.addVertexMarker(d,this._drawnLatLngs);this.onNewVertex(m),this.refresh()},newPointForward:function(d){this.addLatLng(d),this.tools.attachForwardLineGuide(),this.tools.anchorForwardLineGuide(d)},newPointBackward:function(d){this.addLatLng(d),this.tools.anchorBackwardLineGuide(d)},push:function(d){if(!d)return console.error("L.Editable.PathEditor.push expect a valid latlng as parameter");this._drawing===n.Editable.FORWARD?this.newPointForward(d):this.newPointBackward(d)},removeLatLng:function(d){d.__vertex.delete(),this.refresh()},pop:function(){if(this._drawnLatLngs.length<=1)return;let d;return this._drawing===n.Editable.FORWARD?d=this._drawnLatLngs[this._drawnLatLngs.length-1]:d=this._drawnLatLngs[0],this.removeLatLng(d),this._drawing===n.Editable.FORWARD?this.tools.anchorForwardLineGuide(this._drawnLatLngs[this._drawnLatLngs.length-1]):this.tools.anchorForwardLineGuide(this._drawnLatLngs[0]),d},processDrawingClick:function(d){d.vertex&&d.vertex.editor===this||(this._drawing===n.Editable.FORWARD?this.newPointForward(d.latlng):this.newPointBackward(d.latlng),this.fireAndForward("editable:drawing:clicked",d))},onDrawingMouseMove:function(d){n.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,d),this._drawing&&(this.tools.moveForwardLineGuide(d.latlng),this.tools.moveBackwardLineGuide(d.latlng))},refresh:function(){this.feature.redraw(),this.onEditing()},newShape:function(d){const m=this.addNewEmptyShape();m&&(this.setDrawnLatLngs(m[0]||m),this.startDrawingForward(),this.fireAndForward("editable:shape:new",{shape:m}),d&&this.newPointForward(d))},deleteShape:function(d,m){const w={shape:d};if(n.Editable.makeCancellable(w),this.fireAndForward("editable:shape:delete",w),!w._cancelled)return d=this._deleteShape(d,m),this.ensureNotFlat&&this.ensureNotFlat(),this.feature.setLatLngs(this.getLatLngs()),this.refresh(),this.reset(),this.fireAndForward("editable:shape:deleted",{shape:d}),this.onEdited(),d},_deleteShape:function(d,m){if(m=m||this.getLatLngs(),!m.length)return;const w=(A,N)=>A.splice(0,Number.MAX_VALUE),I=(A,N)=>(A.splice(A.indexOf(N),1),A.length||this._deleteShape(A),N);if(m===d)return w(m);for(const A of m){if(A===d)return I(m,d);if(A.indexOf(d)!==-1)return I(A,d)}},deleteShapeAt:function(d){const m=this.feature.shapeAt(d);if(m)return this.deleteShape(m)},appendShape:function(d){this.insertShape(d)},prependShape:function(d){this.insertShape(d,0)},insertShape:function(d,m){this.ensureMulti(),d=this.formatShape(d),m===void 0&&(m=this.feature._latlngs.length),this.feature._latlngs.splice(m,0,d),this.feature.redraw(),this._enabled&&this.reset()},extendBounds:function(d){this.feature._bounds.extend(d.vertex.latlng)},onDragStart:function(d){this.editLayer.clearLayers(),n.Editable.BaseEditor.prototype.onDragStart.call(this,d)},onDragEnd:function(d){this.initVertexMarkers(),n.Editable.BaseEditor.prototype.onDragEnd.call(this,d)}}),n.Editable.PolylineEditor=n.Editable.PathEditor.extend({startDrawingBackward:function(){this._drawing=n.Editable.BACKWARD,this.startDrawing()},continueBackward:function(d){this.drawing()||(d=d||this.getDefaultLatLngs(),this.setDrawnLatLngs(d),d.length>0&&(this.tools.attachBackwardLineGuide(),this.tools.anchorBackwardLineGuide(d[0])),this.startDrawingBackward())},continueForward:function(d){this.drawing()||(d=d||this.getDefaultLatLngs(),this.setDrawnLatLngs(d),d.length>0&&(this.tools.attachForwardLineGuide(),this.tools.anchorForwardLineGuide(d[d.length-1])),this.startDrawingForward())},getDefaultLatLngs:function(d){return d=d||this.feature._latlngs,!d.length||d[0]instanceof n.LatLng?d:this.getDefaultLatLngs(d[0])},ensureMulti:function(){this.feature._latlngs.length&&_(this.feature._latlngs)&&(this.feature._latlngs=[this.feature._latlngs])},addNewEmptyShape:function(){if(this.feature._latlngs.length){const d=[];return this.appendShape(d),d}return this.feature._latlngs},formatShape:function(d){if(_(d))return d;if(d[0])return this.formatShape(d[0])},splitShape:function(d,m){if(!m||m>=d.length-1)return;this.ensureMulti();const w=this.feature._latlngs.indexOf(d);if(w===-1)return;const I=d.slice(0,m+1),A=d.slice(m);A[0]=n.latLng(A[0].lat,A[0].lng,A[0].alt),this.feature._latlngs.splice(w,1,I,A),this.refresh(),this.reset(),this.onEdited()}}),n.Editable.PolygonEditor=n.Editable.PathEditor.extend({CLOSED:!0,MIN_VERTEX:3,newPointForward:function(d){n.Editable.PathEditor.prototype.newPointForward.call(this,d),this.tools.backwardLineGuide._latlngs.length||this.tools.anchorBackwardLineGuide(d),this._drawnLatLngs.length===2&&this.tools.attachBackwardLineGuide()},addNewEmptyHole:function(d){this.ensureNotFlat();const m=this.feature.shapeAt(d);if(!m)return;const w=[];return m.push(w),w},newHole:function(d){const m=this.addNewEmptyHole(d);m&&(this.setDrawnLatLngs(m),this.startDrawingForward(),d&&this.newPointForward(d))},addNewEmptyShape:function(){if(this.feature._latlngs.length&&this.feature._latlngs[0].length){const d=[];return this.appendShape(d),d}return this.feature._latlngs},ensureMulti:function(){this.feature._latlngs.length&&_(this.feature._latlngs[0])&&(this.feature._latlngs=[this.feature._latlngs])},ensureNotFlat:function(){(!this.feature._latlngs.length||_(this.feature._latlngs))&&(this.feature._latlngs=[this.feature._latlngs])},vertexCanBeDeleted:function(d){const m=this.feature.parentShape(d.latlngs);return n.Util.indexOf(m,d.latlngs)>0?!0:n.Editable.PathEditor.prototype.vertexCanBeDeleted.call(this,d)},getDefaultLatLngs:function(){return this.feature._latlngs.length||this.feature._latlngs.push([]),this.feature._latlngs[0]},formatShape:d=>_(d)&&(!d[0]||d[0].length!==0)?[d]:d}),n.Editable.RectangleEditor=n.Editable.PathEditor.extend({CLOSED:!0,MIN_VERTEX:4,options:{skipMiddleMarkers:!0},extendBounds:function(d){const m=d.vertex.getIndex(),w=d.vertex.getNext(),I=d.vertex.getPrevious(),A=(m+2)%4,N=d.vertex.latlngs[A],P=new n.LatLngBounds(d.latlng,N);I.latlng.update([d.latlng.lat,N.lng]),w.latlng.update([N.lat,d.latlng.lng]),this.updateBounds(P),this.refreshVertexMarkers()},onDrawingMouseDown:function(d){n.Editable.PathEditor.prototype.onDrawingMouseDown.call(this,d),this.connect();const m=this.getDefaultLatLngs();m.length===3&&m.push(d.latlng);const w=new n.LatLngBounds(d.latlng,d.latlng);this.updateBounds(w),this.updateLatLngs(w),this.refresh(),this.reset(),d.originalEvent._simulated=!1,this.map.dragging._draggable._onUp(d.originalEvent),m[3].__vertex.dragging._draggable._onDown(d.originalEvent)},onDrawingMouseUp:function(d){this.commitDrawing(d),d.originalEvent._simulated=!1,n.Editable.PathEditor.prototype.onDrawingMouseUp.call(this,d)},onDrawingMouseMove:function(d){d.originalEvent._simulated=!1,n.Editable.PathEditor.prototype.onDrawingMouseMove.call(this,d)},getDefaultLatLngs:function(d){return d||this.feature._latlngs[0]},updateBounds:function(d){this.feature._bounds=d},updateLatLngs:function(d){const m=this.getDefaultLatLngs(),w=this.feature._boundsToLatLngs(d);for(let I=0;I<m.length;I++)m[I].update(w[I])}}),n.Editable.CircleEditor=n.Editable.PathEditor.extend({MIN_VERTEX:2,options:{skipMiddleMarkers:!0},initialize:function(d,m,w){n.Editable.PathEditor.prototype.initialize.call(this,d,m,w),this._resizeLatLng=this.computeResizeLatLng()},computeResizeLatLng:function(){const d=(this.feature._radius||this.feature._mRadius)*Math.cos(Math.PI/4),m=this.map.project(this.feature._latlng);return this.map.unproject([m.x+d,m.y-d])},updateResizeLatLng:function(){this._resizeLatLng.update(this.computeResizeLatLng()),this._resizeLatLng.__vertex.update()},getLatLngs:function(){return[this.feature._latlng,this._resizeLatLng]},getDefaultLatLngs:function(){return this.getLatLngs()},onVertexMarkerDrag:function(d){d.vertex.getIndex()===1?this.resize(d):this.updateResizeLatLng(d),n.Editable.PathEditor.prototype.onVertexMarkerDrag.call(this,d)},resize:function(d){let m;this.map.options.crs?m=this.map.options.crs.distance(this.feature._latlng,d.latlng):m=this.feature._latlng.distanceTo(d.latlng),this.feature.setRadius(m)},onDrawingMouseDown:function(d){n.Editable.PathEditor.prototype.onDrawingMouseDown.call(this,d),this._resizeLatLng.update(d.latlng),this.feature._latlng.update(d.latlng),this.connect(),d.originalEvent._simulated=!1,this.map.dragging._draggable._onUp(d.originalEvent),this._resizeLatLng.__vertex.dragging._draggable._onDown(d.originalEvent)},onDrawingMouseUp:function(d){this.commitDrawing(d),d.originalEvent._simulated=!1,n.Editable.PathEditor.prototype.onDrawingMouseUp.call(this,d)},onDrawingMouseMove:function(d){d.originalEvent._simulated=!1,n.Editable.PathEditor.prototype.onDrawingMouseMove.call(this,d)},onDrag:function(d){n.Editable.PathEditor.prototype.onDrag.call(this,d),this.feature.dragging.updateLatLng(this._resizeLatLng)}});const r={createEditor:function(d){d=d||this._map;const m=this.options.editOptions?.editTools||d.editTools;if(!m)throw Error("Unable to detect Editable instance.");const w=this.options.editorClass||this.getEditorClass(m);return new w(d,this,this.options.editOptions)},enableEdit:function(d){return this.editor||this.createEditor(d),this.editor.enable(),this.editor},editEnabled:function(){return this.editor?.enabled()},disableEdit:function(){this.editor&&(this.editor.disable(),delete this.editor)},toggleEdit:function(){this.editEnabled()?this.disableEdit():this.enableEdit()},_onEditableAdd:function(){this.editor&&this.enableEdit()}},o={getEditorClass:d=>d?.options?.polylineEditorClass||n.Editable.PolylineEditor,shapeAt:function(d,m){let w=null;if(m=m||this._latlngs,!m.length)return w;if(_(m)&&this.isInLatLngs(d,m))w=m;else for(const I of m)if(this.isInLatLngs(d,I))return I;return w},isInLatLngs:function(d,m){if(!m)return!1;let w,I,A,N=[],P;const v=this._clickTolerance();if(this._projectLatlngs(m,N,this._pxBounds),N=N[0],P=this._map.latLngToLayerPoint(d),!this._pxBounds.contains(P))return!1;for(w=1,A=N.length,I=0;w<A;I=w++)if(n.LineUtil.pointToSegmentDistance(P,N[I],N[w])<=v)return!0;return!1}},a={getEditorClass:d=>d?.options?.polygonEditorClass||n.Editable.PolygonEditor,shapeAt:function(d,m){let w=null;if(m=m||this._latlngs,!m.length)return w;if(_(m)&&this.isInLatLngs(d,m)&&(w=m),_(m[0])&&this.isInLatLngs(d,m[0]))w=m;else for(const I of m)if(this.isInLatLngs(d,I[0]))return I;return w},isInLatLngs:(d,m)=>{let w=!1,I,A,N,P,v;for(N=0,v=m.length,P=v-1;N<v;P=N++)I=m[N],A=m[P],I.lat>d.lat!=A.lat>d.lat&&d.lng<(A.lng-I.lng)*(d.lat-I.lat)/(A.lat-I.lat)+I.lng&&(w=!w);return w},parentShape:function(d,m){if(m=m||this._latlngs,!m)return;let w=n.Util.indexOf(m,d);if(w!==-1)return m;for(const I of m)if(w=n.Util.indexOf(I,d),w!==-1)return I}},l={getEditorClass:d=>d?.options?.markerEditorClass||n.Editable.MarkerEditor},u={getEditorClass:d=>d?.options?.circleMarkerEditorClass||n.Editable.CircleMarkerEditor},f={getEditorClass:d=>d?.options?.rectangleEditorClass||n.Editable.RectangleEditor},h={getEditorClass:d=>d?.options?.circleEditorClass||n.Editable.CircleEditor},g=function(){this.on("add",this._onEditableAdd)},_=n.LineUtil.isFlat||n.LineUtil._flat||n.Polyline._flat;n.Polyline&&(n.Polyline.include(r),n.Polyline.include(o),n.Polyline.addInitHook(g)),n.Polygon&&(n.Polygon.include(r),n.Polygon.include(a)),n.Marker&&(n.Marker.include(r),n.Marker.include(l),n.Marker.addInitHook(g)),n.CircleMarker&&(n.CircleMarker.include(r),n.CircleMarker.include(u),n.CircleMarker.addInitHook(g)),n.Rectangle&&(n.Rectangle.include(r),n.Rectangle.include(f)),n.Circle&&(n.Circle.include(r),n.Circle.include(h)),n.LatLng.prototype.update=function(d){d=n.latLng(d),this.lat=d.lat,this.lng=d.lng}},window)})(yl)),yl.exports}D0();const M0=`/* required styles */\r
|
|
438
|
+
:scope [data-node-id='${f.id}'] > shacl-property > .shacl-group > .property-instance[data-path='${h.id}']`));for(const m of g)if(m.classList.contains("editor")){if(!e||m.value){let d=m.parentElement;d.classList.add("invalid"),d.classList.remove("valid"),d.appendChild(this.createValidationErrorDisplay(l));do d instanceof kt&&(d.open=!0),d=d.parentElement;while(d)}}else e||(m.classList.add("invalid"),m.classList.remove("valid"),m.appendChild(this.createValidationErrorDisplay(l,"node")))}else e||this.form.querySelector(`:scope [data-node-id='${f.id}']`)?.prepend(this.createValidationErrorDisplay(l,"node"))}o(a)}catch(a){console.error(a),o({conforms:!1,results:[]})}})})}createValidationErrorDisplay(e,n){const r=document.createElement("span");r.classList.add("validation-error"),n&&r.classList.add(n);const o=typeof e=="object"&&e!==null?e:null;if(o)if(o.message?.length)for(const a of o.message)r.title+=a.value+`
|
|
439
|
+
`;else o.sourceConstraintComponent?.value&&(r.title=o.sourceConstraintComponent.value);else typeof e=="string"&&(r.title=e);return r}findRootShaclShapeSubject(){if(this.config.attributes.shapeSubject){const e=Be.namedNode(this.config.attributes.shapeSubject);if(this.config.store.getQuads(e,At,Rs,null).length===0){console.warn(`shapes graph does not contain requested node shape ${this.config.attributes.shapeSubject}`);return}else return e}else{if(this.config.attributes.valuesSubject&&this.config.store.countQuads(null,null,null,Ct)>0){const n=Be.namedNode(this.config.attributes.valuesSubject),r=Wm(this.config.store,this.config.attributes.valuesSubject),o=this.config.store.getQuads(n,At,null,Ct);if(o.length===0&&console.warn(`value subject '${this.config.attributes.valuesSubject}' has neither ${At.id} nor ${Qr.id} statement`),r)return r;for(const l of o)if(this.config.store.getQuads(l.object,At,Rs,null).length>0)return l.object;const a=this.config.store.getObjects(n,At,Ct);for(const l of a)for(const u of this.config.store.getQuads(null,Ys,l,null))return u.subject}const e=this.config.store.getQuads(null,At,Rs,null);if(e.length==0){console.warn("shapes graph does not contain any node shapes");return}return e.length>1&&(console.warn("shapes graph contains",e.length,"node shapes. choosing first found which is",e[0].subject.value),console.info('hint: set the node shape to use with element attribute "data-shape-subject"')),e[0].subject}}removeFromDataGraph(e){for(const n of this.config.store.getQuads(e,null,null,Ct))this.config.store.delete(n),(n.object.termType==="NamedNode"||n.object.termType==="BlankNode")&&this.removeFromDataGraph(n.object)}}window.customElements.define("shacl-form",D0);class vw extends Gf{constructor(e,n,r){super(e),this.onChange=n,this.fileType=r}createEditor(e){const n=Ur(e)>0,r=e.config.theme.createFileEditor(e.label,null,n,e);return r.addEventListener("change",o=>{o.stopPropagation(),this.onChange(o)}),this.fileType&&r.querySelector('input[type="file"]')?.setAttribute("accept",this.fileType),r}}var Br={exports:{}};var M0=Br.exports,Zh;function cu(){return Zh||(Zh=1,(function(i,e){(function(n,r){r(e)})(M0,(function(n){var r="1.9.4";function o(t){var s,c,p,E;for(c=1,p=arguments.length;c<p;c++){E=arguments[c];for(s in E)t[s]=E[s]}return t}var a=Object.create||(function(){function t(){}return function(s){return t.prototype=s,new t}})();function l(t,s){var c=Array.prototype.slice;if(t.bind)return t.bind.apply(t,c.call(arguments,1));var p=c.call(arguments,2);return function(){return t.apply(s,p.length?p.concat(c.call(arguments)):arguments)}}var u=0;function f(t){return"_leaflet_id"in t||(t._leaflet_id=++u),t._leaflet_id}function h(t,s,c){var p,E,D,ne;return ne=function(){p=!1,E&&(D.apply(c,E),E=!1)},D=function(){p?E=arguments:(t.apply(c,arguments),setTimeout(ne,s),p=!0)},D}function g(t,s,c){var p=s[1],E=s[0],D=p-E;return t===p&&c?t:((t-E)%D+D)%D+E}function m(){return!1}function d(t,s){if(s===!1)return t;var c=Math.pow(10,s===void 0?6:s);return Math.round(t*c)/c}function _(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function v(t){return _(t).split(/\s+/)}function I(t,s){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?a(t.options):{});for(var c in s)t.options[c]=s[c];return t.options}function A(t,s,c){var p=[];for(var E in t)p.push(encodeURIComponent(c?E.toUpperCase():E)+"="+encodeURIComponent(t[E]));return(!s||s.indexOf("?")===-1?"?":"&")+p.join("&")}var N=/\{ *([\w_ -]+) *\}/g;function P(t,s){return t.replace(N,function(c,p){var E=s[p];if(E===void 0)throw new Error("No value provided for variable "+c);return typeof E=="function"&&(E=E(s)),E})}var w=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function y(t,s){for(var c=0;c<t.length;c++)if(t[c]===s)return c;return-1}var S="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function O(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var X=0;function C(t){var s=+new Date,c=Math.max(0,16-(s-X));return X=s+c,window.setTimeout(t,c)}var U=window.requestAnimationFrame||O("RequestAnimationFrame")||C,R=window.cancelAnimationFrame||O("CancelAnimationFrame")||O("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function $(t,s,c){if(c&&U===C)t.call(s);else return U.call(window,l(t,s))}function G(t){t&&R.call(window,t)}var j={__proto__:null,extend:o,create:a,bind:l,get lastId(){return u},stamp:f,throttle:h,wrapNum:g,falseFn:m,formatNum:d,trim:_,splitWords:v,setOptions:I,getParamString:A,template:P,isArray:w,indexOf:y,emptyImageUrl:S,requestFn:U,cancelFn:R,requestAnimFrame:$,cancelAnimFrame:G};function F(){}F.extend=function(t){var s=function(){I(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},c=s.__super__=this.prototype,p=a(c);p.constructor=s,s.prototype=p;for(var E in this)Object.prototype.hasOwnProperty.call(this,E)&&E!=="prototype"&&E!=="__super__"&&(s[E]=this[E]);return t.statics&&o(s,t.statics),t.includes&&(se(t.includes),o.apply(null,[p].concat(t.includes))),o(p,t),delete p.statics,delete p.includes,p.options&&(p.options=c.options?a(c.options):{},o(p.options,t.options)),p._initHooks=[],p.callInitHooks=function(){if(!this._initHooksCalled){c.callInitHooks&&c.callInitHooks.call(this),this._initHooksCalled=!0;for(var D=0,ne=p._initHooks.length;D<ne;D++)p._initHooks[D].call(this)}},s},F.include=function(t){var s=this.prototype.options;return o(this.prototype,t),t.options&&(this.prototype.options=s,this.mergeOptions(t.options)),this},F.mergeOptions=function(t){return o(this.prototype.options,t),this},F.addInitHook=function(t){var s=Array.prototype.slice.call(arguments,1),c=typeof t=="function"?t:function(){this[t].apply(this,s)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(c),this};function se(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=w(t)?t:[t];for(var s=0;s<t.length;s++)t[s]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var M={on:function(t,s,c){if(typeof t=="object")for(var p in t)this._on(p,t[p],s);else{t=v(t);for(var E=0,D=t.length;E<D;E++)this._on(t[E],s,c)}return this},off:function(t,s,c){if(!arguments.length)delete this._events;else if(typeof t=="object")for(var p in t)this._off(p,t[p],s);else{t=v(t);for(var E=arguments.length===1,D=0,ne=t.length;D<ne;D++)E?this._off(t[D]):this._off(t[D],s,c)}return this},_on:function(t,s,c,p){if(typeof s!="function"){console.warn("wrong listener type: "+typeof s);return}if(this._listens(t,s,c)===!1){c===this&&(c=void 0);var E={fn:s,ctx:c};p&&(E.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(E)}},_off:function(t,s,c){var p,E,D;if(this._events&&(p=this._events[t],!!p)){if(arguments.length===1){if(this._firingCount)for(E=0,D=p.length;E<D;E++)p[E].fn=m;delete this._events[t];return}if(typeof s!="function"){console.warn("wrong listener type: "+typeof s);return}var ne=this._listens(t,s,c);if(ne!==!1){var he=p[ne];this._firingCount&&(he.fn=m,this._events[t]=p=p.slice()),p.splice(ne,1)}}},fire:function(t,s,c){if(!this.listens(t,c))return this;var p=o({},s,{type:t,target:this,sourceTarget:s&&s.sourceTarget||this});if(this._events){var E=this._events[t];if(E){this._firingCount=this._firingCount+1||1;for(var D=0,ne=E.length;D<ne;D++){var he=E[D],ye=he.fn;he.once&&this.off(t,ye,he.ctx),ye.call(he.ctx||this,p)}this._firingCount--}}return c&&this._propagateEvent(p),this},listens:function(t,s,c,p){typeof t!="string"&&console.warn('"string" type argument expected');var E=s;typeof s!="function"&&(p=!!s,E=void 0,c=void 0);var D=this._events&&this._events[t];if(D&&D.length&&this._listens(t,E,c)!==!1)return!0;if(p){for(var ne in this._eventParents)if(this._eventParents[ne].listens(t,s,c,p))return!0}return!1},_listens:function(t,s,c){if(!this._events)return!1;var p=this._events[t]||[];if(!s)return!!p.length;c===this&&(c=void 0);for(var E=0,D=p.length;E<D;E++)if(p[E].fn===s&&p[E].ctx===c)return E;return!1},once:function(t,s,c){if(typeof t=="object")for(var p in t)this._on(p,t[p],s,!0);else{t=v(t);for(var E=0,D=t.length;E<D;E++)this._on(t[E],s,c,!0)}return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[f(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[f(t)],this},_propagateEvent:function(t){for(var s in this._eventParents)this._eventParents[s].fire(t.type,o({layer:t.target,propagatedFrom:t.target},t),!0)}};M.addEventListener=M.on,M.removeEventListener=M.clearAllEventListeners=M.off,M.addOneTimeEventListener=M.once,M.fireEvent=M.fire,M.hasEventListeners=M.listens;var re=F.extend(M);function B(t,s,c){this.x=c?Math.round(t):t,this.y=c?Math.round(s):s}var oe=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};B.prototype={clone:function(){return new B(this.x,this.y)},add:function(t){return this.clone()._add(T(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(T(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new B(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new B(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=oe(this.x),this.y=oe(this.y),this},distanceTo:function(t){t=T(t);var s=t.x-this.x,c=t.y-this.y;return Math.sqrt(s*s+c*c)},equals:function(t){return t=T(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=T(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+d(this.x)+", "+d(this.y)+")"}};function T(t,s,c){return t instanceof B?t:w(t)?new B(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new B(t.x,t.y):new B(t,s,c)}function Q(t,s){if(t)for(var c=s?[t,s]:t,p=0,E=c.length;p<E;p++)this.extend(c[p])}Q.prototype={extend:function(t){var s,c;if(!t)return this;if(t instanceof B||typeof t[0]=="number"||"x"in t)s=c=T(t);else if(t=ie(t),s=t.min,c=t.max,!s||!c)return this;return!this.min&&!this.max?(this.min=s.clone(),this.max=c.clone()):(this.min.x=Math.min(s.x,this.min.x),this.max.x=Math.max(c.x,this.max.x),this.min.y=Math.min(s.y,this.min.y),this.max.y=Math.max(c.y,this.max.y)),this},getCenter:function(t){return T((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return T(this.min.x,this.max.y)},getTopRight:function(){return T(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var s,c;return typeof t[0]=="number"||t instanceof B?t=T(t):t=ie(t),t instanceof Q?(s=t.min,c=t.max):s=c=t,s.x>=this.min.x&&c.x<=this.max.x&&s.y>=this.min.y&&c.y<=this.max.y},intersects:function(t){t=ie(t);var s=this.min,c=this.max,p=t.min,E=t.max,D=E.x>=s.x&&p.x<=c.x,ne=E.y>=s.y&&p.y<=c.y;return D&&ne},overlaps:function(t){t=ie(t);var s=this.min,c=this.max,p=t.min,E=t.max,D=E.x>s.x&&p.x<c.x,ne=E.y>s.y&&p.y<c.y;return D&&ne},isValid:function(){return!!(this.min&&this.max)},pad:function(t){var s=this.min,c=this.max,p=Math.abs(s.x-c.x)*t,E=Math.abs(s.y-c.y)*t;return ie(T(s.x-p,s.y-E),T(c.x+p,c.y+E))},equals:function(t){return t?(t=ie(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight())):!1}};function ie(t,s){return!t||t instanceof Q?t:new Q(t,s)}function Y(t,s){if(t)for(var c=s?[t,s]:t,p=0,E=c.length;p<E;p++)this.extend(c[p])}Y.prototype={extend:function(t){var s=this._southWest,c=this._northEast,p,E;if(t instanceof Z)p=t,E=t;else if(t instanceof Y){if(p=t._southWest,E=t._northEast,!p||!E)return this}else return t?this.extend(W(t)||me(t)):this;return!s&&!c?(this._southWest=new Z(p.lat,p.lng),this._northEast=new Z(E.lat,E.lng)):(s.lat=Math.min(p.lat,s.lat),s.lng=Math.min(p.lng,s.lng),c.lat=Math.max(E.lat,c.lat),c.lng=Math.max(E.lng,c.lng)),this},pad:function(t){var s=this._southWest,c=this._northEast,p=Math.abs(s.lat-c.lat)*t,E=Math.abs(s.lng-c.lng)*t;return new Y(new Z(s.lat-p,s.lng-E),new Z(c.lat+p,c.lng+E))},getCenter:function(){return new Z((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new Z(this.getNorth(),this.getWest())},getSouthEast:function(){return new Z(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){typeof t[0]=="number"||t instanceof Z||"lat"in t?t=W(t):t=me(t);var s=this._southWest,c=this._northEast,p,E;return t instanceof Y?(p=t.getSouthWest(),E=t.getNorthEast()):p=E=t,p.lat>=s.lat&&E.lat<=c.lat&&p.lng>=s.lng&&E.lng<=c.lng},intersects:function(t){t=me(t);var s=this._southWest,c=this._northEast,p=t.getSouthWest(),E=t.getNorthEast(),D=E.lat>=s.lat&&p.lat<=c.lat,ne=E.lng>=s.lng&&p.lng<=c.lng;return D&&ne},overlaps:function(t){t=me(t);var s=this._southWest,c=this._northEast,p=t.getSouthWest(),E=t.getNorthEast(),D=E.lat>s.lat&&p.lat<c.lat,ne=E.lng>s.lng&&p.lng<c.lng;return D&&ne},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,s){return t?(t=me(t),this._southWest.equals(t.getSouthWest(),s)&&this._northEast.equals(t.getNorthEast(),s)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function me(t,s){return t instanceof Y?t:new Y(t,s)}function Z(t,s,c){if(isNaN(t)||isNaN(s))throw new Error("Invalid LatLng object: ("+t+", "+s+")");this.lat=+t,this.lng=+s,c!==void 0&&(this.alt=+c)}Z.prototype={equals:function(t,s){if(!t)return!1;t=W(t);var c=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return c<=(s===void 0?1e-9:s)},toString:function(t){return"LatLng("+d(this.lat,t)+", "+d(this.lng,t)+")"},distanceTo:function(t){return K.distance(this,W(t))},wrap:function(){return K.wrapLatLng(this)},toBounds:function(t){var s=180*t/40075017,c=s/Math.cos(Math.PI/180*this.lat);return me([this.lat-s,this.lng-c],[this.lat+s,this.lng+c])},clone:function(){return new Z(this.lat,this.lng,this.alt)}};function W(t,s,c){return t instanceof Z?t:w(t)&&typeof t[0]!="object"?t.length===3?new Z(t[0],t[1],t[2]):t.length===2?new Z(t[0],t[1]):null:t==null?t:typeof t=="object"&&"lat"in t?new Z(t.lat,"lng"in t?t.lng:t.lon,t.alt):s===void 0?null:new Z(t,s,c)}var ee={latLngToPoint:function(t,s){var c=this.projection.project(t),p=this.scale(s);return this.transformation._transform(c,p)},pointToLatLng:function(t,s){var c=this.scale(s),p=this.transformation.untransform(t,c);return this.projection.unproject(p)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var s=this.projection.bounds,c=this.scale(t),p=this.transformation.transform(s.min,c),E=this.transformation.transform(s.max,c);return new Q(p,E)},infinite:!1,wrapLatLng:function(t){var s=this.wrapLng?g(t.lng,this.wrapLng,!0):t.lng,c=this.wrapLat?g(t.lat,this.wrapLat,!0):t.lat,p=t.alt;return new Z(c,s,p)},wrapLatLngBounds:function(t){var s=t.getCenter(),c=this.wrapLatLng(s),p=s.lat-c.lat,E=s.lng-c.lng;if(p===0&&E===0)return t;var D=t.getSouthWest(),ne=t.getNorthEast(),he=new Z(D.lat-p,D.lng-E),ye=new Z(ne.lat-p,ne.lng-E);return new Y(he,ye)}},K=o({},ee,{wrapLng:[-180,180],R:6371e3,distance:function(t,s){var c=Math.PI/180,p=t.lat*c,E=s.lat*c,D=Math.sin((s.lat-t.lat)*c/2),ne=Math.sin((s.lng-t.lng)*c/2),he=D*D+Math.cos(p)*Math.cos(E)*ne*ne,ye=2*Math.atan2(Math.sqrt(he),Math.sqrt(1-he));return this.R*ye}}),ue=6378137,ce={R:ue,MAX_LATITUDE:85.0511287798,project:function(t){var s=Math.PI/180,c=this.MAX_LATITUDE,p=Math.max(Math.min(c,t.lat),-c),E=Math.sin(p*s);return new B(this.R*t.lng*s,this.R*Math.log((1+E)/(1-E))/2)},unproject:function(t){var s=180/Math.PI;return new Z((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*s,t.x*s/this.R)},bounds:(function(){var t=ue*Math.PI;return new Q([-t,-t],[t,t])})()};function Ee(t,s,c,p){if(w(t)){this._a=t[0],this._b=t[1],this._c=t[2],this._d=t[3];return}this._a=t,this._b=s,this._c=c,this._d=p}Ee.prototype={transform:function(t,s){return this._transform(t.clone(),s)},_transform:function(t,s){return s=s||1,t.x=s*(this._a*t.x+this._b),t.y=s*(this._c*t.y+this._d),t},untransform:function(t,s){return s=s||1,new B((t.x/s-this._b)/this._a,(t.y/s-this._d)/this._c)}};function Te(t,s,c,p){return new Ee(t,s,c,p)}var q=o({},K,{code:"EPSG:3857",projection:ce,transformation:(function(){var t=.5/(Math.PI*ce.R);return Te(t,.5,-t,.5)})()}),te=o({},q,{code:"EPSG:900913"});function fe(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function xe(t,s){var c="",p,E,D,ne,he,ye;for(p=0,D=t.length;p<D;p++){for(he=t[p],E=0,ne=he.length;E<ne;E++)ye=he[E],c+=(E?"L":"M")+ye.x+" "+ye.y;c+=s?ke.svg?"z":"x":""}return c||"M0 0"}var Se=document.documentElement.style,Ie="ActiveXObject"in window,le=Ie&&!document.addEventListener,ve="msLaunchUri"in navigator&&!("documentMode"in document),Ae=Nt("webkit"),be=Nt("android"),qe=Nt("android 2")||Nt("android 3"),mt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),$e=be&&Nt("Google")&&mt<537&&!("AudioNode"in window),ft=!!window.opera,k=!ve&&Nt("chrome"),b=Nt("gecko")&&!Ae&&!ft&&!Ie,x=!k&&Nt("safari"),H=Nt("phantom"),ae="OTransition"in Se,_e=navigator.platform.indexOf("Win")===0,we=Ie&&"transition"in Se,Oe="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!qe,Ye="MozPerspective"in Se,Qe=!window.L_DISABLE_3D&&(we||Oe||Ye)&&!ae&&!H,Ge=typeof orientation<"u"||Nt("mobile"),Ze=Ge&&Ae,$t=Ge&&Oe,en=!window.PointerEvent&&window.MSPointerEvent,st=!!(window.PointerEvent||en),at="ontouchstart"in window||!!window.TouchEvent,Ai=!window.L_NO_TOUCH&&(at||st),hn=Ge&&ft,Fn=Ge&&b,ei=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,z=(function(){var t=!1;try{var s=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",m,s),window.removeEventListener("testPassiveEventSupport",m,s)}catch{}return t})(),J=(function(){return!!document.createElement("canvas").getContext})(),Ne=!!(document.createElementNS&&fe("svg").createSVGRect),Re=!!Ne&&(function(){var t=document.createElement("div");return t.innerHTML="<svg/>",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),De=!Ne&&(function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var s=t.firstChild;return s.style.behavior="url(#default#VML)",s&&typeof s.adj=="object"}catch{return!1}})(),_t=navigator.platform.indexOf("Mac")===0,wt=navigator.platform.indexOf("Linux")===0;function Nt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var ke={ie:Ie,ielt9:le,edge:ve,webkit:Ae,android:be,android23:qe,androidStock:$e,opera:ft,chrome:k,gecko:b,safari:x,phantom:H,opera12:ae,win:_e,ie3d:we,webkit3d:Oe,gecko3d:Ye,any3d:Qe,mobile:Ge,mobileWebkit:Ze,mobileWebkit3d:$t,msPointer:en,pointer:st,touch:Ai,touchNative:at,mobileOpera:hn,mobileGecko:Fn,retina:ei,passiveEvents:z,canvas:J,svg:Ne,vml:De,inlineSvg:Re,mac:_t,linux:wt},ti=ke.msPointer?"MSPointerDown":"pointerdown",Wt=ke.msPointer?"MSPointerMove":"pointermove",jn=ke.msPointer?"MSPointerUp":"pointerup",En=ke.msPointer?"MSPointerCancel":"pointercancel",fn={touchstart:ti,touchmove:Wt,touchend:jn,touchcancel:En},Bn={touchstart:lo,touchmove:tn,touchend:tn,touchcancel:tn},it={},V=!1;function de(t,s,c){return s==="touchstart"&&xt(),Bn[s]?(c=Bn[s].bind(this,c),t.addEventListener(fn[s],c,!1),c):(console.warn("wrong event specified:",s),m)}function pe(t,s,c){if(!fn[s]){console.warn("wrong event specified:",s);return}t.removeEventListener(fn[s],c,!1)}function Pe(t){it[t.pointerId]=t}function Ue(t){it[t.pointerId]&&(it[t.pointerId]=t)}function Je(t){delete it[t.pointerId]}function xt(){V||(document.addEventListener(ti,Pe,!0),document.addEventListener(Wt,Ue,!0),document.addEventListener(jn,Je,!0),document.addEventListener(En,Je,!0),V=!0)}function tn(t,s){if(s.pointerType!==(s.MSPOINTER_TYPE_MOUSE||"mouse")){s.touches=[];for(var c in it)s.touches.push(it[c]);s.changedTouches=[s],t(s)}}function lo(t,s){s.MSPOINTER_TYPE_TOUCH&&s.pointerType===s.MSPOINTER_TYPE_TOUCH&&St(s),tn(t,s)}function $n(t){var s={},c,p;for(p in t)c=t[p],s[p]=c&&c.bind?c.bind(t):c;return t=s,s.type="dblclick",s.detail=2,s.isTrusted=!1,s._simulated=!0,s}var ni=200;function Ap(t,s){t.addEventListener("dblclick",s);var c=0,p;function E(D){if(D.detail!==1){p=D.detail;return}if(!(D.pointerType==="mouse"||D.sourceCapabilities&&!D.sourceCapabilities.firesTouchEvents)){var ne=gu(D);if(!(ne.some(function(ye){return ye instanceof HTMLLabelElement&&ye.attributes.for})&&!ne.some(function(ye){return ye instanceof HTMLInputElement||ye instanceof HTMLSelectElement}))){var he=Date.now();he-c<=ni?(p++,p===2&&s($n(D))):p=1,c=he}}}return t.addEventListener("click",E),{dblclick:s,simDblclick:E}}function Np(t,s){t.removeEventListener("dblclick",s.dblclick),t.removeEventListener("click",s.simDblclick)}var uo=ns(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),tr=ns(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),du=tr==="webkitTransition"||tr==="OTransition"?tr+"End":"transitionend";function hu(t){return typeof t=="string"?document.getElementById(t):t}function nr(t,s){var c=t.style[s]||t.currentStyle&&t.currentStyle[s];if((!c||c==="auto")&&document.defaultView){var p=document.defaultView.getComputedStyle(t,null);c=p?p[s]:null}return c==="auto"?null:c}function Ke(t,s,c){var p=document.createElement(t);return p.className=s||"",c&&c.appendChild(p),p}function ut(t){var s=t.parentNode;s&&s.removeChild(t)}function es(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Ni(t){var s=t.parentNode;s&&s.lastChild!==t&&s.appendChild(t)}function Ri(t){var s=t.parentNode;s&&s.firstChild!==t&&s.insertBefore(t,s.firstChild)}function co(t,s){if(t.classList!==void 0)return t.classList.contains(s);var c=ts(t);return c.length>0&&new RegExp("(^|\\s)"+s+"(\\s|$)").test(c)}function He(t,s){if(t.classList!==void 0)for(var c=v(s),p=0,E=c.length;p<E;p++)t.classList.add(c[p]);else if(!co(t,s)){var D=ts(t);ho(t,(D?D+" ":"")+s)}}function pt(t,s){t.classList!==void 0?t.classList.remove(s):ho(t,_((" "+ts(t)+" ").replace(" "+s+" "," ")))}function ho(t,s){t.className.baseVal===void 0?t.className=s:t.className.baseVal=s}function ts(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}function Gt(t,s){"opacity"in t.style?t.style.opacity=s:"filter"in t.style&&Rp(t,s)}function Rp(t,s){var c=!1,p="DXImageTransform.Microsoft.Alpha";try{c=t.filters.item(p)}catch{if(s===1)return}s=Math.round(s*100),c?(c.Enabled=s!==100,c.Opacity=s):t.style.filter+=" progid:"+p+"(opacity="+s+")"}function ns(t){for(var s=document.documentElement.style,c=0;c<t.length;c++)if(t[c]in s)return t[c];return!1}function ii(t,s,c){var p=s||new B(0,0);t.style[uo]=(ke.ie3d?"translate("+p.x+"px,"+p.y+"px)":"translate3d("+p.x+"px,"+p.y+"px,0)")+(c?" scale("+c+")":"")}function yt(t,s){t._leaflet_pos=s,ke.any3d?ii(t,s):(t.style.left=s.x+"px",t.style.top=s.y+"px")}function ri(t){return t._leaflet_pos||new B(0,0)}var ir,rr,fo;if("onselectstart"in document)ir=function(){ze(window,"selectstart",St)},rr=function(){rt(window,"selectstart",St)};else{var sr=ns(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ir=function(){if(sr){var t=document.documentElement.style;fo=t[sr],t[sr]="none"}},rr=function(){sr&&(document.documentElement.style[sr]=fo,fo=void 0)}}function po(){ze(window,"dragstart",St)}function go(){rt(window,"dragstart",St)}var is,mo;function _o(t){for(;t.tabIndex===-1;)t=t.parentNode;t.style&&(rs(),is=t,mo=t.style.outlineStyle,t.style.outlineStyle="none",ze(window,"keydown",rs))}function rs(){is&&(is.style.outlineStyle=mo,is=void 0,mo=void 0,rt(window,"keydown",rs))}function fu(t){do t=t.parentNode;while((!t.offsetWidth||!t.offsetHeight)&&t!==document.body);return t}function yo(t){var s=t.getBoundingClientRect();return{x:s.width/t.offsetWidth||1,y:s.height/t.offsetHeight||1,boundingClientRect:s}}var Cp={__proto__:null,TRANSFORM:uo,TRANSITION:tr,TRANSITION_END:du,get:hu,getStyle:nr,create:Ke,remove:ut,empty:es,toFront:Ni,toBack:Ri,hasClass:co,addClass:He,removeClass:pt,setClass:ho,getClass:ts,setOpacity:Gt,testProp:ns,setTransform:ii,setPosition:yt,getPosition:ri,get disableTextSelection(){return ir},get enableTextSelection(){return rr},disableImageDrag:po,enableImageDrag:go,preventOutline:_o,restoreOutline:rs,getSizedParentNode:fu,getScale:yo};function ze(t,s,c,p){if(s&&typeof s=="object")for(var E in s)vo(t,E,s[E],c);else{s=v(s);for(var D=0,ne=s.length;D<ne;D++)vo(t,s[D],c,p)}return this}var pn="_leaflet_events";function rt(t,s,c,p){if(arguments.length===1)pu(t),delete t[pn];else if(s&&typeof s=="object")for(var E in s)wo(t,E,s[E],c);else if(s=v(s),arguments.length===2)pu(t,function(he){return y(s,he)!==-1});else for(var D=0,ne=s.length;D<ne;D++)wo(t,s[D],c,p);return this}function pu(t,s){for(var c in t[pn]){var p=c.split(/\d/)[0];(!s||s(p))&&wo(t,p,null,null,c)}}var bo={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function vo(t,s,c,p){var E=s+f(c)+(p?"_"+f(p):"");if(t[pn]&&t[pn][E])return this;var D=function(he){return c.call(p||t,he||window.event)},ne=D;!ke.touchNative&&ke.pointer&&s.indexOf("touch")===0?D=de(t,s,D):ke.touch&&s==="dblclick"?D=Ap(t,D):"addEventListener"in t?s==="touchstart"||s==="touchmove"||s==="wheel"||s==="mousewheel"?t.addEventListener(bo[s]||s,D,ke.passiveEvents?{passive:!1}:!1):s==="mouseenter"||s==="mouseleave"?(D=function(he){he=he||window.event,Eo(t,he)&&ne(he)},t.addEventListener(bo[s],D,!1)):t.addEventListener(s,ne,!1):t.attachEvent("on"+s,D),t[pn]=t[pn]||{},t[pn][E]=D}function wo(t,s,c,p,E){E=E||s+f(c)+(p?"_"+f(p):"");var D=t[pn]&&t[pn][E];if(!D)return this;!ke.touchNative&&ke.pointer&&s.indexOf("touch")===0?pe(t,s,D):ke.touch&&s==="dblclick"?Np(t,D):"removeEventListener"in t?t.removeEventListener(bo[s]||s,D,!1):t.detachEvent("on"+s,D),t[pn][E]=null}function si(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function xo(t){return vo(t,"wheel",si),this}function or(t){return ze(t,"mousedown touchstart dblclick contextmenu",si),t._leaflet_disable_click=!0,this}function St(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function oi(t){return St(t),si(t),this}function gu(t){if(t.composedPath)return t.composedPath();for(var s=[],c=t.target;c;)s.push(c),c=c.parentNode;return s}function mu(t,s){if(!s)return new B(t.clientX,t.clientY);var c=yo(s),p=c.boundingClientRect;return new B((t.clientX-p.left)/c.x-s.clientLeft,(t.clientY-p.top)/c.y-s.clientTop)}var Pp=ke.linux&&ke.chrome?window.devicePixelRatio:ke.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function _u(t){return ke.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/Pp:t.deltaY&&t.deltaMode===1?-t.deltaY*20:t.deltaY&&t.deltaMode===2?-t.deltaY*60:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?-t.detail*20:t.detail?t.detail/-32765*60:0}function Eo(t,s){var c=s.relatedTarget;if(!c)return!0;try{for(;c&&c!==t;)c=c.parentNode}catch{return!1}return c!==t}var kp={__proto__:null,on:ze,off:rt,stopPropagation:si,disableScrollPropagation:xo,disableClickPropagation:or,preventDefault:St,stop:oi,getPropagationPath:gu,getMousePosition:mu,getWheelDelta:_u,isExternalTarget:Eo,addListener:ze,removeListener:rt},yu=re.extend({run:function(t,s,c,p){this.stop(),this._el=t,this._inProgress=!0,this._duration=c||.25,this._easeOutPower=1/Math.max(p||.5,.2),this._startPos=ri(t),this._offset=s.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=$(this._animate,this),this._step()},_step:function(t){var s=+new Date-this._startTime,c=this._duration*1e3;s<c?this._runFrame(this._easeOut(s/c),t):(this._runFrame(1),this._complete())},_runFrame:function(t,s){var c=this._startPos.add(this._offset.multiplyBy(t));s&&c._round(),yt(this._el,c),this.fire("step")},_complete:function(){G(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),Xe=re.extend({options:{crs:q,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,s){s=I(this,s),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=l(this._onResize,this),this._initEvents(),s.maxBounds&&this.setMaxBounds(s.maxBounds),s.zoom!==void 0&&(this._zoom=this._limitZoom(s.zoom)),s.center&&s.zoom!==void 0&&this.setView(W(s.center),s.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=tr&&ke.any3d&&!ke.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),ze(this._proxy,du,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,s,c){if(s=s===void 0?this._zoom:this._limitZoom(s),t=this._limitCenter(W(t),s,this.options.maxBounds),c=c||{},this._stop(),this._loaded&&!c.reset&&c!==!0){c.animate!==void 0&&(c.zoom=o({animate:c.animate},c.zoom),c.pan=o({animate:c.animate,duration:c.duration},c.pan));var p=this._zoom!==s?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,s,c.zoom):this._tryAnimatedPan(t,c.pan);if(p)return clearTimeout(this._sizeTimer),this}return this._resetView(t,s,c.pan&&c.pan.noMoveStart),this},setZoom:function(t,s){return this._loaded?this.setView(this.getCenter(),t,{zoom:s}):(this._zoom=t,this)},zoomIn:function(t,s){return t=t||(ke.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,s)},zoomOut:function(t,s){return t=t||(ke.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,s)},setZoomAround:function(t,s,c){var p=this.getZoomScale(s),E=this.getSize().divideBy(2),D=t instanceof B?t:this.latLngToContainerPoint(t),ne=D.subtract(E).multiplyBy(1-1/p),he=this.containerPointToLatLng(E.add(ne));return this.setView(he,s,{zoom:c})},_getBoundsCenterZoom:function(t,s){s=s||{},t=t.getBounds?t.getBounds():me(t);var c=T(s.paddingTopLeft||s.padding||[0,0]),p=T(s.paddingBottomRight||s.padding||[0,0]),E=this.getBoundsZoom(t,!1,c.add(p));if(E=typeof s.maxZoom=="number"?Math.min(s.maxZoom,E):E,E===1/0)return{center:t.getCenter(),zoom:E};var D=p.subtract(c).divideBy(2),ne=this.project(t.getSouthWest(),E),he=this.project(t.getNorthEast(),E),ye=this.unproject(ne.add(he).divideBy(2).add(D),E);return{center:ye,zoom:E}},fitBounds:function(t,s){if(t=me(t),!t.isValid())throw new Error("Bounds are not valid.");var c=this._getBoundsCenterZoom(t,s);return this.setView(c.center,c.zoom,s)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,s){return this.setView(t,this._zoom,{pan:s})},panBy:function(t,s){if(t=T(t).round(),s=s||{},!t.x&&!t.y)return this.fire("moveend");if(s.animate!==!0&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new yu,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),s.noMoveStart||this.fire("movestart"),s.animate!==!1){He(this._mapPane,"leaflet-pan-anim");var c=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,c,s.duration||.25,s.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,s,c){if(c=c||{},c.animate===!1||!ke.any3d)return this.setView(t,s,c);this._stop();var p=this.project(this.getCenter()),E=this.project(t),D=this.getSize(),ne=this._zoom;t=W(t),s=s===void 0?ne:s;var he=Math.max(D.x,D.y),ye=he*this.getZoomScale(ne,s),Le=E.distanceTo(p)||1,Ce=1.42,je=Ce*Ce;function Ve(bt){var ms=bt?-1:1,wg=bt?ye:he,xg=ye*ye-he*he+ms*je*je*Le*Le,Eg=2*wg*je*Le,Do=xg/Eg,Ku=Math.sqrt(Do*Do+1)-Do,Sg=Ku<1e-9?-18:Math.log(Ku);return Sg}function Rt(bt){return(Math.exp(bt)-Math.exp(-bt))/2}function Et(bt){return(Math.exp(bt)+Math.exp(-bt))/2}function Xt(bt){return Rt(bt)/Et(bt)}var Ot=Ve(0);function Oi(bt){return he*(Et(Ot)/Et(Ot+Ce*bt))}function _g(bt){return he*(Et(Ot)*Xt(Ot+Ce*bt)-Rt(Ot))/je}function yg(bt){return 1-Math.pow(1-bt,1.5)}var bg=Date.now(),Qu=(Ve(1)-Ot)/Ce,vg=c.duration?1e3*c.duration:1e3*Qu*.8;function Ju(){var bt=(Date.now()-bg)/vg,ms=yg(bt)*Qu;bt<=1?(this._flyToFrame=$(Ju,this),this._move(this.unproject(p.add(E.subtract(p).multiplyBy(_g(ms)/Le)),ne),this.getScaleZoom(he/Oi(ms),ne),{flyTo:!0})):this._move(t,s)._moveEnd(!0)}return this._moveStart(!0,c.noMoveStart),Ju.call(this),this},flyToBounds:function(t,s){var c=this._getBoundsCenterZoom(t,s);return this.flyTo(c.center,c.zoom,s)},setMaxBounds:function(t){return t=me(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(t){var s=this.options.minZoom;return this.options.minZoom=t,this._loaded&&s!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var s=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&s!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,s){this._enforcingBounds=!0;var c=this.getCenter(),p=this._limitCenter(c,this._zoom,me(t));return c.equals(p)||this.panTo(p,s),this._enforcingBounds=!1,this},panInside:function(t,s){s=s||{};var c=T(s.paddingTopLeft||s.padding||[0,0]),p=T(s.paddingBottomRight||s.padding||[0,0]),E=this.project(this.getCenter()),D=this.project(t),ne=this.getPixelBounds(),he=ie([ne.min.add(c),ne.max.subtract(p)]),ye=he.getSize();if(!he.contains(D)){this._enforcingBounds=!0;var Le=D.subtract(he.getCenter()),Ce=he.extend(D).getSize().subtract(ye);E.x+=Le.x<0?-Ce.x:Ce.x,E.y+=Le.y<0?-Ce.y:Ce.y,this.panTo(this.unproject(E),s),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=o({animate:!1,pan:!0},t===!0?{animate:!0}:t);var s=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var c=this.getSize(),p=s.divideBy(2).round(),E=c.divideBy(2).round(),D=p.subtract(E);return!D.x&&!D.y?this:(t.animate&&t.pan?this.panBy(D):(t.pan&&this._rawPanBy(D),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(l(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:s,newSize:c}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=o({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var s=l(this._handleGeolocationResponse,this),c=l(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(s,c,t):navigator.geolocation.getCurrentPosition(s,c,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var s=t.code,c=t.message||(s===1?"permission denied":s===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:s,message:"Geolocation error: "+c+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var s=t.coords.latitude,c=t.coords.longitude,p=new Z(s,c),E=p.toBounds(t.coords.accuracy*2),D=this._locateOptions;if(D.setView){var ne=this.getBoundsZoom(E);this.setView(p,D.maxZoom?Math.min(ne,D.maxZoom):ne)}var he={latlng:p,bounds:E,timestamp:t.timestamp};for(var ye in t.coords)typeof t.coords[ye]=="number"&&(he[ye]=t.coords[ye]);this.fire("locationfound",he)}},addHandler:function(t,s){if(!s)return this;var c=this[t]=new s(this);return this._handlers.push(c),this.options[t]&&c.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),ut(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(G(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)ut(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,s){var c="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),p=Ke("div",c,s||this._mapPane);return t&&(this._panes[t]=p),p},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),s=this.unproject(t.getBottomLeft()),c=this.unproject(t.getTopRight());return new Y(s,c)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,s,c){t=me(t),c=T(c||[0,0]);var p=this.getZoom()||0,E=this.getMinZoom(),D=this.getMaxZoom(),ne=t.getNorthWest(),he=t.getSouthEast(),ye=this.getSize().subtract(c),Le=ie(this.project(he,p),this.project(ne,p)).getSize(),Ce=ke.any3d?this.options.zoomSnap:1,je=ye.x/Le.x,Ve=ye.y/Le.y,Rt=s?Math.max(je,Ve):Math.min(je,Ve);return p=this.getScaleZoom(Rt,p),Ce&&(p=Math.round(p/(Ce/100))*(Ce/100),p=s?Math.ceil(p/Ce)*Ce:Math.floor(p/Ce)*Ce),Math.max(E,Math.min(D,p))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new B(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,s){var c=this._getTopLeftPoint(t,s);return new Q(c,c.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(t===void 0?this.getZoom():t)},getPane:function(t){return typeof t=="string"?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,s){var c=this.options.crs;return s=s===void 0?this._zoom:s,c.scale(t)/c.scale(s)},getScaleZoom:function(t,s){var c=this.options.crs;s=s===void 0?this._zoom:s;var p=c.zoom(t*c.scale(s));return isNaN(p)?1/0:p},project:function(t,s){return s=s===void 0?this._zoom:s,this.options.crs.latLngToPoint(W(t),s)},unproject:function(t,s){return s=s===void 0?this._zoom:s,this.options.crs.pointToLatLng(T(t),s)},layerPointToLatLng:function(t){var s=T(t).add(this.getPixelOrigin());return this.unproject(s)},latLngToLayerPoint:function(t){var s=this.project(W(t))._round();return s._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(W(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(me(t))},distance:function(t,s){return this.options.crs.distance(W(t),W(s))},containerPointToLayerPoint:function(t){return T(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return T(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var s=this.containerPointToLayerPoint(T(t));return this.layerPointToLatLng(s)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(W(t)))},mouseEventToContainerPoint:function(t){return mu(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var s=this._container=hu(t);if(s){if(s._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");ze(s,"scroll",this._onScroll,this),this._containerId=f(s)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&ke.any3d,He(t,"leaflet-container"+(ke.touch?" leaflet-touch":"")+(ke.retina?" leaflet-retina":"")+(ke.ielt9?" leaflet-oldie":"")+(ke.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var s=nr(t,"position");s!=="absolute"&&s!=="relative"&&s!=="fixed"&&s!=="sticky"&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),yt(this._mapPane,new B(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(He(t.markerPane,"leaflet-zoom-hide"),He(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,s,c){yt(this._mapPane,new B(0,0));var p=!this._loaded;this._loaded=!0,s=this._limitZoom(s),this.fire("viewprereset");var E=this._zoom!==s;this._moveStart(E,c)._move(t,s)._moveEnd(E),this.fire("viewreset"),p&&this.fire("load")},_moveStart:function(t,s){return t&&this.fire("zoomstart"),s||this.fire("movestart"),this},_move:function(t,s,c,p){s===void 0&&(s=this._zoom);var E=this._zoom!==s;return this._zoom=s,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),p?c&&c.pinch&&this.fire("zoom",c):((E||c&&c.pinch)&&this.fire("zoom",c),this.fire("move",c)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return G(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){yt(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[f(this._container)]=this;var s=t?rt:ze;s(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&s(window,"resize",this._onResize,this),ke.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){G(this._resizeRequest),this._resizeRequest=$(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,s){for(var c=[],p,E=s==="mouseout"||s==="mouseover",D=t.target||t.srcElement,ne=!1;D;){if(p=this._targets[f(D)],p&&(s==="click"||s==="preclick")&&this._draggableMoved(p)){ne=!0;break}if(p&&p.listens(s,!0)&&(E&&!Eo(D,t)||(c.push(p),E))||D===this._container)break;D=D.parentNode}return!c.length&&!ne&&!E&&this.listens(s,!0)&&(c=[this]),c},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var s=t.target||t.srcElement;if(!(!this._loaded||s._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(s))){var c=t.type;c==="mousedown"&&_o(s),this._fireDOMEvent(t,c)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,s,c){if(t.type==="click"){var p=o({},t);p.type="preclick",this._fireDOMEvent(p,p.type,c)}var E=this._findEventTargets(t,s);if(c){for(var D=[],ne=0;ne<c.length;ne++)c[ne].listens(s,!0)&&D.push(c[ne]);E=D.concat(E)}if(E.length){s==="contextmenu"&&St(t);var he=E[0],ye={originalEvent:t};if(t.type!=="keypress"&&t.type!=="keydown"&&t.type!=="keyup"){var Le=he.getLatLng&&(!he._radius||he._radius<=10);ye.containerPoint=Le?this.latLngToContainerPoint(he.getLatLng()):this.mouseEventToContainerPoint(t),ye.layerPoint=this.containerPointToLayerPoint(ye.containerPoint),ye.latlng=Le?he.getLatLng():this.layerPointToLatLng(ye.layerPoint)}for(ne=0;ne<E.length;ne++)if(E[ne].fire(s,ye,!0),ye.originalEvent._stopped||E[ne].options.bubblingMouseEvents===!1&&y(this._mouseEvents,s)!==-1)return}},_draggableMoved:function(t){return t=t.dragging&&t.dragging.enabled()?t:this,t.dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,s=this._handlers.length;t<s;t++)this._handlers[t].disable()},whenReady:function(t,s){return this._loaded?t.call(s||this,{target:this}):this.on("load",t,s),this},_getMapPanePos:function(){return ri(this._mapPane)||new B(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,s){var c=t&&s!==void 0?this._getNewPixelOrigin(t,s):this.getPixelOrigin();return c.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,s){var c=this.getSize()._divideBy(2);return this.project(t,s)._subtract(c)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,s,c){var p=this._getNewPixelOrigin(c,s);return this.project(t,s)._subtract(p)},_latLngBoundsToNewLayerBounds:function(t,s,c){var p=this._getNewPixelOrigin(c,s);return ie([this.project(t.getSouthWest(),s)._subtract(p),this.project(t.getNorthWest(),s)._subtract(p),this.project(t.getSouthEast(),s)._subtract(p),this.project(t.getNorthEast(),s)._subtract(p)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,s,c){if(!c)return t;var p=this.project(t,s),E=this.getSize().divideBy(2),D=new Q(p.subtract(E),p.add(E)),ne=this._getBoundsOffset(D,c,s);return Math.abs(ne.x)<=1&&Math.abs(ne.y)<=1?t:this.unproject(p.add(ne),s)},_limitOffset:function(t,s){if(!s)return t;var c=this.getPixelBounds(),p=new Q(c.min.add(t),c.max.add(t));return t.add(this._getBoundsOffset(p,s))},_getBoundsOffset:function(t,s,c){var p=ie(this.project(s.getNorthEast(),c),this.project(s.getSouthWest(),c)),E=p.min.subtract(t.min),D=p.max.subtract(t.max),ne=this._rebound(E.x,-D.x),he=this._rebound(E.y,-D.y);return new B(ne,he)},_rebound:function(t,s){return t+s>0?Math.round(t-s)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(s))},_limitZoom:function(t){var s=this.getMinZoom(),c=this.getMaxZoom(),p=ke.any3d?this.options.zoomSnap:1;return p&&(t=Math.round(t/p)*p),Math.max(s,Math.min(c,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){pt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,s){var c=this._getCenterOffset(t)._trunc();return(s&&s.animate)!==!0&&!this.getSize().contains(c)?!1:(this.panBy(c,s),!0)},_createAnimProxy:function(){var t=this._proxy=Ke("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(s){var c=uo,p=this._proxy.style[c];ii(this._proxy,this.project(s.center,s.zoom),this.getZoomScale(s.zoom,1)),p===this._proxy.style[c]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ut(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),s=this.getZoom();ii(this._proxy,this.project(t,s),this.getZoomScale(s,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,s,c){if(this._animatingZoom)return!0;if(c=c||{},!this._zoomAnimated||c.animate===!1||this._nothingToAnimate()||Math.abs(s-this._zoom)>this.options.zoomAnimationThreshold)return!1;var p=this.getZoomScale(s),E=this._getCenterOffset(t)._divideBy(1-1/p);return c.animate!==!0&&!this.getSize().contains(E)?!1:($(function(){this._moveStart(!0,c.noMoveStart||!1)._animateZoom(t,s,!0)},this),!0)},_animateZoom:function(t,s,c,p){this._mapPane&&(c&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=s,He(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:s,noUpdate:p}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(l(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&pt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Dp(t,s){return new Xe(t,s)}var nn=F.extend({options:{position:"topright"},initialize:function(t){I(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var s=this._map;return s&&s.removeControl(this),this.options.position=t,s&&s.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var s=this._container=this.onAdd(t),c=this.getPosition(),p=t._controlCorners[c];return He(s,"leaflet-control"),c.indexOf("bottom")!==-1?p.insertBefore(s,p.firstChild):p.appendChild(s),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ut(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ar=function(t){return new nn(t)};Xe.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},s="leaflet-",c=this._controlContainer=Ke("div",s+"control-container",this._container);function p(E,D){var ne=s+E+" "+s+D;t[E+D]=Ke("div",ne,c)}p("top","left"),p("top","right"),p("bottom","left"),p("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ut(this._controlCorners[t]);ut(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var bu=nn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,s,c,p){return c<p?-1:p<c?1:0}},initialize:function(t,s,c){I(this,c),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var p in t)this._addLayer(t[p],p);for(p in s)this._addLayer(s[p],p,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var s=0;s<this._layers.length;s++)this._layers[s].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return nn.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,s){return this._addLayer(t,s),this._map?this._update():this},addOverlay:function(t,s){return this._addLayer(t,s,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var s=this._getLayer(f(t));return s&&this._layers.splice(this._layers.indexOf(s),1),this._map?this._update():this},expand:function(){He(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(He(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):pt(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return pt(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",s=this._container=Ke("div",t),c=this.options.collapsed;s.setAttribute("aria-haspopup",!0),or(s),xo(s);var p=this._section=Ke("section",t+"-list");c&&(this._map.on("click",this.collapse,this),ze(s,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var E=this._layersLink=Ke("a",t+"-toggle",s);E.href="#",E.title="Layers",E.setAttribute("role","button"),ze(E,{keydown:function(D){D.keyCode===13&&this._expandSafely()},click:function(D){St(D),this._expandSafely()}},this),c||this.expand(),this._baseLayersList=Ke("div",t+"-base",p),this._separator=Ke("div",t+"-separator",p),this._overlaysList=Ke("div",t+"-overlays",p),s.appendChild(p)},_getLayer:function(t){for(var s=0;s<this._layers.length;s++)if(this._layers[s]&&f(this._layers[s].layer)===t)return this._layers[s]},_addLayer:function(t,s,c){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:s,overlay:c}),this.options.sortLayers&&this._layers.sort(l(function(p,E){return this.options.sortFunction(p.layer,E.layer,p.name,E.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;es(this._baseLayersList),es(this._overlaysList),this._layerControlInputs=[];var t,s,c,p,E=0;for(c=0;c<this._layers.length;c++)p=this._layers[c],this._addItem(p),s=s||p.overlay,t=t||!p.overlay,E+=p.overlay?0:1;return this.options.hideSingleBase&&(t=t&&E>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=s&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var s=this._getLayer(f(t.target)),c=s.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;c&&this._map.fire(c,s)},_createRadioElement:function(t,s){var c='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(s?' checked="checked"':"")+"/>",p=document.createElement("div");return p.innerHTML=c,p.firstChild},_addItem:function(t){var s=document.createElement("label"),c=this._map.hasLayer(t.layer),p;t.overlay?(p=document.createElement("input"),p.type="checkbox",p.className="leaflet-control-layers-selector",p.defaultChecked=c):p=this._createRadioElement("leaflet-base-layers_"+f(this),c),this._layerControlInputs.push(p),p.layerId=f(t.layer),ze(p,"click",this._onInputClick,this);var E=document.createElement("span");E.innerHTML=" "+t.name;var D=document.createElement("span");s.appendChild(D),D.appendChild(p),D.appendChild(E);var ne=t.overlay?this._overlaysList:this._baseLayersList;return ne.appendChild(s),this._checkDisabledLayers(),s},_onInputClick:function(){if(!this._preventClick){var t=this._layerControlInputs,s,c,p=[],E=[];this._handlingClick=!0;for(var D=t.length-1;D>=0;D--)s=t[D],c=this._getLayer(s.layerId).layer,s.checked?p.push(c):s.checked||E.push(c);for(D=0;D<E.length;D++)this._map.hasLayer(E[D])&&this._map.removeLayer(E[D]);for(D=0;D<p.length;D++)this._map.hasLayer(p[D])||this._map.addLayer(p[D]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var t=this._layerControlInputs,s,c,p=this._map.getZoom(),E=t.length-1;E>=0;E--)s=t[E],c=this._getLayer(s.layerId).layer,s.disabled=c.options.minZoom!==void 0&&p<c.options.minZoom||c.options.maxZoom!==void 0&&p>c.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,ze(t,"click",St),this.expand();var s=this;setTimeout(function(){rt(t,"click",St),s._preventClick=!1})}}),Mp=function(t,s,c){return new bu(t,s,c)},So=nn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var s="leaflet-control-zoom",c=Ke("div",s+" leaflet-bar"),p=this.options;return this._zoomInButton=this._createButton(p.zoomInText,p.zoomInTitle,s+"-in",c,this._zoomIn),this._zoomOutButton=this._createButton(p.zoomOutText,p.zoomOutTitle,s+"-out",c,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),c},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,s,c,p,E){var D=Ke("a",c,p);return D.innerHTML=t,D.href="#",D.title=s,D.setAttribute("role","button"),D.setAttribute("aria-label",s),or(D),ze(D,"click",oi),ze(D,"click",E,this),ze(D,"click",this._refocusOnMap,this),D},_updateDisabled:function(){var t=this._map,s="leaflet-disabled";pt(this._zoomInButton,s),pt(this._zoomOutButton,s),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(He(this._zoomOutButton,s),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(He(this._zoomInButton,s),this._zoomInButton.setAttribute("aria-disabled","true"))}});Xe.mergeOptions({zoomControl:!0}),Xe.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new So,this.addControl(this.zoomControl))});var Op=function(t){return new So(t)},vu=nn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var s="leaflet-control-scale",c=Ke("div",s),p=this.options;return this._addScales(p,s+"-line",c),t.on(p.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),c},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,s,c){t.metric&&(this._mScale=Ke("div",s,c)),t.imperial&&(this._iScale=Ke("div",s,c))},_update:function(){var t=this._map,s=t.getSize().y/2,c=t.distance(t.containerPointToLatLng([0,s]),t.containerPointToLatLng([this.options.maxWidth,s]));this._updateScales(c)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var s=this._getRoundNum(t),c=s<1e3?s+" m":s/1e3+" km";this._updateScale(this._mScale,c,s/t)},_updateImperial:function(t){var s=t*3.2808399,c,p,E;s>5280?(c=s/5280,p=this._getRoundNum(c),this._updateScale(this._iScale,p+" mi",p/c)):(E=this._getRoundNum(s),this._updateScale(this._iScale,E+" ft",E/s))},_updateScale:function(t,s,c){t.style.width=Math.round(this.options.maxWidth*c)+"px",t.innerHTML=s},_getRoundNum:function(t){var s=Math.pow(10,(Math.floor(t)+"").length-1),c=t/s;return c=c>=10?10:c>=5?5:c>=3?3:c>=2?2:1,s*c}}),Fp=function(t){return new vu(t)},jp='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',To=nn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(ke.inlineSvg?jp+" ":"")+"Leaflet</a>"},initialize:function(t){I(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=Ke("div","leaflet-control-attribution"),or(this._container);for(var s in t._layers)t._layers[s].getAttribution&&this.addAttribution(t._layers[s].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var s in this._attributions)this._attributions[s]&&t.push(s);var c=[];this.options.prefix&&c.push(this.options.prefix),t.length&&c.push(t.join(", ")),this._container.innerHTML=c.join(' <span aria-hidden="true">|</span> ')}}});Xe.mergeOptions({attributionControl:!0}),Xe.addInitHook(function(){this.options.attributionControl&&new To().addTo(this)});var Bp=function(t){return new To(t)};nn.Layers=bu,nn.Zoom=So,nn.Scale=vu,nn.Attribution=To,ar.layers=Mp,ar.zoom=Op,ar.scale=Fp,ar.attribution=Bp;var gn=F.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});gn.addTo=function(t,s){return t.addHandler(s,this),this};var $p={Events:M},wu=ke.touch?"touchstart mousedown":"mousedown",qn=re.extend({options:{clickTolerance:3},initialize:function(t,s,c,p){I(this,p),this._element=t,this._dragStartTarget=s||t,this._preventOutline=c},enable:function(){this._enabled||(ze(this._dragStartTarget,wu,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(qn._dragging===this&&this.finishDrag(!0),rt(this._dragStartTarget,wu,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!co(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){qn._dragging===this&&this.finishDrag();return}if(!(qn._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(qn._dragging=this,this._preventOutline&&_o(this._element),po(),ir(),!this._moving)){this.fire("down");var s=t.touches?t.touches[0]:t,c=fu(this._element);this._startPoint=new B(s.clientX,s.clientY),this._startPos=ri(this._element),this._parentScale=yo(c);var p=t.type==="mousedown";ze(document,p?"mousemove":"touchmove",this._onMove,this),ze(document,p?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var s=t.touches&&t.touches.length===1?t.touches[0]:t,c=new B(s.clientX,s.clientY)._subtract(this._startPoint);!c.x&&!c.y||Math.abs(c.x)+Math.abs(c.y)<this.options.clickTolerance||(c.x/=this._parentScale.x,c.y/=this._parentScale.y,St(t),this._moved||(this.fire("dragstart"),this._moved=!0,He(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),He(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(c),this._moving=!0,this._lastEvent=t,this._updatePosition())}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),yt(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){pt(document.body,"leaflet-dragging"),this._lastTarget&&(pt(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),rt(document,"mousemove touchmove",this._onMove,this),rt(document,"mouseup touchend touchcancel",this._onUp,this),go(),rr();var s=this._moved&&this._moving;this._moving=!1,qn._dragging=!1,s&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function xu(t,s,c){var p,E=[1,4,2,8],D,ne,he,ye,Le,Ce,je,Ve;for(D=0,Ce=t.length;D<Ce;D++)t[D]._code=ai(t[D],s);for(he=0;he<4;he++){for(je=E[he],p=[],D=0,Ce=t.length,ne=Ce-1;D<Ce;ne=D++)ye=t[D],Le=t[ne],ye._code&je?Le._code&je||(Ve=ss(Le,ye,je,s,c),Ve._code=ai(Ve,s),p.push(Ve)):(Le._code&je&&(Ve=ss(Le,ye,je,s,c),Ve._code=ai(Ve,s),p.push(Ve)),p.push(ye));t=p}return t}function Eu(t,s){var c,p,E,D,ne,he,ye,Le,Ce;if(!t||t.length===0)throw new Error("latlngs not passed");Zt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var je=W([0,0]),Ve=me(t),Rt=Ve.getNorthWest().distanceTo(Ve.getSouthWest())*Ve.getNorthEast().distanceTo(Ve.getNorthWest());Rt<1700&&(je=Lo(t));var Et=t.length,Xt=[];for(c=0;c<Et;c++){var Ot=W(t[c]);Xt.push(s.project(W([Ot.lat-je.lat,Ot.lng-je.lng])))}for(he=ye=Le=0,c=0,p=Et-1;c<Et;p=c++)E=Xt[c],D=Xt[p],ne=E.y*D.x-D.y*E.x,ye+=(E.x+D.x)*ne,Le+=(E.y+D.y)*ne,he+=ne*3;he===0?Ce=Xt[0]:Ce=[ye/he,Le/he];var Oi=s.unproject(T(Ce));return W([Oi.lat+je.lat,Oi.lng+je.lng])}function Lo(t){for(var s=0,c=0,p=0,E=0;E<t.length;E++){var D=W(t[E]);s+=D.lat,c+=D.lng,p++}return W([s/p,c/p])}var qp={__proto__:null,clipPolygon:xu,polygonCenter:Eu,centroid:Lo};function Su(t,s){if(!s||!t.length)return t.slice();var c=s*s;return t=Up(t,c),t=Hp(t,c),t}function Tu(t,s,c){return Math.sqrt(lr(t,s,c,!0))}function zp(t,s,c){return lr(t,s,c)}function Hp(t,s){var c=t.length,p=typeof Uint8Array<"u"?Uint8Array:Array,E=new p(c);E[0]=E[c-1]=1,Io(t,E,s,0,c-1);var D,ne=[];for(D=0;D<c;D++)E[D]&&ne.push(t[D]);return ne}function Io(t,s,c,p,E){var D=0,ne,he,ye;for(he=p+1;he<=E-1;he++)ye=lr(t[he],t[p],t[E],!0),ye>D&&(ne=he,D=ye);D>c&&(s[ne]=1,Io(t,s,c,p,ne),Io(t,s,c,ne,E))}function Up(t,s){for(var c=[t[0]],p=1,E=0,D=t.length;p<D;p++)Vp(t[p],t[E])>s&&(c.push(t[p]),E=p);return E<D-1&&c.push(t[D-1]),c}var Lu;function Iu(t,s,c,p,E){var D=p?Lu:ai(t,c),ne=ai(s,c),he,ye,Le;for(Lu=ne;;){if(!(D|ne))return[t,s];if(D&ne)return!1;he=D||ne,ye=ss(t,s,he,c,E),Le=ai(ye,c),he===D?(t=ye,D=Le):(s=ye,ne=Le)}}function ss(t,s,c,p,E){var D=s.x-t.x,ne=s.y-t.y,he=p.min,ye=p.max,Le,Ce;return c&8?(Le=t.x+D*(ye.y-t.y)/ne,Ce=ye.y):c&4?(Le=t.x+D*(he.y-t.y)/ne,Ce=he.y):c&2?(Le=ye.x,Ce=t.y+ne*(ye.x-t.x)/D):c&1&&(Le=he.x,Ce=t.y+ne*(he.x-t.x)/D),new B(Le,Ce,E)}function ai(t,s){var c=0;return t.x<s.min.x?c|=1:t.x>s.max.x&&(c|=2),t.y<s.min.y?c|=4:t.y>s.max.y&&(c|=8),c}function Vp(t,s){var c=s.x-t.x,p=s.y-t.y;return c*c+p*p}function lr(t,s,c,p){var E=s.x,D=s.y,ne=c.x-E,he=c.y-D,ye=ne*ne+he*he,Le;return ye>0&&(Le=((t.x-E)*ne+(t.y-D)*he)/ye,Le>1?(E=c.x,D=c.y):Le>0&&(E+=ne*Le,D+=he*Le)),ne=t.x-E,he=t.y-D,p?ne*ne+he*he:new B(E,D)}function Zt(t){return!w(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function Au(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Zt(t)}function Nu(t,s){var c,p,E,D,ne,he,ye,Le;if(!t||t.length===0)throw new Error("latlngs not passed");Zt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var Ce=W([0,0]),je=me(t),Ve=je.getNorthWest().distanceTo(je.getSouthWest())*je.getNorthEast().distanceTo(je.getNorthWest());Ve<1700&&(Ce=Lo(t));var Rt=t.length,Et=[];for(c=0;c<Rt;c++){var Xt=W(t[c]);Et.push(s.project(W([Xt.lat-Ce.lat,Xt.lng-Ce.lng])))}for(c=0,p=0;c<Rt-1;c++)p+=Et[c].distanceTo(Et[c+1])/2;if(p===0)Le=Et[0];else for(c=0,D=0;c<Rt-1;c++)if(ne=Et[c],he=Et[c+1],E=ne.distanceTo(he),D+=E,D>p){ye=(D-p)/E,Le=[he.x-ye*(he.x-ne.x),he.y-ye*(he.y-ne.y)];break}var Ot=s.unproject(T(Le));return W([Ot.lat+Ce.lat,Ot.lng+Ce.lng])}var Wp={__proto__:null,simplify:Su,pointToSegmentDistance:Tu,closestPointOnSegment:zp,clipSegment:Iu,_getEdgeIntersection:ss,_getBitCode:ai,_sqClosestPointOnSegment:lr,isFlat:Zt,_flat:Au,polylineCenter:Nu},Ao={project:function(t){return new B(t.lng,t.lat)},unproject:function(t){return new Z(t.y,t.x)},bounds:new Q([-180,-90],[180,90])},No={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Q([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var s=Math.PI/180,c=this.R,p=t.lat*s,E=this.R_MINOR/c,D=Math.sqrt(1-E*E),ne=D*Math.sin(p),he=Math.tan(Math.PI/4-p/2)/Math.pow((1-ne)/(1+ne),D/2);return p=-c*Math.log(Math.max(he,1e-10)),new B(t.lng*s*c,p)},unproject:function(t){for(var s=180/Math.PI,c=this.R,p=this.R_MINOR/c,E=Math.sqrt(1-p*p),D=Math.exp(-t.y/c),ne=Math.PI/2-2*Math.atan(D),he=0,ye=.1,Le;he<15&&Math.abs(ye)>1e-7;he++)Le=E*Math.sin(ne),Le=Math.pow((1-Le)/(1+Le),E/2),ye=Math.PI/2-2*Math.atan(D*Le)-ne,ne+=ye;return new Z(ne*s,t.x*s/c)}},Gp={__proto__:null,LonLat:Ao,Mercator:No,SphericalMercator:ce},Zp=o({},K,{code:"EPSG:3395",projection:No,transformation:(function(){var t=.5/(Math.PI*No.R);return Te(t,.5,-t,.5)})()}),Ru=o({},K,{code:"EPSG:4326",projection:Ao,transformation:Te(1/180,1,-1/180,.5)}),Xp=o({},ee,{projection:Ao,transformation:Te(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,s){var c=s.lng-t.lng,p=s.lat-t.lat;return Math.sqrt(c*c+p*p)},infinite:!0});ee.Earth=K,ee.EPSG3395=Zp,ee.EPSG3857=q,ee.EPSG900913=te,ee.EPSG4326=Ru,ee.Simple=Xp;var rn=re.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[f(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[f(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var s=t.target;if(s.hasLayer(this)){if(this._map=s,this._zoomAnimated=s._zoomAnimated,this.getEvents){var c=this.getEvents();s.on(c,this),this.once("remove",function(){s.off(c,this)},this)}this.onAdd(s),this.fire("add"),s.fire("layeradd",{layer:this})}}});Xe.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var s=f(t);return this._layers[s]?this:(this._layers[s]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var s=f(t);return this._layers[s]?(this._loaded&&t.onRemove(this),delete this._layers[s],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return f(t)in this._layers},eachLayer:function(t,s){for(var c in this._layers)t.call(s,this._layers[c]);return this},_addLayers:function(t){t=t?w(t)?t:[t]:[];for(var s=0,c=t.length;s<c;s++)this.addLayer(t[s])},_addZoomLimit:function(t){(!isNaN(t.options.maxZoom)||!isNaN(t.options.minZoom))&&(this._zoomBoundLayers[f(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var s=f(t);this._zoomBoundLayers[s]&&(delete this._zoomBoundLayers[s],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,s=-1/0,c=this._getZoomSpan();for(var p in this._zoomBoundLayers){var E=this._zoomBoundLayers[p].options;t=E.minZoom===void 0?t:Math.min(t,E.minZoom),s=E.maxZoom===void 0?s:Math.max(s,E.maxZoom)}this._layersMaxZoom=s===-1/0?void 0:s,this._layersMinZoom=t===1/0?void 0:t,c!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Ci=rn.extend({initialize:function(t,s){I(this,s),this._layers={};var c,p;if(t)for(c=0,p=t.length;c<p;c++)this.addLayer(t[c])},addLayer:function(t){var s=this.getLayerId(t);return this._layers[s]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var s=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[s]&&this._map.removeLayer(this._layers[s]),delete this._layers[s],this},hasLayer:function(t){var s=typeof t=="number"?t:this.getLayerId(t);return s in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var s=Array.prototype.slice.call(arguments,1),c,p;for(c in this._layers)p=this._layers[c],p[t]&&p[t].apply(p,s);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,s){for(var c in this._layers)t.call(s,this._layers[c]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return f(t)}}),Qp=function(t,s){return new Ci(t,s)},Sn=Ci.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Ci.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Ci.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new Y;for(var s in this._layers){var c=this._layers[s];t.extend(c.getBounds?c.getBounds():c.getLatLng())}return t}}),Jp=function(t,s){return new Sn(t,s)},Pi=F.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){I(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,s){var c=this._getIconUrl(t);if(!c){if(t==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var p=this._createImg(c,s&&s.tagName==="IMG"?s:null);return this._setIconStyles(p,t),(this.options.crossOrigin||this.options.crossOrigin==="")&&(p.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),p},_setIconStyles:function(t,s){var c=this.options,p=c[s+"Size"];typeof p=="number"&&(p=[p,p]);var E=T(p),D=T(s==="shadow"&&c.shadowAnchor||c.iconAnchor||E&&E.divideBy(2,!0));t.className="leaflet-marker-"+s+" "+(c.className||""),D&&(t.style.marginLeft=-D.x+"px",t.style.marginTop=-D.y+"px"),E&&(t.style.width=E.x+"px",t.style.height=E.y+"px")},_createImg:function(t,s){return s=s||document.createElement("img"),s.src=t,s},_getIconUrl:function(t){return ke.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Kp(t){return new Pi(t)}var ur=Pi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return typeof ur.imagePath!="string"&&(ur.imagePath=this._detectIconPath()),(this.options.imagePath||ur.imagePath)+Pi.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){var s=function(c,p,E){var D=p.exec(c);return D&&D[E]};return t=s(t,/^url\((['"])?(.+)\1\)$/,2),t&&s(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=Ke("div","leaflet-default-icon-path",document.body),s=nr(t,"background-image")||nr(t,"backgroundImage");if(document.body.removeChild(t),s=this._stripUrl(s),s)return s;var c=document.querySelector('link[href$="leaflet.css"]');return c?c.href.substring(0,c.href.length-11-1):""}}),Cu=gn.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new qn(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),He(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&pt(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var s=this._marker,c=s._map,p=this._marker.options.autoPanSpeed,E=this._marker.options.autoPanPadding,D=ri(s._icon),ne=c.getPixelBounds(),he=c.getPixelOrigin(),ye=ie(ne.min._subtract(he).add(E),ne.max._subtract(he).subtract(E));if(!ye.contains(D)){var Le=T((Math.max(ye.max.x,D.x)-ye.max.x)/(ne.max.x-ye.max.x)-(Math.min(ye.min.x,D.x)-ye.min.x)/(ne.min.x-ye.min.x),(Math.max(ye.max.y,D.y)-ye.max.y)/(ne.max.y-ye.max.y)-(Math.min(ye.min.y,D.y)-ye.min.y)/(ne.min.y-ye.min.y)).multiplyBy(p);c.panBy(Le,{animate:!1}),this._draggable._newPos._add(Le),this._draggable._startPos._add(Le),yt(s._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=$(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(G(this._panRequest),this._panRequest=$(this._adjustPan.bind(this,t)))},_onDrag:function(t){var s=this._marker,c=s._shadow,p=ri(s._icon),E=s._map.layerPointToLatLng(p);c&&yt(c,p),s._latlng=E,t.latlng=E,t.oldLatLng=this._oldLatLng,s.fire("move",t).fire("drag",t)},_onDragEnd:function(t){G(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),os=rn.extend({options:{icon:new ur,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,s){I(this,s),this._latlng=W(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var s=this._latlng;return this._latlng=W(t),this.update(),this.fire("move",{oldLatLng:s,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,s="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),c=t.icon.createIcon(this._icon),p=!1;c!==this._icon&&(this._icon&&this._removeIcon(),p=!0,t.title&&(c.title=t.title),c.tagName==="IMG"&&(c.alt=t.alt||"")),He(c,s),t.keyboard&&(c.tabIndex="0",c.setAttribute("role","button")),this._icon=c,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&ze(c,"focus",this._panOnFocus,this);var E=t.icon.createShadow(this._shadow),D=!1;E!==this._shadow&&(this._removeShadow(),D=!0),E&&(He(E,s),E.alt=""),this._shadow=E,t.opacity<1&&this._updateOpacity(),p&&this.getPane().appendChild(this._icon),this._initInteraction(),E&&D&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&rt(this._icon,"focus",this._panOnFocus,this),ut(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ut(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&yt(this._icon,t),this._shadow&&yt(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var s=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(s)},_initInteraction:function(){if(this.options.interactive&&(He(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Cu)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Cu(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&Gt(this._icon,t),this._shadow&&Gt(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t=this._map;if(t){var s=this.options.icon.options,c=s.iconSize?T(s.iconSize):T(0,0),p=s.iconAnchor?T(s.iconAnchor):T(0,0);t.panInside(this._latlng,{paddingTopLeft:p,paddingBottomRight:c.subtract(p)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Yp(t,s){return new os(t,s)}var zn=rn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return I(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),as=zn.extend({options:{fill:!0,radius:10},initialize:function(t,s){I(this,s),this._latlng=W(t),this._radius=this.options.radius},setLatLng:function(t){var s=this._latlng;return this._latlng=W(t),this.redraw(),this.fire("move",{oldLatLng:s,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var s=t&&t.radius||this._radius;return zn.prototype.setStyle.call(this,t),this.setRadius(s),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,s=this._radiusY||t,c=this._clickTolerance(),p=[t+c,s+c];this._pxBounds=new Q(this._point.subtract(p),this._point.add(p))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function eg(t,s){return new as(t,s)}var Ro=as.extend({initialize:function(t,s,c){if(typeof s=="number"&&(s=o({},c,{radius:s})),I(this,s),this._latlng=W(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new Y(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:zn.prototype.setStyle,_project:function(){var t=this._latlng.lng,s=this._latlng.lat,c=this._map,p=c.options.crs;if(p.distance===K.distance){var E=Math.PI/180,D=this._mRadius/K.R/E,ne=c.project([s+D,t]),he=c.project([s-D,t]),ye=ne.add(he).divideBy(2),Le=c.unproject(ye).lat,Ce=Math.acos((Math.cos(D*E)-Math.sin(s*E)*Math.sin(Le*E))/(Math.cos(s*E)*Math.cos(Le*E)))/E;(isNaN(Ce)||Ce===0)&&(Ce=D/Math.cos(Math.PI/180*s)),this._point=ye.subtract(c.getPixelOrigin()),this._radius=isNaN(Ce)?0:ye.x-c.project([Le,t-Ce]).x,this._radiusY=ye.y-ne.y}else{var je=p.unproject(p.project(this._latlng).subtract([this._mRadius,0]));this._point=c.latLngToLayerPoint(this._latlng),this._radius=this._point.x-c.latLngToLayerPoint(je).x}this._updateBounds()}});function tg(t,s,c){return new Ro(t,s,c)}var Tn=zn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,s){I(this,s),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var s=1/0,c=null,p=lr,E,D,ne=0,he=this._parts.length;ne<he;ne++)for(var ye=this._parts[ne],Le=1,Ce=ye.length;Le<Ce;Le++){E=ye[Le-1],D=ye[Le];var je=p(t,E,D,!0);je<s&&(s=je,c=p(t,E,D))}return c&&(c.distance=Math.sqrt(s)),c},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Nu(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(t,s){return s=s||this._defaultShape(),t=W(t),s.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new Y,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Zt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var s=[],c=Zt(t),p=0,E=t.length;p<E;p++)c?(s[p]=W(t[p]),this._bounds.extend(s[p])):s[p]=this._convertLatLngs(t[p]);return s},_project:function(){var t=new Q;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),s=new B(t,t);this._rawPxBounds&&(this._pxBounds=new Q([this._rawPxBounds.min.subtract(s),this._rawPxBounds.max.add(s)]))},_projectLatlngs:function(t,s,c){var p=t[0]instanceof Z,E=t.length,D,ne;if(p){for(ne=[],D=0;D<E;D++)ne[D]=this._map.latLngToLayerPoint(t[D]),c.extend(ne[D]);s.push(ne)}else for(D=0;D<E;D++)this._projectLatlngs(t[D],s,c)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}var s=this._parts,c,p,E,D,ne,he,ye;for(c=0,E=0,D=this._rings.length;c<D;c++)for(ye=this._rings[c],p=0,ne=ye.length;p<ne-1;p++)he=Iu(ye[p],ye[p+1],t,p,!0),he&&(s[E]=s[E]||[],s[E].push(he[0]),(he[1]!==ye[p+1]||p===ne-2)&&(s[E].push(he[1]),E++))}},_simplifyPoints:function(){for(var t=this._parts,s=this.options.smoothFactor,c=0,p=t.length;c<p;c++)t[c]=Su(t[c],s)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,s){var c,p,E,D,ne,he,ye=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(c=0,D=this._parts.length;c<D;c++)for(he=this._parts[c],p=0,ne=he.length,E=ne-1;p<ne;E=p++)if(!(!s&&p===0)&&Tu(t,he[E],he[p])<=ye)return!0;return!1}});function ng(t,s){return new Tn(t,s)}Tn._flat=Au;var ki=Tn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Eu(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(t){var s=Tn.prototype._convertLatLngs.call(this,t),c=s.length;return c>=2&&s[0]instanceof Z&&s[0].equals(s[c-1])&&s.pop(),s},_setLatLngs:function(t){Tn.prototype._setLatLngs.call(this,t),Zt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Zt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,s=this.options.weight,c=new B(s,s);if(t=new Q(t.min.subtract(c),t.max.add(c)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(var p=0,E=this._rings.length,D;p<E;p++)D=xu(this._rings[p],t,!0),D.length&&this._parts.push(D)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var s=!1,c,p,E,D,ne,he,ye,Le;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(D=0,ye=this._parts.length;D<ye;D++)for(c=this._parts[D],ne=0,Le=c.length,he=Le-1;ne<Le;he=ne++)p=c[ne],E=c[he],p.y>t.y!=E.y>t.y&&t.x<(E.x-p.x)*(t.y-p.y)/(E.y-p.y)+p.x&&(s=!s);return s||Tn.prototype._containsPoint.call(this,t,!0)}});function ig(t,s){return new ki(t,s)}var Ln=Sn.extend({initialize:function(t,s){I(this,s),this._layers={},t&&this.addData(t)},addData:function(t){var s=w(t)?t:t.features,c,p,E;if(s){for(c=0,p=s.length;c<p;c++)E=s[c],(E.geometries||E.geometry||E.features||E.coordinates)&&this.addData(E);return this}var D=this.options;if(D.filter&&!D.filter(t))return this;var ne=ls(t,D);return ne?(ne.feature=ds(t),ne.defaultOptions=ne.options,this.resetStyle(ne),D.onEachFeature&&D.onEachFeature(t,ne),this.addLayer(ne)):this},resetStyle:function(t){return t===void 0?this.eachLayer(this.resetStyle,this):(t.options=o({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer(function(s){this._setLayerStyle(s,t)},this)},_setLayerStyle:function(t,s){t.setStyle&&(typeof s=="function"&&(s=s(t.feature)),t.setStyle(s))}});function ls(t,s){var c=t.type==="Feature"?t.geometry:t,p=c?c.coordinates:null,E=[],D=s&&s.pointToLayer,ne=s&&s.coordsToLatLng||Co,he,ye,Le,Ce;if(!p&&!c)return null;switch(c.type){case"Point":return he=ne(p),Pu(D,t,he,s);case"MultiPoint":for(Le=0,Ce=p.length;Le<Ce;Le++)he=ne(p[Le]),E.push(Pu(D,t,he,s));return new Sn(E);case"LineString":case"MultiLineString":return ye=us(p,c.type==="LineString"?0:1,ne),new Tn(ye,s);case"Polygon":case"MultiPolygon":return ye=us(p,c.type==="Polygon"?1:2,ne),new ki(ye,s);case"GeometryCollection":for(Le=0,Ce=c.geometries.length;Le<Ce;Le++){var je=ls({geometry:c.geometries[Le],type:"Feature",properties:t.properties},s);je&&E.push(je)}return new Sn(E);case"FeatureCollection":for(Le=0,Ce=c.features.length;Le<Ce;Le++){var Ve=ls(c.features[Le],s);Ve&&E.push(Ve)}return new Sn(E);default:throw new Error("Invalid GeoJSON object.")}}function Pu(t,s,c,p){return t?t(s,c):new os(c,p&&p.markersInheritOptions&&p)}function Co(t){return new Z(t[1],t[0],t[2])}function us(t,s,c){for(var p=[],E=0,D=t.length,ne;E<D;E++)ne=s?us(t[E],s-1,c):(c||Co)(t[E]),p.push(ne);return p}function Po(t,s){return t=W(t),t.alt!==void 0?[d(t.lng,s),d(t.lat,s),d(t.alt,s)]:[d(t.lng,s),d(t.lat,s)]}function cs(t,s,c,p){for(var E=[],D=0,ne=t.length;D<ne;D++)E.push(s?cs(t[D],Zt(t[D])?0:s-1,c,p):Po(t[D],p));return!s&&c&&E.length>0&&E.push(E[0].slice()),E}function Di(t,s){return t.feature?o({},t.feature,{geometry:s}):ds(s)}function ds(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var ko={toGeoJSON:function(t){return Di(this,{type:"Point",coordinates:Po(this.getLatLng(),t)})}};os.include(ko),Ro.include(ko),as.include(ko),Tn.include({toGeoJSON:function(t){var s=!Zt(this._latlngs),c=cs(this._latlngs,s?1:0,!1,t);return Di(this,{type:(s?"Multi":"")+"LineString",coordinates:c})}}),ki.include({toGeoJSON:function(t){var s=!Zt(this._latlngs),c=s&&!Zt(this._latlngs[0]),p=cs(this._latlngs,c?2:s?1:0,!0,t);return s||(p=[p]),Di(this,{type:(c?"Multi":"")+"Polygon",coordinates:p})}}),Ci.include({toMultiPoint:function(t){var s=[];return this.eachLayer(function(c){s.push(c.toGeoJSON(t).geometry.coordinates)}),Di(this,{type:"MultiPoint",coordinates:s})},toGeoJSON:function(t){var s=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(s==="MultiPoint")return this.toMultiPoint(t);var c=s==="GeometryCollection",p=[];return this.eachLayer(function(E){if(E.toGeoJSON){var D=E.toGeoJSON(t);if(c)p.push(D.geometry);else{var ne=ds(D);ne.type==="FeatureCollection"?p.push.apply(p,ne.features):p.push(ne)}}}),c?Di(this,{geometries:p,type:"GeometryCollection"}):{type:"FeatureCollection",features:p}}});function ku(t,s){return new Ln(t,s)}var rg=ku,hs=rn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,s,c){this._url=t,this._bounds=me(s),I(this,c)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(He(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ut(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&Ni(this._image),this},bringToBack:function(){return this._map&&Ri(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=me(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._url.tagName==="IMG",s=this._image=t?this._url:Ke("img");if(He(s,"leaflet-image-layer"),this._zoomAnimated&&He(s,"leaflet-zoom-animated"),this.options.className&&He(s,this.options.className),s.onselectstart=m,s.onmousemove=m,s.onload=l(this.fire,this,"load"),s.onerror=l(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(s.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=s.src;return}s.src=this._url,s.alt=this.options.alt},_animateZoom:function(t){var s=this._map.getZoomScale(t.zoom),c=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;ii(this._image,c,s)},_reset:function(){var t=this._image,s=new Q(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),c=s.getSize();yt(t,s.min),t.style.width=c.x+"px",t.style.height=c.y+"px"},_updateOpacity:function(){Gt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),sg=function(t,s,c){return new hs(t,s,c)},Du=hs.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t=this._url.tagName==="VIDEO",s=this._image=t?this._url:Ke("video");if(He(s,"leaflet-image-layer"),this._zoomAnimated&&He(s,"leaflet-zoom-animated"),this.options.className&&He(s,this.options.className),s.onselectstart=m,s.onmousemove=m,s.onloadeddata=l(this.fire,this,"load"),t){for(var c=s.getElementsByTagName("source"),p=[],E=0;E<c.length;E++)p.push(c[E].src);this._url=c.length>0?p:[s.src];return}w(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(s.style,"objectFit")&&(s.style.objectFit="fill"),s.autoplay=!!this.options.autoplay,s.loop=!!this.options.loop,s.muted=!!this.options.muted,s.playsInline=!!this.options.playsInline;for(var D=0;D<this._url.length;D++){var ne=Ke("source");ne.src=this._url[D],s.appendChild(ne)}}});function og(t,s,c){return new Du(t,s,c)}var Mu=hs.extend({_initImage:function(){var t=this._image=this._url;He(t,"leaflet-image-layer"),this._zoomAnimated&&He(t,"leaflet-zoom-animated"),this.options.className&&He(t,this.options.className),t.onselectstart=m,t.onmousemove=m}});function ag(t,s,c){return new Mu(t,s,c)}var mn=rn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,s){t&&(t instanceof Z||w(t))?(this._latlng=W(t),I(this,s)):(I(this,t),this._source=s),this.options.content&&(this._content=this.options.content)},openOn:function(t){return t=arguments.length?t:this._source._map,t.hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&Gt(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&Gt(this._container,1),this.bringToFront(),this.options.interactive&&(He(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(Gt(this._container,0),this._removeTimeout=setTimeout(l(ut,void 0,this._container),200)):ut(this._container),this.options.interactive&&(pt(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=W(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Ni(this._container),this},bringToBack:function(){return this._map&&Ri(this._container),this},_prepareOpen:function(t){var s=this._source;if(!s._map)return!1;if(s instanceof Sn){s=null;var c=this._source._layers;for(var p in c)if(c[p]._map){s=c[p];break}if(!s)return!1;this._source=s}if(!t)if(s.getCenter)t=s.getCenter();else if(s.getLatLng)t=s.getLatLng();else if(s.getBounds)t=s.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,s=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof s=="string")t.innerHTML=s;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(s)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),s=T(this.options.offset),c=this._getAnchor();this._zoomAnimated?yt(this._container,t.add(c)):s=s.add(t).add(c);var p=this._containerBottom=-s.y,E=this._containerLeft=-Math.round(this._containerWidth/2)+s.x;this._container.style.bottom=p+"px",this._container.style.left=E+"px"}},_getAnchor:function(){return[0,0]}});Xe.include({_initOverlay:function(t,s,c,p){var E=s;return E instanceof t||(E=new t(p).setContent(s)),c&&E.setLatLng(c),E}}),rn.include({_initOverlay:function(t,s,c,p){var E=c;return E instanceof t?(I(E,p),E._source=this):(E=s&&!p?s:new t(p,this),E.setContent(c)),E}});var fs=mn.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t=arguments.length?t:this._source._map,!t.hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,mn.prototype.openOn.call(this,t)},onAdd:function(t){mn.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof zn||this._source.on("preclick",si))},onRemove:function(t){mn.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof zn||this._source.off("preclick",si))},getEvents:function(){var t=mn.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",s=this._container=Ke("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),c=this._wrapper=Ke("div",t+"-content-wrapper",s);if(this._contentNode=Ke("div",t+"-content",c),or(s),xo(this._contentNode),ze(s,"contextmenu",si),this._tipContainer=Ke("div",t+"-tip-container",s),this._tip=Ke("div",t+"-tip",this._tipContainer),this.options.closeButton){var p=this._closeButton=Ke("a",t+"-close-button",s);p.setAttribute("role","button"),p.setAttribute("aria-label","Close popup"),p.href="#close",p.innerHTML='<span aria-hidden="true">×</span>',ze(p,"click",function(E){St(E),this.close()},this)}},_updateLayout:function(){var t=this._contentNode,s=t.style;s.width="",s.whiteSpace="nowrap";var c=t.offsetWidth;c=Math.min(c,this.options.maxWidth),c=Math.max(c,this.options.minWidth),s.width=c+1+"px",s.whiteSpace="",s.height="";var p=t.offsetHeight,E=this.options.maxHeight,D="leaflet-popup-scrolled";E&&p>E?(s.height=E+"px",He(t,D)):pt(t,D),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var s=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),c=this._getAnchor();yt(this._container,s.add(c))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,s=parseInt(nr(this._container,"marginBottom"),10)||0,c=this._container.offsetHeight+s,p=this._containerWidth,E=new B(this._containerLeft,-c-this._containerBottom);E._add(ri(this._container));var D=t.layerPointToContainerPoint(E),ne=T(this.options.autoPanPadding),he=T(this.options.autoPanPaddingTopLeft||ne),ye=T(this.options.autoPanPaddingBottomRight||ne),Le=t.getSize(),Ce=0,je=0;D.x+p+ye.x>Le.x&&(Ce=D.x+p-Le.x+ye.x),D.x-Ce-he.x<0&&(Ce=D.x-he.x),D.y+c+ye.y>Le.y&&(je=D.y+c-Le.y+ye.y),D.y-je-he.y<0&&(je=D.y-he.y),(Ce||je)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([Ce,je]))}},_getAnchor:function(){return T(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),lg=function(t,s){return new fs(t,s)};Xe.mergeOptions({closePopupOnClick:!0}),Xe.include({openPopup:function(t,s,c){return this._initOverlay(fs,t,s,c).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),rn.include({bindPopup:function(t,s){return this._popup=this._initOverlay(fs,this._popup,t,s),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Sn||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(!(!this._popup||!this._map)){oi(t);var s=t.layer||t.target;if(this._popup._source===s&&!(s instanceof zn)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng);return}this._popup._source=s,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){t.originalEvent.keyCode===13&&this._openPopup(t)}});var ps=mn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){mn.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){mn.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=mn.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip",s=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Ke("div",s),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+f(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var s,c,p=this._map,E=this._container,D=p.latLngToContainerPoint(p.getCenter()),ne=p.layerPointToContainerPoint(t),he=this.options.direction,ye=E.offsetWidth,Le=E.offsetHeight,Ce=T(this.options.offset),je=this._getAnchor();he==="top"?(s=ye/2,c=Le):he==="bottom"?(s=ye/2,c=0):he==="center"?(s=ye/2,c=Le/2):he==="right"?(s=0,c=Le/2):he==="left"?(s=ye,c=Le/2):ne.x<D.x?(he="right",s=0,c=Le/2):(he="left",s=ye+(Ce.x+je.x)*2,c=Le/2),t=t.subtract(T(s,c,!0)).add(Ce).add(je),pt(E,"leaflet-tooltip-right"),pt(E,"leaflet-tooltip-left"),pt(E,"leaflet-tooltip-top"),pt(E,"leaflet-tooltip-bottom"),He(E,"leaflet-tooltip-"+he),yt(E,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&Gt(this._container,t)},_animateZoom:function(t){var s=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(s)},_getAnchor:function(){return T(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),ug=function(t,s){return new ps(t,s)};Xe.include({openTooltip:function(t,s,c){return this._initOverlay(ps,t,s,c).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),rn.include({bindTooltip:function(t,s){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(ps,this._tooltip,t,s),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(!(!t&&this._tooltipHandlersAdded)){var s=t?"off":"on",c={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?c.add=this._openTooltip:(c.mouseover=this._openTooltip,c.mouseout=this.closeTooltip,c.click=this._openTooltip,this._map?this._addFocusListeners():c.add=this._addFocusListeners),this._tooltip.options.sticky&&(c.mousemove=this._moveTooltip),this[s](c),this._tooltipHandlersAdded=!t}},openTooltip:function(t){return this._tooltip&&(this instanceof Sn||(this._tooltip._source=this),this._tooltip._prepareOpen(t)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var s=typeof t.getElement=="function"&&t.getElement();s&&(ze(s,"focus",function(){this._tooltip._source=t,this.openTooltip()},this),ze(s,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){var s=typeof t.getElement=="function"&&t.getElement();s&&s.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var s=this;this._map.once("moveend",function(){s._openOnceFlag=!1,s._openTooltip(t)});return}this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0)}},_moveTooltip:function(t){var s=t.latlng,c,p;this._tooltip.options.sticky&&t.originalEvent&&(c=this._map.mouseEventToContainerPoint(t.originalEvent),p=this._map.containerPointToLayerPoint(c),s=this._map.layerPointToLatLng(p)),this._tooltip.setLatLng(s)}});var Ou=Pi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var s=t&&t.tagName==="DIV"?t:document.createElement("div"),c=this.options;if(c.html instanceof Element?(es(s),s.appendChild(c.html)):s.innerHTML=c.html!==!1?c.html:"",c.bgPos){var p=T(c.bgPos);s.style.backgroundPosition=-p.x+"px "+-p.y+"px"}return this._setIconStyles(s,"icon"),s},createShadow:function(){return null}});function cg(t){return new Ou(t)}Pi.Default=ur;var cr=rn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:ke.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){I(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ut(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Ni(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Ri(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var t=this._clampZoom(this._map.getZoom());t!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()}return this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=h(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof B?t:new B(t,t)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var s=this.getPane().children,c=-t(-1/0,1/0),p=0,E=s.length,D;p<E;p++)D=s[p].style.zIndex,s[p]!==this._container&&D&&(c=t(c,+D));isFinite(c)&&(this.options.zIndex=c+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!ke.ielt9){Gt(this._container,this.options.opacity);var t=+new Date,s=!1,c=!1;for(var p in this._tiles){var E=this._tiles[p];if(!(!E.current||!E.loaded)){var D=Math.min(1,(t-E.loaded)/200);Gt(E.el,D),D<1?s=!0:(E.active?c=!0:this._onOpaqueTile(E),E.active=!0)}}c&&!this._noPrune&&this._pruneTiles(),s&&(G(this._fadeFrame),this._fadeFrame=$(this._updateOpacity,this))}},_onOpaqueTile:m,_initContainer:function(){this._container||(this._container=Ke("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,s=this.options.maxZoom;if(t!==void 0){for(var c in this._levels)c=Number(c),this._levels[c].el.children.length||c===t?(this._levels[c].el.style.zIndex=s-Math.abs(t-c),this._onUpdateLevel(c)):(ut(this._levels[c].el),this._removeTilesAtZoom(c),this._onRemoveLevel(c),delete this._levels[c]);var p=this._levels[t],E=this._map;return p||(p=this._levels[t]={},p.el=Ke("div","leaflet-tile-container leaflet-zoom-animated",this._container),p.el.style.zIndex=s,p.origin=E.project(E.unproject(E.getPixelOrigin()),t).round(),p.zoom=t,this._setZoomTransform(p,E.getCenter(),E.getZoom()),m(p.el.offsetWidth),this._onCreateLevel(p)),this._level=p,p}},_onUpdateLevel:m,_onRemoveLevel:m,_onCreateLevel:m,_pruneTiles:function(){if(this._map){var t,s,c=this._map.getZoom();if(c>this.options.maxZoom||c<this.options.minZoom){this._removeAllTiles();return}for(t in this._tiles)s=this._tiles[t],s.retain=s.current;for(t in this._tiles)if(s=this._tiles[t],s.current&&!s.active){var p=s.coords;this._retainParent(p.x,p.y,p.z,p.z-5)||this._retainChildren(p.x,p.y,p.z,p.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}},_removeTilesAtZoom:function(t){for(var s in this._tiles)this._tiles[s].coords.z===t&&this._removeTile(s)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ut(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,s,c,p){var E=Math.floor(t/2),D=Math.floor(s/2),ne=c-1,he=new B(+E,+D);he.z=+ne;var ye=this._tileCoordsToKey(he),Le=this._tiles[ye];return Le&&Le.active?(Le.retain=!0,!0):(Le&&Le.loaded&&(Le.retain=!0),ne>p?this._retainParent(E,D,ne,p):!1)},_retainChildren:function(t,s,c,p){for(var E=2*t;E<2*t+2;E++)for(var D=2*s;D<2*s+2;D++){var ne=new B(E,D);ne.z=c+1;var he=this._tileCoordsToKey(ne),ye=this._tiles[he];if(ye&&ye.active){ye.retain=!0;continue}else ye&&ye.loaded&&(ye.retain=!0);c+1<p&&this._retainChildren(E,D,c+1,p)}},_resetView:function(t){var s=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),s,s)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var s=this.options;return s.minNativeZoom!==void 0&&t<s.minNativeZoom?s.minNativeZoom:s.maxNativeZoom!==void 0&&s.maxNativeZoom<t?s.maxNativeZoom:t},_setView:function(t,s,c,p){var E=Math.round(s);this.options.maxZoom!==void 0&&E>this.options.maxZoom||this.options.minZoom!==void 0&&E<this.options.minZoom?E=void 0:E=this._clampZoom(E);var D=this.options.updateWhenZooming&&E!==this._tileZoom;(!p||D)&&(this._tileZoom=E,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),E!==void 0&&this._update(t),c||this._pruneTiles(),this._noPrune=!!c),this._setZoomTransforms(t,s)},_setZoomTransforms:function(t,s){for(var c in this._levels)this._setZoomTransform(this._levels[c],t,s)},_setZoomTransform:function(t,s,c){var p=this._map.getZoomScale(c,t.zoom),E=t.origin.multiplyBy(p).subtract(this._map._getNewPixelOrigin(s,c)).round();ke.any3d?ii(t.el,E,p):yt(t.el,E)},_resetGrid:function(){var t=this._map,s=t.options.crs,c=this._tileSize=this.getTileSize(),p=this._tileZoom,E=this._map.getPixelWorldBounds(this._tileZoom);E&&(this._globalTileRange=this._pxBoundsToTileRange(E)),this._wrapX=s.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,s.wrapLng[0]],p).x/c.x),Math.ceil(t.project([0,s.wrapLng[1]],p).x/c.y)],this._wrapY=s.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([s.wrapLat[0],0],p).y/c.x),Math.ceil(t.project([s.wrapLat[1],0],p).y/c.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(t){var s=this._map,c=s._animatingZoom?Math.max(s._animateToZoom,s.getZoom()):s.getZoom(),p=s.getZoomScale(c,this._tileZoom),E=s.project(t,this._tileZoom).floor(),D=s.getSize().divideBy(p*2);return new Q(E.subtract(D),E.add(D))},_update:function(t){var s=this._map;if(s){var c=this._clampZoom(s.getZoom());if(t===void 0&&(t=s.getCenter()),this._tileZoom!==void 0){var p=this._getTiledPixelBounds(t),E=this._pxBoundsToTileRange(p),D=E.getCenter(),ne=[],he=this.options.keepBuffer,ye=new Q(E.getBottomLeft().subtract([he,-he]),E.getTopRight().add([he,-he]));if(!(isFinite(E.min.x)&&isFinite(E.min.y)&&isFinite(E.max.x)&&isFinite(E.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var Le in this._tiles){var Ce=this._tiles[Le].coords;(Ce.z!==this._tileZoom||!ye.contains(new B(Ce.x,Ce.y)))&&(this._tiles[Le].current=!1)}if(Math.abs(c-this._tileZoom)>1){this._setView(t,c);return}for(var je=E.min.y;je<=E.max.y;je++)for(var Ve=E.min.x;Ve<=E.max.x;Ve++){var Rt=new B(Ve,je);if(Rt.z=this._tileZoom,!!this._isValidTile(Rt)){var Et=this._tiles[this._tileCoordsToKey(Rt)];Et?Et.current=!0:ne.push(Rt)}}if(ne.sort(function(Ot,Oi){return Ot.distanceTo(D)-Oi.distanceTo(D)}),ne.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Xt=document.createDocumentFragment();for(Ve=0;Ve<ne.length;Ve++)this._addTile(ne[Ve],Xt);this._level.el.appendChild(Xt)}}}},_isValidTile:function(t){var s=this._map.options.crs;if(!s.infinite){var c=this._globalTileRange;if(!s.wrapLng&&(t.x<c.min.x||t.x>c.max.x)||!s.wrapLat&&(t.y<c.min.y||t.y>c.max.y))return!1}if(!this.options.bounds)return!0;var p=this._tileCoordsToBounds(t);return me(this.options.bounds).overlaps(p)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var s=this._map,c=this.getTileSize(),p=t.scaleBy(c),E=p.add(c),D=s.unproject(p,t.z),ne=s.unproject(E,t.z);return[D,ne]},_tileCoordsToBounds:function(t){var s=this._tileCoordsToNwSe(t),c=new Y(s[0],s[1]);return this.options.noWrap||(c=this._map.wrapLatLngBounds(c)),c},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var s=t.split(":"),c=new B(+s[0],+s[1]);return c.z=+s[2],c},_removeTile:function(t){var s=this._tiles[t];s&&(ut(s.el),delete this._tiles[t],this.fire("tileunload",{tile:s.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){He(t,"leaflet-tile");var s=this.getTileSize();t.style.width=s.x+"px",t.style.height=s.y+"px",t.onselectstart=m,t.onmousemove=m,ke.ielt9&&this.options.opacity<1&&Gt(t,this.options.opacity)},_addTile:function(t,s){var c=this._getTilePos(t),p=this._tileCoordsToKey(t),E=this.createTile(this._wrapCoords(t),l(this._tileReady,this,t));this._initTile(E),this.createTile.length<2&&$(l(this._tileReady,this,t,null,E)),yt(E,c),this._tiles[p]={el:E,coords:t,current:!0},s.appendChild(E),this.fire("tileloadstart",{tile:E,coords:t})},_tileReady:function(t,s,c){s&&this.fire("tileerror",{error:s,tile:c,coords:t});var p=this._tileCoordsToKey(t);c=this._tiles[p],c&&(c.loaded=+new Date,this._map._fadeAnimated?(Gt(c.el,0),G(this._fadeFrame),this._fadeFrame=$(this._updateOpacity,this)):(c.active=!0,this._pruneTiles()),s||(He(c.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:c.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ke.ielt9||!this._map._fadeAnimated?$(this._pruneTiles,this):setTimeout(l(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var s=new B(this._wrapX?g(t.x,this._wrapX):t.x,this._wrapY?g(t.y,this._wrapY):t.y);return s.z=t.z,s},_pxBoundsToTileRange:function(t){var s=this.getTileSize();return new Q(t.min.unscaleBy(s).floor(),t.max.unscaleBy(s).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function dg(t){return new cr(t)}var Mi=cr.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,s){this._url=t,s=I(this,s),s.detectRetina&&ke.retina&&s.maxZoom>0?(s.tileSize=Math.floor(s.tileSize/2),s.zoomReverse?(s.zoomOffset--,s.minZoom=Math.min(s.maxZoom,s.minZoom+1)):(s.zoomOffset++,s.maxZoom=Math.max(s.minZoom,s.maxZoom-1)),s.minZoom=Math.max(0,s.minZoom)):s.zoomReverse?s.minZoom=Math.min(s.maxZoom,s.minZoom):s.maxZoom=Math.max(s.minZoom,s.maxZoom),typeof s.subdomains=="string"&&(s.subdomains=s.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,s){return this._url===t&&s===void 0&&(s=!0),this._url=t,s||this.redraw(),this},createTile:function(t,s){var c=document.createElement("img");return ze(c,"load",l(this._tileOnLoad,this,s,c)),ze(c,"error",l(this._tileOnError,this,s,c)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(c.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(c.referrerPolicy=this.options.referrerPolicy),c.alt="",c.src=this.getTileUrl(t),c},getTileUrl:function(t){var s={r:ke.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var c=this._globalTileRange.max.y-t.y;this.options.tms&&(s.y=c),s["-y"]=c}return P(this._url,o(s,this.options))},_tileOnLoad:function(t,s){ke.ielt9?setTimeout(l(t,this,null,s),0):t(null,s)},_tileOnError:function(t,s,c){var p=this.options.errorTileUrl;p&&s.getAttribute("src")!==p&&(s.src=p),t(c,s)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,s=this.options.maxZoom,c=this.options.zoomReverse,p=this.options.zoomOffset;return c&&(t=s-t),t+p},_getSubdomain:function(t){var s=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[s]},_abortLoading:function(){var t,s;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&(s=this._tiles[t].el,s.onload=m,s.onerror=m,!s.complete)){s.src=S;var c=this._tiles[t].coords;ut(s),delete this._tiles[t],this.fire("tileabort",{tile:s,coords:c})}},_removeTile:function(t){var s=this._tiles[t];if(s)return s.el.setAttribute("src",S),cr.prototype._removeTile.call(this,t)},_tileReady:function(t,s,c){if(!(!this._map||c&&c.getAttribute("src")===S))return cr.prototype._tileReady.call(this,t,s,c)}});function Fu(t,s){return new Mi(t,s)}var ju=Mi.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,s){this._url=t;var c=o({},this.defaultWmsParams);for(var p in s)p in this.options||(c[p]=s[p]);s=I(this,s);var E=s.detectRetina&&ke.retina?2:1,D=this.getTileSize();c.width=D.x*E,c.height=D.y*E,this.wmsParams=c},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var s=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[s]=this._crs.code,Mi.prototype.onAdd.call(this,t)},getTileUrl:function(t){var s=this._tileCoordsToNwSe(t),c=this._crs,p=ie(c.project(s[0]),c.project(s[1])),E=p.min,D=p.max,ne=(this._wmsVersion>=1.3&&this._crs===Ru?[E.y,E.x,D.y,D.x]:[E.x,E.y,D.x,D.y]).join(","),he=Mi.prototype.getTileUrl.call(this,t);return he+A(this.wmsParams,he,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+ne},setParams:function(t,s){return o(this.wmsParams,t),s||this.redraw(),this}});function hg(t,s){return new ju(t,s)}Mi.WMS=ju,Fu.wms=hg;var In=rn.extend({options:{padding:.1},initialize:function(t){I(this,t),f(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),He(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,s){var c=this._map.getZoomScale(s,this._zoom),p=this._map.getSize().multiplyBy(.5+this.options.padding),E=this._map.project(this._center,s),D=p.multiplyBy(-c).add(E).subtract(this._map._getNewPixelOrigin(t,s));ke.any3d?ii(this._container,D,c):yt(this._container,D)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,s=this._map.getSize(),c=this._map.containerPointToLayerPoint(s.multiplyBy(-t)).round();this._bounds=new Q(c,c.add(s.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Bu=In.extend({options:{tolerance:0},getEvents:function(){var t=In.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){In.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");ze(t,"mousemove",this._onMouseMove,this),ze(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ze(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){G(this._redrawRequest),delete this._ctx,ut(this._container),rt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;this._redrawBounds=null;for(var s in this._layers)t=this._layers[s],t._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){In.prototype._update.call(this);var t=this._bounds,s=this._container,c=t.getSize(),p=ke.retina?2:1;yt(s,t.min),s.width=p*c.x,s.height=p*c.y,s.style.width=c.x+"px",s.style.height=c.y+"px",ke.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){In.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[f(t)]=t;var s=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=s),this._drawLast=s,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var s=t._order,c=s.next,p=s.prev;c?c.prev=p:this._drawLast=p,p?p.next=c:this._drawFirst=c,delete t._order,delete this._layers[f(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(typeof t.options.dashArray=="string"){var s=t.options.dashArray.split(/[, ]+/),c=[],p,E;for(E=0;E<s.length;E++){if(p=Number(s[E]),isNaN(p))return;c.push(p)}t.options._dashArray=c}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||$(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var s=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Q,this._redrawBounds.extend(t._pxBounds.min.subtract([s,s])),this._redrawBounds.extend(t._pxBounds.max.add([s,s]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var s=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,s.x,s.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,s=this._redrawBounds;if(this._ctx.save(),s){var c=s.getSize();this._ctx.beginPath(),this._ctx.rect(s.min.x,s.min.y,c.x,c.y),this._ctx.clip()}this._drawing=!0;for(var p=this._drawFirst;p;p=p.next)t=p.layer,(!s||t._pxBounds&&t._pxBounds.intersects(s))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,s){if(this._drawing){var c,p,E,D,ne=t._parts,he=ne.length,ye=this._ctx;if(he){for(ye.beginPath(),c=0;c<he;c++){for(p=0,E=ne[c].length;p<E;p++)D=ne[c][p],ye[p?"lineTo":"moveTo"](D.x,D.y);s&&ye.closePath()}this._fillStroke(ye,t)}}},_updateCircle:function(t){if(!(!this._drawing||t._empty())){var s=t._point,c=this._ctx,p=Math.max(Math.round(t._radius),1),E=(Math.max(Math.round(t._radiusY),1)||p)/p;E!==1&&(c.save(),c.scale(1,E)),c.beginPath(),c.arc(s.x,s.y/E,p,0,Math.PI*2,!1),E!==1&&c.restore(),this._fillStroke(c,t)}},_fillStroke:function(t,s){var c=s.options;c.fill&&(t.globalAlpha=c.fillOpacity,t.fillStyle=c.fillColor||c.color,t.fill(c.fillRule||"evenodd")),c.stroke&&c.weight!==0&&(t.setLineDash&&t.setLineDash(s.options&&s.options._dashArray||[]),t.globalAlpha=c.opacity,t.lineWidth=c.weight,t.strokeStyle=c.color,t.lineCap=c.lineCap,t.lineJoin=c.lineJoin,t.stroke())},_onClick:function(t){for(var s=this._map.mouseEventToLayerPoint(t),c,p,E=this._drawFirst;E;E=E.next)c=E.layer,c.options.interactive&&c._containsPoint(s)&&(!(t.type==="click"||t.type==="preclick")||!this._map._draggableMoved(c))&&(p=c);this._fireEvent(p?[p]:!1,t)},_onMouseMove:function(t){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var s=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,s)}},_handleMouseOut:function(t){var s=this._hoveredLayer;s&&(pt(this._container,"leaflet-interactive"),this._fireEvent([s],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,s){if(!this._mouseHoverThrottled){for(var c,p,E=this._drawFirst;E;E=E.next)c=E.layer,c.options.interactive&&c._containsPoint(s)&&(p=c);p!==this._hoveredLayer&&(this._handleMouseOut(t),p&&(He(this._container,"leaflet-interactive"),this._fireEvent([p],t,"mouseover"),this._hoveredLayer=p)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,t),this._mouseHoverThrottled=!0,setTimeout(l(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,s,c){this._map._fireDOMEvent(s,c||s.type,t)},_bringToFront:function(t){var s=t._order;if(s){var c=s.next,p=s.prev;if(c)c.prev=p;else return;p?p.next=c:c&&(this._drawFirst=c),s.prev=this._drawLast,this._drawLast.next=s,s.next=null,this._drawLast=s,this._requestRedraw(t)}},_bringToBack:function(t){var s=t._order;if(s){var c=s.next,p=s.prev;if(p)p.next=c;else return;c?c.prev=p:p&&(this._drawLast=p),s.prev=null,s.next=this._drawFirst,this._drawFirst.prev=s,this._drawFirst=s,this._requestRedraw(t)}}});function $u(t){return ke.canvas?new Bu(t):null}var dr=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch{}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),fg={_initContainer:function(){this._container=Ke("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(In.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var s=t._container=dr("shape");He(s,"leaflet-vml-shape "+(this.options.className||"")),s.coordsize="1 1",t._path=dr("path"),s.appendChild(t._path),this._updateStyle(t),this._layers[f(t)]=t},_addPath:function(t){var s=t._container;this._container.appendChild(s),t.options.interactive&&t.addInteractiveTarget(s)},_removePath:function(t){var s=t._container;ut(s),t.removeInteractiveTarget(s),delete this._layers[f(t)]},_updateStyle:function(t){var s=t._stroke,c=t._fill,p=t.options,E=t._container;E.stroked=!!p.stroke,E.filled=!!p.fill,p.stroke?(s||(s=t._stroke=dr("stroke")),E.appendChild(s),s.weight=p.weight+"px",s.color=p.color,s.opacity=p.opacity,p.dashArray?s.dashStyle=w(p.dashArray)?p.dashArray.join(" "):p.dashArray.replace(/( *, *)/g," "):s.dashStyle="",s.endcap=p.lineCap.replace("butt","flat"),s.joinstyle=p.lineJoin):s&&(E.removeChild(s),t._stroke=null),p.fill?(c||(c=t._fill=dr("fill")),E.appendChild(c),c.color=p.fillColor||p.color,c.opacity=p.fillOpacity):c&&(E.removeChild(c),t._fill=null)},_updateCircle:function(t){var s=t._point.round(),c=Math.round(t._radius),p=Math.round(t._radiusY||c);this._setPath(t,t._empty()?"M0 0":"AL "+s.x+","+s.y+" "+c+","+p+" 0,"+65535*360)},_setPath:function(t,s){t._path.v=s},_bringToFront:function(t){Ni(t._container)},_bringToBack:function(t){Ri(t._container)}},gs=ke.vml?dr:fe,hr=In.extend({_initContainer:function(){this._container=gs("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=gs("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ut(this._container),rt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){In.prototype._update.call(this);var t=this._bounds,s=t.getSize(),c=this._container;(!this._svgSize||!this._svgSize.equals(s))&&(this._svgSize=s,c.setAttribute("width",s.x),c.setAttribute("height",s.y)),yt(c,t.min),c.setAttribute("viewBox",[t.min.x,t.min.y,s.x,s.y].join(" ")),this.fire("update")}},_initPath:function(t){var s=t._path=gs("path");t.options.className&&He(s,t.options.className),t.options.interactive&&He(s,"leaflet-interactive"),this._updateStyle(t),this._layers[f(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ut(t._path),t.removeInteractiveTarget(t._path),delete this._layers[f(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var s=t._path,c=t.options;s&&(c.stroke?(s.setAttribute("stroke",c.color),s.setAttribute("stroke-opacity",c.opacity),s.setAttribute("stroke-width",c.weight),s.setAttribute("stroke-linecap",c.lineCap),s.setAttribute("stroke-linejoin",c.lineJoin),c.dashArray?s.setAttribute("stroke-dasharray",c.dashArray):s.removeAttribute("stroke-dasharray"),c.dashOffset?s.setAttribute("stroke-dashoffset",c.dashOffset):s.removeAttribute("stroke-dashoffset")):s.setAttribute("stroke","none"),c.fill?(s.setAttribute("fill",c.fillColor||c.color),s.setAttribute("fill-opacity",c.fillOpacity),s.setAttribute("fill-rule",c.fillRule||"evenodd")):s.setAttribute("fill","none"))},_updatePoly:function(t,s){this._setPath(t,xe(t._parts,s))},_updateCircle:function(t){var s=t._point,c=Math.max(Math.round(t._radius),1),p=Math.max(Math.round(t._radiusY),1)||c,E="a"+c+","+p+" 0 1,0 ",D=t._empty()?"M0 0":"M"+(s.x-c)+","+s.y+E+c*2+",0 "+E+-c*2+",0 ";this._setPath(t,D)},_setPath:function(t,s){t._path.setAttribute("d",s)},_bringToFront:function(t){Ni(t._path)},_bringToBack:function(t){Ri(t._path)}});ke.vml&&hr.include(fg);function qu(t){return ke.svg||ke.vml?new hr(t):null}Xe.include({getRenderer:function(t){var s=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return s||(s=this._renderer=this._createRenderer()),this.hasLayer(s)||this.addLayer(s),s},_getPaneRenderer:function(t){if(t==="overlayPane"||t===void 0)return!1;var s=this._paneRenderers[t];return s===void 0&&(s=this._createRenderer({pane:t}),this._paneRenderers[t]=s),s},_createRenderer:function(t){return this.options.preferCanvas&&$u(t)||qu(t)}});var zu=ki.extend({initialize:function(t,s){ki.prototype.initialize.call(this,this._boundsToLatLngs(t),s)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=me(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function pg(t,s){return new zu(t,s)}hr.create=gs,hr.pointsToPath=xe,Ln.geometryToLayer=ls,Ln.coordsToLatLng=Co,Ln.coordsToLatLngs=us,Ln.latLngToCoords=Po,Ln.latLngsToCoords=cs,Ln.getFeature=Di,Ln.asFeature=ds,Xe.mergeOptions({boxZoom:!0});var Hu=gn.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){ze(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){rt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ut(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||t.which!==1&&t.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),ir(),po(),this._startPoint=this._map.mouseEventToContainerPoint(t),ze(document,{contextmenu:oi,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=Ke("div","leaflet-zoom-box",this._container),He(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var s=new Q(this._point,this._startPoint),c=s.getSize();yt(this._box,s.min),this._box.style.width=c.x+"px",this._box.style.height=c.y+"px"},_finish:function(){this._moved&&(ut(this._box),pt(this._container,"leaflet-crosshair")),rr(),go(),rt(document,{contextmenu:oi,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if(!(t.which!==1&&t.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(l(this._resetState,this),0);var s=new Y(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(s).fire("boxzoomend",{boxZoomBounds:s})}},_onKeyDown:function(t){t.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Xe.addInitHook("addHandler","boxZoom",Hu),Xe.mergeOptions({doubleClickZoom:!0});var Uu=gn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var s=this._map,c=s.getZoom(),p=s.options.zoomDelta,E=t.originalEvent.shiftKey?c-p:c+p;s.options.doubleClickZoom==="center"?s.setZoom(E):s.setZoomAround(t.containerPoint,E)}});Xe.addInitHook("addHandler","doubleClickZoom",Uu),Xe.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Vu=gn.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new qn(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}He(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){pt(this._map._container,"leaflet-grab"),pt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var s=me(this._map.options.maxBounds);this._offsetLimit=ie(this._map.latLngToContainerPoint(s.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(s.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var s=this._lastTime=+new Date,c=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(c),this._times.push(s),this._prunePositions(s)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),s=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=s.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,s){return t-(t-s)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var t=this._draggable._newPos.subtract(this._draggable._startPos),s=this._offsetLimit;t.x<s.min.x&&(t.x=this._viscousLimit(t.x,s.min.x)),t.y<s.min.y&&(t.y=this._viscousLimit(t.y,s.min.y)),t.x>s.max.x&&(t.x=this._viscousLimit(t.x,s.max.x)),t.y>s.max.y&&(t.y=this._viscousLimit(t.y,s.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,s=Math.round(t/2),c=this._initialWorldOffset,p=this._draggable._newPos.x,E=(p-s+c)%t+s-c,D=(p+s+c)%t-s-c,ne=Math.abs(E+c)<Math.abs(D+c)?E:D;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=ne},_onDragEnd:function(t){var s=this._map,c=s.options,p=!c.inertia||t.noInertia||this._times.length<2;if(s.fire("dragend",t),p)s.fire("moveend");else{this._prunePositions(+new Date);var E=this._lastPos.subtract(this._positions[0]),D=(this._lastTime-this._times[0])/1e3,ne=c.easeLinearity,he=E.multiplyBy(ne/D),ye=he.distanceTo([0,0]),Le=Math.min(c.inertiaMaxSpeed,ye),Ce=he.multiplyBy(Le/ye),je=Le/(c.inertiaDeceleration*ne),Ve=Ce.multiplyBy(-je/2).round();!Ve.x&&!Ve.y?s.fire("moveend"):(Ve=s._limitOffset(Ve,s.options.maxBounds),$(function(){s.panBy(Ve,{duration:je,easeLinearity:ne,noMoveStart:!0,animate:!0})}))}}});Xe.addInitHook("addHandler","dragging",Vu),Xe.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Wu=gn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),ze(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),rt(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,s=document.documentElement,c=t.scrollTop||s.scrollTop,p=t.scrollLeft||s.scrollLeft;this._map._container.focus(),window.scrollTo(p,c)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var s=this._panKeys={},c=this.keyCodes,p,E;for(p=0,E=c.left.length;p<E;p++)s[c.left[p]]=[-1*t,0];for(p=0,E=c.right.length;p<E;p++)s[c.right[p]]=[t,0];for(p=0,E=c.down.length;p<E;p++)s[c.down[p]]=[0,t];for(p=0,E=c.up.length;p<E;p++)s[c.up[p]]=[0,-1*t]},_setZoomDelta:function(t){var s=this._zoomKeys={},c=this.keyCodes,p,E;for(p=0,E=c.zoomIn.length;p<E;p++)s[c.zoomIn[p]]=t;for(p=0,E=c.zoomOut.length;p<E;p++)s[c.zoomOut[p]]=-t},_addHooks:function(){ze(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){rt(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var s=t.keyCode,c=this._map,p;if(s in this._panKeys){if(!c._panAnim||!c._panAnim._inProgress)if(p=this._panKeys[s],t.shiftKey&&(p=T(p).multiplyBy(3)),c.options.maxBounds&&(p=c._limitOffset(T(p),c.options.maxBounds)),c.options.worldCopyJump){var E=c.wrapLatLng(c.unproject(c.project(c.getCenter()).add(p)));c.panTo(E)}else c.panBy(p)}else if(s in this._zoomKeys)c.setZoom(c.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[s]);else if(s===27&&c._popup&&c._popup.options.closeOnEscapeKey)c.closePopup();else return;oi(t)}}});Xe.addInitHook("addHandler","keyboard",Wu),Xe.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Gu=gn.extend({addHooks:function(){ze(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){rt(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var s=_u(t),c=this._map.options.wheelDebounceTime;this._delta+=s,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var p=Math.max(c-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(l(this._performZoom,this),p),oi(t)},_performZoom:function(){var t=this._map,s=t.getZoom(),c=this._map.options.zoomSnap||0;t._stop();var p=this._delta/(this._map.options.wheelPxPerZoomLevel*4),E=4*Math.log(2/(1+Math.exp(-Math.abs(p))))/Math.LN2,D=c?Math.ceil(E/c)*c:E,ne=t._limitZoom(s+(this._delta>0?D:-D))-s;this._delta=0,this._startTime=null,ne&&(t.options.scrollWheelZoom==="center"?t.setZoom(s+ne):t.setZoomAround(this._lastMousePos,s+ne))}});Xe.addInitHook("addHandler","scrollWheelZoom",Gu);var gg=600;Xe.mergeOptions({tapHold:ke.touchNative&&ke.safari&&ke.mobile,tapTolerance:15});var Zu=gn.extend({addHooks:function(){ze(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){rt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),t.touches.length===1){var s=t.touches[0];this._startPos=this._newPos=new B(s.clientX,s.clientY),this._holdTimeout=setTimeout(l(function(){this._cancel(),this._isTapValid()&&(ze(document,"touchend",St),ze(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",s))},this),gg),ze(document,"touchend touchcancel contextmenu",this._cancel,this),ze(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){rt(document,"touchend",St),rt(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),rt(document,"touchend touchcancel contextmenu",this._cancel,this),rt(document,"touchmove",this._onMove,this)},_onMove:function(t){var s=t.touches[0];this._newPos=new B(s.clientX,s.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,s){var c=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:s.screenX,screenY:s.screenY,clientX:s.clientX,clientY:s.clientY});c._simulated=!0,s.target.dispatchEvent(c)}});Xe.addInitHook("addHandler","tapHold",Zu),Xe.mergeOptions({touchZoom:ke.touch,bounceAtZoomLimits:!0});var Xu=gn.extend({addHooks:function(){He(this._map._container,"leaflet-touch-zoom"),ze(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){pt(this._map._container,"leaflet-touch-zoom"),rt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var s=this._map;if(!(!t.touches||t.touches.length!==2||s._animatingZoom||this._zooming)){var c=s.mouseEventToContainerPoint(t.touches[0]),p=s.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=s.getSize()._divideBy(2),this._startLatLng=s.containerPointToLatLng(this._centerPoint),s.options.touchZoom!=="center"&&(this._pinchStartLatLng=s.containerPointToLatLng(c.add(p)._divideBy(2))),this._startDist=c.distanceTo(p),this._startZoom=s.getZoom(),this._moved=!1,this._zooming=!0,s._stop(),ze(document,"touchmove",this._onTouchMove,this),ze(document,"touchend touchcancel",this._onTouchEnd,this),St(t)}},_onTouchMove:function(t){if(!(!t.touches||t.touches.length!==2||!this._zooming)){var s=this._map,c=s.mouseEventToContainerPoint(t.touches[0]),p=s.mouseEventToContainerPoint(t.touches[1]),E=c.distanceTo(p)/this._startDist;if(this._zoom=s.getScaleZoom(E,this._startZoom),!s.options.bounceAtZoomLimits&&(this._zoom<s.getMinZoom()&&E<1||this._zoom>s.getMaxZoom()&&E>1)&&(this._zoom=s._limitZoom(this._zoom)),s.options.touchZoom==="center"){if(this._center=this._startLatLng,E===1)return}else{var D=c._add(p)._divideBy(2)._subtract(this._centerPoint);if(E===1&&D.x===0&&D.y===0)return;this._center=s.unproject(s.project(this._pinchStartLatLng,this._zoom).subtract(D),this._zoom)}this._moved||(s._moveStart(!0,!1),this._moved=!0),G(this._animRequest);var ne=l(s._move,s,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=$(ne,this,!0),St(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,G(this._animRequest),rt(document,"touchmove",this._onTouchMove,this),rt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Xe.addInitHook("addHandler","touchZoom",Xu),Xe.BoxZoom=Hu,Xe.DoubleClickZoom=Uu,Xe.Drag=Vu,Xe.Keyboard=Wu,Xe.ScrollWheelZoom=Gu,Xe.TapHold=Zu,Xe.TouchZoom=Xu,n.Bounds=Q,n.Browser=ke,n.CRS=ee,n.Canvas=Bu,n.Circle=Ro,n.CircleMarker=as,n.Class=F,n.Control=nn,n.DivIcon=Ou,n.DivOverlay=mn,n.DomEvent=kp,n.DomUtil=Cp,n.Draggable=qn,n.Evented=re,n.FeatureGroup=Sn,n.GeoJSON=Ln,n.GridLayer=cr,n.Handler=gn,n.Icon=Pi,n.ImageOverlay=hs,n.LatLng=Z,n.LatLngBounds=Y,n.Layer=rn,n.LayerGroup=Ci,n.LineUtil=Wp,n.Map=Xe,n.Marker=os,n.Mixin=$p,n.Path=zn,n.Point=B,n.PolyUtil=qp,n.Polygon=ki,n.Polyline=Tn,n.Popup=fs,n.PosAnimation=yu,n.Projection=Gp,n.Rectangle=zu,n.Renderer=In,n.SVG=hr,n.SVGOverlay=Mu,n.TileLayer=Mi,n.Tooltip=ps,n.Transformation=Ee,n.Util=j,n.VideoOverlay=Du,n.bind=l,n.bounds=ie,n.canvas=$u,n.circle=tg,n.circleMarker=eg,n.control=ar,n.divIcon=cg,n.extend=o,n.featureGroup=Jp,n.geoJSON=ku,n.geoJson=rg,n.gridLayer=dg,n.icon=Kp,n.imageOverlay=sg,n.latLng=W,n.latLngBounds=me,n.layerGroup=Qp,n.map=Dp,n.marker=Yp,n.point=T,n.polygon=ig,n.polyline=ng,n.popup=lg,n.rectangle=pg,n.setOptions=I,n.stamp=f,n.svg=qu,n.svgOverlay=ag,n.tileLayer=Fu,n.tooltip=ug,n.transformation=Te,n.version=r,n.videoOverlay=og;var mg=window.L;n.noConflict=function(){return window.L=mg,this},window.L=n}))})(Br,Br.exports)),Br.exports}var Ft=cu(),yl={exports:{}},Xh;function O0(){return Xh||(Xh=1,(function(i,e){((n,r)=>{i.exports=n(cu()),typeof r<"u"&&r.L&&n(r.L)})(n=>{n.Editable=n.Evented.extend({statics:{FORWARD:1,BACKWARD:-1},options:{zIndex:1e3,polygonClass:n.Polygon,polylineClass:n.Polyline,markerClass:n.Marker,circleMarkerClass:n.CircleMarker,rectangleClass:n.Rectangle,circleClass:n.Circle,drawingCSSClass:"leaflet-editable-drawing",drawingCursor:"crosshair",editLayer:void 0,featuresLayer:void 0,polylineEditorClass:void 0,polygonEditorClass:void 0,markerEditorClass:void 0,circleMarkerEditorClass:void 0,rectangleEditorClass:void 0,circleEditorClass:void 0,lineGuideOptions:{},skipMiddleMarkers:!1},initialize:function(d,_){n.setOptions(this,_),this._lastZIndex=this.options.zIndex,this.map=d,this.editLayer=this.createEditLayer(),this.featuresLayer=this.createFeaturesLayer(),this.forwardLineGuide=this.createLineGuide(),this.backwardLineGuide=this.createLineGuide()},fireAndForward:function(d,_){_=_||{},_.editTools=this,this.fire(d,_),this.map.fire(d,_)},createLineGuide:function(){const d=n.extend({dashArray:"5,10",weight:1,interactive:!1},this.options.lineGuideOptions);return n.polyline([],d)},createVertexIcon:d=>n.Browser.mobile&&n.Browser.touch?new n.Editable.TouchVertexIcon(d):new n.Editable.VertexIcon(d),createEditLayer:function(){return this.options.editLayer||new n.LayerGroup().addTo(this.map)},createFeaturesLayer:function(){return this.options.featuresLayer||new n.LayerGroup().addTo(this.map)},moveForwardLineGuide:function(d){this.forwardLineGuide._latlngs.length&&(this.forwardLineGuide._latlngs[1]=d,this.forwardLineGuide._bounds.extend(d),this.forwardLineGuide.redraw())},moveBackwardLineGuide:function(d){this.backwardLineGuide._latlngs.length&&(this.backwardLineGuide._latlngs[1]=d,this.backwardLineGuide._bounds.extend(d),this.backwardLineGuide.redraw())},anchorForwardLineGuide:function(d){this.forwardLineGuide._latlngs[0]=d,this.forwardLineGuide._bounds.extend(d),this.forwardLineGuide.redraw()},anchorBackwardLineGuide:function(d){this.backwardLineGuide._latlngs[0]=d,this.backwardLineGuide._bounds.extend(d),this.backwardLineGuide.redraw()},attachForwardLineGuide:function(){this.editLayer.addLayer(this.forwardLineGuide)},attachBackwardLineGuide:function(){this.editLayer.addLayer(this.backwardLineGuide)},detachForwardLineGuide:function(){this.forwardLineGuide.setLatLngs([]),this.editLayer.removeLayer(this.forwardLineGuide)},detachBackwardLineGuide:function(){this.backwardLineGuide.setLatLngs([]),this.editLayer.removeLayer(this.backwardLineGuide)},blockEvents:function(){this._oldTargets||(this._oldTargets=this.map._targets,this.map._targets={})},unblockEvents:function(){this._oldTargets&&(this.map._targets=n.extend(this.map._targets,this._oldTargets),delete this._oldTargets)},registerForDrawing:function(d){this._drawingEditor&&this.unregisterForDrawing(this._drawingEditor),this.blockEvents(),d.reset(),this._drawingEditor=d,this.map.on("mousemove touchmove",d.onDrawingMouseMove,d),this.map.on("mousedown",this.onMousedown,this),this.map.on("mouseup",this.onMouseup,this),n.DomUtil.addClass(this.map._container,this.options.drawingCSSClass),this.defaultMapCursor=this.map._container.style.cursor,this.map._container.style.cursor=this.options.drawingCursor},unregisterForDrawing:function(d){this.unblockEvents(),n.DomUtil.removeClass(this.map._container,this.options.drawingCSSClass),this.map._container.style.cursor=this.defaultMapCursor,d=d||this._drawingEditor,d&&(this.map.off("mousemove touchmove",d.onDrawingMouseMove,d),this.map.off("mousedown",this.onMousedown,this),this.map.off("mouseup",this.onMouseup,this),d===this._drawingEditor&&(delete this._drawingEditor,d._drawing&&d.cancelDrawing()))},onMousedown:function(d){d.originalEvent.which==1&&(this._mouseDown=d,this._drawingEditor.onDrawingMouseDown(d))},onMouseup:function(d){if(this._mouseDown){const _=this._drawingEditor,v=this._mouseDown;if(this._mouseDown=null,_.onDrawingMouseUp(d),this._drawingEditor!==_)return;const I=n.point(v.originalEvent.clientX,v.originalEvent.clientY),A=n.point(d.originalEvent.clientX,d.originalEvent.clientY).distanceTo(I);Math.abs(A)<9*(window.devicePixelRatio||1)&&this._drawingEditor.onDrawingClick(d)}},drawing:function(){return this._drawingEditor?.drawing()},stopDrawing:function(){this.unregisterForDrawing()},commitDrawing:function(d){this._drawingEditor&&this._drawingEditor.commitDrawing(d)},connectCreatedToMap:function(d){return this.featuresLayer.addLayer(d)},startPolyline:function(d,_){const v=this.createPolyline([],_);return v.enableEdit(this.map).newShape(d),v},startPolygon:function(d,_){const v=this.createPolygon([],_);return v.enableEdit(this.map).newShape(d),v},startMarker:function(d,_){d=d||this.map.getCenter().clone();const v=this.createMarker(d,_);return v.enableEdit(this.map).startDrawing(),v},startCircleMarker:function(d,_){d=d||this.map.getCenter().clone();const v=this.createCircleMarker(d,_);return v.enableEdit(this.map).startDrawing(),v},startRectangle:function(d,_){const v=d||n.latLng([0,0]),I=new n.LatLngBounds(v,v),A=this.createRectangle(I,_);return A.enableEdit(this.map).startDrawing(),A},startCircle:function(d,_){d=d||this.map.getCenter().clone();const v=this.createCircle(d,_);return v.enableEdit(this.map).startDrawing(),v},startHole:(d,_)=>{d.newHole(_)},createLayer:function(d,_,v){v=n.Util.extend({editOptions:{editTools:this}},v);const I=new d(_,v);return this.fireAndForward("editable:created",{layer:I}),I},createPolyline:function(d,_){return this.createLayer(_?.polylineClass||this.options.polylineClass,d,_)},createPolygon:function(d,_){return this.createLayer(_?.polygonClass||this.options.polygonClass,d,_)},createMarker:function(d,_){return this.createLayer(_?.markerClass||this.options.markerClass,d,_)},createCircleMarker:function(d,_){return this.createLayer(_?.circleMarkerClass||this.options.circleMarkerClass,d,_)},createRectangle:function(d,_){return this.createLayer(_?.rectangleClass||this.options.rectangleClass,d,_)},createCircle:function(d,_){return this.createLayer(_?.circleClass||this.options.circleClass,d,_)}}),n.extend(n.Editable,{makeCancellable:d=>{d.cancel=()=>{d._cancelled=!0}}}),n.Map.mergeOptions({editToolsClass:n.Editable,editable:!1,editOptions:{}}),n.Map.addInitHook(function(){this.whenReady(function(){this.options.editable&&(this.editTools=new this.options.editToolsClass(this,this.options.editOptions))})}),n.Editable.VertexIcon=n.DivIcon.extend({options:{iconSize:new n.Point(8,8)}}),n.Editable.TouchVertexIcon=n.Editable.VertexIcon.extend({options:{iconSize:new n.Point(20,20)}}),n.Editable.VertexMarker=n.Marker.extend({options:{draggable:!0,className:"leaflet-div-icon leaflet-vertex-icon"},initialize:function(d,_,v,I){this.latlng=d,this.latlngs=_,this.editor=v,n.Marker.prototype.initialize.call(this,d,I),this.options.icon=this.editor.tools.createVertexIcon({className:this.options.className}),this.latlng.__vertex=this,this.connect(),this.setZIndexOffset(v.tools._lastZIndex+1)},connect:function(){this.editor.editLayer.addLayer(this)},onAdd:function(d){n.Marker.prototype.onAdd.call(this,d),this.on("drag",this.onDrag),this.on("dragstart",this.onDragStart),this.on("dragend",this.onDragEnd),this.on("mouseup",this.onMouseup),this.on("click",this.onClick),this.on("contextmenu",this.onContextMenu),this.on("mousedown touchstart",this.onMouseDown),this.on("mouseover",this.onMouseOver),this.on("mouseout",this.onMouseOut),this.addMiddleMarkers()},onRemove:function(d){this.middleMarker&&this.middleMarker.delete(),delete this.latlng.__vertex,this.off("drag",this.onDrag),this.off("dragstart",this.onDragStart),this.off("dragend",this.onDragEnd),this.off("mouseup",this.onMouseup),this.off("click",this.onClick),this.off("contextmenu",this.onContextMenu),this.off("mousedown touchstart",this.onMouseDown),this.off("mouseover",this.onMouseOver),this.off("mouseout",this.onMouseOut),n.Marker.prototype.onRemove.call(this,d)},onDrag:function(d){d.vertex=this,this.editor.onVertexMarkerDrag(d);const _=n.DomUtil.getPosition(this._icon),v=this._map.layerPointToLatLng(_);this.latlng.update(v),this._latlng=this.latlng,this.editor.refresh(),this.middleMarker&&this.middleMarker.updateLatLng();const I=this.getNext();I?.middleMarker&&I.middleMarker.updateLatLng()},onDragStart:function(d){d.vertex=this,this.editor.onVertexMarkerDragStart(d)},onDragEnd:function(d){d.vertex=this,this.editor.onVertexMarkerDragEnd(d)},onClick:function(d){d.vertex=this,this.editor.onVertexMarkerClick(d)},onMouseup:function(d){n.DomEvent.stop(d),d.vertex=this,this.editor.map.fire("mouseup",d)},onContextMenu:function(d){d.vertex=this,this.editor.onVertexMarkerContextMenu(d)},onMouseDown:function(d){d.vertex=this,this.editor.onVertexMarkerMouseDown(d)},onMouseOver:function(d){d.vertex=this,this.editor.onVertexMarkerMouseOver(d)},onMouseOut:function(d){d.vertex=this,this.editor.onVertexMarkerMouseOut(d)},delete:function(){const d=this.getNext();this.latlngs.splice(this.getIndex(),1),this.editor.editLayer.removeLayer(this),this.editor.onVertexDeleted({latlng:this.latlng,vertex:this}),this.latlngs.length||this.editor.deleteShape(this.latlngs),d&&d.resetMiddleMarker(),this.editor.refresh()},getIndex:function(){return this.latlngs.indexOf(this.latlng)},getLastIndex:function(){return this.latlngs.length-1},getPrevious:function(){if(this.latlngs.length<2)return;const d=this.getIndex();let _=d-1;d===0&&this.editor.CLOSED&&(_=this.getLastIndex());const v=this.latlngs[_];if(v)return v.__vertex},getNext:function(){if(this.latlngs.length<2)return;const d=this.getIndex();let _=d+1;d===this.getLastIndex()&&this.editor.CLOSED&&(_=0);const v=this.latlngs[_];if(v)return v.__vertex},addMiddleMarker:function(d){this.editor.hasMiddleMarkers()&&(d=d||this.getPrevious(),d&&!this.middleMarker&&(this.middleMarker=this.editor.addMiddleMarker(d,this,this.latlngs,this.editor)))},addMiddleMarkers:function(){if(!this.editor.hasMiddleMarkers())return;const d=this.getPrevious();d&&this.addMiddleMarker(d);const _=this.getNext();_&&_.resetMiddleMarker()},resetMiddleMarker:function(){this.middleMarker&&this.middleMarker.delete(),this.addMiddleMarker()},split:function(){this.editor.splitShape&&this.editor.splitShape(this.latlngs,this.getIndex())},continue:function(){if(!this.editor.continueBackward)return;const d=this.getIndex();d===0?this.editor.continueBackward(this.latlngs):d===this.getLastIndex()&&this.editor.continueForward(this.latlngs)}}),n.Editable.mergeOptions({vertexMarkerClass:n.Editable.VertexMarker}),n.Editable.MiddleMarker=n.Marker.extend({options:{opacity:.5,className:"leaflet-div-icon leaflet-middle-icon",draggable:!0},initialize:function(d,_,v,I,A){this.left=d,this.right=_,this.editor=I,this.latlngs=v,n.Marker.prototype.initialize.call(this,this.computeLatLng(),A),this._opacity=this.options.opacity,this.options.icon=this.editor.tools.createVertexIcon({className:this.options.className}),this.editor.editLayer.addLayer(this),this.setVisibility()},setVisibility:function(){const d=this._map.latLngToContainerPoint(this.left.latlng),_=this._map.latLngToContainerPoint(this.right.latlng),v=n.point(this.options.icon.options.iconSize);d.distanceTo(_)<v.x*3?this.hide():this.show()},show:function(){this.setOpacity(this._opacity)},hide:function(){this.setOpacity(0)},updateLatLng:function(){this.setLatLng(this.computeLatLng()),this.setVisibility()},computeLatLng:function(){const d=this.editor.map.latLngToContainerPoint(this.left.latlng),_=this.editor.map.latLngToContainerPoint(this.right.latlng),v=(d.y+_.y)/2,I=(d.x+_.x)/2;return this.editor.map.containerPointToLatLng([I,v])},onAdd:function(d){n.Marker.prototype.onAdd.call(this,d),n.DomEvent.on(this._icon,"mousedown touchstart",this.onMouseDown,this),d.on("zoomend",this.setVisibility,this)},onRemove:function(d){delete this.right.middleMarker,n.DomEvent.off(this._icon,"mousedown touchstart",this.onMouseDown,this),d.off("zoomend",this.setVisibility,this),n.Marker.prototype.onRemove.call(this,d)},onMouseDown:function(d){const _=n.DomUtil.getPosition(this._icon),v=this.editor.map.layerPointToLatLng(_);if(d={originalEvent:d,latlng:v},this.options.opacity===0||(n.Editable.makeCancellable(d),this.editor.onMiddleMarkerMouseDown(d),d._cancelled))return;this.latlngs.splice(this.index(),0,d.latlng),this.editor.refresh();const I=this._icon,A=this.editor.addVertexMarker(d.latlng,this.latlngs);this.editor.onNewVertex(A);const N=A._icon.parentNode;N.removeChild(A._icon),A._icon=I,N.appendChild(A._icon),A._initIcon(),A._initInteraction(),A.setOpacity(1),n.Draggable._dragging=!1,A.dragging._draggable._onDown(d.originalEvent),this.delete()},delete:function(){this.editor.editLayer.removeLayer(this)},index:function(){return this.latlngs.indexOf(this.right.latlng)}}),n.Editable.mergeOptions({middleMarkerClass:n.Editable.MiddleMarker}),n.Editable.BaseEditor=n.Handler.extend({initialize:function(d,_,v){n.setOptions(this,v),this.map=d,this.feature=_,this.feature.editor=this,this.editLayer=new n.LayerGroup,this.tools=this.options.editTools||d.editTools},addHooks:function(){this.isConnected()?this.onFeatureAdd():this.feature.once("add",this.onFeatureAdd,this),this.onEnable(),this.feature.on(this._getEvents(),this)},removeHooks:function(){this.feature.off(this._getEvents(),this),this.feature.dragging&&this.feature.dragging.disable(),this.editLayer.clearLayers(),this.tools.editLayer.removeLayer(this.editLayer),this.onDisable(),this._drawing&&this.cancelDrawing()},drawing:function(){return!!this._drawing},reset:()=>{},onFeatureAdd:function(){this.tools.editLayer.addLayer(this.editLayer),this.feature.dragging&&this.options.draggable!=!1&&this.feature.dragging.enable()},hasMiddleMarkers:function(){return!this.options.skipMiddleMarkers&&!this.tools.options.skipMiddleMarkers},fireAndForward:function(d,_){_=_||{},_.layer=this.feature,this.feature.fire(d,_),this.tools.fireAndForward(d,_)},onEnable:function(){this.fireAndForward("editable:enable")},onDisable:function(){this.fireAndForward("editable:disable")},onEditing:function(){this.fireAndForward("editable:editing")},onEdited:function(){this.fireAndForward("editable:edited")},onStartDrawing:function(){this.fireAndForward("editable:drawing:start")},onEndDrawing:function(){this.fireAndForward("editable:drawing:end")},onCancelDrawing:function(){this.fireAndForward("editable:drawing:cancel")},onCommitDrawing:function(d){this.fireAndForward("editable:drawing:commit",d),this.onEdited()},onDrawingMouseDown:function(d){this.fireAndForward("editable:drawing:mousedown",d)},onDrawingMouseUp:function(d){this.fireAndForward("editable:drawing:mouseup",d)},startDrawing:function(){this._drawing||(this._drawing=n.Editable.FORWARD),this.tools.registerForDrawing(this),this.onStartDrawing()},commitDrawing:function(d){this.onCommitDrawing(d),this.endDrawing()},cancelDrawing:function(){n.Draggable._dragging=!1,this.onCancelDrawing(),this.endDrawing()},endDrawing:function(){this._drawing=!1,this.tools.unregisterForDrawing(this),this.onEndDrawing()},onDrawingClick:function(d){this.drawing()&&(n.Editable.makeCancellable(d),this.fireAndForward("editable:drawing:click",d),!d._cancelled&&(this.isConnected()||this.connect(d),this.processDrawingClick(d)))},isConnected:function(){return this.map.hasLayer(this.feature)},connect:function(){this.tools.connectCreatedToMap(this.feature),this.tools.editLayer.addLayer(this.editLayer)},onMove:function(d){this.fireAndForward("editable:drawing:move",d)},onDrawingMouseMove:function(d){this.onMove(d)},_getEvents:function(){return{dragstart:this.onDragStart,drag:this.onDrag,dragend:this.onDragEnd,remove:this.disable}},onDragStart:function(d){this.onEditing(),this.fireAndForward("editable:dragstart",d)},onDrag:function(d){this.onMove(d),this.fireAndForward("editable:drag",d)},onDragEnd:function(d){this.fireAndForward("editable:dragend",d),this.onEdited()}}),n.Editable.MarkerEditor=n.Editable.BaseEditor.extend({onDrawingMouseMove:function(d){n.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,d),this._drawing&&this.feature.setLatLng(d.latlng)},processDrawingClick:function(d){this.fireAndForward("editable:drawing:clicked",d),this.commitDrawing(d)},connect:function(d){d&&(this.feature._latlng=d.latlng),n.Editable.BaseEditor.prototype.connect.call(this,d)}}),n.Editable.CircleMarkerEditor=n.Editable.BaseEditor.extend({onDrawingMouseMove:function(d){n.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,d),this._drawing&&this.feature.setLatLng(d.latlng)},processDrawingClick:function(d){this.fireAndForward("editable:drawing:clicked",d),this.commitDrawing(d)},connect:function(d){d&&(this.feature._latlng=d.latlng),n.Editable.BaseEditor.prototype.connect.call(this,d)}}),n.Editable.PathEditor=n.Editable.BaseEditor.extend({CLOSED:!1,MIN_VERTEX:2,addHooks:function(){return n.Editable.BaseEditor.prototype.addHooks.call(this),this.feature&&(this.initVertexMarkers(),this.map.on("moveend",this.onMoveEnd,this)),this},removeHooks:function(){n.Editable.BaseEditor.prototype.removeHooks.call(this),this.feature&&this.map.off("moveend",this.onMoveEnd,this)},onMoveEnd:function(){this.initVertexMarkers()},initVertexMarkers:function(d){if(this.enabled())if(d=d||this.getLatLngs(),m(d))this.addVertexMarkers(d);else for(const _ of d)this.initVertexMarkers(_)},getLatLngs:function(){return this.feature.getLatLngs()},reset:function(){this.editLayer.clearLayers(),this.initVertexMarkers()},addVertexMarker:function(d,_){return d.__vertex?(d.__vertex.connect(),d.__vertex):new this.tools.options.vertexMarkerClass(d,_,this)},onNewVertex:function(d){this.fireAndForward("editable:vertex:new",{latlng:d.latlng,vertex:d})},addVertexMarkers:function(d){const _=this.map.getBounds();for(const v of d)_.contains(v)&&this.addVertexMarker(v,d)},refreshVertexMarkers:function(d){d=d||this.getDefaultLatLngs();for(const _ of d)_.__vertex.update()},addMiddleMarker:function(d,_,v){return new this.tools.options.middleMarkerClass(d,_,v,this)},onVertexMarkerClick:function(d){if(n.Editable.makeCancellable(d),this.fireAndForward("editable:vertex:click",d),d._cancelled||this.tools.drawing()&&this.tools._drawingEditor!==this)return;const _=d.vertex.getIndex();let v;d.originalEvent.ctrlKey?this.onVertexMarkerCtrlClick(d):d.originalEvent.altKey?this.onVertexMarkerAltClick(d):d.originalEvent.shiftKey?this.onVertexMarkerShiftClick(d):d.originalEvent.metaKey?this.onVertexMarkerMetaKeyClick(d):_===d.vertex.getLastIndex()&&this._drawing===n.Editable.FORWARD?_>=this.MIN_VERTEX-1&&(v=!0):_===0&&this._drawing===n.Editable.BACKWARD&&this._drawnLatLngs.length>=this.MIN_VERTEX||_===0&&this._drawing===n.Editable.FORWARD&&this._drawnLatLngs.length>=this.MIN_VERTEX&&this.CLOSED?v=!0:this.onVertexRawMarkerClick(d),this.fireAndForward("editable:vertex:clicked",d),v&&this.commitDrawing(d)},onVertexRawMarkerClick:function(d){this.fireAndForward("editable:vertex:rawclick",d),!d._cancelled&&this.vertexCanBeDeleted(d.vertex)&&d.vertex.delete()},vertexCanBeDeleted:function(d){return d.latlngs.length>this.MIN_VERTEX},onVertexDeleted:function(d){this.fireAndForward("editable:vertex:deleted",d),this.onEdited()},onVertexMarkerCtrlClick:function(d){this.fireAndForward("editable:vertex:ctrlclick",d)},onVertexMarkerShiftClick:function(d){this.fireAndForward("editable:vertex:shiftclick",d)},onVertexMarkerMetaKeyClick:function(d){this.fireAndForward("editable:vertex:metakeyclick",d)},onVertexMarkerAltClick:function(d){this.fireAndForward("editable:vertex:altclick",d)},onVertexMarkerContextMenu:function(d){this.fireAndForward("editable:vertex:contextmenu",d)},onVertexMarkerMouseDown:function(d){this.fireAndForward("editable:vertex:mousedown",d)},onVertexMarkerMouseOver:function(d){this.fireAndForward("editable:vertex:mouseover",d)},onVertexMarkerMouseOut:function(d){this.fireAndForward("editable:vertex:mouseout",d)},onMiddleMarkerMouseDown:function(d){this.fireAndForward("editable:middlemarker:mousedown",d)},onVertexMarkerDrag:function(d){this.onMove(d),this.feature._bounds&&this.extendBounds(d),this.fireAndForward("editable:vertex:drag",d)},onVertexMarkerDragStart:function(d){this.fireAndForward("editable:vertex:dragstart",d)},onVertexMarkerDragEnd:function(d){this.fireAndForward("editable:vertex:dragend",d),this.onEdited()},setDrawnLatLngs:function(d){this._drawnLatLngs=d||this.getDefaultLatLngs()},startDrawing:function(){this._drawnLatLngs||this.setDrawnLatLngs(),n.Editable.BaseEditor.prototype.startDrawing.call(this)},startDrawingForward:function(){this.startDrawing()},endDrawing:function(){this.tools.detachForwardLineGuide(),this.tools.detachBackwardLineGuide(),this._drawnLatLngs&&this._drawnLatLngs.length<this.MIN_VERTEX&&this.deleteShape(this._drawnLatLngs),n.Editable.BaseEditor.prototype.endDrawing.call(this),delete this._drawnLatLngs},addLatLng:function(d){this._drawing===n.Editable.FORWARD?this._drawnLatLngs.push(d):this._drawnLatLngs.unshift(d),this.feature._bounds.extend(d);const _=this.addVertexMarker(d,this._drawnLatLngs);this.onNewVertex(_),this.refresh()},newPointForward:function(d){this.addLatLng(d),this.tools.attachForwardLineGuide(),this.tools.anchorForwardLineGuide(d)},newPointBackward:function(d){this.addLatLng(d),this.tools.anchorBackwardLineGuide(d)},push:function(d){if(!d)return console.error("L.Editable.PathEditor.push expect a valid latlng as parameter");this._drawing===n.Editable.FORWARD?this.newPointForward(d):this.newPointBackward(d)},removeLatLng:function(d){d.__vertex.delete(),this.refresh()},pop:function(){if(this._drawnLatLngs.length<=1)return;let d;return this._drawing===n.Editable.FORWARD?d=this._drawnLatLngs[this._drawnLatLngs.length-1]:d=this._drawnLatLngs[0],this.removeLatLng(d),this._drawing===n.Editable.FORWARD?this.tools.anchorForwardLineGuide(this._drawnLatLngs[this._drawnLatLngs.length-1]):this.tools.anchorForwardLineGuide(this._drawnLatLngs[0]),d},processDrawingClick:function(d){d.vertex&&d.vertex.editor===this||(this._drawing===n.Editable.FORWARD?this.newPointForward(d.latlng):this.newPointBackward(d.latlng),this.fireAndForward("editable:drawing:clicked",d))},onDrawingMouseMove:function(d){n.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,d),this._drawing&&(this.tools.moveForwardLineGuide(d.latlng),this.tools.moveBackwardLineGuide(d.latlng))},refresh:function(){this.feature.redraw(),this.onEditing()},newShape:function(d){const _=this.addNewEmptyShape();_&&(this.setDrawnLatLngs(_[0]||_),this.startDrawingForward(),this.fireAndForward("editable:shape:new",{shape:_}),d&&this.newPointForward(d))},deleteShape:function(d,_){const v={shape:d};if(n.Editable.makeCancellable(v),this.fireAndForward("editable:shape:delete",v),!v._cancelled)return d=this._deleteShape(d,_),this.ensureNotFlat&&this.ensureNotFlat(),this.feature.setLatLngs(this.getLatLngs()),this.refresh(),this.reset(),this.fireAndForward("editable:shape:deleted",{shape:d}),this.onEdited(),d},_deleteShape:function(d,_){if(_=_||this.getLatLngs(),!_.length)return;const v=(A,N)=>A.splice(0,Number.MAX_VALUE),I=(A,N)=>(A.splice(A.indexOf(N),1),A.length||this._deleteShape(A),N);if(_===d)return v(_);for(const A of _){if(A===d)return I(_,d);if(A.indexOf(d)!==-1)return I(A,d)}},deleteShapeAt:function(d){const _=this.feature.shapeAt(d);if(_)return this.deleteShape(_)},appendShape:function(d){this.insertShape(d)},prependShape:function(d){this.insertShape(d,0)},insertShape:function(d,_){this.ensureMulti(),d=this.formatShape(d),_===void 0&&(_=this.feature._latlngs.length),this.feature._latlngs.splice(_,0,d),this.feature.redraw(),this._enabled&&this.reset()},extendBounds:function(d){this.feature._bounds.extend(d.vertex.latlng)},onDragStart:function(d){this.editLayer.clearLayers(),n.Editable.BaseEditor.prototype.onDragStart.call(this,d)},onDragEnd:function(d){this.initVertexMarkers(),n.Editable.BaseEditor.prototype.onDragEnd.call(this,d)}}),n.Editable.PolylineEditor=n.Editable.PathEditor.extend({startDrawingBackward:function(){this._drawing=n.Editable.BACKWARD,this.startDrawing()},continueBackward:function(d){this.drawing()||(d=d||this.getDefaultLatLngs(),this.setDrawnLatLngs(d),d.length>0&&(this.tools.attachBackwardLineGuide(),this.tools.anchorBackwardLineGuide(d[0])),this.startDrawingBackward())},continueForward:function(d){this.drawing()||(d=d||this.getDefaultLatLngs(),this.setDrawnLatLngs(d),d.length>0&&(this.tools.attachForwardLineGuide(),this.tools.anchorForwardLineGuide(d[d.length-1])),this.startDrawingForward())},getDefaultLatLngs:function(d){return d=d||this.feature._latlngs,!d.length||d[0]instanceof n.LatLng?d:this.getDefaultLatLngs(d[0])},ensureMulti:function(){this.feature._latlngs.length&&m(this.feature._latlngs)&&(this.feature._latlngs=[this.feature._latlngs])},addNewEmptyShape:function(){if(this.feature._latlngs.length){const d=[];return this.appendShape(d),d}return this.feature._latlngs},formatShape:function(d){if(m(d))return d;if(d[0])return this.formatShape(d[0])},splitShape:function(d,_){if(!_||_>=d.length-1)return;this.ensureMulti();const v=this.feature._latlngs.indexOf(d);if(v===-1)return;const I=d.slice(0,_+1),A=d.slice(_);A[0]=n.latLng(A[0].lat,A[0].lng,A[0].alt),this.feature._latlngs.splice(v,1,I,A),this.refresh(),this.reset(),this.onEdited()}}),n.Editable.PolygonEditor=n.Editable.PathEditor.extend({CLOSED:!0,MIN_VERTEX:3,newPointForward:function(d){n.Editable.PathEditor.prototype.newPointForward.call(this,d),this.tools.backwardLineGuide._latlngs.length||this.tools.anchorBackwardLineGuide(d),this._drawnLatLngs.length===2&&this.tools.attachBackwardLineGuide()},addNewEmptyHole:function(d){this.ensureNotFlat();const _=this.feature.shapeAt(d);if(!_)return;const v=[];return _.push(v),v},newHole:function(d){const _=this.addNewEmptyHole(d);_&&(this.setDrawnLatLngs(_),this.startDrawingForward(),d&&this.newPointForward(d))},addNewEmptyShape:function(){if(this.feature._latlngs.length&&this.feature._latlngs[0].length){const d=[];return this.appendShape(d),d}return this.feature._latlngs},ensureMulti:function(){this.feature._latlngs.length&&m(this.feature._latlngs[0])&&(this.feature._latlngs=[this.feature._latlngs])},ensureNotFlat:function(){(!this.feature._latlngs.length||m(this.feature._latlngs))&&(this.feature._latlngs=[this.feature._latlngs])},vertexCanBeDeleted:function(d){const _=this.feature.parentShape(d.latlngs);return n.Util.indexOf(_,d.latlngs)>0?!0:n.Editable.PathEditor.prototype.vertexCanBeDeleted.call(this,d)},getDefaultLatLngs:function(){return this.feature._latlngs.length||this.feature._latlngs.push([]),this.feature._latlngs[0]},formatShape:d=>m(d)&&(!d[0]||d[0].length!==0)?[d]:d}),n.Editable.RectangleEditor=n.Editable.PathEditor.extend({CLOSED:!0,MIN_VERTEX:4,options:{skipMiddleMarkers:!0},extendBounds:function(d){const _=d.vertex.getIndex(),v=d.vertex.getNext(),I=d.vertex.getPrevious(),A=(_+2)%4,N=d.vertex.latlngs[A],P=new n.LatLngBounds(d.latlng,N);I.latlng.update([d.latlng.lat,N.lng]),v.latlng.update([N.lat,d.latlng.lng]),this.updateBounds(P),this.refreshVertexMarkers()},onDrawingMouseDown:function(d){n.Editable.PathEditor.prototype.onDrawingMouseDown.call(this,d),this.connect();const _=this.getDefaultLatLngs();_.length===3&&_.push(d.latlng);const v=new n.LatLngBounds(d.latlng,d.latlng);this.updateBounds(v),this.updateLatLngs(v),this.refresh(),this.reset(),d.originalEvent._simulated=!1,this.map.dragging._draggable._onUp(d.originalEvent),_[3].__vertex.dragging._draggable._onDown(d.originalEvent)},onDrawingMouseUp:function(d){this.commitDrawing(d),d.originalEvent._simulated=!1,n.Editable.PathEditor.prototype.onDrawingMouseUp.call(this,d)},onDrawingMouseMove:function(d){d.originalEvent._simulated=!1,n.Editable.PathEditor.prototype.onDrawingMouseMove.call(this,d)},getDefaultLatLngs:function(d){return d||this.feature._latlngs[0]},updateBounds:function(d){this.feature._bounds=d},updateLatLngs:function(d){const _=this.getDefaultLatLngs(),v=this.feature._boundsToLatLngs(d);for(let I=0;I<_.length;I++)_[I].update(v[I])}}),n.Editable.CircleEditor=n.Editable.PathEditor.extend({MIN_VERTEX:2,options:{skipMiddleMarkers:!0},initialize:function(d,_,v){n.Editable.PathEditor.prototype.initialize.call(this,d,_,v),this._resizeLatLng=this.computeResizeLatLng()},computeResizeLatLng:function(){const d=(this.feature._radius||this.feature._mRadius)*Math.cos(Math.PI/4),_=this.map.project(this.feature._latlng);return this.map.unproject([_.x+d,_.y-d])},updateResizeLatLng:function(){this._resizeLatLng.update(this.computeResizeLatLng()),this._resizeLatLng.__vertex.update()},getLatLngs:function(){return[this.feature._latlng,this._resizeLatLng]},getDefaultLatLngs:function(){return this.getLatLngs()},onVertexMarkerDrag:function(d){d.vertex.getIndex()===1?this.resize(d):this.updateResizeLatLng(d),n.Editable.PathEditor.prototype.onVertexMarkerDrag.call(this,d)},resize:function(d){let _;this.map.options.crs?_=this.map.options.crs.distance(this.feature._latlng,d.latlng):_=this.feature._latlng.distanceTo(d.latlng),this.feature.setRadius(_)},onDrawingMouseDown:function(d){n.Editable.PathEditor.prototype.onDrawingMouseDown.call(this,d),this._resizeLatLng.update(d.latlng),this.feature._latlng.update(d.latlng),this.connect(),d.originalEvent._simulated=!1,this.map.dragging._draggable._onUp(d.originalEvent),this._resizeLatLng.__vertex.dragging._draggable._onDown(d.originalEvent)},onDrawingMouseUp:function(d){this.commitDrawing(d),d.originalEvent._simulated=!1,n.Editable.PathEditor.prototype.onDrawingMouseUp.call(this,d)},onDrawingMouseMove:function(d){d.originalEvent._simulated=!1,n.Editable.PathEditor.prototype.onDrawingMouseMove.call(this,d)},onDrag:function(d){n.Editable.PathEditor.prototype.onDrag.call(this,d),this.feature.dragging.updateLatLng(this._resizeLatLng)}});const r={createEditor:function(d){d=d||this._map;const _=this.options.editOptions?.editTools||d.editTools;if(!_)throw Error("Unable to detect Editable instance.");const v=this.options.editorClass||this.getEditorClass(_);return new v(d,this,this.options.editOptions)},enableEdit:function(d){return this.editor||this.createEditor(d),this.editor.enable(),this.editor},editEnabled:function(){return this.editor?.enabled()},disableEdit:function(){this.editor&&(this.editor.disable(),delete this.editor)},toggleEdit:function(){this.editEnabled()?this.disableEdit():this.enableEdit()},_onEditableAdd:function(){this.editor&&this.enableEdit()}},o={getEditorClass:d=>d?.options?.polylineEditorClass||n.Editable.PolylineEditor,shapeAt:function(d,_){let v=null;if(_=_||this._latlngs,!_.length)return v;if(m(_)&&this.isInLatLngs(d,_))v=_;else for(const I of _)if(this.isInLatLngs(d,I))return I;return v},isInLatLngs:function(d,_){if(!_)return!1;let v,I,A,N=[],P;const w=this._clickTolerance();if(this._projectLatlngs(_,N,this._pxBounds),N=N[0],P=this._map.latLngToLayerPoint(d),!this._pxBounds.contains(P))return!1;for(v=1,A=N.length,I=0;v<A;I=v++)if(n.LineUtil.pointToSegmentDistance(P,N[I],N[v])<=w)return!0;return!1}},a={getEditorClass:d=>d?.options?.polygonEditorClass||n.Editable.PolygonEditor,shapeAt:function(d,_){let v=null;if(_=_||this._latlngs,!_.length)return v;if(m(_)&&this.isInLatLngs(d,_)&&(v=_),m(_[0])&&this.isInLatLngs(d,_[0]))v=_;else for(const I of _)if(this.isInLatLngs(d,I[0]))return I;return v},isInLatLngs:(d,_)=>{let v=!1,I,A,N,P,w;for(N=0,w=_.length,P=w-1;N<w;P=N++)I=_[N],A=_[P],I.lat>d.lat!=A.lat>d.lat&&d.lng<(A.lng-I.lng)*(d.lat-I.lat)/(A.lat-I.lat)+I.lng&&(v=!v);return v},parentShape:function(d,_){if(_=_||this._latlngs,!_)return;let v=n.Util.indexOf(_,d);if(v!==-1)return _;for(const I of _)if(v=n.Util.indexOf(I,d),v!==-1)return I}},l={getEditorClass:d=>d?.options?.markerEditorClass||n.Editable.MarkerEditor},u={getEditorClass:d=>d?.options?.circleMarkerEditorClass||n.Editable.CircleMarkerEditor},f={getEditorClass:d=>d?.options?.rectangleEditorClass||n.Editable.RectangleEditor},h={getEditorClass:d=>d?.options?.circleEditorClass||n.Editable.CircleEditor},g=function(){this.on("add",this._onEditableAdd)},m=n.LineUtil.isFlat||n.LineUtil._flat||n.Polyline._flat;n.Polyline&&(n.Polyline.include(r),n.Polyline.include(o),n.Polyline.addInitHook(g)),n.Polygon&&(n.Polygon.include(r),n.Polygon.include(a)),n.Marker&&(n.Marker.include(r),n.Marker.include(l),n.Marker.addInitHook(g)),n.CircleMarker&&(n.CircleMarker.include(r),n.CircleMarker.include(u),n.CircleMarker.addInitHook(g)),n.Rectangle&&(n.Rectangle.include(r),n.Rectangle.include(f)),n.Circle&&(n.Circle.include(r),n.Circle.include(h)),n.LatLng.prototype.update=function(d){d=n.latLng(d),this.lat=d.lat,this.lng=d.lng}},window)})(yl)),yl.exports}O0();const F0=`/* required styles */\r
|
|
440
440
|
\r
|
|
441
441
|
.leaflet-pane,\r
|
|
442
442
|
.leaflet-tile,\r
|
|
@@ -1097,7 +1097,7 @@ svg.leaflet-image-layer.leaflet-interactive path {\r
|
|
|
1097
1097
|
print-color-adjust: exact;\r
|
|
1098
1098
|
}\r
|
|
1099
1099
|
}\r
|
|
1100
|
-
`,
|
|
1100
|
+
`,j0=`.leaflet-fullscreen-icon {
|
|
1101
1101
|
background-image: url('icon-fullscreen.svg');
|
|
1102
1102
|
background-size: 26px 52px;
|
|
1103
1103
|
}
|
|
@@ -1136,7 +1136,7 @@ svg.leaflet-image-layer.leaflet-interactive path {\r
|
|
|
1136
1136
|
left: 0 !important;
|
|
1137
1137
|
z-index: 99999;
|
|
1138
1138
|
}
|
|
1139
|
-
`;var
|
|
1139
|
+
`;var js={exports:{}},B0=js.exports,Qh;function $0(){return Qh||(Qh=1,(function(i){(function(e,n){i.exports?i.exports=n(cu()):n(e.L)})(typeof self<"u"?self:B0,e=>{if(typeof document>"u")return console.warn('"window.document" is undefined; leaflet.fullscreen requires this object to access the DOM'),!1;const n=(()=>{const a=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"]],l=a[0],u={};for(const f of a)if(f[1]in document){for(let h=0;h<f.length;h++)u[l[h]]=f[h];return u}return!1})(),r={change:n.fullscreenchange,error:n.fullscreenerror},o={request(a,l){return new Promise((u,f)=>{const h=(function(){this.off("change",h),u()}).bind(this);this.on("change",h),a=a||document.documentElement;const g=a[n.requestFullscreen](l);g instanceof Promise&&g.then(h).catch(f)})},exit(){return new Promise((a,l)=>{if(!this.isFullscreen){a();return}const u=(function(){this.off("change",u),a()}).bind(this);this.on("change",u);const f=document[n.exitFullscreen]();f instanceof Promise&&f.then(u).catch(l)})},on(a,l){const u=r[a];u&&document.addEventListener(u,l,!1)},off(a,l){const u=r[a];u&&document.removeEventListener(u,l,!1)},nativeAPI:n};return Object.defineProperties(o,{isFullscreen:{get(){return!!document[n.fullscreenElement]}},isEnabled:{enumerable:!0,get(){return!!document[n.fullscreenEnabled]}}}),e.Control.FullScreen=e.Control.extend({options:{position:"topleft",title:"Full Screen",titleCancel:"Exit Full Screen",forceSeparateButton:!1,forcePseudoFullscreen:!1,fullscreenElement:!1},_screenfull:o,onAdd(a){let l="leaflet-control-zoom-fullscreen",u,f="";return a.zoomControl&&!this.options.forceSeparateButton?u=a.zoomControl._container:u=e.DomUtil.create("div","leaflet-bar"),this.options.content?f=this.options.content:l+=" leaflet-fullscreen-icon",this._createButton(this.options.title,l,f,u,this.toggleFullScreen,this),this._map.fullscreenControl=this,this._map.on("enterFullscreen exitFullscreen",this._toggleState,this),u},onRemove(){e.DomEvent.off(this.link,"click",e.DomEvent.stop).off(this.link,"click",this.toggleFullScreen,this),this._screenfull.isEnabled&&(e.DomEvent.off(this._container,this._screenfull.nativeAPI.fullscreenchange,e.DomEvent.stop).off(this._container,this._screenfull.nativeAPI.fullscreenchange,this._handleFullscreenChange,this),e.DomEvent.off(document,this._screenfull.nativeAPI.fullscreenchange,e.DomEvent.stop).off(document,this._screenfull.nativeAPI.fullscreenchange,this._handleFullscreenChange,this))},_createButton(a,l,u,f,h,g){return this.link=e.DomUtil.create("a",l,f),this.link.href="#",this.link.title=a,this.link.innerHTML=u,this.link.setAttribute("role","button"),this.link.setAttribute("aria-label",a),L.DomEvent.disableClickPropagation(f),e.DomEvent.on(this.link,"click",e.DomEvent.stop).on(this.link,"click",h,g),this._screenfull.isEnabled&&(e.DomEvent.on(f,this._screenfull.nativeAPI.fullscreenchange,e.DomEvent.stop).on(f,this._screenfull.nativeAPI.fullscreenchange,this._handleFullscreenChange,g),e.DomEvent.on(document,this._screenfull.nativeAPI.fullscreenchange,e.DomEvent.stop).on(document,this._screenfull.nativeAPI.fullscreenchange,this._handleFullscreenChange,g)),this.link},toggleFullScreen(){const a=this._map;a._exitFired=!1,a._isFullscreen?(this._screenfull.isEnabled&&!this.options.forcePseudoFullscreen?this._screenfull.exit().then(()=>a.invalidateSize()):(e.DomUtil.removeClass(this.options.fullscreenElement?this.options.fullscreenElement:a._container,"leaflet-pseudo-fullscreen"),a.invalidateSize()),a.fire("exitFullscreen"),a._exitFired=!0,a._isFullscreen=!1):(this._screenfull.isEnabled&&!this.options.forcePseudoFullscreen?this._screenfull.request(this.options.fullscreenElement?this.options.fullscreenElement:a._container).then(()=>a.invalidateSize()):(e.DomUtil.addClass(this.options.fullscreenElement?this.options.fullscreenElement:a._container,"leaflet-pseudo-fullscreen"),a.invalidateSize()),a.fire("enterFullscreen"),a._isFullscreen=!0)},_toggleState(){this.link.title=this._map._isFullscreen?this.options.title:this.options.titleCancel,this._map._isFullscreen?L.DomUtil.removeClass(this.link,"leaflet-fullscreen-on"):L.DomUtil.addClass(this.link,"leaflet-fullscreen-on")},_handleFullscreenChange(a){const l=this._map;a.target===l.getContainer()&&!this._screenfull.isFullscreen&&!l._exitFired&&(this._screenfull.exit().then(()=>l.invalidateSize()),l.fire("exitFullscreen"),l._exitFired=!0,l._isFullscreen=!1)}}),e.Map.include({toggleFullscreen(){this.fullscreenControl.toggleFullScreen()}}),e.Map.addInitHook(function(){this.options.fullscreenControl&&this.addControl(e.control.fullscreen(this.options.fullscreenControlOptions))}),e.control.fullscreen=function(a){return new e.Control.FullScreen(a)},{leaflet:e}})})(js)),js.exports}$0();const q0=`
|
|
1140
1140
|
#shaclMapDialog .closeButton { position: absolute; right: 0; top: 0; z-index: 1; padding: 6px 8px; cursor: pointer; border: 0; background-color: #FFFA; font-size: 24px; z-index: 1000; }
|
|
1141
1141
|
#shaclMapDialog { padding: 0; width:90vw; height: 90vh; margin: auto; }
|
|
1142
1142
|
#shaclMapDialog::backdrop { background-color: #0007; }
|
|
@@ -1145,11 +1145,11 @@ svg.leaflet-image-layer.leaflet-interactive path {\r
|
|
|
1145
1145
|
.leaflet-container { min-height: 300px; }
|
|
1146
1146
|
.fullscreen-icon { background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjYgNTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIwLjYgMzYuN0gxNmEuOS45IDAgMCAxLS44LS44di00LjVjMC0uMi4yLS40LjQtLjRoMS40Yy4zIDAgLjUuMi41LjR2M2gzYy4yIDAgLjQuMi40LjV2MS40YzAgLjItLjIuNC0uNC40em0tOS45LS44di00LjVjMC0uMi0uMi0uNC0uNC0uNEg4LjljLS4zIDAtLjUuMi0uNS40djNoLTNjLS4yIDAtLjQuMi0uNC41djEuNGMwIC4yLjIuNC40LjRIMTBjLjQgMCAuOC0uNC44LS44em0wIDEwLjdWNDJjMC0uNC0uNC0uOC0uOC0uOEg1LjRjLS4yIDAtLjQuMi0uNC40djEuNGMwIC4zLjIuNS40LjVoM3YzYzAgLjIuMi40LjUuNGgxLjRjLjIgMCAuNC0uMi40LS40em02LjkgMHYtM2gzYy4yIDAgLjQtLjIuNC0uNXYtMS40YzAtLjItLjItLjQtLjQtLjRIMTZjLS40IDAtLjguNC0uOC44djQuNWMwIC4yLjIuNC40LjRoMS40Yy4zIDAgLjUtLjIuNS0uNHpNNSAxMC4zVjUuOWMwLS41LjQtLjkuOS0uOWg0LjRjLjIgMCAuNC4yLjQuNFY3YzAgLjItLjIuNC0uNC40aC0zdjNjMCAuMi0uMi40LS40LjRINS40YS40LjQgMCAwIDEtLjQtLjR6bTEwLjMtNC45VjdjMCAuMi4yLjQuNC40aDN2M2MwIC4yLjIuNC40LjRoMS41Yy4yIDAgLjQtLjIuNC0uNFY1LjljMC0uNS0uNC0uOS0uOS0uOWgtNC40Yy0uMiAwLS40LjItLjQuNHptNS4zIDkuOUgxOWMtLjIgMC0uNC4yLS40LjR2M2gtM2MtLjIgMC0uNC4yLS40LjR2MS41YzAgLjIuMi40LjQuNGg0LjRjLjUgMCAuOS0uNC45LS45di00LjRjMC0uMi0uMi0uNC0uNC0uNHptLTkuOSA1LjNWMTljMC0uMi0uMi0uNC0uNC0uNGgtM3YtM2MwLS4yLS4yLS40LS40LS40SDUuNGMtLjIgMC0uNC4yLS40LjR2NC40YzAgLjUuNC45LjkuOWg0LjRjLjIgMCAuNC0uMi40LS40eiIgZmlsbD0iY3VycmVudENvbG9yIi8+PC9zdmc+); }
|
|
1147
1147
|
#shaclMapDialogContainer { width:100%; height: 100%; }
|
|
1148
|
-
|
|
1148
|
+
`,z0=`
|
|
1149
1149
|
<dialog id="shaclMapDialog" onclick="event.target==this && this.close()">
|
|
1150
1150
|
<div id="shaclMapDialogContainer"></div>
|
|
1151
1151
|
<div class="hint">ⓘ Draw a polygon or marker, then close dialog</div>
|
|
1152
1152
|
<button class="closeButton" type="button" onclick="this.parentElement.close()">✕</button>
|
|
1153
|
-
</dialog>`,Jh={lng:8.657238961696038,lat:49.87627570549512},Kh='© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',Yh="https://tile.openstreetmap.de/{z}/{x}/{y}.png",ef=
|
|
1154
|
-
`+
|
|
1155
|
-
`+
|
|
1153
|
+
</dialog>`,Jh={lng:8.657238961696038,lat:49.87627570549512},Kh='© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',Yh="https://tile.openstreetmap.de/{z}/{x}/{y}.png",ef=Ft.icon({iconUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",shadowUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC",iconSize:[25,41],shadowSize:[41,41],iconAnchor:[12,41],shadowAnchor:[14,41],popupAnchor:[-3,-76]});class ww extends Gf{constructor(e){super(e,F0+`
|
|
1154
|
+
`+j0+`
|
|
1155
|
+
`+q0)}initEditMode(e){e.insertAdjacentHTML("beforeend",z0);const n=e.querySelector("#shaclMapDialogContainer");this.map=Ft.map(n,{fullscreenControl:!0,editable:!0,layers:[Ft.tileLayer(Yh)],zoom:5,maxBounds:tf,center:Jh}),this.map.attributionControl.addAttribution(Kh);const r=Ft.Control.extend({options:{position:"topleft",callback:null,kind:"",html:""},onAdd:function(a){const l=Ft.DomUtil.create("div","leaflet-control leaflet-bar"),u=Ft.DomUtil.create("a","",l);return u.href="#",u.title="Create a new "+this.options.kind,u.innerHTML=this.options.html,Ft.DomEvent.on(u,"click",Ft.DomEvent.stop).on(u,"click",()=>{window.LAYER=this.options.callback.call(a.editTools)},this),l}});this.map.addControl(new(r.extend({options:{callback:()=>{this.displayedShape?.remove(),this.displayedShape=this.map?.editTools.startPolygon()},kind:"polygon",html:"▰"}}))),this.map.addControl(new(r.extend({options:{callback:()=>{this.displayedShape?.remove(),this.displayedShape=this.map?.editTools.startMarker(void 0,{icon:ef})},kind:"marker",html:"•"}}))),this.map.on("editable:drawing:end",()=>{this.saveChanges()}),this.map.on("editable:vertex:dragend",()=>{this.saveChanges()});const o=e.querySelector("#shaclMapDialog");return o.addEventListener("close",()=>{const a=document.body.style.top;document.body.style.position="",document.body.style.top="",window.scrollTo(0,parseInt(a||"0")*-1),this.currentEditor&&this.createdGeometry&&(this.currentEditor.value=H0(this.createdGeometry),this.currentEditor.dispatchEvent(new Event("change",{bubbles:!0})))}),o}createEditor(e,n){let r=e.config.form.querySelector("#shaclMapDialog");r||(r=this.initEditMode(e.config.form));const o=e.config.theme.createButton("Open map...",!1);o.style.marginLeft="5px",o.classList.add("open-map-button"),o.onclick=()=>{this.currentEditor=a.querySelector(".editor"),this.createdGeometry=void 0,this.displayedShape?.remove(),this.drawAndZoomToGeometry(nf(this.currentEditor.value||""),this.map),document.body.style.top=`-${window.scrollY}px`,document.body.style.position="fixed",r.showModal()};const a=Wf(e,n||null,!0);return a.appendChild(o),a}createViewer(e,n){const r=document.createElement("div"),o=nf(n.value);if(o?.coordinates?.length){const a=Ft.map(r,{fullscreenControl:!0,layers:[Ft.tileLayer(Yh)],zoom:5,center:Jh,maxBounds:tf});a.attributionControl.addAttribution(Kh),this.drawAndZoomToGeometry(o,a)}return r}drawAndZoomToGeometry(e,n){if(setTimeout(()=>{n.invalidateSize()}),e?.type==="Point"){const r={lng:e.coordinates[0],lat:e.coordinates[1]};this.displayedShape=Ft.marker(r,{icon:ef}).addTo(n),n.setView(r,15,{animate:!1})}else if(e?.type==="Polygon"){const r=e.coordinates[0].map(a=>({lng:a[0],lat:a[1]})),o=Ft.polygon(r).addTo(n);this.displayedShape=o,n.fitBounds(o.getBounds(),{animate:!1}),setTimeout(()=>{n.fitBounds(o.getBounds(),{animate:!1}),n.setView(o.getCenter(),void 0,{animate:!1})},1)}else n.setZoom(5)}saveChanges(){if(this.displayedShape instanceof Ft.Marker){const e=this.displayedShape.getLatLng();this.createdGeometry={type:"Point",coordinates:[e.lng,e.lat]}}else if(this.displayedShape instanceof Ft.Polygon){const e=this.displayedShape.getLatLngs();e[0][0].equals(e[0][e[0].length-1])||e[0].push(e[0][0]),this.createdGeometry={type:"Polygon",coordinates:[e[0].map(n=>[n.lng,n.lat])]}}else this.createdGeometry=void 0}}const tf=[[-90,-180],[90,180]];function nf(i){const e=i.match(/^POINT\((.*)\)$/);if(e?.length==2){const r=e[1].split(" ");if(r.length===2)return{type:"Point",coordinates:[parseFloat(r[0]),parseFloat(r[1])]}}const n=i.match(/^POLYGON[(]{2}(.*)[)]{2}$/);if(n?.length==2){const r=n[1].split(",");if(r.length>2){const o=[],a=[];o.push(a);for(const l of r){const u=l.split(" ");u.length===2&&a.push([parseFloat(u[0]),parseFloat(u[1])])}return{type:"Polygon",coordinates:o}}}}function H0(i){return i.type==="Point"?`POINT(${i.coordinates.join(" ")})`:i.type==="Polygon"?`POLYGON((${i.coordinates[0].map(e=>e.join(" ")).join(",")}))`:""}export{Gh as Config,_y as DefaultTheme,vw as FileUploadPlugin,ww as LeafletPlugin,Gf as Plugin,D0 as ShaclForm,Hd as ShaclPropertyTemplate,e_ as Theme,Cs as fetchRDF,Wm as findConformsToShapeSubject,qf as findConformsToValuesSubject,Zn as findLabel,H0 as geometryToWkt,Rn as importRDF,k0 as initTimeout,Gm as loadGraphs,Ui as parseRDF,Vi as prefixes,Xm as propertyMappers,Ts as rdfCache,i_ as registerPlugin,nf as wktToGeometry,tf as worldBounds};
|