html-crush 6.2.2 → 6.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,31 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 6.3.0 (2026-09-01)
7
+
8
+ ### Bug Fixes
9
+
10
+ - align input option types with runtime ([ecbe95f](https://github.com/codsen/codsen/commit/ecbe95f3776101ae759b632b964c5f53579f012b))
11
+ - align range input and output types ([1a13db6](https://github.com/codsen/codsen/commit/1a13db665fe2f9e77c6b5fd509980c87e5a57baf))
12
+ - avoid unrelated comment line breaks ([e5e2ae6](https://github.com/codsen/codsen/commit/e5e2ae681ece0695a74d2f4b022665d81e867835))
13
+ - classify Unicode letters by code point ([e166119](https://github.com/codsen/codsen/commit/e166119a72e032ff4e3faffe6d35d766f8a011d0))
14
+ - keep progress within configured bounds ([4486713](https://github.com/codsen/codsen/commit/4486713f5c7a94e5c6e9ccb8aabcd6dbdc31e834))
15
+ - normalize end-of-file whitespace cleanup ([e13fd99](https://github.com/codsen/codsen/commit/e13fd99e705d6fd92ec39d0efedbaea6d60f7dce))
16
+ - preserve comment-like CSS strings ([4680eac](https://github.com/codsen/codsen/commit/4680eac5b16d868a4022e846e53b81e571415f53))
17
+ - preserve quoted attribute values ([6b0546e](https://github.com/codsen/codsen/commit/6b0546e98947ee98fdc4bd466fef46285eaec064))
18
+ - protect raw HTML element contents ([c6ffb0a](https://github.com/codsen/codsen/commit/c6ffb0a50a33a8586e83eeff409c0fefe6222730))
19
+ - remove unfinished CSS comments through EOF ([a0ebd01](https://github.com/codsen/codsen/commit/a0ebd01ba92970299ca7c5763eb9edc1e5cbb724))
20
+ - report conditional comment applicability ([2ee76fd](https://github.com/codsen/codsen/commit/2ee76fd9441715cfe5cde00121b359ad3ac2ae18))
21
+ - report terminal ranges-apply progress ([329e080](https://github.com/codsen/codsen/commit/329e0800a6b6186a0ff140619c07908c4923c8ac))
22
+
23
+ ### Features
24
+
25
+ - report explicit output size units ([70f0cad](https://github.com/codsen/codsen/commit/70f0cada7e74b6451e5eaade3432a3a8d316372a))
26
+
27
+ ### Performance Improvements
28
+
29
+ - avoid repeated range normalization ([07185c0](https://github.com/codsen/codsen/commit/07185c053a644004f378295758def93d66b90d02))
30
+
6
31
  ## 6.2.2 (2026-08-22)
7
32
 
8
33
  ### Performance Improvements
package/README.md CHANGED
@@ -22,6 +22,8 @@
22
22
  <a href="https://codsen.com/os/html-crush/play"><img src="https://img.shields.io/badge/playground-here-brightgreen?style=flat-square" alt="playground"></a>
23
23
  </p>
24
24
 
25
+ **No 3rd party dependencies.** All dependencies and devDependencies, checked recursively, are Codsen packages.
26
+
25
27
  ## Install
26
28
 
27
29
  This package is [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). If you're not ready yet, install an older version of this program, 4.2.0 (`npm i html-crush@4.2.0`).
@@ -56,7 +58,7 @@ assert.equal(
56
58
 
57
59
  ## Documentation
58
60
 
59
- Please [visit codsen.com](https://codsen.com/os/html-crush/) for a full description of the API. If you’re looking for the **Changelog**, it’s [here](https://github.com/codsen/codsen/blob/main/packages/html-crush/CHANGELOG.md). Also, try the [GUI playground](https://codsen.com/os/html-crush/play).
61
+ Please [visit codsen.com](https://codsen.com/os/html-crush/) for a full description of the API. For **Changelog**, see [raw md on GitHub](https://github.com/codsen/codsen/blob/main/packages/html-crush/CHANGELOG.md) or [the website](https://codsen.com/os/html-crush/changelog). Also, try the [GUI playground](https://codsen.com/os/html-crush/play).
60
62
 
61
63
  ## Contributing
62
64
 
@@ -1,24 +1,25 @@
1
1
  /**
2
2
  * @name html-crush
3
3
  * @fileoverview Minify email templates
4
- * @version 6.2.2
4
+ * @version 6.3.1
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/html-crush/}
8
8
  */
9
9
 
10
- import{formatDiagnosticValue as X,isLetter as F,isPlainObject as ge,isStr as O,isWhitespaceChar as S}from"codsen-utils";import{rApply as ce}from"ranges-apply";import{Ranges as be}from"ranges-push";import{left as K,right as L}from"string-left-right";import{matchLeft as he,matchRight as fe,matchRightIncl as Ee}from"string-match-left-right";import{expander as q}from"string-range-expander";var te="6.2.2";var Ae=te;function ie(n){return n>96&&n<123||n>64&&n<91||n>47&&n<58||n===95}function k(n){return n!==void 0&&ie(n.charCodeAt(0))}var 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 ye(n,T){let z=Date.now();if(!O(n))throw n===void 0?new Error("html-crush/crush(): [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush/crush(): [THROW_ID_02] the first input argument must be string! It was given as "${typeof n}", equal to:
11
- ${X(n,4)}`);if(T&&!ge(T))throw new Error(`html-crush/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 ${X(T,4)}`);if(T&&Array.isArray(T.breakToTheLeftOf)&&T.breakToTheLeftOf.length){for(let r=0,e=T.breakToTheLeftOf.length;r<e;r++)if(!O(T.breakToTheLeftOf[r]))throw new TypeError(`html-crush/crush(): [THROW_ID_04] the resolvedOpts.breakToTheLeftOf array contains non-string elements! For example, element at index ${r} is of a type "${typeof T.breakToTheLeftOf[r]}" and is equal to:
12
- ${X(T.breakToTheLeftOf[r],4)}`)}let s=new be({limitToBeAddedWhitespace:!0}),l={...Te,...T};typeof l.removeHTMLComments=="boolean"&&(l.removeHTMLComments=l.removeHTMLComments?1:0);let M="";Array.isArray(l.breakToTheLeftOf)&&l.breakToTheLeftOf.length&&(M=[...new Set(l.breakToTheLeftOf.map(r=>r[0]))].join(""));let y={removeHTMLComments:!1,removeCSSComments:!1},G=Array.isArray(l.mindTheInlineTags)?l.mindTheInlineTags:[],R=new Set(G),$e=!!G.length&&G.every(r=>O(r)&&!!r.length&&![...r].some(e=>!k(e))),x=new Map,Q=Array.isArray(l.breakToTheLeftOf)&&!!l.breakToTheLeftOf.length&&l.breakToTheLeftOf.every(O)&&!(l.breakToTheLeftOf.length===1&&!l.breakToTheLeftOf[0].trim());if(Q)for(let r of l.breakToTheLeftOf){if(!r.length)continue;let e=x.get(r[0]);e?e.push(r):x.set(r[0],[r])}function Z(r){if(!Q)return!!Ee(n,r,l.breakToTheLeftOf);let e=x.get(n[r]);if(e===void 0)return!1;for(let E=0,o=e.length;E<o;E++)if(n.startsWith(e[E],r))return!0;return!1}function v(r,e){if(!$e)return!!fe(n,r,l.mindTheInlineTags,{...e?{trimCharsBeforeMatching:"/"}:{},cb:h=>!h||!k(h)});let E=r+1;if(e)for(;n[E]==="/";)E++;let o=E;for(;o<b&&ie(n.charCodeAt(o));)o++;return o>E&&R.has(n.slice(E,o))}let V=null,i=null,C=!1,m=0,U=0,g=!1,N=!1,c=null,d=null,P=null,B=null,u,t=null,$=null,a=null,p=null,A=null,_=null,w=">};",H="<",se="!",ue=">",re="<",ee="{},:;<>~+",j=ee,Y=ee,I=!0,b=n.length,J=0;for(;J<b&&S(n[J]);)J++;let me=Math.floor(b/2),ne=.01,le;l.reportProgressFunc&&(le=Math.floor(l.reportProgressFuncTo-(l.reportProgressFuncTo-l.reportProgressFuncFrom)*ne-l.reportProgressFuncFrom));let D,W=0,f=`
10
+ import{formatDiagnosticValue as z,isLetter as De,isPlainObject as Oe,isStr as N,isWhitespaceChar as L}from"codsen-utils";import{Ranges as Ce}from"ranges-push";import{left as Z,right as V}from"string-left-right";import{matchLeft as Ve,matchRight as Ae,matchRightIncl as ye}from"string-match-left-right";import{expander as ee}from"string-range-expander";var me="6.3.1";function ae(n,g){if(g<0||g>=n.length)return;let E=n.charCodeAt(g),b=n.charCodeAt(g+1);if(E>=55296&&E<=56319&&b>=56320&&b<=57343)return n.slice(g,g+2);let i=n.charCodeAt(g-1);return E>=56320&&E<=57343&&i>=55296&&i<=56319?n.slice(g-1,g+1):n[g]}var Re=me;function ne(n){return n>96&&n<123||n>64&&n<91||n>47&&n<58||n===95}function J(n){return n!==void 0&&ne(n.charCodeAt(0))}function ce(n){return n!==void 0&&(ne(n.charCodeAt(0))||":-.".includes(n))}function ge(n){if(/^[\x00-\x7f]*$/.test(n))return n.length;let g=0;for(let E=0;E<n.length;E++){let b=n.charCodeAt(E);if(b<=127)g+=1;else if(b<=2047)g+=2;else if(b>=55296&&b<=56319&&E+1<n.length){let i=n.charCodeAt(E+1);i>=56320&&i<=57343?(g+=4,E+=1):g+=3}else g+=3}return g}function Ne(n,g,E){let b="",i=0;for(let l=0,I=g.length;l<I;l++){E&&E(l/I*100);let O=g[l];b+=`${n.slice(i,O[0])}${O[2]??""}`,i=O[1]}return E&&E(100),b+n.slice(i)}var be={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 Be(n,g){let E=Date.now();if(!N(n))throw n===void 0?new Error("html-crush/crush(): [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush/crush(): [THROW_ID_02] the first input argument must be string! It was given as "${typeof n}", equal to:
11
+ ${z(n,4)}`);if(g&&!Oe(g))throw new Error(`html-crush/crush(): [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ${typeof g}, equal to ${z(g,4)}`);let b=g;if(b&&Array.isArray(b.breakToTheLeftOf)&&b.breakToTheLeftOf.length){for(let s=0,e=b.breakToTheLeftOf.length;s<e;s++)if(!N(b.breakToTheLeftOf[s]))throw new TypeError(`html-crush/crush(): [THROW_ID_04] the resolvedOpts.breakToTheLeftOf array contains non-string elements! For example, element at index ${s} is of a type "${typeof b.breakToTheLeftOf[s]}" and is equal to:
12
+ ${z(b.breakToTheLeftOf[s],4)}`)}let i=new Ce({limitToBeAddedWhitespace:!0}),l={...be,...b,reportProgressFunc:typeof b?.reportProgressFunc=="function"?b.reportProgressFunc:null,breakToTheLeftOf:b?.breakToTheLeftOf===void 0?be.breakToTheLeftOf:Array.isArray(b.breakToTheLeftOf)?b.breakToTheLeftOf:[]};typeof l.removeHTMLComments=="boolean"&&(l.removeHTMLComments=l.removeHTMLComments?1:0);let I="";Array.isArray(l.breakToTheLeftOf)&&l.breakToTheLeftOf.length&&(I=[...new Set(l.breakToTheLeftOf.map(s=>s[0]))].join(""));let O={removeHTMLComments:!1,removeCSSComments:!1},Y=Array.isArray(l.mindTheInlineTags)?l.mindTheInlineTags:[],W=new Set(Y),fe=!!Y.length&&Y.every(s=>N(s)&&!!s.length&&![...s].some(e=>!J(e))),X=new Map,te=Array.isArray(l.breakToTheLeftOf)&&!!l.breakToTheLeftOf.length&&l.breakToTheLeftOf.every(N)&&!(l.breakToTheLeftOf.length===1&&!l.breakToTheLeftOf[0].trim());if(te)for(let s of l.breakToTheLeftOf){if(!s.length)continue;let e=X.get(s[0]);e?e.push(s):X.set(s[0],[s])}function le(s){if(!te)return!!ye(n,s,l.breakToTheLeftOf);let e=X.get(n[s]);if(e===void 0)return!1;for(let a=0,t=e.length;a<t;a++)if(n.startsWith(e[a],s))return!0;return!1}function H(s,e){if(!fe)return!!Ae(n,s,l.mindTheInlineTags,{...e?{trimCharsBeforeMatching:"/"}:{},cb:c=>!c||!J(c)});let a=s+1;if(e)for(;n[a]==="/";)a++;let t=a;for(;t<h&&ne(n.charCodeAt(t));)t++;return t>a&&W.has(n.slice(a,t))}function he(s){let e=s-1;for(;e>=0&&L(n[e]);)e--;if(n[e]!=="=")return null;let a=e,t=e-1;for(;t>=0&&L(n[t]);)t--,a--;for(;t>=0&&ce(n[t]);)t--;return t+1<a?n.slice(t+1,a).toLowerCase():null}function y(s,e,a){if(n[s]!=="<")return!1;let t=s+1;if(a){if(n[t]!=="/")return!1;t++}else if(n[t]==="/")return!1;for(let c=0;c<e.length;c++){let C=n.charCodeAt(t+c);if(C>64&&C<91&&(C+=32),C!==e.charCodeAt(c))return!1}return!ce(n[t+e.length])&&!De(ae(n,t+e.length))}function de(s,e){let a=n.indexOf("<",s);for(;a!==-1;){if(y(a,e,!0))return a;a=n.indexOf("<",a+1)}return-1}let P=null,$=null,w=!1,r=0,G=0,T=!1,k=!1,f=null,U=null,M=null,S=null,v=null,q=null,u,o=null,m=null,d=null,D=null,A=null,j=null,R=">};",B="<",Te="!",Ee=">",pe="<",oe="{},:;<>~+",K=oe,Q=oe,F=!0,h=n.length;function ie(s,e=!1){let a=s.length,t=Math.max(h-a,0),c=ge(n),C=e?c:ge(s),re=Math.max(c-C,0);return{timeTakenInMilliseconds:Date.now()-E,originalLength:h,cleanedLength:a,bytesSaved:t,percentageReducedOfOriginal:h?Math.round(t*100/h):0,originalLengthInCodeUnits:h,cleanedLengthInCodeUnits:a,codeUnitsSaved:t,percentageReducedOfOriginalInCodeUnits:h?Math.round(t*100/h):0,originalLengthInUtf8Bytes:c,cleanedLengthInUtf8Bytes:C,utf8BytesSaved:re,percentageReducedOfOriginalInUtf8Bytes:c?Math.round(re*100/c):0}}let _=0;for(;_<h&&L(n[_]);)_++;let Se=Math.floor(h/2),se=.01,$e=1-se,ue=null;function x(s){if(!l.reportProgressFunc||h<=1e3)return;let e=Math.max(0,Math.min(s,1)),a=Math.floor(l.reportProgressFuncFrom+(l.reportProgressFuncTo-l.reportProgressFuncFrom)*e);a!==ue&&(ue=a,l.reportProgressFunc(a))}let p=`
13
13
  `;if(n.includes(`\r
14
- `)?f=`\r
15
- `:n.includes("\r")&&(f="\r"),b){for(let e=0;e<b;e++){if(l.reportProgressFunc&&(b>1e3&&b<2e3?e===me&&l.reportProgressFunc(Math.floor((l.reportProgressFuncTo-l.reportProgressFuncFrom)/2)):b>=2e3&&(D=l.reportProgressFuncFrom+Math.floor(e/b*(le||1)),D!==W&&(W=D,l.reportProgressFunc(D)))),U++,!u&&g&&n[e]==="}"&&n[e-1]==="}"&&(m+1>=l.lineLengthLimit?(s.push(e,e,f),m=0):(t=e,$=e,a=" ")),u&&typeof u=="number"&&e>=u&&(u=void 0),B!==null&&n[e]==="<"&&n.startsWith("</script",e)&&!F(n[e+8])){if((l.removeIndentations||l.removeLineBreaks)&&e>0&&n[~-e]&&S(n[~-e])){for(let o=e;o--;)if(n[o]===`
16
- `||n[o]==="\r"||!S(n[o])){o+1<e&&s.push(o+1,e);break}}B=null,u=!1,e+=8;continue}if(!u&&!g&&n[e]==="<"&&n.startsWith("<script",e)&&!F(n[e+7])){B=e,u=!0;let o="";(l.removeLineBreaks||l.removeIndentations)&&i!==null&&(i>0&&(o=f),s.push(i,e,o)),i=null,V=null}if(A!==null&&p===null&&!k(n[e])){p=n.slice(A,e);let o=L(n,~-e),h=L(n,e);if(typeof o=="number"&&n[o]===">"&&S(n[e])&&h)s.push(e,h);else if(o&&n[o]==="/"&&n[L(n,o)]===">"){S(n[e])&&h&&s.push(e,h);let oe=L(n,o+1);n[o+1]!==">"&&oe&&s.push(o+1,oe)}}if(!u&&!g&&!c&&n[~-e]==="<"&&A===null)if(k(n[e]))A=e;else{let o=L(n,~-e),h=L(n,o);n[o]==="/"&&k(n[h]||"")&&(A=h)}if(!u&&(g||c)&&d!==null&&n[e]==="*"&&n[e+1]==="/"&&([t,$]=q({str:n,from:d,to:e+2,ifLeftSideIncludesThisThenCropTightly:j||"",ifRightSideIncludesThisThenCropTightly:Y||""}),d=null,t!=null?s.push(t,$):(m+=1,e+=1),u=e+2),!u&&(g||c)&&d===null&&n[e]==="/"&&n[e+1]==="*"&&(y.removeCSSComments||(y.removeCSSComments=!0),l.removeCSSComments&&(d=e)),N&&n.startsWith("![endif",e+1)&&(N=!1),!u&&!g&&!c&&P!==null){let o;n.startsWith("-->",e)?o=3:n[e]===">"&&n[e-1]==="]"&&(o=1),o&&([t,$]=q({str:n,from:P,to:e+o}),P=null,t!=null?l.lineLengthLimit&&U-($-t)>=l.lineLengthLimit?(s.push(t,$,f),U=-o):(s.push(t,$),U-=$-t):(m+=o-1,e+=o-1),u=e+o)}if(!u&&!g&&!c&&n[e]==="<"&&(n.startsWith("<!--",e)||l.removeHTMLComments===2&&n.startsWith("<![endif",e))&&P===null&&(n.startsWith("[if",e+4)?(N||(N=!0),l.removeHTMLComments===2&&(P=e)):l.removeHTMLComments&&(!N||l.removeHTMLComments===2)&&(P=e),y.removeHTMLComments||(y.removeHTMLComments=!0)),!u&&g&&d===null&&n[e]==="<"&&n.startsWith("</style",e)&&!F(n[e+7])?g=!1:!u&&!g&&d===null&&n[e]==="<"&&n.startsWith("<style",e)&&!F(n[e+6])&&(g=!0,(l.removeLineBreaks||l.removeIndentations)&&l.breakToTheLeftOf.includes("<style")&&n.startsWith(' type="text/css">',e+6)&&n[e+24]&&s.push(e+23,e+23,f)),!u&&!c&&`"'`.includes(n[e])&&n.endsWith("style=",e)&&(c=e),!u&&S(n[e]))i===null&&(i=e);else if(!u&&!((g||c)&&d!==null)){if(i!==null){if(l.removeLineBreaks&&(m+=1),I)I=!1,(l.removeIndentations||l.removeLineBreaks)&&s.push(0,e);else if(l.removeIndentations&&!l.removeLineBreaks&&(!C&&V!==null&&e>V?s.push(V+1,e):i+1<e&&(n.endsWith("]>",i)||n.endsWith("-->",i)||n.startsWith("<![",e)||n.startsWith("<!--<![",e)?s.push(i,e):n[i]===" "?s.push(i+1,e):n[~-e]===" "?s.push(i,~-e):s.push(i,e," "))),l.removeLineBreaks||c){if(M.includes(n[e])&&Z(e)){!(`\r
17
- `.includes(n[~-e])&&i===~-e)&&!(n[~-e]===`
18
- `&&n[e-2]==="\r"&&i===e-2)&&s.push(i,e,f),t=null,$=null,a=null,i=null,m=1;continue}let o=" ";if(!(n[e]==="<"&&v(e,!1))){if(n[~-i]&&ue.includes(n[~-i])&&re.includes(n[e])||(g||c)&&d===null&&(j.includes(n[~-i])||Y.includes(n[e]))||n[e]==="!"&&n.startsWith("!important",e)&&!N||c&&(n[~-i]==="'"||n[~-i]==='"')||n[~-i]==="}"&&n.startsWith("</style",e)||n[e]===">"&&(`'"`.includes(n[K(n,e)])||n[L(n,e)]==="<")||n[e]==="/"&&n[L(n,e)]===">"){o="";let h=n[e]==="/"&&n[e+1]===">"?L(n,e):null;h&&h>e+1&&(s.push(e+1,h),m-=h-e+1)}}g&&n[e]==="}"&&i&&n[i-1]==="}"&&(o=" "),o?.length&&(m+=1),l.lineLengthLimit?m>=l.lineLengthLimit||!n[e+1]||n[e]===">"||n[e]==="/"&&n[e+1]===">"?((m>l.lineLengthLimit||m===l.lineLengthLimit&&n[e+1]?.trim()&&!w.includes(n[e])&&!H.includes(n[e+1]))&&(o=f,m=1),(m>l.lineLengthLimit||!(o===" "&&e===i+1))&&(s.push(i,e,o),V=null),t=null,$=null,a=null):(t===null||i<t)&&(t=i,$=e,a=o):e===i+1&&o===" "||s.push(i,e,o)}i=null,C||(C=!0)}else I&&(I=!1),l.removeLineBreaks&&(m+=1);C||(C=!0)}if(!u&&!I&&e!==0&&l.removeLineBreaks&&(l.lineLengthLimit||M)&&!(n[e]==="<"&&n.startsWith("</a",e))){if(M&&Z(e)&&J<e&&(n[e]!=="<"||!n.startsWith("<![endif]",e)||!he(n,e,"<!--"))){s.push(e,e,f),t=null,$=null,a=null,m=1;continue}else if(l.lineLengthLimit&&m<=l.lineLengthLimit){if(!n[e+1]||H.includes(n[e])&&!se.includes(n[e])||w.includes(n[e])||S(n[e])){if(t!==null&&$!==null&&(t!==$||a?.length)){let o=a;!S(n[e])&&n[e+1]?.trim()&&m+(a?a.length:0)>l.lineLengthLimit&&(o=f),(m+(o?o.length:0)>l.lineLengthLimit||!(o===" "&&$===t+1&&n[t]===" "))&&(n[~-t]==="}"&&n[$]==="{"||(s.push(t,$,o),V=null))}!S(n[e])&&(H.includes(n[e])||n[~-e]&&w.includes(n[~-e]))&&O(_)&&(!p||!R.has(p))&&!(n[e]==="<"&&v(e,!1))&&!(n[e]==="<"&&v(e,!0))?(t=e,$=e,a=null):d===null&&t!==null&&(c||!l.mindTheInlineTags||!Array.isArray(l.mindTheInlineTags)||Array.isArray(l.mindTheInlineTags.length)&&!l.mindTheInlineTags.length||!O(p)||Array.isArray(l.mindTheInlineTags)&&l.mindTheInlineTags.length&&O(p)&&!R.has(p))&&!(n[e]==="<"&&v(e,!0))&&(t=null,$=null,a=null)}}else if(l.lineLengthLimit)if(H.includes(n[e])&&!(n[e]==="<"&&v(e,!0)))if(t!==null&&$!==null&&(t!==$||a?.length)){let o=a?.length?a.length:0;m-($-t-o)-1>l.lineLengthLimit||(s.push(t,$,a),m-($-t-o)-1===l.lineLengthLimit&&(s.push(e,e,f),m=0),t=null,$=null,a=null)}else s.push(e,e,f),m=0;else n[e+1]&&w.includes(n[e])&&O(p)&&Array.isArray(l.mindTheInlineTags)&&l.mindTheInlineTags.length&&!R.has(p)?t!==null&&$!==null&&(t!==$||a?.length)||(s.push(e+1,e+1,f),m=0):S(n[e])||n[e+1]||t!==null&&$!==null&&(t!==$||a?.length)&&s.push(t,$,f)}if(!u&&!I&&l.removeLineBreaks&&l.lineLengthLimit&&m>=l.lineLengthLimit&&t!==null&&$!==null&&!w.includes(n[e])&&!H.includes(n[e])&&!"/".includes(n[e])&&!(m===l.lineLengthLimit&&n[e+1]&&!n[e+1].trim())){let o=f;n[e+1]&&!n[e+1].trim()&&m===l.lineLengthLimit&&(o=a),o===f&&!n[~-t].trim()&&K(n,t)&&(t=K(n,t)+1),s.push(t,$,o),m=e-$,n[e].length&&(m+=1),t=null,$=null,a=null}if((!u&&n[e]===`
14
+ `)?p=`\r
15
+ `:n.includes("\r")&&(p="\r"),h){for(let e=0;e<h;e++){if(l.reportProgressFunc&&(h>1e3&&h<2e3?e===Se&&x(.5):h>=2e3&&x(e/h*$e)),G++,!u&&T&&n[e]==="}"&&n[e-1]==="}"&&(r+1>=l.lineLengthLimit?(i.push(e,e,p),r=0):(o=e,m=e,d=" ")),u&&typeof u=="number"&&e>=u&&(u=void 0),q!==null&&y(e,"script",!0)){if((l.removeIndentations||l.removeLineBreaks)&&e>0&&n[~-e]&&L(n[~-e])){for(let t=e;t--;)if(n[t]===`
16
+ `||n[t]==="\r"||!L(n[t])){t+1<e&&i.push(t+1,e);break}}q=null,u=!1,e+=8;continue}if(!u&&!T&&y(e,"script",!1)){q=e,u=!0;let t="";(l.removeLineBreaks||l.removeIndentations)&&$!==null&&($>0&&(t=p),i.push($,e,t)),$=null,P=null}if(!u&&U!==null){l.removeLineBreaks&&(r=`\r
17
+ `.includes(n[e])?0:r+1),e>U&&n[e]===n[U]&&(U=null);continue}if(!u&&A!==null&&!f&&`"'`.includes(n[e])){let t=he(e);if(t==="style")f=e;else if(t!==null){U=e,l.removeLineBreaks&&(r+=1);continue}}if(!u&&M!==null){if(l.removeLineBreaks&&(r=`\r
18
+ `.includes(n[e])?0:r+1),e>M&&n[e]===n[M]){let t=0;for(let c=e;c>0&&n[c-1]==="\\";c--)t++;t%2===0&&(M=null)}continue}if(!u&&(T||f)&&(f||A===null)&&`"'`.includes(n[e])&&!(f&&n[e]===n[f])){M=e,l.removeLineBreaks&&(r+=1);continue}if(A!==null&&D===null&&!J(n[e])){D=n.slice(A,e);let t=V(n,~-e),c=V(n,e);if(typeof t=="number"&&n[t]===">"&&L(n[e])&&c)i.push(e,c);else if(t&&n[t]==="/"&&n[V(n,t)]===">"){L(n[e])&&c&&i.push(e,c);let C=V(n,t+1);n[t+1]!==">"&&C&&i.push(t+1,C)}}if(!u&&!T&&!f&&n[~-e]==="<"&&A===null)if(J(n[e]))A=e;else{let t=V(n,~-e),c=V(n,t);n[t]==="/"&&J(n[c]||"")&&(A=c)}if(!u&&(T||f)&&S!==null&&n[e]==="*"&&n[e+1]==="/"&&([o,m]=ee({str:n,from:S,to:e+2,ifLeftSideIncludesThisThenCropTightly:K||"",ifRightSideIncludesThisThenCropTightly:Q||""}),S=null,o!=null?i.push(o,m):(r+=1,e+=1),u=e+2),!u&&(T||f)&&S===null&&n[e]==="/"&&n[e+1]==="*"&&(O.removeCSSComments||(O.removeCSSComments=!0),l.removeCSSComments&&(S=e)),k&&n.startsWith("![endif",e+1)&&(k=!1),!u&&!T&&!f&&v!==null){let t;n.startsWith("-->",e)?t=3:n[e]===">"&&n[e-1]==="]"&&(t=1),t&&([o,m]=ee({str:n,from:v,to:e+t}),v=null,o!=null?l.removeLineBreaks&&l.lineLengthLimit&&G-(m-o)>=l.lineLengthLimit?(i.push(o,m,p),G=-t):(i.push(o,m),G-=m-o):(r+=t-1,e+=t-1),u=e+t)}if(!u&&!T&&!f&&n[e]==="<"&&(n.startsWith("<!--",e)||n.startsWith("<![endif",e))&&v===null&&(n.startsWith("<![endif",e)?l.removeHTMLComments===2&&(v=e):n.startsWith("[if",e+4)?(k||(k=!0),l.removeHTMLComments===2&&(v=e)):l.removeHTMLComments&&(!k||l.removeHTMLComments===2)&&(v=e),O.removeHTMLComments||(O.removeHTMLComments=!0)),!u&&T&&S===null&&y(e,"style",!0)?T=!1:!u&&!T&&S===null&&y(e,"style",!1)&&(T=!0,(l.removeLineBreaks||l.removeIndentations)&&l.breakToTheLeftOf.includes("<style")&&n.startsWith(' type="text/css">',e+6)&&n[e+24]&&i.push(e+23,e+23,p)),!u&&!f&&`"'`.includes(n[e])&&n.endsWith("style=",e)&&(f=e),!u&&L(n[e]))$===null&&($=e);else if(!u&&!((T||f)&&S!==null)){if($!==null){if(l.removeLineBreaks&&(r+=1),F)F=!1,(l.removeIndentations||l.removeLineBreaks)&&i.push(0,e);else if(l.removeIndentations&&!l.removeLineBreaks&&(!w&&P!==null&&e>P?i.push(P+1,e):$+1<e&&(n.endsWith("]>",$)||n.endsWith("-->",$)||n.startsWith("<![",e)||n.startsWith("<!--<![",e)?i.push($,e):n[$]===" "?i.push($+1,e):n[~-e]===" "?i.push($,~-e):i.push($,e," "))),l.removeLineBreaks||f){if(I.includes(n[e])&&le(e)){!(`\r
19
+ `.includes(n[~-e])&&$===~-e)&&!(n[~-e]===`
20
+ `&&n[e-2]==="\r"&&$===e-2)&&i.push($,e,p),o=null,m=null,d=null,$=null,r=1;continue}let t=" ";if(!(n[e]==="<"&&H(e,!1))){if(n[~-$]&&Ee.includes(n[~-$])&&pe.includes(n[e])||(T||f)&&S===null&&(K.includes(n[~-$])||Q.includes(n[e]))||n[e]==="!"&&n.startsWith("!important",e)&&!k||f&&(n[~-$]==="'"||n[~-$]==='"')||n[~-$]==="}"&&n.startsWith("</style",e)||n[e]===">"&&(`'"`.includes(n[Z(n,e)])||n[V(n,e)]==="<")||n[e]==="/"&&n[V(n,e)]===">"){t="";let c=n[e]==="/"&&n[e+1]===">"?V(n,e):null;c&&c>e+1&&(i.push(e+1,c),r-=c-e+1)}}T&&n[e]==="}"&&$&&n[$-1]==="}"&&(t=" "),t?.length&&(r+=1),l.lineLengthLimit?r>=l.lineLengthLimit||!n[e+1]||n[e]===">"||n[e]==="/"&&n[e+1]===">"?((r>l.lineLengthLimit||r===l.lineLengthLimit&&n[e+1]?.trim()&&!R.includes(n[e])&&!B.includes(n[e+1]))&&(t=p,r=1),(r>l.lineLengthLimit||!(t===" "&&e===$+1))&&(i.push($,e,t),P=null),o=null,m=null,d=null):(o===null||$<o)&&(o=$,m=e,d=t):e===$+1&&t===" "||i.push($,e,t)}$=null,w||(w=!0)}else F&&(F=!1),l.removeLineBreaks&&(r+=1);w||(w=!0)}if(!u&&!F&&e!==0&&l.removeLineBreaks&&(l.lineLengthLimit||I)&&!(n[e]==="<"&&n.startsWith("</a",e))){if(I&&le(e)&&_<e&&(n[e]!=="<"||!n.startsWith("<![endif]",e)||!Ve(n,e,"<!--"))){i.push(e,e,p),o=null,m=null,d=null,r=1;continue}else if(l.lineLengthLimit&&r<=l.lineLengthLimit){if(!n[e+1]||B.includes(n[e])&&!Te.includes(n[e])||R.includes(n[e])||L(n[e])){if(o!==null&&m!==null&&(o!==m||d?.length)){let t=d;!L(n[e])&&n[e+1]?.trim()&&r+(d?d.length:0)>l.lineLengthLimit&&(t=p),(r+(t?t.length:0)>l.lineLengthLimit||!(t===" "&&m===o+1&&n[o]===" "))&&(n[~-o]==="}"&&n[m]==="{"||(i.push(o,m,t),P=null))}!L(n[e])&&(B.includes(n[e])||n[~-e]&&R.includes(n[~-e]))&&N(j)&&(!D||!W.has(D))&&!(n[e]==="<"&&H(e,!1))&&!(n[e]==="<"&&H(e,!0))?(o=e,m=e,d=null):S===null&&o!==null&&(f||!l.mindTheInlineTags||!Array.isArray(l.mindTheInlineTags)||Array.isArray(l.mindTheInlineTags.length)&&!l.mindTheInlineTags.length||!N(D)||Array.isArray(l.mindTheInlineTags)&&l.mindTheInlineTags.length&&N(D)&&!W.has(D))&&!(n[e]==="<"&&H(e,!0))&&(o=null,m=null,d=null)}}else if(l.lineLengthLimit)if(B.includes(n[e])&&!(n[e]==="<"&&H(e,!0)))if(o!==null&&m!==null&&(o!==m||d?.length)){let t=d?.length?d.length:0;r-(m-o-t)-1>l.lineLengthLimit||(i.push(o,m,d),r-(m-o-t)-1===l.lineLengthLimit&&(i.push(e,e,p),r=0),o=null,m=null,d=null)}else i.push(e,e,p),r=0;else n[e+1]&&R.includes(n[e])&&N(D)&&Array.isArray(l.mindTheInlineTags)&&l.mindTheInlineTags.length&&!W.has(D)?o!==null&&m!==null&&(o!==m||d?.length)||(i.push(e+1,e+1,p),r=0):L(n[e])||n[e+1]||o!==null&&m!==null&&(o!==m||d?.length)&&i.push(o,m,p)}if(!u&&!F&&l.removeLineBreaks&&l.lineLengthLimit&&r>=l.lineLengthLimit&&o!==null&&m!==null&&!R.includes(n[e])&&!B.includes(n[e])&&!"/".includes(n[e])&&!(r===l.lineLengthLimit&&n[e+1]&&!n[e+1].trim())){let t=p;n[e+1]&&!n[e+1].trim()&&r===l.lineLengthLimit&&(t=d),t===p&&!n[~-o].trim()&&Z(n,o)&&(o=Z(n,o)+1),i.push(o,m,t),r=e-m,n[e].length&&(r+=1),o=null,m=null,d=null}if((!u&&n[e]===`
19
21
  `||n[e]==="\r"&&(!n[e+1]||n[e+1]&&n[e+1]!==`
20
- `))&&(V=e,C&&(C=!1),!l.removeLineBreaks&&i!==null&&i<e&&n[e+1]&&n[e+1]!=="\r"&&n[e+1]!==`
21
- `&&s.push(i,e)),n[e+1]||(g&&d!==null?s.push([...q({str:n,from:d,to:e,ifLeftSideIncludesThisThenCropTightly:j||"",ifRightSideIncludesThisThenCropTightly:Y||""})]):i&&n[e]!==`
22
- `&&n[e]!=="\r"?s.push(i,e+1):i&&(n[e]==="\r"&&n[e+1]===`
23
- `||n[e]===`
24
- `&&n[e-1]!=="\r")&&s.push(i,e)),!u&&c&&c<e&&n[c]===n[e]&&(c=null),!u&&!g&&n[e]==="<"&&n.startsWith("<pre",e)&&!F(n[e+4])){let o=n.indexOf("</pre",e+5);o>0&&(u=o)}if(!u&&!g&&n[e]==="<"&&n.startsWith("<code",e)&&!F(n[e+5])){let o=n.indexOf("</code",e+5);o>0&&(u=o)}if(!u&&n[e]==="<"&&n.startsWith("<![CDATA[",e)){let o=n.indexOf("]]>",e+9);o>0&&(u=o)}if(!u&&!g&&!c&&A!==null&&n[e]===">"&&(n[L(n,e)]==="<"&&(_=p),A=null,p=null),n[e]==="<"&&_!==null&&(_=null),!u&&g&&n[e]==="{"&&n[e+1]==="{"){let o=n.indexOf("}}",e+2);o!==-1&&(u=o+2)}let E=!0}let r=s.current();if(r){let e=l.reportProgressFuncTo-(l.reportProgressFuncTo-l.reportProgressFuncFrom)*ne,E=ce(n,r,h=>{l.reportProgressFunc&&b>=2e3&&(D=Math.floor(e+(l.reportProgressFuncTo-e)*(h/100)),D!==W&&(W=D,l.reportProgressFunc(D)))}),o=E.length;return{log:{timeTakenInMilliseconds:Date.now()-z,originalLength:b,cleanedLength:o,bytesSaved:Math.max(b-o,0),percentageReducedOfOriginal:b?Math.round(Math.max(b-o,0)*100/b):0},ranges:r,applicableOpts:y,result:E}}}return{log:{timeTakenInMilliseconds:Date.now()-z,originalLength:b,cleanedLength:b,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:y,ranges:null,result:n}}export{ye as crush,Te as defaults,Ae as version};
22
+ `))&&(P=e,w&&(w=!1),!l.removeLineBreaks&&$!==null&&$<e&&n[e+1]&&n[e+1]!=="\r"&&n[e+1]!==`
23
+ `&&i.push($,e)),!n[e+1]){if((T||f)&&S!==null)i.push([...ee({str:n,from:S,to:e+1,ifLeftSideIncludesThisThenCropTightly:K||"",ifRightSideIncludesThisThenCropTightly:Q||""})]);else if($!==null&&(_<h||l.removeIndentations||l.removeLineBreaks)){let t=n.endsWith(`\r
24
+ `)?h-2:n.endsWith(`
25
+ `)||n.endsWith("\r")?h-1:h;$<t&&i.push($,t)}}if(!u&&f&&f<e&&n[f]===n[e]&&(f=null),!u&&!T&&n[e]==="<"){let t=null;if(y(e,"pre",!1)?t="pre":y(e,"code",!1)?t="code":y(e,"textarea",!1)&&(t="textarea"),t!==null){let c=de(e+2,t);u=c===-1?h:c}}if(!u&&n[e]==="<"&&n.startsWith("<![CDATA[",e)){let t=n.indexOf("]]>",e+9);t>0&&(u=t)}if(!u&&!T&&!f&&A!==null&&n[e]===">"&&(n[V(n,e)]==="<"&&(j=D),A=null,D=null),n[e]==="<"&&j!==null&&(j=null),!u&&T&&n[e]==="{"&&n[e+1]==="{"){let t=n.indexOf("}}",e+2);t!==-1&&(u=t+2)}let a=!0}let s=i.current();if(s){let e=l.reportProgressFunc&&h>=2e3?t=>{x($e+se*(t/100))}:void 0,a=Ne(n,s,e);return x(1),{log:ie(a),ranges:s,applicableOpts:O,result:a}}}return x(1),{log:ie(n,!0),applicableOpts:O,ranges:null,result:n}}export{Be as crush,be as defaults,Re as version};
@@ -1,57 +1,49 @@
1
1
  /**
2
2
  * @name html-crush
3
3
  * @fileoverview Minify email templates
4
- * @version 6.2.2
4
+ * @version 6.3.1
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/html-crush/}
8
8
  */
9
9
 
10
- "use strict";var htmlCrush=(()=>{var re=Object.defineProperty,Je=Object.defineProperties,Ge=Object.getOwnPropertyDescriptor,qe=Object.getOwnPropertyDescriptors,Ye=Object.getOwnPropertyNames,Se=Object.getOwnPropertySymbols;var Oe=Object.prototype.hasOwnProperty,ze=Object.prototype.propertyIsEnumerable;var he=(e,r,o)=>r in e?re(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o,R=(e,r)=>{for(var o in r||(r={}))Oe.call(r,o)&&he(e,o,r[o]);if(Se)for(var o of Se(r))ze.call(r,o)&&he(e,o,r[o]);return e},we=(e,r)=>Je(e,qe(r));var Ke=(e,r)=>{for(var o in r)re(e,o,{get:r[o],enumerable:!0})},Qe=(e,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Ye(r))!Oe.call(e,i)&&i!==o&&re(e,i,{get:()=>r[i],enumerable:!(n=Ge(r,i))||n.enumerable});return e};var Xe=e=>Qe(re({},"__esModule",{value:!0}),e);var X=(e,r,o)=>he(e,typeof r!="symbol"?r+"":r,o);var pt={};Ke(pt,{crush:()=>$t,defaults:()=>ke,version:()=>mt});function Ze(){let e=[],r=0,o=!1;return{append(n){return o?!1:r+n.length>1999?(e.push("\u2026"),r+=1,o=!0,!1):(e.push(n),r+=n.length,!0)},result(){return e.join("")},stopped(){return o}}}function et(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function ie(e,r){if(e.append('"')){for(let o=0;o<r.length&&!e.stopped();o+=1){let n=r.charCodeAt(o);n===34?e.append('\\"'):n===92?e.append("\\\\"):n===8?e.append("\\b"):n===9?e.append("\\t"):n===10?e.append("\\n"):n===12?e.append("\\f"):n===13?e.append("\\r"):n<32||n===8232||n===8233||n>=55296&&n<=57343?e.append(et(n)):e.append(r[o])}e.append('"')}}function tt(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function Le(e,r){e.append("Symbol(");let o=String(r);o.length>8&&ie(e,o.slice(7,-1)),e.append(")")}function Ae(e,r){typeof r=="symbol"?Le(e,r):ie(e,String(r))}function p(e,r=0){let o=Ze(),n=r===4?4:0,i=new WeakSet,l=0;function h(s){n&&o.append(" ".repeat(s*n))}function u(s,f){s&&o.append(","),n&&(o.append("\n"),h(f+1))}function c(s,f,y){n&&f&&(o.append("\n"),h(y)),o.append(s)}function a(s,f){Object.prototype.hasOwnProperty.call(s,"value")?$(s.value,f):o.append(tt(s))}function b(s,f){let y;try{y=Reflect.getOwnPropertyDescriptor(s,"length")}catch(d){o.append("[Uninspectable]");return}let m=y==null?void 0:y.value;if(!Number.isSafeInteger(m)||m<0){o.append("[Uninspectable]");return}o.append("[");let I=!1;for(let d=0;d<m&&!o.stopped();d+=1){if(u(I,f),I=!0,l>=50){o.append("[MaxEntries]");break}l+=1;let E;try{E=Reflect.getOwnPropertyDescriptor(s,String(d))}catch(v){o.append("[Uninspectable]");continue}E!=null&&E.enumerable?a(E,f+1):o.append("[Empty]")}c("]",I,f)}function A(s,f){let y;try{y=Reflect.ownKeys(s)}catch(I){o.append("[Uninspectable]");return}o.append("{");let m=!1;for(let I of y){if(o.stopped())break;if(l>=50){u(m,f),m=!0,ie(o,"\u2026"),o.append(n?": ":":"),o.append("[MaxEntries]");break}l+=1;let d;try{d=Reflect.getOwnPropertyDescriptor(s,I)}catch(E){u(m,f),m=!0,Ae(o,I),o.append(n?": ":":"),o.append("[Uninspectable]");continue}d!=null&&d.enumerable&&(u(m,f),m=!0,Ae(o,I),o.append(n?": ":":"),a(d,f+1))}c("}",m,f)}function C(s,f){if(i.has(s)){o.append("[Circular]");return}if(f>=5){o.append("[MaxDepth]");return}let y;try{y=Array.isArray(s)}catch(m){o.append("[Uninspectable]");return}i.add(s);try{y?b(s,f):A(s,f)}finally{i.delete(s)}}function $(s,f){s===null?o.append("null"):typeof s=="string"?ie(o,s):typeof s=="number"?o.append(Object.is(s,-0)?"-0":String(s)):typeof s=="boolean"?o.append(s?"true":"false"):typeof s>"u"?o.append("undefined"):typeof s=="bigint"?o.append("".concat(s,"n")):typeof s=="symbol"?Le(o,s):typeof s=="function"?o.append("[Function]"):C(s,f)}try{return $(e,0),o.result()}catch(s){return"[Uninspectable]"}}var bt=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),nt=Object.prototype.hasOwnProperty;function q(e){if(!O(e)||e.length!==1)return!1;let r=e.charCodeAt(0);return r<128?r>64&&r<91||r>96&&r<123:e.toUpperCase()!==e.toLowerCase()}function k(e){if(!O(e)||!e)return!1;let r=e.charCodeAt(0);return r<128?r===32||r>8&&r<14:!e[0].trim()}function W(e){if(e==null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function O(e){return typeof e=="string"}function Ce(e){return Number.isFinite(e)}function H(e){return Number.isSafeInteger(e)&&e>=0}var De,Tt=(De=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:De.get;var yt=Date.prototype.getTime;function j(e){return e!=null}function Ie(e,r){return W(e)&&O(r)&&nt.call(e,r)}var rt={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function z(e,r){if(!Array.isArray(e)||!e.length)return e;let o=R(R({},rt),r),n,i;if(o.strictlyTwoElementsInRangeArrays&&!e.every((u,c)=>!Array.isArray(u)||u.length!==2?(n=c,i=u.length,!1):!0))throw new TypeError("ranges-sort/rSort(): [THROW_ID_01] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ".concat(n,"th range (").concat(p(e[n],4),") has not two but ").concat(i," elements!"));if(!e.every((u,c)=>!Array.isArray(u)||!Number.isInteger(u[0])||u[0]<0||!Number.isInteger(u[1])||u[1]<0?(n=c,!1):!0))throw new TypeError("ranges-sort/rSort(): [THROW_ID_02] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ".concat(n,"th range (").concat(p(e[n],4),") does not consist of only natural numbers!"));let l=e.length**2,h=0;return Array.from(e).sort((u,c)=>(o.progressFn&&(h+=1,o.progressFn(Math.floor(h*100/l))),u[0]===c[0]?u[1]<c[1]?-1:u[1]>c[1]?1:0:u[0]<c[0]?-1:1))}var it={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function ge(e,r){function o(s){return!!s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;if(r&&!o(r))throw new TypeError("ranges-merge/rMerge(): [THROW_ID_01] the second input argument must be a plain object. It was given as:\n".concat(p(r,4)," (type ").concat(typeof r,")"));let n=R(R({},it),r);if(n.progressFn&&o(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_02] opts.progressFn must be a function! It was given of a type: "'.concat(typeof n.progressFn,'", equal to ').concat(p(n.progressFn,4)));if(n.mergeType!==1&&n.mergeType!==2&&n.mergeType!=="1"&&n.mergeType!=="2")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_03] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof n.mergeType,'", equal to ').concat(p(n.mergeType,4)));if(typeof n.joinRangesThatTouchEdges!="boolean")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof n.joinRangesThatTouchEdges,'", equal to ').concat(p(n.joinRangesThatTouchEdges,4)));let i=n.progressFn,l=n.joinRangesThatTouchEdges,h=[];for(let s of e)Array.isArray(s)&&(s[2]!==void 0||s[0]!==s[1])&&h.push([...s]);let u,c,a;i?u=z(h,{progressFn:s=>{a=Math.floor(s/5),a!==c&&(c=a,i(a))}}):u=z(h);let b=u.length-1,A=n.mergeType===2||n.mergeType==="2",C=u.length;for(let s=b;s>=0;s--){let f=u[s];for(i&&s<b&&(a=Math.floor((1-(s+1)/b)*78)+21,a!==c&&a>c&&(c=a,i(a)));C<u.length;){let y=u[C],m=y[0]===f[0];if(!m&&(l?y[0]>f[1]:y[0]>=f[1]))break;let I=y[1]>=f[1];I&&(f[1]=y[1]),y[2]!==void 0&&(m||I)&&f[2]!==null&&(y[2]===null&&f[2]!==null?f[2]=null:f[2]!=null?A&&m?f[2]=y[2]:f[2]+=y[2]:f[2]=y[2]),C+=1}C-=1,u[C]=f}let $=u.length-C;for(let s=0;s<$;s++)u[s]=u[C+s];return u.length=$,u.length?u:null}function oe(e){if(typeof e=="number")return Number.isInteger(e)&&e>=0;if(typeof e!="string"||!e.trim())return!1;let r=Number(e);return Number.isInteger(r)&&r>=0}function ve(e,r,o){let n=0,i=0;if(e===void 0&&r===void 0&&o===void 0)throw new Error("ranges-apply/rApply(): [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError("ranges-apply/rApply(): [THROW_ID_02] first input argument must be a string! Currently it's: ".concat(typeof e,", equal to: ").concat(p(e,4)));if(r!=null&&!Array.isArray(r))throw new TypeError("ranges-apply/rApply(): [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ".concat(typeof r,", equal to: ").concat(p(r,4)));if(o&&typeof o!="function")throw new TypeError("ranges-apply/rApply(): [THROW_ID_04] the third input argument must be a function (or falsy)! Currently it's: ".concat(typeof o,", equal to: ").concat(p(o,4)));if(!(r!=null&&r.some(Boolean)))return e;let l;Array.isArray(r)&&!Array.isArray(r[0])&&oe(r[0])&&oe(r[1])?l=[Array.from(r)]:l=Array.from(r);let h=l.length,u=0;l.forEach((b,A)=>{if(b){if(o&&(n=Math.floor(u/h*10),n!==i&&(i=n,o(n))),!Array.isArray(b))throw new TypeError("ranges-apply/rApply(): [THROW_ID_05] ranges array, second input arg., has ".concat(A,"th element not an array: ").concat(p(b,4),", which is ").concat(typeof b));if(!oe(b[0]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_06] ranges array, second input arg. has ".concat(A,"th element, array ").concat(p(b),". Its first element is not a non-negative integer or string index, but ").concat(typeof b[0],", equal to: ").concat(p(b[0],4),"."));if(typeof b[0]=="string"&&(l[A]=[...b],l[A][0]=Number(b[0])),!oe(b[1]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_07] ranges array, second input arg. has ".concat(A,"th element, array ").concat(p(b),". Its second element is not a non-negative integer or string index, but ").concat(typeof b[1],", equal to: ").concat(p(b[1],4),"."));typeof b[1]=="string"&&(l[A]===b&&(l[A]=[...b]),l[A][1]=Number(b[1])),u+=1}});let c=o?ge(l,{progressFn:b=>{n=10+Math.floor(b/10),n!==i&&(i=n,o(n))}}):ge(l),a=(c==null?void 0:c.length)||0;if(c&&a>0){let b=e.slice(c[a-1][1]);e=c.reduce((A,C,$,s)=>{o&&(n=20+Math.floor($/a*80),n!==i&&(i=n,o(n)));let f=$===0?0:s[$-1][1],y=s[$][0];return"".concat(A).concat(e.slice(f,y)).concat(s[$][2]||"")},""),e+=b}return e}function le(e,r=1){let o="\xA0";function n(l){return Array.from(l).reverse().join("")}function i(l,h,u){let c=u?"\n":"\r",a=u?"\r":"\n";if(!l)return l;let b=0,A=0,C="";for(let $=0,s=l.length;$<s;$++)(l[$]===c||l[$]===a&&l[$-1]!==c)&&A++,"\r\n".includes(l[$])||l[$]===o?(b=0,l[$]===o?C+=l[$]:l[$]===c?A<=h&&(C+=l[$],l[$+1]===a&&(C+=l[$+1],$++)):l[$]===a&&(l==null?void 0:l[$-1])!==c&&A<=h&&(C+=l[$])):(b++,!l[$+1]&&!A&&(C+=" "));return C}if(typeof e=="string"&&e.length){let l=1;typeof+r=="number"&&Number.isInteger(+r)&&+r>=0&&(l=+r);let h="",u="";if(!e.trim())h=e;else if(!e[0].trim()){for(let c=0,a=e.length;c<a;c++)if(e[c].trim()){h=e.slice(0,c);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===o)){for(let c=e.length;c--;)if(e[c].trim()){u=e.slice(c+1);break}}return"".concat(i(h,l,!1)).concat(e.trim()).concat(n(i(n(u),l,!0)))}return e}var ot={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function lt(e,r){function o(a){return!!a&&typeof a=="object"&&!Array.isArray(a)}if(!Array.isArray(e)||!e.length)return null;if(r&&!o(r))throw new TypeError("ranges-push/rMerge(): [THROW_ID_10] the second input argument must be a plain object. It was given as:\n".concat(p(r,4)," (type ").concat(typeof r,")"));let n=R(R({},ot),r);if(n.progressFn&&o(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new TypeError('ranges-push/rMerge(): [THROW_ID_11] resolvedOpts.progressFn must be a function! It was given of a type: "'.concat(typeof n.progressFn,'", equal to ').concat(p(n.progressFn,4)));if(![1,2,"1","2"].includes(n.mergeType))throw new TypeError('ranges-push/rMerge(): [THROW_ID_12] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof n.mergeType,'", equal to ').concat(p(n.mergeType,4)));if(typeof n.joinRangesThatTouchEdges!="boolean")throw new TypeError('ranges-push/rMerge(): [THROW_ID_13] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof n.joinRangesThatTouchEdges,'", equal to ').concat(p(n.joinRangesThatTouchEdges,4)));let i=e.filter(a=>Array.isArray(a)).map(a=>[...a]).filter(a=>a[2]!==void 0||a[0]!==a[1]),l,h,u;n.progressFn?l=z(i,{progressFn:a=>{u=Math.floor(a/5),u!==h&&(h=u,n.progressFn!=null&&n.progressFn(u))}}):l=z(i);let c=l.length-1;for(let a=c;a>0;a--)n.progressFn&&(u=Math.floor((1-a/c)*78)+21,u!==h&&u>h&&(h=u,n.progressFn(u))),(l[a][0]<=l[a-1][0]||!n.joinRangesThatTouchEdges&&l[a][0]<l[a-1][1]||n.joinRangesThatTouchEdges&&l[a][0]<=l[a-1][1])&&(l[a-1][0]=Math.min(l[a][0],l[a-1][0]),l[a-1][1]=Math.max(l[a][1],l[a-1][1]),l[a][2]!==void 0&&(l[a-1][0]>=l[a][0]||l[a-1][1]<=l[a][1])&&l[a-1][2]!==null&&(l[a][2]===null&&l[a-1][2]!==null?l[a-1][2]=null:l[a-1][2]!=null?+n.mergeType==2&&l[a-1][0]===l[a][0]?l[a-1][2]=l[a][2]:l[a-1][2]+=l[a][2]:l[a-1][2]=l[a][2]),l.splice(a,1),a=l.length);return l.length?l:null}var st={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1};function Re(e){return e[2]===void 0&&e[0]===e[1]}function at(e){let r=-1;for(let o=0,n=e.length;o<n;o++){let i=e[o];if(Array.isArray(i)){if(i[0]<r)return!1;r=i[0]}}return!0}var Ve=class{constructor(e){X(this,"ranges");X(this,"opts");X(this,"sorted");if(e!=null&&!W(e))throw new TypeError("ranges-push/Ranges/constructor(): [THROW_ID_01] The options argument must be a plain object. It was given as ".concat(p(e,4)," (type ").concat(typeof e,")."));let r=R(R({},st),e);if(r.mergeType&&r.mergeType!==1&&r.mergeType!==2)if(O(r.mergeType)&&r.mergeType.trim()==="1")r.mergeType=1;else if(O(r.mergeType)&&r.mergeType.trim()==="2")r.mergeType=2;else throw new Error('ranges-push/Ranges/constructor(): [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof r.mergeType,'", equal to ').concat(p(r.mergeType,4)));this.opts=r,this.ranges=[],this.sorted=!0}add(e,r,o){var l;if(e==null&&r==null)return;if(j(e)&&!j(r)){if(Array.isArray(e)){if(e.length){if(e.some(h=>Array.isArray(h))){e.forEach(h=>{Array.isArray(h)&&this.add(...h)});return}e.length&&H(+e[0])&&H(+e[1])&&this.add(...e)}return}throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_03] the first input argument, "from" is set ('.concat(p(e),') but second-one, "to" is not (').concat(p(r),")"))}else if(!j(e)&&j(r))throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_04] the second input argument, "to" is set ('.concat(p(r),') but first-one, "from" is not (').concat(p(e),")"));let n=+e,i=+r;if(H(n)&&H(i)){if(j(o)&&!O(o)&&!Ce(o))throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_05] The third argument, the value to add, was given not as string but ".concat(typeof o,", equal to:\n").concat(p(o,4)));if(j(this.ranges)&&Array.isArray(this.last())&&n===this.last()[1]){if(this.last()[1]=i,this.last()[2],this.last()[2]!==null&&j(o)){let h=this.last()[2]&&this.last()[2].length&&(!((l=this.opts)!=null&&l.mergeType)||this.opts.mergeType===1)?"".concat(this.last()[2]).concat(o):o;this.opts.limitToBeAddedWhitespace&&(h=le(h,this.opts.limitLinebreaksCount)),O(h)&&!h.length||(this.last()[2]=h)}}else{this.ranges||(this.ranges=[]);let h=this.last();h&&n<h[0]&&(this.sorted=!1);let u=o!==void 0&&!(O(o)&&!o.length)?[n,i,o&&this.opts.limitToBeAddedWhitespace?le(o,this.opts.limitLinebreaksCount):o]:[n,i];this.ranges.push(u)}}else throw H(n)?new TypeError('ranges-push/Ranges/add(): [THROW_ID_07] "to" value, the second input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof r,'" equal to: ').concat(p(r,4))):new TypeError('ranges-push/Ranges/add(): [THROW_ID_06] "from" value, the first input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof e,'" equal to: ').concat(p(e,4)))}push(e,r,o){this.add(e,r,o)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=lt(this.ranges,{mergeType:this.opts.mergeType}),this.sorted=!0,this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>j(e[2])?[e[0],e[1],le(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}firstCovers(e){if(!H(e))throw new TypeError("ranges-push/Ranges/firstCovers(): [THROW_ID_08] the input argument must be a natural number or zero! It was given as ".concat(p(e,4)," (type ").concat(typeof e,")"));if(!Array.isArray(this.ranges)||!this.ranges.length)return!1;let r=null;if(this.sorted){for(let n=0,i=this.ranges.length;n<i;n++){let l=this.ranges[n];if(!(!Array.isArray(l)||Re(l))){if(r===null){if(l[0]!==0)return!1;r=l[1]}else{if(l[0]>r)break;l[1]>r&&(r=l[1])}if(r>=e)return!0}}return r!==null&&r>=e}let o=!0;for(;o;){o=!1;for(let n=0,i=this.ranges.length;n<i;n++){let l=this.ranges[n];if(!(!Array.isArray(l)||Re(l))){if(l[0]<0)return!1;(r===null?l[0]===0:l[0]<=r&&l[1]>r)&&(r=l[1],o=!0)}}}return r!==null&&r>=e}wipe(){this.ranges=[],this.sorted=!0}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])&&H(e[0][0]))this.ranges=Array.from(e),this.sorted=at(this.ranges);else throw new Error("ranges-push/Ranges/replace(): [THROW_ID_09] Single range was given but we expected array of arrays! The first element, ".concat(p(e[0],4)," should be an array and its first element should be an integer, a string index."));else this.ranges=[],this.sorted=!0}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};var ce="\xA0";function me(e){return e===32||e>=9&&e<=13||e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function B(e,r=0){if(typeof e!="string"||!e.length)return null;(!r||typeof r!="number")&&(r=0);let o=e[r+1];if(!o)return null;if(!me(o.charCodeAt(0)))return r+1;if(o=e[r+2],o&&!me(o.charCodeAt(0)))return r+2;for(let n=r+3,i=e.length;n<i;n++)if(!me(e.charCodeAt(n)))return n;return null}function ut({str:e,idx:r,stopAtNewlines:o,stopAtRawNbsp:n}){if(typeof e!="string"||!e.length||((!r||typeof r!="number")&&(r=0),r<1))return null;if(e[~-r]&&(e[~-r].trim()||o&&"\n\r".includes(e[~-r])||n&&e[~-r]===ce))return~-r;if(e[r-2]&&(e[r-2].trim()||o&&"\n\r".includes(e[r-2])||n&&e[r-2]===ce))return r-2;for(let i=r;i--;)if(e[i]&&(e[i].trim()||o&&"\n\r".includes(e[i])||n&&e[i]===ce))return i;return null}function se(e,r=0){return ut({str:e,idx:r,stopAtNewlines:!1,stopAtRawNbsp:!1})}function Ne(e){return typeof e!="string"?e:e.length?[e]:[]}var Me={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},ft=e=>e+1;function ht(e,r,o,n,i=!1,l=ft){var d;let h=typeof o=="function"?o():o;if(+r<0&&i&&h==="EOL")return h;let u=R(R({},Me),n);if(r>=e.length&&!i)return!1;let c=i?1:o.length,a=0,b=!1,A=!1,C=!1,$=u.maxMismatches,s=r,f=!1,y=!1,m=!1;function I(){return a===1&&$<u.maxMismatches-1}for(;e[s];){let E=l(s);if(u.trimBeforeMatching&&e[s].trim()===""){if(!e[E]&&i&&o==="EOL")return!0;s=l(s);continue}if(u&&!u.i&&((d=u==null?void 0:u.trimCharsBeforeMatching)!=null&&d.includes(e[s]))||u!=null&&u.i&&u.trimCharsBeforeMatching&&u.trimCharsBeforeMatching.map(V=>V.toLowerCase()).includes(e[s].toLowerCase())){if(i&&o==="EOL"&&!e[E])return!0;s=l(s);continue}let v=E>s?o[o.length-c]:o[c-1];if(!u.i&&e[s]===v||u.i&&v!==void 0&&e[s].toLowerCase()===v.toLowerCase()){if(f||(f=!0),C||(C=!0),c===o.length){if(y=!0,$!==u.maxMismatches)return!1}else c===1&&(m=!0);if(c-=1,a++,I())return!1;if(!c)return a!==o.length||$===u.maxMismatches||!b?s:!1}else if(!b&&!a&&(b=!0),u.maxMismatches&&$&&s){$-=1;for(let V=0;V<=$;V++){let P=E>s?o[o.length-c+1+V]:o[c-2-V],J=e[l(s)];if(P&&(!u.i&&e[s]===P||u.i&&e[s].toLowerCase()===P.toLowerCase())&&(!u.firstMustMatch||c!==o.length)){if(a++,I())return!1;c-=2,f=!0;break}else if(J&&P&&(!u.i&&J===P||u.i&&J.toLowerCase()===P.toLowerCase())&&(!u.firstMustMatch||c!==o.length)){if(!a&&!u.hungry)return!1;c-=1,f=!0;break}else if(P===void 0&&$>=0&&f&&(!u.firstMustMatch||y)&&(!u.lastMustMatch||m))return s}f||(A=s)}else return s===0&&c===1&&!u.lastMustMatch&&C?0:!1;if(A!==!1&&A!==s&&(A=!1),c<1)return s;s=l(s)}if(c>0)return i&&h==="EOL"?!0:u&&u.maxMismatches>=c&&C?A||0:!1}function $e(e,r,o,n,i){var b,A,C;if(W(i)&&Ie(i,"trimBeforeMatching")&&i&&typeof i.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_01] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(i.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let l=R(R({},Me),i);if(typeof l.trimCharsBeforeMatching=="string"&&(l.trimCharsBeforeMatching=Ne(l.trimCharsBeforeMatching)),l.trimCharsBeforeMatching=l.trimCharsBeforeMatching.map($=>O($)?$:String($)),!O(r)||!r.length)return!1;if(!Number.isInteger(o)||o<0)throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_02] the second argument should be a natural number. Currently it's of a type: ").concat(typeof o,", equal to:\n").concat(p(o,4)));let h,u;if(O(n))h=[n];else if(Array.isArray(n))h=n;else if(!n)h=n;else if(typeof n=="function")h=[],h.push(n);else throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_03] the third argument, whatToMatch, is neither string nor array of strings! It's ").concat(typeof n,", equal to:\n").concat(p(n,4)));if(i&&!W(i))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_04] the fourth argument, options object, should be a plain object. Currently it's of a type \"").concat(typeof i,'", and equal to:\n').concat(p(i,4)));let c=0,a="";if((b=l==null?void 0:l.trimCharsBeforeMatching)!=null&&b.some(($,s)=>$.length>1?(c=s,a=$,!0):!1))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_05] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ").concat(c," is longer than 1 character, ").concat(a.length," (equals to ").concat(a,"). Please split it into separate characters and put into array as separate elements."));if(!h||!Array.isArray(h)||Array.isArray(h)&&!h.length||Array.isArray(h)&&h.length===1&&O(h[0])&&!h[0].trim()){if(typeof l.cb=="function"){let s,f=o;if((e==="matchLeftIncl"||e==="matchRight")&&(f+=1),e[5]==="L")for(let d=f;d--;){let E=r[d];if((!l.trimBeforeMatching||l.trimBeforeMatching&&(E!=null&&E.trim()))&&(!((A=l.trimCharsBeforeMatching)!=null&&A.length)||E!==void 0&&!l.trimCharsBeforeMatching.includes(E))){s=d;break}}else if(e.startsWith("matchRight"))for(let d=f;d<r.length;d++){let E=r[d];if((!l.trimBeforeMatching||l.trimBeforeMatching&&E.trim())&&(!((C=l.trimCharsBeforeMatching)!=null&&C.length)||!l.trimCharsBeforeMatching.includes(E))){s=d;break}}if(s===void 0)return!1;let y=r[s],m=s+1,I="";return m&&m>0&&(I=r.slice(0,m)),e[5]==="L"||s&&s>0&&(I=r.slice(s)),l.cb(y,I,s)}let $="";throw i||($=" More so, the whole options object, the fourth input argument, is missing!"),new Error("string-match-left-right/".concat(e,'(): [THROW_ID_06] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!').concat($))}for(let $=0,s=h.length;$<s;$++){u=typeof h[$]=="function";let f=h[$],y,m,I="",d=o;e==="matchRight"?d+=1:e==="matchLeft"&&(d-=1);let E=ht(r,d,f,l,u,v=>e[5]==="L"?v-1:v+1);if(E&&u&&typeof f=="function"&&f()==="EOL")return f()&&(!l.cb||l.cb(y,I,m))?f():!1;if(Number.isInteger(E)&&(m=e.startsWith("matchLeft")?E-1:E+1,e[5]==="L"?I=r.slice(0,E):I=r.slice(m)),m<0&&(m=void 0),r[m]&&(y=r[m]),Number.isInteger(E)&&(!l.cb||l.cb(y,I,m)))return f}return!1}function xe(e,r,o,n){return $e("matchLeft",e,r,o,n)}function Pe(e,r,o,n){return $e("matchRightIncl",e,r,o,n)}function _e(e,r,o,n){return $e("matchRight",e,r,o,n)}var gt={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function ae(e){var u,c;let r=/^[0-9a-zA-Z]+$/;function o(a){return O(a)&&!a.trim()}if(W(e)){if(!Object.keys(e).length)throw new Error('string-range-expander/expander(): [THROW_ID_02] Input must be a plain object but it\'s been given as a plain object without any keys. However, "from" and "to" settings are obligatory!')}else{let a;throw e===void 0?a="but it is missing completely.":e===null?a="but it was given as null.":a="but it was given as ".concat(typeof e,", equal to:\n").concat(p(e,4),"."),new Error("string-range-expander/expander(): [THROW_ID_01] Input must be a plain object ".concat(a))}if(!H(e.from))throw new Error("string-range-expander/expander(): [THROW_ID_03] The input's \"from\" value resolvedOpts.from, is not a number! It's been given as ".concat(typeof e.from,", equal to ").concat(p(e.from)));if(!H(e.to))throw new Error("string-range-expander/expander(): [THROW_ID_04] The input's \"to\" value resolvedOpts.to, is not a number! It's been given as ".concat(typeof e.to,", equal to ").concat(p(e.to)));if(e!=null&&e.str&&!e.str[e.from]&&e.from!==e.to)throw new Error('string-range-expander/expander(): [THROW_ID_05] The given input string resolvedOpts.str ("'.concat(e.str,'") must contain the character at index "from" ("').concat(e.from,'")'));if(e!=null&&e.str&&!e.str[e.to-1])throw new Error('string-range-expander/expander(): [THROW_ID_06] The given input string, resolvedOpts.str ("'.concat(e.str,'") must contain the character at index before "to" ("').concat(e.to-1,'")'));if(e.from>e.to)throw new Error('string-range-expander/expander(): [THROW_ID_07] The given "from" index, "'.concat(e.from,'" is greater than "to" index, "').concat(e.to,"\". That's wrong!"));if(e.extendToOneSide===null||O(e.extendToOneSide)&&e.extendToOneSide!=="left"&&e.extendToOneSide!=="right"||!O(e.extendToOneSide)&&e.extendToOneSide!==void 0&&e.extendToOneSide)throw new Error('string-range-expander/expander(): [THROW_ID_08] The options value "extendToOneSide" is not recognisable! It\'s set to: "'.concat(e.extendToOneSide,'" (').concat(typeof e.extendToOneSide,'). It has to be either Boolean "false" or one of strings: "left" or "right"'));if(e!=null&&e.ifLeftSideIncludesThisThenCropTightly&&!O(e.ifLeftSideIncludesThisThenCropTightly))throw new Error('string-range-expander/expander(): [THROW_ID_09] The option "ifLeftSideIncludesThisThenCropTightly", is not a string! It\'s been given as '.concat(typeof e.ifLeftSideIncludesThisThenCropTightly,", equal to ").concat(p(e.ifLeftSideIncludesThisThenCropTightly)));if(e!=null&&e.ifLeftSideIncludesThisCropItToo&&!O(e.ifLeftSideIncludesThisCropItToo))throw new Error('string-range-expander/expander(): [THROW_ID_10] The option "ifLeftSideIncludesThisCropItToo", is not a string! It\'s been given as '.concat(typeof e.ifLeftSideIncludesThisCropItToo,", equal to ").concat(p(e.ifLeftSideIncludesThisCropItToo)));if(e!=null&&e.ifRightSideIncludesThisThenCropTightly&&!O(e.ifRightSideIncludesThisThenCropTightly))throw new Error('string-range-expander/expander(): [THROW_ID_11] The option "ifRightSideIncludesThisThenCropTightly", is not a string! It\'s been given as '.concat(typeof e.ifRightSideIncludesThisThenCropTightly,", equal to ").concat(p(e.ifRightSideIncludesThisThenCropTightly)));if(e!=null&&e.ifRightSideIncludesThisCropItToo&&!O(e.ifRightSideIncludesThisCropItToo))throw new Error('string-range-expander/expander(): [THROW_ID_12] The option "ifRightSideIncludesThisCropItToo", is not a string! It\'s been given as '.concat(typeof e.ifRightSideIncludesThisCropItToo,", equal to ").concat(p(e.ifRightSideIncludesThisCropItToo)));let n=R(R({},gt),e),i=n.str,l=n.from,h=n.to;if(n.extendToOneSide!=="right"&&(o(i[l-1])&&(o(i[l-2])||n.ifLeftSideIncludesThisCropItToo.includes(i[l-2]))||i[l-1]&&n.ifLeftSideIncludesThisCropItToo.includes(i[l-1])||n.wipeAllWhitespaceOnLeft&&o(i[l-1]))){for(let a=l;a--;)if(!n.ifLeftSideIncludesThisCropItToo.includes(i[a])){if(i[a].trim()){n.wipeAllWhitespaceOnLeft||n.ifLeftSideIncludesThisCropItToo.includes(i[a+1])?l=a+1:l=a+2;break}else if(a===0){n.wipeAllWhitespaceOnLeft?l=0:l=1;break}}}if(n.extendToOneSide!=="left"&&(o(i[h])&&(n.wipeAllWhitespaceOnRight||o(i[h+1]))||n.ifRightSideIncludesThisCropItToo.includes(i[h]))){for(let a=h,b=i.length;a<b;a++)if(!n.ifRightSideIncludesThisCropItToo.includes(i[a])){if(i[a].trim()){n.wipeAllWhitespaceOnRight||n.ifRightSideIncludesThisCropItToo.includes(i[a-1])?h=a:h=a-1;break}else if(a===i.length-1){n.wipeAllWhitespaceOnRight?h=i.length:h=i.length-1;break}}}return(n.extendToOneSide!=="right"&&O(n.ifLeftSideIncludesThisThenCropTightly)&&n.ifLeftSideIncludesThisThenCropTightly&&(i[l-2]&&n.ifLeftSideIncludesThisThenCropTightly.includes(i[l-2])||i[l-1]&&n.ifLeftSideIncludesThisThenCropTightly.includes(i[l-1]))||n.extendToOneSide!=="left"&&O(n.ifRightSideIncludesThisThenCropTightly)&&n.ifRightSideIncludesThisThenCropTightly&&(i[h+1]&&n.ifRightSideIncludesThisThenCropTightly.includes(i[h+1])||i[h]&&n.ifRightSideIncludesThisThenCropTightly.includes(i[h])))&&(n.extendToOneSide!=="right"&&o(i[l-1])&&!n.wipeAllWhitespaceOnLeft&&(l-=1),n.extendToOneSide!=="left"&&o(i[h])&&!n.wipeAllWhitespaceOnRight&&(h+=1)),n.addSingleSpaceToPreventAccidentalConcatenation&&((u=i[l-1])!=null&&u.trim())&&((c=i[h])!=null&&c.trim())&&(!n.ifLeftSideIncludesThisThenCropTightly&&!n.ifRightSideIncludesThisThenCropTightly||!((!n.ifLeftSideIncludesThisThenCropTightly||n.ifLeftSideIncludesThisThenCropTightly.includes(i[l-1]))&&(!n.ifRightSideIncludesThisThenCropTightly||i[h]&&n.ifRightSideIncludesThisThenCropTightly.includes(i[h]))))&&(r.test(i[l-1])||r.test(i[h]))?[l,h," "]:[l,h]}var He="6.2.2";var mt=He;function Fe(e){return e>96&&e<123||e>64&&e<91||e>47&&e<58||e===95}function Z(e){return e!==void 0&&Fe(e.charCodeAt(0))}var ke={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 $t(e,r){var Te,ye;let o=Date.now();if(!O(e))throw e===void 0?new Error("html-crush/crush(): [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error('html-crush/crush(): [THROW_ID_02] the first input argument must be string! It was given as "'.concat(typeof e,'", equal to:\n').concat(p(e,4)));if(r&&!W(r))throw new Error("html-crush/crush(): [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ".concat(typeof r,", equal to ").concat(p(r,4)));if(r&&Array.isArray(r.breakToTheLeftOf)&&r.breakToTheLeftOf.length){for(let L=0,t=r.breakToTheLeftOf.length;L<t;L++)if(!O(r.breakToTheLeftOf[L]))throw new TypeError("html-crush/crush(): [THROW_ID_04] the resolvedOpts.breakToTheLeftOf array contains non-string elements! For example, element at index ".concat(L,' is of a type "').concat(typeof r.breakToTheLeftOf[L],'" and is equal to:\n').concat(p(r.breakToTheLeftOf[L],4)))}let n=new Ve({limitToBeAddedWhitespace:!0}),i=R(R({},ke),r);typeof i.removeHTMLComments=="boolean"&&(i.removeHTMLComments=i.removeHTMLComments?1:0);let l="";Array.isArray(i.breakToTheLeftOf)&&i.breakToTheLeftOf.length&&(l=[...new Set(i.breakToTheLeftOf.map(L=>L[0]))].join(""));let h={removeHTMLComments:!1,removeCSSComments:!1},u=Array.isArray(i.mindTheInlineTags)?i.mindTheInlineTags:[],c=new Set(u),a=!!u.length&&u.every(L=>O(L)&&!!L.length&&![...L].some(t=>!Z(t))),b=new Map,A=Array.isArray(i.breakToTheLeftOf)&&!!i.breakToTheLeftOf.length&&i.breakToTheLeftOf.every(O)&&!(i.breakToTheLeftOf.length===1&&!i.breakToTheLeftOf[0].trim());if(A)for(let L of i.breakToTheLeftOf){if(!L.length)continue;let t=b.get(L[0]);t?t.push(L):b.set(L[0],[L])}function C(L){if(!A)return!!Pe(e,L,i.breakToTheLeftOf);let t=b.get(e[L]);if(t===void 0)return!1;for(let _=0,g=t.length;_<g;_++)if(e.startsWith(t[_],L))return!0;return!1}function $(L,t){if(!a)return!!_e(e,L,i.mindTheInlineTags,we(R({},t?{trimCharsBeforeMatching:"/"}:{}),{cb:M=>!M||!Z(M)}));let _=L+1;if(t)for(;e[_]==="/";)_++;let g=_;for(;g<N&&Fe(e.charCodeAt(g));)g++;return g>_&&c.has(e.slice(_,g))}let s=null,f=null,y=!1,m=0,I=0,d=!1,E=!1,v=null,V=null,P=null,J=null,w,T=null,S=null,D=null,F=null,G=null,ee=null,K=">};",Q="<",We="!",Be=">",je="<",pe="{},:;<>~+",ue=pe,fe=pe,Y=!0,N=e.length,te=0;for(;te<N&&k(e[te]);)te++;let Ue=Math.floor(N/2),de=.01,be;i.reportProgressFunc&&(be=Math.floor(i.reportProgressFuncTo-(i.reportProgressFuncTo-i.reportProgressFuncFrom)*de-i.reportProgressFuncFrom));let U,ne=0,x="\n";if(e.includes("\r\n")?x="\r\n":e.includes("\r")&&(x="\r"),N){for(let t=0;t<N;t++){if(i.reportProgressFunc&&(N>1e3&&N<2e3?t===Ue&&i.reportProgressFunc(Math.floor((i.reportProgressFuncTo-i.reportProgressFuncFrom)/2)):N>=2e3&&(U=i.reportProgressFuncFrom+Math.floor(t/N*(be||1)),U!==ne&&(ne=U,i.reportProgressFunc(U)))),I++,!w&&d&&e[t]==="}"&&e[t-1]==="}"&&(m+1>=i.lineLengthLimit?(n.push(t,t,x),m=0):(T=t,S=t,D=" ")),w&&typeof w=="number"&&t>=w&&(w=void 0),J!==null&&e[t]==="<"&&e.startsWith("<\/script",t)&&!q(e[t+8])){if((i.removeIndentations||i.removeLineBreaks)&&t>0&&e[~-t]&&k(e[~-t])){for(let g=t;g--;)if(e[g]==="\n"||e[g]==="\r"||!k(e[g])){g+1<t&&n.push(g+1,t);break}}J=null,w=!1,t+=8;continue}if(!w&&!d&&e[t]==="<"&&e.startsWith("<script",t)&&!q(e[t+7])){J=t,w=!0;let g="";(i.removeLineBreaks||i.removeIndentations)&&f!==null&&(f>0&&(g=x),n.push(f,t,g)),f=null,s=null}if(G!==null&&F===null&&!Z(e[t])){F=e.slice(G,t);let g=B(e,~-t),M=B(e,t);if(typeof g=="number"&&e[g]===">"&&k(e[t])&&M)n.push(t,M);else if(g&&e[g]==="/"&&e[B(e,g)]===">"){k(e[t])&&M&&n.push(t,M);let Ee=B(e,g+1);e[g+1]!==">"&&Ee&&n.push(g+1,Ee)}}if(!w&&!d&&!v&&e[~-t]==="<"&&G===null)if(Z(e[t]))G=t;else{let g=B(e,~-t),M=B(e,g);e[g]==="/"&&Z(e[M]||"")&&(G=M)}if(!w&&(d||v)&&V!==null&&e[t]==="*"&&e[t+1]==="/"&&([T,S]=ae({str:e,from:V,to:t+2,ifLeftSideIncludesThisThenCropTightly:ue||"",ifRightSideIncludesThisThenCropTightly:fe||""}),V=null,T!=null?n.push(T,S):(m+=1,t+=1),w=t+2),!w&&(d||v)&&V===null&&e[t]==="/"&&e[t+1]==="*"&&(h.removeCSSComments||(h.removeCSSComments=!0),i.removeCSSComments&&(V=t)),E&&e.startsWith("![endif",t+1)&&(E=!1),!w&&!d&&!v&&P!==null){let g;e.startsWith("-->",t)?g=3:e[t]===">"&&e[t-1]==="]"&&(g=1),g&&([T,S]=ae({str:e,from:P,to:t+g}),P=null,T!=null?i.lineLengthLimit&&I-(S-T)>=i.lineLengthLimit?(n.push(T,S,x),I=-g):(n.push(T,S),I-=S-T):(m+=g-1,t+=g-1),w=t+g)}if(!w&&!d&&!v&&e[t]==="<"&&(e.startsWith("<!--",t)||i.removeHTMLComments===2&&e.startsWith("<![endif",t))&&P===null&&(e.startsWith("[if",t+4)?(E||(E=!0),i.removeHTMLComments===2&&(P=t)):i.removeHTMLComments&&(!E||i.removeHTMLComments===2)&&(P=t),h.removeHTMLComments||(h.removeHTMLComments=!0)),!w&&d&&V===null&&e[t]==="<"&&e.startsWith("</style",t)&&!q(e[t+7])?d=!1:!w&&!d&&V===null&&e[t]==="<"&&e.startsWith("<style",t)&&!q(e[t+6])&&(d=!0,(i.removeLineBreaks||i.removeIndentations)&&i.breakToTheLeftOf.includes("<style")&&e.startsWith(' type="text/css">',t+6)&&e[t+24]&&n.push(t+23,t+23,x)),!w&&!v&&"\"'".includes(e[t])&&e.endsWith("style=",t)&&(v=t),!w&&k(e[t]))f===null&&(f=t);else if(!w&&!((d||v)&&V!==null)){if(f!==null){if(i.removeLineBreaks&&(m+=1),Y)Y=!1,(i.removeIndentations||i.removeLineBreaks)&&n.push(0,t);else if(i.removeIndentations&&!i.removeLineBreaks&&(!y&&s!==null&&t>s?n.push(s+1,t):f+1<t&&(e.endsWith("]>",f)||e.endsWith("-->",f)||e.startsWith("<![",t)||e.startsWith("<!--<![",t)?n.push(f,t):e[f]===" "?n.push(f+1,t):e[~-t]===" "?n.push(f,~-t):n.push(f,t," "))),i.removeLineBreaks||v){if(l.includes(e[t])&&C(t)){!("\r\n".includes(e[~-t])&&f===~-t)&&!(e[~-t]==="\n"&&e[t-2]==="\r"&&f===t-2)&&n.push(f,t,x),T=null,S=null,D=null,f=null,m=1;continue}let g=" ";if(!(e[t]==="<"&&$(t,!1))){if(e[~-f]&&Be.includes(e[~-f])&&je.includes(e[t])||(d||v)&&V===null&&(ue.includes(e[~-f])||fe.includes(e[t]))||e[t]==="!"&&e.startsWith("!important",t)&&!E||v&&(e[~-f]==="'"||e[~-f]==='"')||e[~-f]==="}"&&e.startsWith("</style",t)||e[t]===">"&&("'\"".includes(e[se(e,t)])||e[B(e,t)]==="<")||e[t]==="/"&&e[B(e,t)]===">"){g="";let M=e[t]==="/"&&e[t+1]===">"?B(e,t):null;M&&M>t+1&&(n.push(t+1,M),m-=M-t+1)}}d&&e[t]==="}"&&f&&e[f-1]==="}"&&(g=" "),g!=null&&g.length&&(m+=1),i.lineLengthLimit?m>=i.lineLengthLimit||!e[t+1]||e[t]===">"||e[t]==="/"&&e[t+1]===">"?((m>i.lineLengthLimit||m===i.lineLengthLimit&&((Te=e[t+1])!=null&&Te.trim())&&!K.includes(e[t])&&!Q.includes(e[t+1]))&&(g=x,m=1),(m>i.lineLengthLimit||!(g===" "&&t===f+1))&&(n.push(f,t,g),s=null),T=null,S=null,D=null):(T===null||f<T)&&(T=f,S=t,D=g):t===f+1&&g===" "||n.push(f,t,g)}f=null,y||(y=!0)}else Y&&(Y=!1),i.removeLineBreaks&&(m+=1);y||(y=!0)}if(!w&&!Y&&t!==0&&i.removeLineBreaks&&(i.lineLengthLimit||l)&&!(e[t]==="<"&&e.startsWith("</a",t))){if(l&&C(t)&&te<t&&(e[t]!=="<"||!e.startsWith("<![endif]",t)||!xe(e,t,"<!--"))){n.push(t,t,x),T=null,S=null,D=null,m=1;continue}else if(i.lineLengthLimit&&m<=i.lineLengthLimit){if(!e[t+1]||Q.includes(e[t])&&!We.includes(e[t])||K.includes(e[t])||k(e[t])){if(T!==null&&S!==null&&(T!==S||D!=null&&D.length)){let g=D;!k(e[t])&&((ye=e[t+1])!=null&&ye.trim())&&m+(D?D.length:0)>i.lineLengthLimit&&(g=x),(m+(g?g.length:0)>i.lineLengthLimit||!(g===" "&&S===T+1&&e[T]===" "))&&(e[~-T]==="}"&&e[S]==="{"||(n.push(T,S,g),s=null))}!k(e[t])&&(Q.includes(e[t])||e[~-t]&&K.includes(e[~-t]))&&O(ee)&&(!F||!c.has(F))&&!(e[t]==="<"&&$(t,!1))&&!(e[t]==="<"&&$(t,!0))?(T=t,S=t,D=null):V===null&&T!==null&&(v||!i.mindTheInlineTags||!Array.isArray(i.mindTheInlineTags)||Array.isArray(i.mindTheInlineTags.length)&&!i.mindTheInlineTags.length||!O(F)||Array.isArray(i.mindTheInlineTags)&&i.mindTheInlineTags.length&&O(F)&&!c.has(F))&&!(e[t]==="<"&&$(t,!0))&&(T=null,S=null,D=null)}}else if(i.lineLengthLimit)if(Q.includes(e[t])&&!(e[t]==="<"&&$(t,!0)))if(T!==null&&S!==null&&(T!==S||D!=null&&D.length)){let g=D!=null&&D.length?D.length:0;m-(S-T-g)-1>i.lineLengthLimit||(n.push(T,S,D),m-(S-T-g)-1===i.lineLengthLimit&&(n.push(t,t,x),m=0),T=null,S=null,D=null)}else n.push(t,t,x),m=0;else e[t+1]&&K.includes(e[t])&&O(F)&&Array.isArray(i.mindTheInlineTags)&&i.mindTheInlineTags.length&&!c.has(F)?T!==null&&S!==null&&(T!==S||D!=null&&D.length)||(n.push(t+1,t+1,x),m=0):k(e[t])||e[t+1]||T!==null&&S!==null&&(T!==S||D!=null&&D.length)&&n.push(T,S,x)}if(!w&&!Y&&i.removeLineBreaks&&i.lineLengthLimit&&m>=i.lineLengthLimit&&T!==null&&S!==null&&!K.includes(e[t])&&!Q.includes(e[t])&&!"/".includes(e[t])&&!(m===i.lineLengthLimit&&e[t+1]&&!e[t+1].trim())){let g=x;e[t+1]&&!e[t+1].trim()&&m===i.lineLengthLimit&&(g=D),g===x&&!e[~-T].trim()&&se(e,T)&&(T=se(e,T)+1),n.push(T,S,g),m=t-S,e[t].length&&(m+=1),T=null,S=null,D=null}if((!w&&e[t]==="\n"||e[t]==="\r"&&(!e[t+1]||e[t+1]&&e[t+1]!=="\n"))&&(s=t,y&&(y=!1),!i.removeLineBreaks&&f!==null&&f<t&&e[t+1]&&e[t+1]!=="\r"&&e[t+1]!=="\n"&&n.push(f,t)),e[t+1]||(d&&V!==null?n.push([...ae({str:e,from:V,to:t,ifLeftSideIncludesThisThenCropTightly:ue||"",ifRightSideIncludesThisThenCropTightly:fe||""})]):f&&e[t]!=="\n"&&e[t]!=="\r"?n.push(f,t+1):f&&(e[t]==="\r"&&e[t+1]==="\n"||e[t]==="\n"&&e[t-1]!=="\r")&&n.push(f,t)),!w&&v&&v<t&&e[v]===e[t]&&(v=null),!w&&!d&&e[t]==="<"&&e.startsWith("<pre",t)&&!q(e[t+4])){let g=e.indexOf("</pre",t+5);g>0&&(w=g)}if(!w&&!d&&e[t]==="<"&&e.startsWith("<code",t)&&!q(e[t+5])){let g=e.indexOf("</code",t+5);g>0&&(w=g)}if(!w&&e[t]==="<"&&e.startsWith("<![CDATA[",t)){let g=e.indexOf("]]>",t+9);g>0&&(w=g)}if(!w&&!d&&!v&&G!==null&&e[t]===">"&&(e[B(e,t)]==="<"&&(ee=F),G=null,F=null),e[t]==="<"&&ee!==null&&(ee=null),!w&&d&&e[t]==="{"&&e[t+1]==="{"){let g=e.indexOf("}}",t+2);g!==-1&&(w=g+2)}let _=!0}let L=n.current();if(L){let t=i.reportProgressFuncTo-(i.reportProgressFuncTo-i.reportProgressFuncFrom)*de,_=ve(e,L,M=>{i.reportProgressFunc&&N>=2e3&&(U=Math.floor(t+(i.reportProgressFuncTo-t)*(M/100)),U!==ne&&(ne=U,i.reportProgressFunc(U)))}),g=_.length;return{log:{timeTakenInMilliseconds:Date.now()-o,originalLength:N,cleanedLength:g,bytesSaved:Math.max(N-g,0),percentageReducedOfOriginal:N?Math.round(Math.max(N-g,0)*100/N):0},ranges:L,applicableOpts:h,result:_}}}return{log:{timeTakenInMilliseconds:Date.now()-o,originalLength:N,cleanedLength:N,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:h,ranges:null,result:e}}return Xe(pt);})();
10
+ "use strict";var htmlCrush=(()=>{var ue=Object.defineProperty,$t=Object.defineProperties,bt=Object.getOwnPropertyDescriptor,Tt=Object.getOwnPropertyDescriptors,yt=Object.getOwnPropertyNames,We=Object.getOwnPropertySymbols;var He=Object.prototype.hasOwnProperty,St=Object.prototype.propertyIsEnumerable;var Te=(e,n,t)=>n in e?ue(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,U=(e,n)=>{for(var t in n||(n={}))He.call(n,t)&&Te(e,t,n[t]);if(We)for(var t of We(n))St.call(n,t)&&Te(e,t,n[t]);return e},le=(e,n)=>$t(e,Tt(n));var Et=(e,n)=>{for(var t in n)ue(e,t,{get:n[t],enumerable:!0})},Ct=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of yt(n))!He.call(e,l)&&l!==t&&ue(e,l,{get:()=>n[l],enumerable:!(r=bt(n,l))||r.enumerable});return e};var At=e=>Ct(ue({},"__esModule",{value:!0}),e);var oe=(e,n,t)=>Te(e,typeof n!="symbol"?n+"":n,t);var Yt={};Et(Yt,{crush:()=>Kt,defaults:()=>ve,version:()=>zt});function Ot(){let e=[],n=0,t=!1;return{append(r){return t?!1:n+r.length>1999?(e.push("\u2026"),n+=1,t=!0,!1):(e.push(r),n+=r.length,!0)},result(){return e.join("")},stopped(){return t}}}function wt(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function fe(e,n){if(e.append('"')){for(let t=0;t<n.length&&!e.stopped();t+=1){let r=n.charCodeAt(t);r===34?e.append('\\"'):r===92?e.append("\\\\"):r===8?e.append("\\b"):r===9?e.append("\\t"):r===10?e.append("\\n"):r===12?e.append("\\f"):r===13?e.append("\\r"):r<32||r===8232||r===8233||r>=55296&&r<=57343?e.append(wt(r)):e.append(n[t])}e.append('"')}}function Lt(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function Fe(e,n){e.append("Symbol(");let t=String(n);t.length>8&&fe(e,t.slice(7,-1)),e.append(")")}function je(e,n){typeof n=="symbol"?Fe(e,n):fe(e,String(n))}function g(e,n=0){let t=Ot(),r=n===4?4:0,l=new WeakSet,i=0;function s(f){r&&t.append(" ".repeat(f*r))}function u(f,C){f&&t.append(","),r&&(t.append("\n"),s(C+1))}function c(f,C,d){r&&C&&(t.append("\n"),s(d)),t.append(f)}function h(f,C){Object.prototype.hasOwnProperty.call(f,"value")?N(f.value,C):t.append(Lt(f))}function E(f,C){let d;try{d=Reflect.getOwnPropertyDescriptor(f,"length")}catch(a){t.append("[Uninspectable]");return}let b=d==null?void 0:d.value;if(!Number.isSafeInteger(b)||b<0){t.append("[Uninspectable]");return}t.append("[");let m=!1;for(let a=0;a<b&&!t.stopped();a+=1){if(u(m,C),m=!0,i>=50){t.append("[MaxEntries]");break}i+=1;let R;try{R=Reflect.getOwnPropertyDescriptor(f,String(a))}catch($){t.append("[Uninspectable]");continue}R!=null&&R.enumerable?h(R,C+1):t.append("[Empty]")}c("]",m,C)}function A(f,C){let d;try{d=Reflect.ownKeys(f)}catch(m){t.append("[Uninspectable]");return}t.append("{");let b=!1;for(let m of d){if(t.stopped())break;if(i>=50){u(b,C),b=!0,fe(t,"\u2026"),t.append(r?": ":":"),t.append("[MaxEntries]");break}i+=1;let a;try{a=Reflect.getOwnPropertyDescriptor(f,m)}catch(R){u(b,C),b=!0,je(t,m),t.append(r?": ":":"),t.append("[Uninspectable]");continue}a!=null&&a.enumerable&&(u(b,C),b=!0,je(t,m),t.append(r?": ":":"),h(a,C+1))}c("}",b,C)}function p(f,C){if(l.has(f)){t.append("[Circular]");return}if(C>=5){t.append("[MaxDepth]");return}let d;try{d=Array.isArray(f)}catch(b){t.append("[Uninspectable]");return}l.add(f);try{d?E(f,C):A(f,C)}finally{l.delete(f)}}function N(f,C){f===null?t.append("null"):typeof f=="string"?fe(t,f):typeof f=="number"?t.append(Object.is(f,-0)?"-0":String(f)):typeof f=="boolean"?t.append(f?"true":"false"):typeof f>"u"?t.append("undefined"):typeof f=="bigint"?t.append("".concat(f,"n")):typeof f=="symbol"?Fe(t,f):typeof f=="function"?t.append("[Function]"):p(f,C)}try{return N(e,0),t.result()}catch(f){return"[Uninspectable]"}}var vt=["_16_0_a_0_4_0_5_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_8_4l_1_11_2_0_","6_14_1z_q_4_3_19_16_z_1_1_2q_1_0_f_1_7_1_a_2_2_0_g_0_1_t_t_2g_b_0_o_w_9_1_4_0_5_l_4_0_9_0_3_0_n_o_7_","a_5_n_1_6_g_15_1m_1h_3_0_i_0_7_9_f_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_e_1_a_0_8_5_4_1_2_l_1_6","_1_1_1_1_1_1_v_3_1_0_j_2_g_8_1_2_1_l_1_6_1_1_1_4_3_0_i_0_f_1_n_0_b_7_2_1_2_l_1_6_1_1_1_4_3_0_u_1_1_2","_f_0_h_0_1_5_3_2_1_3_3_1_1_0_1_1_3_1_3_2_3_b_m_0_1g_7_1_2_1_m_1_f_3_0_q_2_1_1_2_1_u_0_4_7_1_2_1_m_1_","9_1_4_3_0_u_2_1_1_f_1_h_8_1_2_1_14_2_0_g_0_5_2_8_2_o_5_5_h_3_n_1_8_1_0_2_6_1m_1b_1_1_c_6_1m_1_1_0_1_","4_1_n_1_0_1_9_1_1_9_0_2_4_1_0_l_3_w_0_1r_7_1_z_r_4_37_16_k_0_g_5_4_3_3_0_3_1_7_2_4_c_c_0_h_11_1_0_5_","0_2_16_1_98_1_3_2_6_1_0_1_3_2_14_1_3_2_w_1_3_2_6_1_0_1_3_2_e_1_1k_1_3_2_1u_11_f_g_2d_2_5_3_h7_2_g_1_","p_5_22_6_7_7_h_d_i_e_h_e_c_1_2_f_1f_z_0_4_0_1v_2g_7_4_2_x_1_0_5_1x_a_u_1d_t_2_4_b_17_4_p_1i_m_9_1g_2","a_0_2l_1a_h_7_1i_t_d_1_a_17_q_z_15_2_a_z_2_a_5_16_2_2_15_3_1_5_1_1_3_0_5_5b_1s_7p_2_5_2_11_2_5_2_7_1","_0_1_0_1_0_1_u_2_1g_1_6_1_0_3_2_1_6_3_3_2_5_4_c_5_2_1_6_38_0_d_0_g_c_2t_0_4_0_2_9_1_0_3_4_6_0_1_0_1_","0_1_3_1_a_2_3_5_4_4_0_1g_1_22j_6c_6_3_3_1_c_11_1_0_5_0_2_1j_7_0_g_m_9_6_1_6_1_6_1_6_1_6_1_6_1_6_1_6_","28_0_d1_1_16_4_5_1_4_2d_6_2_1_2h_1_3_5_16_1_2l_h_v_1c_f_e8_533_1s_h3g_1v_19_2_7g_3_f_a_1_k_1a_g_u_2_","1x_1d_8_2_2u_2_29_k_g_1_2_1_3_1_m_t_1f_e_1d_1q_5_3_0_1_1_b_r_a_m_p_s_7_1a_s_0_g_4_1_9_a_4_1_14_n_2_1","_7_k_m_3_0_3_1d_1_0_3_1_2_4_2_0_1_0_o_2_2_a_7_2_c_5_2_5_2_5_9_6_1_6_1_16_1_d_6_36_t_8mb_c_m_4_1c_6is","_a5_2_2x_12_6_c_4_5_0_1_9_1_c_1_4_1_0_1_1_1_1_1_2z_x_a2_i_1r_2_1h_14_b_38_4_1_3q_10_p_6_p_b_2g_3_5_2","_5_2_5_2_2_z_b_1_p_1_i_1_1_1_e_2_d_y_3e_at_s_3_1c_1b_v_d_j_1_7_6_11_a_t_2_z_4_7_1c_4d_i_z_4_z_4_13_8","_1f_c_a_1_e_1_6_1_1_1_a_1_e_1_6_1_1_3_1f_c_8m_9_l_a_7_o_5_1_15_1_8_1x_5_2_0_1_17_1_1_3_0_2_m_a_m_9_u","_1t_i_1_1_a_l_a_p_6_p_12_1j_6_1_1s_0_f_3_1_2_1_s_16_s_3_s_z_7_1_r_r_1h_a_l_a_i_d_h_32_20_1j_1e_d_1e_","d_z_12_r_9_m_6y_15_6_1_g_5_1k_s_a_0_8_l_16_h_1a_k_r_m_c_1g_1l_1_2_0_d_18_w_o_q_z_t_0_2_0_8_y_3_0_c_1","b_e_3_l_0_1_0_z_h_1_o_j_1_1r_6_1_0_1_3_1_e_1_9_7_1a_12_7_2_1_2_l_1_6_1_1_1_4_3_0_i_0_c_4_u_9_1_0_2_0","_1_11_1_0_p_0_1_0_18_1g_i_3_k_2_u_1b_k_1_1_0_54_1a_15_3_10_1b_k_0_1n_16_d_0_1z_q_11_6_55_17_38_1r_v_","7_2_0_2_7_1_1_1_n_f_0_1_0_2m_7_2_12_g_0_1_0_s_0_a_13_7_0_l_0_b_19_j_0_i_20_5j_w_v_8_1_10_h_0_1d_t_34","_6_1_1_1_11_l_0_p_5_1_1_1_v_e_0_n_17_78_i_f_0_1_c_1_x_3g_0_27_pl_6e_5f_218_2o_f_tr_h_5_p_32y_5_g6_5a","1_t_1cy_fs_7_u_h_26_h_t_i_1b_g_3_v_k_5_i_c0_18_5v_1r_w_o_2_o_18_22_5_0_1u_c_1s_1_1_0_e_1_c_5p1_15_v_","2p_36_6pp_3_1_6_1_1_1_82_f_0_t_2_2_0_e_3_8_az_1s4_2y_5_c_3_8_7_9_4me_2c_1_1y_1_1_2_0_2_1_2_3_1_b_1_0","_1_6_1_1s_1_3_2_7_1_6_1_r_1_3_1_4_1_0_3_6_1_9f_2_o_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_7_1f8_u_6_5","_79_1p_42_18_a_6_g_0_8x_t_i_17_dg_r_6c_t_2_0_5r_u_1_2_1_1_1_6_2_4_9_1_68_6_1_3_1_1_1_e_1_5g_1n_1v_7_","0_xg_3_1_q_1_1_1_0_2_0_1_9_1_3_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1","_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4_1_g_3es_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),ye=vt.slice(1).split("_"),Se=[],Be=127;for(let e=0;e<ye.length;e+=2){let n=Be+1+Number.parseInt(ye[e],36),t=n+Number.parseInt(ye[e+1],36);Se.push([n,t]),Be=t}function It(e){if(Number.isNaN(e)||e<128||e>1114111)return!1;let n=0,t=Se.length-1;for(;n<=t;){let r=n+t>>1,l=Se[r];if(e<l[0])t=r-1;else if(e>l[1])n=r+1;else return!0}return!1}var en=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),Dt=Object.prototype.hasOwnProperty,Ge=Function.prototype.toString,Rt=Ge.call(Object);var tn=Map.prototype.entries,nn=Set.prototype.values;var Ue,rn=(Ue=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:Ue.get,qe,_n=(qe=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:qe.get,Je,ln=(Je=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:Je.get,ze,on=(ze=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:ze.get,sn=RegExp.prototype.test;function xt(e){if(e.length===1){let n=e.charCodeAt(0);return n<55296||n>57343?n:-1}if(e.length===2){let n=e.charCodeAt(0),t=e.charCodeAt(1);if(n>=55296&&n<=56319&&t>=56320&&t<=57343)return(n-55296)*1024+t-56320+65536}return-1}function Ke(e){if(!L(e)||e.length===0||e.length>2)return!1;let n=e.charCodeAt(0);return e.length===1&&n<128?n>64&&n<91||n>96&&n<123:It(xt(e))}function H(e){if(!L(e)||!e)return!1;let n=e.charCodeAt(0);return n<128?n===32||n>8&&n<14:!e[0].trim()}function F(e){var r;if(e==null||typeof e!="object")return!1;let n=Object.getPrototypeOf(e);if(n===null||n===Object.prototype)return!0;let t=Object.getOwnPropertyDescriptor(n,"constructor");return!t||!("value"in t)||typeof t.value!="function"?!1:((r=Object.getOwnPropertyDescriptor(t.value,"prototype"))==null?void 0:r.value)===n&&Ge.call(t.value)===Rt}function L(e){return typeof e=="string"}function Ee(e){return Number.isFinite(e)}function K(e){return Number.isSafeInteger(e)&&e>=0}var an=Date.prototype.getTime;function ce(e){return e!=null}function Ye(e,n){return e!=null&&Dt.call(e,n)}function he(e,n=1){let t="\xA0";function r(i){return i.length<2?i:Array.from(i).reverse().join("")}function l(i,s,u){let c=u?"\n":"\r",h=u?"\r":"\n";if(!i)return i;let E=0,A="";for(let p=0,N=i.length;p<N;p++)(i[p]===c||i[p]===h&&i[p-1]!==c)&&E++,"\r\n".includes(i[p])||i[p]===t?i[p]===t?A+=i[p]:i[p]===c?E<=s&&(A+=i[p],i[p+1]===h&&(A+=i[p+1],p++)):i[p]===h&&(i==null?void 0:i[p-1])!==c&&E<=s&&(A+=i[p]):!i[p+1]&&!E&&(A+=" ");return A}if(typeof e=="string"&&e.length){let i=e.trim();if(i.length===e.length)return e;let s=1;typeof n=="number"&&Number.isInteger(n)&&n>=0&&(s=n);let u="",c="";if(!i)u=e;else if(!e[0].trim()){for(let E=0,A=e.length;E<A;E++)if(e[E].trim()){u=e.slice(0,E);break}}let h=e[e.length-1];if(i&&(h.trim()===""||h===t)){for(let E=e.length;E--;)if(e[E].trim()){c=e.slice(E+1);break}}return"".concat(l(u,s,!1)).concat(i).concat(r(l(r(c),s,!0)))}return e}var Qe={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Nt(e,n){let t,r=0;for(;r<e.length;){let l=r+1;for(;l<e.length&&e[r][0]===e[l][0]&&e[r][1]===e[l][1];)l+=1;if(l-r>1){t||(t=new Map(n.map((u,c)=>[u,c])));let i=t,s=e.slice(r,l).sort((u,c)=>i.get(u)-i.get(c));e.splice(r,s.length,...s)}r=l}return e}function Ce(e,n){var u;if(!Array.isArray(e)||!e.length)return e;let t=n===void 0?!0:F(n);if(n!==void 0&&t&&(n==null?void 0:n.strictlyTwoElementsInRangeArrays)===!0)for(let c=0;c<e.length;c+=1){let h=e[c];if(!Array.isArray(h)||h.length!==2)throw new TypeError("ranges-sort/rSort(): [THROW_ID_01] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, range at index ".concat(c," (").concat(g(h,4),") is ").concat(Array.isArray(h)?"an array with ".concat(h.length," elements"):"not an array","!"));if(!Number.isInteger(h[0])||h[0]<0||!Number.isInteger(h[1])||h[1]<0)throw new TypeError("ranges-sort/rSort(): [THROW_ID_02] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, range at index ".concat(c," (").concat(g(h,4),") does not consist of only natural numbers!"))}else for(let c=0;c<e.length;c+=1){let h=e[c];if(!Array.isArray(h)||!Number.isInteger(h[0])||h[0]<0||!Number.isInteger(h[1])||h[1]<0)throw new TypeError("ranges-sort/rSort(): [THROW_ID_02] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, range at index ".concat(c," (").concat(g(h,4),") does not consist of only natural numbers!"))}if(n!==void 0&&!t)throw new TypeError("ranges-sort/rSort(): [THROW_ID_03] The second argument must be a plain options object; received ".concat(g(n,4)," (type ").concat(typeof n,")!"));let r=Qe.progressFn;if(n!==void 0){let c=n.strictlyTwoElementsInRangeArrays;if(c!==void 0&&typeof c!="boolean")throw new TypeError("ranges-sort/rSort(): [THROW_ID_04] opts.strictlyTwoElementsInRangeArrays must be a boolean; received ".concat(g(c,4)," (type ").concat(typeof c,")!"));if(r=(u=n.progressFn)!=null?u:Qe.progressFn,r!==!1&&r!==null&&typeof r!="function")throw new TypeError("ranges-sort/rSort(): [THROW_ID_05] opts.progressFn must be a function, false, null, or undefined; received ".concat(g(r,4)," (type ").concat(typeof r,")!"))}let l,i;if(r){let c=e.length**2,h=0,E;i=A=>{A!==E&&(E=A,r(A))},l=Array.from(e).sort((A,p)=>(h+=1,i==null||i(Math.min(99,Math.floor(h*100/c))),A[0]===p[0]?A[1]<p[1]?-1:A[1]>p[1]?1:0:A[0]<p[0]?-1:1))}else l=Array.from(e).sort((c,h)=>c[0]===h[0]?c[1]<h[1]?-1:c[1]>h[1]?1:0:c[0]<h[0]?-1:1);let s=l.length>10?Nt(l,e):l;return i==null||i(100),s}var Ae={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Xe(e,n,t){return n===void 0||e===null?e:n===null?null:e===void 0||t?n:e+n}function kt(e,n){var f,C,d;function t(b){return!!b&&typeof b=="object"&&!Array.isArray(b)}if(!Array.isArray(e)||!e.length)return null;if(n&&!t(n))throw new TypeError("ranges-push/rMerge(): [THROW_ID_07] the second input argument must be a plain object. It was given as:\n".concat(g(n,4)," (type ").concat(typeof n,")"));let r=(f=n==null?void 0:n.progressFn)!=null?f:Ae.progressFn,l=(C=n==null?void 0:n.mergeType)!=null?C:Ae.mergeType,i=(d=n==null?void 0:n.joinRangesThatTouchEdges)!=null?d:Ae.joinRangesThatTouchEdges;if(r&&t(r)&&!Object.keys(r).length)r=null;else if(r&&typeof r!="function")throw new TypeError('ranges-push/rMerge(): [THROW_ID_08] resolvedOpts.progressFn must be a function! It was given of a type: "'.concat(typeof r,'", equal to ').concat(g(r,4)));if(l!==1&&l!==2&&l!=="1"&&l!=="2")throw new TypeError('ranges-push/rMerge(): [THROW_ID_09] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof l,'", equal to ').concat(g(l,4)));if(typeof i!="boolean")throw new TypeError('ranges-push/rMerge(): [THROW_ID_10] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof i,'", equal to ').concat(g(i,4)));let s=[];for(let b of e)Array.isArray(b)&&(b[2]!==void 0||b[0]!==b[1])&&s.push([...b]);let u,c,h;r?u=Ce(s,{progressFn:b=>{h=Math.floor(b/5),h!==c&&(c=h,r==null||r(h))}}):u=Ce(s);let E=u.length-1,A=+l==2,p=u.length;for(let b=E;b>=0;b--){let m=u[b];for(r&&b<E&&(h=Math.floor((1-(b+1)/E)*78)+21,h!==c&&h>c&&(c=h,r(h)));p<u.length;){let a=u[p],R=a[0]===m[0];if(!R&&(i?a[0]>m[1]:a[0]>=m[1]))break;let $=a[1]>=m[1];$&&(m[1]=a[1]),a[2]===null?m[2]=null:a[2]!==void 0&&(R||$)&&(m[2]=Xe(m[2],a[2],A&&R)),p+=1}p-=1,u[p]=m}let N=u.length-p;for(let b=0;b<N;b++)u[b]=u[p+b];return u.length=N,u.length?u:null}var ge=Object.freeze({limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1});function Y(e){if(K(e))return e;if(typeof e=="string"&&/^\d+$/.test(e)){let n=Number(e);return K(n)?n:null}return null}function Ze(e){if(!Array.isArray(e))return"a ranges batch must contain only range arrays; received ".concat(g(e,4));if(e.length>3)return"a range must contain at most three values; received ".concat(g(e,4));let[n,t,r]=e;if(n==null&&t==null)return;if(n!=null&&t==null)return"the first index is set (".concat(g(n),") but the second index is not (").concat(g(t),")");if(n==null&&t!=null)return"the second index is set (".concat(g(t),") but the first index is not (").concat(g(n),")");let l=Y(n),i=Y(t);if(l===null)return"the first index must be a natural number, zero, or a digit-only numeric string; received ".concat(g(n,4)," (type ").concat(typeof n,")");if(i===null)return"the second index must be a natural number, zero, or a digit-only numeric string; received ".concat(g(t,4)," (type ").concat(typeof t,")");if(ce(r)&&!L(r)&&!Ee(r))return"the third value must be a string, number, null, or undefined; received ".concat(g(r,4)," (type ").concat(typeof r,")");if(l>i)return"the first index (".concat(l,") must not be greater than the second index (").concat(i,")")}function Vt(e){if(e.length>3)return{error:"expected at most three arguments but received ".concat(e.length),ranges:[]};if(e.length<=1&&Array.isArray(e[0])){let t=e[0];if(!t.length)return{ranges:[]};e=Array.isArray(t[0])?t:[t]}else e=[e];let n=[];for(let t of e){let r=Ze(t);if(r)return{error:r,ranges:[]};let[l,i,s]=t;if(l==null&&i==null)continue;let u=Y(l),c=Y(i);n.push(s!==void 0&&!(L(s)&&!s.length)?[u,c,s]:[u,c])}return{ranges:n}}function Mt(e){return e[2]===void 0&&e[0]===e[1]}function Pt(e){let n=-1;for(let t=0,r=e.length;t<r;t++){let l=e[t];if(Array.isArray(l)){if(l[0]<n)return!1;n=l[0]}}return!0}var et=class{constructor(e){oe(this,"ranges");oe(this,"opts");oe(this,"currentCache",null);if(e!=null&&!F(e))throw new TypeError("ranges-push/Ranges/constructor(): [THROW_ID_01] The options argument must be a plain object. It was given as ".concat(g(e,4)," (type ").concat(typeof e,")."));if(e===void 0){this.opts=ge,this.ranges=[];return}let n=e,t=n.limitToBeAddedWhitespace===void 0?ge.limitToBeAddedWhitespace:n.limitToBeAddedWhitespace,r=n.limitLinebreaksCount===void 0?ge.limitLinebreaksCount:n.limitLinebreaksCount,l=n.mergeType===void 0?ge.mergeType:n.mergeType,i=l==="1"?1:l==="2"?2:l,s;if(typeof t!="boolean"?s="opts.limitToBeAddedWhitespace must be a boolean; received ".concat(g(t,4)," (type ").concat(typeof t,")"):K(r)?i!==1&&i!==2&&(s='opts.mergeType must be 1, 2, "1", or "2"; received '.concat(g(l,4)," (type ").concat(typeof l,")")):s="opts.limitLinebreaksCount must be a natural number or zero; received ".concat(g(r,4)," (type ").concat(typeof r,")"),s)throw new TypeError("ranges-push/Ranges/constructor(): [THROW_ID_02] ".concat(s,"."));let u=Object.freeze({limitToBeAddedWhitespace:t,limitLinebreaksCount:r,mergeType:i});this.opts=u,this.ranges=[]}rangeListsMatch(e,n){if(!Array.isArray(e))return n===null;if(!Array.isArray(n)||e.length!==n[0])return!1;let t=1;for(let r=0,l=e.length;r<l;r++){let i=e[r];if(!Array.isArray(i)){if(n[t++]!==-1||i!==n[t++])return!1;continue}if(i.length!==n[t++])return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[t++])return!1}return t===n.length}snapshotRanges(e){if(!Array.isArray(e))return null;let n=new Array(1+e.length*4);n[0]=e.length;let t=1;for(let r=0,l=e.length;r<l;r++){let i=e[r];if(Array.isArray(i)){n[t++]=i.length;for(let s=0;s<i.length;s++)n[t++]=i[s]}else n[t++]=-1,n[t++]=i}return n.length=t,n}currentStateMatchesSnapshot(){let e=this.currentCache;return e!==null&&this.rangeListsMatch(this.ranges,e.rangesSnapshot)&&this.rangeListsMatch(e.result,e.resultSnapshot)}recordCurrentSnapshot(e){let n=this.snapshotRanges(this.ranges);this.currentCache={rangesSnapshot:n,result:e,resultSnapshot:e===this.ranges?n:this.snapshotRanges(e)}}invalidateCurrentCache(){this.currentCache=null}addValidated(e,n,t){this.invalidateCurrentCache();let r=this.last();if(ce(this.ranges)&&Array.isArray(r)&&e===r[1]){if(r[1]=n,t!==void 0&&!(L(t)&&!t.length)){let i=Xe(r[2],t,this.opts.mergeType===2&&r[0]===e);this.opts.limitToBeAddedWhitespace&&typeof i=="string"&&(i=he(i,this.opts.limitLinebreaksCount)),L(i)&&!i.length||(r[2]=i)}return}this.ranges||(this.ranges=[]);let l=t!==void 0?[e,n,typeof t=="string"&&this.opts.limitToBeAddedWhitespace?he(t,this.opts.limitLinebreaksCount):t]:[e,n];this.ranges.push(l)}add(e,n,t){let r=arguments.length,l;if(r>3)l="expected at most three arguments but received ".concat(r);else if(r===1&&Array.isArray(e)){let i=Array.isArray(e[0])?e:[e];for(let s=0,u=i.length;s<u&&(l=Ze(i[s]),!l);s++);if(!l)for(let s=0,u=i.length;s<u;s++){let[c,h,E]=i[s];c==null&&h==null||this.addValidated(Y(c),Y(h),L(E)&&!E.length?void 0:E)}}else{if(e==null&&n==null)return;if(e!=null&&n==null)l="the first index is set (".concat(g(e),") but the second index is not (").concat(g(n),")");else if(e==null&&n!=null)l="the second index is set (".concat(g(n),") but the first index is not (").concat(g(e),")");else{let i=Y(e),s=Y(n);i===null?l="the first index must be a natural number, zero, or a digit-only numeric string; received ".concat(g(e,4)," (type ").concat(typeof e,")"):s===null?l="the second index must be a natural number, zero, or a digit-only numeric string; received ".concat(g(n,4)," (type ").concat(typeof n,")"):ce(t)&&!L(t)&&!Ee(t)?l="the third value must be a string, number, null, or undefined; received ".concat(g(t,4)," (type ").concat(typeof t,")"):i>s?l="the first index (".concat(i,") must not be greater than the second index (").concat(s,")"):this.addValidated(i,s,L(t)&&!t.length?void 0:t)}}if(l)throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_03] ".concat(l,"."))}push(e,n,t){this.add.apply(this,arguments)}current(){var e,n;if(this.currentStateMatchesSnapshot())return(n=(e=this.currentCache)==null?void 0:e.result)!=null?n:null;if(Array.isArray(this.ranges)&&this.ranges.length){this.ranges=kt(this.ranges,this.opts.mergeType===1?void 0:{mergeType:2});let t=this.ranges;return t&&this.opts.limitToBeAddedWhitespace&&(t=t.map(r=>typeof r[2]=="string"?[r[0],r[1],he(r[2],this.opts.limitLinebreaksCount)]:r)),this.recordCurrentSnapshot(t),t}return this.recordCurrentSnapshot(null),null}firstCovers(e){if(!K(e))throw new TypeError("ranges-push/Ranges/firstCovers(): [THROW_ID_04] the input argument must be a natural number or zero! It was given as ".concat(g(e,4)," (type ").concat(typeof e,")"));if(!Array.isArray(this.ranges)||!this.ranges.length)return!1;let n=Pt(this.ranges)?this.ranges:this.ranges.filter(r=>Array.isArray(r)).slice().sort((r,l)=>r[0]-l[0]||r[1]-l[1]),t=null;for(let r=0,l=n.length;r<l;r++){let i=n[r];if(!(!Array.isArray(i)||Mt(i))){if(t===null){if(i[0]!==0)return!1;t=i[1]}else{if(i[0]>t)break;i[1]>t&&(t=i[1])}if(t>=e)return!0}}return t!==null&&t>=e}wipe(){this.ranges=[],this.invalidateCurrentCache()}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])){let n=Vt([e]);if(n.error)throw new TypeError("ranges-push/Ranges/replace(): [THROW_ID_06] ".concat(n.error,"."));this.ranges=n.ranges,this.invalidateCurrentCache()}else throw new Error("ranges-push/Ranges/replace(): [THROW_ID_05] Single range was given but we expected array of arrays! The first element, ".concat(g(e[0],4)," should be an array."));else this.ranges=[],this.invalidateCurrentCache()}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};function Z(e){return e===32||e>=9&&e<=13||e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function tt(e,n){return n==null?0:typeof n!="number"||!Number.isInteger(n)||n<0?null:n>e?e:n}function Wt(e,n){return n===-1?-1:tt(e,n)}function q(e,n=0){if(typeof e!="string"||!e.length)return null;let t=Wt(e.length,n);if(t===null||t+1>=e.length)return null;let r=t+1;if(!Z(e.charCodeAt(r)))return r;if(r+=1,r>=e.length)return null;if(!Z(e.charCodeAt(r)))return r;for(r+=1;r<e.length;r++)if(!Z(e.charCodeAt(r)))return r;return null}function me(e,n=0){if(typeof e!="string"||!e.length)return null;let t=tt(e.length,n);if(t===null||t<1)return null;let r=t-1;if(!Z(e.charCodeAt(r)))return r;if(r-=1,r<0)return null;if(!Z(e.charCodeAt(r)))return r;for(r-=1;r>=0;r--)if(!Z(e.charCodeAt(r)))return r;return null}function nt(e){return typeof e!="string"?e:e.length?[e]:[]}var rt={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},it=e=>e+1,Ht=e=>e-1;function jt(e,n,t,r,l=()=>!1,i=!1,s=it){if(+n<0&&i&&t==="EOL")return t;if(n>=e.length&&!i)return!1;let u=i?1:t.length,c=0,h=!1,E=!1,A=!1,p=Math.min(r.maxMismatches,e.length+t.length),N=p,f=n,C=!1,d=!1,b=!1;function m(){return c===1&&N<p-1}for(;e[f];){let a=s(f);if(r.trimBeforeMatching&&e[f].trim()===""){if(!e[a]&&i&&t==="EOL")return!0;f=s(f);continue}if(l(e[f])){if(i&&t==="EOL"&&!e[a])return!0;f=s(f);continue}if(i)return!1;let R=a>f?t[t.length-u]:t[u-1];if(!r.i&&e[f]===R||r.i&&R!==void 0&&e[f].toLowerCase()===R.toLowerCase()){if(C||(C=!0),A||(A=!0),u===t.length){if(d=!0,N!==p)return!1}else u===1&&(b=!0);if(u-=1,c++,m())return!1;if(!u)return c!==t.length||N===p||!h?f:!1}else if(!h&&!c&&(h=!0),p&&N&&f){N-=1;for(let $=0;$<=N;$++){let M=a>f?t[t.length-u+1+$]:t[u-2-$],y=e[s(f)];if(M&&(!r.i&&e[f]===M||r.i&&e[f].toLowerCase()===M.toLowerCase())&&(!r.firstMustMatch||u!==t.length)){if(c++,m())return!1;u-=2,C=!0;break}else if(y&&M&&(!r.i&&y===M||r.i&&y.toLowerCase()===M.toLowerCase())&&(!r.firstMustMatch||u!==t.length)){if(!c&&!r.hungry)return!1;u-=1,C=!0;break}else if(M===void 0&&N>=0&&C&&(!r.firstMustMatch||d)&&(!r.lastMustMatch||b))return f}C||(E=f)}else return f===0&&u===1&&p>0&&N>0&&(!r.firstMustMatch||d)&&!r.lastMustMatch&&A?0:!1;if(E!==!1&&E!==f&&(E=!1),u<1)return f;f=s(f)}if(u>0)return i&&t==="EOL"?!0:r&&p>=u&&A?E||0:!1}function Oe(e,n,t,r,l){var f,C,d,b;if(F(l)&&Ye(l,"trimBeforeMatching")&&l&&typeof l.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_01] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(l.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let i=U(U({},rt),l);if(i.maxMismatches=(f=l==null?void 0:l.maxMismatches)!=null?f:rt.maxMismatches,Ft(i.maxMismatches,e),typeof i.trimCharsBeforeMatching=="string"&&(i.trimCharsBeforeMatching=nt(i.trimCharsBeforeMatching)),i.trimCharsBeforeMatching=i.trimCharsBeforeMatching.map(m=>L(m)?m:String(m)),!L(n)||!n.length)return!1;if(!Number.isInteger(t)||t<0)throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_02] the second argument should be a natural number. Currently it's of a type: ").concat(typeof t,", equal to:\n").concat(g(t,4)));let s,u;if(L(r))s=[r];else if(Array.isArray(r))s=r;else if(!r)s=r;else if(typeof r=="function")s=[],s.push(r);else throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_03] the third argument, whatToMatch, is neither string nor array of strings! It's ").concat(typeof r,", equal to:\n").concat(g(r,4)));if(Bt(s,e),l&&!F(l))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_04] the fourth argument, options object, should be a plain object. Currently it's of a type \"").concat(typeof l,'", and equal to:\n').concat(g(l,4)));let c=0,h="";if((C=i==null?void 0:i.trimCharsBeforeMatching)!=null&&C.some((m,a)=>m.length>1?(c=a,h=m,!0):!1))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_05] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ").concat(c," is longer than 1 character, ").concat(h.length," (equals to ").concat(h,"). Please split it into separate characters and put into array as separate elements."));if(t>=n.length)return!1;let E=i.i?i.trimCharsBeforeMatching.map(m=>m.toLowerCase()):i.trimCharsBeforeMatching,A=i.i?m=>E.includes(m.toLowerCase()):m=>E.includes(m);if(!s||!Array.isArray(s)||Array.isArray(s)&&!s.length||Array.isArray(s)&&s.length===1&&L(s[0])&&!s[0].trim()){if(typeof i.cb=="function"){let a,R=t;if((e==="matchLeftIncl"||e==="matchRight")&&(R+=1),e[5]==="L")for(let y=R;y--;){let V=n[y];if((!i.trimBeforeMatching||i.trimBeforeMatching&&(V!=null&&V.trim()))&&(!((d=i.trimCharsBeforeMatching)!=null&&d.length)||V!==void 0&&!A(V))){a=y;break}}else if(e.startsWith("matchRight"))for(let y=R;y<n.length;y++){let V=n[y];if((!i.trimBeforeMatching||i.trimBeforeMatching&&V.trim())&&(!((b=i.trimCharsBeforeMatching)!=null&&b.length)||!A(V))){a=y;break}}if(a===void 0)return!1;let $=n[a],M=e[5]==="L"?n.slice(0,a+1):n.slice(a);return e[5],i.cb($,M,a)}let m="";throw l||(m=" More so, the whole options object, the fourth input argument, is missing!"),new Error("string-match-left-right/".concat(e,'(): [THROW_ID_06] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!').concat(m))}if(!i.cb&&!i.i&&!i.trimBeforeMatching&&!i.trimCharsBeforeMatching.length&&i.maxMismatches===0&&!i.firstMustMatch&&!i.lastMustMatch&&!i.hungry&&s.every(L)){for(let m of s){if(!m.length)continue;let a=t;if(e==="matchRight"?a+=1:e==="matchLeft"?a-=m.length:e==="matchLeftIncl"&&(a-=m.length-1),a>=0&&n.startsWith(m,a))return m}return!1}let p=t;e==="matchRight"?p+=1:e==="matchLeft"&&(p-=1);let N=e[5]==="L"?Ht:it;for(let m=0,a=s.length;m<a;m++){u=typeof s[m]=="function";let R=s[m],$=typeof R=="function"?R():R;if(u&&$!=="EOL")throw new Error("string-match-left-right/".concat(e,'(): [THROW_ID_09] EOL marker functions must return "EOL". The function at index ').concat(m," returned:\n").concat(g($,4)));if(u&&e.endsWith("Incl"))continue;let M,y,V="",D=jt(n,p,$,i,A,u,N);if(D&&u)return!i.cb||i.cb(M,V,y)?$:!1;if(Number.isInteger(D)&&(y=e.startsWith("matchLeft")?D-1:D+1,e[5]==="L"?V=n.slice(0,D):V=n.slice(y)),y<0&&(y=void 0),n[y]&&(M=n[y]),Number.isInteger(D)&&(!i.cb||i.cb(M,V,y)))return $}return!1}function Ft(e,n){if(!Number.isSafeInteger(e)||e<0)throw new Error("string-match-left-right/".concat(n,"(): [THROW_ID_07] opts.maxMismatches must be a non-negative safe integer. Currently it's of a type: ").concat(typeof e,", equal to:\n").concat(g(e,4)))}function Bt(e,n){if(e)for(let t=0;t<e.length;t+=1){let r=e[t];if(typeof r!="string"&&typeof r!="function")throw new Error("string-match-left-right/".concat(n,"(): [THROW_ID_08] matcher alternatives must be strings or EOL marker functions. The value at index ").concat(t," is of a type: ").concat(typeof r,", equal to:\n").concat(g(r,4)))}}function _t(e,n,t,r){return Oe("matchLeft",e,n,t,r)}function lt(e,n,t,r){return Oe("matchRightIncl",e,n,t,r)}function ot(e,n,t,r){return Oe("matchRight",e,n,t,r)}var Ut=["_16_0_7_1_1_0_3_1_1_2_1_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_8_4l_1","_11_2_0_6_14_1z_q_4_3_19_16_l_9_4_1_1_2q_1_0_f_1_7_e_2_0_g_0_1_t_t_2g_b_0_e_16_9_1_4_0_5_l_4_0_9_0_3","_0_n_o_7_a_5_n_1_6_g_15_1m_1h_3_0_i_0_7_9_4_9_1_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_4_b_2_5_2_","0_8_5_4_1_2_l_1_6_1_1_1_1_1_1_v_3_1_0_7_9_2_2_g_8_1_2_1_l_1_6_1_1_1_4_3_0_i_0_f_1_4_9_9_0_b_7_2_1_2_","l_1_6_1_1_1_4_3_0_u_1_1_2_4_9_1_6_b_0_1_5_3_2_1_3_3_1_1_0_1_1_3_1_3_2_3_b_m_0_l_c_i_7_1_2_1_m_1_f_3_","0_q_2_1_1_2_1_4_9_8_6_1_0_4_7_1_2_1_m_1_9_1_4_3_0_u_2_1_1_4_9_1_1_h_8_1_2_1_14_2_0_g_0_5_2_1_9_4_i_1","_5_5_h_3_n_1_8_1_0_2_6_v_9_h_1b_1_1_c_6_9_9_13_1_1_0_1_4_1_n_1_0_1_9_1_1_9_0_2_4_1_0_9_9_2_3_w_0_v_j","_c_7_1_z_r_4_37_16_k_a_6_5_4_3_3_0_3_1_7_2_4_c_c_0_1_9_6_11_1_0_5_0_2_16_1_98_1_3_2_6_1_0_1_3_2_14_1","_3_2_w_1_3_2_6_1_0_1_3_2_e_1_1k_1_3_2_1u_e_j_3_f_g_2d_2_5_3_h7_2_g_1_p_5_22_3_a_7_h_d_i_e_h_e_c_1_2_","f_1f_z_0_4_0_3_9_6_9_m_9_6_2g_7_4_2_x_1_0_5_1x_a_u_13_13_2_4_b_17_4_p_6_a_11_m_9_1g_17_9_6_9_d_0_2l_","1a_h_7_3_9_15_t_d_1j_q_z_s_9_3_1c_2_a_5_16_2_2_15_3_1_5_1_1_3_0_5_5b_1s_7p_2_5_2_11_2_5_2_7_1_0_1_0_","1_0_1_u_2_1g_1_6_1_0_3_2_1_6_3_3_2_5_4_c_5_2_1_6_37_1_2_5_5_a_6_c_2t_0_4_0_2_9_1_0_3_4_6_0_1_0_1_0_1","_3_1_a_2_3_5_4_4_0_1_1l_k6_1n_26_l_hi_t_vg_6c_6_3_3_1_9_0_2_11_1_0_5_0_2_1j_7_0_g_m_9_6_1_6_1_6_1_6_","1_6_1_6_1_6_1_6_28_0_d1_2_p_8_7_4_2_4_4_2d_6_2_1_2h_1_3_5_16_1_2l_3_3_a_v_1c_f_w_9_u_7_1_e_w_9_13_e_","8w_533_1s_h3g_1v_19_2_7g_3_r_k_1a_g_u_2_27_13_8_2_2u_2_29_k_g_1_2_1_3_1_m_d_5_a_1f_e_1d_s_9_o_5_3_0_","1_1_1_11_a_m_p_s_7_1a_s_a_6_4_1_o_1_14_n_2_1_7_4_9_6_m_3_0_3_1d_1_0_3_1_2_4_2_0_1_0_o_2_2_a_7_2_c_5_","2_5_2_5_9_6_1_6_1_16_1_d_6_36_d_9_6_8mb_c_m_4_1c_6is_a5_2_2x_12_6_c_4_5_0_1_9_1_c_1_4_1_0_1_1_1_1_1_","2z_x_a2_i_1r_2_1h_14_b_38_4_1_3q_j_9_7_p_6_p_b_2g_3_5_2_5_2_5_2_2_z_b_1_p_1_i_1_1_1_e_2_d_y_3e_c_18_","c_1k_h_1_6s_s_3_1c_g_q_4_z_9_t_5_11_a_t_2_z_4_7_1_4_16_4d_2_9_6_z_4_z_4_13_8_1f_c_a_1_e_1_6_1_1_1_a_","1_e_1_6_1_1_3_1f_c_8m_9_l_a_7_o_5_1_15_1_8_1x_5_2_0_1_17_1_1_3_0_2_m_2_u_2_11_8_8_1c_i_1_1_5_w_4_p_6","_p_12_1j_4_j_2_1a_f_3_1_2_1_s_a_8_n_u_1_v_w_7_1_r_6_4_g_1h_a_l_2_q_5_p_n_6_28_20_1j_1e_d_1e_7_15_c_9","_6_11_9_m_62_u_1_15_6_1_g_5_1k_13_8_l_b_3_r_h_1a_r_k_m_c_1g_q_t_1_1_2_0_d_18_w_o_7_9_9_z_f_9_4_0_2_0","_8_y_3_0_c_1b_e_3_b_a_1_0_4_j_b_h_1_o_j_1_1r_6_1_0_1_3_1_e_1_9_7_1a_h_9_b_7_2_1_2_l_1_6_1_1_1_4_3_0_","i_0_c_4_u_9_1_0_2_0_1_11_1_0_p_0_1_0_18_1g_i_3_5_9_5_2_u_1b_k_1_1_0_8_9_4m_1a_15_3_10_1b_k_0_b_9_12_","16_d_0_7_9_6_j_s_q_l_b_4_6_55_17_38_2a_c_7_2_0_2_7_1_1_1_n_f_0_1_0_e_9_1y_7_2_12_g_0_1_0_s_0_a_13_7_","0_l_0_b_19_j_0_i_20_5j_w_f_9_6_8_1_10_h_0_f_s_5_t_34_6_1_1_1_11_l_0_9_9_6_5_1_1_1_v_e_0_7_9_6_17_4_9","_6u_i_f_0_1_c_1_x_s_9_2e_0_f_k_17_pl_2u_32_h_5f_218_2o_f_tr_h_5_p_32y_5_g6_5a1_t_i_9_1c6_fs_7_u_1_9_","6_26_1_9_6_t_i_1b_g_3_c_9_1_6_1_k_5_i_c0_18_3_9_5i_2e_9_o_2_o_18_22_5_0_1u_c_1s_1_1_0_e_4_9_5p1_15_v","_2p_36_6pp_3_1_6_1_1_1_82_f_0_t_2_2_0_e_3_8_az_1s4_2y_5_c_3_8_7_9_386_9_152_j_c_j_30_o_3r_2c_1_1y_1_","1_2_0_2_1_2_3_1_b_1_0_1_6_1_1s_1_3_2_7_1_6_1_r_1_3_1_4_1_0_3_6_1_9f_2_o_1_o_1_u_1_o_1_u_1_o_1_u_1_o_","1_u_1_o_1_7_2_1d_1ds_u_6_5_79_1p_42_18_a_6_2_9_4_0_8x_t_i_17_4_9_d2_r_4_9_5y_t_2_a_5h_u_1_2_1_1_1_6_","2_4_9_1_68_6_1_3_1_1_1_e_1_5g_2_8_1c_1v_7_0_4_9_lz_1m_1_2_1_3_24_18_1_e_5e_3_1_q_1_1_1_0_2_0_1_9_1_3","_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4","_1_g_g4_c_25f_9_sm_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),we=Ut.slice(1).split("_"),Le=[],st=127;for(let e=0;e<we.length;e+=2){let n=st+1+Number.parseInt(we[e],36),t=n+Number.parseInt(we[e+1],36);Le.push([n,t]),st=t}function qt(e){if(Number.isNaN(e)||e<128||e>1114111)return!1;let n=0,t=Le.length-1;for(;n<=t;){let r=n+t>>1,l=Le[r];if(e<l[0])t=r-1;else if(e>l[1])n=r+1;else return!0}return!1}function W(e,n,t){let r=n[t];if(!e||!r||!e.includes(r))return!1;let l=r.charCodeAt(0),i=t,s=t+1;if(!(l>=55296&&l<=56319&&n.charCodeAt(s)>=56320&&n.charCodeAt(s)<=57343))if(l>=56320&&l<=57343&&n.charCodeAt(t-1)>=55296&&n.charCodeAt(t-1)<=56319)i=t-1,s=t;else return e.includes(n[t]);let u=n.charCodeAt(i),c=n.charCodeAt(s);for(let h=0;h<e.length-1;h++)if(e.charCodeAt(h)===u&&e.charCodeAt(h+1)===c)return!0;return!1}function at(e,n){let t=e.charCodeAt(n);if(t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)return!0;let r=t;return t>=55296&&t<=56319&&e.charCodeAt(n+1)>=56320&&e.charCodeAt(n+1)<=57343?r=(t-55296)*1024+(e.charCodeAt(n+1)-56320)+65536:t>=56320&&t<=57343&&e.charCodeAt(n-1)>=55296&&e.charCodeAt(n-1)<=56319&&(r=(e.charCodeAt(n-1)-55296)*1024+(t-56320)+65536),qt(r)}var G={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function de(e){var s,u,c,h,E,A,p,N,f,C;function n(d){return L(d)&&!d.trim()}if(F(e)){if(!Object.keys(e).length)throw new Error('string-range-expander/expander(): [THROW_ID_02] Input must be a plain object with the required "str", "from", and "to" keys, but it was given without any keys.')}else{let d;throw e===void 0?d="but it is missing completely.":e===null?d="but it was given as null.":d="but it was given as ".concat(typeof e,", equal to:\n").concat(g(e,4),"."),new Error("string-range-expander/expander(): [THROW_ID_01] Input must be a plain object ".concat(d))}if(!L(e.str))throw new Error('string-range-expander/expander(): [THROW_ID_03] The input\'s "str" value must be a string! It was given as '.concat(typeof e.str,", equal to ").concat(g(e.str)));if(!K(e.from)||e.from<0)throw new Error('string-range-expander/expander(): [THROW_ID_04] The input\'s "from" value must be a non-negative integer! It was given as '.concat(typeof e.from,", equal to ").concat(g(e.from)));if(!K(e.to)||e.to<0)throw new Error('string-range-expander/expander(): [THROW_ID_05] The input\'s "to" value must be a non-negative integer! It was given as '.concat(typeof e.to,", equal to ").concat(g(e.to)));if(e.from>e.str.length)throw new Error('string-range-expander/expander(): [THROW_ID_06] The input\'s "from" value ('.concat(e.from,") must not exceed the string length (").concat(e.str.length,")."));if(e.to>e.str.length)throw new Error('string-range-expander/expander(): [THROW_ID_07] The input\'s "to" value ('.concat(e.to,") must not exceed the string length (").concat(e.str.length,")."));if(e.from>e.to)throw new Error('string-range-expander/expander(): [THROW_ID_08] The input\'s "from" value ('.concat(e.from,') must not exceed its "to" value (').concat(e.to,")."));if(e.extendToOneSide!==void 0&&e.extendToOneSide!==!1&&e.extendToOneSide!=="left"&&e.extendToOneSide!=="right")throw new Error('string-range-expander/expander(): [THROW_ID_09] The options value "extendToOneSide" is not recognisable! It\'s set to: "'.concat(e.extendToOneSide,'" (').concat(typeof e.extendToOneSide,'). It has to be either Boolean "false" or one of strings: "left" or "right"'));if(e.ifLeftSideIncludesThisThenCropTightly!==void 0&&!L(e.ifLeftSideIncludesThisThenCropTightly))throw new Error('string-range-expander/expander(): [THROW_ID_10] The option "ifLeftSideIncludesThisThenCropTightly", is not a string! It\'s been given as '.concat(typeof e.ifLeftSideIncludesThisThenCropTightly,", equal to ").concat(g(e.ifLeftSideIncludesThisThenCropTightly)));if(e.ifLeftSideIncludesThisCropItToo!==void 0&&!L(e.ifLeftSideIncludesThisCropItToo))throw new Error('string-range-expander/expander(): [THROW_ID_11] The option "ifLeftSideIncludesThisCropItToo", is not a string! It\'s been given as '.concat(typeof e.ifLeftSideIncludesThisCropItToo,", equal to ").concat(g(e.ifLeftSideIncludesThisCropItToo)));if(e.ifRightSideIncludesThisThenCropTightly!==void 0&&!L(e.ifRightSideIncludesThisThenCropTightly))throw new Error('string-range-expander/expander(): [THROW_ID_12] The option "ifRightSideIncludesThisThenCropTightly", is not a string! It\'s been given as '.concat(typeof e.ifRightSideIncludesThisThenCropTightly,", equal to ").concat(g(e.ifRightSideIncludesThisThenCropTightly)));if(e.ifRightSideIncludesThisCropItToo!==void 0&&!L(e.ifRightSideIncludesThisCropItToo))throw new Error('string-range-expander/expander(): [THROW_ID_13] The option "ifRightSideIncludesThisCropItToo", is not a string! It\'s been given as '.concat(typeof e.ifRightSideIncludesThisCropItToo,", equal to ").concat(g(e.ifRightSideIncludesThisCropItToo)));if(e.wipeAllWhitespaceOnLeft!==void 0&&typeof e.wipeAllWhitespaceOnLeft!="boolean")throw new Error('string-range-expander/expander(): [THROW_ID_14] The option "wipeAllWhitespaceOnLeft" must be a Boolean! It was given as '.concat(typeof e.wipeAllWhitespaceOnLeft,", equal to ").concat(g(e.wipeAllWhitespaceOnLeft)));if(e.wipeAllWhitespaceOnRight!==void 0&&typeof e.wipeAllWhitespaceOnRight!="boolean")throw new Error('string-range-expander/expander(): [THROW_ID_15] The option "wipeAllWhitespaceOnRight" must be a Boolean! It was given as '.concat(typeof e.wipeAllWhitespaceOnRight,", equal to ").concat(g(e.wipeAllWhitespaceOnRight)));if(e.addSingleSpaceToPreventAccidentalConcatenation!==void 0&&typeof e.addSingleSpaceToPreventAccidentalConcatenation!="boolean")throw new Error('string-range-expander/expander(): [THROW_ID_16] The option "addSingleSpaceToPreventAccidentalConcatenation" must be a Boolean! It was given as '.concat(typeof e.addSingleSpaceToPreventAccidentalConcatenation,", equal to ").concat(g(e.addSingleSpaceToPreventAccidentalConcatenation)));let t=le(U(U({},G),e),{ifLeftSideIncludesThisThenCropTightly:(s=e.ifLeftSideIncludesThisThenCropTightly)!=null?s:G.ifLeftSideIncludesThisThenCropTightly,ifLeftSideIncludesThisCropItToo:(u=e.ifLeftSideIncludesThisCropItToo)!=null?u:G.ifLeftSideIncludesThisCropItToo,ifRightSideIncludesThisThenCropTightly:(c=e.ifRightSideIncludesThisThenCropTightly)!=null?c:G.ifRightSideIncludesThisThenCropTightly,ifRightSideIncludesThisCropItToo:(h=e.ifRightSideIncludesThisCropItToo)!=null?h:G.ifRightSideIncludesThisCropItToo,extendToOneSide:(E=e.extendToOneSide)!=null?E:G.extendToOneSide,wipeAllWhitespaceOnLeft:(A=e.wipeAllWhitespaceOnLeft)!=null?A:G.wipeAllWhitespaceOnLeft,wipeAllWhitespaceOnRight:(p=e.wipeAllWhitespaceOnRight)!=null?p:G.wipeAllWhitespaceOnRight,addSingleSpaceToPreventAccidentalConcatenation:(N=e.addSingleSpaceToPreventAccidentalConcatenation)!=null?N:G.addSingleSpaceToPreventAccidentalConcatenation}),r=t.str,l=t.from,i=t.to;if(t.extendToOneSide!=="right"&&(n(r[l-1])&&(n(r[l-2])||W(t.ifLeftSideIncludesThisCropItToo,r,l-2))||r[l-1]&&W(t.ifLeftSideIncludesThisCropItToo,r,l-1)||t.wipeAllWhitespaceOnLeft&&n(r[l-1]))){for(let d=l;d--;)if(!W(t.ifLeftSideIncludesThisCropItToo,r,d)){if(r[d].trim()){t.wipeAllWhitespaceOnLeft||W(t.ifLeftSideIncludesThisCropItToo,r,d+1)?l=d+1:l=d+2;break}else if(d===0){t.wipeAllWhitespaceOnLeft?l=0:l=1;break}}}if(t.extendToOneSide!=="left"&&(n(r[i])&&(t.wipeAllWhitespaceOnRight||n(r[i+1])||W(t.ifRightSideIncludesThisCropItToo,r,i+1))||W(t.ifRightSideIncludesThisCropItToo,r,i))){for(let d=i,b=r.length;d<b;d++)if(!W(t.ifRightSideIncludesThisCropItToo,r,d)){if(r[d].trim()){t.wipeAllWhitespaceOnRight||W(t.ifRightSideIncludesThisCropItToo,r,d-1)?i=d:i=d-1;break}else if(d===r.length-1){t.wipeAllWhitespaceOnRight?i=r.length:i=r.length-1;break}}}return(t.extendToOneSide!=="right"&&L(t.ifLeftSideIncludesThisThenCropTightly)&&t.ifLeftSideIncludesThisThenCropTightly&&(r[l-2]&&W(t.ifLeftSideIncludesThisThenCropTightly,r,l-2)||r[l-1]&&W(t.ifLeftSideIncludesThisThenCropTightly,r,l-1))||t.extendToOneSide!=="left"&&L(t.ifRightSideIncludesThisThenCropTightly)&&t.ifRightSideIncludesThisThenCropTightly&&(r[i+1]&&W(t.ifRightSideIncludesThisThenCropTightly,r,i+1)||r[i]&&W(t.ifRightSideIncludesThisThenCropTightly,r,i)))&&(t.extendToOneSide!=="right"&&n(r[l-1])&&!t.wipeAllWhitespaceOnLeft&&(l-=1),t.extendToOneSide!=="left"&&n(r[i])&&!t.wipeAllWhitespaceOnRight&&(i+=1)),t.addSingleSpaceToPreventAccidentalConcatenation&&((f=r[l-1])!=null&&f.trim())&&((C=r[i])!=null&&C.trim())&&(!t.ifLeftSideIncludesThisThenCropTightly&&!t.ifRightSideIncludesThisThenCropTightly||!((!t.ifLeftSideIncludesThisThenCropTightly||W(t.ifLeftSideIncludesThisThenCropTightly,r,l-1))&&(!t.ifRightSideIncludesThisThenCropTightly||r[i]&&W(t.ifRightSideIncludesThisThenCropTightly,r,i))))&&(at(r,l-1)||at(r,i))?[l,i," "]:[l,i]}var ut="6.3.1";function ft(e,n){if(n<0||n>=e.length)return;let t=e.charCodeAt(n),r=e.charCodeAt(n+1);if(t>=55296&&t<=56319&&r>=56320&&r<=57343)return e.slice(n,n+2);let l=e.charCodeAt(n-1);return t>=56320&&t<=57343&&l>=55296&&l<=56319?e.slice(n-1,n+1):e[n]}var zt=ut;function Ie(e){return e>96&&e<123||e>64&&e<91||e>47&&e<58||e===95}function se(e){return e!==void 0&&Ie(e.charCodeAt(0))}function ct(e){return e!==void 0&&(Ie(e.charCodeAt(0))||":-.".includes(e))}function ht(e){if(/^[\x00-\x7f]*$/.test(e))return e.length;let n=0;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<=127)n+=1;else if(r<=2047)n+=2;else if(r>=55296&&r<=56319&&t+1<e.length){let l=e.charCodeAt(t+1);l>=56320&&l<=57343?(n+=4,t+=1):n+=3}else n+=3}return n}function Gt(e,n,t){var i;let r="",l=0;for(let s=0,u=n.length;s<u;s++){t&&t(s/u*100);let c=n[s];r+="".concat(e.slice(l,c[0])).concat((i=c[2])!=null?i:""),l=c[1]}return t&&t(100),r+e.slice(l)}var ve={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 Kt(e,n){var Ve,Me;let t=Date.now();if(!L(e))throw e===void 0?new Error("html-crush/crush(): [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error('html-crush/crush(): [THROW_ID_02] the first input argument must be string! It was given as "'.concat(typeof e,'", equal to:\n').concat(g(e,4)));if(n&&!F(n))throw new Error("html-crush/crush(): [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ".concat(typeof n,", equal to ").concat(g(n,4)));let r=n;if(r&&Array.isArray(r.breakToTheLeftOf)&&r.breakToTheLeftOf.length){for(let S=0,_=r.breakToTheLeftOf.length;S<_;S++)if(!L(r.breakToTheLeftOf[S]))throw new TypeError("html-crush/crush(): [THROW_ID_04] the resolvedOpts.breakToTheLeftOf array contains non-string elements! For example, element at index ".concat(S,' is of a type "').concat(typeof r.breakToTheLeftOf[S],'" and is equal to:\n').concat(g(r.breakToTheLeftOf[S],4)))}let l=new et({limitToBeAddedWhitespace:!0}),i=le(U(U({},ve),r),{reportProgressFunc:typeof(r==null?void 0:r.reportProgressFunc)=="function"?r.reportProgressFunc:null,breakToTheLeftOf:(r==null?void 0:r.breakToTheLeftOf)===void 0?ve.breakToTheLeftOf:Array.isArray(r.breakToTheLeftOf)?r.breakToTheLeftOf:[]});typeof i.removeHTMLComments=="boolean"&&(i.removeHTMLComments=i.removeHTMLComments?1:0);let s="";Array.isArray(i.breakToTheLeftOf)&&i.breakToTheLeftOf.length&&(s=[...new Set(i.breakToTheLeftOf.map(S=>S[0]))].join(""));let u={removeHTMLComments:!1,removeCSSComments:!1},c=Array.isArray(i.mindTheInlineTags)?i.mindTheInlineTags:[],h=new Set(c),E=!!c.length&&c.every(S=>L(S)&&!!S.length&&![...S].some(_=>!se(_))),A=new Map,p=Array.isArray(i.breakToTheLeftOf)&&!!i.breakToTheLeftOf.length&&i.breakToTheLeftOf.every(L)&&!(i.breakToTheLeftOf.length===1&&!i.breakToTheLeftOf[0].trim());if(p)for(let S of i.breakToTheLeftOf){if(!S.length)continue;let _=A.get(S[0]);_?_.push(S):A.set(S[0],[S])}function N(S){if(!p)return!!lt(e,S,i.breakToTheLeftOf);let _=A.get(e[S]);if(_===void 0)return!1;for(let v=0,o=_.length;v<o;v++)if(e.startsWith(_[v],S))return!0;return!1}function f(S,_){if(!E)return!!ot(e,S,i.mindTheInlineTags,le(U({},_?{trimCharsBeforeMatching:"/"}:{}),{cb:I=>!I||!se(I)}));let v=S+1;if(_)for(;e[v]==="/";)v++;let o=v;for(;o<k&&Ie(e.charCodeAt(o));)o++;return o>v&&h.has(e.slice(v,o))}function C(S){let _=S-1;for(;_>=0&&H(e[_]);)_--;if(e[_]!=="=")return null;let v=_,o=_-1;for(;o>=0&&H(e[o]);)o--,v--;for(;o>=0&&ct(e[o]);)o--;return o+1<v?e.slice(o+1,v).toLowerCase():null}function d(S,_,v){if(e[S]!=="<")return!1;let o=S+1;if(v){if(e[o]!=="/")return!1;o++}else if(e[o]==="/")return!1;for(let I=0;I<_.length;I++){let J=e.charCodeAt(o+I);if(J>64&&J<91&&(J+=32),J!==_.charCodeAt(I))return!1}return!ct(e[o+_.length])&&!Ke(ft(e,o+_.length))}function b(S,_){let v=e.indexOf("<",S);for(;v!==-1;){if(d(v,_,!0))return v;v=e.indexOf("<",v+1)}return-1}let m=null,a=null,R=!1,$=0,M=0,y=!1,V=!1,D=null,ee=null,te=null,j=null,Q=null,pe=null,O,T=null,w=null,x=null,B=null,z=null,ae=null,ne=">};",re="<",gt="!",mt=">",dt="<",De="{},:;<>~+",$e=De,be=De,X=!0,k=e.length;function Re(S,_=!1){let v=S.length,o=Math.max(k-v,0),I=ht(e),J=_?I:ht(S),Pe=Math.max(I-J,0);return{timeTakenInMilliseconds:Date.now()-t,originalLength:k,cleanedLength:v,bytesSaved:o,percentageReducedOfOriginal:k?Math.round(o*100/k):0,originalLengthInCodeUnits:k,cleanedLengthInCodeUnits:v,codeUnitsSaved:o,percentageReducedOfOriginalInCodeUnits:k?Math.round(o*100/k):0,originalLengthInUtf8Bytes:I,cleanedLengthInUtf8Bytes:J,utf8BytesSaved:Pe,percentageReducedOfOriginalInUtf8Bytes:I?Math.round(Pe*100/I):0}}let ie=0;for(;ie<k&&H(e[ie]);)ie++;let pt=Math.floor(k/2),xe=.01,Ne=1-xe,ke=null;function _e(S){if(!i.reportProgressFunc||k<=1e3)return;let _=Math.max(0,Math.min(S,1)),v=Math.floor(i.reportProgressFuncFrom+(i.reportProgressFuncTo-i.reportProgressFuncFrom)*_);v!==ke&&(ke=v,i.reportProgressFunc(v))}let P="\n";if(e.includes("\r\n")?P="\r\n":e.includes("\r")&&(P="\r"),k){for(let _=0;_<k;_++){if(i.reportProgressFunc&&(k>1e3&&k<2e3?_===pt&&_e(.5):k>=2e3&&_e(_/k*Ne)),M++,!O&&y&&e[_]==="}"&&e[_-1]==="}"&&($+1>=i.lineLengthLimit?(l.push(_,_,P),$=0):(T=_,w=_,x=" ")),O&&typeof O=="number"&&_>=O&&(O=void 0),pe!==null&&d(_,"script",!0)){if((i.removeIndentations||i.removeLineBreaks)&&_>0&&e[~-_]&&H(e[~-_])){for(let o=_;o--;)if(e[o]==="\n"||e[o]==="\r"||!H(e[o])){o+1<_&&l.push(o+1,_);break}}pe=null,O=!1,_+=8;continue}if(!O&&!y&&d(_,"script",!1)){pe=_,O=!0;let o="";(i.removeLineBreaks||i.removeIndentations)&&a!==null&&(a>0&&(o=P),l.push(a,_,o)),a=null,m=null}if(!O&&ee!==null){i.removeLineBreaks&&($="\r\n".includes(e[_])?0:$+1),_>ee&&e[_]===e[ee]&&(ee=null);continue}if(!O&&z!==null&&!D&&"\"'".includes(e[_])){let o=C(_);if(o==="style")D=_;else if(o!==null){ee=_,i.removeLineBreaks&&($+=1);continue}}if(!O&&te!==null){if(i.removeLineBreaks&&($="\r\n".includes(e[_])?0:$+1),_>te&&e[_]===e[te]){let o=0;for(let I=_;I>0&&e[I-1]==="\\";I--)o++;o%2===0&&(te=null)}continue}if(!O&&(y||D)&&(D||z===null)&&"\"'".includes(e[_])&&!(D&&e[_]===e[D])){te=_,i.removeLineBreaks&&($+=1);continue}if(z!==null&&B===null&&!se(e[_])){B=e.slice(z,_);let o=q(e,~-_),I=q(e,_);if(typeof o=="number"&&e[o]===">"&&H(e[_])&&I)l.push(_,I);else if(o&&e[o]==="/"&&e[q(e,o)]===">"){H(e[_])&&I&&l.push(_,I);let J=q(e,o+1);e[o+1]!==">"&&J&&l.push(o+1,J)}}if(!O&&!y&&!D&&e[~-_]==="<"&&z===null)if(se(e[_]))z=_;else{let o=q(e,~-_),I=q(e,o);e[o]==="/"&&se(e[I]||"")&&(z=I)}if(!O&&(y||D)&&j!==null&&e[_]==="*"&&e[_+1]==="/"&&([T,w]=de({str:e,from:j,to:_+2,ifLeftSideIncludesThisThenCropTightly:$e||"",ifRightSideIncludesThisThenCropTightly:be||""}),j=null,T!=null?l.push(T,w):($+=1,_+=1),O=_+2),!O&&(y||D)&&j===null&&e[_]==="/"&&e[_+1]==="*"&&(u.removeCSSComments||(u.removeCSSComments=!0),i.removeCSSComments&&(j=_)),V&&e.startsWith("![endif",_+1)&&(V=!1),!O&&!y&&!D&&Q!==null){let o;e.startsWith("-->",_)?o=3:e[_]===">"&&e[_-1]==="]"&&(o=1),o&&([T,w]=de({str:e,from:Q,to:_+o}),Q=null,T!=null?i.removeLineBreaks&&i.lineLengthLimit&&M-(w-T)>=i.lineLengthLimit?(l.push(T,w,P),M=-o):(l.push(T,w),M-=w-T):($+=o-1,_+=o-1),O=_+o)}if(!O&&!y&&!D&&e[_]==="<"&&(e.startsWith("<!--",_)||e.startsWith("<![endif",_))&&Q===null&&(e.startsWith("<![endif",_)?i.removeHTMLComments===2&&(Q=_):e.startsWith("[if",_+4)?(V||(V=!0),i.removeHTMLComments===2&&(Q=_)):i.removeHTMLComments&&(!V||i.removeHTMLComments===2)&&(Q=_),u.removeHTMLComments||(u.removeHTMLComments=!0)),!O&&y&&j===null&&d(_,"style",!0)?y=!1:!O&&!y&&j===null&&d(_,"style",!1)&&(y=!0,(i.removeLineBreaks||i.removeIndentations)&&i.breakToTheLeftOf.includes("<style")&&e.startsWith(' type="text/css">',_+6)&&e[_+24]&&l.push(_+23,_+23,P)),!O&&!D&&"\"'".includes(e[_])&&e.endsWith("style=",_)&&(D=_),!O&&H(e[_]))a===null&&(a=_);else if(!O&&!((y||D)&&j!==null)){if(a!==null){if(i.removeLineBreaks&&($+=1),X)X=!1,(i.removeIndentations||i.removeLineBreaks)&&l.push(0,_);else if(i.removeIndentations&&!i.removeLineBreaks&&(!R&&m!==null&&_>m?l.push(m+1,_):a+1<_&&(e.endsWith("]>",a)||e.endsWith("-->",a)||e.startsWith("<![",_)||e.startsWith("<!--<![",_)?l.push(a,_):e[a]===" "?l.push(a+1,_):e[~-_]===" "?l.push(a,~-_):l.push(a,_," "))),i.removeLineBreaks||D){if(s.includes(e[_])&&N(_)){!("\r\n".includes(e[~-_])&&a===~-_)&&!(e[~-_]==="\n"&&e[_-2]==="\r"&&a===_-2)&&l.push(a,_,P),T=null,w=null,x=null,a=null,$=1;continue}let o=" ";if(!(e[_]==="<"&&f(_,!1))){if(e[~-a]&&mt.includes(e[~-a])&&dt.includes(e[_])||(y||D)&&j===null&&($e.includes(e[~-a])||be.includes(e[_]))||e[_]==="!"&&e.startsWith("!important",_)&&!V||D&&(e[~-a]==="'"||e[~-a]==='"')||e[~-a]==="}"&&e.startsWith("</style",_)||e[_]===">"&&("'\"".includes(e[me(e,_)])||e[q(e,_)]==="<")||e[_]==="/"&&e[q(e,_)]===">"){o="";let I=e[_]==="/"&&e[_+1]===">"?q(e,_):null;I&&I>_+1&&(l.push(_+1,I),$-=I-_+1)}}y&&e[_]==="}"&&a&&e[a-1]==="}"&&(o=" "),o!=null&&o.length&&($+=1),i.lineLengthLimit?$>=i.lineLengthLimit||!e[_+1]||e[_]===">"||e[_]==="/"&&e[_+1]===">"?(($>i.lineLengthLimit||$===i.lineLengthLimit&&((Ve=e[_+1])!=null&&Ve.trim())&&!ne.includes(e[_])&&!re.includes(e[_+1]))&&(o=P,$=1),($>i.lineLengthLimit||!(o===" "&&_===a+1))&&(l.push(a,_,o),m=null),T=null,w=null,x=null):(T===null||a<T)&&(T=a,w=_,x=o):_===a+1&&o===" "||l.push(a,_,o)}a=null,R||(R=!0)}else X&&(X=!1),i.removeLineBreaks&&($+=1);R||(R=!0)}if(!O&&!X&&_!==0&&i.removeLineBreaks&&(i.lineLengthLimit||s)&&!(e[_]==="<"&&e.startsWith("</a",_))){if(s&&N(_)&&ie<_&&(e[_]!=="<"||!e.startsWith("<![endif]",_)||!_t(e,_,"<!--"))){l.push(_,_,P),T=null,w=null,x=null,$=1;continue}else if(i.lineLengthLimit&&$<=i.lineLengthLimit){if(!e[_+1]||re.includes(e[_])&&!gt.includes(e[_])||ne.includes(e[_])||H(e[_])){if(T!==null&&w!==null&&(T!==w||x!=null&&x.length)){let o=x;!H(e[_])&&((Me=e[_+1])!=null&&Me.trim())&&$+(x?x.length:0)>i.lineLengthLimit&&(o=P),($+(o?o.length:0)>i.lineLengthLimit||!(o===" "&&w===T+1&&e[T]===" "))&&(e[~-T]==="}"&&e[w]==="{"||(l.push(T,w,o),m=null))}!H(e[_])&&(re.includes(e[_])||e[~-_]&&ne.includes(e[~-_]))&&L(ae)&&(!B||!h.has(B))&&!(e[_]==="<"&&f(_,!1))&&!(e[_]==="<"&&f(_,!0))?(T=_,w=_,x=null):j===null&&T!==null&&(D||!i.mindTheInlineTags||!Array.isArray(i.mindTheInlineTags)||Array.isArray(i.mindTheInlineTags.length)&&!i.mindTheInlineTags.length||!L(B)||Array.isArray(i.mindTheInlineTags)&&i.mindTheInlineTags.length&&L(B)&&!h.has(B))&&!(e[_]==="<"&&f(_,!0))&&(T=null,w=null,x=null)}}else if(i.lineLengthLimit)if(re.includes(e[_])&&!(e[_]==="<"&&f(_,!0)))if(T!==null&&w!==null&&(T!==w||x!=null&&x.length)){let o=x!=null&&x.length?x.length:0;$-(w-T-o)-1>i.lineLengthLimit||(l.push(T,w,x),$-(w-T-o)-1===i.lineLengthLimit&&(l.push(_,_,P),$=0),T=null,w=null,x=null)}else l.push(_,_,P),$=0;else e[_+1]&&ne.includes(e[_])&&L(B)&&Array.isArray(i.mindTheInlineTags)&&i.mindTheInlineTags.length&&!h.has(B)?T!==null&&w!==null&&(T!==w||x!=null&&x.length)||(l.push(_+1,_+1,P),$=0):H(e[_])||e[_+1]||T!==null&&w!==null&&(T!==w||x!=null&&x.length)&&l.push(T,w,P)}if(!O&&!X&&i.removeLineBreaks&&i.lineLengthLimit&&$>=i.lineLengthLimit&&T!==null&&w!==null&&!ne.includes(e[_])&&!re.includes(e[_])&&!"/".includes(e[_])&&!($===i.lineLengthLimit&&e[_+1]&&!e[_+1].trim())){let o=P;e[_+1]&&!e[_+1].trim()&&$===i.lineLengthLimit&&(o=x),o===P&&!e[~-T].trim()&&me(e,T)&&(T=me(e,T)+1),l.push(T,w,o),$=_-w,e[_].length&&($+=1),T=null,w=null,x=null}if((!O&&e[_]==="\n"||e[_]==="\r"&&(!e[_+1]||e[_+1]&&e[_+1]!=="\n"))&&(m=_,R&&(R=!1),!i.removeLineBreaks&&a!==null&&a<_&&e[_+1]&&e[_+1]!=="\r"&&e[_+1]!=="\n"&&l.push(a,_)),!e[_+1]){if((y||D)&&j!==null)l.push([...de({str:e,from:j,to:_+1,ifLeftSideIncludesThisThenCropTightly:$e||"",ifRightSideIncludesThisThenCropTightly:be||""})]);else if(a!==null&&(ie<k||i.removeIndentations||i.removeLineBreaks)){let o=e.endsWith("\r\n")?k-2:e.endsWith("\n")||e.endsWith("\r")?k-1:k;a<o&&l.push(a,o)}}if(!O&&D&&D<_&&e[D]===e[_]&&(D=null),!O&&!y&&e[_]==="<"){let o=null;if(d(_,"pre",!1)?o="pre":d(_,"code",!1)?o="code":d(_,"textarea",!1)&&(o="textarea"),o!==null){let I=b(_+2,o);O=I===-1?k:I}}if(!O&&e[_]==="<"&&e.startsWith("<![CDATA[",_)){let o=e.indexOf("]]>",_+9);o>0&&(O=o)}if(!O&&!y&&!D&&z!==null&&e[_]===">"&&(e[q(e,_)]==="<"&&(ae=B),z=null,B=null),e[_]==="<"&&ae!==null&&(ae=null),!O&&y&&e[_]==="{"&&e[_+1]==="{"){let o=e.indexOf("}}",_+2);o!==-1&&(O=o+2)}let v=!0}let S=l.current();if(S){let _=i.reportProgressFunc&&k>=2e3?o=>{_e(Ne+xe*(o/100))}:void 0,v=Gt(e,S,_);return _e(1),{log:Re(v),ranges:S,applicableOpts:u,result:v}}}return _e(1),{log:Re(e,!0),applicableOpts:u,ranges:null,result:e}}return At(Yt);})();
11
11
  /**
12
- * @name codsen-utils
13
- * @fileoverview Various utility functions
14
- * @version 1.9.0
12
+ * @name codsen-format-diagnostic-value
13
+ * @fileoverview Safely format untrusted JavaScript values for diagnostics
14
+ * @version 1.1.1
15
15
  * @author Roy Revelt
16
16
  * @license MIT
17
- * {@link https://codsen.com/os/codsen-utils/}
17
+ * {@link https://codsen.com/os/codsen-format-diagnostic-value/}
18
18
  */
19
19
  /**
20
- * @name ranges-sort
21
- * @fileoverview Sort string index ranges
22
- * @version 6.2.1
23
- * @author Roy Revelt
24
- * @license MIT
25
- * {@link https://codsen.com/os/ranges-sort/}
26
- */
27
- /**
28
- * @name ranges-merge
29
- * @fileoverview Merge and sort string index ranges
30
- * @version 9.2.2
20
+ * @name codsen-utils
21
+ * @fileoverview Various utility functions
22
+ * @version 1.10.1
31
23
  * @author Roy Revelt
32
24
  * @license MIT
33
- * {@link https://codsen.com/os/ranges-merge/}
25
+ * {@link https://codsen.com/os/codsen-utils/}
34
26
  */
35
27
  /**
36
- * @name ranges-apply
37
- * @fileoverview Take an array of string index ranges, delete/replace the string according to them
38
- * @version 7.2.2
28
+ * @name string-collapse-leading-whitespace
29
+ * @fileoverview Collapse the leading and trailing whitespace of a string
30
+ * @version 7.3.1
39
31
  * @author Roy Revelt
40
32
  * @license MIT
41
- * {@link https://codsen.com/os/ranges-apply/}
33
+ * {@link https://codsen.com/os/string-collapse-leading-whitespace/}
42
34
  */
43
35
  /**
44
- * @name string-collapse-leading-whitespace
45
- * @fileoverview Collapse the leading and trailing whitespace of a string
46
- * @version 7.2.0
36
+ * @name ranges-sort
37
+ * @fileoverview Sort string index ranges
38
+ * @version 6.2.3
47
39
  * @author Roy Revelt
48
40
  * @license MIT
49
- * {@link https://codsen.com/os/string-collapse-leading-whitespace/}
41
+ * {@link https://codsen.com/os/ranges-sort/}
50
42
  */
51
43
  /**
52
44
  * @name ranges-push
53
45
  * @fileoverview Gather string index ranges
54
- * @version 7.2.1
46
+ * @version 7.3.1
55
47
  * @author Roy Revelt
56
48
  * @license MIT
57
49
  * {@link https://codsen.com/os/ranges-push/}
@@ -59,7 +51,7 @@
59
51
  /**
60
52
  * @name string-left-right
61
53
  * @fileoverview Looks up the first non-whitespace character to the left/right of a given index
62
- * @version 6.2.1
54
+ * @version 6.2.3
63
55
  * @author Roy Revelt
64
56
  * @license MIT
65
57
  * {@link https://codsen.com/os/string-left-right/}
@@ -67,7 +59,7 @@
67
59
  /**
68
60
  * @name arrayiffy-if-string
69
61
  * @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
70
- * @version 5.2.1
62
+ * @version 5.2.3
71
63
  * @author Roy Revelt
72
64
  * @license MIT
73
65
  * {@link https://codsen.com/os/arrayiffy-if-string/}
@@ -75,7 +67,7 @@
75
67
  /**
76
68
  * @name string-match-left-right
77
69
  * @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
78
- * @version 9.2.2
70
+ * @version 9.2.4
79
71
  * @author Roy Revelt
80
72
  * @license MIT
81
73
  * {@link https://codsen.com/os/string-match-left-right/}
@@ -83,7 +75,7 @@
83
75
  /**
84
76
  * @name string-range-expander
85
77
  * @fileoverview Expands string index ranges within whitespace boundaries until letters are met
86
- * @version 4.2.1
78
+ * @version 4.2.3
87
79
  * @author Roy Revelt
88
80
  * @license MIT
89
81
  * {@link https://codsen.com/os/string-range-expander/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html-crush",
3
- "version": "6.2.2",
3
+ "version": "6.3.1",
4
4
  "description": "Minify email templates",
5
5
  "keywords": [
6
6
  "breaks",
@@ -76,15 +76,14 @@
76
76
  }
77
77
  },
78
78
  "dependencies": {
79
- "codsen-utils": "^1.9.0",
80
- "ranges-apply": "^7.2.2",
81
- "ranges-push": "^7.2.1",
82
- "string-left-right": "^6.2.1",
83
- "string-match-left-right": "^9.2.2",
84
- "string-range-expander": "^4.2.1"
79
+ "codsen-utils": "^1.10.1",
80
+ "ranges-push": "^7.3.1",
81
+ "string-left-right": "^6.2.3",
82
+ "string-match-left-right": "^9.2.4",
83
+ "string-range-expander": "^4.2.3"
85
84
  },
86
85
  "devDependencies": {
87
- "test-mixer": "^4.3.1"
86
+ "test-mixer": "^4.4.1"
88
87
  },
89
88
  "engines": {
90
89
  "node": ">=18.20.8"
package/types/index.d.ts CHANGED
@@ -16,16 +16,40 @@ interface Opts {
16
16
  breakToTheLeftOf: string[];
17
17
  mindTheInlineTags: string[];
18
18
  }
19
+ interface InputOpts {
20
+ lineLengthLimit?: number;
21
+ removeIndentations?: boolean;
22
+ removeLineBreaks?: boolean;
23
+ removeHTMLComments?: boolean | 0 | 1 | 2;
24
+ removeCSSComments?: boolean;
25
+ reportProgressFunc?: null | false | 0 | ((percDone: number) => void);
26
+ reportProgressFuncFrom?: number;
27
+ reportProgressFuncTo?: number;
28
+ breakToTheLeftOf?: string[] | null | false;
29
+ mindTheInlineTags?: string[];
30
+ }
19
31
  declare const defaults: Opts;
20
32
  interface Res {
21
33
  /** Best-effort completion statistics for user-facing feedback.
22
34
  * Observational fields do not affect the transformation. */
23
35
  log: {
24
36
  timeTakenInMilliseconds: number;
37
+ /** Legacy input length in UTF-16 code units. */
25
38
  originalLength: number;
39
+ /** Legacy output length in UTF-16 code units. */
26
40
  cleanedLength: number;
41
+ /** Legacy name: UTF-16 code units saved, not bytes. */
27
42
  bytesSaved: number;
43
+ /** Legacy percentage calculated from UTF-16 code units. */
28
44
  percentageReducedOfOriginal: number;
45
+ originalLengthInCodeUnits: number;
46
+ cleanedLengthInCodeUnits: number;
47
+ codeUnitsSaved: number;
48
+ percentageReducedOfOriginalInCodeUnits: number;
49
+ originalLengthInUtf8Bytes: number;
50
+ cleanedLengthInUtf8Bytes: number;
51
+ utf8BytesSaved: number;
52
+ percentageReducedOfOriginalInUtf8Bytes: number;
29
53
  };
30
54
  applicableOpts: {
31
55
  removeHTMLComments: boolean;
@@ -37,7 +61,7 @@ interface Res {
37
61
  /**
38
62
  * Minifies HTML/CSS: valid or broken, pure or mixed with other languages
39
63
  */
40
- declare function crush(str: string, opts?: Partial<Opts>): Res;
64
+ declare function crush(str: string, opts?: InputOpts | null): Res;
41
65
 
42
66
  export { crush, defaults, version };
43
- export type { Opts, Res };
67
+ export type { InputOpts, Opts, Res };