html-crush 6.2.1 → 6.3.0
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 +32 -1
- package/dist/html-crush.esm.js +15 -14
- package/dist/html-crush.umd.js +23 -31
- package/package.json +7 -8
- package/types/index.d.ts +26 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,37 @@
|
|
|
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
|
+
|
|
31
|
+
## 6.2.2 (2026-08-22)
|
|
32
|
+
|
|
33
|
+
### Performance Improvements
|
|
34
|
+
|
|
35
|
+
- optimise package hot paths and JSON editing ([f3112bd](https://github.com/codsen/codsen/commit/f3112bd7fc0d7c9bc09312d3744c950691d72ca5))
|
|
36
|
+
|
|
6
37
|
## 6.2.0 (2026-08-19)
|
|
7
38
|
|
|
8
39
|
### Bug Fixes
|
|
@@ -11,7 +42,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
42
|
- isolate range state per crush call ([dec5331](https://github.com/codsen/codsen/commit/dec53312c4e55e6519398bd48246d92610a21b06))
|
|
12
43
|
- make validation diagnostics safe ([7b01074](https://github.com/codsen/codsen/commit/7b0107476f12734aeb8e82852ba980b187280110))
|
|
13
44
|
- protect every Jinja expression, not only the first ([741d3f5](https://github.com/codsen/codsen/commit/741d3f50c2727b46c124ae26cad048932fa2a180))
|
|
14
|
-
- resolve review findings
|
|
45
|
+
- resolve various review findings ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
|
|
15
46
|
- retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
|
|
16
47
|
|
|
17
48
|
### Features
|
package/dist/html-crush.esm.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name html-crush
|
|
3
3
|
* @fileoverview Minify email templates
|
|
4
|
-
* @version 6.
|
|
4
|
+
* @version 6.3.0
|
|
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
|
|
11
|
-
${
|
|
12
|
-
${
|
|
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.0";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
|
-
`)?
|
|
15
|
-
`:n.includes("\r")&&(
|
|
16
|
-
`||n[
|
|
17
|
-
`.includes(n[
|
|
18
|
-
|
|
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
|
-
`))&&(
|
|
21
|
-
`&&
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
`&&n[e-1]!=="\r")&&s.push(i,e)),!u&&c&&c<e&&n[c]===n[e]&&(c=null),!u&&!g&&n.startsWith("<pre",e)&&!A(n[e+4])){let o=n.indexOf("</pre",e+5);o>0&&(u=o)}if(!u&&!g&&n.startsWith("<code",e)&&!A(n[e+5])){let o=n.indexOf("</code",e+5);o>0&&(u=o)}if(!u&&n.startsWith("<![CDATA[",e)){let o=n.indexOf("]]>",e+9);o>0&&(u=o)}if(!u&&!g&&!c&&L!==null&&n[e]===">"&&(n[a(n,e)]==="<"&&(H=d),L=null,d=null),n[e]==="<"&&H!==null&&(H=null),!u&&g&&n[e]==="{"&&n[e+1]==="{"){let o=n.indexOf("}}",e+2);o!==-1&&(u=o+2)}let J=!0}let T=s.current();if(T){let e=l.reportProgressFuncTo-(l.reportProgressFuncTo-l.reportProgressFuncFrom)*Y,J=oe(n,T,k=>{l.reportProgressFunc&&h>=2e3&&(p=Math.floor(e+(l.reportProgressFuncTo-e)*(k/100)),p!==M&&(M=p,l.reportProgressFunc(p)))}),o=J.length;return{log:{timeTakenInMilliseconds:Date.now()-x,originalLength:h,cleanedLength:o,bytesSaved:Math.max(h-o,0),percentageReducedOfOriginal:h?Math.round(Math.max(h-o,0)*100/h):0},ranges:T,applicableOpts:O,result:J}}}return{log:{timeTakenInMilliseconds:Date.now()-x,originalLength:h,cleanedLength:h,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:O,ranges:null,result:n}}export{Ee as crush,$e as defaults,he 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};
|
package/dist/html-crush.umd.js
CHANGED
|
@@ -1,57 +1,49 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name html-crush
|
|
3
3
|
* @fileoverview Minify email templates
|
|
4
|
-
* @version 6.
|
|
4
|
+
* @version 6.3.0
|
|
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 Y=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames,he=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,Ne=Object.prototype.propertyIsEnumerable;var re=(e,r,l)=>r in e?Y(e,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[r]=l,L=(e,r)=>{for(var l in r||(r={}))me.call(r,l)&&re(e,l,r[l]);if(he)for(var l of he(r))Ne.call(r,l)&&re(e,l,r[l]);return e};var Ve=(e,r)=>{for(var l in r)Y(e,l,{get:r[l],enumerable:!0})},Me=(e,r,l,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Re(r))!me.call(e,o)&&o!==l&&Y(e,o,{get:()=>r[o],enumerable:!(n=ve(r,o))||n.enumerable});return e};var Pe=e=>Me(Y({},"__esModule",{value:!0}),e);var J=(e,r,l)=>re(e,typeof r!="symbol"?r+"":r,l);var et={};Ve(et,{crush:()=>Ze,defaults:()=>Oe,version:()=>Xe});function xe(){let e=[],r=0,l=!1;return{append(n){return l?!1:r+n.length>1999?(e.push("\u2026"),r+=1,l=!0,!1):(e.push(n),r+=n.length,!0)},result(){return e.join("")},stopped(){return l}}}function _e(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function z(e,r){if(e.append('"')){for(let l=0;l<r.length&&!e.stopped();l+=1){let n=r.charCodeAt(l);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(_e(n)):e.append(r[l])}e.append('"')}}function He(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function $e(e,r){e.append("Symbol(");let l=String(r);l.length>8&&z(e,l.slice(7,-1)),e.append(")")}function ce(e,r){typeof r=="symbol"?$e(e,r):z(e,String(r))}function T(e,r=0){let l=xe(),n=r===4?4:0,o=new WeakSet,i=0;function f(u){n&&l.append(" ".repeat(u*n))}function g(u,d){u&&l.append(","),n&&(l.append("\n"),f(d+1))}function a(u,d,O){n&&d&&(l.append("\n"),f(O)),l.append(u)}function s(u,d){Object.prototype.hasOwnProperty.call(u,"value")?p(u.value,d):l.append(He(u))}function c(u,d){let O;try{O=Reflect.getOwnPropertyDescriptor(u,"length")}catch(m){l.append("[Uninspectable]");return}let S=O==null?void 0:O.value;if(!Number.isSafeInteger(S)||S<0){l.append("[Uninspectable]");return}l.append("[");let b=!1;for(let m=0;m<S&&!l.stopped();m+=1){if(g(b,d),b=!0,i>=50){l.append("[MaxEntries]");break}i+=1;let $;try{$=Reflect.getOwnPropertyDescriptor(u,String(m))}catch(y){l.append("[Uninspectable]");continue}$!=null&&$.enumerable?s($,d+1):l.append("[Empty]")}a("]",b,d)}function w(u,d){let O;try{O=Reflect.ownKeys(u)}catch(b){l.append("[Uninspectable]");return}l.append("{");let S=!1;for(let b of O){if(l.stopped())break;if(i>=50){g(S,d),S=!0,z(l,"\u2026"),l.append(n?": ":":"),l.append("[MaxEntries]");break}i+=1;let m;try{m=Reflect.getOwnPropertyDescriptor(u,b)}catch($){g(S,d),S=!0,ce(l,b),l.append(n?": ":":"),l.append("[Uninspectable]");continue}m!=null&&m.enumerable&&(g(S,d),S=!0,ce(l,b),l.append(n?": ":":"),s(m,d+1))}a("}",S,d)}function E(u,d){if(o.has(u)){l.append("[Circular]");return}if(d>=5){l.append("[MaxDepth]");return}let O;try{O=Array.isArray(u)}catch(S){l.append("[Uninspectable]");return}o.add(u);try{O?c(u,d):w(u,d)}finally{o.delete(u)}}function p(u,d){u===null?l.append("null"):typeof u=="string"?z(l,u):typeof u=="number"?l.append(Object.is(u,-0)?"-0":String(u)):typeof u=="boolean"?l.append(u?"true":"false"):typeof u>"u"?l.append("undefined"):typeof u=="bigint"?l.append("".concat(u,"n")):typeof u=="symbol"?$e(l,u):typeof u=="function"?l.append("[Function]"):E(u,d)}try{return p(e,0),l.result()}catch(u){return"[Uninspectable]"}}var nt=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"]),Fe=Object.prototype.hasOwnProperty;function H(e){if(!D(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 M(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 D(e){return typeof e=="string"}function pe(e){return Number.isFinite(e)}function V(e){return Number.isSafeInteger(e)&&e>=0}function P(e){return e!=null}function de(e,r){return M(e)&&D(r)&&Fe.call(e,r)}var We={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function W(e,r){if(!Array.isArray(e)||!e.length)return e;let l=L(L({},We),r),n,o;if(l.strictlyTwoElementsInRangeArrays&&!e.every((g,a)=>!Array.isArray(g)||g.length!==2?(n=a,o=g.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(T(e[n],4),") has not two but ").concat(o," elements!"));if(!e.every((g,a)=>!Array.isArray(g)||!Number.isInteger(g[0])||g[0]<0||!Number.isInteger(g[1])||g[1]<0?(n=a,!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(T(e[n],4),") does not consist of only natural numbers!"));let i=e.length**2,f=0;return Array.from(e).sort((g,a)=>(l.progressFn&&(f+=1,l.progressFn(Math.floor(f*100/i))),g[0]===a[0]?g[1]<a[1]?-1:g[1]>a[1]?1:0:g[0]<a[0]?-1:1))}var ke={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function ie(e,r){function l(s){return!!s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;if(r&&!l(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(T(r,4)," (type ").concat(typeof r,")"));let n=L(L({},ke),r);if(n.progressFn&&l(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(T(n.progressFn,4)));if(![1,2,"1","2"].includes(n.mergeType))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(T(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(T(n.joinRangesThatTouchEdges,4)));let o=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),i,f,g;n.progressFn?i=W(o,{progressFn:s=>{g=Math.floor(s/5),g!==f&&(f=g,n.progressFn(g))}}):i=W(o);let a=i.length-1;for(let s=a;s>0;s--)n.progressFn&&(g=Math.floor((1-s/a)*78)+21,g!==f&&g>f&&(f=g,n.progressFn(g))),(i[s][0]<=i[s-1][0]||!n.joinRangesThatTouchEdges&&i[s][0]<i[s-1][1]||n.joinRangesThatTouchEdges&&i[s][0]<=i[s-1][1])&&(i[s-1][0]=Math.min(i[s][0],i[s-1][0]),i[s-1][1]=Math.max(i[s][1],i[s-1][1]),i[s][2]!==void 0&&(i[s-1][0]>=i[s][0]||i[s-1][1]<=i[s][1])&&i[s-1][2]!==null&&(i[s][2]===null&&i[s-1][2]!==null?i[s-1][2]=null:i[s-1][2]!=null?+n.mergeType==2&&i[s-1][0]===i[s][0]?i[s-1][2]=i[s][2]:i[s-1][2]+=i[s][2]:i[s-1][2]=i[s][2]),i.splice(s,1),s=i.length);return i.length?i:null}function K(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 be(e,r,l){let n=0,o=0;if(e===void 0&&r===void 0&&l===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(T(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(T(r,4)));if(l&&typeof l!="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 l,", equal to: ").concat(T(l,4)));if(!(r!=null&&r.some(Boolean)))return e;let i;Array.isArray(r)&&!Array.isArray(r[0])&&K(r[0])&&K(r[1])?i=[Array.from(r)]:i=Array.from(r);let f=i.length,g=0;i.forEach((c,w)=>{if(c){if(l&&(n=Math.floor(g/f*10),n!==o&&(o=n,l(n))),!Array.isArray(c))throw new TypeError("ranges-apply/rApply(): [THROW_ID_05] ranges array, second input arg., has ".concat(w,"th element not an array: ").concat(T(c,4),", which is ").concat(typeof c));if(!K(c[0]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_06] ranges array, second input arg. has ".concat(w,"th element, array ").concat(T(c),". Its first element is not a non-negative integer or string index, but ").concat(typeof c[0],", equal to: ").concat(T(c[0],4),"."));if(typeof c[0]=="string"&&(i[w]=[...c],i[w][0]=Number(c[0])),!K(c[1]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_07] ranges array, second input arg. has ".concat(w,"th element, array ").concat(T(c),". Its second element is not a non-negative integer or string index, but ").concat(typeof c[1],", equal to: ").concat(T(c[1],4),"."));typeof c[1]=="string"&&(i[w]===c&&(i[w]=[...c]),i[w][1]=Number(c[1])),g+=1}});let a=l?ie(i,{progressFn:c=>{n=10+Math.floor(c/10),n!==o&&(o=n,l(n))}}):ie(i),s=(a==null?void 0:a.length)||0;if(a&&s>0){let c=e.slice(a[s-1][1]);e=a.reduce((w,E,p,u)=>{l&&(n=20+Math.floor(p/s*80),n!==o&&(o=n,l(n)));let d=p===0?0:u[p-1][1],O=u[p][0];return"".concat(w).concat(e.slice(d,O)).concat(u[p][2]||"")},""),e+=c}return e}function Q(e,r=1){let l="\xA0";function n(i){return Array.from(i).reverse().join("")}function o(i,f,g){let a=g?"\n":"\r",s=g?"\r":"\n";if(!i)return i;let c=0,w=0,E="";for(let p=0,u=i.length;p<u;p++)(i[p]===a||i[p]===s&&i[p-1]!==a)&&w++,"\r\n".includes(i[p])||i[p]===l?(c=0,i[p]===l?E+=i[p]:i[p]===a?w<=f&&(E+=i[p],i[p+1]===s&&(E+=i[p+1],p++)):i[p]===s&&(i==null?void 0:i[p-1])!==a&&w<=f&&(E+=i[p])):(c++,!i[p+1]&&!w&&(E+=" "));return E}if(typeof e=="string"&&e.length){let i=1;typeof+r=="number"&&Number.isInteger(+r)&&+r>=0&&(i=+r);let f="",g="";if(!e.trim())f=e;else if(!e[0].trim()){for(let a=0,s=e.length;a<s;a++)if(e[a].trim()){f=e.slice(0,a);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===l)){for(let a=e.length;a--;)if(e[a].trim()){g=e.slice(a+1);break}}return"".concat(o(f,i,!1)).concat(e.trim()).concat(n(o(n(g),i,!0)))}return e}var Be={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Ue(e,r){function l(s){return!!s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;if(r&&!l(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(T(r,4)," (type ").concat(typeof r,")"));let n=L(L({},Be),r);if(n.progressFn&&l(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(T(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(T(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(T(n.joinRangesThatTouchEdges,4)));let o=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),i,f,g;n.progressFn?i=W(o,{progressFn:s=>{g=Math.floor(s/5),g!==f&&(f=g,n.progressFn!=null&&n.progressFn(g))}}):i=W(o);let a=i.length-1;for(let s=a;s>0;s--)n.progressFn&&(g=Math.floor((1-s/a)*78)+21,g!==f&&g>f&&(f=g,n.progressFn(g))),(i[s][0]<=i[s-1][0]||!n.joinRangesThatTouchEdges&&i[s][0]<i[s-1][1]||n.joinRangesThatTouchEdges&&i[s][0]<=i[s-1][1])&&(i[s-1][0]=Math.min(i[s][0],i[s-1][0]),i[s-1][1]=Math.max(i[s][1],i[s-1][1]),i[s][2]!==void 0&&(i[s-1][0]>=i[s][0]||i[s-1][1]<=i[s][1])&&i[s-1][2]!==null&&(i[s][2]===null&&i[s-1][2]!==null?i[s-1][2]=null:i[s-1][2]!=null?+n.mergeType==2&&i[s-1][0]===i[s][0]?i[s-1][2]=i[s][2]:i[s-1][2]+=i[s][2]:i[s-1][2]=i[s][2]),i.splice(s,1),s=i.length);return i.length?i:null}var je={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1};function Te(e){return e[2]===void 0&&e[0]===e[1]}function Je(e){let r=-1;for(let l=0,n=e.length;l<n;l++){let o=e[l];if(Array.isArray(o)){if(o[0]<r)return!1;r=o[0]}}return!0}var ye=class{constructor(e){J(this,"ranges");J(this,"opts");J(this,"sorted");if(e!=null&&!M(e))throw new TypeError("ranges-push/Ranges/constructor(): [THROW_ID_01] The options argument must be a plain object. It was given as ".concat(T(e,4)," (type ").concat(typeof e,")."));let r=L(L({},je),e);if(r.mergeType&&r.mergeType!==1&&r.mergeType!==2)if(D(r.mergeType)&&r.mergeType.trim()==="1")r.mergeType=1;else if(D(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(T(r.mergeType,4)));this.opts=r,this.ranges=[],this.sorted=!0}add(e,r,l){var i;if(e==null&&r==null)return;if(P(e)&&!P(r)){if(Array.isArray(e)){if(e.length){if(e.some(f=>Array.isArray(f))){e.forEach(f=>{Array.isArray(f)&&this.add(...f)});return}e.length&&V(+e[0])&&V(+e[1])&&this.add(...e)}return}throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_03] the first input argument, "from" is set ('.concat(T(e),') but second-one, "to" is not (').concat(T(r),")"))}else if(!P(e)&&P(r))throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_04] the second input argument, "to" is set ('.concat(T(r),') but first-one, "from" is not (').concat(T(e),")"));let n=+e,o=+r;if(V(n)&&V(o)){if(P(l)&&!D(l)&&!pe(l))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 l,", equal to:\n").concat(T(l,4)));if(P(this.ranges)&&Array.isArray(this.last())&&n===this.last()[1]){if(this.last()[1]=o,this.last()[2],this.last()[2]!==null&&P(l)){let f=this.last()[2]&&this.last()[2].length&&(!((i=this.opts)!=null&&i.mergeType)||this.opts.mergeType===1)?"".concat(this.last()[2]).concat(l):l;this.opts.limitToBeAddedWhitespace&&(f=Q(f,this.opts.limitLinebreaksCount)),D(f)&&!f.length||(this.last()[2]=f)}}else{this.ranges||(this.ranges=[]);let f=this.last();f&&n<f[0]&&(this.sorted=!1);let g=l!==void 0&&!(D(l)&&!l.length)?[n,o,l&&this.opts.limitToBeAddedWhitespace?Q(l,this.opts.limitLinebreaksCount):l]:[n,o];this.ranges.push(g)}}else throw V(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(T(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(T(e,4)))}push(e,r,l){this.add(e,r,l)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=Ue(this.ranges,{mergeType:this.opts.mergeType}),this.sorted=!0,this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>P(e[2])?[e[0],e[1],Q(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}firstCovers(e){if(!V(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(T(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,o=this.ranges.length;n<o;n++){let i=this.ranges[n];if(!(!Array.isArray(i)||Te(i))){if(r===null){if(i[0]!==0)return!1;r=i[1]}else{if(i[0]>r)break;i[1]>r&&(r=i[1])}if(r>=e)return!0}}return r!==null&&r>=e}let l=!0;for(;l;){l=!1;for(let n=0,o=this.ranges.length;n<o;n++){let i=this.ranges[n];if(!(!Array.isArray(i)||Te(i))){if(i[0]<0)return!1;(r===null?i[0]===0:i[0]<=r&&i[1]>r)&&(r=i[1],l=!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])&&V(e[0][0]))this.ranges=Array.from(e),this.sorted=Je(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(T(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 k="\xA0";function Ge({str:e,idx:r=0,stopAtNewlines:l=!1,stopAtRawNbsp:n=!1}){if(typeof e!="string"||!e.length||((!r||typeof r!="number")&&(r=0),!e[r+1]))return null;if(e[r+1]&&(e[r+1].trim()||l&&"\n\r".includes(e[r+1])||n&&e[r+1]===k))return r+1;if(e[r+2]&&(e[r+2].trim()||l&&"\n\r".includes(e[r+2])||n&&e[r+2]===k))return r+2;for(let o=r+1,i=e.length;o<i;o++)if(e[o].trim()||l&&"\n\r".includes(e[o])||n&&e[o]===k)return o;return null}function A(e,r=0){return Ge({str:e,idx:r,stopAtNewlines:!1,stopAtRawNbsp:!1})}function qe({str:e,idx:r,stopAtNewlines:l,stopAtRawNbsp:n}){if(typeof e!="string"||!e.length||((!r||typeof r!="number")&&(r=0),r<1))return null;if(e[~-r]&&(e[~-r].trim()||l&&"\n\r".includes(e[~-r])||n&&e[~-r]===k))return~-r;if(e[r-2]&&(e[r-2].trim()||l&&"\n\r".includes(e[r-2])||n&&e[r-2]===k))return r-2;for(let o=r;o--;)if(e[o]&&(e[o].trim()||l&&"\n\r".includes(e[o])||n&&e[o]===k))return o;return null}function X(e,r=0){return qe({str:e,idx:r,stopAtNewlines:!1,stopAtRawNbsp:!1})}function Ee(e){return typeof e!="string"?e:e.length?[e]:[]}var Se={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},Ye=e=>e+1;function ze(e,r,l,n,o=!1,i=Ye){var m;let f=typeof l=="function"?l():l;if(+r<0&&o&&f==="EOL")return f;let g=L(L({},Se),n);if(r>=e.length&&!o)return!1;let a=o?1:l.length,s=0,c=!1,w=!1,E=!1,p=g.maxMismatches,u=r,d=!1,O=!1,S=!1;function b(){return s===1&&p<g.maxMismatches-1}for(;e[u];){let $=i(u);if(g.trimBeforeMatching&&e[u].trim()===""){if(!e[$]&&o&&l==="EOL")return!0;u=i(u);continue}if(g&&!g.i&&((m=g==null?void 0:g.trimCharsBeforeMatching)!=null&&m.includes(e[u]))||g!=null&&g.i&&g.trimCharsBeforeMatching&&g.trimCharsBeforeMatching.map(C=>C.toLowerCase()).includes(e[u].toLowerCase())){if(o&&l==="EOL"&&!e[$])return!0;u=i(u);continue}let y=$>u?l[l.length-a]:l[a-1];if(!g.i&&e[u]===y||g.i&&y!==void 0&&e[u].toLowerCase()===y.toLowerCase()){if(d||(d=!0),E||(E=!0),a===l.length){if(O=!0,p!==g.maxMismatches)return!1}else a===1&&(S=!0);if(a-=1,s++,b())return!1;if(!a)return s!==l.length||p===g.maxMismatches||!c?u:!1}else if(!c&&!s&&(c=!0),g.maxMismatches&&p&&u){p-=1;for(let C=0;C<=p;C++){let v=$>u?l[l.length-a+1+C]:l[a-2-C],x=e[i(u)];if(v&&(!g.i&&e[u]===v||g.i&&e[u].toLowerCase()===v.toLowerCase())&&(!g.firstMustMatch||a!==l.length)){if(s++,b())return!1;a-=2,d=!0;break}else if(x&&v&&(!g.i&&x===v||g.i&&x.toLowerCase()===v.toLowerCase())&&(!g.firstMustMatch||a!==l.length)){if(!s&&!g.hungry)return!1;a-=1,d=!0;break}else if(v===void 0&&p>=0&&d&&(!g.firstMustMatch||O)&&(!g.lastMustMatch||S))return u}d||(w=u)}else return u===0&&a===1&&!g.lastMustMatch&&E?0:!1;if(w!==!1&&w!==u&&(w=!1),a<1)return u;u=i(u)}if(a>0)return o&&f==="EOL"?!0:g&&g.maxMismatches>=a&&E?w||0:!1}function oe(e,r,l,n,o){var c,w,E;if(M(o)&&de(o,"trimBeforeMatching")&&o&&typeof o.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_01] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(o.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let i=L(L({},Se),o);if(typeof i.trimCharsBeforeMatching=="string"&&(i.trimCharsBeforeMatching=Ee(i.trimCharsBeforeMatching)),i.trimCharsBeforeMatching=i.trimCharsBeforeMatching.map(p=>D(p)?p:String(p)),!D(r)||!r.length)return!1;if(!Number.isInteger(l)||l<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 l,", equal to:\n").concat(T(l,4)));let f,g;if(D(n))f=[n];else if(Array.isArray(n))f=n;else if(!n)f=n;else if(typeof n=="function")f=[],f.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(T(n,4)));if(o&&!M(o))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 o,'", and equal to:\n').concat(T(o,4)));let a=0,s="";if((c=i==null?void 0:i.trimCharsBeforeMatching)!=null&&c.some((p,u)=>p.length>1?(a=u,s=p,!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(a," is longer than 1 character, ").concat(s.length," (equals to ").concat(s,"). Please split it into separate characters and put into array as separate elements."));if(!f||!Array.isArray(f)||Array.isArray(f)&&!f.length||Array.isArray(f)&&f.length===1&&D(f[0])&&!f[0].trim()){if(typeof i.cb=="function"){let u,d=l;if((e==="matchLeftIncl"||e==="matchRight")&&(d+=1),e[5]==="L")for(let m=d;m--;){let $=r[m];if((!i.trimBeforeMatching||i.trimBeforeMatching&&($!=null&&$.trim()))&&(!((w=i.trimCharsBeforeMatching)!=null&&w.length)||$!==void 0&&!i.trimCharsBeforeMatching.includes($))){u=m;break}}else if(e.startsWith("matchRight"))for(let m=d;m<r.length;m++){let $=r[m];if((!i.trimBeforeMatching||i.trimBeforeMatching&&$.trim())&&(!((E=i.trimCharsBeforeMatching)!=null&&E.length)||!i.trimCharsBeforeMatching.includes($))){u=m;break}}if(u===void 0)return!1;let O=r[u],S=u+1,b="";return S&&S>0&&(b=r.slice(0,S)),e[5]==="L"||u&&u>0&&(b=r.slice(u)),i.cb(O,b,u)}let p="";throw o||(p=" 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(p))}for(let p=0,u=f.length;p<u;p++){g=typeof f[p]=="function";let d=f[p],O,S,b="",m=l;e==="matchRight"?m+=1:e==="matchLeft"&&(m-=1);let $=ze(r,m,d,i,g,y=>e[5]==="L"?y-1:y+1);if($&&g&&typeof d=="function"&&d()==="EOL")return d()&&(!i.cb||i.cb(O,b,S))?d():!1;if(Number.isInteger($)&&(S=e.startsWith("matchLeft")?$-1:$+1,e[5]==="L"?b=r.slice(0,$):b=r.slice(S)),S<0&&(S=void 0),r[S]&&(O=r[S]),Number.isInteger($)&&(!i.cb||i.cb(O,b,S)))return d}return!1}function we(e,r,l,n){return oe("matchLeft",e,r,l,n)}function le(e,r,l,n){return oe("matchRightIncl",e,r,l,n)}function B(e,r,l,n){return oe("matchRight",e,r,l,n)}var Ke={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function Z(e){var g,a;let r=/^[0-9a-zA-Z]+$/;function l(s){return D(s)&&!s.trim()}if(M(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 s;throw e===void 0?s="but it is missing completely.":e===null?s="but it was given as null.":s="but it was given as ".concat(typeof e,", equal to:\n").concat(T(e,4),"."),new Error("string-range-expander/expander(): [THROW_ID_01] Input must be a plain object ".concat(s))}if(!V(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(T(e.from)));if(!V(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(T(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||D(e.extendToOneSide)&&e.extendToOneSide!=="left"&&e.extendToOneSide!=="right"||!D(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&&!D(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(T(e.ifLeftSideIncludesThisThenCropTightly)));if(e!=null&&e.ifLeftSideIncludesThisCropItToo&&!D(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(T(e.ifLeftSideIncludesThisCropItToo)));if(e!=null&&e.ifRightSideIncludesThisThenCropTightly&&!D(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(T(e.ifRightSideIncludesThisThenCropTightly)));if(e!=null&&e.ifRightSideIncludesThisCropItToo&&!D(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(T(e.ifRightSideIncludesThisCropItToo)));let n=L(L({},Ke),e),o=n.str,i=n.from,f=n.to;if(n.extendToOneSide!=="right"&&(l(o[i-1])&&(l(o[i-2])||n.ifLeftSideIncludesThisCropItToo.includes(o[i-2]))||o[i-1]&&n.ifLeftSideIncludesThisCropItToo.includes(o[i-1])||n.wipeAllWhitespaceOnLeft&&l(o[i-1]))){for(let s=i;s--;)if(!n.ifLeftSideIncludesThisCropItToo.includes(o[s])){if(o[s].trim()){n.wipeAllWhitespaceOnLeft||n.ifLeftSideIncludesThisCropItToo.includes(o[s+1])?i=s+1:i=s+2;break}else if(s===0){n.wipeAllWhitespaceOnLeft?i=0:i=1;break}}}if(n.extendToOneSide!=="left"&&(l(o[f])&&(n.wipeAllWhitespaceOnRight||l(o[f+1]))||n.ifRightSideIncludesThisCropItToo.includes(o[f]))){for(let s=f,c=o.length;s<c;s++)if(!n.ifRightSideIncludesThisCropItToo.includes(o[s])){if(o[s].trim()){n.wipeAllWhitespaceOnRight||n.ifRightSideIncludesThisCropItToo.includes(o[s-1])?f=s:f=s-1;break}else if(s===o.length-1){n.wipeAllWhitespaceOnRight?f=o.length:f=o.length-1;break}}}return(n.extendToOneSide!=="right"&&D(n.ifLeftSideIncludesThisThenCropTightly)&&n.ifLeftSideIncludesThisThenCropTightly&&(o[i-2]&&n.ifLeftSideIncludesThisThenCropTightly.includes(o[i-2])||o[i-1]&&n.ifLeftSideIncludesThisThenCropTightly.includes(o[i-1]))||n.extendToOneSide!=="left"&&D(n.ifRightSideIncludesThisThenCropTightly)&&n.ifRightSideIncludesThisThenCropTightly&&(o[f+1]&&n.ifRightSideIncludesThisThenCropTightly.includes(o[f+1])||o[f]&&n.ifRightSideIncludesThisThenCropTightly.includes(o[f])))&&(n.extendToOneSide!=="right"&&l(o[i-1])&&!n.wipeAllWhitespaceOnLeft&&(i-=1),n.extendToOneSide!=="left"&&l(o[f])&&!n.wipeAllWhitespaceOnRight&&(f+=1)),n.addSingleSpaceToPreventAccidentalConcatenation&&((g=o[i-1])!=null&&g.trim())&&((a=o[f])!=null&&a.trim())&&(!n.ifLeftSideIncludesThisThenCropTightly&&!n.ifRightSideIncludesThisThenCropTightly||!((!n.ifLeftSideIncludesThisThenCropTightly||n.ifLeftSideIncludesThisThenCropTightly.includes(o[i-1]))&&(!n.ifRightSideIncludesThisThenCropTightly||o[f]&&n.ifRightSideIncludesThisThenCropTightly.includes(o[f]))))&&(r.test(o[i-1])||r.test(o[f]))?[i,f," "]:[i,f]}var De="6.2.1";var Xe=De,Oe={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 Ze(e,r){var ge,fe;let l=Date.now();if(!D(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(T(e,4)));if(r&&!M(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(T(r,4)));if(r&&Array.isArray(r.breakToTheLeftOf)&&r.breakToTheLeftOf.length){for(let N=0,t=r.breakToTheLeftOf.length;N<t;N++)if(!D(r.breakToTheLeftOf[N]))throw new TypeError("html-crush/crush(): [THROW_ID_04] the resolvedOpts.breakToTheLeftOf array contains non-string elements! For example, element at index ".concat(N,' is of a type "').concat(typeof r.breakToTheLeftOf[N],'" and is equal to:\n').concat(T(r.breakToTheLeftOf[N],4)))}let n=new ye({limitToBeAddedWhitespace:!0}),o=L(L({},Oe),r);typeof o.removeHTMLComments=="boolean"&&(o.removeHTMLComments=o.removeHTMLComments?1:0);let i="";Array.isArray(o.breakToTheLeftOf)&&o.breakToTheLeftOf.length&&(i=[...new Set(o.breakToTheLeftOf.map(N=>N[0]))].join(""));let f={removeHTMLComments:!1,removeCSSComments:!1},g=null,a=null,s=!1,c=0,w=0,E=!1,p=!1,u=null,d=null,O=null,S=null,b,m=null,$=null,y=null,C=null,v=null,x=null,U=">};",j="<",Le="!",Ae=">",Ce="<",se="{},:;<>~+",ee=se,te=se,F=!0,R=e.length,Ie=Math.floor(R/2),ae=.01,ue;o.reportProgressFunc&&(ue=Math.floor(o.reportProgressFuncTo-(o.reportProgressFuncTo-o.reportProgressFuncFrom)*ae-o.reportProgressFuncFrom));let _,G=0,I="\n";if(e.includes("\r\n")?I="\r\n":e.includes("\r")&&(I="\r"),R){for(let t=0;t<R;t++){if(o.reportProgressFunc&&(R>1e3&&R<2e3?t===Ie&&o.reportProgressFunc(Math.floor((o.reportProgressFuncTo-o.reportProgressFuncFrom)/2)):R>=2e3&&(_=o.reportProgressFuncFrom+Math.floor(t/R*(ue||1)),_!==G&&(G=_,o.reportProgressFunc(_)))),w++,!b&&E&&e[t]==="}"&&e[t-1]==="}"&&(c+1>=o.lineLengthLimit?(n.push(t,t,I),c=0):(m=t,$=t,y=" ")),b&&typeof b=="number"&&t>=b&&(b=void 0),S!==null&&e.startsWith("<\/script",t)&&!H(e[t+8])){if((o.removeIndentations||o.removeLineBreaks)&&t>0&&e[~-t]&&!e[~-t].trim()){for(let h=t;h--;)if(e[h]==="\n"||e[h]==="\r"||e[h].trim()){h+1<t&&n.push(h+1,t);break}}S=null,b=!1,t+=8;continue}if(!b&&!E&&e.startsWith("<script",t)&&!H(e[t+7])){S=t,b=!0;let h="";(o.removeLineBreaks||o.removeIndentations)&&a!==null&&(a>0&&(h=I),n.push(a,t,h)),a=null,g=null}if(v!==null&&C===null&&!/\w/.test(e[t])){C=e.slice(v,t);let h=A(e,~-t);typeof h=="number"&&e[h]===">"&&!e[t].trim()&&A(e,t)?n.push(t,A(e,t)):h&&e[h]==="/"&&e[A(e,h)]===">"&&(!e[t].trim()&&A(e,t)&&n.push(t,A(e,t)),e[h+1]!==">"&&A(e,h+1)&&n.push(h+1,A(e,h+1)))}if(!b&&!E&&!u&&e[~-t]==="<"&&v===null&&(/\w/.test(e[t])?v=t:e[A(e,~-t)]==="/"&&/\w/.test(e[A(e,A(e,~-t))]||"")&&(v=A(e,A(e,~-t)))),!b&&(E||u)&&d!==null&&e[t]==="*"&&e[t+1]==="/"&&([m,$]=Z({str:e,from:d,to:t+2,ifLeftSideIncludesThisThenCropTightly:ee||"",ifRightSideIncludesThisThenCropTightly:te||""}),d=null,m!=null?n.push(m,$):(c+=1,t+=1),b=t+2),!b&&(E||u)&&d===null&&e[t]==="/"&&e[t+1]==="*"&&(f.removeCSSComments||(f.removeCSSComments=!0),o.removeCSSComments&&(d=t)),p&&e.startsWith("![endif",t+1)&&(p=!1),!b&&!E&&!u&&O!==null){let h;e.startsWith("-->",t)?h=3:e[t]===">"&&e[t-1]==="]"&&(h=1),h&&([m,$]=Z({str:e,from:O,to:t+h}),O=null,m!=null?o.lineLengthLimit&&w-($-m)>=o.lineLengthLimit?(n.push(m,$,I),w=-h):(n.push(m,$),w-=$-m):(c+=h-1,t+=h-1),b=t+h)}if(!b&&!E&&!u&&(e.startsWith("<!--",t)||o.removeHTMLComments===2&&e.startsWith("<![endif",t))&&O===null&&(e.startsWith("[if",t+4)?(p||(p=!0),o.removeHTMLComments===2&&(O=t)):o.removeHTMLComments&&(!p||o.removeHTMLComments===2)&&(O=t),f.removeHTMLComments||(f.removeHTMLComments=!0)),!b&&E&&d===null&&e.startsWith("</style",t)&&!H(e[t+7])?E=!1:!b&&!E&&d===null&&e.startsWith("<style",t)&&!H(e[t+6])&&(E=!0,(o.removeLineBreaks||o.removeIndentations)&&o.breakToTheLeftOf.includes("<style")&&e.startsWith(' type="text/css">',t+6)&&e[t+24]&&n.push(t+23,t+23,I)),!b&&!u&&"\"'".includes(e[t])&&e.endsWith("style=",t)&&(u=t),!b&&!e[t].trim())a===null&&(a=t);else if(!b&&!((E||u)&&d!==null)){if(a!==null){if(o.removeLineBreaks&&(c+=1),F)F=!1,(o.removeIndentations||o.removeLineBreaks)&&n.push(0,t);else if(o.removeIndentations&&!o.removeLineBreaks&&(!s&&g!==null&&t>g?n.push(g+1,t):a+1<t&&(e.endsWith("]>",a)||e.endsWith("-->",a)||e.startsWith("<![",t)||e.startsWith("<!--<![",t)?n.push(a,t):e[a]===" "?n.push(a+1,t):e[~-t]===" "?n.push(a,~-t):n.push(a,t," "))),o.removeLineBreaks||u){if(i.includes(e[t])&&le(e,t,o.breakToTheLeftOf)){!("\r\n".includes(e[~-t])&&a===~-t)&&!(e[~-t]==="\n"&&e[t-2]==="\r"&&a===t-2)&&n.push(a,t,I),m=null,$=null,y=null,a=null,c=1;continue}let h=" ";e[t]==="<"&&B(e,t,o.mindTheInlineTags,{cb:q=>!q||!/\w/.test(q)})||(e[~-a]&&Ae.includes(e[~-a])&&Ce.includes(e[t])||(E||u)&&d===null&&(ee.includes(e[~-a])||te.includes(e[t]))||e.startsWith("!important",t)&&!p||u&&(e[~-a]==="'"||e[~-a]==='"')||e[~-a]==="}"&&e.startsWith("</style",t)||e[t]===">"&&("'\"".includes(e[X(e,t)])||e[A(e,t)]==="<")||e[t]==="/"&&e[A(e,t)]===">")&&(h="",e[t]==="/"&&e[t+1]===">"&&A(e,t)&&A(e,t)>t+1&&(n.push(t+1,A(e,t)),c-=A(e,t)-t+1)),E&&e[t]==="}"&&a&&e[a-1]==="}"&&(h=" "),h!=null&&h.length&&(c+=1),o.lineLengthLimit?c>=o.lineLengthLimit||!e[t+1]||e[t]===">"||e[t]==="/"&&e[t+1]===">"?((c>o.lineLengthLimit||c===o.lineLengthLimit&&((ge=e[t+1])!=null&&ge.trim())&&!U.includes(e[t])&&!j.includes(e[t+1]))&&(h=I,c=1),(c>o.lineLengthLimit||!(h===" "&&t===a+1))&&(n.push(a,t,h),g=null),m=null,$=null,y=null):(m===null||a<m)&&(m=a,$=t,y=h):t===a+1&&h===" "||n.push(a,t,h)}a=null,s||(s=!0)}else F&&(F=!1),o.removeLineBreaks&&(c+=1);s||(s=!0)}if(!b&&!F&&t!==0&&o.removeLineBreaks&&(o.lineLengthLimit||i)&&!e.startsWith("</a",t)){if(i&&le(e,t,o.breakToTheLeftOf)&&e.slice(0,t).trim()&&(!e.startsWith("<![endif]",t)||!we(e,t,"<!--"))){n.push(t,t,I),m=null,$=null,y=null,c=1;continue}else if(o.lineLengthLimit&&c<=o.lineLengthLimit){if(!e[t+1]||j.includes(e[t])&&!Le.includes(e[t])||U.includes(e[t])||!e[t].trim()){if(m!==null&&$!==null&&(m!==$||y!=null&&y.length)){let h=y;e[t].trim()&&((fe=e[t+1])!=null&&fe.trim())&&c+(y?y.length:0)>o.lineLengthLimit&&(h=I),(c+(h?h.length:0)>o.lineLengthLimit||!(h===" "&&$===m+1&&e[m]===" "))&&(e[~-m]==="}"&&e[$]==="{"||(n.push(m,$,h),g=null))}e[t].trim()&&(j.includes(e[t])||e[~-t]&&U.includes(e[~-t]))&&D(x)&&(!C||!o.mindTheInlineTags.includes(C))&&!(e[t]==="<"&&B(e,t,o.mindTheInlineTags,{cb:h=>!h||!/\w/.test(h)}))&&!(e[t]==="<"&&B(e,t,o.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:h=>!h||!/\w/.test(h)}))?(m=t,$=t,y=null):d===null&&m!==null&&(u||!o.mindTheInlineTags||!Array.isArray(o.mindTheInlineTags)||Array.isArray(o.mindTheInlineTags.length)&&!o.mindTheInlineTags.length||!D(C)||Array.isArray(o.mindTheInlineTags)&&o.mindTheInlineTags.length&&D(C)&&!o.mindTheInlineTags.includes(C))&&!(e[t]==="<"&&B(e,t,o.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:h=>!h||!/\w/.test(h)}))&&(m=null,$=null,y=null)}}else if(o.lineLengthLimit)if(j.includes(e[t])&&!(e[t]==="<"&&B(e,t,o.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:h=>!h||!/\w/.test(h)})))if(m!==null&&$!==null&&(m!==$||y!=null&&y.length)){let h=y!=null&&y.length?y.length:0;c-($-m-h)-1>o.lineLengthLimit||(n.push(m,$,y),c-($-m-h)-1===o.lineLengthLimit&&(n.push(t,t,I),c=0),m=null,$=null,y=null)}else n.push(t,t,I),c=0;else e[t+1]&&U.includes(e[t])&&D(C)&&Array.isArray(o.mindTheInlineTags)&&o.mindTheInlineTags.length&&!o.mindTheInlineTags.includes(C)?m!==null&&$!==null&&(m!==$||y!=null&&y.length)||(n.push(t+1,t+1,I),c=0):e[t].trim()&&(e[t+1]||m!==null&&$!==null&&(m!==$||y!=null&&y.length)&&n.push(m,$,I))}if(!b&&!F&&o.removeLineBreaks&&o.lineLengthLimit&&c>=o.lineLengthLimit&&m!==null&&$!==null&&!U.includes(e[t])&&!j.includes(e[t])&&!"/".includes(e[t])&&!(c===o.lineLengthLimit&&e[t+1]&&!e[t+1].trim())){let h=I;e[t+1]&&!e[t+1].trim()&&c===o.lineLengthLimit&&(h=y),h===I&&!e[~-m].trim()&&X(e,m)&&(m=X(e,m)+1),n.push(m,$,h),c=t-$,e[t].length&&(c+=1),m=null,$=null,y=null}if((!b&&e[t]==="\n"||e[t]==="\r"&&(!e[t+1]||e[t+1]&&e[t+1]!=="\n"))&&(g=t,s&&(s=!1),!o.removeLineBreaks&&a!==null&&a<t&&e[t+1]&&e[t+1]!=="\r"&&e[t+1]!=="\n"&&n.push(a,t)),e[t+1]||(E&&d!==null?n.push([...Z({str:e,from:d,to:t,ifLeftSideIncludesThisThenCropTightly:ee||"",ifRightSideIncludesThisThenCropTightly:te||""})]):a&&e[t]!=="\n"&&e[t]!=="\r"?n.push(a,t+1):a&&(e[t]==="\r"&&e[t+1]==="\n"||e[t]==="\n"&&e[t-1]!=="\r")&&n.push(a,t)),!b&&u&&u<t&&e[u]===e[t]&&(u=null),!b&&!E&&e.startsWith("<pre",t)&&!H(e[t+4])){let h=e.indexOf("</pre",t+5);h>0&&(b=h)}if(!b&&!E&&e.startsWith("<code",t)&&!H(e[t+5])){let h=e.indexOf("</code",t+5);h>0&&(b=h)}if(!b&&e.startsWith("<![CDATA[",t)){let h=e.indexOf("]]>",t+9);h>0&&(b=h)}if(!b&&!E&&!u&&v!==null&&e[t]===">"&&(e[A(e,t)]==="<"&&(x=C),v=null,C=null),e[t]==="<"&&x!==null&&(x=null),!b&&E&&e[t]==="{"&&e[t+1]==="{"){let h=e.indexOf("}}",t+2);h!==-1&&(b=h+2)}let ne=!0}let N=n.current();if(N){let t=o.reportProgressFuncTo-(o.reportProgressFuncTo-o.reportProgressFuncFrom)*ae,ne=be(e,N,q=>{o.reportProgressFunc&&R>=2e3&&(_=Math.floor(t+(o.reportProgressFuncTo-t)*(q/100)),_!==G&&(G=_,o.reportProgressFunc(_)))}),h=ne.length;return{log:{timeTakenInMilliseconds:Date.now()-l,originalLength:R,cleanedLength:h,bytesSaved:Math.max(R-h,0),percentageReducedOfOriginal:R?Math.round(Math.max(R-h,0)*100/R):0},ranges:N,applicableOpts:f,result:ne}}}return{log:{timeTakenInMilliseconds:Date.now()-l,originalLength:R,cleanedLength:R,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:f,ranges:null,result:e}}return Pe(et);})();
|
|
10
|
+
"use strict";var htmlCrush=(()=>{var ue=Object.defineProperty,pt=Object.defineProperties,$t=Object.getOwnPropertyDescriptor,bt=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertyNames,We=Object.getOwnPropertySymbols;var He=Object.prototype.hasOwnProperty,yt=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))yt.call(n,t)&&Te(e,t,n[t]);return e},le=(e,n)=>pt(e,bt(n));var St=(e,n)=>{for(var t in n)ue(e,t,{get:n[t],enumerable:!0})},Et=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of Tt(n))!He.call(e,l)&&l!==t&&ue(e,l,{get:()=>n[l],enumerable:!(r=$t(n,l))||r.enumerable});return e};var Ct=e=>Et(ue({},"__esModule",{value:!0}),e);var oe=(e,n,t)=>Te(e,typeof n!="symbol"?n+"":n,t);var Kt={};St(Kt,{crush:()=>Gt,defaults:()=>ve,version:()=>Jt});function At(){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 Ot(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(Ot(r)):e.append(n[t])}e.append('"')}}function wt(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=At(),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(wt(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 Lt=["_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=Lt.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 vt(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 Zt=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"]),It=Object.prototype.hasOwnProperty,Ge=Function.prototype.toString,Dt=Ge.call(Object);var en=Map.prototype.entries,tn=Set.prototype.values;var Ue,nn=(Ue=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:Ue.get,qe,rn=(qe=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:qe.get,Je,_n=(Je=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:Je.get,ze,ln=(ze=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:ze.get,on=RegExp.prototype.test;function Rt(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(!w(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:vt(Rt(e))}function H(e){if(!w(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)===Dt}function w(e){return typeof e=="string"}function Ee(e){return Number.isFinite(e)}function G(e){return Number.isSafeInteger(e)&&e>=0}var sn=Date.prototype.getTime;function ce(e){return e!=null}function Ye(e,n){return e!=null&&It.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 xt(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?xt(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 Nt(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(G(e))return e;if(typeof e=="string"&&/^\d+$/.test(e)){let n=Number(e);return G(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)&&!w(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&&!(w(s)&&!s.length)?[u,c,s]:[u,c])}return{ranges:n}}function kt(e){return e[2]===void 0&&e[0]===e[1]}function Mt(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,")"):G(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&&!(w(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)),w(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),w(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)&&!w(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,w(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=Nt(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(!G(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=Mt(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)||kt(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 Pt(e,n){return n==null?0:typeof n!="number"||!Number.isInteger(n)||n<0?null:n>e?e:n}function q(e,n=0){if(typeof e!="string"||!e.length)return null;(!n||typeof n!="number")&&(n=0);let t=e[n+1];if(!t)return null;if(!Z(t.charCodeAt(0)))return n+1;if(t=e[n+2],t&&!Z(t.charCodeAt(0)))return n+2;for(let r=n+3,l=e.length;r<l;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=Pt(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 tt(e){return typeof e!="string"?e:e.length?[e]:[]}var nt={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},rt=e=>e+1,Wt=e=>e-1;function Ht(e,n,t,r,l=()=>!1,i=!1,s=rt){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({},nt),l);if(i.maxMismatches=(f=l==null?void 0:l.maxMismatches)!=null?f:nt.maxMismatches,jt(i.maxMismatches,e),typeof i.trimCharsBeforeMatching=="string"&&(i.trimCharsBeforeMatching=tt(i.trimCharsBeforeMatching)),i.trimCharsBeforeMatching=i.trimCharsBeforeMatching.map(m=>w(m)?m:String(m)),!w(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(w(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(Ft(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&&w(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 k=n[y];if((!i.trimBeforeMatching||i.trimBeforeMatching&&(k!=null&&k.trim()))&&(!((d=i.trimCharsBeforeMatching)!=null&&d.length)||k!==void 0&&!A(k))){a=y;break}}else if(e.startsWith("matchRight"))for(let y=R;y<n.length;y++){let k=n[y];if((!i.trimBeforeMatching||i.trimBeforeMatching&&k.trim())&&(!((b=i.trimCharsBeforeMatching)!=null&&b.length)||!A(k))){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(w)){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"?Wt:rt;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,k="",D=Ht(n,p,$,i,A,u,N);if(D&&u)return!i.cb||i.cb(M,k,y)?$:!1;if(Number.isInteger(D)&&(y=e.startsWith("matchLeft")?D-1:D+1,e[5]==="L"?k=n.slice(0,D):k=n.slice(y)),y<0&&(y=void 0),n[y]&&(M=n[y]),Number.isInteger(D)&&(!i.cb||i.cb(M,k,y)))return $}return!1}function jt(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 Ft(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 it(e,n,t,r){return Oe("matchLeft",e,n,t,r)}function _t(e,n,t,r){return Oe("matchRightIncl",e,n,t,r)}function lt(e,n,t,r){return Oe("matchRight",e,n,t,r)}var Bt=["_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=Bt.slice(1).split("_"),Le=[],ot=127;for(let e=0;e<we.length;e+=2){let n=ot+1+Number.parseInt(we[e],36),t=n+Number.parseInt(we[e+1],36);Le.push([n,t]),ot=t}function Ut(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 st(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),Ut(r)}var K={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 w(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(!w(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(!G(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(!G(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&&!w(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&&!w(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&&!w(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&&!w(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({},K),e),{ifLeftSideIncludesThisThenCropTightly:(s=e.ifLeftSideIncludesThisThenCropTightly)!=null?s:K.ifLeftSideIncludesThisThenCropTightly,ifLeftSideIncludesThisCropItToo:(u=e.ifLeftSideIncludesThisCropItToo)!=null?u:K.ifLeftSideIncludesThisCropItToo,ifRightSideIncludesThisThenCropTightly:(c=e.ifRightSideIncludesThisThenCropTightly)!=null?c:K.ifRightSideIncludesThisThenCropTightly,ifRightSideIncludesThisCropItToo:(h=e.ifRightSideIncludesThisCropItToo)!=null?h:K.ifRightSideIncludesThisCropItToo,extendToOneSide:(E=e.extendToOneSide)!=null?E:K.extendToOneSide,wipeAllWhitespaceOnLeft:(A=e.wipeAllWhitespaceOnLeft)!=null?A:K.wipeAllWhitespaceOnLeft,wipeAllWhitespaceOnRight:(p=e.wipeAllWhitespaceOnRight)!=null?p:K.wipeAllWhitespaceOnRight,addSingleSpaceToPreventAccidentalConcatenation:(N=e.addSingleSpaceToPreventAccidentalConcatenation)!=null?N:K.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"&&w(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"&&w(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))))&&(st(r,l-1)||st(r,i))?[l,i," "]:[l,i]}var at="6.3.0";function ut(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 Jt=at;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 ft(e){return e!==void 0&&(Ie(e.charCodeAt(0))||":-.".includes(e))}function ct(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 zt(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 Gt(e,n){var ke,Me;let t=Date.now();if(!w(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(!w(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=>w(S)&&!!S.length&&![...S].some(_=>!se(_))),A=new Map,p=Array.isArray(i.breakToTheLeftOf)&&!!i.breakToTheLeftOf.length&&i.breakToTheLeftOf.every(w)&&!(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!!_t(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!!lt(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<V&&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&&ft(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!ft(e[o+_.length])&&!Ke(ut(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,k=!1,D=null,ee=null,te=null,j=null,Q=null,pe=null,O,T=null,L=null,x=null,B=null,z=null,ae=null,ne=">};",re="<",ht="!",gt=">",mt="<",De="{},:;<>~+",$e=De,be=De,X=!0,V=e.length;function Re(S,_=!1){let v=S.length,o=Math.max(V-v,0),I=ct(e),J=_?I:ct(S),Pe=Math.max(I-J,0);return{timeTakenInMilliseconds:Date.now()-t,originalLength:V,cleanedLength:v,bytesSaved:o,percentageReducedOfOriginal:V?Math.round(o*100/V):0,originalLengthInCodeUnits:V,cleanedLengthInCodeUnits:v,codeUnitsSaved:o,percentageReducedOfOriginalInCodeUnits:V?Math.round(o*100/V):0,originalLengthInUtf8Bytes:I,cleanedLengthInUtf8Bytes:J,utf8BytesSaved:Pe,percentageReducedOfOriginalInUtf8Bytes:I?Math.round(Pe*100/I):0}}let ie=0;for(;ie<V&&H(e[ie]);)ie++;let dt=Math.floor(V/2),xe=.01,Ne=1-xe,Ve=null;function _e(S){if(!i.reportProgressFunc||V<=1e3)return;let _=Math.max(0,Math.min(S,1)),v=Math.floor(i.reportProgressFuncFrom+(i.reportProgressFuncTo-i.reportProgressFuncFrom)*_);v!==Ve&&(Ve=v,i.reportProgressFunc(v))}let P="\n";if(e.includes("\r\n")?P="\r\n":e.includes("\r")&&(P="\r"),V){for(let _=0;_<V;_++){if(i.reportProgressFunc&&(V>1e3&&V<2e3?_===dt&&_e(.5):V>=2e3&&_e(_/V*Ne)),M++,!O&&y&&e[_]==="}"&&e[_-1]==="}"&&($+1>=i.lineLengthLimit?(l.push(_,_,P),$=0):(T=_,L=_,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,L]=de({str:e,from:j,to:_+2,ifLeftSideIncludesThisThenCropTightly:$e||"",ifRightSideIncludesThisThenCropTightly:be||""}),j=null,T!=null?l.push(T,L):($+=1,_+=1),O=_+2),!O&&(y||D)&&j===null&&e[_]==="/"&&e[_+1]==="*"&&(u.removeCSSComments||(u.removeCSSComments=!0),i.removeCSSComments&&(j=_)),k&&e.startsWith("![endif",_+1)&&(k=!1),!O&&!y&&!D&&Q!==null){let o;e.startsWith("-->",_)?o=3:e[_]===">"&&e[_-1]==="]"&&(o=1),o&&([T,L]=de({str:e,from:Q,to:_+o}),Q=null,T!=null?i.removeLineBreaks&&i.lineLengthLimit&&M-(L-T)>=i.lineLengthLimit?(l.push(T,L,P),M=-o):(l.push(T,L),M-=L-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)?(k||(k=!0),i.removeHTMLComments===2&&(Q=_)):i.removeHTMLComments&&(!k||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,L=null,x=null,a=null,$=1;continue}let o=" ";if(!(e[_]==="<"&&f(_,!1))){if(e[~-a]&>.includes(e[~-a])&&mt.includes(e[_])||(y||D)&&j===null&&($e.includes(e[~-a])||be.includes(e[_]))||e[_]==="!"&&e.startsWith("!important",_)&&!k||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&&((ke=e[_+1])!=null&&ke.trim())&&!ne.includes(e[_])&&!re.includes(e[_+1]))&&(o=P,$=1),($>i.lineLengthLimit||!(o===" "&&_===a+1))&&(l.push(a,_,o),m=null),T=null,L=null,x=null):(T===null||a<T)&&(T=a,L=_,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]",_)||!it(e,_,"<!--"))){l.push(_,_,P),T=null,L=null,x=null,$=1;continue}else if(i.lineLengthLimit&&$<=i.lineLengthLimit){if(!e[_+1]||re.includes(e[_])&&!ht.includes(e[_])||ne.includes(e[_])||H(e[_])){if(T!==null&&L!==null&&(T!==L||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===" "&&L===T+1&&e[T]===" "))&&(e[~-T]==="}"&&e[L]==="{"||(l.push(T,L,o),m=null))}!H(e[_])&&(re.includes(e[_])||e[~-_]&&ne.includes(e[~-_]))&&w(ae)&&(!B||!h.has(B))&&!(e[_]==="<"&&f(_,!1))&&!(e[_]==="<"&&f(_,!0))?(T=_,L=_,x=null):j===null&&T!==null&&(D||!i.mindTheInlineTags||!Array.isArray(i.mindTheInlineTags)||Array.isArray(i.mindTheInlineTags.length)&&!i.mindTheInlineTags.length||!w(B)||Array.isArray(i.mindTheInlineTags)&&i.mindTheInlineTags.length&&w(B)&&!h.has(B))&&!(e[_]==="<"&&f(_,!0))&&(T=null,L=null,x=null)}}else if(i.lineLengthLimit)if(re.includes(e[_])&&!(e[_]==="<"&&f(_,!0)))if(T!==null&&L!==null&&(T!==L||x!=null&&x.length)){let o=x!=null&&x.length?x.length:0;$-(L-T-o)-1>i.lineLengthLimit||(l.push(T,L,x),$-(L-T-o)-1===i.lineLengthLimit&&(l.push(_,_,P),$=0),T=null,L=null,x=null)}else l.push(_,_,P),$=0;else e[_+1]&&ne.includes(e[_])&&w(B)&&Array.isArray(i.mindTheInlineTags)&&i.mindTheInlineTags.length&&!h.has(B)?T!==null&&L!==null&&(T!==L||x!=null&&x.length)||(l.push(_+1,_+1,P),$=0):H(e[_])||e[_+1]||T!==null&&L!==null&&(T!==L||x!=null&&x.length)&&l.push(T,L,P)}if(!O&&!X&&i.removeLineBreaks&&i.lineLengthLimit&&$>=i.lineLengthLimit&&T!==null&&L!==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,L,o),$=_-L,e[_].length&&($+=1),T=null,L=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<V||i.removeIndentations||i.removeLineBreaks)){let o=e.endsWith("\r\n")?V-2:e.endsWith("\n")||e.endsWith("\r")?V-1:V;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?V: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&&V>=2e3?o=>{_e(Ne+xe*(o/100))}:void 0,v=zt(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 Ct(Kt);})();
|
|
11
11
|
/**
|
|
12
|
-
* @name codsen-
|
|
13
|
-
* @fileoverview
|
|
14
|
-
* @version 1.
|
|
12
|
+
* @name codsen-format-diagnostic-value
|
|
13
|
+
* @fileoverview Safely format untrusted JavaScript values for diagnostics
|
|
14
|
+
* @version 1.1.0
|
|
15
15
|
* @author Roy Revelt
|
|
16
16
|
* @license MIT
|
|
17
|
-
* {@link https://codsen.com/os/codsen-
|
|
17
|
+
* {@link https://codsen.com/os/codsen-format-diagnostic-value/}
|
|
18
18
|
*/
|
|
19
19
|
/**
|
|
20
|
-
* @name
|
|
21
|
-
* @fileoverview
|
|
22
|
-
* @version
|
|
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.1
|
|
20
|
+
* @name codsen-utils
|
|
21
|
+
* @fileoverview Various utility functions
|
|
22
|
+
* @version 1.10.0
|
|
31
23
|
* @author Roy Revelt
|
|
32
24
|
* @license MIT
|
|
33
|
-
* {@link https://codsen.com/os/
|
|
25
|
+
* {@link https://codsen.com/os/codsen-utils/}
|
|
34
26
|
*/
|
|
35
27
|
/**
|
|
36
|
-
* @name
|
|
37
|
-
* @fileoverview
|
|
38
|
-
* @version 7.
|
|
28
|
+
* @name string-collapse-leading-whitespace
|
|
29
|
+
* @fileoverview Collapse the leading and trailing whitespace of a string
|
|
30
|
+
* @version 7.3.0
|
|
39
31
|
* @author Roy Revelt
|
|
40
32
|
* @license MIT
|
|
41
|
-
* {@link https://codsen.com/os/
|
|
33
|
+
* {@link https://codsen.com/os/string-collapse-leading-whitespace/}
|
|
42
34
|
*/
|
|
43
35
|
/**
|
|
44
|
-
* @name
|
|
45
|
-
* @fileoverview
|
|
46
|
-
* @version
|
|
36
|
+
* @name ranges-sort
|
|
37
|
+
* @fileoverview Sort string index ranges
|
|
38
|
+
* @version 6.2.2
|
|
47
39
|
* @author Roy Revelt
|
|
48
40
|
* @license MIT
|
|
49
|
-
* {@link https://codsen.com/os/
|
|
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.
|
|
46
|
+
* @version 7.3.0
|
|
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.
|
|
54
|
+
* @version 6.2.2
|
|
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.
|
|
62
|
+
* @version 5.2.2
|
|
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.
|
|
70
|
+
* @version 9.2.3
|
|
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.
|
|
78
|
+
* @version 4.2.2
|
|
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.
|
|
3
|
+
"version": "6.3.0",
|
|
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.
|
|
80
|
-
"ranges-
|
|
81
|
-
"
|
|
82
|
-
"string-left-right": "^
|
|
83
|
-
"string-
|
|
84
|
-
"string-range-expander": "^4.2.0"
|
|
79
|
+
"codsen-utils": "^1.10.0",
|
|
80
|
+
"ranges-push": "^7.3.0",
|
|
81
|
+
"string-left-right": "^6.2.2",
|
|
82
|
+
"string-match-left-right": "^9.2.3",
|
|
83
|
+
"string-range-expander": "^4.2.2"
|
|
85
84
|
},
|
|
86
85
|
"devDependencies": {
|
|
87
|
-
"test-mixer": "^4.
|
|
86
|
+
"test-mixer": "^4.4.0"
|
|
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?:
|
|
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 };
|