@speclynx/apidom-core 4.0.4 → 4.0.5

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,10 @@
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
+ ## [4.0.5](https://github.com/speclynx/apidom/compare/v4.0.4...v4.0.5) (2026-03-13)
7
+
8
+ **Note:** Version bump only for package @speclynx/apidom-core
9
+
6
10
  ## [4.0.4](https://github.com/speclynx/apidom/compare/v4.0.3...v4.0.4) (2026-03-12)
7
11
 
8
12
  ### Bug Fixes
@@ -29082,9 +29082,9 @@ const mergeVisitors = (visitors, options = {}) => {
29082
29082
  }
29083
29083
 
29084
29084
  // Handle path-based control flow
29085
+ // Note: no break here — other merged visitors must still process this node
29085
29086
  if (proxyPath.shouldStop) {
29086
29087
  skipping[i] = breakSymbol;
29087
- break;
29088
29088
  }
29089
29089
  if (proxyPath.shouldSkip) {
29090
29090
  skipping[i] = currentNode;
@@ -29115,6 +29115,11 @@ const mergeVisitors = (visitors, options = {}) => {
29115
29115
  }
29116
29116
  }
29117
29117
  }
29118
+
29119
+ // stop traversal only when all visitors have stopped
29120
+ if (skipping.every(s => s === breakSymbol)) {
29121
+ path.stop();
29122
+ }
29118
29123
  if (hasChanged) {
29119
29124
  path.replaceWith(currentNode);
29120
29125
  return currentNode;
@@ -29140,9 +29145,9 @@ const mergeVisitors = (visitors, options = {}) => {
29140
29145
  }
29141
29146
 
29142
29147
  // Handle path-based control flow
29148
+ // Note: no break here — other merged visitors must still process this node
29143
29149
  if (proxyPath.shouldStop) {
29144
29150
  skipping[i] = breakSymbol;
29145
- break;
29146
29151
  }
29147
29152
  if (proxyPath.removed) {
29148
29153
  path.remove();
@@ -29162,6 +29167,11 @@ const mergeVisitors = (visitors, options = {}) => {
29162
29167
  skipping[i] = internalSkipSymbol;
29163
29168
  }
29164
29169
  }
29170
+
29171
+ // stop traversal only when all visitors have stopped
29172
+ if (skipping.every(s => s === breakSymbol)) {
29173
+ path.stop();
29174
+ }
29165
29175
  return undefined;
29166
29176
  }
29167
29177
  };
