html-crush 5.0.12 → 5.0.13

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.
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * @name html-crush
3
3
  * @fileoverview Minifies HTML/CSS: valid or broken, pure or mixed with other languages
4
- * @version 5.0.12
4
+ * @version 5.0.13
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/html-crush/}
8
8
  */
9
9
 
10
- import{rApply as ne}from"ranges-apply";import{Ranges as le}from"ranges-push";import{matchLeft as oe,matchRight as F,matchRightIncl as X}from"string-match-left-right";import{expander as _}from"string-range-expander";import{left as G,right as a}from"string-left-right";var Y="5.0.12";var ge=Y,$=new le({limitToBeAddedWhitespace:!0}),te={lineLengthLimit:500,removeIndentations:!0,removeLineBreaks:!1,removeHTMLComments:!1,removeCSSComments:!0,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,breakToTheLeftOf:["</td","<html","</html","<head","</head","<meta","<link","<table","<script","<\/script","<!DOCTYPE","<style","</style","<title","<body","@media","</body","<!--[if","<!--<![endif","<![endif]"],mindTheInlineTags:["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]};function N(n){return typeof n=="string"}function A(n){return typeof n=="string"&&n.toUpperCase()!==n.toLowerCase()}function ce(n,E){let W=Date.now();if(!N(n))throw n===void 0?new Error("html-crush: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush: [THROW_ID_02] the first input argument must be string! It was given as "${typeof n}", equal to:
10
+ import{rApply as ne}from"ranges-apply";import{Ranges as le}from"ranges-push";import{matchLeft as oe,matchRight as F,matchRightIncl as X}from"string-match-left-right";import{expander as _}from"string-range-expander";import{left as G,right as a}from"string-left-right";var Y="5.0.13";var ge=Y,$=new le({limitToBeAddedWhitespace:!0}),te={lineLengthLimit:500,removeIndentations:!0,removeLineBreaks:!1,removeHTMLComments:!1,removeCSSComments:!0,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,breakToTheLeftOf:["</td","<html","</html","<head","</head","<meta","<link","<table","<script","<\/script","<!DOCTYPE","<style","</style","<title","<body","@media","</body","<!--[if","<!--<![endif","<![endif]"],mindTheInlineTags:["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]};function N(n){return typeof n=="string"}function A(n){return typeof n=="string"&&n.toUpperCase()!==n.toLowerCase()}function ce(n,E){let W=Date.now();if(!N(n))throw n===void 0?new Error("html-crush: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush: [THROW_ID_02] the first input argument must be string! It was given as "${typeof n}", equal to:
11
11
  ${JSON.stringify(n,null,4)}`);if(E&&typeof E!="object")throw new Error(`html-crush: [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ${typeof E}, equal to ${JSON.stringify(E,null,4)}`);if(E&&Array.isArray(E.breakToTheLeftOf)&&E.breakToTheLeftOf.length){for(let e=0,w=E.breakToTheLeftOf.length;e<w;e++)if(!N(E.breakToTheLeftOf[e]))throw new TypeError(`html-crush: [THROW_ID_05] the opts.breakToTheLeftOf array contains non-string elements! For example, element at index ${e} is of a type "${typeof E.breakToTheLeftOf[e]}" and is equal to:
12
12
  ${JSON.stringify(E.breakToTheLeftOf[e],null,4)}`)}let l={...te,...E};typeof l.removeHTMLComments=="boolean"&&(l.removeHTMLComments=l.removeHTMLComments?1:0);let H="";Array.isArray(l.breakToTheLeftOf)&&l.breakToTheLeftOf.length&&(H=[...new Set(l.breakToTheLeftOf.map(e=>e[0]))].join(""));let L={removeHTMLComments:!1,removeCSSComments:!1},p=null,i=null,S=!1,m=0,M=0,g=!1,V=!1,c=null,f=null,C=null,U=null,s,t=null,u=null,r=null,T=null,D=null,v=null,P=">};",I="<",K="!",q=">",z="<",B="{},:;<>~+",k=B,J=B,O=!0,h=n.length,Q=Math.floor(h/2),x=.01,j;l.reportProgressFunc&&(j=Math.floor(l.reportProgressFuncTo-(l.reportProgressFuncTo-l.reportProgressFuncFrom)*x-l.reportProgressFuncFrom));let d,R=0,b=`
13
13
  `;if(n.includes(`\r
@@ -1,44 +1,44 @@
1
1
  /**
2
2
  * @name html-crush
3
3
  * @fileoverview Minifies HTML/CSS: valid or broken, pure or mixed with other languages
4
- * @version 5.0.12
4
+ * @version 5.0.13
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/html-crush/}
8
8
  */
9
9
 
10
- var htmlCrush=(()=>{var sn=Object.create;var ee=Object.defineProperty;var ln=Object.getOwnPropertyDescriptor;var an=Object.getOwnPropertyNames,ke=Object.getOwnPropertySymbols,un=Object.getPrototypeOf,Be=Object.prototype.hasOwnProperty,gn=Object.prototype.propertyIsEnumerable;var ye=(e,t,r)=>t in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,S=(e,t)=>{for(var r in t||(t={}))Be.call(t,r)&&ye(e,r,t[r]);if(ke)for(var r of ke(t))gn.call(t,r)&&ye(e,r,t[r]);return e};var Ue=e=>ee(e,"__esModule",{value:!0});var Ge=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),cn=(e,t)=>{for(var r in t)ee(e,r,{get:t[r],enumerable:!0})},qe=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of an(t))!Be.call(e,a)&&(r||a!=="default")&&ee(e,a,{get:()=>t[a],enumerable:!(n=ln(t,a))||n.enumerable});return e},Ke=(e,t)=>qe(Ue(ee(e!=null?sn(un(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),fn=(e=>(t,r)=>e&&e.get(t)||(r=qe(Ue({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var Ee=(e,t,r)=>(ye(e,typeof t!="symbol"?t+"":t,r),r);var ut=Ge((Ci,at)=>{var En="[object Object]";function Sn(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function wn(e,t){return function(r){return e(t(r))}}var On=Function.prototype,st=Object.prototype,lt=On.toString,Ln=st.hasOwnProperty,Dn=lt.call(Object),An=st.toString,Cn=wn(Object.getPrototypeOf,Object);function In(e){return!!e&&typeof e=="object"}function _n(e){if(!In(e)||An.call(e)!=En||Sn(e))return!1;var t=Cn(e);if(t===null)return!0;var r=Ln.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&lt.call(r)==Dn}at.exports=_n});var zt=Ge((ie,q)=>{var Nn=200,gt="__lodash_hash_undefined__",ct=9007199254740991,De="[object Arguments]",vn="[object Array]",ft="[object Boolean]",mt="[object Date]",Vn="[object Error]",Ae="[object Function]",ht="[object GeneratorFunction]",ue="[object Map]",$t="[object Number]",Ce="[object Object]",pt="[object Promise]",bt="[object RegExp]",ge="[object Set]",dt="[object String]",Tt="[object Symbol]",Ie="[object WeakMap]",yt="[object ArrayBuffer]",ce="[object DataView]",Et="[object Float32Array]",St="[object Float64Array]",wt="[object Int8Array]",Ot="[object Int16Array]",Lt="[object Int32Array]",Dt="[object Uint8Array]",At="[object Uint8ClampedArray]",Ct="[object Uint16Array]",It="[object Uint32Array]",Rn=/[\\^$.*+?()[\]{}|]/g,Mn=/\w*$/,Pn=/^\[object .+?Constructor\]$/,Hn=/^(?:0|[1-9]\d*)$/,w={};w[De]=w[vn]=w[yt]=w[ce]=w[ft]=w[mt]=w[Et]=w[St]=w[wt]=w[Ot]=w[Lt]=w[ue]=w[$t]=w[Ce]=w[bt]=w[ge]=w[dt]=w[Tt]=w[Dt]=w[At]=w[Ct]=w[It]=!0;w[Vn]=w[Ae]=w[Ie]=!1;var Fn=typeof global=="object"&&global&&global.Object===Object&&global,xn=typeof self=="object"&&self&&self.Object===Object&&self,N=Fn||xn||Function("return this")(),_t=typeof ie=="object"&&ie&&!ie.nodeType&&ie,Nt=_t&&typeof q=="object"&&q&&!q.nodeType&&q,Wn=Nt&&Nt.exports===_t;function jn(e,t){return e.set(t[0],t[1]),e}function Jn(e,t){return e.add(t),e}function kn(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}function Bn(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}function vt(e,t,r,n){var a=-1,o=e?e.length:0;for(n&&o&&(r=e[++a]);++a<o;)r=t(r,e[a],a,e);return r}function Un(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Gn(e,t){return e==null?void 0:e[t]}function Vt(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function Rt(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}function _e(e,t){return function(r){return e(t(r))}}function Mt(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var qn=Array.prototype,Kn=Function.prototype,fe=Object.prototype,Ne=N["__core-js_shared__"],Pt=function(){var e=/[^.]+$/.exec(Ne&&Ne.keys&&Ne.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ht=Kn.toString,H=fe.hasOwnProperty,me=fe.toString,Yn=RegExp("^"+Ht.call(H).replace(Rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ft=Wn?N.Buffer:void 0,xt=N.Symbol,Wt=N.Uint8Array,Xn=_e(Object.getPrototypeOf,Object),zn=Object.create,Zn=fe.propertyIsEnumerable,Qn=qn.splice,jt=Object.getOwnPropertySymbols,er=Ft?Ft.isBuffer:void 0,tr=_e(Object.keys,Object),ve=G(N,"DataView"),ne=G(N,"Map"),Ve=G(N,"Promise"),Re=G(N,"Set"),Me=G(N,"WeakMap"),re=G(Object,"create"),nr=W(ve),rr=W(ne),ir=W(Ve),or=W(Re),sr=W(Me),Jt=xt?xt.prototype:void 0,kt=Jt?Jt.valueOf:void 0;function F(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function lr(){this.__data__=re?re(null):{}}function ar(e){return this.has(e)&&delete this.__data__[e]}function ur(e){var t=this.__data__;if(re){var r=t[e];return r===gt?void 0:r}return H.call(t,e)?t[e]:void 0}function gr(e){var t=this.__data__;return re?t[e]!==void 0:H.call(t,e)}function cr(e,t){var r=this.__data__;return r[e]=re&&t===void 0?gt:t,this}F.prototype.clear=lr;F.prototype.delete=ar;F.prototype.get=ur;F.prototype.has=gr;F.prototype.set=cr;function v(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function fr(){this.__data__=[]}function mr(e){var t=this.__data__,r=he(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Qn.call(t,r,1),!0}function hr(e){var t=this.__data__,r=he(t,e);return r<0?void 0:t[r][1]}function $r(e){return he(this.__data__,e)>-1}function pr(e,t){var r=this.__data__,n=he(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}v.prototype.clear=fr;v.prototype.delete=mr;v.prototype.get=hr;v.prototype.has=$r;v.prototype.set=pr;function B(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function br(){this.__data__={hash:new F,map:new(ne||v),string:new F}}function dr(e){return $e(this,e).delete(e)}function Tr(e){return $e(this,e).get(e)}function yr(e){return $e(this,e).has(e)}function Er(e,t){return $e(this,e).set(e,t),this}B.prototype.clear=br;B.prototype.delete=dr;B.prototype.get=Tr;B.prototype.has=yr;B.prototype.set=Er;function U(e){this.__data__=new v(e)}function Sr(){this.__data__=new v}function wr(e){return this.__data__.delete(e)}function Or(e){return this.__data__.get(e)}function Lr(e){return this.__data__.has(e)}function Dr(e,t){var r=this.__data__;if(r instanceof v){var n=r.__data__;if(!ne||n.length<Nn-1)return n.push([e,t]),this;r=this.__data__=new B(n)}return r.set(e,t),this}U.prototype.clear=Sr;U.prototype.delete=wr;U.prototype.get=Or;U.prototype.has=Lr;U.prototype.set=Dr;function Ar(e,t){var r=Fe(e)||zr(e)?Un(e.length,String):[],n=r.length,a=!!n;for(var o in e)(t||H.call(e,o))&&!(a&&(o=="length"||qr(o,n)))&&r.push(o);return r}function Bt(e,t,r){var n=e[t];(!(H.call(e,t)&&Kt(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function he(e,t){for(var r=e.length;r--;)if(Kt(e[r][0],t))return r;return-1}function Cr(e,t){return e&&Ut(t,xe(t),e)}function Pe(e,t,r,n,a,o,u){var l;if(n&&(l=o?n(e,a,o,u):n(e)),l!==void 0)return l;if(!pe(e))return e;var c=Fe(e);if(c){if(l=Br(e),!t)return jr(e,l)}else{var s=x(e),$=s==Ae||s==ht;if(Qr(e))return Rr(e,t);if(s==Ce||s==De||$&&!o){if(Vt(e))return o?e:{};if(l=Ur($?{}:e),!t)return Jr(e,Cr(l,e))}else{if(!w[s])return o?e:{};l=Gr(e,s,Pe,t)}}u||(u=new U);var h=u.get(e);if(h)return h;if(u.set(e,l),!c)var T=r?kr(e):xe(e);return kn(T||e,function(m,f){T&&(f=m,m=e[f]),Bt(l,f,Pe(m,t,r,n,f,e,u))}),l}function Ir(e){return pe(e)?zn(e):{}}function _r(e,t,r){var n=t(e);return Fe(e)?n:Bn(n,r(e))}function Nr(e){return me.call(e)}function vr(e){if(!pe(e)||Yr(e))return!1;var t=Xt(e)||Vt(e)?Yn:Pn;return t.test(W(e))}function Vr(e){if(!qt(e))return tr(e);var t=[];for(var r in Object(e))H.call(e,r)&&r!="constructor"&&t.push(r);return t}function Rr(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function He(e){var t=new e.constructor(e.byteLength);return new Wt(t).set(new Wt(e)),t}function Mr(e,t){var r=t?He(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function Pr(e,t,r){var n=t?r(Rt(e),!0):Rt(e);return vt(n,jn,new e.constructor)}function Hr(e){var t=new e.constructor(e.source,Mn.exec(e));return t.lastIndex=e.lastIndex,t}function Fr(e,t,r){var n=t?r(Mt(e),!0):Mt(e);return vt(n,Jn,new e.constructor)}function xr(e){return kt?Object(kt.call(e)):{}}function Wr(e,t){var r=t?He(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function jr(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function Ut(e,t,r,n){r||(r={});for(var a=-1,o=t.length;++a<o;){var u=t[a],l=n?n(r[u],e[u],u,r,e):void 0;Bt(r,u,l===void 0?e[u]:l)}return r}function Jr(e,t){return Ut(e,Gt(e),t)}function kr(e){return _r(e,xe,Gt)}function $e(e,t){var r=e.__data__;return Kr(t)?r[typeof t=="string"?"string":"hash"]:r.map}function G(e,t){var r=Gn(e,t);return vr(r)?r:void 0}var Gt=jt?_e(jt,Object):ni,x=Nr;(ve&&x(new ve(new ArrayBuffer(1)))!=ce||ne&&x(new ne)!=ue||Ve&&x(Ve.resolve())!=pt||Re&&x(new Re)!=ge||Me&&x(new Me)!=Ie)&&(x=function(e){var t=me.call(e),r=t==Ce?e.constructor:void 0,n=r?W(r):void 0;if(n)switch(n){case nr:return ce;case rr:return ue;case ir:return pt;case or:return ge;case sr:return Ie}return t});function Br(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&H.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function Ur(e){return typeof e.constructor=="function"&&!qt(e)?Ir(Xn(e)):{}}function Gr(e,t,r,n){var a=e.constructor;switch(t){case yt:return He(e);case ft:case mt:return new a(+e);case ce:return Mr(e,n);case Et:case St:case wt:case Ot:case Lt:case Dt:case At:case Ct:case It:return Wr(e,n);case ue:return Pr(e,n,r);case $t:case dt:return new a(e);case bt:return Hr(e);case ge:return Fr(e,n,r);case Tt:return xr(e)}}function qr(e,t){return t=t==null?ct:t,!!t&&(typeof e=="number"||Hn.test(e))&&e>-1&&e%1==0&&e<t}function Kr(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Yr(e){return!!Pt&&Pt in e}function qt(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||fe;return e===r}function W(e){if(e!=null){try{return Ht.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Xr(e){return Pe(e,!0,!0)}function Kt(e,t){return e===t||e!==e&&t!==t}function zr(e){return Zr(e)&&H.call(e,"callee")&&(!Zn.call(e,"callee")||me.call(e)==De)}var Fe=Array.isArray;function Yt(e){return e!=null&&ei(e.length)&&!Xt(e)}function Zr(e){return ti(e)&&Yt(e)}var Qr=er||ri;function Xt(e){var t=pe(e)?me.call(e):"";return t==Ae||t==ht}function ei(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ct}function pe(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function ti(e){return!!e&&typeof e=="object"}function xe(e){return Yt(e)?Ar(e):Vr(e)}function ni(){return[]}function ri(){return!1}q.exports=Xr});var ci={};cn(ci,{crush:()=>gi,defaults:()=>Qt,version:()=>ui});var mn={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Se(e,t){if(!Array.isArray(e)||!e.length)return e;let r=S(S({},mn),t),n,a;if(r.strictlyTwoElementsInRangeArrays&&!e.every((l,c)=>!Array.isArray(l)||l.length!==2?(n=c,a=l.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, ${n}th range (${JSON.stringify(e[n],null,4)}) has not two but ${a} elements!`);if(!e.every((l,c)=>!Array.isArray(l)||!Number.isInteger(l[0])||l[0]<0||!Number.isInteger(l[1])||l[1]<0?(n=c,!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, ${n}th range (${JSON.stringify(e[n],null,4)}) does not consist of only natural numbers!`);let o=e.length**2,u=0;return Array.from(e).sort((l,c)=>(r.progressFn&&(u+=1,r.progressFn(Math.floor(u*100/o))),l[0]===c[0]?l[1]<c[1]?-1:l[1]>c[1]?1:0:l[0]<c[0]?-1:1))}var Ye={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Xe(e,t){function r(s){return s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;let n;if(t)if(r(t)){if(n=S(S({},Ye),t),n.progressFn&&r(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof n.progressFn}", equal to ${JSON.stringify(n.progressFn,null,4)}`);if(![1,2,"1","2"].includes(n.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof n.mergeType}", equal to ${JSON.stringify(n.mergeType,null,4)}`);if(typeof n.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 n.joinRangesThatTouchEdges}", equal to ${JSON.stringify(n.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
11
- ${JSON.stringify(t,null,4)} (type ${typeof t})`);else n=S({},Ye);let a=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),o,u,l;n.progressFn?o=Se(a,{progressFn:s=>{l=Math.floor(s/5),l!==u&&(u=l,n.progressFn(l))}}):o=Se(a);let c=o.length-1;for(let s=c;s>0;s--)n.progressFn&&(l=Math.floor((1-s/c)*78)+21,l!==u&&l>u&&(u=l,n.progressFn(l))),(o[s][0]<=o[s-1][0]||!n.joinRangesThatTouchEdges&&o[s][0]<o[s-1][1]||n.joinRangesThatTouchEdges&&o[s][0]<=o[s-1][1])&&(o[s-1][0]=Math.min(o[s][0],o[s-1][0]),o[s-1][1]=Math.max(o[s][1],o[s-1][1]),o[s][2]!==void 0&&(o[s-1][0]>=o[s][0]||o[s-1][1]<=o[s][1])&&o[s-1][2]!==null&&(o[s][2]===null&&o[s-1][2]!==null?o[s-1][2]=null:o[s-1][2]!=null?+n.mergeType==2&&o[s-1][0]===o[s][0]?o[s-1][2]=o[s][2]:o[s-1][2]+=o[s][2]:o[s-1][2]=o[s][2]),o.splice(s,1),s=o.length);return o.length?o:null}var hn=!0,we="Invariant failed";function ze(e,t){if(!e){if(hn)throw new Error(we);var r=typeof t=="function"?t():t,n=r?we+": "+r:we;throw new Error(n)}}function Ze(e,t,r){let n=0,a=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($=>$).length)return e;let o;Array.isArray(t)&&Number.isInteger(t[0])&&Number.isInteger(t[1])?o=[Array.from(t)]:o=Array.from(t);let u=o.length,l=0;o.filter($=>$).forEach(($,h)=>{if(r&&(n=Math.floor(l/u*10),n!==a&&(a=n,r(n))),!Array.isArray($))throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${h}th element not an array: ${JSON.stringify($,null,4)}, which is ${typeof $}`);if(!Number.isInteger($[0])){if(!Number.isInteger(+$[0])||+$[0]<0)throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${h}th element, array ${JSON.stringify($,null,0)}. Its first element is not an integer, string index, but ${typeof $[0]}, equal to: ${JSON.stringify($[0],null,4)}.`);o[h][0]=+o[h][0]}if(!Number.isInteger($[1])){if(!Number.isInteger(+$[1])||+$[1]<0)throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${h}th element, array ${JSON.stringify($,null,0)}. Its second element is not an integer, string index, but ${typeof $[1]}, equal to: ${JSON.stringify($[1],null,4)}.`);o[h][1]=+o[h][1]}l+=1});let c=Xe(o,{progressFn:$=>{r&&(n=10+Math.floor($/10),n!==a&&(a=n,r(n)))}});ze(c);let s=c.length;if(s>0){let $=e.slice(c[s-1][1]);e=c.reduce((h,T,m,f)=>{r&&(n=20+Math.floor(m/s*80),n!==a&&(a=n,r(n)));let O=m===0?0:f[m-1][1],L=f[m][0];return`${h}${e.slice(O,L)}${f[m][2]||""}`},""),e+=$}return e}function se(e,t=1){let r="\xA0";function n(o){return Array.from(o).reverse().join("")}function a(o,u,l){let c=l?`
10
+ var htmlCrush=(()=>{var on=Object.create;var ee=Object.defineProperty;var sn=Object.getOwnPropertyDescriptor;var ln=Object.getOwnPropertyNames,ke=Object.getOwnPropertySymbols,an=Object.getPrototypeOf,Be=Object.prototype.hasOwnProperty,un=Object.prototype.propertyIsEnumerable;var ye=(e,t,r)=>t in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,S=(e,t)=>{for(var r in t||(t={}))Be.call(t,r)&&ye(e,r,t[r]);if(ke)for(var r of ke(t))un.call(t,r)&&ye(e,r,t[r]);return e};var Ue=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gn=(e,t)=>{for(var r in t)ee(e,r,{get:t[r],enumerable:!0})},Ge=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of ln(t))!Be.call(e,a)&&a!==r&&ee(e,a,{get:()=>t[a],enumerable:!(n=sn(t,a))||n.enumerable});return e};var qe=(e,t,r)=>(r=e!=null?on(an(e)):{},Ge(t||!e||!e.__esModule?ee(r,"default",{value:e,enumerable:!0}):r,e)),cn=e=>Ge(ee({},"__esModule",{value:!0}),e);var Ee=(e,t,r)=>(ye(e,typeof t!="symbol"?t+"":t,r),r);var at=Ue((Ai,lt)=>{var yn="[object Object]";function En(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function Sn(e,t){return function(r){return e(t(r))}}var wn=Function.prototype,ot=Object.prototype,st=wn.toString,On=ot.hasOwnProperty,Ln=st.call(Object),Dn=ot.toString,An=Sn(Object.getPrototypeOf,Object);function Cn(e){return!!e&&typeof e=="object"}function In(e){if(!Cn(e)||Dn.call(e)!=yn||En(e))return!1;var t=An(e);if(t===null)return!0;var r=On.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&st.call(r)==Ln}lt.exports=In});var Xt=Ue((ne,B)=>{var _n=200,yt="__lodash_hash_undefined__",Et=9007199254740991,Ve="[object Arguments]",Nn="[object Array]",St="[object Boolean]",wt="[object Date]",vn="[object Error]",Re="[object Function]",Ot="[object GeneratorFunction]",ue="[object Map]",Lt="[object Number]",Me="[object Object]",ut="[object Promise]",Dt="[object RegExp]",ge="[object Set]",At="[object String]",Ct="[object Symbol]",Ae="[object WeakMap]",It="[object ArrayBuffer]",ce="[object DataView]",_t="[object Float32Array]",Nt="[object Float64Array]",vt="[object Int8Array]",Vt="[object Int16Array]",Rt="[object Int32Array]",Mt="[object Uint8Array]",Pt="[object Uint8ClampedArray]",Ht="[object Uint16Array]",Ft="[object Uint32Array]",Vn=/[\\^$.*+?()[\]{}|]/g,Rn=/\w*$/,Mn=/^\[object .+?Constructor\]$/,Pn=/^(?:0|[1-9]\d*)$/,w={};w[Ve]=w[Nn]=w[It]=w[ce]=w[St]=w[wt]=w[_t]=w[Nt]=w[vt]=w[Vt]=w[Rt]=w[ue]=w[Lt]=w[Me]=w[Dt]=w[ge]=w[At]=w[Ct]=w[Mt]=w[Pt]=w[Ht]=w[Ft]=!0;w[vn]=w[Re]=w[Ae]=!1;var Hn=typeof global=="object"&&global&&global.Object===Object&&global,Fn=typeof self=="object"&&self&&self.Object===Object&&self,N=Hn||Fn||Function("return this")(),xt=typeof ne=="object"&&ne&&!ne.nodeType&&ne,gt=xt&&typeof B=="object"&&B&&!B.nodeType&&B,xn=gt&&gt.exports===xt;function Wn(e,t){return e.set(t[0],t[1]),e}function jn(e,t){return e.add(t),e}function Jn(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}function kn(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}function Wt(e,t,r,n){var a=-1,o=e?e.length:0;for(n&&o&&(r=e[++a]);++a<o;)r=t(r,e[a],a,e);return r}function Bn(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Un(e,t){return e==null?void 0:e[t]}function jt(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function ct(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}function Pe(e,t){return function(r){return e(t(r))}}function ft(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Gn=Array.prototype,qn=Function.prototype,fe=Object.prototype,De=N["__core-js_shared__"],mt=function(){var e=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Jt=qn.toString,H=fe.hasOwnProperty,me=fe.toString,Kn=RegExp("^"+Jt.call(H).replace(Vn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ht=xn?N.Buffer:void 0,$t=N.Symbol,pt=N.Uint8Array,Yn=Pe(Object.getPrototypeOf,Object),Xn=Object.create,zn=fe.propertyIsEnumerable,Zn=Gn.splice,bt=Object.getOwnPropertySymbols,Qn=ht?ht.isBuffer:void 0,er=Pe(Object.keys,Object),Ce=q(N,"DataView"),re=q(N,"Map"),Ie=q(N,"Promise"),_e=q(N,"Set"),Ne=q(N,"WeakMap"),ie=q(Object,"create"),tr=W(Ce),nr=W(re),rr=W(Ie),ir=W(_e),or=W(Ne),dt=$t?$t.prototype:void 0,Tt=dt?dt.valueOf:void 0;function x(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function sr(){this.__data__=ie?ie(null):{}}function lr(e){return this.has(e)&&delete this.__data__[e]}function ar(e){var t=this.__data__;if(ie){var r=t[e];return r===yt?void 0:r}return H.call(t,e)?t[e]:void 0}function ur(e){var t=this.__data__;return ie?t[e]!==void 0:H.call(t,e)}function gr(e,t){var r=this.__data__;return r[e]=ie&&t===void 0?yt:t,this}x.prototype.clear=sr;x.prototype.delete=lr;x.prototype.get=ar;x.prototype.has=ur;x.prototype.set=gr;function v(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function cr(){this.__data__=[]}function fr(e){var t=this.__data__,r=he(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Zn.call(t,r,1),!0}function mr(e){var t=this.__data__,r=he(t,e);return r<0?void 0:t[r][1]}function hr(e){return he(this.__data__,e)>-1}function $r(e,t){var r=this.__data__,n=he(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}v.prototype.clear=cr;v.prototype.delete=fr;v.prototype.get=mr;v.prototype.has=hr;v.prototype.set=$r;function U(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function pr(){this.__data__={hash:new x,map:new(re||v),string:new x}}function br(e){return $e(this,e).delete(e)}function dr(e){return $e(this,e).get(e)}function Tr(e){return $e(this,e).has(e)}function yr(e,t){return $e(this,e).set(e,t),this}U.prototype.clear=pr;U.prototype.delete=br;U.prototype.get=dr;U.prototype.has=Tr;U.prototype.set=yr;function G(e){this.__data__=new v(e)}function Er(){this.__data__=new v}function Sr(e){return this.__data__.delete(e)}function wr(e){return this.__data__.get(e)}function Or(e){return this.__data__.has(e)}function Lr(e,t){var r=this.__data__;if(r instanceof v){var n=r.__data__;if(!re||n.length<_n-1)return n.push([e,t]),this;r=this.__data__=new U(n)}return r.set(e,t),this}G.prototype.clear=Er;G.prototype.delete=Sr;G.prototype.get=wr;G.prototype.has=Or;G.prototype.set=Lr;function Dr(e,t){var r=Fe(e)||Xr(e)?Bn(e.length,String):[],n=r.length,a=!!n;for(var o in e)(t||H.call(e,o))&&!(a&&(o=="length"||Gr(o,n)))&&r.push(o);return r}function kt(e,t,r){var n=e[t];(!(H.call(e,t)&&qt(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function he(e,t){for(var r=e.length;r--;)if(qt(e[r][0],t))return r;return-1}function Ar(e,t){return e&&Bt(t,xe(t),e)}function ve(e,t,r,n,a,o,u){var l;if(n&&(l=o?n(e,a,o,u):n(e)),l!==void 0)return l;if(!pe(e))return e;var c=Fe(e);if(c){if(l=kr(e),!t)return Wr(e,l)}else{var s=F(e),$=s==Re||s==Ot;if(Zr(e))return Vr(e,t);if(s==Me||s==Ve||$&&!o){if(jt(e))return o?e:{};if(l=Br($?{}:e),!t)return jr(e,Ar(l,e))}else{if(!w[s])return o?e:{};l=Ur(e,s,ve,t)}}u||(u=new G);var h=u.get(e);if(h)return h;if(u.set(e,l),!c)var T=r?Jr(e):xe(e);return Jn(T||e,function(m,f){T&&(f=m,m=e[f]),kt(l,f,ve(m,t,r,n,f,e,u))}),l}function Cr(e){return pe(e)?Xn(e):{}}function Ir(e,t,r){var n=t(e);return Fe(e)?n:kn(n,r(e))}function _r(e){return me.call(e)}function Nr(e){if(!pe(e)||Kr(e))return!1;var t=Yt(e)||jt(e)?Kn:Mn;return t.test(W(e))}function vr(e){if(!Gt(e))return er(e);var t=[];for(var r in Object(e))H.call(e,r)&&r!="constructor"&&t.push(r);return t}function Vr(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function He(e){var t=new e.constructor(e.byteLength);return new pt(t).set(new pt(e)),t}function Rr(e,t){var r=t?He(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function Mr(e,t,r){var n=t?r(ct(e),!0):ct(e);return Wt(n,Wn,new e.constructor)}function Pr(e){var t=new e.constructor(e.source,Rn.exec(e));return t.lastIndex=e.lastIndex,t}function Hr(e,t,r){var n=t?r(ft(e),!0):ft(e);return Wt(n,jn,new e.constructor)}function Fr(e){return Tt?Object(Tt.call(e)):{}}function xr(e,t){var r=t?He(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Wr(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function Bt(e,t,r,n){r||(r={});for(var a=-1,o=t.length;++a<o;){var u=t[a],l=n?n(r[u],e[u],u,r,e):void 0;kt(r,u,l===void 0?e[u]:l)}return r}function jr(e,t){return Bt(e,Ut(e),t)}function Jr(e){return Ir(e,xe,Ut)}function $e(e,t){var r=e.__data__;return qr(t)?r[typeof t=="string"?"string":"hash"]:r.map}function q(e,t){var r=Un(e,t);return Nr(r)?r:void 0}var Ut=bt?Pe(bt,Object):ti,F=_r;(Ce&&F(new Ce(new ArrayBuffer(1)))!=ce||re&&F(new re)!=ue||Ie&&F(Ie.resolve())!=ut||_e&&F(new _e)!=ge||Ne&&F(new Ne)!=Ae)&&(F=function(e){var t=me.call(e),r=t==Me?e.constructor:void 0,n=r?W(r):void 0;if(n)switch(n){case tr:return ce;case nr:return ue;case rr:return ut;case ir:return ge;case or:return Ae}return t});function kr(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&H.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function Br(e){return typeof e.constructor=="function"&&!Gt(e)?Cr(Yn(e)):{}}function Ur(e,t,r,n){var a=e.constructor;switch(t){case It:return He(e);case St:case wt:return new a(+e);case ce:return Rr(e,n);case _t:case Nt:case vt:case Vt:case Rt:case Mt:case Pt:case Ht:case Ft:return xr(e,n);case ue:return Mr(e,n,r);case Lt:case At:return new a(e);case Dt:return Pr(e);case ge:return Hr(e,n,r);case Ct:return Fr(e)}}function Gr(e,t){return t=t==null?Et:t,!!t&&(typeof e=="number"||Pn.test(e))&&e>-1&&e%1==0&&e<t}function qr(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Kr(e){return!!mt&&mt in e}function Gt(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||fe;return e===r}function W(e){if(e!=null){try{return Jt.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Yr(e){return ve(e,!0,!0)}function qt(e,t){return e===t||e!==e&&t!==t}function Xr(e){return zr(e)&&H.call(e,"callee")&&(!zn.call(e,"callee")||me.call(e)==Ve)}var Fe=Array.isArray;function Kt(e){return e!=null&&Qr(e.length)&&!Yt(e)}function zr(e){return ei(e)&&Kt(e)}var Zr=Qn||ni;function Yt(e){var t=pe(e)?me.call(e):"";return t==Re||t==Ot}function Qr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Et}function pe(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function ei(e){return!!e&&typeof e=="object"}function xe(e){return Kt(e)?Dr(e):vr(e)}function ti(){return[]}function ni(){return!1}B.exports=Yr});var gi={};gn(gi,{crush:()=>ui,defaults:()=>Zt,version:()=>ai});var fn={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Se(e,t){if(!Array.isArray(e)||!e.length)return e;let r=S(S({},fn),t),n,a;if(r.strictlyTwoElementsInRangeArrays&&!e.every((l,c)=>!Array.isArray(l)||l.length!==2?(n=c,a=l.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, ${n}th range (${JSON.stringify(e[n],null,4)}) has not two but ${a} elements!`);if(!e.every((l,c)=>!Array.isArray(l)||!Number.isInteger(l[0])||l[0]<0||!Number.isInteger(l[1])||l[1]<0?(n=c,!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, ${n}th range (${JSON.stringify(e[n],null,4)}) does not consist of only natural numbers!`);let o=e.length**2,u=0;return Array.from(e).sort((l,c)=>(r.progressFn&&(u+=1,r.progressFn(Math.floor(u*100/o))),l[0]===c[0]?l[1]<c[1]?-1:l[1]>c[1]?1:0:l[0]<c[0]?-1:1))}var Ke={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Ye(e,t){function r(s){return s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;let n;if(t)if(r(t)){if(n=S(S({},Ke),t),n.progressFn&&r(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof n.progressFn}", equal to ${JSON.stringify(n.progressFn,null,4)}`);if(![1,2,"1","2"].includes(n.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof n.mergeType}", equal to ${JSON.stringify(n.mergeType,null,4)}`);if(typeof n.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 n.joinRangesThatTouchEdges}", equal to ${JSON.stringify(n.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
11
+ ${JSON.stringify(t,null,4)} (type ${typeof t})`);else n=S({},Ke);let a=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),o,u,l;n.progressFn?o=Se(a,{progressFn:s=>{l=Math.floor(s/5),l!==u&&(u=l,n.progressFn(l))}}):o=Se(a);let c=o.length-1;for(let s=c;s>0;s--)n.progressFn&&(l=Math.floor((1-s/c)*78)+21,l!==u&&l>u&&(u=l,n.progressFn(l))),(o[s][0]<=o[s-1][0]||!n.joinRangesThatTouchEdges&&o[s][0]<o[s-1][1]||n.joinRangesThatTouchEdges&&o[s][0]<=o[s-1][1])&&(o[s-1][0]=Math.min(o[s][0],o[s-1][0]),o[s-1][1]=Math.max(o[s][1],o[s-1][1]),o[s][2]!==void 0&&(o[s-1][0]>=o[s][0]||o[s-1][1]<=o[s][1])&&o[s-1][2]!==null&&(o[s][2]===null&&o[s-1][2]!==null?o[s-1][2]=null:o[s-1][2]!=null?+n.mergeType==2&&o[s-1][0]===o[s][0]?o[s-1][2]=o[s][2]:o[s-1][2]+=o[s][2]:o[s-1][2]=o[s][2]),o.splice(s,1),s=o.length);return o.length?o:null}var mn=!0,we="Invariant failed";function Xe(e,t){if(!e){if(mn)throw new Error(we);var r=typeof t=="function"?t():t,n=r?we+": "+r:we;throw new Error(n)}}function ze(e,t,r){let n=0,a=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($=>$).length)return e;let o;Array.isArray(t)&&Number.isInteger(t[0])&&Number.isInteger(t[1])?o=[Array.from(t)]:o=Array.from(t);let u=o.length,l=0;o.filter($=>$).forEach(($,h)=>{if(r&&(n=Math.floor(l/u*10),n!==a&&(a=n,r(n))),!Array.isArray($))throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${h}th element not an array: ${JSON.stringify($,null,4)}, which is ${typeof $}`);if(!Number.isInteger($[0])){if(!Number.isInteger(+$[0])||+$[0]<0)throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${h}th element, array ${JSON.stringify($,null,0)}. Its first element is not an integer, string index, but ${typeof $[0]}, equal to: ${JSON.stringify($[0],null,4)}.`);o[h][0]=+o[h][0]}if(!Number.isInteger($[1])){if(!Number.isInteger(+$[1])||+$[1]<0)throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${h}th element, array ${JSON.stringify($,null,0)}. Its second element is not an integer, string index, but ${typeof $[1]}, equal to: ${JSON.stringify($[1],null,4)}.`);o[h][1]=+o[h][1]}l+=1});let c=Ye(o,{progressFn:$=>{r&&(n=10+Math.floor($/10),n!==a&&(a=n,r(n)))}});Xe(c);let s=c.length;if(s>0){let $=e.slice(c[s-1][1]);e=c.reduce((h,T,m,f)=>{r&&(n=20+Math.floor(m/s*80),n!==a&&(a=n,r(n)));let O=m===0?0:f[m-1][1],L=f[m][0];return`${h}${e.slice(O,L)}${f[m][2]||""}`},""),e+=$}return e}function se(e,t=1){let r="\xA0";function n(o){return Array.from(o).reverse().join("")}function a(o,u,l){let c=l?`
12
12
  `:"\r",s=l?"\r":`
13
13
  `;if(!o)return o;let $=0,h=0,T="";for(let m=0,f=o.length;m<f;m++)(o[m]===c||o[m]===s&&o[m-1]!==c)&&h++,`\r
14
- `.includes(o[m])||o[m]===r?($=0,o[m]===r?T+=o[m]:o[m]===c?h<=u&&(T+=o[m],o[m+1]===s&&(T+=o[m+1],m++)):o[m]===s&&(!o[m-1]||o[m-1]!==c)&&h<=u&&(T+=o[m])):($++,!o[m+1]&&!h&&(T+=" "));return T}if(typeof e=="string"&&e.length){let o=1;typeof+t=="number"&&Number.isInteger(+t)&&+t>=0&&(o=+t);let u="",l="";if(!e.trim())u=e;else if(!e[0].trim()){for(let c=0,s=e.length;c<s;c++)if(e[c].trim()){u=e.slice(0,c);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===r)){for(let c=e.length;c--;)if(e[c].trim()){l=e.slice(c+1);break}}return`${a(u,o,!1)}${e.trim()}${n(a(n(l),o,!0))}`}return e}var $n={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Qe(e,t){if(!Array.isArray(e)||!e.length)return e;let r=S(S({},$n),t),n,a;if(r.strictlyTwoElementsInRangeArrays&&!e.every((l,c)=>!Array.isArray(l)||l.length!==2?(n=c,a=l.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, ${n}th range (${JSON.stringify(e[n],null,4)}) has not two but ${a} elements!`);if(!e.every((l,c)=>!Array.isArray(l)||!Number.isInteger(l[0])||l[0]<0||!Number.isInteger(l[1])||l[1]<0?(n=c,!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, ${n}th range (${JSON.stringify(e[n],null,4)}) does not consist of only natural numbers!`);let o=e.length**2,u=0;return Array.from(e).sort((l,c)=>(r.progressFn&&(u+=1,r.progressFn(Math.floor(u*100/o))),l[0]===c[0]?l[1]<c[1]?-1:l[1]>c[1]?1:0:l[0]<c[0]?-1:1))}var et={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function pn(e,t){function r(s){return s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;let n;if(t)if(r(t)){if(n=S(S({},et),t),n.progressFn&&r(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof n.progressFn}", equal to ${JSON.stringify(n.progressFn,null,4)}`);if(![1,2,"1","2"].includes(n.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof n.mergeType}", equal to ${JSON.stringify(n.mergeType,null,4)}`);if(typeof n.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 n.joinRangesThatTouchEdges}", equal to ${JSON.stringify(n.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
15
- ${JSON.stringify(t,null,4)} (type ${typeof t})`);else n=S({},et);let a=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),o,u,l;n.progressFn?o=Qe(a,{progressFn:s=>{l=Math.floor(s/5),l!==u&&(u=l,n.progressFn(l))}}):o=Qe(a);let c=o.length-1;for(let s=c;s>0;s--)n.progressFn&&(l=Math.floor((1-s/c)*78)+21,l!==u&&l>u&&(u=l,n.progressFn(l))),(o[s][0]<=o[s-1][0]||!n.joinRangesThatTouchEdges&&o[s][0]<o[s-1][1]||n.joinRangesThatTouchEdges&&o[s][0]<=o[s-1][1])&&(o[s-1][0]=Math.min(o[s][0],o[s-1][0]),o[s-1][1]=Math.max(o[s][1],o[s-1][1]),o[s][2]!==void 0&&(o[s-1][0]>=o[s][0]||o[s-1][1]<=o[s][1])&&o[s-1][2]!==null&&(o[s][2]===null&&o[s-1][2]!==null?o[s-1][2]=null:o[s-1][2]!=null?+n.mergeType==2&&o[s-1][0]===o[s][0]?o[s-1][2]=o[s][2]:o[s-1][2]+=o[s][2]:o[s-1][2]=o[s][2]),o.splice(s,1),s=o.length);return o.length?o:null}function M(e){return e!=null}function P(e){return Number.isInteger(e)&&e>=0}function te(e){return typeof e=="string"}var bn={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},tt=class{constructor(e){Ee(this,"ranges");Ee(this,"opts");let t=S(S({},bn),e);if(t.mergeType&&t.mergeType!==1&&t.mergeType!==2)if(te(t.mergeType)&&t.mergeType.trim()==="1")t.mergeType=1;else if(te(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){if(e==null&&t==null)return;if(M(e)&&!M(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&&P(+e[0])&&P(+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(!M(e)&&M(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 n=+e,a=+t;if(P(r)&&(r=String(r)),P(n)&&P(a)){if(M(r)&&!te(r)&&!P(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:
16
- ${JSON.stringify(r,null,4)}`);if(M(this.ranges)&&Array.isArray(this.last())&&n===this.last()[1]){if(this.last()[1]=a,this.last()[2],this.last()[2]!==null&&M(r)){let o=this.last()[2]&&this.last()[2].length>0&&(!this.opts||!this.opts.mergeType||this.opts.mergeType===1)?`${this.last()[2]}${r}`:r;this.opts.limitToBeAddedWhitespace&&(o=se(o,this.opts.limitLinebreaksCount)),te(o)&&!o.length||(this.last()[2]=o)}}else{this.ranges||(this.ranges=[]);let o=r!==void 0&&!(te(r)&&!r.length)?[n,a,r&&this.opts.limitToBeAddedWhitespace?se(r,this.opts.limitLinebreaksCount):r]:[n,a];this.ranges.push(o)}}else throw P(n)&&n>=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 a}" equal to: ${JSON.stringify(a,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 n}" equal to: ${JSON.stringify(n,null,4)}`)}push(e,t,r){this.add(e,t,r)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=pn(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>M(e[2])?[e[0],e[1],se(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])&&P(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}};function nt(e){return typeof e=="string"?e.length?[e]:[]:e}function rt(e){return e&&typeof e=="object"&&!Array.isArray(e)}function le(e){return typeof e=="string"}var it={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},dn=e=>e+1;function Tn(e,t,r,n,a=!1,o=dn){let u=typeof r=="function"?r():r;if(+t<0&&a&&u==="EOL")return u;let l=S(S({},it),n);if(t>=e.length&&!a)return!1;let c=a?1:r.length,s=0,$=!1,h=!1,T=!1,m=l.maxMismatches,f=t,O=!1,L=!1,p=!1;function b(){return s===1&&m<l.maxMismatches-1}for(;e[f];){let d=o(f);if(l.trimBeforeMatching&&e[f].trim()===""){if(!e[d]&&a&&r==="EOL")return!0;f=o(f);continue}if(l&&!l.i&&l.trimCharsBeforeMatching&&l.trimCharsBeforeMatching.includes(e[f])||(l==null?void 0:l.i)&&l.trimCharsBeforeMatching&&l.trimCharsBeforeMatching.map(A=>A.toLowerCase()).includes(e[f].toLowerCase())){if(a&&r==="EOL"&&!e[d])return!0;f=o(f);continue}let E=d>f?r[r.length-c]:r[c-1];if(!l.i&&e[f]===E||l.i&&e[f].toLowerCase()===E.toLowerCase()){if(O||(O=!0),T||(T=!0),c===r.length){if(L=!0,m!==l.maxMismatches)return!1}else c===1&&(p=!0);if(c-=1,s++,b())return!1;if(!c)return s!==r.length||m===l.maxMismatches||!$?f:!1}else if(!$&&!s&&($=!0),l.maxMismatches&&m&&f){m-=1;for(let A=0;A<=m;A++){let I=d>f?r[r.length-c+1+A]:r[c-2-A],V=e[o(f)];if(I&&(!l.i&&e[f]===I||l.i&&e[f].toLowerCase()===I.toLowerCase())&&(!l.firstMustMatch||c!==r.length)){if(s++,b())return!1;c-=2,O=!0;break}else if(V&&I&&(!l.i&&V===I||l.i&&V.toLowerCase()===I.toLowerCase())&&(!l.firstMustMatch||c!==r.length)){if(!s&&!l.hungry)return!1;c-=1,O=!0;break}else if(I===void 0&&m>=0&&O&&(!l.firstMustMatch||L)&&(!l.lastMustMatch||p))return f}O||(h=f)}else return f===0&&c===1&&!l.lastMustMatch&&T?0:!1;if(h!==!1&&h!==f&&(h=!1),c<1)return f;f=o(f)}if(c>0)return a&&u==="EOL"?!0:l&&l.maxMismatches>=c&&T?h||0:!1}function Oe(e,t,r,n,a){if(rt(a)&&Object.prototype.hasOwnProperty.call(a,"trimBeforeMatching")&&typeof a.trimBeforeMatching!="boolean")throw new Error(`string-match-left-right/${e}(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!${Array.isArray(a.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""}`);let o=S(S({},it),a);if(typeof o.trimCharsBeforeMatching=="string"&&(o.trimCharsBeforeMatching=nt(o.trimCharsBeforeMatching)),o.trimCharsBeforeMatching=o.trimCharsBeforeMatching.map($=>le($)?$:String($)),!le(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:
14
+ `.includes(o[m])||o[m]===r?($=0,o[m]===r?T+=o[m]:o[m]===c?h<=u&&(T+=o[m],o[m+1]===s&&(T+=o[m+1],m++)):o[m]===s&&(!o[m-1]||o[m-1]!==c)&&h<=u&&(T+=o[m])):($++,!o[m+1]&&!h&&(T+=" "));return T}if(typeof e=="string"&&e.length){let o=1;typeof+t=="number"&&Number.isInteger(+t)&&+t>=0&&(o=+t);let u="",l="";if(!e.trim())u=e;else if(!e[0].trim()){for(let c=0,s=e.length;c<s;c++)if(e[c].trim()){u=e.slice(0,c);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===r)){for(let c=e.length;c--;)if(e[c].trim()){l=e.slice(c+1);break}}return`${a(u,o,!1)}${e.trim()}${n(a(n(l),o,!0))}`}return e}var hn={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Ze(e,t){if(!Array.isArray(e)||!e.length)return e;let r=S(S({},hn),t),n,a;if(r.strictlyTwoElementsInRangeArrays&&!e.every((l,c)=>!Array.isArray(l)||l.length!==2?(n=c,a=l.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, ${n}th range (${JSON.stringify(e[n],null,4)}) has not two but ${a} elements!`);if(!e.every((l,c)=>!Array.isArray(l)||!Number.isInteger(l[0])||l[0]<0||!Number.isInteger(l[1])||l[1]<0?(n=c,!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, ${n}th range (${JSON.stringify(e[n],null,4)}) does not consist of only natural numbers!`);let o=e.length**2,u=0;return Array.from(e).sort((l,c)=>(r.progressFn&&(u+=1,r.progressFn(Math.floor(u*100/o))),l[0]===c[0]?l[1]<c[1]?-1:l[1]>c[1]?1:0:l[0]<c[0]?-1:1))}var Qe={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function $n(e,t){function r(s){return s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;let n;if(t)if(r(t)){if(n=S(S({},Qe),t),n.progressFn&&r(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof n.progressFn}", equal to ${JSON.stringify(n.progressFn,null,4)}`);if(![1,2,"1","2"].includes(n.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof n.mergeType}", equal to ${JSON.stringify(n.mergeType,null,4)}`);if(typeof n.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 n.joinRangesThatTouchEdges}", equal to ${JSON.stringify(n.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
15
+ ${JSON.stringify(t,null,4)} (type ${typeof t})`);else n=S({},Qe);let a=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),o,u,l;n.progressFn?o=Ze(a,{progressFn:s=>{l=Math.floor(s/5),l!==u&&(u=l,n.progressFn(l))}}):o=Ze(a);let c=o.length-1;for(let s=c;s>0;s--)n.progressFn&&(l=Math.floor((1-s/c)*78)+21,l!==u&&l>u&&(u=l,n.progressFn(l))),(o[s][0]<=o[s-1][0]||!n.joinRangesThatTouchEdges&&o[s][0]<o[s-1][1]||n.joinRangesThatTouchEdges&&o[s][0]<=o[s-1][1])&&(o[s-1][0]=Math.min(o[s][0],o[s-1][0]),o[s-1][1]=Math.max(o[s][1],o[s-1][1]),o[s][2]!==void 0&&(o[s-1][0]>=o[s][0]||o[s-1][1]<=o[s][1])&&o[s-1][2]!==null&&(o[s][2]===null&&o[s-1][2]!==null?o[s-1][2]=null:o[s-1][2]!=null?+n.mergeType==2&&o[s-1][0]===o[s][0]?o[s-1][2]=o[s][2]:o[s-1][2]+=o[s][2]:o[s-1][2]=o[s][2]),o.splice(s,1),s=o.length);return o.length?o:null}function M(e){return e!=null}function P(e){return Number.isInteger(e)&&e>=0}function te(e){return typeof e=="string"}var pn={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},et=class{constructor(e){Ee(this,"ranges");Ee(this,"opts");let t=S(S({},pn),e);if(t.mergeType&&t.mergeType!==1&&t.mergeType!==2)if(te(t.mergeType)&&t.mergeType.trim()==="1")t.mergeType=1;else if(te(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){if(e==null&&t==null)return;if(M(e)&&!M(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&&P(+e[0])&&P(+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(!M(e)&&M(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 n=+e,a=+t;if(P(r)&&(r=String(r)),P(n)&&P(a)){if(M(r)&&!te(r)&&!P(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:
16
+ ${JSON.stringify(r,null,4)}`);if(M(this.ranges)&&Array.isArray(this.last())&&n===this.last()[1]){if(this.last()[1]=a,this.last()[2],this.last()[2]!==null&&M(r)){let o=this.last()[2]&&this.last()[2].length>0&&(!this.opts||!this.opts.mergeType||this.opts.mergeType===1)?`${this.last()[2]}${r}`:r;this.opts.limitToBeAddedWhitespace&&(o=se(o,this.opts.limitLinebreaksCount)),te(o)&&!o.length||(this.last()[2]=o)}}else{this.ranges||(this.ranges=[]);let o=r!==void 0&&!(te(r)&&!r.length)?[n,a,r&&this.opts.limitToBeAddedWhitespace?se(r,this.opts.limitLinebreaksCount):r]:[n,a];this.ranges.push(o)}}else throw P(n)&&n>=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 a}" equal to: ${JSON.stringify(a,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 n}" equal to: ${JSON.stringify(n,null,4)}`)}push(e,t,r){this.add(e,t,r)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=$n(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>M(e[2])?[e[0],e[1],se(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])&&P(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}};function tt(e){return typeof e=="string"?e.length?[e]:[]:e}function nt(e){return e&&typeof e=="object"&&!Array.isArray(e)}function le(e){return typeof e=="string"}var rt={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},bn=e=>e+1;function dn(e,t,r,n,a=!1,o=bn){let u=typeof r=="function"?r():r;if(+t<0&&a&&u==="EOL")return u;let l=S(S({},rt),n);if(t>=e.length&&!a)return!1;let c=a?1:r.length,s=0,$=!1,h=!1,T=!1,m=l.maxMismatches,f=t,O=!1,L=!1,p=!1;function b(){return s===1&&m<l.maxMismatches-1}for(;e[f];){let d=o(f);if(l.trimBeforeMatching&&e[f].trim()===""){if(!e[d]&&a&&r==="EOL")return!0;f=o(f);continue}if(l&&!l.i&&l.trimCharsBeforeMatching&&l.trimCharsBeforeMatching.includes(e[f])||(l==null?void 0:l.i)&&l.trimCharsBeforeMatching&&l.trimCharsBeforeMatching.map(A=>A.toLowerCase()).includes(e[f].toLowerCase())){if(a&&r==="EOL"&&!e[d])return!0;f=o(f);continue}let E=d>f?r[r.length-c]:r[c-1];if(!l.i&&e[f]===E||l.i&&e[f].toLowerCase()===E.toLowerCase()){if(O||(O=!0),T||(T=!0),c===r.length){if(L=!0,m!==l.maxMismatches)return!1}else c===1&&(p=!0);if(c-=1,s++,b())return!1;if(!c)return s!==r.length||m===l.maxMismatches||!$?f:!1}else if(!$&&!s&&($=!0),l.maxMismatches&&m&&f){m-=1;for(let A=0;A<=m;A++){let I=d>f?r[r.length-c+1+A]:r[c-2-A],V=e[o(f)];if(I&&(!l.i&&e[f]===I||l.i&&e[f].toLowerCase()===I.toLowerCase())&&(!l.firstMustMatch||c!==r.length)){if(s++,b())return!1;c-=2,O=!0;break}else if(V&&I&&(!l.i&&V===I||l.i&&V.toLowerCase()===I.toLowerCase())&&(!l.firstMustMatch||c!==r.length)){if(!s&&!l.hungry)return!1;c-=1,O=!0;break}else if(I===void 0&&m>=0&&O&&(!l.firstMustMatch||L)&&(!l.lastMustMatch||p))return f}O||(h=f)}else return f===0&&c===1&&!l.lastMustMatch&&T?0:!1;if(h!==!1&&h!==f&&(h=!1),c<1)return f;f=o(f)}if(c>0)return a&&u==="EOL"?!0:l&&l.maxMismatches>=c&&T?h||0:!1}function Oe(e,t,r,n,a){if(nt(a)&&Object.prototype.hasOwnProperty.call(a,"trimBeforeMatching")&&typeof a.trimBeforeMatching!="boolean")throw new Error(`string-match-left-right/${e}(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!${Array.isArray(a.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""}`);let o=S(S({},rt),a);if(typeof o.trimCharsBeforeMatching=="string"&&(o.trimCharsBeforeMatching=tt(o.trimCharsBeforeMatching)),o.trimCharsBeforeMatching=o.trimCharsBeforeMatching.map($=>le($)?$:String($)),!le(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:
17
17
  ${JSON.stringify(r,null,4)}`);let u,l;if(le(n))u=[n];else if(Array.isArray(n))u=n;else if(!n)u=n;else if(typeof n=="function")u=[],u.push(n);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 n}, equal to:
18
- ${JSON.stringify(n,null,4)}`);if(a&&!rt(a))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 a}", and equal to:
19
- ${JSON.stringify(a,null,4)}`);let c=0,s="";if((o==null?void 0:o.trimCharsBeforeMatching)&&o.trimCharsBeforeMatching.some(($,h)=>$.length>1?(c=h,s=$,!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 ${c} is longer than 1 character, ${s.length} (equals to ${s}). Please split it into separate characters and put into array as separate elements.`);if(!u||!Array.isArray(u)||Array.isArray(u)&&!u.length||Array.isArray(u)&&u.length===1&&le(u[0])&&!u[0].trim()){if(typeof o.cb=="function"){let h,T=r;if((e==="matchLeftIncl"||e==="matchRight")&&(T+=1),e[5]==="L")for(let L=T;L--;){let p=t[L];if((!o.trimBeforeMatching||o.trimBeforeMatching&&p!==void 0&&p.trim())&&(!o.trimCharsBeforeMatching||!o.trimCharsBeforeMatching.length||p!==void 0&&!o.trimCharsBeforeMatching.includes(p))){h=L;break}}else if(e.startsWith("matchRight"))for(let L=T;L<t.length;L++){let p=t[L];if((!o.trimBeforeMatching||o.trimBeforeMatching&&p.trim())&&(!o.trimCharsBeforeMatching||!o.trimCharsBeforeMatching.length||!o.trimCharsBeforeMatching.includes(p))){h=L;break}}if(h===void 0)return!1;let m=t[h],f=h+1,O="";return f&&f>0&&(O=t.slice(0,f)),e[5]==="L"||h&&h>0&&(O=t.slice(h)),o.cb(m,O,h)}let $="";throw a||($=" 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!${$}`)}for(let $=0,h=u.length;$<h;$++){l=typeof u[$]=="function";let T=u[$],m,f,O="",L=r;e==="matchRight"?L+=1:e==="matchLeft"&&(L-=1);let p=Tn(t,L,T,o,l,b=>e[5]==="L"?b-1:b+1);if(p&&l&&typeof T=="function"&&T()==="EOL")return T()&&(o.cb?o.cb(m,O,f):!0)?T():!1;if(Number.isInteger(p)&&(f=e.startsWith("matchLeft")?p-1:p+1,e[5]==="L"?O=t.slice(0,p):O=t.slice(f)),f<0&&(f=void 0),t[f]&&(m=t[f]),Number.isInteger(p)&&(o.cb?o.cb(m,O,f):!0))return T}return!1}function ot(e,t,r,n){return Oe("matchLeft",e,t,r,n)}function Le(e,t,r,n){return Oe("matchRightIncl",e,t,r,n)}function k(e,t,r,n){return Oe("matchRight",e,t,r,n)}var yn={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function ae(e){var c;let t=/^[0-9a-zA-Z]+$/;function r(s){return!s||typeof s!="string"?!1:!s.trim()}function n(s){return typeof s=="string"}if(!e||typeof e!="object"||Array.isArray(e)){let s;throw e===void 0?s="but it is missing completely.":e===null?s="but it was given as null.":s=`but it was given as ${typeof e}, equal to:
20
- ${JSON.stringify(e,null,4)}.`,new Error(`string-range-expander: [THROW_ID_01] Input must be a plain object ${s}`)}else if(typeof e=="object"&&e!==null&&!Array.isArray(e)&&!Object.keys(e).length)throw new Error("string-range-expander: [THROW_ID_02] Input must be a plain object but it was given as a plain object without any keys.");if(typeof e.from!="number")throw new Error(`string-range-expander: [THROW_ID_03] The input's "from" value opts.from, is not a number! Currently it's given as ${typeof e.from}, equal to ${JSON.stringify(e.from,null,0)}`);if(typeof e.to!="number")throw new Error(`string-range-expander: [THROW_ID_04] The input's "to" value opts.to, is not a number! Currently it's given as ${typeof e.to}, equal to ${JSON.stringify(e.to,null,0)}`);if((e==null?void 0:e.str)&&!e.str[e.from]&&e.from!==e.to)throw new Error(`string-range-expander: [THROW_ID_05] The given input string opts.str ("${e.str}") must contain the character at index "from" ("${e.from}")`);if((e==null?void 0:e.str)&&!e.str[e.to-1])throw new Error(`string-range-expander: [THROW_ID_06] The given input string, opts.str ("${e.str}") must contain the character at index before "to" ("${e.to-1}")`);if(e.from>e.to)throw new Error(`string-range-expander: [THROW_ID_07] The given "from" index, "${e.from}" is greater than "to" index, "${e.to}". That's wrong!`);if(n(e.extendToOneSide)&&e.extendToOneSide!=="left"&&e.extendToOneSide!=="right"||!n(e.extendToOneSide)&&e.extendToOneSide!==void 0&&e.extendToOneSide!==!1)throw new Error(`string-range-expander: [THROW_ID_08] The opts.extendToOneSide value is not recogniseable! It's set to: "${e.extendToOneSide}" (${typeof e.extendToOneSide}). It has to be either Boolean "false" or strings "left" or "right"`);let a=S(S({},yn),e);if(Array.isArray(a.ifLeftSideIncludesThisThenCropTightly)){let s,$;if(a.ifLeftSideIncludesThisThenCropTightly.every((h,T)=>n(h)?!0:(s=T,$=h,!1)))a.ifLeftSideIncludesThisThenCropTightly=a.ifLeftSideIncludesThisThenCropTightly.join("");else throw new Error(`string-range-expander: [THROW_ID_09] The opts.ifLeftSideIncludesThisThenCropTightly was set to an array:
21
- ${JSON.stringify(a.ifLeftSideIncludesThisThenCropTightly,null,4)}. Now, that array contains not only string elements. For example, an element at index ${s} is of a type ${typeof $} (equal to ${JSON.stringify($,null,0)}).`)}let o=a.str,u=a.from,l=a.to;if(a.extendToOneSide!=="right"&&(r(o[u-1])&&(r(o[u-2])||a.ifLeftSideIncludesThisCropItToo.includes(o[u-2]))||o[u-1]&&a.ifLeftSideIncludesThisCropItToo.includes(o[u-1])||a.wipeAllWhitespaceOnLeft&&r(o[u-1]))){for(let s=u;s--;)if(!a.ifLeftSideIncludesThisCropItToo.includes(o[s])){if(o[s].trim()){a.wipeAllWhitespaceOnLeft||a.ifLeftSideIncludesThisCropItToo.includes(o[s+1])?u=s+1:u=s+2;break}else if(s===0){a.wipeAllWhitespaceOnLeft?u=0:u=1;break}}}if(a.extendToOneSide!=="left"&&(r(o[l])&&(a.wipeAllWhitespaceOnRight||r(o[l+1]))||a.ifRightSideIncludesThisCropItToo.includes(o[l]))){for(let s=l,$=o.length;s<$;s++)if(!a.ifRightSideIncludesThisCropItToo.includes(o[s])&&((c=o[s])==null?void 0:c.trim())){a.wipeAllWhitespaceOnRight||a.ifRightSideIncludesThisCropItToo.includes(o[s-1])?l=s:l=s-1;break}}return(a.extendToOneSide!=="right"&&n(a.ifLeftSideIncludesThisThenCropTightly)&&a.ifLeftSideIncludesThisThenCropTightly&&(o[u-2]&&a.ifLeftSideIncludesThisThenCropTightly.includes(o[u-2])||o[u-1]&&a.ifLeftSideIncludesThisThenCropTightly.includes(o[u-1]))||a.extendToOneSide!=="left"&&n(a.ifRightSideIncludesThisThenCropTightly)&&a.ifRightSideIncludesThisThenCropTightly&&(o[l+1]&&a.ifRightSideIncludesThisThenCropTightly.includes(o[l+1])||o[l]&&a.ifRightSideIncludesThisThenCropTightly.includes(o[l])))&&(a.extendToOneSide!=="right"&&r(o[u-1])&&!a.wipeAllWhitespaceOnLeft&&(u-=1),a.extendToOneSide!=="left"&&r(o[l])&&!a.wipeAllWhitespaceOnRight&&(l+=1)),a.addSingleSpaceToPreventAccidentalConcatenation&&o[u-1]&&o[u-1].trim()&&o[l]&&o[l].trim()&&(!a.ifLeftSideIncludesThisThenCropTightly&&!a.ifRightSideIncludesThisThenCropTightly||!((!a.ifLeftSideIncludesThisThenCropTightly||a.ifLeftSideIncludesThisThenCropTightly.includes(o[u-1]))&&(!a.ifRightSideIncludesThisThenCropTightly||o[l]&&a.ifRightSideIncludesThisThenCropTightly.includes(o[l]))))&&(t.test(o[u-1])||t.test(o[l]))?[u,l," "]:[u,l]}var ii=Ke(ut(),1),oi=Ke(zt(),1);var K="\xA0";function si({str:e,idx:t=0,stopAtNewlines:r=!1,stopAtRawNbsp:n=!1}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),!e[t+1]))return null;if(e[t+1]&&(e[t+1].trim()||r&&`
18
+ ${JSON.stringify(n,null,4)}`);if(a&&!nt(a))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 a}", and equal to:
19
+ ${JSON.stringify(a,null,4)}`);let c=0,s="";if((o==null?void 0:o.trimCharsBeforeMatching)&&o.trimCharsBeforeMatching.some(($,h)=>$.length>1?(c=h,s=$,!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 ${c} is longer than 1 character, ${s.length} (equals to ${s}). Please split it into separate characters and put into array as separate elements.`);if(!u||!Array.isArray(u)||Array.isArray(u)&&!u.length||Array.isArray(u)&&u.length===1&&le(u[0])&&!u[0].trim()){if(typeof o.cb=="function"){let h,T=r;if((e==="matchLeftIncl"||e==="matchRight")&&(T+=1),e[5]==="L")for(let L=T;L--;){let p=t[L];if((!o.trimBeforeMatching||o.trimBeforeMatching&&p!==void 0&&p.trim())&&(!o.trimCharsBeforeMatching||!o.trimCharsBeforeMatching.length||p!==void 0&&!o.trimCharsBeforeMatching.includes(p))){h=L;break}}else if(e.startsWith("matchRight"))for(let L=T;L<t.length;L++){let p=t[L];if((!o.trimBeforeMatching||o.trimBeforeMatching&&p.trim())&&(!o.trimCharsBeforeMatching||!o.trimCharsBeforeMatching.length||!o.trimCharsBeforeMatching.includes(p))){h=L;break}}if(h===void 0)return!1;let m=t[h],f=h+1,O="";return f&&f>0&&(O=t.slice(0,f)),e[5]==="L"||h&&h>0&&(O=t.slice(h)),o.cb(m,O,h)}let $="";throw a||($=" 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!${$}`)}for(let $=0,h=u.length;$<h;$++){l=typeof u[$]=="function";let T=u[$],m,f,O="",L=r;e==="matchRight"?L+=1:e==="matchLeft"&&(L-=1);let p=dn(t,L,T,o,l,b=>e[5]==="L"?b-1:b+1);if(p&&l&&typeof T=="function"&&T()==="EOL")return T()&&(o.cb?o.cb(m,O,f):!0)?T():!1;if(Number.isInteger(p)&&(f=e.startsWith("matchLeft")?p-1:p+1,e[5]==="L"?O=t.slice(0,p):O=t.slice(f)),f<0&&(f=void 0),t[f]&&(m=t[f]),Number.isInteger(p)&&(o.cb?o.cb(m,O,f):!0))return T}return!1}function it(e,t,r,n){return Oe("matchLeft",e,t,r,n)}function Le(e,t,r,n){return Oe("matchRightIncl",e,t,r,n)}function k(e,t,r,n){return Oe("matchRight",e,t,r,n)}var Tn={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function ae(e){var c;let t=/^[0-9a-zA-Z]+$/;function r(s){return!s||typeof s!="string"?!1:!s.trim()}function n(s){return typeof s=="string"}if(!e||typeof e!="object"||Array.isArray(e)){let s;throw e===void 0?s="but it is missing completely.":e===null?s="but it was given as null.":s=`but it was given as ${typeof e}, equal to:
20
+ ${JSON.stringify(e,null,4)}.`,new Error(`string-range-expander: [THROW_ID_01] Input must be a plain object ${s}`)}else if(typeof e=="object"&&e!==null&&!Array.isArray(e)&&!Object.keys(e).length)throw new Error("string-range-expander: [THROW_ID_02] Input must be a plain object but it was given as a plain object without any keys.");if(typeof e.from!="number")throw new Error(`string-range-expander: [THROW_ID_03] The input's "from" value opts.from, is not a number! Currently it's given as ${typeof e.from}, equal to ${JSON.stringify(e.from,null,0)}`);if(typeof e.to!="number")throw new Error(`string-range-expander: [THROW_ID_04] The input's "to" value opts.to, is not a number! Currently it's given as ${typeof e.to}, equal to ${JSON.stringify(e.to,null,0)}`);if((e==null?void 0:e.str)&&!e.str[e.from]&&e.from!==e.to)throw new Error(`string-range-expander: [THROW_ID_05] The given input string opts.str ("${e.str}") must contain the character at index "from" ("${e.from}")`);if((e==null?void 0:e.str)&&!e.str[e.to-1])throw new Error(`string-range-expander: [THROW_ID_06] The given input string, opts.str ("${e.str}") must contain the character at index before "to" ("${e.to-1}")`);if(e.from>e.to)throw new Error(`string-range-expander: [THROW_ID_07] The given "from" index, "${e.from}" is greater than "to" index, "${e.to}". That's wrong!`);if(n(e.extendToOneSide)&&e.extendToOneSide!=="left"&&e.extendToOneSide!=="right"||!n(e.extendToOneSide)&&e.extendToOneSide!==void 0&&e.extendToOneSide!==!1)throw new Error(`string-range-expander: [THROW_ID_08] The opts.extendToOneSide value is not recogniseable! It's set to: "${e.extendToOneSide}" (${typeof e.extendToOneSide}). It has to be either Boolean "false" or strings "left" or "right"`);let a=S(S({},Tn),e);if(Array.isArray(a.ifLeftSideIncludesThisThenCropTightly)){let s,$;if(a.ifLeftSideIncludesThisThenCropTightly.every((h,T)=>n(h)?!0:(s=T,$=h,!1)))a.ifLeftSideIncludesThisThenCropTightly=a.ifLeftSideIncludesThisThenCropTightly.join("");else throw new Error(`string-range-expander: [THROW_ID_09] The opts.ifLeftSideIncludesThisThenCropTightly was set to an array:
21
+ ${JSON.stringify(a.ifLeftSideIncludesThisThenCropTightly,null,4)}. Now, that array contains not only string elements. For example, an element at index ${s} is of a type ${typeof $} (equal to ${JSON.stringify($,null,0)}).`)}let o=a.str,u=a.from,l=a.to;if(a.extendToOneSide!=="right"&&(r(o[u-1])&&(r(o[u-2])||a.ifLeftSideIncludesThisCropItToo.includes(o[u-2]))||o[u-1]&&a.ifLeftSideIncludesThisCropItToo.includes(o[u-1])||a.wipeAllWhitespaceOnLeft&&r(o[u-1]))){for(let s=u;s--;)if(!a.ifLeftSideIncludesThisCropItToo.includes(o[s])){if(o[s].trim()){a.wipeAllWhitespaceOnLeft||a.ifLeftSideIncludesThisCropItToo.includes(o[s+1])?u=s+1:u=s+2;break}else if(s===0){a.wipeAllWhitespaceOnLeft?u=0:u=1;break}}}if(a.extendToOneSide!=="left"&&(r(o[l])&&(a.wipeAllWhitespaceOnRight||r(o[l+1]))||a.ifRightSideIncludesThisCropItToo.includes(o[l]))){for(let s=l,$=o.length;s<$;s++)if(!a.ifRightSideIncludesThisCropItToo.includes(o[s])&&((c=o[s])==null?void 0:c.trim())){a.wipeAllWhitespaceOnRight||a.ifRightSideIncludesThisCropItToo.includes(o[s-1])?l=s:l=s-1;break}}return(a.extendToOneSide!=="right"&&n(a.ifLeftSideIncludesThisThenCropTightly)&&a.ifLeftSideIncludesThisThenCropTightly&&(o[u-2]&&a.ifLeftSideIncludesThisThenCropTightly.includes(o[u-2])||o[u-1]&&a.ifLeftSideIncludesThisThenCropTightly.includes(o[u-1]))||a.extendToOneSide!=="left"&&n(a.ifRightSideIncludesThisThenCropTightly)&&a.ifRightSideIncludesThisThenCropTightly&&(o[l+1]&&a.ifRightSideIncludesThisThenCropTightly.includes(o[l+1])||o[l]&&a.ifRightSideIncludesThisThenCropTightly.includes(o[l])))&&(a.extendToOneSide!=="right"&&r(o[u-1])&&!a.wipeAllWhitespaceOnLeft&&(u-=1),a.extendToOneSide!=="left"&&r(o[l])&&!a.wipeAllWhitespaceOnRight&&(l+=1)),a.addSingleSpaceToPreventAccidentalConcatenation&&o[u-1]&&o[u-1].trim()&&o[l]&&o[l].trim()&&(!a.ifLeftSideIncludesThisThenCropTightly&&!a.ifRightSideIncludesThisThenCropTightly||!((!a.ifLeftSideIncludesThisThenCropTightly||a.ifLeftSideIncludesThisThenCropTightly.includes(o[u-1]))&&(!a.ifRightSideIncludesThisThenCropTightly||o[l]&&a.ifRightSideIncludesThisThenCropTightly.includes(o[l]))))&&(t.test(o[u-1])||t.test(o[l]))?[u,l," "]:[u,l]}var ri=qe(at(),1),ii=qe(Xt(),1);var K="\xA0";function oi({str:e,idx:t=0,stopAtNewlines:r=!1,stopAtRawNbsp:n=!1}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),!e[t+1]))return null;if(e[t+1]&&(e[t+1].trim()||r&&`
22
22
  \r`.includes(e[t+1])||n&&e[t+1]===K))return t+1;if(e[t+2]&&(e[t+2].trim()||r&&`
23
23
  \r`.includes(e[t+2])||n&&e[t+2]===K))return t+2;for(let a=t+1,o=e.length;a<o;a++)if(e[a].trim()||r&&`
24
- \r`.includes(e[a])||n&&e[a]===K)return a;return null}function D(e,t=0){return si({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function li({str:e,idx:t,stopAtNewlines:r,stopAtRawNbsp:n}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),t<1))return null;if(e[~-t]&&(e[~-t].trim()||r&&`
24
+ \r`.includes(e[a])||n&&e[a]===K)return a;return null}function D(e,t=0){return oi({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function si({str:e,idx:t,stopAtNewlines:r,stopAtRawNbsp:n}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),t<1))return null;if(e[~-t]&&(e[~-t].trim()||r&&`
25
25
  \r`.includes(e[~-t])||n&&e[~-t]===K))return~-t;if(e[t-2]&&(e[t-2].trim()||r&&`
26
26
  \r`.includes(e[t-2])||n&&e[t-2]===K))return t-2;for(let a=t;a--;)if(e[a]&&(e[a].trim()||r&&`
27
- \r`.includes(e[a])||n&&e[a]===K))return a;return null}function be(e,t=0){return li({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}var Zt="5.0.12";var ui=Zt,y=new tt({limitToBeAddedWhitespace:!0}),Qt={lineLengthLimit:500,removeIndentations:!0,removeLineBreaks:!1,removeHTMLComments:!1,removeCSSComments:!0,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,breakToTheLeftOf:["</td","<html","</html","<head","</head","<meta","<link","<table","<script","<\/script","<!DOCTYPE","<style","</style","<title","<body","@media","</body","<!--[if","<!--<![endif","<![endif]"],mindTheInlineTags:["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]};function Y(e){return typeof e=="string"}function X(e){return typeof e=="string"&&e.toUpperCase()!==e.toLowerCase()}function gi(e,t){var fi;let r=Date.now();if(!Y(e))throw e===void 0?new Error("html-crush: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush: [THROW_ID_02] the first input argument must be string! It was given as "${typeof e}", equal to:
27
+ \r`.includes(e[a])||n&&e[a]===K))return a;return null}function be(e,t=0){return si({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}var zt="5.0.13";var ai=zt,y=new et({limitToBeAddedWhitespace:!0}),Zt={lineLengthLimit:500,removeIndentations:!0,removeLineBreaks:!1,removeHTMLComments:!1,removeCSSComments:!0,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,breakToTheLeftOf:["</td","<html","</html","<head","</head","<meta","<link","<table","<script","<\/script","<!DOCTYPE","<style","</style","<title","<body","@media","</body","<!--[if","<!--<![endif","<![endif]"],mindTheInlineTags:["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]};function Y(e){return typeof e=="string"}function X(e){return typeof e=="string"&&e.toUpperCase()!==e.toLowerCase()}function ui(e,t){let r=Date.now();if(!Y(e))throw e===void 0?new Error("html-crush: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush: [THROW_ID_02] the first input argument must be string! It was given as "${typeof e}", equal to:
28
28
  ${JSON.stringify(e,null,4)}`);if(t&&typeof t!="object")throw new Error(`html-crush: [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ${typeof t}, equal to ${JSON.stringify(t,null,4)}`);if(t&&Array.isArray(t.breakToTheLeftOf)&&t.breakToTheLeftOf.length){for(let i=0,Q=t.breakToTheLeftOf.length;i<Q;i++)if(!Y(t.breakToTheLeftOf[i]))throw new TypeError(`html-crush: [THROW_ID_05] the opts.breakToTheLeftOf array contains non-string elements! For example, element at index ${i} is of a type "${typeof t.breakToTheLeftOf[i]}" and is equal to:
29
- ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Qt),t);typeof n.removeHTMLComments=="boolean"&&(n.removeHTMLComments=n.removeHTMLComments?1:0);let a="";Array.isArray(n.breakToTheLeftOf)&&n.breakToTheLeftOf.length&&(a=[...new Set(n.breakToTheLeftOf.map(i=>i[0]))].join(""));let o={removeHTMLComments:!1,removeCSSComments:!1},u=null,l=null,c=!1,s=0,$=0,h=!1,T=!1,m=null,f=null,O=null,L=null,p,b=null,d=null,E=null,A=null,I=null,V=null,z=">};",Z="<",en="!",tn=">",nn="<",We="{},:;<>~+",de=We,Te=We,j=!0,_=e.length,rn=Math.floor(_/2),je=.01,Je;n.reportProgressFunc&&(Je=Math.floor(n.reportProgressFuncTo-(n.reportProgressFuncTo-n.reportProgressFuncFrom)*je-n.reportProgressFuncFrom));let R,oe=0,C=`
29
+ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.removeHTMLComments=="boolean"&&(n.removeHTMLComments=n.removeHTMLComments?1:0);let a="";Array.isArray(n.breakToTheLeftOf)&&n.breakToTheLeftOf.length&&(a=[...new Set(n.breakToTheLeftOf.map(i=>i[0]))].join(""));let o={removeHTMLComments:!1,removeCSSComments:!1},u=null,l=null,c=!1,s=0,$=0,h=!1,T=!1,m=null,f=null,O=null,L=null,p,b=null,d=null,E=null,A=null,I=null,V=null,z=">};",Z="<",Qt="!",en=">",tn="<",We="{},:;<>~+",de=We,Te=We,j=!0,_=e.length,nn=Math.floor(_/2),je=.01,Je;n.reportProgressFunc&&(Je=Math.floor(n.reportProgressFuncTo-(n.reportProgressFuncTo-n.reportProgressFuncFrom)*je-n.reportProgressFuncFrom));let R,oe=0,C=`
30
30
  `;if(e.includes(`\r
31
31
  `)?C=`\r
32
- `:e.includes("\r")&&(C="\r"),_){for(let i=0;i<_;i++){if(n.reportProgressFunc&&(_>1e3&&_<2e3?i===rn&&n.reportProgressFunc(Math.floor((n.reportProgressFuncTo-n.reportProgressFuncFrom)/2)):_>=2e3&&(R=n.reportProgressFuncFrom+Math.floor(i/_*(Je||1)),R!==oe&&(oe=R,n.reportProgressFunc(R)))),$++,!p&&h&&e[i]==="}"&&e[i-1]==="}"&&(s+1>=n.lineLengthLimit?(y.push(i,i,C),s=0):(b=i,d=i,E=" ")),p&&typeof p=="number"&&i>=p&&(p=void 0),L!==null&&e.startsWith("<\/script",i)&&!X(e[i+8])){if((n.removeIndentations||n.removeLineBreaks)&&i>0&&e[~-i]&&!e[~-i].trim()){for(let g=i;g--;)if(e[g]===`
32
+ `:e.includes("\r")&&(C="\r"),_){for(let i=0;i<_;i++){if(n.reportProgressFunc&&(_>1e3&&_<2e3?i===nn&&n.reportProgressFunc(Math.floor((n.reportProgressFuncTo-n.reportProgressFuncFrom)/2)):_>=2e3&&(R=n.reportProgressFuncFrom+Math.floor(i/_*(Je||1)),R!==oe&&(oe=R,n.reportProgressFunc(R)))),$++,!p&&h&&e[i]==="}"&&e[i-1]==="}"&&(s+1>=n.lineLengthLimit?(y.push(i,i,C),s=0):(b=i,d=i,E=" ")),p&&typeof p=="number"&&i>=p&&(p=void 0),L!==null&&e.startsWith("<\/script",i)&&!X(e[i+8])){if((n.removeIndentations||n.removeLineBreaks)&&i>0&&e[~-i]&&!e[~-i].trim()){for(let g=i;g--;)if(e[g]===`
33
33
  `||e[g]==="\r"||e[g].trim()){g+1<i&&y.push(g+1,i);break}}L=null,p=!1,i+=8;continue}if(!p&&!h&&e.startsWith("<script",i)&&!X(e[i+7])){L=i,p=!0;let g="";(n.removeLineBreaks||n.removeIndentations)&&l!==null&&(l>0&&(g=C),y.push(l,i,g)),l=null,u=null}if(I!==null&&A===null&&!/\w/.test(e[i])){A=e.slice(I,i);let g=D(e,~-i);typeof g=="number"&&e[g]===">"&&!e[i].trim()&&D(e,i)?y.push(i,D(e,i)):g&&e[g]==="/"&&e[D(e,g)]===">"&&(!e[i].trim()&&D(e,i)&&y.push(i,D(e,i)),e[g+1]!==">"&&D(e,g+1)&&y.push(g+1,D(e,g+1)))}if(!p&&!h&&!m&&e[~-i]==="<"&&I===null&&(/\w/.test(e[i])?I=i:e[D(e,~-i)]==="/"&&/\w/.test(e[D(e,D(e,~-i))]||"")&&(I=D(e,D(e,~-i)))),!p&&(h||m)&&f!==null&&e[i]==="*"&&e[i+1]==="/"&&([b,d]=ae({str:e,from:f,to:i+2,ifLeftSideIncludesThisThenCropTightly:de||"",ifRightSideIncludesThisThenCropTightly:Te||""}),f=null,b!=null?y.push(b,d):(s+=1,i+=1),p=i+2),!p&&(h||m)&&f===null&&e[i]==="/"&&e[i+1]==="*"&&(o.removeCSSComments||(o.removeCSSComments=!0),n.removeCSSComments&&(f=i)),T&&e.startsWith("![endif",i+1)&&(T=!1),!p&&!h&&!m&&O!==null){let g;e.startsWith("-->",i)?g=3:e[i]===">"&&e[i-1]==="]"&&(g=1),g&&([b,d]=ae({str:e,from:O,to:i+g}),O=null,b!=null?n.lineLengthLimit&&$-(d-b)>=n.lineLengthLimit?(y.push(b,d,C),$=-g):(y.push(b,d),$-=d-b):(s+=g-1,i+=g-1),p=i+g)}if(!p&&!h&&!m&&(e.startsWith("<!--",i)||n.removeHTMLComments===2&&e.startsWith("<![endif",i))&&O===null&&(e.startsWith("[if",i+4)?(T||(T=!0),n.removeHTMLComments===2&&(O=i)):n.removeHTMLComments&&(!T||n.removeHTMLComments===2)&&(O=i),o.removeHTMLComments||(o.removeHTMLComments=!0)),!p&&h&&f===null&&e.startsWith("</style",i)&&!X(e[i+7])?h=!1:!p&&!h&&f===null&&e.startsWith("<style",i)&&!X(e[i+6])&&(h=!0,(n.removeLineBreaks||n.removeIndentations)&&n.breakToTheLeftOf.includes("<style")&&e.startsWith(' type="text/css">',i+6)&&e[i+24]&&y.push(i+23,i+23,C)),!p&&!m&&`"'`.includes(e[i])&&e.endsWith("style=",i)&&(m=i),!p&&!e[i].trim())l===null&&(l=i);else if(!p&&!((h||m)&&f!==null)){if(l!==null){if(n.removeLineBreaks&&(s+=1),j)j=!1,(n.removeIndentations||n.removeLineBreaks)&&y.push(0,i);else if(n.removeIndentations&&!n.removeLineBreaks&&(!c&&u!==null&&i>u?y.push(u+1,i):l+1<i&&(e.endsWith("]>",l)||e.endsWith("-->",l)||e.startsWith("<![",i)||e.startsWith("<!--<![",i)?y.push(l,i):e[l]===" "?y.push(l+1,i):e[~-i]===" "?y.push(l,~-i):y.push(l,i," "))),n.removeLineBreaks||m){if(a.includes(e[i])&&Le(e,i,n.breakToTheLeftOf)){!(`\r
34
34
  `.includes(e[~-i])&&l===~-i)&&!(e[~-i]===`
35
- `&&e[i-2]==="\r"&&l===i-2)&&y.push(l,i,C),b=null,d=null,E=null,l=null,s=1;continue}let g=" ";e[i]==="<"&&k(e,i,n.mindTheInlineTags,{cb:J=>!J||!/\w/.test(J)})||(e[~-l]&&tn.includes(e[~-l])&&nn.includes(e[i])||(h||m)&&f===null&&(de.includes(e[~-l])||Te.includes(e[i]))||e.startsWith("!important",i)&&!T||m&&(e[~-l]==="'"||e[~-l]==='"')||e[~-l]==="}"&&e.startsWith("</style",i)||e[i]===">"&&(`'"`.includes(e[be(e,i)])||e[D(e,i)]==="<")||e[i]==="/"&&e[D(e,i)]===">")&&(g="",e[i]==="/"&&e[i+1]===">"&&D(e,i)&&D(e,i)>i+1&&(y.push(i+1,D(e,i)),s-=D(e,i)-i+1)),h&&e[i]==="}"&&l&&e[l-1]==="}"&&(g=" "),(g==null?void 0:g.length)&&(s+=1),n.lineLengthLimit?s>=n.lineLengthLimit||!e[i+1]||e[i]===">"||e[i]==="/"&&e[i+1]===">"?((s>n.lineLengthLimit||s===n.lineLengthLimit&&e[i+1]&&e[i+1].trim()&&!z.includes(e[i])&&!Z.includes(e[i+1]))&&(g=C,s=1),(s>n.lineLengthLimit||!(g===" "&&i===l+1))&&(y.push(l,i,g),u=null),b=null,d=null,E=null):(b===null||l<b)&&(b=l,d=i,E=g):i===l+1&&g===" "||y.push(l,i,g)}l=null,c||(c=!0)}else j&&(j=!1),n.removeLineBreaks&&(s+=1);c||(c=!0)}if(!p&&!j&&i!==0&&n.removeLineBreaks&&(n.lineLengthLimit||a)&&!e.startsWith("</a",i)){if(a&&Le(e,i,n.breakToTheLeftOf)&&e.slice(0,i).trim()&&(!e.startsWith("<![endif]",i)||!ot(e,i,"<!--"))){y.push(i,i,C),b=null,d=null,E=null,s=1;continue}else if(n.lineLengthLimit&&s<=n.lineLengthLimit){if(!e[i+1]||Z.includes(e[i])&&!en.includes(e[i])||z.includes(e[i])||!e[i].trim()){if(b!==null&&d!==null&&(b!==d||(E==null?void 0:E.length))){let g=E;e[i].trim()&&e[i+1]&&e[i+1].trim()&&s+(E?E.length:0)>n.lineLengthLimit&&(g=C),(s+(g?g.length:0)>n.lineLengthLimit||!(g===" "&&d===b+1&&e[b]===" "))&&(e[~-b]==="}"&&e[d]==="{"||(y.push(b,d,g),u=null))}e[i].trim()&&(Z.includes(e[i])||e[~-i]&&z.includes(e[~-i]))&&Y(V)&&(!A||!n.mindTheInlineTags.includes(A))&&!(e[i]==="<"&&k(e,i,n.mindTheInlineTags,{cb:g=>!g||!/\w/.test(g)}))&&!(e[i]==="<"&&k(e,i,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:g=>!g||!/\w/.test(g)}))?(b=i,d=i,E=null):f===null&&b!==null&&(m||!n.mindTheInlineTags||!Array.isArray(n.mindTheInlineTags)||Array.isArray(n.mindTheInlineTags.length)&&!n.mindTheInlineTags.length||!Y(A)||Array.isArray(n.mindTheInlineTags)&&n.mindTheInlineTags.length&&Y(A)&&!n.mindTheInlineTags.includes(A))&&!(e[i]==="<"&&k(e,i,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:g=>!g||!/\w/.test(g)}))&&(b=null,d=null,E=null)}}else if(n.lineLengthLimit)if(Z.includes(e[i])&&!(e[i]==="<"&&k(e,i,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:g=>!g||!/\w/.test(g)})))if(b!==null&&d!==null&&(b!==d||(E==null?void 0:E.length))){let g=(E==null?void 0:E.length)?E.length:0;s-(d-b-g)-1>n.lineLengthLimit||(y.push(b,d,E),s-(d-b-g)-1===n.lineLengthLimit&&(y.push(i,i,C),s=0),b=null,d=null,E=null)}else y.push(i,i,C),s=0;else e[i+1]&&z.includes(e[i])&&Y(A)&&Array.isArray(n.mindTheInlineTags)&&n.mindTheInlineTags.length&&!n.mindTheInlineTags.includes(A)?b!==null&&d!==null&&(b!==d||(E==null?void 0:E.length))||(y.push(i+1,i+1,C),s=0):e[i].trim()&&(e[i+1]||b!==null&&d!==null&&(b!==d||(E==null?void 0:E.length))&&y.push(b,d,C))}if(!p&&!j&&n.removeLineBreaks&&n.lineLengthLimit&&s>=n.lineLengthLimit&&b!==null&&d!==null&&!z.includes(e[i])&&!Z.includes(e[i])&&!"/".includes(e[i])&&!(s===n.lineLengthLimit&&e[i+1]&&!e[i+1].trim())){let g=C;e[i+1]&&!e[i+1].trim()&&s===n.lineLengthLimit&&(g=E),g===C&&!e[~-b].trim()&&be(e,b)&&(b=be(e,b)+1),y.push(b,d,g),s=i-d,e[i].length&&(s+=1),b=null,d=null,E=null}if((!p&&e[i]===`
35
+ `&&e[i-2]==="\r"&&l===i-2)&&y.push(l,i,C),b=null,d=null,E=null,l=null,s=1;continue}let g=" ";e[i]==="<"&&k(e,i,n.mindTheInlineTags,{cb:J=>!J||!/\w/.test(J)})||(e[~-l]&&en.includes(e[~-l])&&tn.includes(e[i])||(h||m)&&f===null&&(de.includes(e[~-l])||Te.includes(e[i]))||e.startsWith("!important",i)&&!T||m&&(e[~-l]==="'"||e[~-l]==='"')||e[~-l]==="}"&&e.startsWith("</style",i)||e[i]===">"&&(`'"`.includes(e[be(e,i)])||e[D(e,i)]==="<")||e[i]==="/"&&e[D(e,i)]===">")&&(g="",e[i]==="/"&&e[i+1]===">"&&D(e,i)&&D(e,i)>i+1&&(y.push(i+1,D(e,i)),s-=D(e,i)-i+1)),h&&e[i]==="}"&&l&&e[l-1]==="}"&&(g=" "),g!=null&&g.length&&(s+=1),n.lineLengthLimit?s>=n.lineLengthLimit||!e[i+1]||e[i]===">"||e[i]==="/"&&e[i+1]===">"?((s>n.lineLengthLimit||s===n.lineLengthLimit&&e[i+1]&&e[i+1].trim()&&!z.includes(e[i])&&!Z.includes(e[i+1]))&&(g=C,s=1),(s>n.lineLengthLimit||!(g===" "&&i===l+1))&&(y.push(l,i,g),u=null),b=null,d=null,E=null):(b===null||l<b)&&(b=l,d=i,E=g):i===l+1&&g===" "||y.push(l,i,g)}l=null,c||(c=!0)}else j&&(j=!1),n.removeLineBreaks&&(s+=1);c||(c=!0)}if(!p&&!j&&i!==0&&n.removeLineBreaks&&(n.lineLengthLimit||a)&&!e.startsWith("</a",i)){if(a&&Le(e,i,n.breakToTheLeftOf)&&e.slice(0,i).trim()&&(!e.startsWith("<![endif]",i)||!it(e,i,"<!--"))){y.push(i,i,C),b=null,d=null,E=null,s=1;continue}else if(n.lineLengthLimit&&s<=n.lineLengthLimit){if(!e[i+1]||Z.includes(e[i])&&!Qt.includes(e[i])||z.includes(e[i])||!e[i].trim()){if(b!==null&&d!==null&&(b!==d||(E==null?void 0:E.length))){let g=E;e[i].trim()&&e[i+1]&&e[i+1].trim()&&s+(E?E.length:0)>n.lineLengthLimit&&(g=C),(s+(g?g.length:0)>n.lineLengthLimit||!(g===" "&&d===b+1&&e[b]===" "))&&(e[~-b]==="}"&&e[d]==="{"||(y.push(b,d,g),u=null))}e[i].trim()&&(Z.includes(e[i])||e[~-i]&&z.includes(e[~-i]))&&Y(V)&&(!A||!n.mindTheInlineTags.includes(A))&&!(e[i]==="<"&&k(e,i,n.mindTheInlineTags,{cb:g=>!g||!/\w/.test(g)}))&&!(e[i]==="<"&&k(e,i,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:g=>!g||!/\w/.test(g)}))?(b=i,d=i,E=null):f===null&&b!==null&&(m||!n.mindTheInlineTags||!Array.isArray(n.mindTheInlineTags)||Array.isArray(n.mindTheInlineTags.length)&&!n.mindTheInlineTags.length||!Y(A)||Array.isArray(n.mindTheInlineTags)&&n.mindTheInlineTags.length&&Y(A)&&!n.mindTheInlineTags.includes(A))&&!(e[i]==="<"&&k(e,i,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:g=>!g||!/\w/.test(g)}))&&(b=null,d=null,E=null)}}else if(n.lineLengthLimit)if(Z.includes(e[i])&&!(e[i]==="<"&&k(e,i,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:g=>!g||!/\w/.test(g)})))if(b!==null&&d!==null&&(b!==d||(E==null?void 0:E.length))){let g=E!=null&&E.length?E.length:0;s-(d-b-g)-1>n.lineLengthLimit||(y.push(b,d,E),s-(d-b-g)-1===n.lineLengthLimit&&(y.push(i,i,C),s=0),b=null,d=null,E=null)}else y.push(i,i,C),s=0;else e[i+1]&&z.includes(e[i])&&Y(A)&&Array.isArray(n.mindTheInlineTags)&&n.mindTheInlineTags.length&&!n.mindTheInlineTags.includes(A)?b!==null&&d!==null&&(b!==d||(E==null?void 0:E.length))||(y.push(i+1,i+1,C),s=0):e[i].trim()&&(e[i+1]||b!==null&&d!==null&&(b!==d||(E==null?void 0:E.length))&&y.push(b,d,C))}if(!p&&!j&&n.removeLineBreaks&&n.lineLengthLimit&&s>=n.lineLengthLimit&&b!==null&&d!==null&&!z.includes(e[i])&&!Z.includes(e[i])&&!"/".includes(e[i])&&!(s===n.lineLengthLimit&&e[i+1]&&!e[i+1].trim())){let g=C;e[i+1]&&!e[i+1].trim()&&s===n.lineLengthLimit&&(g=E),g===C&&!e[~-b].trim()&&be(e,b)&&(b=be(e,b)+1),y.push(b,d,g),s=i-d,e[i].length&&(s+=1),b=null,d=null,E=null}if((!p&&e[i]===`
36
36
  `||e[i]==="\r"&&(!e[i+1]||e[i+1]&&e[i+1]!==`
37
37
  `))&&(u=i,c&&(c=!1),!n.removeLineBreaks&&l!==null&&l<i&&e[i+1]&&e[i+1]!=="\r"&&e[i+1]!==`
38
38
  `&&y.push(l,i)),e[i+1]||(h&&f!==null?y.push(...ae({str:e,from:f,to:i,ifLeftSideIncludesThisThenCropTightly:de||"",ifRightSideIncludesThisThenCropTightly:Te||""})):l&&e[i]!==`
39
39
  `&&e[i]!=="\r"?y.push(l,i+1):l&&(e[i]==="\r"&&e[i+1]===`
40
40
  `||e[i]===`
41
- `&&e[i-1]!=="\r")&&y.push(l,i)),!p&&m&&m<i&&e[m]===e[i]&&(m=null),!p&&!h&&e.startsWith("<pre",i)&&!X(e[i+4])){let g=e.indexOf("</pre",i+5);g>0&&(p=g)}if(!p&&!h&&e.startsWith("<code",i)&&!X(e[i+5])){let g=e.indexOf("</code",i+5);g>0&&(p=g)}if(!p&&e.startsWith("<![CDATA[",i)){let g=e.indexOf("]]>",i+9);g>0&&(p=g)}!p&&!h&&!m&&I!==null&&e[i]===">"&&(e[D(e,i)]==="<"&&(V=A),I=null,A=null),e[i]==="<"&&V!==null&&(V=null),h&&e[i]==="{"&&e[i+1]==="{"&&e.indexOf("}}")!==-1&&(p=e.indexOf("}}")+2);let Q=!0}if(y.current()){let i=y.current();y.wipe();let Q=n.reportProgressFuncTo-(n.reportProgressFuncTo-n.reportProgressFuncFrom)*je,g=Ze(e,i,on=>{n.reportProgressFunc&&_>=2e3&&(R=Math.floor(Q+(n.reportProgressFuncTo-Q)*(on/100)),R!==oe&&(oe=R,n.reportProgressFunc(R)))}),J=g.length;return{log:{timeTakenInMilliseconds:Date.now()-r,originalLength:_,cleanedLength:J,bytesSaved:Math.max(_-J,0),percentageReducedOfOriginal:_?Math.round(Math.max(_-J,0)*100/_):0},ranges:i,applicableOpts:o,result:g}}}return{log:{timeTakenInMilliseconds:Date.now()-r,originalLength:_,cleanedLength:_,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:o,ranges:null,result:e}}return fn(ci);})();
41
+ `&&e[i-1]!=="\r")&&y.push(l,i)),!p&&m&&m<i&&e[m]===e[i]&&(m=null),!p&&!h&&e.startsWith("<pre",i)&&!X(e[i+4])){let g=e.indexOf("</pre",i+5);g>0&&(p=g)}if(!p&&!h&&e.startsWith("<code",i)&&!X(e[i+5])){let g=e.indexOf("</code",i+5);g>0&&(p=g)}if(!p&&e.startsWith("<![CDATA[",i)){let g=e.indexOf("]]>",i+9);g>0&&(p=g)}!p&&!h&&!m&&I!==null&&e[i]===">"&&(e[D(e,i)]==="<"&&(V=A),I=null,A=null),e[i]==="<"&&V!==null&&(V=null),h&&e[i]==="{"&&e[i+1]==="{"&&e.indexOf("}}")!==-1&&(p=e.indexOf("}}")+2);let Q=!0}if(y.current()){let i=y.current();y.wipe();let Q=n.reportProgressFuncTo-(n.reportProgressFuncTo-n.reportProgressFuncFrom)*je,g=ze(e,i,rn=>{n.reportProgressFunc&&_>=2e3&&(R=Math.floor(Q+(n.reportProgressFuncTo-Q)*(rn/100)),R!==oe&&(oe=R,n.reportProgressFunc(R)))}),J=g.length;return{log:{timeTakenInMilliseconds:Date.now()-r,originalLength:_,cleanedLength:J,bytesSaved:Math.max(_-J,0),percentageReducedOfOriginal:_?Math.round(Math.max(_-J,0)*100/_):0},ranges:i,applicableOpts:o,result:g}}}return{log:{timeTakenInMilliseconds:Date.now()-r,originalLength:_,cleanedLength:_,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:o,ranges:null,result:e}}return cn(gi);})();
42
42
  /**
43
43
  * @name arrayiffy-if-string
44
44
  * @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
@@ -98,7 +98,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Qt),t);typeof n.r
98
98
  /**
99
99
  * @name string-match-left-right
100
100
  * @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
101
- * @version 8.0.12
101
+ * @version 8.1.0
102
102
  * @author Roy Revelt, Codsen Ltd
103
103
  * @license MIT
104
104
  * {@link https://codsen.com/os/string-match-left-right/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html-crush",
3
- "version": "5.0.12",
3
+ "version": "5.0.13",
4
4
  "description": "Minifies HTML/CSS: valid or broken, pure or mixed with other languages",
5
5
  "keywords": [
6
6
  "breaks",
@@ -80,7 +80,7 @@
80
80
  "ranges-apply": "^6.0.12",
81
81
  "ranges-push": "^6.0.12",
82
82
  "string-left-right": "^5.0.12",
83
- "string-match-left-right": "^8.0.12",
83
+ "string-match-left-right": "^8.1.0",
84
84
  "string-range-expander": "^3.0.12",
85
85
  "test-mixer": "^3.0.12"
86
86
  }