json-variables 12.0.8 → 12.0.10
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/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/json-variables.esm.js +7 -7
- package/dist/json-variables.umd.js +79 -79
- package/package.json +10 -9
- package/types/index.d.ts +3 -4
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2010-
|
|
3
|
+
Copyright (c) 2010-2023 Roy Revelt and other contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/README.md
CHANGED
|
@@ -64,6 +64,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
|
|
|
64
64
|
|
|
65
65
|
MIT License.
|
|
66
66
|
|
|
67
|
-
Copyright © 2010-
|
|
67
|
+
Copyright © 2010-2023 Roy Revelt and other contributors.
|
|
68
68
|
|
|
69
69
|
<p align="center"><img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center"></p>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name json-variables
|
|
3
3
|
* @fileoverview Resolves custom-marked, cross-referenced paths in parsed JSON
|
|
4
|
-
* @version 12.0.
|
|
4
|
+
* @version 12.0.10
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/json-variables/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{
|
|
11
|
-
`;c=
|
|
10
|
+
import{matchLeftIncl as k,matchRightIncl as x}from"string-match-left-right";import{remDup as F}from"string-remove-duplicate-heads-tails";import{strFindHeadsTails as I}from"string-find-heads-tails";import{getByKey as _}from"ast-get-values-by-key";import{arrayiffy as B}from"arrayiffy-if-string";import{traverse as L}from"ast-monkey-traverse";import{rApply as O}from"ranges-apply";import h from"object-path";import{Ranges as U}from"ranges-push";import{isMatch as M}from"matcher";import{isPlainObject as w,existy as q,isBool as A,isNull as N,isStr as o,isNum as K}from"codsen-utils";var j="12.0.10";var ce=j,G=Object.prototype.hasOwnProperty,z={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(t){return o(t)?t.trim():t}function Y(t){if(o(t)&&t.length&&t.indexOf(".")!==-1){for(let e=0,r=t.length;e<r;e++)if(t[e]===".")return t.slice(0,e)}return t}function Q(t){if(o(t)&&t.length&&t.indexOf(".")!==-1){for(let e=0,r=t.length;e<r;e++)if(t[e]===".")return t.slice(e+1)}return t}function J(t){if(o(t)&&t.length&&t.indexOf(".")!==-1){for(let e=t.length;e--;)if(t[e]===".")return t.slice(0,e)}return t}function P(t){if(o(t)&&t.length&&t.indexOf(".")!==-1){for(let e=t.length;e--;)if(t[e]===".")return t.slice(e+1)}return t}function T(t,e){return!o(t)||!t.trim()?!1:!!(t.includes(e.heads)||t.includes(e.tails)||o(e.headsNoWrap)&&e.headsNoWrap.length&&t.includes(e.headsNoWrap)||o(e.tailsNoWrap)&&e.tailsNoWrap.length&&t.includes(e.tailsNoWrap))}function X(t,e,r){let l,s;return o(t)&&t.length&&x(t,0,e,{trimBeforeMatching:!0,cb:(n,a,i)=>(l=i,!0)})&&k(t,t.length-1,r,{trimBeforeMatching:!0,cb:(n,a,i)=>(s=(i||0)+1,!0)})?t.slice(l,s):t}function H(t,e,r=!1,l,s,n){if(e.wrapHeadsWith||(e.wrapHeadsWith=""),e.wrapTailsWith||(e.wrapTailsWith=""),o(t)&&!r&&e.wrapGlobalFlipSwitch&&!e.dontWrapVars.some(a=>M(n,a))&&(!e.preventDoubleWrapping||e.preventDoubleWrapping&&o(t)&&!t.includes(e.wrapHeadsWith)&&!t.includes(e.wrapTailsWith)))return`${e.wrapHeadsWith}${t}${e.wrapTailsWith}`;if(r){if(!o(t))return t;let a=F(t,{heads:e.wrapHeadsWith,tails:e.wrapTailsWith});return o(a)?X(a,e.wrapHeadsWith,e.wrapTailsWith):a}return t}function Z(t,e,r,l){let s;if(r.indexOf(".")!==-1){let n=r,a=!0;if(l.lookForDataContainers&&o(l.dataContainerIdentifierTails)&&l.dataContainerIdentifierTails.length&&!n.endsWith(l.dataContainerIdentifierTails)){let i=h.get(t,n+l.dataContainerIdentifierTails);w(i)&&h.get(i,e)&&(s=h.get(i,e),a=!1)}for(;a&&n.indexOf(".")!==-1;){if(n=J(n),P(n)===e)throw new Error(`json-variables/findValues(): [THROW_ID_20] While trying to resolve: "${e}" at path "${r}", we encountered a closed loop. The parent key "${P(n)}" is called the same as the variable "${e}" we're looking for.`);if(l.lookForDataContainers&&o(l.dataContainerIdentifierTails)&&l.dataContainerIdentifierTails.length&&!n.endsWith(l.dataContainerIdentifierTails)){let i=h.get(t,n+l.dataContainerIdentifierTails);w(i)&&h.get(i,e)&&(s=h.get(i,e),a=!1)}if(s===void 0){let i=h.get(t,n);w(i)&&h.get(i,e)&&(s=h.get(i,e),a=!1)}}}if(s===void 0){let n=h.get(t,e);n!==void 0&&(s=n)}if(s===void 0)if(e.indexOf(".")===-1){let n=_(t,e);if(n.length){for(let a=0,i=n.length;a<i;a++)if(o(n[a].val)||A(n[a].val)||N(n[a].val)){s=n[a].val;break}else if(K(n[a].val)){s=String(n[a].val);break}else if(Array.isArray(n[a].val)){s=n[a].val.join("");break}}}else{let n=_(t,Y(e));if(n.length)for(let a=0,i=n.length;a<i;a++){let m=h.get(n[a].val,Q(e));m&&o(m)&&(s=m)}}return s}function R(t,e,r,l,s=[]){if(s.includes(r)){let c="";if(s.length>1){let b=` \u2192
|
|
11
|
+
`;c=s.reduce((D,y,S)=>D+(S===0?"":b)+(y===r?"\u{1F4A5} ":" ")+y,` Here's the path we travelled up until we hit the recursion:
|
|
12
12
|
|
|
13
|
-
`),c+=`${b}\u{1F4A5} ${
|
|
14
|
-
${c}`)}let W=!1;d.length===1&&
|
|
15
|
-
${c}`)}d.length===1&&
|
|
16
|
-
Please check the following key: ${a}`);if(
|
|
13
|
+
`),c+=`${b}\u{1F4A5} ${r}`}throw new Error(`json-variables/resolveString(): [THROW_ID_19] While trying to resolve: "${e}" at path "${r}", we encountered a closed loop, the key is referencing itself."${c}`)}let n={},a=Array.from(s);a.push(r);let i=new U;function m(c,b,D){for(let y=0,S=c.length;y<S;y++){let f=c[y],p=e.slice(f.headsEndAt,f.tailsStartAt);if(p.length===0)i.push(f.headsStartAt,f.tailsEndAt);else if(G.call(n,p)&&o(n[p]))i.push(f.headsStartAt,f.tailsEndAt,n[p]);else{let g=Z(t,p.trim(),r,l);if(g===void 0)if(l.allowUnresolved===!0)g="";else if(o(l.allowUnresolved))g=l.allowUnresolved;else throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_18] We couldn't find the value to resolve the variable ${e.slice(f.headsEndAt,f.tailsStartAt)}. We're at path: "${r}".`);if(!D&&l.throwWhenNonStringInsertedInString&&!o(g))throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_23] While resolving the variable ${e.slice(f.headsEndAt,f.tailsStartAt)} at path ${r}, it resolved into a non-string value, ${JSON.stringify(g,null,4)}. This is happening because options setting "throwWhenNonStringInsertedInString" is active (set to "true").`);if(A(g)){if(l.resolveToBoolIfAnyValuesContainBool)return i.wipe(),l.resolveToFalseIfAnyValuesContainBool?!1:g;g=""}else{if(N(g)&&D)return i.wipe(),g;Array.isArray(g)?g=String(g.join("")):N(g)?g="":g=String(g)}let v=r.includes(".")?`${J(r)}.${p}`:p;if(T(g,l)){let V=H(R(t,g,v,l,a),l,b,a,v,p.trim());o(V)&&i.push(f.headsStartAt,f.tailsEndAt,V)}else{n[p]=g;let V=H(g,l,b,a,v,p.trim());o(V)&&i.push(f.headsStartAt,f.tailsEndAt,V)}}}}let d;try{d=I(e,l.heads,l.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(c){throw new Error(`json-variables/resolveString(): [THROW_ID_17] While trying to resolve string: "${e}" at path ${r}, something wrong with heads and tails was detected! Here's the internal error message:
|
|
14
|
+
${c}`)}let W=!1;d.length===1&&O(e,[[d[0].headsStartAt,d[0].tailsEndAt]]).trim()===""&&(W=!0);let $=m(d,!1,W);if(typeof $=="boolean"||$===null)return $;try{d=I(e,l.headsNoWrap,l.tailsNoWrap,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(c){throw new Error(`json-variables/resolveString(): [THROW_ID_22] While trying to resolve string: "${e}" at path ${r}, something wrong with no-wrap heads and no-wrap tails was detected! Here's the internal error message:
|
|
15
|
+
${c}`)}d.length===1&&O(e,[[d[0].headsStartAt,d[0].tailsEndAt]]).trim()===""&&(W=!0);let E=m(d,!0,W);return A(E)||N(E)?E:i?.current()?O(e,i.current()):e}function pe(t,e){if(!arguments.length)throw new Error("json-variables/jVar(): [THROW_ID_01] Alas! Inputs are missing!");if(!w(t))throw new TypeError(`json-variables/jVar(): [THROW_ID_02] Alas! The input must be a plain object! Currently it's: ${Array.isArray(t)?"array":typeof t}`);if(e&&!w(e))throw new TypeError(`json-variables/jVar(): [THROW_ID_03] Alas! An Optional Options Object must be a plain object! Currently it's: ${Array.isArray(e)?"array":typeof e}`);let r={...z,...e};r.dontWrapVars?Array.isArray(r.dontWrapVars)||(r.dontWrapVars=B(r.dontWrapVars)):r.dontWrapVars=[];let l,s;if(r.dontWrapVars.length&&!r.dontWrapVars.every((a,i)=>o(a)?!0:(l=a,s=i,!1)))throw new Error(`json-variables/jVar(): [THROW_ID_05] Alas! All variable names set in resolvedOpts.dontWrapVars should be of a string type. Computer detected a value "${l}" at index ${s}, which is not string but ${Array.isArray(l)?"array":typeof l}!`);if(r.heads==="")throw new Error("json-variables/jVar(): [THROW_ID_06] Alas! resolvedOpts.heads are empty!");if(r.tails==="")throw new Error("json-variables/jVar(): [THROW_ID_07] Alas! resolvedOpts.tails are empty!");if(r.lookForDataContainers&&r.dataContainerIdentifierTails==="")throw new Error("json-variables/jVar(): [THROW_ID_08] Alas! resolvedOpts.dataContainerIdentifierTails is empty!");if(r.heads===r.tails)throw new Error("json-variables/jVar(): [THROW_ID_09] Alas! resolvedOpts.heads and resolvedOpts.tails can't be equal!");if(r.heads===r.headsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_10] Alas! resolvedOpts.heads and resolvedOpts.headsNoWrap can't be equal!");if(r.tails===r.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_11] Alas! resolvedOpts.tails and resolvedOpts.tailsNoWrap can't be equal!");if(r.headsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_12] Alas! resolvedOpts.headsNoWrap is an empty string!");if(r.tailsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_13] Alas! resolvedOpts.tailsNoWrap is an empty string!");if(r.headsNoWrap===r.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_14] Alas! resolvedOpts.headsNoWrap and resolvedOpts.tailsNoWrap can't be equal!");let n;return L(t,(a,i,m)=>{if(q(i)&&T(a,r))throw new Error(`json-variables/jVar(): [THROW_ID_15] Alas! Object keys can't contain variables!
|
|
16
|
+
Please check the following key: ${a}`);if(i!==void 0?n=i:n=a,n==="")return n;if(r.heads.length&&u(n)===u(r.heads)||r.tails.length&&u(n)===u(r.tails)||r.headsNoWrap.length&&u(n)===u(r.headsNoWrap)||r.tailsNoWrap.length&&u(n)===u(r.tailsNoWrap)){if(!r.noSingleMarkers)return n;throw new Error(`json-variables/jVar(): [THROW_ID_16] Alas! While processing the input, we stumbled upon ${u(n)} which is equal to ${u(n)===u(r.heads)?"heads":""}${u(n)===u(r.tails)?"tails":""}${o(r.headsNoWrap)&&u(n)===u(r.headsNoWrap)?"headsNoWrap":""}${o(r.tailsNoWrap)&&u(n)===u(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 (${u(n)}) alone`)}return o(n)&&T(n,r)?R(t,n,m.path,r):n})}export{z as defaults,pe as jVar,ce as version};
|
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name json-variables
|
|
3
3
|
* @fileoverview Resolves custom-marked, cross-referenced paths in parsed JSON
|
|
4
|
-
* @version 12.0.
|
|
4
|
+
* @version 12.0.10
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/json-variables/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var jsonVariables=(()=>{var tr=Object.create;var q=Object.defineProperty,rr=Object.defineProperties,nr=Object.getOwnPropertyDescriptor,ir=Object.getOwnPropertyDescriptors,sr=Object.getOwnPropertyNames,qe=Object.getOwnPropertySymbols,ar=Object.getPrototypeOf,Ue=Object.prototype.hasOwnProperty,or=Object.prototype.propertyIsEnumerable;var me=(e,t,r)=>t in e?q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$=(e,t)=>{for(var r in t||(t={}))Ue.call(t,r)&&me(e,r,t[r]);if(qe)for(var r of qe(t))or.call(t,r)&&me(e,r,t[r]);return e},U=(e,t)=>rr(e,ir(t));var Ke=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),lr=(e,t)=>{for(var r in t)q(e,r,{get:t[r],enumerable:!0})},Ge=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of sr(t))!Ue.call(e,l)&&l!==r&&q(e,l,{get:()=>t[l],enumerable:!(i=nr(t,l))||i.enumerable});return e};var we=(e,t,r)=>(r=e!=null?tr(ar(e)):{},Ge(t||!e||!e.__esModule?q(r,"default",{value:e,enumerable:!0}):r,e)),ur=e=>Ge(q({},"__esModule",{value:!0}),e);var be=(e,t,r)=>(me(e,typeof t!="symbol"?t+"":t,r),r);var Ce=Ke((K,P)=>{var fr=200,at="__lodash_hash_undefined__",ot=9007199254740991,Ee="[object Arguments]",gr="[object Array]",lt="[object Boolean]",ut="[object Date]",hr="[object Error]",Se="[object Function]",ft="[object GeneratorFunction]",ee="[object Map]",gt="[object Number]",We="[object Object]",Qe="[object Promise]",ht="[object RegExp]",te="[object Set]",ct="[object String]",pt="[object Symbol]",$e="[object WeakMap]",dt="[object ArrayBuffer]",re="[object DataView]",yt="[object Float32Array]",mt="[object Float64Array]",wt="[object Int8Array]",bt="[object Int16Array]",Tt="[object Int32Array]",$t="[object Uint8Array]",vt="[object Uint8ClampedArray]",At="[object Uint16Array]",Ot="[object Uint32Array]",cr=/[\\^$.*+?()[\]{}|]/g,pr=/\w*$/,dr=/^\[object .+?Constructor\]$/,yr=/^(?:0|[1-9]\d*)$/,v={};v[Ee]=v[gr]=v[dt]=v[re]=v[lt]=v[ut]=v[yt]=v[mt]=v[wt]=v[bt]=v[Tt]=v[ee]=v[gt]=v[We]=v[ht]=v[te]=v[ct]=v[pt]=v[$t]=v[vt]=v[At]=v[Ot]=!0;v[hr]=v[Se]=v[$e]=!1;var mr=typeof global=="object"&&global&&global.Object===Object&&global,wr=typeof self=="object"&&self&&self.Object===Object&&self,x=mr||wr||Function("return this")(),_t=typeof K=="object"&&K&&!K.nodeType&&K,ze=_t&&typeof P=="object"&&P&&!P.nodeType&&P,br=ze&&ze.exports===_t;function Tr(e,t){return e.set(t[0],t[1]),e}function $r(e,t){return e.add(t),e}function vr(e,t){for(var r=-1,i=e?e.length:0;++r<i&&t(e[r],r,e)!==!1;);return e}function Ar(e,t){for(var r=-1,i=t.length,l=e.length;++r<i;)e[l+r]=t[r];return e}function It(e,t,r,i){var l=-1,n=e?e.length:0;for(i&&n&&(r=e[++l]);++l<n;)r=t(r,e[l],l,e);return r}function Or(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}function _r(e,t){return e==null?void 0:e[t]}function Et(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function Ze(e){var t=-1,r=Array(e.size);return e.forEach(function(i,l){r[++t]=[l,i]}),r}function De(e,t){return function(r){return e(t(r))}}function Ye(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}var Ir=Array.prototype,Er=Function.prototype,ne=Object.prototype,Te=x["__core-js_shared__"],Xe=function(){var e=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),St=Er.toString,R=ne.hasOwnProperty,ie=ne.toString,Sr=RegExp("^"+St.call(R).replace(cr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),et=br?x.Buffer:void 0,tt=x.Symbol,rt=x.Uint8Array,Wr=De(Object.getPrototypeOf,Object),Dr=Object.create,xr=ne.propertyIsEnumerable,Nr=Ir.splice,nt=Object.getOwnPropertySymbols,Rr=et?et.isBuffer:void 0,Cr=De(Object.keys,Object),ve=F(x,"DataView"),G=F(x,"Map"),Ae=F(x,"Promise"),Oe=F(x,"Set"),_e=F(x,"WeakMap"),Q=F(Object,"create"),Vr=M(ve),jr=M(G),Hr=M(Ae),Mr=M(Oe),Pr=M(_e),it=tt?tt.prototype:void 0,st=it?it.valueOf:void 0;function H(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Br(){this.__data__=Q?Q(null):{}}function Jr(e){return this.has(e)&&delete this.__data__[e]}function Fr(e){var t=this.__data__;if(Q){var r=t[e];return r===at?void 0:r}return R.call(t,e)?t[e]:void 0}function kr(e){var t=this.__data__;return Q?t[e]!==void 0:R.call(t,e)}function Lr(e,t){var r=this.__data__;return r[e]=Q&&t===void 0?at:t,this}H.prototype.clear=Br;H.prototype.delete=Jr;H.prototype.get=Fr;H.prototype.has=kr;H.prototype.set=Lr;function N(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function qr(){this.__data__=[]}function Ur(e){var t=this.__data__,r=se(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():Nr.call(t,r,1),!0}function Kr(e){var t=this.__data__,r=se(t,e);return r<0?void 0:t[r][1]}function Gr(e){return se(this.__data__,e)>-1}function Qr(e,t){var r=this.__data__,i=se(r,e);return i<0?r.push([e,t]):r[i][1]=t,this}N.prototype.clear=qr;N.prototype.delete=Ur;N.prototype.get=Kr;N.prototype.has=Gr;N.prototype.set=Qr;function B(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function zr(){this.__data__={hash:new H,map:new(G||N),string:new H}}function Zr(e){return ae(this,e).delete(e)}function Yr(e){return ae(this,e).get(e)}function Xr(e){return ae(this,e).has(e)}function en(e,t){return ae(this,e).set(e,t),this}B.prototype.clear=zr;B.prototype.delete=Zr;B.prototype.get=Yr;B.prototype.has=Xr;B.prototype.set=en;function J(e){this.__data__=new N(e)}function tn(){this.__data__=new N}function rn(e){return this.__data__.delete(e)}function nn(e){return this.__data__.get(e)}function sn(e){return this.__data__.has(e)}function an(e,t){var r=this.__data__;if(r instanceof N){var i=r.__data__;if(!G||i.length<fr-1)return i.push([e,t]),this;r=this.__data__=new B(i)}return r.set(e,t),this}J.prototype.clear=tn;J.prototype.delete=rn;J.prototype.get=nn;J.prototype.has=sn;J.prototype.set=an;function on(e,t){var r=Ne(e)||xn(e)?Or(e.length,String):[],i=r.length,l=!!i;for(var n in e)(t||R.call(e,n))&&!(l&&(n=="length"||En(n,i)))&&r.push(n);return r}function Wt(e,t,r){var i=e[t];(!(R.call(e,t)&&Rt(i,r))||r===void 0&&!(t in e))&&(e[t]=r)}function se(e,t){for(var r=e.length;r--;)if(Rt(e[r][0],t))return r;return-1}function ln(e,t){return e&&Dt(t,Re(t),e)}function Ie(e,t,r,i,l,n,o){var s;if(i&&(s=n?i(e,l,n,o):i(e)),s!==void 0)return s;if(!oe(e))return e;var g=Ne(e);if(g){if(s=On(e),!t)return $n(e,s)}else{var a=j(e),h=a==Se||a==ft;if(Rn(e))return pn(e,t);if(a==We||a==Ee||h&&!n){if(Et(e))return n?e:{};if(s=_n(h?{}:e),!t)return vn(e,ln(s,e))}else{if(!v[a])return n?e:{};s=In(e,a,Ie,t)}}o||(o=new J);var c=o.get(e);if(c)return c;if(o.set(e,s),!g)var T=r?An(e):Re(e);return vr(T||e,function(y,f){T&&(f=y,y=e[f]),Wt(s,f,Ie(y,t,r,i,f,e,o))}),s}function un(e){return oe(e)?Dr(e):{}}function fn(e,t,r){var i=t(e);return Ne(e)?i:Ar(i,r(e))}function gn(e){return ie.call(e)}function hn(e){if(!oe(e)||Wn(e))return!1;var t=Vt(e)||Et(e)?Sr:dr;return t.test(M(e))}function cn(e){if(!Nt(e))return Cr(e);var t=[];for(var r in Object(e))R.call(e,r)&&r!="constructor"&&t.push(r);return t}function pn(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function xe(e){var t=new e.constructor(e.byteLength);return new rt(t).set(new rt(e)),t}function dn(e,t){var r=t?xe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function yn(e,t,r){var i=t?r(Ze(e),!0):Ze(e);return It(i,Tr,new e.constructor)}function mn(e){var t=new e.constructor(e.source,pr.exec(e));return t.lastIndex=e.lastIndex,t}function wn(e,t,r){var i=t?r(Ye(e),!0):Ye(e);return It(i,$r,new e.constructor)}function bn(e){return st?Object(st.call(e)):{}}function Tn(e,t){var r=t?xe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function $n(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}function Dt(e,t,r,i){r||(r={});for(var l=-1,n=t.length;++l<n;){var o=t[l],s=i?i(r[o],e[o],o,r,e):void 0;Wt(r,o,s===void 0?e[o]:s)}return r}function vn(e,t){return Dt(e,xt(e),t)}function An(e){return fn(e,Re,xt)}function ae(e,t){var r=e.__data__;return Sn(t)?r[typeof t=="string"?"string":"hash"]:r.map}function F(e,t){var r=_r(e,t);return hn(r)?r:void 0}var xt=nt?De(nt,Object):jn,j=gn;(ve&&j(new ve(new ArrayBuffer(1)))!=re||G&&j(new G)!=ee||Ae&&j(Ae.resolve())!=Qe||Oe&&j(new Oe)!=te||_e&&j(new _e)!=$e)&&(j=function(e){var t=ie.call(e),r=t==We?e.constructor:void 0,i=r?M(r):void 0;if(i)switch(i){case Vr:return re;case jr:return ee;case Hr:return Qe;case Mr:return te;case Pr:return $e}return t});function On(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&R.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function _n(e){return typeof e.constructor=="function"&&!Nt(e)?un(Wr(e)):{}}function In(e,t,r,i){var l=e.constructor;switch(t){case dt:return xe(e);case lt:case ut:return new l(+e);case re:return dn(e,i);case yt:case mt:case wt:case bt:case Tt:case $t:case vt:case At:case Ot:return Tn(e,i);case ee:return yn(e,i,r);case gt:case ct:return new l(e);case ht:return mn(e);case te:return wn(e,i,r);case pt:return bn(e)}}function En(e,t){return t=t==null?ot:t,!!t&&(typeof e=="number"||yr.test(e))&&e>-1&&e%1==0&&e<t}function Sn(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Wn(e){return!!Xe&&Xe in e}function Nt(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ne;return e===r}function M(e){if(e!=null){try{return St.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Dn(e){return Ie(e,!0,!0)}function Rt(e,t){return e===t||e!==e&&t!==t}function xn(e){return Nn(e)&&R.call(e,"callee")&&(!xr.call(e,"callee")||ie.call(e)==Ee)}var Ne=Array.isArray;function Ct(e){return e!=null&&Cn(e.length)&&!Vt(e)}function Nn(e){return Vn(e)&&Ct(e)}var Rn=Rr||Hn;function Vt(e){var t=oe(e)?ie.call(e):"";return t==Se||t==ft}function Cn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ot}function oe(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Vn(e){return!!e&&typeof e=="object"}function Re(e){return Ct(e)?on(e):cn(e)}function jn(){return[]}function Hn(){return!1}P.exports=Dn});var Mt=Ke((Ht,he)=>{(function(e,t){"use strict";typeof he=="object"&&typeof he.exports=="object"?he.exports=t():typeof define=="function"&&define.amd?define([],t):e.objectPath=t()})(Ht,function(){"use strict";var e=Object.prototype.toString;function t(h,c){return h==null?!1:Object.prototype.hasOwnProperty.call(h,c)}function r(h){if(!h||n(h)&&h.length===0)return!0;if(typeof h!="string"){for(var c in h)if(t(h,c))return!1;return!0}return!1}function i(h){return e.call(h)}function l(h){return typeof h=="object"&&i(h)==="[object Object]"}var n=Array.isArray||function(h){return e.call(h)==="[object Array]"};function o(h){return typeof h=="boolean"||i(h)==="[object Boolean]"}function s(h){var c=parseInt(h);return c.toString()===h?c:h}function g(h){h=h||{};var c=function(d){return Object.keys(c).reduce(function(u,p){return p==="create"||typeof c[p]=="function"&&(u[p]=c[p].bind(c,d)),u},{})},T;h.includeInheritedProps?T=function(){return!0}:T=function(d,u){return typeof u=="number"&&Array.isArray(d)||t(d,u)};function y(d,u){if(T(d,u))return d[u]}var f;h.includeInheritedProps?f=function(d,u){typeof u!="string"&&typeof u!="number"&&(u=String(u));var p=y(d,u);if(u==="__proto__"||u==="prototype"||u==="constructor"&&typeof p=="function")throw new Error("For security reasons, object's magic properties cannot be set");return p}:f=function(d,u){return y(d,u)};function w(d,u,p,m){if(typeof u=="number"&&(u=[u]),!u||u.length===0)return d;if(typeof u=="string")return w(d,u.split(".").map(s),p,m);var b=u[0],A=f(d,b);return u.length===1?((A===void 0||!m)&&(d[b]=p),A):(A===void 0&&(typeof u[1]=="number"?d[b]=[]:d[b]={}),w(d[b],u.slice(1),p,m))}return c.has=function(d,u){if(typeof u=="number"?u=[u]:typeof u=="string"&&(u=u.split(".")),!u||u.length===0)return!!d;for(var p=0;p<u.length;p++){var m=s(u[p]);if(typeof m=="number"&&n(d)&&m<d.length||(h.includeInheritedProps?m in Object(d):t(d,m)))d=d[m];else return!1}return!0},c.ensureExists=function(d,u,p){return w(d,u,p,!0)},c.set=function(d,u,p,m){return w(d,u,p,m)},c.insert=function(d,u,p,m){var b=c.get(d,u);m=~~m,n(b)||(b=[],c.set(d,u,b)),b.splice(m,0,p)},c.empty=function(d,u){if(!r(u)&&d!=null){var p,m;if(p=c.get(d,u)){if(typeof p=="string")return c.set(d,u,"");if(o(p))return c.set(d,u,!1);if(typeof p=="number")return c.set(d,u,0);if(n(p))p.length=0;else if(l(p))for(m in p)T(p,m)&&delete p[m];else return c.set(d,u,null)}}},c.push=function(d,u){var p=c.get(d,u);n(p)||(p=[],c.set(d,u,p)),p.push.apply(p,Array.prototype.slice.call(arguments,2))},c.coalesce=function(d,u,p){for(var m,b=0,A=u.length;b<A;b++)if((m=c.get(d,u[b]))!==void 0)return m;return p},c.get=function(d,u,p){if(typeof u=="number"&&(u=[u]),!u||u.length===0)return d;if(d==null)return p;if(typeof u=="string")return c.get(d,u.split("."),p);var m=s(u[0]),b=f(d,m);return b===void 0?p:u.length===1?b:c.get(d[m],u.slice(1),p)},c.del=function(u,p){if(typeof p=="number"&&(p=[p]),u==null||r(p))return u;if(typeof p=="string")return c.del(u,p.split("."));var m=s(p[0]);if(f(u,m),!T(u,m))return u;if(p.length===1)n(u)?u.splice(m,1):delete u[m];else return c.del(u[m],p.slice(1));return u},c}var a=g();return a.create=g,a.withInheritedProps=g({includeInheritedProps:!0}),a})});var oi={};lr(oi,{defaults:()=>Yt,jVar:()=>ai,version:()=>Yn});var ue=we(Ce(),1);function le(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function Mn(e){if(e.includes(".")){let t=e.lastIndexOf(".");if(!e.slice(0,t).includes("."))return e.slice(0,t);for(let r=t-1;r--;)if(e[r]===".")return e.slice(r+1,t)}return null}var Ve=Mn;function fe(e,t){let r={now:!1};function i(l,n,o,s){let g=(0,ue.default)(l),a,h=$({depth:-1,path:""},o);if(h.depth+=1,Array.isArray(g))for(let c=0,T=g.length;c<T&&!s.now;c++){let y=h.path?`${h.path}.${c}`:`${c}`;g[c]!==void 0?(h.parent=(0,ue.default)(g),h.parentType="array",h.parentKey=Ve(y),a=i(n(g[c],void 0,U($({},h),{path:y}),s),n,U($({},h),{path:y}),s),Number.isNaN(a)&&c<g.length?(g.splice(c,1),c-=1):g[c]=a):g.splice(c,1)}else if(le(g))for(let c in g){if(s.now&&c!=null)break;let T=h.path?`${h.path}.${c}`:c;h.depth===0&&c!=null&&(h.topmostKey=c),h.parent=(0,ue.default)(g),h.parentType="object",h.parentKey=Ve(T),a=i(n(c,g[c],U($({},h),{path:T}),s),n,U($({},h),{path:T}),s),Number.isNaN(a)?delete g[c]:g[c]=a}return g}return i(e,t,{},r)}function je(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var He=new Map,jt=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError(`Expected '${t}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter(r=>{if(typeof r!="string"){if(typeof r>"u")return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof r}' in the array`)}return!0})},Pn=(e,t)=>{t=$({caseSensitive:!1},t);let r=e+JSON.stringify(t);if(He.has(r))return He.get(r);let i=e[0]==="!";i&&(e=e.slice(1)),e=je(e).replace(/\\\*/g,"[\\s\\S]*");let l=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return l.negated=i,He.set(r,l),l},Bn=(e,t,r,i)=>{if(e=jt(e,"inputs"),t=jt(t,"patterns"),t.length===0)return[];t=t.map(o=>Pn(o,r));let{allPatterns:l}=r||{},n=[];for(let o of e){let s,g=[...t].fill(!1);for(let[a,h]of t.entries())if(h.test(o)&&(g[a]=!0,s=!h.negated,!s))break;if(!(s===!1||s===void 0&&t.some(a=>!a.negated)||l&&g.some((a,h)=>!a&&!t[h].negated))&&(n.push(o),i))break}return n};function ge(e,t,r){return Bn(e,t,r,!0).length>0}var W=we(Mt(),1);function I(e){return typeof e!="string"?e:e.length?[e]:[]}function Pt(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ce(e){return typeof e=="string"}var Bt={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},Jn=e=>e+1;function Fn(e,t,r,i,l=!1,n=Jn){let o=typeof r=="function"?r():r;if(+t<0&&l&&o==="EOL")return o;let s=$($({},Bt),i);if(t>=e.length&&!l)return!1;let g=l?1:r.length,a=0,h=!1,c=!1,T=!1,y=s.maxMismatches,f=t,w=!1,d=!1,u=!1;function p(){return a===1&&y<s.maxMismatches-1}for(;e[f];){let m=n(f);if(s.trimBeforeMatching&&e[f].trim()===""){if(!e[m]&&l&&r==="EOL")return!0;f=n(f);continue}if(s&&!s.i&&s.trimCharsBeforeMatching&&s.trimCharsBeforeMatching.includes(e[f])||s!=null&&s.i&&s.trimCharsBeforeMatching&&s.trimCharsBeforeMatching.map(A=>A.toLowerCase()).includes(e[f].toLowerCase())){if(l&&r==="EOL"&&!e[m])return!0;f=n(f);continue}let b=m>f?r[r.length-g]:r[g-1];if(!s.i&&e[f]===b||s.i&&e[f].toLowerCase()===b.toLowerCase()){if(w||(w=!0),T||(T=!0),g===r.length){if(d=!0,y!==s.maxMismatches)return!1}else g===1&&(u=!0);if(g-=1,a++,p())return!1;if(!g)return a!==r.length||y===s.maxMismatches||!h?f:!1}else if(!h&&!a&&(h=!0),s.maxMismatches&&y&&f){y-=1;for(let A=0;A<=y;A++){let E=m>f?r[r.length-g+1+A]:r[g-2-A],ye=e[n(f)];if(E&&(!s.i&&e[f]===E||s.i&&e[f].toLowerCase()===E.toLowerCase())&&(!s.firstMustMatch||g!==r.length)){if(a++,p())return!1;g-=2,w=!0;break}else if(ye&&E&&(!s.i&&ye===E||s.i&&ye.toLowerCase()===E.toLowerCase())&&(!s.firstMustMatch||g!==r.length)){if(!a&&!s.hungry)return!1;g-=1,w=!0;break}else if(E===void 0&&y>=0&&w&&(!s.firstMustMatch||d)&&(!s.lastMustMatch||u))return f}w||(c=f)}else return f===0&&g===1&&!s.lastMustMatch&&T?0:!1;if(c!==!1&&c!==f&&(c=!1),g<1)return f;f=n(f)}if(g>0)return l&&o==="EOL"?!0:s&&s.maxMismatches>=g&&T?c||0:!1}function Jt(e,t,r,i,l){var h,c;if(Pt(l)&&Object.prototype.hasOwnProperty.call(l,"trimBeforeMatching")&&l&&typeof l.trimBeforeMatching!="boolean")throw new Error(`string-match-left-right/${e}(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!${Array.isArray(l.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""}`);let n=$($({},Bt),l);if(typeof n.trimCharsBeforeMatching=="string"&&(n.trimCharsBeforeMatching=I(n.trimCharsBeforeMatching)),n.trimCharsBeforeMatching=n.trimCharsBeforeMatching.map(T=>ce(T)?T:String(T)),!ce(t)||!t.length)return!1;if(!Number.isInteger(r)||r<0)throw new Error(`string-match-left-right/${e}(): [THROW_ID_03] the second argument should be a natural number. Currently it's of a type: ${typeof r}, equal to:
|
|
11
|
-
${JSON.stringify(
|
|
12
|
-
${JSON.stringify(i,null,4)}`);if(l&&!
|
|
13
|
-
${JSON.stringify(l,null,4)}`);let
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
"use strict";var jsonVariables=(()=>{var Zr=Object.create;var U=Object.defineProperty,Yr=Object.defineProperties,Xr=Object.getOwnPropertyDescriptor,et=Object.getOwnPropertyDescriptors,rt=Object.getOwnPropertyNames,Je=Object.getOwnPropertySymbols,tt=Object.getPrototypeOf,Fe=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable;var de=(e,r,t)=>r in e?U(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,v=(e,r)=>{for(var t in r||(r={}))Fe.call(r,t)&&de(e,t,r[t]);if(Je)for(var t of Je(r))nt.call(r,t)&&de(e,t,r[t]);return e},K=(e,r)=>Yr(e,et(r));var ke=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),it=(e,r)=>{for(var t in r)U(e,t,{get:r[t],enumerable:!0})},Le=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of rt(r))!Fe.call(e,l)&&l!==t&&U(e,l,{get:()=>r[l],enumerable:!(i=Xr(r,l))||i.enumerable});return e};var ye=(e,r,t)=>(t=e!=null?Zr(tt(e)):{},Le(r||!e||!e.__esModule?U(t,"default",{value:e,enumerable:!0}):t,e)),at=e=>Le(U({},"__esModule",{value:!0}),e);var me=(e,r,t)=>(de(e,typeof r!="symbol"?r+"":r,t),t);var Re=ke((Z,F)=>{var pt=200,hr="__lodash_hash_undefined__",gr=9007199254740991,Se="[object Arguments]",dt="[object Array]",pr="[object Boolean]",dr="[object Date]",yt="[object Error]",Ee="[object Function]",yr="[object GeneratorFunction]",te="[object Map]",mr="[object Number]",We="[object Object]",rr="[object Promise]",wr="[object RegExp]",ne="[object Set]",br="[object String]",Tr="[object Symbol]",$e="[object WeakMap]",$r="[object ArrayBuffer]",ie="[object DataView]",vr="[object Float32Array]",Or="[object Float64Array]",Ar="[object Int8Array]",_r="[object Int16Array]",Ir="[object Int32Array]",Sr="[object Uint8Array]",Er="[object Uint8ClampedArray]",Wr="[object Uint16Array]",Dr="[object Uint32Array]",mt=/[\\^$.*+?()[\]{}|]/g,wt=/\w*$/,bt=/^\[object .+?Constructor\]$/,Tt=/^(?:0|[1-9]\d*)$/,O={};O[Se]=O[dt]=O[$r]=O[ie]=O[pr]=O[dr]=O[vr]=O[Or]=O[Ar]=O[_r]=O[Ir]=O[te]=O[mr]=O[We]=O[wr]=O[ne]=O[br]=O[Tr]=O[Sr]=O[Er]=O[Wr]=O[Dr]=!0;O[yt]=O[Ee]=O[$e]=!1;var $t=typeof global=="object"&&global&&global.Object===Object&&global,vt=typeof self=="object"&&self&&self.Object===Object&&self,C=$t||vt||Function("return this")(),xr=typeof Z=="object"&&Z&&!Z.nodeType&&Z,tr=xr&&typeof F=="object"&&F&&!F.nodeType&&F,Ot=tr&&tr.exports===xr;function At(e,r){return e.set(r[0],r[1]),e}function _t(e,r){return e.add(r),e}function It(e,r){for(var t=-1,i=e?e.length:0;++t<i&&r(e[t],t,e)!==!1;);return e}function St(e,r){for(var t=-1,i=r.length,l=e.length;++t<i;)e[l+t]=r[t];return e}function Nr(e,r,t,i){var l=-1,n=e?e.length:0;for(i&&n&&(t=e[++l]);++l<n;)t=r(t,e[l],l,e);return t}function Et(e,r){for(var t=-1,i=Array(e);++t<e;)i[t]=r(t);return i}function Wt(e,r){return e==null?void 0:e[r]}function Cr(e){var r=!1;if(e!=null&&typeof e.toString!="function")try{r=!!(e+"")}catch(t){}return r}function nr(e){var r=-1,t=Array(e.size);return e.forEach(function(i,l){t[++r]=[l,i]}),t}function De(e,r){return function(t){return e(r(t))}}function ir(e){var r=-1,t=Array(e.size);return e.forEach(function(i){t[++r]=i}),t}var Dt=Array.prototype,xt=Function.prototype,ae=Object.prototype,Te=C["__core-js_shared__"],ar=function(){var e=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Rr=xt.toString,V=ae.hasOwnProperty,se=ae.toString,Nt=RegExp("^"+Rr.call(V).replace(mt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),sr=Ot?C.Buffer:void 0,or=C.Symbol,lr=C.Uint8Array,Ct=De(Object.getPrototypeOf,Object),Rt=Object.create,Vt=ae.propertyIsEnumerable,jt=Dt.splice,ur=Object.getOwnPropertySymbols,Ht=sr?sr.isBuffer:void 0,Mt=De(Object.keys,Object),ve=q(C,"DataView"),Y=q(C,"Map"),Oe=q(C,"Promise"),Ae=q(C,"Set"),_e=q(C,"WeakMap"),X=q(Object,"create"),Pt=M(ve),Bt=M(Y),Jt=M(Oe),Ft=M(Ae),kt=M(_e),fr=or?or.prototype:void 0,cr=fr?fr.valueOf:void 0;function H(e){var r=-1,t=e?e.length:0;for(this.clear();++r<t;){var i=e[r];this.set(i[0],i[1])}}function Lt(){this.__data__=X?X(null):{}}function qt(e){return this.has(e)&&delete this.__data__[e]}function Ut(e){var r=this.__data__;if(X){var t=r[e];return t===hr?void 0:t}return V.call(r,e)?r[e]:void 0}function Kt(e){var r=this.__data__;return X?r[e]!==void 0:V.call(r,e)}function Gt(e,r){var t=this.__data__;return t[e]=X&&r===void 0?hr:r,this}H.prototype.clear=Lt;H.prototype.delete=qt;H.prototype.get=Ut;H.prototype.has=Kt;H.prototype.set=Gt;function R(e){var r=-1,t=e?e.length:0;for(this.clear();++r<t;){var i=e[r];this.set(i[0],i[1])}}function Qt(){this.__data__=[]}function zt(e){var r=this.__data__,t=oe(r,e);if(t<0)return!1;var i=r.length-1;return t==i?r.pop():jt.call(r,t,1),!0}function Zt(e){var r=this.__data__,t=oe(r,e);return t<0?void 0:r[t][1]}function Yt(e){return oe(this.__data__,e)>-1}function Xt(e,r){var t=this.__data__,i=oe(t,e);return i<0?t.push([e,r]):t[i][1]=r,this}R.prototype.clear=Qt;R.prototype.delete=zt;R.prototype.get=Zt;R.prototype.has=Yt;R.prototype.set=Xt;function k(e){var r=-1,t=e?e.length:0;for(this.clear();++r<t;){var i=e[r];this.set(i[0],i[1])}}function en(){this.__data__={hash:new H,map:new(Y||R),string:new H}}function rn(e){return le(this,e).delete(e)}function tn(e){return le(this,e).get(e)}function nn(e){return le(this,e).has(e)}function an(e,r){return le(this,e).set(e,r),this}k.prototype.clear=en;k.prototype.delete=rn;k.prototype.get=tn;k.prototype.has=nn;k.prototype.set=an;function L(e){this.__data__=new R(e)}function sn(){this.__data__=new R}function on(e){return this.__data__.delete(e)}function ln(e){return this.__data__.get(e)}function un(e){return this.__data__.has(e)}function fn(e,r){var t=this.__data__;if(t instanceof R){var i=t.__data__;if(!Y||i.length<pt-1)return i.push([e,r]),this;t=this.__data__=new k(i)}return t.set(e,r),this}L.prototype.clear=sn;L.prototype.delete=on;L.prototype.get=ln;L.prototype.has=un;L.prototype.set=fn;function cn(e,r){var t=Ne(e)||Vn(e)?Et(e.length,String):[],i=t.length,l=!!i;for(var n in e)(r||V.call(e,n))&&!(l&&(n=="length"||xn(n,i)))&&t.push(n);return t}function Vr(e,r,t){var i=e[r];(!(V.call(e,r)&&Pr(i,t))||t===void 0&&!(r in e))&&(e[r]=t)}function oe(e,r){for(var t=e.length;t--;)if(Pr(e[t][0],r))return t;return-1}function hn(e,r){return e&&jr(r,Ce(r),e)}function Ie(e,r,t,i,l,n,o){var s;if(i&&(s=n?i(e,l,n,o):i(e)),s!==void 0)return s;if(!ue(e))return e;var p=Ne(e);if(p){if(s=En(e),!r)return _n(e,s)}else{var a=j(e),c=a==Ee||a==yr;if(Hn(e))return wn(e,r);if(a==We||a==Se||c&&!n){if(Cr(e))return n?e:{};if(s=Wn(c?{}:e),!r)return In(e,hn(s,e))}else{if(!O[a])return n?e:{};s=Dn(e,a,Ie,r)}}o||(o=new L);var h=o.get(e);if(h)return h;if(o.set(e,s),!p)var T=t?Sn(e):Ce(e);return It(T||e,function(y,f){T&&(f=y,y=e[f]),Vr(s,f,Ie(y,r,t,i,f,e,o))}),s}function gn(e){return ue(e)?Rt(e):{}}function pn(e,r,t){var i=r(e);return Ne(e)?i:St(i,t(e))}function dn(e){return se.call(e)}function yn(e){if(!ue(e)||Cn(e))return!1;var r=Jr(e)||Cr(e)?Nt:bt;return r.test(M(e))}function mn(e){if(!Mr(e))return Mt(e);var r=[];for(var t in Object(e))V.call(e,t)&&t!="constructor"&&r.push(t);return r}function wn(e,r){if(r)return e.slice();var t=new e.constructor(e.length);return e.copy(t),t}function xe(e){var r=new e.constructor(e.byteLength);return new lr(r).set(new lr(e)),r}function bn(e,r){var t=r?xe(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}function Tn(e,r,t){var i=r?t(nr(e),!0):nr(e);return Nr(i,At,new e.constructor)}function $n(e){var r=new e.constructor(e.source,wt.exec(e));return r.lastIndex=e.lastIndex,r}function vn(e,r,t){var i=r?t(ir(e),!0):ir(e);return Nr(i,_t,new e.constructor)}function On(e){return cr?Object(cr.call(e)):{}}function An(e,r){var t=r?xe(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}function _n(e,r){var t=-1,i=e.length;for(r||(r=Array(i));++t<i;)r[t]=e[t];return r}function jr(e,r,t,i){t||(t={});for(var l=-1,n=r.length;++l<n;){var o=r[l],s=i?i(t[o],e[o],o,t,e):void 0;Vr(t,o,s===void 0?e[o]:s)}return t}function In(e,r){return jr(e,Hr(e),r)}function Sn(e){return pn(e,Ce,Hr)}function le(e,r){var t=e.__data__;return Nn(r)?t[typeof r=="string"?"string":"hash"]:t.map}function q(e,r){var t=Wt(e,r);return yn(t)?t:void 0}var Hr=ur?De(ur,Object):Bn,j=dn;(ve&&j(new ve(new ArrayBuffer(1)))!=ie||Y&&j(new Y)!=te||Oe&&j(Oe.resolve())!=rr||Ae&&j(new Ae)!=ne||_e&&j(new _e)!=$e)&&(j=function(e){var r=se.call(e),t=r==We?e.constructor:void 0,i=t?M(t):void 0;if(i)switch(i){case Pt:return ie;case Bt:return te;case Jt:return rr;case Ft:return ne;case kt:return $e}return r});function En(e){var r=e.length,t=e.constructor(r);return r&&typeof e[0]=="string"&&V.call(e,"index")&&(t.index=e.index,t.input=e.input),t}function Wn(e){return typeof e.constructor=="function"&&!Mr(e)?gn(Ct(e)):{}}function Dn(e,r,t,i){var l=e.constructor;switch(r){case $r:return xe(e);case pr:case dr:return new l(+e);case ie:return bn(e,i);case vr:case Or:case Ar:case _r:case Ir:case Sr:case Er:case Wr:case Dr:return An(e,i);case te:return Tn(e,i,t);case mr:case br:return new l(e);case wr:return $n(e);case ne:return vn(e,i,t);case Tr:return On(e)}}function xn(e,r){return r=r==null?gr:r,!!r&&(typeof e=="number"||Tt.test(e))&&e>-1&&e%1==0&&e<r}function Nn(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function Cn(e){return!!ar&&ar in e}function Mr(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||ae;return e===t}function M(e){if(e!=null){try{return Rr.call(e)}catch(r){}try{return e+""}catch(r){}}return""}function Rn(e){return Ie(e,!0,!0)}function Pr(e,r){return e===r||e!==e&&r!==r}function Vn(e){return jn(e)&&V.call(e,"callee")&&(!Vt.call(e,"callee")||se.call(e)==Se)}var Ne=Array.isArray;function Br(e){return e!=null&&Mn(e.length)&&!Jr(e)}function jn(e){return Pn(e)&&Br(e)}var Hn=Ht||Jn;function Jr(e){var r=ue(e)?se.call(e):"";return r==Ee||r==yr}function Mn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=gr}function ue(e){var r=typeof e;return!!e&&(r=="object"||r=="function")}function Pn(e){return!!e&&typeof e=="object"}function Ce(e){return Br(e)?cn(e):mn(e)}function Bn(){return[]}function Jn(){return!1}F.exports=Rn});var Lr=ke((kr,ge)=>{(function(e,r){"use strict";typeof ge=="object"&&typeof ge.exports=="object"?ge.exports=r():typeof define=="function"&&define.amd?define([],r):e.objectPath=r()})(kr,function(){"use strict";var e=Object.prototype.toString;function r(c,h){return c==null?!1:Object.prototype.hasOwnProperty.call(c,h)}function t(c){if(!c||n(c)&&c.length===0)return!0;if(typeof c!="string"){for(var h in c)if(r(c,h))return!1;return!0}return!1}function i(c){return e.call(c)}function l(c){return typeof c=="object"&&i(c)==="[object Object]"}var n=Array.isArray||function(c){return e.call(c)==="[object Array]"};function o(c){return typeof c=="boolean"||i(c)==="[object Boolean]"}function s(c){var h=parseInt(c);return h.toString()===c?h:c}function p(c){c=c||{};var h=function(d){return Object.keys(h).reduce(function(u,g){return g==="create"||typeof h[g]=="function"&&(u[g]=h[g].bind(h,d)),u},{})},T;c.includeInheritedProps?T=function(){return!0}:T=function(d,u){return typeof u=="number"&&Array.isArray(d)||r(d,u)};function y(d,u){if(T(d,u))return d[u]}var f;c.includeInheritedProps?f=function(d,u){typeof u!="string"&&typeof u!="number"&&(u=String(u));var g=y(d,u);if(u==="__proto__"||u==="prototype"||u==="constructor"&&typeof g=="function")throw new Error("For security reasons, object's magic properties cannot be set");return g}:f=function(d,u){return y(d,u)};function w(d,u,g,m){if(typeof u=="number"&&(u=[u]),!u||u.length===0)return d;if(typeof u=="string")return w(d,u.split(".").map(s),g,m);var b=u[0],A=f(d,b);return u.length===1?((A===void 0||!m)&&(d[b]=g),A):(A===void 0&&(typeof u[1]=="number"?d[b]=[]:d[b]={}),w(d[b],u.slice(1),g,m))}return h.has=function(d,u){if(typeof u=="number"?u=[u]:typeof u=="string"&&(u=u.split(".")),!u||u.length===0)return!!d;for(var g=0;g<u.length;g++){var m=s(u[g]);if(typeof m=="number"&&n(d)&&m<d.length||(c.includeInheritedProps?m in Object(d):r(d,m)))d=d[m];else return!1}return!0},h.ensureExists=function(d,u,g){return w(d,u,g,!0)},h.set=function(d,u,g,m){return w(d,u,g,m)},h.insert=function(d,u,g,m){var b=h.get(d,u);m=~~m,n(b)||(b=[],h.set(d,u,b)),b.splice(m,0,g)},h.empty=function(d,u){if(!t(u)&&d!=null){var g,m;if(g=h.get(d,u)){if(typeof g=="string")return h.set(d,u,"");if(o(g))return h.set(d,u,!1);if(typeof g=="number")return h.set(d,u,0);if(n(g))g.length=0;else if(l(g))for(m in g)T(g,m)&&delete g[m];else return h.set(d,u,null)}}},h.push=function(d,u){var g=h.get(d,u);n(g)||(g=[],h.set(d,u,g)),g.push.apply(g,Array.prototype.slice.call(arguments,2))},h.coalesce=function(d,u,g){for(var m,b=0,A=u.length;b<A;b++)if((m=h.get(d,u[b]))!==void 0)return m;return g},h.get=function(d,u,g){if(typeof u=="number"&&(u=[u]),!u||u.length===0)return d;if(d==null)return g;if(typeof u=="string")return h.get(d,u.split("."),g);var m=s(u[0]),b=f(d,m);return b===void 0?g:u.length===1?b:h.get(d[m],u.slice(1),g)},h.del=function(u,g){if(typeof g=="number"&&(g=[g]),u==null||t(g))return u;if(typeof g=="string")return h.del(u,g.split("."));var m=s(g[0]);if(f(u,m),!T(u,m))return u;if(g.length===1)n(u)?u.splice(m,1):delete u[m];else return h.del(u[m],g.slice(1));return u},h}var a=p();return a.create=p,a.withInheritedProps=p({includeInheritedProps:!0}),a})});var Xn={};it(Xn,{defaults:()=>Gr,jVar:()=>Yn,version:()=>Un});function S(e){return typeof e!="string"?e:e.length?[e]:[]}function I(e){if(e==null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function $(e){return typeof e=="string"}function qe(e){return Number.isFinite(e)}function N(e){return Number.isSafeInteger(e)&&e>=0}function ee(e){return typeof e=="boolean"}function G(e){return e===null}function W(e){return e!=null}function Ue(e,r){return I(e)&&$(r)&&Object.prototype.hasOwnProperty.call(e,r)}var Ke={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},st=e=>e+1;function ot(e,r,t,i,l=!1,n=st){let o=typeof t=="function"?t():t;if(+r<0&&l&&o==="EOL")return o;let s=v(v({},Ke),i);if(r>=e.length&&!l)return!1;let p=l?1:t.length,a=0,c=!1,h=!1,T=!1,y=s.maxMismatches,f=r,w=!1,d=!1,u=!1;function g(){return a===1&&y<s.maxMismatches-1}for(;e[f];){let m=n(f);if(s.trimBeforeMatching&&e[f].trim()===""){if(!e[m]&&l&&t==="EOL")return!0;f=n(f);continue}if(s&&!s.i&&s.trimCharsBeforeMatching&&s.trimCharsBeforeMatching.includes(e[f])||s!=null&&s.i&&s.trimCharsBeforeMatching&&s.trimCharsBeforeMatching.map(A=>A.toLowerCase()).includes(e[f].toLowerCase())){if(l&&t==="EOL"&&!e[m])return!0;f=n(f);continue}let b=m>f?t[t.length-p]:t[p-1];if(!s.i&&e[f]===b||s.i&&e[f].toLowerCase()===b.toLowerCase()){if(w||(w=!0),T||(T=!0),p===t.length){if(d=!0,y!==s.maxMismatches)return!1}else p===1&&(u=!0);if(p-=1,a++,g())return!1;if(!p)return a!==t.length||y===s.maxMismatches||!c?f:!1}else if(!c&&!a&&(c=!0),s.maxMismatches&&y&&f){y-=1;for(let A=0;A<=y;A++){let E=m>f?t[t.length-p+1+A]:t[p-2-A],pe=e[n(f)];if(E&&(!s.i&&e[f]===E||s.i&&e[f].toLowerCase()===E.toLowerCase())&&(!s.firstMustMatch||p!==t.length)){if(a++,g())return!1;p-=2,w=!0;break}else if(pe&&E&&(!s.i&&pe===E||s.i&&pe.toLowerCase()===E.toLowerCase())&&(!s.firstMustMatch||p!==t.length)){if(!a&&!s.hungry)return!1;p-=1,w=!0;break}else if(E===void 0&&y>=0&&w&&(!s.firstMustMatch||d)&&(!s.lastMustMatch||u))return f}w||(h=f)}else return f===0&&p===1&&!s.lastMustMatch&&T?0:!1;if(h!==!1&&h!==f&&(h=!1),p<1)return f;f=n(f)}if(p>0)return l&&o==="EOL"?!0:s&&s.maxMismatches>=p&&T?h||0:!1}function Ge(e,r,t,i,l){var c,h;if(I(l)&&Ue(l,"trimBeforeMatching")&&l&&typeof l.trimBeforeMatching!="boolean")throw new Error(`string-match-left-right/${e}(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!${Array.isArray(l.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""}`);let n=v(v({},Ke),l);if(typeof n.trimCharsBeforeMatching=="string"&&(n.trimCharsBeforeMatching=S(n.trimCharsBeforeMatching)),n.trimCharsBeforeMatching=n.trimCharsBeforeMatching.map(T=>$(T)?T:String(T)),!$(r)||!r.length)return!1;if(!Number.isInteger(t)||t<0)throw new Error(`string-match-left-right/${e}(): [THROW_ID_03] the second argument should be a natural number. Currently it's of a type: ${typeof t}, equal to:
|
|
11
|
+
${JSON.stringify(t,null,4)}`);let o,s;if($(i))o=[i];else if(Array.isArray(i))o=i;else if(!i)o=i;else if(typeof i=="function")o=[],o.push(i);else throw new Error(`string-match-left-right/${e}(): [THROW_ID_05] the third argument, whatToMatch, is neither string nor array of strings! It's ${typeof i}, equal to:
|
|
12
|
+
${JSON.stringify(i,null,4)}`);if(l&&!I(l))throw new Error(`string-match-left-right/${e}(): [THROW_ID_06] the fourth argument, options object, should be a plain object. Currently it's of a type "${typeof l}", and equal to:
|
|
13
|
+
${JSON.stringify(l,null,4)}`);let p=0,a="";if(n!=null&&n.trimCharsBeforeMatching&&n.trimCharsBeforeMatching.some((T,y)=>T.length>1?(p=y,a=T,!0):!1))throw new Error(`string-match-left-right/${e}(): [THROW_ID_07] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ${p} is longer than 1 character, ${a.length} (equals to ${a}). Please split it into separate characters and put into array as separate elements.`);if(!o||!Array.isArray(o)||Array.isArray(o)&&!o.length||Array.isArray(o)&&o.length===1&&$(o[0])&&!o[0].trim()){if(typeof n.cb=="function"){let y,f=t;if((e==="matchLeftIncl"||e==="matchRight")&&(f+=1),e[5]==="L")for(let g=f;g--;){let m=r[g];if((!n.trimBeforeMatching||n.trimBeforeMatching&&m!==void 0&&m.trim())&&(!((c=n.trimCharsBeforeMatching)!=null&&c.length)||m!==void 0&&!n.trimCharsBeforeMatching.includes(m))){y=g;break}}else if(e.startsWith("matchRight"))for(let g=f;g<r.length;g++){let m=r[g];if((!n.trimBeforeMatching||n.trimBeforeMatching&&m.trim())&&(!((h=n.trimCharsBeforeMatching)!=null&&h.length)||!n.trimCharsBeforeMatching.includes(m))){y=g;break}}if(y===void 0)return!1;let w=r[y],d=y+1,u="";return d&&d>0&&(u=r.slice(0,d)),e[5]==="L"||y&&y>0&&(u=r.slice(y)),n.cb(w,u,y)}let T="";throw l||(T=" More so, the whole options object, the fourth input argument, is missing!"),new Error(`string-match-left-right/${e}(): [THROW_ID_08] 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!${T}`)}for(let T=0,y=o.length;T<y;T++){s=typeof o[T]=="function";let f=o[T],w,d,u="",g=t;e==="matchRight"?g+=1:e==="matchLeft"&&(g-=1);let m=ot(r,g,f,n,s,b=>e[5]==="L"?b-1:b+1);if(m&&s&&typeof f=="function"&&f()==="EOL")return f()&&(!n.cb||n.cb(w,u,d))?f():!1;if(Number.isInteger(m)&&(d=e.startsWith("matchLeft")?m-1:m+1,e[5]==="L"?u=r.slice(0,m):u=r.slice(d)),d<0&&(d=void 0),r[d]&&(w=r[d]),Number.isInteger(m)&&(!n.cb||n.cb(w,u,d)))return f}return!1}function P(e,r,t,i){return Ge("matchLeftIncl",e,r,t,i)}function D(e,r,t,i){return Ge("matchRightIncl",e,r,t,i)}function re(e,r=1){let t="\xA0";function i(n){return Array.from(n).reverse().join("")}function l(n,o,s){let p=s?`
|
|
14
|
+
`:"\r",a=s?"\r":`
|
|
15
|
+
`;if(!n)return n;let c=0,h=0,T="";for(let y=0,f=n.length;y<f;y++)(n[y]===p||n[y]===a&&n[y-1]!==p)&&h++,`\r
|
|
16
|
+
`.includes(n[y])||n[y]===t?(c=0,n[y]===t?T+=n[y]:n[y]===p?h<=o&&(T+=n[y],n[y+1]===a&&(T+=n[y+1],y++)):n[y]===a&&(n==null?void 0:n[y-1])!==p&&h<=o&&(T+=n[y])):(c++,!n[y+1]&&!h&&(T+=" "));return T}if(typeof e=="string"&&e.length){let n=1;typeof+r=="number"&&Number.isInteger(+r)&&+r>=0&&(n=+r);let o="",s="";if(!e.trim())o=e;else if(!e[0].trim()){for(let p=0,a=e.length;p<a;p++)if(e[p].trim()){o=e.slice(0,p);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===t)){for(let p=e.length;p--;)if(e[p].trim()){s=e.slice(p+1);break}}return`${l(o,n,!1)}${e.trim()}${i(l(i(s),n,!0))}`}return e}var lt={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function B(e,r){if(!Array.isArray(e)||!e.length)return e;let t=v(v({},lt),r),i,l;if(t.strictlyTwoElementsInRangeArrays&&!e.every((s,p)=>!Array.isArray(s)||s.length!==2?(i=p,l=s.length,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ${i}th range (${JSON.stringify(e[i],null,4)}) has not two but ${l} elements!`);if(!e.every((s,p)=>!Array.isArray(s)||!Number.isInteger(s[0])||s[0]<0||!Number.isInteger(s[1])||s[1]<0?(i=p,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ${i}th range (${JSON.stringify(e[i],null,4)}) does not consist of only natural numbers!`);let n=e.length**2,o=0;return Array.from(e).sort((s,p)=>(t.progressFn&&(o+=1,t.progressFn(Math.floor(o*100/n))),s[0]===p[0]?s[1]<p[1]?-1:s[1]>p[1]?1:0:s[0]<p[0]?-1:1))}var Qe={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function ut(e,r){function t(a){return!!a&&typeof a=="object"&&!Array.isArray(a)}if(!Array.isArray(e)||!e.length)return null;let i;if(r)if(t(r)){if(i=v(v({},Qe),r),i.progressFn&&t(i.progressFn)&&!Object.keys(i.progressFn).length)i.progressFn=null;else if(i.progressFn&&typeof i.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] resolvedOpts.progressFn must be a function! It was given of a type: "${typeof i.progressFn}", equal to ${JSON.stringify(i.progressFn,null,4)}`);if(![1,2,"1","2"].includes(i.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "${typeof i.mergeType}", equal to ${JSON.stringify(i.mergeType,null,4)}`);if(typeof i.joinRangesThatTouchEdges!="boolean")throw new Error(`ranges-merge: [THROW_ID_04] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof i.joinRangesThatTouchEdges}", equal to ${JSON.stringify(i.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
|
|
17
|
+
${JSON.stringify(r,null,4)} (type ${typeof r})`);else i=v({},Qe);let l=e.filter(a=>Array.isArray(a)).map(a=>[...a]).filter(a=>a[2]!==void 0||a[0]!==a[1]),n,o,s;i.progressFn?n=B(l,{progressFn:a=>{s=Math.floor(a/5),s!==o&&(o=s,i.progressFn(s))}}):n=B(l);let p=n.length-1;for(let a=p;a>0;a--)i.progressFn&&(s=Math.floor((1-a/p)*78)+21,s!==o&&s>o&&(o=s,i.progressFn(s))),(n[a][0]<=n[a-1][0]||!i.joinRangesThatTouchEdges&&n[a][0]<n[a-1][1]||i.joinRangesThatTouchEdges&&n[a][0]<=n[a-1][1])&&(n[a-1][0]=Math.min(n[a][0],n[a-1][0]),n[a-1][1]=Math.max(n[a][1],n[a-1][1]),n[a][2]!==void 0&&(n[a-1][0]>=n[a][0]||n[a-1][1]<=n[a][1])&&n[a-1][2]!==null&&(n[a][2]===null&&n[a-1][2]!==null?n[a-1][2]=null:n[a-1][2]!=null?+i.mergeType==2&&n[a-1][0]===n[a][0]?n[a-1][2]=n[a][2]:n[a-1][2]+=n[a][2]:n[a-1][2]=n[a][2]),n.splice(a,1),a=n.length);return n.length?n:null}var ft={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},Q=class{constructor(e){me(this,"ranges");me(this,"opts");let r=v(v({},ft),e);if(r.mergeType&&r.mergeType!==1&&r.mergeType!==2)if($(r.mergeType)&&r.mergeType.trim()==="1")r.mergeType=1;else if($(r.mergeType)&&r.mergeType.trim()==="2")r.mergeType=2;else throw new Error(`ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof r.mergeType}", equal to ${JSON.stringify(r.mergeType,null,4)}`);this.opts=r,this.ranges=[]}add(e,r,t){var n;if(e==null&&r==null)return;if(W(e)&&!W(r)){if(Array.isArray(e)){if(e.length){if(e.some(o=>Array.isArray(o))){e.forEach(o=>{Array.isArray(o)&&this.add(...o)});return}e.length&&N(+e[0])&&N(+e[1])&&this.add(...e)}return}throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(e,null,0)}) but second-one, "to" is not (${JSON.stringify(r,null,0)})`)}else if(!W(e)&&W(r))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(r,null,0)}) but first-one, "from" is not (${JSON.stringify(e,null,0)})`);let i=+e,l=+r;if(N(t)&&(t=String(t)),N(i)&&N(l)){if(W(t)&&!$(t)&&!N(t))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof t}, equal to:
|
|
18
|
+
${JSON.stringify(t,null,4)}`);if(W(this.ranges)&&Array.isArray(this.last())&&i===this.last()[1]){if(this.last()[1]=l,this.last()[2],this.last()[2]!==null&&W(t)){let o=this.last()[2]&&this.last()[2].length&&(!((n=this.opts)!=null&&n.mergeType)||this.opts.mergeType===1)?`${this.last()[2]}${t}`:t;this.opts.limitToBeAddedWhitespace&&(o=re(o,this.opts.limitLinebreaksCount)),$(o)&&!o.length||(this.last()[2]=o)}}else{this.ranges||(this.ranges=[]);let o=t!==void 0&&!($(t)&&!t.length)?[i,l,t&&this.opts.limitToBeAddedWhitespace?re(t,this.opts.limitLinebreaksCount):t]:[i,l];this.ranges.push(o)}}else throw N(i)&&i>=0?new TypeError(`ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it's of a type "${typeof l}" equal to: ${JSON.stringify(l,null,4)}`):new TypeError(`ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it's of a type "${typeof i}" equal to: ${JSON.stringify(i,null,4)}`)}push(e,r,t){this.add(e,r,t)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=ut(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>W(e[2])?[e[0],e[1],re(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}wipe(){this.ranges=[]}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])&&N(e[0][0]))this.ranges=Array.from(e);else throw new Error(`ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ${JSON.stringify(e[0],null,4)} should be an array and its first element should be an integer, a string index.`);else this.ranges=[]}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};var ze={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Ze(e,r){function t(a){return!!a&&typeof a=="object"&&!Array.isArray(a)}if(!Array.isArray(e)||!e.length)return null;let i;if(r)if(t(r)){if(i=v(v({},ze),r),i.progressFn&&t(i.progressFn)&&!Object.keys(i.progressFn).length)i.progressFn=null;else if(i.progressFn&&typeof i.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof i.progressFn}", equal to ${JSON.stringify(i.progressFn,null,4)}`);if(![1,2,"1","2"].includes(i.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof i.mergeType}", equal to ${JSON.stringify(i.mergeType,null,4)}`);if(typeof i.joinRangesThatTouchEdges!="boolean")throw new Error(`ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof i.joinRangesThatTouchEdges}", equal to ${JSON.stringify(i.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
|
|
19
|
+
${JSON.stringify(r,null,4)} (type ${typeof r})`);else i=v({},ze);let l=e.filter(a=>Array.isArray(a)).map(a=>[...a]).filter(a=>a[2]!==void 0||a[0]!==a[1]),n,o,s;i.progressFn?n=B(l,{progressFn:a=>{s=Math.floor(a/5),s!==o&&(o=s,i.progressFn(s))}}):n=B(l);let p=n.length-1;for(let a=p;a>0;a--)i.progressFn&&(s=Math.floor((1-a/p)*78)+21,s!==o&&s>o&&(o=s,i.progressFn(s))),(n[a][0]<=n[a-1][0]||!i.joinRangesThatTouchEdges&&n[a][0]<n[a-1][1]||i.joinRangesThatTouchEdges&&n[a][0]<=n[a-1][1])&&(n[a-1][0]=Math.min(n[a][0],n[a-1][0]),n[a-1][1]=Math.max(n[a][1],n[a-1][1]),n[a][2]!==void 0&&(n[a-1][0]>=n[a][0]||n[a-1][1]<=n[a][1])&&n[a-1][2]!==null&&(n[a][2]===null&&n[a-1][2]!==null?n[a-1][2]=null:n[a-1][2]!=null?+i.mergeType==2&&n[a-1][0]===n[a][0]?n[a-1][2]=n[a][2]:n[a-1][2]+=n[a][2]:n[a-1][2]=n[a][2]),n.splice(a,1),a=n.length);return n.length?n:null}var ct=!0,we="Invariant failed";function Ye(e,r){if(!e){if(ct)throw new Error(we);var t=typeof r=="function"?r():r,i=t?"".concat(we,": ").concat(t):we;throw new Error(i)}}function J(e,r,t){let i=0,l=0;if(arguments.length===0)throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError(`ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ${typeof e}, equal to: ${JSON.stringify(e,null,4)}`);if(r&&!Array.isArray(r))throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof r}, equal to: ${JSON.stringify(r,null,4)}`);if(t&&typeof t!="function")throw new TypeError(`ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ${typeof t}, equal to: ${JSON.stringify(t,null,4)}`);if(!r||!r.filter(c=>c).length)return e;let n;Array.isArray(r)&&Number.isInteger(r[0])&&Number.isInteger(r[1])?n=[Array.from(r)]:n=Array.from(r);let o=n.length,s=0;n.filter(c=>c).forEach((c,h)=>{if(t&&(i=Math.floor(s/o*10),i!==l&&(l=i,t(i))),!Array.isArray(c))throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${h}th element not an array: ${JSON.stringify(c,null,4)}, which is ${typeof c}`);if(!Number.isInteger(c[0])){if(!Number.isInteger(+c[0])||+c[0]<0)throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${h}th element, array ${JSON.stringify(c,null,0)}. Its first element is not an integer, string index, but ${typeof c[0]}, equal to: ${JSON.stringify(c[0],null,4)}.`);n[h][0]=+n[h][0]}if(!Number.isInteger(c[1])){if(!Number.isInteger(+c[1])||+c[1]<0)throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${h}th element, array ${JSON.stringify(c,null,0)}. Its second element is not an integer, string index, but ${typeof c[1]}, equal to: ${JSON.stringify(c[1],null,4)}.`);n[h][1]=+n[h][1]}s+=1});let p=Ze(n,{progressFn:c=>{t&&(i=10+Math.floor(c/10),i!==l&&(l=i,t(i)))}});Ye(p);let a=p.length;if(a>0){let c=e.slice(p[a-1][1]);e=p.reduce((h,T,y,f)=>{t&&(i=20+Math.floor(y/a*80),i!==l&&(l=i,t(i)));let w=y===0?0:f[y-1][1],d=f[y][0];return`${h}${e.slice(w,d)}${f[y][2]||""}`},""),e+=c}return e}var ht={classicTrim:!1,cr:!1,lf:!1,tab:!1,space:!0,nbsp:!1};function z(e,r){if(typeof e!="string")throw new Error(`string-trim-spaces-only: [THROW_ID_01] input must be string! It was given as ${typeof e}, equal to:
|
|
20
|
+
${JSON.stringify(e,null,4)}`);let t=v(v({},ht),r);function i(o){return t.classicTrim&&!o.trim()||!t.classicTrim&&(t.space&&o===" "||t.cr&&o==="\r"||t.lf&&o===`
|
|
21
|
+
`||t.tab&&o===" "||t.nbsp&&o==="\xA0")}let l,n;if(e.length){if(i(e[0]))for(let o=0,s=e.length;o<s;o++){if(!i(e[o])){l=o;break}if(o===e.length-1)return{res:"",ranges:[[0,e.length]]}}if(i(e[e.length-1])){for(let o=e.length;o--;)if(!i(e[o])){n=o+1;break}}return l?n?{res:e.slice(l,n),ranges:[[0,l],[n,e.length]]}:{res:e.slice(l),ranges:[[0,l]]}:n?{res:e.slice(0,n),ranges:[[n,e.length]]}:{res:e,ranges:[]}}return{res:"",ranges:[]}}var gt={heads:["{{"],tails:["}}"]};function Xe(e,r){let t=Object.prototype.hasOwnProperty;if(e===void 0)throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_01] The input is missing!");if(typeof e!="string")return e;if(r&&!I(r))throw new Error(`string-remove-duplicate-heads-tails: [THROW_ID_03] The given options are not a plain object but ${typeof r}!`);let i=v({},r);if(i&&t.call(i,"heads"))if(S(i.heads).every(w=>typeof w=="string"||Array.isArray(w)))typeof i.heads=="string"&&(i.heads=S(i.heads));else throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_04] The resolvedOpts.heads contains elements which are not string-type!");if(i&&t.call(i,"tails"))if(S(i.tails).every(w=>typeof w=="string"||Array.isArray(w)))typeof i.tails=="string"&&(i.tails=S(i.tails));else throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_05] The resolvedOpts.tails contains elements which are not string-type!");let l=z(e).res;if(l.length===0)return e;e=l;let n=v(v({},gt),i);n.heads=n.heads.map(w=>w.trim()),n.tails=n.tails.map(w=>w.trim());let o=!1,s=!1,p=new Q({limitToBeAddedWhitespace:!0}),a=new Q({limitToBeAddedWhitespace:!0}),c=!0,h=!0,T="";function y(w,d){let u;return D(w,0,d.heads,{trimBeforeMatching:!0,cb:(g,m,b)=>(u=b,!0)})&&D(w,u,d.tails,{trimBeforeMatching:!0,cb:(g,m,b)=>(u=b,!0)})?w.slice(u):w}for(;e!==y(e,n);)e=z(y(e,n)).res;function f(w,d){let u;return!P(w,w.length-1,d.tails,{trimBeforeMatching:!0,cb:(g,m,b)=>(u=b,!0)})||!u?w:P(w,u,d.heads,{trimBeforeMatching:!0,cb:(g,m,b)=>(u=b,!0)})?w.slice(0,u+1):w}for(;e!==f(e,n);)e=z(f(e,n)).res;if(!n.heads.length||!D(e,0,n.heads,{trimBeforeMatching:!0})||!n.tails.length||!P(e,e.length-1,n.tails,{trimBeforeMatching:!0}))return z(e).res;for(let w=0,d=e.length;w<d;w++)if(e[w].trim()!==""){let u;if(D(e,w,n.heads,{trimBeforeMatching:!0,cb:(g,m,b)=>(u=b,!0)})&&u){h=!0,c&&(c=!0);let g;D(e,u,n.tails,{trimBeforeMatching:!0,cb:(m,b,A)=>(g=A,!0)})&&p.push(w,g),a.current()&&o&&T!=="tails"&&p.push(a.current()),o||a.current()&&(p.push(a.current()),a.wipe()),a.push(w,u),T="heads",w=u-1;continue}if(D(e,w,n.tails,{trimBeforeMatching:!0,cb:(g,m,b)=>(u=Number.isInteger(b)?b:e.length,!0)})&&u){h=!0,c?(T==="heads"&&a.wipe(),c=!1):a.push(w,u),T="tails",w=u-1;continue}c&&(c=!0),h&&!o?(o=!0,h=!1):h&&!s?(s=!0,c=!0,h=!1,T==="heads"&&a.wipe()):h&&s&&a.wipe()}return a.current()&&p.push(a.current()),p.current()?J(e,p.current()).trim():e.trim()}var er={fromIndex:0,throwWhenSomethingWrongIsDetected:!0,allowWholeValueToBeOnlyHeadsOrTails:!0,source:"string-find-heads-tails",matchHeadsAndTailsStrictlyInPairsByTheirOrder:!1,relaxedAPI:!1};function be(e,r,t,i){if(W(i)&&!I(i))throw new TypeError(`string-find-heads-tails: [THROW_ID_01] the fourth input argument, an Optional Options Object, must be a plain object! Currently it's equal to: ${i} (type: ${typeof i})`);let l=v(v({},er),i);if($(l.fromIndex)&&/^\d*$/.test(l.fromIndex))l.fromIndex=Number(l.fromIndex);else if(!Number.isInteger(l.fromIndex)||l.fromIndex<0)throw new TypeError(`${l.source} [THROW_ID_18] the fourth input argument must be a natural number or zero! Currently it's: ${l.fromIndex}`);if(!$(e)||e.length===0){if(l.relaxedAPI)return[];throw new TypeError(`string-find-heads-tails: [THROW_ID_02] the first input argument, input string, must be a non-zero-length string! Currently it's: ${typeof e}, equal to: ${e}`)}let n,o;if(!$(r)&&!Array.isArray(r)){if(l.relaxedAPI)return[];throw new TypeError(`string-find-heads-tails: [THROW_ID_03] the second input argument, heads, must be either a string or an array of strings! Currently it's: ${typeof r}, equal to:
|
|
22
|
+
${JSON.stringify(r,null,4)}`)}else if($(r))if(r.length===0){if(l.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_04] the second input argument, heads, must be a non-empty string! Currently it's empty.")}else r=S(r);else if(Array.isArray(r))if(r.length===0){if(l.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_05] the second input argument, heads, must be a non-empty array and contain at least one string! Currently it's empty.")}else if(r.every((f,w)=>(n=f,o=w,$(f)))){if(!r.every((f,w)=>(o=w,$(f)&&f.length&&f.trim()!=="")))if(l.relaxedAPI){if(r=r.filter(f=>$(f)&&f.length),r.length===0)return[]}else throw new TypeError(`string-find-heads-tails: [THROW_ID_07] the second input argument, heads, should not contain empty strings! For example, there's one detected at index ${o} of heads array:
|
|
23
|
+
${JSON.stringify(r,null,4)}.`)}else if(l.relaxedAPI){if(r=r.filter(f=>$(f)&&f.length),r.length===0)return[]}else throw new TypeError(`string-find-heads-tails: [THROW_ID_06] the second input argument, heads, contains non-string elements! For example, element at ${o}th index is ${typeof n}, equal to:
|
|
16
24
|
${JSON.stringify(n,null,4)}. Whole heads array looks like:
|
|
17
|
-
${JSON.stringify(
|
|
18
|
-
${JSON.stringify(
|
|
19
|
-
${JSON.stringify(
|
|
25
|
+
${JSON.stringify(r,null,4)}`);if(!$(t)&&!Array.isArray(t)){if(l.relaxedAPI)return[];throw new TypeError(`string-find-heads-tails: [THROW_ID_08] the third input argument, tails, must be either a string or an array of strings! Currently it's: ${typeof t}, equal to:
|
|
26
|
+
${JSON.stringify(t,null,4)}`)}else if($(t))if(t.length===0){if(l.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_09] the third input argument, tails, must be a non-empty string! Currently it's empty.")}else t=S(t);else if(Array.isArray(t))if(t.length===0){if(l.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_10] the third input argument, tails, must be a non-empty array and contain at least one string! Currently it's empty.")}else if(t.every((f,w)=>(n=f,o=w,$(f)))){if(!t.every((f,w)=>(o=w,$(f)&&f.length&&f.trim()!=="")))if(l.relaxedAPI){if(t=t.filter(f=>$(f)&&f.length),t.length===0)return[]}else throw new TypeError(`string-find-heads-tails: [THROW_ID_12] the third input argument, tails, should not contain empty strings! For example, there's one detected at index ${o}. Whole tails array is equal to:
|
|
27
|
+
${JSON.stringify(t,null,4)}`)}else if(l.relaxedAPI){if(t=t.filter(f=>$(f)&&f.length),t.length===0)return[]}else throw new TypeError(`string-find-heads-tails: [THROW_ID_11] the third input argument, tails, contains non-string elements! For example, element at ${o}th index is ${typeof n}, equal to:
|
|
20
28
|
${JSON.stringify(n,null,4)}. Whole tails array is equal to:
|
|
21
|
-
${JSON.stringify(
|
|
29
|
+
${JSON.stringify(t,null,4)}`);let s=l.source===er.source;if(l.throwWhenSomethingWrongIsDetected&&!l.allowWholeValueToBeOnlyHeadsOrTails){if(S(r).includes(e))throw new Error(`${l.source}${s?": [THROW_ID_16]":""} the whole input string can't be equal to ${$(r)?"":"one of "}heads (${e})!`);if(S(t).includes(e))throw new Error(`${l.source}${s?": [THROW_ID_17]":""} the whole input string can't be equal to ${$(t)?"":"one of "}tails (${e})!`)}let p=r.concat(t).map(f=>f.charAt(0)).reduce((f,w)=>w.charCodeAt(0)>f[1]?[f[0],w.charCodeAt(0)]:w.charCodeAt(0)<f[0]?[w.charCodeAt(0),f[1]]:f,[r[0].charCodeAt(0),r[0].charCodeAt(0)]),a=[],c=!1,h={},T="",y;for(let f=l.fromIndex,w=e.length;f<w;f++){let d=e[f].charCodeAt(0);if(d<=p[1]&&d>=p[0]){let u=D(e,f,r);if(u&&l.matchHeadsAndTailsStrictlyInPairsByTheirOrder){for(let m=r.length;m--;)if(r[m]===u){y=m;break}}if($(u))if(c){if(l.throwWhenSomethingWrongIsDetected)throw new TypeError(`${l.source}${s?": [THROW_ID_19]":""} When processing "${e}", we found heads (${e.slice(f,f+u.length)}) starting at character with index number "${f}" and there was another set of heads before it! Generally speaking, there should be "heads-tails-heads-tails", not "heads-heads-tails"!
|
|
22
30
|
We're talking about the area of the code:
|
|
23
31
|
|
|
24
32
|
|
|
@@ -29,105 +37,65 @@ ${e.slice(f+u.length,Math.min(w,f+200))}
|
|
|
29
37
|
--------------------------------------ends
|
|
30
38
|
|
|
31
39
|
|
|
32
|
-
To turn off this error being thrown, set resolvedOpts.throwWhenSomethingWrongIsDetected to Boolean false.`)}else{
|
|
33
|
-
|
|
34
|
-
`;if(!n)return n;let h=0,c=0,T="";for(let y=0,f=n.length;y<f;y++)(n[y]===g||n[y]===a&&n[y-1]!==g)&&c++,`\r
|
|
35
|
-
`.includes(n[y])||n[y]===r?(h=0,n[y]===r?T+=n[y]:n[y]===g?c<=o&&(T+=n[y],n[y+1]===a&&(T+=n[y+1],y++)):n[y]===a&&(n==null?void 0:n[y-1])!==g&&c<=o&&(T+=n[y])):(h++,!n[y+1]&&!c&&(T+=" "));return T}if(typeof e=="string"&&e.length){let n=1;typeof+t=="number"&&Number.isInteger(+t)&&+t>=0&&(n=+t);let o="",s="";if(!e.trim())o=e;else if(!e[0].trim()){for(let g=0,a=e.length;g<a;g++)if(e[g].trim()){o=e.slice(0,g);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===r)){for(let g=e.length;g--;)if(e[g].trim()){s=e.slice(g+1);break}}return`${l(o,n,!1)}${e.trim()}${i(l(i(s),n,!0))}`}return e}var Ln={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function kt(e,t){if(!Array.isArray(e)||!e.length)return e;let r=$($({},Ln),t),i,l;if(r.strictlyTwoElementsInRangeArrays&&!e.every((s,g)=>!Array.isArray(s)||s.length!==2?(i=g,l=s.length,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ${i}th range (${JSON.stringify(e[i],null,4)}) has not two but ${l} elements!`);if(!e.every((s,g)=>!Array.isArray(s)||!Number.isInteger(s[0])||s[0]<0||!Number.isInteger(s[1])||s[1]<0?(i=g,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ${i}th range (${JSON.stringify(e[i],null,4)}) does not consist of only natural numbers!`);let n=e.length**2,o=0;return Array.from(e).sort((s,g)=>(r.progressFn&&(o+=1,r.progressFn(Math.floor(o*100/n))),s[0]===g[0]?s[1]<g[1]?-1:s[1]>g[1]?1:0:s[0]<g[0]?-1:1))}var Lt={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function qn(e,t){function r(a){return!!a&&typeof a=="object"&&!Array.isArray(a)}if(!Array.isArray(e)||!e.length)return null;let i;if(t)if(r(t)){if(i=$($({},Lt),t),i.progressFn&&r(i.progressFn)&&!Object.keys(i.progressFn).length)i.progressFn=null;else if(i.progressFn&&typeof i.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] resolvedOpts.progressFn must be a function! It was given of a type: "${typeof i.progressFn}", equal to ${JSON.stringify(i.progressFn,null,4)}`);if(![1,2,"1","2"].includes(i.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "${typeof i.mergeType}", equal to ${JSON.stringify(i.mergeType,null,4)}`);if(typeof i.joinRangesThatTouchEdges!="boolean")throw new Error(`ranges-merge: [THROW_ID_04] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof i.joinRangesThatTouchEdges}", equal to ${JSON.stringify(i.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
|
|
36
|
-
${JSON.stringify(t,null,4)} (type ${typeof t})`);else i=$({},Lt);let l=e.filter(a=>Array.isArray(a)).map(a=>[...a]).filter(a=>a[2]!==void 0||a[0]!==a[1]),n,o,s;i.progressFn?n=kt(l,{progressFn:a=>{s=Math.floor(a/5),s!==o&&(o=s,i.progressFn(s))}}):n=kt(l);let g=n.length-1;for(let a=g;a>0;a--)i.progressFn&&(s=Math.floor((1-a/g)*78)+21,s!==o&&s>o&&(o=s,i.progressFn(s))),(n[a][0]<=n[a-1][0]||!i.joinRangesThatTouchEdges&&n[a][0]<n[a-1][1]||i.joinRangesThatTouchEdges&&n[a][0]<=n[a-1][1])&&(n[a-1][0]=Math.min(n[a][0],n[a-1][0]),n[a-1][1]=Math.max(n[a][1],n[a-1][1]),n[a][2]!==void 0&&(n[a-1][0]>=n[a][0]||n[a-1][1]<=n[a][1])&&n[a-1][2]!==null&&(n[a][2]===null&&n[a-1][2]!==null?n[a-1][2]=null:n[a-1][2]!=null?+i.mergeType==2&&n[a-1][0]===n[a][0]?n[a-1][2]=n[a][2]:n[a-1][2]+=n[a][2]:n[a-1][2]=n[a][2]),n.splice(a,1),a=n.length);return n.length?n:null}function C(e){return e!=null}function V(e){return Number.isInteger(e)&&e>=0}function z(e){return typeof e=="string"}var Un={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},Z=class{constructor(e){be(this,"ranges");be(this,"opts");let t=$($({},Un),e);if(t.mergeType&&t.mergeType!==1&&t.mergeType!==2)if(z(t.mergeType)&&t.mergeType.trim()==="1")t.mergeType=1;else if(z(t.mergeType)&&t.mergeType.trim()==="2")t.mergeType=2;else throw new Error(`ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof t.mergeType}", equal to ${JSON.stringify(t.mergeType,null,4)}`);this.opts=t,this.ranges=[]}add(e,t,r){var n;if(e==null&&t==null)return;if(C(e)&&!C(t)){if(Array.isArray(e)){if(e.length){if(e.some(o=>Array.isArray(o))){e.forEach(o=>{Array.isArray(o)&&this.add(...o)});return}e.length&&V(+e[0])&&V(+e[1])&&this.add(...e)}return}throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(e,null,0)}) but second-one, "to" is not (${JSON.stringify(t,null,0)})`)}else if(!C(e)&&C(t))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(t,null,0)}) but first-one, "from" is not (${JSON.stringify(e,null,0)})`);let i=+e,l=+t;if(V(r)&&(r=String(r)),V(i)&&V(l)){if(C(r)&&!z(r)&&!V(r))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof r}, equal to:
|
|
37
|
-
${JSON.stringify(r,null,4)}`);if(C(this.ranges)&&Array.isArray(this.last())&&i===this.last()[1]){if(this.last()[1]=l,this.last()[2],this.last()[2]!==null&&C(r)){let o=this.last()[2]&&this.last()[2].length&&(!((n=this.opts)!=null&&n.mergeType)||this.opts.mergeType===1)?`${this.last()[2]}${r}`:r;this.opts.limitToBeAddedWhitespace&&(o=pe(o,this.opts.limitLinebreaksCount)),z(o)&&!o.length||(this.last()[2]=o)}}else{this.ranges||(this.ranges=[]);let o=r!==void 0&&!(z(r)&&!r.length)?[i,l,r&&this.opts.limitToBeAddedWhitespace?pe(r,this.opts.limitLinebreaksCount):r]:[i,l];this.ranges.push(o)}}else throw V(i)&&i>=0?new TypeError(`ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it's of a type "${typeof l}" equal to: ${JSON.stringify(l,null,4)}`):new TypeError(`ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it's of a type "${typeof i}" equal to: ${JSON.stringify(i,null,4)}`)}push(e,t,r){this.add(e,t,r)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=qn(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>C(e[2])?[e[0],e[1],pe(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}wipe(){this.ranges=[]}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])&&V(e[0][0]))this.ranges=Array.from(e);else throw new Error(`ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ${JSON.stringify(e[0],null,4)} should be an array and its first element should be an integer, a string index.`);else this.ranges=[]}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};var Kn={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Je(e,t){if(!Array.isArray(e)||!e.length)return e;let r=$($({},Kn),t),i,l;if(r.strictlyTwoElementsInRangeArrays&&!e.every((s,g)=>!Array.isArray(s)||s.length!==2?(i=g,l=s.length,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ${i}th range (${JSON.stringify(e[i],null,4)}) has not two but ${l} elements!`);if(!e.every((s,g)=>!Array.isArray(s)||!Number.isInteger(s[0])||s[0]<0||!Number.isInteger(s[1])||s[1]<0?(i=g,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ${i}th range (${JSON.stringify(e[i],null,4)}) does not consist of only natural numbers!`);let n=e.length**2,o=0;return Array.from(e).sort((s,g)=>(r.progressFn&&(o+=1,r.progressFn(Math.floor(o*100/n))),s[0]===g[0]?s[1]<g[1]?-1:s[1]>g[1]?1:0:s[0]<g[0]?-1:1))}var qt={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Ut(e,t){function r(a){return!!a&&typeof a=="object"&&!Array.isArray(a)}if(!Array.isArray(e)||!e.length)return null;let i;if(t)if(r(t)){if(i=$($({},qt),t),i.progressFn&&r(i.progressFn)&&!Object.keys(i.progressFn).length)i.progressFn=null;else if(i.progressFn&&typeof i.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof i.progressFn}", equal to ${JSON.stringify(i.progressFn,null,4)}`);if(![1,2,"1","2"].includes(i.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof i.mergeType}", equal to ${JSON.stringify(i.mergeType,null,4)}`);if(typeof i.joinRangesThatTouchEdges!="boolean")throw new Error(`ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof i.joinRangesThatTouchEdges}", equal to ${JSON.stringify(i.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
|
|
38
|
-
${JSON.stringify(t,null,4)} (type ${typeof t})`);else i=$({},qt);let l=e.filter(a=>Array.isArray(a)).map(a=>[...a]).filter(a=>a[2]!==void 0||a[0]!==a[1]),n,o,s;i.progressFn?n=Je(l,{progressFn:a=>{s=Math.floor(a/5),s!==o&&(o=s,i.progressFn(s))}}):n=Je(l);let g=n.length-1;for(let a=g;a>0;a--)i.progressFn&&(s=Math.floor((1-a/g)*78)+21,s!==o&&s>o&&(o=s,i.progressFn(s))),(n[a][0]<=n[a-1][0]||!i.joinRangesThatTouchEdges&&n[a][0]<n[a-1][1]||i.joinRangesThatTouchEdges&&n[a][0]<=n[a-1][1])&&(n[a-1][0]=Math.min(n[a][0],n[a-1][0]),n[a-1][1]=Math.max(n[a][1],n[a-1][1]),n[a][2]!==void 0&&(n[a-1][0]>=n[a][0]||n[a-1][1]<=n[a][1])&&n[a-1][2]!==null&&(n[a][2]===null&&n[a-1][2]!==null?n[a-1][2]=null:n[a-1][2]!=null?+i.mergeType==2&&n[a-1][0]===n[a][0]?n[a-1][2]=n[a][2]:n[a-1][2]+=n[a][2]:n[a-1][2]=n[a][2]),n.splice(a,1),a=n.length);return n.length?n:null}var Gn=!0,Fe="Invariant failed";function Kt(e,t){if(!e){if(Gn)throw new Error(Fe);var r=typeof t=="function"?t():t,i=r?"".concat(Fe,": ").concat(r):Fe;throw new Error(i)}}function L(e,t,r){let i=0,l=0;if(arguments.length===0)throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError(`ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ${typeof e}, equal to: ${JSON.stringify(e,null,4)}`);if(t&&!Array.isArray(t))throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof t}, equal to: ${JSON.stringify(t,null,4)}`);if(r&&typeof r!="function")throw new TypeError(`ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ${typeof r}, equal to: ${JSON.stringify(r,null,4)}`);if(!t||!t.filter(h=>h).length)return e;let n;Array.isArray(t)&&Number.isInteger(t[0])&&Number.isInteger(t[1])?n=[Array.from(t)]:n=Array.from(t);let o=n.length,s=0;n.filter(h=>h).forEach((h,c)=>{if(r&&(i=Math.floor(s/o*10),i!==l&&(l=i,r(i))),!Array.isArray(h))throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${c}th element not an array: ${JSON.stringify(h,null,4)}, which is ${typeof h}`);if(!Number.isInteger(h[0])){if(!Number.isInteger(+h[0])||+h[0]<0)throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${c}th element, array ${JSON.stringify(h,null,0)}. Its first element is not an integer, string index, but ${typeof h[0]}, equal to: ${JSON.stringify(h[0],null,4)}.`);n[c][0]=+n[c][0]}if(!Number.isInteger(h[1])){if(!Number.isInteger(+h[1])||+h[1]<0)throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${c}th element, array ${JSON.stringify(h,null,0)}. Its second element is not an integer, string index, but ${typeof h[1]}, equal to: ${JSON.stringify(h[1],null,4)}.`);n[c][1]=+n[c][1]}s+=1});let g=Ut(n,{progressFn:h=>{r&&(i=10+Math.floor(h/10),i!==l&&(l=i,r(i)))}});Kt(g);let a=g.length;if(a>0){let h=e.slice(g[a-1][1]);e=g.reduce((c,T,y,f)=>{r&&(i=20+Math.floor(y/a*80),i!==l&&(l=i,r(i)));let w=y===0?0:f[y-1][1],d=f[y][0];return`${c}${e.slice(w,d)}${f[y][2]||""}`},""),e+=h}return e}var Qn={classicTrim:!1,cr:!1,lf:!1,tab:!1,space:!0,nbsp:!1};function Y(e,t){if(typeof e!="string")throw new Error(`string-trim-spaces-only: [THROW_ID_01] input must be string! It was given as ${typeof e}, equal to:
|
|
39
|
-
${JSON.stringify(e,null,4)}`);let r=$($({},Qn),t);function i(o){return r.classicTrim&&!o.trim()||!r.classicTrim&&(r.space&&o===" "||r.cr&&o==="\r"||r.lf&&o===`
|
|
40
|
-
`||r.tab&&o===" "||r.nbsp&&o==="\xA0")}let l,n;if(e.length){if(i(e[0]))for(let o=0,s=e.length;o<s;o++){if(!i(e[o])){l=o;break}if(o===e.length-1)return{res:"",ranges:[[0,e.length]]}}if(i(e[e.length-1])){for(let o=e.length;o--;)if(!i(e[o])){n=o+1;break}}return l?n?{res:e.slice(l,n),ranges:[[0,l],[n,e.length]]}:{res:e.slice(l),ranges:[[0,l]]}:n?{res:e.slice(0,n),ranges:[[n,e.length]]}:{res:e,ranges:[]}}return{res:"",ranges:[]}}var zn={heads:["{{"],tails:["}}"]};function Gt(e,t){let r=Object.prototype.hasOwnProperty;if(e===void 0)throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_01] The input is missing!");if(typeof e!="string")return e;if(t&&!le(t))throw new Error(`string-remove-duplicate-heads-tails: [THROW_ID_03] The given options are not a plain object but ${typeof t}!`);let i=$({},t);if(i&&r.call(i,"heads"))if(I(i.heads).every(w=>typeof w=="string"||Array.isArray(w)))typeof i.heads=="string"&&(i.heads=I(i.heads));else throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_04] The resolvedOpts.heads contains elements which are not string-type!");if(i&&r.call(i,"tails"))if(I(i.tails).every(w=>typeof w=="string"||Array.isArray(w)))typeof i.tails=="string"&&(i.tails=I(i.tails));else throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_05] The resolvedOpts.tails contains elements which are not string-type!");let l=Y(e).res;if(l.length===0)return e;e=l;let n=$($({},zn),i);n.heads=n.heads.map(w=>w.trim()),n.tails=n.tails.map(w=>w.trim());let o=!1,s=!1,g=new Z({limitToBeAddedWhitespace:!0}),a=new Z({limitToBeAddedWhitespace:!0}),h=!0,c=!0,T="";function y(w,d){let u;return S(w,0,d.heads,{trimBeforeMatching:!0,cb:(p,m,b)=>(u=b,!0)})&&S(w,u,d.tails,{trimBeforeMatching:!0,cb:(p,m,b)=>(u=b,!0)})?w.slice(u):w}for(;e!==y(e,n);)e=Y(y(e,n)).res;function f(w,d){let u;return!k(w,w.length-1,d.tails,{trimBeforeMatching:!0,cb:(p,m,b)=>(u=b,!0)})||!u?w:k(w,u,d.heads,{trimBeforeMatching:!0,cb:(p,m,b)=>(u=b,!0)})?w.slice(0,u+1):w}for(;e!==f(e,n);)e=Y(f(e,n)).res;if(!n.heads.length||!S(e,0,n.heads,{trimBeforeMatching:!0})||!n.tails.length||!k(e,e.length-1,n.tails,{trimBeforeMatching:!0}))return Y(e).res;for(let w=0,d=e.length;w<d;w++)if(e[w].trim()!==""){let u;if(S(e,w,n.heads,{trimBeforeMatching:!0,cb:(p,m,b)=>(u=b,!0)})&&u){c=!0,h&&(h=!0);let p;S(e,u,n.tails,{trimBeforeMatching:!0,cb:(m,b,A)=>(p=A,!0)})&&g.push(w,p),a.current()&&o&&T!=="tails"&&g.push(a.current()),o||a.current()&&(g.push(a.current()),a.wipe()),a.push(w,u),T="heads",w=u-1;continue}if(S(e,w,n.tails,{trimBeforeMatching:!0,cb:(p,m,b)=>(u=Number.isInteger(b)?b:e.length,!0)})&&u){c=!0,h?(T==="heads"&&a.wipe(),h=!1):a.push(w,u),T="tails",w=u-1;continue}h&&(h=!0),c&&!o?(o=!0,c=!1):c&&!s?(s=!0,h=!0,c=!1,T==="heads"&&a.wipe()):c&&s&&a.wipe()}return a.current()&&g.push(a.current()),g.current()?L(e,g.current()).trim():e.trim()}var Qt="12.0.8";var Yn=Qt,Xn=Object.prototype.hasOwnProperty,Yt={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 _(e){return typeof e=="string"}function ei(e){return typeof e=="number"}function ke(e){return typeof e=="boolean"}function de(e){return e===null}function X(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ti(e){return e!=null}function O(e){return _(e)?e.trim():e}function ri(e){if(typeof e=="string"&&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 ni(e){if(typeof e=="string"&&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}function Xt(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=e.length;t--;)if(e[t]===".")return e.slice(0,t)}return e}function zt(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=e.length;t--;)if(e[t]===".")return e.slice(t+1)}return e}function Le(e,t){return typeof e!="string"||!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 ii(e,t,r){let i,l;return typeof e=="string"&&e.length&&S(e,0,t,{trimBeforeMatching:!0,cb:(n,o,s)=>(i=s,!0)})&&k(e,e.length-1,r,{trimBeforeMatching:!0,cb:(n,o,s)=>(l=(s||0)+1,!0)})?e.slice(i,l):e}function Zt(e,t,r=!1,i,l,n){if(t.wrapHeadsWith||(t.wrapHeadsWith=""),t.wrapTailsWith||(t.wrapTailsWith=""),_(e)&&!r&&t.wrapGlobalFlipSwitch&&!t.dontWrapVars.some(o=>ge(n,o))&&(!t.preventDoubleWrapping||t.preventDoubleWrapping&&_(e)&&!e.includes(t.wrapHeadsWith)&&!e.includes(t.wrapTailsWith)))return`${t.wrapHeadsWith}${e}${t.wrapTailsWith}`;if(r){if(!_(e))return e;let o=Gt(e,{heads:t.wrapHeadsWith,tails:t.wrapTailsWith});return _(o)?ii(o,t.wrapHeadsWith,t.wrapTailsWith):o}return e}function si(e,t,r,i){let l;if(r.indexOf(".")!==-1){let n=r,o=!0;if(i.lookForDataContainers&&typeof i.dataContainerIdentifierTails=="string"&&i.dataContainerIdentifierTails.length&&!n.endsWith(i.dataContainerIdentifierTails)){let s=W.default.get(e,n+i.dataContainerIdentifierTails);X(s)&&W.default.get(s,t)&&(l=W.default.get(s,t),o=!1)}for(;o&&n.indexOf(".")!==-1;){if(n=Xt(n),zt(n)===t)throw new Error(`json-variables/findValues(): [THROW_ID_20] While trying to resolve: "${t}" at path "${r}", we encountered a closed loop. The parent key "${zt(n)}" is called the same as the variable "${t}" we're looking for.`);if(i.lookForDataContainers&&typeof i.dataContainerIdentifierTails=="string"&&i.dataContainerIdentifierTails.length&&!n.endsWith(i.dataContainerIdentifierTails)){let s=W.default.get(e,n+i.dataContainerIdentifierTails);X(s)&&W.default.get(s,t)&&(l=W.default.get(s,t),o=!1)}if(l===void 0){let s=W.default.get(e,n);X(s)&&W.default.get(s,t)&&(l=W.default.get(s,t),o=!1)}}}if(l===void 0){let n=W.default.get(e,t);n!==void 0&&(l=n)}if(l===void 0)if(t.indexOf(".")===-1){let n=Be(e,t);if(n.length){for(let o=0,s=n.length;o<s;o++)if(_(n[o].val)||ke(n[o].val)||de(n[o].val)){l=n[o].val;break}else if(ei(n[o].val)){l=String(n[o].val);break}else if(Array.isArray(n[o].val)){l=n[o].val.join("");break}}}else{let n=Be(e,ri(t));if(n.length)for(let o=0,s=n.length;o<s;o++){let g=W.default.get(n[o].val,ni(t));g&&_(g)&&(l=g)}}return l}function er(e,t,r,i,l=[]){if(l.includes(r)){let y="";if(l.length>1){let f=` \u2192
|
|
41
|
-
`;y=l.reduce((w,d,u)=>w+(u===0?"":f)+(d===r?"\u{1F4A5} ":" ")+d,` Here's the path we travelled up until we hit the recursion:
|
|
40
|
+
To turn off this error being thrown, set resolvedOpts.throwWhenSomethingWrongIsDetected to Boolean false.`)}else{h={},h.headsStartAt=f,h.headsEndAt=f+u.length,c=!0,f+=u.length-1,T&&(T="");continue}let g=D(e,f,t);if(c&&g&&l.matchHeadsAndTailsStrictlyInPairsByTheirOrder&&y!==void 0&&t[y]!==void 0&&t[y]!==g){let m;for(let b=t.length;b--;)if(t[b]===g){m=b;break}throw new TypeError(`${l.source}${s?": [THROW_ID_20]":""} When processing "${e}", we had "resolvedOpts.matchHeadsAndTailsStrictlyInPairsByTheirOrder" on. We found heads (${r[y]}) but the tails the followed it were not of the same index, ${y} (${t[y]}) but ${m} (${g}).`)}if($(g))if(c){h.tailsStartAt=f,h.tailsEndAt=f+g.length,a.push(h),h={},c=!1,f+=g.length-1;continue}else l.throwWhenSomethingWrongIsDetected&&(T=`${l.source}${s?": [THROW_ID_21]":""} When processing "${e}", we found tails (${e.slice(f,f+g.length)}) starting at character with index number "${f}" but there were no heads preceding it. That's very naughty!`)}if(l.throwWhenSomethingWrongIsDetected&&f===w-1){if(Object.keys(h).length!==0)throw new TypeError(`${l.source}${s?": [THROW_ID_22]":""} When processing "${e}", we reached the end of the string and yet didn't find any tails (${JSON.stringify(t,null,4)}) to match the last detected heads (${e.slice(h.headsStartAt,h.headsEndAt)})!`);if(T)throw new Error(T)}}return a}var fe=ye(Re(),1);function Fn(e){if(e.includes(".")){let r=e.lastIndexOf(".");if(!e.slice(0,r).includes("."))return e.slice(0,r);for(let t=r-1;t--;)if(e[t]===".")return e.slice(t+1,r)}return null}var Ve=Fn;function ce(e,r){let t={now:!1};function i(l,n,o,s){let p=(0,fe.default)(l),a,c=v({depth:-1,path:""},o);if(c.depth+=1,Array.isArray(p))for(let h=0,T=p.length;h<T&&!s.now;h++){let y=c.path?`${c.path}.${h}`:`${h}`;p[h]!==void 0?(c.parent=(0,fe.default)(p),c.parentType="array",c.parentKey=Ve(y),a=i(n(p[h],void 0,K(v({},c),{path:y}),s),n,K(v({},c),{path:y}),s),Number.isNaN(a)&&h<p.length?(p.splice(h,1),h-=1):p[h]=a):p.splice(h,1)}else if(I(p))for(let h in p){if(s.now&&h!=null)break;let T=c.path?`${c.path}.${h}`:h;c.depth===0&&h!=null&&(c.topmostKey=h),c.parent=(0,fe.default)(p),c.parentType="object",c.parentKey=Ve(T),a=i(n(h,p[h],K(v({},c),{path:T}),s),n,K(v({},c),{path:T}),s),Number.isNaN(a)?delete p[h]:p[h]=a}return p}return i(e,r,{},t)}function je(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var He=new Map,Fr=(e,r)=>{if(!Array.isArray(e))switch(typeof e){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError(`Expected '${r}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter(t=>{if(typeof t!="string"){if(typeof t>"u")return!1;throw new TypeError(`Expected '${r}' to be an array of strings, but found a type of '${typeof t}' in the array`)}return!0})},kn=(e,r)=>{r=v({caseSensitive:!1},r);let t=e+JSON.stringify(r);if(He.has(t))return He.get(t);let i=e[0]==="!";i&&(e=e.slice(1)),e=je(e).replace(/\\\*/g,"[\\s\\S]*");let l=new RegExp(`^${e}$`,r.caseSensitive?"":"i");return l.negated=i,He.set(t,l),l},Ln=(e,r,t,i)=>{if(e=Fr(e,"inputs"),r=Fr(r,"patterns"),r.length===0)return[];r=r.map(o=>kn(o,t));let{allPatterns:l}=t||{},n=[];for(let o of e){let s,p=[...r].fill(!1);for(let[a,c]of r.entries())if(c.test(o)&&(p[a]=!0,s=!c.negated,!s))break;if(!(s===!1||s===void 0&&r.some(a=>!a.negated)||l&&p.some((a,c)=>!a&&!r[c].negated))&&(n.push(o),i))break}return n};function he(e,r,t){return Ln(e,r,t,!0).length>0}var Me=ye(Re(),1);function Pe(e,r,t){let i;t!==void 0&&(i=Array.isArray(t)?(0,Me.default)(t):[(0,Me.default)(t)]);let l=[],n=ce(e,(o,s,p)=>{let a=s!==void 0?s:o;if(s!==void 0&&he(o,r,{caseSensitive:!0})){if(i===void 0)l.push({val:s,path:p.path});else if(i.length)return i.shift()}return a});return i===void 0?l:n}var x=ye(Lr(),1);var qr="12.0.10";var Un=qr,Kn=Object.prototype.hasOwnProperty,Gr={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 _(e){return $(e)?e.trim():e}function Gn(e){if($(e)&&e.length&&e.indexOf(".")!==-1){for(let r=0,t=e.length;r<t;r++)if(e[r]===".")return e.slice(0,r)}return e}function Qn(e){if($(e)&&e.length&&e.indexOf(".")!==-1){for(let r=0,t=e.length;r<t;r++)if(e[r]===".")return e.slice(r+1)}return e}function Qr(e){if($(e)&&e.length&&e.indexOf(".")!==-1){for(let r=e.length;r--;)if(e[r]===".")return e.slice(0,r)}return e}function Ur(e){if($(e)&&e.length&&e.indexOf(".")!==-1){for(let r=e.length;r--;)if(e[r]===".")return e.slice(r+1)}return e}function Be(e,r){return!$(e)||!e.trim()?!1:!!(e.includes(r.heads)||e.includes(r.tails)||$(r.headsNoWrap)&&r.headsNoWrap.length&&e.includes(r.headsNoWrap)||$(r.tailsNoWrap)&&r.tailsNoWrap.length&&e.includes(r.tailsNoWrap))}function zn(e,r,t){let i,l;return $(e)&&e.length&&D(e,0,r,{trimBeforeMatching:!0,cb:(n,o,s)=>(i=s,!0)})&&P(e,e.length-1,t,{trimBeforeMatching:!0,cb:(n,o,s)=>(l=(s||0)+1,!0)})?e.slice(i,l):e}function Kr(e,r,t=!1,i,l,n){if(r.wrapHeadsWith||(r.wrapHeadsWith=""),r.wrapTailsWith||(r.wrapTailsWith=""),$(e)&&!t&&r.wrapGlobalFlipSwitch&&!r.dontWrapVars.some(o=>he(n,o))&&(!r.preventDoubleWrapping||r.preventDoubleWrapping&&$(e)&&!e.includes(r.wrapHeadsWith)&&!e.includes(r.wrapTailsWith)))return`${r.wrapHeadsWith}${e}${r.wrapTailsWith}`;if(t){if(!$(e))return e;let o=Xe(e,{heads:r.wrapHeadsWith,tails:r.wrapTailsWith});return $(o)?zn(o,r.wrapHeadsWith,r.wrapTailsWith):o}return e}function Zn(e,r,t,i){let l;if(t.indexOf(".")!==-1){let n=t,o=!0;if(i.lookForDataContainers&&$(i.dataContainerIdentifierTails)&&i.dataContainerIdentifierTails.length&&!n.endsWith(i.dataContainerIdentifierTails)){let s=x.default.get(e,n+i.dataContainerIdentifierTails);I(s)&&x.default.get(s,r)&&(l=x.default.get(s,r),o=!1)}for(;o&&n.indexOf(".")!==-1;){if(n=Qr(n),Ur(n)===r)throw new Error(`json-variables/findValues(): [THROW_ID_20] While trying to resolve: "${r}" at path "${t}", we encountered a closed loop. The parent key "${Ur(n)}" is called the same as the variable "${r}" we're looking for.`);if(i.lookForDataContainers&&$(i.dataContainerIdentifierTails)&&i.dataContainerIdentifierTails.length&&!n.endsWith(i.dataContainerIdentifierTails)){let s=x.default.get(e,n+i.dataContainerIdentifierTails);I(s)&&x.default.get(s,r)&&(l=x.default.get(s,r),o=!1)}if(l===void 0){let s=x.default.get(e,n);I(s)&&x.default.get(s,r)&&(l=x.default.get(s,r),o=!1)}}}if(l===void 0){let n=x.default.get(e,r);n!==void 0&&(l=n)}if(l===void 0)if(r.indexOf(".")===-1){let n=Pe(e,r);if(n.length){for(let o=0,s=n.length;o<s;o++)if($(n[o].val)||ee(n[o].val)||G(n[o].val)){l=n[o].val;break}else if(qe(n[o].val)){l=String(n[o].val);break}else if(Array.isArray(n[o].val)){l=n[o].val.join("");break}}}else{let n=Pe(e,Gn(r));if(n.length)for(let o=0,s=n.length;o<s;o++){let p=x.default.get(n[o].val,Qn(r));p&&$(p)&&(l=p)}}return l}function zr(e,r,t,i,l=[]){if(l.includes(t)){let y="";if(l.length>1){let f=` \u2192
|
|
41
|
+
`;y=l.reduce((w,d,u)=>w+(u===0?"":f)+(d===t?"\u{1F4A5} ":" ")+d,` Here's the path we travelled up until we hit the recursion:
|
|
42
42
|
|
|
43
|
-
`),y+=`${f}\u{1F4A5} ${
|
|
44
|
-
${y}`)}let
|
|
45
|
-
${y}`)}a.length===1&&
|
|
46
|
-
Please check the following key: ${o}`);if(s!==void 0?n=s:n=o,n==="")return n;if(
|
|
47
|
-
/**
|
|
48
|
-
* @name codsen-utils
|
|
49
|
-
* @fileoverview Various utility functions
|
|
50
|
-
* @version 1.2.0
|
|
51
|
-
* @author Roy Revelt, Codsen Ltd
|
|
52
|
-
* @license MIT
|
|
53
|
-
* {@link https://codsen.com/os/codsen-utils/}
|
|
54
|
-
*/
|
|
55
|
-
/**
|
|
56
|
-
* @name ast-monkey-util
|
|
57
|
-
* @fileoverview Utility library of AST helper functions
|
|
58
|
-
* @version 3.0.3
|
|
59
|
-
* @author Roy Revelt, Codsen Ltd
|
|
60
|
-
* @license MIT
|
|
61
|
-
* {@link https://codsen.com/os/ast-monkey-util/}
|
|
62
|
-
*/
|
|
63
|
-
/**
|
|
64
|
-
* @name ast-monkey-traverse
|
|
65
|
-
* @fileoverview Utility library to traverse AST
|
|
66
|
-
* @version 4.0.6
|
|
67
|
-
* @author Roy Revelt, Codsen Ltd
|
|
68
|
-
* @license MIT
|
|
69
|
-
* {@link https://codsen.com/os/ast-monkey-traverse/}
|
|
70
|
-
*/
|
|
43
|
+
`),y+=`${f}\u{1F4A5} ${t}`}throw new Error(`json-variables/resolveString(): [THROW_ID_19] While trying to resolve: "${r}" at path "${t}", we encountered a closed loop, the key is referencing itself."${y}`)}let n={},o=Array.from(l);o.push(t);let s=new Q;function p(y,f,w){for(let d=0,u=y.length;d<u;d++){let g=y[d],m=r.slice(g.headsEndAt,g.tailsStartAt);if(m.length===0)s.push(g.headsStartAt,g.tailsEndAt);else if(Kn.call(n,m)&&$(n[m]))s.push(g.headsStartAt,g.tailsEndAt,n[m]);else{let b=Zn(e,m.trim(),t,i);if(b===void 0)if(i.allowUnresolved===!0)b="";else if($(i.allowUnresolved))b=i.allowUnresolved;else throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_18] We couldn't find the value to resolve the variable ${r.slice(g.headsEndAt,g.tailsStartAt)}. We're at path: "${t}".`);if(!w&&i.throwWhenNonStringInsertedInString&&!$(b))throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_23] While resolving the variable ${r.slice(g.headsEndAt,g.tailsStartAt)} at path ${t}, it resolved into a non-string value, ${JSON.stringify(b,null,4)}. This is happening because options setting "throwWhenNonStringInsertedInString" is active (set to "true").`);if(ee(b)){if(i.resolveToBoolIfAnyValuesContainBool)return s.wipe(),i.resolveToFalseIfAnyValuesContainBool?!1:b;b=""}else{if(G(b)&&w)return s.wipe(),b;Array.isArray(b)?b=String(b.join("")):G(b)?b="":b=String(b)}let A=t.includes(".")?`${Qr(t)}.${m}`:m;if(Be(b,i)){let E=Kr(zr(e,b,A,i,o),i,f,o,A,m.trim());$(E)&&s.push(g.headsStartAt,g.tailsEndAt,E)}else{n[m]=b;let E=Kr(b,i,f,o,A,m.trim());$(E)&&s.push(g.headsStartAt,g.tailsEndAt,E)}}}}let a;try{a=be(r,i.heads,i.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(y){throw new Error(`json-variables/resolveString(): [THROW_ID_17] While trying to resolve string: "${r}" at path ${t}, something wrong with heads and tails was detected! Here's the internal error message:
|
|
44
|
+
${y}`)}let c=!1;a.length===1&&J(r,[[a[0].headsStartAt,a[0].tailsEndAt]]).trim()===""&&(c=!0);let h=p(a,!1,c);if(typeof h=="boolean"||h===null)return h;try{a=be(r,i.headsNoWrap,i.tailsNoWrap,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(y){throw new Error(`json-variables/resolveString(): [THROW_ID_22] While trying to resolve string: "${r}" at path ${t}, something wrong with no-wrap heads and no-wrap tails was detected! Here's the internal error message:
|
|
45
|
+
${y}`)}a.length===1&&J(r,[[a[0].headsStartAt,a[0].tailsEndAt]]).trim()===""&&(c=!0);let T=p(a,!0,c);return ee(T)||G(T)?T:s!=null&&s.current()?J(r,s.current()):r}function Yn(e,r){if(!arguments.length)throw new Error("json-variables/jVar(): [THROW_ID_01] Alas! Inputs are missing!");if(!I(e))throw new TypeError(`json-variables/jVar(): [THROW_ID_02] Alas! The input must be a plain object! Currently it's: ${Array.isArray(e)?"array":typeof e}`);if(r&&!I(r))throw new TypeError(`json-variables/jVar(): [THROW_ID_03] Alas! An Optional Options Object must be a plain object! Currently it's: ${Array.isArray(r)?"array":typeof r}`);let t=v(v({},Gr),r);t.dontWrapVars?Array.isArray(t.dontWrapVars)||(t.dontWrapVars=S(t.dontWrapVars)):t.dontWrapVars=[];let i,l;if(t.dontWrapVars.length&&!t.dontWrapVars.every((o,s)=>$(o)?!0:(i=o,l=s,!1)))throw new Error(`json-variables/jVar(): [THROW_ID_05] Alas! All variable names set in resolvedOpts.dontWrapVars should be of a string type. Computer detected a value "${i}" at index ${l}, which is not string but ${Array.isArray(i)?"array":typeof i}!`);if(t.heads==="")throw new Error("json-variables/jVar(): [THROW_ID_06] Alas! resolvedOpts.heads are empty!");if(t.tails==="")throw new Error("json-variables/jVar(): [THROW_ID_07] Alas! resolvedOpts.tails are empty!");if(t.lookForDataContainers&&t.dataContainerIdentifierTails==="")throw new Error("json-variables/jVar(): [THROW_ID_08] Alas! resolvedOpts.dataContainerIdentifierTails is empty!");if(t.heads===t.tails)throw new Error("json-variables/jVar(): [THROW_ID_09] Alas! resolvedOpts.heads and resolvedOpts.tails can't be equal!");if(t.heads===t.headsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_10] Alas! resolvedOpts.heads and resolvedOpts.headsNoWrap can't be equal!");if(t.tails===t.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_11] Alas! resolvedOpts.tails and resolvedOpts.tailsNoWrap can't be equal!");if(t.headsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_12] Alas! resolvedOpts.headsNoWrap is an empty string!");if(t.tailsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_13] Alas! resolvedOpts.tailsNoWrap is an empty string!");if(t.headsNoWrap===t.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_14] Alas! resolvedOpts.headsNoWrap and resolvedOpts.tailsNoWrap can't be equal!");let n;return ce(e,(o,s,p)=>{if(W(s)&&Be(o,t))throw new Error(`json-variables/jVar(): [THROW_ID_15] Alas! Object keys can't contain variables!
|
|
46
|
+
Please check the following key: ${o}`);if(s!==void 0?n=s:n=o,n==="")return n;if(t.heads.length&&_(n)===_(t.heads)||t.tails.length&&_(n)===_(t.tails)||t.headsNoWrap.length&&_(n)===_(t.headsNoWrap)||t.tailsNoWrap.length&&_(n)===_(t.tailsNoWrap)){if(!t.noSingleMarkers)return n;throw new Error(`json-variables/jVar(): [THROW_ID_16] Alas! While processing the input, we stumbled upon ${_(n)} which is equal to ${_(n)===_(t.heads)?"heads":""}${_(n)===_(t.tails)?"tails":""}${$(t.headsNoWrap)&&_(n)===_(t.headsNoWrap)?"headsNoWrap":""}${$(t.tailsNoWrap)&&_(n)===_(t.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 (${_(n)}) alone`)}return $(n)&&Be(n,t)?zr(e,n,p.path,t):n})}return at(Xn);})();
|
|
71
47
|
/**
|
|
72
48
|
* @name arrayiffy-if-string
|
|
73
49
|
* @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
|
|
74
|
-
* @version 5.0.
|
|
50
|
+
* @version 5.0.5
|
|
75
51
|
* @author Roy Revelt, Codsen Ltd
|
|
76
52
|
* @license MIT
|
|
77
53
|
* {@link https://codsen.com/os/arrayiffy-if-string/}
|
|
78
54
|
*/
|
|
79
55
|
/**
|
|
80
|
-
* @name
|
|
81
|
-
* @fileoverview
|
|
82
|
-
* @version
|
|
83
|
-
* @author Roy Revelt, Codsen Ltd
|
|
84
|
-
* @license MIT
|
|
85
|
-
* {@link https://codsen.com/os/string-match-left-right/}
|
|
86
|
-
*/
|
|
87
|
-
/**
|
|
88
|
-
* @name string-find-heads-tails
|
|
89
|
-
* @fileoverview Finds where are arbitrary templating marker heads and tails located
|
|
90
|
-
* @version 6.0.8
|
|
56
|
+
* @name codsen-utils
|
|
57
|
+
* @fileoverview Various utility functions
|
|
58
|
+
* @version 1.3.1
|
|
91
59
|
* @author Roy Revelt, Codsen Ltd
|
|
92
60
|
* @license MIT
|
|
93
|
-
* {@link https://codsen.com/os/
|
|
61
|
+
* {@link https://codsen.com/os/codsen-utils/}
|
|
94
62
|
*/
|
|
95
63
|
/**
|
|
96
|
-
* @name
|
|
97
|
-
* @fileoverview
|
|
98
|
-
* @version
|
|
64
|
+
* @name string-match-left-right
|
|
65
|
+
* @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
|
|
66
|
+
* @version 9.0.10
|
|
99
67
|
* @author Roy Revelt, Codsen Ltd
|
|
100
68
|
* @license MIT
|
|
101
|
-
* {@link https://codsen.com/os/
|
|
69
|
+
* {@link https://codsen.com/os/string-match-left-right/}
|
|
102
70
|
*/
|
|
103
71
|
/**
|
|
104
72
|
* @name string-collapse-leading-whitespace
|
|
105
73
|
* @fileoverview Collapse the leading and trailing whitespace of a string
|
|
106
|
-
* @version 7.0.
|
|
74
|
+
* @version 7.0.5
|
|
107
75
|
* @author Roy Revelt, Codsen Ltd
|
|
108
76
|
* @license MIT
|
|
109
77
|
* {@link https://codsen.com/os/string-collapse-leading-whitespace/}
|
|
110
78
|
*/
|
|
111
79
|
/**
|
|
112
|
-
* @name ranges-
|
|
113
|
-
* @fileoverview
|
|
114
|
-
* @version
|
|
80
|
+
* @name ranges-sort
|
|
81
|
+
* @fileoverview Sort string index ranges
|
|
82
|
+
* @version 6.0.7
|
|
115
83
|
* @author Roy Revelt, Codsen Ltd
|
|
116
84
|
* @license MIT
|
|
117
|
-
* {@link https://codsen.com/os/ranges-
|
|
85
|
+
* {@link https://codsen.com/os/ranges-sort/}
|
|
118
86
|
*/
|
|
119
87
|
/**
|
|
120
|
-
* @name ranges-
|
|
121
|
-
* @fileoverview
|
|
122
|
-
* @version
|
|
88
|
+
* @name ranges-push
|
|
89
|
+
* @fileoverview Gather string index ranges
|
|
90
|
+
* @version 7.0.7
|
|
123
91
|
* @author Roy Revelt, Codsen Ltd
|
|
124
92
|
* @license MIT
|
|
125
|
-
* {@link https://codsen.com/os/ranges-
|
|
93
|
+
* {@link https://codsen.com/os/ranges-push/}
|
|
126
94
|
*/
|
|
127
95
|
/**
|
|
128
96
|
* @name ranges-merge
|
|
129
97
|
* @fileoverview Merge and sort string index ranges
|
|
130
|
-
* @version 9.0.
|
|
98
|
+
* @version 9.0.7
|
|
131
99
|
* @author Roy Revelt, Codsen Ltd
|
|
132
100
|
* @license MIT
|
|
133
101
|
* {@link https://codsen.com/os/ranges-merge/}
|
|
@@ -135,7 +103,7 @@ Please check the following key: ${o}`);if(s!==void 0?n=s:n=o,n==="")return n;if(
|
|
|
135
103
|
/**
|
|
136
104
|
* @name ranges-apply
|
|
137
105
|
* @fileoverview Take an array of string index ranges, delete/replace the string according to them
|
|
138
|
-
* @version 7.0.
|
|
106
|
+
* @version 7.0.7
|
|
139
107
|
* @author Roy Revelt, Codsen Ltd
|
|
140
108
|
* @license MIT
|
|
141
109
|
* {@link https://codsen.com/os/ranges-apply/}
|
|
@@ -143,7 +111,7 @@ Please check the following key: ${o}`);if(s!==void 0?n=s:n=o,n==="")return n;if(
|
|
|
143
111
|
/**
|
|
144
112
|
* @name string-trim-spaces-only
|
|
145
113
|
* @fileoverview Like String.trim() but you can choose granularly what to trim
|
|
146
|
-
* @version 5.0.
|
|
114
|
+
* @version 5.0.7
|
|
147
115
|
* @author Roy Revelt, Codsen Ltd
|
|
148
116
|
* @license MIT
|
|
149
117
|
* {@link https://codsen.com/os/string-trim-spaces-only/}
|
|
@@ -151,8 +119,40 @@ Please check the following key: ${o}`);if(s!==void 0?n=s:n=o,n==="")return n;if(
|
|
|
151
119
|
/**
|
|
152
120
|
* @name string-remove-duplicate-heads-tails
|
|
153
121
|
* @fileoverview Detect and (recursively) remove head and tail wrappings around the input string
|
|
154
|
-
* @version 7.0.
|
|
122
|
+
* @version 7.0.10
|
|
155
123
|
* @author Roy Revelt, Codsen Ltd
|
|
156
124
|
* @license MIT
|
|
157
125
|
* {@link https://codsen.com/os/string-remove-duplicate-heads-tails/}
|
|
158
126
|
*/
|
|
127
|
+
/**
|
|
128
|
+
* @name string-find-heads-tails
|
|
129
|
+
* @fileoverview Finds where are arbitrary templating marker heads and tails located
|
|
130
|
+
* @version 6.0.10
|
|
131
|
+
* @author Roy Revelt, Codsen Ltd
|
|
132
|
+
* @license MIT
|
|
133
|
+
* {@link https://codsen.com/os/string-find-heads-tails/}
|
|
134
|
+
*/
|
|
135
|
+
/**
|
|
136
|
+
* @name ast-monkey-util
|
|
137
|
+
* @fileoverview Utility library of AST helper functions
|
|
138
|
+
* @version 3.0.5
|
|
139
|
+
* @author Roy Revelt, Codsen Ltd
|
|
140
|
+
* @license MIT
|
|
141
|
+
* {@link https://codsen.com/os/ast-monkey-util/}
|
|
142
|
+
*/
|
|
143
|
+
/**
|
|
144
|
+
* @name ast-monkey-traverse
|
|
145
|
+
* @fileoverview Utility library to traverse AST
|
|
146
|
+
* @version 4.0.8
|
|
147
|
+
* @author Roy Revelt, Codsen Ltd
|
|
148
|
+
* @license MIT
|
|
149
|
+
* {@link https://codsen.com/os/ast-monkey-traverse/}
|
|
150
|
+
*/
|
|
151
|
+
/**
|
|
152
|
+
* @name ast-get-values-by-key
|
|
153
|
+
* @fileoverview Extract values and paths from AST by keys OR set them by keys
|
|
154
|
+
* @version 5.0.10
|
|
155
|
+
* @author Roy Revelt, Codsen Ltd
|
|
156
|
+
* @license MIT
|
|
157
|
+
* {@link https://codsen.com/os/ast-get-values-by-key/}
|
|
158
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "json-variables",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.10",
|
|
4
4
|
"description": "Resolves custom-marked, cross-referenced paths in parsed JSON",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"comb",
|
|
@@ -78,15 +78,16 @@
|
|
|
78
78
|
"various": {}
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"arrayiffy-if-string": "^5.0.
|
|
82
|
-
"ast-get-values-by-key": "^5.0.
|
|
83
|
-
"ast-monkey-traverse": "^4.0.
|
|
81
|
+
"arrayiffy-if-string": "^5.0.5",
|
|
82
|
+
"ast-get-values-by-key": "^5.0.10",
|
|
83
|
+
"ast-monkey-traverse": "^4.0.8",
|
|
84
|
+
"codsen-utils": "^1.3.1",
|
|
84
85
|
"matcher": "^5.0.0",
|
|
85
86
|
"object-path": "^0.11.8",
|
|
86
|
-
"ranges-apply": "^7.0.
|
|
87
|
-
"ranges-push": "^7.0.
|
|
88
|
-
"string-find-heads-tails": "^6.0.
|
|
89
|
-
"string-match-left-right": "^9.0.
|
|
90
|
-
"string-remove-duplicate-heads-tails": "^7.0.
|
|
87
|
+
"ranges-apply": "^7.0.7",
|
|
88
|
+
"ranges-push": "^7.0.7",
|
|
89
|
+
"string-find-heads-tails": "^6.0.10",
|
|
90
|
+
"string-match-left-right": "^9.0.10",
|
|
91
|
+
"string-remove-duplicate-heads-tails": "^7.0.10"
|
|
91
92
|
}
|
|
92
93
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import { Obj } from "codsen-utils";
|
|
2
|
+
|
|
1
3
|
declare const version: string;
|
|
2
|
-
interface Obj {
|
|
3
|
-
[key: string]: any;
|
|
4
|
-
}
|
|
5
4
|
interface Opts {
|
|
6
5
|
heads: string;
|
|
7
6
|
tails: string;
|
|
@@ -26,4 +25,4 @@ declare const defaults: Opts;
|
|
|
26
25
|
*/
|
|
27
26
|
declare function jVar(input: Obj, opts?: Partial<Opts>): Obj;
|
|
28
27
|
|
|
29
|
-
export {
|
|
28
|
+
export { Opts, defaults, jVar, version };
|