json-variables 12.2.3 → 12.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 12.2.4 (2026-09-06)
7
+
8
+ ### Performance Improvements
9
+
10
+ - Recorded a 44.94% higher normalized benchmark score than v12.1.3 (20,171 → 29,236).
11
+
6
12
  ## 12.2.3 (2026-09-01)
7
13
 
8
14
  ### Bug Fixes
@@ -30,10 +36,11 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
30
36
  - add codsen-glob and migrate glob consumers ([5595a2b](https://github.com/codsen/codsen/commit/5595a2b267eaa6cb60072d037aef00b7a28edd42))
31
37
  - refresh the tooling and generate with the latest dependencies ([781f802](https://github.com/codsen/codsen/commit/781f802911066a82a4533b0e5a3fcbd742d0dd83))
32
38
 
33
- ### Reverts
39
+ ## 12.1.3 (2026-01-15)
34
40
 
35
- - Revert "Merge pull request #128 from codsen/release/npm-32198404552-1" ([5baeeaa](https://github.com/codsen/codsen/commit/5baeeaaa677b86f1eaa6396cadf3aea32b06416e)), closes [#128](https://github.com/codsen/codsen/issues/128)
36
- - Revert "Merge pull request #127 from codsen/release/npm-32194020886-1" ([5f1e94d](https://github.com/codsen/codsen/commit/5f1e94deef910ce735266b16aeee08a76de7a862)), closes [#127](https://github.com/codsen/codsen/issues/127)
41
+ ### Performance Improvements
42
+
43
+ - Recorded a 13.8% higher normalized benchmark score than v12.0.33 (17,725 → 20,171).
37
44
 
38
45
  ## 12.1.0 (2025-10-15)
39
46
 
@@ -76,12 +83,58 @@ assert.deepEqual(data, target);
76
83
  - export types ([29de20c](https://github.com/codsen/codsen/commit/29de20cec94673562d76ee6a92e12243588b7376))
77
84
  - export types ([11b5fb9](https://github.com/codsen/codsen/commit/11b5fb936ce20e0a77c3a09806773e1cd7695c50))
78
85
 
86
+ ## 11.0.18 (2022-07-05)
87
+
88
+ ### Performance Improvements
89
+
90
+ - Recorded a 49.52% higher normalized benchmark score than v11.0.17 (14,098 → 21,080).
91
+
92
+ ## 11.0.17 (2022-05-04)
93
+
94
+ ### Performance Improvements
95
+
96
+ - Recorded a 17.98% higher normalized benchmark score than v11.0.16 (11,949 → 14,098).
97
+
79
98
  ## 11.0.16 (2022-04-18)
80
99
 
81
100
  ### Fixed
82
101
 
83
102
  - tweak types ([5da8102](https://github.com/codsen/codsen/commit/5da8102fa04b52c63b5a7a32733aaf8eace13569))
84
103
 
104
+ ### Performance Improvements
105
+
106
+ - Recorded a 16.19% higher normalized benchmark score than v11.0.15 (10,284 → 11,949).
107
+
108
+ ## 11.0.14 (2022-04-11)
109
+
110
+ ### Performance Improvements
111
+
112
+ - Recorded a 12.27% higher normalized benchmark score than v11.0.13 (16,444 → 18,461).
113
+
114
+ ## 11.0.13 (2022-04-10)
115
+
116
+ ### Performance Improvements
117
+
118
+ - Recorded a 43.19% higher normalized benchmark score than v11.0.12 (11,484 → 16,444).
119
+
120
+ ## 11.0.11 (2022-01-11)
121
+
122
+ ### Performance Improvements
123
+
124
+ - Recorded a 24.23% higher normalized benchmark score than v11.0.10 (12,791 → 15,890).
125
+
126
+ ## 11.0.9 (2021-12-24)
127
+
128
+ ### Performance Improvements
129
+
130
+ - Recorded a 25.49% higher normalized benchmark score than v11.0.8 (11,090 → 13,917).
131
+
132
+ ## 11.0.7 (2021-11-30)
133
+
134
+ ### Performance Improvements
135
+
136
+ - Recorded a 47.8% higher normalized benchmark score than v11.0.5 (14,775 → 21,838).
137
+
85
138
  ## 11.0.0 (2021-09-09)
86
139
 
87
140
  ### Features
package/README.md CHANGED
@@ -21,6 +21,8 @@
21
21
  <img src="https://img.shields.io/badge/licence-MIT-brightgreen.svg?style=flat-square" alt="MIT Licence">
22
22
  </p>
23
23
 
24
+ **Powered by object-path.** No other dependencies.
25
+
24
26
  ## Install
25
27
 
26
28
  This package is [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). If you're not ready yet, install an older version of this program, 10.1.0 (`npm i json-variables@10.1.0`).
@@ -55,7 +57,7 @@ assert.deepEqual(
55
57
 
56
58
  ## Documentation
57
59
 
58
- Please [visit codsen.com](https://codsen.com/os/json-variables/) for a full description of the API. If you’re looking for the **Changelog**, it’s [here](https://github.com/codsen/codsen/blob/main/packages/json-variables/CHANGELOG.md).
60
+ Please [visit codsen.com](https://codsen.com/os/json-variables/) for a full description of the API. For **Changelog**, see [raw md on GitHub](https://github.com/codsen/codsen/blob/main/packages/json-variables/CHANGELOG.md) or [the website](https://codsen.com/os/json-variables/changelog).
59
61
 
60
62
  ## Contributing
61
63
 
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * @name json-variables
3
3
  * @fileoverview Resolves custom-marked, cross-referenced paths in parsed JSON
4
- * @version 12.2.3
4
+ * @version 12.2.5
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/json-variables/}
8
8
  */
9
9
 
10
- import{arrayiffy as te}from"arrayiffy-if-string";import{getByKey as ne}from"ast-get-values-by-key";import{traverse as oe}from"ast-monkey-traverse";import{formatDiagnosticValue as le,isBool as _,isNull as T,isNum as C,isPlainObject as v,isStr as f}from"codsen-utils";import m from"object-path";import{rApply as P}from"ranges-apply";import{Ranges as ae}from"ranges-push";import{strFindHeadsTails as U}from"string-find-heads-tails";var k="12.2.3";import{isStr as I}from"codsen-utils";function N(r,e){return!I(r)||!r.trim()?!1:!!(r.includes(e.heads)||r.includes(e.tails)||I(e.headsNoWrap)&&e.headsNoWrap.length&&r.includes(e.headsNoWrap)||I(e.tailsNoWrap)&&e.tailsNoWrap.length&&r.includes(e.tailsNoWrap))}import{isStr as q}from"codsen-utils";function R(r){if(q(r)&&r.length&&r.indexOf(".")!==-1){for(let e=r.length;e--;)if(r[e]===".")return r.slice(e+1)}return r}import{isStr as G}from"codsen-utils";function x(r){if(G(r)&&r.length&&r.indexOf(".")!==-1){for(let e=0,t=r.length;e<t;e++)if(r[e]===".")return r.slice(0,e)}return r}import{isStr as z}from"codsen-utils";function J(r){if(z(r)&&r.length&&r.indexOf(".")!==-1){for(let e=r.length;e--;)if(r[e]===".")return r.slice(0,e)}return r}import{isStr as Y}from"codsen-utils";function B(r){if(Y(r)&&r.length&&r.indexOf(".")!==-1){for(let e=0,t=r.length;e<t;e++)if(r[e]===".")return r.slice(e+1)}return r}import{isStr as O,match as ee}from"codsen-utils";import{remDup as re}from"string-remove-duplicate-heads-tails";import{isStr as Q}from"codsen-utils";import{matchLeftIncl as X,matchRightIncl as Z}from"string-match-left-right";function F(r,e,t){let a,p;return Q(r)&&r.length&&Z(r,0,e,{trimBeforeMatching:!0,cb:(o,n,s)=>(a=s,!0)})&&X(r,r.length-1,t,{trimBeforeMatching:!0,cb:(o,n,s)=>(p=(s||0)+1,!0)})?r.slice(a,p):r}function H(r,e,t=!1,a,p,o){if(e.wrapHeadsWith||(e.wrapHeadsWith=""),e.wrapTailsWith||(e.wrapTailsWith=""),O(r)&&!t&&e.wrapGlobalFlipSwitch&&!e.dontWrapVars.some(n=>ee(o,n))&&(!e.preventDoubleWrapping||e.preventDoubleWrapping&&O(r)&&!r.includes(e.wrapHeadsWith)&&!r.includes(e.wrapTailsWith)))return`${e.wrapHeadsWith}${r}${e.wrapTailsWith}`;if(t){if(!O(r))return r;let n=re(r,{heads:e.wrapHeadsWith,tails:e.wrapTailsWith});return O(n)?F(n,e.wrapHeadsWith,e.wrapTailsWith):n}return r}var Ue=k,se=Object.prototype.hasOwnProperty,ie={heads:"%%_",tails:"_%%",headsNoWrap:"%%-",tailsNoWrap:"-%%",lookForDataContainers:!0,dataContainerIdentifierTails:"_data",wrapHeadsWith:"",wrapTailsWith:"",dontWrapVars:[],preventDoubleWrapping:!0,wrapGlobalFlipSwitch:!0,noSingleMarkers:!1,resolveToBoolIfAnyValuesContainBool:!0,resolveToFalseIfAnyValuesContainBool:!0,throwWhenNonStringInsertedInString:!1,allowUnresolved:!1};function u(r){return f(r)?r.trim():r}function L(r,e,t){let a=t.get(e);return a===void 0&&(a=ne(r,e),t.set(e,a)),a}function ue(r,e,t,a,p){let o;if(t.indexOf(".")!==-1){let n=t,s=!0;if(a.lookForDataContainers&&f(a.dataContainerIdentifierTails)&&a.dataContainerIdentifierTails.length&&!n.endsWith(a.dataContainerIdentifierTails)){let i=m.get(r,n+a.dataContainerIdentifierTails),l=v(i)?m.get(i,e):void 0;l&&(o=l,s=!1)}for(;s&&n.indexOf(".")!==-1;){if(n=J(n),R(n)===e)throw new Error(`json-variables/findValues(): [THROW_ID_01] While trying to resolve: "${e}" at path "${t}", we encountered a closed loop. The parent key "${R(n)}" is called the same as the variable "${e}" we're looking for.`);if(a.lookForDataContainers&&f(a.dataContainerIdentifierTails)&&a.dataContainerIdentifierTails.length&&!n.endsWith(a.dataContainerIdentifierTails)){let i=m.get(r,n+a.dataContainerIdentifierTails),l=v(i)?m.get(i,e):void 0;l&&(o=l,s=!1)}if(o===void 0){let i=m.get(r,n),l=v(i)?m.get(i,e):void 0;l&&(o=l,s=!1)}}}if(o===void 0){let n=m.get(r,e);n!==void 0&&(o=n)}if(o===void 0)if(e.indexOf(".")===-1){let n=L(r,e,p);if(n.length){for(let s=0,i=n.length;s<i;s++)if(f(n[s].val)||_(n[s].val)||T(n[s].val)){o=n[s].val;break}else if(C(n[s].val)){o=n[s].val;break}else if(Array.isArray(n[s].val)){o=n[s].val.join("");break}}}else{let n=L(r,x(e),p);if(n.length)for(let s=0,i=n.length;s<i;s++){let l=m.get(n[s].val,B(e));l&&f(l)&&(o=l)}}return o}function K(r,e,t,a,p,o=[]){if(o.includes(t)){let d="";if(o.length>1){let E=` \u2192
10
+ import{arrayiffy as te}from"arrayiffy-if-string";import{getByKey as ne}from"ast-get-values-by-key";import{traverse as oe}from"ast-monkey-traverse";import{formatDiagnosticValue as le,isBool as _,isNull as T,isNum as C,isPlainObject as v,isStr as f}from"codsen-utils";import m from"object-path";import{rApply as P}from"ranges-apply";import{Ranges as ae}from"ranges-push";import{strFindHeadsTails as U}from"string-find-heads-tails";var k="12.2.5";import{isStr as I}from"codsen-utils";function N(r,e){return!I(r)||!r.trim()?!1:!!(r.includes(e.heads)||r.includes(e.tails)||I(e.headsNoWrap)&&e.headsNoWrap.length&&r.includes(e.headsNoWrap)||I(e.tailsNoWrap)&&e.tailsNoWrap.length&&r.includes(e.tailsNoWrap))}import{isStr as q}from"codsen-utils";function R(r){if(q(r)&&r.length&&r.indexOf(".")!==-1){for(let e=r.length;e--;)if(r[e]===".")return r.slice(e+1)}return r}import{isStr as G}from"codsen-utils";function x(r){if(G(r)&&r.length&&r.indexOf(".")!==-1){for(let e=0,t=r.length;e<t;e++)if(r[e]===".")return r.slice(0,e)}return r}import{isStr as z}from"codsen-utils";function J(r){if(z(r)&&r.length&&r.indexOf(".")!==-1){for(let e=r.length;e--;)if(r[e]===".")return r.slice(0,e)}return r}import{isStr as Y}from"codsen-utils";function B(r){if(Y(r)&&r.length&&r.indexOf(".")!==-1){for(let e=0,t=r.length;e<t;e++)if(r[e]===".")return r.slice(e+1)}return r}import{isStr as O,match as ee}from"codsen-utils";import{remDup as re}from"string-remove-duplicate-heads-tails";import{isStr as Q}from"codsen-utils";import{matchLeftIncl as X,matchRightIncl as Z}from"string-match-left-right";function F(r,e,t){let a,p;return Q(r)&&r.length&&Z(r,0,e,{trimBeforeMatching:!0,cb:(o,n,s)=>(a=s,!0)})&&X(r,r.length-1,t,{trimBeforeMatching:!0,cb:(o,n,s)=>(p=(s||0)+1,!0)})?r.slice(a,p):r}function H(r,e,t=!1,a,p,o){if(e.wrapHeadsWith||(e.wrapHeadsWith=""),e.wrapTailsWith||(e.wrapTailsWith=""),O(r)&&!t&&e.wrapGlobalFlipSwitch&&!e.dontWrapVars.some(n=>ee(o,n))&&(!e.preventDoubleWrapping||e.preventDoubleWrapping&&O(r)&&!r.includes(e.wrapHeadsWith)&&!r.includes(e.wrapTailsWith)))return`${e.wrapHeadsWith}${r}${e.wrapTailsWith}`;if(t){if(!O(r))return r;let n=re(r,{heads:e.wrapHeadsWith,tails:e.wrapTailsWith});return O(n)?F(n,e.wrapHeadsWith,e.wrapTailsWith):n}return r}var Ue=k,se=Object.prototype.hasOwnProperty,ie={heads:"%%_",tails:"_%%",headsNoWrap:"%%-",tailsNoWrap:"-%%",lookForDataContainers:!0,dataContainerIdentifierTails:"_data",wrapHeadsWith:"",wrapTailsWith:"",dontWrapVars:[],preventDoubleWrapping:!0,wrapGlobalFlipSwitch:!0,noSingleMarkers:!1,resolveToBoolIfAnyValuesContainBool:!0,resolveToFalseIfAnyValuesContainBool:!0,throwWhenNonStringInsertedInString:!1,allowUnresolved:!1};function u(r){return f(r)?r.trim():r}function L(r,e,t){let a=t.get(e);return a===void 0&&(a=ne(r,e),t.set(e,a)),a}function ue(r,e,t,a,p){let o;if(t.indexOf(".")!==-1){let n=t,s=!0;if(a.lookForDataContainers&&f(a.dataContainerIdentifierTails)&&a.dataContainerIdentifierTails.length&&!n.endsWith(a.dataContainerIdentifierTails)){let i=m.get(r,n+a.dataContainerIdentifierTails),l=v(i)?m.get(i,e):void 0;l&&(o=l,s=!1)}for(;s&&n.indexOf(".")!==-1;){if(n=J(n),R(n)===e)throw new Error(`json-variables/findValues(): [THROW_ID_01] While trying to resolve: "${e}" at path "${t}", we encountered a closed loop. The parent key "${R(n)}" is called the same as the variable "${e}" we're looking for.`);if(a.lookForDataContainers&&f(a.dataContainerIdentifierTails)&&a.dataContainerIdentifierTails.length&&!n.endsWith(a.dataContainerIdentifierTails)){let i=m.get(r,n+a.dataContainerIdentifierTails),l=v(i)?m.get(i,e):void 0;l&&(o=l,s=!1)}if(o===void 0){let i=m.get(r,n),l=v(i)?m.get(i,e):void 0;l&&(o=l,s=!1)}}}if(o===void 0){let n=m.get(r,e);n!==void 0&&(o=n)}if(o===void 0)if(e.indexOf(".")===-1){let n=L(r,e,p);if(n.length){for(let s=0,i=n.length;s<i;s++)if(f(n[s].val)||_(n[s].val)||T(n[s].val)){o=n[s].val;break}else if(C(n[s].val)){o=n[s].val;break}else if(Array.isArray(n[s].val)){o=n[s].val.join("");break}}}else{let n=L(r,x(e),p);if(n.length)for(let s=0,i=n.length;s<i;s++){let l=m.get(n[s].val,B(e));l&&f(l)&&(o=l)}}return o}function K(r,e,t,a,p,o=[]){if(o.includes(t)){let d="";if(o.length>1){let E=` \u2192
11
11
  `;d=o.reduce((w,V,A)=>w+(A===0?"":E)+(V===t?"\u{1F4A5} ":" ")+V,` Here's the path we travelled up until we hit the recursion:
12
12
 
13
13
  `),d+=`${E}\u{1F4A5} ${t}`}throw new Error(`json-variables/resolveString(): [THROW_ID_02] While trying to resolve: "${e}" at path "${t}", we encountered a closed loop, the key is referencing itself."${d}`)}let n={},s=Array.from(o);s.push(t);let i=new ae,l;function y(d,E,w){for(let V=0,A=d.length;V<A;V++){let g=d[V],h=e.slice(g.headsEndAt,g.tailsStartAt);if(h.length===0)i.push(g.headsStartAt,g.tailsEndAt);else if(se.call(n,h)&&f(n[h]))i.push(g.headsStartAt,g.tailsEndAt,n[h]);else{if(l=ue(r,h.trim(),t,a,p),l===void 0)if(a.allowUnresolved===!0)l="";else if(f(a.allowUnresolved))l=a.allowUnresolved;else throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_03] We couldn't find the value to resolve the variable ${e.slice(g.headsEndAt,g.tailsStartAt)}. We're at path: "${t}".`);if(!w&&a.throwWhenNonStringInsertedInString&&!f(l))throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_04] While resolving the variable ${e.slice(g.headsEndAt,g.tailsStartAt)} at path ${t}, it resolved into a non-string value, ${le(l,4)}. This is happening because options setting "throwWhenNonStringInsertedInString" is active (set to "true").`);if(_(l)){if(a.resolveToBoolIfAnyValuesContainBool)return i.wipe(),a.resolveToFalseIfAnyValuesContainBool?!1:l;l=""}else{if(T(l)&&w)return i.wipe(),l;Array.isArray(l)?l=String(l.join("")):T(l)?l="":(!C(l)||!w)&&(l=String(l))}let j=t.includes(".")?`${J(t)}.${h}`:h;if(N(l,a)){let W=H(K(r,l,j,a,p,s),a,E,s,j,h.trim());W!==!1&&i.push(g.headsStartAt,g.tailsEndAt,W)}else{n[h]=l;let W=H(l,a,E,s,j,h.trim());W!==!1&&i.push(g.headsStartAt,g.tailsEndAt,W)}}}}let c;try{c=U(e,a.heads,a.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(d){throw new Error(`json-variables/resolveString(): [THROW_ID_05] While trying to resolve string: "${e}" at path ${t}, something wrong with heads and tails was detected! Here's the internal error message:
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * @name json-variables
3
3
  * @fileoverview Resolves custom-marked, cross-referenced paths in parsed JSON
4
- * @version 12.2.3
4
+ * @version 12.2.5
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/json-variables/}
8
8
  */
9
9
 
10
- "use strict";var jsonVariables=(()=>{var vt=Object.create;var q=Object.defineProperty,wt=Object.defineProperties,$t=Object.getOwnPropertyDescriptor,At=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertyNames,Ee=Object.getOwnPropertySymbols,Ot=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty,Wt=Object.prototype.propertyIsEnumerable;var fe=(e,t,r)=>t in e?q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,W=(e,t)=>{for(var r in t||(t={}))De.call(t,r)&&fe(e,r,t[r]);if(Ee)for(var r of Ee(t))Wt.call(t,r)&&fe(e,r,t[r]);return e},Ie=(e,t)=>wt(e,At(t));var Et=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Dt=(e,t)=>{for(var r in t)q(e,r,{get:t[r],enumerable:!0})},Se=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Tt(t))!De.call(e,a)&&a!==r&&q(e,a,{get:()=>t[a],enumerable:!(n=$t(t,a))||n.enumerable});return e};var It=(e,t,r)=>(r=e!=null?vt(Ot(e)):{},Se(t||!e||!e.__esModule?q(r,"default",{value:e,enumerable:!0}):r,e)),St=e=>Se(q({},"__esModule",{value:!0}),e);var x=(e,t,r)=>fe(e,typeof t!="symbol"?t+"":t,r);var nt=Et((rt,se)=>{(function(e,t){"use strict";typeof se=="object"&&typeof se.exports=="object"?se.exports=t():typeof define=="function"&&define.amd?define([],t):e.objectPath=t()})(rt,function(){"use strict";var e=Object.prototype.toString;function t(f,h){return f==null?!1:Object.prototype.hasOwnProperty.call(f,h)}function r(f){if(!f||i(f)&&f.length===0)return!0;if(typeof f!="string"){for(var h in f)if(t(f,h))return!1;return!0}return!1}function n(f){return e.call(f)}function a(f){return typeof f=="object"&&n(f)==="[object Object]"}var i=Array.isArray||function(f){return e.call(f)==="[object Array]"};function s(f){return typeof f=="boolean"||n(f)==="[object Boolean]"}function l(f){var h=parseInt(f);return h.toString()===f?h:f}function o(f){f=f||{};var h=function(y){return Object.keys(h).reduce(function(_,g){return g==="create"||typeof h[g]=="function"&&(_[g]=h[g].bind(h,y)),_},{})},d;f.includeInheritedProps?d=function(){return!0}:d=function(y,_){return typeof _=="number"&&Array.isArray(y)||t(y,_)};function b(y,_){if(d(y,_))return y[_]}var c;f.includeInheritedProps?c=function(y,_){typeof _!="string"&&typeof _!="number"&&(_=String(_));var g=b(y,_);if(_==="__proto__"||_==="prototype"||_==="constructor"&&typeof g=="function")throw new Error("For security reasons, object's magic properties cannot be set");return g}:c=function(y,_){return b(y,_)};function p(y,_,g,m){if(typeof _=="number"&&(_=[_]),!_||_.length===0)return y;if(typeof _=="string")return p(y,_.split(".").map(l),g,m);var w=_[0],A=c(y,w);return _.length===1?((A===void 0||!m)&&(y[w]=g),A):(A===void 0&&(typeof _[1]=="number"?y[w]=[]:y[w]={}),p(y[w],_.slice(1),g,m))}return h.has=function(y,_){if(typeof _=="number"?_=[_]:typeof _=="string"&&(_=_.split(".")),!_||_.length===0)return!!y;for(var g=0;g<_.length;g++){var m=l(_[g]);if(typeof m=="number"&&i(y)&&m<y.length||(f.includeInheritedProps?m in Object(y):t(y,m)))y=y[m];else return!1}return!0},h.ensureExists=function(y,_,g){return p(y,_,g,!0)},h.set=function(y,_,g,m){return p(y,_,g,m)},h.insert=function(y,_,g,m){var w=h.get(y,_);m=~~m,i(w)||(w=[],h.set(y,_,w)),w.splice(m,0,g)},h.empty=function(y,_){if(!r(_)&&y!=null){var g,m;if(g=h.get(y,_)){if(typeof g=="string")return h.set(y,_,"");if(s(g))return h.set(y,_,!1);if(typeof g=="number")return h.set(y,_,0);if(i(g))g.length=0;else if(a(g))for(m in g)d(g,m)&&delete g[m];else return h.set(y,_,null)}}},h.push=function(y,_){var g=h.get(y,_);i(g)||(g=[],h.set(y,_,g)),g.push.apply(g,Array.prototype.slice.call(arguments,2))},h.coalesce=function(y,_,g){for(var m,w=0,A=_.length;w<A;w++)if((m=h.get(y,_[w]))!==void 0)return m;return g},h.get=function(y,_,g){if(typeof _=="number"&&(_=[_]),!_||_.length===0)return y;if(y==null)return g;if(typeof _=="string")return h.get(y,_.split("."),g);var m=l(_[0]),w=c(y,m);return w===void 0?g:_.length===1?w:h.get(y[m],_.slice(1),g)},h.del=function(_,g){if(typeof g=="number"&&(g=[g]),_==null||r(g))return _;if(typeof g=="string")return h.del(_,g.split("."));var m=l(g[0]);if(c(_,m),!d(_,m))return _;if(g.length===1)i(_)?_.splice(m,1):delete _[m];else return h.del(_[m],g.slice(1));return _},h}var u=o();return u.create=o,u.withInheritedProps=o({includeInheritedProps:!0}),u})});var Er={};Dt(Er,{defaults:()=>mt,jVar:()=>Wr,version:()=>Ar});function S(e){return typeof e!="string"?e:e.length?[e]:[]}var Ve=Symbol.for("ast-monkey-traverse.delete"),Vt=Object.prototype.hasOwnProperty;function j(e){throw new TypeError("ast-monkey-traverse/traverse(): [THROW_ID_02] The first argument must be an acyclic, unaliased tree of arrays, plain objects, and supported primitive values; ".concat(e,"."))}function Rt(e,t){let r=Number(e);return Number.isInteger(r)&&r>=0&&r<t&&"".concat(r)===e}function Re(e){return Array.isArray(e)?new Array(e.length):{}}function ce(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function he(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function xe(e,t=!1){if(he(e))return e;typeof e!="object"&&j("encountered an unsupported ".concat(typeof e," value"));let r=e,n=Re(r),a=[{source:r,target:n}],i=new WeakSet([r]);for(;a.length;){let s=a.pop(),{source:l,target:o}=s,u=Array.isArray(l);Object.getPrototypeOf(l)!==(u?Array.prototype:Object.prototype)&&j(u?"encountered an array with a custom prototype":"encountered a non-plain or custom-prototype object");for(let f of Reflect.ownKeys(l)){if(u&&f==="length")continue;typeof f!="string"&&j(u?"encountered a symbol-keyed array property":"encountered a symbol-keyed object property"),u&&!Rt(f,l.length)&&j("encountered the non-index array property ".concat(JSON.stringify(f)));let h=Object.getOwnPropertyDescriptor(l,f);h.enumerable||j(u?"encountered a non-enumerable array index ".concat(f):"encountered a non-enumerable property ".concat(JSON.stringify(f))),!("value"in h)&&!t&&j(u?"encountered an accessor array index ".concat(f):"encountered an accessor property ".concat(JSON.stringify(f)));let d="value"in h?h.value:l[f];if(he(d))ce(o,f,d);else if(typeof d=="object"){i.has(d)&&j("encountered a cycle or repeated object reference"),i.add(d);let b=Re(d);ce(o,f,b),a.push({source:d,target:b})}else j("encountered an unsupported ".concat(typeof d," value"))}}return n}var N=Symbol("deleted snapshot entry");function _e(e){let t=W({array:Array.isArray(e),entries:new Map},Array.isArray(e)?{lengths:[{value:e.length,version:0}]}:{}),r=[{source:e,target:t}];for(;r.length;){let n=r.pop(),{source:a,target:i}=n;for(let s of Object.keys(a)){let l=a[s];if(typeof l=="object"&&l!==null){let o=W({array:Array.isArray(l),entries:new Map},Array.isArray(l)?{lengths:[{value:l.length,version:0}]}:{});i.entries.set(s,[{value:o,version:0}]),r.push({source:l,target:o})}else i.entries.set(s,[{value:l,version:0}])}}return t}function Ne(e,t){let r=0,n=e.length-1;for(;r<n;){let a=Math.ceil((r+n)/2);e[a].version<=t?r=a:n=a-1}return e[r]}function U(e,t,r){let n=e.entries.get(t);return n?Ne(n,r).value:N}function ge(e,t){return Ne(e.lengths,t).value}function Z(e,t,r,n){let a=e.entries.get(t);a?a.push({value:r,version:n}):e.entries.set(t,[{value:N,version:n-1},{value:r,version:n}])}function xt(e,t,r){let n=r-1,a=ge(e,n);for(let i=t;i<a-1;i+=1)Z(e,"".concat(i),U(e,"".concat(i+1),n),r);a&&Z(e,"".concat(a-1),N,r),e.lengths.push({value:Math.max(0,a-1),version:r})}function je(e,t){let r=new WeakMap;function n(a){let i=r.get(a);if(i)return i;let s=a.array?new Array(ge(a,t)):{},l={defineProperty:()=>!0,deleteProperty:()=>!0,get:(u,f,h)=>{if(a.array&&f==="length")return ge(a,t);if(typeof f=="string"){let d=U(a,f,t);if(d!==N)return typeof d=="object"&&d!==null?n(d):d}return Reflect.get(u,f,h)},getOwnPropertyDescriptor:(u,f)=>{if(a.array&&f==="length")return Reflect.getOwnPropertyDescriptor(u,f);if(typeof f=="string"){let h=U(a,f,t);return h===N?void 0:{configurable:!0,enumerable:!0,value:typeof h=="object"&&h!==null?n(h):h,writable:!0}}},has:(u,f)=>typeof f=="string"&&U(a,f,t)!==N||Reflect.has(u,f),ownKeys:()=>{let u=[...a.entries].filter(([f])=>U(a,f,t)!==N).map(([f])=>f);return a.array?[...u,"length"]:u},set:()=>!0,setPrototypeOf:()=>!0},o=new Proxy(s,l);return r.set(a,o),o}return n(e)}function Ce(e){let t=[],r=e;for(;r;)t.push(r.segment),r=r.parent;return t.reverse()}function jt(e){let t="";for(let r of e)t=t?"".concat(t,".").concat(r):r;return t}function Y(e,t){if(typeof t!="function")throw new TypeError("ast-monkey-traverse/traverse(): [THROW_ID_01] The second argument must be a callback function. It was ".concat(typeof t,"."));let r=xe(e);if(typeof r!="object"||r===null)return r;let n=0,a={now:!1},i=[{container:r,depth:0,index:0,keys:Array.isArray(r)?[]:Object.keys(r),parentKey:null}];for(;i.length&&!a.now;){let s=i[i.length-1],l=Array.isArray(s.container)?s.container:void 0,o=!!l,u;if(l){if(s.index>=l.length){i.pop();continue}if(!Vt.call(l,s.index)){s.index+=1;continue}u="".concat(s.index)}else{if(s.index>=s.keys.length){i.pop();continue}u=s.keys[s.index]}let f=s.container[u],h={parent:s.pathNode,segment:u},d=s.depth===0&&!o?u:s.topmostKey,b,c=n,p,y,_;if(s.depth<100)p=s.path?"".concat(s.path,".").concat(u):u,y=s.pathSegments?[...s.pathSegments,u]:[u],_=W({depth:s.depth,path:p,pathSegments:y,get parent(){return s.snapshot||(s.snapshot=_e(s.container)),b||(b=je(s.snapshot,c)),b},parentType:o?"array":"object",parentKey:s.parentKey},d===void 0?{}:{topmostKey:d});else{let E,V;_=W({depth:s.depth,get path(){return E||(E=Ce(h)),V!=null||(V=jt(E)),V},get pathSegments(){return E||(E=Ce(h)),E},get parent(){return s.snapshot||(s.snapshot=_e(s.container)),b||(b=je(s.snapshot,c)),b},parentType:o?"array":"object",parentKey:s.parentKey},d===void 0?{}:{topmostKey:d})}let g=t(o?f:u,o?void 0:f,_,a),m=g===Ve,w=typeof g=="object"&&g!==null,A=w&&typeof f=="object"&&f!==null&&g===f&&!!s.snapshot,T=g===Ve?f:g,O;!m&&!w&&!he(g)&&j("encountered an unsupported ".concat(typeof g," value")),!m&&w&&(g!==f||A)&&(T=xe(g,!0),s.snapshot&&(O=_e(T))),m?l?(l.splice(s.index,1),n+=1,s.snapshot&&xt(s.snapshot,s.index,n)):(delete s.container[u],n+=1,s.snapshot&&Z(s.snapshot,u,N,n),s.index+=1):((!Object.is(T,f)||A)&&(ce(s.container,u,T),n+=1,s.snapshot&&Z(s.snapshot,u,O===void 0?T:O,n)),s.index+=1,!a.now&&typeof T=="object"&&T!==null&&i.push(W(W(W(Ie(W({container:T,depth:s.depth+1,index:0,keys:Array.isArray(T)?[]:Object.keys(T),parentKey:u},p===void 0?{}:{path:p}),{pathNode:h}),y===void 0?{}:{pathSegments:y}),O?{snapshot:O}:{}),d===void 0?{}:{topmostKey:d})))}return r}function Ct(){let e=[],t=0,r=!1;return{append(n){return r?!1:t+n.length>1999?(e.push("\u2026"),t+=1,r=!0,!1):(e.push(n),t+=n.length,!0)},result(){return e.join("")},stopped(){return r}}}function Nt(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function X(e,t){if(e.append('"')){for(let r=0;r<t.length&&!e.stopped();r+=1){let n=t.charCodeAt(r);n===34?e.append('\\"'):n===92?e.append("\\\\"):n===8?e.append("\\b"):n===9?e.append("\\t"):n===10?e.append("\\n"):n===12?e.append("\\f"):n===13?e.append("\\r"):n<32||n===8232||n===8233||n>=55296&&n<=57343?e.append(Nt(n)):e.append(t[r])}e.append('"')}}function Ht(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function ke(e,t){e.append("Symbol(");let r=String(t);r.length>8&&X(e,r.slice(7,-1)),e.append(")")}function He(e,t){typeof t=="symbol"?ke(e,t):X(e,String(t))}function v(e,t=0){let r=Ct(),n=t===4?4:0,a=new WeakSet,i=0;function s(c){n&&r.append(" ".repeat(c*n))}function l(c,p){c&&r.append(","),n&&(r.append("\n"),s(p+1))}function o(c,p,y){n&&p&&(r.append("\n"),s(y)),r.append(c)}function u(c,p){Object.prototype.hasOwnProperty.call(c,"value")?b(c.value,p):r.append(Ht(c))}function f(c,p){let y;try{y=Reflect.getOwnPropertyDescriptor(c,"length")}catch(m){r.append("[Uninspectable]");return}let _=y==null?void 0:y.value;if(!Number.isSafeInteger(_)||_<0){r.append("[Uninspectable]");return}r.append("[");let g=!1;for(let m=0;m<_&&!r.stopped();m+=1){if(l(g,p),g=!0,i>=50){r.append("[MaxEntries]");break}i+=1;let w;try{w=Reflect.getOwnPropertyDescriptor(c,String(m))}catch(A){r.append("[Uninspectable]");continue}w!=null&&w.enumerable?u(w,p+1):r.append("[Empty]")}o("]",g,p)}function h(c,p){let y;try{y=Reflect.ownKeys(c)}catch(g){r.append("[Uninspectable]");return}r.append("{");let _=!1;for(let g of y){if(r.stopped())break;if(i>=50){l(_,p),_=!0,X(r,"\u2026"),r.append(n?": ":":"),r.append("[MaxEntries]");break}i+=1;let m;try{m=Reflect.getOwnPropertyDescriptor(c,g)}catch(w){l(_,p),_=!0,He(r,g),r.append(n?": ":":"),r.append("[Uninspectable]");continue}m!=null&&m.enumerable&&(l(_,p),_=!0,He(r,g),r.append(n?": ":":"),u(m,p+1))}o("}",_,p)}function d(c,p){if(a.has(c)){r.append("[Circular]");return}if(p>=5){r.append("[MaxDepth]");return}let y;try{y=Array.isArray(c)}catch(_){r.append("[Uninspectable]");return}a.add(c);try{y?f(c,p):h(c,p)}finally{a.delete(c)}}function b(c,p){c===null?r.append("null"):typeof c=="string"?X(r,c):typeof c=="number"?r.append(Object.is(c,-0)?"-0":String(c)):typeof c=="boolean"?r.append(c?"true":"false"):typeof c>"u"?r.append("undefined"):typeof c=="bigint"?r.append("".concat(c,"n")):typeof c=="symbol"?ke(r,c):typeof c=="function"?r.append("[Function]"):d(c,p)}try{return b(e,0),r.result()}catch(c){return"[Uninspectable]"}}var kt=["_16_0_a_0_4_0_5_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_8_4l_1_11_2_0_","6_14_1z_q_4_3_19_16_z_1_1_2q_1_0_f_1_7_1_a_2_2_0_g_0_1_t_t_2g_b_0_o_w_9_1_4_0_5_l_4_0_9_0_3_0_n_o_7_","a_5_n_1_6_g_15_1m_1h_3_0_i_0_7_9_f_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_e_1_a_0_8_5_4_1_2_l_1_6","_1_1_1_1_1_1_v_3_1_0_j_2_g_8_1_2_1_l_1_6_1_1_1_4_3_0_i_0_f_1_n_0_b_7_2_1_2_l_1_6_1_1_1_4_3_0_u_1_1_2","_f_0_h_0_1_5_3_2_1_3_3_1_1_0_1_1_3_1_3_2_3_b_m_0_1g_7_1_2_1_m_1_f_3_0_q_2_1_1_2_1_u_0_4_7_1_2_1_m_1_","9_1_4_3_0_u_2_1_1_f_1_h_8_1_2_1_14_2_0_g_0_5_2_8_2_o_5_5_h_3_n_1_8_1_0_2_6_1m_1b_1_1_c_6_1m_1_1_0_1_","4_1_n_1_0_1_9_1_1_9_0_2_4_1_0_l_3_w_0_1r_7_1_z_r_4_37_16_k_0_g_5_4_3_3_0_3_1_7_2_4_c_c_0_h_11_1_0_5_","0_2_16_1_98_1_3_2_6_1_0_1_3_2_14_1_3_2_w_1_3_2_6_1_0_1_3_2_e_1_1k_1_3_2_1u_11_f_g_2d_2_5_3_h7_2_g_1_","p_5_22_6_7_7_h_d_i_e_h_e_c_1_2_f_1f_z_0_4_0_1v_2g_7_4_2_x_1_0_5_1x_a_u_1d_t_2_4_b_17_4_p_1i_m_9_1g_2","a_0_2l_1a_h_7_1i_t_d_1_a_17_q_z_15_2_a_z_2_a_5_16_2_2_15_3_1_5_1_1_3_0_5_5b_1s_7p_2_5_2_11_2_5_2_7_1","_0_1_0_1_0_1_u_2_1g_1_6_1_0_3_2_1_6_3_3_2_5_4_c_5_2_1_6_38_0_d_0_g_c_2t_0_4_0_2_9_1_0_3_4_6_0_1_0_1_","0_1_3_1_a_2_3_5_4_4_0_1g_1_22j_6c_6_3_3_1_c_11_1_0_5_0_2_1j_7_0_g_m_9_6_1_6_1_6_1_6_1_6_1_6_1_6_1_6_","28_0_d1_1_16_4_5_1_4_2d_6_2_1_2h_1_3_5_16_1_2l_h_v_1c_f_e8_533_1s_h3g_1v_19_2_7g_3_f_a_1_k_1a_g_u_2_","1x_1d_8_2_2u_2_29_k_g_1_2_1_3_1_m_t_1f_e_1d_1q_5_3_0_1_1_b_r_a_m_p_s_7_1a_s_0_g_4_1_9_a_4_1_14_n_2_1","_7_k_m_3_0_3_1d_1_0_3_1_2_4_2_0_1_0_o_2_2_a_7_2_c_5_2_5_2_5_9_6_1_6_1_16_1_d_6_36_t_8mb_c_m_4_1c_6is","_a5_2_2x_12_6_c_4_5_0_1_9_1_c_1_4_1_0_1_1_1_1_1_2z_x_a2_i_1r_2_1h_14_b_38_4_1_3q_10_p_6_p_b_2g_3_5_2","_5_2_5_2_2_z_b_1_p_1_i_1_1_1_e_2_d_y_3e_at_s_3_1c_1b_v_d_j_1_7_6_11_a_t_2_z_4_7_1c_4d_i_z_4_z_4_13_8","_1f_c_a_1_e_1_6_1_1_1_a_1_e_1_6_1_1_3_1f_c_8m_9_l_a_7_o_5_1_15_1_8_1x_5_2_0_1_17_1_1_3_0_2_m_a_m_9_u","_1t_i_1_1_a_l_a_p_6_p_12_1j_6_1_1s_0_f_3_1_2_1_s_16_s_3_s_z_7_1_r_r_1h_a_l_a_i_d_h_32_20_1j_1e_d_1e_","d_z_12_r_9_m_6y_15_6_1_g_5_1k_s_a_0_8_l_16_h_1a_k_r_m_c_1g_1l_1_2_0_d_18_w_o_q_z_t_0_2_0_8_y_3_0_c_1","b_e_3_l_0_1_0_z_h_1_o_j_1_1r_6_1_0_1_3_1_e_1_9_7_1a_12_7_2_1_2_l_1_6_1_1_1_4_3_0_i_0_c_4_u_9_1_0_2_0","_1_11_1_0_p_0_1_0_18_1g_i_3_k_2_u_1b_k_1_1_0_54_1a_15_3_10_1b_k_0_1n_16_d_0_1z_q_11_6_55_17_38_1r_v_","7_2_0_2_7_1_1_1_n_f_0_1_0_2m_7_2_12_g_0_1_0_s_0_a_13_7_0_l_0_b_19_j_0_i_20_5j_w_v_8_1_10_h_0_1d_t_34","_6_1_1_1_11_l_0_p_5_1_1_1_v_e_0_n_17_78_i_f_0_1_c_1_x_3g_0_27_pl_6e_5f_218_2o_f_tr_h_5_p_32y_5_g6_5a","1_t_1cy_fs_7_u_h_26_h_t_i_1b_g_3_v_k_5_i_c0_18_5v_1r_w_o_2_o_18_22_5_0_1u_c_1s_1_1_0_e_1_c_5p1_15_v_","2p_36_6pp_3_1_6_1_1_1_82_f_0_t_2_2_0_e_3_8_az_1s4_2y_5_c_3_8_7_9_4me_2c_1_1y_1_1_2_0_2_1_2_3_1_b_1_0","_1_6_1_1s_1_3_2_7_1_6_1_r_1_3_1_4_1_0_3_6_1_9f_2_o_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_7_1f8_u_6_5","_79_1p_42_18_a_6_g_0_8x_t_i_17_dg_r_6c_t_2_0_5r_u_1_2_1_1_1_6_2_4_9_1_68_6_1_3_1_1_1_e_1_5g_1n_1v_7_","0_xg_3_1_q_1_1_1_0_2_0_1_9_1_3_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1","_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4_1_g_3es_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),pe=kt.slice(1).split("_"),Mt=[],Me=127;for(let e=0;e<pe.length;e+=2){let t=Me+1+Number.parseInt(pe[e],36),r=t+Number.parseInt(pe[e+1],36);Mt.push([t,r]),Me=r}var jr=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),Pt=Object.prototype.hasOwnProperty,qe=Function.prototype.toString,Bt=qe.call(Object),Ft=class{constructor(){x(this,"hasRepeatedReferences",!1);x(this,"clones",[]);x(this,"index");x(this,"sources",[])}get(e){if(this.index){let r=this.index.get(e);return r!==void 0&&(this.hasRepeatedReferences=!0),r}let t=this.sources.indexOf(e);if(t!==-1)return this.hasRepeatedReferences=!0,this.clones[t]}set(e,t){if(this.index){this.index.set(e,t);return}if(this.sources.push(e),this.clones.push(t),this.sources.length===32){this.index=new WeakMap;for(let r=0;r<this.sources.length;r++)this.index.set(this.sources[r],this.clones[r]);this.sources=[],this.clones=[]}}};function Ue(e,t){let r=t.get(e);if(r!==void 0)return r;let n=e.slice(0);return t.set(e,n),n}function Lt(e,t){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let i=Buffer.from(e);return t.set(e,i),i}let r=Ue(e.buffer,t);if(e instanceof DataView||Object.prototype.toString.call(e)==="[object DataView]"){let i=new DataView(r,e.byteOffset,e.byteLength);return t.set(e,i),i}let n=e.constructor,a=new n(r,e.byteOffset,e.length);return t.set(e,a),a}function Jt(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0})}function ee(e,t,r,n){for(let a of r){let i=t[a],s=typeof i!="object"||i===null?i:k(i,n);a==="__proto__"?Jt(e,a,s):e[a]=s}}function P(e,t,r,n){for(let a of r){let i=Object.getOwnPropertyDescriptor(t,a);if(i){if("value"in i){let s=i.value;i.value=typeof s!="object"||s===null?s:k(s,n)}Object.defineProperty(e,a,i)}}}var qt=Map.prototype.entries,Ut=Set.prototype.values,be=Object.prototype.toString,Be,Kt=(Be=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:Be.get,Fe,zt=(Fe=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:Fe.get,Le,Cr=(Le=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:Le.get,Je,Ke=(Je=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:Je.get,Nr=RegExp.prototype.test,de;function Gt(e){if(e instanceof ArrayBuffer)return!0;try{return Kt.call(e),!0}catch(t){return!1}}function Qt(e){try{return qt.call(e)}catch(t){return null}}function Zt(e){try{return Ut.call(e)}catch(t){return null}}function Yt(e){var t;try{return de||(de=(t=Object.getOwnPropertyDescriptor(URL.prototype,"href"))==null?void 0:t.get),de.call(e)}catch(r){return null}}function k(e,t){if(typeof e!="object"||e===null)return e;let r=t.get(e);if(r!==void 0)return r;if(Array.isArray(e)){let o=e.length,u=new Array(o);t.set(e,u);let f=e,h=Object.keys(e);if(h.length===o&&(o===0||h[o-1]==="".concat(o-1)))for(let d=0;d<o;d++){let b=f[d];u[d]=typeof b!="object"||b===null?b:k(b,t)}else ee(u,f,h,t);return u}let n=Object.getPrototypeOf(e);if(n===Object.prototype){let o={};return t.set(e,o),ee(o,e,Object.keys(e),t),o}if(n===null){let o=Object.create(null);return t.set(e,o),ee(o,e,Object.keys(e),t),o}if(er(e)){let o=new Date(ze.call(e));return t.set(e,o),P(o,e,Object.keys(e),t),o}if(ArrayBuffer.isView(e))return Lt(e,t);if(Gt(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return Ue(e,t);let a=Qt(e);if(a){let o=new Map;t.set(e,o);for(let[u,f]of a)o.set(k(u,t),k(f,t));return P(o,e,Object.keys(e),t),o}let i=Zt(e);if(i){let o=new Set;t.set(e,o);for(let u of i)o.add(k(u,t));return P(o,e,Object.keys(e),t),o}if(Xt(e)&&e!==RegExp.prototype){let o=new RegExp(Ke.call(e),zt.call(e));return o.lastIndex=e.lastIndex,t.set(e,o),P(o,e,Object.keys(e),t),o}let s=Yt(e);if(s!==null){let o=new URL(s);return t.set(e,o),P(o,e,Object.keys(e),t),o}if(e instanceof Error||be.call(e)==="[object Error]"){let o=Object.create(Object.getPrototypeOf(e));return t.set(e,o),P(o,e,Reflect.ownKeys(e),t),o}let l=Object.create(n);return t.set(e,l),ee(l,e,Object.keys(e),t),l}function ve(e){return k(e,new Ft)}function D(e){var n;if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let r=Object.getOwnPropertyDescriptor(t,"constructor");return!r||!("value"in r)||typeof r.value!="function"?!1:((n=Object.getOwnPropertyDescriptor(r.value,"prototype"))==null?void 0:n.value)===t&&qe.call(r.value)===Bt}function $(e){return typeof e=="string"}function M(e){return Number.isFinite(e)}function K(e){return Number.isSafeInteger(e)&&e>=0}function ne(e){return typeof e=="boolean"}function z(e){return e===null}function Xt(e){if(e===null||typeof e!="object")return!1;try{return e instanceof RegExp?(e.source,!0):be.call(e)!=="[object RegExp]"?!1:(Ke.call(e),!0)}catch(t){return!1}}var ze=Date.prototype.getTime;function er(e){if(e instanceof Date)return!0;if(e===null||typeof e!="object"||be.call(e)!=="[object Date]")return!1;try{return ze.call(e),!0}catch(t){return!1}}function B(e){return e!=null}function Ge(e,t){return e!=null&&Pt.call(e,t)}var tr=256,rr=1024,nr=1,ir=new Map,sr=new Map;function me(e){if(e>=97&&e<=122)return e-32;if(e>65535)return e;let t=String.fromCharCode(e).toUpperCase();if(t.length!==1)return e;let r=t.charCodeAt(0);return e>127&&r<128?e:r}function ye(e,t,r,n,a,i){for(let s=0;s<a;s++){let l=e.charCodeAt(t+s),o=r.charCodeAt(n+s);if(i||(l>=97&&l<=122&&(l-=32),o>=97&&o<=122&&(o-=32)),l!==o)return!1}return!0}function Qe(e,t,r){let n=t.indexOf("\\");if(n===-1&&e===t)return!0;let a=t.indexOf("*");if(n===-1&&a===-1){if(r)return!1;for(let f=0;f<t.length;f++)if(t.charCodeAt(f)>127)return;return e.length===t.length&&ye(e,0,t,0,t.length,!1)}if(n!==-1)return;let i=0,s=!1,l=-1;for(let f=0;f<t.length;f++){let h=t.charCodeAt(f);if(h>127)return;if(h===42){if(l=f,!s){if(i++,i>1)return;s=!0}}else s=!1}let o=l+1,u=t.length-o;return e.length<a+u?!1:ye(e,0,t,0,a,r)&&ye(e,e.length-u,t,o,u,r)}function ar(e){let t=new Uint32Array(e.length),r=0;for(let n=1;n<e.length;n++){for(;r>0&&e[n]!==e[r];)r=t[r-1];e[n]===e[r]&&r++,t[n]=r}return t}function or(e,t){let r=[[]],n=!0,a=!1,i=!1,s=0;for(let d=0;d<e.length;){let b=e.codePointAt(d);if(b!==92){if(b===42)a=!0,i||(r.push([]),i=!0);else{let m=t?b:me(b);r[r.length-1].push(m),n&&(n=m<=127),s++,i=!1}d+=b>65535?2:1;continue}let c=d+1;for(;e.charCodeAt(c)===92;)c++;let p=c-d,y=e.codePointAt(c),_,g=!1;y===42?(g=p%2===0,_=g?p/2:(p-1)/2):y===void 0||y===10||y===13||y===8232||y===8233?_=Math.ceil(p/2):_=Math.floor(p/2);for(let m=0;m<_;m++)r[r.length-1].push(92),s++;if(g){i=!1,d=c;continue}if(y!==void 0){let m=t?y:me(y);r[r.length-1].push(m),n&&(n=m<=127),s++,c+=y>65535?2:1}i=!1,d=c}let l=a&&r[0].length===0,o=a&&r[r.length-1].length===0,u=[];for(let d of r)d.length&&u.push({values:d});let f=l?0:1,h=u.length-(o?0:1);for(let d=f;d<h;d++)u[d].values.length>nr&&(u[d].failure=ar(u[d].values));return{asciiOnly:n,endsWithWildcard:o,hasWildcard:a,minimumInputLength:s,segments:u,startsWithWildcard:l}}function Ze(e,t){let r=t?ir:sr,n=e.length<=rr;if(n){let i=r.get(e);if(i)return i}let a=or(e,t);if(n){if(r.size>=tr){let i=r.keys().next().value;i!==void 0&&r.delete(i)}r.set(e,a)}return a}function Ye(e,t){if(t){let a=[];for(let i=0;i<e.length;){let s=e.codePointAt(i);a.push(s),i+=s>65535?2:1}return a}let r=new Uint32Array(e.length),n=0;for(let a=0;a<e.length;){let i=e.codePointAt(a);r[n]=me(i),n++,a+=i>65535?2:1}return n===r.length?r:r.subarray(0,n)}function te(e,t,r,n){for(let a=0;a<r.values.length;a++){let i=e.charCodeAt(t+a);if(!n&&i>=97&&i<=122&&(i-=32),i!==r.values[a])return!1}return!0}function lr(e,t,r,n,a){let i=n-t.values.length;if(i<r)return-1;if(!t.failure){for(let l=r;l<=i;l++)if(te(e,l,t,a))return l;return-1}let s=0;for(let l=r;l<n;l++){let o=e.charCodeAt(l);for(!a&&o>=97&&o<=122&&(o-=32);s>0&&o!==t.values[s];)s=t.failure[s-1];if(o===t.values[s]&&(s++,s===t.values.length))return l-s+1}return-1}function Xe(e,t,r){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&te(e,0,t.segments[0],r);let n=0,a=t.segments.length,i=0,s=e.length;if(!t.startsWithWildcard){let l=t.segments[0];if(!te(e,0,l,r))return!1;i=l.values.length,n++}if(!t.endsWithWildcard){a--;let l=t.segments[a];if(s-=l.values.length,!te(e,s,l,r))return!1}for(let l=n;l<a;l++){let o=t.segments[l],u=lr(e,o,i,s,r);if(u===-1)return!1;i=u+o.values.length}return!0}function re(e,t,r){for(let n=0;n<r.values.length;n++)if(e[t+n]!==r.values[n])return!1;return!0}function ur(e,t,r,n){let a=n-t.values.length;if(a<r)return-1;if(!t.failure){for(let s=r;s<=a;s++)if(re(e,s,t))return s;return-1}let i=0;for(let s=r;s<n;s++){for(;i>0&&e[s]!==t.values[i];)i=t.failure[i-1];if(e[s]===t.values[i]&&(i++,i===t.values.length))return s-i+1}return-1}function et(e,t){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&re(e,0,t.segments[0]);let r=0,n=t.segments.length,a=0,i=e.length;if(!t.startsWithWildcard){let s=t.segments[0];if(!re(e,0,s))return!1;a=s.values.length,r++}if(!t.endsWithWildcard){n--;let s=t.segments[n];if(i-=s.values.length,!re(e,i,s))return!1}for(let s=r;s<n;s++){let l=t.segments[s],o=ur(e,l,a,i);if(o===-1)return!1;a=o+l.values.length}return!0}function fr(e,t,r){let n=Qe(e,t,r);if(n!==void 0)return n;let a=Ze(t,r);return a.asciiOnly?Xe(e,a,r):et(Ye(e,r),a)}function Pe(e,t,r,n){var s;let a=Qe(e,t,r);if(a!==void 0)return a;let i=Ze(t,r);return i.asciiOnly?Xe(e,i,r):((s=n.tokens)!=null||(n.tokens=Ye(e,r)),et(n.tokens,i))}function ie(e,t,r){if(typeof t!="string"&&!t.length)return!1;let n=r===void 0?!1:r.caseSensitiveMatch===!0;if(typeof t=="string"){let l=t.charCodeAt(0)===33,o=l?t.slice(1):t,u=fr(e,o,n);return l?!u:u}let a={},i=!1,s=!1;for(let l of t){let o=l.charCodeAt(0)===33,u=o?l.slice(1):l;if(o){if(Pe(e,u,n,a))return!1}else i=!0,!s&&Pe(e,u,n,a)&&(s=!0)}return i?s:!0}function tt(e,t,r){let n;r!==void 0&&(n=Array.isArray(r)?ve(r):[ve(r)]);let a=[],i=Y(e,(s,l,o)=>{let u=o.parentType==="object"?l:s;if(o.parentType==="object"&&typeof s=="string"&&ie(s,t,{caseSensitiveMatch:!0})){if(n===void 0)a.push({val:l,path:o.path});else if(n.length)return n.shift()}return u});return n===void 0?a:i}var C=It(nt(),1);var it={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function _r(e,t){let r,n=0;for(;n<e.length;){let a=n+1;for(;a<e.length&&e[n][0]===e[a][0]&&e[n][1]===e[a][1];)a+=1;if(a-n>1){r||(r=new Map(t.map((l,o)=>[l,o])));let i=r,s=e.slice(n,a).sort((l,o)=>i.get(l)-i.get(o));e.splice(n,s.length,...s)}n=a}return e}function F(e,t){var l;if(!Array.isArray(e)||!e.length)return e;let r=t===void 0?!0:D(t);if(t!==void 0&&r&&(t==null?void 0:t.strictlyTwoElementsInRangeArrays)===!0)for(let o=0;o<e.length;o+=1){let u=e[o];if(!Array.isArray(u)||u.length!==2)throw new TypeError("ranges-sort/rSort(): [THROW_ID_01] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, range at index ".concat(o," (").concat(v(u,4),") is ").concat(Array.isArray(u)?"an array with ".concat(u.length," elements"):"not an array","!"));if(!Number.isInteger(u[0])||u[0]<0||!Number.isInteger(u[1])||u[1]<0)throw new TypeError("ranges-sort/rSort(): [THROW_ID_02] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, range at index ".concat(o," (").concat(v(u,4),") does not consist of only natural numbers!"))}else for(let o=0;o<e.length;o+=1){let u=e[o];if(!Array.isArray(u)||!Number.isInteger(u[0])||u[0]<0||!Number.isInteger(u[1])||u[1]<0)throw new TypeError("ranges-sort/rSort(): [THROW_ID_02] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, range at index ".concat(o," (").concat(v(u,4),") does not consist of only natural numbers!"))}if(t!==void 0&&!r)throw new TypeError("ranges-sort/rSort(): [THROW_ID_03] The second argument must be a plain options object; received ".concat(v(t,4)," (type ").concat(typeof t,")!"));let n=it.progressFn;if(t!==void 0){let o=t.strictlyTwoElementsInRangeArrays;if(o!==void 0&&typeof o!="boolean")throw new TypeError("ranges-sort/rSort(): [THROW_ID_04] opts.strictlyTwoElementsInRangeArrays must be a boolean; received ".concat(v(o,4)," (type ").concat(typeof o,")!"));if(n=(l=t.progressFn)!=null?l:it.progressFn,n!==!1&&n!==null&&typeof n!="function")throw new TypeError("ranges-sort/rSort(): [THROW_ID_05] opts.progressFn must be a function, false, null, or undefined; received ".concat(v(n,4)," (type ").concat(typeof n,")!"))}let a,i;if(n){let o=e.length**2,u=0,f;i=h=>{h!==f&&(f=h,n(h))},a=Array.from(e).sort((h,d)=>(u+=1,i==null||i(Math.min(99,Math.floor(u*100/o))),h[0]===d[0]?h[1]<d[1]?-1:h[1]>d[1]?1:0:h[0]<d[0]?-1:1))}else a=Array.from(e).sort((o,u)=>o[0]===u[0]?o[1]<u[1]?-1:o[1]>u[1]?1:0:o[0]<u[0]?-1:1);let s=a.length>10?_r(a,e):a;return i==null||i(100),s}var cr={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function we(e,t){if(!Array.isArray(e)||!e.length)return null;if(t!==void 0&&!D(t))throw new TypeError("ranges-merge/rMerge(): [THROW_ID_01] the second input argument must be a plain object. It was given as:\n".concat(v(t,4)," (type ").concat(typeof t,")"));let r=W(W({},cr),t);if(r.progressFn&&D(r.progressFn)&&!Object.keys(r.progressFn).length)r.progressFn=null;else if(r.progressFn&&typeof r.progressFn!="function")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_02] opts.progressFn must be a function! It was given of a type: "'.concat(typeof r.progressFn,'", equal to ').concat(v(r.progressFn,4)));if(r.mergeType!==1&&r.mergeType!==2&&r.mergeType!=="1"&&r.mergeType!=="2")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_03] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof r.mergeType,'", equal to ').concat(v(r.mergeType,4)));if(typeof r.joinRangesThatTouchEdges!="boolean")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof r.joinRangesThatTouchEdges,'", equal to ').concat(v(r.joinRangesThatTouchEdges,4)));let n=r.progressFn,a=r.joinRangesThatTouchEdges,i=[];for(let b of e)Array.isArray(b)&&(b[2]!==void 0||b[0]!==b[1])&&i.push([...b]);let s,l,o;n?s=F(i,{progressFn:b=>{o=Math.floor(b/5),o!==l&&(l=o,n(o))}}):s=F(i);let u=s.length-1,f=r.mergeType===2||r.mergeType==="2",h=s.length;for(let b=u;b>=0;b--){let c=s[b];for(n&&b<u&&(o=Math.floor((1-(b+1)/u)*78)+21,o!==l&&o>l&&(l=o,n(o)));h<s.length;){let p=s[h],y=p[0]===c[0];if(!y&&(a?p[0]>c[1]:p[0]>=c[1]))break;let _=p[1]>=c[1];_&&(c[1]=p[1]),p[2]===null?c[2]=null:p[2]!==void 0&&(y||_)&&c[2]!==null&&(c[2]!=null?f&&y?c[2]=p[2]:c[2]+=p[2]:c[2]=p[2]),h+=1}h-=1,s[h]=c}let d=s.length-h;for(let b=0;b<d;b++)s[b]=s[h+b];return s.length=d,n&&l!==99&&n(99),s.length?s:null}function ae(e){if(typeof e=="number")return Number.isInteger(e)&&e>=0;if(typeof e!="string"||!e.trim())return!1;let t=Number(e);return Number.isInteger(t)&&t>=0}function L(e,t,r){let n=0,a=0;if(e===void 0&&t===void 0&&r===void 0)throw new Error("ranges-apply/rApply(): [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError("ranges-apply/rApply(): [THROW_ID_02] first input argument must be a string! Currently it's: ".concat(typeof e,", equal to: ").concat(v(e,4)));if(t!=null&&!Array.isArray(t))throw new TypeError("ranges-apply/rApply(): [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ".concat(typeof t,", equal to: ").concat(v(t,4)));if(r!=null&&r!==!1&&r!==0&&r!==""&&typeof r!="function")throw new TypeError("ranges-apply/rApply(): [THROW_ID_04] the third input argument must be a function, false, null, undefined, 0, or an empty string! Currently it's: ".concat(typeof r,", equal to: ").concat(v(r,4)));if(t==null||!t.length||t.every(f=>f==null))return r&&r(100),e;let i;Array.isArray(t)&&!Array.isArray(t[0])&&ae(t[0])&&ae(t[1])?i=[Array.from(t)]:i=Array.from(t);let s=i.length,l=0;i.forEach((f,h)=>{if(f){if(r&&(n=Math.floor(l/s*10),n!==a&&(a=n,r(n))),!Array.isArray(f))throw new TypeError("ranges-apply/rApply(): [THROW_ID_05] ranges array, second input arg., has ".concat(h,"th element not an array: ").concat(v(f,4),", which is ").concat(typeof f));if(!ae(f[0]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_06] ranges array, second input arg. has ".concat(h,"th element, array ").concat(v(f),". Its first element is not a non-negative integer or string index, but ").concat(typeof f[0],", equal to: ").concat(v(f[0],4),"."));if(typeof f[0]=="string"&&(i[h]=[...f],i[h][0]=Number(f[0])),!ae(f[1]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_07] ranges array, second input arg. has ".concat(h,"th element, array ").concat(v(f),". Its second element is not a non-negative integer or string index, but ").concat(typeof f[1],", equal to: ").concat(v(f[1],4),"."));if(typeof f[1]=="string"&&(i[h]===f&&(i[h]=[...f]),i[h][1]=Number(f[1])),i[h][0]>i[h][1])throw new RangeError("ranges-apply/rApply(): [THROW_ID_08] ranges array, second input arg. has ".concat(h,"th element, array ").concat(v(f),". Its first index (").concat(i[h][0],") must not be greater than its second index (").concat(i[h][1],")."));l+=1}});let o=r?we(i,{progressFn:f=>{n=10+Math.floor(f/10),n!==a&&(a=n,r(n))}}):we(i),u=(o==null?void 0:o.length)||0;if(o&&u>0){let f=e.slice(o[u-1][1]);e=o.reduce((h,d,b,c)=>{var _;r&&(n=20+Math.floor(b/u*80),n!==a&&(a=n,r(n)));let p=b===0?0:c[b-1][1],y=c[b][0];return"".concat(h).concat(e.slice(p,y)).concat((_=c[b][2])!=null?_:"")},""),e+=f}return r&&a!==100&&r(100),e}function oe(e,t=1){let r="\xA0";function n(i){return i.length<2?i:Array.from(i).reverse().join("")}function a(i,s,l){let o=l?"\n":"\r",u=l?"\r":"\n";if(!i)return i;let f=0,h="";for(let d=0,b=i.length;d<b;d++)(i[d]===o||i[d]===u&&i[d-1]!==o)&&f++,"\r\n".includes(i[d])||i[d]===r?i[d]===r?h+=i[d]:i[d]===o?f<=s&&(h+=i[d],i[d+1]===u&&(h+=i[d+1],d++)):i[d]===u&&(i==null?void 0:i[d-1])!==o&&f<=s&&(h+=i[d]):!i[d+1]&&!f&&(h+=" ");return h}if(typeof e=="string"&&e.length){let i=e.trim();if(i.length===e.length)return e;let s=1;typeof t=="number"&&Number.isInteger(t)&&t>=0&&(s=t);let l="",o="";if(!i)l=e;else if(!e[0].trim()){for(let f=0,h=e.length;f<h;f++)if(e[f].trim()){l=e.slice(0,f);break}}let u=e[e.length-1];if(i&&(u.trim()===""||u===r)){for(let f=e.length;f--;)if(e[f].trim()){o=e.slice(f+1);break}}return"".concat(a(l,s,!1)).concat(i).concat(n(a(n(o),s,!0)))}return e}var $e={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function st(e,t,r){return t===void 0||e===null?e:t===null?null:e===void 0||r?t:e+t}function hr(e,t){var c,p,y;function r(_){return!!_&&typeof _=="object"&&!Array.isArray(_)}if(!Array.isArray(e)||!e.length)return null;if(t&&!r(t))throw new TypeError("ranges-push/rMerge(): [THROW_ID_07] the second input argument must be a plain object. It was given as:\n".concat(v(t,4)," (type ").concat(typeof t,")"));let n=(c=t==null?void 0:t.progressFn)!=null?c:$e.progressFn,a=(p=t==null?void 0:t.mergeType)!=null?p:$e.mergeType,i=(y=t==null?void 0:t.joinRangesThatTouchEdges)!=null?y:$e.joinRangesThatTouchEdges;if(n&&r(n)&&!Object.keys(n).length)n=null;else if(n&&typeof n!="function")throw new TypeError('ranges-push/rMerge(): [THROW_ID_08] resolvedOpts.progressFn must be a function! It was given of a type: "'.concat(typeof n,'", equal to ').concat(v(n,4)));if(a!==1&&a!==2&&a!=="1"&&a!=="2")throw new TypeError('ranges-push/rMerge(): [THROW_ID_09] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof a,'", equal to ').concat(v(a,4)));if(typeof i!="boolean")throw new TypeError('ranges-push/rMerge(): [THROW_ID_10] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof i,'", equal to ').concat(v(i,4)));let s=[];for(let _ of e)Array.isArray(_)&&(_[2]!==void 0||_[0]!==_[1])&&s.push([..._]);let l,o,u;n?l=F(s,{progressFn:_=>{u=Math.floor(_/5),u!==o&&(o=u,n==null||n(u))}}):l=F(s);let f=l.length-1,h=+a==2,d=l.length;for(let _=f;_>=0;_--){let g=l[_];for(n&&_<f&&(u=Math.floor((1-(_+1)/f)*78)+21,u!==o&&u>o&&(o=u,n(u)));d<l.length;){let m=l[d],w=m[0]===g[0];if(!w&&(i?m[0]>g[1]:m[0]>=g[1]))break;let A=m[1]>=g[1];A&&(g[1]=m[1]),m[2]===null?g[2]=null:m[2]!==void 0&&(w||A)&&(g[2]=st(g[2],m[2],h&&w)),d+=1}d-=1,l[d]=g}let b=l.length-d;for(let _=0;_<b;_++)l[_]=l[d+_];return l.length=b,l.length?l:null}var le=Object.freeze({limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1});function H(e){if(K(e))return e;if(typeof e=="string"&&/^\d+$/.test(e)){let t=Number(e);return K(t)?t:null}return null}function at(e){if(!Array.isArray(e))return"a ranges batch must contain only range arrays; received ".concat(v(e,4));if(e.length>3)return"a range must contain at most three values; received ".concat(v(e,4));let[t,r,n]=e;if(t==null&&r==null)return;if(t!=null&&r==null)return"the first index is set (".concat(v(t),") but the second index is not (").concat(v(r),")");if(t==null&&r!=null)return"the second index is set (".concat(v(r),") but the first index is not (").concat(v(t),")");let a=H(t),i=H(r);if(a===null)return"the first index must be a natural number, zero, or a digit-only numeric string; received ".concat(v(t,4)," (type ").concat(typeof t,")");if(i===null)return"the second index must be a natural number, zero, or a digit-only numeric string; received ".concat(v(r,4)," (type ").concat(typeof r,")");if(B(n)&&!$(n)&&!M(n))return"the third value must be a string, number, null, or undefined; received ".concat(v(n,4)," (type ").concat(typeof n,")");if(a>i)return"the first index (".concat(a,") must not be greater than the second index (").concat(i,")")}function gr(e){if(e.length>3)return{error:"expected at most three arguments but received ".concat(e.length),ranges:[]};if(e.length<=1&&Array.isArray(e[0])){let r=e[0];if(!r.length)return{ranges:[]};e=Array.isArray(r[0])?r:[r]}else e=[e];let t=[];for(let r of e){let n=at(r);if(n)return{error:n,ranges:[]};let[a,i,s]=r;if(a==null&&i==null)continue;let l=H(a),o=H(i);t.push(s!==void 0&&!($(s)&&!s.length)?[l,o,s]:[l,o])}return{ranges:t}}function pr(e){return e[2]===void 0&&e[0]===e[1]}function dr(e){let t=-1;for(let r=0,n=e.length;r<n;r++){let a=e[r];if(Array.isArray(a)){if(a[0]<t)return!1;t=a[0]}}return!0}var G=class{constructor(e){x(this,"ranges");x(this,"opts");x(this,"currentCache",null);if(e!=null&&!D(e))throw new TypeError("ranges-push/Ranges/constructor(): [THROW_ID_01] The options argument must be a plain object. It was given as ".concat(v(e,4)," (type ").concat(typeof e,")."));if(e===void 0){this.opts=le,this.ranges=[];return}let t=e,r=t.limitToBeAddedWhitespace===void 0?le.limitToBeAddedWhitespace:t.limitToBeAddedWhitespace,n=t.limitLinebreaksCount===void 0?le.limitLinebreaksCount:t.limitLinebreaksCount,a=t.mergeType===void 0?le.mergeType:t.mergeType,i=a==="1"?1:a==="2"?2:a,s;if(typeof r!="boolean"?s="opts.limitToBeAddedWhitespace must be a boolean; received ".concat(v(r,4)," (type ").concat(typeof r,")"):K(n)?i!==1&&i!==2&&(s='opts.mergeType must be 1, 2, "1", or "2"; received '.concat(v(a,4)," (type ").concat(typeof a,")")):s="opts.limitLinebreaksCount must be a natural number or zero; received ".concat(v(n,4)," (type ").concat(typeof n,")"),s)throw new TypeError("ranges-push/Ranges/constructor(): [THROW_ID_02] ".concat(s,"."));let l=Object.freeze({limitToBeAddedWhitespace:r,limitLinebreaksCount:n,mergeType:i});this.opts=l,this.ranges=[]}rangeListsMatch(e,t){if(!Array.isArray(e))return t===null;if(!Array.isArray(t)||e.length!==t[0])return!1;let r=1;for(let n=0,a=e.length;n<a;n++){let i=e[n];if(!Array.isArray(i)){if(t[r++]!==-1||i!==t[r++])return!1;continue}if(i.length!==t[r++])return!1;for(let s=0;s<i.length;s++)if(i[s]!==t[r++])return!1}return r===t.length}snapshotRanges(e){if(!Array.isArray(e))return null;let t=new Array(1+e.length*4);t[0]=e.length;let r=1;for(let n=0,a=e.length;n<a;n++){let i=e[n];if(Array.isArray(i)){t[r++]=i.length;for(let s=0;s<i.length;s++)t[r++]=i[s]}else t[r++]=-1,t[r++]=i}return t.length=r,t}currentStateMatchesSnapshot(){let e=this.currentCache;return e!==null&&this.rangeListsMatch(this.ranges,e.rangesSnapshot)&&this.rangeListsMatch(e.result,e.resultSnapshot)}recordCurrentSnapshot(e){let t=this.snapshotRanges(this.ranges);this.currentCache={rangesSnapshot:t,result:e,resultSnapshot:e===this.ranges?t:this.snapshotRanges(e)}}invalidateCurrentCache(){this.currentCache=null}addValidated(e,t,r){this.invalidateCurrentCache();let n=this.last();if(B(this.ranges)&&Array.isArray(n)&&e===n[1]){if(n[1]=t,r!==void 0&&!($(r)&&!r.length)){let i=st(n[2],r,this.opts.mergeType===2&&n[0]===e);this.opts.limitToBeAddedWhitespace&&typeof i=="string"&&(i=oe(i,this.opts.limitLinebreaksCount)),$(i)&&!i.length||(n[2]=i)}return}this.ranges||(this.ranges=[]);let a=r!==void 0?[e,t,typeof r=="string"&&this.opts.limitToBeAddedWhitespace?oe(r,this.opts.limitLinebreaksCount):r]:[e,t];this.ranges.push(a)}add(e,t,r){let n=arguments.length,a;if(n>3)a="expected at most three arguments but received ".concat(n);else if(n===1&&Array.isArray(e)){let i=Array.isArray(e[0])?e:[e];for(let s=0,l=i.length;s<l&&(a=at(i[s]),!a);s++);if(!a)for(let s=0,l=i.length;s<l;s++){let[o,u,f]=i[s];o==null&&u==null||this.addValidated(H(o),H(u),$(f)&&!f.length?void 0:f)}}else{if(e==null&&t==null)return;if(e!=null&&t==null)a="the first index is set (".concat(v(e),") but the second index is not (").concat(v(t),")");else if(e==null&&t!=null)a="the second index is set (".concat(v(t),") but the first index is not (").concat(v(e),")");else{let i=H(e),s=H(t);i===null?a="the first index must be a natural number, zero, or a digit-only numeric string; received ".concat(v(e,4)," (type ").concat(typeof e,")"):s===null?a="the second index must be a natural number, zero, or a digit-only numeric string; received ".concat(v(t,4)," (type ").concat(typeof t,")"):B(r)&&!$(r)&&!M(r)?a="the third value must be a string, number, null, or undefined; received ".concat(v(r,4)," (type ").concat(typeof r,")"):i>s?a="the first index (".concat(i,") must not be greater than the second index (").concat(s,")"):this.addValidated(i,s,$(r)&&!r.length?void 0:r)}}if(a)throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_03] ".concat(a,"."))}push(e,t,r){this.add.apply(this,arguments)}current(){var e,t;if(this.currentStateMatchesSnapshot())return(t=(e=this.currentCache)==null?void 0:e.result)!=null?t:null;if(Array.isArray(this.ranges)&&this.ranges.length){this.ranges=hr(this.ranges,this.opts.mergeType===1?void 0:{mergeType:2});let r=this.ranges;return r&&this.opts.limitToBeAddedWhitespace&&(r=r.map(n=>typeof n[2]=="string"?[n[0],n[1],oe(n[2],this.opts.limitLinebreaksCount)]:n)),this.recordCurrentSnapshot(r),r}return this.recordCurrentSnapshot(null),null}firstCovers(e){if(!K(e))throw new TypeError("ranges-push/Ranges/firstCovers(): [THROW_ID_04] the input argument must be a natural number or zero! It was given as ".concat(v(e,4)," (type ").concat(typeof e,")"));if(!Array.isArray(this.ranges)||!this.ranges.length)return!1;let t=dr(this.ranges)?this.ranges:this.ranges.filter(n=>Array.isArray(n)).slice().sort((n,a)=>n[0]-a[0]||n[1]-a[1]),r=null;for(let n=0,a=t.length;n<a;n++){let i=t[n];if(!(!Array.isArray(i)||pr(i))){if(r===null){if(i[0]!==0)return!1;r=i[1]}else{if(i[0]>r)break;i[1]>r&&(r=i[1])}if(r>=e)return!0}}return r!==null&&r>=e}wipe(){this.ranges=[],this.invalidateCurrentCache()}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])){let t=gr([e]);if(t.error)throw new TypeError("ranges-push/Ranges/replace(): [THROW_ID_06] ".concat(t.error,"."));this.ranges=t.ranges,this.invalidateCurrentCache()}else throw new Error("ranges-push/Ranges/replace(): [THROW_ID_05] Single range was given but we expected array of arrays! The first element, ".concat(v(e[0],4)," should be an array."));else this.ranges=[],this.invalidateCurrentCache()}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};var ot={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},lt=e=>e+1,yr=e=>e-1;function mr(e,t,r,n,a=()=>!1,i=!1,s=lt){if(+t<0&&i&&r==="EOL")return r;if(t>=e.length&&!i)return!1;let l=i?1:r.length,o=0,u=!1,f=!1,h=!1,d=Math.min(n.maxMismatches,e.length+r.length),b=d,c=t,p=!1,y=!1,_=!1;function g(){return o===1&&b<d-1}for(;e[c];){let m=s(c);if(n.trimBeforeMatching&&e[c].trim()===""){if(!e[m]&&i&&r==="EOL")return!0;c=s(c);continue}if(a(e[c])){if(i&&r==="EOL"&&!e[m])return!0;c=s(c);continue}if(i)return!1;let w=m>c?r[r.length-l]:r[l-1];if(!n.i&&e[c]===w||n.i&&w!==void 0&&e[c].toLowerCase()===w.toLowerCase()){if(p||(p=!0),h||(h=!0),l===r.length){if(y=!0,b!==d)return!1}else l===1&&(_=!0);if(l-=1,o++,g())return!1;if(!l)return o!==r.length||b===d||!u?c:!1}else if(!u&&!o&&(u=!0),d&&b&&c){b-=1;for(let A=0;A<=b;A++){let T=m>c?r[r.length-l+1+A]:r[l-2-A],O=e[s(c)];if(T&&(!n.i&&e[c]===T||n.i&&e[c].toLowerCase()===T.toLowerCase())&&(!n.firstMustMatch||l!==r.length)){if(o++,g())return!1;l-=2,p=!0;break}else if(O&&T&&(!n.i&&O===T||n.i&&O.toLowerCase()===T.toLowerCase())&&(!n.firstMustMatch||l!==r.length)){if(!o&&!n.hungry)return!1;l-=1,p=!0;break}else if(T===void 0&&b>=0&&p&&(!n.firstMustMatch||y)&&(!n.lastMustMatch||_))return c}p||(f=c)}else return c===0&&l===1&&d>0&&b>0&&(!n.firstMustMatch||y)&&!n.lastMustMatch&&h?0:!1;if(f!==!1&&f!==c&&(f=!1),l<1)return c;c=s(c)}if(l>0)return i&&r==="EOL"?!0:n&&d>=l&&h?f||0:!1}function ut(e,t,r,n,a){var c,p,y,_;if(D(a)&&Ge(a,"trimBeforeMatching")&&a&&typeof a.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_01] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(a.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let i=W(W({},ot),a);if(i.maxMismatches=(c=a==null?void 0:a.maxMismatches)!=null?c:ot.maxMismatches,br(i.maxMismatches,e),typeof i.trimCharsBeforeMatching=="string"&&(i.trimCharsBeforeMatching=S(i.trimCharsBeforeMatching)),i.trimCharsBeforeMatching=i.trimCharsBeforeMatching.map(g=>$(g)?g:String(g)),!$(t)||!t.length)return!1;if(!Number.isInteger(r)||r<0)throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_02] the second argument should be a natural number. Currently it's of a type: ").concat(typeof r,", equal to:\n").concat(v(r,4)));let s,l;if($(n))s=[n];else if(Array.isArray(n))s=n;else if(!n)s=n;else if(typeof n=="function")s=[],s.push(n);else throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_03] the third argument, whatToMatch, is neither string nor array of strings! It's ").concat(typeof n,", equal to:\n").concat(v(n,4)));if(vr(s,e),a&&!D(a))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_04] the fourth argument, options object, should be a plain object. Currently it's of a type \"").concat(typeof a,'", and equal to:\n').concat(v(a,4)));let o=0,u="";if((p=i==null?void 0:i.trimCharsBeforeMatching)!=null&&p.some((g,m)=>g.length>1?(o=m,u=g,!0):!1))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_05] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ").concat(o," is longer than 1 character, ").concat(u.length," (equals to ").concat(u,"). Please split it into separate characters and put into array as separate elements."));if(r>=t.length)return!1;let f=i.i?i.trimCharsBeforeMatching.map(g=>g.toLowerCase()):i.trimCharsBeforeMatching,h=i.i?g=>f.includes(g.toLowerCase()):g=>f.includes(g);if(!s||!Array.isArray(s)||Array.isArray(s)&&!s.length||Array.isArray(s)&&s.length===1&&$(s[0])&&!s[0].trim()){if(typeof i.cb=="function"){let m,w=r;if((e==="matchLeftIncl"||e==="matchRight")&&(w+=1),e[5]==="L")for(let O=w;O--;){let E=t[O];if((!i.trimBeforeMatching||i.trimBeforeMatching&&(E!=null&&E.trim()))&&(!((y=i.trimCharsBeforeMatching)!=null&&y.length)||E!==void 0&&!h(E))){m=O;break}}else if(e.startsWith("matchRight"))for(let O=w;O<t.length;O++){let E=t[O];if((!i.trimBeforeMatching||i.trimBeforeMatching&&E.trim())&&(!((_=i.trimCharsBeforeMatching)!=null&&_.length)||!h(E))){m=O;break}}if(m===void 0)return!1;let A=t[m],T=e[5]==="L"?t.slice(0,m+1):t.slice(m);return e[5],i.cb(A,T,m)}let g="";throw a||(g=" More so, the whole options object, the fourth input argument, is missing!"),new Error("string-match-left-right/".concat(e,'(): [THROW_ID_06] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!').concat(g))}if(!i.cb&&!i.i&&!i.trimBeforeMatching&&!i.trimCharsBeforeMatching.length&&i.maxMismatches===0&&!i.firstMustMatch&&!i.lastMustMatch&&!i.hungry&&s.every($)){for(let g of s){if(!g.length)continue;let m=r;if(e==="matchRight"?m+=1:e==="matchLeft"?m-=g.length:e==="matchLeftIncl"&&(m-=g.length-1),m>=0&&t.startsWith(g,m))return g}return!1}let d=r;e==="matchRight"?d+=1:e==="matchLeft"&&(d-=1);let b=e[5]==="L"?yr:lt;for(let g=0,m=s.length;g<m;g++){l=typeof s[g]=="function";let w=s[g],A=typeof w=="function"?w():w;if(l&&A!=="EOL")throw new Error("string-match-left-right/".concat(e,'(): [THROW_ID_09] EOL marker functions must return "EOL". The function at index ').concat(g," returned:\n").concat(v(A,4)));if(l&&e.endsWith("Incl"))continue;let T,O,E="",V=mr(t,d,A,i,h,l,b);if(V&&l)return!i.cb||i.cb(T,E,O)?A:!1;if(Number.isInteger(V)&&(O=e.startsWith("matchLeft")?V-1:V+1,e[5]==="L"?E=t.slice(0,V):E=t.slice(O)),O<0&&(O=void 0),t[O]&&(T=t[O]),Number.isInteger(V)&&(!i.cb||i.cb(T,E,O)))return A}return!1}function br(e,t){if(!Number.isSafeInteger(e)||e<0)throw new Error("string-match-left-right/".concat(t,"(): [THROW_ID_07] opts.maxMismatches must be a non-negative safe integer. Currently it's of a type: ").concat(typeof e,", equal to:\n").concat(v(e,4)))}function vr(e,t){if(e)for(let r=0;r<e.length;r+=1){let n=e[r];if(typeof n!="string"&&typeof n!="function")throw new Error("string-match-left-right/".concat(t,"(): [THROW_ID_08] matcher alternatives must be strings or EOL marker functions. The value at index ").concat(r," is of a type: ").concat(typeof n,", equal to:\n").concat(v(n,4)))}}function J(e,t,r,n){return ut("matchLeftIncl",e,t,r,n)}function R(e,t,r,n){return ut("matchRightIncl",e,t,r,n)}var ft={fromIndex:0,throwWhenSomethingWrongIsDetected:!0,allowWholeValueToBeOnlyHeadsOrTails:!0,source:"string-find-heads-tails",matchHeadsAndTailsStrictlyInPairsByTheirOrder:!1,relaxedAPI:!1};function Ae(e,t,r,n){if(B(n)&&!D(n))throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_01] the fourth input argument, an Optional Options Object, must be a plain object! Currently it's equal to: ".concat(n," (type: ").concat(typeof n,")"));let a=W(W({},ft),n),i=a.source===ft.source?"":"".concat(a.source,": ");if($(a.fromIndex)&&/^\d*$/.test(a.fromIndex))a.fromIndex=Number(a.fromIndex);else if(!Number.isInteger(a.fromIndex)||a.fromIndex<0)throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_02] ".concat(i,"the fourth input argument must be a natural number or zero! Currently it's: ").concat(a.fromIndex));if(!$(e)||e.length===0){if(a.relaxedAPI)return[];throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_03] the first input argument, input string, must be a non-zero-length string! Currently it's: ".concat(typeof e,", equal to: ").concat(e))}let s,l;if(!$(t)&&!Array.isArray(t)){if(a.relaxedAPI)return[];throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_04] the second input argument, heads, must be either a string or an array of strings! Currently it's: ".concat(typeof t,", equal to:\n").concat(v(t,4)))}else if($(t))if(t.length===0){if(a.relaxedAPI)return[];throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_05] the second input argument, heads, must be a non-empty string! Currently it's empty.")}else t=S(t);else if(Array.isArray(t))if(t.length===0){if(a.relaxedAPI)return[];throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_06] the second input argument, heads, must be a non-empty array and contain at least one string! Currently it's empty.")}else if(t.every((c,p)=>(s=c,l=p,$(c)))){if(!t.every((c,p)=>(l=p,$(c)&&c.length&&c.trim()!=="")))if(a.relaxedAPI){if(t=t.filter(c=>$(c)&&c.length),t.length===0)return[]}else throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_08] the second input argument, heads, should not contain empty strings! For example, there's one detected at index ".concat(l," of heads array:\n").concat(v(t,4),"."))}else if(a.relaxedAPI){if(t=t.filter(c=>$(c)&&c.length),t.length===0)return[]}else throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_07] the second input argument, heads, contains non-string elements! For example, element at ".concat(l,"th index is ").concat(typeof s,", equal to:\n").concat(v(s,4),". Whole heads array looks like:\n").concat(v(t,4)));if(!$(r)&&!Array.isArray(r)){if(a.relaxedAPI)return[];throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_09] the third input argument, tails, must be either a string or an array of strings! Currently it's: ".concat(typeof r,", equal to:\n").concat(v(r,4)))}else if($(r))if(r.length===0){if(a.relaxedAPI)return[];throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_10] the third input argument, tails, must be a non-empty string! Currently it's empty.")}else r=S(r);else if(Array.isArray(r))if(r.length===0){if(a.relaxedAPI)return[];throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_11] the third input argument, tails, must be a non-empty array and contain at least one string! Currently it's empty.")}else if(r.every((c,p)=>(s=c,l=p,$(c)))){if(!r.every((c,p)=>(l=p,$(c)&&c.length&&c.trim()!=="")))if(a.relaxedAPI){if(r=r.filter(c=>$(c)&&c.length),r.length===0)return[]}else throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_13] the third input argument, tails, should not contain empty strings! For example, there's one detected at index ".concat(l,". Whole tails array is equal to:\n").concat(v(r,4)))}else if(a.relaxedAPI){if(r=r.filter(c=>$(c)&&c.length),r.length===0)return[]}else throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_12] the third input argument, tails, contains non-string elements! For example, element at ".concat(l,"th index is ").concat(typeof s,", equal to:\n").concat(v(s,4),". Whole tails array is equal to:\n").concat(v(r,4)));if(a.throwWhenSomethingWrongIsDetected&&!a.allowWholeValueToBeOnlyHeadsOrTails){if(S(t).includes(e))throw new Error("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_14] ".concat(i,"the whole input string can't be equal to ").concat($(t)?"":"one of ","heads (").concat(e,")!"));if(S(r).includes(e))throw new Error("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_15] ".concat(i,"the whole input string can't be equal to ").concat($(r)?"":"one of ","tails (").concat(e,")!"))}let o=t.concat(r).map(c=>c.charAt(0)).reduce((c,p)=>p.charCodeAt(0)>c[1]?[c[0],p.charCodeAt(0)]:p.charCodeAt(0)<c[0]?[p.charCodeAt(0),c[1]]:c,[t[0].charCodeAt(0),t[0].charCodeAt(0)]),u=[],f=!1,h={},d,b;for(let c=a.fromIndex,p=e.length;c<p;c++){let y=e[c].charCodeAt(0);if(y<=o[1]&&y>=o[0]){let _=R(e,c,t);if(_&&a.matchHeadsAndTailsStrictlyInPairsByTheirOrder){for(let m=t.length;m--;)if(t[m]===_){b=m;break}}if($(_))if(f){if(a.throwWhenSomethingWrongIsDetected)throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_16] ".concat(i,'When processing "').concat(e,'", we found heads (').concat(e.slice(c,c+_.length),') starting at character with index number "').concat(c,'" and there was another set of heads before it! Generally speaking, there should be "heads-tails-heads-tails", not "heads-heads-tails"!\nWe\'re talking about the area of the code:\n\n\n--------------------------------------starts\n').concat(e.slice(Math.max(c-200,0),c),"\n \x1B[33m------->\x1B[39m ").concat("\x1B[31m".concat(e.slice(c,c+_.length),"\x1B[39m")," \x1B[33m<-------\x1B[39m\n").concat(e.slice(c+_.length,Math.min(p,c+200)),"\n--------------------------------------ends\n\n\nTo turn off this error being thrown, set resolvedOpts.throwWhenSomethingWrongIsDetected to Boolean false."))}else{h={},h.headsStartAt=c,h.headsEndAt=c+_.length,f=!0,c+=_.length-1,d&&(d=void 0);continue}let g=R(e,c,r);if(f&&g&&a.matchHeadsAndTailsStrictlyInPairsByTheirOrder&&b!==void 0&&r[b]!==void 0&&r[b]!==g){let m;for(let w=r.length;w--;)if(r[w]===g){m=w;break}throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_17] ".concat(i,'When processing "').concat(e,'", we had "resolvedOpts.matchHeadsAndTailsStrictlyInPairsByTheirOrder" on. We found heads (').concat(t[b],") but the tails the followed it were not of the same index, ").concat(b," (").concat(r[b],") but ").concat(m," (").concat(g,")."))}if($(g))if(f){h.tailsStartAt=c,h.tailsEndAt=c+g.length,u.push(h),h={},f=!1,c+=g.length-1;continue}else a.throwWhenSomethingWrongIsDetected&&(d=new Error("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_18] ".concat(i,'When processing "').concat(e,'", we found tails (').concat(e.slice(c,c+g.length),') starting at character with index number "').concat(c,"\" but there were no heads preceding it. That's very naughty!")))}if(a.throwWhenSomethingWrongIsDetected&&c===p-1){if(Object.keys(h).length!==0)throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_19] ".concat(i,'When processing "').concat(e,"\", we reached the end of the string and yet didn't find any tails (").concat(v(r,4),") to match the last detected heads (").concat(e.slice(h.headsStartAt,h.headsEndAt),")!"));if(d)throw d}}return u}var _t="12.2.3";function ue(e,t){return!$(e)||!e.trim()?!1:!!(e.includes(t.heads)||e.includes(t.tails)||$(t.headsNoWrap)&&t.headsNoWrap.length&&e.includes(t.headsNoWrap)||$(t.tailsNoWrap)&&t.tailsNoWrap.length&&e.includes(t.tailsNoWrap))}function Te(e){if($(e)&&e.length&&e.indexOf(".")!==-1){for(let t=e.length;t--;)if(e[t]===".")return e.slice(t+1)}return e}function ct(e){if($(e)&&e.length&&e.indexOf(".")!==-1){for(let t=0,r=e.length;t<r;t++)if(e[t]===".")return e.slice(0,t)}return e}function Oe(e){if($(e)&&e.length&&e.indexOf(".")!==-1){for(let t=e.length;t--;)if(e[t]===".")return e.slice(0,t)}return e}function ht(e){if($(e)&&e.length&&e.indexOf(".")!==-1){for(let t=0,r=e.length;t<r;t++)if(e[t]===".")return e.slice(t+1)}return e}var gt={classicTrim:!1,cr:!1,lf:!1,tab:!1,space:!0,nbsp:!1};function Q(e,t){if(typeof e!="string")throw new Error("string-trim-spaces-only/trimSpaces(): [THROW_ID_01] input must be string! It was given as ".concat(typeof e,", equal to:\n").concat(v(e,4)));let r=t?W(W({},gt),t):gt,{classicTrim:n,cr:a,lf:i,tab:s,space:l,nbsp:o}=r;function u(h){return n&&!h.trim()||!n&&(l&&h===" "||a&&h==="\r"||i&&h==="\n"||s&&h===" "||o&&h==="\xA0")}let f=e.length;if(f){let h=0;for(;h<f&&u(e[h]);)h+=1;if(h===f)return{res:"",ranges:[[0,f]]};let d=f;for(;d>h;){let p=d-1;if(!u(e[p])){d<f;break}d=p}let b=h||void 0,c=d<f?d:void 0;return b!==void 0?c!==void 0?{res:e.slice(b,c),ranges:[[0,b],[c,f]]}:{res:e.slice(b),ranges:[[0,b]]}:c!==void 0?{res:e.slice(0,c),ranges:[[c,f]]}:{res:e,ranges:[]}}return{res:"",ranges:[]}}var $r={heads:["{{"],tails:["}}"]};function pt(e,t){let r=Object.prototype.hasOwnProperty;if(e===void 0)throw new Error("string-remove-duplicate-heads-tails/remDup(): [THROW_ID_01] The input is missing!");if(typeof e!="string")return e;if(t&&!D(t))throw new Error("string-remove-duplicate-heads-tails/remDup(): [THROW_ID_02] The given options are not a plain object but ".concat(typeof t,"!"));let n=W({},t);if(n&&r.call(n,"heads"))if(S(n.heads).every(p=>typeof p=="string"||Array.isArray(p)))typeof n.heads=="string"&&(n.heads=S(n.heads));else throw new Error("string-remove-duplicate-heads-tails/remDup(): [THROW_ID_03] The resolvedOpts.heads contains elements which are not string-type!");if(n&&r.call(n,"tails"))if(S(n.tails).every(p=>typeof p=="string"||Array.isArray(p)))typeof n.tails=="string"&&(n.tails=S(n.tails));else throw new Error("string-remove-duplicate-heads-tails/remDup(): [THROW_ID_04] The resolvedOpts.tails contains elements which are not string-type!");let a=Q(e).res;if(a.length===0)return e;e=a;let i=W(W({},$r),n);i.heads=i.heads.map(p=>p.trim()),i.tails=i.tails.map(p=>p.trim());let s=!1,l=!1,o=new G({limitToBeAddedWhitespace:!0}),u=new G({limitToBeAddedWhitespace:!0}),f=!0,h=!0,d="";function b(p,y){let _;return R(p,0,y.heads,{trimBeforeMatching:!0,cb:(g,m,w)=>(_=w,!0)})&&R(p,_,y.tails,{trimBeforeMatching:!0,cb:(g,m,w)=>(_=w,!0)})?p.slice(_):p}for(;e!==b(e,i);)e=Q(b(e,i)).res;function c(p,y){let _;return!J(p,p.length-1,y.tails,{trimBeforeMatching:!0,cb:(g,m,w)=>(_=w,!0)})||!_?p:J(p,_,y.heads,{trimBeforeMatching:!0,cb:(g,m,w)=>(_=w,!0)})?p.slice(0,_+1):p}for(;e!==c(e,i);)e=Q(c(e,i)).res;if(!i.heads.length||!R(e,0,i.heads,{trimBeforeMatching:!0})||!i.tails.length||!J(e,e.length-1,i.tails,{trimBeforeMatching:!0}))return Q(e).res;for(let p=0,y=e.length;p<y;p++)if(e[p].trim()!==""){let _;if(R(e,p,i.heads,{trimBeforeMatching:!0,cb:(g,m,w)=>(_=w,!0)})&&_){h=!0,f&&(f=!0);let g;R(e,_,i.tails,{trimBeforeMatching:!0,cb:(m,w,A)=>(g=A,!0)})&&typeof g=="number"&&o.push(p,g),u.current()&&s&&d!=="tails"&&o.push(u.current()),s||u.current()&&(o.push(u.current()),u.wipe()),u.push(p,_),d="heads",p=_-1;continue}if(R(e,p,i.tails,{trimBeforeMatching:!0,cb:(g,m,w)=>(_=Number.isInteger(w)?w:e.length,!0)})&&_){h=!0,f?(d==="heads"&&u.wipe(),f=!1):u.push(p,_),d="tails",p=_-1;continue}f&&(f=!0),h&&!s?(s=!0,h=!1):h&&!l?(l=!0,f=!0,h=!1,d==="heads"&&u.wipe()):h&&l&&u.wipe()}return u.current()&&o.push(u.current()),o.current()?L(e,o.current()).trim():e.trim()}function dt(e,t,r){let n,a;return $(e)&&e.length&&R(e,0,t,{trimBeforeMatching:!0,cb:(i,s,l)=>(n=l,!0)})&&J(e,e.length-1,r,{trimBeforeMatching:!0,cb:(i,s,l)=>(a=(l||0)+1,!0)})?e.slice(n,a):e}function We(e,t,r=!1,n,a,i){if(t.wrapHeadsWith||(t.wrapHeadsWith=""),t.wrapTailsWith||(t.wrapTailsWith=""),$(e)&&!r&&t.wrapGlobalFlipSwitch&&!t.dontWrapVars.some(s=>ie(i,s))&&(!t.preventDoubleWrapping||t.preventDoubleWrapping&&$(e)&&!e.includes(t.wrapHeadsWith)&&!e.includes(t.wrapTailsWith)))return"".concat(t.wrapHeadsWith).concat(e).concat(t.wrapTailsWith);if(r){if(!$(e))return e;let s=pt(e,{heads:t.wrapHeadsWith,tails:t.wrapTailsWith});return $(s)?dt(s,t.wrapHeadsWith,t.wrapTailsWith):s}return e}var Ar=_t,Tr=Object.prototype.hasOwnProperty,mt={heads:"%%_",tails:"_%%",headsNoWrap:"%%-",tailsNoWrap:"-%%",lookForDataContainers:!0,dataContainerIdentifierTails:"_data",wrapHeadsWith:"",wrapTailsWith:"",dontWrapVars:[],preventDoubleWrapping:!0,wrapGlobalFlipSwitch:!0,noSingleMarkers:!1,resolveToBoolIfAnyValuesContainBool:!0,resolveToFalseIfAnyValuesContainBool:!0,throwWhenNonStringInsertedInString:!1,allowUnresolved:!1};function I(e){return $(e)?e.trim():e}function yt(e,t,r){let n=r.get(t);return n===void 0&&(n=tt(e,t),r.set(t,n)),n}function Or(e,t,r,n,a){let i;if(r.indexOf(".")!==-1){let s=r,l=!0;if(n.lookForDataContainers&&$(n.dataContainerIdentifierTails)&&n.dataContainerIdentifierTails.length&&!s.endsWith(n.dataContainerIdentifierTails)){let o=C.default.get(e,s+n.dataContainerIdentifierTails),u=D(o)?C.default.get(o,t):void 0;u&&(i=u,l=!1)}for(;l&&s.indexOf(".")!==-1;){if(s=Oe(s),Te(s)===t)throw new Error('json-variables/findValues(): [THROW_ID_01] While trying to resolve: "'.concat(t,'" at path "').concat(r,'", we encountered a closed loop. The parent key "').concat(Te(s),'" is called the same as the variable "').concat(t,"\" we're looking for."));if(n.lookForDataContainers&&$(n.dataContainerIdentifierTails)&&n.dataContainerIdentifierTails.length&&!s.endsWith(n.dataContainerIdentifierTails)){let o=C.default.get(e,s+n.dataContainerIdentifierTails),u=D(o)?C.default.get(o,t):void 0;u&&(i=u,l=!1)}if(i===void 0){let o=C.default.get(e,s),u=D(o)?C.default.get(o,t):void 0;u&&(i=u,l=!1)}}}if(i===void 0){let s=C.default.get(e,t);s!==void 0&&(i=s)}if(i===void 0)if(t.indexOf(".")===-1){let s=yt(e,t,a);if(s.length){for(let l=0,o=s.length;l<o;l++)if($(s[l].val)||ne(s[l].val)||z(s[l].val)){i=s[l].val;break}else if(M(s[l].val)){i=s[l].val;break}else if(Array.isArray(s[l].val)){i=s[l].val.join("");break}}}else{let s=yt(e,ct(t),a);if(s.length)for(let l=0,o=s.length;l<o;l++){let u=C.default.get(s[l].val,ht(t));u&&$(u)&&(i=u)}}return i}function bt(e,t,r,n,a,i=[]){if(i.includes(r)){let y="";if(i.length>1){let _=" \u2192\n";y=i.reduce((g,m,w)=>g+(w===0?"":_)+(m===r?"\u{1F4A5} ":" ")+m," Here's the path we travelled up until we hit the recursion:\n\n"),y+="".concat(_,"\u{1F4A5} ").concat(r)}throw new Error('json-variables/resolveString(): [THROW_ID_02] While trying to resolve: "'.concat(t,'" at path "').concat(r,'", we encountered a closed loop, the key is referencing itself."').concat(y))}let s={},l=Array.from(i);l.push(r);let o=new G,u;function f(y,_,g){for(let m=0,w=y.length;m<w;m++){let A=y[m],T=t.slice(A.headsEndAt,A.tailsStartAt);if(T.length===0)o.push(A.headsStartAt,A.tailsEndAt);else if(Tr.call(s,T)&&$(s[T]))o.push(A.headsStartAt,A.tailsEndAt,s[T]);else{if(u=Or(e,T.trim(),r,n,a),u===void 0)if(n.allowUnresolved===!0)u="";else if($(n.allowUnresolved))u=n.allowUnresolved;else throw new Error("json-variables/processHeadsAndTails(): [THROW_ID_03] We couldn't find the value to resolve the variable ".concat(t.slice(A.headsEndAt,A.tailsStartAt),". We're at path: \"").concat(r,'".'));if(!g&&n.throwWhenNonStringInsertedInString&&!$(u))throw new Error("json-variables/processHeadsAndTails(): [THROW_ID_04] While resolving the variable ".concat(t.slice(A.headsEndAt,A.tailsStartAt)," at path ").concat(r,", it resolved into a non-string value, ").concat(v(u,4),'. This is happening because options setting "throwWhenNonStringInsertedInString" is active (set to "true").'));if(ne(u)){if(n.resolveToBoolIfAnyValuesContainBool)return o.wipe(),n.resolveToFalseIfAnyValuesContainBool?!1:u;u=""}else{if(z(u)&&g)return o.wipe(),u;Array.isArray(u)?u=String(u.join("")):z(u)?u="":(!M(u)||!g)&&(u=String(u))}let O=r.includes(".")?"".concat(Oe(r),".").concat(T):T;if(ue(u,n)){let E=We(bt(e,u,O,n,a,l),n,_,l,O,T.trim());E!==!1&&o.push(A.headsStartAt,A.tailsEndAt,E)}else{s[T]=u;let E=We(u,n,_,l,O,T.trim());E!==!1&&o.push(A.headsStartAt,A.tailsEndAt,E)}}}}let h;try{h=Ae(t,n.heads,n.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(y){throw new Error('json-variables/resolveString(): [THROW_ID_05] While trying to resolve string: "'.concat(t,'" at path ').concat(r,", something wrong with heads and tails was detected! Here's the internal error message:\n").concat(y))}let d=!1;h.length===1&&L(t,[[h[0].headsStartAt,h[0].tailsEndAt]]).trim()===""&&(d=!0);let b=f(h,!1,d);if(typeof b=="boolean"||b===null)return b;try{h=Ae(t,n.headsNoWrap,n.tailsNoWrap,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(y){throw new Error('json-variables/resolveString(): [THROW_ID_06] While trying to resolve string: "'.concat(t,'" at path ').concat(r,", something wrong with no-wrap heads and no-wrap tails was detected! Here's the internal error message:\n").concat(y))}h.length===1&&L(t,[[h[0].headsStartAt,h[0].tailsEndAt]]).trim()===""&&(d=!0);let c=f(h,!0,d);if(ne(c)||z(c))return c;let p=o.current();if(p){if(d){if(typeof u=="number")return u;if((p==null?void 0:p.length)===1&&p[0].length===3&&M(p[0][2]))return p[0][2]}return L(t,p)}return t}function Wr(e,t){if(!arguments.length)throw new Error("json-variables/jVar(): [THROW_ID_07] Alas! Inputs are missing!");if(!D(e))throw new TypeError("json-variables/jVar(): [THROW_ID_08] Alas! The input must be a plain object! Currently it's: ".concat(Array.isArray(e)?"array":typeof e));if(t&&!D(t))throw new TypeError("json-variables/jVar(): [THROW_ID_09] Alas! An Optional Options Object must be a plain object! Currently it's: ".concat(Array.isArray(t)?"array":typeof t));let r=W(W({},mt),t);r.dontWrapVars?Array.isArray(r.dontWrapVars)||(r.dontWrapVars=S(r.dontWrapVars)):r.dontWrapVars=[];let n,a;if(r.dontWrapVars.length&&!r.dontWrapVars.every((o,u)=>$(o)?!0:(n=o,a=u,!1)))throw new Error('json-variables/jVar(): [THROW_ID_10] Alas! All variable names set in resolvedOpts.dontWrapVars should be of a string type. Computer detected a value "'.concat(n,'" at index ').concat(a,", which is not string but ").concat(Array.isArray(n)?"array":typeof n,"!"));if(r.heads==="")throw new Error("json-variables/jVar(): [THROW_ID_11] Alas! resolvedOpts.heads are empty!");if(r.tails==="")throw new Error("json-variables/jVar(): [THROW_ID_12] Alas! resolvedOpts.tails are empty!");if(r.lookForDataContainers&&r.dataContainerIdentifierTails==="")throw new Error("json-variables/jVar(): [THROW_ID_13] Alas! resolvedOpts.dataContainerIdentifierTails is empty!");if(r.heads===r.tails)throw new Error("json-variables/jVar(): [THROW_ID_14] Alas! resolvedOpts.heads and resolvedOpts.tails can't be equal!");if(r.heads===r.headsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_15] Alas! resolvedOpts.heads and resolvedOpts.headsNoWrap can't be equal!");if(r.tails===r.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_16] Alas! resolvedOpts.tails and resolvedOpts.tailsNoWrap can't be equal!");if(r.headsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_17] Alas! resolvedOpts.headsNoWrap is an empty string!");if(r.tailsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_18] Alas! resolvedOpts.tailsNoWrap is an empty string!");if(r.headsNoWrap===r.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_19] Alas! resolvedOpts.headsNoWrap and resolvedOpts.tailsNoWrap can't be equal!");let i,s=new Map;return Y(e,(o,u,f)=>{if(f.parentType==="object"&&typeof o=="string"&&ue(o,r))throw new Error("json-variables/jVar(): [THROW_ID_20] Alas! Object keys can't contain variables!\nPlease check the following key: ".concat(o));if(f.parentType==="object"?i=u:i=o,i==="")return i;if($(i)&&(r.heads.length&&I(i)===I(r.heads)||r.tails.length&&I(i)===I(r.tails)||r.headsNoWrap.length&&I(i)===I(r.headsNoWrap)||r.tailsNoWrap.length&&I(i)===I(r.tailsNoWrap))){if(!r.noSingleMarkers)return i;throw new Error("json-variables/jVar(): [THROW_ID_21] Alas! While processing the input, we stumbled upon ".concat(I(i)," which is equal to ").concat(I(i)===I(r.heads)?"heads":"").concat(I(i)===I(r.tails)?"tails":"").concat($(r.headsNoWrap)&&I(i)===I(r.headsNoWrap)?"headsNoWrap":"").concat($(r.tailsNoWrap)&&I(i)===I(r.tailsNoWrap)?"tailsNoWrap":"",'. If you wouldn\'t have set resolvedOpts.noSingleMarkers to "true" this error would not happen and computer would have left the current element (').concat(I(i),") alone"))}return $(i)&&ue(i,r)?bt(e,i,f.path,r,s):i})}return St(Er);})();
10
+ "use strict";var jsonVariables=(()=>{var vt=Object.create;var q=Object.defineProperty,wt=Object.defineProperties,$t=Object.getOwnPropertyDescriptor,At=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertyNames,Ee=Object.getOwnPropertySymbols,Ot=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty,Wt=Object.prototype.propertyIsEnumerable;var fe=(e,t,r)=>t in e?q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,W=(e,t)=>{for(var r in t||(t={}))De.call(t,r)&&fe(e,r,t[r]);if(Ee)for(var r of Ee(t))Wt.call(t,r)&&fe(e,r,t[r]);return e},Ie=(e,t)=>wt(e,At(t));var Et=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Dt=(e,t)=>{for(var r in t)q(e,r,{get:t[r],enumerable:!0})},Se=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Tt(t))!De.call(e,a)&&a!==r&&q(e,a,{get:()=>t[a],enumerable:!(n=$t(t,a))||n.enumerable});return e};var It=(e,t,r)=>(r=e!=null?vt(Ot(e)):{},Se(t||!e||!e.__esModule?q(r,"default",{value:e,enumerable:!0}):r,e)),St=e=>Se(q({},"__esModule",{value:!0}),e);var x=(e,t,r)=>fe(e,typeof t!="symbol"?t+"":t,r);var nt=Et((rt,se)=>{(function(e,t){"use strict";typeof se=="object"&&typeof se.exports=="object"?se.exports=t():typeof define=="function"&&define.amd?define([],t):e.objectPath=t()})(rt,function(){"use strict";var e=Object.prototype.toString;function t(f,h){return f==null?!1:Object.prototype.hasOwnProperty.call(f,h)}function r(f){if(!f||i(f)&&f.length===0)return!0;if(typeof f!="string"){for(var h in f)if(t(f,h))return!1;return!0}return!1}function n(f){return e.call(f)}function a(f){return typeof f=="object"&&n(f)==="[object Object]"}var i=Array.isArray||function(f){return e.call(f)==="[object Array]"};function s(f){return typeof f=="boolean"||n(f)==="[object Boolean]"}function l(f){var h=parseInt(f);return h.toString()===f?h:f}function o(f){f=f||{};var h=function(y){return Object.keys(h).reduce(function(_,g){return g==="create"||typeof h[g]=="function"&&(_[g]=h[g].bind(h,y)),_},{})},d;f.includeInheritedProps?d=function(){return!0}:d=function(y,_){return typeof _=="number"&&Array.isArray(y)||t(y,_)};function b(y,_){if(d(y,_))return y[_]}var c;f.includeInheritedProps?c=function(y,_){typeof _!="string"&&typeof _!="number"&&(_=String(_));var g=b(y,_);if(_==="__proto__"||_==="prototype"||_==="constructor"&&typeof g=="function")throw new Error("For security reasons, object's magic properties cannot be set");return g}:c=function(y,_){return b(y,_)};function p(y,_,g,m){if(typeof _=="number"&&(_=[_]),!_||_.length===0)return y;if(typeof _=="string")return p(y,_.split(".").map(l),g,m);var w=_[0],A=c(y,w);return _.length===1?((A===void 0||!m)&&(y[w]=g),A):(A===void 0&&(typeof _[1]=="number"?y[w]=[]:y[w]={}),p(y[w],_.slice(1),g,m))}return h.has=function(y,_){if(typeof _=="number"?_=[_]:typeof _=="string"&&(_=_.split(".")),!_||_.length===0)return!!y;for(var g=0;g<_.length;g++){var m=l(_[g]);if(typeof m=="number"&&i(y)&&m<y.length||(f.includeInheritedProps?m in Object(y):t(y,m)))y=y[m];else return!1}return!0},h.ensureExists=function(y,_,g){return p(y,_,g,!0)},h.set=function(y,_,g,m){return p(y,_,g,m)},h.insert=function(y,_,g,m){var w=h.get(y,_);m=~~m,i(w)||(w=[],h.set(y,_,w)),w.splice(m,0,g)},h.empty=function(y,_){if(!r(_)&&y!=null){var g,m;if(g=h.get(y,_)){if(typeof g=="string")return h.set(y,_,"");if(s(g))return h.set(y,_,!1);if(typeof g=="number")return h.set(y,_,0);if(i(g))g.length=0;else if(a(g))for(m in g)d(g,m)&&delete g[m];else return h.set(y,_,null)}}},h.push=function(y,_){var g=h.get(y,_);i(g)||(g=[],h.set(y,_,g)),g.push.apply(g,Array.prototype.slice.call(arguments,2))},h.coalesce=function(y,_,g){for(var m,w=0,A=_.length;w<A;w++)if((m=h.get(y,_[w]))!==void 0)return m;return g},h.get=function(y,_,g){if(typeof _=="number"&&(_=[_]),!_||_.length===0)return y;if(y==null)return g;if(typeof _=="string")return h.get(y,_.split("."),g);var m=l(_[0]),w=c(y,m);return w===void 0?g:_.length===1?w:h.get(y[m],_.slice(1),g)},h.del=function(_,g){if(typeof g=="number"&&(g=[g]),_==null||r(g))return _;if(typeof g=="string")return h.del(_,g.split("."));var m=l(g[0]);if(c(_,m),!d(_,m))return _;if(g.length===1)i(_)?_.splice(m,1):delete _[m];else return h.del(_[m],g.slice(1));return _},h}var u=o();return u.create=o,u.withInheritedProps=o({includeInheritedProps:!0}),u})});var Er={};Dt(Er,{defaults:()=>mt,jVar:()=>Wr,version:()=>Ar});function S(e){return typeof e!="string"?e:e.length?[e]:[]}var Ve=Symbol.for("ast-monkey-traverse.delete"),Vt=Object.prototype.hasOwnProperty;function j(e){throw new TypeError("ast-monkey-traverse/traverse(): [THROW_ID_02] The first argument must be an acyclic, unaliased tree of arrays, plain objects, and supported primitive values; ".concat(e,"."))}function Rt(e,t){let r=Number(e);return Number.isInteger(r)&&r>=0&&r<t&&"".concat(r)===e}function Re(e){return Array.isArray(e)?new Array(e.length):{}}function ce(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function he(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function xe(e,t=!1){if(he(e))return e;typeof e!="object"&&j("encountered an unsupported ".concat(typeof e," value"));let r=e,n=Re(r),a=[{source:r,target:n}],i=new WeakSet([r]);for(;a.length;){let s=a.pop(),{source:l,target:o}=s,u=Array.isArray(l);Object.getPrototypeOf(l)!==(u?Array.prototype:Object.prototype)&&j(u?"encountered an array with a custom prototype":"encountered a non-plain or custom-prototype object");for(let f of Reflect.ownKeys(l)){if(u&&f==="length")continue;typeof f!="string"&&j(u?"encountered a symbol-keyed array property":"encountered a symbol-keyed object property"),u&&!Rt(f,l.length)&&j("encountered the non-index array property ".concat(JSON.stringify(f)));let h=Object.getOwnPropertyDescriptor(l,f);h.enumerable||j(u?"encountered a non-enumerable array index ".concat(f):"encountered a non-enumerable property ".concat(JSON.stringify(f))),!("value"in h)&&!t&&j(u?"encountered an accessor array index ".concat(f):"encountered an accessor property ".concat(JSON.stringify(f)));let d="value"in h?h.value:l[f];if(he(d))ce(o,f,d);else if(typeof d=="object"){i.has(d)&&j("encountered a cycle or repeated object reference"),i.add(d);let b=Re(d);ce(o,f,b),a.push({source:d,target:b})}else j("encountered an unsupported ".concat(typeof d," value"))}}return n}var N=Symbol("deleted snapshot entry");function _e(e){let t=W({array:Array.isArray(e),entries:new Map},Array.isArray(e)?{lengths:[{value:e.length,version:0}]}:{}),r=[{source:e,target:t}];for(;r.length;){let n=r.pop(),{source:a,target:i}=n;for(let s of Object.keys(a)){let l=a[s];if(typeof l=="object"&&l!==null){let o=W({array:Array.isArray(l),entries:new Map},Array.isArray(l)?{lengths:[{value:l.length,version:0}]}:{});i.entries.set(s,[{value:o,version:0}]),r.push({source:l,target:o})}else i.entries.set(s,[{value:l,version:0}])}}return t}function Ne(e,t){let r=0,n=e.length-1;for(;r<n;){let a=Math.ceil((r+n)/2);e[a].version<=t?r=a:n=a-1}return e[r]}function U(e,t,r){let n=e.entries.get(t);return n?Ne(n,r).value:N}function ge(e,t){return Ne(e.lengths,t).value}function Z(e,t,r,n){let a=e.entries.get(t);a?a.push({value:r,version:n}):e.entries.set(t,[{value:N,version:n-1},{value:r,version:n}])}function xt(e,t,r){let n=r-1,a=ge(e,n);for(let i=t;i<a-1;i+=1)Z(e,"".concat(i),U(e,"".concat(i+1),n),r);a&&Z(e,"".concat(a-1),N,r),e.lengths.push({value:Math.max(0,a-1),version:r})}function je(e,t){let r=new WeakMap;function n(a){let i=r.get(a);if(i)return i;let s=a.array?new Array(ge(a,t)):{},l={defineProperty:()=>!0,deleteProperty:()=>!0,get:(u,f,h)=>{if(a.array&&f==="length")return ge(a,t);if(typeof f=="string"){let d=U(a,f,t);if(d!==N)return typeof d=="object"&&d!==null?n(d):d}return Reflect.get(u,f,h)},getOwnPropertyDescriptor:(u,f)=>{if(a.array&&f==="length")return Reflect.getOwnPropertyDescriptor(u,f);if(typeof f=="string"){let h=U(a,f,t);return h===N?void 0:{configurable:!0,enumerable:!0,value:typeof h=="object"&&h!==null?n(h):h,writable:!0}}},has:(u,f)=>typeof f=="string"&&U(a,f,t)!==N||Reflect.has(u,f),ownKeys:()=>{let u=[...a.entries].filter(([f])=>U(a,f,t)!==N).map(([f])=>f);return a.array?[...u,"length"]:u},set:()=>!0,setPrototypeOf:()=>!0},o=new Proxy(s,l);return r.set(a,o),o}return n(e)}function Ce(e){let t=[],r=e;for(;r;)t.push(r.segment),r=r.parent;return t.reverse()}function jt(e){let t="";for(let r of e)t=t?"".concat(t,".").concat(r):r;return t}function Y(e,t){if(typeof t!="function")throw new TypeError("ast-monkey-traverse/traverse(): [THROW_ID_01] The second argument must be a callback function. It was ".concat(typeof t,"."));let r=xe(e);if(typeof r!="object"||r===null)return r;let n=0,a={now:!1},i=[{container:r,depth:0,index:0,keys:Array.isArray(r)?[]:Object.keys(r),parentKey:null}];for(;i.length&&!a.now;){let s=i[i.length-1],l=Array.isArray(s.container)?s.container:void 0,o=!!l,u;if(l){if(s.index>=l.length){i.pop();continue}if(!Vt.call(l,s.index)){s.index+=1;continue}u="".concat(s.index)}else{if(s.index>=s.keys.length){i.pop();continue}u=s.keys[s.index]}let f=s.container[u],h={parent:s.pathNode,segment:u},d=s.depth===0&&!o?u:s.topmostKey,b,c=n,p,y,_;if(s.depth<100)p=s.path?"".concat(s.path,".").concat(u):u,y=s.pathSegments?[...s.pathSegments,u]:[u],_=W({depth:s.depth,path:p,pathSegments:y,get parent(){return s.snapshot||(s.snapshot=_e(s.container)),b||(b=je(s.snapshot,c)),b},parentType:o?"array":"object",parentKey:s.parentKey},d===void 0?{}:{topmostKey:d});else{let E,V;_=W({depth:s.depth,get path(){return E||(E=Ce(h)),V!=null||(V=jt(E)),V},get pathSegments(){return E||(E=Ce(h)),E},get parent(){return s.snapshot||(s.snapshot=_e(s.container)),b||(b=je(s.snapshot,c)),b},parentType:o?"array":"object",parentKey:s.parentKey},d===void 0?{}:{topmostKey:d})}let g=t(o?f:u,o?void 0:f,_,a),m=g===Ve,w=typeof g=="object"&&g!==null,A=w&&typeof f=="object"&&f!==null&&g===f&&!!s.snapshot,T=g===Ve?f:g,O;!m&&!w&&!he(g)&&j("encountered an unsupported ".concat(typeof g," value")),!m&&w&&(g!==f||A)&&(T=xe(g,!0),s.snapshot&&(O=_e(T))),m?l?(l.splice(s.index,1),n+=1,s.snapshot&&xt(s.snapshot,s.index,n)):(delete s.container[u],n+=1,s.snapshot&&Z(s.snapshot,u,N,n),s.index+=1):((!Object.is(T,f)||A)&&(ce(s.container,u,T),n+=1,s.snapshot&&Z(s.snapshot,u,O===void 0?T:O,n)),s.index+=1,!a.now&&typeof T=="object"&&T!==null&&i.push(W(W(W(Ie(W({container:T,depth:s.depth+1,index:0,keys:Array.isArray(T)?[]:Object.keys(T),parentKey:u},p===void 0?{}:{path:p}),{pathNode:h}),y===void 0?{}:{pathSegments:y}),O?{snapshot:O}:{}),d===void 0?{}:{topmostKey:d})))}return r}function Ct(){let e=[],t=0,r=!1;return{append(n){return r?!1:t+n.length>1999?(e.push("\u2026"),t+=1,r=!0,!1):(e.push(n),t+=n.length,!0)},result(){return e.join("")},stopped(){return r}}}function Nt(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function X(e,t){if(e.append('"')){for(let r=0;r<t.length&&!e.stopped();r+=1){let n=t.charCodeAt(r);n===34?e.append('\\"'):n===92?e.append("\\\\"):n===8?e.append("\\b"):n===9?e.append("\\t"):n===10?e.append("\\n"):n===12?e.append("\\f"):n===13?e.append("\\r"):n<32||n===8232||n===8233||n>=55296&&n<=57343?e.append(Nt(n)):e.append(t[r])}e.append('"')}}function Ht(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function ke(e,t){e.append("Symbol(");let r=String(t);r.length>8&&X(e,r.slice(7,-1)),e.append(")")}function He(e,t){typeof t=="symbol"?ke(e,t):X(e,String(t))}function v(e,t=0){let r=Ct(),n=t===4?4:0,a=new WeakSet,i=0;function s(c){n&&r.append(" ".repeat(c*n))}function l(c,p){c&&r.append(","),n&&(r.append("\n"),s(p+1))}function o(c,p,y){n&&p&&(r.append("\n"),s(y)),r.append(c)}function u(c,p){Object.prototype.hasOwnProperty.call(c,"value")?b(c.value,p):r.append(Ht(c))}function f(c,p){let y;try{y=Reflect.getOwnPropertyDescriptor(c,"length")}catch(m){r.append("[Uninspectable]");return}let _=y==null?void 0:y.value;if(!Number.isSafeInteger(_)||_<0){r.append("[Uninspectable]");return}r.append("[");let g=!1;for(let m=0;m<_&&!r.stopped();m+=1){if(l(g,p),g=!0,i>=50){r.append("[MaxEntries]");break}i+=1;let w;try{w=Reflect.getOwnPropertyDescriptor(c,String(m))}catch(A){r.append("[Uninspectable]");continue}w!=null&&w.enumerable?u(w,p+1):r.append("[Empty]")}o("]",g,p)}function h(c,p){let y;try{y=Reflect.ownKeys(c)}catch(g){r.append("[Uninspectable]");return}r.append("{");let _=!1;for(let g of y){if(r.stopped())break;if(i>=50){l(_,p),_=!0,X(r,"\u2026"),r.append(n?": ":":"),r.append("[MaxEntries]");break}i+=1;let m;try{m=Reflect.getOwnPropertyDescriptor(c,g)}catch(w){l(_,p),_=!0,He(r,g),r.append(n?": ":":"),r.append("[Uninspectable]");continue}m!=null&&m.enumerable&&(l(_,p),_=!0,He(r,g),r.append(n?": ":":"),u(m,p+1))}o("}",_,p)}function d(c,p){if(a.has(c)){r.append("[Circular]");return}if(p>=5){r.append("[MaxDepth]");return}let y;try{y=Array.isArray(c)}catch(_){r.append("[Uninspectable]");return}a.add(c);try{y?f(c,p):h(c,p)}finally{a.delete(c)}}function b(c,p){c===null?r.append("null"):typeof c=="string"?X(r,c):typeof c=="number"?r.append(Object.is(c,-0)?"-0":String(c)):typeof c=="boolean"?r.append(c?"true":"false"):typeof c>"u"?r.append("undefined"):typeof c=="bigint"?r.append("".concat(c,"n")):typeof c=="symbol"?ke(r,c):typeof c=="function"?r.append("[Function]"):d(c,p)}try{return b(e,0),r.result()}catch(c){return"[Uninspectable]"}}var kt=["_16_0_a_0_4_0_5_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_8_4l_1_11_2_0_","6_14_1z_q_4_3_19_16_z_1_1_2q_1_0_f_1_7_1_a_2_2_0_g_0_1_t_t_2g_b_0_o_w_9_1_4_0_5_l_4_0_9_0_3_0_n_o_7_","a_5_n_1_6_g_15_1m_1h_3_0_i_0_7_9_f_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_e_1_a_0_8_5_4_1_2_l_1_6","_1_1_1_1_1_1_v_3_1_0_j_2_g_8_1_2_1_l_1_6_1_1_1_4_3_0_i_0_f_1_n_0_b_7_2_1_2_l_1_6_1_1_1_4_3_0_u_1_1_2","_f_0_h_0_1_5_3_2_1_3_3_1_1_0_1_1_3_1_3_2_3_b_m_0_1g_7_1_2_1_m_1_f_3_0_q_2_1_1_2_1_u_0_4_7_1_2_1_m_1_","9_1_4_3_0_u_2_1_1_f_1_h_8_1_2_1_14_2_0_g_0_5_2_8_2_o_5_5_h_3_n_1_8_1_0_2_6_1m_1b_1_1_c_6_1m_1_1_0_1_","4_1_n_1_0_1_9_1_1_9_0_2_4_1_0_l_3_w_0_1r_7_1_z_r_4_37_16_k_0_g_5_4_3_3_0_3_1_7_2_4_c_c_0_h_11_1_0_5_","0_2_16_1_98_1_3_2_6_1_0_1_3_2_14_1_3_2_w_1_3_2_6_1_0_1_3_2_e_1_1k_1_3_2_1u_11_f_g_2d_2_5_3_h7_2_g_1_","p_5_22_6_7_7_h_d_i_e_h_e_c_1_2_f_1f_z_0_4_0_1v_2g_7_4_2_x_1_0_5_1x_a_u_1d_t_2_4_b_17_4_p_1i_m_9_1g_2","a_0_2l_1a_h_7_1i_t_d_1_a_17_q_z_15_2_a_z_2_a_5_16_2_2_15_3_1_5_1_1_3_0_5_5b_1s_7p_2_5_2_11_2_5_2_7_1","_0_1_0_1_0_1_u_2_1g_1_6_1_0_3_2_1_6_3_3_2_5_4_c_5_2_1_6_38_0_d_0_g_c_2t_0_4_0_2_9_1_0_3_4_6_0_1_0_1_","0_1_3_1_a_2_3_5_4_4_0_1g_1_22j_6c_6_3_3_1_c_11_1_0_5_0_2_1j_7_0_g_m_9_6_1_6_1_6_1_6_1_6_1_6_1_6_1_6_","28_0_d1_1_16_4_5_1_4_2d_6_2_1_2h_1_3_5_16_1_2l_h_v_1c_f_e8_533_1s_h3g_1v_19_2_7g_3_f_a_1_k_1a_g_u_2_","1x_1d_8_2_2u_2_29_k_g_1_2_1_3_1_m_t_1f_e_1d_1q_5_3_0_1_1_b_r_a_m_p_s_7_1a_s_0_g_4_1_9_a_4_1_14_n_2_1","_7_k_m_3_0_3_1d_1_0_3_1_2_4_2_0_1_0_o_2_2_a_7_2_c_5_2_5_2_5_9_6_1_6_1_16_1_d_6_36_t_8mb_c_m_4_1c_6is","_a5_2_2x_12_6_c_4_5_0_1_9_1_c_1_4_1_0_1_1_1_1_1_2z_x_a2_i_1r_2_1h_14_b_38_4_1_3q_10_p_6_p_b_2g_3_5_2","_5_2_5_2_2_z_b_1_p_1_i_1_1_1_e_2_d_y_3e_at_s_3_1c_1b_v_d_j_1_7_6_11_a_t_2_z_4_7_1c_4d_i_z_4_z_4_13_8","_1f_c_a_1_e_1_6_1_1_1_a_1_e_1_6_1_1_3_1f_c_8m_9_l_a_7_o_5_1_15_1_8_1x_5_2_0_1_17_1_1_3_0_2_m_a_m_9_u","_1t_i_1_1_a_l_a_p_6_p_12_1j_6_1_1s_0_f_3_1_2_1_s_16_s_3_s_z_7_1_r_r_1h_a_l_a_i_d_h_32_20_1j_1e_d_1e_","d_z_12_r_9_m_6y_15_6_1_g_5_1k_s_a_0_8_l_16_h_1a_k_r_m_c_1g_1l_1_2_0_d_18_w_o_q_z_t_0_2_0_8_y_3_0_c_1","b_e_3_l_0_1_0_z_h_1_o_j_1_1r_6_1_0_1_3_1_e_1_9_7_1a_12_7_2_1_2_l_1_6_1_1_1_4_3_0_i_0_c_4_u_9_1_0_2_0","_1_11_1_0_p_0_1_0_18_1g_i_3_k_2_u_1b_k_1_1_0_54_1a_15_3_10_1b_k_0_1n_16_d_0_1z_q_11_6_55_17_38_1r_v_","7_2_0_2_7_1_1_1_n_f_0_1_0_2m_7_2_12_g_0_1_0_s_0_a_13_7_0_l_0_b_19_j_0_i_20_5j_w_v_8_1_10_h_0_1d_t_34","_6_1_1_1_11_l_0_p_5_1_1_1_v_e_0_n_17_78_i_f_0_1_c_1_x_3g_0_27_pl_6e_5f_218_2o_f_tr_h_5_p_32y_5_g6_5a","1_t_1cy_fs_7_u_h_26_h_t_i_1b_g_3_v_k_5_i_c0_18_5v_1r_w_o_2_o_18_22_5_0_1u_c_1s_1_1_0_e_1_c_5p1_15_v_","2p_36_6pp_3_1_6_1_1_1_82_f_0_t_2_2_0_e_3_8_az_1s4_2y_5_c_3_8_7_9_4me_2c_1_1y_1_1_2_0_2_1_2_3_1_b_1_0","_1_6_1_1s_1_3_2_7_1_6_1_r_1_3_1_4_1_0_3_6_1_9f_2_o_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_7_1f8_u_6_5","_79_1p_42_18_a_6_g_0_8x_t_i_17_dg_r_6c_t_2_0_5r_u_1_2_1_1_1_6_2_4_9_1_68_6_1_3_1_1_1_e_1_5g_1n_1v_7_","0_xg_3_1_q_1_1_1_0_2_0_1_9_1_3_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1","_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4_1_g_3es_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),pe=kt.slice(1).split("_"),Mt=[],Me=127;for(let e=0;e<pe.length;e+=2){let t=Me+1+Number.parseInt(pe[e],36),r=t+Number.parseInt(pe[e+1],36);Mt.push([t,r]),Me=r}var jr=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),Pt=Object.prototype.hasOwnProperty,qe=Function.prototype.toString,Bt=qe.call(Object),Ft=class{constructor(){x(this,"hasRepeatedReferences",!1);x(this,"clones",[]);x(this,"index");x(this,"sources",[])}get(e){if(this.index){let r=this.index.get(e);return r!==void 0&&(this.hasRepeatedReferences=!0),r}let t=this.sources.indexOf(e);if(t!==-1)return this.hasRepeatedReferences=!0,this.clones[t]}set(e,t){if(this.index){this.index.set(e,t);return}if(this.sources.push(e),this.clones.push(t),this.sources.length===32){this.index=new WeakMap;for(let r=0;r<this.sources.length;r++)this.index.set(this.sources[r],this.clones[r]);this.sources=[],this.clones=[]}}};function Ue(e,t){let r=t.get(e);if(r!==void 0)return r;let n=e.slice(0);return t.set(e,n),n}function Lt(e,t){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let i=Buffer.from(e);return t.set(e,i),i}let r=Ue(e.buffer,t);if(e instanceof DataView||Object.prototype.toString.call(e)==="[object DataView]"){let i=new DataView(r,e.byteOffset,e.byteLength);return t.set(e,i),i}let n=e.constructor,a=new n(r,e.byteOffset,e.length);return t.set(e,a),a}function Jt(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0})}function ee(e,t,r,n){for(let a of r){let i=t[a],s=typeof i!="object"||i===null?i:k(i,n);a==="__proto__"?Jt(e,a,s):e[a]=s}}function P(e,t,r,n){for(let a of r){let i=Object.getOwnPropertyDescriptor(t,a);if(i){if("value"in i){let s=i.value;i.value=typeof s!="object"||s===null?s:k(s,n)}Object.defineProperty(e,a,i)}}}var qt=Map.prototype.entries,Ut=Set.prototype.values,be=Object.prototype.toString,Be,Kt=(Be=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:Be.get,Fe,zt=(Fe=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:Fe.get,Le,Cr=(Le=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:Le.get,Je,Ke=(Je=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:Je.get,Nr=RegExp.prototype.test,de;function Gt(e){if(e instanceof ArrayBuffer)return!0;try{return Kt.call(e),!0}catch(t){return!1}}function Qt(e){try{return qt.call(e)}catch(t){return null}}function Zt(e){try{return Ut.call(e)}catch(t){return null}}function Yt(e){var t;try{return de||(de=(t=Object.getOwnPropertyDescriptor(URL.prototype,"href"))==null?void 0:t.get),de.call(e)}catch(r){return null}}function k(e,t){if(typeof e!="object"||e===null)return e;let r=t.get(e);if(r!==void 0)return r;if(Array.isArray(e)){let o=e.length,u=new Array(o);t.set(e,u);let f=e,h=Object.keys(e);if(h.length===o&&(o===0||h[o-1]==="".concat(o-1)))for(let d=0;d<o;d++){let b=f[d];u[d]=typeof b!="object"||b===null?b:k(b,t)}else ee(u,f,h,t);return u}let n=Object.getPrototypeOf(e);if(n===Object.prototype){let o={};return t.set(e,o),ee(o,e,Object.keys(e),t),o}if(n===null){let o=Object.create(null);return t.set(e,o),ee(o,e,Object.keys(e),t),o}if(er(e)){let o=new Date(ze.call(e));return t.set(e,o),P(o,e,Object.keys(e),t),o}if(ArrayBuffer.isView(e))return Lt(e,t);if(Gt(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return Ue(e,t);let a=Qt(e);if(a){let o=new Map;t.set(e,o);for(let[u,f]of a)o.set(k(u,t),k(f,t));return P(o,e,Object.keys(e),t),o}let i=Zt(e);if(i){let o=new Set;t.set(e,o);for(let u of i)o.add(k(u,t));return P(o,e,Object.keys(e),t),o}if(Xt(e)&&e!==RegExp.prototype){let o=new RegExp(Ke.call(e),zt.call(e));return o.lastIndex=e.lastIndex,t.set(e,o),P(o,e,Object.keys(e),t),o}let s=Yt(e);if(s!==null){let o=new URL(s);return t.set(e,o),P(o,e,Object.keys(e),t),o}if(e instanceof Error||be.call(e)==="[object Error]"){let o=Object.create(Object.getPrototypeOf(e));return t.set(e,o),P(o,e,Reflect.ownKeys(e),t),o}let l=Object.create(n);return t.set(e,l),ee(l,e,Object.keys(e),t),l}function ve(e){return k(e,new Ft)}function D(e){var n;if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let r=Object.getOwnPropertyDescriptor(t,"constructor");return!r||!("value"in r)||typeof r.value!="function"?!1:((n=Object.getOwnPropertyDescriptor(r.value,"prototype"))==null?void 0:n.value)===t&&qe.call(r.value)===Bt}function $(e){return typeof e=="string"}function M(e){return Number.isFinite(e)}function K(e){return Number.isSafeInteger(e)&&e>=0}function ne(e){return typeof e=="boolean"}function z(e){return e===null}function Xt(e){if(e===null||typeof e!="object")return!1;try{return e instanceof RegExp?(e.source,!0):be.call(e)!=="[object RegExp]"?!1:(Ke.call(e),!0)}catch(t){return!1}}var ze=Date.prototype.getTime;function er(e){if(e instanceof Date)return!0;if(e===null||typeof e!="object"||be.call(e)!=="[object Date]")return!1;try{return ze.call(e),!0}catch(t){return!1}}function B(e){return e!=null}function Ge(e,t){return e!=null&&Pt.call(e,t)}var tr=256,rr=1024,nr=1,ir=new Map,sr=new Map;function me(e){if(e>=97&&e<=122)return e-32;if(e>65535)return e;let t=String.fromCharCode(e).toUpperCase();if(t.length!==1)return e;let r=t.charCodeAt(0);return e>127&&r<128?e:r}function ye(e,t,r,n,a,i){for(let s=0;s<a;s++){let l=e.charCodeAt(t+s),o=r.charCodeAt(n+s);if(i||(l>=97&&l<=122&&(l-=32),o>=97&&o<=122&&(o-=32)),l!==o)return!1}return!0}function Qe(e,t,r){let n=t.indexOf("\\");if(n===-1&&e===t)return!0;let a=t.indexOf("*");if(n===-1&&a===-1){if(r)return!1;for(let f=0;f<t.length;f++)if(t.charCodeAt(f)>127)return;return e.length===t.length&&ye(e,0,t,0,t.length,!1)}if(n!==-1)return;let i=0,s=!1,l=-1;for(let f=0;f<t.length;f++){let h=t.charCodeAt(f);if(h>127)return;if(h===42){if(l=f,!s){if(i++,i>1)return;s=!0}}else s=!1}let o=l+1,u=t.length-o;return e.length<a+u?!1:ye(e,0,t,0,a,r)&&ye(e,e.length-u,t,o,u,r)}function ar(e){let t=new Uint32Array(e.length),r=0;for(let n=1;n<e.length;n++){for(;r>0&&e[n]!==e[r];)r=t[r-1];e[n]===e[r]&&r++,t[n]=r}return t}function or(e,t){let r=[[]],n=!0,a=!1,i=!1,s=0;for(let d=0;d<e.length;){let b=e.codePointAt(d);if(b!==92){if(b===42)a=!0,i||(r.push([]),i=!0);else{let m=t?b:me(b);r[r.length-1].push(m),n&&(n=m<=127),s++,i=!1}d+=b>65535?2:1;continue}let c=d+1;for(;e.charCodeAt(c)===92;)c++;let p=c-d,y=e.codePointAt(c),_,g=!1;y===42?(g=p%2===0,_=g?p/2:(p-1)/2):y===void 0||y===10||y===13||y===8232||y===8233?_=Math.ceil(p/2):_=Math.floor(p/2);for(let m=0;m<_;m++)r[r.length-1].push(92),s++;if(g){i=!1,d=c;continue}if(y!==void 0){let m=t?y:me(y);r[r.length-1].push(m),n&&(n=m<=127),s++,c+=y>65535?2:1}i=!1,d=c}let l=a&&r[0].length===0,o=a&&r[r.length-1].length===0,u=[];for(let d of r)d.length&&u.push({values:d});let f=l?0:1,h=u.length-(o?0:1);for(let d=f;d<h;d++)u[d].values.length>nr&&(u[d].failure=ar(u[d].values));return{asciiOnly:n,endsWithWildcard:o,hasWildcard:a,minimumInputLength:s,segments:u,startsWithWildcard:l}}function Ze(e,t){let r=t?ir:sr,n=e.length<=rr;if(n){let i=r.get(e);if(i)return i}let a=or(e,t);if(n){if(r.size>=tr){let i=r.keys().next().value;i!==void 0&&r.delete(i)}r.set(e,a)}return a}function Ye(e,t){if(t){let a=[];for(let i=0;i<e.length;){let s=e.codePointAt(i);a.push(s),i+=s>65535?2:1}return a}let r=new Uint32Array(e.length),n=0;for(let a=0;a<e.length;){let i=e.codePointAt(a);r[n]=me(i),n++,a+=i>65535?2:1}return n===r.length?r:r.subarray(0,n)}function te(e,t,r,n){for(let a=0;a<r.values.length;a++){let i=e.charCodeAt(t+a);if(!n&&i>=97&&i<=122&&(i-=32),i!==r.values[a])return!1}return!0}function lr(e,t,r,n,a){let i=n-t.values.length;if(i<r)return-1;if(!t.failure){for(let l=r;l<=i;l++)if(te(e,l,t,a))return l;return-1}let s=0;for(let l=r;l<n;l++){let o=e.charCodeAt(l);for(!a&&o>=97&&o<=122&&(o-=32);s>0&&o!==t.values[s];)s=t.failure[s-1];if(o===t.values[s]&&(s++,s===t.values.length))return l-s+1}return-1}function Xe(e,t,r){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&te(e,0,t.segments[0],r);let n=0,a=t.segments.length,i=0,s=e.length;if(!t.startsWithWildcard){let l=t.segments[0];if(!te(e,0,l,r))return!1;i=l.values.length,n++}if(!t.endsWithWildcard){a--;let l=t.segments[a];if(s-=l.values.length,!te(e,s,l,r))return!1}for(let l=n;l<a;l++){let o=t.segments[l],u=lr(e,o,i,s,r);if(u===-1)return!1;i=u+o.values.length}return!0}function re(e,t,r){for(let n=0;n<r.values.length;n++)if(e[t+n]!==r.values[n])return!1;return!0}function ur(e,t,r,n){let a=n-t.values.length;if(a<r)return-1;if(!t.failure){for(let s=r;s<=a;s++)if(re(e,s,t))return s;return-1}let i=0;for(let s=r;s<n;s++){for(;i>0&&e[s]!==t.values[i];)i=t.failure[i-1];if(e[s]===t.values[i]&&(i++,i===t.values.length))return s-i+1}return-1}function et(e,t){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&re(e,0,t.segments[0]);let r=0,n=t.segments.length,a=0,i=e.length;if(!t.startsWithWildcard){let s=t.segments[0];if(!re(e,0,s))return!1;a=s.values.length,r++}if(!t.endsWithWildcard){n--;let s=t.segments[n];if(i-=s.values.length,!re(e,i,s))return!1}for(let s=r;s<n;s++){let l=t.segments[s],o=ur(e,l,a,i);if(o===-1)return!1;a=o+l.values.length}return!0}function fr(e,t,r){let n=Qe(e,t,r);if(n!==void 0)return n;let a=Ze(t,r);return a.asciiOnly?Xe(e,a,r):et(Ye(e,r),a)}function Pe(e,t,r,n){var s;let a=Qe(e,t,r);if(a!==void 0)return a;let i=Ze(t,r);return i.asciiOnly?Xe(e,i,r):((s=n.tokens)!=null||(n.tokens=Ye(e,r)),et(n.tokens,i))}function ie(e,t,r){if(typeof t!="string"&&!t.length)return!1;let n=r===void 0?!1:r.caseSensitiveMatch===!0;if(typeof t=="string"){let l=t.charCodeAt(0)===33,o=l?t.slice(1):t,u=fr(e,o,n);return l?!u:u}let a={},i=!1,s=!1;for(let l of t){let o=l.charCodeAt(0)===33,u=o?l.slice(1):l;if(o){if(Pe(e,u,n,a))return!1}else i=!0,!s&&Pe(e,u,n,a)&&(s=!0)}return i?s:!0}function tt(e,t,r){let n;r!==void 0&&(n=Array.isArray(r)?ve(r):[ve(r)]);let a=[],i=Y(e,(s,l,o)=>{let u=o.parentType==="object"?l:s;if(o.parentType==="object"&&typeof s=="string"&&ie(s,t,{caseSensitiveMatch:!0})){if(n===void 0)a.push({val:l,path:o.path});else if(n.length)return n.shift()}return u});return n===void 0?a:i}var C=It(nt(),1);var it={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function _r(e,t){let r,n=0;for(;n<e.length;){let a=n+1;for(;a<e.length&&e[n][0]===e[a][0]&&e[n][1]===e[a][1];)a+=1;if(a-n>1){r||(r=new Map(t.map((l,o)=>[l,o])));let i=r,s=e.slice(n,a).sort((l,o)=>i.get(l)-i.get(o));e.splice(n,s.length,...s)}n=a}return e}function F(e,t){var l;if(!Array.isArray(e)||!e.length)return e;let r=t===void 0?!0:D(t);if(t!==void 0&&r&&(t==null?void 0:t.strictlyTwoElementsInRangeArrays)===!0)for(let o=0;o<e.length;o+=1){let u=e[o];if(!Array.isArray(u)||u.length!==2)throw new TypeError("ranges-sort/rSort(): [THROW_ID_01] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, range at index ".concat(o," (").concat(v(u,4),") is ").concat(Array.isArray(u)?"an array with ".concat(u.length," elements"):"not an array","!"));if(!Number.isInteger(u[0])||u[0]<0||!Number.isInteger(u[1])||u[1]<0)throw new TypeError("ranges-sort/rSort(): [THROW_ID_02] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, range at index ".concat(o," (").concat(v(u,4),") does not consist of only natural numbers!"))}else for(let o=0;o<e.length;o+=1){let u=e[o];if(!Array.isArray(u)||!Number.isInteger(u[0])||u[0]<0||!Number.isInteger(u[1])||u[1]<0)throw new TypeError("ranges-sort/rSort(): [THROW_ID_02] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, range at index ".concat(o," (").concat(v(u,4),") does not consist of only natural numbers!"))}if(t!==void 0&&!r)throw new TypeError("ranges-sort/rSort(): [THROW_ID_03] The second argument must be a plain options object; received ".concat(v(t,4)," (type ").concat(typeof t,")!"));let n=it.progressFn;if(t!==void 0){let o=t.strictlyTwoElementsInRangeArrays;if(o!==void 0&&typeof o!="boolean")throw new TypeError("ranges-sort/rSort(): [THROW_ID_04] opts.strictlyTwoElementsInRangeArrays must be a boolean; received ".concat(v(o,4)," (type ").concat(typeof o,")!"));if(n=(l=t.progressFn)!=null?l:it.progressFn,n!==!1&&n!==null&&typeof n!="function")throw new TypeError("ranges-sort/rSort(): [THROW_ID_05] opts.progressFn must be a function, false, null, or undefined; received ".concat(v(n,4)," (type ").concat(typeof n,")!"))}let a,i;if(n){let o=e.length**2,u=0,f;i=h=>{h!==f&&(f=h,n(h))},a=Array.from(e).sort((h,d)=>(u+=1,i==null||i(Math.min(99,Math.floor(u*100/o))),h[0]===d[0]?h[1]<d[1]?-1:h[1]>d[1]?1:0:h[0]<d[0]?-1:1))}else a=Array.from(e).sort((o,u)=>o[0]===u[0]?o[1]<u[1]?-1:o[1]>u[1]?1:0:o[0]<u[0]?-1:1);let s=a.length>10?_r(a,e):a;return i==null||i(100),s}var cr={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function we(e,t){if(!Array.isArray(e)||!e.length)return null;if(t!==void 0&&!D(t))throw new TypeError("ranges-merge/rMerge(): [THROW_ID_01] the second input argument must be a plain object. It was given as:\n".concat(v(t,4)," (type ").concat(typeof t,")"));let r=W(W({},cr),t);if(r.progressFn&&D(r.progressFn)&&!Object.keys(r.progressFn).length)r.progressFn=null;else if(r.progressFn&&typeof r.progressFn!="function")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_02] opts.progressFn must be a function! It was given of a type: "'.concat(typeof r.progressFn,'", equal to ').concat(v(r.progressFn,4)));if(r.mergeType!==1&&r.mergeType!==2&&r.mergeType!=="1"&&r.mergeType!=="2")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_03] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof r.mergeType,'", equal to ').concat(v(r.mergeType,4)));if(typeof r.joinRangesThatTouchEdges!="boolean")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof r.joinRangesThatTouchEdges,'", equal to ').concat(v(r.joinRangesThatTouchEdges,4)));let n=r.progressFn,a=r.joinRangesThatTouchEdges,i=[];for(let b of e)Array.isArray(b)&&(b[2]!==void 0||b[0]!==b[1])&&i.push([...b]);let s,l,o;n?s=F(i,{progressFn:b=>{o=Math.floor(b/5),o!==l&&(l=o,n(o))}}):s=F(i);let u=s.length-1,f=r.mergeType===2||r.mergeType==="2",h=s.length;for(let b=u;b>=0;b--){let c=s[b];for(n&&b<u&&(o=Math.floor((1-(b+1)/u)*78)+21,o!==l&&o>l&&(l=o,n(o)));h<s.length;){let p=s[h],y=p[0]===c[0];if(!y&&(a?p[0]>c[1]:p[0]>=c[1]))break;let _=p[1]>=c[1];_&&(c[1]=p[1]),p[2]===null?c[2]=null:p[2]!==void 0&&(y||_)&&c[2]!==null&&(c[2]!=null?f&&y?c[2]=p[2]:c[2]+=p[2]:c[2]=p[2]),h+=1}h-=1,s[h]=c}let d=s.length-h;for(let b=0;b<d;b++)s[b]=s[h+b];return s.length=d,n&&l!==99&&n(99),s.length?s:null}function ae(e){if(typeof e=="number")return Number.isInteger(e)&&e>=0;if(typeof e!="string"||!e.trim())return!1;let t=Number(e);return Number.isInteger(t)&&t>=0}function L(e,t,r){let n=0,a=0;if(e===void 0&&t===void 0&&r===void 0)throw new Error("ranges-apply/rApply(): [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError("ranges-apply/rApply(): [THROW_ID_02] first input argument must be a string! Currently it's: ".concat(typeof e,", equal to: ").concat(v(e,4)));if(t!=null&&!Array.isArray(t))throw new TypeError("ranges-apply/rApply(): [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ".concat(typeof t,", equal to: ").concat(v(t,4)));if(r!=null&&r!==!1&&r!==0&&r!==""&&typeof r!="function")throw new TypeError("ranges-apply/rApply(): [THROW_ID_04] the third input argument must be a function, false, null, undefined, 0, or an empty string! Currently it's: ".concat(typeof r,", equal to: ").concat(v(r,4)));if(t==null||!t.length||t.every(f=>f==null))return r&&r(100),e;let i;Array.isArray(t)&&!Array.isArray(t[0])&&ae(t[0])&&ae(t[1])?i=[Array.from(t)]:i=Array.from(t);let s=i.length,l=0;i.forEach((f,h)=>{if(f){if(r&&(n=Math.floor(l/s*10),n!==a&&(a=n,r(n))),!Array.isArray(f))throw new TypeError("ranges-apply/rApply(): [THROW_ID_05] ranges array, second input arg., has ".concat(h,"th element not an array: ").concat(v(f,4),", which is ").concat(typeof f));if(!ae(f[0]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_06] ranges array, second input arg. has ".concat(h,"th element, array ").concat(v(f),". Its first element is not a non-negative integer or string index, but ").concat(typeof f[0],", equal to: ").concat(v(f[0],4),"."));if(typeof f[0]=="string"&&(i[h]=[...f],i[h][0]=Number(f[0])),!ae(f[1]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_07] ranges array, second input arg. has ".concat(h,"th element, array ").concat(v(f),". Its second element is not a non-negative integer or string index, but ").concat(typeof f[1],", equal to: ").concat(v(f[1],4),"."));if(typeof f[1]=="string"&&(i[h]===f&&(i[h]=[...f]),i[h][1]=Number(f[1])),i[h][0]>i[h][1])throw new RangeError("ranges-apply/rApply(): [THROW_ID_08] ranges array, second input arg. has ".concat(h,"th element, array ").concat(v(f),". Its first index (").concat(i[h][0],") must not be greater than its second index (").concat(i[h][1],")."));l+=1}});let o=r?we(i,{progressFn:f=>{n=10+Math.floor(f/10),n!==a&&(a=n,r(n))}}):we(i),u=(o==null?void 0:o.length)||0;if(o&&u>0){let f=e.slice(o[u-1][1]);e=o.reduce((h,d,b,c)=>{var _;r&&(n=20+Math.floor(b/u*80),n!==a&&(a=n,r(n)));let p=b===0?0:c[b-1][1],y=c[b][0];return"".concat(h).concat(e.slice(p,y)).concat((_=c[b][2])!=null?_:"")},""),e+=f}return r&&a!==100&&r(100),e}function oe(e,t=1){let r="\xA0";function n(i){return i.length<2?i:Array.from(i).reverse().join("")}function a(i,s,l){let o=l?"\n":"\r",u=l?"\r":"\n";if(!i)return i;let f=0,h="";for(let d=0,b=i.length;d<b;d++)(i[d]===o||i[d]===u&&i[d-1]!==o)&&f++,"\r\n".includes(i[d])||i[d]===r?i[d]===r?h+=i[d]:i[d]===o?f<=s&&(h+=i[d],i[d+1]===u&&(h+=i[d+1],d++)):i[d]===u&&(i==null?void 0:i[d-1])!==o&&f<=s&&(h+=i[d]):!i[d+1]&&!f&&(h+=" ");return h}if(typeof e=="string"&&e.length){let i=e.trim();if(i.length===e.length)return e;let s=1;typeof t=="number"&&Number.isInteger(t)&&t>=0&&(s=t);let l="",o="";if(!i)l=e;else if(!e[0].trim()){for(let f=0,h=e.length;f<h;f++)if(e[f].trim()){l=e.slice(0,f);break}}let u=e[e.length-1];if(i&&(u.trim()===""||u===r)){for(let f=e.length;f--;)if(e[f].trim()){o=e.slice(f+1);break}}return"".concat(a(l,s,!1)).concat(i).concat(n(a(n(o),s,!0)))}return e}var $e={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function st(e,t,r){return t===void 0||e===null?e:t===null?null:e===void 0||r?t:e+t}function hr(e,t){var c,p,y;function r(_){return!!_&&typeof _=="object"&&!Array.isArray(_)}if(!Array.isArray(e)||!e.length)return null;if(t&&!r(t))throw new TypeError("ranges-push/rMerge(): [THROW_ID_07] the second input argument must be a plain object. It was given as:\n".concat(v(t,4)," (type ").concat(typeof t,")"));let n=(c=t==null?void 0:t.progressFn)!=null?c:$e.progressFn,a=(p=t==null?void 0:t.mergeType)!=null?p:$e.mergeType,i=(y=t==null?void 0:t.joinRangesThatTouchEdges)!=null?y:$e.joinRangesThatTouchEdges;if(n&&r(n)&&!Object.keys(n).length)n=null;else if(n&&typeof n!="function")throw new TypeError('ranges-push/rMerge(): [THROW_ID_08] resolvedOpts.progressFn must be a function! It was given of a type: "'.concat(typeof n,'", equal to ').concat(v(n,4)));if(a!==1&&a!==2&&a!=="1"&&a!=="2")throw new TypeError('ranges-push/rMerge(): [THROW_ID_09] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof a,'", equal to ').concat(v(a,4)));if(typeof i!="boolean")throw new TypeError('ranges-push/rMerge(): [THROW_ID_10] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof i,'", equal to ').concat(v(i,4)));let s=[];for(let _ of e)Array.isArray(_)&&(_[2]!==void 0||_[0]!==_[1])&&s.push([..._]);let l,o,u;n?l=F(s,{progressFn:_=>{u=Math.floor(_/5),u!==o&&(o=u,n==null||n(u))}}):l=F(s);let f=l.length-1,h=+a==2,d=l.length;for(let _=f;_>=0;_--){let g=l[_];for(n&&_<f&&(u=Math.floor((1-(_+1)/f)*78)+21,u!==o&&u>o&&(o=u,n(u)));d<l.length;){let m=l[d],w=m[0]===g[0];if(!w&&(i?m[0]>g[1]:m[0]>=g[1]))break;let A=m[1]>=g[1];A&&(g[1]=m[1]),m[2]===null?g[2]=null:m[2]!==void 0&&(w||A)&&(g[2]=st(g[2],m[2],h&&w)),d+=1}d-=1,l[d]=g}let b=l.length-d;for(let _=0;_<b;_++)l[_]=l[d+_];return l.length=b,l.length?l:null}var le=Object.freeze({limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1});function H(e){if(K(e))return e;if(typeof e=="string"&&/^\d+$/.test(e)){let t=Number(e);return K(t)?t:null}return null}function at(e){if(!Array.isArray(e))return"a ranges batch must contain only range arrays; received ".concat(v(e,4));if(e.length>3)return"a range must contain at most three values; received ".concat(v(e,4));let[t,r,n]=e;if(t==null&&r==null)return;if(t!=null&&r==null)return"the first index is set (".concat(v(t),") but the second index is not (").concat(v(r),")");if(t==null&&r!=null)return"the second index is set (".concat(v(r),") but the first index is not (").concat(v(t),")");let a=H(t),i=H(r);if(a===null)return"the first index must be a natural number, zero, or a digit-only numeric string; received ".concat(v(t,4)," (type ").concat(typeof t,")");if(i===null)return"the second index must be a natural number, zero, or a digit-only numeric string; received ".concat(v(r,4)," (type ").concat(typeof r,")");if(B(n)&&!$(n)&&!M(n))return"the third value must be a string, number, null, or undefined; received ".concat(v(n,4)," (type ").concat(typeof n,")");if(a>i)return"the first index (".concat(a,") must not be greater than the second index (").concat(i,")")}function gr(e){if(e.length>3)return{error:"expected at most three arguments but received ".concat(e.length),ranges:[]};if(e.length<=1&&Array.isArray(e[0])){let r=e[0];if(!r.length)return{ranges:[]};e=Array.isArray(r[0])?r:[r]}else e=[e];let t=[];for(let r of e){let n=at(r);if(n)return{error:n,ranges:[]};let[a,i,s]=r;if(a==null&&i==null)continue;let l=H(a),o=H(i);t.push(s!==void 0&&!($(s)&&!s.length)?[l,o,s]:[l,o])}return{ranges:t}}function pr(e){return e[2]===void 0&&e[0]===e[1]}function dr(e){let t=-1;for(let r=0,n=e.length;r<n;r++){let a=e[r];if(Array.isArray(a)){if(a[0]<t)return!1;t=a[0]}}return!0}var G=class{constructor(e){x(this,"ranges");x(this,"opts");x(this,"currentCache",null);if(e!=null&&!D(e))throw new TypeError("ranges-push/Ranges/constructor(): [THROW_ID_01] The options argument must be a plain object. It was given as ".concat(v(e,4)," (type ").concat(typeof e,")."));if(e===void 0){this.opts=le,this.ranges=[];return}let t=e,r=t.limitToBeAddedWhitespace===void 0?le.limitToBeAddedWhitespace:t.limitToBeAddedWhitespace,n=t.limitLinebreaksCount===void 0?le.limitLinebreaksCount:t.limitLinebreaksCount,a=t.mergeType===void 0?le.mergeType:t.mergeType,i=a==="1"?1:a==="2"?2:a,s;if(typeof r!="boolean"?s="opts.limitToBeAddedWhitespace must be a boolean; received ".concat(v(r,4)," (type ").concat(typeof r,")"):K(n)?i!==1&&i!==2&&(s='opts.mergeType must be 1, 2, "1", or "2"; received '.concat(v(a,4)," (type ").concat(typeof a,")")):s="opts.limitLinebreaksCount must be a natural number or zero; received ".concat(v(n,4)," (type ").concat(typeof n,")"),s)throw new TypeError("ranges-push/Ranges/constructor(): [THROW_ID_02] ".concat(s,"."));let l=Object.freeze({limitToBeAddedWhitespace:r,limitLinebreaksCount:n,mergeType:i});this.opts=l,this.ranges=[]}rangeListsMatch(e,t){if(!Array.isArray(e))return t===null;if(!Array.isArray(t)||e.length!==t[0])return!1;let r=1;for(let n=0,a=e.length;n<a;n++){let i=e[n];if(!Array.isArray(i)){if(t[r++]!==-1||i!==t[r++])return!1;continue}if(i.length!==t[r++])return!1;for(let s=0;s<i.length;s++)if(i[s]!==t[r++])return!1}return r===t.length}snapshotRanges(e){if(!Array.isArray(e))return null;let t=new Array(1+e.length*4);t[0]=e.length;let r=1;for(let n=0,a=e.length;n<a;n++){let i=e[n];if(Array.isArray(i)){t[r++]=i.length;for(let s=0;s<i.length;s++)t[r++]=i[s]}else t[r++]=-1,t[r++]=i}return t.length=r,t}currentStateMatchesSnapshot(){let e=this.currentCache;return e!==null&&this.rangeListsMatch(this.ranges,e.rangesSnapshot)&&this.rangeListsMatch(e.result,e.resultSnapshot)}recordCurrentSnapshot(e){let t=this.snapshotRanges(this.ranges);this.currentCache={rangesSnapshot:t,result:e,resultSnapshot:e===this.ranges?t:this.snapshotRanges(e)}}invalidateCurrentCache(){this.currentCache=null}addValidated(e,t,r){this.invalidateCurrentCache();let n=this.last();if(B(this.ranges)&&Array.isArray(n)&&e===n[1]){if(n[1]=t,r!==void 0&&!($(r)&&!r.length)){let i=st(n[2],r,this.opts.mergeType===2&&n[0]===e);this.opts.limitToBeAddedWhitespace&&typeof i=="string"&&(i=oe(i,this.opts.limitLinebreaksCount)),$(i)&&!i.length||(n[2]=i)}return}this.ranges||(this.ranges=[]);let a=r!==void 0?[e,t,typeof r=="string"&&this.opts.limitToBeAddedWhitespace?oe(r,this.opts.limitLinebreaksCount):r]:[e,t];this.ranges.push(a)}add(e,t,r){let n=arguments.length,a;if(n>3)a="expected at most three arguments but received ".concat(n);else if(n===1&&Array.isArray(e)){let i=Array.isArray(e[0])?e:[e];for(let s=0,l=i.length;s<l&&(a=at(i[s]),!a);s++);if(!a)for(let s=0,l=i.length;s<l;s++){let[o,u,f]=i[s];o==null&&u==null||this.addValidated(H(o),H(u),$(f)&&!f.length?void 0:f)}}else{if(e==null&&t==null)return;if(e!=null&&t==null)a="the first index is set (".concat(v(e),") but the second index is not (").concat(v(t),")");else if(e==null&&t!=null)a="the second index is set (".concat(v(t),") but the first index is not (").concat(v(e),")");else{let i=H(e),s=H(t);i===null?a="the first index must be a natural number, zero, or a digit-only numeric string; received ".concat(v(e,4)," (type ").concat(typeof e,")"):s===null?a="the second index must be a natural number, zero, or a digit-only numeric string; received ".concat(v(t,4)," (type ").concat(typeof t,")"):B(r)&&!$(r)&&!M(r)?a="the third value must be a string, number, null, or undefined; received ".concat(v(r,4)," (type ").concat(typeof r,")"):i>s?a="the first index (".concat(i,") must not be greater than the second index (").concat(s,")"):this.addValidated(i,s,$(r)&&!r.length?void 0:r)}}if(a)throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_03] ".concat(a,"."))}push(e,t,r){this.add.apply(this,arguments)}current(){var e,t;if(this.currentStateMatchesSnapshot())return(t=(e=this.currentCache)==null?void 0:e.result)!=null?t:null;if(Array.isArray(this.ranges)&&this.ranges.length){this.ranges=hr(this.ranges,this.opts.mergeType===1?void 0:{mergeType:2});let r=this.ranges;return r&&this.opts.limitToBeAddedWhitespace&&(r=r.map(n=>typeof n[2]=="string"?[n[0],n[1],oe(n[2],this.opts.limitLinebreaksCount)]:n)),this.recordCurrentSnapshot(r),r}return this.recordCurrentSnapshot(null),null}firstCovers(e){if(!K(e))throw new TypeError("ranges-push/Ranges/firstCovers(): [THROW_ID_04] the input argument must be a natural number or zero! It was given as ".concat(v(e,4)," (type ").concat(typeof e,")"));if(!Array.isArray(this.ranges)||!this.ranges.length)return!1;let t=dr(this.ranges)?this.ranges:this.ranges.filter(n=>Array.isArray(n)).slice().sort((n,a)=>n[0]-a[0]||n[1]-a[1]),r=null;for(let n=0,a=t.length;n<a;n++){let i=t[n];if(!(!Array.isArray(i)||pr(i))){if(r===null){if(i[0]!==0)return!1;r=i[1]}else{if(i[0]>r)break;i[1]>r&&(r=i[1])}if(r>=e)return!0}}return r!==null&&r>=e}wipe(){this.ranges=[],this.invalidateCurrentCache()}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])){let t=gr([e]);if(t.error)throw new TypeError("ranges-push/Ranges/replace(): [THROW_ID_06] ".concat(t.error,"."));this.ranges=t.ranges,this.invalidateCurrentCache()}else throw new Error("ranges-push/Ranges/replace(): [THROW_ID_05] Single range was given but we expected array of arrays! The first element, ".concat(v(e[0],4)," should be an array."));else this.ranges=[],this.invalidateCurrentCache()}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};var ot={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},lt=e=>e+1,yr=e=>e-1;function mr(e,t,r,n,a=()=>!1,i=!1,s=lt){if(+t<0&&i&&r==="EOL")return r;if(t>=e.length&&!i)return!1;let l=i?1:r.length,o=0,u=!1,f=!1,h=!1,d=Math.min(n.maxMismatches,e.length+r.length),b=d,c=t,p=!1,y=!1,_=!1;function g(){return o===1&&b<d-1}for(;e[c];){let m=s(c);if(n.trimBeforeMatching&&e[c].trim()===""){if(!e[m]&&i&&r==="EOL")return!0;c=s(c);continue}if(a(e[c])){if(i&&r==="EOL"&&!e[m])return!0;c=s(c);continue}if(i)return!1;let w=m>c?r[r.length-l]:r[l-1];if(!n.i&&e[c]===w||n.i&&w!==void 0&&e[c].toLowerCase()===w.toLowerCase()){if(p||(p=!0),h||(h=!0),l===r.length){if(y=!0,b!==d)return!1}else l===1&&(_=!0);if(l-=1,o++,g())return!1;if(!l)return o!==r.length||b===d||!u?c:!1}else if(!u&&!o&&(u=!0),d&&b&&c){b-=1;for(let A=0;A<=b;A++){let T=m>c?r[r.length-l+1+A]:r[l-2-A],O=e[s(c)];if(T&&(!n.i&&e[c]===T||n.i&&e[c].toLowerCase()===T.toLowerCase())&&(!n.firstMustMatch||l!==r.length)){if(o++,g())return!1;l-=2,p=!0;break}else if(O&&T&&(!n.i&&O===T||n.i&&O.toLowerCase()===T.toLowerCase())&&(!n.firstMustMatch||l!==r.length)){if(!o&&!n.hungry)return!1;l-=1,p=!0;break}else if(T===void 0&&b>=0&&p&&(!n.firstMustMatch||y)&&(!n.lastMustMatch||_))return c}p||(f=c)}else return c===0&&l===1&&d>0&&b>0&&(!n.firstMustMatch||y)&&!n.lastMustMatch&&h?0:!1;if(f!==!1&&f!==c&&(f=!1),l<1)return c;c=s(c)}if(l>0)return i&&r==="EOL"?!0:n&&d>=l&&h?f||0:!1}function ut(e,t,r,n,a){var c,p,y,_;if(D(a)&&Ge(a,"trimBeforeMatching")&&a&&typeof a.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_01] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(a.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let i=W(W({},ot),a);if(i.maxMismatches=(c=a==null?void 0:a.maxMismatches)!=null?c:ot.maxMismatches,br(i.maxMismatches,e),typeof i.trimCharsBeforeMatching=="string"&&(i.trimCharsBeforeMatching=S(i.trimCharsBeforeMatching)),i.trimCharsBeforeMatching=i.trimCharsBeforeMatching.map(g=>$(g)?g:String(g)),!$(t)||!t.length)return!1;if(!Number.isInteger(r)||r<0)throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_02] the second argument should be a natural number. Currently it's of a type: ").concat(typeof r,", equal to:\n").concat(v(r,4)));let s,l;if($(n))s=[n];else if(Array.isArray(n))s=n;else if(!n)s=n;else if(typeof n=="function")s=[],s.push(n);else throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_03] the third argument, whatToMatch, is neither string nor array of strings! It's ").concat(typeof n,", equal to:\n").concat(v(n,4)));if(vr(s,e),a&&!D(a))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_04] the fourth argument, options object, should be a plain object. Currently it's of a type \"").concat(typeof a,'", and equal to:\n').concat(v(a,4)));let o=0,u="";if((p=i==null?void 0:i.trimCharsBeforeMatching)!=null&&p.some((g,m)=>g.length>1?(o=m,u=g,!0):!1))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_05] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ").concat(o," is longer than 1 character, ").concat(u.length," (equals to ").concat(u,"). Please split it into separate characters and put into array as separate elements."));if(r>=t.length)return!1;let f=i.i?i.trimCharsBeforeMatching.map(g=>g.toLowerCase()):i.trimCharsBeforeMatching,h=i.i?g=>f.includes(g.toLowerCase()):g=>f.includes(g);if(!s||!Array.isArray(s)||Array.isArray(s)&&!s.length||Array.isArray(s)&&s.length===1&&$(s[0])&&!s[0].trim()){if(typeof i.cb=="function"){let m,w=r;if((e==="matchLeftIncl"||e==="matchRight")&&(w+=1),e[5]==="L")for(let O=w;O--;){let E=t[O];if((!i.trimBeforeMatching||i.trimBeforeMatching&&(E!=null&&E.trim()))&&(!((y=i.trimCharsBeforeMatching)!=null&&y.length)||E!==void 0&&!h(E))){m=O;break}}else if(e.startsWith("matchRight"))for(let O=w;O<t.length;O++){let E=t[O];if((!i.trimBeforeMatching||i.trimBeforeMatching&&E.trim())&&(!((_=i.trimCharsBeforeMatching)!=null&&_.length)||!h(E))){m=O;break}}if(m===void 0)return!1;let A=t[m],T=e[5]==="L"?t.slice(0,m+1):t.slice(m);return e[5],i.cb(A,T,m)}let g="";throw a||(g=" More so, the whole options object, the fourth input argument, is missing!"),new Error("string-match-left-right/".concat(e,'(): [THROW_ID_06] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!').concat(g))}if(!i.cb&&!i.i&&!i.trimBeforeMatching&&!i.trimCharsBeforeMatching.length&&i.maxMismatches===0&&!i.firstMustMatch&&!i.lastMustMatch&&!i.hungry&&s.every($)){for(let g of s){if(!g.length)continue;let m=r;if(e==="matchRight"?m+=1:e==="matchLeft"?m-=g.length:e==="matchLeftIncl"&&(m-=g.length-1),m>=0&&t.startsWith(g,m))return g}return!1}let d=r;e==="matchRight"?d+=1:e==="matchLeft"&&(d-=1);let b=e[5]==="L"?yr:lt;for(let g=0,m=s.length;g<m;g++){l=typeof s[g]=="function";let w=s[g],A=typeof w=="function"?w():w;if(l&&A!=="EOL")throw new Error("string-match-left-right/".concat(e,'(): [THROW_ID_09] EOL marker functions must return "EOL". The function at index ').concat(g," returned:\n").concat(v(A,4)));if(l&&e.endsWith("Incl"))continue;let T,O,E="",V=mr(t,d,A,i,h,l,b);if(V&&l)return!i.cb||i.cb(T,E,O)?A:!1;if(Number.isInteger(V)&&(O=e.startsWith("matchLeft")?V-1:V+1,e[5]==="L"?E=t.slice(0,V):E=t.slice(O)),O<0&&(O=void 0),t[O]&&(T=t[O]),Number.isInteger(V)&&(!i.cb||i.cb(T,E,O)))return A}return!1}function br(e,t){if(!Number.isSafeInteger(e)||e<0)throw new Error("string-match-left-right/".concat(t,"(): [THROW_ID_07] opts.maxMismatches must be a non-negative safe integer. Currently it's of a type: ").concat(typeof e,", equal to:\n").concat(v(e,4)))}function vr(e,t){if(e)for(let r=0;r<e.length;r+=1){let n=e[r];if(typeof n!="string"&&typeof n!="function")throw new Error("string-match-left-right/".concat(t,"(): [THROW_ID_08] matcher alternatives must be strings or EOL marker functions. The value at index ").concat(r," is of a type: ").concat(typeof n,", equal to:\n").concat(v(n,4)))}}function J(e,t,r,n){return ut("matchLeftIncl",e,t,r,n)}function R(e,t,r,n){return ut("matchRightIncl",e,t,r,n)}var ft={fromIndex:0,throwWhenSomethingWrongIsDetected:!0,allowWholeValueToBeOnlyHeadsOrTails:!0,source:"string-find-heads-tails",matchHeadsAndTailsStrictlyInPairsByTheirOrder:!1,relaxedAPI:!1};function Ae(e,t,r,n){if(B(n)&&!D(n))throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_01] the fourth input argument, an Optional Options Object, must be a plain object! Currently it's equal to: ".concat(n," (type: ").concat(typeof n,")"));let a=W(W({},ft),n),i=a.source===ft.source?"":"".concat(a.source,": ");if($(a.fromIndex)&&/^\d*$/.test(a.fromIndex))a.fromIndex=Number(a.fromIndex);else if(!Number.isInteger(a.fromIndex)||a.fromIndex<0)throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_02] ".concat(i,"the fourth input argument must be a natural number or zero! Currently it's: ").concat(a.fromIndex));if(!$(e)||e.length===0){if(a.relaxedAPI)return[];throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_03] the first input argument, input string, must be a non-zero-length string! Currently it's: ".concat(typeof e,", equal to: ").concat(e))}let s,l;if(!$(t)&&!Array.isArray(t)){if(a.relaxedAPI)return[];throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_04] the second input argument, heads, must be either a string or an array of strings! Currently it's: ".concat(typeof t,", equal to:\n").concat(v(t,4)))}else if($(t))if(t.length===0){if(a.relaxedAPI)return[];throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_05] the second input argument, heads, must be a non-empty string! Currently it's empty.")}else t=S(t);else if(Array.isArray(t))if(t.length===0){if(a.relaxedAPI)return[];throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_06] the second input argument, heads, must be a non-empty array and contain at least one string! Currently it's empty.")}else if(t.every((c,p)=>(s=c,l=p,$(c)))){if(!t.every((c,p)=>(l=p,$(c)&&c.length&&c.trim()!=="")))if(a.relaxedAPI){if(t=t.filter(c=>$(c)&&c.length),t.length===0)return[]}else throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_08] the second input argument, heads, should not contain empty strings! For example, there's one detected at index ".concat(l," of heads array:\n").concat(v(t,4),"."))}else if(a.relaxedAPI){if(t=t.filter(c=>$(c)&&c.length),t.length===0)return[]}else throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_07] the second input argument, heads, contains non-string elements! For example, element at ".concat(l,"th index is ").concat(typeof s,", equal to:\n").concat(v(s,4),". Whole heads array looks like:\n").concat(v(t,4)));if(!$(r)&&!Array.isArray(r)){if(a.relaxedAPI)return[];throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_09] the third input argument, tails, must be either a string or an array of strings! Currently it's: ".concat(typeof r,", equal to:\n").concat(v(r,4)))}else if($(r))if(r.length===0){if(a.relaxedAPI)return[];throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_10] the third input argument, tails, must be a non-empty string! Currently it's empty.")}else r=S(r);else if(Array.isArray(r))if(r.length===0){if(a.relaxedAPI)return[];throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_11] the third input argument, tails, must be a non-empty array and contain at least one string! Currently it's empty.")}else if(r.every((c,p)=>(s=c,l=p,$(c)))){if(!r.every((c,p)=>(l=p,$(c)&&c.length&&c.trim()!=="")))if(a.relaxedAPI){if(r=r.filter(c=>$(c)&&c.length),r.length===0)return[]}else throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_13] the third input argument, tails, should not contain empty strings! For example, there's one detected at index ".concat(l,". Whole tails array is equal to:\n").concat(v(r,4)))}else if(a.relaxedAPI){if(r=r.filter(c=>$(c)&&c.length),r.length===0)return[]}else throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_12] the third input argument, tails, contains non-string elements! For example, element at ".concat(l,"th index is ").concat(typeof s,", equal to:\n").concat(v(s,4),". Whole tails array is equal to:\n").concat(v(r,4)));if(a.throwWhenSomethingWrongIsDetected&&!a.allowWholeValueToBeOnlyHeadsOrTails){if(S(t).includes(e))throw new Error("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_14] ".concat(i,"the whole input string can't be equal to ").concat($(t)?"":"one of ","heads (").concat(e,")!"));if(S(r).includes(e))throw new Error("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_15] ".concat(i,"the whole input string can't be equal to ").concat($(r)?"":"one of ","tails (").concat(e,")!"))}let o=t.concat(r).map(c=>c.charAt(0)).reduce((c,p)=>p.charCodeAt(0)>c[1]?[c[0],p.charCodeAt(0)]:p.charCodeAt(0)<c[0]?[p.charCodeAt(0),c[1]]:c,[t[0].charCodeAt(0),t[0].charCodeAt(0)]),u=[],f=!1,h={},d,b;for(let c=a.fromIndex,p=e.length;c<p;c++){let y=e[c].charCodeAt(0);if(y<=o[1]&&y>=o[0]){let _=R(e,c,t);if(_&&a.matchHeadsAndTailsStrictlyInPairsByTheirOrder){for(let m=t.length;m--;)if(t[m]===_){b=m;break}}if($(_))if(f){if(a.throwWhenSomethingWrongIsDetected)throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_16] ".concat(i,'When processing "').concat(e,'", we found heads (').concat(e.slice(c,c+_.length),') starting at character with index number "').concat(c,'" and there was another set of heads before it! Generally speaking, there should be "heads-tails-heads-tails", not "heads-heads-tails"!\nWe\'re talking about the area of the code:\n\n\n--------------------------------------starts\n').concat(e.slice(Math.max(c-200,0),c),"\n \x1B[33m------->\x1B[39m ").concat("\x1B[31m".concat(e.slice(c,c+_.length),"\x1B[39m")," \x1B[33m<-------\x1B[39m\n").concat(e.slice(c+_.length,Math.min(p,c+200)),"\n--------------------------------------ends\n\n\nTo turn off this error being thrown, set resolvedOpts.throwWhenSomethingWrongIsDetected to Boolean false."))}else{h={},h.headsStartAt=c,h.headsEndAt=c+_.length,f=!0,c+=_.length-1,d&&(d=void 0);continue}let g=R(e,c,r);if(f&&g&&a.matchHeadsAndTailsStrictlyInPairsByTheirOrder&&b!==void 0&&r[b]!==void 0&&r[b]!==g){let m;for(let w=r.length;w--;)if(r[w]===g){m=w;break}throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_17] ".concat(i,'When processing "').concat(e,'", we had "resolvedOpts.matchHeadsAndTailsStrictlyInPairsByTheirOrder" on. We found heads (').concat(t[b],") but the tails the followed it were not of the same index, ").concat(b," (").concat(r[b],") but ").concat(m," (").concat(g,")."))}if($(g))if(f){h.tailsStartAt=c,h.tailsEndAt=c+g.length,u.push(h),h={},f=!1,c+=g.length-1;continue}else a.throwWhenSomethingWrongIsDetected&&(d=new Error("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_18] ".concat(i,'When processing "').concat(e,'", we found tails (').concat(e.slice(c,c+g.length),') starting at character with index number "').concat(c,"\" but there were no heads preceding it. That's very naughty!")))}if(a.throwWhenSomethingWrongIsDetected&&c===p-1){if(Object.keys(h).length!==0)throw new TypeError("string-find-heads-tails/strFindHeadsTails(): [THROW_ID_19] ".concat(i,'When processing "').concat(e,"\", we reached the end of the string and yet didn't find any tails (").concat(v(r,4),") to match the last detected heads (").concat(e.slice(h.headsStartAt,h.headsEndAt),")!"));if(d)throw d}}return u}var _t="12.2.5";function ue(e,t){return!$(e)||!e.trim()?!1:!!(e.includes(t.heads)||e.includes(t.tails)||$(t.headsNoWrap)&&t.headsNoWrap.length&&e.includes(t.headsNoWrap)||$(t.tailsNoWrap)&&t.tailsNoWrap.length&&e.includes(t.tailsNoWrap))}function Te(e){if($(e)&&e.length&&e.indexOf(".")!==-1){for(let t=e.length;t--;)if(e[t]===".")return e.slice(t+1)}return e}function ct(e){if($(e)&&e.length&&e.indexOf(".")!==-1){for(let t=0,r=e.length;t<r;t++)if(e[t]===".")return e.slice(0,t)}return e}function Oe(e){if($(e)&&e.length&&e.indexOf(".")!==-1){for(let t=e.length;t--;)if(e[t]===".")return e.slice(0,t)}return e}function ht(e){if($(e)&&e.length&&e.indexOf(".")!==-1){for(let t=0,r=e.length;t<r;t++)if(e[t]===".")return e.slice(t+1)}return e}var gt={classicTrim:!1,cr:!1,lf:!1,tab:!1,space:!0,nbsp:!1};function Q(e,t){if(typeof e!="string")throw new Error("string-trim-spaces-only/trimSpaces(): [THROW_ID_01] input must be string! It was given as ".concat(typeof e,", equal to:\n").concat(v(e,4)));let r=t?W(W({},gt),t):gt,{classicTrim:n,cr:a,lf:i,tab:s,space:l,nbsp:o}=r;function u(h){return n&&!h.trim()||!n&&(l&&h===" "||a&&h==="\r"||i&&h==="\n"||s&&h===" "||o&&h==="\xA0")}let f=e.length;if(f){let h=0;for(;h<f&&u(e[h]);)h+=1;if(h===f)return{res:"",ranges:[[0,f]]};let d=f;for(;d>h;){let p=d-1;if(!u(e[p])){d<f;break}d=p}let b=h||void 0,c=d<f?d:void 0;return b!==void 0?c!==void 0?{res:e.slice(b,c),ranges:[[0,b],[c,f]]}:{res:e.slice(b),ranges:[[0,b]]}:c!==void 0?{res:e.slice(0,c),ranges:[[c,f]]}:{res:e,ranges:[]}}return{res:"",ranges:[]}}var $r={heads:["{{"],tails:["}}"]};function pt(e,t){let r=Object.prototype.hasOwnProperty;if(e===void 0)throw new Error("string-remove-duplicate-heads-tails/remDup(): [THROW_ID_01] The input is missing!");if(typeof e!="string")return e;if(t&&!D(t))throw new Error("string-remove-duplicate-heads-tails/remDup(): [THROW_ID_02] The given options are not a plain object but ".concat(typeof t,"!"));let n=W({},t);if(n&&r.call(n,"heads"))if(S(n.heads).every(p=>typeof p=="string"||Array.isArray(p)))typeof n.heads=="string"&&(n.heads=S(n.heads));else throw new Error("string-remove-duplicate-heads-tails/remDup(): [THROW_ID_03] The resolvedOpts.heads contains elements which are not string-type!");if(n&&r.call(n,"tails"))if(S(n.tails).every(p=>typeof p=="string"||Array.isArray(p)))typeof n.tails=="string"&&(n.tails=S(n.tails));else throw new Error("string-remove-duplicate-heads-tails/remDup(): [THROW_ID_04] The resolvedOpts.tails contains elements which are not string-type!");let a=Q(e).res;if(a.length===0)return e;e=a;let i=W(W({},$r),n);i.heads=i.heads.map(p=>p.trim()),i.tails=i.tails.map(p=>p.trim());let s=!1,l=!1,o=new G({limitToBeAddedWhitespace:!0}),u=new G({limitToBeAddedWhitespace:!0}),f=!0,h=!0,d="";function b(p,y){let _;return R(p,0,y.heads,{trimBeforeMatching:!0,cb:(g,m,w)=>(_=w,!0)})&&R(p,_,y.tails,{trimBeforeMatching:!0,cb:(g,m,w)=>(_=w,!0)})?p.slice(_):p}for(;e!==b(e,i);)e=Q(b(e,i)).res;function c(p,y){let _;return!J(p,p.length-1,y.tails,{trimBeforeMatching:!0,cb:(g,m,w)=>(_=w,!0)})||!_?p:J(p,_,y.heads,{trimBeforeMatching:!0,cb:(g,m,w)=>(_=w,!0)})?p.slice(0,_+1):p}for(;e!==c(e,i);)e=Q(c(e,i)).res;if(!i.heads.length||!R(e,0,i.heads,{trimBeforeMatching:!0})||!i.tails.length||!J(e,e.length-1,i.tails,{trimBeforeMatching:!0}))return Q(e).res;for(let p=0,y=e.length;p<y;p++)if(e[p].trim()!==""){let _;if(R(e,p,i.heads,{trimBeforeMatching:!0,cb:(g,m,w)=>(_=w,!0)})&&_){h=!0,f&&(f=!0);let g;R(e,_,i.tails,{trimBeforeMatching:!0,cb:(m,w,A)=>(g=A,!0)})&&typeof g=="number"&&o.push(p,g),u.current()&&s&&d!=="tails"&&o.push(u.current()),s||u.current()&&(o.push(u.current()),u.wipe()),u.push(p,_),d="heads",p=_-1;continue}if(R(e,p,i.tails,{trimBeforeMatching:!0,cb:(g,m,w)=>(_=Number.isInteger(w)?w:e.length,!0)})&&_){h=!0,f?(d==="heads"&&u.wipe(),f=!1):u.push(p,_),d="tails",p=_-1;continue}f&&(f=!0),h&&!s?(s=!0,h=!1):h&&!l?(l=!0,f=!0,h=!1,d==="heads"&&u.wipe()):h&&l&&u.wipe()}return u.current()&&o.push(u.current()),o.current()?L(e,o.current()).trim():e.trim()}function dt(e,t,r){let n,a;return $(e)&&e.length&&R(e,0,t,{trimBeforeMatching:!0,cb:(i,s,l)=>(n=l,!0)})&&J(e,e.length-1,r,{trimBeforeMatching:!0,cb:(i,s,l)=>(a=(l||0)+1,!0)})?e.slice(n,a):e}function We(e,t,r=!1,n,a,i){if(t.wrapHeadsWith||(t.wrapHeadsWith=""),t.wrapTailsWith||(t.wrapTailsWith=""),$(e)&&!r&&t.wrapGlobalFlipSwitch&&!t.dontWrapVars.some(s=>ie(i,s))&&(!t.preventDoubleWrapping||t.preventDoubleWrapping&&$(e)&&!e.includes(t.wrapHeadsWith)&&!e.includes(t.wrapTailsWith)))return"".concat(t.wrapHeadsWith).concat(e).concat(t.wrapTailsWith);if(r){if(!$(e))return e;let s=pt(e,{heads:t.wrapHeadsWith,tails:t.wrapTailsWith});return $(s)?dt(s,t.wrapHeadsWith,t.wrapTailsWith):s}return e}var Ar=_t,Tr=Object.prototype.hasOwnProperty,mt={heads:"%%_",tails:"_%%",headsNoWrap:"%%-",tailsNoWrap:"-%%",lookForDataContainers:!0,dataContainerIdentifierTails:"_data",wrapHeadsWith:"",wrapTailsWith:"",dontWrapVars:[],preventDoubleWrapping:!0,wrapGlobalFlipSwitch:!0,noSingleMarkers:!1,resolveToBoolIfAnyValuesContainBool:!0,resolveToFalseIfAnyValuesContainBool:!0,throwWhenNonStringInsertedInString:!1,allowUnresolved:!1};function I(e){return $(e)?e.trim():e}function yt(e,t,r){let n=r.get(t);return n===void 0&&(n=tt(e,t),r.set(t,n)),n}function Or(e,t,r,n,a){let i;if(r.indexOf(".")!==-1){let s=r,l=!0;if(n.lookForDataContainers&&$(n.dataContainerIdentifierTails)&&n.dataContainerIdentifierTails.length&&!s.endsWith(n.dataContainerIdentifierTails)){let o=C.default.get(e,s+n.dataContainerIdentifierTails),u=D(o)?C.default.get(o,t):void 0;u&&(i=u,l=!1)}for(;l&&s.indexOf(".")!==-1;){if(s=Oe(s),Te(s)===t)throw new Error('json-variables/findValues(): [THROW_ID_01] While trying to resolve: "'.concat(t,'" at path "').concat(r,'", we encountered a closed loop. The parent key "').concat(Te(s),'" is called the same as the variable "').concat(t,"\" we're looking for."));if(n.lookForDataContainers&&$(n.dataContainerIdentifierTails)&&n.dataContainerIdentifierTails.length&&!s.endsWith(n.dataContainerIdentifierTails)){let o=C.default.get(e,s+n.dataContainerIdentifierTails),u=D(o)?C.default.get(o,t):void 0;u&&(i=u,l=!1)}if(i===void 0){let o=C.default.get(e,s),u=D(o)?C.default.get(o,t):void 0;u&&(i=u,l=!1)}}}if(i===void 0){let s=C.default.get(e,t);s!==void 0&&(i=s)}if(i===void 0)if(t.indexOf(".")===-1){let s=yt(e,t,a);if(s.length){for(let l=0,o=s.length;l<o;l++)if($(s[l].val)||ne(s[l].val)||z(s[l].val)){i=s[l].val;break}else if(M(s[l].val)){i=s[l].val;break}else if(Array.isArray(s[l].val)){i=s[l].val.join("");break}}}else{let s=yt(e,ct(t),a);if(s.length)for(let l=0,o=s.length;l<o;l++){let u=C.default.get(s[l].val,ht(t));u&&$(u)&&(i=u)}}return i}function bt(e,t,r,n,a,i=[]){if(i.includes(r)){let y="";if(i.length>1){let _=" \u2192\n";y=i.reduce((g,m,w)=>g+(w===0?"":_)+(m===r?"\u{1F4A5} ":" ")+m," Here's the path we travelled up until we hit the recursion:\n\n"),y+="".concat(_,"\u{1F4A5} ").concat(r)}throw new Error('json-variables/resolveString(): [THROW_ID_02] While trying to resolve: "'.concat(t,'" at path "').concat(r,'", we encountered a closed loop, the key is referencing itself."').concat(y))}let s={},l=Array.from(i);l.push(r);let o=new G,u;function f(y,_,g){for(let m=0,w=y.length;m<w;m++){let A=y[m],T=t.slice(A.headsEndAt,A.tailsStartAt);if(T.length===0)o.push(A.headsStartAt,A.tailsEndAt);else if(Tr.call(s,T)&&$(s[T]))o.push(A.headsStartAt,A.tailsEndAt,s[T]);else{if(u=Or(e,T.trim(),r,n,a),u===void 0)if(n.allowUnresolved===!0)u="";else if($(n.allowUnresolved))u=n.allowUnresolved;else throw new Error("json-variables/processHeadsAndTails(): [THROW_ID_03] We couldn't find the value to resolve the variable ".concat(t.slice(A.headsEndAt,A.tailsStartAt),". We're at path: \"").concat(r,'".'));if(!g&&n.throwWhenNonStringInsertedInString&&!$(u))throw new Error("json-variables/processHeadsAndTails(): [THROW_ID_04] While resolving the variable ".concat(t.slice(A.headsEndAt,A.tailsStartAt)," at path ").concat(r,", it resolved into a non-string value, ").concat(v(u,4),'. This is happening because options setting "throwWhenNonStringInsertedInString" is active (set to "true").'));if(ne(u)){if(n.resolveToBoolIfAnyValuesContainBool)return o.wipe(),n.resolveToFalseIfAnyValuesContainBool?!1:u;u=""}else{if(z(u)&&g)return o.wipe(),u;Array.isArray(u)?u=String(u.join("")):z(u)?u="":(!M(u)||!g)&&(u=String(u))}let O=r.includes(".")?"".concat(Oe(r),".").concat(T):T;if(ue(u,n)){let E=We(bt(e,u,O,n,a,l),n,_,l,O,T.trim());E!==!1&&o.push(A.headsStartAt,A.tailsEndAt,E)}else{s[T]=u;let E=We(u,n,_,l,O,T.trim());E!==!1&&o.push(A.headsStartAt,A.tailsEndAt,E)}}}}let h;try{h=Ae(t,n.heads,n.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(y){throw new Error('json-variables/resolveString(): [THROW_ID_05] While trying to resolve string: "'.concat(t,'" at path ').concat(r,", something wrong with heads and tails was detected! Here's the internal error message:\n").concat(y))}let d=!1;h.length===1&&L(t,[[h[0].headsStartAt,h[0].tailsEndAt]]).trim()===""&&(d=!0);let b=f(h,!1,d);if(typeof b=="boolean"||b===null)return b;try{h=Ae(t,n.headsNoWrap,n.tailsNoWrap,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(y){throw new Error('json-variables/resolveString(): [THROW_ID_06] While trying to resolve string: "'.concat(t,'" at path ').concat(r,", something wrong with no-wrap heads and no-wrap tails was detected! Here's the internal error message:\n").concat(y))}h.length===1&&L(t,[[h[0].headsStartAt,h[0].tailsEndAt]]).trim()===""&&(d=!0);let c=f(h,!0,d);if(ne(c)||z(c))return c;let p=o.current();if(p){if(d){if(typeof u=="number")return u;if((p==null?void 0:p.length)===1&&p[0].length===3&&M(p[0][2]))return p[0][2]}return L(t,p)}return t}function Wr(e,t){if(!arguments.length)throw new Error("json-variables/jVar(): [THROW_ID_07] Alas! Inputs are missing!");if(!D(e))throw new TypeError("json-variables/jVar(): [THROW_ID_08] Alas! The input must be a plain object! Currently it's: ".concat(Array.isArray(e)?"array":typeof e));if(t&&!D(t))throw new TypeError("json-variables/jVar(): [THROW_ID_09] Alas! An Optional Options Object must be a plain object! Currently it's: ".concat(Array.isArray(t)?"array":typeof t));let r=W(W({},mt),t);r.dontWrapVars?Array.isArray(r.dontWrapVars)||(r.dontWrapVars=S(r.dontWrapVars)):r.dontWrapVars=[];let n,a;if(r.dontWrapVars.length&&!r.dontWrapVars.every((o,u)=>$(o)?!0:(n=o,a=u,!1)))throw new Error('json-variables/jVar(): [THROW_ID_10] Alas! All variable names set in resolvedOpts.dontWrapVars should be of a string type. Computer detected a value "'.concat(n,'" at index ').concat(a,", which is not string but ").concat(Array.isArray(n)?"array":typeof n,"!"));if(r.heads==="")throw new Error("json-variables/jVar(): [THROW_ID_11] Alas! resolvedOpts.heads are empty!");if(r.tails==="")throw new Error("json-variables/jVar(): [THROW_ID_12] Alas! resolvedOpts.tails are empty!");if(r.lookForDataContainers&&r.dataContainerIdentifierTails==="")throw new Error("json-variables/jVar(): [THROW_ID_13] Alas! resolvedOpts.dataContainerIdentifierTails is empty!");if(r.heads===r.tails)throw new Error("json-variables/jVar(): [THROW_ID_14] Alas! resolvedOpts.heads and resolvedOpts.tails can't be equal!");if(r.heads===r.headsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_15] Alas! resolvedOpts.heads and resolvedOpts.headsNoWrap can't be equal!");if(r.tails===r.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_16] Alas! resolvedOpts.tails and resolvedOpts.tailsNoWrap can't be equal!");if(r.headsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_17] Alas! resolvedOpts.headsNoWrap is an empty string!");if(r.tailsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_18] Alas! resolvedOpts.tailsNoWrap is an empty string!");if(r.headsNoWrap===r.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_19] Alas! resolvedOpts.headsNoWrap and resolvedOpts.tailsNoWrap can't be equal!");let i,s=new Map;return Y(e,(o,u,f)=>{if(f.parentType==="object"&&typeof o=="string"&&ue(o,r))throw new Error("json-variables/jVar(): [THROW_ID_20] Alas! Object keys can't contain variables!\nPlease check the following key: ".concat(o));if(f.parentType==="object"?i=u:i=o,i==="")return i;if($(i)&&(r.heads.length&&I(i)===I(r.heads)||r.tails.length&&I(i)===I(r.tails)||r.headsNoWrap.length&&I(i)===I(r.headsNoWrap)||r.tailsNoWrap.length&&I(i)===I(r.tailsNoWrap))){if(!r.noSingleMarkers)return i;throw new Error("json-variables/jVar(): [THROW_ID_21] Alas! While processing the input, we stumbled upon ".concat(I(i)," which is equal to ").concat(I(i)===I(r.heads)?"heads":"").concat(I(i)===I(r.tails)?"tails":"").concat($(r.headsNoWrap)&&I(i)===I(r.headsNoWrap)?"headsNoWrap":"").concat($(r.tailsNoWrap)&&I(i)===I(r.tailsNoWrap)?"tailsNoWrap":"",'. If you wouldn\'t have set resolvedOpts.noSingleMarkers to "true" this error would not happen and computer would have left the current element (').concat(I(i),") alone"))}return $(i)&&ue(i,r)?bt(e,i,f.path,r,s):i})}return St(Er);})();
11
11
  /**
12
12
  * @name arrayiffy-if-string
13
13
  * @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
14
- * @version 5.2.2
14
+ * @version 5.2.3
15
15
  * @author Roy Revelt
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/arrayiffy-if-string/}
@@ -19,7 +19,7 @@
19
19
  /**
20
20
  * @name ast-monkey-traverse
21
21
  * @fileoverview Utility library to traverse AST
22
- * @version 4.3.0
22
+ * @version 4.3.1
23
23
  * @author Roy Revelt
24
24
  * @license MIT
25
25
  * {@link https://codsen.com/os/ast-monkey-traverse/}
@@ -27,7 +27,7 @@
27
27
  /**
28
28
  * @name codsen-format-diagnostic-value
29
29
  * @fileoverview Safely format untrusted JavaScript values for diagnostics
30
- * @version 1.1.0
30
+ * @version 1.1.1
31
31
  * @author Roy Revelt
32
32
  * @license MIT
33
33
  * {@link https://codsen.com/os/codsen-format-diagnostic-value/}
@@ -35,7 +35,7 @@
35
35
  /**
36
36
  * @name codsen-utils
37
37
  * @fileoverview Various utility functions
38
- * @version 1.10.0
38
+ * @version 1.10.2
39
39
  * @author Roy Revelt
40
40
  * @license MIT
41
41
  * {@link https://codsen.com/os/codsen-utils/}
@@ -43,7 +43,7 @@
43
43
  /**
44
44
  * @name ast-get-values-by-key
45
45
  * @fileoverview Extract values and paths from AST by keys OR set them by keys
46
- * @version 5.2.3
46
+ * @version 5.2.5
47
47
  * @author Roy Revelt
48
48
  * @license MIT
49
49
  * {@link https://codsen.com/os/ast-get-values-by-key/}
@@ -51,7 +51,7 @@
51
51
  /**
52
52
  * @name ranges-sort
53
53
  * @fileoverview Sort string index ranges
54
- * @version 6.2.2
54
+ * @version 6.2.4
55
55
  * @author Roy Revelt
56
56
  * @license MIT
57
57
  * {@link https://codsen.com/os/ranges-sort/}
@@ -59,7 +59,7 @@
59
59
  /**
60
60
  * @name ranges-merge
61
61
  * @fileoverview Merge and sort string index ranges
62
- * @version 9.2.3
62
+ * @version 9.2.5
63
63
  * @author Roy Revelt
64
64
  * @license MIT
65
65
  * {@link https://codsen.com/os/ranges-merge/}
@@ -67,7 +67,7 @@
67
67
  /**
68
68
  * @name ranges-apply
69
69
  * @fileoverview Take an array of string index ranges, delete/replace the string according to them
70
- * @version 7.2.3
70
+ * @version 7.2.5
71
71
  * @author Roy Revelt
72
72
  * @license MIT
73
73
  * {@link https://codsen.com/os/ranges-apply/}
@@ -75,7 +75,7 @@
75
75
  /**
76
76
  * @name string-collapse-leading-whitespace
77
77
  * @fileoverview Collapse the leading and trailing whitespace of a string
78
- * @version 7.3.0
78
+ * @version 7.3.1
79
79
  * @author Roy Revelt
80
80
  * @license MIT
81
81
  * {@link https://codsen.com/os/string-collapse-leading-whitespace/}
@@ -83,7 +83,7 @@
83
83
  /**
84
84
  * @name ranges-push
85
85
  * @fileoverview Gather string index ranges
86
- * @version 7.3.0
86
+ * @version 7.3.2
87
87
  * @author Roy Revelt
88
88
  * @license MIT
89
89
  * {@link https://codsen.com/os/ranges-push/}
@@ -91,7 +91,7 @@
91
91
  /**
92
92
  * @name string-match-left-right
93
93
  * @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
94
- * @version 9.2.3
94
+ * @version 9.2.5
95
95
  * @author Roy Revelt
96
96
  * @license MIT
97
97
  * {@link https://codsen.com/os/string-match-left-right/}
@@ -99,7 +99,7 @@
99
99
  /**
100
100
  * @name string-find-heads-tails
101
101
  * @fileoverview Finds where are arbitrary templating marker heads and tails located
102
- * @version 6.2.3
102
+ * @version 6.2.5
103
103
  * @author Roy Revelt
104
104
  * @license MIT
105
105
  * {@link https://codsen.com/os/string-find-heads-tails/}
@@ -107,7 +107,7 @@
107
107
  /**
108
108
  * @name string-trim-spaces-only
109
109
  * @fileoverview Like String.trim() but you can choose granularly what to trim
110
- * @version 5.3.0
110
+ * @version 5.3.1
111
111
  * @author Roy Revelt
112
112
  * @license MIT
113
113
  * {@link https://codsen.com/os/string-trim-spaces-only/}
@@ -115,7 +115,7 @@
115
115
  /**
116
116
  * @name string-remove-duplicate-heads-tails
117
117
  * @fileoverview Detect and (recursively) remove head and tail wrappings around the input string
118
- * @version 7.2.3
118
+ * @version 7.2.5
119
119
  * @author Roy Revelt
120
120
  * @license MIT
121
121
  * {@link https://codsen.com/os/string-remove-duplicate-heads-tails/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-variables",
3
- "version": "12.2.3",
3
+ "version": "12.2.5",
4
4
  "description": "Resolves custom-marked, cross-referenced paths in parsed JSON",
5
5
  "keywords": [
6
6
  "comb",
@@ -74,16 +74,16 @@
74
74
  "various": {}
75
75
  },
76
76
  "dependencies": {
77
- "arrayiffy-if-string": "^5.2.2",
78
- "ast-get-values-by-key": "^5.2.3",
79
- "ast-monkey-traverse": "^4.3.0",
80
- "codsen-utils": "^1.10.0",
77
+ "arrayiffy-if-string": "^5.2.3",
78
+ "ast-get-values-by-key": "^5.2.5",
79
+ "ast-monkey-traverse": "^4.3.1",
80
+ "codsen-utils": "^1.10.2",
81
81
  "object-path": "^0.11.8",
82
- "ranges-apply": "^7.2.3",
83
- "ranges-push": "^7.3.0",
84
- "string-find-heads-tails": "^6.2.3",
85
- "string-match-left-right": "^9.2.3",
86
- "string-remove-duplicate-heads-tails": "^7.2.3"
82
+ "ranges-apply": "^7.2.5",
83
+ "ranges-push": "^7.3.2",
84
+ "string-find-heads-tails": "^6.2.5",
85
+ "string-match-left-right": "^9.2.5",
86
+ "string-remove-duplicate-heads-tails": "^7.2.5"
87
87
  },
88
88
  "engines": {
89
89
  "node": ">=18.20.8"