@speclynx/apidom-core 2.10.2 → 2.11.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.11.0](https://github.com/speclynx/apidom/compare/v2.10.3...v2.11.0) (2026-02-12)
7
+
8
+ **Note:** Version bump only for package @speclynx/apidom-core
9
+
10
+ ## [2.10.3](https://github.com/speclynx/apidom/compare/v2.10.2...v2.10.3) (2026-02-10)
11
+
12
+ **Note:** Version bump only for package @speclynx/apidom-core
13
+
6
14
  ## [2.10.2](https://github.com/speclynx/apidom/compare/v2.10.1...v2.10.2) (2026-02-08)
7
15
 
8
16
  **Note:** Version bump only for package @speclynx/apidom-core
@@ -26333,7 +26333,13 @@ class Element {
26333
26333
 
26334
26334
  /** Unique identifier for this element. */
26335
26335
  get id() {
26336
- return this.getMetaProperty('id', '');
26336
+ if (this.isFrozen) {
26337
+ return this.getMetaProperty('id', '');
26338
+ }
26339
+ if (!this.hasMetaProperty('id')) {
26340
+ this.setMetaProperty('id', '');
26341
+ }
26342
+ return this.meta.get('id');
26337
26343
  }
26338
26344
  set id(value) {
26339
26345
  this.setMetaProperty('id', value);
@@ -26341,7 +26347,13 @@ class Element {
26341
26347
 
26342
26348
  /** CSS-like class names. */
26343
26349
  get classes() {
26344
- return this.getMetaProperty('classes', []);
26350
+ if (this.isFrozen) {
26351
+ return this.getMetaProperty('classes', []);
26352
+ }
26353
+ if (!this.hasMetaProperty('classes')) {
26354
+ this.setMetaProperty('classes', []);
26355
+ }
26356
+ return this.meta.get('classes');
26345
26357
  }
26346
26358
  set classes(value) {
26347
26359
  this.setMetaProperty('classes', value);
@@ -26349,7 +26361,13 @@ class Element {
26349
26361
 
26350
26362
  /** Hyperlinks associated with this element. */
26351
26363
  get links() {
26352
- return this.getMetaProperty('links', []);
26364
+ if (this.isFrozen) {
26365
+ return this.getMetaProperty('links', []);
26366
+ }
26367
+ if (!this.hasMetaProperty('links')) {
26368
+ this.setMetaProperty('links', []);
26369
+ }
26370
+ return this.meta.get('links');
26353
26371
  }
26354
26372
  set links(value) {
26355
26373
  this.setMetaProperty('links', value);
@@ -26500,16 +26518,26 @@ class Element {
26500
26518
  }
26501
26519
 
26502
26520
  /**
26503
- * Gets a meta property, creating it with default value if not present.
26521
+ * Gets a meta property.
26522
+ *
26523
+ * When the property doesn't exist:
26524
+ * - With defaultValue: returns a new refracted element instance (not cached)
26525
+ * - Without defaultValue: returns undefined
26526
+ *
26527
+ * Note: Each call with a default creates a new instance. Use setMetaProperty
26528
+ * first if you need reference equality across multiple accesses.
26504
26529
  */
26530
+
26505
26531
  getMetaProperty(name, defaultValue) {
26506
- if (!this.meta.hasKey(name)) {
26507
- if (this.isFrozen) {
26508
- const element = this.refract(defaultValue);
26532
+ if (!this.hasMetaProperty(name)) {
26533
+ if (defaultValue === undefined) {
26534
+ return undefined;
26535
+ }
26536
+ const element = this.refract(defaultValue);
26537
+ if (element && this.isFrozen) {
26509
26538
  element.freeze();
26510
- return element;
26511
26539
  }
26512
- this.meta.set(name, defaultValue);
26540
+ return element;
26513
26541
  }
26514
26542
  return this.meta.get(name);
26515
26543
  }
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.apidomCore=t():e.apidomCore=t()}(self,()=>(()=>{"use strict";var e={279(e){var t=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,o=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,a=(e,t)=>{for(var n in t||(t={}))s.call(t,n)&&o(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&o(e,n,t[n]);return e},c=(e,t,n)=>o(e,"symbol"!=typeof t?t+"":t,n),l={};((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(l,{DEFAULT_OPTIONS:()=>h,DEFAULT_UUID_LENGTH:()=>u,default:()=>f});var u=6,h={dictionary:"alphanum",shuffle:!0,debug:!1,length:u,counter:0},p=class{constructor(e={}){c(this,"counter"),c(this,"debug"),c(this,"dict"),c(this,"version"),c(this,"dictIndex",0),c(this,"dictRange",[]),c(this,"lowerBound",0),c(this,"upperBound",0),c(this,"dictLength",0),c(this,"uuidLength"),c(this,"_digit_first_ascii",48),c(this,"_digit_last_ascii",58),c(this,"_alpha_lower_first_ascii",97),c(this,"_alpha_lower_last_ascii",123),c(this,"_hex_last_ascii",103),c(this,"_alpha_upper_first_ascii",65),c(this,"_alpha_upper_last_ascii",91),c(this,"_number_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii]}),c(this,"_alpha_dict_ranges",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),c(this,"_alpha_lower_dict_ranges",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),c(this,"_alpha_upper_dict_ranges",{upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),c(this,"_alphanum_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),c(this,"_alphanum_lower_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),c(this,"_alphanum_upper_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),c(this,"_hex_dict_ranges",{decDigits:[this._digit_first_ascii,this._digit_last_ascii],alphaDigits:[this._alpha_lower_first_ascii,this._hex_last_ascii]}),c(this,"_dict_ranges",{_number_dict_ranges:this._number_dict_ranges,_alpha_dict_ranges:this._alpha_dict_ranges,_alpha_lower_dict_ranges:this._alpha_lower_dict_ranges,_alpha_upper_dict_ranges:this._alpha_upper_dict_ranges,_alphanum_dict_ranges:this._alphanum_dict_ranges,_alphanum_lower_dict_ranges:this._alphanum_lower_dict_ranges,_alphanum_upper_dict_ranges:this._alphanum_upper_dict_ranges,_hex_dict_ranges:this._hex_dict_ranges}),c(this,"log",(...e)=>{const t=[...e];t[0]="[short-unique-id] ".concat(e[0]),!0!==this.debug||"undefined"==typeof console||null===console||console.log(...t)}),c(this,"_normalizeDictionary",(e,t)=>{let n;if(e&&Array.isArray(e)&&e.length>1)n=e;else{n=[],this.dictIndex=0;const t="_".concat(e,"_dict_ranges"),r=this._dict_ranges[t];let s=0;for(const[,e]of Object.entries(r)){const[t,n]=e;s+=Math.abs(n-t)}n=new Array(s);let i=0;for(const[,e]of Object.entries(r)){this.dictRange=e,this.lowerBound=this.dictRange[0],this.upperBound=this.dictRange[1];const t=this.lowerBound<=this.upperBound,r=this.lowerBound,s=this.upperBound;if(t)for(let e=r;e<s;e++)n[i++]=String.fromCharCode(e),this.dictIndex=e;else for(let e=r;e>s;e--)n[i++]=String.fromCharCode(e),this.dictIndex=e}n.length=i}if(t){for(let e=n.length-1;e>0;e--){const t=Math.floor(Math.random()*(e+1));[n[e],n[t]]=[n[t],n[e]]}}return n}),c(this,"setDictionary",(e,t)=>{this.dict=this._normalizeDictionary(e,t),this.dictLength=this.dict.length,this.setCounter(0)}),c(this,"seq",()=>this.sequentialUUID()),c(this,"sequentialUUID",()=>{const e=this.dictLength,t=this.dict;let n=this.counter;const r=[];do{const s=n%e;n=Math.trunc(n/e),r.push(t[s])}while(0!==n);const s=r.join("");return this.counter+=1,s}),c(this,"rnd",(e=this.uuidLength||u)=>this.randomUUID(e)),c(this,"randomUUID",(e=this.uuidLength||u)=>{if(null==e||e<1)throw new Error("Invalid UUID Length Provided");const t=new Array(e),n=this.dictLength,r=this.dict;for(let s=0;s<e;s++){const e=Math.floor(Math.random()*n);t[s]=r[e]}return t.join("")}),c(this,"fmt",(e,t)=>this.formattedUUID(e,t)),c(this,"formattedUUID",(e,t)=>{const n={$r:this.randomUUID,$s:this.sequentialUUID,$t:this.stamp};return e.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,e=>{const r=e.slice(0,2),s=Number.parseInt(e.slice(2),10);return"$s"===r?n[r]().padStart(s,"0"):"$t"===r&&t?n[r](s,t):n[r](s)})}),c(this,"availableUUIDs",(e=this.uuidLength)=>Number.parseFloat(([...new Set(this.dict)].length**e).toFixed(0))),c(this,"_collisionCache",new Map),c(this,"approxMaxBeforeCollision",(e=this.availableUUIDs(this.uuidLength))=>{const t=e,n=this._collisionCache.get(t);if(void 0!==n)return n;const r=Number.parseFloat(Math.sqrt(Math.PI/2*e).toFixed(20));return this._collisionCache.set(t,r),r}),c(this,"collisionProbability",(e=this.availableUUIDs(this.uuidLength),t=this.uuidLength)=>Number.parseFloat((this.approxMaxBeforeCollision(e)/this.availableUUIDs(t)).toFixed(20))),c(this,"uniqueness",(e=this.availableUUIDs(this.uuidLength))=>{const t=Number.parseFloat((1-this.approxMaxBeforeCollision(e)/e).toFixed(20));return t>1?1:t<0?0:t}),c(this,"getVersion",()=>this.version),c(this,"stamp",(e,t)=>{const n=Math.floor(+(t||new Date)/1e3).toString(16);if("number"==typeof e&&0===e)return n;if("number"!=typeof e||e<10)throw new Error(["Param finalLength must be a number greater than or equal to 10,","or 0 if you want the raw hexadecimal timestamp"].join("\n"));const r=e-9,s=Math.round(Math.random()*(r>15?15:r)),i=this.randomUUID(r);return"".concat(i.substring(0,s)).concat(n).concat(i.substring(s)).concat(s.toString(16))}),c(this,"parseStamp",(e,t)=>{if(t&&!/t0|t[1-9]\d{1,}/.test(t))throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");const n=t?t.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,e=>{const t={$r:e=>[...Array(e)].map(()=>"r").join(""),$s:e=>[...Array(e)].map(()=>"s").join(""),$t:e=>[...Array(e)].map(()=>"t").join("")},n=e.slice(0,2),r=Number.parseInt(e.slice(2),10);return t[n](r)}).replace(/^(.*?)(t{8,})(.*)$/g,(t,n,r)=>e.substring(n.length,n.length+r.length)):e;if(8===n.length)return new Date(1e3*Number.parseInt(n,16));if(n.length<10)throw new Error("Stamp length invalid");const r=Number.parseInt(n.substring(n.length-1),16);return new Date(1e3*Number.parseInt(n.substring(r,r+8),16))}),c(this,"setCounter",e=>{this.counter=e}),c(this,"validate",(e,t)=>{const n=t?this._normalizeDictionary(t):this.dict;return e.split("").every(e=>n.includes(e))});const t=a(a({},h),e);this.counter=0,this.debug=!1,this.dict=[],this.version="5.3.2";const{dictionary:n,shuffle:r,length:s,counter:i}=t;this.uuidLength=s,this.setDictionary(n,r),this.setCounter(i),this.debug=t.debug,this.log(this.dict),this.log("Generator instantiated with Dictionary Size ".concat(this.dictLength," and counter set to ").concat(this.counter)),this.log=this.log.bind(this),this.setDictionary=this.setDictionary.bind(this),this.setCounter=this.setCounter.bind(this),this.seq=this.seq.bind(this),this.sequentialUUID=this.sequentialUUID.bind(this),this.rnd=this.rnd.bind(this),this.randomUUID=this.randomUUID.bind(this),this.fmt=this.fmt.bind(this),this.formattedUUID=this.formattedUUID.bind(this),this.availableUUIDs=this.availableUUIDs.bind(this),this.approxMaxBeforeCollision=this.approxMaxBeforeCollision.bind(this),this.collisionProbability=this.collisionProbability.bind(this),this.uniqueness=this.uniqueness.bind(this),this.getVersion=this.getVersion.bind(this),this.stamp=this.stamp.bind(this),this.parseStamp=this.parseStamp.bind(this)}};c(p,"default",p);var d,f=p;return d=l,((r,i,o,a)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let c of n(i))s.call(r,c)||c===o||e(r,c,{get:()=>i[c],enumerable:!(a=t(i,c))||a.enumerable});return r})(e({},"__esModule",{value:!0}),d)})();e.exports=t.default,"undefined"!=typeof window&&(t=t.default)}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};function s(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function i(e){return function t(n){return 0===arguments.length||s(n)?t:e.apply(this,arguments)}}function o(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return s(n)?t:i(function(t){return e(n,t)});default:return s(n)&&s(r)?t:s(n)?i(function(t){return e(t,r)}):s(r)?i(function(t){return e(n,t)}):e(n,r)}}}function a(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function c(e,t,n){for(var r=0,s=n.length;r<s;){if(e(t,n[r]))return!0;r+=1}return!1}function l(e,t){return Object.prototype.hasOwnProperty.call(t,e)}n.r(r),n.d(r,{ElementIdentityError:()=>dr,IdentityManager:()=>fr,MediaTypes:()=>wr,Transcluder:()=>Ar,createToolbox:()=>cr,deepmerge:()=>Po,defaultIdentityManager:()=>mr,dehydrate:()=>jo,dispatchRefractorPlugins:()=>ur,fixedFields:()=>Go,from:()=>es,mergeLeft:()=>Vo,mergeRight:()=>qo,refractorPluginElementIdentity:()=>yr,refractorPluginSemanticElementIdentity:()=>gr,resolveSpecification:()=>Zr,sexprs:()=>Fo,toJSON:()=>ns,toString:()=>No,toValue:()=>ts,toYAML:()=>Co,transclude:()=>Er});const u="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var h=Object.prototype.toString;const p=function(){return"[object Arguments]"===h.call(arguments)?function(e){return"[object Arguments]"===h.call(e)}:function(e){return l("callee",e)}}();var d=!{toString:null}.propertyIsEnumerable("toString"),f=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=function(){return arguments.propertyIsEnumerable("length")}(),y=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1},g="function"!=typeof Object.keys||m?i(function(e){if(Object(e)!==e)return[];var t,n,r=[],s=m&&p(e);for(t in e)!l(t,e)||s&&"length"===t||(r[r.length]=t);if(d)for(n=f.length-1;n>=0;)l(t=f[n],e)&&!y(r,t)&&(r[r.length]=t),n-=1;return r}):i(function(e){return Object(e)!==e?[]:Object.keys(e)});const x=g;const b=i(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function w(e,t,n,r){var s=a(e);function i(e,t){return v(e,t,n.slice(),r.slice())}return!c(function(e,t){return!c(i,t,e)},a(t),s)}function v(e,t,n,r){if(u(e,t))return!0;var s=b(e);if(s!==b(t))return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(s){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]}(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!u(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!u(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var i=n.length-1;i>=0;){if(n[i]===e)return r[i]===t;i-=1}switch(s){case"Map":return e.size===t.size&&w(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&w(e.values(),t.values(),n.concat([e]),r.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var o=x(e);if(o.length!==x(t).length)return!1;var a=n.concat([e]),c=r.concat([t]);for(i=o.length-1;i>=0;){var h=o[i];if(!l(h,t)||!v(t[h],e[h],a,c))return!1;i-=1}return!0}const k=o(function(e,t){return v(e,t,[],[])});const S=class{key;value;constructor(e,t){this.key=e,this.value=t}toValue(){return{key:this.key?.toValue(),value:this.value?.toValue()}}};class O{elements;constructor(e){this.elements=e??[]}toValue(){return this.elements.map(e=>({key:e.key?.toValue(),value:e.value?.toValue()}))}map(e,t){return this.elements.map(n=>{const r=n.value,s=n.key;if(void 0===r||void 0===s)throw new Error("MemberElement must have both key and value");return void 0!==t?e.call(t,r,s,n):e(r,s,n)})}filter(e,t){const n=this.elements.filter(n=>{const r=n.value,s=n.key;return void 0!==r&&void 0!==s&&(void 0!==t?e.call(t,r,s,n):e(r,s,n))});return new O(n)}reject(e,t){const n=[];for(const r of this.elements){const s=r.value,i=r.key;void 0!==s&&void 0!==i&&(e.call(t,s,i,r)||n.push(r))}return new O(n)}forEach(e,t){this.elements.forEach((n,r)=>{const s=n.value,i=n.key;void 0!==s&&void 0!==i&&(void 0!==t?e.call(t,s,i,n,r):e(s,i,n,r))})}find(e,t){return this.elements.find(n=>{const r=n.value,s=n.key;return void 0!==r&&void 0!==s&&(void 0!==t?e.call(t,r,s,n):e(r,s,n))})}keys(){return this.elements.map(e=>e.key?.toValue()).filter(e=>void 0!==e)}values(){return this.elements.map(e=>e.value?.toValue()).filter(e=>void 0!==e)}get length(){return this.elements.length}get isEmpty(){return 0===this.length}get first(){return this.elements[0]}get(e){return this.elements[e]}push(e){return this.elements.push(e),this}includesKey(e){return this.elements.some(t=>t.key?.equals(e))}[Symbol.iterator](){return this.elements[Symbol.iterator]()}}const E=O;class A{parent;startLine;startCharacter;startOffset;endLine;endCharacter;endOffset;_storedElement="element";_content;_meta;_attributes;constructor(e,t,n){void 0!==t&&(this.meta=t),void 0!==n&&(this.attributes=n),void 0!==e&&(this.content=e)}get element(){return this._storedElement}set element(e){this._storedElement=e}get content(){return this._content}set content(e){if(e instanceof A)this._content=e;else if(null!=e&&"string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e&&"bigint"!=typeof e&&"symbol"!=typeof e)if(e instanceof S)this._content=e;else if(e instanceof E)this._content=e.elements;else if(Array.isArray(e))this._content=e.map(e=>this.refract(e));else{if("object"!=typeof e)throw new Error("Cannot set content to value of type "+typeof e);this._content=Object.entries(e).map(([e,t])=>new this.MemberElement(e,t))}else this._content=e}get meta(){if(!this._meta){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._meta=new this.ObjectElement}return this._meta}set meta(e){e instanceof A?this._meta=e:this.meta.set(e??{})}get attributes(){if(!this._attributes){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._attributes=new this.ObjectElement}return this._attributes}set attributes(e){e instanceof A?this._attributes=e:this.attributes.set(e??{})}get id(){return this.getMetaProperty("id","")}set id(e){this.setMetaProperty("id",e)}get classes(){return this.getMetaProperty("classes",[])}set classes(e){this.setMetaProperty("classes",e)}get links(){return this.getMetaProperty("links",[])}set links(e){this.setMetaProperty("links",e)}get children(){const{_content:e}=this;if(Array.isArray(e))return e;if(e instanceof S){const t=[];return e.key&&t.push(e.key),e.value&&t.push(e.value),t}return e instanceof A?[e]:[]}get isFrozen(){return Object.isFrozen(this)}freeze(){if(!this.isFrozen){this._meta&&(this._meta.parent=this,this._meta.freeze()),this._attributes&&(this._attributes.parent=this,this._attributes.freeze());for(const e of this.children)e.parent=this,e.freeze();Array.isArray(this._content)&&Object.freeze(this._content),Object.freeze(this)}}toValue(){const{_content:e}=this;return e instanceof A||e instanceof S?e.toValue():Array.isArray(e)?e.map(e=>e.toValue()):e}equals(e){const t=e instanceof A?e.toValue():e;return k(this.toValue(),t)}primitive(){}set(e){return this.content=e,this}toRef(e){const t=this.id.toValue();if(""===t)throw new Error("Cannot create reference to an element without an ID");const n=new this.RefElement(t);return"string"==typeof e&&(n.path=this.refract(e)),n}getMetaProperty(e,t){if(!this.meta.hasKey(e)){if(this.isFrozen){const e=this.refract(t);return e.freeze(),e}this.meta.set(e,t)}return this.meta.get(e)}setMetaProperty(e,t){this.meta.set(e,t)}hasMetaProperty(e){return!this.isMetaEmpty&&this.meta.hasKey(e)}get isMetaEmpty(){return void 0===this._meta||this.meta.isEmpty}getAttributesProperty(e,t){if(!this.hasAttributesProperty(e)){if(this.isFrozen){const e=this.refract(t);return e.freeze(),e}this.attributes.set(e,t)}return this.attributes.get(e)}setAttributesProperty(e,t){this.attributes.set(e,t)}hasAttributesProperty(e){return!this.isAttributesEmpty&&this.attributes.hasKey(e)}get isAttributesEmpty(){return void 0===this._attributes||this.attributes.isEmpty}}const _=A;const I=class extends _{constructor(e,t,n){super(e,t,n),this.element="string"}primitive(){return"string"}get length(){return this.content?.length??0}};const T=class extends _{constructor(e,t,n){super(e,t,n),this.element="number"}primitive(){return"number"}};const M=class extends _{constructor(e,t,n){super(e??null,t,n),this.element="null"}primitive(){return"null"}set(e){throw new Error("Cannot set the value of null")}};const C=class extends _{constructor(e,t,n){super(e,t,n),this.element="boolean"}primitive(){return"boolean"}};class j extends _{constructor(e,t,n){super(e||[],t,n)}get length(){return this._content.length}get isEmpty(){return 0===this.length}get first(){return this._content[0]}get second(){return this._content[1]}get last(){return this._content.at(-1)}push(...e){for(const t of e)this._content.push(this.refract(t));return this}shift(){return this._content.shift()}unshift(e){this._content.unshift(this.refract(e))}includes(e){return this._content.some(t=>t.equals(e))}findElements(e,t){const n=t||{},r=!!n.recursive,s=void 0===n.results?[]:n.results;for(let t=0;t<this._content.length;t+=1){const n=this._content[t],i=n;r&&"function"==typeof i.findElements&&i.findElements(e,{results:s,recursive:r}),e(n,t,void 0)&&s.push(n)}return s}find(e){const t=this.findElements(e,{recursive:!0});return new this.ArrayElement(t)}findByElement(e){return this.find(t=>t.element===e)}findByClass(e){return this.find(t=>{const n=t.classes;return"function"==typeof n.includes&&n.includes(e)})}getById(e){return this.find(t=>t.id.toValue()===e).first}concat(e){return new(0,this.constructor)(this._content.concat(e._content))}[Symbol.iterator](){return this._content[Symbol.iterator]()}}const N=j;const F=class extends N{constructor(e,t,n){super(e||[],t,n),this.element="array"}primitive(){return"array"}get(e){return this._content[e]}getValue(e){const t=this.get(e);if(t)return t.toValue()}set(e,t){return"number"==typeof e&&void 0!==t?this._content[e]=this.refract(t):this.content=e,this}remove(e){return this._content.splice(e,1)[0]??null}map(e,t){return this._content.map(e,t)}flatMap(e,t){return this._content.flatMap(e,t)}compactMap(e,t){const n=[];for(const r of this._content){const s=e.call(t,r);s&&n.push(s)}return n}filter(e,t){const n=this._content.filter(e,t);return new this.constructor(n)}reject(e,t){const n=[];for(const r of this._content)e.call(t,r)||n.push(r);return new this.constructor(n)}reduce(e,t){let n,r;void 0!==t?(n=0,r=this.refract(t)):(n=1,r=this.first);for(let t=n;t<this.length;t+=1){const n=e(r,this._content[t],t,this);r=void 0===n?n:this.refract(n)}return r}forEach(e,t){this._content.forEach((n,r)=>{e.call(t,n,r)})}empty(){return new this.constructor([])}};const D=class extends _{constructor(e,t,n,r){super(new S,n,r),this.element="member",void 0!==e&&(this.key=e),arguments.length>=2&&(this.value=t)}primitive(){return"member"}get key(){return this._content.key}set key(e){this._content.key=this.refract(e)}get value(){return this._content.value}set value(e){this._content.value=void 0===e?void 0:this.refract(e)}};const B=class extends N{constructor(e,t,n){super(e||[],t,n),this.element="object"}primitive(){return"object"}toValue(){return this._content.reduce((e,t)=>(e[t.key.toValue()]=t.value?t.value.toValue():void 0,e),{})}get(e){const t=this.getMember(e);if(t)return t.value}getValue(e){const t=this.get(e);if(t)return t.toValue()}getMember(e){if(void 0!==e)return this._content.find(t=>t.key.toValue()===e)}remove(e){let t=null;return this.content=this._content.filter(n=>n.key.toValue()!==e||(t=n,!1)),t}getKey(e){const t=this.getMember(e);if(t)return t.key}set(e,t){if("string"==typeof e){const n=this.getMember(e);n?n.value=t:this._content.push(new D(e,t))}else if("object"==typeof e&&!Array.isArray(e))for(const t of Object.keys(e))this.set(t,e[t]);return this}keys(){return this._content.map(e=>e.key.toValue())}values(){return this._content.map(e=>e.value.toValue())}hasKey(e){return this._content.some(t=>t.key.equals(e))}items(){return this._content.map(e=>[e.key.toValue(),e.value.toValue()])}map(e,t){return this._content.map(n=>e.call(t,n.value,n.key,n))}compactMap(e,t){const n=[];return this.forEach((r,s,i)=>{const o=e.call(t,r,s,i);o&&n.push(o)}),n}filter(e,t){return new E(this._content).filter(e,t)}reject(e,t){const n=[];for(const r of this._content)e.call(t,r.value,r.key,r)||n.push(r);return new E(n)}forEach(e,t){this._content.forEach(n=>e.call(t,n.value,n.key,n))}reduce(e,t){let n,r;void 0!==t?(n=0,r=this.refract(t)):(n=1,r=this._content[0]?.value);for(let t=n;t<this._content.length;t+=1){const n=this._content[t],s=e(r,n.value,n.key,n,this);r=void 0===s?s:this.refract(s)}return r}empty(){return new this.constructor([])}},$=e=>e instanceof _,L=e=>e instanceof I,P=e=>e instanceof T,U=e=>e instanceof M,q=e=>e instanceof C,R=e=>e instanceof F,V=e=>e instanceof B,G=e=>e instanceof D,H=e=>V(e)&&"object"===e.element||R(e)&&"array"===e.element||q(e)&&"boolean"===e.element||P(e)&&"number"===e.element||L(e)&&"string"===e.element||U(e)&&"null"===e.element||G(e)&&"member"===e.element,K=function(){const e=J,t=z,n=this,r="parser.js: Parser(): ";n.ast=void 0,n.stats=void 0,n.trace=void 0,n.callbacks=[];let s,i,o,a,c,l,u,h=0,p=0,d=0,f=0,m=0,y=new function(){this.state=e.ACTIVE,this.phraseLength=0,this.refresh=()=>{this.state=e.ACTIVE,this.phraseLength=0}};n.parse=(g,x,w,v)=>{const k=`${r}parse(): `;h=0,p=0,d=0,f=0,m=0,s=void 0,i=void 0,o=void 0,a=void 0,y.refresh(),c=void 0,l=void 0,u=void 0,a=t.stringToChars(w),s=g.rules,i=g.udts;const S=x.toLowerCase();let O;for(const e in s)if(s.hasOwnProperty(e)&&S===s[e].lower){O=s[e].index;break}if(void 0===O)throw new Error(`${k}start rule name '${startRule}' not recognized`);(()=>{const e=`${r}initializeCallbacks(): `;let t,o;for(c=[],l=[],t=0;t<s.length;t+=1)c[t]=void 0;for(t=0;t<i.length;t+=1)l[t]=void 0;const a=[];for(t=0;t<s.length;t+=1)a.push(s[t].lower);for(t=0;t<i.length;t+=1)a.push(i[t].lower);for(const r in n.callbacks)if(n.callbacks.hasOwnProperty(r)){if(t=a.indexOf(r.toLowerCase()),t<0)throw new Error(`${e}syntax callback '${r}' not a rule or udt name`);if(o=n.callbacks[r]?n.callbacks[r]:void 0,"function"!=typeof o&&void 0!==o)throw new Error(`${e}syntax callback[${r}] must be function reference or falsy)`);t<s.length?c[t]=o:l[t-s.length]=o}})(),n.trace&&n.trace.init(s,i,a),n.stats&&n.stats.init(s,i),n.ast&&n.ast.init(s,i,a),u=v,o=[{type:e.RNM,index:O}],b(0,0),o=void 0;let E=!1;switch(y.state){case e.ACTIVE:throw new Error(`${k}final state should never be 'ACTIVE'`);case e.NOMATCH:E=!1;break;case e.EMPTY:case e.MATCH:E=y.phraseLength===a.length;break;default:throw new Error("unrecognized state")}return{success:E,state:y.state,stateName:e.idName(y.state),length:a.length,matched:y.phraseLength,maxMatched:m,maxTreeDepth:d,nodeHits:f}};const g=(t,n,s,i)=>{if(n.phraseLength>s){let e=`${r}opRNM(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${n.phraseLength}`,e+=` must be <= remaining chars: ${s}`,new Error(e)}switch(n.state){case e.ACTIVE:if(!i)throw new Error(`${r}opRNM(${t.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:n.phraseLength=0;break;case e.MATCH:0===n.phraseLength&&(n.state=e.EMPTY);break;case e.NOMATCH:n.phraseLength=0;break;default:throw new Error(`${r}opRNM(${t.name}): callback function return error. Unrecognized return state: ${n.state}`)}},x=(t,c)=>{let p,d,f;const m=o[t],g=i[m.index];y.UdtIndex=g.index,h||(f=n.ast&&n.ast.udtDefined(m.index),f&&(d=s.length+m.index,p=n.ast.getLength(),n.ast.down(d,g.name)));const x=a.length-c;l[m.index](y,a,c,u),((t,n,s)=>{if(n.phraseLength>s){let e=`${r}opUDT(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${n.phraseLength}`,e+=` must be <= remaining chars: ${s}`,new Error(e)}switch(n.state){case e.ACTIVE:throw new Error(`${r}opUDT(${t.name}) ACTIVE state return not allowed.`);case e.EMPTY:if(!t.empty)throw new Error(`${r}opUDT(${t.name}) may not return EMPTY.`);n.phraseLength=0;break;case e.MATCH:if(0===n.phraseLength){if(!t.empty)throw new Error(`${r}opUDT(${t.name}) may not return EMPTY.`);n.state=e.EMPTY}break;case e.NOMATCH:n.phraseLength=0;break;default:throw new Error(`${r}opUDT(${t.name}): callback function return error. Unrecognized return state: ${n.state}`)}})(g,y,x),h||f&&(y.state===e.NOMATCH?n.ast.setLength(p):n.ast.up(d,g.name,c,y.phraseLength))},b=(t,i)=>{const l=`${r}opExecute(): `,w=o[t];switch(f+=1,p>d&&(d=p),p+=1,y.refresh(),n.trace&&n.trace.down(w,i),w.type){case e.ALT:((t,n)=>{const r=o[t];for(let t=0;t<r.children.length&&(b(r.children[t],n),y.state===e.NOMATCH);t+=1);})(t,i);break;case e.CAT:((t,r)=>{let s,i,a,c;const l=o[t];n.ast&&(i=n.ast.getLength()),s=!0,a=r,c=0;for(let t=0;t<l.children.length;t+=1){if(b(l.children[t],a),y.state===e.NOMATCH){s=!1;break}a+=y.phraseLength,c+=y.phraseLength}s?(y.state=0===c?e.EMPTY:e.MATCH,y.phraseLength=c):(y.state=e.NOMATCH,y.phraseLength=0,n.ast&&n.ast.setLength(i))})(t,i);break;case e.REP:((t,r)=>{let s,i,c,l;const u=o[t];if(0===u.max)return y.state=e.EMPTY,void(y.phraseLength=0);for(i=r,c=0,l=0,n.ast&&(s=n.ast.getLength());!(i>=a.length)&&(b(t+1,i),y.state!==e.NOMATCH)&&y.state!==e.EMPTY&&(l+=1,c+=y.phraseLength,i+=y.phraseLength,l!==u.max););y.state===e.EMPTY||l>=u.min?(y.state=0===c?e.EMPTY:e.MATCH,y.phraseLength=c):(y.state=e.NOMATCH,y.phraseLength=0,n.ast&&n.ast.setLength(s))})(t,i);break;case e.RNM:((t,r)=>{let i,l,p;const d=o[t],f=s[d.index],m=c[f.index];if(h||(l=n.ast&&n.ast.ruleDefined(d.index),l&&(i=n.ast.getLength(),n.ast.down(d.index,s[d.index].name))),m){const t=a.length-r;m(y,a,r,u),g(f,y,t,!0),y.state===e.ACTIVE&&(p=o,o=f.opcodes,b(0,r),o=p,m(y,a,r,u),g(f,y,t,!1))}else p=o,o=f.opcodes,b(0,r,y),o=p;h||l&&(y.state===e.NOMATCH?n.ast.setLength(i):n.ast.up(d.index,f.name,r,y.phraseLength))})(t,i);break;case e.TRG:((t,n)=>{const r=o[t];y.state=e.NOMATCH,n<a.length&&r.min<=a[n]&&a[n]<=r.max&&(y.state=e.MATCH,y.phraseLength=1)})(t,i);break;case e.TBS:((t,n)=>{const r=o[t],s=r.string.length;if(y.state=e.NOMATCH,n+s<=a.length){for(let e=0;e<s;e+=1)if(a[n+e]!==r.string[e])return;y.state=e.MATCH,y.phraseLength=s}})(t,i);break;case e.TLS:((t,n)=>{let r;const s=o[t];y.state=e.NOMATCH;const i=s.string.length;if(0!==i){if(n+i<=a.length){for(let e=0;e<i;e+=1)if(r=a[n+e],r>=65&&r<=90&&(r+=32),r!==s.string[e])return;y.state=e.MATCH,y.phraseLength=i}}else y.state=e.EMPTY})(t,i);break;case e.UDT:x(t,i);break;case e.AND:((t,n)=>{switch(h+=1,b(t+1,n),h-=1,y.phraseLength=0,y.state){case e.EMPTY:case e.MATCH:y.state=e.EMPTY;break;case e.NOMATCH:y.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${y.state}`)}})(t,i);break;case e.NOT:((t,n)=>{switch(h+=1,b(t+1,n),h-=1,y.phraseLength=0,y.state){case e.EMPTY:case e.MATCH:y.state=e.NOMATCH;break;case e.NOMATCH:y.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${y.state}`)}})(t,i);break;default:throw new Error(`${l}unrecognized operator`)}h||i+y.phraseLength>m&&(m=i+y.phraseLength),n.stats&&n.stats.collect(w,y),n.trace&&n.trace.up(w,y.state,i,y.phraseLength),p-=1}},z={stringToChars:e=>[...e].map(e=>e.codePointAt(0)),charsToString:(e,t,n)=>{let r=e;for(;!(void 0===t||t<0);){if(void 0===n){r=e.slice(t);break}if(n<=0)return"";r=e.slice(t,t+n);break}return String.fromCodePoint(...r)}},J={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,idName:e=>{switch(e){case J.ALT:return"ALT";case J.CAT:return"CAT";case J.REP:return"REP";case J.RNM:return"RNM";case J.TRG:return"TRG";case J.TBS:return"TBS";case J.TLS:return"TLS";case J.UDT:return"UDT";case J.AND:return"AND";case J.NOT:return"NOT";case J.ACTIVE:return"ACTIVE";case J.EMPTY:return"EMPTY";case J.MATCH:return"MATCH";case J.NOMATCH:return"NOMATCH";case J.SEM_PRE:return"SEM_PRE";case J.SEM_POST:return"SEM_POST";case J.SEM_OK:return"SEM_OK";default:return"UNRECOGNIZED STATE"}}};function W(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"json-pointer",lower:"json-pointer",index:0,isBkr:!1},this.rules[1]={name:"reference-token",lower:"reference-token",index:1,isBkr:!1},this.rules[2]={name:"unescaped",lower:"unescaped",index:2,isBkr:!1},this.rules[3]={name:"escaped",lower:"escaped",index:3,isBkr:!1},this.rules[4]={name:"array-location",lower:"array-location",index:4,isBkr:!1},this.rules[5]={name:"array-index",lower:"array-index",index:5,isBkr:!1},this.rules[6]={name:"array-dash",lower:"array-dash",index:6,isBkr:!1},this.rules[7]={name:"slash",lower:"slash",index:7,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:2,children:[2,3]},this.rules[0].opcodes[2]={type:4,index:7},this.rules[0].opcodes[3]={type:4,index:1},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:3,min:0,max:1/0},this.rules[1].opcodes[1]={type:1,children:[2,3]},this.rules[1].opcodes[2]={type:4,index:2},this.rules[1].opcodes[3]={type:4,index:3},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:1,children:[1,2,3]},this.rules[2].opcodes[1]={type:5,min:0,max:46},this.rules[2].opcodes[2]={type:5,min:48,max:125},this.rules[2].opcodes[3]={type:5,min:127,max:1114111},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2]},this.rules[3].opcodes[1]={type:7,string:[126]},this.rules[3].opcodes[2]={type:1,children:[3,4]},this.rules[3].opcodes[3]={type:7,string:[48]},this.rules[3].opcodes[4]={type:7,string:[49]},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2]},this.rules[5].opcodes[1]={type:6,string:[48]},this.rules[5].opcodes[2]={type:2,children:[3,4]},this.rules[5].opcodes[3]={type:5,min:49,max:57},this.rules[5].opcodes[4]={type:3,min:0,max:1/0},this.rules[5].opcodes[5]={type:5,min:48,max:57},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:7,string:[45]},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:7,string:[47]},this.toString=function(){let e="";return e+="; JavaScript Object Notation (JSON) Pointer ABNF syntax\n",e+="; https://datatracker.ietf.org/doc/html/rfc6901\n",e+="json-pointer = *( slash reference-token ) ; MODIFICATION: surrogate text rule used\n",e+="reference-token = *( unescaped / escaped )\n",e+="unescaped = %x00-2E / %x30-7D / %x7F-10FFFF\n",e+=" ; %x2F ('/') and %x7E ('~') are excluded from 'unescaped'\n",e+='escaped = "~" ( "0" / "1" )\n',e+=" ; representing '~' and '/', respectively\n",e+="\n",e+="; https://datatracker.ietf.org/doc/html/rfc6901#section-4\n",e+="array-location = array-index / array-dash\n",e+="array-index = %x30 / ( %x31-39 *(%x30-39) )\n",e+=' ; "0", or digits without a leading "0"\n',e+='array-dash = "-"\n',e+="\n",e+="; Surrogate named rules\n",e+='slash = "/"\n','; JavaScript Object Notation (JSON) Pointer ABNF syntax\n; https://datatracker.ietf.org/doc/html/rfc6901\njson-pointer = *( slash reference-token ) ; MODIFICATION: surrogate text rule used\nreference-token = *( unescaped / escaped )\nunescaped = %x00-2E / %x30-7D / %x7F-10FFFF\n ; %x2F (\'/\') and %x7E (\'~\') are excluded from \'unescaped\'\nescaped = "~" ( "0" / "1" )\n ; representing \'~\' and \'/\', respectively\n\n; https://datatracker.ietf.org/doc/html/rfc6901#section-4\narray-location = array-index / array-dash\narray-index = %x30 / ( %x31-39 *(%x30-39) )\n ; "0", or digits without a leading "0"\narray-dash = "-"\n\n; Surrogate named rules\nslash = "/"\n'}}class Y extends Error{constructor(e,t=void 0){if(super(e,t),this.name=this.constructor.name,"string"==typeof e&&(this.message=e),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack,null!=t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"cause")&&!("cause"in this)){const{cause:e}=t;this.cause=e,e instanceof Error&&"stack"in e&&(this.stack=`${this.stack}\nCAUSE: ${e.stack}`)}if(null!=t&&"object"==typeof t){const{cause:e,...n}=t;Object.assign(this,n)}}}const X=Y;new W;new W,new K,new W,new K,new W,new K,new W,new K;const Q=e=>{if("string"!=typeof e&&"number"!=typeof e)throw new TypeError("Reference token must be a string or number");return String(e).replace(/~/g,"~0").replace(/\//g,"~1")};const Z=class extends X{},ee=e=>{if(!Array.isArray(e))throw new TypeError("Reference tokens must be a list of strings or numbers");try{return 0===e.length?"":`/${e.map(e=>{if("string"!=typeof e&&"number"!=typeof e)throw new TypeError("Reference token must be a string or number");return Q(String(e))}).join("/")}`}catch(t){throw new Z("Unexpected error during JSON Pointer compilation",{cause:t,referenceTokens:e})}};class te extends Error{constructor(e,t=void 0){if(super(e,t),this.name=this.constructor.name,"string"==typeof e&&(this.message=e),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack,null!=t&&"object"==typeof t&&Object.hasOwn(t,"cause")&&!("cause"in this)){const{cause:e}=t;this.cause=e,e instanceof Error&&"stack"in e&&(this.stack=`${this.stack}\nCAUSE: ${e.stack}`)}if(null!=t&&"object"==typeof t){const{cause:e,...n}=t;Object.assign(this,n)}}}const ne=te;new function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"jsonpath-query",lower:"jsonpath-query",index:0,isBkr:!1},this.rules[1]={name:"segments",lower:"segments",index:1,isBkr:!1},this.rules[2]={name:"B",lower:"b",index:2,isBkr:!1},this.rules[3]={name:"S",lower:"s",index:3,isBkr:!1},this.rules[4]={name:"root-identifier",lower:"root-identifier",index:4,isBkr:!1},this.rules[5]={name:"selector",lower:"selector",index:5,isBkr:!1},this.rules[6]={name:"name-selector",lower:"name-selector",index:6,isBkr:!1},this.rules[7]={name:"string-literal",lower:"string-literal",index:7,isBkr:!1},this.rules[8]={name:"double-quoted",lower:"double-quoted",index:8,isBkr:!1},this.rules[9]={name:"single-quoted",lower:"single-quoted",index:9,isBkr:!1},this.rules[10]={name:"ESC",lower:"esc",index:10,isBkr:!1},this.rules[11]={name:"unescaped",lower:"unescaped",index:11,isBkr:!1},this.rules[12]={name:"escapable",lower:"escapable",index:12,isBkr:!1},this.rules[13]={name:"hexchar",lower:"hexchar",index:13,isBkr:!1},this.rules[14]={name:"non-surrogate",lower:"non-surrogate",index:14,isBkr:!1},this.rules[15]={name:"high-surrogate",lower:"high-surrogate",index:15,isBkr:!1},this.rules[16]={name:"low-surrogate",lower:"low-surrogate",index:16,isBkr:!1},this.rules[17]={name:"HEXDIG",lower:"hexdig",index:17,isBkr:!1},this.rules[18]={name:"wildcard-selector",lower:"wildcard-selector",index:18,isBkr:!1},this.rules[19]={name:"index-selector",lower:"index-selector",index:19,isBkr:!1},this.rules[20]={name:"int",lower:"int",index:20,isBkr:!1},this.rules[21]={name:"DIGIT1",lower:"digit1",index:21,isBkr:!1},this.rules[22]={name:"slice-selector",lower:"slice-selector",index:22,isBkr:!1},this.rules[23]={name:"start",lower:"start",index:23,isBkr:!1},this.rules[24]={name:"end",lower:"end",index:24,isBkr:!1},this.rules[25]={name:"step",lower:"step",index:25,isBkr:!1},this.rules[26]={name:"filter-selector",lower:"filter-selector",index:26,isBkr:!1},this.rules[27]={name:"logical-expr",lower:"logical-expr",index:27,isBkr:!1},this.rules[28]={name:"logical-or-expr",lower:"logical-or-expr",index:28,isBkr:!1},this.rules[29]={name:"logical-and-expr",lower:"logical-and-expr",index:29,isBkr:!1},this.rules[30]={name:"basic-expr",lower:"basic-expr",index:30,isBkr:!1},this.rules[31]={name:"paren-expr",lower:"paren-expr",index:31,isBkr:!1},this.rules[32]={name:"logical-not-op",lower:"logical-not-op",index:32,isBkr:!1},this.rules[33]={name:"test-expr",lower:"test-expr",index:33,isBkr:!1},this.rules[34]={name:"filter-query",lower:"filter-query",index:34,isBkr:!1},this.rules[35]={name:"rel-query",lower:"rel-query",index:35,isBkr:!1},this.rules[36]={name:"current-node-identifier",lower:"current-node-identifier",index:36,isBkr:!1},this.rules[37]={name:"comparison-expr",lower:"comparison-expr",index:37,isBkr:!1},this.rules[38]={name:"literal",lower:"literal",index:38,isBkr:!1},this.rules[39]={name:"comparable",lower:"comparable",index:39,isBkr:!1},this.rules[40]={name:"comparison-op",lower:"comparison-op",index:40,isBkr:!1},this.rules[41]={name:"singular-query",lower:"singular-query",index:41,isBkr:!1},this.rules[42]={name:"rel-singular-query",lower:"rel-singular-query",index:42,isBkr:!1},this.rules[43]={name:"abs-singular-query",lower:"abs-singular-query",index:43,isBkr:!1},this.rules[44]={name:"singular-query-segments",lower:"singular-query-segments",index:44,isBkr:!1},this.rules[45]={name:"name-segment",lower:"name-segment",index:45,isBkr:!1},this.rules[46]={name:"index-segment",lower:"index-segment",index:46,isBkr:!1},this.rules[47]={name:"number",lower:"number",index:47,isBkr:!1},this.rules[48]={name:"frac",lower:"frac",index:48,isBkr:!1},this.rules[49]={name:"exp",lower:"exp",index:49,isBkr:!1},this.rules[50]={name:"true",lower:"true",index:50,isBkr:!1},this.rules[51]={name:"false",lower:"false",index:51,isBkr:!1},this.rules[52]={name:"null",lower:"null",index:52,isBkr:!1},this.rules[53]={name:"function-name",lower:"function-name",index:53,isBkr:!1},this.rules[54]={name:"function-name-first",lower:"function-name-first",index:54,isBkr:!1},this.rules[55]={name:"function-name-char",lower:"function-name-char",index:55,isBkr:!1},this.rules[56]={name:"LCALPHA",lower:"lcalpha",index:56,isBkr:!1},this.rules[57]={name:"function-expr",lower:"function-expr",index:57,isBkr:!1},this.rules[58]={name:"function-argument",lower:"function-argument",index:58,isBkr:!1},this.rules[59]={name:"segment",lower:"segment",index:59,isBkr:!1},this.rules[60]={name:"child-segment",lower:"child-segment",index:60,isBkr:!1},this.rules[61]={name:"bracketed-selection",lower:"bracketed-selection",index:61,isBkr:!1},this.rules[62]={name:"member-name-shorthand",lower:"member-name-shorthand",index:62,isBkr:!1},this.rules[63]={name:"name-first",lower:"name-first",index:63,isBkr:!1},this.rules[64]={name:"name-char",lower:"name-char",index:64,isBkr:!1},this.rules[65]={name:"DIGIT",lower:"digit",index:65,isBkr:!1},this.rules[66]={name:"ALPHA",lower:"alpha",index:66,isBkr:!1},this.rules[67]={name:"descendant-segment",lower:"descendant-segment",index:67,isBkr:!1},this.rules[68]={name:"normalized-path",lower:"normalized-path",index:68,isBkr:!1},this.rules[69]={name:"normal-index-segment",lower:"normal-index-segment",index:69,isBkr:!1},this.rules[70]={name:"normal-selector",lower:"normal-selector",index:70,isBkr:!1},this.rules[71]={name:"normal-name-selector",lower:"normal-name-selector",index:71,isBkr:!1},this.rules[72]={name:"normal-single-quoted",lower:"normal-single-quoted",index:72,isBkr:!1},this.rules[73]={name:"normal-unescaped",lower:"normal-unescaped",index:73,isBkr:!1},this.rules[74]={name:"normal-escapable",lower:"normal-escapable",index:74,isBkr:!1},this.rules[75]={name:"normal-hexchar",lower:"normal-hexchar",index:75,isBkr:!1},this.rules[76]={name:"normal-HEXDIG",lower:"normal-hexdig",index:76,isBkr:!1},this.rules[77]={name:"normal-index-selector",lower:"normal-index-selector",index:77,isBkr:!1},this.rules[78]={name:"dot-prefix",lower:"dot-prefix",index:78,isBkr:!1},this.rules[79]={name:"double-dot-prefix",lower:"double-dot-prefix",index:79,isBkr:!1},this.rules[80]={name:"left-bracket",lower:"left-bracket",index:80,isBkr:!1},this.rules[81]={name:"right-bracket",lower:"right-bracket",index:81,isBkr:!1},this.rules[82]={name:"left-paren",lower:"left-paren",index:82,isBkr:!1},this.rules[83]={name:"right-paren",lower:"right-paren",index:83,isBkr:!1},this.rules[84]={name:"comma",lower:"comma",index:84,isBkr:!1},this.rules[85]={name:"colon",lower:"colon",index:85,isBkr:!1},this.rules[86]={name:"dquote",lower:"dquote",index:86,isBkr:!1},this.rules[87]={name:"squote",lower:"squote",index:87,isBkr:!1},this.rules[88]={name:"questionmark",lower:"questionmark",index:88,isBkr:!1},this.rules[89]={name:"disjunction",lower:"disjunction",index:89,isBkr:!1},this.rules[90]={name:"conjunction",lower:"conjunction",index:90,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,2]},this.rules[0].opcodes[1]={type:4,index:4},this.rules[0].opcodes[2]={type:4,index:1},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:3,min:0,max:1/0},this.rules[1].opcodes[1]={type:2,children:[2,3]},this.rules[1].opcodes[2]={type:4,index:3},this.rules[1].opcodes[3]={type:4,index:59},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:6,string:[32]},this.rules[2].opcodes[2]={type:6,string:[9]},this.rules[2].opcodes[3]={type:6,string:[10]},this.rules[2].opcodes[4]={type:6,string:[13]},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:0,max:1/0},this.rules[3].opcodes[1]={type:4,index:2},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:7,string:[36]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[5].opcodes[1]={type:4,index:6},this.rules[5].opcodes[2]={type:4,index:18},this.rules[5].opcodes[3]={type:4,index:22},this.rules[5].opcodes[4]={type:4,index:19},this.rules[5].opcodes[5]={type:4,index:26},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:4,index:7},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,6]},this.rules[7].opcodes[1]={type:2,children:[2,3,5]},this.rules[7].opcodes[2]={type:4,index:86},this.rules[7].opcodes[3]={type:3,min:0,max:1/0},this.rules[7].opcodes[4]={type:4,index:8},this.rules[7].opcodes[5]={type:4,index:86},this.rules[7].opcodes[6]={type:2,children:[7,8,10]},this.rules[7].opcodes[7]={type:4,index:87},this.rules[7].opcodes[8]={type:3,min:0,max:1/0},this.rules[7].opcodes[9]={type:4,index:9},this.rules[7].opcodes[10]={type:4,index:87},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:1,children:[1,2,3,6]},this.rules[8].opcodes[1]={type:4,index:11},this.rules[8].opcodes[2]={type:6,string:[39]},this.rules[8].opcodes[3]={type:2,children:[4,5]},this.rules[8].opcodes[4]={type:4,index:10},this.rules[8].opcodes[5]={type:6,string:[34]},this.rules[8].opcodes[6]={type:2,children:[7,8]},this.rules[8].opcodes[7]={type:4,index:10},this.rules[8].opcodes[8]={type:4,index:12},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2,3,6]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:6,string:[34]},this.rules[9].opcodes[3]={type:2,children:[4,5]},this.rules[9].opcodes[4]={type:4,index:10},this.rules[9].opcodes[5]={type:6,string:[39]},this.rules[9].opcodes[6]={type:2,children:[7,8]},this.rules[9].opcodes[7]={type:4,index:10},this.rules[9].opcodes[8]={type:4,index:12},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[92]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[11].opcodes[1]={type:5,min:32,max:33},this.rules[11].opcodes[2]={type:5,min:35,max:38},this.rules[11].opcodes[3]={type:5,min:40,max:91},this.rules[11].opcodes[4]={type:5,min:93,max:55295},this.rules[11].opcodes[5]={type:5,min:57344,max:1114111},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8]},this.rules[12].opcodes[1]={type:6,string:[98]},this.rules[12].opcodes[2]={type:6,string:[102]},this.rules[12].opcodes[3]={type:6,string:[110]},this.rules[12].opcodes[4]={type:6,string:[114]},this.rules[12].opcodes[5]={type:6,string:[116]},this.rules[12].opcodes[6]={type:7,string:[47]},this.rules[12].opcodes[7]={type:7,string:[92]},this.rules[12].opcodes[8]={type:2,children:[9,10]},this.rules[12].opcodes[9]={type:6,string:[117]},this.rules[12].opcodes[10]={type:4,index:13},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:1,children:[1,2]},this.rules[13].opcodes[1]={type:4,index:14},this.rules[13].opcodes[2]={type:2,children:[3,4,5,6]},this.rules[13].opcodes[3]={type:4,index:15},this.rules[13].opcodes[4]={type:7,string:[92]},this.rules[13].opcodes[5]={type:6,string:[117]},this.rules[13].opcodes[6]={type:4,index:16},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:1,children:[1,11]},this.rules[14].opcodes[1]={type:2,children:[2,9]},this.rules[14].opcodes[2]={type:1,children:[3,4,5,6,7,8]},this.rules[14].opcodes[3]={type:4,index:65},this.rules[14].opcodes[4]={type:7,string:[97]},this.rules[14].opcodes[5]={type:7,string:[98]},this.rules[14].opcodes[6]={type:7,string:[99]},this.rules[14].opcodes[7]={type:7,string:[101]},this.rules[14].opcodes[8]={type:7,string:[102]},this.rules[14].opcodes[9]={type:3,min:3,max:3},this.rules[14].opcodes[10]={type:4,index:17},this.rules[14].opcodes[11]={type:2,children:[12,13,14]},this.rules[14].opcodes[12]={type:7,string:[100]},this.rules[14].opcodes[13]={type:5,min:48,max:55},this.rules[14].opcodes[14]={type:3,min:2,max:2},this.rules[14].opcodes[15]={type:4,index:17},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2,7]},this.rules[15].opcodes[1]={type:7,string:[100]},this.rules[15].opcodes[2]={type:1,children:[3,4,5,6]},this.rules[15].opcodes[3]={type:7,string:[56]},this.rules[15].opcodes[4]={type:7,string:[57]},this.rules[15].opcodes[5]={type:7,string:[97]},this.rules[15].opcodes[6]={type:7,string:[98]},this.rules[15].opcodes[7]={type:3,min:2,max:2},this.rules[15].opcodes[8]={type:4,index:17},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,2,7]},this.rules[16].opcodes[1]={type:7,string:[100]},this.rules[16].opcodes[2]={type:1,children:[3,4,5,6]},this.rules[16].opcodes[3]={type:7,string:[99]},this.rules[16].opcodes[4]={type:7,string:[100]},this.rules[16].opcodes[5]={type:7,string:[101]},this.rules[16].opcodes[6]={type:7,string:[102]},this.rules[16].opcodes[7]={type:3,min:2,max:2},this.rules[16].opcodes[8]={type:4,index:17},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,2,3,4,5,6,7]},this.rules[17].opcodes[1]={type:4,index:65},this.rules[17].opcodes[2]={type:7,string:[97]},this.rules[17].opcodes[3]={type:7,string:[98]},this.rules[17].opcodes[4]={type:7,string:[99]},this.rules[17].opcodes[5]={type:7,string:[100]},this.rules[17].opcodes[6]={type:7,string:[101]},this.rules[17].opcodes[7]={type:7,string:[102]},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:7,string:[42]},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:4,index:20},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:1,children:[1,2]},this.rules[20].opcodes[1]={type:7,string:[48]},this.rules[20].opcodes[2]={type:2,children:[3,5,6]},this.rules[20].opcodes[3]={type:3,min:0,max:1},this.rules[20].opcodes[4]={type:7,string:[45]},this.rules[20].opcodes[5]={type:4,index:21},this.rules[20].opcodes[6]={type:3,min:0,max:1/0},this.rules[20].opcodes[7]={type:4,index:65},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:5,min:49,max:57},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:2,children:[1,5,6,7,11]},this.rules[22].opcodes[1]={type:3,min:0,max:1},this.rules[22].opcodes[2]={type:2,children:[3,4]},this.rules[22].opcodes[3]={type:4,index:23},this.rules[22].opcodes[4]={type:4,index:3},this.rules[22].opcodes[5]={type:4,index:85},this.rules[22].opcodes[6]={type:4,index:3},this.rules[22].opcodes[7]={type:3,min:0,max:1},this.rules[22].opcodes[8]={type:2,children:[9,10]},this.rules[22].opcodes[9]={type:4,index:24},this.rules[22].opcodes[10]={type:4,index:3},this.rules[22].opcodes[11]={type:3,min:0,max:1},this.rules[22].opcodes[12]={type:2,children:[13,14]},this.rules[22].opcodes[13]={type:4,index:85},this.rules[22].opcodes[14]={type:3,min:0,max:1},this.rules[22].opcodes[15]={type:2,children:[16,17]},this.rules[22].opcodes[16]={type:4,index:3},this.rules[22].opcodes[17]={type:4,index:25},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:4,index:20},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:4,index:20},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:4,index:20},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:2,children:[1,2,3]},this.rules[26].opcodes[1]={type:4,index:88},this.rules[26].opcodes[2]={type:4,index:3},this.rules[26].opcodes[3]={type:4,index:27},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:4,index:28},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:29},this.rules[28].opcodes[2]={type:3,min:0,max:1/0},this.rules[28].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[28].opcodes[4]={type:4,index:3},this.rules[28].opcodes[5]={type:4,index:89},this.rules[28].opcodes[6]={type:4,index:3},this.rules[28].opcodes[7]={type:4,index:29},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:2,children:[1,2]},this.rules[29].opcodes[1]={type:4,index:30},this.rules[29].opcodes[2]={type:3,min:0,max:1/0},this.rules[29].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[29].opcodes[4]={type:4,index:3},this.rules[29].opcodes[5]={type:4,index:90},this.rules[29].opcodes[6]={type:4,index:3},this.rules[29].opcodes[7]={type:4,index:30},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:1,children:[1,2,3]},this.rules[30].opcodes[1]={type:4,index:31},this.rules[30].opcodes[2]={type:4,index:37},this.rules[30].opcodes[3]={type:4,index:33},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:2,children:[1,5,6,7,8,9]},this.rules[31].opcodes[1]={type:3,min:0,max:1},this.rules[31].opcodes[2]={type:2,children:[3,4]},this.rules[31].opcodes[3]={type:4,index:32},this.rules[31].opcodes[4]={type:4,index:3},this.rules[31].opcodes[5]={type:4,index:82},this.rules[31].opcodes[6]={type:4,index:3},this.rules[31].opcodes[7]={type:4,index:27},this.rules[31].opcodes[8]={type:4,index:3},this.rules[31].opcodes[9]={type:4,index:83},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:7,string:[33]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:2,children:[1,5]},this.rules[33].opcodes[1]={type:3,min:0,max:1},this.rules[33].opcodes[2]={type:2,children:[3,4]},this.rules[33].opcodes[3]={type:4,index:32},this.rules[33].opcodes[4]={type:4,index:3},this.rules[33].opcodes[5]={type:1,children:[6,7]},this.rules[33].opcodes[6]={type:4,index:34},this.rules[33].opcodes[7]={type:4,index:57},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:1,children:[1,2]},this.rules[34].opcodes[1]={type:4,index:35},this.rules[34].opcodes[2]={type:4,index:0},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:2,children:[1,2]},this.rules[35].opcodes[1]={type:4,index:36},this.rules[35].opcodes[2]={type:4,index:1},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:7,string:[64]},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:2,children:[1,2,3,4,5]},this.rules[37].opcodes[1]={type:4,index:39},this.rules[37].opcodes[2]={type:4,index:3},this.rules[37].opcodes[3]={type:4,index:40},this.rules[37].opcodes[4]={type:4,index:3},this.rules[37].opcodes[5]={type:4,index:39},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[38].opcodes[1]={type:4,index:47},this.rules[38].opcodes[2]={type:4,index:7},this.rules[38].opcodes[3]={type:4,index:50},this.rules[38].opcodes[4]={type:4,index:51},this.rules[38].opcodes[5]={type:4,index:52},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:1,children:[1,2,3]},this.rules[39].opcodes[1]={type:4,index:41},this.rules[39].opcodes[2]={type:4,index:57},this.rules[39].opcodes[3]={type:4,index:38},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2,3,4,5,6]},this.rules[40].opcodes[1]={type:7,string:[61,61]},this.rules[40].opcodes[2]={type:7,string:[33,61]},this.rules[40].opcodes[3]={type:7,string:[60,61]},this.rules[40].opcodes[4]={type:7,string:[62,61]},this.rules[40].opcodes[5]={type:7,string:[60]},this.rules[40].opcodes[6]={type:7,string:[62]},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:1,children:[1,2]},this.rules[41].opcodes[1]={type:4,index:42},this.rules[41].opcodes[2]={type:4,index:43},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:4,index:36},this.rules[42].opcodes[2]={type:4,index:44},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:2,children:[1,2]},this.rules[43].opcodes[1]={type:4,index:4},this.rules[43].opcodes[2]={type:4,index:44},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:3,min:0,max:1/0},this.rules[44].opcodes[1]={type:2,children:[2,3]},this.rules[44].opcodes[2]={type:4,index:3},this.rules[44].opcodes[3]={type:1,children:[4,5]},this.rules[44].opcodes[4]={type:4,index:45},this.rules[44].opcodes[5]={type:4,index:46},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:1,children:[1,5]},this.rules[45].opcodes[1]={type:2,children:[2,3,4]},this.rules[45].opcodes[2]={type:4,index:80},this.rules[45].opcodes[3]={type:4,index:6},this.rules[45].opcodes[4]={type:4,index:81},this.rules[45].opcodes[5]={type:2,children:[6,7]},this.rules[45].opcodes[6]={type:4,index:78},this.rules[45].opcodes[7]={type:4,index:62},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:2,children:[1,2,3]},this.rules[46].opcodes[1]={type:4,index:80},this.rules[46].opcodes[2]={type:4,index:19},this.rules[46].opcodes[3]={type:4,index:81},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:2,children:[1,4,6]},this.rules[47].opcodes[1]={type:1,children:[2,3]},this.rules[47].opcodes[2]={type:4,index:20},this.rules[47].opcodes[3]={type:7,string:[45,48]},this.rules[47].opcodes[4]={type:3,min:0,max:1},this.rules[47].opcodes[5]={type:4,index:48},this.rules[47].opcodes[6]={type:3,min:0,max:1},this.rules[47].opcodes[7]={type:4,index:49},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:2,children:[1,2]},this.rules[48].opcodes[1]={type:7,string:[46]},this.rules[48].opcodes[2]={type:3,min:1,max:1/0},this.rules[48].opcodes[3]={type:4,index:65},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:2,children:[1,2,6]},this.rules[49].opcodes[1]={type:7,string:[101]},this.rules[49].opcodes[2]={type:3,min:0,max:1},this.rules[49].opcodes[3]={type:1,children:[4,5]},this.rules[49].opcodes[4]={type:7,string:[45]},this.rules[49].opcodes[5]={type:7,string:[43]},this.rules[49].opcodes[6]={type:3,min:1,max:1/0},this.rules[49].opcodes[7]={type:4,index:65},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[116,114,117,101]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[102,97,108,115,101]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[110,117,108,108]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:4,index:54},this.rules[53].opcodes[2]={type:3,min:0,max:1/0},this.rules[53].opcodes[3]={type:4,index:55},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:4,index:56},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:1,children:[1,2,3]},this.rules[55].opcodes[1]={type:4,index:54},this.rules[55].opcodes[2]={type:7,string:[95]},this.rules[55].opcodes[3]={type:4,index:65},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:5,min:97,max:122},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:2,children:[1,2,3,4,13,14]},this.rules[57].opcodes[1]={type:4,index:53},this.rules[57].opcodes[2]={type:4,index:82},this.rules[57].opcodes[3]={type:4,index:3},this.rules[57].opcodes[4]={type:3,min:0,max:1},this.rules[57].opcodes[5]={type:2,children:[6,7]},this.rules[57].opcodes[6]={type:4,index:58},this.rules[57].opcodes[7]={type:3,min:0,max:1/0},this.rules[57].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[57].opcodes[9]={type:4,index:3},this.rules[57].opcodes[10]={type:4,index:84},this.rules[57].opcodes[11]={type:4,index:3},this.rules[57].opcodes[12]={type:4,index:58},this.rules[57].opcodes[13]={type:4,index:3},this.rules[57].opcodes[14]={type:4,index:83},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[58].opcodes[1]={type:4,index:27},this.rules[58].opcodes[2]={type:4,index:34},this.rules[58].opcodes[3]={type:4,index:57},this.rules[58].opcodes[4]={type:4,index:38},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:1,children:[1,2]},this.rules[59].opcodes[1]={type:4,index:60},this.rules[59].opcodes[2]={type:4,index:67},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:1,children:[1,2]},this.rules[60].opcodes[1]={type:4,index:61},this.rules[60].opcodes[2]={type:2,children:[3,4]},this.rules[60].opcodes[3]={type:4,index:78},this.rules[60].opcodes[4]={type:1,children:[5,6]},this.rules[60].opcodes[5]={type:4,index:18},this.rules[60].opcodes[6]={type:4,index:62},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3,4,10,11]},this.rules[61].opcodes[1]={type:4,index:80},this.rules[61].opcodes[2]={type:4,index:3},this.rules[61].opcodes[3]={type:4,index:5},this.rules[61].opcodes[4]={type:3,min:0,max:1/0},this.rules[61].opcodes[5]={type:2,children:[6,7,8,9]},this.rules[61].opcodes[6]={type:4,index:3},this.rules[61].opcodes[7]={type:4,index:84},this.rules[61].opcodes[8]={type:4,index:3},this.rules[61].opcodes[9]={type:4,index:5},this.rules[61].opcodes[10]={type:4,index:3},this.rules[61].opcodes[11]={type:4,index:81},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:2,children:[1,2]},this.rules[62].opcodes[1]={type:4,index:63},this.rules[62].opcodes[2]={type:3,min:0,max:1/0},this.rules[62].opcodes[3]={type:4,index:64},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[63].opcodes[1]={type:4,index:66},this.rules[63].opcodes[2]={type:7,string:[95]},this.rules[63].opcodes[3]={type:5,min:128,max:55295},this.rules[63].opcodes[4]={type:5,min:57344,max:1114111},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:1,children:[1,2]},this.rules[64].opcodes[1]={type:4,index:63},this.rules[64].opcodes[2]={type:4,index:65},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:5,min:48,max:57},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:1,children:[1,2]},this.rules[66].opcodes[1]={type:5,min:65,max:90},this.rules[66].opcodes[2]={type:5,min:97,max:122},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:2,children:[1,2]},this.rules[67].opcodes[1]={type:4,index:79},this.rules[67].opcodes[2]={type:1,children:[3,4,5]},this.rules[67].opcodes[3]={type:4,index:61},this.rules[67].opcodes[4]={type:4,index:18},this.rules[67].opcodes[5]={type:4,index:62},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:2,children:[1,2]},this.rules[68].opcodes[1]={type:4,index:4},this.rules[68].opcodes[2]={type:3,min:0,max:1/0},this.rules[68].opcodes[3]={type:4,index:69},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:2,children:[1,2,3]},this.rules[69].opcodes[1]={type:4,index:80},this.rules[69].opcodes[2]={type:4,index:70},this.rules[69].opcodes[3]={type:4,index:81},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:1,children:[1,2]},this.rules[70].opcodes[1]={type:4,index:71},this.rules[70].opcodes[2]={type:4,index:77},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:2,children:[1,2,4]},this.rules[71].opcodes[1]={type:4,index:87},this.rules[71].opcodes[2]={type:3,min:0,max:1/0},this.rules[71].opcodes[3]={type:4,index:72},this.rules[71].opcodes[4]={type:4,index:87},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:1,children:[1,2]},this.rules[72].opcodes[1]={type:4,index:73},this.rules[72].opcodes[2]={type:2,children:[3,4]},this.rules[72].opcodes[3]={type:4,index:10},this.rules[72].opcodes[4]={type:4,index:74},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[73].opcodes[1]={type:5,min:32,max:38},this.rules[73].opcodes[2]={type:5,min:40,max:91},this.rules[73].opcodes[3]={type:5,min:93,max:55295},this.rules[73].opcodes[4]={type:5,min:57344,max:1114111},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8]},this.rules[74].opcodes[1]={type:6,string:[98]},this.rules[74].opcodes[2]={type:6,string:[102]},this.rules[74].opcodes[3]={type:6,string:[110]},this.rules[74].opcodes[4]={type:6,string:[114]},this.rules[74].opcodes[5]={type:6,string:[116]},this.rules[74].opcodes[6]={type:7,string:[39]},this.rules[74].opcodes[7]={type:7,string:[92]},this.rules[74].opcodes[8]={type:2,children:[9,10]},this.rules[74].opcodes[9]={type:6,string:[117]},this.rules[74].opcodes[10]={type:4,index:75},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:2,children:[1,2,3]},this.rules[75].opcodes[1]={type:7,string:[48]},this.rules[75].opcodes[2]={type:7,string:[48]},this.rules[75].opcodes[3]={type:1,children:[4,7,10,13]},this.rules[75].opcodes[4]={type:2,children:[5,6]},this.rules[75].opcodes[5]={type:7,string:[48]},this.rules[75].opcodes[6]={type:5,min:48,max:55},this.rules[75].opcodes[7]={type:2,children:[8,9]},this.rules[75].opcodes[8]={type:7,string:[48]},this.rules[75].opcodes[9]={type:6,string:[98]},this.rules[75].opcodes[10]={type:2,children:[11,12]},this.rules[75].opcodes[11]={type:7,string:[48]},this.rules[75].opcodes[12]={type:5,min:101,max:102},this.rules[75].opcodes[13]={type:2,children:[14,15]},this.rules[75].opcodes[14]={type:7,string:[49]},this.rules[75].opcodes[15]={type:4,index:76},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:4,index:65},this.rules[76].opcodes[2]={type:5,min:97,max:102},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:7,string:[48]},this.rules[77].opcodes[2]={type:2,children:[3,4]},this.rules[77].opcodes[3]={type:4,index:21},this.rules[77].opcodes[4]={type:3,min:0,max:1/0},this.rules[77].opcodes[5]={type:4,index:65},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:7,string:[46]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:7,string:[46,46]},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:7,string:[91]},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:7,string:[93]},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:7,string:[40]},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:7,string:[41]},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:7,string:[44]},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:7,string:[58]},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:6,string:[34]},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:6,string:[39]},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:7,string:[63]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:7,string:[124,124]},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:7,string:[38,38]},this.toString=function(){let e="";return e+="; JSONPath: Query Expressions for JSON\n",e+="; https://www.rfc-editor.org/rfc/rfc9535\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.1.1\n",e+="jsonpath-query = root-identifier segments\n",e+="segments = *(S segment)\n",e+="\n",e+="B = %x20 / ; Space\n",e+=" %x09 / ; Horizontal tab\n",e+=" %x0A / ; Line feed or New line\n",e+=" %x0D ; Carriage return\n",e+="S = *B ; optional blank space\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.2.1\n",e+='root-identifier = "$"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3\n",e+="selector = name-selector /\n",e+=" wildcard-selector /\n",e+=" slice-selector /\n",e+=" index-selector /\n",e+=" filter-selector\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.1.1\n",e+="name-selector = string-literal\n",e+="\n",e+='string-literal = dquote *double-quoted dquote / ; "string", MODIFICATION: surrogate text rule used\n',e+=" squote *single-quoted squote ; 'string', MODIFICATION: surrogate text rule used\n",e+="\n",e+="double-quoted = unescaped /\n",e+=" %x27 / ; '\n",e+=' ESC %x22 / ; \\"\n',e+=" ESC escapable\n",e+="\n",e+="single-quoted = unescaped /\n",e+=' %x22 / ; "\n',e+=" ESC %x27 / ; \\'\n",e+=" ESC escapable\n",e+="\n",e+="ESC = %x5C ; \\ backslash\n",e+="\n",e+="unescaped = %x20-21 / ; see RFC 8259\n",e+=' ; omit 0x22 "\n',e+=" %x23-26 /\n",e+=" ; omit 0x27 '\n",e+=" %x28-5B /\n",e+=" ; omit 0x5C \\\n",e+=" %x5D-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="\n",e+="escapable = %x62 / ; b BS backspace U+0008\n",e+=" %x66 / ; f FF form feed U+000C\n",e+=" %x6E / ; n LF line feed U+000A\n",e+=" %x72 / ; r CR carriage return U+000D\n",e+=" %x74 / ; t HT horizontal tab U+0009\n",e+=' "/" / ; / slash (solidus) U+002F\n',e+=' "\\" / ; \\ backslash (reverse solidus) U+005C\n',e+=" (%x75 hexchar) ; uXXXX U+XXXX\n",e+="\n",e+="hexchar = non-surrogate /\n",e+=' (high-surrogate "\\" %x75 low-surrogate)\n',e+='non-surrogate = ((DIGIT / "A"/"B"/"C" / "E"/"F") 3HEXDIG) /\n',e+=' ("D" %x30-37 2HEXDIG )\n',e+='high-surrogate = "D" ("8"/"9"/"A"/"B") 2HEXDIG\n',e+='low-surrogate = "D" ("C"/"D"/"E"/"F") 2HEXDIG\n',e+="\n",e+='HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.2.1\n",e+='wildcard-selector = "*"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.3.1\n",e+="index-selector = int ; decimal integer\n",e+="\n",e+='int = "0" /\n',e+=' (["-"] DIGIT1 *DIGIT) ; - optional\n',e+="DIGIT1 = %x31-39 ; 1-9 non-zero digit\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.4.1\n",e+="slice-selector = [start S] colon S [end S] [colon [S step ]] ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="start = int ; included in selection\n",e+="end = int ; not included in selection\n",e+="step = int ; default: 1\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.5.1\n",e+="filter-selector = questionmark S logical-expr ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="logical-expr = logical-or-expr\n",e+="logical-or-expr = logical-and-expr *(S disjunction S logical-and-expr) ; MODIFICATION: surrogate text rule used\n",e+=" ; disjunction\n",e+=" ; binds less tightly than conjunction\n",e+="logical-and-expr = basic-expr *(S conjunction S basic-expr) ; MODIFICATION: surrogate text rule used\n",e+=" ; conjunction\n",e+=" ; binds more tightly than disjunction\n",e+="\n",e+="basic-expr = paren-expr /\n",e+=" comparison-expr /\n",e+=" test-expr\n",e+="\n",e+="paren-expr = [logical-not-op S] left-paren S logical-expr S right-paren ; MODIFICATION: surrogate text rule used\n",e+=" ; parenthesized expression\n",e+='logical-not-op = "!" ; logical NOT operator\n',e+="\n",e+="test-expr = [logical-not-op S]\n",e+=" (filter-query / ; existence/non-existence\n",e+=" function-expr) ; LogicalType or NodesType\n",e+="filter-query = rel-query / jsonpath-query\n",e+="rel-query = current-node-identifier segments\n",e+='current-node-identifier = "@"\n',e+="\n",e+="comparison-expr = comparable S comparison-op S comparable\n",e+="literal = number / string-literal /\n",e+=" true / false / null\n",e+="comparable = singular-query / ; singular query value\n",e+=" function-expr / ; ValueType\n",e+=" literal\n",e+=" ; MODIFICATION: https://www.rfc-editor.org/errata/eid8352\n",e+='comparison-op = "==" / "!=" /\n',e+=' "<=" / ">=" /\n',e+=' "<" / ">"\n',e+="\n",e+="singular-query = rel-singular-query / abs-singular-query\n",e+="rel-singular-query = current-node-identifier singular-query-segments\n",e+="abs-singular-query = root-identifier singular-query-segments\n",e+="singular-query-segments = *(S (name-segment / index-segment))\n",e+="name-segment = (left-bracket name-selector right-bracket) / ; MODIFICATION: surrogate text rule used\n",e+=" (dot-prefix member-name-shorthand) ; MODIFICATION: surrogate text rule used\n",e+="index-segment = left-bracket index-selector right-bracket ; MODIFICATION: surrogate text rule used\n",e+="\n",e+='number = (int / "-0") [ frac ] [ exp ] ; decimal number\n',e+='frac = "." 1*DIGIT ; decimal fraction\n',e+='exp = "e" [ "-" / "+" ] 1*DIGIT ; decimal exponent\n',e+="true = %x74.72.75.65 ; true\n",e+="false = %x66.61.6c.73.65 ; false\n",e+="null = %x6e.75.6c.6c ; null\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.4\n",e+="function-name = function-name-first *function-name-char\n",e+="function-name-first = LCALPHA\n",e+='function-name-char = function-name-first / "_" / DIGIT\n',e+='LCALPHA = %x61-7A ; "a".."z"\n',e+="\n",e+="function-expr = function-name left-paren S [function-argument ; MODIFICATION: surrogate text rule used\n",e+=" *(S comma S function-argument)] S right-paren ; MODIFICATION: surrogate text rule used\n",e+="function-argument = logical-expr / ; MODIFICATION: https://www.rfc-editor.org/errata/eid8343\n",e+=" filter-query / ; (includes singular-query)\n",e+=" function-expr /\n",e+=" literal\n",e+="\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5\n",e+="segment = child-segment / descendant-segment\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.1.1\n",e+="child-segment = bracketed-selection /\n",e+=" (dot-prefix ; MODIFICATION: surrogate text rule used\n",e+=" (wildcard-selector /\n",e+=" member-name-shorthand))\n",e+="\n",e+="bracketed-selection = left-bracket S selector *(S comma S selector) S right-bracket\n",e+=" ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="member-name-shorthand = name-first *name-char\n",e+="name-first = ALPHA /\n",e+=' "_" /\n',e+=" %x80-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="name-char = name-first / DIGIT\n",e+="\n",e+="DIGIT = %x30-39 ; 0-9\n",e+="ALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.2.1\n",e+="descendant-segment = double-dot-prefix (bracketed-selection / ; MODIFICATION: surrogate text rule used\n",e+=" wildcard-selector /\n",e+=" member-name-shorthand)\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#name-normalized-paths\n",e+="normalized-path = root-identifier *(normal-index-segment)\n",e+="normal-index-segment = left-bracket normal-selector right-bracket ; MODIFICATION: surrogate text rule used\n",e+="normal-selector = normal-name-selector / normal-index-selector\n",e+="normal-name-selector = squote *normal-single-quoted squote ; 'string', MODIFICATION: surrogate text rule used\n",e+="normal-single-quoted = normal-unescaped /\n",e+=" ESC normal-escapable\n",e+="normal-unescaped = ; omit %x0-1F control codes\n",e+=" %x20-26 /\n",e+=" ; omit 0x27 '\n",e+=" %x28-5B /\n",e+=" ; omit 0x5C \\\n",e+=" %x5D-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="\n",e+="normal-escapable = %x62 / ; b BS backspace U+0008\n",e+=" %x66 / ; f FF form feed U+000C\n",e+=" %x6E / ; n LF line feed U+000A\n",e+=" %x72 / ; r CR carriage return U+000D\n",e+=" %x74 / ; t HT horizontal tab U+0009\n",e+=" \"'\" / ; ' apostrophe U+0027\n",e+=' "\\" / ; \\ backslash (reverse solidus) U+005C\n',e+=" (%x75 normal-hexchar)\n",e+=" ; certain values u00xx U+00XX\n",e+='normal-hexchar = "0" "0"\n',e+=" (\n",e+=' ("0" %x30-37) / ; "00"-"07"\n',e+=" ; omit U+0008-U+000A BS HT LF\n",e+=' ("0" %x62) / ; "0b"\n',e+=" ; omit U+000C-U+000D FF CR\n",e+=' ("0" %x65-66) / ; "0e"-"0f"\n',e+=' ("1" normal-HEXDIG)\n',e+=" )\n",e+='normal-HEXDIG = DIGIT / %x61-66 ; "0"-"9", "a"-"f"\n',e+='normal-index-selector = "0" / (DIGIT1 *DIGIT)\n',e+=" ; non-negative decimal integer\n",e+="\n",e+="; Surrogate named rules\n",e+='dot-prefix = "."\n',e+='double-dot-prefix = ".."\n',e+='left-bracket = "["\n',e+='right-bracket = "]"\n',e+='left-paren = "("\n',e+='right-paren = ")"\n',e+='comma = ","\n',e+='colon = ":"\n',e+='dquote = %x22 ; "\n',e+="squote = %x27 ; '\n",e+='questionmark = "?"\n',e+='disjunction = "||"\n',e+='conjunction = "&&"\n','; JSONPath: Query Expressions for JSON\n; https://www.rfc-editor.org/rfc/rfc9535\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.1.1\njsonpath-query = root-identifier segments\nsegments = *(S segment)\n\nB = %x20 / ; Space\n %x09 / ; Horizontal tab\n %x0A / ; Line feed or New line\n %x0D ; Carriage return\nS = *B ; optional blank space\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.2.1\nroot-identifier = "$"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3\nselector = name-selector /\n wildcard-selector /\n slice-selector /\n index-selector /\n filter-selector\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.1.1\nname-selector = string-literal\n\nstring-literal = dquote *double-quoted dquote / ; "string", MODIFICATION: surrogate text rule used\n squote *single-quoted squote ; \'string\', MODIFICATION: surrogate text rule used\n\ndouble-quoted = unescaped /\n %x27 / ; \'\n ESC %x22 / ; \\"\n ESC escapable\n\nsingle-quoted = unescaped /\n %x22 / ; "\n ESC %x27 / ; \\\'\n ESC escapable\n\nESC = %x5C ; \\ backslash\n\nunescaped = %x20-21 / ; see RFC 8259\n ; omit 0x22 "\n %x23-26 /\n ; omit 0x27 \'\n %x28-5B /\n ; omit 0x5C \\\n %x5D-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\n\nescapable = %x62 / ; b BS backspace U+0008\n %x66 / ; f FF form feed U+000C\n %x6E / ; n LF line feed U+000A\n %x72 / ; r CR carriage return U+000D\n %x74 / ; t HT horizontal tab U+0009\n "/" / ; / slash (solidus) U+002F\n "\\" / ; \\ backslash (reverse solidus) U+005C\n (%x75 hexchar) ; uXXXX U+XXXX\n\nhexchar = non-surrogate /\n (high-surrogate "\\" %x75 low-surrogate)\nnon-surrogate = ((DIGIT / "A"/"B"/"C" / "E"/"F") 3HEXDIG) /\n ("D" %x30-37 2HEXDIG )\nhigh-surrogate = "D" ("8"/"9"/"A"/"B") 2HEXDIG\nlow-surrogate = "D" ("C"/"D"/"E"/"F") 2HEXDIG\n\nHEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.2.1\nwildcard-selector = "*"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.3.1\nindex-selector = int ; decimal integer\n\nint = "0" /\n (["-"] DIGIT1 *DIGIT) ; - optional\nDIGIT1 = %x31-39 ; 1-9 non-zero digit\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.4.1\nslice-selector = [start S] colon S [end S] [colon [S step ]] ; MODIFICATION: surrogate text rule used\n\nstart = int ; included in selection\nend = int ; not included in selection\nstep = int ; default: 1\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.5.1\nfilter-selector = questionmark S logical-expr ; MODIFICATION: surrogate text rule used\n\nlogical-expr = logical-or-expr\nlogical-or-expr = logical-and-expr *(S disjunction S logical-and-expr) ; MODIFICATION: surrogate text rule used\n ; disjunction\n ; binds less tightly than conjunction\nlogical-and-expr = basic-expr *(S conjunction S basic-expr) ; MODIFICATION: surrogate text rule used\n ; conjunction\n ; binds more tightly than disjunction\n\nbasic-expr = paren-expr /\n comparison-expr /\n test-expr\n\nparen-expr = [logical-not-op S] left-paren S logical-expr S right-paren ; MODIFICATION: surrogate text rule used\n ; parenthesized expression\nlogical-not-op = "!" ; logical NOT operator\n\ntest-expr = [logical-not-op S]\n (filter-query / ; existence/non-existence\n function-expr) ; LogicalType or NodesType\nfilter-query = rel-query / jsonpath-query\nrel-query = current-node-identifier segments\ncurrent-node-identifier = "@"\n\ncomparison-expr = comparable S comparison-op S comparable\nliteral = number / string-literal /\n true / false / null\ncomparable = singular-query / ; singular query value\n function-expr / ; ValueType\n literal\n ; MODIFICATION: https://www.rfc-editor.org/errata/eid8352\ncomparison-op = "==" / "!=" /\n "<=" / ">=" /\n "<" / ">"\n\nsingular-query = rel-singular-query / abs-singular-query\nrel-singular-query = current-node-identifier singular-query-segments\nabs-singular-query = root-identifier singular-query-segments\nsingular-query-segments = *(S (name-segment / index-segment))\nname-segment = (left-bracket name-selector right-bracket) / ; MODIFICATION: surrogate text rule used\n (dot-prefix member-name-shorthand) ; MODIFICATION: surrogate text rule used\nindex-segment = left-bracket index-selector right-bracket ; MODIFICATION: surrogate text rule used\n\nnumber = (int / "-0") [ frac ] [ exp ] ; decimal number\nfrac = "." 1*DIGIT ; decimal fraction\nexp = "e" [ "-" / "+" ] 1*DIGIT ; decimal exponent\ntrue = %x74.72.75.65 ; true\nfalse = %x66.61.6c.73.65 ; false\nnull = %x6e.75.6c.6c ; null\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.4\nfunction-name = function-name-first *function-name-char\nfunction-name-first = LCALPHA\nfunction-name-char = function-name-first / "_" / DIGIT\nLCALPHA = %x61-7A ; "a".."z"\n\nfunction-expr = function-name left-paren S [function-argument ; MODIFICATION: surrogate text rule used\n *(S comma S function-argument)] S right-paren ; MODIFICATION: surrogate text rule used\nfunction-argument = logical-expr / ; MODIFICATION: https://www.rfc-editor.org/errata/eid8343\n filter-query / ; (includes singular-query)\n function-expr /\n literal\n\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5\nsegment = child-segment / descendant-segment\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.1.1\nchild-segment = bracketed-selection /\n (dot-prefix ; MODIFICATION: surrogate text rule used\n (wildcard-selector /\n member-name-shorthand))\n\nbracketed-selection = left-bracket S selector *(S comma S selector) S right-bracket\n ; MODIFICATION: surrogate text rule used\n\nmember-name-shorthand = name-first *name-char\nname-first = ALPHA /\n "_" /\n %x80-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\nname-char = name-first / DIGIT\n\nDIGIT = %x30-39 ; 0-9\nALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.2.1\ndescendant-segment = double-dot-prefix (bracketed-selection / ; MODIFICATION: surrogate text rule used\n wildcard-selector /\n member-name-shorthand)\n\n; https://www.rfc-editor.org/rfc/rfc9535#name-normalized-paths\nnormalized-path = root-identifier *(normal-index-segment)\nnormal-index-segment = left-bracket normal-selector right-bracket ; MODIFICATION: surrogate text rule used\nnormal-selector = normal-name-selector / normal-index-selector\nnormal-name-selector = squote *normal-single-quoted squote ; \'string\', MODIFICATION: surrogate text rule used\nnormal-single-quoted = normal-unescaped /\n ESC normal-escapable\nnormal-unescaped = ; omit %x0-1F control codes\n %x20-26 /\n ; omit 0x27 \'\n %x28-5B /\n ; omit 0x5C \\\n %x5D-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\n\nnormal-escapable = %x62 / ; b BS backspace U+0008\n %x66 / ; f FF form feed U+000C\n %x6E / ; n LF line feed U+000A\n %x72 / ; r CR carriage return U+000D\n %x74 / ; t HT horizontal tab U+0009\n "\'" / ; \' apostrophe U+0027\n "\\" / ; \\ backslash (reverse solidus) U+005C\n (%x75 normal-hexchar)\n ; certain values u00xx U+00XX\nnormal-hexchar = "0" "0"\n (\n ("0" %x30-37) / ; "00"-"07"\n ; omit U+0008-U+000A BS HT LF\n ("0" %x62) / ; "0b"\n ; omit U+000C-U+000D FF CR\n ("0" %x65-66) / ; "0e"-"0f"\n ("1" normal-HEXDIG)\n )\nnormal-HEXDIG = DIGIT / %x61-66 ; "0"-"9", "a"-"f"\nnormal-index-selector = "0" / (DIGIT1 *DIGIT)\n ; non-negative decimal integer\n\n; Surrogate named rules\ndot-prefix = "."\ndouble-dot-prefix = ".."\nleft-bracket = "["\nright-bracket = "]"\nleft-paren = "("\nright-paren = ")"\ncomma = ","\ncolon = ":"\ndquote = %x22 ; "\nsquote = %x27 ; \'\nquestionmark = "?"\ndisjunction = "||"\nconjunction = "&&"\n'}};const re=class extends ne{},se=e=>{if(!Array.isArray(e))throw new re("Selectors must be an array, got: "+typeof e,{selectors:e});try{return`$${e.map(e=>{if("string"==typeof e)return`['${(e=>{if("string"!=typeof e)throw new TypeError("Selector must be a string");let t="";for(const n of e){const e=n.codePointAt(0);switch(e){case 8:t+="\\b";break;case 9:t+="\\t";break;case 10:t+="\\n";break;case 12:t+="\\f";break;case 13:t+="\\r";break;case 39:t+="\\'";break;case 92:t+="\\\\";break;default:t+=e<=31?`\\u${e.toString(16).padStart(4,"0")}`:n}}return t})(e)}']`;if("number"==typeof e){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Index selector must be a non-negative safe integer, got: ${e}`);return`[${e}]`}throw new TypeError("Selector must be a string or non-negative integer, got: "+typeof e)}).join("")}`}catch(t){throw new re("Failed to compile normalized JSONPath",{cause:t,selectors:e})}},ie=(e,t,n,r)=>{const{realm:s}=e,{value:i}=n;if(s.isObject(t)&&s.hasProperty(t,i)){r(s.getProperty(t,i),i)}},oe=(e,t,n,r)=>{const{realm:s}=e,{value:i}=n;if(!s.isArray(t))return;const o=s.getLength(t),a=((e,t)=>e>=0?e:t+e)(i,o);if(a>=0&&a<o){r(s.getElement(t,a),a)}},ae=(e,t,n,r)=>{const{realm:s}=e;for(const[e,n]of s.entries(t))r(n,e)},ce=(e,t)=>e>=0?Math.min(e,t):Math.max(t+e,0),le=(e,t,n,r)=>{const{realm:s}=e,{start:i,end:o,step:a}=n;if(!s.isArray(t))return;const c=((e,t,n,r)=>{const s=n??1;if(0===s)return null;let i,o;if(s>0){const n=0,s=r,a=null!==e?ce(e,r):n,c=null!==t?ce(t,r):s;i=Math.max(a,0),o=Math.min(c,r)}else{const n=r-1,s=-r-1,a=null!==e?e>=0?Math.min(e,r-1):Math.max(r+e,-1):n,c=null!==t?t>=0?Math.min(t,r-1):Math.max(r+t,-1):s;o=Math.min(a,r-1),i=Math.max(c,-1)}return{lower:i,upper:o,step:s}})(i,o,a,s.getLength(t));if(null===c)return;const{lower:l,upper:u,step:h}=c;if(h>0)for(let e=l;e<u;e+=h){r(s.getElement(t,e),e)}else for(let e=u;e>l;e+=h){r(s.getElement(t,e),e)}},ue=(e,t,n,r)=>r.value,he=(e,t,n)=>{const{realm:r}=e,{selector:s}=n;switch(s.type){case"NameSelector":{const{value:e}=s;return r.isObject(t)&&r.hasProperty(t,e)?r.getProperty(t,e):void 0}case"IndexSelector":{const{value:e}=s;if(!r.isArray(t))return;const n=r.getLength(t),i=e>=0?e:n+e;return i>=0&&i<n?r.getElement(t,i):void 0}default:return}},pe=(e,t,n,r)=>{const{selectors:s}=n;for(const n of s)Oe(e,t,n,r)},de=(e,t,n)=>{const r=[],s=e=>{r.push(e)},{selector:i}=n;switch(i.type){case"BracketedSelection":pe(e,t,i,s);break;case"NameSelector":case"WildcardSelector":case"IndexSelector":case"SliceSelector":case"FilterSelector":Oe(e,t,i,s)}return r},fe=(e,t,n,r)=>{let s=n;for(const t of r){const n=[];if("DescendantSegment"===t.type){const r=s=>{const{realm:i}=e,o=de(e,s,t);n.push(...o);for(const[,e]of i.entries(s))r(e)};for(const e of s)r(e)}else for(const r of s){const s=de(e,r,t);n.push(...s)}s=n}return s},me=(e,t,n,r)=>{const{query:s}=r;let i;switch(s.type){case"RelQuery":i=((e,t,n,r)=>{const{segments:s}=r;return 0===s.length?[n]:fe(e,0,[n],s)})(e,0,n,s);break;case"JsonPathQuery":i=((e,t,n,r)=>{const{segments:s}=r;return 0===s.length?[t]:fe(e,0,[t],s)})(e,t,0,s);break;default:i=[]}return o=i,Object.defineProperty(o,"_isNodelist",{value:!0,enumerable:!1,writable:!1}),o;var o};let ye;const ge=(e,t,n,r)=>{const{name:s,arguments:i}=r,o=e.functions[s];if("function"!=typeof o)return;const a=i.map(r=>((e,t,n,r)=>{switch(r.type){case"Literal":case"RelSingularQuery":case"AbsSingularQuery":case"FunctionExpr":return xe(e,t,n,r);case"FilterQuery":return me(e,t,n,r);case"TestExpr":return"FilterQuery"===r.expression.type?me(e,t,n,r.expression):"FunctionExpr"===r.expression.type?xe(e,t,n,r.expression):ye(e,t,n,r);case"LogicalOrExpr":case"LogicalAndExpr":case"LogicalNotExpr":case"ComparisonExpr":return ye(e,t,n,r);default:return}})(e,t,n,r));return o(e.realm,...a)},xe=(e,t,n,r)=>{switch(r.type){case"Literal":return ue(e,t,n,r);case"RelSingularQuery":return((e,t,n,r)=>{let s=n;for(const t of r.segments)if(s=he(e,s,t),void 0===s)return;return s})(e,0,n,r);case"AbsSingularQuery":return((e,t,n,r)=>{let s=t;for(const t of r.segments)if(s=he(e,s,t),void 0===s)return;return s})(e,t,0,r);case"FunctionExpr":return ge(e,t,n,r);default:return}},be=(e,t,n,r)=>{const{left:s,op:i,right:o}=r,a=xe(e,t,n,s),c=xe(e,t,n,o);return e.realm.compare(a,i,c)},we=e=>Array.isArray(e),ve=(e,t,n,r)=>{switch(r.type){case"LogicalOrExpr":return!!ve(e,t,n,r.left)||ve(e,t,n,r.right);case"LogicalAndExpr":return!!ve(e,t,n,r.left)&&ve(e,t,n,r.right);case"LogicalNotExpr":return!ve(e,t,n,r.expression);case"TestExpr":{const{expression:s}=r;if("FilterQuery"===s.type){return me(e,t,n,s).length>0}if("FunctionExpr"===s.type){const r=ge(e,t,n,s);return"boolean"==typeof r?r:void 0!==r&&(we(r)?r.length>0:Boolean(r))}return!1}case"ComparisonExpr":return be(e,t,n,r);default:return!1}};ye=ve;const ke=ve,Se=(e,t,n,r)=>{const{realm:s,root:i}=e,{expression:o}=n;for(const[n,a]of s.entries(t)){ke(e,i,a,o)&&r(a,n)}},Oe=(e,t,n,r)=>{switch(n.type){case"NameSelector":ie(e,t,n,r);break;case"IndexSelector":oe(e,t,n,r);break;case"WildcardSelector":ae(e,t,n,r);break;case"SliceSelector":le(e,t,n,r);break;case"FilterSelector":Se(e,t,n,r)}};new Map;class Ee{node;key;index;parent;parentPath;inList;#e=!1;#t=!1;#n=!1;#r=!1;#s;#i=!1;constructor(e,t,n,r,s){this.node=e,this.parent=t,this.parentPath=n,this.key=r,this.index=s&&"number"==typeof r?r:void 0,this.inList=s}get shouldSkip(){return this.#e}get shouldStop(){return this.#t}get removed(){return this.#n}isRoot(){return null===this.parentPath}get depth(){let e=0,t=this.parentPath;for(;null!==t;)e+=1,t=t.parentPath;return e}getAncestry(){const e=[];let t=this.parentPath;for(;null!==t;)e.push(t),t=t.parentPath;return e}getAncestorNodes(){return this.getAncestry().map(e=>e.node)}getPathKeys(){const e=[];let t=this;for(;null!==t&&void 0!==t.key;){const{key:n,parent:r,parentPath:s}=t;if(G(r)&&"value"===n){if(!L(r.key))throw new TypeError("MemberElement.key must be a StringElement");e.unshift(r.key.toValue())}else R(s?.node)&&"number"==typeof n&&e.unshift(n);t=t.parentPath}return e}formatPath(e="jsonpointer"){const t=this.getPathKeys();return 0===t.length?"jsonpath"===e?"$":"":"jsonpath"===e?se(t):ee(t)}findParent(e){let t=this.parentPath;for(;null!==t;){if(e(t))return t;t=t.parentPath}return null}find(e){return e(this)?this:this.findParent(e)}skip(){this.#e=!0}stop(){this.#t=!0}replaceWith(e){this.#i&&console.warn("Warning: replaceWith() called on a stale Path. This path belongs to a node whose visit has already completed. The replacement will have no effect. To replace a parent node, do so from the parent's own visitor."),this.#r=!0,this.#s=e,this.node=e}remove(){this.#i&&console.warn("Warning: remove() called on a stale Path. This path belongs to a node whose visit has already completed. The removal will have no effect. To remove a parent node, do so from the parent's own visitor."),this.#n=!0}_getReplacementNode(){return this.#s}_wasReplaced(){return this.#r}_reset(){this.#e=!1,this.#t=!1,this.#n=!1,this.#r=!1,this.#s=void 0}_markStale(){this.#i=!0}}class Ae extends AggregateError{constructor(e,t,n){super(e,t,n),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const _e=Ae;class Ie extends Error{static[Symbol.hasInstance](e){return super[Symbol.hasInstance](e)||Function.prototype[Symbol.hasInstance].call(_e,e)}constructor(e,t){super(e,t),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const Te=Ie;const Me=class extends Te{constructor(e,t){if(super(e,t),null!=t&&"object"==typeof t){const{cause:e,...n}=t;Object.assign(this,n)}}};function Ce(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,n){return t.apply(this,arguments)};case 3:return function(e,n,r){return t.apply(this,arguments)};case 4:return function(e,n,r,s){return t.apply(this,arguments)};case 5:return function(e,n,r,s,i){return t.apply(this,arguments)};case 6:return function(e,n,r,s,i,o){return t.apply(this,arguments)};case 7:return function(e,n,r,s,i,o,a){return t.apply(this,arguments)};case 8:return function(e,n,r,s,i,o,a,c){return t.apply(this,arguments)};case 9:return function(e,n,r,s,i,o,a,c,l){return t.apply(this,arguments)};case 10:return function(e,n,r,s,i,o,a,c,l,u){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function je(e,t,n){return function(){for(var r=[],i=0,o=e,a=0,c=!1;a<t.length||i<arguments.length;){var l;a<t.length&&(!s(t[a])||i>=arguments.length)?l=t[a]:(l=arguments[i],i+=1),r[a]=l,s(l)?c=!0:o-=1,a+=1}return!c&&o<=0?n.apply(this,r):Ce(Math.max(0,o),je(e,r,n))}}var Ne=o(function(e,t){return 1===e?i(t):Ce(e,je(e,[],t))});const Fe=Ne;function De(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t}const Be=o(function(e,t){return e&&t});function $e(e,t,n){for(var r=0,s=n.length;r<s;)t=e(t,n[r]),r+=1;return t}const Le=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};function Pe(e){return"[object String]"===Object.prototype.toString.call(e)}const Ue=i(function(e){return!!Le(e)||!!e&&("object"==typeof e&&(!Pe(e)&&(0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))});var qe="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function Re(e,t,n){return function(r,s,i){if(Ue(i))return e(r,s,i);if(null==i)return s;if("function"==typeof i["fantasy-land/reduce"])return t(r,s,i,"fantasy-land/reduce");if(null!=i[qe])return n(r,s,i[qe]());if("function"==typeof i.next)return n(r,s,i);if("function"==typeof i.reduce)return t(r,s,i,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function Ve(e,t,n){for(var r=n.next();!r.done;)t=e(t,r.value),r=n.next();return t}function Ge(e,t,n,r){return n[r](e,t)}const He=Re($e,Ge,Ve);function Ke(e,t,n){return function(){if(0===arguments.length)return n();var r=arguments[arguments.length-1];if(!Le(r)){for(var s=0;s<e.length;){if("function"==typeof r[e[s]])return r[e[s]].apply(r,Array.prototype.slice.call(arguments,0,-1));s+=1}if(function(e){return null!=e&&"function"==typeof e["@@transducer/step"]}(r))return t.apply(null,Array.prototype.slice.call(arguments,0,-1))(r)}return n.apply(this,arguments)}}function ze(e,t){for(var n=0,r=t.length,s=Array(r);n<r;)s[n]=e(t[n]),n+=1;return s}const Je=function(){return this.xf["@@transducer/init"]()},We=function(e){return this.xf["@@transducer/result"](e)};var Ye=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=Je,e.prototype["@@transducer/result"]=We,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},e}();var Xe=o(Ke(["fantasy-land/map","map"],function(e){return function(t){return new Ye(e,t)}},function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return Fe(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return $e(function(n,r){return n[r]=e(t[r]),n},{},x(t));default:return ze(e,t)}}));const Qe=Xe;const Ze=o(function(e,t){return"function"==typeof t["fantasy-land/ap"]?t["fantasy-land/ap"](e):"function"==typeof e.ap?e.ap(t):"function"==typeof e?function(n){return e(n)(t(n))}:He(function(e,n){return function(e,t){var n;t=t||[];var r=(e=e||[]).length,s=t.length,i=[];for(n=0;n<r;)i[i.length]=e[n],n+=1;for(n=0;n<s;)i[i.length]=t[n],n+=1;return i}(e,Qe(n,t))},[],e)});var et=o(function(e,t){var n=Fe(e,t);return Fe(e,function(){return $e(Ze,Qe(n,arguments[0]),Array.prototype.slice.call(arguments,1))})});const tt=et;var nt=i(function(e){return tt(e.length,e)});const rt=nt;const st=o(function(e,t){return De(e)?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:rt(Be)(e,t)});function it(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function ot(e){return function t(n,r,a){switch(arguments.length){case 0:return t;case 1:return s(n)?t:o(function(t,r){return e(n,t,r)});case 2:return s(n)&&s(r)?t:s(n)?o(function(t,n){return e(t,r,n)}):s(r)?o(function(t,r){return e(n,t,r)}):i(function(t){return e(n,r,t)});default:return s(n)&&s(r)&&s(a)?t:s(n)&&s(r)?o(function(t,n){return e(t,n,a)}):s(n)&&s(a)?o(function(t,n){return e(t,r,n)}):s(r)&&s(a)?o(function(t,r){return e(n,t,r)}):s(n)?i(function(t){return e(t,r,a)}):s(r)?i(function(t){return e(n,t,a)}):s(a)?i(function(t){return e(n,r,t)}):e(n,r,a)}}}function at(e,t,n){for(var r=0,s=n.length;r<s;){if((t=e["@@transducer/step"](t,n[r]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r+=1}return e["@@transducer/result"](t)}var ct=o(function(e,t){return Ce(e.length,function(){return e.apply(t,arguments)})});const lt=ct;function ut(e,t,n){for(var r=n.next();!r.done;){if((t=e["@@transducer/step"](t,r.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r=n.next()}return e["@@transducer/result"](t)}function ht(e,t,n,r){return e["@@transducer/result"](n[r](lt(e["@@transducer/step"],e),t))}const pt=Re(at,ht,ut);var dt=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();var ft=ot(function(e,t,n){return pt("function"==typeof e?function(e){return new dt(e)}(e):e,t,n)});const mt=ft;function yt(e,t){return function(){var n=arguments.length;if(0===n)return t();var r=arguments[n-1];return Le(r)||"function"!=typeof r[e]?t.apply(this,arguments):r[e].apply(r,Array.prototype.slice.call(arguments,0,n-1))}}const gt=ot(yt("slice",function(e,t,n){return Array.prototype.slice.call(n,e,t)}));const xt=i(yt("tail",gt(1,1/0)));function bt(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return Ce(arguments[0].length,mt(it,arguments[0],xt(arguments)))}function wt(e,t){return function(e,t,n){var r,s;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(r=1/t;n<e.length;){if(0===(s=e[n])&&1/s===r)return n;n+=1}return-1}if(t!=t){for(;n<e.length;){if("number"==typeof(s=e[n])&&s!=s)return n;n+=1}return-1}return e.indexOf(t,n);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,n);case"object":if(null===t)return e.indexOf(t,n)}for(;n<e.length;){if(k(e[n],t))return n;n+=1}return-1}(t,e,0)>=0}function vt(e){return'"'+e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var kt=function(e){return(e<10?"0":"")+e};const St="function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+kt(e.getUTCMonth()+1)+"-"+kt(e.getUTCDate())+"T"+kt(e.getUTCHours())+":"+kt(e.getUTCMinutes())+":"+kt(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function Ot(e){return"[object Object]"===Object.prototype.toString.call(e)}var Et=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=Je,e.prototype["@@transducer/result"]=We,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},e}();function At(e){return function(t){return new Et(e,t)}}var _t=o(Ke(["fantasy-land/filter","filter"],At,function(e,t){return Ot(t)?$e(function(n,r){return e(t[r])&&(n[r]=t[r]),n},{},x(t)):(n=t,"[object Map]"===Object.prototype.toString.call(n)?function(e,t){for(var n=new Map,r=t.entries(),s=r.next();!s.done;)e(s.value[1])&&n.set(s.value[0],s.value[1]),s=r.next();return n}(e,t):function(e,t){for(var n=0,r=t.length,s=[];n<r;)e(t[n])&&(s[s.length]=t[n]),n+=1;return s}(e,t));var n}));const It=_t;const Tt=o(function(e,t){return It((n=e,function(){return!n.apply(this,arguments)}),t);var n});function Mt(e,t){var n=function(n){var r=t.concat([e]);return wt(n,r)?"<Circular>":Mt(n,r)},r=function(e,t){return ze(function(t){return vt(t)+": "+n(e[t])},t.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+ze(n,e).join(", ")+"))";case"[object Array]":return"["+ze(n,e).concat(r(e,Tt(function(e){return/^\d+$/.test(e)},x(e)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof e?"new Boolean("+n(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?n(NaN):vt(St(e)))+")";case"[object Map]":return"new Map("+n(Array.from(e))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof e?"new Number("+n(e.valueOf())+")":1/e==-1/0?"-0":e.toString(10);case"[object Set]":return"new Set("+n(Array.from(e).sort())+")";case"[object String]":return"object"==typeof e?"new String("+n(e.valueOf())+")":vt(e);case"[object Undefined]":return"undefined";default:if("function"==typeof e.toString){var s=e.toString();if("[object Object]"!==s)return s}return"{"+r(e,x(e)).join(", ")+"}"}}const Ct=i(function(e){return Mt(e,[])});const jt=o(function(e,t){return e||t});const Nt=o(function(e,t){return De(e)?function(){return e.apply(this,arguments)||t.apply(this,arguments)}:rt(jt)(e,t)});const Ft=rt(i(function(e){return!e}));const Dt=k(null);const Bt=Ft(Dt);const $t=o(function(e,t){if(e===t)return t;function n(e,t){if(e>t!=t>e)return t>e?t:e}var r=n(e,t);if(void 0!==r)return r;var s=n(typeof e,typeof t);if(void 0!==s)return s===typeof e?e:t;var i=Ct(e),o=n(i,Ct(t));return void 0!==o&&o===i?e:t}),Lt=Number.isInteger||function(e){return(e|0)===e};function Pt(e,t){return t[e<0?t.length+e:e]}const Ut=o(function(e,t){if(null!=t)return Lt(e)?Pt(e,t):t[e]});const qt=o(function(e,t){return Qe(Ut(e),t)});const Rt=i(function(e){return Fe(mt($t,0,qt("length",e)),function(){for(var t=0,n=e.length;t<n;){if(e[t].apply(this,arguments))return!0;t+=1}return!1})});var Vt=function(e,t){switch(arguments.length){case 0:return Vt;case 1:return function t(n){return 0===arguments.length?t:u(e,n)};default:return u(e,t)}};const Gt=Vt;const Ht=Fe(1,bt(b,Gt("GeneratorFunction")));const Kt=Fe(1,bt(b,Gt("AsyncFunction")));const zt=Rt([bt(b,Gt("Function")),Ht,Kt]);function Jt(e){return Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jt(e)}const Wt=function(e){return"object"===Jt(e)};var Yt=Fe(1,st(Bt,Nt(Wt,zt)));const Xt=Fe(1,st(Yt,bt(Ct,k("[object Promise]")))),Qt=e=>"number"==typeof e.startLine&&"number"==typeof e.startCharacter&&"number"==typeof e.startOffset&&"number"==typeof e.endLine&&"number"==typeof e.endCharacter&&"number"==typeof e.endOffset,Zt=(e,t)=>0===t.length||!!$(e)&&(!e.isMetaEmpty&&(!!e.hasMetaProperty("classes")&&t.every(t=>e.classes.includes(t))));class en extends I{constructor(e,t,n){super(e,t,n),this.element="sourceMap"}static transfer(e,t){t.startLine=e.startLine,t.startCharacter=e.startCharacter,t.startOffset=e.startOffset,t.endLine=e.endLine,t.endCharacter=e.endCharacter,t.endOffset=e.endOffset}static from(e){const{startLine:t,startCharacter:n,startOffset:r,endLine:s,endCharacter:i,endOffset:o}=e;if("number"!=typeof t||"number"!=typeof n||"number"!=typeof r||"number"!=typeof s||"number"!=typeof i||"number"!=typeof o)return;const a="sm1:"+[t,n,r,s,i,o].map(nn).join("");const c=new en(a);return c.startLine=t,c.startCharacter=n,c.startOffset=r,c.endLine=s,c.endCharacter=i,c.endOffset=o,c}applyTo(e){this.content&&([e.startLine,e.startCharacter,e.startOffset,e.endLine,e.endCharacter,e.endOffset]=function(e){const t=e.startsWith("sm1:")?e.slice(4):e,n=[];let r=0;for(let e=0;e<6;e++){const e=rn(t,r);n.push(e.value),r=e.next}return n}(this.content))}}const tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function nn(e){let t=e>>>0,n="";do{let e=31&t;t>>>=5,0!==t&&(e|=32),n+=tn[e]}while(0!==t);return n}function rn(e,t=0){let n=0,r=0,s=t;for(;;){const t=e[s++],i=tn.indexOf(t);if(-1===i)throw new Error(`Invalid Base64 VLQ char: ${t}`);if(n|=(31&i)<<r,r+=5,!!!(32&i))break}return{value:n>>>0,next:s}}const sn=en;const on=class extends Me{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};const an=class extends on{};const cn=class extends on{},ln=(e,t)=>{const{visited:n=new WeakMap}=t,r={...t,visited:n};if(n.has(e))return n.get(e);const s=dn(e);n.set(e,s);const{content:i}=e;return Array.isArray(i)?s.content=i.map(e=>ln(e,r)):$(i)?s.content=ln(i,r):s.content=i instanceof S?un(i,r):i,s},un=(e,t)=>{const{visited:n=new WeakMap}=t,r={...t,visited:n};if(n.has(e))return n.get(e);const{key:s,value:i}=e,o=void 0!==s?ln(s,r):void 0,a=void 0!==i?ln(i,r):void 0,c=new S(o,a);return n.set(e,c),c},hn=(e,t={})=>{if(e instanceof S)return un(e,t);if(e instanceof E)return((e,t)=>{const{visited:n=new WeakMap}=t,r={...t,visited:n};if(n.has(e))return n.get(e);const s=[...e].map(e=>ln(e,r)),i=new E(s);return n.set(e,i),i})(e,t);if($(e))return ln(e,t);throw new an("Value provided to cloneDeep function couldn't be cloned",{value:e})};hn.safe=e=>{try{return hn(e)}catch{return e}};const pn=e=>{const{key:t,value:n}=e;return new S(t,n)},dn=e=>{const t=new(0,e.constructor);t.element=e.element,e.isMetaEmpty||(t.meta=hn(e.meta)),e.isAttributesEmpty||(t.attributes=hn(e.attributes)),Qt(e)&&sn.transfer(e,t);const{content:n}=e;return $(n)?t.content=dn(n):Array.isArray(n)?t.content=[...n]:t.content=n instanceof S?pn(n):n,t},fn=e=>{if(e instanceof S)return pn(e);if(e instanceof E)return(e=>{const t=[...e];return new E(t)})(e);if($(e))return dn(e);throw new cn("Value provided to cloneShallow function couldn't be cloned",{value:e})};fn.safe=e=>{try{return fn(e)}catch{return e}};const mn=e=>{const t=e?.element;return void 0===t||"element"===t?"Element":`${t.charAt(0).toUpperCase()}${t.slice(1)}Element`},yn=e=>$(e),gn=e=>fn(e),xn=(e,t,n)=>{G(e)?e.value=n:Array.isArray(e)?e[t]=null===n?void 0:n:null===n?delete e[t]:e[t]=n},bn=e=>G(e)?["key","value"]:R(e)||V(e)?["content"]:[],wn=(e,t)=>{if(void 0!==e[t])return e[t];const n=t.length;for(const r in e){if(!r.includes("|"))continue;const s=r.indexOf(t);if(-1===s)continue;const i=0===s||"|"===r[s-1],o=s+n===r.length||"|"===r[s+n];if(i&&o)return e[r]}},vn=(e,t,n)=>{if(void 0===t)return null;const r=e,s=n?"leave":"enter",i=wn(r,t);if(!n&&"function"==typeof i)return i;if(null!=i){const e=i[s];if("function"==typeof e)return e}const o=r[s];if("function"==typeof o)return o;if(null!=o){const e=wn(o,t);if("function"==typeof e)return e}return null},kn=(e,t={})=>{const{visitFnGetter:n=vn,nodeTypeGetter:r=mn,exposeEdits:s=!1}=t,i=Symbol("internal-skip"),o=Symbol("break"),a=new Array(e.length).fill(i);return{enter(t){let c=t.node,l=!1;for(let u=0;u<e.length;u+=1)if(a[u]===i){const i=n(e[u],r(c),!1);if("function"==typeof i){const n=On(t,c),r=i.call(e[u],n);if(Xt(r))throw new Me("Async visitor not supported in sync mode",{visitor:e[u],visitFn:i});if(n.shouldStop){a[u]=o;break}if(n.shouldSkip&&(a[u]=c),n.removed)return void t.remove();if(n._wasReplaced()){const e=n._getReplacementNode();if(!s)return t.replaceWith(e),e;c=e,l=!0}else if(void 0!==r){if(!s)return t.replaceWith(r),r;c=r,l=!0}}}if(l)return t.replaceWith(c),c},leave(t){const s=t.node;for(let c=0;c<e.length;c+=1)if(a[c]===i){const i=n(e[c],r(s),!0);if("function"==typeof i){const n=On(t,s),r=i.call(e[c],n);if(Xt(r))throw new Me("Async visitor not supported in sync mode",{visitor:e[c],visitFn:i});if(n.shouldStop){a[c]=o;break}if(n.removed)return void t.remove();if(n._wasReplaced()){const e=n._getReplacementNode();return t.replaceWith(e),e}if(void 0!==r)return t.replaceWith(r),r}}else a[c]===s&&(a[c]=i)}}},Sn=(e,t={})=>{const{visitFnGetter:n=vn,nodeTypeGetter:r=mn,exposeEdits:s=!1}=t,i=Symbol("internal-skip"),o=Symbol("break"),a=new Array(e.length).fill(i);return{async enter(t){let c=t.node,l=!1;for(let u=0;u<e.length;u+=1)if(a[u]===i){const i=n(e[u],r(c),!1);if("function"==typeof i){const n=On(t,c),r=await i.call(e[u],n);if(n.shouldStop){a[u]=o;break}if(n.shouldSkip&&(a[u]=c),n.removed)return void t.remove();if(n._wasReplaced()){const e=n._getReplacementNode();if(!s)return t.replaceWith(e),e;c=e,l=!0}else if(void 0!==r){if(!s)return t.replaceWith(r),r;c=r,l=!0}}}if(l)return t.replaceWith(c),c},async leave(t){const s=t.node;for(let c=0;c<e.length;c+=1)if(a[c]===i){const i=n(e[c],r(s),!0);if("function"==typeof i){const n=On(t,s),r=await i.call(e[c],n);if(n.shouldStop){a[c]=o;break}if(n.removed)return void t.remove();if(n._wasReplaced()){const e=n._getReplacementNode();return t.replaceWith(e),e}if(void 0!==r)return t.replaceWith(r),r}}else a[c]===s&&(a[c]=i)}}};function On(e,t){return new Ee(t,e.parent,e.parentPath,e.key,e.inList)}function*En(e,t,n){const{keyMap:r,state:s,nodeTypeGetter:i,nodePredicate:o,nodeCloneFn:a,detectCycles:c,mutable:l,mutationFn:u}=n,h="function"==typeof r;let p,d,f=Array.isArray(e),m=[e],y=-1,g=[],x=e,b=null,w=null;const v=[];do{y+=1;const e=y===m.length;let n;const k=e&&0!==g.length;if(e){if(n=0===v.length?void 0:b?.key,x=d,d=v.pop(),w=b?.parentPath?.parentPath??null,k)if(l)for(const[e,t]of g)u(x,e,t);else if(f){x=x.slice();let e=0;for(const[t,n]of g){const r=t-e;null===n?(x.splice(r,1),e+=1):x[r]=n}}else{x=a(x);for(const[e,t]of g)x[e]=t}if(void 0!==p){y=p.index,m=p.keys,g=p.edits;const e=p.inArray;if(w=p.parentPath,p=p.prev,k&&!l){const t=e?y:m[y];g.push([t,x])}f=e}}else if(void 0!==d&&(n=f?y:m[y],x=d[n],void 0===x))continue;if(!Array.isArray(x)){if(!o(x))throw new Me(`Invalid AST Node: ${String(x)}`,{node:x});if(c&&v.includes(x))continue;b=new Ee(x,d,w,n,f);const r=vn(t,i(x),e);if(r){for(const[e,n]of Object.entries(s))t[e]=n;const i=yield{visitFn:r,path:b,isLeaving:e};if(b.shouldStop)break;if(b.shouldSkip&&!e)continue;if(b.removed){if(g.push([n,null]),!e)continue}else if(b._wasReplaced()){const t=b._getReplacementNode();if(g.push([n,t]),!e){if(!o(t))continue;x=t}}else if(void 0!==i&&(g.push([n,i]),!e)){if(!o(i))continue;x=i}b._markStale()}}if(!e){if(p={inArray:f,index:y,keys:m,edits:g,parentPath:w,prev:p},f=Array.isArray(x),f)m=x;else if(h)m=r(x);else{const e=i(x);m=void 0!==e?r[e]??[]:[]}y=-1,g=[],void 0!==d&&v.push(d),d=x,w=b}}while(void 0!==p);return 0!==g.length?g.at(-1)[1]:e}kn[Symbol.for("nodejs.util.promisify.custom")]=Sn;const An=(e,t,n={})=>{const r=En(e,t,{keyMap:n.keyMap??bn,state:n.state??{},nodeTypeGetter:n.nodeTypeGetter??mn,nodePredicate:n.nodePredicate??yn,nodeCloneFn:n.nodeCloneFn??gn,detectCycles:n.detectCycles??!0,mutable:n.mutable??!1,mutationFn:n.mutationFn??xn});let s=r.next();for(;!s.done;){const e=s.value,n=e.visitFn.call(t,e.path);if(Xt(n))throw new Me("Async visitor not supported in sync mode",{visitor:t,visitFn:e.visitFn});s=r.next(n)}return s.value},_n=async(e,t,n={})=>{const r=En(e,t,{keyMap:n.keyMap??bn,state:n.state??{},nodeTypeGetter:n.nodeTypeGetter??mn,nodePredicate:n.nodePredicate??yn,nodeCloneFn:n.nodeCloneFn??gn,detectCycles:n.detectCycles??!0,mutable:n.mutable??!1,mutationFn:n.mutationFn??xn});let s=r.next();for(;!s.done;){const e=s.value,n=await e.visitFn.call(t,e.path);s=r.next(n)}return s.value};An[Symbol.for("nodejs.util.promisify.custom")]=_n,Ee.prototype.traverse=function(e,t){return An(this.node,e,t)},Ee.prototype.traverseAsync=function(e,t){return _n(this.node,e,t)};var In=ot(function(e,t,n){var r,s={};for(r in n=n||{},t=t||{})l(r,t)&&(s[r]=l(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)l(r,n)&&!l(r,s)&&(s[r]=n[r]);return s});const Tn=In;var Mn=ot(function e(t,n,r){return Tn(function(n,r,s){return Ot(r)&&Ot(s)?e(t,r,s):t(n,r,s)},n,r)});const Cn=Mn;const jn=o(function(e,t){return Cn(function(e,t,n){return n},e,t)});const Nn=o(function(e,t){return null==t||t!=t?e:t});const Fn=ot(function(e,t,n){return Nn(e,Ut(t,n))});function Dn(e,t){for(var n=t,r=0;r<e.length;r+=1){if(null==n)return;var s=e[r];n=Lt(s)?Pt(s,n):n[s]}return n}const Bn=o(Dn);const $n=gt(0,-1);var Ln=o(function(e,t){return e.apply(this,t)});const Pn=Ln;const Un=Ft(zt);var qn=i(function(e){return null!=e&&"function"==typeof e["fantasy-land/empty"]?e["fantasy-land/empty"]():null!=e&&null!=e.constructor&&"function"==typeof e.constructor["fantasy-land/empty"]?e.constructor["fantasy-land/empty"]():null!=e&&"function"==typeof e.empty?e.empty():null!=e&&null!=e.constructor&&"function"==typeof e.constructor.empty?e.constructor.empty():e==Set||e instanceof Set?new Set:e==Map||e instanceof Map?new Map:Le(e)?[]:Pe(e)?"":Ot(e)?{}:p(e)?function(){return arguments}():function(e){var t=Object.prototype.toString.call(e);return"[object Uint8ClampedArray]"===t||"[object Int8Array]"===t||"[object Uint8Array]"===t||"[object Int16Array]"===t||"[object Uint16Array]"===t||"[object Int32Array]"===t||"[object Uint32Array]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object BigInt64Array]"===t||"[object BigUint64Array]"===t}(e)?e.constructor.from(""):void 0});const Rn=qn;const Vn=i(function(e){return null!=e&&k(e,Rn(e))});const Gn=st(Fe(1,zt(Array.isArray)?Array.isArray:bt(b,Gt("Array"))),Vn);const Hn=Fe(3,function(e,t,n){var r=Bn(e,n),s=Bn($n(e),n);if(!Un(r)&&!Gn(e)){var i=lt(r,s);return Pn(i,t)}});const Kn=class extends _{constructor(e,t,n){super(e||[],t,n),this.element="link"}get relation(){if(this.hasAttributesProperty("relation"))return this.attributes.get("relation")}set relation(e){this.attributes.set("relation",e)}get href(){if(this.hasAttributesProperty("href"))return this.attributes.get("href")}set href(e){this.attributes.set("href",e)}};const zn=class extends _{constructor(e,t,n){super(e||[],t,n),this.element="ref",this.path||(this.path="element")}get path(){if(this.hasAttributesProperty("path"))return this.attributes.get("path")}set path(e){this.attributes.set("path",e)}};const Jn=class extends I{constructor(e,t,n){super(e,t,n),this.element="annotation"}get code(){if(this.hasAttributesProperty("code"))return this.attributes.get("code")}set code(e){this.attributes.set("code",e)}};const Wn=class extends I{constructor(e,t,n){super(e,t,n),this.element="comment"}};const Yn=class extends F{constructor(e,t,n){super(e,t,n),this.element="parseResult"}get api(){return this.filter(e=>Zt(e,["api"])).first}get results(){return this.filter(e=>Zt(e,["result"]))}get result(){return this.results.first}get annotations(){return this.filter(e=>"annotation"===e.element)}get warnings(){return this.filter(e=>"annotation"===e.element&&Zt(e,["warning"]))}get errors(){return this.filter(e=>"annotation"===e.element&&Zt(e,["error"]))}get isEmpty(){return 0===this.reject(e=>"annotation"===e.element).length}replaceResult(e){const{result:t}=this;if(void 0===t)return!1;const n=this._content,r=n.findIndex(e=>e===t);return-1!==r&&(n[r]=e,!0)}},Xn=e=>e instanceof Kn,Qn=e=>e instanceof zn;const Zn=class{namespace;constructor(e){this.namespace=e||new this.Namespace}serialise(e){if(!(e instanceof this.namespace.elements.Element))throw new TypeError(`Given element \`${e}\` is not an Element instance`);const t={element:e.element};if(e.isMetaEmpty||(t.meta=this.serialiseObject(e.meta)),e.isAttributesEmpty||(t.attributes=this.serialiseObject(e.attributes)),!(e instanceof sn)){const n=sn.from(e);n&&(t.meta||(t.meta={}),t.meta.__mappings__=this.serialise(n))}const n=this.serialiseContent(e.content);return void 0!==n&&(t.content=n),t}deserialise(e){if(!e.element)throw new Error("Given value is not an object containing an element name");const t=new(this.namespace.getElementClass(e.element));let n;t.element!==e.element&&(t.element=e.element);let r=e.meta;if(e.meta?.__mappings__){const{__mappings__:t,...s}=e.meta;n=t,r=Object.keys(s).length>0?s:void 0}if(r&&this.deserialiseObject(r,t.meta),n){this.deserialise(n).applyTo(t)}e.attributes&&this.deserialiseObject(e.attributes,t.attributes);const s=this.deserialiseContent(e.content);return void 0===s&&null!==t.content||(t.content=s),t}serialiseContent(e){if(e instanceof this.namespace.elements.Element)return this.serialise(e);if(e instanceof this.namespace.KeyValuePair){const t=e,n={key:this.serialise(t.key)};return t.value&&(n.value=this.serialise(t.value)),n}if(e&&Array.isArray(e)){if(0===e.length)return;return e.map(e=>this.serialise(e))}return e}deserialiseContent(e){if(e){if(e.element)return this.deserialise(e);if(e.key){const t=new this.namespace.KeyValuePair(this.deserialise(e.key));return e.value&&(t.value=this.deserialise(e.value)),t}if(Array.isArray(e))return e.map(e=>this.deserialise(e))}return e}serialiseObject(e){const t={};if(e.forEach((e,n)=>{e&&(t[n.toValue()]=this.serialise(e))}),0!==Object.keys(t).length)return t}deserialiseObject(e,t){Object.keys(e).forEach(n=>{t.set(n,this.deserialise(e[n]))})}},er=e=>null===e,tr=e=>"string"==typeof e,nr=e=>"number"==typeof e,rr=e=>"boolean"==typeof e,sr=e=>null!==e&&"object"==typeof e;class ir{elementMap={};elementDetection=[];Element;KeyValuePair;_elements;_attributeElementKeys=[];_attributeElementArrayKeys=[];constructor(e){this.Element=_,this.KeyValuePair=S,e&&e.noDefault||this.useDefault()}use(e){return e.namespace&&e.namespace({base:this}),e.load&&e.load({base:this}),this}useDefault(){return this.register("null",M).register("string",I).register("number",T).register("boolean",C).register("array",F).register("object",B).register("member",D).register("ref",zn).register("link",Kn).register("sourceMap",sn),this.detect(er,M,!1).detect(tr,I,!1).detect(nr,T,!1).detect(rr,C,!1).detect(Array.isArray,F,!1).detect(sr,B,!1),this}register(e,t){return this._elements=void 0,this.elementMap[e]=t,this}unregister(e){return this._elements=void 0,delete this.elementMap[e],this}detect(e,t,n){return void 0===n||n?this.elementDetection.unshift([e,t]):this.elementDetection.push([e,t]),this}toElement(e){if(e instanceof this.Element)return e;let t;for(const[n,r]of this.elementDetection)if(n(e)){t=new r(e);break}return t}getElementClass(e){const t=this.elementMap[e];return void 0===t?this.Element:t}fromRefract(e){return this.serialiser.deserialise(e)}toRefract(e){return this.serialiser.serialise(e)}get elements(){return void 0===this._elements&&(this._elements={Element:this.Element},Object.keys(this.elementMap).forEach(e=>{const t=e[0].toUpperCase()+e.substring(1);this._elements[t]=this.elementMap[e]})),this._elements}get serialiser(){return new Zn(this)}}Zn.prototype.Namespace=ir;const or=new ir,ar={isElement:$,isStringElement:L,isNumberElement:P,isNullElement:U,isBooleanElement:q,isArrayElement:R,isObjectElement:V,isMemberElement:G,isPrimitiveElement:H,isLinkElement:Xn,isRefElement:Qn,isAnnotationElement:e=>e instanceof Jn,isCommentElement:e=>e instanceof Wn,isParseResultElement:e=>e instanceof Yn,isSourceMapElement:e=>e instanceof sn,hasElementSourceMap:Qt,includesSymbols:(e,t)=>{if(0===t.length)return!0;if(!e.hasAttributesProperty("symbols"))return!1;const n=e.attributes.get("symbols");return!!R(n)&&t.every(e=>n.includes(e))},includesClasses:Zt},cr=()=>({predicates:ar,namespace:or}),lr={toolboxCreator:cr,visitorOptions:{exposeEdits:!0}},ur=(e,t,n={})=>{if(0===t.length)return e;const r=jn(lr,n),{toolboxCreator:s,visitorOptions:i}=r,o=s(),a=t.map(e=>e(o)),c=kn(a.map(Fn({},"visitor")),i);a.forEach(Hn(["pre"],[]));const l=An(e,c);return a.forEach(Hn(["post"],[])),l};ur[Symbol.for("nodejs.util.promisify.custom")]=async(e,t,n={})=>{if(0===t.length)return e;const r=jn(lr,n),{toolboxCreator:s,visitorOptions:i}=r,o=s(),a=t.map(e=>e(o)),c=Sn(a.map(Fn({},"visitor")),i);await Promise.allSettled(a.map(Hn(["pre"],[])));const l=await _n(e,c);return await Promise.allSettled(a.map(Hn(["post"],[]))),l};var hr=n(279),pr=n.n(hr);const dr=class extends Me{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};class fr{uuid;identityMap;constructor({length:e=6}={}){this.uuid=new(pr())({length:e}),this.identityMap=new WeakMap}identify(e){if(!$(e))throw new dr("Cannot not identify the element. `element` is neither structurally compatible nor a subclass of an Element class.",{value:e});if(e.hasMetaProperty("id")){const t=e.meta.get("id");if(L(t)&&!t.equals(""))return e.id}if(this.identityMap.has(e))return this.identityMap.get(e);const t=new I(this.generateId());return this.identityMap.set(e,t),t}forget(e){return!!this.identityMap.has(e)&&(this.identityMap.delete(e),!0)}generateId(){return this.uuid.randomUUID()}}const mr=new fr,yr=({length:e=6}={})=>()=>{let t;return{pre(){t=new fr({length:e})},visitor:{enter(e){e.node.id=t.identify(e.node)}},post(){t=null}}},gr=({length:e=6}={})=>()=>{let t;return{pre(){t=new fr({length:e})},visitor:{enter(e){H(e.node)||(e.node.id=t.identify(e.node))}},post(){t=null}}};const xr=class extends Te{};const br=class extends xr{};const wr=class extends Array{unknownMediaType="application/octet-stream";filterByFormat(){throw new br("filterByFormat method in MediaTypes class is not yet implemented.")}findBy(){throw new br("findBy method in MediaTypes class is not yet implemented.")}latest(){throw new br("latest method in MediaTypes class is not yet implemented.")}};var vr=i(function(e){return function(){return e}})(void 0);const kr=k(vr()),Sr=(e,t=new WeakMap)=>(G(e)?(t.set(e.key,e),Sr(e.key,t),t.set(e.value,e),Sr(e.value,t)):e.children.forEach(n=>{t.set(n,e),Sr(n,t)}),t);const Or=class{element;edges;constructor({element:e}){this.element=e}transclude(e,t){if(e===this.element)return t;if(e===t)return this.element;this.edges=this.edges??Sr(this.element);const n=this.edges.get(e);return kr(n)?void 0:(V(n)?((e,t,n)=>{const r=n.get(e);V(r)&&(r.content=r.map((s,i,o)=>o===e?(n.delete(e),n.set(t,r),t):o))})(e,t,this.edges):R(n)?((e,t,n)=>{const r=n.get(e);R(r)&&(r.content=r.map(s=>s===e?(n.delete(e),n.set(t,r),t):s))})(e,t,this.edges):G(n)&&((e,t,n)=>{const r=n.get(e);G(r)&&(r.key===e&&(r.key=t,n.delete(e),n.set(t,r)),r.value===e&&(r.value=t,n.delete(e),n.set(t,r)))})(e,t,this.edges),this.element)}},Er=(e,t,n)=>new Or({element:n}).transclude(e,t),Ar=Or;var _r=o(function(e,t){return $e(function(n,r){return n[r]=e(t[r],r,t),n},{},x(t))});const Ir=_r;const Tr=i(function(e){return null==e});var Mr=o(function(e,t){if(0===e.length||Tr(t))return!1;for(var n=t,r=0;r<e.length;){if(Tr(n)||!l(e[r],n))return!1;n=n[e[r]],r+=1}return!0});const Cr=Mr;var jr=o(function(e,t){return Cr([e],t)});const Nr=jr;const Fr=ot(function(e,t,n){return e(Ut(t,n))});const Dr=ot(function(e,t,n){return e(Dn(t,n))});const Br=Fe(1,st(Bt,Wt));var $r=bt(b,Gt("Object")),Lr=Dr(st(zt,bt(Ct,k(Ct(Object)))),["constructor"]);const Pr=Fe(1,function(e){if(!Br(e)||!$r(e))return!1;var t=Object.getPrototypeOf(e);return!!Dt(t)||Lr(t)});const Ur=Fe(1,bt(b,Gt("String")));var qr=i(function(e){return Fe(e.length,e)});const Rr=qr;const Vr=o(function(e,t){return Fe(e+1,function(){var n=arguments[e];if(null!=n&&De(n[t]))return n[t].apply(n,Array.prototype.slice.call(arguments,0,e));throw new TypeError(Ct(n)+' does not have a method named "'+t+'"')})});const Gr=Vr(1,"split");var Hr=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=Je,e.prototype["@@transducer/result"]=We,e.prototype["@@transducer/step"]=function(e,t){if(this.f){if(this.f(t))return e;this.f=null}return this.xf["@@transducer/step"](e,t)},e}();function Kr(e){return function(t){return new Hr(e,t)}}const zr=o(Ke(["dropWhile"],Kr,function(e,t){for(var n=0,r=t.length;n<r&&e(t[n]);)n+=1;return gt(n,1/0,t)}));const Jr=Vr(1,"join");var Wr=i(function(e){return Fe(e.length,function(t,n){var r=Array.prototype.slice.call(arguments,0);return r[0]=n,r[1]=t,e.apply(this,r)})});const Yr=Wr(o(wt));const Xr=Rr(function(e,t){return bt(Gr(""),zr(Yr(e)),Jr(""))(t)}),Qr=new WeakMap,Zr=e=>{if(Qr.has(e))return Qr.get(e);const t={},n=(e,r,s)=>("string"==typeof e.element&&(t[e.element]=e.$visitor?[...s,"$visitor"]:s),Ir((e,t)=>{const i=[...s,t];if(Pr(e)&&Nr("$ref",e)&&Fr(Ur,"$ref",e)){const t=Bn(["$ref"],e),n=Xr("#/",t);return Bn(n.split("/"),r)}return Pr(e)?n(e,r,i):e},e)),r=n(e,e,[]);return r.elementMap=t,Qr.set(e,r),r},es=(e,t=or)=>{if(Ur(e))try{return t.fromRefract(JSON.parse(e))}catch{}return Pr(e)&&Nr("element",e)?t.fromRefract(e):t.toElement(e)},ts=e=>{if(!$(e))return e;if(L(e)||P(e)||q(e)||U(e))return e.toValue();const t=new WeakMap,n=e=>{if(!$(e))return e;if(V(e)){if(t.has(e))return t.get(e);const r={};return t.set(e,r),e.forEach((e,t)=>{const s=n(t),i=n(e);"string"==typeof s&&(r[s]=i)}),r}if(R(e)){if(t.has(e))return t.get(e);const r=[];return t.set(e,r),e.forEach(e=>r.push(n(e))),r}return Qn(e)?String(e.toValue()):Xn(e)?L(e.href)?e.href.toValue():"":e.toValue()};return n(e)},ns=(e,t,n)=>JSON.stringify(ts(e),t,n),rs=Symbol.for("yaml.alias"),ss=Symbol.for("yaml.document"),is=Symbol.for("yaml.map"),os=Symbol.for("yaml.pair"),as=Symbol.for("yaml.scalar"),cs=Symbol.for("yaml.seq"),ls=Symbol.for("yaml.node.type"),us=e=>!!e&&"object"==typeof e&&e[ls]===rs,hs=e=>!!e&&"object"==typeof e&&e[ls]===ss,ps=e=>!!e&&"object"==typeof e&&e[ls]===is,ds=e=>!!e&&"object"==typeof e&&e[ls]===os,fs=e=>!!e&&"object"==typeof e&&e[ls]===as,ms=e=>!!e&&"object"==typeof e&&e[ls]===cs;function ys(e){if(e&&"object"==typeof e)switch(e[ls]){case is:case cs:return!0}return!1}function gs(e){if(e&&"object"==typeof e)switch(e[ls]){case rs:case is:case as:case cs:return!0}return!1}const xs=e=>(fs(e)||ys(e))&&!!e.anchor,bs=Symbol("break visit"),ws=Symbol("skip children"),vs=Symbol("remove node");function ks(e,t){const n=As(t);if(hs(e)){Ss(null,e.contents,n,Object.freeze([e]))===vs&&(e.contents=null)}else Ss(null,e,n,Object.freeze([]))}function Ss(e,t,n,r){const s=_s(e,t,n,r);if(gs(s)||ds(s))return Is(e,r,s),Ss(e,s,n,r);if("symbol"!=typeof s)if(ys(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){const s=Ss(e,t.items[e],n,r);if("number"==typeof s)e=s-1;else{if(s===bs)return bs;s===vs&&(t.items.splice(e,1),e-=1)}}}else if(ds(t)){r=Object.freeze(r.concat(t));const e=Ss("key",t.key,n,r);if(e===bs)return bs;e===vs&&(t.key=null);const s=Ss("value",t.value,n,r);if(s===bs)return bs;s===vs&&(t.value=null)}return s}async function Os(e,t){const n=As(t);if(hs(e)){await Es(null,e.contents,n,Object.freeze([e]))===vs&&(e.contents=null)}else await Es(null,e,n,Object.freeze([]))}async function Es(e,t,n,r){const s=await _s(e,t,n,r);if(gs(s)||ds(s))return Is(e,r,s),Es(e,s,n,r);if("symbol"!=typeof s)if(ys(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){const s=await Es(e,t.items[e],n,r);if("number"==typeof s)e=s-1;else{if(s===bs)return bs;s===vs&&(t.items.splice(e,1),e-=1)}}}else if(ds(t)){r=Object.freeze(r.concat(t));const e=await Es("key",t.key,n,r);if(e===bs)return bs;e===vs&&(t.key=null);const s=await Es("value",t.value,n,r);if(s===bs)return bs;s===vs&&(t.value=null)}return s}function As(e){return"object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function _s(e,t,n,r){return"function"==typeof n?n(e,t,r):ps(t)?n.Map?.(e,t,r):ms(t)?n.Seq?.(e,t,r):ds(t)?n.Pair?.(e,t,r):fs(t)?n.Scalar?.(e,t,r):us(t)?n.Alias?.(e,t,r):void 0}function Is(e,t,n){const r=t[t.length-1];if(ys(r))r.items[e]=n;else if(ds(r))"key"===e?r.key=n:r.value=n;else{if(!hs(r)){const e=us(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${e} parent`)}r.contents=n}}ks.BREAK=bs,ks.SKIP=ws,ks.REMOVE=vs,Os.BREAK=bs,Os.SKIP=ws,Os.REMOVE=vs;const Ts={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ms=e=>e.replace(/[!,[\]{}]/g,e=>Ts[e]);class Cs{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Cs.defaultYaml,e),this.tags=Object.assign({},Cs.defaultTags,t)}clone(){const e=new Cs(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new Cs(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Cs.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Cs.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:Cs.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Cs.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),r=n.shift();switch(r){case"%TAG":{if(2!==n.length&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[e,r]=n;return this.tags[e]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),!1;const[e]=n;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;return t(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),!1}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){const n=e.slice(2,-1);return"!"===n||"!!"===n?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),n)}const[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);const s=this.tags[n];if(s)try{return s+decodeURIComponent(r)}catch(e){return t(String(e)),null}return"!"===n?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Ms(e.substring(n.length));return"!"===e[0]?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let r;if(e&&n.length>0&&gs(e.contents)){const t={};ks(e.contents,(e,n)=>{gs(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(const[s,i]of n)"!!"===s&&"tag:yaml.org,2002:"===i||e&&!r.some(e=>e.startsWith(i))||t.push(`%TAG ${s} ${i}`);return t.join("\n")}}function js(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);throw new Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0}function Ns(e){const t=new Set;return ks(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Fs(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Ds(e,t,n,r){if(r&&"object"==typeof r)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){const n=r[t],s=Ds(e,r,String(t),n);void 0===s?delete r[t]:s!==n&&(r[t]=s)}else if(r instanceof Map)for(const t of Array.from(r.keys())){const n=r.get(t),s=Ds(e,r,t,n);void 0===s?r.delete(t):s!==n&&r.set(t,s)}else if(r instanceof Set)for(const t of Array.from(r)){const n=Ds(e,r,t,t);void 0===n?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(const[t,n]of Object.entries(r)){const s=Ds(e,r,t,n);void 0===s?delete r[t]:s!==n&&(r[t]=s)}return e.call(t,n,r)}function Bs(e,t,n){if(Array.isArray(e))return e.map((e,t)=>Bs(e,String(t),n));if(e&&"function"==typeof e.toJSON){if(!n||!xs(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return"bigint"!=typeof e||n?.keep?e:Number(e)}Cs.defaultYaml={explicit:!1,version:"1.2"},Cs.defaultTags={"!!":"tag:yaml.org,2002:"};class $s{constructor(e){Object.defineProperty(this,ls,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:s}={}){if(!hs(e))throw new TypeError("A document argument is required");const i={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},o=Bs(this,"",i);if("function"==typeof r)for(const{count:e,res:t}of i.anchors.values())r(t,e);return"function"==typeof s?Ds(s,{"":o},"",o):o}}class Ls extends $s{constructor(e){super(rs),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let n,r;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],ks(e,{Node:(e,t)=>{(us(t)||xs(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));for(const e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:r,maxAliasCount:s}=t,i=this.resolve(r,t);if(!i){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}let o=n.get(i);if(o||(Bs(i,null,t),o=n.get(i)),void 0===o?.res){throw new ReferenceError("This should not happen: Alias anchor was not resolved?")}if(s>=0&&(o.count+=1,0===o.aliasCount&&(o.aliasCount=Ps(r,i,n)),o.count*o.aliasCount>s)){throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return o.res}toString(e,t,n){const r=`*${this.source}`;if(e){if(js(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(e.implicitKey)return`${r} `}return r}}function Ps(e,t,n){if(us(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}if(ys(t)){let r=0;for(const s of t.items){const t=Ps(e,s,n);t>r&&(r=t)}return r}if(ds(t)){const r=Ps(e,t.key,n),s=Ps(e,t.value,n);return Math.max(r,s)}return 1}const Us=e=>!e||"function"!=typeof e&&"object"!=typeof e;class qs extends $s{constructor(e){super(as),this.value=e}toJSON(e,t){return t?.keep?this.value:Bs(this.value,e,t)}toString(){return String(this.value)}}qs.BLOCK_FOLDED="BLOCK_FOLDED",qs.BLOCK_LITERAL="BLOCK_LITERAL",qs.PLAIN="PLAIN",qs.QUOTE_DOUBLE="QUOTE_DOUBLE",qs.QUOTE_SINGLE="QUOTE_SINGLE";function Rs(e,t,n){if(hs(e)&&(e=e.contents),gs(e))return e;if(ds(e)){const t=n.schema[is].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"undefined"!=typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=n;let c;if(r&&e&&"object"==typeof e){if(c=a.get(e),c)return c.anchor??(c.anchor=s(e)),new Ls(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t="tag:yaml.org,2002:"+t.slice(2));let l=function(e,t,n){if(t){const e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}(e,t,o.tags);if(!l){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){const t=new qs(e);return c&&(c.node=t),t}l=e instanceof Map?o[is]:Symbol.iterator in Object(e)?o[cs]:o[is]}i&&(i(l),delete n.onTagObj);const u=l?.createNode?l.createNode(n.schema,e,n):"function"==typeof l?.nodeClass?.from?l.nodeClass.from(n.schema,e,n):new qs(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Vs(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){const n=t[e];if("number"==typeof n&&Number.isInteger(n)&&n>=0){const e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return Rs(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Gs=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class Hs extends $s{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>gs(t)||ds(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Gs(e))this.add(t);else{const[n,...r]=e,s=this.get(n,!0);if(ys(s))s.addIn(r,t);else{if(void 0!==s||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,Vs(this.schema,r,t))}}}deleteIn(e){const[t,...n]=e;if(0===n.length)return this.delete(t);const r=this.get(t,!0);if(ys(r))return r.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...r]=e,s=this.get(n,!0);return 0===r.length?!t&&fs(s)?s.value:s:ys(s)?s.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!ds(t))return!1;const n=t.value;return null==n||e&&fs(n)&&null==n.value&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){const[t,...n]=e;if(0===n.length)return this.has(t);const r=this.get(t,!0);return!!ys(r)&&r.hasIn(n)}setIn(e,t){const[n,...r]=e;if(0===r.length)this.set(n,t);else{const e=this.get(n,!0);if(ys(e))e.setIn(r,t);else{if(void 0!==e||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,Vs(this.schema,r,t))}}}}const Ks=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function zs(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Js=(e,t,n)=>e.endsWith("\n")?zs(n,t):n.includes("\n")?"\n"+zs(n,t):(e.endsWith(" ")?"":" ")+n,Ws="flow",Ys="block",Xs="quoted";function Qs(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return e;s<i&&(i=0);const c=Math.max(1+i,1+s-t.length);if(e.length<=c)return e;const l=[],u={};let h,p,d=s-t.length;"number"==typeof r&&(r>s-Math.max(2,i)?l.push(0):d=s-r);let f=!1,m=-1,y=-1,g=-1;n===Ys&&(m=Zs(e,m,t.length),-1!==m&&(d=m+c));for(let r;r=e[m+=1];){if(n===Xs&&"\\"===r){switch(y=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}g=m}if("\n"===r)n===Ys&&(m=Zs(e,m,t.length)),d=m+t.length+c,h=void 0;else{if(" "===r&&p&&" "!==p&&"\n"!==p&&"\t"!==p){const t=e[m+1];t&&" "!==t&&"\n"!==t&&"\t"!==t&&(h=m)}if(m>=d)if(h)l.push(h),d=h+c,h=void 0;else if(n===Xs){for(;" "===p||"\t"===p;)p=r,r=e[m+=1],f=!0;const t=m>g+1?m-2:y-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,h=void 0}else f=!0}p=r}if(f&&a&&a(),0===l.length)return e;o&&o();let x=e.slice(0,l[0]);for(let r=0;r<l.length;++r){const s=l[r],i=l[r+1]||e.length;0===s?x=`\n${t}${e.slice(0,i)}`:(n===Xs&&u[s]&&(x+=`${e[s]}\\`),x+=`\n${t}${e.slice(s+1,i)}`)}return x}function Zs(e,t,n){let r=t,s=t+1,i=e[s];for(;" "===i||"\t"===i;)if(t<s+n)i=e[++t];else{do{i=e[++t]}while(i&&"\n"!==i);r=t,s=t+1,i=e[s]}return r}const ei=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ti=e=>/^(%|---|\.\.\.)/m.test(e);function ni(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(ti(e)?" ":"");let o="",a=0;for(let e=0,t=n[e];t;t=n[++e])if(" "===t&&"\\"===n[e+1]&&"n"===n[e+2]&&(o+=n.slice(a,e)+"\\ ",e+=1,a=e,t="\\"),"\\"===t)switch(n[e+1]){case"u":{o+=n.slice(a,e);const t=n.substr(e+2,4);switch(t){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:"00"===t.substr(0,2)?o+="\\x"+t.substr(2):o+=n.substr(e,6)}e+=5,a=e+1}break;case"n":if(r||'"'===n[e+2]||n.length<s)e+=1;else{for(o+=n.slice(a,e)+"\n\n";"\\"===n[e+2]&&"n"===n[e+3]&&'"'!==n[e+4];)o+="\n",e+=2;o+=i," "===n[e+2]&&(o+="\\"),e+=1,a=e+1}break;default:e+=1}return o=a?o+n.slice(a):n,r?o:Qs(o,i,Xs,ei(t,!1))}function ri(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return ni(e,t);const n=t.indent||(ti(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&\n${n}`)+"'";return t.implicitKey?r:Qs(r,n,Ws,ei(t,!1))}function si(e,t){const{singleQuote:n}=t.options;let r;if(!1===n)r=ni;else{const t=e.includes('"'),s=e.includes("'");r=t&&!s?ri:s&&!t?ni:n?ri:ni}return r(e,t)}let ii;try{ii=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{ii=/\n+(?!\n|$)/g}function oi({comment:e,type:t,value:n},r,s,i){const{blockQuote:o,commentString:a,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return si(n,r);const l=r.indent||(r.forceBlockIndent||ti(n)?" ":""),u="literal"===o||"folded"!==o&&t!==qs.BLOCK_FOLDED&&(t===qs.BLOCK_LITERAL||!function(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let t=0,n=0;t<s;++t)if("\n"===e[t]){if(t-n>r)return!0;if(n=t+1,s-n<=r)return!1}return!0}(n,c,l.length));if(!n)return u?"|\n":">\n";let h,p;for(p=n.length;p>0;--p){const e=n[p-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let d=n.substring(p);const f=d.indexOf("\n");-1===f?h="-":n===d||f!==d.length-1?(h="+",i&&i()):h="",d&&(n=n.slice(0,-d.length),"\n"===d[d.length-1]&&(d=d.slice(0,-1)),d=d.replace(ii,`$&${l}`));let m,y=!1,g=-1;for(m=0;m<n.length;++m){const e=n[m];if(" "===e)y=!0;else{if("\n"!==e)break;g=m}}let x=n.substring(0,g<m?g+1:m);x&&(n=n.substring(x.length),x=x.replace(/\n+/g,`$&${l}`));let b=(y?l?"2":"1":"")+h;if(e&&(b+=" "+a(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!u){const e=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`);let s=!1;const i=ei(r,!0);"folded"!==o&&t!==qs.BLOCK_FOLDED&&(i.onOverflow=()=>{s=!0});const a=Qs(`${x}${e}${d}`,l,Ys,i);if(!s)return`>${b}\n${l}${a}`}return`|${b}\n${l}${x}${n=n.replace(/\n+/g,`$&${l}`)}${d}`}function ai(e,t,n,r){const{implicitKey:s,inFlow:i}=t,o="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==qs.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=qs.QUOTE_DOUBLE);const c=e=>{switch(e){case qs.BLOCK_FOLDED:case qs.BLOCK_LITERAL:return s||i?si(o.value,t):oi(o,t,n,r);case qs.QUOTE_DOUBLE:return ni(o.value,t);case qs.QUOTE_SINGLE:return ri(o.value,t);case qs.PLAIN:return function(e,t,n,r){const{type:s,value:i}=e,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=t;if(a&&i.includes("\n")||u&&/[[\]{},]/.test(i))return si(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes("\n")?si(i,t):oi(e,t,n,r);if(!a&&!u&&s!==qs.PLAIN&&i.includes("\n"))return oi(e,t,n,r);if(ti(i)){if(""===c)return t.forceBlockIndent=!0,oi(e,t,n,r);if(a&&c===l)return si(i,t)}const h=i.replace(/\n+/g,`$&\n${c}`);if(o){const e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(h),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return si(i,t)}return a?h:Qs(h,c,Ws,ei(t,!1))}(o,t,n,r);default:return null}};let l=c(a);if(null===l){const{defaultKeyType:e,defaultStringType:n}=t.options,r=s&&e||n;if(l=c(r),null===l)throw new Error(`Unsupported default string type ${r}`)}return l}function ci(e,t){const n=Object.assign({blockQuote:!0,commentString:Ks,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:r,options:n}}function li(e,t,n,r){if(ds(e))return e.toString(t,n,r);if(us(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const i=gs(e)?e:t.doc.createNode(e,{onTagObj:e=>s=e});s??(s=function(e,t){if(t.tag){const n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(fs(t)){r=t.value;let s=e.filter(e=>e.identify?.(r));if(s.length>1){const e=s.filter(e=>e.test);e.length>0&&(s=e)}n=s.find(e=>e.format===t.format)??s.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n)throw new Error(`Tag not resolved for ${r?.constructor?.name??(null===r?"null":typeof r)} value`);return n}(t.doc.schema.tags,i));const o=function(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(fs(e)||ys(e))&&e.anchor;i&&js(i)&&(n.add(i),s.push(`&${i}`));const o=e.tag??(t.default?null:t.tag);return o&&s.push(r.directives.tagString(o)),s.join(" ")}(i,s,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const a="function"==typeof s.stringify?s.stringify(i,t,n,r):fs(i)?ai(i,t,n,r):i.toString(t,n,r);return o?fs(i)||"{"===a[0]||"["===a[0]?`${o} ${a}`:`${o}\n${t.indent}${a}`:a}const ui="<<",hi={identify:e=>e===ui||"symbol"==typeof e&&e.description===ui,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new qs(Symbol(ui)),{addToJSMap:pi}),stringify:()=>ui};function pi(e,t,n){if(n=e&&us(n)?n.resolve(e.doc):n,ms(n))for(const r of n.items)di(e,t,r);else if(Array.isArray(n))for(const r of n)di(e,t,r);else di(e,t,n)}function di(e,t,n){const r=e&&us(n)?n.resolve(e.doc):n;if(!ps(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[e,n]of s)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function fi(e,t,{key:n,value:r}){if(gs(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(((e,t)=>(hi.identify(t)||fs(t)&&(!t.type||t.type===qs.PLAIN)&&hi.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===hi.tag&&e.default))(e,n))pi(e,t,r);else{const s=Bs(n,"",e);if(t instanceof Map)t.set(s,Bs(r,s,e));else if(t instanceof Set)t.add(s);else{const i=function(e,t,n){if(null===t)return"";if("object"!=typeof t)return String(t);if(gs(e)&&n?.doc){const t=ci(n.doc,{});t.anchors=new Set;for(const e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;const i=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(i);e.length>40&&(e=e.substring(0,36)+'..."'),r=n.doc.options.logLevel,s=`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`,"debug"!==r&&"warn"!==r||console.warn(s),n.mapKeyWarned=!0}return i}var r,s;return JSON.stringify(t)}(n,s,e),o=Bs(r,i,e);i in t?Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[i]=o}}return t}function mi(e,t,n){const r=Rs(e,void 0,n),s=Rs(t,void 0,n);return new yi(r,s)}class yi{constructor(e,t=null){Object.defineProperty(this,ls,{value:os}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return gs(t)&&(t=t.clone(e)),gs(n)&&(n=n.clone(e)),new yi(t,n)}toJSON(e,t){return fi(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?function({key:e,value:t},n,r,s){const{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:h}}=n;let p=gs(e)&&e.comment||null;if(h){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(ys(e)||!gs(e)&&"object"==typeof e)throw new Error("With simple keys, collection cannot be used as a key value")}let d=!h&&(!e||p&&null==t&&!n.inFlow||ys(e)||(fs(e)?e.type===qs.BLOCK_FOLDED||e.type===qs.BLOCK_LITERAL:"object"==typeof e));n=Object.assign({},n,{allNullValues:!1,implicitKey:!d&&(h||!i),indent:a+c});let f,m,y,g=!1,x=!1,b=li(e,n,()=>g=!0,()=>x=!0);if(!d&&!n.inFlow&&b.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");d=!0}if(n.inFlow){if(i||null==t)return g&&r&&r(),""===b?"?":d?`? ${b}`:b}else if(i&&!h||null==t&&d)return b=`? ${b}`,p&&!g?b+=Js(b,n.indent,l(p)):x&&s&&s(),b;g&&(p=null),d?(p&&(b+=Js(b,n.indent,l(p))),b=`? ${b}\n${a}:`):(b=`${b}:`,p&&(b+=Js(b,n.indent,l(p)))),gs(t)?(f=!!t.spaceBefore,m=t.commentBefore,y=t.comment):(f=!1,m=null,y=null,t&&"object"==typeof t&&(t=o.createNode(t))),n.implicitKey=!1,d||p||!fs(t)||(n.indentAtStart=b.length+1),x=!1,u||!(c.length>=2)||n.inFlow||d||!ms(t)||t.flow||t.tag||t.anchor||(n.indent=n.indent.substring(2));let w=!1;const v=li(t,n,()=>w=!0,()=>x=!0);let k=" ";if(p||f||m)k=f?"\n":"",m&&(k+=`\n${zs(l(m),n.indent)}`),""!==v||n.inFlow?k+=`\n${n.indent}`:"\n"===k&&y&&(k="\n\n");else if(!d&&ys(t)){const e=v[0],r=v.indexOf("\n"),s=-1!==r,i=n.inFlow??t.flow??0===t.items.length;if(s||!i){let t=!1;if(s&&("&"===e||"!"===e)){let n=v.indexOf(" ");"&"===e&&-1!==n&&n<r&&"!"===v[n+1]&&(n=v.indexOf(" ",n+1)),(-1===n||r<n)&&(t=!0)}t||(k=`\n${n.indent}`)}}else""!==v&&"\n"!==v[0]||(k="");return b+=k+v,n.inFlow?w&&r&&r():y&&!w?b+=Js(b,n.indent,l(y)):x&&s&&s(),b}(this,e,t,n):JSON.stringify(this)}}function gi(e,t,n){return(t.inFlow??e.flow?bi:xi)(e,t,n)}function xi({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){const{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:i,type:null});let h=!1;const p=[];for(let e=0;e<t.length;++e){const s=t[e];let o=null;if(gs(s))!h&&s.spaceBefore&&p.push(""),wi(n,p,s.commentBefore,h),s.comment&&(o=s.comment);else if(ds(s)){const e=gs(s.key)?s.key:null;e&&(!h&&e.spaceBefore&&p.push(""),wi(n,p,e.commentBefore,h))}h=!1;let a=li(s,u,()=>o=null,()=>h=!0);o&&(a+=Js(a,i,l(o))),h&&o&&(h=!1),p.push(r+a)}let d;if(0===p.length)d=s.start+s.end;else{d=p[0];for(let e=1;e<p.length;++e){const t=p[e];d+=t?`\n${c}${t}`:"\n"}}return e?(d+="\n"+zs(l(e),c),a&&a()):h&&o&&o(),d}function bi({items:e},t,{flowChars:n,itemIndent:r}){const{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=t;r+=i;const c=Object.assign({},t,{indent:r,inFlow:!0,type:null});let l=!1,u=0;const h=[];for(let n=0;n<e.length;++n){const s=e[n];let i=null;if(gs(s))s.spaceBefore&&h.push(""),wi(t,h,s.commentBefore,!1),s.comment&&(i=s.comment);else if(ds(s)){const e=gs(s.key)?s.key:null;e&&(e.spaceBefore&&h.push(""),wi(t,h,e.commentBefore,!1),e.comment&&(l=!0));const n=gs(s.value)?s.value:null;n?(n.comment&&(i=n.comment),n.commentBefore&&(l=!0)):null==s.value&&e?.comment&&(i=e.comment)}i&&(l=!0);let o=li(s,c,()=>i=null);n<e.length-1&&(o+=","),i&&(o+=Js(o,r,a(i))),!l&&(h.length>u||o.includes("\n"))&&(l=!0),h.push(o),u=h.length}const{start:p,end:d}=n;if(0===h.length)return p+d;if(!l){const e=h.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=p;for(const t of h)e+=t?`\n${i}${s}${t}`:"\n";return`${e}\n${s}${d}`}return`${p}${o}${h.join(" ")}${o}${d}`}function wi({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const s=zs(t(r),e);n.push(s.trimStart())}}function vi(e,t){const n=fs(t)?t.value:t;for(const r of e)if(ds(r)){if(r.key===t||r.key===n)return r;if(fs(r.key)&&r.key.value===n)return r}}class ki extends Hs{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(is,e),this.items=[]}static from(e,t,n){const{keepUndefined:r,replacer:s}=n,i=new this(e),o=(e,o)=>{if("function"==typeof s)o=s.call(t,e,o);else if(Array.isArray(s)&&!s.includes(e))return;(void 0!==o||r)&&i.items.push(mi(e,o,n))};if(t instanceof Map)for(const[e,n]of t)o(e,n);else if(t&&"object"==typeof t)for(const e of Object.keys(t))o(e,t[e]);return"function"==typeof e.sortMapEntries&&i.items.sort(e.sortMapEntries),i}add(e,t){let n;n=ds(e)?e:e&&"object"==typeof e&&"key"in e?new yi(e.key,e.value):new yi(e,e?.value);const r=vi(this.items,n.key),s=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${n.key} already set`);fs(r.value)&&Us(n.value)?r.value.value=n.value:r.value=n.value}else if(s){const e=this.items.findIndex(e=>s(n,e)<0);-1===e?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){const t=vi(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=vi(this.items,e),r=n?.value;return(!t&&fs(r)?r.value:r)??void 0}has(e){return!!vi(this.items,e)}set(e,t){this.add(new yi(e,t),!0)}toJSON(e,t,n){const r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(const e of this.items)fi(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(const e of this.items)if(!ds(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),gi(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const Si={collection:"map",default:!0,nodeClass:ki,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(ps(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,n)=>ki.from(e,t,n)};class Oi extends Hs{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(cs,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=Ei(e);if("number"!=typeof t)return!1;return this.items.splice(t,1).length>0}get(e,t){const n=Ei(e);if("number"!=typeof n)return;const r=this.items[n];return!t&&fs(r)?r.value:r}has(e){const t=Ei(e);return"number"==typeof t&&t<this.items.length}set(e,t){const n=Ei(e);if("number"!=typeof n)throw new Error(`Expected a valid index, not ${e}.`);const r=this.items[n];fs(r)&&Us(t)?r.value=t:this.items[n]=t}toJSON(e,t){const n=[];t?.onCreate&&t.onCreate(n);let r=0;for(const e of this.items)n.push(Bs(e,String(r++),t));return n}toString(e,t,n){return e?gi(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){const{replacer:r}=n,s=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let i of t){if("function"==typeof r){const n=t instanceof Set?i:String(e++);i=r.call(t,n,i)}s.items.push(Rs(i,void 0,n))}}return s}}function Ei(e){let t=fs(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}const Ai={collection:"seq",default:!0,nodeClass:Oi,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(ms(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,n)=>Oi.from(e,t,n)},_i={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,n,r)=>ai(e,t=Object.assign({actualString:!0},t),n,r)},Ii={identify:e=>null==e,createNode:()=>new qs(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new qs(null),stringify:({source:e},t)=>"string"==typeof e&&Ii.test.test(e)?e:t.options.nullStr},Ti={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new qs("t"===e[0]||"T"===e[0]),stringify({source:e,value:t},n){if(e&&Ti.test.test(e)){if(t===("t"===e[0]||"T"===e[0]))return e}return t?n.options.trueStr:n.options.falseStr}};function Mi({format:e,minFractionDigits:t,tag:n,value:r}){if("bigint"==typeof r)return String(r);const s="number"==typeof r?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(i)){let e=i.indexOf(".");e<0&&(e=i.length,i+=".");let n=t-(i.length-e-1);for(;n-- >0;)i+="0"}return i}const Ci={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Mi},ji={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Mi(e)}},Ni={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new qs(parseFloat(e)),n=e.indexOf(".");return-1!==n&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-n-1),t},stringify:Mi},Fi=e=>"bigint"==typeof e||Number.isInteger(e),Di=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function Bi(e,t,n){const{value:r}=e;return Fi(r)&&r>=0?n+r.toString(t):Mi(e)}const $i={identify:e=>Fi(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Di(e,2,8,n),stringify:e=>Bi(e,8,"0o")},Li={identify:Fi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Di(e,0,10,n),stringify:Mi},Pi={identify:e=>Fi(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Di(e,2,16,n),stringify:e=>Bi(e,16,"0x")},Ui=[Si,Ai,_i,Ii,Ti,$i,Li,Pi,Ci,ji,Ni];function qi(e){return"bigint"==typeof e||Number.isInteger(e)}const Ri=({value:e})=>JSON.stringify(e),Vi=[Si,Ai].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Ri},{identify:e=>null==e,createNode:()=>new qs(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ri},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:Ri},{identify:qi,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>qi(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Ri}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),Gi={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if("function"==typeof atob){const t=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,s,i){if(!n)return"";const o=n;let a;if("function"!=typeof btoa)throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");{let e="";for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);a=btoa(e)}if(t??(t=qs.BLOCK_LITERAL),t!==qs.QUOTE_DOUBLE){const e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(a.length/e),s=new Array(n);for(let t=0,r=0;t<n;++t,r+=e)s[t]=a.substr(r,e);a=s.join(t===qs.BLOCK_LITERAL?"\n":" ")}return ai({comment:e,type:t,value:a},r,s,i)}};function Hi(e,t){if(ms(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!ds(r)){if(ps(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const e=r.items[0]||new yi(new qs(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){const t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=ds(r)?r:new yi(r)}}else t("Expected a sequence for this tag");return e}function Ki(e,t,n){const{replacer:r}=n,s=new Oi(e);s.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let o,a;if("function"==typeof r&&(e=r.call(t,String(i++),e)),Array.isArray(e)){if(2!==e.length)throw new TypeError(`Expected [key, value] tuple: ${e}`);o=e[0],a=e[1]}else if(e&&e instanceof Object){const t=Object.keys(e);if(1!==t.length)throw new TypeError(`Expected tuple with one key, not ${t.length} keys`);o=t[0],a=e[o]}else o=e;s.items.push(mi(o,a,n))}return s}const zi={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Hi,createNode:Ki};class Ji extends Oi{constructor(){super(),this.add=ki.prototype.add.bind(this),this.delete=ki.prototype.delete.bind(this),this.get=ki.prototype.get.bind(this),this.has=ki.prototype.has.bind(this),this.set=ki.prototype.set.bind(this),this.tag=Ji.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t?.onCreate&&t.onCreate(n);for(const e of this.items){let r,s;if(ds(e)?(r=Bs(e.key,"",t),s=Bs(e.value,r,t)):r=Bs(e,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,s)}return n}static from(e,t,n){const r=Ki(e,t,n),s=new this;return s.items=r.items,s}}Ji.tag="tag:yaml.org,2002:omap";const Wi={collection:"seq",identify:e=>e instanceof Map,nodeClass:Ji,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Hi(e,t),r=[];for(const{key:e}of n.items)fs(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new Ji,n)},createNode:(e,t,n)=>Ji.from(e,t,n)};function Yi({value:e,source:t},n){return t&&(e?Xi:Qi).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Xi={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new qs(!0),stringify:Yi},Qi={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new qs(!1),stringify:Yi},Zi={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Mi},eo={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Mi(e)}},to={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new qs(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(-1!==n){const r=e.substring(n+1).replace(/_/g,"");"0"===r[r.length-1]&&(t.minFractionDigits=r.length)}return t},stringify:Mi},no=e=>"bigint"==typeof e||Number.isInteger(e);function ro(e,t,n,{intAsBigInt:r}){const s=e[0];if("-"!==s&&"+"!==s||(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}const t=BigInt(e);return"-"===s?BigInt(-1)*t:t}const i=parseInt(e,n);return"-"===s?-1*i:i}function so(e,t,n){const{value:r}=e;if(no(r)){const e=r.toString(t);return r<0?"-"+n+e.substr(1):n+e}return Mi(e)}const io={identify:no,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>ro(e,2,2,n),stringify:e=>so(e,2,"0b")},oo={identify:no,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>ro(e,1,8,n),stringify:e=>so(e,8,"0")},ao={identify:no,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>ro(e,0,10,n),stringify:Mi},co={identify:no,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>ro(e,2,16,n),stringify:e=>so(e,16,"0x")};class lo extends ki{constructor(e){super(e),this.tag=lo.tag}add(e){let t;t=ds(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new yi(e.key,null):new yi(e,null);vi(this.items,t.key)||this.items.push(t)}get(e,t){const n=vi(this.items,e);return!t&&ds(n)?fs(n.key)?n.key.value:n.key:n}set(e,t){if("boolean"!=typeof t)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof t);const n=vi(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new yi(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){const{replacer:r}=n,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof r&&(e=r.call(t,e,e)),s.items.push(mi(e,null,n));return s}}lo.tag="tag:yaml.org,2002:set";const uo={collection:"map",identify:e=>e instanceof Set,nodeClass:lo,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>lo.from(e,t,n),resolve(e,t){if(ps(e)){if(e.hasAllNullValues(!0))return Object.assign(new lo,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function ho(e,t){const n=e[0],r="-"===n||"+"===n?e.substring(1):e,s=e=>t?BigInt(e):Number(e),i=r.replace(/_/g,"").split(":").reduce((e,t)=>e*s(60)+s(t),s(0));return"-"===n?s(-1)*i:i}function po(e){let{value:t}=e,n=e=>e;if("bigint"==typeof t)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Mi(e);let r="";t<0&&(r="-",t*=n(-1));const s=n(60),i=[t%s];return t<60?i.unshift(0):(t=(t-i[0])/s,i.unshift(t%s),t>=60&&(t=(t-i[0])/s,i.unshift(t))),r+i.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const fo={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>ho(e,n),stringify:po},mo={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>ho(e,!1),stringify:po},yo={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(yo.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,o,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let l=Date.UTC(n,r-1,s,i||0,o||0,a||0,c);const u=t[8];if(u&&"Z"!==u){let e=ho(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},go=[Si,Ai,_i,Ii,Xi,Qi,io,oo,ao,co,Zi,eo,to,Gi,hi,Wi,zi,uo,fo,mo,yo],xo=new Map([["core",Ui],["failsafe",[Si,Ai,_i]],["json",Vi],["yaml11",go],["yaml-1.1",go]]),bo={binary:Gi,bool:Ti,float:Ni,floatExp:ji,floatNaN:Ci,floatTime:mo,int:Li,intHex:Pi,intOct:$i,intTime:fo,map:Si,merge:hi,null:Ii,omap:Wi,pairs:zi,seq:Ai,set:uo,timestamp:yo},wo={"tag:yaml.org,2002:binary":Gi,"tag:yaml.org,2002:merge":hi,"tag:yaml.org,2002:omap":Wi,"tag:yaml.org,2002:pairs":zi,"tag:yaml.org,2002:set":uo,"tag:yaml.org,2002:timestamp":yo};function vo(e,t,n){const r=xo.get(t);if(r&&!e)return n&&!r.includes(hi)?r.concat(hi):r.slice();let s=r;if(!s){if(!Array.isArray(e)){const e=Array.from(xo.keys()).filter(e=>"yaml11"!==e).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}s=[]}if(Array.isArray(e))for(const t of e)s=s.concat(t);else"function"==typeof e&&(s=e(s.slice()));return n&&(s=s.concat(hi)),s.reduce((e,t)=>{const n="string"==typeof t?bo[t]:t;if(!n){const e=JSON.stringify(t),n=Object.keys(bo).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}const ko=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class So{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:s,sortMapEntries:i,toStringDefaults:o}){this.compat=Array.isArray(e)?vo(e,"compat"):e?vo(null,e):null,this.name="string"==typeof s&&s||"core",this.knownTags=r?wo:{},this.tags=vo(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,is,{value:Si}),Object.defineProperty(this,as,{value:_i}),Object.defineProperty(this,cs,{value:Ai}),this.sortMapEntries="function"==typeof i?i:!0===i?ko:null}clone(){const e=Object.create(So.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}class Oo{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ls,{value:ss});let r=null;"function"==typeof t||Array.isArray(t)?r=t:void 0===n&&t&&(n=t,t=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:i}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(i=this.directives.yaml.version)):this.directives=new Cs({version:i}),this.setSchema(i,n),this.contents=void 0===e?null:this.createNode(e,r,n)}clone(){const e=Object.create(Oo.prototype,{[ls]:{value:ss}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=gs(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Eo(this.contents)&&this.contents.add(e)}addIn(e,t){Eo(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=Ns(this);e.anchor=!t||n.has(t)?Fs(t||"a",n):t}return new Ls(e.anchor)}createNode(e,t,n){let r;if("function"==typeof t)e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){const e=e=>"number"==typeof e||e instanceof String||e instanceof Number,n=t.filter(e).map(String);n.length>0&&(t=t.concat(n)),r=t}else void 0===n&&t&&(n=t,t=void 0);const{aliasDuplicateObjects:s,anchorPrefix:i,flow:o,keepUndefined:a,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:h,sourceObjects:p}=function(e,t){const n=[],r=new Map;let s=null;return{onAnchor:r=>{n.push(r),s??(s=Ns(e));const i=Fs(t,s);return s.add(i),i},setAnchors:()=>{for(const e of n){const t=r.get(e);if("object"!=typeof t||!t.anchor||!fs(t.node)&&!ys(t.node)){const t=new Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}t.node.anchor=t.anchor}},sourceObjects:r}}(this,i||"a"),d=Rs(e,l,{aliasDuplicateObjects:s??!0,keepUndefined:a??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:p});return o&&ys(d)&&(d.flow=!0),h(),d}createPair(e,t,n={}){const r=this.createNode(e,null,n),s=this.createNode(t,null,n);return new yi(r,s)}delete(e){return!!Eo(this.contents)&&this.contents.delete(e)}deleteIn(e){return Gs(e)?null!=this.contents&&(this.contents=null,!0):!!Eo(this.contents)&&this.contents.deleteIn(e)}get(e,t){return ys(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Gs(e)?!t&&fs(this.contents)?this.contents.value:this.contents:ys(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!ys(this.contents)&&this.contents.has(e)}hasIn(e){return Gs(e)?void 0!==this.contents:!!ys(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=Vs(this.schema,[e],t):Eo(this.contents)&&this.contents.set(e,t)}setIn(e,t){Gs(e)?this.contents=t:null==this.contents?this.contents=Vs(this.schema,Array.from(e),t):Eo(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){let n;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Cs({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Cs({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else{if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new So(Object.assign(n,t))}}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){const o={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},a=Bs(this.contents,t??"",o);if("function"==typeof s)for(const{count:e,res:t}of o.anchors.values())s(t,e);return"function"==typeof i?Ds(i,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return function(e,t){const n=[];let r=!0===t.directives;if(!1!==t.directives&&e.directives){const t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const s=ci(e,t),{commentString:i}=s.options;if(e.commentBefore){1!==n.length&&n.unshift("");const t=i(e.commentBefore);n.unshift(zs(t,""))}let o=!1,a=null;if(e.contents){if(gs(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const t=i(e.contents.commentBefore);n.push(zs(t,""))}s.forceBlockIndent=!!e.comment,a=e.contents.comment}const t=a?void 0:()=>o=!0;let c=li(e.contents,s,()=>a=null,t);a&&(c+=Js(c,"",i(a))),"|"!==c[0]&&">"!==c[0]||"---"!==n[n.length-1]?n.push(c):n[n.length-1]=`--- ${c}`}else n.push(li(e.contents,s));if(e.directives?.docEnd)if(e.comment){const t=i(e.comment);t.includes("\n")?(n.push("..."),n.push(zs(t,""))):n.push(`... ${t}`)}else n.push("...");else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,"")),t&&(o&&!a||""===n[n.length-1]||n.push(""),n.push(zs(i(t),"")))}return n.join("\n")+"\n"}(this,e)}}function Eo(e){if(ys(e))return!0;throw new Error("Expected a YAML collection as document contents")}Error;const Ao=Symbol("break visit"),_o=Symbol("skip children"),Io=Symbol("remove item");function To(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),Mo(Object.freeze([]),e,t)}function Mo(e,t,n){let r=n(t,e);if("symbol"==typeof r)return r;for(const s of["key","value"]){const i=t[s];if(i&&"items"in i){for(let t=0;t<i.items.length;++t){const r=Mo(Object.freeze(e.concat([[s,t]])),i.items[t],n);if("number"==typeof r)t=r-1;else{if(r===Ao)return Ao;r===Io&&(i.items.splice(t,1),t-=1)}}"function"==typeof r&&"key"===s&&(r=r(t,e))}}return"function"==typeof r?r(t,e):r}To.BREAK=Ao,To.SKIP=_o,To.REMOVE=Io,To.itemAtPath=(e,t)=>{let n=e;for(const[e,r]of t){const t=n?.[e];if(!t||!("items"in t))return;n=t.items[r]}return n},To.parentCollection=(e,t)=>{const n=To.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],s=n?.[r];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};new Set("0123456789ABCDEFabcdef"),new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),new Set(",[]{}"),new Set(" ,[]{}\n\r\t");const Co=(e,{directive:t=!1,aliasDuplicateObjects:n=!1,...r}={})=>{const s={aliasDuplicateObjects:n,...r};if(t){const t=new Oo(ts(e),s);return t.directives.yaml.explicit=!0,t.toString(s)}return function(e,t,n){let r=null;if("function"==typeof t||Array.isArray(t)?r=t:void 0===n&&t&&(n=t),"string"==typeof n&&(n=n.length),"number"==typeof n){const e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){const{keepUndefined:e}=n??t??{};if(!e)return}return hs(e)&&!r?e.toString(n):new Oo(e,r,n).toString(n)}(ts(e),s)},jo=(e,t=or)=>t.toRefract(e),No=(e,t=or)=>{const n=jo(e,t);return JSON.stringify(n)},Fo=e=>{let t="",n=0;return An(e,{enter(e){const{element:r}=e.node,s=r.charAt(0).toUpperCase()+r.slice(1),i=" ".repeat(n);t+=n>0?"\n":"",t+=`${i}(${s}Element`,n+=1},leave(){n-=1,t+=")"}}),t},Do=e=>{const t=e.isMetaEmpty?void 0:hn(e.meta),n=e.isAttributesEmpty?void 0:hn(e.attributes);return new e.constructor(void 0,t,n)},Bo=(e,t)=>t.clone&&t.isMergeableElement(e)?Lo(Do(e),e,t):e,$o={clone:!0,isMergeableElement:e=>V(e)||R(e),arrayElementMerge:(e,t,n)=>new(0,e.constructor)(e.concat(t).map(e=>Bo(e,n))),objectElementMerge:(e,t,n)=>{const r=V(e)?Do(e):Do(t);return V(e)&&e.forEach((e,t,s)=>{const i=fn(s);i.value=Bo(e,n),r.content.push(i)}),t.forEach((t,s,i)=>{const o=ts(s);let a;if(V(e)&&e.hasKey(o)&&n.isMergeableElement(t)){const r=e.get(o);a=fn(i),a.value=((e,t)=>{if("function"!=typeof t.customMerge)return Lo;const n=t.customMerge(e,t);return"function"==typeof n?n:Lo})(s,n)(r,t,n)}else a=fn(i),a.value=Bo(t,n);r.remove(o),r.content.push(a)}),r},customMerge:void 0,customMetaMerge:void 0,customAttributesMerge:void 0},Lo=(e,t,n)=>{const r={...$o,...n};r.isMergeableElement=r.isMergeableElement??$o.isMergeableElement,r.arrayElementMerge=r.arrayElementMerge??$o.arrayElementMerge,r.objectElementMerge=r.objectElementMerge??$o.objectElementMerge;const s=R(t);if(!(s===R(e)))return Bo(t,r);const i=s&&"function"==typeof r.arrayElementMerge?r.arrayElementMerge(e,t,r):r.objectElementMerge(e,t,r);return i.meta=(e=>"function"!=typeof e.customMetaMerge?e=>hn(e):e.customMetaMerge)(r)(e.meta,t.meta),i.attributes=(e=>"function"!=typeof e.customAttributesMerge?e=>hn(e):e.customAttributesMerge)(r)(e.attributes,t.attributes),i};Lo.all=(e,t)=>{if(!Array.isArray(e))throw new TypeError("First argument of deepmerge should be an array.");return 0===e.length?new B:e.reduce((e,n)=>Lo(e,n,t),Do(e[0]))};const Po=Lo,Uo=(e,t,n)=>{const r={...$o,...n,customMerge:()=>(e,t)=>t,clone:!1};return Po(e,t,r)};Uo.all=(e,t)=>{if(!Array.isArray(e))throw new TypeError("First argument of mergeRight should be an array.");return 0===e.length?new B:e.reduce((e,n)=>Uo(e,n,t),Do(e[0]))};const qo=Uo,Ro=(...[e,t,n])=>qo(t,e,n);Ro.all=(...[e,t])=>qo.all([...e].reverse(),t);const Vo=Ro;function Go(e,t){const n=(e instanceof _?e.constructor:e).fixedFields??[];return t?.indexed?Object.fromEntries(n.map(e=>[e.name,e])):n}return r})());
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.apidomCore=t():e.apidomCore=t()}(self,()=>(()=>{"use strict";var e={279(e){var t=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,o=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,a=(e,t)=>{for(var n in t||(t={}))s.call(t,n)&&o(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&o(e,n,t[n]);return e},c=(e,t,n)=>o(e,"symbol"!=typeof t?t+"":t,n),l={};((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(l,{DEFAULT_OPTIONS:()=>h,DEFAULT_UUID_LENGTH:()=>u,default:()=>f});var u=6,h={dictionary:"alphanum",shuffle:!0,debug:!1,length:u,counter:0},p=class{constructor(e={}){c(this,"counter"),c(this,"debug"),c(this,"dict"),c(this,"version"),c(this,"dictIndex",0),c(this,"dictRange",[]),c(this,"lowerBound",0),c(this,"upperBound",0),c(this,"dictLength",0),c(this,"uuidLength"),c(this,"_digit_first_ascii",48),c(this,"_digit_last_ascii",58),c(this,"_alpha_lower_first_ascii",97),c(this,"_alpha_lower_last_ascii",123),c(this,"_hex_last_ascii",103),c(this,"_alpha_upper_first_ascii",65),c(this,"_alpha_upper_last_ascii",91),c(this,"_number_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii]}),c(this,"_alpha_dict_ranges",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),c(this,"_alpha_lower_dict_ranges",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),c(this,"_alpha_upper_dict_ranges",{upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),c(this,"_alphanum_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),c(this,"_alphanum_lower_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),c(this,"_alphanum_upper_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),c(this,"_hex_dict_ranges",{decDigits:[this._digit_first_ascii,this._digit_last_ascii],alphaDigits:[this._alpha_lower_first_ascii,this._hex_last_ascii]}),c(this,"_dict_ranges",{_number_dict_ranges:this._number_dict_ranges,_alpha_dict_ranges:this._alpha_dict_ranges,_alpha_lower_dict_ranges:this._alpha_lower_dict_ranges,_alpha_upper_dict_ranges:this._alpha_upper_dict_ranges,_alphanum_dict_ranges:this._alphanum_dict_ranges,_alphanum_lower_dict_ranges:this._alphanum_lower_dict_ranges,_alphanum_upper_dict_ranges:this._alphanum_upper_dict_ranges,_hex_dict_ranges:this._hex_dict_ranges}),c(this,"log",(...e)=>{const t=[...e];t[0]="[short-unique-id] ".concat(e[0]),!0!==this.debug||"undefined"==typeof console||null===console||console.log(...t)}),c(this,"_normalizeDictionary",(e,t)=>{let n;if(e&&Array.isArray(e)&&e.length>1)n=e;else{n=[],this.dictIndex=0;const t="_".concat(e,"_dict_ranges"),r=this._dict_ranges[t];let s=0;for(const[,e]of Object.entries(r)){const[t,n]=e;s+=Math.abs(n-t)}n=new Array(s);let i=0;for(const[,e]of Object.entries(r)){this.dictRange=e,this.lowerBound=this.dictRange[0],this.upperBound=this.dictRange[1];const t=this.lowerBound<=this.upperBound,r=this.lowerBound,s=this.upperBound;if(t)for(let e=r;e<s;e++)n[i++]=String.fromCharCode(e),this.dictIndex=e;else for(let e=r;e>s;e--)n[i++]=String.fromCharCode(e),this.dictIndex=e}n.length=i}if(t){for(let e=n.length-1;e>0;e--){const t=Math.floor(Math.random()*(e+1));[n[e],n[t]]=[n[t],n[e]]}}return n}),c(this,"setDictionary",(e,t)=>{this.dict=this._normalizeDictionary(e,t),this.dictLength=this.dict.length,this.setCounter(0)}),c(this,"seq",()=>this.sequentialUUID()),c(this,"sequentialUUID",()=>{const e=this.dictLength,t=this.dict;let n=this.counter;const r=[];do{const s=n%e;n=Math.trunc(n/e),r.push(t[s])}while(0!==n);const s=r.join("");return this.counter+=1,s}),c(this,"rnd",(e=this.uuidLength||u)=>this.randomUUID(e)),c(this,"randomUUID",(e=this.uuidLength||u)=>{if(null==e||e<1)throw new Error("Invalid UUID Length Provided");const t=new Array(e),n=this.dictLength,r=this.dict;for(let s=0;s<e;s++){const e=Math.floor(Math.random()*n);t[s]=r[e]}return t.join("")}),c(this,"fmt",(e,t)=>this.formattedUUID(e,t)),c(this,"formattedUUID",(e,t)=>{const n={$r:this.randomUUID,$s:this.sequentialUUID,$t:this.stamp};return e.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,e=>{const r=e.slice(0,2),s=Number.parseInt(e.slice(2),10);return"$s"===r?n[r]().padStart(s,"0"):"$t"===r&&t?n[r](s,t):n[r](s)})}),c(this,"availableUUIDs",(e=this.uuidLength)=>Number.parseFloat(([...new Set(this.dict)].length**e).toFixed(0))),c(this,"_collisionCache",new Map),c(this,"approxMaxBeforeCollision",(e=this.availableUUIDs(this.uuidLength))=>{const t=e,n=this._collisionCache.get(t);if(void 0!==n)return n;const r=Number.parseFloat(Math.sqrt(Math.PI/2*e).toFixed(20));return this._collisionCache.set(t,r),r}),c(this,"collisionProbability",(e=this.availableUUIDs(this.uuidLength),t=this.uuidLength)=>Number.parseFloat((this.approxMaxBeforeCollision(e)/this.availableUUIDs(t)).toFixed(20))),c(this,"uniqueness",(e=this.availableUUIDs(this.uuidLength))=>{const t=Number.parseFloat((1-this.approxMaxBeforeCollision(e)/e).toFixed(20));return t>1?1:t<0?0:t}),c(this,"getVersion",()=>this.version),c(this,"stamp",(e,t)=>{const n=Math.floor(+(t||new Date)/1e3).toString(16);if("number"==typeof e&&0===e)return n;if("number"!=typeof e||e<10)throw new Error(["Param finalLength must be a number greater than or equal to 10,","or 0 if you want the raw hexadecimal timestamp"].join("\n"));const r=e-9,s=Math.round(Math.random()*(r>15?15:r)),i=this.randomUUID(r);return"".concat(i.substring(0,s)).concat(n).concat(i.substring(s)).concat(s.toString(16))}),c(this,"parseStamp",(e,t)=>{if(t&&!/t0|t[1-9]\d{1,}/.test(t))throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");const n=t?t.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,e=>{const t={$r:e=>[...Array(e)].map(()=>"r").join(""),$s:e=>[...Array(e)].map(()=>"s").join(""),$t:e=>[...Array(e)].map(()=>"t").join("")},n=e.slice(0,2),r=Number.parseInt(e.slice(2),10);return t[n](r)}).replace(/^(.*?)(t{8,})(.*)$/g,(t,n,r)=>e.substring(n.length,n.length+r.length)):e;if(8===n.length)return new Date(1e3*Number.parseInt(n,16));if(n.length<10)throw new Error("Stamp length invalid");const r=Number.parseInt(n.substring(n.length-1),16);return new Date(1e3*Number.parseInt(n.substring(r,r+8),16))}),c(this,"setCounter",e=>{this.counter=e}),c(this,"validate",(e,t)=>{const n=t?this._normalizeDictionary(t):this.dict;return e.split("").every(e=>n.includes(e))});const t=a(a({},h),e);this.counter=0,this.debug=!1,this.dict=[],this.version="5.3.2";const{dictionary:n,shuffle:r,length:s,counter:i}=t;this.uuidLength=s,this.setDictionary(n,r),this.setCounter(i),this.debug=t.debug,this.log(this.dict),this.log("Generator instantiated with Dictionary Size ".concat(this.dictLength," and counter set to ").concat(this.counter)),this.log=this.log.bind(this),this.setDictionary=this.setDictionary.bind(this),this.setCounter=this.setCounter.bind(this),this.seq=this.seq.bind(this),this.sequentialUUID=this.sequentialUUID.bind(this),this.rnd=this.rnd.bind(this),this.randomUUID=this.randomUUID.bind(this),this.fmt=this.fmt.bind(this),this.formattedUUID=this.formattedUUID.bind(this),this.availableUUIDs=this.availableUUIDs.bind(this),this.approxMaxBeforeCollision=this.approxMaxBeforeCollision.bind(this),this.collisionProbability=this.collisionProbability.bind(this),this.uniqueness=this.uniqueness.bind(this),this.getVersion=this.getVersion.bind(this),this.stamp=this.stamp.bind(this),this.parseStamp=this.parseStamp.bind(this)}};c(p,"default",p);var d,f=p;return d=l,((r,i,o,a)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let c of n(i))s.call(r,c)||c===o||e(r,c,{get:()=>i[c],enumerable:!(a=t(i,c))||a.enumerable});return r})(e({},"__esModule",{value:!0}),d)})();e.exports=t.default,"undefined"!=typeof window&&(t=t.default)}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};function s(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function i(e){return function t(n){return 0===arguments.length||s(n)?t:e.apply(this,arguments)}}function o(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return s(n)?t:i(function(t){return e(n,t)});default:return s(n)&&s(r)?t:s(n)?i(function(t){return e(t,r)}):s(r)?i(function(t){return e(n,t)}):e(n,r)}}}function a(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function c(e,t,n){for(var r=0,s=n.length;r<s;){if(e(t,n[r]))return!0;r+=1}return!1}function l(e,t){return Object.prototype.hasOwnProperty.call(t,e)}n.r(r),n.d(r,{ElementIdentityError:()=>dr,IdentityManager:()=>fr,MediaTypes:()=>wr,Transcluder:()=>Ar,createToolbox:()=>cr,deepmerge:()=>Po,defaultIdentityManager:()=>mr,dehydrate:()=>jo,dispatchRefractorPlugins:()=>ur,fixedFields:()=>Go,from:()=>es,mergeLeft:()=>Vo,mergeRight:()=>qo,refractorPluginElementIdentity:()=>yr,refractorPluginSemanticElementIdentity:()=>gr,resolveSpecification:()=>Zr,sexprs:()=>Fo,toJSON:()=>ns,toString:()=>No,toValue:()=>ts,toYAML:()=>Co,transclude:()=>Er});const u="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var h=Object.prototype.toString;const p=function(){return"[object Arguments]"===h.call(arguments)?function(e){return"[object Arguments]"===h.call(e)}:function(e){return l("callee",e)}}();var d=!{toString:null}.propertyIsEnumerable("toString"),f=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=function(){return arguments.propertyIsEnumerable("length")}(),y=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1},g="function"!=typeof Object.keys||m?i(function(e){if(Object(e)!==e)return[];var t,n,r=[],s=m&&p(e);for(t in e)!l(t,e)||s&&"length"===t||(r[r.length]=t);if(d)for(n=f.length-1;n>=0;)l(t=f[n],e)&&!y(r,t)&&(r[r.length]=t),n-=1;return r}):i(function(e){return Object(e)!==e?[]:Object.keys(e)});const x=g;const b=i(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function w(e,t,n,r){var s=a(e);function i(e,t){return v(e,t,n.slice(),r.slice())}return!c(function(e,t){return!c(i,t,e)},a(t),s)}function v(e,t,n,r){if(u(e,t))return!0;var s=b(e);if(s!==b(t))return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(s){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]}(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!u(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!u(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var i=n.length-1;i>=0;){if(n[i]===e)return r[i]===t;i-=1}switch(s){case"Map":return e.size===t.size&&w(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&w(e.values(),t.values(),n.concat([e]),r.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var o=x(e);if(o.length!==x(t).length)return!1;var a=n.concat([e]),c=r.concat([t]);for(i=o.length-1;i>=0;){var h=o[i];if(!l(h,t)||!v(t[h],e[h],a,c))return!1;i-=1}return!0}const k=o(function(e,t){return v(e,t,[],[])});const S=class{key;value;constructor(e,t){this.key=e,this.value=t}toValue(){return{key:this.key?.toValue(),value:this.value?.toValue()}}};class O{elements;constructor(e){this.elements=e??[]}toValue(){return this.elements.map(e=>({key:e.key?.toValue(),value:e.value?.toValue()}))}map(e,t){return this.elements.map(n=>{const r=n.value,s=n.key;if(void 0===r||void 0===s)throw new Error("MemberElement must have both key and value");return void 0!==t?e.call(t,r,s,n):e(r,s,n)})}filter(e,t){const n=this.elements.filter(n=>{const r=n.value,s=n.key;return void 0!==r&&void 0!==s&&(void 0!==t?e.call(t,r,s,n):e(r,s,n))});return new O(n)}reject(e,t){const n=[];for(const r of this.elements){const s=r.value,i=r.key;void 0!==s&&void 0!==i&&(e.call(t,s,i,r)||n.push(r))}return new O(n)}forEach(e,t){this.elements.forEach((n,r)=>{const s=n.value,i=n.key;void 0!==s&&void 0!==i&&(void 0!==t?e.call(t,s,i,n,r):e(s,i,n,r))})}find(e,t){return this.elements.find(n=>{const r=n.value,s=n.key;return void 0!==r&&void 0!==s&&(void 0!==t?e.call(t,r,s,n):e(r,s,n))})}keys(){return this.elements.map(e=>e.key?.toValue()).filter(e=>void 0!==e)}values(){return this.elements.map(e=>e.value?.toValue()).filter(e=>void 0!==e)}get length(){return this.elements.length}get isEmpty(){return 0===this.length}get first(){return this.elements[0]}get(e){return this.elements[e]}push(e){return this.elements.push(e),this}includesKey(e){return this.elements.some(t=>t.key?.equals(e))}[Symbol.iterator](){return this.elements[Symbol.iterator]()}}const E=O;class A{parent;startLine;startCharacter;startOffset;endLine;endCharacter;endOffset;_storedElement="element";_content;_meta;_attributes;constructor(e,t,n){void 0!==t&&(this.meta=t),void 0!==n&&(this.attributes=n),void 0!==e&&(this.content=e)}get element(){return this._storedElement}set element(e){this._storedElement=e}get content(){return this._content}set content(e){if(e instanceof A)this._content=e;else if(null!=e&&"string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e&&"bigint"!=typeof e&&"symbol"!=typeof e)if(e instanceof S)this._content=e;else if(e instanceof E)this._content=e.elements;else if(Array.isArray(e))this._content=e.map(e=>this.refract(e));else{if("object"!=typeof e)throw new Error("Cannot set content to value of type "+typeof e);this._content=Object.entries(e).map(([e,t])=>new this.MemberElement(e,t))}else this._content=e}get meta(){if(!this._meta){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._meta=new this.ObjectElement}return this._meta}set meta(e){e instanceof A?this._meta=e:this.meta.set(e??{})}get attributes(){if(!this._attributes){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._attributes=new this.ObjectElement}return this._attributes}set attributes(e){e instanceof A?this._attributes=e:this.attributes.set(e??{})}get id(){return this.isFrozen?this.getMetaProperty("id",""):(this.hasMetaProperty("id")||this.setMetaProperty("id",""),this.meta.get("id"))}set id(e){this.setMetaProperty("id",e)}get classes(){return this.isFrozen?this.getMetaProperty("classes",[]):(this.hasMetaProperty("classes")||this.setMetaProperty("classes",[]),this.meta.get("classes"))}set classes(e){this.setMetaProperty("classes",e)}get links(){return this.isFrozen?this.getMetaProperty("links",[]):(this.hasMetaProperty("links")||this.setMetaProperty("links",[]),this.meta.get("links"))}set links(e){this.setMetaProperty("links",e)}get children(){const{_content:e}=this;if(Array.isArray(e))return e;if(e instanceof S){const t=[];return e.key&&t.push(e.key),e.value&&t.push(e.value),t}return e instanceof A?[e]:[]}get isFrozen(){return Object.isFrozen(this)}freeze(){if(!this.isFrozen){this._meta&&(this._meta.parent=this,this._meta.freeze()),this._attributes&&(this._attributes.parent=this,this._attributes.freeze());for(const e of this.children)e.parent=this,e.freeze();Array.isArray(this._content)&&Object.freeze(this._content),Object.freeze(this)}}toValue(){const{_content:e}=this;return e instanceof A||e instanceof S?e.toValue():Array.isArray(e)?e.map(e=>e.toValue()):e}equals(e){const t=e instanceof A?e.toValue():e;return k(this.toValue(),t)}primitive(){}set(e){return this.content=e,this}toRef(e){const t=this.id.toValue();if(""===t)throw new Error("Cannot create reference to an element without an ID");const n=new this.RefElement(t);return"string"==typeof e&&(n.path=this.refract(e)),n}getMetaProperty(e,t){if(!this.hasMetaProperty(e)){if(void 0===t)return;const e=this.refract(t);return e&&this.isFrozen&&e.freeze(),e}return this.meta.get(e)}setMetaProperty(e,t){this.meta.set(e,t)}hasMetaProperty(e){return!this.isMetaEmpty&&this.meta.hasKey(e)}get isMetaEmpty(){return void 0===this._meta||this.meta.isEmpty}getAttributesProperty(e,t){if(!this.hasAttributesProperty(e)){if(this.isFrozen){const e=this.refract(t);return e.freeze(),e}this.attributes.set(e,t)}return this.attributes.get(e)}setAttributesProperty(e,t){this.attributes.set(e,t)}hasAttributesProperty(e){return!this.isAttributesEmpty&&this.attributes.hasKey(e)}get isAttributesEmpty(){return void 0===this._attributes||this.attributes.isEmpty}}const _=A;const I=class extends _{constructor(e,t,n){super(e,t,n),this.element="string"}primitive(){return"string"}get length(){return this.content?.length??0}};const T=class extends _{constructor(e,t,n){super(e,t,n),this.element="number"}primitive(){return"number"}};const M=class extends _{constructor(e,t,n){super(e??null,t,n),this.element="null"}primitive(){return"null"}set(e){throw new Error("Cannot set the value of null")}};const C=class extends _{constructor(e,t,n){super(e,t,n),this.element="boolean"}primitive(){return"boolean"}};class j extends _{constructor(e,t,n){super(e||[],t,n)}get length(){return this._content.length}get isEmpty(){return 0===this.length}get first(){return this._content[0]}get second(){return this._content[1]}get last(){return this._content.at(-1)}push(...e){for(const t of e)this._content.push(this.refract(t));return this}shift(){return this._content.shift()}unshift(e){this._content.unshift(this.refract(e))}includes(e){return this._content.some(t=>t.equals(e))}findElements(e,t){const n=t||{},r=!!n.recursive,s=void 0===n.results?[]:n.results;for(let t=0;t<this._content.length;t+=1){const n=this._content[t],i=n;r&&"function"==typeof i.findElements&&i.findElements(e,{results:s,recursive:r}),e(n,t,void 0)&&s.push(n)}return s}find(e){const t=this.findElements(e,{recursive:!0});return new this.ArrayElement(t)}findByElement(e){return this.find(t=>t.element===e)}findByClass(e){return this.find(t=>{const n=t.classes;return"function"==typeof n.includes&&n.includes(e)})}getById(e){return this.find(t=>t.id.toValue()===e).first}concat(e){return new(0,this.constructor)(this._content.concat(e._content))}[Symbol.iterator](){return this._content[Symbol.iterator]()}}const N=j;const F=class extends N{constructor(e,t,n){super(e||[],t,n),this.element="array"}primitive(){return"array"}get(e){return this._content[e]}getValue(e){const t=this.get(e);if(t)return t.toValue()}set(e,t){return"number"==typeof e&&void 0!==t?this._content[e]=this.refract(t):this.content=e,this}remove(e){return this._content.splice(e,1)[0]??null}map(e,t){return this._content.map(e,t)}flatMap(e,t){return this._content.flatMap(e,t)}compactMap(e,t){const n=[];for(const r of this._content){const s=e.call(t,r);s&&n.push(s)}return n}filter(e,t){const n=this._content.filter(e,t);return new this.constructor(n)}reject(e,t){const n=[];for(const r of this._content)e.call(t,r)||n.push(r);return new this.constructor(n)}reduce(e,t){let n,r;void 0!==t?(n=0,r=this.refract(t)):(n=1,r=this.first);for(let t=n;t<this.length;t+=1){const n=e(r,this._content[t],t,this);r=void 0===n?n:this.refract(n)}return r}forEach(e,t){this._content.forEach((n,r)=>{e.call(t,n,r)})}empty(){return new this.constructor([])}};const D=class extends _{constructor(e,t,n,r){super(new S,n,r),this.element="member",void 0!==e&&(this.key=e),arguments.length>=2&&(this.value=t)}primitive(){return"member"}get key(){return this._content.key}set key(e){this._content.key=this.refract(e)}get value(){return this._content.value}set value(e){this._content.value=void 0===e?void 0:this.refract(e)}};const B=class extends N{constructor(e,t,n){super(e||[],t,n),this.element="object"}primitive(){return"object"}toValue(){return this._content.reduce((e,t)=>(e[t.key.toValue()]=t.value?t.value.toValue():void 0,e),{})}get(e){const t=this.getMember(e);if(t)return t.value}getValue(e){const t=this.get(e);if(t)return t.toValue()}getMember(e){if(void 0!==e)return this._content.find(t=>t.key.toValue()===e)}remove(e){let t=null;return this.content=this._content.filter(n=>n.key.toValue()!==e||(t=n,!1)),t}getKey(e){const t=this.getMember(e);if(t)return t.key}set(e,t){if("string"==typeof e){const n=this.getMember(e);n?n.value=t:this._content.push(new D(e,t))}else if("object"==typeof e&&!Array.isArray(e))for(const t of Object.keys(e))this.set(t,e[t]);return this}keys(){return this._content.map(e=>e.key.toValue())}values(){return this._content.map(e=>e.value.toValue())}hasKey(e){return this._content.some(t=>t.key.equals(e))}items(){return this._content.map(e=>[e.key.toValue(),e.value.toValue()])}map(e,t){return this._content.map(n=>e.call(t,n.value,n.key,n))}compactMap(e,t){const n=[];return this.forEach((r,s,i)=>{const o=e.call(t,r,s,i);o&&n.push(o)}),n}filter(e,t){return new E(this._content).filter(e,t)}reject(e,t){const n=[];for(const r of this._content)e.call(t,r.value,r.key,r)||n.push(r);return new E(n)}forEach(e,t){this._content.forEach(n=>e.call(t,n.value,n.key,n))}reduce(e,t){let n,r;void 0!==t?(n=0,r=this.refract(t)):(n=1,r=this._content[0]?.value);for(let t=n;t<this._content.length;t+=1){const n=this._content[t],s=e(r,n.value,n.key,n,this);r=void 0===s?s:this.refract(s)}return r}empty(){return new this.constructor([])}},$=e=>e instanceof _,L=e=>e instanceof I,P=e=>e instanceof T,U=e=>e instanceof M,q=e=>e instanceof C,R=e=>e instanceof F,V=e=>e instanceof B,G=e=>e instanceof D,H=e=>V(e)&&"object"===e.element||R(e)&&"array"===e.element||q(e)&&"boolean"===e.element||P(e)&&"number"===e.element||L(e)&&"string"===e.element||U(e)&&"null"===e.element||G(e)&&"member"===e.element,z=function(){const e=J,t=K,n=this,r="parser.js: Parser(): ";n.ast=void 0,n.stats=void 0,n.trace=void 0,n.callbacks=[];let s,i,o,a,c,l,u,h=0,p=0,d=0,f=0,m=0,y=new function(){this.state=e.ACTIVE,this.phraseLength=0,this.refresh=()=>{this.state=e.ACTIVE,this.phraseLength=0}};n.parse=(g,x,w,v)=>{const k=`${r}parse(): `;h=0,p=0,d=0,f=0,m=0,s=void 0,i=void 0,o=void 0,a=void 0,y.refresh(),c=void 0,l=void 0,u=void 0,a=t.stringToChars(w),s=g.rules,i=g.udts;const S=x.toLowerCase();let O;for(const e in s)if(s.hasOwnProperty(e)&&S===s[e].lower){O=s[e].index;break}if(void 0===O)throw new Error(`${k}start rule name '${startRule}' not recognized`);(()=>{const e=`${r}initializeCallbacks(): `;let t,o;for(c=[],l=[],t=0;t<s.length;t+=1)c[t]=void 0;for(t=0;t<i.length;t+=1)l[t]=void 0;const a=[];for(t=0;t<s.length;t+=1)a.push(s[t].lower);for(t=0;t<i.length;t+=1)a.push(i[t].lower);for(const r in n.callbacks)if(n.callbacks.hasOwnProperty(r)){if(t=a.indexOf(r.toLowerCase()),t<0)throw new Error(`${e}syntax callback '${r}' not a rule or udt name`);if(o=n.callbacks[r]?n.callbacks[r]:void 0,"function"!=typeof o&&void 0!==o)throw new Error(`${e}syntax callback[${r}] must be function reference or falsy)`);t<s.length?c[t]=o:l[t-s.length]=o}})(),n.trace&&n.trace.init(s,i,a),n.stats&&n.stats.init(s,i),n.ast&&n.ast.init(s,i,a),u=v,o=[{type:e.RNM,index:O}],b(0,0),o=void 0;let E=!1;switch(y.state){case e.ACTIVE:throw new Error(`${k}final state should never be 'ACTIVE'`);case e.NOMATCH:E=!1;break;case e.EMPTY:case e.MATCH:E=y.phraseLength===a.length;break;default:throw new Error("unrecognized state")}return{success:E,state:y.state,stateName:e.idName(y.state),length:a.length,matched:y.phraseLength,maxMatched:m,maxTreeDepth:d,nodeHits:f}};const g=(t,n,s,i)=>{if(n.phraseLength>s){let e=`${r}opRNM(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${n.phraseLength}`,e+=` must be <= remaining chars: ${s}`,new Error(e)}switch(n.state){case e.ACTIVE:if(!i)throw new Error(`${r}opRNM(${t.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:n.phraseLength=0;break;case e.MATCH:0===n.phraseLength&&(n.state=e.EMPTY);break;case e.NOMATCH:n.phraseLength=0;break;default:throw new Error(`${r}opRNM(${t.name}): callback function return error. Unrecognized return state: ${n.state}`)}},x=(t,c)=>{let p,d,f;const m=o[t],g=i[m.index];y.UdtIndex=g.index,h||(f=n.ast&&n.ast.udtDefined(m.index),f&&(d=s.length+m.index,p=n.ast.getLength(),n.ast.down(d,g.name)));const x=a.length-c;l[m.index](y,a,c,u),((t,n,s)=>{if(n.phraseLength>s){let e=`${r}opUDT(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${n.phraseLength}`,e+=` must be <= remaining chars: ${s}`,new Error(e)}switch(n.state){case e.ACTIVE:throw new Error(`${r}opUDT(${t.name}) ACTIVE state return not allowed.`);case e.EMPTY:if(!t.empty)throw new Error(`${r}opUDT(${t.name}) may not return EMPTY.`);n.phraseLength=0;break;case e.MATCH:if(0===n.phraseLength){if(!t.empty)throw new Error(`${r}opUDT(${t.name}) may not return EMPTY.`);n.state=e.EMPTY}break;case e.NOMATCH:n.phraseLength=0;break;default:throw new Error(`${r}opUDT(${t.name}): callback function return error. Unrecognized return state: ${n.state}`)}})(g,y,x),h||f&&(y.state===e.NOMATCH?n.ast.setLength(p):n.ast.up(d,g.name,c,y.phraseLength))},b=(t,i)=>{const l=`${r}opExecute(): `,w=o[t];switch(f+=1,p>d&&(d=p),p+=1,y.refresh(),n.trace&&n.trace.down(w,i),w.type){case e.ALT:((t,n)=>{const r=o[t];for(let t=0;t<r.children.length&&(b(r.children[t],n),y.state===e.NOMATCH);t+=1);})(t,i);break;case e.CAT:((t,r)=>{let s,i,a,c;const l=o[t];n.ast&&(i=n.ast.getLength()),s=!0,a=r,c=0;for(let t=0;t<l.children.length;t+=1){if(b(l.children[t],a),y.state===e.NOMATCH){s=!1;break}a+=y.phraseLength,c+=y.phraseLength}s?(y.state=0===c?e.EMPTY:e.MATCH,y.phraseLength=c):(y.state=e.NOMATCH,y.phraseLength=0,n.ast&&n.ast.setLength(i))})(t,i);break;case e.REP:((t,r)=>{let s,i,c,l;const u=o[t];if(0===u.max)return y.state=e.EMPTY,void(y.phraseLength=0);for(i=r,c=0,l=0,n.ast&&(s=n.ast.getLength());!(i>=a.length)&&(b(t+1,i),y.state!==e.NOMATCH)&&y.state!==e.EMPTY&&(l+=1,c+=y.phraseLength,i+=y.phraseLength,l!==u.max););y.state===e.EMPTY||l>=u.min?(y.state=0===c?e.EMPTY:e.MATCH,y.phraseLength=c):(y.state=e.NOMATCH,y.phraseLength=0,n.ast&&n.ast.setLength(s))})(t,i);break;case e.RNM:((t,r)=>{let i,l,p;const d=o[t],f=s[d.index],m=c[f.index];if(h||(l=n.ast&&n.ast.ruleDefined(d.index),l&&(i=n.ast.getLength(),n.ast.down(d.index,s[d.index].name))),m){const t=a.length-r;m(y,a,r,u),g(f,y,t,!0),y.state===e.ACTIVE&&(p=o,o=f.opcodes,b(0,r),o=p,m(y,a,r,u),g(f,y,t,!1))}else p=o,o=f.opcodes,b(0,r,y),o=p;h||l&&(y.state===e.NOMATCH?n.ast.setLength(i):n.ast.up(d.index,f.name,r,y.phraseLength))})(t,i);break;case e.TRG:((t,n)=>{const r=o[t];y.state=e.NOMATCH,n<a.length&&r.min<=a[n]&&a[n]<=r.max&&(y.state=e.MATCH,y.phraseLength=1)})(t,i);break;case e.TBS:((t,n)=>{const r=o[t],s=r.string.length;if(y.state=e.NOMATCH,n+s<=a.length){for(let e=0;e<s;e+=1)if(a[n+e]!==r.string[e])return;y.state=e.MATCH,y.phraseLength=s}})(t,i);break;case e.TLS:((t,n)=>{let r;const s=o[t];y.state=e.NOMATCH;const i=s.string.length;if(0!==i){if(n+i<=a.length){for(let e=0;e<i;e+=1)if(r=a[n+e],r>=65&&r<=90&&(r+=32),r!==s.string[e])return;y.state=e.MATCH,y.phraseLength=i}}else y.state=e.EMPTY})(t,i);break;case e.UDT:x(t,i);break;case e.AND:((t,n)=>{switch(h+=1,b(t+1,n),h-=1,y.phraseLength=0,y.state){case e.EMPTY:case e.MATCH:y.state=e.EMPTY;break;case e.NOMATCH:y.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${y.state}`)}})(t,i);break;case e.NOT:((t,n)=>{switch(h+=1,b(t+1,n),h-=1,y.phraseLength=0,y.state){case e.EMPTY:case e.MATCH:y.state=e.NOMATCH;break;case e.NOMATCH:y.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${y.state}`)}})(t,i);break;default:throw new Error(`${l}unrecognized operator`)}h||i+y.phraseLength>m&&(m=i+y.phraseLength),n.stats&&n.stats.collect(w,y),n.trace&&n.trace.up(w,y.state,i,y.phraseLength),p-=1}},K={stringToChars:e=>[...e].map(e=>e.codePointAt(0)),charsToString:(e,t,n)=>{let r=e;for(;!(void 0===t||t<0);){if(void 0===n){r=e.slice(t);break}if(n<=0)return"";r=e.slice(t,t+n);break}return String.fromCodePoint(...r)}},J={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,idName:e=>{switch(e){case J.ALT:return"ALT";case J.CAT:return"CAT";case J.REP:return"REP";case J.RNM:return"RNM";case J.TRG:return"TRG";case J.TBS:return"TBS";case J.TLS:return"TLS";case J.UDT:return"UDT";case J.AND:return"AND";case J.NOT:return"NOT";case J.ACTIVE:return"ACTIVE";case J.EMPTY:return"EMPTY";case J.MATCH:return"MATCH";case J.NOMATCH:return"NOMATCH";case J.SEM_PRE:return"SEM_PRE";case J.SEM_POST:return"SEM_POST";case J.SEM_OK:return"SEM_OK";default:return"UNRECOGNIZED STATE"}}};function W(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"json-pointer",lower:"json-pointer",index:0,isBkr:!1},this.rules[1]={name:"reference-token",lower:"reference-token",index:1,isBkr:!1},this.rules[2]={name:"unescaped",lower:"unescaped",index:2,isBkr:!1},this.rules[3]={name:"escaped",lower:"escaped",index:3,isBkr:!1},this.rules[4]={name:"array-location",lower:"array-location",index:4,isBkr:!1},this.rules[5]={name:"array-index",lower:"array-index",index:5,isBkr:!1},this.rules[6]={name:"array-dash",lower:"array-dash",index:6,isBkr:!1},this.rules[7]={name:"slash",lower:"slash",index:7,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:2,children:[2,3]},this.rules[0].opcodes[2]={type:4,index:7},this.rules[0].opcodes[3]={type:4,index:1},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:3,min:0,max:1/0},this.rules[1].opcodes[1]={type:1,children:[2,3]},this.rules[1].opcodes[2]={type:4,index:2},this.rules[1].opcodes[3]={type:4,index:3},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:1,children:[1,2,3]},this.rules[2].opcodes[1]={type:5,min:0,max:46},this.rules[2].opcodes[2]={type:5,min:48,max:125},this.rules[2].opcodes[3]={type:5,min:127,max:1114111},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2]},this.rules[3].opcodes[1]={type:7,string:[126]},this.rules[3].opcodes[2]={type:1,children:[3,4]},this.rules[3].opcodes[3]={type:7,string:[48]},this.rules[3].opcodes[4]={type:7,string:[49]},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2]},this.rules[5].opcodes[1]={type:6,string:[48]},this.rules[5].opcodes[2]={type:2,children:[3,4]},this.rules[5].opcodes[3]={type:5,min:49,max:57},this.rules[5].opcodes[4]={type:3,min:0,max:1/0},this.rules[5].opcodes[5]={type:5,min:48,max:57},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:7,string:[45]},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:7,string:[47]},this.toString=function(){let e="";return e+="; JavaScript Object Notation (JSON) Pointer ABNF syntax\n",e+="; https://datatracker.ietf.org/doc/html/rfc6901\n",e+="json-pointer = *( slash reference-token ) ; MODIFICATION: surrogate text rule used\n",e+="reference-token = *( unescaped / escaped )\n",e+="unescaped = %x00-2E / %x30-7D / %x7F-10FFFF\n",e+=" ; %x2F ('/') and %x7E ('~') are excluded from 'unescaped'\n",e+='escaped = "~" ( "0" / "1" )\n',e+=" ; representing '~' and '/', respectively\n",e+="\n",e+="; https://datatracker.ietf.org/doc/html/rfc6901#section-4\n",e+="array-location = array-index / array-dash\n",e+="array-index = %x30 / ( %x31-39 *(%x30-39) )\n",e+=' ; "0", or digits without a leading "0"\n',e+='array-dash = "-"\n',e+="\n",e+="; Surrogate named rules\n",e+='slash = "/"\n','; JavaScript Object Notation (JSON) Pointer ABNF syntax\n; https://datatracker.ietf.org/doc/html/rfc6901\njson-pointer = *( slash reference-token ) ; MODIFICATION: surrogate text rule used\nreference-token = *( unescaped / escaped )\nunescaped = %x00-2E / %x30-7D / %x7F-10FFFF\n ; %x2F (\'/\') and %x7E (\'~\') are excluded from \'unescaped\'\nescaped = "~" ( "0" / "1" )\n ; representing \'~\' and \'/\', respectively\n\n; https://datatracker.ietf.org/doc/html/rfc6901#section-4\narray-location = array-index / array-dash\narray-index = %x30 / ( %x31-39 *(%x30-39) )\n ; "0", or digits without a leading "0"\narray-dash = "-"\n\n; Surrogate named rules\nslash = "/"\n'}}class Y extends Error{constructor(e,t=void 0){if(super(e,t),this.name=this.constructor.name,"string"==typeof e&&(this.message=e),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack,null!=t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"cause")&&!("cause"in this)){const{cause:e}=t;this.cause=e,e instanceof Error&&"stack"in e&&(this.stack=`${this.stack}\nCAUSE: ${e.stack}`)}if(null!=t&&"object"==typeof t){const{cause:e,...n}=t;Object.assign(this,n)}}}const X=Y;new W;new W,new z,new W,new z,new W,new z,new W,new z;const Q=e=>{if("string"!=typeof e&&"number"!=typeof e)throw new TypeError("Reference token must be a string or number");return String(e).replace(/~/g,"~0").replace(/\//g,"~1")};const Z=class extends X{},ee=e=>{if(!Array.isArray(e))throw new TypeError("Reference tokens must be a list of strings or numbers");try{return 0===e.length?"":`/${e.map(e=>{if("string"!=typeof e&&"number"!=typeof e)throw new TypeError("Reference token must be a string or number");return Q(String(e))}).join("/")}`}catch(t){throw new Z("Unexpected error during JSON Pointer compilation",{cause:t,referenceTokens:e})}};class te extends Error{constructor(e,t=void 0){if(super(e,t),this.name=this.constructor.name,"string"==typeof e&&(this.message=e),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack,null!=t&&"object"==typeof t&&Object.hasOwn(t,"cause")&&!("cause"in this)){const{cause:e}=t;this.cause=e,e instanceof Error&&"stack"in e&&(this.stack=`${this.stack}\nCAUSE: ${e.stack}`)}if(null!=t&&"object"==typeof t){const{cause:e,...n}=t;Object.assign(this,n)}}}const ne=te;new function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"jsonpath-query",lower:"jsonpath-query",index:0,isBkr:!1},this.rules[1]={name:"segments",lower:"segments",index:1,isBkr:!1},this.rules[2]={name:"B",lower:"b",index:2,isBkr:!1},this.rules[3]={name:"S",lower:"s",index:3,isBkr:!1},this.rules[4]={name:"root-identifier",lower:"root-identifier",index:4,isBkr:!1},this.rules[5]={name:"selector",lower:"selector",index:5,isBkr:!1},this.rules[6]={name:"name-selector",lower:"name-selector",index:6,isBkr:!1},this.rules[7]={name:"string-literal",lower:"string-literal",index:7,isBkr:!1},this.rules[8]={name:"double-quoted",lower:"double-quoted",index:8,isBkr:!1},this.rules[9]={name:"single-quoted",lower:"single-quoted",index:9,isBkr:!1},this.rules[10]={name:"ESC",lower:"esc",index:10,isBkr:!1},this.rules[11]={name:"unescaped",lower:"unescaped",index:11,isBkr:!1},this.rules[12]={name:"escapable",lower:"escapable",index:12,isBkr:!1},this.rules[13]={name:"hexchar",lower:"hexchar",index:13,isBkr:!1},this.rules[14]={name:"non-surrogate",lower:"non-surrogate",index:14,isBkr:!1},this.rules[15]={name:"high-surrogate",lower:"high-surrogate",index:15,isBkr:!1},this.rules[16]={name:"low-surrogate",lower:"low-surrogate",index:16,isBkr:!1},this.rules[17]={name:"HEXDIG",lower:"hexdig",index:17,isBkr:!1},this.rules[18]={name:"wildcard-selector",lower:"wildcard-selector",index:18,isBkr:!1},this.rules[19]={name:"index-selector",lower:"index-selector",index:19,isBkr:!1},this.rules[20]={name:"int",lower:"int",index:20,isBkr:!1},this.rules[21]={name:"DIGIT1",lower:"digit1",index:21,isBkr:!1},this.rules[22]={name:"slice-selector",lower:"slice-selector",index:22,isBkr:!1},this.rules[23]={name:"start",lower:"start",index:23,isBkr:!1},this.rules[24]={name:"end",lower:"end",index:24,isBkr:!1},this.rules[25]={name:"step",lower:"step",index:25,isBkr:!1},this.rules[26]={name:"filter-selector",lower:"filter-selector",index:26,isBkr:!1},this.rules[27]={name:"logical-expr",lower:"logical-expr",index:27,isBkr:!1},this.rules[28]={name:"logical-or-expr",lower:"logical-or-expr",index:28,isBkr:!1},this.rules[29]={name:"logical-and-expr",lower:"logical-and-expr",index:29,isBkr:!1},this.rules[30]={name:"basic-expr",lower:"basic-expr",index:30,isBkr:!1},this.rules[31]={name:"paren-expr",lower:"paren-expr",index:31,isBkr:!1},this.rules[32]={name:"logical-not-op",lower:"logical-not-op",index:32,isBkr:!1},this.rules[33]={name:"test-expr",lower:"test-expr",index:33,isBkr:!1},this.rules[34]={name:"filter-query",lower:"filter-query",index:34,isBkr:!1},this.rules[35]={name:"rel-query",lower:"rel-query",index:35,isBkr:!1},this.rules[36]={name:"current-node-identifier",lower:"current-node-identifier",index:36,isBkr:!1},this.rules[37]={name:"comparison-expr",lower:"comparison-expr",index:37,isBkr:!1},this.rules[38]={name:"literal",lower:"literal",index:38,isBkr:!1},this.rules[39]={name:"comparable",lower:"comparable",index:39,isBkr:!1},this.rules[40]={name:"comparison-op",lower:"comparison-op",index:40,isBkr:!1},this.rules[41]={name:"singular-query",lower:"singular-query",index:41,isBkr:!1},this.rules[42]={name:"rel-singular-query",lower:"rel-singular-query",index:42,isBkr:!1},this.rules[43]={name:"abs-singular-query",lower:"abs-singular-query",index:43,isBkr:!1},this.rules[44]={name:"singular-query-segments",lower:"singular-query-segments",index:44,isBkr:!1},this.rules[45]={name:"name-segment",lower:"name-segment",index:45,isBkr:!1},this.rules[46]={name:"index-segment",lower:"index-segment",index:46,isBkr:!1},this.rules[47]={name:"number",lower:"number",index:47,isBkr:!1},this.rules[48]={name:"frac",lower:"frac",index:48,isBkr:!1},this.rules[49]={name:"exp",lower:"exp",index:49,isBkr:!1},this.rules[50]={name:"true",lower:"true",index:50,isBkr:!1},this.rules[51]={name:"false",lower:"false",index:51,isBkr:!1},this.rules[52]={name:"null",lower:"null",index:52,isBkr:!1},this.rules[53]={name:"function-name",lower:"function-name",index:53,isBkr:!1},this.rules[54]={name:"function-name-first",lower:"function-name-first",index:54,isBkr:!1},this.rules[55]={name:"function-name-char",lower:"function-name-char",index:55,isBkr:!1},this.rules[56]={name:"LCALPHA",lower:"lcalpha",index:56,isBkr:!1},this.rules[57]={name:"function-expr",lower:"function-expr",index:57,isBkr:!1},this.rules[58]={name:"function-argument",lower:"function-argument",index:58,isBkr:!1},this.rules[59]={name:"segment",lower:"segment",index:59,isBkr:!1},this.rules[60]={name:"child-segment",lower:"child-segment",index:60,isBkr:!1},this.rules[61]={name:"bracketed-selection",lower:"bracketed-selection",index:61,isBkr:!1},this.rules[62]={name:"member-name-shorthand",lower:"member-name-shorthand",index:62,isBkr:!1},this.rules[63]={name:"name-first",lower:"name-first",index:63,isBkr:!1},this.rules[64]={name:"name-char",lower:"name-char",index:64,isBkr:!1},this.rules[65]={name:"DIGIT",lower:"digit",index:65,isBkr:!1},this.rules[66]={name:"ALPHA",lower:"alpha",index:66,isBkr:!1},this.rules[67]={name:"descendant-segment",lower:"descendant-segment",index:67,isBkr:!1},this.rules[68]={name:"normalized-path",lower:"normalized-path",index:68,isBkr:!1},this.rules[69]={name:"normal-index-segment",lower:"normal-index-segment",index:69,isBkr:!1},this.rules[70]={name:"normal-selector",lower:"normal-selector",index:70,isBkr:!1},this.rules[71]={name:"normal-name-selector",lower:"normal-name-selector",index:71,isBkr:!1},this.rules[72]={name:"normal-single-quoted",lower:"normal-single-quoted",index:72,isBkr:!1},this.rules[73]={name:"normal-unescaped",lower:"normal-unescaped",index:73,isBkr:!1},this.rules[74]={name:"normal-escapable",lower:"normal-escapable",index:74,isBkr:!1},this.rules[75]={name:"normal-hexchar",lower:"normal-hexchar",index:75,isBkr:!1},this.rules[76]={name:"normal-HEXDIG",lower:"normal-hexdig",index:76,isBkr:!1},this.rules[77]={name:"normal-index-selector",lower:"normal-index-selector",index:77,isBkr:!1},this.rules[78]={name:"dot-prefix",lower:"dot-prefix",index:78,isBkr:!1},this.rules[79]={name:"double-dot-prefix",lower:"double-dot-prefix",index:79,isBkr:!1},this.rules[80]={name:"left-bracket",lower:"left-bracket",index:80,isBkr:!1},this.rules[81]={name:"right-bracket",lower:"right-bracket",index:81,isBkr:!1},this.rules[82]={name:"left-paren",lower:"left-paren",index:82,isBkr:!1},this.rules[83]={name:"right-paren",lower:"right-paren",index:83,isBkr:!1},this.rules[84]={name:"comma",lower:"comma",index:84,isBkr:!1},this.rules[85]={name:"colon",lower:"colon",index:85,isBkr:!1},this.rules[86]={name:"dquote",lower:"dquote",index:86,isBkr:!1},this.rules[87]={name:"squote",lower:"squote",index:87,isBkr:!1},this.rules[88]={name:"questionmark",lower:"questionmark",index:88,isBkr:!1},this.rules[89]={name:"disjunction",lower:"disjunction",index:89,isBkr:!1},this.rules[90]={name:"conjunction",lower:"conjunction",index:90,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,2]},this.rules[0].opcodes[1]={type:4,index:4},this.rules[0].opcodes[2]={type:4,index:1},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:3,min:0,max:1/0},this.rules[1].opcodes[1]={type:2,children:[2,3]},this.rules[1].opcodes[2]={type:4,index:3},this.rules[1].opcodes[3]={type:4,index:59},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:6,string:[32]},this.rules[2].opcodes[2]={type:6,string:[9]},this.rules[2].opcodes[3]={type:6,string:[10]},this.rules[2].opcodes[4]={type:6,string:[13]},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:0,max:1/0},this.rules[3].opcodes[1]={type:4,index:2},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:7,string:[36]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[5].opcodes[1]={type:4,index:6},this.rules[5].opcodes[2]={type:4,index:18},this.rules[5].opcodes[3]={type:4,index:22},this.rules[5].opcodes[4]={type:4,index:19},this.rules[5].opcodes[5]={type:4,index:26},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:4,index:7},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,6]},this.rules[7].opcodes[1]={type:2,children:[2,3,5]},this.rules[7].opcodes[2]={type:4,index:86},this.rules[7].opcodes[3]={type:3,min:0,max:1/0},this.rules[7].opcodes[4]={type:4,index:8},this.rules[7].opcodes[5]={type:4,index:86},this.rules[7].opcodes[6]={type:2,children:[7,8,10]},this.rules[7].opcodes[7]={type:4,index:87},this.rules[7].opcodes[8]={type:3,min:0,max:1/0},this.rules[7].opcodes[9]={type:4,index:9},this.rules[7].opcodes[10]={type:4,index:87},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:1,children:[1,2,3,6]},this.rules[8].opcodes[1]={type:4,index:11},this.rules[8].opcodes[2]={type:6,string:[39]},this.rules[8].opcodes[3]={type:2,children:[4,5]},this.rules[8].opcodes[4]={type:4,index:10},this.rules[8].opcodes[5]={type:6,string:[34]},this.rules[8].opcodes[6]={type:2,children:[7,8]},this.rules[8].opcodes[7]={type:4,index:10},this.rules[8].opcodes[8]={type:4,index:12},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2,3,6]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:6,string:[34]},this.rules[9].opcodes[3]={type:2,children:[4,5]},this.rules[9].opcodes[4]={type:4,index:10},this.rules[9].opcodes[5]={type:6,string:[39]},this.rules[9].opcodes[6]={type:2,children:[7,8]},this.rules[9].opcodes[7]={type:4,index:10},this.rules[9].opcodes[8]={type:4,index:12},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[92]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[11].opcodes[1]={type:5,min:32,max:33},this.rules[11].opcodes[2]={type:5,min:35,max:38},this.rules[11].opcodes[3]={type:5,min:40,max:91},this.rules[11].opcodes[4]={type:5,min:93,max:55295},this.rules[11].opcodes[5]={type:5,min:57344,max:1114111},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8]},this.rules[12].opcodes[1]={type:6,string:[98]},this.rules[12].opcodes[2]={type:6,string:[102]},this.rules[12].opcodes[3]={type:6,string:[110]},this.rules[12].opcodes[4]={type:6,string:[114]},this.rules[12].opcodes[5]={type:6,string:[116]},this.rules[12].opcodes[6]={type:7,string:[47]},this.rules[12].opcodes[7]={type:7,string:[92]},this.rules[12].opcodes[8]={type:2,children:[9,10]},this.rules[12].opcodes[9]={type:6,string:[117]},this.rules[12].opcodes[10]={type:4,index:13},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:1,children:[1,2]},this.rules[13].opcodes[1]={type:4,index:14},this.rules[13].opcodes[2]={type:2,children:[3,4,5,6]},this.rules[13].opcodes[3]={type:4,index:15},this.rules[13].opcodes[4]={type:7,string:[92]},this.rules[13].opcodes[5]={type:6,string:[117]},this.rules[13].opcodes[6]={type:4,index:16},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:1,children:[1,11]},this.rules[14].opcodes[1]={type:2,children:[2,9]},this.rules[14].opcodes[2]={type:1,children:[3,4,5,6,7,8]},this.rules[14].opcodes[3]={type:4,index:65},this.rules[14].opcodes[4]={type:7,string:[97]},this.rules[14].opcodes[5]={type:7,string:[98]},this.rules[14].opcodes[6]={type:7,string:[99]},this.rules[14].opcodes[7]={type:7,string:[101]},this.rules[14].opcodes[8]={type:7,string:[102]},this.rules[14].opcodes[9]={type:3,min:3,max:3},this.rules[14].opcodes[10]={type:4,index:17},this.rules[14].opcodes[11]={type:2,children:[12,13,14]},this.rules[14].opcodes[12]={type:7,string:[100]},this.rules[14].opcodes[13]={type:5,min:48,max:55},this.rules[14].opcodes[14]={type:3,min:2,max:2},this.rules[14].opcodes[15]={type:4,index:17},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2,7]},this.rules[15].opcodes[1]={type:7,string:[100]},this.rules[15].opcodes[2]={type:1,children:[3,4,5,6]},this.rules[15].opcodes[3]={type:7,string:[56]},this.rules[15].opcodes[4]={type:7,string:[57]},this.rules[15].opcodes[5]={type:7,string:[97]},this.rules[15].opcodes[6]={type:7,string:[98]},this.rules[15].opcodes[7]={type:3,min:2,max:2},this.rules[15].opcodes[8]={type:4,index:17},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,2,7]},this.rules[16].opcodes[1]={type:7,string:[100]},this.rules[16].opcodes[2]={type:1,children:[3,4,5,6]},this.rules[16].opcodes[3]={type:7,string:[99]},this.rules[16].opcodes[4]={type:7,string:[100]},this.rules[16].opcodes[5]={type:7,string:[101]},this.rules[16].opcodes[6]={type:7,string:[102]},this.rules[16].opcodes[7]={type:3,min:2,max:2},this.rules[16].opcodes[8]={type:4,index:17},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,2,3,4,5,6,7]},this.rules[17].opcodes[1]={type:4,index:65},this.rules[17].opcodes[2]={type:7,string:[97]},this.rules[17].opcodes[3]={type:7,string:[98]},this.rules[17].opcodes[4]={type:7,string:[99]},this.rules[17].opcodes[5]={type:7,string:[100]},this.rules[17].opcodes[6]={type:7,string:[101]},this.rules[17].opcodes[7]={type:7,string:[102]},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:7,string:[42]},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:4,index:20},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:1,children:[1,2]},this.rules[20].opcodes[1]={type:7,string:[48]},this.rules[20].opcodes[2]={type:2,children:[3,5,6]},this.rules[20].opcodes[3]={type:3,min:0,max:1},this.rules[20].opcodes[4]={type:7,string:[45]},this.rules[20].opcodes[5]={type:4,index:21},this.rules[20].opcodes[6]={type:3,min:0,max:1/0},this.rules[20].opcodes[7]={type:4,index:65},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:5,min:49,max:57},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:2,children:[1,5,6,7,11]},this.rules[22].opcodes[1]={type:3,min:0,max:1},this.rules[22].opcodes[2]={type:2,children:[3,4]},this.rules[22].opcodes[3]={type:4,index:23},this.rules[22].opcodes[4]={type:4,index:3},this.rules[22].opcodes[5]={type:4,index:85},this.rules[22].opcodes[6]={type:4,index:3},this.rules[22].opcodes[7]={type:3,min:0,max:1},this.rules[22].opcodes[8]={type:2,children:[9,10]},this.rules[22].opcodes[9]={type:4,index:24},this.rules[22].opcodes[10]={type:4,index:3},this.rules[22].opcodes[11]={type:3,min:0,max:1},this.rules[22].opcodes[12]={type:2,children:[13,14]},this.rules[22].opcodes[13]={type:4,index:85},this.rules[22].opcodes[14]={type:3,min:0,max:1},this.rules[22].opcodes[15]={type:2,children:[16,17]},this.rules[22].opcodes[16]={type:4,index:3},this.rules[22].opcodes[17]={type:4,index:25},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:4,index:20},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:4,index:20},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:4,index:20},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:2,children:[1,2,3]},this.rules[26].opcodes[1]={type:4,index:88},this.rules[26].opcodes[2]={type:4,index:3},this.rules[26].opcodes[3]={type:4,index:27},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:4,index:28},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:29},this.rules[28].opcodes[2]={type:3,min:0,max:1/0},this.rules[28].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[28].opcodes[4]={type:4,index:3},this.rules[28].opcodes[5]={type:4,index:89},this.rules[28].opcodes[6]={type:4,index:3},this.rules[28].opcodes[7]={type:4,index:29},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:2,children:[1,2]},this.rules[29].opcodes[1]={type:4,index:30},this.rules[29].opcodes[2]={type:3,min:0,max:1/0},this.rules[29].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[29].opcodes[4]={type:4,index:3},this.rules[29].opcodes[5]={type:4,index:90},this.rules[29].opcodes[6]={type:4,index:3},this.rules[29].opcodes[7]={type:4,index:30},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:1,children:[1,2,3]},this.rules[30].opcodes[1]={type:4,index:31},this.rules[30].opcodes[2]={type:4,index:37},this.rules[30].opcodes[3]={type:4,index:33},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:2,children:[1,5,6,7,8,9]},this.rules[31].opcodes[1]={type:3,min:0,max:1},this.rules[31].opcodes[2]={type:2,children:[3,4]},this.rules[31].opcodes[3]={type:4,index:32},this.rules[31].opcodes[4]={type:4,index:3},this.rules[31].opcodes[5]={type:4,index:82},this.rules[31].opcodes[6]={type:4,index:3},this.rules[31].opcodes[7]={type:4,index:27},this.rules[31].opcodes[8]={type:4,index:3},this.rules[31].opcodes[9]={type:4,index:83},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:7,string:[33]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:2,children:[1,5]},this.rules[33].opcodes[1]={type:3,min:0,max:1},this.rules[33].opcodes[2]={type:2,children:[3,4]},this.rules[33].opcodes[3]={type:4,index:32},this.rules[33].opcodes[4]={type:4,index:3},this.rules[33].opcodes[5]={type:1,children:[6,7]},this.rules[33].opcodes[6]={type:4,index:34},this.rules[33].opcodes[7]={type:4,index:57},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:1,children:[1,2]},this.rules[34].opcodes[1]={type:4,index:35},this.rules[34].opcodes[2]={type:4,index:0},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:2,children:[1,2]},this.rules[35].opcodes[1]={type:4,index:36},this.rules[35].opcodes[2]={type:4,index:1},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:7,string:[64]},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:2,children:[1,2,3,4,5]},this.rules[37].opcodes[1]={type:4,index:39},this.rules[37].opcodes[2]={type:4,index:3},this.rules[37].opcodes[3]={type:4,index:40},this.rules[37].opcodes[4]={type:4,index:3},this.rules[37].opcodes[5]={type:4,index:39},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[38].opcodes[1]={type:4,index:47},this.rules[38].opcodes[2]={type:4,index:7},this.rules[38].opcodes[3]={type:4,index:50},this.rules[38].opcodes[4]={type:4,index:51},this.rules[38].opcodes[5]={type:4,index:52},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:1,children:[1,2,3]},this.rules[39].opcodes[1]={type:4,index:41},this.rules[39].opcodes[2]={type:4,index:57},this.rules[39].opcodes[3]={type:4,index:38},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2,3,4,5,6]},this.rules[40].opcodes[1]={type:7,string:[61,61]},this.rules[40].opcodes[2]={type:7,string:[33,61]},this.rules[40].opcodes[3]={type:7,string:[60,61]},this.rules[40].opcodes[4]={type:7,string:[62,61]},this.rules[40].opcodes[5]={type:7,string:[60]},this.rules[40].opcodes[6]={type:7,string:[62]},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:1,children:[1,2]},this.rules[41].opcodes[1]={type:4,index:42},this.rules[41].opcodes[2]={type:4,index:43},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:4,index:36},this.rules[42].opcodes[2]={type:4,index:44},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:2,children:[1,2]},this.rules[43].opcodes[1]={type:4,index:4},this.rules[43].opcodes[2]={type:4,index:44},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:3,min:0,max:1/0},this.rules[44].opcodes[1]={type:2,children:[2,3]},this.rules[44].opcodes[2]={type:4,index:3},this.rules[44].opcodes[3]={type:1,children:[4,5]},this.rules[44].opcodes[4]={type:4,index:45},this.rules[44].opcodes[5]={type:4,index:46},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:1,children:[1,5]},this.rules[45].opcodes[1]={type:2,children:[2,3,4]},this.rules[45].opcodes[2]={type:4,index:80},this.rules[45].opcodes[3]={type:4,index:6},this.rules[45].opcodes[4]={type:4,index:81},this.rules[45].opcodes[5]={type:2,children:[6,7]},this.rules[45].opcodes[6]={type:4,index:78},this.rules[45].opcodes[7]={type:4,index:62},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:2,children:[1,2,3]},this.rules[46].opcodes[1]={type:4,index:80},this.rules[46].opcodes[2]={type:4,index:19},this.rules[46].opcodes[3]={type:4,index:81},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:2,children:[1,4,6]},this.rules[47].opcodes[1]={type:1,children:[2,3]},this.rules[47].opcodes[2]={type:4,index:20},this.rules[47].opcodes[3]={type:7,string:[45,48]},this.rules[47].opcodes[4]={type:3,min:0,max:1},this.rules[47].opcodes[5]={type:4,index:48},this.rules[47].opcodes[6]={type:3,min:0,max:1},this.rules[47].opcodes[7]={type:4,index:49},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:2,children:[1,2]},this.rules[48].opcodes[1]={type:7,string:[46]},this.rules[48].opcodes[2]={type:3,min:1,max:1/0},this.rules[48].opcodes[3]={type:4,index:65},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:2,children:[1,2,6]},this.rules[49].opcodes[1]={type:7,string:[101]},this.rules[49].opcodes[2]={type:3,min:0,max:1},this.rules[49].opcodes[3]={type:1,children:[4,5]},this.rules[49].opcodes[4]={type:7,string:[45]},this.rules[49].opcodes[5]={type:7,string:[43]},this.rules[49].opcodes[6]={type:3,min:1,max:1/0},this.rules[49].opcodes[7]={type:4,index:65},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[116,114,117,101]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[102,97,108,115,101]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[110,117,108,108]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:4,index:54},this.rules[53].opcodes[2]={type:3,min:0,max:1/0},this.rules[53].opcodes[3]={type:4,index:55},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:4,index:56},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:1,children:[1,2,3]},this.rules[55].opcodes[1]={type:4,index:54},this.rules[55].opcodes[2]={type:7,string:[95]},this.rules[55].opcodes[3]={type:4,index:65},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:5,min:97,max:122},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:2,children:[1,2,3,4,13,14]},this.rules[57].opcodes[1]={type:4,index:53},this.rules[57].opcodes[2]={type:4,index:82},this.rules[57].opcodes[3]={type:4,index:3},this.rules[57].opcodes[4]={type:3,min:0,max:1},this.rules[57].opcodes[5]={type:2,children:[6,7]},this.rules[57].opcodes[6]={type:4,index:58},this.rules[57].opcodes[7]={type:3,min:0,max:1/0},this.rules[57].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[57].opcodes[9]={type:4,index:3},this.rules[57].opcodes[10]={type:4,index:84},this.rules[57].opcodes[11]={type:4,index:3},this.rules[57].opcodes[12]={type:4,index:58},this.rules[57].opcodes[13]={type:4,index:3},this.rules[57].opcodes[14]={type:4,index:83},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[58].opcodes[1]={type:4,index:27},this.rules[58].opcodes[2]={type:4,index:34},this.rules[58].opcodes[3]={type:4,index:57},this.rules[58].opcodes[4]={type:4,index:38},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:1,children:[1,2]},this.rules[59].opcodes[1]={type:4,index:60},this.rules[59].opcodes[2]={type:4,index:67},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:1,children:[1,2]},this.rules[60].opcodes[1]={type:4,index:61},this.rules[60].opcodes[2]={type:2,children:[3,4]},this.rules[60].opcodes[3]={type:4,index:78},this.rules[60].opcodes[4]={type:1,children:[5,6]},this.rules[60].opcodes[5]={type:4,index:18},this.rules[60].opcodes[6]={type:4,index:62},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3,4,10,11]},this.rules[61].opcodes[1]={type:4,index:80},this.rules[61].opcodes[2]={type:4,index:3},this.rules[61].opcodes[3]={type:4,index:5},this.rules[61].opcodes[4]={type:3,min:0,max:1/0},this.rules[61].opcodes[5]={type:2,children:[6,7,8,9]},this.rules[61].opcodes[6]={type:4,index:3},this.rules[61].opcodes[7]={type:4,index:84},this.rules[61].opcodes[8]={type:4,index:3},this.rules[61].opcodes[9]={type:4,index:5},this.rules[61].opcodes[10]={type:4,index:3},this.rules[61].opcodes[11]={type:4,index:81},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:2,children:[1,2]},this.rules[62].opcodes[1]={type:4,index:63},this.rules[62].opcodes[2]={type:3,min:0,max:1/0},this.rules[62].opcodes[3]={type:4,index:64},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[63].opcodes[1]={type:4,index:66},this.rules[63].opcodes[2]={type:7,string:[95]},this.rules[63].opcodes[3]={type:5,min:128,max:55295},this.rules[63].opcodes[4]={type:5,min:57344,max:1114111},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:1,children:[1,2]},this.rules[64].opcodes[1]={type:4,index:63},this.rules[64].opcodes[2]={type:4,index:65},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:5,min:48,max:57},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:1,children:[1,2]},this.rules[66].opcodes[1]={type:5,min:65,max:90},this.rules[66].opcodes[2]={type:5,min:97,max:122},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:2,children:[1,2]},this.rules[67].opcodes[1]={type:4,index:79},this.rules[67].opcodes[2]={type:1,children:[3,4,5]},this.rules[67].opcodes[3]={type:4,index:61},this.rules[67].opcodes[4]={type:4,index:18},this.rules[67].opcodes[5]={type:4,index:62},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:2,children:[1,2]},this.rules[68].opcodes[1]={type:4,index:4},this.rules[68].opcodes[2]={type:3,min:0,max:1/0},this.rules[68].opcodes[3]={type:4,index:69},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:2,children:[1,2,3]},this.rules[69].opcodes[1]={type:4,index:80},this.rules[69].opcodes[2]={type:4,index:70},this.rules[69].opcodes[3]={type:4,index:81},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:1,children:[1,2]},this.rules[70].opcodes[1]={type:4,index:71},this.rules[70].opcodes[2]={type:4,index:77},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:2,children:[1,2,4]},this.rules[71].opcodes[1]={type:4,index:87},this.rules[71].opcodes[2]={type:3,min:0,max:1/0},this.rules[71].opcodes[3]={type:4,index:72},this.rules[71].opcodes[4]={type:4,index:87},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:1,children:[1,2]},this.rules[72].opcodes[1]={type:4,index:73},this.rules[72].opcodes[2]={type:2,children:[3,4]},this.rules[72].opcodes[3]={type:4,index:10},this.rules[72].opcodes[4]={type:4,index:74},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[73].opcodes[1]={type:5,min:32,max:38},this.rules[73].opcodes[2]={type:5,min:40,max:91},this.rules[73].opcodes[3]={type:5,min:93,max:55295},this.rules[73].opcodes[4]={type:5,min:57344,max:1114111},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8]},this.rules[74].opcodes[1]={type:6,string:[98]},this.rules[74].opcodes[2]={type:6,string:[102]},this.rules[74].opcodes[3]={type:6,string:[110]},this.rules[74].opcodes[4]={type:6,string:[114]},this.rules[74].opcodes[5]={type:6,string:[116]},this.rules[74].opcodes[6]={type:7,string:[39]},this.rules[74].opcodes[7]={type:7,string:[92]},this.rules[74].opcodes[8]={type:2,children:[9,10]},this.rules[74].opcodes[9]={type:6,string:[117]},this.rules[74].opcodes[10]={type:4,index:75},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:2,children:[1,2,3]},this.rules[75].opcodes[1]={type:7,string:[48]},this.rules[75].opcodes[2]={type:7,string:[48]},this.rules[75].opcodes[3]={type:1,children:[4,7,10,13]},this.rules[75].opcodes[4]={type:2,children:[5,6]},this.rules[75].opcodes[5]={type:7,string:[48]},this.rules[75].opcodes[6]={type:5,min:48,max:55},this.rules[75].opcodes[7]={type:2,children:[8,9]},this.rules[75].opcodes[8]={type:7,string:[48]},this.rules[75].opcodes[9]={type:6,string:[98]},this.rules[75].opcodes[10]={type:2,children:[11,12]},this.rules[75].opcodes[11]={type:7,string:[48]},this.rules[75].opcodes[12]={type:5,min:101,max:102},this.rules[75].opcodes[13]={type:2,children:[14,15]},this.rules[75].opcodes[14]={type:7,string:[49]},this.rules[75].opcodes[15]={type:4,index:76},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:4,index:65},this.rules[76].opcodes[2]={type:5,min:97,max:102},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:7,string:[48]},this.rules[77].opcodes[2]={type:2,children:[3,4]},this.rules[77].opcodes[3]={type:4,index:21},this.rules[77].opcodes[4]={type:3,min:0,max:1/0},this.rules[77].opcodes[5]={type:4,index:65},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:7,string:[46]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:7,string:[46,46]},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:7,string:[91]},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:7,string:[93]},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:7,string:[40]},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:7,string:[41]},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:7,string:[44]},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:7,string:[58]},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:6,string:[34]},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:6,string:[39]},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:7,string:[63]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:7,string:[124,124]},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:7,string:[38,38]},this.toString=function(){let e="";return e+="; JSONPath: Query Expressions for JSON\n",e+="; https://www.rfc-editor.org/rfc/rfc9535\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.1.1\n",e+="jsonpath-query = root-identifier segments\n",e+="segments = *(S segment)\n",e+="\n",e+="B = %x20 / ; Space\n",e+=" %x09 / ; Horizontal tab\n",e+=" %x0A / ; Line feed or New line\n",e+=" %x0D ; Carriage return\n",e+="S = *B ; optional blank space\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.2.1\n",e+='root-identifier = "$"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3\n",e+="selector = name-selector /\n",e+=" wildcard-selector /\n",e+=" slice-selector /\n",e+=" index-selector /\n",e+=" filter-selector\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.1.1\n",e+="name-selector = string-literal\n",e+="\n",e+='string-literal = dquote *double-quoted dquote / ; "string", MODIFICATION: surrogate text rule used\n',e+=" squote *single-quoted squote ; 'string', MODIFICATION: surrogate text rule used\n",e+="\n",e+="double-quoted = unescaped /\n",e+=" %x27 / ; '\n",e+=' ESC %x22 / ; \\"\n',e+=" ESC escapable\n",e+="\n",e+="single-quoted = unescaped /\n",e+=' %x22 / ; "\n',e+=" ESC %x27 / ; \\'\n",e+=" ESC escapable\n",e+="\n",e+="ESC = %x5C ; \\ backslash\n",e+="\n",e+="unescaped = %x20-21 / ; see RFC 8259\n",e+=' ; omit 0x22 "\n',e+=" %x23-26 /\n",e+=" ; omit 0x27 '\n",e+=" %x28-5B /\n",e+=" ; omit 0x5C \\\n",e+=" %x5D-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="\n",e+="escapable = %x62 / ; b BS backspace U+0008\n",e+=" %x66 / ; f FF form feed U+000C\n",e+=" %x6E / ; n LF line feed U+000A\n",e+=" %x72 / ; r CR carriage return U+000D\n",e+=" %x74 / ; t HT horizontal tab U+0009\n",e+=' "/" / ; / slash (solidus) U+002F\n',e+=' "\\" / ; \\ backslash (reverse solidus) U+005C\n',e+=" (%x75 hexchar) ; uXXXX U+XXXX\n",e+="\n",e+="hexchar = non-surrogate /\n",e+=' (high-surrogate "\\" %x75 low-surrogate)\n',e+='non-surrogate = ((DIGIT / "A"/"B"/"C" / "E"/"F") 3HEXDIG) /\n',e+=' ("D" %x30-37 2HEXDIG )\n',e+='high-surrogate = "D" ("8"/"9"/"A"/"B") 2HEXDIG\n',e+='low-surrogate = "D" ("C"/"D"/"E"/"F") 2HEXDIG\n',e+="\n",e+='HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.2.1\n",e+='wildcard-selector = "*"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.3.1\n",e+="index-selector = int ; decimal integer\n",e+="\n",e+='int = "0" /\n',e+=' (["-"] DIGIT1 *DIGIT) ; - optional\n',e+="DIGIT1 = %x31-39 ; 1-9 non-zero digit\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.4.1\n",e+="slice-selector = [start S] colon S [end S] [colon [S step ]] ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="start = int ; included in selection\n",e+="end = int ; not included in selection\n",e+="step = int ; default: 1\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.5.1\n",e+="filter-selector = questionmark S logical-expr ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="logical-expr = logical-or-expr\n",e+="logical-or-expr = logical-and-expr *(S disjunction S logical-and-expr) ; MODIFICATION: surrogate text rule used\n",e+=" ; disjunction\n",e+=" ; binds less tightly than conjunction\n",e+="logical-and-expr = basic-expr *(S conjunction S basic-expr) ; MODIFICATION: surrogate text rule used\n",e+=" ; conjunction\n",e+=" ; binds more tightly than disjunction\n",e+="\n",e+="basic-expr = paren-expr /\n",e+=" comparison-expr /\n",e+=" test-expr\n",e+="\n",e+="paren-expr = [logical-not-op S] left-paren S logical-expr S right-paren ; MODIFICATION: surrogate text rule used\n",e+=" ; parenthesized expression\n",e+='logical-not-op = "!" ; logical NOT operator\n',e+="\n",e+="test-expr = [logical-not-op S]\n",e+=" (filter-query / ; existence/non-existence\n",e+=" function-expr) ; LogicalType or NodesType\n",e+="filter-query = rel-query / jsonpath-query\n",e+="rel-query = current-node-identifier segments\n",e+='current-node-identifier = "@"\n',e+="\n",e+="comparison-expr = comparable S comparison-op S comparable\n",e+="literal = number / string-literal /\n",e+=" true / false / null\n",e+="comparable = singular-query / ; singular query value\n",e+=" function-expr / ; ValueType\n",e+=" literal\n",e+=" ; MODIFICATION: https://www.rfc-editor.org/errata/eid8352\n",e+='comparison-op = "==" / "!=" /\n',e+=' "<=" / ">=" /\n',e+=' "<" / ">"\n',e+="\n",e+="singular-query = rel-singular-query / abs-singular-query\n",e+="rel-singular-query = current-node-identifier singular-query-segments\n",e+="abs-singular-query = root-identifier singular-query-segments\n",e+="singular-query-segments = *(S (name-segment / index-segment))\n",e+="name-segment = (left-bracket name-selector right-bracket) / ; MODIFICATION: surrogate text rule used\n",e+=" (dot-prefix member-name-shorthand) ; MODIFICATION: surrogate text rule used\n",e+="index-segment = left-bracket index-selector right-bracket ; MODIFICATION: surrogate text rule used\n",e+="\n",e+='number = (int / "-0") [ frac ] [ exp ] ; decimal number\n',e+='frac = "." 1*DIGIT ; decimal fraction\n',e+='exp = "e" [ "-" / "+" ] 1*DIGIT ; decimal exponent\n',e+="true = %x74.72.75.65 ; true\n",e+="false = %x66.61.6c.73.65 ; false\n",e+="null = %x6e.75.6c.6c ; null\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.4\n",e+="function-name = function-name-first *function-name-char\n",e+="function-name-first = LCALPHA\n",e+='function-name-char = function-name-first / "_" / DIGIT\n',e+='LCALPHA = %x61-7A ; "a".."z"\n',e+="\n",e+="function-expr = function-name left-paren S [function-argument ; MODIFICATION: surrogate text rule used\n",e+=" *(S comma S function-argument)] S right-paren ; MODIFICATION: surrogate text rule used\n",e+="function-argument = logical-expr / ; MODIFICATION: https://www.rfc-editor.org/errata/eid8343\n",e+=" filter-query / ; (includes singular-query)\n",e+=" function-expr /\n",e+=" literal\n",e+="\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5\n",e+="segment = child-segment / descendant-segment\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.1.1\n",e+="child-segment = bracketed-selection /\n",e+=" (dot-prefix ; MODIFICATION: surrogate text rule used\n",e+=" (wildcard-selector /\n",e+=" member-name-shorthand))\n",e+="\n",e+="bracketed-selection = left-bracket S selector *(S comma S selector) S right-bracket\n",e+=" ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="member-name-shorthand = name-first *name-char\n",e+="name-first = ALPHA /\n",e+=' "_" /\n',e+=" %x80-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="name-char = name-first / DIGIT\n",e+="\n",e+="DIGIT = %x30-39 ; 0-9\n",e+="ALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.2.1\n",e+="descendant-segment = double-dot-prefix (bracketed-selection / ; MODIFICATION: surrogate text rule used\n",e+=" wildcard-selector /\n",e+=" member-name-shorthand)\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#name-normalized-paths\n",e+="normalized-path = root-identifier *(normal-index-segment)\n",e+="normal-index-segment = left-bracket normal-selector right-bracket ; MODIFICATION: surrogate text rule used\n",e+="normal-selector = normal-name-selector / normal-index-selector\n",e+="normal-name-selector = squote *normal-single-quoted squote ; 'string', MODIFICATION: surrogate text rule used\n",e+="normal-single-quoted = normal-unescaped /\n",e+=" ESC normal-escapable\n",e+="normal-unescaped = ; omit %x0-1F control codes\n",e+=" %x20-26 /\n",e+=" ; omit 0x27 '\n",e+=" %x28-5B /\n",e+=" ; omit 0x5C \\\n",e+=" %x5D-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="\n",e+="normal-escapable = %x62 / ; b BS backspace U+0008\n",e+=" %x66 / ; f FF form feed U+000C\n",e+=" %x6E / ; n LF line feed U+000A\n",e+=" %x72 / ; r CR carriage return U+000D\n",e+=" %x74 / ; t HT horizontal tab U+0009\n",e+=" \"'\" / ; ' apostrophe U+0027\n",e+=' "\\" / ; \\ backslash (reverse solidus) U+005C\n',e+=" (%x75 normal-hexchar)\n",e+=" ; certain values u00xx U+00XX\n",e+='normal-hexchar = "0" "0"\n',e+=" (\n",e+=' ("0" %x30-37) / ; "00"-"07"\n',e+=" ; omit U+0008-U+000A BS HT LF\n",e+=' ("0" %x62) / ; "0b"\n',e+=" ; omit U+000C-U+000D FF CR\n",e+=' ("0" %x65-66) / ; "0e"-"0f"\n',e+=' ("1" normal-HEXDIG)\n',e+=" )\n",e+='normal-HEXDIG = DIGIT / %x61-66 ; "0"-"9", "a"-"f"\n',e+='normal-index-selector = "0" / (DIGIT1 *DIGIT)\n',e+=" ; non-negative decimal integer\n",e+="\n",e+="; Surrogate named rules\n",e+='dot-prefix = "."\n',e+='double-dot-prefix = ".."\n',e+='left-bracket = "["\n',e+='right-bracket = "]"\n',e+='left-paren = "("\n',e+='right-paren = ")"\n',e+='comma = ","\n',e+='colon = ":"\n',e+='dquote = %x22 ; "\n',e+="squote = %x27 ; '\n",e+='questionmark = "?"\n',e+='disjunction = "||"\n',e+='conjunction = "&&"\n','; JSONPath: Query Expressions for JSON\n; https://www.rfc-editor.org/rfc/rfc9535\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.1.1\njsonpath-query = root-identifier segments\nsegments = *(S segment)\n\nB = %x20 / ; Space\n %x09 / ; Horizontal tab\n %x0A / ; Line feed or New line\n %x0D ; Carriage return\nS = *B ; optional blank space\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.2.1\nroot-identifier = "$"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3\nselector = name-selector /\n wildcard-selector /\n slice-selector /\n index-selector /\n filter-selector\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.1.1\nname-selector = string-literal\n\nstring-literal = dquote *double-quoted dquote / ; "string", MODIFICATION: surrogate text rule used\n squote *single-quoted squote ; \'string\', MODIFICATION: surrogate text rule used\n\ndouble-quoted = unescaped /\n %x27 / ; \'\n ESC %x22 / ; \\"\n ESC escapable\n\nsingle-quoted = unescaped /\n %x22 / ; "\n ESC %x27 / ; \\\'\n ESC escapable\n\nESC = %x5C ; \\ backslash\n\nunescaped = %x20-21 / ; see RFC 8259\n ; omit 0x22 "\n %x23-26 /\n ; omit 0x27 \'\n %x28-5B /\n ; omit 0x5C \\\n %x5D-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\n\nescapable = %x62 / ; b BS backspace U+0008\n %x66 / ; f FF form feed U+000C\n %x6E / ; n LF line feed U+000A\n %x72 / ; r CR carriage return U+000D\n %x74 / ; t HT horizontal tab U+0009\n "/" / ; / slash (solidus) U+002F\n "\\" / ; \\ backslash (reverse solidus) U+005C\n (%x75 hexchar) ; uXXXX U+XXXX\n\nhexchar = non-surrogate /\n (high-surrogate "\\" %x75 low-surrogate)\nnon-surrogate = ((DIGIT / "A"/"B"/"C" / "E"/"F") 3HEXDIG) /\n ("D" %x30-37 2HEXDIG )\nhigh-surrogate = "D" ("8"/"9"/"A"/"B") 2HEXDIG\nlow-surrogate = "D" ("C"/"D"/"E"/"F") 2HEXDIG\n\nHEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.2.1\nwildcard-selector = "*"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.3.1\nindex-selector = int ; decimal integer\n\nint = "0" /\n (["-"] DIGIT1 *DIGIT) ; - optional\nDIGIT1 = %x31-39 ; 1-9 non-zero digit\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.4.1\nslice-selector = [start S] colon S [end S] [colon [S step ]] ; MODIFICATION: surrogate text rule used\n\nstart = int ; included in selection\nend = int ; not included in selection\nstep = int ; default: 1\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.5.1\nfilter-selector = questionmark S logical-expr ; MODIFICATION: surrogate text rule used\n\nlogical-expr = logical-or-expr\nlogical-or-expr = logical-and-expr *(S disjunction S logical-and-expr) ; MODIFICATION: surrogate text rule used\n ; disjunction\n ; binds less tightly than conjunction\nlogical-and-expr = basic-expr *(S conjunction S basic-expr) ; MODIFICATION: surrogate text rule used\n ; conjunction\n ; binds more tightly than disjunction\n\nbasic-expr = paren-expr /\n comparison-expr /\n test-expr\n\nparen-expr = [logical-not-op S] left-paren S logical-expr S right-paren ; MODIFICATION: surrogate text rule used\n ; parenthesized expression\nlogical-not-op = "!" ; logical NOT operator\n\ntest-expr = [logical-not-op S]\n (filter-query / ; existence/non-existence\n function-expr) ; LogicalType or NodesType\nfilter-query = rel-query / jsonpath-query\nrel-query = current-node-identifier segments\ncurrent-node-identifier = "@"\n\ncomparison-expr = comparable S comparison-op S comparable\nliteral = number / string-literal /\n true / false / null\ncomparable = singular-query / ; singular query value\n function-expr / ; ValueType\n literal\n ; MODIFICATION: https://www.rfc-editor.org/errata/eid8352\ncomparison-op = "==" / "!=" /\n "<=" / ">=" /\n "<" / ">"\n\nsingular-query = rel-singular-query / abs-singular-query\nrel-singular-query = current-node-identifier singular-query-segments\nabs-singular-query = root-identifier singular-query-segments\nsingular-query-segments = *(S (name-segment / index-segment))\nname-segment = (left-bracket name-selector right-bracket) / ; MODIFICATION: surrogate text rule used\n (dot-prefix member-name-shorthand) ; MODIFICATION: surrogate text rule used\nindex-segment = left-bracket index-selector right-bracket ; MODIFICATION: surrogate text rule used\n\nnumber = (int / "-0") [ frac ] [ exp ] ; decimal number\nfrac = "." 1*DIGIT ; decimal fraction\nexp = "e" [ "-" / "+" ] 1*DIGIT ; decimal exponent\ntrue = %x74.72.75.65 ; true\nfalse = %x66.61.6c.73.65 ; false\nnull = %x6e.75.6c.6c ; null\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.4\nfunction-name = function-name-first *function-name-char\nfunction-name-first = LCALPHA\nfunction-name-char = function-name-first / "_" / DIGIT\nLCALPHA = %x61-7A ; "a".."z"\n\nfunction-expr = function-name left-paren S [function-argument ; MODIFICATION: surrogate text rule used\n *(S comma S function-argument)] S right-paren ; MODIFICATION: surrogate text rule used\nfunction-argument = logical-expr / ; MODIFICATION: https://www.rfc-editor.org/errata/eid8343\n filter-query / ; (includes singular-query)\n function-expr /\n literal\n\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5\nsegment = child-segment / descendant-segment\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.1.1\nchild-segment = bracketed-selection /\n (dot-prefix ; MODIFICATION: surrogate text rule used\n (wildcard-selector /\n member-name-shorthand))\n\nbracketed-selection = left-bracket S selector *(S comma S selector) S right-bracket\n ; MODIFICATION: surrogate text rule used\n\nmember-name-shorthand = name-first *name-char\nname-first = ALPHA /\n "_" /\n %x80-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\nname-char = name-first / DIGIT\n\nDIGIT = %x30-39 ; 0-9\nALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.2.1\ndescendant-segment = double-dot-prefix (bracketed-selection / ; MODIFICATION: surrogate text rule used\n wildcard-selector /\n member-name-shorthand)\n\n; https://www.rfc-editor.org/rfc/rfc9535#name-normalized-paths\nnormalized-path = root-identifier *(normal-index-segment)\nnormal-index-segment = left-bracket normal-selector right-bracket ; MODIFICATION: surrogate text rule used\nnormal-selector = normal-name-selector / normal-index-selector\nnormal-name-selector = squote *normal-single-quoted squote ; \'string\', MODIFICATION: surrogate text rule used\nnormal-single-quoted = normal-unescaped /\n ESC normal-escapable\nnormal-unescaped = ; omit %x0-1F control codes\n %x20-26 /\n ; omit 0x27 \'\n %x28-5B /\n ; omit 0x5C \\\n %x5D-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\n\nnormal-escapable = %x62 / ; b BS backspace U+0008\n %x66 / ; f FF form feed U+000C\n %x6E / ; n LF line feed U+000A\n %x72 / ; r CR carriage return U+000D\n %x74 / ; t HT horizontal tab U+0009\n "\'" / ; \' apostrophe U+0027\n "\\" / ; \\ backslash (reverse solidus) U+005C\n (%x75 normal-hexchar)\n ; certain values u00xx U+00XX\nnormal-hexchar = "0" "0"\n (\n ("0" %x30-37) / ; "00"-"07"\n ; omit U+0008-U+000A BS HT LF\n ("0" %x62) / ; "0b"\n ; omit U+000C-U+000D FF CR\n ("0" %x65-66) / ; "0e"-"0f"\n ("1" normal-HEXDIG)\n )\nnormal-HEXDIG = DIGIT / %x61-66 ; "0"-"9", "a"-"f"\nnormal-index-selector = "0" / (DIGIT1 *DIGIT)\n ; non-negative decimal integer\n\n; Surrogate named rules\ndot-prefix = "."\ndouble-dot-prefix = ".."\nleft-bracket = "["\nright-bracket = "]"\nleft-paren = "("\nright-paren = ")"\ncomma = ","\ncolon = ":"\ndquote = %x22 ; "\nsquote = %x27 ; \'\nquestionmark = "?"\ndisjunction = "||"\nconjunction = "&&"\n'}};const re=class extends ne{},se=e=>{if(!Array.isArray(e))throw new re("Selectors must be an array, got: "+typeof e,{selectors:e});try{return`$${e.map(e=>{if("string"==typeof e)return`['${(e=>{if("string"!=typeof e)throw new TypeError("Selector must be a string");let t="";for(const n of e){const e=n.codePointAt(0);switch(e){case 8:t+="\\b";break;case 9:t+="\\t";break;case 10:t+="\\n";break;case 12:t+="\\f";break;case 13:t+="\\r";break;case 39:t+="\\'";break;case 92:t+="\\\\";break;default:t+=e<=31?`\\u${e.toString(16).padStart(4,"0")}`:n}}return t})(e)}']`;if("number"==typeof e){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Index selector must be a non-negative safe integer, got: ${e}`);return`[${e}]`}throw new TypeError("Selector must be a string or non-negative integer, got: "+typeof e)}).join("")}`}catch(t){throw new re("Failed to compile normalized JSONPath",{cause:t,selectors:e})}},ie=(e,t,n,r)=>{const{realm:s}=e,{value:i}=n;if(s.isObject(t)&&s.hasProperty(t,i)){r(s.getProperty(t,i),i)}},oe=(e,t,n,r)=>{const{realm:s}=e,{value:i}=n;if(!s.isArray(t))return;const o=s.getLength(t),a=((e,t)=>e>=0?e:t+e)(i,o);if(a>=0&&a<o){r(s.getElement(t,a),a)}},ae=(e,t,n,r)=>{const{realm:s}=e;for(const[e,n]of s.entries(t))r(n,e)},ce=(e,t)=>e>=0?Math.min(e,t):Math.max(t+e,0),le=(e,t,n,r)=>{const{realm:s}=e,{start:i,end:o,step:a}=n;if(!s.isArray(t))return;const c=((e,t,n,r)=>{const s=n??1;if(0===s)return null;let i,o;if(s>0){const n=0,s=r,a=null!==e?ce(e,r):n,c=null!==t?ce(t,r):s;i=Math.max(a,0),o=Math.min(c,r)}else{const n=r-1,s=-r-1,a=null!==e?e>=0?Math.min(e,r-1):Math.max(r+e,-1):n,c=null!==t?t>=0?Math.min(t,r-1):Math.max(r+t,-1):s;o=Math.min(a,r-1),i=Math.max(c,-1)}return{lower:i,upper:o,step:s}})(i,o,a,s.getLength(t));if(null===c)return;const{lower:l,upper:u,step:h}=c;if(h>0)for(let e=l;e<u;e+=h){r(s.getElement(t,e),e)}else for(let e=u;e>l;e+=h){r(s.getElement(t,e),e)}},ue=(e,t,n,r)=>r.value,he=(e,t,n)=>{const{realm:r}=e,{selector:s}=n;switch(s.type){case"NameSelector":{const{value:e}=s;return r.isObject(t)&&r.hasProperty(t,e)?r.getProperty(t,e):void 0}case"IndexSelector":{const{value:e}=s;if(!r.isArray(t))return;const n=r.getLength(t),i=e>=0?e:n+e;return i>=0&&i<n?r.getElement(t,i):void 0}default:return}},pe=(e,t,n,r)=>{const{selectors:s}=n;for(const n of s)Oe(e,t,n,r)},de=(e,t,n)=>{const r=[],s=e=>{r.push(e)},{selector:i}=n;switch(i.type){case"BracketedSelection":pe(e,t,i,s);break;case"NameSelector":case"WildcardSelector":case"IndexSelector":case"SliceSelector":case"FilterSelector":Oe(e,t,i,s)}return r},fe=(e,t,n,r)=>{let s=n;for(const t of r){const n=[];if("DescendantSegment"===t.type){const r=s=>{const{realm:i}=e,o=de(e,s,t);n.push(...o);for(const[,e]of i.entries(s))r(e)};for(const e of s)r(e)}else for(const r of s){const s=de(e,r,t);n.push(...s)}s=n}return s},me=(e,t,n,r)=>{const{query:s}=r;let i;switch(s.type){case"RelQuery":i=((e,t,n,r)=>{const{segments:s}=r;return 0===s.length?[n]:fe(e,0,[n],s)})(e,0,n,s);break;case"JsonPathQuery":i=((e,t,n,r)=>{const{segments:s}=r;return 0===s.length?[t]:fe(e,0,[t],s)})(e,t,0,s);break;default:i=[]}return o=i,Object.defineProperty(o,"_isNodelist",{value:!0,enumerable:!1,writable:!1}),o;var o};let ye;const ge=(e,t,n,r)=>{const{name:s,arguments:i}=r,o=e.functions[s];if("function"!=typeof o)return;const a=i.map(r=>((e,t,n,r)=>{switch(r.type){case"Literal":case"RelSingularQuery":case"AbsSingularQuery":case"FunctionExpr":return xe(e,t,n,r);case"FilterQuery":return me(e,t,n,r);case"TestExpr":return"FilterQuery"===r.expression.type?me(e,t,n,r.expression):"FunctionExpr"===r.expression.type?xe(e,t,n,r.expression):ye(e,t,n,r);case"LogicalOrExpr":case"LogicalAndExpr":case"LogicalNotExpr":case"ComparisonExpr":return ye(e,t,n,r);default:return}})(e,t,n,r));return o(e.realm,...a)},xe=(e,t,n,r)=>{switch(r.type){case"Literal":return ue(e,t,n,r);case"RelSingularQuery":return((e,t,n,r)=>{let s=n;for(const t of r.segments)if(s=he(e,s,t),void 0===s)return;return s})(e,0,n,r);case"AbsSingularQuery":return((e,t,n,r)=>{let s=t;for(const t of r.segments)if(s=he(e,s,t),void 0===s)return;return s})(e,t,0,r);case"FunctionExpr":return ge(e,t,n,r);default:return}},be=(e,t,n,r)=>{const{left:s,op:i,right:o}=r,a=xe(e,t,n,s),c=xe(e,t,n,o);return e.realm.compare(a,i,c)},we=e=>Array.isArray(e),ve=(e,t,n,r)=>{switch(r.type){case"LogicalOrExpr":return!!ve(e,t,n,r.left)||ve(e,t,n,r.right);case"LogicalAndExpr":return!!ve(e,t,n,r.left)&&ve(e,t,n,r.right);case"LogicalNotExpr":return!ve(e,t,n,r.expression);case"TestExpr":{const{expression:s}=r;if("FilterQuery"===s.type){return me(e,t,n,s).length>0}if("FunctionExpr"===s.type){const r=ge(e,t,n,s);return"boolean"==typeof r?r:void 0!==r&&(we(r)?r.length>0:Boolean(r))}return!1}case"ComparisonExpr":return be(e,t,n,r);default:return!1}};ye=ve;const ke=ve,Se=(e,t,n,r)=>{const{realm:s,root:i}=e,{expression:o}=n;for(const[n,a]of s.entries(t)){ke(e,i,a,o)&&r(a,n)}},Oe=(e,t,n,r)=>{switch(n.type){case"NameSelector":ie(e,t,n,r);break;case"IndexSelector":oe(e,t,n,r);break;case"WildcardSelector":ae(e,t,n,r);break;case"SliceSelector":le(e,t,n,r);break;case"FilterSelector":Se(e,t,n,r)}};new Map;class Ee{node;key;index;parent;parentPath;inList;#e=!1;#t=!1;#n=!1;#r=!1;#s;#i=!1;constructor(e,t,n,r,s){this.node=e,this.parent=t,this.parentPath=n,this.key=r,this.index=s&&"number"==typeof r?r:void 0,this.inList=s}get shouldSkip(){return this.#e}get shouldStop(){return this.#t}get removed(){return this.#n}isRoot(){return null===this.parentPath}get depth(){let e=0,t=this.parentPath;for(;null!==t;)e+=1,t=t.parentPath;return e}getAncestry(){const e=[];let t=this.parentPath;for(;null!==t;)e.push(t),t=t.parentPath;return e}getAncestorNodes(){return this.getAncestry().map(e=>e.node)}getPathKeys(){const e=[];let t=this;for(;null!==t&&void 0!==t.key;){const{key:n,parent:r,parentPath:s}=t;if(G(r)&&"value"===n){if(!L(r.key))throw new TypeError("MemberElement.key must be a StringElement");e.unshift(r.key.toValue())}else R(s?.node)&&"number"==typeof n&&e.unshift(n);t=t.parentPath}return e}formatPath(e="jsonpointer"){const t=this.getPathKeys();return 0===t.length?"jsonpath"===e?"$":"":"jsonpath"===e?se(t):ee(t)}findParent(e){let t=this.parentPath;for(;null!==t;){if(e(t))return t;t=t.parentPath}return null}find(e){return e(this)?this:this.findParent(e)}skip(){this.#e=!0}stop(){this.#t=!0}replaceWith(e){this.#i&&console.warn("Warning: replaceWith() called on a stale Path. This path belongs to a node whose visit has already completed. The replacement will have no effect. To replace a parent node, do so from the parent's own visitor."),this.#r=!0,this.#s=e,this.node=e}remove(){this.#i&&console.warn("Warning: remove() called on a stale Path. This path belongs to a node whose visit has already completed. The removal will have no effect. To remove a parent node, do so from the parent's own visitor."),this.#n=!0}_getReplacementNode(){return this.#s}_wasReplaced(){return this.#r}_reset(){this.#e=!1,this.#t=!1,this.#n=!1,this.#r=!1,this.#s=void 0}_markStale(){this.#i=!0}}class Ae extends AggregateError{constructor(e,t,n){super(e,t,n),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const _e=Ae;class Ie extends Error{static[Symbol.hasInstance](e){return super[Symbol.hasInstance](e)||Function.prototype[Symbol.hasInstance].call(_e,e)}constructor(e,t){super(e,t),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const Te=Ie;const Me=class extends Te{constructor(e,t){if(super(e,t),null!=t&&"object"==typeof t){const{cause:e,...n}=t;Object.assign(this,n)}}};function Ce(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,n){return t.apply(this,arguments)};case 3:return function(e,n,r){return t.apply(this,arguments)};case 4:return function(e,n,r,s){return t.apply(this,arguments)};case 5:return function(e,n,r,s,i){return t.apply(this,arguments)};case 6:return function(e,n,r,s,i,o){return t.apply(this,arguments)};case 7:return function(e,n,r,s,i,o,a){return t.apply(this,arguments)};case 8:return function(e,n,r,s,i,o,a,c){return t.apply(this,arguments)};case 9:return function(e,n,r,s,i,o,a,c,l){return t.apply(this,arguments)};case 10:return function(e,n,r,s,i,o,a,c,l,u){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function je(e,t,n){return function(){for(var r=[],i=0,o=e,a=0,c=!1;a<t.length||i<arguments.length;){var l;a<t.length&&(!s(t[a])||i>=arguments.length)?l=t[a]:(l=arguments[i],i+=1),r[a]=l,s(l)?c=!0:o-=1,a+=1}return!c&&o<=0?n.apply(this,r):Ce(Math.max(0,o),je(e,r,n))}}var Ne=o(function(e,t){return 1===e?i(t):Ce(e,je(e,[],t))});const Fe=Ne;function De(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t}const Be=o(function(e,t){return e&&t});function $e(e,t,n){for(var r=0,s=n.length;r<s;)t=e(t,n[r]),r+=1;return t}const Le=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};function Pe(e){return"[object String]"===Object.prototype.toString.call(e)}const Ue=i(function(e){return!!Le(e)||!!e&&("object"==typeof e&&(!Pe(e)&&(0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))});var qe="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function Re(e,t,n){return function(r,s,i){if(Ue(i))return e(r,s,i);if(null==i)return s;if("function"==typeof i["fantasy-land/reduce"])return t(r,s,i,"fantasy-land/reduce");if(null!=i[qe])return n(r,s,i[qe]());if("function"==typeof i.next)return n(r,s,i);if("function"==typeof i.reduce)return t(r,s,i,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function Ve(e,t,n){for(var r=n.next();!r.done;)t=e(t,r.value),r=n.next();return t}function Ge(e,t,n,r){return n[r](e,t)}const He=Re($e,Ge,Ve);function ze(e,t,n){return function(){if(0===arguments.length)return n();var r=arguments[arguments.length-1];if(!Le(r)){for(var s=0;s<e.length;){if("function"==typeof r[e[s]])return r[e[s]].apply(r,Array.prototype.slice.call(arguments,0,-1));s+=1}if(function(e){return null!=e&&"function"==typeof e["@@transducer/step"]}(r))return t.apply(null,Array.prototype.slice.call(arguments,0,-1))(r)}return n.apply(this,arguments)}}function Ke(e,t){for(var n=0,r=t.length,s=Array(r);n<r;)s[n]=e(t[n]),n+=1;return s}const Je=function(){return this.xf["@@transducer/init"]()},We=function(e){return this.xf["@@transducer/result"](e)};var Ye=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=Je,e.prototype["@@transducer/result"]=We,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},e}();var Xe=o(ze(["fantasy-land/map","map"],function(e){return function(t){return new Ye(e,t)}},function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return Fe(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return $e(function(n,r){return n[r]=e(t[r]),n},{},x(t));default:return Ke(e,t)}}));const Qe=Xe;const Ze=o(function(e,t){return"function"==typeof t["fantasy-land/ap"]?t["fantasy-land/ap"](e):"function"==typeof e.ap?e.ap(t):"function"==typeof e?function(n){return e(n)(t(n))}:He(function(e,n){return function(e,t){var n;t=t||[];var r=(e=e||[]).length,s=t.length,i=[];for(n=0;n<r;)i[i.length]=e[n],n+=1;for(n=0;n<s;)i[i.length]=t[n],n+=1;return i}(e,Qe(n,t))},[],e)});var et=o(function(e,t){var n=Fe(e,t);return Fe(e,function(){return $e(Ze,Qe(n,arguments[0]),Array.prototype.slice.call(arguments,1))})});const tt=et;var nt=i(function(e){return tt(e.length,e)});const rt=nt;const st=o(function(e,t){return De(e)?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:rt(Be)(e,t)});function it(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function ot(e){return function t(n,r,a){switch(arguments.length){case 0:return t;case 1:return s(n)?t:o(function(t,r){return e(n,t,r)});case 2:return s(n)&&s(r)?t:s(n)?o(function(t,n){return e(t,r,n)}):s(r)?o(function(t,r){return e(n,t,r)}):i(function(t){return e(n,r,t)});default:return s(n)&&s(r)&&s(a)?t:s(n)&&s(r)?o(function(t,n){return e(t,n,a)}):s(n)&&s(a)?o(function(t,n){return e(t,r,n)}):s(r)&&s(a)?o(function(t,r){return e(n,t,r)}):s(n)?i(function(t){return e(t,r,a)}):s(r)?i(function(t){return e(n,t,a)}):s(a)?i(function(t){return e(n,r,t)}):e(n,r,a)}}}function at(e,t,n){for(var r=0,s=n.length;r<s;){if((t=e["@@transducer/step"](t,n[r]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r+=1}return e["@@transducer/result"](t)}var ct=o(function(e,t){return Ce(e.length,function(){return e.apply(t,arguments)})});const lt=ct;function ut(e,t,n){for(var r=n.next();!r.done;){if((t=e["@@transducer/step"](t,r.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r=n.next()}return e["@@transducer/result"](t)}function ht(e,t,n,r){return e["@@transducer/result"](n[r](lt(e["@@transducer/step"],e),t))}const pt=Re(at,ht,ut);var dt=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();var ft=ot(function(e,t,n){return pt("function"==typeof e?function(e){return new dt(e)}(e):e,t,n)});const mt=ft;function yt(e,t){return function(){var n=arguments.length;if(0===n)return t();var r=arguments[n-1];return Le(r)||"function"!=typeof r[e]?t.apply(this,arguments):r[e].apply(r,Array.prototype.slice.call(arguments,0,n-1))}}const gt=ot(yt("slice",function(e,t,n){return Array.prototype.slice.call(n,e,t)}));const xt=i(yt("tail",gt(1,1/0)));function bt(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return Ce(arguments[0].length,mt(it,arguments[0],xt(arguments)))}function wt(e,t){return function(e,t,n){var r,s;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(r=1/t;n<e.length;){if(0===(s=e[n])&&1/s===r)return n;n+=1}return-1}if(t!=t){for(;n<e.length;){if("number"==typeof(s=e[n])&&s!=s)return n;n+=1}return-1}return e.indexOf(t,n);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,n);case"object":if(null===t)return e.indexOf(t,n)}for(;n<e.length;){if(k(e[n],t))return n;n+=1}return-1}(t,e,0)>=0}function vt(e){return'"'+e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var kt=function(e){return(e<10?"0":"")+e};const St="function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+kt(e.getUTCMonth()+1)+"-"+kt(e.getUTCDate())+"T"+kt(e.getUTCHours())+":"+kt(e.getUTCMinutes())+":"+kt(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function Ot(e){return"[object Object]"===Object.prototype.toString.call(e)}var Et=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=Je,e.prototype["@@transducer/result"]=We,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},e}();function At(e){return function(t){return new Et(e,t)}}var _t=o(ze(["fantasy-land/filter","filter"],At,function(e,t){return Ot(t)?$e(function(n,r){return e(t[r])&&(n[r]=t[r]),n},{},x(t)):(n=t,"[object Map]"===Object.prototype.toString.call(n)?function(e,t){for(var n=new Map,r=t.entries(),s=r.next();!s.done;)e(s.value[1])&&n.set(s.value[0],s.value[1]),s=r.next();return n}(e,t):function(e,t){for(var n=0,r=t.length,s=[];n<r;)e(t[n])&&(s[s.length]=t[n]),n+=1;return s}(e,t));var n}));const It=_t;const Tt=o(function(e,t){return It((n=e,function(){return!n.apply(this,arguments)}),t);var n});function Mt(e,t){var n=function(n){var r=t.concat([e]);return wt(n,r)?"<Circular>":Mt(n,r)},r=function(e,t){return Ke(function(t){return vt(t)+": "+n(e[t])},t.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+Ke(n,e).join(", ")+"))";case"[object Array]":return"["+Ke(n,e).concat(r(e,Tt(function(e){return/^\d+$/.test(e)},x(e)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof e?"new Boolean("+n(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?n(NaN):vt(St(e)))+")";case"[object Map]":return"new Map("+n(Array.from(e))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof e?"new Number("+n(e.valueOf())+")":1/e==-1/0?"-0":e.toString(10);case"[object Set]":return"new Set("+n(Array.from(e).sort())+")";case"[object String]":return"object"==typeof e?"new String("+n(e.valueOf())+")":vt(e);case"[object Undefined]":return"undefined";default:if("function"==typeof e.toString){var s=e.toString();if("[object Object]"!==s)return s}return"{"+r(e,x(e)).join(", ")+"}"}}const Ct=i(function(e){return Mt(e,[])});const jt=o(function(e,t){return e||t});const Nt=o(function(e,t){return De(e)?function(){return e.apply(this,arguments)||t.apply(this,arguments)}:rt(jt)(e,t)});const Ft=rt(i(function(e){return!e}));const Dt=k(null);const Bt=Ft(Dt);const $t=o(function(e,t){if(e===t)return t;function n(e,t){if(e>t!=t>e)return t>e?t:e}var r=n(e,t);if(void 0!==r)return r;var s=n(typeof e,typeof t);if(void 0!==s)return s===typeof e?e:t;var i=Ct(e),o=n(i,Ct(t));return void 0!==o&&o===i?e:t}),Lt=Number.isInteger||function(e){return(e|0)===e};function Pt(e,t){return t[e<0?t.length+e:e]}const Ut=o(function(e,t){if(null!=t)return Lt(e)?Pt(e,t):t[e]});const qt=o(function(e,t){return Qe(Ut(e),t)});const Rt=i(function(e){return Fe(mt($t,0,qt("length",e)),function(){for(var t=0,n=e.length;t<n;){if(e[t].apply(this,arguments))return!0;t+=1}return!1})});var Vt=function(e,t){switch(arguments.length){case 0:return Vt;case 1:return function t(n){return 0===arguments.length?t:u(e,n)};default:return u(e,t)}};const Gt=Vt;const Ht=Fe(1,bt(b,Gt("GeneratorFunction")));const zt=Fe(1,bt(b,Gt("AsyncFunction")));const Kt=Rt([bt(b,Gt("Function")),Ht,zt]);function Jt(e){return Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jt(e)}const Wt=function(e){return"object"===Jt(e)};var Yt=Fe(1,st(Bt,Nt(Wt,Kt)));const Xt=Fe(1,st(Yt,bt(Ct,k("[object Promise]")))),Qt=e=>"number"==typeof e.startLine&&"number"==typeof e.startCharacter&&"number"==typeof e.startOffset&&"number"==typeof e.endLine&&"number"==typeof e.endCharacter&&"number"==typeof e.endOffset,Zt=(e,t)=>0===t.length||!!$(e)&&(!e.isMetaEmpty&&(!!e.hasMetaProperty("classes")&&t.every(t=>e.classes.includes(t))));class en extends I{constructor(e,t,n){super(e,t,n),this.element="sourceMap"}static transfer(e,t){t.startLine=e.startLine,t.startCharacter=e.startCharacter,t.startOffset=e.startOffset,t.endLine=e.endLine,t.endCharacter=e.endCharacter,t.endOffset=e.endOffset}static from(e){const{startLine:t,startCharacter:n,startOffset:r,endLine:s,endCharacter:i,endOffset:o}=e;if("number"!=typeof t||"number"!=typeof n||"number"!=typeof r||"number"!=typeof s||"number"!=typeof i||"number"!=typeof o)return;const a="sm1:"+[t,n,r,s,i,o].map(nn).join("");const c=new en(a);return c.startLine=t,c.startCharacter=n,c.startOffset=r,c.endLine=s,c.endCharacter=i,c.endOffset=o,c}applyTo(e){this.content&&([e.startLine,e.startCharacter,e.startOffset,e.endLine,e.endCharacter,e.endOffset]=function(e){const t=e.startsWith("sm1:")?e.slice(4):e,n=[];let r=0;for(let e=0;e<6;e++){const e=rn(t,r);n.push(e.value),r=e.next}return n}(this.content))}}const tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function nn(e){let t=e>>>0,n="";do{let e=31&t;t>>>=5,0!==t&&(e|=32),n+=tn[e]}while(0!==t);return n}function rn(e,t=0){let n=0,r=0,s=t;for(;;){const t=e[s++],i=tn.indexOf(t);if(-1===i)throw new Error(`Invalid Base64 VLQ char: ${t}`);if(n|=(31&i)<<r,r+=5,!!!(32&i))break}return{value:n>>>0,next:s}}const sn=en;const on=class extends Me{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};const an=class extends on{};const cn=class extends on{},ln=(e,t)=>{const{visited:n=new WeakMap}=t,r={...t,visited:n};if(n.has(e))return n.get(e);const s=dn(e);n.set(e,s);const{content:i}=e;return Array.isArray(i)?s.content=i.map(e=>ln(e,r)):$(i)?s.content=ln(i,r):s.content=i instanceof S?un(i,r):i,s},un=(e,t)=>{const{visited:n=new WeakMap}=t,r={...t,visited:n};if(n.has(e))return n.get(e);const{key:s,value:i}=e,o=void 0!==s?ln(s,r):void 0,a=void 0!==i?ln(i,r):void 0,c=new S(o,a);return n.set(e,c),c},hn=(e,t={})=>{if(e instanceof S)return un(e,t);if(e instanceof E)return((e,t)=>{const{visited:n=new WeakMap}=t,r={...t,visited:n};if(n.has(e))return n.get(e);const s=[...e].map(e=>ln(e,r)),i=new E(s);return n.set(e,i),i})(e,t);if($(e))return ln(e,t);throw new an("Value provided to cloneDeep function couldn't be cloned",{value:e})};hn.safe=e=>{try{return hn(e)}catch{return e}};const pn=e=>{const{key:t,value:n}=e;return new S(t,n)},dn=e=>{const t=new(0,e.constructor);t.element=e.element,e.isMetaEmpty||(t.meta=hn(e.meta)),e.isAttributesEmpty||(t.attributes=hn(e.attributes)),Qt(e)&&sn.transfer(e,t);const{content:n}=e;return $(n)?t.content=dn(n):Array.isArray(n)?t.content=[...n]:t.content=n instanceof S?pn(n):n,t},fn=e=>{if(e instanceof S)return pn(e);if(e instanceof E)return(e=>{const t=[...e];return new E(t)})(e);if($(e))return dn(e);throw new cn("Value provided to cloneShallow function couldn't be cloned",{value:e})};fn.safe=e=>{try{return fn(e)}catch{return e}};const mn=e=>{const t=e?.element;return void 0===t||"element"===t?"Element":`${t.charAt(0).toUpperCase()}${t.slice(1)}Element`},yn=e=>$(e),gn=e=>fn(e),xn=(e,t,n)=>{G(e)?e.value=n:Array.isArray(e)?e[t]=null===n?void 0:n:null===n?delete e[t]:e[t]=n},bn=e=>G(e)?["key","value"]:R(e)||V(e)?["content"]:[],wn=(e,t)=>{if(void 0!==e[t])return e[t];const n=t.length;for(const r in e){if(!r.includes("|"))continue;const s=r.indexOf(t);if(-1===s)continue;const i=0===s||"|"===r[s-1],o=s+n===r.length||"|"===r[s+n];if(i&&o)return e[r]}},vn=(e,t,n)=>{if(void 0===t)return null;const r=e,s=n?"leave":"enter",i=wn(r,t);if(!n&&"function"==typeof i)return i;if(null!=i){const e=i[s];if("function"==typeof e)return e}const o=r[s];if("function"==typeof o)return o;if(null!=o){const e=wn(o,t);if("function"==typeof e)return e}return null},kn=(e,t={})=>{const{visitFnGetter:n=vn,nodeTypeGetter:r=mn,exposeEdits:s=!1}=t,i=Symbol("internal-skip"),o=Symbol("break"),a=new Array(e.length).fill(i);return{enter(t){let c=t.node,l=!1;for(let u=0;u<e.length;u+=1)if(a[u]===i){const i=n(e[u],r(c),!1);if("function"==typeof i){const n=On(t,c),r=i.call(e[u],n);if(Xt(r))throw new Me("Async visitor not supported in sync mode",{visitor:e[u],visitFn:i});if(n.shouldStop){a[u]=o;break}if(n.shouldSkip&&(a[u]=c),n.removed)return void t.remove();if(n._wasReplaced()){const e=n._getReplacementNode();if(!s)return t.replaceWith(e),e;c=e,l=!0}else if(void 0!==r){if(!s)return t.replaceWith(r),r;c=r,l=!0}}}if(l)return t.replaceWith(c),c},leave(t){const s=t.node;for(let c=0;c<e.length;c+=1)if(a[c]===i){const i=n(e[c],r(s),!0);if("function"==typeof i){const n=On(t,s),r=i.call(e[c],n);if(Xt(r))throw new Me("Async visitor not supported in sync mode",{visitor:e[c],visitFn:i});if(n.shouldStop){a[c]=o;break}if(n.removed)return void t.remove();if(n._wasReplaced()){const e=n._getReplacementNode();return t.replaceWith(e),e}if(void 0!==r)return t.replaceWith(r),r}}else a[c]===s&&(a[c]=i)}}},Sn=(e,t={})=>{const{visitFnGetter:n=vn,nodeTypeGetter:r=mn,exposeEdits:s=!1}=t,i=Symbol("internal-skip"),o=Symbol("break"),a=new Array(e.length).fill(i);return{async enter(t){let c=t.node,l=!1;for(let u=0;u<e.length;u+=1)if(a[u]===i){const i=n(e[u],r(c),!1);if("function"==typeof i){const n=On(t,c),r=await i.call(e[u],n);if(n.shouldStop){a[u]=o;break}if(n.shouldSkip&&(a[u]=c),n.removed)return void t.remove();if(n._wasReplaced()){const e=n._getReplacementNode();if(!s)return t.replaceWith(e),e;c=e,l=!0}else if(void 0!==r){if(!s)return t.replaceWith(r),r;c=r,l=!0}}}if(l)return t.replaceWith(c),c},async leave(t){const s=t.node;for(let c=0;c<e.length;c+=1)if(a[c]===i){const i=n(e[c],r(s),!0);if("function"==typeof i){const n=On(t,s),r=await i.call(e[c],n);if(n.shouldStop){a[c]=o;break}if(n.removed)return void t.remove();if(n._wasReplaced()){const e=n._getReplacementNode();return t.replaceWith(e),e}if(void 0!==r)return t.replaceWith(r),r}}else a[c]===s&&(a[c]=i)}}};function On(e,t){return new Ee(t,e.parent,e.parentPath,e.key,e.inList)}function*En(e,t,n){const{keyMap:r,state:s,nodeTypeGetter:i,nodePredicate:o,nodeCloneFn:a,detectCycles:c,mutable:l,mutationFn:u}=n,h="function"==typeof r;let p,d,f=Array.isArray(e),m=[e],y=-1,g=[],x=e,b=null,w=null;const v=[];do{y+=1;const e=y===m.length;let n;const k=e&&0!==g.length;if(e){if(n=0===v.length?void 0:b?.key,x=d,d=v.pop(),w=b?.parentPath?.parentPath??null,k)if(l)for(const[e,t]of g)u(x,e,t);else if(f){x=x.slice();let e=0;for(const[t,n]of g){const r=t-e;null===n?(x.splice(r,1),e+=1):x[r]=n}}else{x=a(x);for(const[e,t]of g)x[e]=t}if(void 0!==p){y=p.index,m=p.keys,g=p.edits;const e=p.inArray;if(w=p.parentPath,p=p.prev,k&&!l){const t=e?y:m[y];g.push([t,x])}f=e}}else if(void 0!==d&&(n=f?y:m[y],x=d[n],void 0===x))continue;if(!Array.isArray(x)){if(!o(x))throw new Me(`Invalid AST Node: ${String(x)}`,{node:x});if(c&&v.includes(x))continue;b=new Ee(x,d,w,n,f);const r=vn(t,i(x),e);if(r){for(const[e,n]of Object.entries(s))t[e]=n;const i=yield{visitFn:r,path:b,isLeaving:e};if(b.shouldStop)break;if(b.shouldSkip&&!e)continue;if(b.removed){if(g.push([n,null]),!e)continue}else if(b._wasReplaced()){const t=b._getReplacementNode();if(g.push([n,t]),!e){if(!o(t))continue;x=t}}else if(void 0!==i&&(g.push([n,i]),!e)){if(!o(i))continue;x=i}b._markStale()}}if(!e){if(p={inArray:f,index:y,keys:m,edits:g,parentPath:w,prev:p},f=Array.isArray(x),f)m=x;else if(h)m=r(x);else{const e=i(x);m=void 0!==e?r[e]??[]:[]}y=-1,g=[],void 0!==d&&v.push(d),d=x,w=b}}while(void 0!==p);return 0!==g.length?g.at(-1)[1]:e}kn[Symbol.for("nodejs.util.promisify.custom")]=Sn;const An=(e,t,n={})=>{const r=En(e,t,{keyMap:n.keyMap??bn,state:n.state??{},nodeTypeGetter:n.nodeTypeGetter??mn,nodePredicate:n.nodePredicate??yn,nodeCloneFn:n.nodeCloneFn??gn,detectCycles:n.detectCycles??!0,mutable:n.mutable??!1,mutationFn:n.mutationFn??xn});let s=r.next();for(;!s.done;){const e=s.value,n=e.visitFn.call(t,e.path);if(Xt(n))throw new Me("Async visitor not supported in sync mode",{visitor:t,visitFn:e.visitFn});s=r.next(n)}return s.value},_n=async(e,t,n={})=>{const r=En(e,t,{keyMap:n.keyMap??bn,state:n.state??{},nodeTypeGetter:n.nodeTypeGetter??mn,nodePredicate:n.nodePredicate??yn,nodeCloneFn:n.nodeCloneFn??gn,detectCycles:n.detectCycles??!0,mutable:n.mutable??!1,mutationFn:n.mutationFn??xn});let s=r.next();for(;!s.done;){const e=s.value,n=await e.visitFn.call(t,e.path);s=r.next(n)}return s.value};An[Symbol.for("nodejs.util.promisify.custom")]=_n,Ee.prototype.traverse=function(e,t){return An(this.node,e,t)},Ee.prototype.traverseAsync=function(e,t){return _n(this.node,e,t)};var In=ot(function(e,t,n){var r,s={};for(r in n=n||{},t=t||{})l(r,t)&&(s[r]=l(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)l(r,n)&&!l(r,s)&&(s[r]=n[r]);return s});const Tn=In;var Mn=ot(function e(t,n,r){return Tn(function(n,r,s){return Ot(r)&&Ot(s)?e(t,r,s):t(n,r,s)},n,r)});const Cn=Mn;const jn=o(function(e,t){return Cn(function(e,t,n){return n},e,t)});const Nn=o(function(e,t){return null==t||t!=t?e:t});const Fn=ot(function(e,t,n){return Nn(e,Ut(t,n))});function Dn(e,t){for(var n=t,r=0;r<e.length;r+=1){if(null==n)return;var s=e[r];n=Lt(s)?Pt(s,n):n[s]}return n}const Bn=o(Dn);const $n=gt(0,-1);var Ln=o(function(e,t){return e.apply(this,t)});const Pn=Ln;const Un=Ft(Kt);var qn=i(function(e){return null!=e&&"function"==typeof e["fantasy-land/empty"]?e["fantasy-land/empty"]():null!=e&&null!=e.constructor&&"function"==typeof e.constructor["fantasy-land/empty"]?e.constructor["fantasy-land/empty"]():null!=e&&"function"==typeof e.empty?e.empty():null!=e&&null!=e.constructor&&"function"==typeof e.constructor.empty?e.constructor.empty():e==Set||e instanceof Set?new Set:e==Map||e instanceof Map?new Map:Le(e)?[]:Pe(e)?"":Ot(e)?{}:p(e)?function(){return arguments}():function(e){var t=Object.prototype.toString.call(e);return"[object Uint8ClampedArray]"===t||"[object Int8Array]"===t||"[object Uint8Array]"===t||"[object Int16Array]"===t||"[object Uint16Array]"===t||"[object Int32Array]"===t||"[object Uint32Array]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object BigInt64Array]"===t||"[object BigUint64Array]"===t}(e)?e.constructor.from(""):void 0});const Rn=qn;const Vn=i(function(e){return null!=e&&k(e,Rn(e))});const Gn=st(Fe(1,Kt(Array.isArray)?Array.isArray:bt(b,Gt("Array"))),Vn);const Hn=Fe(3,function(e,t,n){var r=Bn(e,n),s=Bn($n(e),n);if(!Un(r)&&!Gn(e)){var i=lt(r,s);return Pn(i,t)}});const zn=class extends _{constructor(e,t,n){super(e||[],t,n),this.element="link"}get relation(){if(this.hasAttributesProperty("relation"))return this.attributes.get("relation")}set relation(e){this.attributes.set("relation",e)}get href(){if(this.hasAttributesProperty("href"))return this.attributes.get("href")}set href(e){this.attributes.set("href",e)}};const Kn=class extends _{constructor(e,t,n){super(e||[],t,n),this.element="ref",this.path||(this.path="element")}get path(){if(this.hasAttributesProperty("path"))return this.attributes.get("path")}set path(e){this.attributes.set("path",e)}};const Jn=class extends I{constructor(e,t,n){super(e,t,n),this.element="annotation"}get code(){if(this.hasAttributesProperty("code"))return this.attributes.get("code")}set code(e){this.attributes.set("code",e)}};const Wn=class extends I{constructor(e,t,n){super(e,t,n),this.element="comment"}};const Yn=class extends F{constructor(e,t,n){super(e,t,n),this.element="parseResult"}get api(){return this.filter(e=>Zt(e,["api"])).first}get results(){return this.filter(e=>Zt(e,["result"]))}get result(){return this.results.first}get annotations(){return this.filter(e=>"annotation"===e.element)}get warnings(){return this.filter(e=>"annotation"===e.element&&Zt(e,["warning"]))}get errors(){return this.filter(e=>"annotation"===e.element&&Zt(e,["error"]))}get isEmpty(){return 0===this.reject(e=>"annotation"===e.element).length}replaceResult(e){const{result:t}=this;if(void 0===t)return!1;const n=this._content,r=n.findIndex(e=>e===t);return-1!==r&&(n[r]=e,!0)}},Xn=e=>e instanceof zn,Qn=e=>e instanceof Kn;const Zn=class{namespace;constructor(e){this.namespace=e||new this.Namespace}serialise(e){if(!(e instanceof this.namespace.elements.Element))throw new TypeError(`Given element \`${e}\` is not an Element instance`);const t={element:e.element};if(e.isMetaEmpty||(t.meta=this.serialiseObject(e.meta)),e.isAttributesEmpty||(t.attributes=this.serialiseObject(e.attributes)),!(e instanceof sn)){const n=sn.from(e);n&&(t.meta||(t.meta={}),t.meta.__mappings__=this.serialise(n))}const n=this.serialiseContent(e.content);return void 0!==n&&(t.content=n),t}deserialise(e){if(!e.element)throw new Error("Given value is not an object containing an element name");const t=new(this.namespace.getElementClass(e.element));let n;t.element!==e.element&&(t.element=e.element);let r=e.meta;if(e.meta?.__mappings__){const{__mappings__:t,...s}=e.meta;n=t,r=Object.keys(s).length>0?s:void 0}if(r&&this.deserialiseObject(r,t.meta),n){this.deserialise(n).applyTo(t)}e.attributes&&this.deserialiseObject(e.attributes,t.attributes);const s=this.deserialiseContent(e.content);return void 0===s&&null!==t.content||(t.content=s),t}serialiseContent(e){if(e instanceof this.namespace.elements.Element)return this.serialise(e);if(e instanceof this.namespace.KeyValuePair){const t=e,n={key:this.serialise(t.key)};return t.value&&(n.value=this.serialise(t.value)),n}if(e&&Array.isArray(e)){if(0===e.length)return;return e.map(e=>this.serialise(e))}return e}deserialiseContent(e){if(e){if(e.element)return this.deserialise(e);if(e.key){const t=new this.namespace.KeyValuePair(this.deserialise(e.key));return e.value&&(t.value=this.deserialise(e.value)),t}if(Array.isArray(e))return e.map(e=>this.deserialise(e))}return e}serialiseObject(e){const t={};if(e.forEach((e,n)=>{e&&(t[n.toValue()]=this.serialise(e))}),0!==Object.keys(t).length)return t}deserialiseObject(e,t){Object.keys(e).forEach(n=>{t.set(n,this.deserialise(e[n]))})}},er=e=>null===e,tr=e=>"string"==typeof e,nr=e=>"number"==typeof e,rr=e=>"boolean"==typeof e,sr=e=>null!==e&&"object"==typeof e;class ir{elementMap={};elementDetection=[];Element;KeyValuePair;_elements;_attributeElementKeys=[];_attributeElementArrayKeys=[];constructor(e){this.Element=_,this.KeyValuePair=S,e&&e.noDefault||this.useDefault()}use(e){return e.namespace&&e.namespace({base:this}),e.load&&e.load({base:this}),this}useDefault(){return this.register("null",M).register("string",I).register("number",T).register("boolean",C).register("array",F).register("object",B).register("member",D).register("ref",Kn).register("link",zn).register("sourceMap",sn),this.detect(er,M,!1).detect(tr,I,!1).detect(nr,T,!1).detect(rr,C,!1).detect(Array.isArray,F,!1).detect(sr,B,!1),this}register(e,t){return this._elements=void 0,this.elementMap[e]=t,this}unregister(e){return this._elements=void 0,delete this.elementMap[e],this}detect(e,t,n){return void 0===n||n?this.elementDetection.unshift([e,t]):this.elementDetection.push([e,t]),this}toElement(e){if(e instanceof this.Element)return e;let t;for(const[n,r]of this.elementDetection)if(n(e)){t=new r(e);break}return t}getElementClass(e){const t=this.elementMap[e];return void 0===t?this.Element:t}fromRefract(e){return this.serialiser.deserialise(e)}toRefract(e){return this.serialiser.serialise(e)}get elements(){return void 0===this._elements&&(this._elements={Element:this.Element},Object.keys(this.elementMap).forEach(e=>{const t=e[0].toUpperCase()+e.substring(1);this._elements[t]=this.elementMap[e]})),this._elements}get serialiser(){return new Zn(this)}}Zn.prototype.Namespace=ir;const or=new ir,ar={isElement:$,isStringElement:L,isNumberElement:P,isNullElement:U,isBooleanElement:q,isArrayElement:R,isObjectElement:V,isMemberElement:G,isPrimitiveElement:H,isLinkElement:Xn,isRefElement:Qn,isAnnotationElement:e=>e instanceof Jn,isCommentElement:e=>e instanceof Wn,isParseResultElement:e=>e instanceof Yn,isSourceMapElement:e=>e instanceof sn,hasElementSourceMap:Qt,includesSymbols:(e,t)=>{if(0===t.length)return!0;if(!e.hasAttributesProperty("symbols"))return!1;const n=e.attributes.get("symbols");return!!R(n)&&t.every(e=>n.includes(e))},includesClasses:Zt},cr=()=>({predicates:ar,namespace:or}),lr={toolboxCreator:cr,visitorOptions:{exposeEdits:!0}},ur=(e,t,n={})=>{if(0===t.length)return e;const r=jn(lr,n),{toolboxCreator:s,visitorOptions:i}=r,o=s(),a=t.map(e=>e(o)),c=kn(a.map(Fn({},"visitor")),i);a.forEach(Hn(["pre"],[]));const l=An(e,c);return a.forEach(Hn(["post"],[])),l};ur[Symbol.for("nodejs.util.promisify.custom")]=async(e,t,n={})=>{if(0===t.length)return e;const r=jn(lr,n),{toolboxCreator:s,visitorOptions:i}=r,o=s(),a=t.map(e=>e(o)),c=Sn(a.map(Fn({},"visitor")),i);await Promise.allSettled(a.map(Hn(["pre"],[])));const l=await _n(e,c);return await Promise.allSettled(a.map(Hn(["post"],[]))),l};var hr=n(279),pr=n.n(hr);const dr=class extends Me{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};class fr{uuid;identityMap;constructor({length:e=6}={}){this.uuid=new(pr())({length:e}),this.identityMap=new WeakMap}identify(e){if(!$(e))throw new dr("Cannot not identify the element. `element` is neither structurally compatible nor a subclass of an Element class.",{value:e});if(e.hasMetaProperty("id")){const t=e.meta.get("id");if(L(t)&&!t.equals(""))return e.id}if(this.identityMap.has(e))return this.identityMap.get(e);const t=new I(this.generateId());return this.identityMap.set(e,t),t}forget(e){return!!this.identityMap.has(e)&&(this.identityMap.delete(e),!0)}generateId(){return this.uuid.randomUUID()}}const mr=new fr,yr=({length:e=6}={})=>()=>{let t;return{pre(){t=new fr({length:e})},visitor:{enter(e){e.node.id=t.identify(e.node)}},post(){t=null}}},gr=({length:e=6}={})=>()=>{let t;return{pre(){t=new fr({length:e})},visitor:{enter(e){H(e.node)||(e.node.id=t.identify(e.node))}},post(){t=null}}};const xr=class extends Te{};const br=class extends xr{};const wr=class extends Array{unknownMediaType="application/octet-stream";filterByFormat(){throw new br("filterByFormat method in MediaTypes class is not yet implemented.")}findBy(){throw new br("findBy method in MediaTypes class is not yet implemented.")}latest(){throw new br("latest method in MediaTypes class is not yet implemented.")}};var vr=i(function(e){return function(){return e}})(void 0);const kr=k(vr()),Sr=(e,t=new WeakMap)=>(G(e)?(t.set(e.key,e),Sr(e.key,t),t.set(e.value,e),Sr(e.value,t)):e.children.forEach(n=>{t.set(n,e),Sr(n,t)}),t);const Or=class{element;edges;constructor({element:e}){this.element=e}transclude(e,t){if(e===this.element)return t;if(e===t)return this.element;this.edges=this.edges??Sr(this.element);const n=this.edges.get(e);return kr(n)?void 0:(V(n)?((e,t,n)=>{const r=n.get(e);V(r)&&(r.content=r.map((s,i,o)=>o===e?(n.delete(e),n.set(t,r),t):o))})(e,t,this.edges):R(n)?((e,t,n)=>{const r=n.get(e);R(r)&&(r.content=r.map(s=>s===e?(n.delete(e),n.set(t,r),t):s))})(e,t,this.edges):G(n)&&((e,t,n)=>{const r=n.get(e);G(r)&&(r.key===e&&(r.key=t,n.delete(e),n.set(t,r)),r.value===e&&(r.value=t,n.delete(e),n.set(t,r)))})(e,t,this.edges),this.element)}},Er=(e,t,n)=>new Or({element:n}).transclude(e,t),Ar=Or;var _r=o(function(e,t){return $e(function(n,r){return n[r]=e(t[r],r,t),n},{},x(t))});const Ir=_r;const Tr=i(function(e){return null==e});var Mr=o(function(e,t){if(0===e.length||Tr(t))return!1;for(var n=t,r=0;r<e.length;){if(Tr(n)||!l(e[r],n))return!1;n=n[e[r]],r+=1}return!0});const Cr=Mr;var jr=o(function(e,t){return Cr([e],t)});const Nr=jr;const Fr=ot(function(e,t,n){return e(Ut(t,n))});const Dr=ot(function(e,t,n){return e(Dn(t,n))});const Br=Fe(1,st(Bt,Wt));var $r=bt(b,Gt("Object")),Lr=Dr(st(Kt,bt(Ct,k(Ct(Object)))),["constructor"]);const Pr=Fe(1,function(e){if(!Br(e)||!$r(e))return!1;var t=Object.getPrototypeOf(e);return!!Dt(t)||Lr(t)});const Ur=Fe(1,bt(b,Gt("String")));var qr=i(function(e){return Fe(e.length,e)});const Rr=qr;const Vr=o(function(e,t){return Fe(e+1,function(){var n=arguments[e];if(null!=n&&De(n[t]))return n[t].apply(n,Array.prototype.slice.call(arguments,0,e));throw new TypeError(Ct(n)+' does not have a method named "'+t+'"')})});const Gr=Vr(1,"split");var Hr=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=Je,e.prototype["@@transducer/result"]=We,e.prototype["@@transducer/step"]=function(e,t){if(this.f){if(this.f(t))return e;this.f=null}return this.xf["@@transducer/step"](e,t)},e}();function zr(e){return function(t){return new Hr(e,t)}}const Kr=o(ze(["dropWhile"],zr,function(e,t){for(var n=0,r=t.length;n<r&&e(t[n]);)n+=1;return gt(n,1/0,t)}));const Jr=Vr(1,"join");var Wr=i(function(e){return Fe(e.length,function(t,n){var r=Array.prototype.slice.call(arguments,0);return r[0]=n,r[1]=t,e.apply(this,r)})});const Yr=Wr(o(wt));const Xr=Rr(function(e,t){return bt(Gr(""),Kr(Yr(e)),Jr(""))(t)}),Qr=new WeakMap,Zr=e=>{if(Qr.has(e))return Qr.get(e);const t={},n=(e,r,s)=>("string"==typeof e.element&&(t[e.element]=e.$visitor?[...s,"$visitor"]:s),Ir((e,t)=>{const i=[...s,t];if(Pr(e)&&Nr("$ref",e)&&Fr(Ur,"$ref",e)){const t=Bn(["$ref"],e),n=Xr("#/",t);return Bn(n.split("/"),r)}return Pr(e)?n(e,r,i):e},e)),r=n(e,e,[]);return r.elementMap=t,Qr.set(e,r),r},es=(e,t=or)=>{if(Ur(e))try{return t.fromRefract(JSON.parse(e))}catch{}return Pr(e)&&Nr("element",e)?t.fromRefract(e):t.toElement(e)},ts=e=>{if(!$(e))return e;if(L(e)||P(e)||q(e)||U(e))return e.toValue();const t=new WeakMap,n=e=>{if(!$(e))return e;if(V(e)){if(t.has(e))return t.get(e);const r={};return t.set(e,r),e.forEach((e,t)=>{const s=n(t),i=n(e);"string"==typeof s&&(r[s]=i)}),r}if(R(e)){if(t.has(e))return t.get(e);const r=[];return t.set(e,r),e.forEach(e=>r.push(n(e))),r}return Qn(e)?String(e.toValue()):Xn(e)?L(e.href)?e.href.toValue():"":e.toValue()};return n(e)},ns=(e,t,n)=>JSON.stringify(ts(e),t,n),rs=Symbol.for("yaml.alias"),ss=Symbol.for("yaml.document"),is=Symbol.for("yaml.map"),os=Symbol.for("yaml.pair"),as=Symbol.for("yaml.scalar"),cs=Symbol.for("yaml.seq"),ls=Symbol.for("yaml.node.type"),us=e=>!!e&&"object"==typeof e&&e[ls]===rs,hs=e=>!!e&&"object"==typeof e&&e[ls]===ss,ps=e=>!!e&&"object"==typeof e&&e[ls]===is,ds=e=>!!e&&"object"==typeof e&&e[ls]===os,fs=e=>!!e&&"object"==typeof e&&e[ls]===as,ms=e=>!!e&&"object"==typeof e&&e[ls]===cs;function ys(e){if(e&&"object"==typeof e)switch(e[ls]){case is:case cs:return!0}return!1}function gs(e){if(e&&"object"==typeof e)switch(e[ls]){case rs:case is:case as:case cs:return!0}return!1}const xs=e=>(fs(e)||ys(e))&&!!e.anchor,bs=Symbol("break visit"),ws=Symbol("skip children"),vs=Symbol("remove node");function ks(e,t){const n=As(t);if(hs(e)){Ss(null,e.contents,n,Object.freeze([e]))===vs&&(e.contents=null)}else Ss(null,e,n,Object.freeze([]))}function Ss(e,t,n,r){const s=_s(e,t,n,r);if(gs(s)||ds(s))return Is(e,r,s),Ss(e,s,n,r);if("symbol"!=typeof s)if(ys(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){const s=Ss(e,t.items[e],n,r);if("number"==typeof s)e=s-1;else{if(s===bs)return bs;s===vs&&(t.items.splice(e,1),e-=1)}}}else if(ds(t)){r=Object.freeze(r.concat(t));const e=Ss("key",t.key,n,r);if(e===bs)return bs;e===vs&&(t.key=null);const s=Ss("value",t.value,n,r);if(s===bs)return bs;s===vs&&(t.value=null)}return s}async function Os(e,t){const n=As(t);if(hs(e)){await Es(null,e.contents,n,Object.freeze([e]))===vs&&(e.contents=null)}else await Es(null,e,n,Object.freeze([]))}async function Es(e,t,n,r){const s=await _s(e,t,n,r);if(gs(s)||ds(s))return Is(e,r,s),Es(e,s,n,r);if("symbol"!=typeof s)if(ys(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){const s=await Es(e,t.items[e],n,r);if("number"==typeof s)e=s-1;else{if(s===bs)return bs;s===vs&&(t.items.splice(e,1),e-=1)}}}else if(ds(t)){r=Object.freeze(r.concat(t));const e=await Es("key",t.key,n,r);if(e===bs)return bs;e===vs&&(t.key=null);const s=await Es("value",t.value,n,r);if(s===bs)return bs;s===vs&&(t.value=null)}return s}function As(e){return"object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function _s(e,t,n,r){return"function"==typeof n?n(e,t,r):ps(t)?n.Map?.(e,t,r):ms(t)?n.Seq?.(e,t,r):ds(t)?n.Pair?.(e,t,r):fs(t)?n.Scalar?.(e,t,r):us(t)?n.Alias?.(e,t,r):void 0}function Is(e,t,n){const r=t[t.length-1];if(ys(r))r.items[e]=n;else if(ds(r))"key"===e?r.key=n:r.value=n;else{if(!hs(r)){const e=us(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${e} parent`)}r.contents=n}}ks.BREAK=bs,ks.SKIP=ws,ks.REMOVE=vs,Os.BREAK=bs,Os.SKIP=ws,Os.REMOVE=vs;const Ts={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ms=e=>e.replace(/[!,[\]{}]/g,e=>Ts[e]);class Cs{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Cs.defaultYaml,e),this.tags=Object.assign({},Cs.defaultTags,t)}clone(){const e=new Cs(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new Cs(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Cs.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Cs.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:Cs.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Cs.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),r=n.shift();switch(r){case"%TAG":{if(2!==n.length&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[e,r]=n;return this.tags[e]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),!1;const[e]=n;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;return t(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),!1}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){const n=e.slice(2,-1);return"!"===n||"!!"===n?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),n)}const[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);const s=this.tags[n];if(s)try{return s+decodeURIComponent(r)}catch(e){return t(String(e)),null}return"!"===n?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Ms(e.substring(n.length));return"!"===e[0]?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let r;if(e&&n.length>0&&gs(e.contents)){const t={};ks(e.contents,(e,n)=>{gs(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(const[s,i]of n)"!!"===s&&"tag:yaml.org,2002:"===i||e&&!r.some(e=>e.startsWith(i))||t.push(`%TAG ${s} ${i}`);return t.join("\n")}}function js(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);throw new Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0}function Ns(e){const t=new Set;return ks(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Fs(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Ds(e,t,n,r){if(r&&"object"==typeof r)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){const n=r[t],s=Ds(e,r,String(t),n);void 0===s?delete r[t]:s!==n&&(r[t]=s)}else if(r instanceof Map)for(const t of Array.from(r.keys())){const n=r.get(t),s=Ds(e,r,t,n);void 0===s?r.delete(t):s!==n&&r.set(t,s)}else if(r instanceof Set)for(const t of Array.from(r)){const n=Ds(e,r,t,t);void 0===n?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(const[t,n]of Object.entries(r)){const s=Ds(e,r,t,n);void 0===s?delete r[t]:s!==n&&(r[t]=s)}return e.call(t,n,r)}function Bs(e,t,n){if(Array.isArray(e))return e.map((e,t)=>Bs(e,String(t),n));if(e&&"function"==typeof e.toJSON){if(!n||!xs(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return"bigint"!=typeof e||n?.keep?e:Number(e)}Cs.defaultYaml={explicit:!1,version:"1.2"},Cs.defaultTags={"!!":"tag:yaml.org,2002:"};class $s{constructor(e){Object.defineProperty(this,ls,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:s}={}){if(!hs(e))throw new TypeError("A document argument is required");const i={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},o=Bs(this,"",i);if("function"==typeof r)for(const{count:e,res:t}of i.anchors.values())r(t,e);return"function"==typeof s?Ds(s,{"":o},"",o):o}}class Ls extends $s{constructor(e){super(rs),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let n,r;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],ks(e,{Node:(e,t)=>{(us(t)||xs(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));for(const e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:r,maxAliasCount:s}=t,i=this.resolve(r,t);if(!i){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}let o=n.get(i);if(o||(Bs(i,null,t),o=n.get(i)),void 0===o?.res){throw new ReferenceError("This should not happen: Alias anchor was not resolved?")}if(s>=0&&(o.count+=1,0===o.aliasCount&&(o.aliasCount=Ps(r,i,n)),o.count*o.aliasCount>s)){throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return o.res}toString(e,t,n){const r=`*${this.source}`;if(e){if(js(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(e.implicitKey)return`${r} `}return r}}function Ps(e,t,n){if(us(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}if(ys(t)){let r=0;for(const s of t.items){const t=Ps(e,s,n);t>r&&(r=t)}return r}if(ds(t)){const r=Ps(e,t.key,n),s=Ps(e,t.value,n);return Math.max(r,s)}return 1}const Us=e=>!e||"function"!=typeof e&&"object"!=typeof e;class qs extends $s{constructor(e){super(as),this.value=e}toJSON(e,t){return t?.keep?this.value:Bs(this.value,e,t)}toString(){return String(this.value)}}qs.BLOCK_FOLDED="BLOCK_FOLDED",qs.BLOCK_LITERAL="BLOCK_LITERAL",qs.PLAIN="PLAIN",qs.QUOTE_DOUBLE="QUOTE_DOUBLE",qs.QUOTE_SINGLE="QUOTE_SINGLE";function Rs(e,t,n){if(hs(e)&&(e=e.contents),gs(e))return e;if(ds(e)){const t=n.schema[is].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"undefined"!=typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=n;let c;if(r&&e&&"object"==typeof e){if(c=a.get(e),c)return c.anchor??(c.anchor=s(e)),new Ls(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t="tag:yaml.org,2002:"+t.slice(2));let l=function(e,t,n){if(t){const e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}(e,t,o.tags);if(!l){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){const t=new qs(e);return c&&(c.node=t),t}l=e instanceof Map?o[is]:Symbol.iterator in Object(e)?o[cs]:o[is]}i&&(i(l),delete n.onTagObj);const u=l?.createNode?l.createNode(n.schema,e,n):"function"==typeof l?.nodeClass?.from?l.nodeClass.from(n.schema,e,n):new qs(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Vs(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){const n=t[e];if("number"==typeof n&&Number.isInteger(n)&&n>=0){const e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return Rs(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Gs=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class Hs extends $s{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>gs(t)||ds(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Gs(e))this.add(t);else{const[n,...r]=e,s=this.get(n,!0);if(ys(s))s.addIn(r,t);else{if(void 0!==s||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,Vs(this.schema,r,t))}}}deleteIn(e){const[t,...n]=e;if(0===n.length)return this.delete(t);const r=this.get(t,!0);if(ys(r))return r.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...r]=e,s=this.get(n,!0);return 0===r.length?!t&&fs(s)?s.value:s:ys(s)?s.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!ds(t))return!1;const n=t.value;return null==n||e&&fs(n)&&null==n.value&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){const[t,...n]=e;if(0===n.length)return this.has(t);const r=this.get(t,!0);return!!ys(r)&&r.hasIn(n)}setIn(e,t){const[n,...r]=e;if(0===r.length)this.set(n,t);else{const e=this.get(n,!0);if(ys(e))e.setIn(r,t);else{if(void 0!==e||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,Vs(this.schema,r,t))}}}}const zs=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ks(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Js=(e,t,n)=>e.endsWith("\n")?Ks(n,t):n.includes("\n")?"\n"+Ks(n,t):(e.endsWith(" ")?"":" ")+n,Ws="flow",Ys="block",Xs="quoted";function Qs(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return e;s<i&&(i=0);const c=Math.max(1+i,1+s-t.length);if(e.length<=c)return e;const l=[],u={};let h,p,d=s-t.length;"number"==typeof r&&(r>s-Math.max(2,i)?l.push(0):d=s-r);let f=!1,m=-1,y=-1,g=-1;n===Ys&&(m=Zs(e,m,t.length),-1!==m&&(d=m+c));for(let r;r=e[m+=1];){if(n===Xs&&"\\"===r){switch(y=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}g=m}if("\n"===r)n===Ys&&(m=Zs(e,m,t.length)),d=m+t.length+c,h=void 0;else{if(" "===r&&p&&" "!==p&&"\n"!==p&&"\t"!==p){const t=e[m+1];t&&" "!==t&&"\n"!==t&&"\t"!==t&&(h=m)}if(m>=d)if(h)l.push(h),d=h+c,h=void 0;else if(n===Xs){for(;" "===p||"\t"===p;)p=r,r=e[m+=1],f=!0;const t=m>g+1?m-2:y-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,h=void 0}else f=!0}p=r}if(f&&a&&a(),0===l.length)return e;o&&o();let x=e.slice(0,l[0]);for(let r=0;r<l.length;++r){const s=l[r],i=l[r+1]||e.length;0===s?x=`\n${t}${e.slice(0,i)}`:(n===Xs&&u[s]&&(x+=`${e[s]}\\`),x+=`\n${t}${e.slice(s+1,i)}`)}return x}function Zs(e,t,n){let r=t,s=t+1,i=e[s];for(;" "===i||"\t"===i;)if(t<s+n)i=e[++t];else{do{i=e[++t]}while(i&&"\n"!==i);r=t,s=t+1,i=e[s]}return r}const ei=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ti=e=>/^(%|---|\.\.\.)/m.test(e);function ni(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(ti(e)?" ":"");let o="",a=0;for(let e=0,t=n[e];t;t=n[++e])if(" "===t&&"\\"===n[e+1]&&"n"===n[e+2]&&(o+=n.slice(a,e)+"\\ ",e+=1,a=e,t="\\"),"\\"===t)switch(n[e+1]){case"u":{o+=n.slice(a,e);const t=n.substr(e+2,4);switch(t){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:"00"===t.substr(0,2)?o+="\\x"+t.substr(2):o+=n.substr(e,6)}e+=5,a=e+1}break;case"n":if(r||'"'===n[e+2]||n.length<s)e+=1;else{for(o+=n.slice(a,e)+"\n\n";"\\"===n[e+2]&&"n"===n[e+3]&&'"'!==n[e+4];)o+="\n",e+=2;o+=i," "===n[e+2]&&(o+="\\"),e+=1,a=e+1}break;default:e+=1}return o=a?o+n.slice(a):n,r?o:Qs(o,i,Xs,ei(t,!1))}function ri(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return ni(e,t);const n=t.indent||(ti(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&\n${n}`)+"'";return t.implicitKey?r:Qs(r,n,Ws,ei(t,!1))}function si(e,t){const{singleQuote:n}=t.options;let r;if(!1===n)r=ni;else{const t=e.includes('"'),s=e.includes("'");r=t&&!s?ri:s&&!t?ni:n?ri:ni}return r(e,t)}let ii;try{ii=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{ii=/\n+(?!\n|$)/g}function oi({comment:e,type:t,value:n},r,s,i){const{blockQuote:o,commentString:a,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return si(n,r);const l=r.indent||(r.forceBlockIndent||ti(n)?" ":""),u="literal"===o||"folded"!==o&&t!==qs.BLOCK_FOLDED&&(t===qs.BLOCK_LITERAL||!function(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let t=0,n=0;t<s;++t)if("\n"===e[t]){if(t-n>r)return!0;if(n=t+1,s-n<=r)return!1}return!0}(n,c,l.length));if(!n)return u?"|\n":">\n";let h,p;for(p=n.length;p>0;--p){const e=n[p-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let d=n.substring(p);const f=d.indexOf("\n");-1===f?h="-":n===d||f!==d.length-1?(h="+",i&&i()):h="",d&&(n=n.slice(0,-d.length),"\n"===d[d.length-1]&&(d=d.slice(0,-1)),d=d.replace(ii,`$&${l}`));let m,y=!1,g=-1;for(m=0;m<n.length;++m){const e=n[m];if(" "===e)y=!0;else{if("\n"!==e)break;g=m}}let x=n.substring(0,g<m?g+1:m);x&&(n=n.substring(x.length),x=x.replace(/\n+/g,`$&${l}`));let b=(y?l?"2":"1":"")+h;if(e&&(b+=" "+a(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!u){const e=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`);let s=!1;const i=ei(r,!0);"folded"!==o&&t!==qs.BLOCK_FOLDED&&(i.onOverflow=()=>{s=!0});const a=Qs(`${x}${e}${d}`,l,Ys,i);if(!s)return`>${b}\n${l}${a}`}return`|${b}\n${l}${x}${n=n.replace(/\n+/g,`$&${l}`)}${d}`}function ai(e,t,n,r){const{implicitKey:s,inFlow:i}=t,o="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==qs.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=qs.QUOTE_DOUBLE);const c=e=>{switch(e){case qs.BLOCK_FOLDED:case qs.BLOCK_LITERAL:return s||i?si(o.value,t):oi(o,t,n,r);case qs.QUOTE_DOUBLE:return ni(o.value,t);case qs.QUOTE_SINGLE:return ri(o.value,t);case qs.PLAIN:return function(e,t,n,r){const{type:s,value:i}=e,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=t;if(a&&i.includes("\n")||u&&/[[\]{},]/.test(i))return si(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes("\n")?si(i,t):oi(e,t,n,r);if(!a&&!u&&s!==qs.PLAIN&&i.includes("\n"))return oi(e,t,n,r);if(ti(i)){if(""===c)return t.forceBlockIndent=!0,oi(e,t,n,r);if(a&&c===l)return si(i,t)}const h=i.replace(/\n+/g,`$&\n${c}`);if(o){const e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(h),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return si(i,t)}return a?h:Qs(h,c,Ws,ei(t,!1))}(o,t,n,r);default:return null}};let l=c(a);if(null===l){const{defaultKeyType:e,defaultStringType:n}=t.options,r=s&&e||n;if(l=c(r),null===l)throw new Error(`Unsupported default string type ${r}`)}return l}function ci(e,t){const n=Object.assign({blockQuote:!0,commentString:zs,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:r,options:n}}function li(e,t,n,r){if(ds(e))return e.toString(t,n,r);if(us(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const i=gs(e)?e:t.doc.createNode(e,{onTagObj:e=>s=e});s??(s=function(e,t){if(t.tag){const n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(fs(t)){r=t.value;let s=e.filter(e=>e.identify?.(r));if(s.length>1){const e=s.filter(e=>e.test);e.length>0&&(s=e)}n=s.find(e=>e.format===t.format)??s.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n)throw new Error(`Tag not resolved for ${r?.constructor?.name??(null===r?"null":typeof r)} value`);return n}(t.doc.schema.tags,i));const o=function(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(fs(e)||ys(e))&&e.anchor;i&&js(i)&&(n.add(i),s.push(`&${i}`));const o=e.tag??(t.default?null:t.tag);return o&&s.push(r.directives.tagString(o)),s.join(" ")}(i,s,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const a="function"==typeof s.stringify?s.stringify(i,t,n,r):fs(i)?ai(i,t,n,r):i.toString(t,n,r);return o?fs(i)||"{"===a[0]||"["===a[0]?`${o} ${a}`:`${o}\n${t.indent}${a}`:a}const ui="<<",hi={identify:e=>e===ui||"symbol"==typeof e&&e.description===ui,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new qs(Symbol(ui)),{addToJSMap:pi}),stringify:()=>ui};function pi(e,t,n){if(n=e&&us(n)?n.resolve(e.doc):n,ms(n))for(const r of n.items)di(e,t,r);else if(Array.isArray(n))for(const r of n)di(e,t,r);else di(e,t,n)}function di(e,t,n){const r=e&&us(n)?n.resolve(e.doc):n;if(!ps(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[e,n]of s)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function fi(e,t,{key:n,value:r}){if(gs(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(((e,t)=>(hi.identify(t)||fs(t)&&(!t.type||t.type===qs.PLAIN)&&hi.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===hi.tag&&e.default))(e,n))pi(e,t,r);else{const s=Bs(n,"",e);if(t instanceof Map)t.set(s,Bs(r,s,e));else if(t instanceof Set)t.add(s);else{const i=function(e,t,n){if(null===t)return"";if("object"!=typeof t)return String(t);if(gs(e)&&n?.doc){const t=ci(n.doc,{});t.anchors=new Set;for(const e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;const i=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(i);e.length>40&&(e=e.substring(0,36)+'..."'),r=n.doc.options.logLevel,s=`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`,"debug"!==r&&"warn"!==r||console.warn(s),n.mapKeyWarned=!0}return i}var r,s;return JSON.stringify(t)}(n,s,e),o=Bs(r,i,e);i in t?Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[i]=o}}return t}function mi(e,t,n){const r=Rs(e,void 0,n),s=Rs(t,void 0,n);return new yi(r,s)}class yi{constructor(e,t=null){Object.defineProperty(this,ls,{value:os}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return gs(t)&&(t=t.clone(e)),gs(n)&&(n=n.clone(e)),new yi(t,n)}toJSON(e,t){return fi(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?function({key:e,value:t},n,r,s){const{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:h}}=n;let p=gs(e)&&e.comment||null;if(h){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(ys(e)||!gs(e)&&"object"==typeof e)throw new Error("With simple keys, collection cannot be used as a key value")}let d=!h&&(!e||p&&null==t&&!n.inFlow||ys(e)||(fs(e)?e.type===qs.BLOCK_FOLDED||e.type===qs.BLOCK_LITERAL:"object"==typeof e));n=Object.assign({},n,{allNullValues:!1,implicitKey:!d&&(h||!i),indent:a+c});let f,m,y,g=!1,x=!1,b=li(e,n,()=>g=!0,()=>x=!0);if(!d&&!n.inFlow&&b.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");d=!0}if(n.inFlow){if(i||null==t)return g&&r&&r(),""===b?"?":d?`? ${b}`:b}else if(i&&!h||null==t&&d)return b=`? ${b}`,p&&!g?b+=Js(b,n.indent,l(p)):x&&s&&s(),b;g&&(p=null),d?(p&&(b+=Js(b,n.indent,l(p))),b=`? ${b}\n${a}:`):(b=`${b}:`,p&&(b+=Js(b,n.indent,l(p)))),gs(t)?(f=!!t.spaceBefore,m=t.commentBefore,y=t.comment):(f=!1,m=null,y=null,t&&"object"==typeof t&&(t=o.createNode(t))),n.implicitKey=!1,d||p||!fs(t)||(n.indentAtStart=b.length+1),x=!1,u||!(c.length>=2)||n.inFlow||d||!ms(t)||t.flow||t.tag||t.anchor||(n.indent=n.indent.substring(2));let w=!1;const v=li(t,n,()=>w=!0,()=>x=!0);let k=" ";if(p||f||m)k=f?"\n":"",m&&(k+=`\n${Ks(l(m),n.indent)}`),""!==v||n.inFlow?k+=`\n${n.indent}`:"\n"===k&&y&&(k="\n\n");else if(!d&&ys(t)){const e=v[0],r=v.indexOf("\n"),s=-1!==r,i=n.inFlow??t.flow??0===t.items.length;if(s||!i){let t=!1;if(s&&("&"===e||"!"===e)){let n=v.indexOf(" ");"&"===e&&-1!==n&&n<r&&"!"===v[n+1]&&(n=v.indexOf(" ",n+1)),(-1===n||r<n)&&(t=!0)}t||(k=`\n${n.indent}`)}}else""!==v&&"\n"!==v[0]||(k="");return b+=k+v,n.inFlow?w&&r&&r():y&&!w?b+=Js(b,n.indent,l(y)):x&&s&&s(),b}(this,e,t,n):JSON.stringify(this)}}function gi(e,t,n){return(t.inFlow??e.flow?bi:xi)(e,t,n)}function xi({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){const{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:i,type:null});let h=!1;const p=[];for(let e=0;e<t.length;++e){const s=t[e];let o=null;if(gs(s))!h&&s.spaceBefore&&p.push(""),wi(n,p,s.commentBefore,h),s.comment&&(o=s.comment);else if(ds(s)){const e=gs(s.key)?s.key:null;e&&(!h&&e.spaceBefore&&p.push(""),wi(n,p,e.commentBefore,h))}h=!1;let a=li(s,u,()=>o=null,()=>h=!0);o&&(a+=Js(a,i,l(o))),h&&o&&(h=!1),p.push(r+a)}let d;if(0===p.length)d=s.start+s.end;else{d=p[0];for(let e=1;e<p.length;++e){const t=p[e];d+=t?`\n${c}${t}`:"\n"}}return e?(d+="\n"+Ks(l(e),c),a&&a()):h&&o&&o(),d}function bi({items:e},t,{flowChars:n,itemIndent:r}){const{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=t;r+=i;const c=Object.assign({},t,{indent:r,inFlow:!0,type:null});let l=!1,u=0;const h=[];for(let n=0;n<e.length;++n){const s=e[n];let i=null;if(gs(s))s.spaceBefore&&h.push(""),wi(t,h,s.commentBefore,!1),s.comment&&(i=s.comment);else if(ds(s)){const e=gs(s.key)?s.key:null;e&&(e.spaceBefore&&h.push(""),wi(t,h,e.commentBefore,!1),e.comment&&(l=!0));const n=gs(s.value)?s.value:null;n?(n.comment&&(i=n.comment),n.commentBefore&&(l=!0)):null==s.value&&e?.comment&&(i=e.comment)}i&&(l=!0);let o=li(s,c,()=>i=null);n<e.length-1&&(o+=","),i&&(o+=Js(o,r,a(i))),!l&&(h.length>u||o.includes("\n"))&&(l=!0),h.push(o),u=h.length}const{start:p,end:d}=n;if(0===h.length)return p+d;if(!l){const e=h.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=p;for(const t of h)e+=t?`\n${i}${s}${t}`:"\n";return`${e}\n${s}${d}`}return`${p}${o}${h.join(" ")}${o}${d}`}function wi({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const s=Ks(t(r),e);n.push(s.trimStart())}}function vi(e,t){const n=fs(t)?t.value:t;for(const r of e)if(ds(r)){if(r.key===t||r.key===n)return r;if(fs(r.key)&&r.key.value===n)return r}}class ki extends Hs{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(is,e),this.items=[]}static from(e,t,n){const{keepUndefined:r,replacer:s}=n,i=new this(e),o=(e,o)=>{if("function"==typeof s)o=s.call(t,e,o);else if(Array.isArray(s)&&!s.includes(e))return;(void 0!==o||r)&&i.items.push(mi(e,o,n))};if(t instanceof Map)for(const[e,n]of t)o(e,n);else if(t&&"object"==typeof t)for(const e of Object.keys(t))o(e,t[e]);return"function"==typeof e.sortMapEntries&&i.items.sort(e.sortMapEntries),i}add(e,t){let n;n=ds(e)?e:e&&"object"==typeof e&&"key"in e?new yi(e.key,e.value):new yi(e,e?.value);const r=vi(this.items,n.key),s=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${n.key} already set`);fs(r.value)&&Us(n.value)?r.value.value=n.value:r.value=n.value}else if(s){const e=this.items.findIndex(e=>s(n,e)<0);-1===e?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){const t=vi(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=vi(this.items,e),r=n?.value;return(!t&&fs(r)?r.value:r)??void 0}has(e){return!!vi(this.items,e)}set(e,t){this.add(new yi(e,t),!0)}toJSON(e,t,n){const r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(const e of this.items)fi(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(const e of this.items)if(!ds(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),gi(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const Si={collection:"map",default:!0,nodeClass:ki,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(ps(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,n)=>ki.from(e,t,n)};class Oi extends Hs{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(cs,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=Ei(e);if("number"!=typeof t)return!1;return this.items.splice(t,1).length>0}get(e,t){const n=Ei(e);if("number"!=typeof n)return;const r=this.items[n];return!t&&fs(r)?r.value:r}has(e){const t=Ei(e);return"number"==typeof t&&t<this.items.length}set(e,t){const n=Ei(e);if("number"!=typeof n)throw new Error(`Expected a valid index, not ${e}.`);const r=this.items[n];fs(r)&&Us(t)?r.value=t:this.items[n]=t}toJSON(e,t){const n=[];t?.onCreate&&t.onCreate(n);let r=0;for(const e of this.items)n.push(Bs(e,String(r++),t));return n}toString(e,t,n){return e?gi(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){const{replacer:r}=n,s=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let i of t){if("function"==typeof r){const n=t instanceof Set?i:String(e++);i=r.call(t,n,i)}s.items.push(Rs(i,void 0,n))}}return s}}function Ei(e){let t=fs(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}const Ai={collection:"seq",default:!0,nodeClass:Oi,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(ms(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,n)=>Oi.from(e,t,n)},_i={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,n,r)=>ai(e,t=Object.assign({actualString:!0},t),n,r)},Ii={identify:e=>null==e,createNode:()=>new qs(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new qs(null),stringify:({source:e},t)=>"string"==typeof e&&Ii.test.test(e)?e:t.options.nullStr},Ti={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new qs("t"===e[0]||"T"===e[0]),stringify({source:e,value:t},n){if(e&&Ti.test.test(e)){if(t===("t"===e[0]||"T"===e[0]))return e}return t?n.options.trueStr:n.options.falseStr}};function Mi({format:e,minFractionDigits:t,tag:n,value:r}){if("bigint"==typeof r)return String(r);const s="number"==typeof r?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(i)){let e=i.indexOf(".");e<0&&(e=i.length,i+=".");let n=t-(i.length-e-1);for(;n-- >0;)i+="0"}return i}const Ci={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Mi},ji={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Mi(e)}},Ni={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new qs(parseFloat(e)),n=e.indexOf(".");return-1!==n&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-n-1),t},stringify:Mi},Fi=e=>"bigint"==typeof e||Number.isInteger(e),Di=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function Bi(e,t,n){const{value:r}=e;return Fi(r)&&r>=0?n+r.toString(t):Mi(e)}const $i={identify:e=>Fi(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Di(e,2,8,n),stringify:e=>Bi(e,8,"0o")},Li={identify:Fi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Di(e,0,10,n),stringify:Mi},Pi={identify:e=>Fi(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Di(e,2,16,n),stringify:e=>Bi(e,16,"0x")},Ui=[Si,Ai,_i,Ii,Ti,$i,Li,Pi,Ci,ji,Ni];function qi(e){return"bigint"==typeof e||Number.isInteger(e)}const Ri=({value:e})=>JSON.stringify(e),Vi=[Si,Ai].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Ri},{identify:e=>null==e,createNode:()=>new qs(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ri},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:Ri},{identify:qi,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>qi(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Ri}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),Gi={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if("function"==typeof atob){const t=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,s,i){if(!n)return"";const o=n;let a;if("function"!=typeof btoa)throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");{let e="";for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);a=btoa(e)}if(t??(t=qs.BLOCK_LITERAL),t!==qs.QUOTE_DOUBLE){const e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(a.length/e),s=new Array(n);for(let t=0,r=0;t<n;++t,r+=e)s[t]=a.substr(r,e);a=s.join(t===qs.BLOCK_LITERAL?"\n":" ")}return ai({comment:e,type:t,value:a},r,s,i)}};function Hi(e,t){if(ms(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!ds(r)){if(ps(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const e=r.items[0]||new yi(new qs(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){const t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=ds(r)?r:new yi(r)}}else t("Expected a sequence for this tag");return e}function zi(e,t,n){const{replacer:r}=n,s=new Oi(e);s.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let o,a;if("function"==typeof r&&(e=r.call(t,String(i++),e)),Array.isArray(e)){if(2!==e.length)throw new TypeError(`Expected [key, value] tuple: ${e}`);o=e[0],a=e[1]}else if(e&&e instanceof Object){const t=Object.keys(e);if(1!==t.length)throw new TypeError(`Expected tuple with one key, not ${t.length} keys`);o=t[0],a=e[o]}else o=e;s.items.push(mi(o,a,n))}return s}const Ki={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Hi,createNode:zi};class Ji extends Oi{constructor(){super(),this.add=ki.prototype.add.bind(this),this.delete=ki.prototype.delete.bind(this),this.get=ki.prototype.get.bind(this),this.has=ki.prototype.has.bind(this),this.set=ki.prototype.set.bind(this),this.tag=Ji.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t?.onCreate&&t.onCreate(n);for(const e of this.items){let r,s;if(ds(e)?(r=Bs(e.key,"",t),s=Bs(e.value,r,t)):r=Bs(e,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,s)}return n}static from(e,t,n){const r=zi(e,t,n),s=new this;return s.items=r.items,s}}Ji.tag="tag:yaml.org,2002:omap";const Wi={collection:"seq",identify:e=>e instanceof Map,nodeClass:Ji,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Hi(e,t),r=[];for(const{key:e}of n.items)fs(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new Ji,n)},createNode:(e,t,n)=>Ji.from(e,t,n)};function Yi({value:e,source:t},n){return t&&(e?Xi:Qi).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Xi={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new qs(!0),stringify:Yi},Qi={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new qs(!1),stringify:Yi},Zi={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Mi},eo={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Mi(e)}},to={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new qs(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(-1!==n){const r=e.substring(n+1).replace(/_/g,"");"0"===r[r.length-1]&&(t.minFractionDigits=r.length)}return t},stringify:Mi},no=e=>"bigint"==typeof e||Number.isInteger(e);function ro(e,t,n,{intAsBigInt:r}){const s=e[0];if("-"!==s&&"+"!==s||(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}const t=BigInt(e);return"-"===s?BigInt(-1)*t:t}const i=parseInt(e,n);return"-"===s?-1*i:i}function so(e,t,n){const{value:r}=e;if(no(r)){const e=r.toString(t);return r<0?"-"+n+e.substr(1):n+e}return Mi(e)}const io={identify:no,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>ro(e,2,2,n),stringify:e=>so(e,2,"0b")},oo={identify:no,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>ro(e,1,8,n),stringify:e=>so(e,8,"0")},ao={identify:no,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>ro(e,0,10,n),stringify:Mi},co={identify:no,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>ro(e,2,16,n),stringify:e=>so(e,16,"0x")};class lo extends ki{constructor(e){super(e),this.tag=lo.tag}add(e){let t;t=ds(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new yi(e.key,null):new yi(e,null);vi(this.items,t.key)||this.items.push(t)}get(e,t){const n=vi(this.items,e);return!t&&ds(n)?fs(n.key)?n.key.value:n.key:n}set(e,t){if("boolean"!=typeof t)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof t);const n=vi(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new yi(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){const{replacer:r}=n,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof r&&(e=r.call(t,e,e)),s.items.push(mi(e,null,n));return s}}lo.tag="tag:yaml.org,2002:set";const uo={collection:"map",identify:e=>e instanceof Set,nodeClass:lo,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>lo.from(e,t,n),resolve(e,t){if(ps(e)){if(e.hasAllNullValues(!0))return Object.assign(new lo,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function ho(e,t){const n=e[0],r="-"===n||"+"===n?e.substring(1):e,s=e=>t?BigInt(e):Number(e),i=r.replace(/_/g,"").split(":").reduce((e,t)=>e*s(60)+s(t),s(0));return"-"===n?s(-1)*i:i}function po(e){let{value:t}=e,n=e=>e;if("bigint"==typeof t)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Mi(e);let r="";t<0&&(r="-",t*=n(-1));const s=n(60),i=[t%s];return t<60?i.unshift(0):(t=(t-i[0])/s,i.unshift(t%s),t>=60&&(t=(t-i[0])/s,i.unshift(t))),r+i.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const fo={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>ho(e,n),stringify:po},mo={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>ho(e,!1),stringify:po},yo={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(yo.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,o,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let l=Date.UTC(n,r-1,s,i||0,o||0,a||0,c);const u=t[8];if(u&&"Z"!==u){let e=ho(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},go=[Si,Ai,_i,Ii,Xi,Qi,io,oo,ao,co,Zi,eo,to,Gi,hi,Wi,Ki,uo,fo,mo,yo],xo=new Map([["core",Ui],["failsafe",[Si,Ai,_i]],["json",Vi],["yaml11",go],["yaml-1.1",go]]),bo={binary:Gi,bool:Ti,float:Ni,floatExp:ji,floatNaN:Ci,floatTime:mo,int:Li,intHex:Pi,intOct:$i,intTime:fo,map:Si,merge:hi,null:Ii,omap:Wi,pairs:Ki,seq:Ai,set:uo,timestamp:yo},wo={"tag:yaml.org,2002:binary":Gi,"tag:yaml.org,2002:merge":hi,"tag:yaml.org,2002:omap":Wi,"tag:yaml.org,2002:pairs":Ki,"tag:yaml.org,2002:set":uo,"tag:yaml.org,2002:timestamp":yo};function vo(e,t,n){const r=xo.get(t);if(r&&!e)return n&&!r.includes(hi)?r.concat(hi):r.slice();let s=r;if(!s){if(!Array.isArray(e)){const e=Array.from(xo.keys()).filter(e=>"yaml11"!==e).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}s=[]}if(Array.isArray(e))for(const t of e)s=s.concat(t);else"function"==typeof e&&(s=e(s.slice()));return n&&(s=s.concat(hi)),s.reduce((e,t)=>{const n="string"==typeof t?bo[t]:t;if(!n){const e=JSON.stringify(t),n=Object.keys(bo).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}const ko=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class So{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:s,sortMapEntries:i,toStringDefaults:o}){this.compat=Array.isArray(e)?vo(e,"compat"):e?vo(null,e):null,this.name="string"==typeof s&&s||"core",this.knownTags=r?wo:{},this.tags=vo(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,is,{value:Si}),Object.defineProperty(this,as,{value:_i}),Object.defineProperty(this,cs,{value:Ai}),this.sortMapEntries="function"==typeof i?i:!0===i?ko:null}clone(){const e=Object.create(So.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}class Oo{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ls,{value:ss});let r=null;"function"==typeof t||Array.isArray(t)?r=t:void 0===n&&t&&(n=t,t=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:i}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(i=this.directives.yaml.version)):this.directives=new Cs({version:i}),this.setSchema(i,n),this.contents=void 0===e?null:this.createNode(e,r,n)}clone(){const e=Object.create(Oo.prototype,{[ls]:{value:ss}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=gs(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Eo(this.contents)&&this.contents.add(e)}addIn(e,t){Eo(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=Ns(this);e.anchor=!t||n.has(t)?Fs(t||"a",n):t}return new Ls(e.anchor)}createNode(e,t,n){let r;if("function"==typeof t)e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){const e=e=>"number"==typeof e||e instanceof String||e instanceof Number,n=t.filter(e).map(String);n.length>0&&(t=t.concat(n)),r=t}else void 0===n&&t&&(n=t,t=void 0);const{aliasDuplicateObjects:s,anchorPrefix:i,flow:o,keepUndefined:a,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:h,sourceObjects:p}=function(e,t){const n=[],r=new Map;let s=null;return{onAnchor:r=>{n.push(r),s??(s=Ns(e));const i=Fs(t,s);return s.add(i),i},setAnchors:()=>{for(const e of n){const t=r.get(e);if("object"!=typeof t||!t.anchor||!fs(t.node)&&!ys(t.node)){const t=new Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}t.node.anchor=t.anchor}},sourceObjects:r}}(this,i||"a"),d=Rs(e,l,{aliasDuplicateObjects:s??!0,keepUndefined:a??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:p});return o&&ys(d)&&(d.flow=!0),h(),d}createPair(e,t,n={}){const r=this.createNode(e,null,n),s=this.createNode(t,null,n);return new yi(r,s)}delete(e){return!!Eo(this.contents)&&this.contents.delete(e)}deleteIn(e){return Gs(e)?null!=this.contents&&(this.contents=null,!0):!!Eo(this.contents)&&this.contents.deleteIn(e)}get(e,t){return ys(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Gs(e)?!t&&fs(this.contents)?this.contents.value:this.contents:ys(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!ys(this.contents)&&this.contents.has(e)}hasIn(e){return Gs(e)?void 0!==this.contents:!!ys(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=Vs(this.schema,[e],t):Eo(this.contents)&&this.contents.set(e,t)}setIn(e,t){Gs(e)?this.contents=t:null==this.contents?this.contents=Vs(this.schema,Array.from(e),t):Eo(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){let n;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Cs({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Cs({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else{if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new So(Object.assign(n,t))}}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){const o={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},a=Bs(this.contents,t??"",o);if("function"==typeof s)for(const{count:e,res:t}of o.anchors.values())s(t,e);return"function"==typeof i?Ds(i,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return function(e,t){const n=[];let r=!0===t.directives;if(!1!==t.directives&&e.directives){const t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const s=ci(e,t),{commentString:i}=s.options;if(e.commentBefore){1!==n.length&&n.unshift("");const t=i(e.commentBefore);n.unshift(Ks(t,""))}let o=!1,a=null;if(e.contents){if(gs(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const t=i(e.contents.commentBefore);n.push(Ks(t,""))}s.forceBlockIndent=!!e.comment,a=e.contents.comment}const t=a?void 0:()=>o=!0;let c=li(e.contents,s,()=>a=null,t);a&&(c+=Js(c,"",i(a))),"|"!==c[0]&&">"!==c[0]||"---"!==n[n.length-1]?n.push(c):n[n.length-1]=`--- ${c}`}else n.push(li(e.contents,s));if(e.directives?.docEnd)if(e.comment){const t=i(e.comment);t.includes("\n")?(n.push("..."),n.push(Ks(t,""))):n.push(`... ${t}`)}else n.push("...");else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,"")),t&&(o&&!a||""===n[n.length-1]||n.push(""),n.push(Ks(i(t),"")))}return n.join("\n")+"\n"}(this,e)}}function Eo(e){if(ys(e))return!0;throw new Error("Expected a YAML collection as document contents")}Error;const Ao=Symbol("break visit"),_o=Symbol("skip children"),Io=Symbol("remove item");function To(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),Mo(Object.freeze([]),e,t)}function Mo(e,t,n){let r=n(t,e);if("symbol"==typeof r)return r;for(const s of["key","value"]){const i=t[s];if(i&&"items"in i){for(let t=0;t<i.items.length;++t){const r=Mo(Object.freeze(e.concat([[s,t]])),i.items[t],n);if("number"==typeof r)t=r-1;else{if(r===Ao)return Ao;r===Io&&(i.items.splice(t,1),t-=1)}}"function"==typeof r&&"key"===s&&(r=r(t,e))}}return"function"==typeof r?r(t,e):r}To.BREAK=Ao,To.SKIP=_o,To.REMOVE=Io,To.itemAtPath=(e,t)=>{let n=e;for(const[e,r]of t){const t=n?.[e];if(!t||!("items"in t))return;n=t.items[r]}return n},To.parentCollection=(e,t)=>{const n=To.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],s=n?.[r];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};new Set("0123456789ABCDEFabcdef"),new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),new Set(",[]{}"),new Set(" ,[]{}\n\r\t");const Co=(e,{directive:t=!1,aliasDuplicateObjects:n=!1,...r}={})=>{const s={aliasDuplicateObjects:n,...r};if(t){const t=new Oo(ts(e),s);return t.directives.yaml.explicit=!0,t.toString(s)}return function(e,t,n){let r=null;if("function"==typeof t||Array.isArray(t)?r=t:void 0===n&&t&&(n=t),"string"==typeof n&&(n=n.length),"number"==typeof n){const e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){const{keepUndefined:e}=n??t??{};if(!e)return}return hs(e)&&!r?e.toString(n):new Oo(e,r,n).toString(n)}(ts(e),s)},jo=(e,t=or)=>t.toRefract(e),No=(e,t=or)=>{const n=jo(e,t);return JSON.stringify(n)},Fo=e=>{let t="",n=0;return An(e,{enter(e){const{element:r}=e.node,s=r.charAt(0).toUpperCase()+r.slice(1),i=" ".repeat(n);t+=n>0?"\n":"",t+=`${i}(${s}Element`,n+=1},leave(){n-=1,t+=")"}}),t},Do=e=>{const t=e.isMetaEmpty?void 0:hn(e.meta),n=e.isAttributesEmpty?void 0:hn(e.attributes);return new e.constructor(void 0,t,n)},Bo=(e,t)=>t.clone&&t.isMergeableElement(e)?Lo(Do(e),e,t):e,$o={clone:!0,isMergeableElement:e=>V(e)||R(e),arrayElementMerge:(e,t,n)=>new(0,e.constructor)(e.concat(t).map(e=>Bo(e,n))),objectElementMerge:(e,t,n)=>{const r=V(e)?Do(e):Do(t);return V(e)&&e.forEach((e,t,s)=>{const i=fn(s);i.value=Bo(e,n),r.content.push(i)}),t.forEach((t,s,i)=>{const o=ts(s);let a;if(V(e)&&e.hasKey(o)&&n.isMergeableElement(t)){const r=e.get(o);a=fn(i),a.value=((e,t)=>{if("function"!=typeof t.customMerge)return Lo;const n=t.customMerge(e,t);return"function"==typeof n?n:Lo})(s,n)(r,t,n)}else a=fn(i),a.value=Bo(t,n);r.remove(o),r.content.push(a)}),r},customMerge:void 0,customMetaMerge:void 0,customAttributesMerge:void 0},Lo=(e,t,n)=>{const r={...$o,...n};r.isMergeableElement=r.isMergeableElement??$o.isMergeableElement,r.arrayElementMerge=r.arrayElementMerge??$o.arrayElementMerge,r.objectElementMerge=r.objectElementMerge??$o.objectElementMerge;const s=R(t);if(!(s===R(e)))return Bo(t,r);const i=s&&"function"==typeof r.arrayElementMerge?r.arrayElementMerge(e,t,r):r.objectElementMerge(e,t,r);return i.meta=(e=>"function"!=typeof e.customMetaMerge?e=>hn(e):e.customMetaMerge)(r)(e.meta,t.meta),i.attributes=(e=>"function"!=typeof e.customAttributesMerge?e=>hn(e):e.customAttributesMerge)(r)(e.attributes,t.attributes),i};Lo.all=(e,t)=>{if(!Array.isArray(e))throw new TypeError("First argument of deepmerge should be an array.");return 0===e.length?new B:e.reduce((e,n)=>Lo(e,n,t),Do(e[0]))};const Po=Lo,Uo=(e,t,n)=>{const r={...$o,...n,customMerge:()=>(e,t)=>t,clone:!1};return Po(e,t,r)};Uo.all=(e,t)=>{if(!Array.isArray(e))throw new TypeError("First argument of mergeRight should be an array.");return 0===e.length?new B:e.reduce((e,n)=>Uo(e,n,t),Do(e[0]))};const qo=Uo,Ro=(...[e,t,n])=>qo(t,e,n);Ro.all=(...[e,t])=>qo.all([...e].reverse(),t);const Vo=Ro;function Go(e,t){const n=(e instanceof _?e.constructor:e).fixedFields??[];return t?.indexed?Object.fromEntries(n.map(e=>[e.name,e])):n}return r})());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@speclynx/apidom-core",
3
- "version": "2.10.2",
3
+ "version": "2.11.0",
4
4
  "description": "Tools for manipulating ApiDOM structures.",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -40,9 +40,9 @@
40
40
  "license": "Apache-2.0",
41
41
  "dependencies": {
42
42
  "@babel/runtime-corejs3": "^7.28.4",
43
- "@speclynx/apidom-datamodel": "^2.10.2",
44
- "@speclynx/apidom-error": "^2.10.2",
45
- "@speclynx/apidom-traverse": "^2.10.2",
43
+ "@speclynx/apidom-datamodel": "^2.11.0",
44
+ "@speclynx/apidom-error": "^2.11.0",
45
+ "@speclynx/apidom-traverse": "^2.11.0",
46
46
  "ramda": "~0.32.0",
47
47
  "ramda-adjunct": "^6.0.0",
48
48
  "short-unique-id": "^5.3.2",
@@ -59,5 +59,5 @@
59
59
  "README.md",
60
60
  "CHANGELOG.md"
61
61
  ],
62
- "gitHead": "13e4768403e45eb996509a423b0e0b3833c31fc1"
62
+ "gitHead": "ee7e9488621be61f5dc1b098b8af135dc83c9ac1"
63
63
  }