@speclynx/apidom-json-path 1.12.1

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.
@@ -0,0 +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.apidomJsonPath=t():e.apidomJsonPath=t()}(self,()=>(()=>{var e={88:(e,t,r)=>{var n=r(4700);e.exports=function(e){return n(this,e).get(e)}},155:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},195:(e,t,r)=>{var n=r(4882),s=r(8121),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return s(e);var t=[];for(var r in Object(e))i.call(e,r)&&"constructor"!=r&&t.push(r);return t}},353:(e,t,r)=>{var n=r(1340),s=r(3934),i=r(8861),o=r(1182),a=r(8486),c=r(3142),l=r(5853),u=r(8666),h="[object Arguments]",p="[object Array]",f="[object Object]",d=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,m,y,b){var g=c(e),v=c(t),E=g?p:a(e),x=v?p:a(t),w=(E=E==h?f:E)==f,O=(x=x==h?f:x)==f,A=E==x;if(A&&l(e)){if(!l(t))return!1;g=!0,w=!1}if(A&&!w)return b||(b=new n),g||u(e)?s(e,t,r,m,y,b):i(e,t,E,r,m,y,b);if(!(1&r)){var _=w&&d.call(e,"__wrapped__"),k=O&&d.call(t,"__wrapped__");if(_||k){var T=_?e.value():e,j=k?t.value():t;return b||(b=new n),y(T,j,r,m,b)}}return!!A&&(b||(b=new n),o(e,t,r,m,y,b))}},358:(e,t,r)=>{var n=r(6137),s=r(3283),i=r(3142),o=r(5853),a=r(9632),c=r(8666),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),u=!r&&s(e),h=!r&&!u&&o(e),p=!r&&!u&&!h&&c(e),f=r||u||h||p,d=f?n(e.length,String):[],m=d.length;for(var y in e)!t&&!l.call(e,y)||f&&("length"==y||h&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||a(y,m))||d.push(y);return d}},393:(e,t,r)=>{var n=r(8244),s=r(7979),i=r(1211);e.exports=function(e){return n(e,i,s)}},394:e=>{e.exports=class{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};e._meta&&e._meta.length>0&&(t.meta=this.serialiseObject(e.meta)),e._attributes&&e._attributes.length>0&&(t.attributes=this.serialiseObject(e.attributes));const r=this.serialiseContent(e.content);return void 0!==r&&(t.content=r),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));t.element!==e.element&&(t.element=e.element),e.meta&&this.deserialiseObject(e.meta,t.meta),e.attributes&&this.deserialiseObject(e.attributes,t.attributes);const r=this.deserialiseContent(e.content);return void 0===r&&null!==t.content||(t.content=r),t}serialiseContent(e){if(e instanceof this.namespace.elements.Element)return this.serialise(e);if(e instanceof this.namespace.KeyValuePair){const t={key:this.serialise(e.key)};return e.value&&(t.value=this.serialise(e.value)),t}if(e&&e.map){if(0===e.length)return;return e.map(this.serialise,this)}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(e.map)return e.map(this.deserialise,this)}return e}serialiseObject(e){const t={};if(e.forEach((e,r)=>{e&&(t[r.toValue()]=this.serialise(e))}),0!==Object.keys(t).length)return t}deserialiseObject(e,t){Object.keys(e).forEach(r=>{t.set(r,this.deserialise(e[r]))})}}},547:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},593:(e,t,r)=>{const n=r(8631);e.exports=class extends n{constructor(e,t,r){super(e||[],t,r),this.element="ref",this.path||(this.path="element")}get path(){return this.attributes.get("path")}set path(e){this.attributes.set("path",e)}}},674:(e,t,r)=>{var n=r(7379),s=r(5387),i=r(547),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&s(e.length)&&!!o[n(e)]}},986:(e,t,r)=>{var n=r(7379),s=r(547);e.exports=function(e){return"number"==typeof e||s(e)&&"[object Number]"==n(e)}},1112:(e,t,r)=>{var n=r(4497),s=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return s.call(t,e)?t[e]:void 0}},1129:e=>{e.exports=function(e,t){for(var r=-1,n=t.length,s=e.length;++r<n;)e[s+r]=t[r];return e}},1182:(e,t,r)=>{var n=r(393),s=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,i,o,a){var c=1&r,l=n(e),u=l.length;if(u!=n(t).length&&!c)return!1;for(var h=u;h--;){var p=l[h];if(!(c?p in t:s.call(t,p)))return!1}var f=a.get(e),d=a.get(t);if(f&&d)return f==t&&d==e;var m=!0;a.set(e,t),a.set(t,e);for(var y=c;++h<u;){var b=e[p=l[h]],g=t[p];if(i)var v=c?i(g,b,p,t,e,a):i(b,g,p,e,t,a);if(!(void 0===v?b===g||o(b,g,r,i,a):v)){m=!1;break}y||(y="constructor"==p)}if(m&&!y){var E=e.constructor,x=t.constructor;E==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof x&&x instanceof x||(m=!1)}return a.delete(e),a.delete(t),m}},1211:(e,t,r)=>{var n=r(358),s=r(195),i=r(6529);e.exports=function(e){return i(e)?n(e):s(e)}},1340:(e,t,r)=>{var n=r(1386),s=r(4103),i=r(1779),o=r(4162),a=r(7462),c=r(6638);function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=s,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=c,e.exports=l},1386:(e,t,r)=>{var n=r(2393),s=r(2049),i=r(7144),o=r(7452),a=r(3964);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=s,c.prototype.get=i,c.prototype.has=o,c.prototype.set=a,e.exports=c},1517:e=>{e.exports=function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}},1580:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},1623:(e,t,r)=>{var n=r(8942).Uint8Array;e.exports=n},1779:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},1877:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1950:(e,t,r)=>{var n=r(8942)["__core-js_shared__"];e.exports=n},2049:(e,t,r)=>{var n=r(7034),s=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():s.call(t,r,1),--this.size,!0)}},2306:(e,t,r)=>{e=r.nmd(e);var n=r(4967),s=t&&!t.nodeType&&t,i=s&&e&&!e.nodeType&&e,o=i&&i.exports===s&&n.process,a=function(){try{var e=i&&i.require&&i.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a},2322:e=>{class t{constructor(e,t){this.key=e,this.value=t}clone(){const e=new t;return this.key&&(e.key=this.key.clone()),this.value&&(e.value=this.value.clone()),e}}e.exports=t},2393:e=>{e.exports=function(){this.__data__=[],this.size=0}},2536:(e,t,r)=>{const n=r(8631);e.exports=class extends n{constructor(e,t,r){super(e,t,r),this.element="number"}primitive(){return"number"}}},2555:(e,t,r)=>{const n=r(8631);e.exports=class extends n{constructor(e,t,r){super(e,t,r),this.element="boolean"}primitive(){return"boolean"}}},2563:(e,t,r)=>{var n=r(7379),s=r(547);e.exports=function(e){return!0===e||!1===e||s(e)&&"[object Boolean]"==n(e)}},3004:(e,t,r)=>{const n=r(8631);e.exports=class extends n{constructor(e,t,r){super(e||null,t,r),this.element="null"}primitive(){return"null"}set(){return new Error("Cannot set the value of null")}}},3103:(e,t,r)=>{var n=r(4715)(r(8942),"DataView");e.exports=n},3142:e=>{var t=Array.isArray;e.exports=t},3148:(e,t,r)=>{const n=r(394);e.exports=class extends n{serialise(e){if(!(e instanceof this.namespace.elements.Element))throw new TypeError(`Given element \`${e}\` is not an Element instance`);let t;e._attributes&&e.attributes.get("variable")&&(t=e.attributes.get("variable"));const r={element:e.element};e._meta&&e._meta.length>0&&(r.meta=this.serialiseObject(e.meta));const n="enum"===e.element||-1!==e.attributes.keys().indexOf("enumerations");if(n){const t=this.enumSerialiseAttributes(e);t&&(r.attributes=t)}else if(e._attributes&&e._attributes.length>0){let{attributes:n}=e;n.get("metadata")&&(n=n.clone(),n.set("meta",n.get("metadata")),n.remove("metadata")),"member"===e.element&&t&&(n=n.clone(),n.remove("variable")),n.length>0&&(r.attributes=this.serialiseObject(n))}if(n)r.content=this.enumSerialiseContent(e,r);else if(this[`${e.element}SerialiseContent`])r.content=this[`${e.element}SerialiseContent`](e,r);else if(void 0!==e.content){let n;t&&e.content.key?(n=e.content.clone(),n.key.attributes.set("variable",t),n=this.serialiseContent(n)):n=this.serialiseContent(e.content),this.shouldSerialiseContent(e,n)&&(r.content=n)}else this.shouldSerialiseContent(e,e.content)&&e instanceof this.namespace.elements.Array&&(r.content=[]);return r}shouldSerialiseContent(e,t){return"parseResult"===e.element||"httpRequest"===e.element||"httpResponse"===e.element||"category"===e.element||"link"===e.element||void 0!==t&&(!Array.isArray(t)||0!==t.length)}refSerialiseContent(e,t){return delete t.attributes,{href:e.toValue(),path:e.path.toValue()}}sourceMapSerialiseContent(e){return e.toValue()}dataStructureSerialiseContent(e){return[this.serialiseContent(e.content)]}enumSerialiseAttributes(e){const t=e.attributes.clone(),r=t.remove("enumerations")||new this.namespace.elements.Array([]),n=t.get("default");let s=t.get("samples")||new this.namespace.elements.Array([]);if(n&&n.content&&(n.content.attributes&&n.content.attributes.remove("typeAttributes"),t.set("default",new this.namespace.elements.Array([n.content]))),s.forEach(e=>{e.content&&e.content.element&&e.content.attributes.remove("typeAttributes")}),e.content&&0!==r.length&&s.unshift(e.content),s=s.map(e=>e instanceof this.namespace.elements.Array?[e]:new this.namespace.elements.Array([e.content])),s.length&&t.set("samples",s),t.length>0)return this.serialiseObject(t)}enumSerialiseContent(e){if(e._attributes){const t=e.attributes.get("enumerations");if(t&&t.length>0)return t.content.map(e=>{const t=e.clone();return t.attributes.remove("typeAttributes"),this.serialise(t)})}if(e.content){const t=e.content.clone();return t.attributes.remove("typeAttributes"),[this.serialise(t)]}return[]}deserialise(e){if("string"==typeof e)return new this.namespace.elements.String(e);if("number"==typeof e)return new this.namespace.elements.Number(e);if("boolean"==typeof e)return new this.namespace.elements.Boolean(e);if(null===e)return new this.namespace.elements.Null;if(Array.isArray(e))return new this.namespace.elements.Array(e.map(this.deserialise,this));const t=this.namespace.getElementClass(e.element),r=new t;r.element!==e.element&&(r.element=e.element),e.meta&&this.deserialiseObject(e.meta,r.meta),e.attributes&&this.deserialiseObject(e.attributes,r.attributes);const n=this.deserialiseContent(e.content);if(void 0===n&&null!==r.content||(r.content=n),"enum"===r.element){r.content&&r.attributes.set("enumerations",r.content);let e=r.attributes.get("samples");if(r.attributes.remove("samples"),e){const n=e;e=new this.namespace.elements.Array,n.forEach(n=>{n.forEach(n=>{const s=new t(n);s.element=r.element,e.push(s)})});const s=e.shift();r.content=s?s.content:void 0,r.attributes.set("samples",e)}else r.content=void 0;let n=r.attributes.get("default");if(n&&n.length>0){n=n.get(0);const e=new t(n);e.element=r.element,r.attributes.set("default",e)}}else if("dataStructure"===r.element&&Array.isArray(r.content))[r.content]=r.content;else if("category"===r.element){const e=r.attributes.get("meta");e&&(r.attributes.set("metadata",e),r.attributes.remove("meta"))}else"member"===r.element&&r.key&&r.key._attributes&&r.key._attributes.getValue("variable")&&(r.attributes.set("variable",r.key.attributes.get("variable")),r.key.attributes.remove("variable"));return r}serialiseContent(e){if(e instanceof this.namespace.elements.Element)return this.serialise(e);if(e instanceof this.namespace.KeyValuePair){const t={key:this.serialise(e.key)};return e.value&&(t.value=this.serialise(e.value)),t}return e&&e.map?e.map(this.serialise,this):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(e.map)return e.map(this.deserialise,this)}return e}shouldRefract(e){return!!(e._attributes&&e.attributes.keys().length||e._meta&&e.meta.keys().length)||"enum"!==e.element&&(e.element!==e.primitive()||"member"===e.element)}convertKeyToRefract(e,t){return this.shouldRefract(t)?this.serialise(t):"enum"===t.element?this.serialiseEnum(t):"array"===t.element?t.map(t=>this.shouldRefract(t)||"default"===e?this.serialise(t):"array"===t.element||"object"===t.element||"enum"===t.element?t.children.map(e=>this.serialise(e)):t.toValue()):"object"===t.element?(t.content||[]).map(this.serialise,this):t.toValue()}serialiseEnum(e){return e.children.map(e=>this.serialise(e))}serialiseObject(e){const t={};return e.forEach((e,r)=>{if(e){const n=r.toValue();t[n]=this.convertKeyToRefract(n,e)}}),t}deserialiseObject(e,t){Object.keys(e).forEach(r=>{t.set(r,this.deserialise(e[r]))})}}},3212:(e,t,r)=>{var n=r(8250),s=r(1877),i=r(8006);function o(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}o.prototype.add=o.prototype.push=s,o.prototype.has=i,e.exports=o},3283:(e,t,r)=>{var n=r(6027),s=r(547),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(e){return s(e)&&o.call(e,"callee")&&!a.call(e,"callee")};e.exports=c},3305:(e,t,r)=>{var n=r(4497);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},3311:(e,t,r)=>{const n=r(1517),s=r(4123);class i extends s{map(e,t){return this.elements.map(r=>e.bind(t)(r.value,r.key,r))}filter(e,t){return new i(this.elements.filter(r=>e.bind(t)(r.value,r.key,r)))}reject(e,t){return this.filter(n(e.bind(t)))}forEach(e,t){return this.elements.forEach((r,n)=>{e.bind(t)(r.value,r.key,r,n)})}keys(){return this.map((e,t)=>t.toValue())}values(){return this.map(e=>e.toValue())}}e.exports=i},3655:(e,t,r)=>{var n=r(7379),s=r(1580);e.exports=function(e){if(!s(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},3766:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},3934:(e,t,r)=>{var n=r(3212),s=r(6465),i=r(5568);e.exports=function(e,t,r,o,a,c){var l=1&r,u=e.length,h=t.length;if(u!=h&&!(l&&h>u))return!1;var p=c.get(e),f=c.get(t);if(p&&f)return p==t&&f==e;var d=-1,m=!0,y=2&r?new n:void 0;for(c.set(e,t),c.set(t,e);++d<u;){var b=e[d],g=t[d];if(o)var v=l?o(g,b,d,t,e,c):o(b,g,d,e,t,c);if(void 0!==v){if(v)continue;m=!1;break}if(y){if(!s(t,function(e,t){if(!i(y,t)&&(b===e||a(b,e,r,o,c)))return y.push(t)})){m=!1;break}}else if(b!==g&&!a(b,g,r,o,c)){m=!1;break}}return c.delete(e),c.delete(t),m}},3964:(e,t,r)=>{var n=r(7034);e.exports=function(e,t){var r=this.__data__,s=n(r,e);return s<0?(++this.size,r.push([e,t])):r[s][1]=t,this}},4066:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},4103:(e,t,r)=>{var n=r(1386);e.exports=function(){this.__data__=new n,this.size=0}},4123:(e,t,r)=>{const n=r(1517);function s(e){return"string"==typeof e?t=>t.element===e:e.constructor&&e.extend?t=>t instanceof e:e}class i{constructor(e){this.elements=e||[]}toValue(){return this.elements.map(e=>e.toValue())}map(e,t){return this.elements.map(e,t)}flatMap(e,t){return this.map(e,t).reduce((e,t)=>e.concat(t),[])}compactMap(e,t){const r=[];return this.forEach(n=>{const s=e.bind(t)(n);s&&r.push(s)}),r}filter(e,t){return e=s(e),new i(this.elements.filter(e,t))}reject(e,t){return e=s(e),new i(this.elements.filter(n(e),t))}find(e,t){return e=s(e),this.elements.find(e,t)}forEach(e,t){this.elements.forEach(e,t)}reduce(e,t){return this.elements.reduce(e,t)}includes(e){return this.elements.some(t=>t.equals(e))}shift(){return this.elements.shift()}unshift(e){this.elements.unshift(this.refract(e))}push(e){return this.elements.push(this.refract(e)),this}add(e){this.push(e)}get(e){return this.elements[e]}getValue(e){const t=this.elements[e];if(t)return t.toValue()}get length(){return this.elements.length}get isEmpty(){return 0===this.elements.length}get first(){return this.elements[0]}}"undefined"!=typeof Symbol&&(i.prototype[Symbol.iterator]=function(){return this.elements[Symbol.iterator]()}),e.exports=i},4162:e=>{e.exports=function(e){return this.__data__.get(e)}},4497:(e,t,r)=>{var n=r(4715)(Object,"create");e.exports=n},4512:(e,t,r)=>{var n=r(4715)(r(8942),"Set");e.exports=n},4687:(e,t,r)=>{var n=r(353),s=r(547);e.exports=function e(t,r,i,o,a){return t===r||(null==t||null==r||!s(t)&&!s(r)?t!=t&&r!=r:n(t,r,i,o,e,a))}},4700:(e,t,r)=>{var n=r(9067);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},4715:(e,t,r)=>{var n=r(9624),s=r(155);e.exports=function(e,t){var r=s(e,t);return n(r)?r:void 0}},4732:(e,t,r)=>{var n=r(4700);e.exports=function(e){return n(this,e).has(e)}},4759:(e,t,r)=>{var n,s=r(1950),i=(n=/[^.]+$/.exec(s&&s.keys&&s.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!i&&i in e}},4772:e=>{e.exports=function(){return!1}},4882:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},4967:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},5071:(e,t,r)=>{var n=r(4497);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},5098:(e,t,r)=>{var n=r(3305),s=r(9361),i=r(1112),o=r(5276),a=r(5071);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=s,c.prototype.get=i,c.prototype.has=o,c.prototype.set=a,e.exports=c},5276:(e,t,r)=>{var n=r(4497),s=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:s.call(t,e)}},5387:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},5568:e=>{e.exports=function(e,t){return e.has(t)}},5642:(e,t,r)=>{const n=r(1517),s=r(1580),i=r(9796),o=r(7309),a=r(3311);e.exports=class extends i{constructor(e,t,r){super(e||[],t,r),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}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(r=>r.key.toValue()!==e||(t=r,!1)),t}getKey(e){const t=this.getMember(e);if(t)return t.key}set(e,t){if(s(e))return Object.keys(e).forEach(t=>{this.set(t,e[t])}),this;const r=e,n=this.getMember(r);return n?n.value=t:this.content.push(new o(r,t)),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(r=>e.bind(t)(r.value,r.key,r))}compactMap(e,t){const r=[];return this.forEach((n,s,i)=>{const o=e.bind(t)(n,s,i);o&&r.push(o)}),r}filter(e,t){return new a(this.content).filter(e,t)}reject(e,t){return this.filter(n(e),t)}forEach(e,t){return this.content.forEach(r=>e.bind(t)(r.value,r.key,r))}}},5650:(e,t,r)=>{var n=r(8942).Symbol;e.exports=n},5681:(e,t,r)=>{var n=r(4700);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},5735:(e,t,r)=>{const n=r(9310),s=r(8138),i=r(986),o=r(2563),a=r(1580),c=r(394),l=r(7547);class u{constructor(e){this.elementMap={},this.elementDetection=[],this.Element=l.Element,this.KeyValuePair=l.KeyValuePair,e&&e.noDefault||this.useDefault(),this._attributeElementKeys=[],this._attributeElementArrayKeys=[]}use(e){return e.namespace&&e.namespace({base:this}),e.load&&e.load({base:this}),this}useDefault(){return this.register("null",l.NullElement).register("string",l.StringElement).register("number",l.NumberElement).register("boolean",l.BooleanElement).register("array",l.ArrayElement).register("object",l.ObjectElement).register("member",l.MemberElement).register("ref",l.RefElement).register("link",l.LinkElement),this.detect(n,l.NullElement,!1).detect(s,l.StringElement,!1).detect(i,l.NumberElement,!1).detect(o,l.BooleanElement,!1).detect(Array.isArray,l.ArrayElement,!1).detect(a,l.ObjectElement,!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,r){return void 0===r||r?this.elementDetection.unshift([e,t]):this.elementDetection.push([e,t]),this}toElement(e){if(e instanceof this.Element)return e;let t;for(let r=0;r<this.elementDetection.length;r+=1){const n=this.elementDetection[r][0],s=this.elementDetection[r][1];if(n(e)){t=new s(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.substr(1);this._elements[t]=this.elementMap[e]})),this._elements}get serialiser(){return new c(this)}}c.prototype.Namespace=u,e.exports=u},5853:(e,t,r)=>{e=r.nmd(e);var n=r(8942),s=r(4772),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?n.Buffer:void 0,c=(a?a.isBuffer:void 0)||s;e.exports=c},5894:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}},6027:(e,t,r)=>{var n=r(7379),s=r(547);e.exports=function(e){return s(e)&&"[object Arguments]"==n(e)}},6137:e=>{e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},6285:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},6343:(e,t,r)=>{var n=r(4687);e.exports=function(e,t){return n(e,t)}},6465:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},6529:(e,t,r)=>{var n=r(3655),s=r(5387);e.exports=function(e){return null!=e&&s(e.length)&&!n(e)}},6638:(e,t,r)=>{var n=r(1386),s=r(9770),i=r(8250);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var o=r.__data__;if(!s||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(o)}return r.set(e,t),this.size=r.size,this}},7034:(e,t,r)=>{var n=r(6285);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},7144:(e,t,r)=>{var n=r(7034);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},7309:(e,t,r)=>{const n=r(2322),s=r(8631);e.exports=class extends s{constructor(e,t,r,s){super(new n,r,s),this.element="member",this.key=e,this.value=t}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=this.refract(e)}}},7379:(e,t,r)=>{var n=r(5650),s=r(8870),i=r(9005),o=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?s(e):i(e)}},7452:(e,t,r)=>{var n=r(7034);e.exports=function(e){return n(this.__data__,e)>-1}},7462:e=>{e.exports=function(e){return this.__data__.has(e)}},7547:(e,t,r)=>{const n=r(8631),s=r(3004),i=r(8712),o=r(2536),a=r(2555),c=r(9796),l=r(7309),u=r(5642),h=r(9620),p=r(593),f=r(4123),d=r(3311),m=r(2322);function y(e){if(e instanceof n)return e;if("string"==typeof e)return new i(e);if("number"==typeof e)return new o(e);if("boolean"==typeof e)return new a(e);if(null===e)return new s;if(Array.isArray(e))return new c(e.map(y));if("object"==typeof e){return new u(e)}return e}n.prototype.ObjectElement=u,n.prototype.RefElement=p,n.prototype.MemberElement=l,n.prototype.refract=y,f.prototype.refract=y,e.exports={Element:n,NullElement:s,StringElement:i,NumberElement:o,BooleanElement:a,ArrayElement:c,MemberElement:l,ObjectElement:u,LinkElement:h,RefElement:p,refract:y,ArraySlice:f,ObjectSlice:d,KeyValuePair:m}},7979:(e,t,r)=>{var n=r(9847),s=r(9306),i=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols,a=o?function(e){return null==e?[]:(e=Object(e),n(o(e),function(t){return i.call(e,t)}))}:s;e.exports=a},8006:e=>{e.exports=function(e){return this.__data__.has(e)}},8121:(e,t,r)=>{var n=r(3766)(Object.keys,Object);e.exports=n},8138:(e,t,r)=>{var n=r(7379),s=r(3142),i=r(547);e.exports=function(e){return"string"==typeof e||!s(e)&&i(e)&&"[object String]"==n(e)}},8244:(e,t,r)=>{var n=r(1129),s=r(3142);e.exports=function(e,t,r){var i=t(e);return s(e)?i:n(i,r(e))}},8250:(e,t,r)=>{var n=r(9753),s=r(5681),i=r(88),o=r(4732),a=r(9068);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=s,c.prototype.get=i,c.prototype.has=o,c.prototype.set=a,e.exports=c},8326:(e,t,r)=>{const n=r(5735),s=r(7547);t.KeyValuePair=r(2322),t.G6=s.ArraySlice,t.ot=s.ObjectSlice,t.Hg=s.Element,t.Om=s.StringElement,t.kT=s.NumberElement,t.bd=s.BooleanElement,t.Os=s.NullElement,t.wE=s.ArrayElement,t.Sh=s.ObjectElement,t.Pr=s.MemberElement,t.sI=s.RefElement,t.Ft=s.LinkElement,s.refract,r(394),r(3148)},8486:(e,t,r)=>{var n=r(3103),s=r(9770),i=r(9413),o=r(4512),a=r(9270),c=r(7379),l=r(4066),u="[object Map]",h="[object Promise]",p="[object Set]",f="[object WeakMap]",d="[object DataView]",m=l(n),y=l(s),b=l(i),g=l(o),v=l(a),E=c;(n&&E(new n(new ArrayBuffer(1)))!=d||s&&E(new s)!=u||i&&E(i.resolve())!=h||o&&E(new o)!=p||a&&E(new a)!=f)&&(E=function(e){var t=c(e),r="[object Object]"==t?e.constructor:void 0,n=r?l(r):"";if(n)switch(n){case m:return d;case y:return u;case b:return h;case g:return p;case v:return f}return t}),e.exports=E},8631:(e,t,r)=>{const n=r(6343),s=r(2322),i=r(4123);class o{constructor(e,t,r){t&&(this.meta=t),r&&(this.attributes=r),this.content=e}freeze(){Object.isFrozen(this)||(this._meta&&(this.meta.parent=this,this.meta.freeze()),this._attributes&&(this.attributes.parent=this,this.attributes.freeze()),this.children.forEach(e=>{e.parent=this,e.freeze()},this),this.content&&Array.isArray(this.content)&&Object.freeze(this.content),Object.freeze(this))}primitive(){}clone(){const e=new this.constructor;return e.element=this.element,this.meta.length&&(e._meta=this.meta.clone()),this.attributes.length&&(e._attributes=this.attributes.clone()),this.content?this.content.clone?e.content=this.content.clone():Array.isArray(this.content)?e.content=this.content.map(e=>e.clone()):e.content=this.content:e.content=this.content,e}toValue(){return this.content instanceof o?this.content.toValue():this.content instanceof s?{key:this.content.key.toValue(),value:this.content.value?this.content.value.toValue():void 0}:this.content&&this.content.map?this.content.map(e=>e.toValue(),this):this.content}toRef(e){if(""===this.id.toValue())throw Error("Cannot create reference to an element that does not contain an ID");const t=new this.RefElement(this.id.toValue());return e&&(t.path=e),t}findRecursive(...e){if(arguments.length>1&&!this.isFrozen)throw new Error("Cannot find recursive with multiple element names without first freezing the element. Call `element.freeze()`");const t=e.pop();let r=new i;const n=(e,t)=>(e.push(t),e),o=(e,r)=>{r.element===t&&e.push(r);const i=r.findRecursive(t);return i&&i.reduce(n,e),r.content instanceof s&&(r.content.key&&o(e,r.content.key),r.content.value&&o(e,r.content.value)),e};return this.content&&(this.content.element&&o(r,this.content),Array.isArray(this.content)&&this.content.reduce(o,r)),e.isEmpty||(r=r.filter(t=>{let r=t.parents.map(e=>e.element);for(const t in e){const n=e[t],s=r.indexOf(n);if(-1===s)return!1;r=r.splice(0,s)}return!0})),r}set(e){return this.content=e,this}equals(e){return n(this.toValue(),e)}getMetaProperty(e,t){if(!this.meta.hasKey(e)){if(this.isFrozen){const e=this.refract(t);return e.freeze(),e}this.meta.set(e,t)}return this.meta.get(e)}setMetaProperty(e,t){this.meta.set(e,t)}get element(){return this._storedElement||"element"}set element(e){this._storedElement=e}get content(){return this._content}set content(e){if(e instanceof o)this._content=e;else if(e instanceof i)this.content=e.elements;else if("string"==typeof e||"number"==typeof e||"boolean"==typeof e||"null"===e||null==e)this._content=e;else if(e instanceof s)this._content=e;else if(Array.isArray(e))this._content=e.map(this.refract);else{if("object"!=typeof e)throw new Error("Cannot set content to given value");this._content=Object.keys(e).map(t=>new this.MemberElement(t,e[t]))}}get meta(){if(!this._meta){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._meta=new this.ObjectElement}return this._meta}set meta(e){e instanceof this.ObjectElement?this._meta=e:this.meta.set(e||{})}get attributes(){if(!this._attributes){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._attributes=new this.ObjectElement}return this._attributes}set attributes(e){e instanceof this.ObjectElement?this._attributes=e:this.attributes.set(e||{})}get id(){return this.getMetaProperty("id","")}set id(e){this.setMetaProperty("id",e)}get classes(){return this.getMetaProperty("classes",[])}set classes(e){this.setMetaProperty("classes",e)}get title(){return this.getMetaProperty("title","")}set title(e){this.setMetaProperty("title",e)}get description(){return this.getMetaProperty("description","")}set description(e){this.setMetaProperty("description",e)}get links(){return this.getMetaProperty("links",[])}set links(e){this.setMetaProperty("links",e)}get isFrozen(){return Object.isFrozen(this)}get parents(){let{parent:e}=this;const t=new i;for(;e;)t.push(e),e=e.parent;return t}get children(){if(Array.isArray(this.content))return new i(this.content);if(this.content instanceof s){const e=new i([this.content.key]);return this.content.value&&e.push(this.content.value),e}return this.content instanceof o?new i([this.content]):new i}get recursiveChildren(){const e=new i;return this.children.forEach(t=>{e.push(t),t.recursiveChildren.forEach(t=>{e.push(t)})}),e}}e.exports=o},8666:(e,t,r)=>{var n=r(674),s=r(9460),i=r(2306),o=i&&i.isTypedArray,a=o?s(o):n;e.exports=a},8712:(e,t,r)=>{const n=r(8631);e.exports=class extends n{constructor(e,t,r){super(e,t,r),this.element="string"}primitive(){return"string"}get length(){return this.content.length}}},8861:(e,t,r)=>{var n=r(5650),s=r(1623),i=r(6285),o=r(3934),a=r(5894),c=r(9828),l=n?n.prototype:void 0,u=l?l.valueOf:void 0;e.exports=function(e,t,r,n,l,h,p){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!h(new s(e),new s(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=a;case"[object Set]":var d=1&n;if(f||(f=c),e.size!=t.size&&!d)return!1;var m=p.get(e);if(m)return m==t;n|=2,p.set(e,t);var y=o(f(e),f(t),n,l,h,p);return p.delete(e),y;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},8870:(e,t,r)=>{var n=r(5650),s=Object.prototype,i=s.hasOwnProperty,o=s.toString,a=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(e){}var s=o.call(e);return n&&(t?e[a]=r:delete e[a]),s}},8942:(e,t,r)=>{var n=r(4967),s="object"==typeof self&&self&&self.Object===Object&&self,i=n||s||Function("return this")();e.exports=i},9005:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9067:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},9068:(e,t,r)=>{var n=r(4700);e.exports=function(e,t){var r=n(this,e),s=r.size;return r.set(e,t),this.size+=r.size==s?0:1,this}},9270:(e,t,r)=>{var n=r(4715)(r(8942),"WeakMap");e.exports=n},9306:e=>{e.exports=function(){return[]}},9310:e=>{e.exports=function(e){return null===e}},9361:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},9413:(e,t,r)=>{var n=r(4715)(r(8942),"Promise");e.exports=n},9460:e=>{e.exports=function(e){return function(t){return e(t)}}},9620:(e,t,r)=>{const n=r(8631);e.exports=class extends n{constructor(e,t,r){super(e||[],t,r),this.element="link"}get relation(){return this.attributes.get("relation")}set relation(e){this.attributes.set("relation",e)}get href(){return this.attributes.get("href")}set href(e){this.attributes.set("href",e)}}},9624:(e,t,r)=>{var n=r(3655),s=r(4759),i=r(1580),o=r(4066),a=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,h=l.hasOwnProperty,p=RegExp("^"+u.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||s(e))&&(n(e)?p:a).test(o(e))}},9632:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},9753:(e,t,r)=>{var n=r(5098),s=r(1386),i=r(9770);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||s),string:new n}}},9770:(e,t,r)=>{var n=r(4715)(r(8942),"Map");e.exports=n},9796:(e,t,r)=>{const n=r(1517),s=r(8631),i=r(4123);class o extends s{constructor(e,t,r){super(e||[],t,r),this.element="array"}primitive(){return"array"}get(e){return this.content[e]}getValue(e){const t=this.get(e);if(t)return t.toValue()}getIndex(e){return this.content[e]}set(e,t){return this.content[e]=this.refract(t),this}remove(e){const t=this.content.splice(e,1);return t.length?t[0]:null}map(e,t){return this.content.map(e,t)}flatMap(e,t){return this.map(e,t).reduce((e,t)=>e.concat(t),[])}compactMap(e,t){const r=[];return this.forEach(n=>{const s=e.bind(t)(n);s&&r.push(s)}),r}filter(e,t){return new i(this.content.filter(e,t))}reject(e,t){return this.filter(n(e),t)}reduce(e,t){let r,n;void 0!==t?(r=0,n=this.refract(t)):(r=1,n="object"===this.primitive()?this.first.value:this.first);for(let t=r;t<this.length;t+=1){const r=this.content[t];n="object"===this.primitive()?this.refract(e(n,r.value,r.key,r,this)):this.refract(e(n,r,t,this))}return n}forEach(e,t){this.content.forEach((r,n)=>{e.bind(t)(r,this.refract(n))})}shift(){return this.content.shift()}unshift(e){this.content.unshift(this.refract(e))}push(e){return this.content.push(this.refract(e)),this}add(e){this.push(e)}findElements(e,t){const r=t||{},n=!!r.recursive,s=void 0===r.results?[]:r.results;return this.forEach((t,r,i)=>{n&&void 0!==t.findElements&&t.findElements(e,{results:s,recursive:n}),e(t,r,i)&&s.push(t)}),s}find(e){return new i(this.findElements(e,{recursive:!0}))}findByElement(e){return this.find(t=>t.element===e)}findByClass(e){return this.find(t=>t.classes.includes(e))}getById(e){return this.find(t=>t.id.toValue()===e).first}includes(e){return this.content.some(t=>t.equals(e))}contains(e){return this.includes(e)}empty(){return new this.constructor([])}"fantasy-land/empty"(){return this.empty()}concat(e){return new this.constructor(this.content.concat(e.content))}"fantasy-land/concat"(e){return this.concat(e)}"fantasy-land/map"(e){return new this.constructor(this.map(e))}"fantasy-land/chain"(e){return this.map(t=>e(t),this).reduce((e,t)=>e.concat(t),this.empty())}"fantasy-land/filter"(e){return new this.constructor(this.content.filter(e))}"fantasy-land/reduce"(e,t){return this.content.reduce(e,t)}get length(){return this.content.length}get isEmpty(){return 0===this.content.length}get first(){return this.getIndex(0)}get second(){return this.getIndex(1)}get last(){return this.getIndex(this.length-1)}}o.empty=function(){return new this},o["fantasy-land/empty"]=o.empty,"undefined"!=typeof Symbol&&(o.prototype[Symbol.iterator]=function(){return this.content[Symbol.iterator]()}),e.exports=o},9828:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}},9847:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,s=0,i=[];++r<n;){var o=e[r];t(o,r,e)&&(i[s++]=o)}return i}}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n](i,i.exports,r),i.loaded=!0,i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};return(()=>{"use strict";r.r(n),r.d(n,{EvaluationJsonPathError:()=>c,MultiEvaluationJsonPathError:()=>l,evaluate:()=>It,evaluateMulti:()=>Bt});class e extends AggregateError{constructor(e,t,r){super(e,t,r),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const t=e;class s extends Error{static[Symbol.hasInstance](e){return super[Symbol.hasInstance](e)||Function.prototype[Symbol.hasInstance].call(t,e)}constructor(e,t){super(e,t),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const i=s;const o=class extends i{constructor(e,t){if(super(e,t),null!=t&&"object"==typeof t){const{cause:e,...r}=t;Object.assign(this,r)}}};const a=class extends o{};const c=class extends a{path;element;constructor(e,t){super(e,t),void 0!==t&&(this.path=t.path,this.element=t.element)}};const l=class extends a{paths;element;constructor(e,t){super(e,t),void 0!==t&&(this.paths=t.paths,this.element=t.element)}};class u{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+u.version}static addUnaryOp(e){return u.max_unop_len=Math.max(e.length,u.max_unop_len),u.unary_ops[e]=1,u}static addBinaryOp(e,t,r){return u.max_binop_len=Math.max(e.length,u.max_binop_len),u.binary_ops[e]=t,r?u.right_associative.add(e):u.right_associative.delete(e),u}static addIdentifierChar(e){return u.additional_identifier_chars.add(e),u}static addLiteral(e,t){return u.literals[e]=t,u}static removeUnaryOp(e){return delete u.unary_ops[e],e.length===u.max_unop_len&&(u.max_unop_len=u.getMaxKeyLen(u.unary_ops)),u}static removeAllUnaryOps(){return u.unary_ops={},u.max_unop_len=0,u}static removeIdentifierChar(e){return u.additional_identifier_chars.delete(e),u}static removeBinaryOp(e){return delete u.binary_ops[e],e.length===u.max_binop_len&&(u.max_binop_len=u.getMaxKeyLen(u.binary_ops)),u.right_associative.delete(e),u}static removeAllBinaryOps(){return u.binary_ops={},u.max_binop_len=0,u}static removeLiteral(e){return delete u.literals[e],u}static removeAllLiterals(){return u.literals={},u}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new u(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return u.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!u.binary_ops[String.fromCharCode(e)]||u.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return u.isIdentifierStart(e)||u.isDecimalDigit(e)}throwError(e){const t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(u.hooks[e]){const r={context:this,node:t};return u.hooks.run(e,r),r.node}return t}searchHook(e){if(u.hooks[e]){const t={context:this};return u.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===u.SPACE_CODE||e===u.TAB_CODE||e===u.LF_CODE||e===u.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const e=this.gobbleExpressions(),t=1===e.length?e[0]:{type:u.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t,r,n=[];for(;this.index<this.expr.length;)if(t=this.code,t===u.SEMCOL_CODE||t===u.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())n.push(r);else if(this.index<this.expr.length){if(t===e)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){const e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,u.max_binop_len),t=e.length;for(;t>0;){if(u.binary_ops.hasOwnProperty(e)&&(!u.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!u.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,r,n,s,i,o,a,c;if(i=this.gobbleToken(),!i)return i;if(t=this.gobbleBinaryOp(),!t)return i;for(s={value:t,prec:u.binaryPrecedence(t),right_a:u.right_associative.has(t)},o=this.gobbleToken(),o||this.throwError("Expected expression after "+t),n=[i,s,o];t=this.gobbleBinaryOp();){if(r=u.binaryPrecedence(t),0===r){this.index-=t.length;break}s={value:t,prec:r,right_a:u.right_associative.has(t)},c=t;const a=e=>s.right_a&&e.right_a?r>e.prec:r<=e.prec;for(;n.length>2&&a(n[n.length-2]);)o=n.pop(),t=n.pop().value,i=n.pop(),e={type:u.BINARY_EXP,operator:t,left:i,right:o},n.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+c),n.push(s,e)}for(a=n.length-1,e=n[a];a>1;)e={type:u.BINARY_EXP,operator:n[a-1].value,left:n[a-2],right:e},a-=2;return e}gobbleToken(){let e,t,r,n;if(this.gobbleSpaces(),n=this.searchHook("gobble-token"),n)return this.runHook("after-token",n);if(e=this.code,u.isDecimalDigit(e)||e===u.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===u.SQUOTE_CODE||e===u.DQUOTE_CODE)n=this.gobbleStringLiteral();else if(e===u.OBRACK_CODE)n=this.gobbleArray();else{for(t=this.expr.substr(this.index,u.max_unop_len),r=t.length;r>0;){if(u.unary_ops.hasOwnProperty(t)&&(!u.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!u.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=r;const e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:u.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--r)}u.isIdentifierStart(e)?(n=this.gobbleIdentifier(),u.literals.hasOwnProperty(n.name)?n={type:u.LITERAL,value:u.literals[n.name],raw:n.name}:n.name===u.this_str&&(n={type:u.THIS_EXP})):e===u.OPAREN_CODE&&(n=this.gobbleGroup())}return n?(n=this.gobbleTokenProperty(n),this.runHook("after-token",n)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===u.PERIOD_CODE||t===u.OBRACK_CODE||t===u.OPAREN_CODE||t===u.QUMARK_CODE;){let r;if(t===u.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==u.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===u.OBRACK_CODE?((e={type:u.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()}).property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),t=this.code,t!==u.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===u.OPAREN_CODE?e={type:u.CALL_EXP,arguments:this.gobbleArguments(u.CPAREN_CODE),callee:e}:(t===u.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),e={type:u.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),r&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e,t,r="";for(;u.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);if(this.code===u.PERIOD_CODE)for(r+=this.expr.charAt(this.index++);u.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);if(e=this.char,"e"===e||"E"===e){for(r+=this.expr.charAt(this.index++),e=this.char,"+"!==e&&"-"!==e||(r+=this.expr.charAt(this.index++));u.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);u.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+r+this.char+")")}return t=this.code,u.isIdentifierStart(t)?this.throwError("Variable names cannot start with a number ("+r+this.char+")"):(t===u.PERIOD_CODE||1===r.length&&r.charCodeAt(0)===u.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:u.LITERAL,value:parseFloat(r),raw:r}}gobbleStringLiteral(){let e="";const t=this.index,r=this.expr.charAt(this.index++);let n=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===r){n=!0;break}if("\\"===t)switch(t=this.expr.charAt(this.index++),t){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return n||this.throwError('Unclosed quote after "'+e+'"'),{type:u.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(u.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(e=this.code,u.isIdentifierPart(e));)this.index++;return{type:u.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){const t=[];let r=!1,n=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let s=this.code;if(s===e){r=!0,this.index++,e===u.CPAREN_CODE&&n&&n>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(s===u.COMMA_CODE){if(this.index++,n++,n!==t.length)if(e===u.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===u.CBRACK_CODE)for(let e=t.length;e<n;e++)t.push(null)}else if(t.length!==n&&0!==n)this.throwError("Expected comma");else{const e=this.gobbleExpression();e&&e.type!==u.COMPOUND||this.throwError("Expected comma"),t.push(e)}}return r||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(u.CPAREN_CODE);if(this.code===u.CPAREN_CODE)return this.index++,1===e.length?e[0]:!!e.length&&{type:u.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:u.ARRAY_EXP,elements:this.gobbleArguments(u.CBRACK_CODE)}}}const h=new class{add(e,t,r){if("string"!=typeof arguments[0])for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][r?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}};Object.assign(u,{hooks:h,plugins:new class{constructor(e){this.jsep=e,this.registered={}}register(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t.forEach(e=>{if("object"!=typeof e||!e.name||!e.init)throw new Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}(u),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),u.max_unop_len=u.getMaxKeyLen(u.unary_ops),u.max_binop_len=u.getMaxKeyLen(u.binary_ops);const p=e=>new u(e).parse(),f=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(u).filter(e=>!f.includes(e)&&void 0===p[e]).forEach(e=>{p[e]=u[e]}),p.Jsep=u;var d={name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;const r=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;const s=this.gobbleExpression();if(s||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:n,alternate:s},r.operator&&e.binary_ops[r.operator]<=.9){let n=r;for(;n.right.operator&&e.binary_ops[n.right.operator]<=.9;)n=n.right;t.node.test=n.right,n.right=t.node,t.node=r}}else this.throwError("Expected :")}})}};p.plugins.register(d);var m={name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){const r=++this.index;let n=!1;for(;this.index<this.expr.length;){if(47===this.code&&!n){const n=this.expr.slice(r,this.index);let s,i="";for(;++this.index<this.expr.length;){const e=this.code;if(!(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;i+=this.char}try{s=new RegExp(n,i)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:s,raw:this.expr.slice(r-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?n=!0:n&&this.code===e.CBRACK_CODE&&(n=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}};const y={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[43,45],assignmentPrecedence:.9,init(e){const t=[e.IDENTIFIER,e.MEMBER_EXP];function r(e){y.assignmentOperators.has(e.operator)?(e.type="AssignmentExpression",r(e.left),r(e.right)):e.operator||Object.values(e).forEach(e=>{e&&"object"==typeof e&&r(e)})}y.assignmentOperators.forEach(t=>e.addBinaryOp(t,y.assignmentPrecedence,!0)),e.hooks.add("gobble-token",function(e){const r=this.code;y.updateOperators.some(e=>e===r&&e===this.expr.charCodeAt(this.index+1))&&(this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},e.node.argument&&t.includes(e.node.argument.type)||this.throwError(`Unexpected ${e.node.operator}`))}),e.hooks.add("after-token",function(e){if(e.node){const r=this.code;y.updateOperators.some(e=>e===r&&e===this.expr.charCodeAt(this.index+1))&&(t.includes(e.node.type)||this.throwError(`Unexpected ${e.node.operator}`),this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:e.node,prefix:!1})}}),e.hooks.add("after-expression",function(e){e.node&&r(e.node)})}};p.plugins.register(m,y),p.addUnaryOp("typeof"),p.addLiteral("null",null),p.addLiteral("undefined",void 0);const b=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__"]),g={evalAst(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":return g.evalBinaryExpression(e,t);case"Compound":return g.evalCompound(e,t);case"ConditionalExpression":return g.evalConditionalExpression(e,t);case"Identifier":return g.evalIdentifier(e,t);case"Literal":return g.evalLiteral(e,t);case"MemberExpression":return g.evalMemberExpression(e,t);case"UnaryExpression":return g.evalUnaryExpression(e,t);case"ArrayExpression":return g.evalArrayExpression(e,t);case"CallExpression":return g.evalCallExpression(e,t);case"AssignmentExpression":return g.evalAssignmentExpression(e,t);default:throw SyntaxError("Unexpected expression",e)}},evalBinaryExpression:(e,t)=>({"||":(e,t)=>e||t(),"&&":(e,t)=>e&&t(),"|":(e,t)=>e|t(),"^":(e,t)=>e^t(),"&":(e,t)=>e&t(),"==":(e,t)=>e==t(),"!=":(e,t)=>e!=t(),"===":(e,t)=>e===t(),"!==":(e,t)=>e!==t(),"<":(e,t)=>e<t(),">":(e,t)=>e>t(),"<=":(e,t)=>e<=t(),">=":(e,t)=>e>=t(),"<<":(e,t)=>e<<t(),">>":(e,t)=>e>>t(),">>>":(e,t)=>e>>>t(),"+":(e,t)=>e+t(),"-":(e,t)=>e-t(),"*":(e,t)=>e*t(),"/":(e,t)=>e/t(),"%":(e,t)=>e%t()}[e.operator](g.evalAst(e.left,t),()=>g.evalAst(e.right,t))),evalCompound(e,t){let r;for(let n=0;n<e.body.length;n++){"Identifier"===e.body[n].type&&["var","let","const"].includes(e.body[n].name)&&e.body[n+1]&&"AssignmentExpression"===e.body[n+1].type&&(n+=1);const s=e.body[n];r=g.evalAst(s,t)}return r},evalConditionalExpression:(e,t)=>g.evalAst(e.test,t)?g.evalAst(e.consequent,t):g.evalAst(e.alternate,t),evalIdentifier(e,t){if(Object.hasOwn(t,e.name))return t[e.name];throw ReferenceError(`${e.name} is not defined`)},evalLiteral:e=>e.value,evalMemberExpression(e,t){const r=String(e.computed?g.evalAst(e.property):e.property.name),n=g.evalAst(e.object,t);if(null==n)throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);if(!Object.hasOwn(n,r)&&b.has(r))throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);const s=n[r];return"function"==typeof s?s.bind(n):s},evalUnaryExpression:(e,t)=>({"-":e=>-g.evalAst(e,t),"!":e=>!g.evalAst(e,t),"~":e=>~g.evalAst(e,t),"+":e=>+g.evalAst(e,t),typeof:e=>typeof g.evalAst(e,t)}[e.operator](e.argument)),evalArrayExpression:(e,t)=>e.elements.map(e=>g.evalAst(e,t)),evalCallExpression(e,t){const r=e.arguments.map(e=>g.evalAst(e,t));return g.evalAst(e.callee,t)(...r)},evalAssignmentExpression(e,t){if("Identifier"!==e.left.type)throw SyntaxError("Invalid left-hand side in assignment");const r=e.left.name,n=g.evalAst(e.right,t);return t[r]=n,t[r]}};function v(e,t){return(e=e.slice()).push(t),e}function E(e,t){return(t=t.slice()).unshift(e),t}class x extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}}function w(e,t,r,n,s){if(!(this instanceof w))try{return new w(e,t,r,n,s)}catch(e){if(!e.avoidNew)throw e;return e.value}"string"==typeof e&&(s=n,n=r,r=t,t=e,e=null);const i=e&&"object"==typeof e;if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=!Object.hasOwn(e,"wrap")||e.wrap,this.sandbox=e.sandbox||{},this.eval=void 0===e.eval?"safe":e.eval,this.ignoreEvalErrors=void 0!==e.ignoreEvalErrors&&e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||s||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==e.autostart){const n={path:i?e.path:t};i?"json"in e&&(n.json=e.json):n.json=r;const s=this.evaluate(n);if(!s||"object"!=typeof s)throw new x(s);return s}}w.prototype.evaluate=function(e,t,r,n){let s=this.parent,i=this.parentProperty,{flatten:o,wrap:a}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,(e=e||this.path)&&"object"==typeof e&&!Array.isArray(e)){if(!e.path&&""!==e.path)throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=e),o=Object.hasOwn(e,"flatten")?e.flatten:o,this.currResultType=Object.hasOwn(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=Object.hasOwn(e,"sandbox")?e.sandbox:this.currSandbox,a=Object.hasOwn(e,"wrap")?e.wrap:a,this.currEval=Object.hasOwn(e,"eval")?e.eval:this.currEval,r=Object.hasOwn(e,"callback")?e.callback:r,this.currOtherTypeCallback=Object.hasOwn(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,s=Object.hasOwn(e,"parent")?e.parent:s,i=Object.hasOwn(e,"parentProperty")?e.parentProperty:i,e=e.path}if(s=s||null,i=i||null,Array.isArray(e)&&(e=w.toPathString(e)),!e&&""!==e||!t)return;const c=w.toPathArray(e);"$"===c[0]&&c.length>1&&c.shift(),this._hasParentSelector=null;const l=this._trace(c,t,["$"],s,i,r).filter(function(e){return e&&!e.isParentSelector});return l.length?a||1!==l.length||l[0].hasArrExpr?l.reduce((e,t)=>{const r=this._getPreferredOutput(t);return o&&Array.isArray(r)?e=e.concat(r):e.push(r),e},[]):this._getPreferredOutput(l[0]):a?[]:void 0},w.prototype._getPreferredOutput=function(e){const t=this.currResultType;switch(t){case"all":{const t=Array.isArray(e.path)?e.path:w.toPathArray(e.path);return e.pointer=w.toPointer(t),e.path="string"==typeof e.path?e.path:w.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return w.toPathString(e[t]);case"pointer":return w.toPointer(e.path);default:throw new TypeError("Unknown result type")}},w.prototype._handleCallback=function(e,t,r){if(t){const n=this._getPreferredOutput(e);e.path="string"==typeof e.path?e.path:w.toPathString(e.path),t(n,r,e)}},w.prototype._trace=function(e,t,r,n,s,i,o,a){let c;if(!e.length)return c={path:r,value:t,parent:n,parentProperty:s,hasArrExpr:o},this._handleCallback(c,i,"value"),c;const l=e[0],u=e.slice(1),h=[];function p(e){Array.isArray(e)?e.forEach(e=>{h.push(e)}):h.push(e)}if(("string"!=typeof l||a)&&t&&Object.hasOwn(t,l))p(this._trace(u,t[l],v(r,l),t,l,i,o));else if("*"===l)this._walk(t,e=>{p(this._trace(u,t[e],v(r,e),t,e,i,!0,!0))});else if(".."===l)p(this._trace(u,t,r,n,s,i,o)),this._walk(t,n=>{"object"==typeof t[n]&&p(this._trace(e.slice(),t[n],v(r,n),t,n,i,!0))});else{if("^"===l)return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:u,isParentSelector:!0};if("~"===l)return c={path:v(r,l),value:s,parent:n,parentProperty:null},this._handleCallback(c,i,"property"),c;if("$"===l)p(this._trace(u,t,r,null,null,i,o));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(l))p(this._slice(l,u,t,r,n,s,i));else if(0===l.indexOf("?(")){if(!1===this.currEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const e=l.replace(/^\?\((.*?)\)$/u,"$1"),o=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(e);o?this._walk(t,e=>{const a=[o[2]],c=o[1]?t[e][o[1]]:t[e];this._trace(a,c,r,n,s,i,!0).length>0&&p(this._trace(u,t[e],v(r,e),t,e,i,!0))}):this._walk(t,o=>{this._eval(e,t[o],o,r,n,s)&&p(this._trace(u,t[o],v(r,o),t,o,i,!0))})}else if("("===l[0]){if(!1===this.currEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(E(this._eval(l,t,r.at(-1),r.slice(0,-1),n,s),u),t,r,n,s,i,o))}else if("@"===l[0]){let e=!1;const o=l.slice(1,-2);switch(o){case"scalar":t&&["object","function"].includes(typeof t)||(e=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===o&&(e=!0);break;case"integer":!Number.isFinite(t)||t%1||(e=!0);break;case"number":Number.isFinite(t)&&(e=!0);break;case"nonFinite":"number"!=typeof t||Number.isFinite(t)||(e=!0);break;case"object":t&&typeof t===o&&(e=!0);break;case"array":Array.isArray(t)&&(e=!0);break;case"other":e=this.currOtherTypeCallback(t,r,n,s);break;case"null":null===t&&(e=!0);break;default:throw new TypeError("Unknown value type "+o)}if(e)return c={path:r,value:t,parent:n,parentProperty:s},this._handleCallback(c,i,"value"),c}else if("`"===l[0]&&t&&Object.hasOwn(t,l.slice(1))){const e=l.slice(1);p(this._trace(u,t[e],v(r,e),t,e,i,o,!0))}else if(l.includes(",")){const e=l.split(",");for(const o of e)p(this._trace(E(o,u),t,r,n,s,i,!0))}else!a&&t&&Object.hasOwn(t,l)&&p(this._trace(u,t[l],v(r,l),t,l,i,o,!0))}if(this._hasParentSelector)for(let e=0;e<h.length;e++){const r=h[e];if(r&&r.isParentSelector){const a=this._trace(r.expr,t,r.path,n,s,i,o);if(Array.isArray(a)){h[e]=a[0];const t=a.length;for(let r=1;r<t;r++)e++,h.splice(e,0,a[r])}else h[e]=a}}return h},w.prototype._walk=function(e,t){if(Array.isArray(e)){const r=e.length;for(let e=0;e<r;e++)t(e)}else e&&"object"==typeof e&&Object.keys(e).forEach(e=>{t(e)})},w.prototype._slice=function(e,t,r,n,s,i,o){if(!Array.isArray(r))return;const a=r.length,c=e.split(":"),l=c[2]&&Number.parseInt(c[2])||1;let u=c[0]&&Number.parseInt(c[0])||0,h=c[1]&&Number.parseInt(c[1])||a;u=u<0?Math.max(0,u+a):Math.min(a,u),h=h<0?Math.max(0,h+a):Math.min(a,h);const p=[];for(let e=u;e<h;e+=l){this._trace(E(e,t),r,n,s,i,o,!0).forEach(e=>{p.push(e)})}return p},w.prototype._eval=function(e,t,r,n,s,i){this.currSandbox._$_parentProperty=i,this.currSandbox._$_parent=s,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;const o=e.includes("@path");o&&(this.currSandbox._$_path=w.toPathString(n.concat([r])));const a=this.currEval+"Script:"+e;if(!w.cache[a]){let t=e.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(o&&(t=t.replaceAll("@path","_$_path")),"safe"===this.currEval||!0===this.currEval||void 0===this.currEval)w.cache[a]=new this.safeVm.Script(t);else if("native"===this.currEval)w.cache[a]=new this.vm.Script(t);else if("function"==typeof this.currEval&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const e=this.currEval;w.cache[a]=new e(t)}else{if("function"!=typeof this.currEval)throw new TypeError(`Unknown "eval" property "${this.currEval}"`);w.cache[a]={runInNewContext:e=>this.currEval(t,e)}}}try{return w.cache[a].runInNewContext(this.currSandbox)}catch(t){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+t.message+": "+e)}},w.cache={},w.toPathString=function(e){const t=e,r=t.length;let n="$";for(let e=1;e<r;e++)/^(~|\^|@.*?\(\))$/u.test(t[e])||(n+=/^[0-9*]+$/u.test(t[e])?"["+t[e]+"]":"['"+t[e]+"']");return n},w.toPointer=function(e){const t=e,r=t.length;let n="";for(let e=1;e<r;e++)/^(~|\^|@.*?\(\))$/u.test(t[e])||(n+="/"+t[e].toString().replaceAll("~","~0").replaceAll("/","~1"));return n},w.toPathArray=function(e){const{cache:t}=w;if(t[e])return t[e].concat();const r=[],n=e.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function(e,t){return"[#"+(r.push(t)-1)+"]"}).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,function(e,t){return"['"+t.replaceAll(".","%@%").replaceAll("~","%%@@%%")+"']"}).replaceAll("~",";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replaceAll("%@%",".").replaceAll("%%@@%%","~").replaceAll(/(?:;)?(\^+)(?:;)?/gu,function(e,t){return";"+t.split("").join(";")+";"}).replaceAll(/;;;|;;/gu,";..;").replaceAll(/;$|'?\]|'$/gu,"").split(";").map(function(e){const t=e.match(/#(\d+)/u);return t&&t[1]?r[t[1]]:e});return t[e]=n,t[e].concat()},w.prototype.safeVm={Script:class{constructor(e){this.code=e,this.ast=p(this.code)}runInNewContext(e){const t=Object.assign(Object.create(null),e);return g.evalAst(this.ast,t)}}};w.prototype.vm={Script:class{constructor(e){this.code=e}runInNewContext(e){let t=this.code;const r=Object.keys(e),n=[];!function(e,t,r){const n=e.length;for(let s=0;s<n;s++)r(e[s])&&t.push(e.splice(s--,1)[0])}(r,n,t=>"function"==typeof e[t]);const s=r.map(t=>e[t]);t=n.reduce((t,r)=>{let n=e[r].toString();return/function/u.test(n)||(n="function "+n),"var "+r+"="+n+";"+t},"")+t,/(['"])use strict\1/u.test(t)||r.includes("arguments")||(t="var arguments = undefined;"+t),t=t.replace(/;\s*$/u,"");const i=t.lastIndexOf(";"),o=-1!==i?t.slice(0,i+1)+" return "+t.slice(i+1):" return "+t;return new Function(...r,o)(...s)}}};const O=function(){const e=j,t=T,r=this,n="parser.js: Parser(): ";r.ast=void 0,r.stats=void 0,r.trace=void 0,r.callbacks=[];let s,i,o,a,c,l,u,h=0,p=0,f=0,d=0,m=0,y=new function(){this.state=e.ACTIVE,this.phraseLength=0,this.refresh=()=>{this.state=e.ACTIVE,this.phraseLength=0}};r.parse=(b,g,E,x)=>{const w=`${n}parse(): `;h=0,p=0,f=0,d=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(E),s=b.rules,i=b.udts;const O=g.toLowerCase();let A;for(const e in s)if(s.hasOwnProperty(e)&&O===s[e].lower){A=s[e].index;break}if(void 0===A)throw new Error(`${w}start rule name '${startRule}' not recognized`);(()=>{const e=`${n}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 n in r.callbacks)if(r.callbacks.hasOwnProperty(n)){if(t=a.indexOf(n.toLowerCase()),t<0)throw new Error(`${e}syntax callback '${n}' not a rule or udt name`);if(o=r.callbacks[n]?r.callbacks[n]:void 0,"function"!=typeof o&&void 0!==o)throw new Error(`${e}syntax callback[${n}] must be function reference or falsy)`);t<s.length?c[t]=o:l[t-s.length]=o}})(),r.trace&&r.trace.init(s,i,a),r.stats&&r.stats.init(s,i),r.ast&&r.ast.init(s,i,a),u=x,o=[{type:e.RNM,index:A}],v(0,0),o=void 0;let _=!1;switch(y.state){case e.ACTIVE:throw new Error(`${w}final state should never be 'ACTIVE'`);case e.NOMATCH:_=!1;break;case e.EMPTY:case e.MATCH:_=y.phraseLength===a.length;break;default:throw new Error("unrecognized state")}return{success:_,state:y.state,stateName:e.idName(y.state),length:a.length,matched:y.phraseLength,maxMatched:m,maxTreeDepth:f,nodeHits:d}};const b=(t,r,s,i)=>{if(r.phraseLength>s){let e=`${n}opRNM(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${r.phraseLength}`,e+=` must be <= remaining chars: ${s}`,new Error(e)}switch(r.state){case e.ACTIVE:if(!i)throw new Error(`${n}opRNM(${t.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:r.phraseLength=0;break;case e.MATCH:0===r.phraseLength&&(r.state=e.EMPTY);break;case e.NOMATCH:r.phraseLength=0;break;default:throw new Error(`${n}opRNM(${t.name}): callback function return error. Unrecognized return state: ${r.state}`)}},g=(t,c)=>{let p,f,d;const m=o[t],b=i[m.index];y.UdtIndex=b.index,h||(d=r.ast&&r.ast.udtDefined(m.index),d&&(f=s.length+m.index,p=r.ast.getLength(),r.ast.down(f,b.name)));const g=a.length-c;l[m.index](y,a,c,u),((t,r,s)=>{if(r.phraseLength>s){let e=`${n}opUDT(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${r.phraseLength}`,e+=` must be <= remaining chars: ${s}`,new Error(e)}switch(r.state){case e.ACTIVE:throw new Error(`${n}opUDT(${t.name}) ACTIVE state return not allowed.`);case e.EMPTY:if(!t.empty)throw new Error(`${n}opUDT(${t.name}) may not return EMPTY.`);r.phraseLength=0;break;case e.MATCH:if(0===r.phraseLength){if(!t.empty)throw new Error(`${n}opUDT(${t.name}) may not return EMPTY.`);r.state=e.EMPTY}break;case e.NOMATCH:r.phraseLength=0;break;default:throw new Error(`${n}opUDT(${t.name}): callback function return error. Unrecognized return state: ${r.state}`)}})(b,y,g),h||d&&(y.state===e.NOMATCH?r.ast.setLength(p):r.ast.up(f,b.name,c,y.phraseLength))},v=(t,i)=>{const l=`${n}opExecute(): `,E=o[t];switch(d+=1,p>f&&(f=p),p+=1,y.refresh(),r.trace&&r.trace.down(E,i),E.type){case e.ALT:((t,r)=>{const n=o[t];for(let t=0;t<n.children.length&&(v(n.children[t],r),y.state===e.NOMATCH);t+=1);})(t,i);break;case e.CAT:((t,n)=>{let s,i,a,c;const l=o[t];r.ast&&(i=r.ast.getLength()),s=!0,a=n,c=0;for(let t=0;t<l.children.length;t+=1){if(v(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,r.ast&&r.ast.setLength(i))})(t,i);break;case e.REP:((t,n)=>{let s,i,c,l;const u=o[t];if(0===u.max)return y.state=e.EMPTY,void(y.phraseLength=0);for(i=n,c=0,l=0,r.ast&&(s=r.ast.getLength());!(i>=a.length)&&(v(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,r.ast&&r.ast.setLength(s))})(t,i);break;case e.RNM:((t,n)=>{let i,l,p;const f=o[t],d=s[f.index],m=c[d.index];if(h||(l=r.ast&&r.ast.ruleDefined(f.index),l&&(i=r.ast.getLength(),r.ast.down(f.index,s[f.index].name))),m){const t=a.length-n;m(y,a,n,u),b(d,y,t,!0),y.state===e.ACTIVE&&(p=o,o=d.opcodes,v(0,n),o=p,m(y,a,n,u),b(d,y,t,!1))}else p=o,o=d.opcodes,v(0,n,y),o=p;h||l&&(y.state===e.NOMATCH?r.ast.setLength(i):r.ast.up(f.index,d.name,n,y.phraseLength))})(t,i);break;case e.TRG:((t,r)=>{const n=o[t];y.state=e.NOMATCH,r<a.length&&n.min<=a[r]&&a[r]<=n.max&&(y.state=e.MATCH,y.phraseLength=1)})(t,i);break;case e.TBS:((t,r)=>{const n=o[t],s=n.string.length;if(y.state=e.NOMATCH,r+s<=a.length){for(let e=0;e<s;e+=1)if(a[r+e]!==n.string[e])return;y.state=e.MATCH,y.phraseLength=s}})(t,i);break;case e.TLS:((t,r)=>{let n;const s=o[t];y.state=e.NOMATCH;const i=s.string.length;if(0!==i){if(r+i<=a.length){for(let e=0;e<i;e+=1)if(n=a[r+e],n>=65&&n<=90&&(n+=32),n!==s.string[e])return;y.state=e.MATCH,y.phraseLength=i}}else y.state=e.EMPTY})(t,i);break;case e.UDT:g(t,i);break;case e.AND:((t,r)=>{switch(h+=1,v(t+1,r),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,r)=>{switch(h+=1,v(t+1,r),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),r.stats&&r.stats.collect(E,y),r.trace&&r.trace.up(E,y.state,i,y.phraseLength),p-=1}},A=function(){const e=j,t=T,r=this;let n,s,i,o=0;const a=[],c=[],l=[];function u(e){let t="";for(;e-- >0;)t+=" ";return t}r.callbacks=[],r.init=(e,t,u)=>{let h;c.length=0,l.length=0,o=0,n=e,s=t,i=u;const p=[];for(h=0;h<n.length;h+=1)p.push(n[h].lower);for(h=0;h<s.length;h+=1)p.push(s[h].lower);for(o=n.length+s.length,h=0;h<o;h+=1)a[h]=void 0;for(const e in r.callbacks)if(r.callbacks.hasOwnProperty(e)){const t=e.toLowerCase();if(h=p.indexOf(t),h<0)throw new Error(`parser.js: Ast()): init: node '${e}' not a rule or udt name`);a[h]=r.callbacks[e]}},r.ruleDefined=e=>!!a[e],r.udtDefined=e=>!!a[n.length+e],r.down=(t,r)=>{const n=l.length;return c.push(n),l.push({name:r,thisIndex:n,thatIndex:void 0,state:e.SEM_PRE,callbackIndex:t,phraseIndex:void 0,phraseLength:void 0,stack:c.length}),n},r.up=(t,r,n,s)=>{const i=l.length,o=c.pop();return l.push({name:r,thisIndex:i,thatIndex:o,state:e.SEM_POST,callbackIndex:t,phraseIndex:n,phraseLength:s,stack:c.length}),l[o].thatIndex=i,l[o].phraseIndex=n,l[o].phraseLength=s,i},r.translate=t=>{let r,n;for(let s=0;s<l.length;s+=1)n=l[s],r=a[n.callbackIndex],r&&(n.state===e.SEM_PRE?r(e.SEM_PRE,i,n.phraseIndex,n.phraseLength,t):r&&r(e.SEM_POST,i,n.phraseIndex,n.phraseLength,t))},r.setLength=e=>{l.length=e,c.length=e>0?l[e-1].stack:0},r.getLength=()=>l.length,r.toXml=()=>{let r="",n=0;return r+='<?xml version="1.0" encoding="utf-8"?>\n',r+=`<root nodes="${l.length/2}" characters="${i.length}">\n`,r+="\x3c!-- input string --\x3e\n",r+=u(n+2),r+=t.charsToString(i),r+="\n",l.forEach(s=>{s.state===e.SEM_PRE?(n+=1,r+=u(n),r+=`<node name="${s.name}" index="${s.phraseIndex}" length="${s.phraseLength}">\n`,r+=u(n+2),r+=t.charsToString(i,s.phraseIndex,s.phraseLength),r+="\n"):(r+=u(n),r+=`</node>\x3c!-- name="${s.name}" --\x3e\n`,n-=1)}),r+="</root>\n",r}},_=function(){const e=j,t=T,r="parser.js: Trace(): ";let n,s,i,o="",a=0;const c=this,l=e=>{let t="",r=0;if(e>=0)for(;e--;)r+=1,5===r?(t+="|",r=0):t+=".";return t};c.init=(e,t,r)=>{s=e,i=t,n=r};const u=n=>{let o;switch(n.type){case e.ALT:o="ALT";break;case e.CAT:o="CAT";break;case e.REP:o=n.max===1/0?`REP(${n.min},inf)`:`REP(${n.min},${n.max})`;break;case e.RNM:o=`RNM(${s[n.index].name})`;break;case e.TRG:o=`TRG(${n.min},${n.max})`;break;case e.TBS:o=n.string.length>6?`TBS(${t.charsToString(n.string,0,3)}...)`:`TBS(${t.charsToString(n.string,0,6)})`;break;case e.TLS:o=n.string.length>6?`TLS(${t.charsToString(n.string,0,3)}...)`:`TLS(${t.charsToString(n.string,0,6)})`;break;case e.UDT:o=`UDT(${i[n.index].name})`;break;case e.AND:o="AND";break;case e.NOT:o="NOT";break;default:throw new Error(`${r}Trace: opName: unrecognized opcode`)}return o};c.down=(e,r)=>{const s=l(a),i=Math.min(100,n.length-r);let c=t.charsToString(n,r,i);i<n.length-r&&(c+="..."),c=`${s}|-|[${u(e)}]${c}\n`,o+=c,a+=1},c.up=(s,i,c,h)=>{const p=`${r}trace.up: `;a-=1;const f=l(a);let d,m,y;switch(i){case e.EMPTY:y="|E|",m="''";break;case e.MATCH:y="|M|",d=Math.min(100,h),m=d<h?`'${t.charsToString(n,c,d)}...'`:`'${t.charsToString(n,c,d)}'`;break;case e.NOMATCH:y="|N|",m="";break;default:throw new Error(`${p} unrecognized state`)}m=`${f}${y}[${u(s)}]${m}\n`,o+=m},c.displayTrace=()=>o},k=function(){const e=j;let t,r,n;const s=[],i=[],o=[];this.init=(e,n)=>{t=e,r=n,p()},this.collect=(t,r)=>{f(n,r.state,r.phraseLength),f(s[t.type],r.state,r.phraseLength),t.type===e.RNM&&f(i[t.index],r.state,r.phraseLength),t.type===e.UDT&&f(o[t.index],r.state,r.phraseLength)},this.displayStats=()=>{let t="";const r={match:0,empty:0,nomatch:0,total:0},n=(e,t,n,s,i)=>{r.match+=t,r.empty+=n,r.nomatch+=s,r.total+=i;return`${e} | ${a(t)} | ${a(n)} | ${a(s)} | ${a(i)} |\n`};return t+=" OPERATOR STATS\n",t+=" | MATCH | EMPTY | NOMATCH | TOTAL |\n",t+=n(" ALT",s[e.ALT].match,s[e.ALT].empty,s[e.ALT].nomatch,s[e.ALT].total),t+=n(" CAT",s[e.CAT].match,s[e.CAT].empty,s[e.CAT].nomatch,s[e.CAT].total),t+=n(" REP",s[e.REP].match,s[e.REP].empty,s[e.REP].nomatch,s[e.REP].total),t+=n(" RNM",s[e.RNM].match,s[e.RNM].empty,s[e.RNM].nomatch,s[e.RNM].total),t+=n(" TRG",s[e.TRG].match,s[e.TRG].empty,s[e.TRG].nomatch,s[e.TRG].total),t+=n(" TBS",s[e.TBS].match,s[e.TBS].empty,s[e.TBS].nomatch,s[e.TBS].total),t+=n(" TLS",s[e.TLS].match,s[e.TLS].empty,s[e.TLS].nomatch,s[e.TLS].total),t+=n(" UDT",s[e.UDT].match,s[e.UDT].empty,s[e.UDT].nomatch,s[e.UDT].total),t+=n(" AND",s[e.AND].match,s[e.AND].empty,s[e.AND].nomatch,s[e.AND].total),t+=n(" NOT",s[e.NOT].match,s[e.NOT].empty,s[e.NOT].nomatch,s[e.NOT].total),t+=n("TOTAL",r.match,r.empty,r.nomatch,r.total),t},this.displayHits=e=>{let t="";const r=(e,t,r,s,i)=>{n.match+=e,n.empty+=t,n.nomatch+=r,n.total+=s;return`| ${a(e)} | ${a(t)} | ${a(r)} | ${a(s)} | ${i}\n`};"string"==typeof e&&"a"===e.toLowerCase()[0]?(i.sort(c),o.sort(c),t+=" RULES/UDTS ALPHABETICALLY\n"):"string"==typeof e&&"i"===e.toLowerCase()[0]?(i.sort(u),o.sort(u),t+=" RULES/UDTS BY INDEX\n"):(i.sort(l),o.sort(l),t+=" RULES/UDTS BY HIT COUNT\n"),t+="| MATCH | EMPTY | NOMATCH | TOTAL | NAME\n";for(let e=0;e<i.length;e+=1){let n=i[e];n.total&&(t+=r(n.match,n.empty,n.nomatch,n.total,n.name))}for(let e=0;e<o.length;e+=1){let n=o[e];n.total&&(t+=r(n.match,n.empty,n.nomatch,n.total,n.name))}return t};const a=e=>e<10?` ${e}`:e<100?` ${e}`:e<1e3?` ${e}`:e<1e4?` ${e}`:e<1e5?` ${e}`:e<1e6?` ${e}`:`${e}`,c=(e,t)=>e.lower<t.lower?-1:e.lower>t.lower?1:0,l=(e,t)=>e.total<t.total?1:e.total>t.total?-1:c(e,t),u=(e,t)=>e.index<t.index?-1:e.index>t.index?1:0,h=function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},p=()=>{s.length=0,n=new h,s[e.ALT]=new h,s[e.CAT]=new h,s[e.REP]=new h,s[e.RNM]=new h,s[e.TRG]=new h,s[e.TBS]=new h,s[e.TLS]=new h,s[e.UDT]=new h,s[e.AND]=new h,s[e.NOT]=new h,i.length=0;for(let e=0;e<t.length;e+=1)i.push({empty:0,match:0,nomatch:0,total:0,name:t[e].name,lower:t[e].lower,index:t[e].index});if(r.length>0){o.length=0;for(let e=0;e<r.length;e+=1)o.push({empty:0,match:0,nomatch:0,total:0,name:r[e].name,lower:r[e].lower,index:r[e].index})}},f=(t,r)=>{switch(t.total+=1,r){case e.EMPTY:t.empty+=1;break;case e.MATCH:t.match+=1;break;case e.NOMATCH:t.nomatch+=1;break;default:throw new Error(`parser.js: Stats(): collect(): incStat(): unrecognized state: ${r}`)}}},T={stringToChars:e=>[...e].map(e=>e.codePointAt(0)),charsToString:(e,t,r)=>{let n=e;for(;!(void 0===t||t<0);){if(void 0===r){n=e.slice(t);break}if(r<=0)return"";n=e.slice(t,t+r);break}return String.fromCodePoint(...n)}},j={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,idName:e=>{switch(e){case j.ALT:return"ALT";case j.CAT:return"CAT";case j.REP:return"REP";case j.RNM:return"RNM";case j.TRG:return"TRG";case j.TBS:return"TBS";case j.TLS:return"TLS";case j.UDT:return"UDT";case j.AND:return"AND";case j.NOT:return"NOT";case j.ACTIVE:return"ACTIVE";case j.EMPTY:return"EMPTY";case j.MATCH:return"MATCH";case j.NOMATCH:return"NOMATCH";case j.SEM_PRE:return"SEM_PRE";case j.SEM_POST:return"SEM_POST";case j.SEM_OK:return"SEM_OK";default:return"UNRECOGNIZED STATE"}}};function S(){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 P 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,...r}=t;Object.assign(this,r)}}}const C=P;const M=class extends C{},N=e=>(t,r,n,s,i)=>{if("object"!=typeof i||null===i||Array.isArray(i))throw new M("parser's user data must be an object");if(t===j.SEM_PRE){const t={type:e,text:T.charsToString(r,n,s),start:n,length:s,children:[]};if(i.stack.length>0){i.stack[i.stack.length-1].children.push(t)}else i.root=t;i.stack.push(t)}t===j.SEM_POST&&i.stack.pop()};const $=class extends A{constructor(){super(),this.callbacks["json-pointer"]=N("json-pointer"),this.callbacks["reference-token"]=N("reference-token"),this.callbacks.slash=N("text")}getTree(){const e={stack:[],root:null};return this.translate(e),delete e.stack,e}},R=e=>{if("string"!=typeof e)throw new TypeError("Reference token must be a string");return e.replace(/~1/g,"/").replace(/~0/g,"~")};const D=class extends ${getTree(){const{root:e}=super.getTree();return e.children.filter(({type:e})=>"reference-token"===e).map(({text:e})=>R(e))}};const L=class extends Array{toString(){return this.map(e=>`"${String(e)}"`).join(", ")}};const I=class extends _{inferExpectations(){const e=this.displayTrace().split("\n"),t=new Set;let r=-1;for(let n=0;n<e.length;n++){const s=e[n];if(s.includes("M|")){const e=s.match(/]'(.*)'$/);e&&e[1]&&(r=n)}if(n>r){const e=s.match(/N\|\[TLS\(([^)]+)\)]/);e&&t.add(e[1])}}return new L(...t)}},B=new S,V=(e,{translator:t=new D,stats:r=!1,trace:n=!1}={})=>{if("string"!=typeof e)throw new TypeError("JSON Pointer must be a string");try{const s=new O;t&&(s.ast=t),r&&(s.stats=new k),n&&(s.trace=new I);const i=s.parse(B,"json-pointer",e);return{result:i,tree:i.success&&t?s.ast.getTree():void 0,stats:s.stats,trace:s.trace}}catch(t){throw new M("Unexpected error during JSON Pointer parsing",{cause:t,jsonPointer:e})}};new S,new O,new S,new O;const U=new S,z=new O,F=e=>{if("string"!=typeof e)return!1;try{return z.parse(U,"array-index",e).success}catch{return!1}},H=new S,K=new O,q=e=>{if("string"!=typeof e)return!1;try{return K.parse(H,"array-dash",e).success}catch{return!1}};const G=class{#e;#t;#r;constructor(e,t={}){this.#e=e,this.#e.steps=[],this.#e.failed=!1,this.#e.failedAt=-1,this.#e.message=`JSON Pointer "${t.jsonPointer}" was successfully evaluated against the provided value`,this.#e.context={...t,realm:t.realm.name},this.#t=[],this.#r=t.realm}step({referenceToken:e,input:t,output:r,success:n=!0,reason:s}){const i=this.#t.length;this.#t.push(e);const o={referenceToken:e,referenceTokenPosition:i,input:t,inputType:this.#r.isObject(t)?"object":this.#r.isArray(t)?"array":"unrecognized",output:r,success:n};s&&(o.reason=s),this.#e.steps.push(o),n||(this.#e.failed=!0,this.#e.failedAt=i,this.#e.message=s)}};const Y=class{name="";isArray(e){throw new C("Realm.isArray(node) must be implemented in a subclass")}isObject(e){throw new C("Realm.isObject(node) must be implemented in a subclass")}sizeOf(e){throw new C("Realm.sizeOf(node) must be implemented in a subclass")}has(e,t){throw new C("Realm.has(node) must be implemented in a subclass")}evaluate(e,t){throw new C("Realm.evaluate(node) must be implemented in a subclass")}};const J=class extends C{};const X=class extends J{};const W=class extends Y{name="json";isArray(e){return Array.isArray(e)}isObject(e){return"object"==typeof e&&null!==e&&!this.isArray(e)}sizeOf(e){return this.isArray(e)?e.length:this.isObject(e)?Object.keys(e).length:0}has(e,t){if(this.isArray(e)){const r=Number(t),n=r>>>0;if(r!==n)throw new X(`Invalid array index "${t}": index must be an unsinged 32-bit integer`,{referenceToken:t,currentValue:e,realm:this.name});return n<this.sizeOf(e)&&Object.prototype.hasOwnProperty.call(e,r)}return!!this.isObject(e)&&Object.prototype.hasOwnProperty.call(e,t)}evaluate(e,t){return this.isArray(e)?e[Number(t)]:e[t]}};const Q=class extends J{};const Z=class extends J{},ee=(e,t,{strictArrays:r=!0,strictObjects:n=!0,realm:s=new W,trace:i=!0}={})=>{const{result:o,tree:a,trace:c}=V(t,{trace:!!i}),l="object"==typeof i&&null!==i?new G(i,{jsonPointer:t,referenceTokens:a,strictArrays:r,strictObjects:n,realm:s,value:e}):null;try{let i;if(!o.success){let r=`Invalid JSON Pointer: "${t}". Syntax error at position ${o.maxMatched}`;throw r+=c?`, expected ${c.inferExpectations()}`:"",new J(r,{jsonPointer:t,currentValue:e,realm:s.name})}return a.reduce((e,o,c)=>{if(s.isArray(e)){if(q(o)){if(r)throw new X(`Invalid array index "-" at position ${c} in "${t}". The "-" token always refers to a nonexistent element during evaluation`,{jsonPointer:t,referenceTokens:a,referenceToken:o,referenceTokenPosition:c,currentValue:e,realm:s.name});return i=s.evaluate(e,String(s.sizeOf(e))),null==l||l.step({referenceToken:o,input:e,output:i}),i}if(!F(o))throw new X(`Invalid array index "${o}" at position ${c} in "${t}": index MUST be "0", or digits without a leading "0"`,{jsonPointer:t,referenceTokens:a,referenceToken:o,referenceTokenPosition:c,currentValue:e,realm:s.name});const n=Number(o);if(!Number.isSafeInteger(n))throw new X(`Invalid array index "${o}" at position ${c} in "${t}": index must be a safe integer`,{jsonPointer:t,referenceTokens:a,referenceToken:o,referenceTokenPosition:c,currentValue:e,realm:s.name});if(!s.has(e,o)&&r)throw new X(`Invalid array index "${o}" at position ${c} in "${t}": index not found in array`,{jsonPointer:t,referenceTokens:a,referenceToken:o,referenceTokenPosition:c,currentValue:e,realm:s.name});return i=s.evaluate(e,o),null==l||l.step({referenceToken:o,input:e,output:i}),i}if(s.isObject(e)){if(!s.has(e,o)&&n)throw new Z(`Invalid object key "${o}" at position ${c} in "${t}": key not found in object`,{jsonPointer:t,referenceTokens:a,referenceToken:o,referenceTokenPosition:c,currentValue:e,realm:s.name});return i=s.evaluate(e,o),null==l||l.step({referenceToken:o,input:e,output:i}),i}throw new Q(`Invalid reference token "${o}" at position ${c} in "${t}": cannot be applied to a non-object/non-array value`,{jsonPointer:t,referenceTokens:a,referenceToken:o,referenceTokenPosition:c,currentValue:e,realm:s.name})},e)}catch(e){if(null==l||l.step({referenceToken:e.referenceToken,input:e.currentValue,success:!1,reason:e.message}),e instanceof J)throw e;throw new J("Unexpected error during JSON Pointer evaluation",{cause:e,jsonPointer:t,referenceTokens:a})}};var te=r(8326);class re extends te.Om{constructor(e,t,r){super(e,t,r),this.element="annotation"}get code(){return this.attributes.get("code")}set code(e){this.attributes.set("code",e)}}const ne=re;class se extends te.Om{constructor(e,t,r){super(e,t,r),this.element="comment"}}const ie=se;function oe(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function ae(e){return function t(r){return 0===arguments.length||oe(r)?t:e.apply(this,arguments)}}function ce(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return oe(r)?t:ae(function(t){return e(r,t)});default:return oe(r)&&oe(n)?t:oe(r)?ae(function(t){return e(t,n)}):oe(n)?ae(function(t){return e(r,t)}):e(r,n)}}}function le(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}function ue(e,t,r){for(var n=0,s=r.length;n<s;){if(e(t,r[n]))return!0;n+=1}return!1}function he(e,t){return Object.prototype.hasOwnProperty.call(t,e)}const pe="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var fe=Object.prototype.toString;const de=function(){return"[object Arguments]"===fe.call(arguments)?function(e){return"[object Arguments]"===fe.call(e)}:function(e){return he("callee",e)}}();var me=!{toString:null}.propertyIsEnumerable("toString"),ye=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],be=function(){return arguments.propertyIsEnumerable("length")}(),ge=function(e,t){for(var r=0;r<e.length;){if(e[r]===t)return!0;r+=1}return!1};const ve="function"!=typeof Object.keys||be?ae(function(e){if(Object(e)!==e)return[];var t,r,n=[],s=be&&de(e);for(t in e)!he(t,e)||s&&"length"===t||(n[n.length]=t);if(me)for(r=ye.length-1;r>=0;)he(t=ye[r],e)&&!ge(n,t)&&(n[n.length]=t),r-=1;return n}):ae(function(e){return Object(e)!==e?[]:Object.keys(e)});const Ee=ae(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function xe(e,t,r,n){var s=le(e);function i(e,t){return we(e,t,r.slice(),n.slice())}return!ue(function(e,t){return!ue(i,t,e)},le(t),s)}function we(e,t,r,n){if(pe(e,t))return!0;var s,i,o=Ee(e);if(o!==Ee(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(o){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(s=e.constructor,null==(i=String(s).match(/^function (\w*)/))?"":i[1]))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!pe(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!pe(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 a=r.length-1;a>=0;){if(r[a]===e)return n[a]===t;a-=1}switch(o){case"Map":return e.size===t.size&&xe(e.entries(),t.entries(),r.concat([e]),n.concat([t]));case"Set":return e.size===t.size&&xe(e.values(),t.values(),r.concat([e]),n.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 c=ve(e);if(c.length!==ve(t).length)return!1;var l=r.concat([e]),u=n.concat([t]);for(a=c.length-1;a>=0;){var h=c[a];if(!he(h,t)||!we(t[h],e[h],l,u))return!1;a-=1}return!0}const Oe=ce(function(e,t){return we(e,t,[],[])})(ae(function(e){return function(){return e}})(void 0)());class Ae extends te.wE{constructor(e,t,r){super(e,t,r),this.element="parseResult"}get api(){return this.children.filter(e=>e.classes.contains("api")).first}get results(){return this.children.filter(e=>e.classes.contains("result"))}get result(){return this.results.first}get annotations(){return this.children.filter(e=>"annotation"===e.element)}get warnings(){return this.children.filter(e=>"annotation"===e.element&&e.classes.contains("warning"))}get errors(){return this.children.filter(e=>"annotation"===e.element&&e.classes.contains("error"))}get isEmpty(){return this.children.reject(e=>"annotation"===e.element).isEmpty}replaceResult(e){const{result:t}=this;if(Oe(t))return!1;const r=this.content.findIndex(e=>e===t);return-1!==r&&(this.content[r]=e,!0)}}const _e=Ae;class ke extends te.wE{constructor(e,t,r){super(e,t,r),this.element="sourceMap"}get positionStart(){return this.children.filter(e=>e.classes.contains("position")).get(0)}get positionEnd(){return this.children.filter(e=>e.classes.contains("position")).get(1)}set position(e){if(void 0===e)return;const t=new te.wE([e.start.row,e.start.column,e.start.char]),r=new te.wE([e.end.row,e.end.column,e.end.char]);t.classes.push("position"),r.classes.push("position"),this.push(t).push(r)}}const Te=ke,je=(e,t)=>"object"==typeof t&&null!==t&&e in t&&"function"==typeof t[e],Se=e=>"object"==typeof e&&null!=e&&"_storedElement"in e&&"string"==typeof e._storedElement&&"_content"in e,Pe=(e,t)=>"object"==typeof t&&null!==t&&"primitive"in t&&("function"==typeof t.primitive&&t.primitive()===e),Ce=(e,t)=>"object"==typeof t&&null!==t&&"classes"in t&&(Array.isArray(t.classes)||t.classes instanceof te.wE)&&t.classes.includes(e),Me=(e,t)=>"object"==typeof t&&null!==t&&"element"in t&&t.element===e,Ne=e=>e({hasMethod:je,hasBasicElementProps:Se,primitiveEq:Pe,isElementType:Me,hasClass:Ce}),$e=Ne(({hasBasicElementProps:e,primitiveEq:t})=>r=>r instanceof te.Hg||e(r)&&t(void 0,r)),Re=Ne(({hasBasicElementProps:e,primitiveEq:t})=>r=>r instanceof te.Om||e(r)&&t("string",r)),De=Ne(({hasBasicElementProps:e,primitiveEq:t})=>r=>r instanceof te.kT||e(r)&&t("number",r)),Le=Ne(({hasBasicElementProps:e,primitiveEq:t})=>r=>r instanceof te.Os||e(r)&&t("null",r)),Ie=Ne(({hasBasicElementProps:e,primitiveEq:t})=>r=>r instanceof te.bd||e(r)&&t("boolean",r)),Be=Ne(({hasBasicElementProps:e,primitiveEq:t,hasMethod:r})=>n=>n instanceof te.Sh||e(n)&&t("object",n)&&r("keys",n)&&r("values",n)&&r("items",n)),Ve=Ne(({hasBasicElementProps:e,primitiveEq:t,hasMethod:r})=>n=>n instanceof te.wE&&!(n instanceof te.Sh)||e(n)&&t("array",n)&&r("push",n)&&r("unshift",n)&&r("map",n)&&r("reduce",n)),Ue=Ne(({hasBasicElementProps:e,isElementType:t,primitiveEq:r})=>n=>n instanceof te.Pr||e(n)&&t("member",n)&&r(void 0,n)),ze=Ne(({hasBasicElementProps:e,isElementType:t,primitiveEq:r})=>n=>n instanceof te.Ft||e(n)&&t("link",n)&&r(void 0,n)),Fe=Ne(({hasBasicElementProps:e,isElementType:t,primitiveEq:r})=>n=>n instanceof te.sI||e(n)&&t("ref",n)&&r(void 0,n));Ne(({hasBasicElementProps:e,isElementType:t,primitiveEq:r})=>n=>n instanceof ne||e(n)&&t("annotation",n)&&r("array",n)),Ne(({hasBasicElementProps:e,isElementType:t,primitiveEq:r})=>n=>n instanceof ie||e(n)&&t("comment",n)&&r("string",n)),Ne(({hasBasicElementProps:e,isElementType:t,primitiveEq:r})=>n=>n instanceof _e||e(n)&&t("parseResult",n)&&r("array",n)),Ne(({hasBasicElementProps:e,isElementType:t,primitiveEq:r})=>n=>n instanceof Te||e(n)&&t("sourceMap",n)&&r("array",n));class He extends Y{name="apidom";isArray(e){return Ve(e)}isObject(e){return Be(e)}sizeOf(e){return this.isArray(e)||this.isObject(e)?e.length:0}has(e,t){if(this.isArray(e)){const r=Number(t),n=r>>>0;if(r!==n)throw new X(`Invalid array index "${t}": index must be an unsinged 32-bit integer`,{referenceToken:t,currentValue:e,realm:this.name});return n<this.sizeOf(e)}if(this.isObject(e)){const r=e.keys(),n=new Set(r);if(r.length!==n.size)throw new Z(`Object key "${t}" is not unique — JSON Pointer requires unique member names`,{referenceToken:t,currentValue:e,realm:this.name});return e.hasKey(t)}return!1}evaluate(e,t){return this.isArray(e)?e.get(Number(t)):this.isObject(e)?e.get(t):void 0}}const Ke=(e,t,r={})=>ee(e,t,{...r,realm:new He});const qe=function(){return!0};function Ge(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,r){return t.apply(this,arguments)};case 3:return function(e,r,n){return t.apply(this,arguments)};case 4:return function(e,r,n,s){return t.apply(this,arguments)};case 5:return function(e,r,n,s,i){return t.apply(this,arguments)};case 6:return function(e,r,n,s,i,o){return t.apply(this,arguments)};case 7:return function(e,r,n,s,i,o,a){return t.apply(this,arguments)};case 8:return function(e,r,n,s,i,o,a,c){return t.apply(this,arguments)};case 9:return function(e,r,n,s,i,o,a,c,l){return t.apply(this,arguments)};case 10:return function(e,r,n,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 Ye(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function Je(e){return function t(r,n,s){switch(arguments.length){case 0:return t;case 1:return oe(r)?t:ce(function(t,n){return e(r,t,n)});case 2:return oe(r)&&oe(n)?t:oe(r)?ce(function(t,r){return e(t,n,r)}):oe(n)?ce(function(t,n){return e(r,t,n)}):ae(function(t){return e(r,n,t)});default:return oe(r)&&oe(n)&&oe(s)?t:oe(r)&&oe(n)?ce(function(t,r){return e(t,r,s)}):oe(r)&&oe(s)?ce(function(t,r){return e(t,n,r)}):oe(n)&&oe(s)?ce(function(t,n){return e(r,t,n)}):oe(r)?ae(function(t){return e(t,n,s)}):oe(n)?ae(function(t){return e(r,t,s)}):oe(s)?ae(function(t){return e(r,n,t)}):e(r,n,s)}}}const Xe=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};const We=ae(function(e){return!!Xe(e)||!!e&&("object"==typeof e&&(!function(e){return"[object String]"===Object.prototype.toString.call(e)}(e)&&(0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))});var Qe="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function Ze(e,t,r){return function(n,s,i){if(We(i))return e(n,s,i);if(null==i)return s;if("function"==typeof i["fantasy-land/reduce"])return t(n,s,i,"fantasy-land/reduce");if(null!=i[Qe])return r(n,s,i[Qe]());if("function"==typeof i.next)return r(n,s,i);if("function"==typeof i.reduce)return t(n,s,i,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function et(e,t,r){for(var n=0,s=r.length;n<s;){if((t=e["@@transducer/step"](t,r[n]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n+=1}return e["@@transducer/result"](t)}const tt=ce(function(e,t){return Ge(e.length,function(){return e.apply(t,arguments)})});function rt(e,t,r){for(var n=r.next();!n.done;){if((t=e["@@transducer/step"](t,n.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n=r.next()}return e["@@transducer/result"](t)}function nt(e,t,r,n){return e["@@transducer/result"](r[n](tt(e["@@transducer/step"],e),t))}const st=Ze(et,nt,rt);var it=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}();const ot=Je(function(e,t,r){return st("function"==typeof e?new it(e):e,t,r)});function at(e,t){return function(){var r=arguments.length;if(0===r)return t();var n=arguments[r-1];return Xe(n)||"function"!=typeof n[e]?t.apply(this,arguments):n[e].apply(n,Array.prototype.slice.call(arguments,0,r-1))}}const ct=ae(at("tail",Je(at("slice",function(e,t,r){return Array.prototype.slice.call(r,e,t)}))(1,1/0)));function lt(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return Ge(arguments[0].length,ot(Ye,arguments[0],ct(arguments)))}function ut(e,t,r){return function(){for(var n=[],s=0,i=e,o=0,a=!1;o<t.length||s<arguments.length;){var c;o<t.length&&(!oe(t[o])||s>=arguments.length)?c=t[o]:(c=arguments[s],s+=1),n[o]=c,oe(c)?a=!0:i-=1,o+=1}return!a&&i<=0?r.apply(this,n):Ge(Math.max(0,i),ut(e,n,r))}}var ht=function(e,t){switch(arguments.length){case 0:return ht;case 1:return function t(r){return 0===arguments.length?t:pe(e,r)};default:return pe(e,t)}};const pt=ce(function(e,t){return 1===e?ae(t):Ge(e,ut(e,[],t))})(1,lt(Ee,ht("String"))),ft=(e,t,r)=>{const n=e[t];if(null!=n){if(!r&&"function"==typeof n)return n;const e=r?n.leave:n.enter;if("function"==typeof e)return e}else{const n=r?e.leave:e.enter;if(null!=n){if("function"==typeof n)return n;const e=n[t];if("function"==typeof e)return e}}return null},dt={},mt=e=>e?.type,yt=e=>"string"==typeof mt(e),bt=e=>Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e));((e,{visitFnGetter:t=ft,nodeTypeGetter:r=mt,breakSymbol:n=dt,deleteNodeSymbol:s=null,skipVisitingNodeSymbol:i=!1,exposeEdits:a=!1}={})=>{const c=Symbol("skip"),l=new Array(e.length).fill(c);return{enter(u,h,p,f,d,m){let y=u,b=!1;const g={...m,replaceWith(e,t){m.replaceWith(e,t),y=e}};for(let u=0;u<e.length;u+=1)if(l[u]===c){const c=t(e[u],r(y),!1);if("function"==typeof c){const t=c.call(e[u],y,h,p,f,d,g);if("function"==typeof t?.then)throw new o("Async visitor not supported in sync mode",{visitor:e[u],visitFn:c});if(t===i)l[u]=y;else if(t===n)l[u]=n;else{if(t===s)return t;if(void 0!==t){if(!a)return t;y=t,b=!0}}}}return b?y:void 0},leave(s,a,u,h,p,f){let d=s;const m={...f,replaceWith(e,t){f.replaceWith(e,t),d=e}};for(let s=0;s<e.length;s+=1)if(l[s]===c){const c=t(e[s],r(d),!0);if("function"==typeof c){const t=c.call(e[s],d,a,u,h,p,m);if("function"==typeof t?.then)throw new o("Async visitor not supported in sync mode",{visitor:e[s],visitFn:c});if(t===n)l[s]=n;else if(void 0!==t&&t!==i)return t}}else l[s]===d&&(l[s]=c)}}})[Symbol.for("nodejs.util.promisify.custom")]=(e,{visitFnGetter:t=ft,nodeTypeGetter:r=mt,breakSymbol:n=dt,deleteNodeSymbol:s=null,skipVisitingNodeSymbol:i=!1,exposeEdits:o=!1}={})=>{const a=Symbol("skip"),c=new Array(e.length).fill(a);return{async enter(l,u,h,p,f,d){let m=l,y=!1;const b={...d,replaceWith(e,t){d.replaceWith(e,t),m=e}};for(let l=0;l<e.length;l+=1)if(c[l]===a){const a=t(e[l],r(m),!1);if("function"==typeof a){const t=await a.call(e[l],m,u,h,p,f,b);if(t===i)c[l]=m;else if(t===n)c[l]=n;else{if(t===s)return t;if(void 0!==t){if(!o)return t;m=t,y=!0}}}}return y?m:void 0},async leave(s,o,l,u,h,p){let f=s;const d={...p,replaceWith(e,t){p.replaceWith(e,t),f=e}};for(let s=0;s<e.length;s+=1)if(c[s]===a){const a=t(e[s],r(f),!0);if("function"==typeof a){const t=await a.call(e[s],f,o,l,u,h,d);if(t===n)c[s]=n;else if(void 0!==t&&t!==i)return t}}else c[s]===f&&(c[s]=a)}}};const gt=(e,t,{keyMap:r=null,state:n={},breakSymbol:s=dt,deleteNodeSymbol:i=null,skipVisitingNodeSymbol:a=!1,visitFnGetter:c=ft,nodeTypeGetter:l=mt,nodePredicate:u=yt,nodeCloneFn:h=bt,detectCycles:p=!0}={})=>{const f=r||{};let d,m,y=Array.isArray(e),b=[e],g=-1,v=[],E=e;const x=[],w=[];do{g+=1;const e=g===b.length;let r;const O=e&&0!==v.length;if(e){if(r=0===w.length?void 0:x.pop(),E=m,m=w.pop(),O)if(y){E=E.slice();let e=0;for(const[t,r]of v){const n=t-e;r===i?(E.splice(n,1),e+=1):E[n]=r}}else{E=h(E);for(const[e,t]of v)E[e]=t}g=d.index,b=d.keys,v=d.edits,y=d.inArray,d=d.prev}else if(m!==i&&void 0!==m){if(r=y?g:b[g],E=m[r],E===i||void 0===E)continue;x.push(r)}let A;if(!Array.isArray(E)){if(!u(E))throw new o(`Invalid AST Node: ${String(E)}`,{node:E});if(p&&w.includes(E)){x.pop();continue}const i=c(t,l(E),e);if(i){for(const[e,r]of Object.entries(n))t[e]=r;const s={replaceWith(t,n){"function"==typeof n?n(t,E,r,m,x,w):m&&(m[r]=t),e||(E=t)}};A=i.call(t,E,r,m,x,w,s)}if("function"==typeof A?.then)throw new o("Async visitor not supported in sync mode",{visitor:t,visitFn:i});if(A===s)break;if(A===a){if(!e){x.pop();continue}}else if(void 0!==A&&(v.push([r,A]),!e)){if(!u(A)){x.pop();continue}E=A}}void 0===A&&O&&v.push([r,E]),e||(d={inArray:y,index:g,keys:b,edits:v,prev:d},y=Array.isArray(E),b=y?E:f[l(E)]??[],g=-1,v=[],m!==i&&void 0!==m&&w.push(m),m=E)}while(void 0!==d);return 0!==v.length?v.at(-1)[1]:e};gt[Symbol.for("nodejs.util.promisify.custom")]=async(e,t,{keyMap:r=null,state:n={},breakSymbol:s=dt,deleteNodeSymbol:i=null,skipVisitingNodeSymbol:a=!1,visitFnGetter:c=ft,nodeTypeGetter:l=mt,nodePredicate:u=yt,nodeCloneFn:h=bt,detectCycles:p=!0}={})=>{const f=r||{};let d,m,y=Array.isArray(e),b=[e],g=-1,v=[],E=e;const x=[],w=[];do{g+=1;const e=g===b.length;let r;const O=e&&0!==v.length;if(e){if(r=0===w.length?void 0:x.pop(),E=m,m=w.pop(),O)if(y){E=E.slice();let e=0;for(const[t,r]of v){const n=t-e;r===i?(E.splice(n,1),e+=1):E[n]=r}}else{E=h(E);for(const[e,t]of v)E[e]=t}g=d.index,b=d.keys,v=d.edits,y=d.inArray,d=d.prev}else if(m!==i&&void 0!==m){if(r=y?g:b[g],E=m[r],E===i||void 0===E)continue;x.push(r)}let A;if(!Array.isArray(E)){if(!u(E))throw new o(`Invalid AST Node: ${String(E)}`,{node:E});if(p&&w.includes(E)){x.pop();continue}const i=c(t,l(E),e);if(i){for(const[e,r]of Object.entries(n))t[e]=r;const s={replaceWith(t,n){"function"==typeof n?n(t,E,r,m,x,w):m&&(m[r]=t),e||(E=t)}};A=await i.call(t,E,r,m,x,w,s)}if(A===s)break;if(A===a){if(!e){x.pop();continue}}else if(void 0!==A&&(v.push([r,A]),!e)){if(!u(A)){x.pop();continue}E=A}}void 0===A&&O&&v.push([r,E]),e||(d={inArray:y,index:g,keys:b,edits:v,prev:d},y=Array.isArray(E),b=y?E:f[l(E)]??[],g=-1,v=[],m!==i&&void 0!==m&&w.push(m),m=E)}while(void 0!==d);return 0!==v.length?v.at(-1)[1]:e};const vt=class extends o{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};const Et=class extends vt{};const xt=class extends vt{},wt=(e,t={})=>{const{visited:r=new WeakMap}=t,n={...t,visited:r};if(r.has(e))return r.get(e);if(e instanceof te.KeyValuePair){const{key:t,value:s}=e,i=$e(t)?wt(t,n):t,o=$e(s)?wt(s,n):s,a=new te.KeyValuePair(i,o);return r.set(e,a),a}if(e instanceof te.ot){const t=e=>wt(e,n),s=[...e].map(t),i=new te.ot(s);return r.set(e,i),i}if(e instanceof te.G6){const t=e=>wt(e,n),s=[...e].map(t),i=new te.G6(s);return r.set(e,i),i}if($e(e)){const t=_t(e);if(r.set(e,t),e.content)if($e(e.content))t.content=wt(e.content,n);else if(e.content instanceof te.KeyValuePair)t.content=wt(e.content,n);else if(Array.isArray(e.content)){const r=e=>wt(e,n);t.content=e.content.map(r)}else t.content=e.content;else t.content=e.content;return t}throw new Et("Value provided to cloneDeep function couldn't be cloned",{value:e})};wt.safe=e=>{try{return wt(e)}catch{return e}};const Ot=e=>{const{key:t,value:r}=e;return new te.KeyValuePair(t,r)},At=e=>{const t=new e.constructor;if(t.element=e.element,e.meta.length>0&&(t._meta=wt(e.meta)),e.attributes.length>0&&(t._attributes=wt(e.attributes)),$e(e.content)){const r=e.content;t.content=At(r)}else Array.isArray(e.content)?t.content=[...e.content]:e.content instanceof te.KeyValuePair?t.content=Ot(e.content):t.content=e.content;return t},_t=e=>{if(e instanceof te.KeyValuePair)return Ot(e);if(e instanceof te.ot)return(e=>{const t=[...e];return new te.ot(t)})(e);if(e instanceof te.G6)return(e=>{const t=[...e];return new te.G6(t)})(e);if($e(e))return At(e);throw new xt("Value provided to cloneShallow function couldn't be cloned",{value:e})};_t.safe=e=>{try{return _t(e)}catch{return e}};const kt=e=>Be(e)?"ObjectElement":Ve(e)?"ArrayElement":Ue(e)?"MemberElement":Re(e)?"StringElement":Ie(e)?"BooleanElement":De(e)?"NumberElement":Le(e)?"NullElement":ze(e)?"LinkElement":Fe(e)?"RefElement":void 0,Tt=e=>$e(e)?_t(e):bt(e),jt=lt(kt,pt),St={ObjectElement:["content"],ArrayElement:["content"],MemberElement:["key","value"],StringElement:[],BooleanElement:[],NumberElement:[],NullElement:[],RefElement:[],LinkElement:[],Annotation:[],Comment:[],ParseResultElement:["content"],SourceMap:["content"]};const Pt=(e,t,{keyMap:r=St,...n}={})=>gt(e,t,{keyMap:r,nodeTypeGetter:kt,nodePredicate:jt,nodeCloneFn:Tt,...n});Pt[Symbol.for("nodejs.util.promisify.custom")]=async(e,t,{keyMap:r=St,...n}={})=>gt[Symbol.for("nodejs.util.promisify.custom")](e,t,{keyMap:r,nodeTypeGetter:kt,nodePredicate:jt,nodeCloneFn:Tt,...n});const Ct=e=>"string"==typeof e?.type?e.type:kt(e),Mt={EphemeralObject:["content"],EphemeralArray:["content"],...St},Nt=(e,t,{keyMap:r=Mt,...n}={})=>Pt(e,t,{keyMap:r,nodeTypeGetter:Ct,nodePredicate:qe,detectCycles:!1,deleteNodeSymbol:Symbol.for("delete-node"),skipVisitingNodeSymbol:Symbol.for("skip-visiting-node"),...n});Nt[Symbol.for("nodejs.util.promisify.custom")]=async(e,{keyMap:t=Mt,...r}={})=>Pt[Symbol.for("nodejs.util.promisify.custom")](e,visitor,{keyMap:t,nodeTypeGetter:Ct,nodePredicate:qe,detectCycles:!1,deleteNodeSymbol:Symbol.for("delete-node"),skipVisitingNodeSymbol:Symbol.for("skip-visiting-node"),...r});const $t=class{type="EphemeralArray";content=[];reference=void 0;constructor(e){this.content=e,this.reference=[]}toReference(){return this.reference}toArray(){return this.reference.push(...this.content),this.reference}};const Rt=class{type="EphemeralObject";content=[];reference=void 0;constructor(e){this.content=e,this.reference={}}toReference(){return this.reference}toObject(){return Object.assign(this.reference,Object.fromEntries(this.content))}};class Dt{ObjectElement={enter:e=>{if(this.references.has(e))return this.references.get(e).toReference();const t=new Rt(e.content);return this.references.set(e,t),t}};EphemeralObject={leave:e=>e.toObject()};MemberElement={enter:e=>[e.key,e.value]};ArrayElement={enter:e=>{if(this.references.has(e))return this.references.get(e).toReference();const t=new $t(e.content);return this.references.set(e,t),t}};EphemeralArray={leave:e=>e.toArray()};references=new WeakMap;BooleanElement(e){return e.toValue()}NumberElement(e){return e.toValue()}StringElement(e){return e.toValue()}NullElement(){return null}RefElement(e,...t){const r=t[3];return"EphemeralObject"===r[r.length-1]?.type?Symbol.for("delete-node"):String(e.toValue())}LinkElement(e){return Re(e.href)?e.href.toValue():""}}const Lt=e=>$e(e)?Re(e)||De(e)||Ie(e)||Le(e)?e.toValue():Nt(e,new Dt):e,It=(e,t)=>{try{const r=Lt(t);return w({path:e,json:r,resultType:"pointer"}).map(e=>Ke(t,e))}catch(r){throw new c(`JSON Path evaluation failed while evaluating "${String(e)}".`,{path:e,element:wt(t),cause:r})}},Bt=(e,t)=>{try{const r=Lt(t),n=[];for(const s of e){const e=w({path:s,json:r,resultType:"pointer"}),i=[];for(const r of e){const e=Ke(t,r);i.push(e)}Array.isArray(s)?n.push([w.toPathString(s),i]):n.push([s,i])}return n}catch(r){throw new l(`JSON Path evaluation failed while multi-evaluating "${String(e)}".`,{paths:e,element:wt(t),cause:r})}}})(),n})());
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@speclynx/apidom-json-path",
3
+ "version": "1.12.1",
4
+ "description": "Evaluate JSONPath expressions against ApiDOM.",
5
+ "publishConfig": {
6
+ "access": "public",
7
+ "registry": "https://registry.npmjs.org",
8
+ "provenance": true
9
+ },
10
+ "type": "module",
11
+ "sideEffects": false,
12
+ "unpkg": "./dist/apidom-json-path.browser.min.js",
13
+ "main": "./src/index.cjs",
14
+ "exports": {
15
+ "types": "./types/apidom-json-path.d.ts",
16
+ "import": "./src/index.mjs",
17
+ "require": "./src/index.cjs"
18
+ },
19
+ "types": "./types/apidom-json-path.d.ts",
20
+ "scripts": {
21
+ "build": "npm run clean && run-p --max-parallel ${CPU_CORES:-2} typescript:declaration build:es build:cjs build:umd:browser",
22
+ "build:es": "cross-env BABEL_ENV=es babel src --out-dir src --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward'",
23
+ "build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir src --extensions '.ts' --out-file-extension '.cjs' --root-mode 'upward'",
24
+ "build:umd:browser": "cross-env BABEL_ENV=browser webpack --config config/webpack/browser.config.js --progress",
25
+ "lint": "eslint ./",
26
+ "lint:fix": "eslint ./ --fix",
27
+ "clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs' 'test/**/*.mjs' ./dist ./types",
28
+ "typescript:check-types": "tsc --noEmit",
29
+ "typescript:declaration": "tsc -p tsconfig.declaration.json && api-extractor run -l -c ./config/api-extractor/api-extractor.json",
30
+ "test": "npm run build:es && cross-env BABEL_ENV=es babel test --out-dir test --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward' && cross-env NODE_ENV=test mocha",
31
+ "prepack": "copyfiles -u 3 ../../LICENSES/* LICENSES && copyfiles -u 2 ../../NOTICE .",
32
+ "postpack": "rimraf NOTICE LICENSES"
33
+ },
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/speclynx/apidom.git"
37
+ },
38
+ "author": "Vladimír Gorej",
39
+ "license": "Apache-2.0",
40
+ "dependencies": {
41
+ "@babel/runtime-corejs3": "^7.28.4",
42
+ "@speclynx/apidom-core": "^1.12.1",
43
+ "@speclynx/apidom-error": "^1.12.1",
44
+ "@speclynx/apidom-json-pointer": "^1.12.1",
45
+ "jsonpath-plus": "^10.3.0"
46
+ },
47
+ "files": [
48
+ "src/**/*.mjs",
49
+ "src/**/*.cjs",
50
+ "dist/",
51
+ "types/apidom-json-path.d.ts",
52
+ "LICENSES",
53
+ "NOTICE",
54
+ "README.md",
55
+ "CHANGELOG.md"
56
+ ],
57
+ "gitHead": "49be88493f922c4ace2e4ebc0f23387ccb62c4fc"
58
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
4
+ exports.__esModule = true;
5
+ exports.default = void 0;
6
+ var _JsonPathError = _interopRequireDefault(require("./JsonPathError.cjs"));
7
+ /**
8
+ * @public
9
+ */
10
+
11
+ /**
12
+ * @public
13
+ */
14
+ class EvaluationJsonPathError extends _JsonPathError.default {
15
+ path;
16
+ element;
17
+ constructor(message, structuredOptions) {
18
+ super(message, structuredOptions);
19
+ if (typeof structuredOptions !== 'undefined') {
20
+ this.path = structuredOptions.path;
21
+ this.element = structuredOptions.element;
22
+ }
23
+ }
24
+ }
25
+ var _default = exports.default = EvaluationJsonPathError;
@@ -0,0 +1,19 @@
1
+ import JsonPathError from "./JsonPathError.mjs";
2
+ /**
3
+ * @public
4
+ */
5
+ /**
6
+ * @public
7
+ */
8
+ class EvaluationJsonPathError extends JsonPathError {
9
+ path;
10
+ element;
11
+ constructor(message, structuredOptions) {
12
+ super(message, structuredOptions);
13
+ if (typeof structuredOptions !== 'undefined') {
14
+ this.path = structuredOptions.path;
15
+ this.element = structuredOptions.element;
16
+ }
17
+ }
18
+ }
19
+ export default EvaluationJsonPathError;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _apidomError = require("@speclynx/apidom-error");
6
+ /**
7
+ * @public
8
+ */
9
+ class JsonPathError extends _apidomError.ApiDOMStructuredError {}
10
+ var _default = exports.default = JsonPathError;
@@ -0,0 +1,7 @@
1
+ import { ApiDOMStructuredError } from '@speclynx/apidom-error';
2
+
3
+ /**
4
+ * @public
5
+ */
6
+ class JsonPathError extends ApiDOMStructuredError {}
7
+ export default JsonPathError;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
4
+ exports.__esModule = true;
5
+ exports.default = void 0;
6
+ var _JsonPathError = _interopRequireDefault(require("./JsonPathError.cjs"));
7
+ /**
8
+ * @public
9
+ */
10
+
11
+ /**
12
+ * @public
13
+ */
14
+ class MultiEvaluationJsonPathError extends _JsonPathError.default {
15
+ paths;
16
+ element;
17
+ constructor(message, structuredOptions) {
18
+ super(message, structuredOptions);
19
+ if (typeof structuredOptions !== 'undefined') {
20
+ this.paths = structuredOptions.paths;
21
+ this.element = structuredOptions.element;
22
+ }
23
+ }
24
+ }
25
+ var _default = exports.default = MultiEvaluationJsonPathError;
@@ -0,0 +1,19 @@
1
+ import JsonPathError from "./JsonPathError.mjs";
2
+ /**
3
+ * @public
4
+ */
5
+ /**
6
+ * @public
7
+ */
8
+ class MultiEvaluationJsonPathError extends JsonPathError {
9
+ paths;
10
+ element;
11
+ constructor(message, structuredOptions) {
12
+ super(message, structuredOptions);
13
+ if (typeof structuredOptions !== 'undefined') {
14
+ this.paths = structuredOptions.paths;
15
+ this.element = structuredOptions.element;
16
+ }
17
+ }
18
+ }
19
+ export default MultiEvaluationJsonPathError;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
4
+ exports.__esModule = true;
5
+ exports.default = void 0;
6
+ var _jsonpathPlus = require("jsonpath-plus");
7
+ var _apidomJsonPointer = require("@speclynx/apidom-json-pointer");
8
+ var _apidomCore = require("@speclynx/apidom-core");
9
+ var _MultiEvaluationJsonPathError = _interopRequireDefault(require("./errors/MultiEvaluationJsonPathError.cjs"));
10
+ /**
11
+ * @public
12
+ */
13
+
14
+ /**
15
+ * @public
16
+ */
17
+
18
+ /**
19
+ * Evaluates multiple JSONPaths on ApiDOM element.
20
+ * @public
21
+ */
22
+ const evaluateMulti = (paths, element) => {
23
+ try {
24
+ const json = (0, _apidomCore.toValue)(element);
25
+ const results = [];
26
+ for (const path of paths) {
27
+ const pointers = (0, _jsonpathPlus.JSONPath)({
28
+ path,
29
+ json,
30
+ resultType: 'pointer'
31
+ });
32
+ const endPointValues = [];
33
+ for (const pointer of pointers) {
34
+ const endPointValue = (0, _apidomJsonPointer.evaluate)(element, pointer);
35
+ endPointValues.push(endPointValue);
36
+ }
37
+ if (Array.isArray(path)) {
38
+ results.push([_jsonpathPlus.JSONPath.toPathString(path), endPointValues]);
39
+ } else {
40
+ results.push([path, endPointValues]);
41
+ }
42
+ }
43
+ return results;
44
+ } catch (error) {
45
+ throw new _MultiEvaluationJsonPathError.default(`JSON Path evaluation failed while multi-evaluating "${String(paths)}".`, {
46
+ paths,
47
+ element: (0, _apidomCore.cloneDeep)(element),
48
+ cause: error
49
+ });
50
+ }
51
+ };
52
+ var _default = exports.default = evaluateMulti;
@@ -0,0 +1,45 @@
1
+ import { JSONPath } from 'jsonpath-plus';
2
+ import { evaluate as jsonPointerEvaluate } from '@speclynx/apidom-json-pointer';
3
+ import { toValue, cloneDeep } from '@speclynx/apidom-core';
4
+ import MultiEvaluationJsonPathError from "./errors/MultiEvaluationJsonPathError.mjs";
5
+ /**
6
+ * @public
7
+ */
8
+ /**
9
+ * @public
10
+ */
11
+ /**
12
+ * Evaluates multiple JSONPaths on ApiDOM element.
13
+ * @public
14
+ */
15
+ const evaluateMulti = (paths, element) => {
16
+ try {
17
+ const json = toValue(element);
18
+ const results = [];
19
+ for (const path of paths) {
20
+ const pointers = JSONPath({
21
+ path,
22
+ json,
23
+ resultType: 'pointer'
24
+ });
25
+ const endPointValues = [];
26
+ for (const pointer of pointers) {
27
+ const endPointValue = jsonPointerEvaluate(element, pointer);
28
+ endPointValues.push(endPointValue);
29
+ }
30
+ if (Array.isArray(path)) {
31
+ results.push([JSONPath.toPathString(path), endPointValues]);
32
+ } else {
33
+ results.push([path, endPointValues]);
34
+ }
35
+ }
36
+ return results;
37
+ } catch (error) {
38
+ throw new MultiEvaluationJsonPathError(`JSON Path evaluation failed while multi-evaluating "${String(paths)}".`, {
39
+ paths,
40
+ element: cloneDeep(element),
41
+ cause: error
42
+ });
43
+ }
44
+ };
45
+ export default evaluateMulti;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
4
+ exports.__esModule = true;
5
+ exports.default = void 0;
6
+ var _jsonpathPlus = require("jsonpath-plus");
7
+ var _apidomJsonPointer = require("@speclynx/apidom-json-pointer");
8
+ var _apidomCore = require("@speclynx/apidom-core");
9
+ var _EvaluationJsonPathError = _interopRequireDefault(require("./errors/EvaluationJsonPathError.cjs"));
10
+ /**
11
+ * @public
12
+ */
13
+
14
+ /**
15
+ * Evaluates single JSONPath on ApiDOM element.
16
+ * @public
17
+ */
18
+ const evaluate = (path, element) => {
19
+ try {
20
+ const json = (0, _apidomCore.toValue)(element);
21
+ const pointers = (0, _jsonpathPlus.JSONPath)({
22
+ path,
23
+ json,
24
+ resultType: 'pointer'
25
+ });
26
+ return pointers.map(pointer => (0, _apidomJsonPointer.evaluate)(element, pointer));
27
+ } catch (error) {
28
+ throw new _EvaluationJsonPathError.default(`JSON Path evaluation failed while evaluating "${String(path)}".`, {
29
+ path,
30
+ element: (0, _apidomCore.cloneDeep)(element),
31
+ cause: error
32
+ });
33
+ }
34
+ };
35
+ var _default = exports.default = evaluate;
@@ -0,0 +1,29 @@
1
+ import { JSONPath } from 'jsonpath-plus';
2
+ import { evaluate as jsonPointerEvaluate } from '@speclynx/apidom-json-pointer';
3
+ import { toValue, cloneDeep } from '@speclynx/apidom-core';
4
+ import EvaluationJsonPathError from "./errors/EvaluationJsonPathError.mjs";
5
+ /**
6
+ * @public
7
+ */
8
+ /**
9
+ * Evaluates single JSONPath on ApiDOM element.
10
+ * @public
11
+ */
12
+ const evaluate = (path, element) => {
13
+ try {
14
+ const json = toValue(element);
15
+ const pointers = JSONPath({
16
+ path,
17
+ json,
18
+ resultType: 'pointer'
19
+ });
20
+ return pointers.map(pointer => jsonPointerEvaluate(element, pointer));
21
+ } catch (error) {
22
+ throw new EvaluationJsonPathError(`JSON Path evaluation failed while evaluating "${String(path)}".`, {
23
+ path,
24
+ element: cloneDeep(element),
25
+ cause: error
26
+ });
27
+ }
28
+ };
29
+ export default evaluate;