@@ -29190,9 +29200,11 @@ const mergeVisitorsAsync = (visitors, options = {}) => {
29190
29200
  if (typeof visitFn === 'function') {
29191
29201
  const proxyPath = createPathProxy(path, currentNode);
29192
29202
  const result = await visitFn.call(visitors[i], proxyPath);
29203
+
29204
+ // Handle path-based control flow
29205
+ // Note: no break here — other merged visitors must still process this node
29193
29206
  if (proxyPath.shouldStop) {
29194
29207
  skipping[i] = breakSymbol;
29195
- break;
29196
29208
  }
29197
29209
  if (proxyPath.shouldSkip) {
29198
29210
  skipping[i] = currentNode;
@@ -29222,6 +29234,11 @@ const mergeVisitorsAsync = (visitors, options = {}) => {
29222
29234
  }
29223
29235
  }
29224
29236
  }
29237
+
29238
+ // stop traversal only when all visitors have stopped
29239
+ if (skipping.every(s => s === breakSymbol)) {
29240
+ path.stop();
29241
+ }
29225
29242
  if (hasChanged) {
29226
29243
  path.replaceWith(currentNode);
29227
29244
  return currentNode;
@@ -29236,9 +29253,11 @@ const mergeVisitorsAsync = (visitors, options = {}) => {
29236
29253
  if (typeof visitFn === 'function') {
29237
29254
  const proxyPath = createPathProxy(path, currentNode);
29238
29255
  const result = await visitFn.call(visitors[i], proxyPath);
29256
+
29257
+ // Handle path-based control flow
29258
+ // Note: no break here — other merged visitors must still process this node
29239
29259
  if (proxyPath.shouldStop) {
29240
29260
  skipping[i] = breakSymbol;
29241
- break;
29242
29261
  }
29243
29262
  if (proxyPath.removed) {
29244
29263
  path.remove();
@@ -29257,6 +29276,11 @@ const mergeVisitorsAsync = (visitors, options = {}) => {
29257
29276
  skipping[i] = internalSkipSymbol;
29258
29277
  }
29259
29278
  }
29279
+
29280
+ // stop traversal only when all visitors have stopped
29281
+ if (skipping.every(s => s === breakSymbol)) {
29282
+ path.stop();
29283
+ }
29260
29284
  return undefined;
29261
29285
  }
29262
29286
  };
@@ -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:()=>kr,IdentityManager:()=>Or,MediaTypes:()=>Tr,Transcluder:()=>Fr,createToolbox:()=>gr,deepmerge:()=>Zo,defaultIdentityManager:()=>Sr,dehydrate:()=>zo,dispatchRefractorPlugins:()=>xr,fixedFields:()=>sa,from:()=>ls,mergeLeft:()=>ra,mergeRight:()=>ta,refractorPluginElementIdentity:()=>Er,refractorPluginSemanticElementIdentity:()=>Ar,resolveSpecification:()=>cs,sexprs:()=>Jo,toJSON:()=>ps,toString:()=>Ko,toValue:()=>us,toYAML:()=>Ho,transclude:()=>Dr});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 b=g;const x=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=x(e);if(s!==x(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=b(e);if(o.length!==b(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,[],[])});function O(e,t,n){if(n||(n=new S),function(e){var t=typeof e;return null==e||"object"!=t&&"function"!=t}(e))return e;var r,s=function(r){var s=n.get(e);if(s)return s;for(var i in n.set(e,r),e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=t?O(e[i],!0,n):e[i]);return r};switch(x(e)){case"Object":return s(Object.create(Object.getPrototypeOf(e)));case"Array":return s(Array(e.length));case"Date":return new Date(e.valueOf());case"RegExp":return r=e,new RegExp(r.source,r.flags?r.flags:(r.global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.sticky?"y":"")+(r.unicode?"u":"")+(r.dotAll?"s":""));case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return e.slice();default:return e}}var S=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){var n=this.hash(e),r=this.map[n];r||(this.map[n]=r=[]),r.push([e,t]),this.length+=1},e.prototype.hash=function(e){var t=[];for(var n in e)t.push(Object.prototype.toString.call(e[n]));return t.join()},e.prototype.get=function(e){if(this.length<=180)for(var t in this.map)for(var n=this.map[t],r=0;r<n.length;r+=1){if((i=n[r])[0]===e)return i[1]}else{var s=this.hash(e);if(n=this.map[s])for(r=0;r<n.length;r+=1){var i;if((i=n[r])[0]===e)return i[1]}}},e}();const E=i(function(e){return null!=e&&"function"==typeof e.clone?e.clone():O(e,!0)});class A{get(e){return this[e]}set(e,t){this[e]=t}hasKey(e){return Object.hasOwn(this,e)}keys(){return Object.keys(this)}remove(e){delete this[e]}get isEmpty(){return 0===Object.keys(this).length}get isFrozen(){return Object.isFrozen(this)}freeze(){for(const e of Object.values(this))e instanceof this.Element?e.freeze():(Array.isArray(e)||null!==e&&"object"==typeof e)&&Object.freeze(e);Object.freeze(this)}cloneShallow(){const e=new A;return Object.assign(e,this),e}merge(e){const t=this.cloneShallow();for(const[n,r]of Object.entries(e)){const e=t.get(n);Array.isArray(e)&&Array.isArray(r)?t.set(n,[...e,...r]):t.set(n,r)}return t}cloneDeep(){const e=new A;for(const[t,n]of Object.entries(this))n instanceof this.Element?e.set(t,this.cloneDeepElement(n)):e.set(t,E(n));return e}}const _=A;const I=class{key;value;constructor(e,t){this.key=e,this.value=t}toValue(){return{key:this.key?.toValue(),value:this.value?.toValue()}}};class T{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 T(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 T(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 C=T,j=Object.freeze(new _);class M{parent;style;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 M)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 I)this._content=e;else if(e instanceof C)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)return j;this._meta=new _}return this._meta}set meta(e){if(e instanceof _)this._meta=e;else if(e&&"object"==typeof e){const t=new _;Object.assign(t,e),this._meta=t}}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 M?this._attributes=e:this.attributes.set(e??{})}get id(){if(!this.hasMetaProperty("id")){if(this.isFrozen)return"";this.setMetaProperty("id","")}return this.meta.get("id")}set id(e){this.setMetaProperty("id",e)}get classes(){if(!this.hasMetaProperty("classes")){if(this.isFrozen)return[];this.setMetaProperty("classes",[])}return this.meta.get("classes")}set classes(e){this.setMetaProperty("classes",e)}get links(){if(!this.hasMetaProperty("links")){if(this.isFrozen){const e=new this.ArrayElement;return e.freeze(),e}this.setMetaProperty("links",new this.ArrayElement)}return 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 I){const t=[];return e.key&&t.push(e.key),e.value&&t.push(e.value),t}return e instanceof M?[e]:[]}get isFrozen(){return Object.isFrozen(this)}freeze(){if(!this.isFrozen){this._meta&&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 M||e instanceof I?e.toValue():Array.isArray(e)?e.map(e=>e.toValue()):e}equals(e){const t=e instanceof M?e.toValue():e;return k(this.toValue(),t)}primitive(){}set(e){return this.content=e,this}toRef(e){const t=this.id;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){return this.hasMetaProperty(e)?this.meta.get(e):t}setMetaProperty(e,t){this.meta.set(e,t)}hasMetaProperty(e){return void 0!==this._meta&&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 N=M;const D=class extends N{constructor(e,t,n){super(e,t,n),this.element="string"}primitive(){return"string"}get length(){return this.content?.length??0}};const F=class extends N{constructor(e,t,n){super(e,t,n),this.element="number"}primitive(){return"number"}};const B=class extends N{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 $=class extends N{constructor(e,t,n){super(e,t,n),this.element="boolean"}primitive(){return"boolean"}};class L extends N{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===e).first}concat(e){return new(0,this.constructor)(this._content.concat(e._content))}[Symbol.iterator](){return this._content[Symbol.iterator]()}}const P=L;const U=class extends P{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 q=class extends N{constructor(e,t,n,r){super(new I,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 R=class extends P{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 q(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 C(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 C(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([])}},V=e=>e instanceof N,G=e=>e instanceof D,H=e=>e instanceof F,z=e=>e instanceof B,K=e=>e instanceof $,J=e=>e instanceof U,W=e=>e instanceof R,X=e=>e instanceof q,Y=e=>W(e)&&"object"===e.element||J(e)&&"array"===e.element||K(e)&&"boolean"===e.element||H(e)&&"number"===e.element||G(e)&&"string"===e.element||z(e)&&"null"===e.element||X(e)&&"member"===e.element,Q=function(){const e=ee,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,b,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 O=b.toLowerCase();let S;for(const e in s)if(s.hasOwnProperty(e)&&O===s[e].lower){S=s[e].index;break}if(void 0===S)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:S}],x(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}`)}},b=(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 b=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,b),h||f&&(y.state===e.NOMATCH?n.ast.setLength(p):n.ast.up(d,g.name,c,y.phraseLength))},x=(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&&(x(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(x(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)&&(x(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,x(0,r),o=p,m(y,a,r,u),g(f,y,t,!1))}else p=o,o=f.opcodes,x(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:b(t,i);break;case e.AND:((t,n)=>{switch(h+=1,x(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,x(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)}},ee={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 ee.ALT:return"ALT";case ee.CAT:return"CAT";case ee.REP:return"REP";case ee.RNM:return"RNM";case ee.TRG:return"TRG";case ee.TBS:return"TBS";case ee.TLS:return"TLS";case ee.UDT:return"UDT";case ee.AND:return"AND";case ee.NOT:return"NOT";case ee.ACTIVE:return"ACTIVE";case ee.EMPTY:return"EMPTY";case ee.MATCH:return"MATCH";case ee.NOMATCH:return"NOMATCH";case ee.SEM_PRE:return"SEM_PRE";case ee.SEM_POST:return"SEM_POST";case ee.SEM_OK:return"SEM_OK";default:return"UNRECOGNIZED STATE"}}};function te(){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 ne 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 re=ne;new te;new te,new Q,new te,new Q,new te,new Q,new te,new Q;const se=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 ie=class extends re{},oe=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 se(String(e))}).join("/")}`}catch(t){throw new ie("Unexpected error during JSON Pointer compilation",{cause:t,referenceTokens:e})}};class ae 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 ce=ae;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 le=class extends ce{},ue=e=>{if(!Array.isArray(e))throw new le("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 le("Failed to compile normalized JSONPath",{cause:t,selectors:e})}},he=(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)}},pe=(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)}},de=(e,t,n,r)=>{const{realm:s}=e;for(const[e,n]of s.entries(t))r(n,e)},fe=(e,t)=>e>=0?Math.min(e,t):Math.max(t+e,0),me=(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?fe(e,r):n,c=null!==t?fe(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)}},ye=(e,t,n,r)=>r.value,ge=(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}},be=(e,t,n,r)=>{const{selectors:s}=n;for(const n of s)Ce(e,t,n,r)},xe=(e,t,n)=>{const r=[],s=e=>{r.push(e)},{selector:i}=n;switch(i.type){case"BracketedSelection":be(e,t,i,s);break;case"NameSelector":case"WildcardSelector":case"IndexSelector":case"SliceSelector":case"FilterSelector":Ce(e,t,i,s)}return r},we=(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=xe(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=xe(e,r,t);n.push(...s)}s=n}return s},ve=(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]:we(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]:we(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 ke;const Oe=(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 Se(e,t,n,r);case"FilterQuery":return ve(e,t,n,r);case"TestExpr":return"FilterQuery"===r.expression.type?ve(e,t,n,r.expression):"FunctionExpr"===r.expression.type?Se(e,t,n,r.expression):ke(e,t,n,r);case"LogicalOrExpr":case"LogicalAndExpr":case"LogicalNotExpr":case"ComparisonExpr":return ke(e,t,n,r);default:return}})(e,t,n,r));return o(e.realm,...a)},Se=(e,t,n,r)=>{switch(r.type){case"Literal":return ye(e,t,n,r);case"RelSingularQuery":return((e,t,n,r)=>{let s=n;for(const t of r.segments)if(s=ge(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=ge(e,s,t),void 0===s)return;return s})(e,t,0,r);case"FunctionExpr":return Oe(e,t,n,r);default:return}},Ee=(e,t,n,r)=>{const{left:s,op:i,right:o}=r,a=Se(e,t,n,s),c=Se(e,t,n,o);return e.realm.compare(a,i,c)},Ae=e=>Array.isArray(e),_e=(e,t,n,r)=>{switch(r.type){case"LogicalOrExpr":return!!_e(e,t,n,r.left)||_e(e,t,n,r.right);case"LogicalAndExpr":return!!_e(e,t,n,r.left)&&_e(e,t,n,r.right);case"LogicalNotExpr":return!_e(e,t,n,r.expression);case"TestExpr":{const{expression:s}=r;if("FilterQuery"===s.type){return ve(e,t,n,s).length>0}if("FunctionExpr"===s.type){const r=Oe(e,t,n,s);return"boolean"==typeof r?r:void 0!==r&&(Ae(r)?r.length>0:Boolean(r))}return!1}case"ComparisonExpr":return Ee(e,t,n,r);default:return!1}};ke=_e;const Ie=_e,Te=(e,t,n,r)=>{const{realm:s,root:i}=e,{expression:o}=n;for(const[n,a]of s.entries(t)){Ie(e,i,a,o)&&r(a,n)}},Ce=(e,t,n,r)=>{switch(n.type){case"NameSelector":he(e,t,n,r);break;case"IndexSelector":pe(e,t,n,r);break;case"WildcardSelector":de(e,t,n,r);break;case"SliceSelector":me(e,t,n,r);break;case"FilterSelector":Te(e,t,n,r)}};new Map;class je{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(X(r)&&"value"===n){if(!G(r.key))throw new TypeError("MemberElement.key must be a StringElement");e.unshift(r.key.toValue())}else J(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?ue(t):oe(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 Me 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 Ne=Me;class De extends Error{static[Symbol.hasInstance](e){return super[Symbol.hasInstance](e)||Function.prototype[Symbol.hasInstance].call(Ne,e)}constructor(e,t){super(e,t),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const Fe=De;const Be=class extends Fe{constructor(e,t){if(super(e,t),null!=t&&"object"==typeof t){const{cause:e,...n}=t;Object.assign(this,n)}}};function $e(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 Le(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):$e(Math.max(0,o),Le(e,r,n))}}var Pe=o(function(e,t){return 1===e?i(t):$e(e,Le(e,[],t))});const Ue=Pe;function qe(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t}const Re=o(function(e,t){return e&&t});function Ve(e,t,n){for(var r=0,s=n.length;r<s;)t=e(t,n[r]),r+=1;return t}const Ge=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};function He(e){return"[object String]"===Object.prototype.toString.call(e)}const ze=i(function(e){return!!Ge(e)||!!e&&("object"==typeof e&&(!He(e)&&(0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))});var Ke="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function Je(e,t,n){return function(r,s,i){if(ze(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[Ke])return n(r,s,i[Ke]());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 We(e,t,n){for(var r=n.next();!r.done;)t=e(t,r.value),r=n.next();return t}function Xe(e,t,n,r){return n[r](e,t)}const Ye=Je(Ve,Xe,We);function Qe(e,t,n){return function(){if(0===arguments.length)return n();var r=arguments[arguments.length-1];if(!Ge(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 et=function(){return this.xf["@@transducer/init"]()},tt=function(e){return this.xf["@@transducer/result"](e)};var nt=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=et,e.prototype["@@transducer/result"]=tt,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},e}();var rt=o(Qe(["fantasy-land/map","map"],function(e){return function(t){return new nt(e,t)}},function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return Ue(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return Ve(function(n,r){return n[r]=e(t[r]),n},{},b(t));default:return Ze(e,t)}}));const st=rt;const it=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))}:Ye(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,st(n,t))},[],e)});var ot=o(function(e,t){var n=Ue(e,t);return Ue(e,function(){return Ve(it,st(n,arguments[0]),Array.prototype.slice.call(arguments,1))})});const at=ot;var ct=i(function(e){return at(e.length,e)});const lt=ct;const ut=o(function(e,t){return qe(e)?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:lt(Re)(e,t)});function ht(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function pt(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 dt(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 ft=o(function(e,t){return $e(e.length,function(){return e.apply(t,arguments)})});const mt=ft;function yt(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 gt(e,t,n,r){return e["@@transducer/result"](n[r](mt(e["@@transducer/step"],e),t))}const bt=Je(dt,gt,yt);var xt=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 wt=pt(function(e,t,n){return bt("function"==typeof e?function(e){return new xt(e)}(e):e,t,n)});const vt=wt;function kt(e,t){return function(){var n=arguments.length;if(0===n)return t();var r=arguments[n-1];return Ge(r)||"function"!=typeof r[e]?t.apply(this,arguments):r[e].apply(r,Array.prototype.slice.call(arguments,0,n-1))}}const Ot=pt(kt("slice",function(e,t,n){return Array.prototype.slice.call(n,e,t)}));const St=i(kt("tail",Ot(1,1/0)));function Et(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return $e(arguments[0].length,vt(ht,arguments[0],St(arguments)))}function At(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 _t(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 It=function(e){return(e<10?"0":"")+e};const Tt="function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+It(e.getUTCMonth()+1)+"-"+It(e.getUTCDate())+"T"+It(e.getUTCHours())+":"+It(e.getUTCMinutes())+":"+It(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function Ct(e){return"[object Object]"===Object.prototype.toString.call(e)}var jt=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=et,e.prototype["@@transducer/result"]=tt,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},e}();function Mt(e){return function(t){return new jt(e,t)}}var Nt=o(Qe(["fantasy-land/filter","filter"],Mt,function(e,t){return Ct(t)?Ve(function(n,r){return e(t[r])&&(n[r]=t[r]),n},{},b(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 Dt=Nt;const Ft=o(function(e,t){return Dt((n=e,function(){return!n.apply(this,arguments)}),t);var n});function Bt(e,t){var n=function(n){var r=t.concat([e]);return At(n,r)?"<Circular>":Bt(n,r)},r=function(e,t){return Ze(function(t){return _t(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,Ft(function(e){return/^\d+$/.test(e)},b(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):_t(Tt(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())+")":_t(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,b(e)).join(", ")+"}"}}const $t=i(function(e){return Bt(e,[])});const Lt=o(function(e,t){return e||t});const Pt=o(function(e,t){return qe(e)?function(){return e.apply(this,arguments)||t.apply(this,arguments)}:lt(Lt)(e,t)});const Ut=lt(i(function(e){return!e}));const qt=k(null);const Rt=Ut(qt);const Vt=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=$t(e),o=n(i,$t(t));return void 0!==o&&o===i?e:t}),Gt=Number.isInteger||function(e){return(e|0)===e};function Ht(e,t){return t[e<0?t.length+e:e]}const zt=o(function(e,t){if(null!=t)return Gt(e)?Ht(e,t):t[e]});const Kt=o(function(e,t){return st(zt(e),t)});const Jt=i(function(e){return Ue(vt(Vt,0,Kt("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 Wt=function(e,t){switch(arguments.length){case 0:return Wt;case 1:return function t(n){return 0===arguments.length?t:u(e,n)};default:return u(e,t)}};const Xt=Wt;const Yt=Ue(1,Et(x,Xt("GeneratorFunction")));const Qt=Ue(1,Et(x,Xt("AsyncFunction")));const Zt=Jt([Et(x,Xt("Function")),Yt,Qt]);function en(e){return en="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},en(e)}const tn=function(e){return"object"===en(e)};var nn=Ue(1,ut(Rt,Pt(tn,Zt)));const rn=Ue(1,ut(nn,Et($t,k("[object Promise]")))),sn=e=>void 0!==e.style,on=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,an=(e,t)=>0===t.length||!!V(e)&&(!e.isMetaEmpty&&(!!e.hasMetaProperty("classes")&&t.every(t=>e.classes.includes(t))));class cn extends D{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(un).join("");const c=new cn(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=hn(t,r);n.push(e.value),r=e.next}return n}(this.content))}}const ln="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function un(e){let t=e>>>0,n="";do{let e=31&t;t>>>=5,0!==t&&(e|=32),n+=ln[e]}while(0!==t);return n}function hn(e,t=0){let n=0,r=0,s=t;for(;;){const t=e[s++],i=ln.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 pn=cn;const dn=class extends Be{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};const fn=class extends dn{};const mn=class extends dn{},yn=(e,t)=>{const{visited:n=new WeakMap}=t,r={...t,visited:n};if(n.has(e))return n.get(e);const s=wn(e);n.set(e,s);const{content:i}=e;return Array.isArray(i)?s.content=i.map(e=>yn(e,r)):V(i)?s.content=yn(i,r):s.content=i instanceof I?gn(i,r):i,s},gn=(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?yn(s,r):void 0,a=void 0!==i?yn(i,r):void 0,c=new I(o,a);return n.set(e,c),c},bn=(e,t={})=>{if(e instanceof I)return gn(e,t);if(e instanceof C)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=>yn(e,r)),i=new C(s);return n.set(e,i),i})(e,t);if(V(e))return yn(e,t);throw new fn("Value provided to cloneDeep function couldn't be cloned",{value:e})};bn.safe=e=>{try{return bn(e)}catch{return e}};const xn=e=>{const{key:t,value:n}=e;return new I(t,n)},wn=e=>{const t=new(0,e.constructor);t.element=e.element,e.isMetaEmpty||(t.meta=e.meta.cloneDeep()),e.isAttributesEmpty||(t.attributes=bn(e.attributes)),on(e)&&pn.transfer(e,t),sn(e)&&(t.style=E(e.style));const{content:n}=e;return V(n)?t.content=wn(n):Array.isArray(n)?t.content=[...n]:t.content=n instanceof I?xn(n):n,t},vn=e=>{if(e instanceof I)return xn(e);if(e instanceof C)return(e=>{const t=[...e];return new C(t)})(e);if(V(e))return wn(e);throw new mn("Value provided to cloneShallow function couldn't be cloned",{value:e})};vn.safe=e=>{try{return vn(e)}catch{return e}};const kn=e=>{const t=e?.element;return void 0===t||"element"===t?"Element":`${t.charAt(0).toUpperCase()}${t.slice(1)}Element`},On=e=>V(e),Sn=e=>vn(e),En=(e,t,n)=>{X(e)?e.value=n:Array.isArray(e)?e[t]=null===n?void 0:n:null===n?delete e[t]:e[t]=n},An=e=>X(e)?["key","value"]:J(e)||W(e)?["content"]:[],_n=(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]}},In=(e,t,n)=>{if(void 0===t)return null;const r=e,s=n?"leave":"enter",i=_n(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=_n(o,t);if("function"==typeof e)return e}return null},Tn=(e,t={})=>{const{visitFnGetter:n=In,nodeTypeGetter:r=kn,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=jn(t,c),r=i.call(e[u],n);if(rn(r))throw new Be("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=jn(t,s),r=i.call(e[c],n);if(rn(r))throw new Be("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)}}},Cn=(e,t={})=>{const{visitFnGetter:n=In,nodeTypeGetter:r=kn,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=jn(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=jn(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 jn(e,t){return new je(t,e.parent,e.parentPath,e.key,e.inList)}function*Mn(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=[],b=e,x=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:x?.key,b=d,d=v.pop(),w=x?.parentPath?.parentPath??null,k)if(l)for(const[e,t]of g)u(b,e,t);else if(f){b=b.slice();let e=0;for(const[t,n]of g){const r=t-e;null===n?(b.splice(r,1),e+=1):b[r]=n}}else{b=a(b);for(const[e,t]of g)b[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,b])}f=e}}else if(void 0!==d&&(n=f?y:m[y],b=d[n],void 0===b))continue;if(!Array.isArray(b)){if(!o(b))throw new Be(`Invalid AST Node: ${String(b)}`,{node:b});if(c&&v.includes(b))continue;x=new je(b,d,w,n,f);const r=In(t,i(b),e);if(r){for(const[e,n]of Object.entries(s))t[e]=n;const i=yield{visitFn:r,path:x,isLeaving:e};if(x.shouldStop)break;if(x.shouldSkip&&!e)continue;if(x.removed){if(g.push([n,null]),!e)continue}else if(x._wasReplaced()){const t=x._getReplacementNode();if(g.push([n,t]),!e){if(!o(t))continue;b=t}}else if(void 0!==i&&(g.push([n,i]),!e)){if(!o(i))continue;b=i}x._markStale()}}if(!e){if(p={inArray:f,index:y,keys:m,edits:g,parentPath:w,prev:p},f=Array.isArray(b),f)m=b;else if(h)m=r(b);else{const e=i(b);m=void 0!==e?r[e]??[]:[]}y=-1,g=[],void 0!==d&&v.push(d),d=b,w=x}}while(void 0!==p);return 0!==g.length?g.at(-1)[1]:e}Tn[Symbol.for("nodejs.util.promisify.custom")]=Cn;const Nn=(e,t,n={})=>{const r=Mn(e,t,{keyMap:n.keyMap??An,state:n.state??{},nodeTypeGetter:n.nodeTypeGetter??kn,nodePredicate:n.nodePredicate??On,nodeCloneFn:n.nodeCloneFn??Sn,detectCycles:n.detectCycles??!0,mutable:n.mutable??!1,mutationFn:n.mutationFn??En});let s=r.next();for(;!s.done;){const e=s.value,n=e.visitFn.call(t,e.path);if(rn(n))throw new Be("Async visitor not supported in sync mode",{visitor:t,visitFn:e.visitFn});s=r.next(n)}return s.value},Dn=async(e,t,n={})=>{const r=Mn(e,t,{keyMap:n.keyMap??An,state:n.state??{},nodeTypeGetter:n.nodeTypeGetter??kn,nodePredicate:n.nodePredicate??On,nodeCloneFn:n.nodeCloneFn??Sn,detectCycles:n.detectCycles??!0,mutable:n.mutable??!1,mutationFn:n.mutationFn??En});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};Nn[Symbol.for("nodejs.util.promisify.custom")]=Dn,je.prototype.traverse=function(e,t){return Nn(this.node,e,t)},je.prototype.traverseAsync=function(e,t){return Dn(this.node,e,t)};var Fn=pt(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 Bn=Fn;var $n=pt(function e(t,n,r){return Bn(function(n,r,s){return Ct(r)&&Ct(s)?e(t,r,s):t(n,r,s)},n,r)});const Ln=$n;const Pn=o(function(e,t){return Ln(function(e,t,n){return n},e,t)});const Un=o(function(e,t){return null==t||t!=t?e:t});const qn=pt(function(e,t,n){return Un(e,zt(t,n))});function Rn(e,t){for(var n=t,r=0;r<e.length;r+=1){if(null==n)return;var s=e[r];n=Gt(s)?Ht(s,n):n[s]}return n}const Vn=o(Rn);const Gn=Ot(0,-1);var Hn=o(function(e,t){return e.apply(this,t)});const zn=Hn;const Kn=Ut(Zt);var Jn=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:Ge(e)?[]:He(e)?"":Ct(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 Wn=Jn;const Xn=i(function(e){return null!=e&&k(e,Wn(e))});const Yn=ut(Ue(1,Zt(Array.isArray)?Array.isArray:Et(x,Xt("Array"))),Xn);const Qn=Ue(3,function(e,t,n){var r=Vn(e,n),s=Vn(Gn(e),n);if(!Kn(r)&&!Yn(e)){var i=mt(r,s);return zn(i,t)}});const Zn=class extends N{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 er=class extends N{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 tr=class extends D{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 nr=class extends D{constructor(e,t,n){super(e,t,n),this.element="comment"}};const rr=class extends U{constructor(e,t,n){super(e,t,n),this.element="parseResult"}get api(){return this.filter(e=>an(e,["api"])).first}get results(){return this.filter(e=>an(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&&an(e,["warning"]))}get errors(){return this.filter(e=>"annotation"===e.element&&an(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)}},sr=e=>e instanceof Zn,ir=e=>e instanceof er;class or extends R{constructor(e,t,n){super(e,t,n),this.element="__styles__"}static transfer(e,t){t.style=e.style}static from(e){if(e.style)return new or(e.style)}applyTo(e){e.style=this.toValue()}}const ar=or;const cr=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){const n=this.serialiseMeta(e);n&&(t.meta=n.meta,n.rawKeys.length>0&&(t.__meta_raw__=n.rawKeys))}if(e.isAttributesEmpty||(t.attributes=this.serialiseObject(e.attributes)),!(e instanceof pn)){const n=pn.from(e);n&&(t.meta||(t.meta={}),t.meta.__mappings__=this.serialise(n))}if(!(e instanceof ar)){const n=ar.from(e);n&&(t.meta||(t.meta={}),t.meta.__styles__=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,r;t.element!==e.element&&(t.element=e.element);let s=e.meta;if(e.meta?.__mappings__||e.meta?.__styles__){const{__mappings__:t,__styles__:i,...o}=e.meta;n=t,r=i,s=Object.keys(o).length>0?o:void 0}const i=e.__meta_raw__?new Set(e.__meta_raw__):void 0;if(s)for(const[e,n]of Object.entries(s)){const r=this.deserialise(n);t.setMetaProperty(e,i?.has(e)?r.toValue():r)}if(n){this.deserialise(n).applyTo(t)}if(r){this.deserialise(r).applyTo(t)}e.attributes&&this.deserialiseObject(e.attributes,t.attributes);const o=this.deserialiseContent(e.content);return void 0===o&&null!==t.content||(t.content=o),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}serialiseMeta(e){const t={},n=[];let r=!1;for(const[s,i]of Object.entries(e.meta))if(i instanceof this.namespace.elements.Element)t[s]=this.serialise(i),r=!0;else if(void 0!==i){const o=e.refract(i);t[s]=this.serialise(o),n.push(s),r=!0}return r?{meta:t,rawKeys:n}:void 0}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]))})}},lr=e=>null===e,ur=e=>"string"==typeof e,hr=e=>"number"==typeof e,pr=e=>"boolean"==typeof e,dr=e=>null!==e&&"object"==typeof e;class fr{elementMap={};elementDetection=[];Element;KeyValuePair;_elements;_attributeElementKeys=[];_attributeElementArrayKeys=[];constructor(e){this.Element=N,this.KeyValuePair=I,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",B).register("string",D).register("number",F).register("boolean",$).register("array",U).register("object",R).register("member",q).register("ref",er).register("link",Zn).register("sourceMap",pn),this.detect(lr,B,!1).detect(ur,D,!1).detect(hr,F,!1).detect(pr,$,!1).detect(Array.isArray,U,!1).detect(dr,R,!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 cr(this)}}cr.prototype.Namespace=fr;const mr=new fr,yr={isElement:V,isStringElement:G,isNumberElement:H,isNullElement:z,isBooleanElement:K,isArrayElement:J,isObjectElement:W,isMemberElement:X,isPrimitiveElement:Y,isLinkElement:sr,isRefElement:ir,isAnnotationElement:e=>e instanceof tr,isCommentElement:e=>e instanceof nr,isParseResultElement:e=>e instanceof rr,isSourceMapElement:e=>e instanceof pn,hasElementStyle:sn,hasElementSourceMap:on,includesSymbols:(e,t)=>{if(0===t.length)return!0;if(!e.hasAttributesProperty("symbols"))return!1;const n=e.attributes.get("symbols");return!!J(n)&&t.every(e=>n.includes(e))},includesClasses:an},gr=()=>({predicates:yr,namespace:mr}),br={toolboxCreator:gr,visitorOptions:{exposeEdits:!0}},xr=(e,t,n={})=>{if(0===t.length)return e;const r=Pn(br,n),{toolboxCreator:s,visitorOptions:i}=r,o=s(),a=t.map(e=>e(o)),c=Tn(a.map(qn({},"visitor")),i);a.forEach(Qn(["pre"],[]));const l=Nn(e,c);return a.forEach(Qn(["post"],[])),l};xr[Symbol.for("nodejs.util.promisify.custom")]=async(e,t,n={})=>{if(0===t.length)return e;const r=Pn(br,n),{toolboxCreator:s,visitorOptions:i}=r,o=s(),a=t.map(e=>e(o)),c=Cn(a.map(qn({},"visitor")),i);await Promise.allSettled(a.map(Qn(["pre"],[])));const l=await Dn(e,c);return await Promise.allSettled(a.map(Qn(["post"],[]))),l};var wr=n(279),vr=n.n(wr);const kr=class extends Be{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};class Or{uuid;identityMap;constructor({length:e=6}={}){this.uuid=new(vr())({length:e}),this.identityMap=new WeakMap}identify(e){if(!V(e))throw new kr("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.id;if("string"==typeof t&&""!==t)return t}if(this.identityMap.has(e))return this.identityMap.get(e);const t=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 Sr=new Or,Er=({length:e=6}={})=>()=>{let t;return{pre(){t=new Or({length:e})},visitor:{enter(e){e.node.id=t.identify(e.node)}},post(){t=null}}},Ar=({length:e=6}={})=>()=>{let t;return{pre(){t=new Or({length:e})},visitor:{enter(e){Y(e.node)||(e.node.id=t.identify(e.node))}},post(){t=null}}};const _r=class extends Fe{};const Ir=class extends _r{};const Tr=class extends Array{unknownMediaType="application/octet-stream";filterByFormat(){throw new Ir("filterByFormat method in MediaTypes class is not yet implemented.")}findBy(){throw new Ir("findBy method in MediaTypes class is not yet implemented.")}latest(){throw new Ir("latest method in MediaTypes class is not yet implemented.")}};var Cr=i(function(e){return function(){return e}})(void 0);const jr=k(Cr()),Mr=(e,t=new WeakMap)=>(X(e)?(t.set(e.key,e),Mr(e.key,t),t.set(e.value,e),Mr(e.value,t)):e.children.forEach(n=>{t.set(n,e),Mr(n,t)}),t);const Nr=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??Mr(this.element);const n=this.edges.get(e);return jr(n)?void 0:(W(n)?((e,t,n)=>{const r=n.get(e);W(r)&&(r.content=r.map((s,i,o)=>o===e?(n.delete(e),n.set(t,r),t):o))})(e,t,this.edges):J(n)?((e,t,n)=>{const r=n.get(e);J(r)&&(r.content=r.map(s=>s===e?(n.delete(e),n.set(t,r),t):s))})(e,t,this.edges):X(n)&&((e,t,n)=>{const r=n.get(e);X(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)}},Dr=(e,t,n)=>new Nr({element:n}).transclude(e,t),Fr=Nr;var Br=o(function(e,t){return Ve(function(n,r){return n[r]=e(t[r],r,t),n},{},b(t))});const $r=Br;const Lr=i(function(e){return null==e});var Pr=o(function(e,t){if(0===e.length||Lr(t))return!1;for(var n=t,r=0;r<e.length;){if(Lr(n)||!l(e[r],n))return!1;n=n[e[r]],r+=1}return!0});const Ur=Pr;var qr=o(function(e,t){return Ur([e],t)});const Rr=qr;const Vr=pt(function(e,t,n){return e(zt(t,n))});const Gr=pt(function(e,t,n){return e(Rn(t,n))});const Hr=Ue(1,ut(Rt,tn));var zr=Et(x,Xt("Object")),Kr=Gr(ut(Zt,Et($t,k($t(Object)))),["constructor"]);const Jr=Ue(1,function(e){if(!Hr(e)||!zr(e))return!1;var t=Object.getPrototypeOf(e);return!!qt(t)||Kr(t)});const Wr=Ue(1,Et(x,Xt("String")));var Xr=i(function(e){return Ue(e.length,e)});const Yr=Xr;const Qr=o(function(e,t){return Ue(e+1,function(){var n=arguments[e];if(null!=n&&qe(n[t]))return n[t].apply(n,Array.prototype.slice.call(arguments,0,e));throw new TypeError($t(n)+' does not have a method named "'+t+'"')})});const Zr=Qr(1,"split");var es=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=et,e.prototype["@@transducer/result"]=tt,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 ts(e){return function(t){return new es(e,t)}}const ns=o(Qe(["dropWhile"],ts,function(e,t){for(var n=0,r=t.length;n<r&&e(t[n]);)n+=1;return Ot(n,1/0,t)}));const rs=Qr(1,"join");var ss=i(function(e){return Ue(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 is=ss(o(At));const os=Yr(function(e,t){return Et(Zr(""),ns(is(e)),rs(""))(t)}),as=new WeakMap,cs=e=>{if(as.has(e))return as.get(e);const t={},n=(e,r,s)=>("string"==typeof e.element&&(t[e.element]=e.$visitor?[...s,"$visitor"]:s),$r((e,t)=>{const i=[...s,t];if(Jr(e)&&Rr("$ref",e)&&Vr(Wr,"$ref",e)){const t=Vn(["$ref"],e),n=os("#/",t),s=Vn(n.split("/"),r),{$ref:i,...o}=e;return Object.keys(o).length>0&&Jr(s)?{...s,...o}:s}return Jr(e)?n(e,r,i):e},e)),r=n(e,e,[]);return r.elementMap=t,as.set(e,r),r},ls=(e,t=mr)=>{if(Wr(e))try{return t.fromRefract(JSON.parse(e))}catch{}return Jr(e)&&Rr("element",e)?t.fromRefract(e):t.toElement(e)},us=e=>{if(!V(e))return e;if(G(e)||H(e)||K(e)||z(e))return e.toValue();const t=new WeakMap,n=e=>{if(!V(e))return e;if(W(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(J(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 ir(e)?String(e.toValue()):sr(e)?G(e.href)?e.href.toValue():"":e.toValue()};return n(e)},hs=e=>e.style?.json??{},ps=(e,t,n,r)=>{if(r?.preserveStyle){const t=hs(e),r="number"==typeof n?n:"number"==typeof t.indent?t.indent:0,s=new Map,i=((e,t)=>{const n=new WeakSet,r=e=>{if(!V(e))return e;if(n.has(e))return null;if(n.add(e),W(e)){const t={};return e.forEach((e,n)=>{const s=V(n)?us(n):n;"string"==typeof s&&(t[s]=r(e))}),t}if(J(e)){const t=[];return e.forEach(e=>t.push(r(e))),t}if(ir(e))return String(us(e));if(sr(e))return G(e.href)?us(e.href):"";if(H(e)){const n=hs(e);if("string"==typeof n.rawContent){const e=`\0RAW${t.size}\0`;return t.set(e,n.rawContent),e}}return us(e)};return r(e)})(e,s);let o=JSON.stringify(i,null,r);for(const[e,t]of s)o=o.replace(JSON.stringify(e),t);return o}return JSON.stringify(us(e),t,n)},ds=Symbol.for("yaml.alias"),fs=Symbol.for("yaml.document"),ms=Symbol.for("yaml.map"),ys=Symbol.for("yaml.pair"),gs=Symbol.for("yaml.scalar"),bs=Symbol.for("yaml.seq"),xs=Symbol.for("yaml.node.type"),ws=e=>!!e&&"object"==typeof e&&e[xs]===ds,vs=e=>!!e&&"object"==typeof e&&e[xs]===fs,ks=e=>!!e&&"object"==typeof e&&e[xs]===ms,Os=e=>!!e&&"object"==typeof e&&e[xs]===ys,Ss=e=>!!e&&"object"==typeof e&&e[xs]===gs,Es=e=>!!e&&"object"==typeof e&&e[xs]===bs;function As(e){if(e&&"object"==typeof e)switch(e[xs]){case ms:case bs:return!0}return!1}function _s(e){if(e&&"object"==typeof e)switch(e[xs]){case ds:case ms:case gs:case bs:return!0}return!1}const Is=e=>(Ss(e)||As(e))&&!!e.anchor,Ts=Symbol("break visit"),Cs=Symbol("skip children"),js=Symbol("remove node");function Ms(e,t){const n=Bs(t);if(vs(e)){Ns(null,e.contents,n,Object.freeze([e]))===js&&(e.contents=null)}else Ns(null,e,n,Object.freeze([]))}function Ns(e,t,n,r){const s=$s(e,t,n,r);if(_s(s)||Os(s))return Ls(e,r,s),Ns(e,s,n,r);if("symbol"!=typeof s)if(As(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){const s=Ns(e,t.items[e],n,r);if("number"==typeof s)e=s-1;else{if(s===Ts)return Ts;s===js&&(t.items.splice(e,1),e-=1)}}}else if(Os(t)){r=Object.freeze(r.concat(t));const e=Ns("key",t.key,n,r);if(e===Ts)return Ts;e===js&&(t.key=null);const s=Ns("value",t.value,n,r);if(s===Ts)return Ts;s===js&&(t.value=null)}return s}async function Ds(e,t){const n=Bs(t);if(vs(e)){await Fs(null,e.contents,n,Object.freeze([e]))===js&&(e.contents=null)}else await Fs(null,e,n,Object.freeze([]))}async function Fs(e,t,n,r){const s=await $s(e,t,n,r);if(_s(s)||Os(s))return Ls(e,r,s),Fs(e,s,n,r);if("symbol"!=typeof s)if(As(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){const s=await Fs(e,t.items[e],n,r);if("number"==typeof s)e=s-1;else{if(s===Ts)return Ts;s===js&&(t.items.splice(e,1),e-=1)}}}else if(Os(t)){r=Object.freeze(r.concat(t));const e=await Fs("key",t.key,n,r);if(e===Ts)return Ts;e===js&&(t.key=null);const s=await Fs("value",t.value,n,r);if(s===Ts)return Ts;s===js&&(t.value=null)}return s}function Bs(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):ks(t)?n.Map?.(e,t,r):Es(t)?n.Seq?.(e,t,r):Os(t)?n.Pair?.(e,t,r):Ss(t)?n.Scalar?.(e,t,r):ws(t)?n.Alias?.(e,t,r):void 0}function Ls(e,t,n){const r=t[t.length-1];if(As(r))r.items[e]=n;else if(Os(r))"key"===e?r.key=n:r.value=n;else{if(!vs(r)){const e=ws(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${e} parent`)}r.contents=n}}Ms.BREAK=Ts,Ms.SKIP=Cs,Ms.REMOVE=js,Ds.BREAK=Ts,Ds.SKIP=Cs,Ds.REMOVE=js;const Ps={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Us=e=>e.replace(/[!,[\]{}]/g,e=>Ps[e]);class qs{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},qs.defaultYaml,e),this.tags=Object.assign({},qs.defaultTags,t)}clone(){const e=new qs(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new qs(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:qs.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},qs.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:qs.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},qs.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+Us(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&&_s(e.contents)){const t={};Ms(e.contents,(e,n)=>{_s(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 Rs(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 Vs(e){const t=new Set;return Ms(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Gs(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Hs(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=Hs(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=Hs(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=Hs(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=Hs(e,r,t,n);void 0===s?delete r[t]:s!==n&&(r[t]=s)}return e.call(t,n,r)}function zs(e,t,n){if(Array.isArray(e))return e.map((e,t)=>zs(e,String(t),n));if(e&&"function"==typeof e.toJSON){if(!n||!Is(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)}qs.defaultYaml={explicit:!1,version:"1.2"},qs.defaultTags={"!!":"tag:yaml.org,2002:"};class Ks{constructor(e){Object.defineProperty(this,xs,{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(!vs(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=zs(this,"",i);if("function"==typeof r)for(const{count:e,res:t}of i.anchors.values())r(t,e);return"function"==typeof s?Hs(s,{"":o},"",o):o}}class Js extends Ks{constructor(e){super(ds),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=[],Ms(e,{Node:(e,t)=>{(ws(t)||Is(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||(zs(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=Ws(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(Rs(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 Ws(e,t,n){if(ws(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}if(As(t)){let r=0;for(const s of t.items){const t=Ws(e,s,n);t>r&&(r=t)}return r}if(Os(t)){const r=Ws(e,t.key,n),s=Ws(e,t.value,n);return Math.max(r,s)}return 1}const Xs=e=>!e||"function"!=typeof e&&"object"!=typeof e;class Ys extends Ks{constructor(e){super(gs),this.value=e}toJSON(e,t){return t?.keep?this.value:zs(this.value,e,t)}toString(){return String(this.value)}}Ys.BLOCK_FOLDED="BLOCK_FOLDED",Ys.BLOCK_LITERAL="BLOCK_LITERAL",Ys.PLAIN="PLAIN",Ys.QUOTE_DOUBLE="QUOTE_DOUBLE",Ys.QUOTE_SINGLE="QUOTE_SINGLE";function Qs(e,t,n){if(vs(e)&&(e=e.contents),_s(e))return e;if(Os(e)){const t=n.schema[ms].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 Js(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 Ys(e);return c&&(c.node=t),t}l=e instanceof Map?o[ms]:Symbol.iterator in Object(e)?o[bs]:o[ms]}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 Ys(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Zs(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 Qs(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 ei=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class ti extends Ks{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=>_s(t)||Os(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(ei(e))this.add(t);else{const[n,...r]=e,s=this.get(n,!0);if(As(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,Zs(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(As(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&&Ss(s)?s.value:s:As(s)?s.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Os(t))return!1;const n=t.value;return null==n||e&&Ss(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!!As(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(As(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,Zs(this.schema,r,t))}}}}const ni=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ri(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const si=(e,t,n)=>e.endsWith("\n")?ri(n,t):n.includes("\n")?"\n"+ri(n,t):(e.endsWith(" ")?"":" ")+n,ii="flow",oi="block",ai="quoted";function ci(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===oi&&(m=li(e,m,t.length),-1!==m&&(d=m+c));for(let r;r=e[m+=1];){if(n===ai&&"\\"===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===oi&&(m=li(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===ai){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 b=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?b=`\n${t}${e.slice(0,i)}`:(n===ai&&u[s]&&(b+=`${e[s]}\\`),b+=`\n${t}${e.slice(s+1,i)}`)}return b}function li(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 ui=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),hi=e=>/^(%|---|\.\.\.)/m.test(e);function pi(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(hi(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:ci(o,i,ai,ui(t,!1))}function di(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return pi(e,t);const n=t.indent||(hi(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&\n${n}`)+"'";return t.implicitKey?r:ci(r,n,ii,ui(t,!1))}function fi(e,t){const{singleQuote:n}=t.options;let r;if(!1===n)r=pi;else{const t=e.includes('"'),s=e.includes("'");r=t&&!s?di:s&&!t?pi:n?di:pi}return r(e,t)}let mi;try{mi=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{mi=/\n+(?!\n|$)/g}function yi({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 fi(n,r);const l=r.indent||(r.forceBlockIndent||hi(n)?" ":""),u="literal"===o||"folded"!==o&&t!==Ys.BLOCK_FOLDED&&(t===Ys.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(mi,`$&${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 b=n.substring(0,g<m?g+1:m);b&&(n=n.substring(b.length),b=b.replace(/\n+/g,`$&${l}`));let x=(y?l?"2":"1":"")+h;if(e&&(x+=" "+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=ui(r,!0);"folded"!==o&&t!==Ys.BLOCK_FOLDED&&(i.onOverflow=()=>{s=!0});const a=ci(`${b}${e}${d}`,l,oi,i);if(!s)return`>${x}\n${l}${a}`}return`|${x}\n${l}${b}${n=n.replace(/\n+/g,`$&${l}`)}${d}`}function gi(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!==Ys.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=Ys.QUOTE_DOUBLE);const c=e=>{switch(e){case Ys.BLOCK_FOLDED:case Ys.BLOCK_LITERAL:return s||i?fi(o.value,t):yi(o,t,n,r);case Ys.QUOTE_DOUBLE:return pi(o.value,t);case Ys.QUOTE_SINGLE:return di(o.value,t);case Ys.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 fi(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes("\n")?fi(i,t):yi(e,t,n,r);if(!a&&!u&&s!==Ys.PLAIN&&i.includes("\n"))return yi(e,t,n,r);if(hi(i)){if(""===c)return t.forceBlockIndent=!0,yi(e,t,n,r);if(a&&c===l)return fi(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 fi(i,t)}return a?h:ci(h,c,ii,ui(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 bi(e,t){const n=Object.assign({blockQuote:!0,commentString:ni,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 xi(e,t,n,r){if(Os(e))return e.toString(t,n,r);if(ws(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=_s(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(Ss(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=(Ss(e)||As(e))&&e.anchor;i&&Rs(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):Ss(i)?gi(i,t,n,r):i.toString(t,n,r);return o?Ss(i)||"{"===a[0]||"["===a[0]?`${o} ${a}`:`${o}\n${t.indent}${a}`:a}const wi="<<",vi={identify:e=>e===wi||"symbol"==typeof e&&e.description===wi,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ys(Symbol(wi)),{addToJSMap:ki}),stringify:()=>wi};function ki(e,t,n){if(n=e&&ws(n)?n.resolve(e.doc):n,Es(n))for(const r of n.items)Oi(e,t,r);else if(Array.isArray(n))for(const r of n)Oi(e,t,r);else Oi(e,t,n)}function Oi(e,t,n){const r=e&&ws(n)?n.resolve(e.doc):n;if(!ks(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 Si(e,t,{key:n,value:r}){if(_s(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(((e,t)=>(vi.identify(t)||Ss(t)&&(!t.type||t.type===Ys.PLAIN)&&vi.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===vi.tag&&e.default))(e,n))ki(e,t,r);else{const s=zs(n,"",e);if(t instanceof Map)t.set(s,zs(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(_s(e)&&n?.doc){const t=bi(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=zs(r,i,e);i in t?Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[i]=o}}return t}function Ei(e,t,n){const r=Qs(e,void 0,n),s=Qs(t,void 0,n);return new Ai(r,s)}class Ai{constructor(e,t=null){Object.defineProperty(this,xs,{value:ys}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return _s(t)&&(t=t.clone(e)),_s(n)&&(n=n.clone(e)),new Ai(t,n)}toJSON(e,t){return Si(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=_s(e)&&e.comment||null;if(h){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(As(e)||!_s(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||As(e)||(Ss(e)?e.type===Ys.BLOCK_FOLDED||e.type===Ys.BLOCK_LITERAL:"object"==typeof e));n=Object.assign({},n,{allNullValues:!1,implicitKey:!d&&(h||!i),indent:a+c});let f,m,y,g=!1,b=!1,x=xi(e,n,()=>g=!0,()=>b=!0);if(!d&&!n.inFlow&&x.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(),""===x?"?":d?`? ${x}`:x}else if(i&&!h||null==t&&d)return x=`? ${x}`,p&&!g?x+=si(x,n.indent,l(p)):b&&s&&s(),x;g&&(p=null),d?(p&&(x+=si(x,n.indent,l(p))),x=`? ${x}\n${a}:`):(x=`${x}:`,p&&(x+=si(x,n.indent,l(p)))),_s(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||!Ss(t)||(n.indentAtStart=x.length+1),b=!1,u||!(c.length>=2)||n.inFlow||d||!Es(t)||t.flow||t.tag||t.anchor||(n.indent=n.indent.substring(2));let w=!1;const v=xi(t,n,()=>w=!0,()=>b=!0);let k=" ";if(p||f||m)k=f?"\n":"",m&&(k+=`\n${ri(l(m),n.indent)}`),""!==v||n.inFlow?k+=`\n${n.indent}`:"\n"===k&&y&&(k="\n\n");else if(!d&&As(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 x+=k+v,n.inFlow?w&&r&&r():y&&!w?x+=si(x,n.indent,l(y)):b&&s&&s(),x}(this,e,t,n):JSON.stringify(this)}}function _i(e,t,n){return(t.inFlow??e.flow?Ti:Ii)(e,t,n)}function Ii({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(_s(s))!h&&s.spaceBefore&&p.push(""),Ci(n,p,s.commentBefore,h),s.comment&&(o=s.comment);else if(Os(s)){const e=_s(s.key)?s.key:null;e&&(!h&&e.spaceBefore&&p.push(""),Ci(n,p,e.commentBefore,h))}h=!1;let a=xi(s,u,()=>o=null,()=>h=!0);o&&(a+=si(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"+ri(l(e),c),a&&a()):h&&o&&o(),d}function Ti({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(_s(s))s.spaceBefore&&h.push(""),Ci(t,h,s.commentBefore,!1),s.comment&&(i=s.comment);else if(Os(s)){const e=_s(s.key)?s.key:null;e&&(e.spaceBefore&&h.push(""),Ci(t,h,e.commentBefore,!1),e.comment&&(l=!0));const n=_s(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=xi(s,c,()=>i=null);n<e.length-1&&(o+=","),i&&(o+=si(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 Ci({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const s=ri(t(r),e);n.push(s.trimStart())}}function ji(e,t){const n=Ss(t)?t.value:t;for(const r of e)if(Os(r)){if(r.key===t||r.key===n)return r;if(Ss(r.key)&&r.key.value===n)return r}}class Mi extends ti{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ms,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(Ei(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=Os(e)?e:e&&"object"==typeof e&&"key"in e?new Ai(e.key,e.value):new Ai(e,e?.value);const r=ji(this.items,n.key),s=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${n.key} already set`);Ss(r.value)&&Xs(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=ji(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=ji(this.items,e),r=n?.value;return(!t&&Ss(r)?r.value:r)??void 0}has(e){return!!ji(this.items,e)}set(e,t){this.add(new Ai(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)Si(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(const e of this.items)if(!Os(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})),_i(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const Ni={collection:"map",default:!0,nodeClass:Mi,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(ks(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,n)=>Mi.from(e,t,n)};class Di extends ti{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(bs,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=Fi(e);if("number"!=typeof t)return!1;return this.items.splice(t,1).length>0}get(e,t){const n=Fi(e);if("number"!=typeof n)return;const r=this.items[n];return!t&&Ss(r)?r.value:r}has(e){const t=Fi(e);return"number"==typeof t&&t<this.items.length}set(e,t){const n=Fi(e);if("number"!=typeof n)throw new Error(`Expected a valid index, not ${e}.`);const r=this.items[n];Ss(r)&&Xs(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(zs(e,String(r++),t));return n}toString(e,t,n){return e?_i(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(Qs(i,void 0,n))}}return s}}function Fi(e){let t=Ss(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}const Bi={collection:"seq",default:!0,nodeClass:Di,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(Es(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,n)=>Di.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)=>gi(e,t=Object.assign({actualString:!0},t),n,r)},Li={identify:e=>null==e,createNode:()=>new Ys(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ys(null),stringify:({source:e},t)=>"string"==typeof e&&Li.test.test(e)?e:t.options.nullStr},Pi={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ys("t"===e[0]||"T"===e[0]),stringify({source:e,value:t},n){if(e&&Pi.test.test(e)){if(t===("t"===e[0]||"T"===e[0]))return e}return t?n.options.trueStr:n.options.falseStr}};function Ui({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 qi={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:Ui},Ri={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():Ui(e)}},Vi={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 Ys(parseFloat(e)),n=e.indexOf(".");return-1!==n&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-n-1),t},stringify:Ui},Gi=e=>"bigint"==typeof e||Number.isInteger(e),Hi=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function zi(e,t,n){const{value:r}=e;return Gi(r)&&r>=0?n+r.toString(t):Ui(e)}const Ki={identify:e=>Gi(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Hi(e,2,8,n),stringify:e=>zi(e,8,"0o")},Ji={identify:Gi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Hi(e,0,10,n),stringify:Ui},Wi={identify:e=>Gi(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Hi(e,2,16,n),stringify:e=>zi(e,16,"0x")},Xi=[Ni,Bi,$i,Li,Pi,Ki,Ji,Wi,qi,Ri,Vi];function Yi(e){return"bigint"==typeof e||Number.isInteger(e)}const Qi=({value:e})=>JSON.stringify(e),Zi=[Ni,Bi].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Qi},{identify:e=>null==e,createNode:()=>new Ys(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Qi},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:Qi},{identify:Yi,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})=>Yi(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:Qi}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),eo={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=Ys.BLOCK_LITERAL),t!==Ys.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===Ys.BLOCK_LITERAL?"\n":" ")}return gi({comment:e,type:t,value:a},r,s,i)}};function to(e,t){if(Es(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Os(r)){if(ks(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const e=r.items[0]||new Ai(new Ys(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]=Os(r)?r:new Ai(r)}}else t("Expected a sequence for this tag");return e}function no(e,t,n){const{replacer:r}=n,s=new Di(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(Ei(o,a,n))}return s}const ro={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:to,createNode:no};class so extends Di{constructor(){super(),this.add=Mi.prototype.add.bind(this),this.delete=Mi.prototype.delete.bind(this),this.get=Mi.prototype.get.bind(this),this.has=Mi.prototype.has.bind(this),this.set=Mi.prototype.set.bind(this),this.tag=so.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(Os(e)?(r=zs(e.key,"",t),s=zs(e.value,r,t)):r=zs(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=no(e,t,n),s=new this;return s.items=r.items,s}}so.tag="tag:yaml.org,2002:omap";const io={collection:"seq",identify:e=>e instanceof Map,nodeClass:so,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=to(e,t),r=[];for(const{key:e}of n.items)Ss(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new so,n)},createNode:(e,t,n)=>so.from(e,t,n)};function oo({value:e,source:t},n){return t&&(e?ao:co).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const ao={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 Ys(!0),stringify:oo},co={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 Ys(!1),stringify:oo},lo={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:Ui},uo={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():Ui(e)}},ho={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 Ys(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:Ui},po=e=>"bigint"==typeof e||Number.isInteger(e);function fo(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 mo(e,t,n){const{value:r}=e;if(po(r)){const e=r.toString(t);return r<0?"-"+n+e.substr(1):n+e}return Ui(e)}const yo={identify:po,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>fo(e,2,2,n),stringify:e=>mo(e,2,"0b")},go={identify:po,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>fo(e,1,8,n),stringify:e=>mo(e,8,"0")},bo={identify:po,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>fo(e,0,10,n),stringify:Ui},xo={identify:po,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>fo(e,2,16,n),stringify:e=>mo(e,16,"0x")};class wo extends Mi{constructor(e){super(e),this.tag=wo.tag}add(e){let t;t=Os(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new Ai(e.key,null):new Ai(e,null);ji(this.items,t.key)||this.items.push(t)}get(e,t){const n=ji(this.items,e);return!t&&Os(n)?Ss(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=ji(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Ai(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(Ei(e,null,n));return s}}wo.tag="tag:yaml.org,2002:set";const vo={collection:"map",identify:e=>e instanceof Set,nodeClass:wo,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>wo.from(e,t,n),resolve(e,t){if(ks(e)){if(e.hasAllNullValues(!0))return Object.assign(new wo,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function ko(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 Oo(e){let{value:t}=e,n=e=>e;if("bigint"==typeof t)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Ui(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 So={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})=>ko(e,n),stringify:Oo},Eo={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=>ko(e,!1),stringify:Oo},Ao={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(Ao.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=ko(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$/,"")??""},_o=[Ni,Bi,$i,Li,ao,co,yo,go,bo,xo,lo,uo,ho,eo,vi,io,ro,vo,So,Eo,Ao],Io=new Map([["core",Xi],["failsafe",[Ni,Bi,$i]],["json",Zi],["yaml11",_o],["yaml-1.1",_o]]),To={binary:eo,bool:Pi,float:Vi,floatExp:Ri,floatNaN:qi,floatTime:Eo,int:Ji,intHex:Wi,intOct:Ki,intTime:So,map:Ni,merge:vi,null:Li,omap:io,pairs:ro,seq:Bi,set:vo,timestamp:Ao},Co={"tag:yaml.org,2002:binary":eo,"tag:yaml.org,2002:merge":vi,"tag:yaml.org,2002:omap":io,"tag:yaml.org,2002:pairs":ro,"tag:yaml.org,2002:set":vo,"tag:yaml.org,2002:timestamp":Ao};function jo(e,t,n){const r=Io.get(t);if(r&&!e)return n&&!r.includes(vi)?r.concat(vi):r.slice();let s=r;if(!s){if(!Array.isArray(e)){const e=Array.from(Io.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(vi)),s.reduce((e,t)=>{const n="string"==typeof t?To[t]:t;if(!n){const e=JSON.stringify(t),n=Object.keys(To).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 Mo=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class No{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:s,sortMapEntries:i,toStringDefaults:o}){this.compat=Array.isArray(e)?jo(e,"compat"):e?jo(null,e):null,this.name="string"==typeof s&&s||"core",this.knownTags=r?Co:{},this.tags=jo(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,ms,{value:Ni}),Object.defineProperty(this,gs,{value:$i}),Object.defineProperty(this,bs,{value:Bi}),this.sortMapEntries="function"==typeof i?i:!0===i?Mo:null}clone(){const e=Object.create(No.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}class Do{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,xs,{value:fs});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 qs({version:i}),this.setSchema(i,n),this.contents=void 0===e?null:this.createNode(e,r,n)}clone(){const e=Object.create(Do.prototype,{[xs]:{value:fs}});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=_s(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Fo(this.contents)&&this.contents.add(e)}addIn(e,t){Fo(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=Vs(this);e.anchor=!t||n.has(t)?Gs(t||"a",n):t}return new Js(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=Vs(e));const i=Gs(t,s);return s.add(i),i},setAnchors:()=>{for(const e of n){const t=r.get(e);if("object"!=typeof t||!t.anchor||!Ss(t.node)&&!As(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=Qs(e,l,{aliasDuplicateObjects:s??!0,keepUndefined:a??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:p});return o&&As(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 Ai(r,s)}delete(e){return!!Fo(this.contents)&&this.contents.delete(e)}deleteIn(e){return ei(e)?null!=this.contents&&(this.contents=null,!0):!!Fo(this.contents)&&this.contents.deleteIn(e)}get(e,t){return As(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return ei(e)?!t&&Ss(this.contents)?this.contents.value:this.contents:As(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!As(this.contents)&&this.contents.has(e)}hasIn(e){return ei(e)?void 0!==this.contents:!!As(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=Zs(this.schema,[e],t):Fo(this.contents)&&this.contents.set(e,t)}setIn(e,t){ei(e)?this.contents=t:null==this.contents?this.contents=Zs(this.schema,Array.from(e),t):Fo(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 qs({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 qs({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 No(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=zs(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?Hs(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=bi(e,t),{commentString:i}=s.options;if(e.commentBefore){1!==n.length&&n.unshift("");const t=i(e.commentBefore);n.unshift(ri(t,""))}let o=!1,a=null;if(e.contents){if(_s(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const t=i(e.contents.commentBefore);n.push(ri(t,""))}s.forceBlockIndent=!!e.comment,a=e.contents.comment}const t=a?void 0:()=>o=!0;let c=xi(e.contents,s,()=>a=null,t);a&&(c+=si(c,"",i(a))),"|"!==c[0]&&">"!==c[0]||"---"!==n[n.length-1]?n.push(c):n[n.length-1]=`--- ${c}`}else n.push(xi(e.contents,s));if(e.directives?.docEnd)if(e.comment){const t=i(e.comment);t.includes("\n")?(n.push("..."),n.push(ri(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(ri(i(t),"")))}return n.join("\n")+"\n"}(this,e)}}function Fo(e){if(As(e))return!0;throw new Error("Expected a YAML collection as document contents")}Error;const Bo=Symbol("break visit"),$o=Symbol("skip children"),Lo=Symbol("remove item");function Po(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),Uo(Object.freeze([]),e,t)}function Uo(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=Uo(Object.freeze(e.concat([[s,t]])),i.items[t],n);if("number"==typeof r)t=r-1;else{if(r===Bo)return Bo;r===Lo&&(i.items.splice(t,1),t-=1)}}"function"==typeof r&&"key"===s&&(r=r(t,e))}}return"function"==typeof r?r(t,e):r}Po.BREAK=Bo,Po.SKIP=$o,Po.REMOVE=Lo,Po.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},Po.parentCollection=(e,t)=>{const n=Po.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 qo=e=>e.style?.yaml??{},Ro={Plain:Ys.PLAIN,SingleQuoted:Ys.QUOTE_SINGLE,DoubleQuoted:Ys.QUOTE_DOUBLE,Literal:Ys.BLOCK_LITERAL,Folded:Ys.BLOCK_FOLDED},Vo=(e,t)=>{t.comment&&(e.comment=` ${t.comment}`),t.commentBefore&&(e.commentBefore=` ${t.commentBefore}`)},Go=(e,t)=>{if(!V(e))return e;if(t.has(e))return;t.add(e);const n=qo(e);if(W(e)){const r=new Mi;return r.flow="Flow"===n.styleGroup,Vo(r,n),e.forEach((e,n,s)=>{const i=X(s)?qo(s):{},o=Go(n,t),a=Go(e,t),c=new Ai(o,a);i.commentBefore&&_s(o)&&(o.commentBefore=` ${i.commentBefore}`),i.comment&&_s(a)&&(a.comment=` ${i.comment}`),r.items.push(c)}),r}if(J(e)){const r=new Di;return r.flow="Flow"===n.styleGroup,Vo(r,n),e.forEach(e=>{r.items.push(Go(e,t))}),r}if(ir(e))return new Ys(String(us(e)));if(sr(e))return new Ys(G(e.href)?us(e.href):"");const r=n.scalarStyle?Ro[n.scalarStyle]:void 0,s=new Ys(us(e));if(r&&(s.type=r),n.rawContent&&"Plain"===n.scalarStyle&&"number"==typeof s.value){/[eE]/.test(n.rawContent)?s.format="EXP":/^0x/i.test(n.rawContent)?s.format="HEX":/^0o/i.test(n.rawContent)&&(s.format="OCT");const e=n.rawContent.match(/\.(\d+)/);e&&(s.minFractionDigits=e[1].length)}return Vo(s,n),s},Ho=(e,{directive:t=!1,preserveStyle:n=!1,aliasDuplicateObjects:r=!1,...s}={})=>{const i={aliasDuplicateObjects:r,...s};if(n){const n=qo(e);void 0===s.indent&&"number"==typeof n.indent&&(i.indent=n.indent),"boolean"==typeof n.flowCollectionPadding&&(i.flowCollectionPadding=n.flowCollectionPadding);const r=Go(e,new WeakSet),o=new Do(void 0,i);return o.contents=r,t&&(o.directives.yaml.explicit=!0),o.toString(i)}if(t){const t=new Do(us(e),i);return t.directives.yaml.explicit=!0,t.toString(i)}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 vs(e)&&!r?e.toString(n):new Do(e,r,n).toString(n)}(us(e),i)},zo=(e,t=mr)=>t.toRefract(e),Ko=(e,t=mr)=>{const n=zo(e,t);return JSON.stringify(n)},Jo=e=>{let t="",n=0;return Nn(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},Wo=e=>{const t=e.isMetaEmpty?void 0:e.meta.cloneDeep(),n=e.isAttributesEmpty?void 0:bn(e.attributes);return new e.constructor(void 0,t,n)},Xo=(e,t)=>t.clone&&t.isMergeableElement(e)?Qo(Wo(e),e,t):e,Yo={clone:!0,isMergeableElement:e=>W(e)||J(e),arrayElementMerge:(e,t,n)=>new(0,e.constructor)(e.concat(t).map(e=>Xo(e,n))),objectElementMerge:(e,t,n)=>{const r=W(e)?Wo(e):Wo(t);return W(e)&&e.forEach((e,t,s)=>{const i=vn(s);i.value=Xo(e,n),r.content.push(i)}),t.forEach((t,s,i)=>{const o=us(s);let a;if(W(e)&&e.hasKey(o)&&n.isMergeableElement(t)){const r=e.get(o);a=vn(i),a.value=((e,t)=>{if("function"!=typeof t.customMerge)return Qo;const n=t.customMerge(e,t);return"function"==typeof n?n:Qo})(s,n)(r,t,n)}else a=vn(i),a.value=Xo(t,n);r.remove(o),r.content.push(a)}),r},customMerge:void 0,customMetaMerge:void 0,customAttributesMerge:void 0},Qo=(e,t,n)=>{const r={...Yo,...n};r.isMergeableElement=r.isMergeableElement??Yo.isMergeableElement,r.arrayElementMerge=r.arrayElementMerge??Yo.arrayElementMerge,r.objectElementMerge=r.objectElementMerge??Yo.objectElementMerge;const s=J(t);if(!(s===J(e)))return Xo(t,r);const i=s&&"function"==typeof r.arrayElementMerge?r.arrayElementMerge(e,t,r):r.objectElementMerge(e,t,r);return e.isMetaEmpty||t.isMetaEmpty?e.isMetaEmpty?t.isMetaEmpty||(i.meta=t.meta.cloneDeep()):i.meta=e.meta.cloneDeep():i.meta=(e=>"function"!=typeof e.customMetaMerge?e=>e.cloneDeep():e.customMetaMerge)(r)(e.meta,t.meta),e.isAttributesEmpty||t.isAttributesEmpty?e.isAttributesEmpty?t.isAttributesEmpty||(i.attributes=bn(t.attributes)):i.attributes=bn(e.attributes):i.attributes=(e=>"function"!=typeof e.customAttributesMerge?e=>bn(e):e.customAttributesMerge)(r)(e.attributes,t.attributes),i};Qo.all=(e,t)=>{if(!Array.isArray(e))throw new TypeError("First argument of deepmerge should be an array.");return 0===e.length?new R:e.reduce((e,n)=>Qo(e,n,t),Wo(e[0]))};const Zo=Qo,ea=(e,t,n)=>{const r={...Yo,...n,customMerge:()=>(e,t)=>t,clone:!1};return Zo(e,t,r)};ea.all=(e,t)=>{if(!Array.isArray(e))throw new TypeError("First argument of mergeRight should be an array.");return 0===e.length?new R:e.reduce((e,n)=>ea(e,n,t),Wo(e[0]))};const ta=ea,na=(...[e,t,n])=>ta(t,e,n);na.all=(...[e,t])=>ta.all([...e].reverse(),t);const ra=na;function sa(e,t){const n=(e instanceof N?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:()=>kr,IdentityManager:()=>Or,MediaTypes:()=>Tr,Transcluder:()=>Fr,createToolbox:()=>gr,deepmerge:()=>Zo,defaultIdentityManager:()=>Sr,dehydrate:()=>zo,dispatchRefractorPlugins:()=>xr,fixedFields:()=>sa,from:()=>ls,mergeLeft:()=>ra,mergeRight:()=>ta,refractorPluginElementIdentity:()=>Er,refractorPluginSemanticElementIdentity:()=>Ar,resolveSpecification:()=>cs,sexprs:()=>Jo,toJSON:()=>ps,toString:()=>Ko,toValue:()=>us,toYAML:()=>Ho,transclude:()=>Dr});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 b=g;const x=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=x(e);if(s!==x(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=b(e);if(o.length!==b(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,[],[])});function O(e,t,n){if(n||(n=new S),function(e){var t=typeof e;return null==e||"object"!=t&&"function"!=t}(e))return e;var r,s=function(r){var s=n.get(e);if(s)return s;for(var i in n.set(e,r),e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=t?O(e[i],!0,n):e[i]);return r};switch(x(e)){case"Object":return s(Object.create(Object.getPrototypeOf(e)));case"Array":return s(Array(e.length));case"Date":return new Date(e.valueOf());case"RegExp":return r=e,new RegExp(r.source,r.flags?r.flags:(r.global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.sticky?"y":"")+(r.unicode?"u":"")+(r.dotAll?"s":""));case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return e.slice();default:return e}}var S=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){var n=this.hash(e),r=this.map[n];r||(this.map[n]=r=[]),r.push([e,t]),this.length+=1},e.prototype.hash=function(e){var t=[];for(var n in e)t.push(Object.prototype.toString.call(e[n]));return t.join()},e.prototype.get=function(e){if(this.length<=180)for(var t in this.map)for(var n=this.map[t],r=0;r<n.length;r+=1){if((i=n[r])[0]===e)return i[1]}else{var s=this.hash(e);if(n=this.map[s])for(r=0;r<n.length;r+=1){var i;if((i=n[r])[0]===e)return i[1]}}},e}();const E=i(function(e){return null!=e&&"function"==typeof e.clone?e.clone():O(e,!0)});class A{get(e){return this[e]}set(e,t){this[e]=t}hasKey(e){return Object.hasOwn(this,e)}keys(){return Object.keys(this)}remove(e){delete this[e]}get isEmpty(){return 0===Object.keys(this).length}get isFrozen(){return Object.isFrozen(this)}freeze(){for(const e of Object.values(this))e instanceof this.Element?e.freeze():(Array.isArray(e)||null!==e&&"object"==typeof e)&&Object.freeze(e);Object.freeze(this)}cloneShallow(){const e=new A;return Object.assign(e,this),e}merge(e){const t=this.cloneShallow();for(const[n,r]of Object.entries(e)){const e=t.get(n);Array.isArray(e)&&Array.isArray(r)?t.set(n,[...e,...r]):t.set(n,r)}return t}cloneDeep(){const e=new A;for(const[t,n]of Object.entries(this))n instanceof this.Element?e.set(t,this.cloneDeepElement(n)):e.set(t,E(n));return e}}const _=A;const I=class{key;value;constructor(e,t){this.key=e,this.value=t}toValue(){return{key:this.key?.toValue(),value:this.value?.toValue()}}};class T{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 T(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 T(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 C=T,j=Object.freeze(new _);class M{parent;style;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 M)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 I)this._content=e;else if(e instanceof C)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)return j;this._meta=new _}return this._meta}set meta(e){if(e instanceof _)this._meta=e;else if(e&&"object"==typeof e){const t=new _;Object.assign(t,e),this._meta=t}}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 M?this._attributes=e:this.attributes.set(e??{})}get id(){if(!this.hasMetaProperty("id")){if(this.isFrozen)return"";this.setMetaProperty("id","")}return this.meta.get("id")}set id(e){this.setMetaProperty("id",e)}get classes(){if(!this.hasMetaProperty("classes")){if(this.isFrozen)return[];this.setMetaProperty("classes",[])}return this.meta.get("classes")}set classes(e){this.setMetaProperty("classes",e)}get links(){if(!this.hasMetaProperty("links")){if(this.isFrozen){const e=new this.ArrayElement;return e.freeze(),e}this.setMetaProperty("links",new this.ArrayElement)}return 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 I){const t=[];return e.key&&t.push(e.key),e.value&&t.push(e.value),t}return e instanceof M?[e]:[]}get isFrozen(){return Object.isFrozen(this)}freeze(){if(!this.isFrozen){this._meta&&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 M||e instanceof I?e.toValue():Array.isArray(e)?e.map(e=>e.toValue()):e}equals(e){const t=e instanceof M?e.toValue():e;return k(this.toValue(),t)}primitive(){}set(e){return this.content=e,this}toRef(e){const t=this.id;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){return this.hasMetaProperty(e)?this.meta.get(e):t}setMetaProperty(e,t){this.meta.set(e,t)}hasMetaProperty(e){return void 0!==this._meta&&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 N=M;const D=class extends N{constructor(e,t,n){super(e,t,n),this.element="string"}primitive(){return"string"}get length(){return this.content?.length??0}};const F=class extends N{constructor(e,t,n){super(e,t,n),this.element="number"}primitive(){return"number"}};const B=class extends N{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 $=class extends N{constructor(e,t,n){super(e,t,n),this.element="boolean"}primitive(){return"boolean"}};class L extends N{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===e).first}concat(e){return new(0,this.constructor)(this._content.concat(e._content))}[Symbol.iterator](){return this._content[Symbol.iterator]()}}const P=L;const U=class extends P{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 q=class extends N{constructor(e,t,n,r){super(new I,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 R=class extends P{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 q(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 C(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 C(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([])}},V=e=>e instanceof N,G=e=>e instanceof D,H=e=>e instanceof F,z=e=>e instanceof B,K=e=>e instanceof $,J=e=>e instanceof U,W=e=>e instanceof R,X=e=>e instanceof q,Y=e=>W(e)&&"object"===e.element||J(e)&&"array"===e.element||K(e)&&"boolean"===e.element||H(e)&&"number"===e.element||G(e)&&"string"===e.element||z(e)&&"null"===e.element||X(e)&&"member"===e.element,Q=function(){const e=ee,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,b,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 O=b.toLowerCase();let S;for(const e in s)if(s.hasOwnProperty(e)&&O===s[e].lower){S=s[e].index;break}if(void 0===S)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:S}],x(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}`)}},b=(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 b=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,b),h||f&&(y.state===e.NOMATCH?n.ast.setLength(p):n.ast.up(d,g.name,c,y.phraseLength))},x=(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&&(x(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(x(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)&&(x(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,x(0,r),o=p,m(y,a,r,u),g(f,y,t,!1))}else p=o,o=f.opcodes,x(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:b(t,i);break;case e.AND:((t,n)=>{switch(h+=1,x(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,x(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)}},ee={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 ee.ALT:return"ALT";case ee.CAT:return"CAT";case ee.REP:return"REP";case ee.RNM:return"RNM";case ee.TRG:return"TRG";case ee.TBS:return"TBS";case ee.TLS:return"TLS";case ee.UDT:return"UDT";case ee.AND:return"AND";case ee.NOT:return"NOT";case ee.ACTIVE:return"ACTIVE";case ee.EMPTY:return"EMPTY";case ee.MATCH:return"MATCH";case ee.NOMATCH:return"NOMATCH";case ee.SEM_PRE:return"SEM_PRE";case ee.SEM_POST:return"SEM_POST";case ee.SEM_OK:return"SEM_OK";default:return"UNRECOGNIZED STATE"}}};function te(){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 ne 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 re=ne;new te;new te,new Q,new te,new Q,new te,new Q,new te,new Q;const se=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 ie=class extends re{},oe=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 se(String(e))}).join("/")}`}catch(t){throw new ie("Unexpected error during JSON Pointer compilation",{cause:t,referenceTokens:e})}};class ae 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 ce=ae;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 le=class extends ce{},ue=e=>{if(!Array.isArray(e))throw new le("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 le("Failed to compile normalized JSONPath",{cause:t,selectors:e})}},he=(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)}},pe=(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)}},de=(e,t,n,r)=>{const{realm:s}=e;for(const[e,n]of s.entries(t))r(n,e)},fe=(e,t)=>e>=0?Math.min(e,t):Math.max(t+e,0),me=(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?fe(e,r):n,c=null!==t?fe(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)}},ye=(e,t,n,r)=>r.value,ge=(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}},be=(e,t,n,r)=>{const{selectors:s}=n;for(const n of s)Ce(e,t,n,r)},xe=(e,t,n)=>{const r=[],s=e=>{r.push(e)},{selector:i}=n;switch(i.type){case"BracketedSelection":be(e,t,i,s);break;case"NameSelector":case"WildcardSelector":case"IndexSelector":case"SliceSelector":case"FilterSelector":Ce(e,t,i,s)}return r},we=(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=xe(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=xe(e,r,t);n.push(...s)}s=n}return s},ve=(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]:we(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]:we(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 ke;const Oe=(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 Se(e,t,n,r);case"FilterQuery":return ve(e,t,n,r);case"TestExpr":return"FilterQuery"===r.expression.type?ve(e,t,n,r.expression):"FunctionExpr"===r.expression.type?Se(e,t,n,r.expression):ke(e,t,n,r);case"LogicalOrExpr":case"LogicalAndExpr":case"LogicalNotExpr":case"ComparisonExpr":return ke(e,t,n,r);default:return}})(e,t,n,r));return o(e.realm,...a)},Se=(e,t,n,r)=>{switch(r.type){case"Literal":return ye(e,t,n,r);case"RelSingularQuery":return((e,t,n,r)=>{let s=n;for(const t of r.segments)if(s=ge(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=ge(e,s,t),void 0===s)return;return s})(e,t,0,r);case"FunctionExpr":return Oe(e,t,n,r);default:return}},Ee=(e,t,n,r)=>{const{left:s,op:i,right:o}=r,a=Se(e,t,n,s),c=Se(e,t,n,o);return e.realm.compare(a,i,c)},Ae=e=>Array.isArray(e),_e=(e,t,n,r)=>{switch(r.type){case"LogicalOrExpr":return!!_e(e,t,n,r.left)||_e(e,t,n,r.right);case"LogicalAndExpr":return!!_e(e,t,n,r.left)&&_e(e,t,n,r.right);case"LogicalNotExpr":return!_e(e,t,n,r.expression);case"TestExpr":{const{expression:s}=r;if("FilterQuery"===s.type){return ve(e,t,n,s).length>0}if("FunctionExpr"===s.type){const r=Oe(e,t,n,s);return"boolean"==typeof r?r:void 0!==r&&(Ae(r)?r.length>0:Boolean(r))}return!1}case"ComparisonExpr":return Ee(e,t,n,r);default:return!1}};ke=_e;const Ie=_e,Te=(e,t,n,r)=>{const{realm:s,root:i}=e,{expression:o}=n;for(const[n,a]of s.entries(t)){Ie(e,i,a,o)&&r(a,n)}},Ce=(e,t,n,r)=>{switch(n.type){case"NameSelector":he(e,t,n,r);break;case"IndexSelector":pe(e,t,n,r);break;case"WildcardSelector":de(e,t,n,r);break;case"SliceSelector":me(e,t,n,r);break;case"FilterSelector":Te(e,t,n,r)}};new Map;class je{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(X(r)&&"value"===n){if(!G(r.key))throw new TypeError("MemberElement.key must be a StringElement");e.unshift(r.key.toValue())}else J(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?ue(t):oe(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 Me 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 Ne=Me;class De extends Error{static[Symbol.hasInstance](e){return super[Symbol.hasInstance](e)||Function.prototype[Symbol.hasInstance].call(Ne,e)}constructor(e,t){super(e,t),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const Fe=De;const Be=class extends Fe{constructor(e,t){if(super(e,t),null!=t&&"object"==typeof t){const{cause:e,...n}=t;Object.assign(this,n)}}};function $e(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 Le(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):$e(Math.max(0,o),Le(e,r,n))}}var Pe=o(function(e,t){return 1===e?i(t):$e(e,Le(e,[],t))});const Ue=Pe;function qe(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t}const Re=o(function(e,t){return e&&t});function Ve(e,t,n){for(var r=0,s=n.length;r<s;)t=e(t,n[r]),r+=1;return t}const Ge=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};function He(e){return"[object String]"===Object.prototype.toString.call(e)}const ze=i(function(e){return!!Ge(e)||!!e&&("object"==typeof e&&(!He(e)&&(0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))});var Ke="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function Je(e,t,n){return function(r,s,i){if(ze(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[Ke])return n(r,s,i[Ke]());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 We(e,t,n){for(var r=n.next();!r.done;)t=e(t,r.value),r=n.next();return t}function Xe(e,t,n,r){return n[r](e,t)}const Ye=Je(Ve,Xe,We);function Qe(e,t,n){return function(){if(0===arguments.length)return n();var r=arguments[arguments.length-1];if(!Ge(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 et=function(){return this.xf["@@transducer/init"]()},tt=function(e){return this.xf["@@transducer/result"](e)};var nt=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=et,e.prototype["@@transducer/result"]=tt,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},e}();var rt=o(Qe(["fantasy-land/map","map"],function(e){return function(t){return new nt(e,t)}},function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return Ue(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return Ve(function(n,r){return n[r]=e(t[r]),n},{},b(t));default:return Ze(e,t)}}));const st=rt;const it=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))}:Ye(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,st(n,t))},[],e)});var ot=o(function(e,t){var n=Ue(e,t);return Ue(e,function(){return Ve(it,st(n,arguments[0]),Array.prototype.slice.call(arguments,1))})});const at=ot;var ct=i(function(e){return at(e.length,e)});const lt=ct;const ut=o(function(e,t){return qe(e)?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:lt(Re)(e,t)});function ht(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function pt(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 dt(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 ft=o(function(e,t){return $e(e.length,function(){return e.apply(t,arguments)})});const mt=ft;function yt(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 gt(e,t,n,r){return e["@@transducer/result"](n[r](mt(e["@@transducer/step"],e),t))}const bt=Je(dt,gt,yt);var xt=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 wt=pt(function(e,t,n){return bt("function"==typeof e?function(e){return new xt(e)}(e):e,t,n)});const vt=wt;function kt(e,t){return function(){var n=arguments.length;if(0===n)return t();var r=arguments[n-1];return Ge(r)||"function"!=typeof r[e]?t.apply(this,arguments):r[e].apply(r,Array.prototype.slice.call(arguments,0,n-1))}}const Ot=pt(kt("slice",function(e,t,n){return Array.prototype.slice.call(n,e,t)}));const St=i(kt("tail",Ot(1,1/0)));function Et(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return $e(arguments[0].length,vt(ht,arguments[0],St(arguments)))}function At(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 _t(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 It=function(e){return(e<10?"0":"")+e};const Tt="function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+It(e.getUTCMonth()+1)+"-"+It(e.getUTCDate())+"T"+It(e.getUTCHours())+":"+It(e.getUTCMinutes())+":"+It(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function Ct(e){return"[object Object]"===Object.prototype.toString.call(e)}var jt=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=et,e.prototype["@@transducer/result"]=tt,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},e}();function Mt(e){return function(t){return new jt(e,t)}}var Nt=o(Qe(["fantasy-land/filter","filter"],Mt,function(e,t){return Ct(t)?Ve(function(n,r){return e(t[r])&&(n[r]=t[r]),n},{},b(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 Dt=Nt;const Ft=o(function(e,t){return Dt((n=e,function(){return!n.apply(this,arguments)}),t);var n});function Bt(e,t){var n=function(n){var r=t.concat([e]);return At(n,r)?"<Circular>":Bt(n,r)},r=function(e,t){return Ze(function(t){return _t(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,Ft(function(e){return/^\d+$/.test(e)},b(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):_t(Tt(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())+")":_t(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,b(e)).join(", ")+"}"}}const $t=i(function(e){return Bt(e,[])});const Lt=o(function(e,t){return e||t});const Pt=o(function(e,t){return qe(e)?function(){return e.apply(this,arguments)||t.apply(this,arguments)}:lt(Lt)(e,t)});const Ut=lt(i(function(e){return!e}));const qt=k(null);const Rt=Ut(qt);const Vt=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=$t(e),o=n(i,$t(t));return void 0!==o&&o===i?e:t}),Gt=Number.isInteger||function(e){return(e|0)===e};function Ht(e,t){return t[e<0?t.length+e:e]}const zt=o(function(e,t){if(null!=t)return Gt(e)?Ht(e,t):t[e]});const Kt=o(function(e,t){return st(zt(e),t)});const Jt=i(function(e){return Ue(vt(Vt,0,Kt("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 Wt=function(e,t){switch(arguments.length){case 0:return Wt;case 1:return function t(n){return 0===arguments.length?t:u(e,n)};default:return u(e,t)}};const Xt=Wt;const Yt=Ue(1,Et(x,Xt("GeneratorFunction")));const Qt=Ue(1,Et(x,Xt("AsyncFunction")));const Zt=Jt([Et(x,Xt("Function")),Yt,Qt]);function en(e){return en="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},en(e)}const tn=function(e){return"object"===en(e)};var nn=Ue(1,ut(Rt,Pt(tn,Zt)));const rn=Ue(1,ut(nn,Et($t,k("[object Promise]")))),sn=e=>void 0!==e.style,on=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,an=(e,t)=>0===t.length||!!V(e)&&(!e.isMetaEmpty&&(!!e.hasMetaProperty("classes")&&t.every(t=>e.classes.includes(t))));class cn extends D{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(un).join("");const c=new cn(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=hn(t,r);n.push(e.value),r=e.next}return n}(this.content))}}const ln="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function un(e){let t=e>>>0,n="";do{let e=31&t;t>>>=5,0!==t&&(e|=32),n+=ln[e]}while(0!==t);return n}function hn(e,t=0){let n=0,r=0,s=t;for(;;){const t=e[s++],i=ln.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 pn=cn;const dn=class extends Be{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};const fn=class extends dn{};const mn=class extends dn{},yn=(e,t)=>{const{visited:n=new WeakMap}=t,r={...t,visited:n};if(n.has(e))return n.get(e);const s=wn(e);n.set(e,s);const{content:i}=e;return Array.isArray(i)?s.content=i.map(e=>yn(e,r)):V(i)?s.content=yn(i,r):s.content=i instanceof I?gn(i,r):i,s},gn=(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?yn(s,r):void 0,a=void 0!==i?yn(i,r):void 0,c=new I(o,a);return n.set(e,c),c},bn=(e,t={})=>{if(e instanceof I)return gn(e,t);if(e instanceof C)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=>yn(e,r)),i=new C(s);return n.set(e,i),i})(e,t);if(V(e))return yn(e,t);throw new fn("Value provided to cloneDeep function couldn't be cloned",{value:e})};bn.safe=e=>{try{return bn(e)}catch{return e}};const xn=e=>{const{key:t,value:n}=e;return new I(t,n)},wn=e=>{const t=new(0,e.constructor);t.element=e.element,e.isMetaEmpty||(t.meta=e.meta.cloneDeep()),e.isAttributesEmpty||(t.attributes=bn(e.attributes)),on(e)&&pn.transfer(e,t),sn(e)&&(t.style=E(e.style));const{content:n}=e;return V(n)?t.content=wn(n):Array.isArray(n)?t.content=[...n]:t.content=n instanceof I?xn(n):n,t},vn=e=>{if(e instanceof I)return xn(e);if(e instanceof C)return(e=>{const t=[...e];return new C(t)})(e);if(V(e))return wn(e);throw new mn("Value provided to cloneShallow function couldn't be cloned",{value:e})};vn.safe=e=>{try{return vn(e)}catch{return e}};const kn=e=>{const t=e?.element;return void 0===t||"element"===t?"Element":`${t.charAt(0).toUpperCase()}${t.slice(1)}Element`},On=e=>V(e),Sn=e=>vn(e),En=(e,t,n)=>{X(e)?e.value=n:Array.isArray(e)?e[t]=null===n?void 0:n:null===n?delete e[t]:e[t]=n},An=e=>X(e)?["key","value"]:J(e)||W(e)?["content"]:[],_n=(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]}},In=(e,t,n)=>{if(void 0===t)return null;const r=e,s=n?"leave":"enter",i=_n(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=_n(o,t);if("function"==typeof e)return e}return null},Tn=(e,t={})=>{const{visitFnGetter:n=In,nodeTypeGetter:r=kn,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=jn(t,c),r=i.call(e[u],n);if(rn(r))throw new Be("Async visitor not supported in sync mode",{visitor:e[u],visitFn:i});if(n.shouldStop&&(a[u]=o),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(a.every(e=>e===o)&&t.stop(),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=jn(t,s),r=i.call(e[c],n);if(rn(r))throw new Be("Async visitor not supported in sync mode",{visitor:e[c],visitFn:i});if(n.shouldStop&&(a[c]=o),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);a.every(e=>e===o)&&t.stop()}}},Cn=(e,t={})=>{const{visitFnGetter:n=In,nodeTypeGetter:r=kn,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=jn(t,c),r=await i.call(e[u],n);if(n.shouldStop&&(a[u]=o),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(a.every(e=>e===o)&&t.stop(),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=jn(t,s),r=await i.call(e[c],n);if(n.shouldStop&&(a[c]=o),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);a.every(e=>e===o)&&t.stop()}}};function jn(e,t){return new je(t,e.parent,e.parentPath,e.key,e.inList)}function*Mn(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=[],b=e,x=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:x?.key,b=d,d=v.pop(),w=x?.parentPath?.parentPath??null,k)if(l)for(const[e,t]of g)u(b,e,t);else if(f){b=b.slice();let e=0;for(const[t,n]of g){const r=t-e;null===n?(b.splice(r,1),e+=1):b[r]=n}}else{b=a(b);for(const[e,t]of g)b[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,b])}f=e}}else if(void 0!==d&&(n=f?y:m[y],b=d[n],void 0===b))continue;if(!Array.isArray(b)){if(!o(b))throw new Be(`Invalid AST Node: ${String(b)}`,{node:b});if(c&&v.includes(b))continue;x=new je(b,d,w,n,f);const r=In(t,i(b),e);if(r){for(const[e,n]of Object.entries(s))t[e]=n;const i=yield{visitFn:r,path:x,isLeaving:e};if(x.shouldStop)break;if(x.shouldSkip&&!e)continue;if(x.removed){if(g.push([n,null]),!e)continue}else if(x._wasReplaced()){const t=x._getReplacementNode();if(g.push([n,t]),!e){if(!o(t))continue;b=t}}else if(void 0!==i&&(g.push([n,i]),!e)){if(!o(i))continue;b=i}x._markStale()}}if(!e){if(p={inArray:f,index:y,keys:m,edits:g,parentPath:w,prev:p},f=Array.isArray(b),f)m=b;else if(h)m=r(b);else{const e=i(b);m=void 0!==e?r[e]??[]:[]}y=-1,g=[],void 0!==d&&v.push(d),d=b,w=x}}while(void 0!==p);return 0!==g.length?g.at(-1)[1]:e}Tn[Symbol.for("nodejs.util.promisify.custom")]=Cn;const Nn=(e,t,n={})=>{const r=Mn(e,t,{keyMap:n.keyMap??An,state:n.state??{},nodeTypeGetter:n.nodeTypeGetter??kn,nodePredicate:n.nodePredicate??On,nodeCloneFn:n.nodeCloneFn??Sn,detectCycles:n.detectCycles??!0,mutable:n.mutable??!1,mutationFn:n.mutationFn??En});let s=r.next();for(;!s.done;){const e=s.value,n=e.visitFn.call(t,e.path);if(rn(n))throw new Be("Async visitor not supported in sync mode",{visitor:t,visitFn:e.visitFn});s=r.next(n)}return s.value},Dn=async(e,t,n={})=>{const r=Mn(e,t,{keyMap:n.keyMap??An,state:n.state??{},nodeTypeGetter:n.nodeTypeGetter??kn,nodePredicate:n.nodePredicate??On,nodeCloneFn:n.nodeCloneFn??Sn,detectCycles:n.detectCycles??!0,mutable:n.mutable??!1,mutationFn:n.mutationFn??En});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};Nn[Symbol.for("nodejs.util.promisify.custom")]=Dn,je.prototype.traverse=function(e,t){return Nn(this.node,e,t)},je.prototype.traverseAsync=function(e,t){return Dn(this.node,e,t)};var Fn=pt(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 Bn=Fn;var $n=pt(function e(t,n,r){return Bn(function(n,r,s){return Ct(r)&&Ct(s)?e(t,r,s):t(n,r,s)},n,r)});const Ln=$n;const Pn=o(function(e,t){return Ln(function(e,t,n){return n},e,t)});const Un=o(function(e,t){return null==t||t!=t?e:t});const qn=pt(function(e,t,n){return Un(e,zt(t,n))});function Rn(e,t){for(var n=t,r=0;r<e.length;r+=1){if(null==n)return;var s=e[r];n=Gt(s)?Ht(s,n):n[s]}return n}const Vn=o(Rn);const Gn=Ot(0,-1);var Hn=o(function(e,t){return e.apply(this,t)});const zn=Hn;const Kn=Ut(Zt);var Jn=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:Ge(e)?[]:He(e)?"":Ct(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 Wn=Jn;const Xn=i(function(e){return null!=e&&k(e,Wn(e))});const Yn=ut(Ue(1,Zt(Array.isArray)?Array.isArray:Et(x,Xt("Array"))),Xn);const Qn=Ue(3,function(e,t,n){var r=Vn(e,n),s=Vn(Gn(e),n);if(!Kn(r)&&!Yn(e)){var i=mt(r,s);return zn(i,t)}});const Zn=class extends N{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 er=class extends N{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 tr=class extends D{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 nr=class extends D{constructor(e,t,n){super(e,t,n),this.element="comment"}};const rr=class extends U{constructor(e,t,n){super(e,t,n),this.element="parseResult"}get api(){return this.filter(e=>an(e,["api"])).first}get results(){return this.filter(e=>an(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&&an(e,["warning"]))}get errors(){return this.filter(e=>"annotation"===e.element&&an(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)}},sr=e=>e instanceof Zn,ir=e=>e instanceof er;class or extends R{constructor(e,t,n){super(e,t,n),this.element="__styles__"}static transfer(e,t){t.style=e.style}static from(e){if(e.style)return new or(e.style)}applyTo(e){e.style=this.toValue()}}const ar=or;const cr=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){const n=this.serialiseMeta(e);n&&(t.meta=n.meta,n.rawKeys.length>0&&(t.__meta_raw__=n.rawKeys))}if(e.isAttributesEmpty||(t.attributes=this.serialiseObject(e.attributes)),!(e instanceof pn)){const n=pn.from(e);n&&(t.meta||(t.meta={}),t.meta.__mappings__=this.serialise(n))}if(!(e instanceof ar)){const n=ar.from(e);n&&(t.meta||(t.meta={}),t.meta.__styles__=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,r;t.element!==e.element&&(t.element=e.element);let s=e.meta;if(e.meta?.__mappings__||e.meta?.__styles__){const{__mappings__:t,__styles__:i,...o}=e.meta;n=t,r=i,s=Object.keys(o).length>0?o:void 0}const i=e.__meta_raw__?new Set(e.__meta_raw__):void 0;if(s)for(const[e,n]of Object.entries(s)){const r=this.deserialise(n);t.setMetaProperty(e,i?.has(e)?r.toValue():r)}if(n){this.deserialise(n).applyTo(t)}if(r){this.deserialise(r).applyTo(t)}e.attributes&&this.deserialiseObject(e.attributes,t.attributes);const o=this.deserialiseContent(e.content);return void 0===o&&null!==t.content||(t.content=o),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}serialiseMeta(e){const t={},n=[];let r=!1;for(const[s,i]of Object.entries(e.meta))if(i instanceof this.namespace.elements.Element)t[s]=this.serialise(i),r=!0;else if(void 0!==i){const o=e.refract(i);t[s]=this.serialise(o),n.push(s),r=!0}return r?{meta:t,rawKeys:n}:void 0}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]))})}},lr=e=>null===e,ur=e=>"string"==typeof e,hr=e=>"number"==typeof e,pr=e=>"boolean"==typeof e,dr=e=>null!==e&&"object"==typeof e;class fr{elementMap={};elementDetection=[];Element;KeyValuePair;_elements;_attributeElementKeys=[];_attributeElementArrayKeys=[];constructor(e){this.Element=N,this.KeyValuePair=I,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",B).register("string",D).register("number",F).register("boolean",$).register("array",U).register("object",R).register("member",q).register("ref",er).register("link",Zn).register("sourceMap",pn),this.detect(lr,B,!1).detect(ur,D,!1).detect(hr,F,!1).detect(pr,$,!1).detect(Array.isArray,U,!1).detect(dr,R,!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 cr(this)}}cr.prototype.Namespace=fr;const mr=new fr,yr={isElement:V,isStringElement:G,isNumberElement:H,isNullElement:z,isBooleanElement:K,isArrayElement:J,isObjectElement:W,isMemberElement:X,isPrimitiveElement:Y,isLinkElement:sr,isRefElement:ir,isAnnotationElement:e=>e instanceof tr,isCommentElement:e=>e instanceof nr,isParseResultElement:e=>e instanceof rr,isSourceMapElement:e=>e instanceof pn,hasElementStyle:sn,hasElementSourceMap:on,includesSymbols:(e,t)=>{if(0===t.length)return!0;if(!e.hasAttributesProperty("symbols"))return!1;const n=e.attributes.get("symbols");return!!J(n)&&t.every(e=>n.includes(e))},includesClasses:an},gr=()=>({predicates:yr,namespace:mr}),br={toolboxCreator:gr,visitorOptions:{exposeEdits:!0}},xr=(e,t,n={})=>{if(0===t.length)return e;const r=Pn(br,n),{toolboxCreator:s,visitorOptions:i}=r,o=s(),a=t.map(e=>e(o)),c=Tn(a.map(qn({},"visitor")),i);a.forEach(Qn(["pre"],[]));const l=Nn(e,c);return a.forEach(Qn(["post"],[])),l};xr[Symbol.for("nodejs.util.promisify.custom")]=async(e,t,n={})=>{if(0===t.length)return e;const r=Pn(br,n),{toolboxCreator:s,visitorOptions:i}=r,o=s(),a=t.map(e=>e(o)),c=Cn(a.map(qn({},"visitor")),i);await Promise.allSettled(a.map(Qn(["pre"],[])));const l=await Dn(e,c);return await Promise.allSettled(a.map(Qn(["post"],[]))),l};var wr=n(279),vr=n.n(wr);const kr=class extends Be{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};class Or{uuid;identityMap;constructor({length:e=6}={}){this.uuid=new(vr())({length:e}),this.identityMap=new WeakMap}identify(e){if(!V(e))throw new kr("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.id;if("string"==typeof t&&""!==t)return t}if(this.identityMap.has(e))return this.identityMap.get(e);const t=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 Sr=new Or,Er=({length:e=6}={})=>()=>{let t;return{pre(){t=new Or({length:e})},visitor:{enter(e){e.node.id=t.identify(e.node)}},post(){t=null}}},Ar=({length:e=6}={})=>()=>{let t;return{pre(){t=new Or({length:e})},visitor:{enter(e){Y(e.node)||(e.node.id=t.identify(e.node))}},post(){t=null}}};const _r=class extends Fe{};const Ir=class extends _r{};const Tr=class extends Array{unknownMediaType="application/octet-stream";filterByFormat(){throw new Ir("filterByFormat method in MediaTypes class is not yet implemented.")}findBy(){throw new Ir("findBy method in MediaTypes class is not yet implemented.")}latest(){throw new Ir("latest method in MediaTypes class is not yet implemented.")}};var Cr=i(function(e){return function(){return e}})(void 0);const jr=k(Cr()),Mr=(e,t=new WeakMap)=>(X(e)?(t.set(e.key,e),Mr(e.key,t),t.set(e.value,e),Mr(e.value,t)):e.children.forEach(n=>{t.set(n,e),Mr(n,t)}),t);const Nr=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??Mr(this.element);const n=this.edges.get(e);return jr(n)?void 0:(W(n)?((e,t,n)=>{const r=n.get(e);W(r)&&(r.content=r.map((s,i,o)=>o===e?(n.delete(e),n.set(t,r),t):o))})(e,t,this.edges):J(n)?((e,t,n)=>{const r=n.get(e);J(r)&&(r.content=r.map(s=>s===e?(n.delete(e),n.set(t,r),t):s))})(e,t,this.edges):X(n)&&((e,t,n)=>{const r=n.get(e);X(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)}},Dr=(e,t,n)=>new Nr({element:n}).transclude(e,t),Fr=Nr;var Br=o(function(e,t){return Ve(function(n,r){return n[r]=e(t[r],r,t),n},{},b(t))});const $r=Br;const Lr=i(function(e){return null==e});var Pr=o(function(e,t){if(0===e.length||Lr(t))return!1;for(var n=t,r=0;r<e.length;){if(Lr(n)||!l(e[r],n))return!1;n=n[e[r]],r+=1}return!0});const Ur=Pr;var qr=o(function(e,t){return Ur([e],t)});const Rr=qr;const Vr=pt(function(e,t,n){return e(zt(t,n))});const Gr=pt(function(e,t,n){return e(Rn(t,n))});const Hr=Ue(1,ut(Rt,tn));var zr=Et(x,Xt("Object")),Kr=Gr(ut(Zt,Et($t,k($t(Object)))),["constructor"]);const Jr=Ue(1,function(e){if(!Hr(e)||!zr(e))return!1;var t=Object.getPrototypeOf(e);return!!qt(t)||Kr(t)});const Wr=Ue(1,Et(x,Xt("String")));var Xr=i(function(e){return Ue(e.length,e)});const Yr=Xr;const Qr=o(function(e,t){return Ue(e+1,function(){var n=arguments[e];if(null!=n&&qe(n[t]))return n[t].apply(n,Array.prototype.slice.call(arguments,0,e));throw new TypeError($t(n)+' does not have a method named "'+t+'"')})});const Zr=Qr(1,"split");var es=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=et,e.prototype["@@transducer/result"]=tt,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 ts(e){return function(t){return new es(e,t)}}const ns=o(Qe(["dropWhile"],ts,function(e,t){for(var n=0,r=t.length;n<r&&e(t[n]);)n+=1;return Ot(n,1/0,t)}));const rs=Qr(1,"join");var ss=i(function(e){return Ue(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 is=ss(o(At));const os=Yr(function(e,t){return Et(Zr(""),ns(is(e)),rs(""))(t)}),as=new WeakMap,cs=e=>{if(as.has(e))return as.get(e);const t={},n=(e,r,s)=>("string"==typeof e.element&&(t[e.element]=e.$visitor?[...s,"$visitor"]:s),$r((e,t)=>{const i=[...s,t];if(Jr(e)&&Rr("$ref",e)&&Vr(Wr,"$ref",e)){const t=Vn(["$ref"],e),n=os("#/",t),s=Vn(n.split("/"),r),{$ref:i,...o}=e;return Object.keys(o).length>0&&Jr(s)?{...s,...o}:s}return Jr(e)?n(e,r,i):e},e)),r=n(e,e,[]);return r.elementMap=t,as.set(e,r),r},ls=(e,t=mr)=>{if(Wr(e))try{return t.fromRefract(JSON.parse(e))}catch{}return Jr(e)&&Rr("element",e)?t.fromRefract(e):t.toElement(e)},us=e=>{if(!V(e))return e;if(G(e)||H(e)||K(e)||z(e))return e.toValue();const t=new WeakMap,n=e=>{if(!V(e))return e;if(W(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(J(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 ir(e)?String(e.toValue()):sr(e)?G(e.href)?e.href.toValue():"":e.toValue()};return n(e)},hs=e=>e.style?.json??{},ps=(e,t,n,r)=>{if(r?.preserveStyle){const t=hs(e),r="number"==typeof n?n:"number"==typeof t.indent?t.indent:0,s=new Map,i=((e,t)=>{const n=new WeakSet,r=e=>{if(!V(e))return e;if(n.has(e))return null;if(n.add(e),W(e)){const t={};return e.forEach((e,n)=>{const s=V(n)?us(n):n;"string"==typeof s&&(t[s]=r(e))}),t}if(J(e)){const t=[];return e.forEach(e=>t.push(r(e))),t}if(ir(e))return String(us(e));if(sr(e))return G(e.href)?us(e.href):"";if(H(e)){const n=hs(e);if("string"==typeof n.rawContent){const e=`\0RAW${t.size}\0`;return t.set(e,n.rawContent),e}}return us(e)};return r(e)})(e,s);let o=JSON.stringify(i,null,r);for(const[e,t]of s)o=o.replace(JSON.stringify(e),t);return o}return JSON.stringify(us(e),t,n)},ds=Symbol.for("yaml.alias"),fs=Symbol.for("yaml.document"),ms=Symbol.for("yaml.map"),ys=Symbol.for("yaml.pair"),gs=Symbol.for("yaml.scalar"),bs=Symbol.for("yaml.seq"),xs=Symbol.for("yaml.node.type"),ws=e=>!!e&&"object"==typeof e&&e[xs]===ds,vs=e=>!!e&&"object"==typeof e&&e[xs]===fs,ks=e=>!!e&&"object"==typeof e&&e[xs]===ms,Os=e=>!!e&&"object"==typeof e&&e[xs]===ys,Ss=e=>!!e&&"object"==typeof e&&e[xs]===gs,Es=e=>!!e&&"object"==typeof e&&e[xs]===bs;function As(e){if(e&&"object"==typeof e)switch(e[xs]){case ms:case bs:return!0}return!1}function _s(e){if(e&&"object"==typeof e)switch(e[xs]){case ds:case ms:case gs:case bs:return!0}return!1}const Is=e=>(Ss(e)||As(e))&&!!e.anchor,Ts=Symbol("break visit"),Cs=Symbol("skip children"),js=Symbol("remove node");function Ms(e,t){const n=Bs(t);if(vs(e)){Ns(null,e.contents,n,Object.freeze([e]))===js&&(e.contents=null)}else Ns(null,e,n,Object.freeze([]))}function Ns(e,t,n,r){const s=$s(e,t,n,r);if(_s(s)||Os(s))return Ls(e,r,s),Ns(e,s,n,r);if("symbol"!=typeof s)if(As(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){const s=Ns(e,t.items[e],n,r);if("number"==typeof s)e=s-1;else{if(s===Ts)return Ts;s===js&&(t.items.splice(e,1),e-=1)}}}else if(Os(t)){r=Object.freeze(r.concat(t));const e=Ns("key",t.key,n,r);if(e===Ts)return Ts;e===js&&(t.key=null);const s=Ns("value",t.value,n,r);if(s===Ts)return Ts;s===js&&(t.value=null)}return s}async function Ds(e,t){const n=Bs(t);if(vs(e)){await Fs(null,e.contents,n,Object.freeze([e]))===js&&(e.contents=null)}else await Fs(null,e,n,Object.freeze([]))}async function Fs(e,t,n,r){const s=await $s(e,t,n,r);if(_s(s)||Os(s))return Ls(e,r,s),Fs(e,s,n,r);if("symbol"!=typeof s)if(As(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){const s=await Fs(e,t.items[e],n,r);if("number"==typeof s)e=s-1;else{if(s===Ts)return Ts;s===js&&(t.items.splice(e,1),e-=1)}}}else if(Os(t)){r=Object.freeze(r.concat(t));const e=await Fs("key",t.key,n,r);if(e===Ts)return Ts;e===js&&(t.key=null);const s=await Fs("value",t.value,n,r);if(s===Ts)return Ts;s===js&&(t.value=null)}return s}function Bs(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):ks(t)?n.Map?.(e,t,r):Es(t)?n.Seq?.(e,t,r):Os(t)?n.Pair?.(e,t,r):Ss(t)?n.Scalar?.(e,t,r):ws(t)?n.Alias?.(e,t,r):void 0}function Ls(e,t,n){const r=t[t.length-1];if(As(r))r.items[e]=n;else if(Os(r))"key"===e?r.key=n:r.value=n;else{if(!vs(r)){const e=ws(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${e} parent`)}r.contents=n}}Ms.BREAK=Ts,Ms.SKIP=Cs,Ms.REMOVE=js,Ds.BREAK=Ts,Ds.SKIP=Cs,Ds.REMOVE=js;const Ps={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Us=e=>e.replace(/[!,[\]{}]/g,e=>Ps[e]);class qs{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},qs.defaultYaml,e),this.tags=Object.assign({},qs.defaultTags,t)}clone(){const e=new qs(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new qs(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:qs.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},qs.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:qs.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},qs.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+Us(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&&_s(e.contents)){const t={};Ms(e.contents,(e,n)=>{_s(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 Rs(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 Vs(e){const t=new Set;return Ms(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Gs(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Hs(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=Hs(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=Hs(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=Hs(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=Hs(e,r,t,n);void 0===s?delete r[t]:s!==n&&(r[t]=s)}return e.call(t,n,r)}function zs(e,t,n){if(Array.isArray(e))return e.map((e,t)=>zs(e,String(t),n));if(e&&"function"==typeof e.toJSON){if(!n||!Is(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)}qs.defaultYaml={explicit:!1,version:"1.2"},qs.defaultTags={"!!":"tag:yaml.org,2002:"};class Ks{constructor(e){Object.defineProperty(this,xs,{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(!vs(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=zs(this,"",i);if("function"==typeof r)for(const{count:e,res:t}of i.anchors.values())r(t,e);return"function"==typeof s?Hs(s,{"":o},"",o):o}}class Js extends Ks{constructor(e){super(ds),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=[],Ms(e,{Node:(e,t)=>{(ws(t)||Is(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||(zs(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=Ws(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(Rs(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 Ws(e,t,n){if(ws(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}if(As(t)){let r=0;for(const s of t.items){const t=Ws(e,s,n);t>r&&(r=t)}return r}if(Os(t)){const r=Ws(e,t.key,n),s=Ws(e,t.value,n);return Math.max(r,s)}return 1}const Xs=e=>!e||"function"!=typeof e&&"object"!=typeof e;class Ys extends Ks{constructor(e){super(gs),this.value=e}toJSON(e,t){return t?.keep?this.value:zs(this.value,e,t)}toString(){return String(this.value)}}Ys.BLOCK_FOLDED="BLOCK_FOLDED",Ys.BLOCK_LITERAL="BLOCK_LITERAL",Ys.PLAIN="PLAIN",Ys.QUOTE_DOUBLE="QUOTE_DOUBLE",Ys.QUOTE_SINGLE="QUOTE_SINGLE";function Qs(e,t,n){if(vs(e)&&(e=e.contents),_s(e))return e;if(Os(e)){const t=n.schema[ms].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 Js(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 Ys(e);return c&&(c.node=t),t}l=e instanceof Map?o[ms]:Symbol.iterator in Object(e)?o[bs]:o[ms]}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 Ys(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Zs(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 Qs(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 ei=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class ti extends Ks{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=>_s(t)||Os(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(ei(e))this.add(t);else{const[n,...r]=e,s=this.get(n,!0);if(As(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,Zs(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(As(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&&Ss(s)?s.value:s:As(s)?s.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Os(t))return!1;const n=t.value;return null==n||e&&Ss(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!!As(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(As(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,Zs(this.schema,r,t))}}}}const ni=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ri(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const si=(e,t,n)=>e.endsWith("\n")?ri(n,t):n.includes("\n")?"\n"+ri(n,t):(e.endsWith(" ")?"":" ")+n,ii="flow",oi="block",ai="quoted";function ci(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===oi&&(m=li(e,m,t.length),-1!==m&&(d=m+c));for(let r;r=e[m+=1];){if(n===ai&&"\\"===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===oi&&(m=li(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===ai){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 b=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?b=`\n${t}${e.slice(0,i)}`:(n===ai&&u[s]&&(b+=`${e[s]}\\`),b+=`\n${t}${e.slice(s+1,i)}`)}return b}function li(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 ui=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),hi=e=>/^(%|---|\.\.\.)/m.test(e);function pi(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(hi(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:ci(o,i,ai,ui(t,!1))}function di(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return pi(e,t);const n=t.indent||(hi(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&\n${n}`)+"'";return t.implicitKey?r:ci(r,n,ii,ui(t,!1))}function fi(e,t){const{singleQuote:n}=t.options;let r;if(!1===n)r=pi;else{const t=e.includes('"'),s=e.includes("'");r=t&&!s?di:s&&!t?pi:n?di:pi}return r(e,t)}let mi;try{mi=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{mi=/\n+(?!\n|$)/g}function yi({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 fi(n,r);const l=r.indent||(r.forceBlockIndent||hi(n)?" ":""),u="literal"===o||"folded"!==o&&t!==Ys.BLOCK_FOLDED&&(t===Ys.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(mi,`$&${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 b=n.substring(0,g<m?g+1:m);b&&(n=n.substring(b.length),b=b.replace(/\n+/g,`$&${l}`));let x=(y?l?"2":"1":"")+h;if(e&&(x+=" "+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=ui(r,!0);"folded"!==o&&t!==Ys.BLOCK_FOLDED&&(i.onOverflow=()=>{s=!0});const a=ci(`${b}${e}${d}`,l,oi,i);if(!s)return`>${x}\n${l}${a}`}return`|${x}\n${l}${b}${n=n.replace(/\n+/g,`$&${l}`)}${d}`}function gi(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!==Ys.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=Ys.QUOTE_DOUBLE);const c=e=>{switch(e){case Ys.BLOCK_FOLDED:case Ys.BLOCK_LITERAL:return s||i?fi(o.value,t):yi(o,t,n,r);case Ys.QUOTE_DOUBLE:return pi(o.value,t);case Ys.QUOTE_SINGLE:return di(o.value,t);case Ys.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 fi(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes("\n")?fi(i,t):yi(e,t,n,r);if(!a&&!u&&s!==Ys.PLAIN&&i.includes("\n"))return yi(e,t,n,r);if(hi(i)){if(""===c)return t.forceBlockIndent=!0,yi(e,t,n,r);if(a&&c===l)return fi(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 fi(i,t)}return a?h:ci(h,c,ii,ui(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 bi(e,t){const n=Object.assign({blockQuote:!0,commentString:ni,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 xi(e,t,n,r){if(Os(e))return e.toString(t,n,r);if(ws(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=_s(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(Ss(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=(Ss(e)||As(e))&&e.anchor;i&&Rs(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):Ss(i)?gi(i,t,n,r):i.toString(t,n,r);return o?Ss(i)||"{"===a[0]||"["===a[0]?`${o} ${a}`:`${o}\n${t.indent}${a}`:a}const wi="<<",vi={identify:e=>e===wi||"symbol"==typeof e&&e.description===wi,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ys(Symbol(wi)),{addToJSMap:ki}),stringify:()=>wi};function ki(e,t,n){if(n=e&&ws(n)?n.resolve(e.doc):n,Es(n))for(const r of n.items)Oi(e,t,r);else if(Array.isArray(n))for(const r of n)Oi(e,t,r);else Oi(e,t,n)}function Oi(e,t,n){const r=e&&ws(n)?n.resolve(e.doc):n;if(!ks(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 Si(e,t,{key:n,value:r}){if(_s(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(((e,t)=>(vi.identify(t)||Ss(t)&&(!t.type||t.type===Ys.PLAIN)&&vi.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===vi.tag&&e.default))(e,n))ki(e,t,r);else{const s=zs(n,"",e);if(t instanceof Map)t.set(s,zs(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(_s(e)&&n?.doc){const t=bi(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=zs(r,i,e);i in t?Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[i]=o}}return t}function Ei(e,t,n){const r=Qs(e,void 0,n),s=Qs(t,void 0,n);return new Ai(r,s)}class Ai{constructor(e,t=null){Object.defineProperty(this,xs,{value:ys}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return _s(t)&&(t=t.clone(e)),_s(n)&&(n=n.clone(e)),new Ai(t,n)}toJSON(e,t){return Si(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=_s(e)&&e.comment||null;if(h){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(As(e)||!_s(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||As(e)||(Ss(e)?e.type===Ys.BLOCK_FOLDED||e.type===Ys.BLOCK_LITERAL:"object"==typeof e));n=Object.assign({},n,{allNullValues:!1,implicitKey:!d&&(h||!i),indent:a+c});let f,m,y,g=!1,b=!1,x=xi(e,n,()=>g=!0,()=>b=!0);if(!d&&!n.inFlow&&x.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(),""===x?"?":d?`? ${x}`:x}else if(i&&!h||null==t&&d)return x=`? ${x}`,p&&!g?x+=si(x,n.indent,l(p)):b&&s&&s(),x;g&&(p=null),d?(p&&(x+=si(x,n.indent,l(p))),x=`? ${x}\n${a}:`):(x=`${x}:`,p&&(x+=si(x,n.indent,l(p)))),_s(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||!Ss(t)||(n.indentAtStart=x.length+1),b=!1,u||!(c.length>=2)||n.inFlow||d||!Es(t)||t.flow||t.tag||t.anchor||(n.indent=n.indent.substring(2));let w=!1;const v=xi(t,n,()=>w=!0,()=>b=!0);let k=" ";if(p||f||m)k=f?"\n":"",m&&(k+=`\n${ri(l(m),n.indent)}`),""!==v||n.inFlow?k+=`\n${n.indent}`:"\n"===k&&y&&(k="\n\n");else if(!d&&As(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 x+=k+v,n.inFlow?w&&r&&r():y&&!w?x+=si(x,n.indent,l(y)):b&&s&&s(),x}(this,e,t,n):JSON.stringify(this)}}function _i(e,t,n){return(t.inFlow??e.flow?Ti:Ii)(e,t,n)}function Ii({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(_s(s))!h&&s.spaceBefore&&p.push(""),Ci(n,p,s.commentBefore,h),s.comment&&(o=s.comment);else if(Os(s)){const e=_s(s.key)?s.key:null;e&&(!h&&e.spaceBefore&&p.push(""),Ci(n,p,e.commentBefore,h))}h=!1;let a=xi(s,u,()=>o=null,()=>h=!0);o&&(a+=si(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"+ri(l(e),c),a&&a()):h&&o&&o(),d}function Ti({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(_s(s))s.spaceBefore&&h.push(""),Ci(t,h,s.commentBefore,!1),s.comment&&(i=s.comment);else if(Os(s)){const e=_s(s.key)?s.key:null;e&&(e.spaceBefore&&h.push(""),Ci(t,h,e.commentBefore,!1),e.comment&&(l=!0));const n=_s(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=xi(s,c,()=>i=null);n<e.length-1&&(o+=","),i&&(o+=si(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 Ci({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const s=ri(t(r),e);n.push(s.trimStart())}}function ji(e,t){const n=Ss(t)?t.value:t;for(const r of e)if(Os(r)){if(r.key===t||r.key===n)return r;if(Ss(r.key)&&r.key.value===n)return r}}class Mi extends ti{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ms,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(Ei(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=Os(e)?e:e&&"object"==typeof e&&"key"in e?new Ai(e.key,e.value):new Ai(e,e?.value);const r=ji(this.items,n.key),s=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${n.key} already set`);Ss(r.value)&&Xs(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=ji(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=ji(this.items,e),r=n?.value;return(!t&&Ss(r)?r.value:r)??void 0}has(e){return!!ji(this.items,e)}set(e,t){this.add(new Ai(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)Si(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(const e of this.items)if(!Os(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})),_i(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const Ni={collection:"map",default:!0,nodeClass:Mi,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(ks(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,n)=>Mi.from(e,t,n)};class Di extends ti{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(bs,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=Fi(e);if("number"!=typeof t)return!1;return this.items.splice(t,1).length>0}get(e,t){const n=Fi(e);if("number"!=typeof n)return;const r=this.items[n];return!t&&Ss(r)?r.value:r}has(e){const t=Fi(e);return"number"==typeof t&&t<this.items.length}set(e,t){const n=Fi(e);if("number"!=typeof n)throw new Error(`Expected a valid index, not ${e}.`);const r=this.items[n];Ss(r)&&Xs(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(zs(e,String(r++),t));return n}toString(e,t,n){return e?_i(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(Qs(i,void 0,n))}}return s}}function Fi(e){let t=Ss(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}const Bi={collection:"seq",default:!0,nodeClass:Di,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(Es(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,n)=>Di.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)=>gi(e,t=Object.assign({actualString:!0},t),n,r)},Li={identify:e=>null==e,createNode:()=>new Ys(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ys(null),stringify:({source:e},t)=>"string"==typeof e&&Li.test.test(e)?e:t.options.nullStr},Pi={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ys("t"===e[0]||"T"===e[0]),stringify({source:e,value:t},n){if(e&&Pi.test.test(e)){if(t===("t"===e[0]||"T"===e[0]))return e}return t?n.options.trueStr:n.options.falseStr}};function Ui({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 qi={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:Ui},Ri={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():Ui(e)}},Vi={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 Ys(parseFloat(e)),n=e.indexOf(".");return-1!==n&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-n-1),t},stringify:Ui},Gi=e=>"bigint"==typeof e||Number.isInteger(e),Hi=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function zi(e,t,n){const{value:r}=e;return Gi(r)&&r>=0?n+r.toString(t):Ui(e)}const Ki={identify:e=>Gi(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Hi(e,2,8,n),stringify:e=>zi(e,8,"0o")},Ji={identify:Gi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Hi(e,0,10,n),stringify:Ui},Wi={identify:e=>Gi(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Hi(e,2,16,n),stringify:e=>zi(e,16,"0x")},Xi=[Ni,Bi,$i,Li,Pi,Ki,Ji,Wi,qi,Ri,Vi];function Yi(e){return"bigint"==typeof e||Number.isInteger(e)}const Qi=({value:e})=>JSON.stringify(e),Zi=[Ni,Bi].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Qi},{identify:e=>null==e,createNode:()=>new Ys(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Qi},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:Qi},{identify:Yi,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})=>Yi(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:Qi}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),eo={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=Ys.BLOCK_LITERAL),t!==Ys.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===Ys.BLOCK_LITERAL?"\n":" ")}return gi({comment:e,type:t,value:a},r,s,i)}};function to(e,t){if(Es(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Os(r)){if(ks(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const e=r.items[0]||new Ai(new Ys(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]=Os(r)?r:new Ai(r)}}else t("Expected a sequence for this tag");return e}function no(e,t,n){const{replacer:r}=n,s=new Di(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(Ei(o,a,n))}return s}const ro={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:to,createNode:no};class so extends Di{constructor(){super(),this.add=Mi.prototype.add.bind(this),this.delete=Mi.prototype.delete.bind(this),this.get=Mi.prototype.get.bind(this),this.has=Mi.prototype.has.bind(this),this.set=Mi.prototype.set.bind(this),this.tag=so.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(Os(e)?(r=zs(e.key,"",t),s=zs(e.value,r,t)):r=zs(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=no(e,t,n),s=new this;return s.items=r.items,s}}so.tag="tag:yaml.org,2002:omap";const io={collection:"seq",identify:e=>e instanceof Map,nodeClass:so,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=to(e,t),r=[];for(const{key:e}of n.items)Ss(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new so,n)},createNode:(e,t,n)=>so.from(e,t,n)};function oo({value:e,source:t},n){return t&&(e?ao:co).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const ao={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 Ys(!0),stringify:oo},co={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 Ys(!1),stringify:oo},lo={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:Ui},uo={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():Ui(e)}},ho={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 Ys(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:Ui},po=e=>"bigint"==typeof e||Number.isInteger(e);function fo(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 mo(e,t,n){const{value:r}=e;if(po(r)){const e=r.toString(t);return r<0?"-"+n+e.substr(1):n+e}return Ui(e)}const yo={identify:po,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>fo(e,2,2,n),stringify:e=>mo(e,2,"0b")},go={identify:po,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>fo(e,1,8,n),stringify:e=>mo(e,8,"0")},bo={identify:po,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>fo(e,0,10,n),stringify:Ui},xo={identify:po,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>fo(e,2,16,n),stringify:e=>mo(e,16,"0x")};class wo extends Mi{constructor(e){super(e),this.tag=wo.tag}add(e){let t;t=Os(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new Ai(e.key,null):new Ai(e,null);ji(this.items,t.key)||this.items.push(t)}get(e,t){const n=ji(this.items,e);return!t&&Os(n)?Ss(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=ji(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Ai(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(Ei(e,null,n));return s}}wo.tag="tag:yaml.org,2002:set";const vo={collection:"map",identify:e=>e instanceof Set,nodeClass:wo,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>wo.from(e,t,n),resolve(e,t){if(ks(e)){if(e.hasAllNullValues(!0))return Object.assign(new wo,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function ko(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 Oo(e){let{value:t}=e,n=e=>e;if("bigint"==typeof t)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Ui(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 So={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})=>ko(e,n),stringify:Oo},Eo={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=>ko(e,!1),stringify:Oo},Ao={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(Ao.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=ko(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$/,"")??""},_o=[Ni,Bi,$i,Li,ao,co,yo,go,bo,xo,lo,uo,ho,eo,vi,io,ro,vo,So,Eo,Ao],Io=new Map([["core",Xi],["failsafe",[Ni,Bi,$i]],["json",Zi],["yaml11",_o],["yaml-1.1",_o]]),To={binary:eo,bool:Pi,float:Vi,floatExp:Ri,floatNaN:qi,floatTime:Eo,int:Ji,intHex:Wi,intOct:Ki,intTime:So,map:Ni,merge:vi,null:Li,omap:io,pairs:ro,seq:Bi,set:vo,timestamp:Ao},Co={"tag:yaml.org,2002:binary":eo,"tag:yaml.org,2002:merge":vi,"tag:yaml.org,2002:omap":io,"tag:yaml.org,2002:pairs":ro,"tag:yaml.org,2002:set":vo,"tag:yaml.org,2002:timestamp":Ao};function jo(e,t,n){const r=Io.get(t);if(r&&!e)return n&&!r.includes(vi)?r.concat(vi):r.slice();let s=r;if(!s){if(!Array.isArray(e)){const e=Array.from(Io.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(vi)),s.reduce((e,t)=>{const n="string"==typeof t?To[t]:t;if(!n){const e=JSON.stringify(t),n=Object.keys(To).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 Mo=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class No{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:s,sortMapEntries:i,toStringDefaults:o}){this.compat=Array.isArray(e)?jo(e,"compat"):e?jo(null,e):null,this.name="string"==typeof s&&s||"core",this.knownTags=r?Co:{},this.tags=jo(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,ms,{value:Ni}),Object.defineProperty(this,gs,{value:$i}),Object.defineProperty(this,bs,{value:Bi}),this.sortMapEntries="function"==typeof i?i:!0===i?Mo:null}clone(){const e=Object.create(No.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}class Do{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,xs,{value:fs});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 qs({version:i}),this.setSchema(i,n),this.contents=void 0===e?null:this.createNode(e,r,n)}clone(){const e=Object.create(Do.prototype,{[xs]:{value:fs}});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=_s(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Fo(this.contents)&&this.contents.add(e)}addIn(e,t){Fo(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=Vs(this);e.anchor=!t||n.has(t)?Gs(t||"a",n):t}return new Js(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=Vs(e));const i=Gs(t,s);return s.add(i),i},setAnchors:()=>{for(const e of n){const t=r.get(e);if("object"!=typeof t||!t.anchor||!Ss(t.node)&&!As(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=Qs(e,l,{aliasDuplicateObjects:s??!0,keepUndefined:a??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:p});return o&&As(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 Ai(r,s)}delete(e){return!!Fo(this.contents)&&this.contents.delete(e)}deleteIn(e){return ei(e)?null!=this.contents&&(this.contents=null,!0):!!Fo(this.contents)&&this.contents.deleteIn(e)}get(e,t){return As(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return ei(e)?!t&&Ss(this.contents)?this.contents.value:this.contents:As(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!As(this.contents)&&this.contents.has(e)}hasIn(e){return ei(e)?void 0!==this.contents:!!As(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=Zs(this.schema,[e],t):Fo(this.contents)&&this.contents.set(e,t)}setIn(e,t){ei(e)?this.contents=t:null==this.contents?this.contents=Zs(this.schema,Array.from(e),t):Fo(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 qs({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 qs({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 No(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=zs(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?Hs(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=bi(e,t),{commentString:i}=s.options;if(e.commentBefore){1!==n.length&&n.unshift("");const t=i(e.commentBefore);n.unshift(ri(t,""))}let o=!1,a=null;if(e.contents){if(_s(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const t=i(e.contents.commentBefore);n.push(ri(t,""))}s.forceBlockIndent=!!e.comment,a=e.contents.comment}const t=a?void 0:()=>o=!0;let c=xi(e.contents,s,()=>a=null,t);a&&(c+=si(c,"",i(a))),"|"!==c[0]&&">"!==c[0]||"---"!==n[n.length-1]?n.push(c):n[n.length-1]=`--- ${c}`}else n.push(xi(e.contents,s));if(e.directives?.docEnd)if(e.comment){const t=i(e.comment);t.includes("\n")?(n.push("..."),n.push(ri(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(ri(i(t),"")))}return n.join("\n")+"\n"}(this,e)}}function Fo(e){if(As(e))return!0;throw new Error("Expected a YAML collection as document contents")}Error;const Bo=Symbol("break visit"),$o=Symbol("skip children"),Lo=Symbol("remove item");function Po(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),Uo(Object.freeze([]),e,t)}function Uo(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=Uo(Object.freeze(e.concat([[s,t]])),i.items[t],n);if("number"==typeof r)t=r-1;else{if(r===Bo)return Bo;r===Lo&&(i.items.splice(t,1),t-=1)}}"function"==typeof r&&"key"===s&&(r=r(t,e))}}return"function"==typeof r?r(t,e):r}Po.BREAK=Bo,Po.SKIP=$o,Po.REMOVE=Lo,Po.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},Po.parentCollection=(e,t)=>{const n=Po.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 qo=e=>e.style?.yaml??{},Ro={Plain:Ys.PLAIN,SingleQuoted:Ys.QUOTE_SINGLE,DoubleQuoted:Ys.QUOTE_DOUBLE,Literal:Ys.BLOCK_LITERAL,Folded:Ys.BLOCK_FOLDED},Vo=(e,t)=>{t.comment&&(e.comment=` ${t.comment}`),t.commentBefore&&(e.commentBefore=` ${t.commentBefore}`)},Go=(e,t)=>{if(!V(e))return e;if(t.has(e))return;t.add(e);const n=qo(e);if(W(e)){const r=new Mi;return r.flow="Flow"===n.styleGroup,Vo(r,n),e.forEach((e,n,s)=>{const i=X(s)?qo(s):{},o=Go(n,t),a=Go(e,t),c=new Ai(o,a);i.commentBefore&&_s(o)&&(o.commentBefore=` ${i.commentBefore}`),i.comment&&_s(a)&&(a.comment=` ${i.comment}`),r.items.push(c)}),r}if(J(e)){const r=new Di;return r.flow="Flow"===n.styleGroup,Vo(r,n),e.forEach(e=>{r.items.push(Go(e,t))}),r}if(ir(e))return new Ys(String(us(e)));if(sr(e))return new Ys(G(e.href)?us(e.href):"");const r=n.scalarStyle?Ro[n.scalarStyle]:void 0,s=new Ys(us(e));if(r&&(s.type=r),n.rawContent&&"Plain"===n.scalarStyle&&"number"==typeof s.value){/[eE]/.test(n.rawContent)?s.format="EXP":/^0x/i.test(n.rawContent)?s.format="HEX":/^0o/i.test(n.rawContent)&&(s.format="OCT");const e=n.rawContent.match(/\.(\d+)/);e&&(s.minFractionDigits=e[1].length)}return Vo(s,n),s},Ho=(e,{directive:t=!1,preserveStyle:n=!1,aliasDuplicateObjects:r=!1,...s}={})=>{const i={aliasDuplicateObjects:r,...s};if(n){const n=qo(e);void 0===s.indent&&"number"==typeof n.indent&&(i.indent=n.indent),"boolean"==typeof n.flowCollectionPadding&&(i.flowCollectionPadding=n.flowCollectionPadding);const r=Go(e,new WeakSet),o=new Do(void 0,i);return o.contents=r,t&&(o.directives.yaml.explicit=!0),o.toString(i)}if(t){const t=new Do(us(e),i);return t.directives.yaml.explicit=!0,t.toString(i)}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 vs(e)&&!r?e.toString(n):new Do(e,r,n).toString(n)}(us(e),i)},zo=(e,t=mr)=>t.toRefract(e),Ko=(e,t=mr)=>{const n=zo(e,t);return JSON.stringify(n)},Jo=e=>{let t="",n=0;return Nn(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},Wo=e=>{const t=e.isMetaEmpty?void 0:e.meta.cloneDeep(),n=e.isAttributesEmpty?void 0:bn(e.attributes);return new e.constructor(void 0,t,n)},Xo=(e,t)=>t.clone&&t.isMergeableElement(e)?Qo(Wo(e),e,t):e,Yo={clone:!0,isMergeableElement:e=>W(e)||J(e),arrayElementMerge:(e,t,n)=>new(0,e.constructor)(e.concat(t).map(e=>Xo(e,n))),objectElementMerge:(e,t,n)=>{const r=W(e)?Wo(e):Wo(t);return W(e)&&e.forEach((e,t,s)=>{const i=vn(s);i.value=Xo(e,n),r.content.push(i)}),t.forEach((t,s,i)=>{const o=us(s);let a;if(W(e)&&e.hasKey(o)&&n.isMergeableElement(t)){const r=e.get(o);a=vn(i),a.value=((e,t)=>{if("function"!=typeof t.customMerge)return Qo;const n=t.customMerge(e,t);return"function"==typeof n?n:Qo})(s,n)(r,t,n)}else a=vn(i),a.value=Xo(t,n);r.remove(o),r.content.push(a)}),r},customMerge:void 0,customMetaMerge:void 0,customAttributesMerge:void 0},Qo=(e,t,n)=>{const r={...Yo,...n};r.isMergeableElement=r.isMergeableElement??Yo.isMergeableElement,r.arrayElementMerge=r.arrayElementMerge??Yo.arrayElementMerge,r.objectElementMerge=r.objectElementMerge??Yo.objectElementMerge;const s=J(t);if(!(s===J(e)))return Xo(t,r);const i=s&&"function"==typeof r.arrayElementMerge?r.arrayElementMerge(e,t,r):r.objectElementMerge(e,t,r);return e.isMetaEmpty||t.isMetaEmpty?e.isMetaEmpty?t.isMetaEmpty||(i.meta=t.meta.cloneDeep()):i.meta=e.meta.cloneDeep():i.meta=(e=>"function"!=typeof e.customMetaMerge?e=>e.cloneDeep():e.customMetaMerge)(r)(e.meta,t.meta),e.isAttributesEmpty||t.isAttributesEmpty?e.isAttributesEmpty?t.isAttributesEmpty||(i.attributes=bn(t.attributes)):i.attributes=bn(e.attributes):i.attributes=(e=>"function"!=typeof e.customAttributesMerge?e=>bn(e):e.customAttributesMerge)(r)(e.attributes,t.attributes),i};Qo.all=(e,t)=>{if(!Array.isArray(e))throw new TypeError("First argument of deepmerge should be an array.");return 0===e.length?new R:e.reduce((e,n)=>Qo(e,n,t),Wo(e[0]))};const Zo=Qo,ea=(e,t,n)=>{const r={...Yo,...n,customMerge:()=>(e,t)=>t,clone:!1};return Zo(e,t,r)};ea.all=(e,t)=>{if(!Array.isArray(e))throw new TypeError("First argument of mergeRight should be an array.");return 0===e.length?new R:e.reduce((e,n)=>ea(e,n,t),Wo(e[0]))};const ta=ea,na=(...[e,t,n])=>ta(t,e,n);na.all=(...[e,t])=>ta.all([...e].reverse(),t);const ra=na;function sa(e,t){const n=(e instanceof N?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": "4.0.4",
3
+ "version": "4.0.5",
4
4
  "description": "Tools for manipulating ApiDOM structures.",
5
5
  "keywords": [
6
6
  "apidom",
@@ -57,9 +57,9 @@
57
57
  "license": "Apache-2.0",
58
58
  "dependencies": {
59
59
  "@babel/runtime-corejs3": "^7.28.4",
60
- "@speclynx/apidom-datamodel": "4.0.4",
61
- "@speclynx/apidom-error": "4.0.4",
62
- "@speclynx/apidom-traverse": "4.0.4",
60
+ "@speclynx/apidom-datamodel": "4.0.5",
61
+ "@speclynx/apidom-error": "4.0.5",
62
+ "@speclynx/apidom-traverse": "4.0.5",
63
63
  "ramda": "~0.32.0",
64
64
  "ramda-adjunct": "^6.0.0",
65
65
  "short-unique-id": "^5.3.2",
@@ -76,5 +76,5 @@
76
76
  "README.md",
77
77
  "CHANGELOG.md"
78
78
  ],
79
- "gitHead": "a06f6ef3d37ad5bf860cbbf4b442bfbe3a522cc2"
79
+ "gitHead": "5a85d2a832eeefb07d03760faa391b457447e966"
80
80
  }