string-remove-widows 4.2.7 → 4.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-remove-widows
|
|
3
3
|
* @fileoverview Helps to prevent widow words in a text
|
|
4
|
-
* @version 4.2.
|
|
4
|
+
* @version 4.2.8
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-remove-widows/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{formatDiagnosticValue as j,isLetter as sn,isPlainObject as ze,rawMDash as Ge,rawNbsp as de,rawNDash as Ze}from"codsen-utils";import{rApply as dn}from"ranges-apply";import{Ranges as un}from"ranges-push";import{left as $e,right as an}from"string-left-right";var je="4.2.
|
|
10
|
+
import{formatDiagnosticValue as j,isLetter as sn,isPlainObject as ze,rawMDash as Ge,rawNbsp as de,rawNDash as Ze}from"codsen-utils";import{rApply as dn}from"ranges-apply";import{Ranges as un}from"ranges-push";import{left as $e,right as an}from"string-left-right";var je="4.2.8";function ge(e){return e===32||e>=9&&e<=13&&e!==11}function pe(e,t,r=!0){let i=t+(e[t+1]==="/"?2:1),s=e.charCodeAt(i)|32;if(s<97||s>122)return;for(i+=1;i<e.length;){let o=e.charCodeAt(i);if(o<=62&&(ge(o)||o===47||o===34||o===39||o>=60&&o<=62))break;i+=1}if(e[i]&&!ge(e.charCodeAt(i))&&e[i]!=="/"&&e[i]!==">")return;let d,a=!1,u=!1;for(;i<e.length;i+=1){let o=e[i];if(d)o===d&&(d=void 0);else{if(o===">")return i+1;if(o==="<")return r?i:void 0;ge(e.charCodeAt(i))?u=!1:a?(a=!1,o==='"'||o==="'"?d=o:u=!0):o==="="&&!u&&(a=!0)}}return r?e.length:void 0}var on=new Set(["address","article","aside","blockquote","body","br","caption","center","dd","details","dialog","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"]),rn=new Set(["script","style","pre","code","textarea","title"]);function se(e,t){if(e.startsWith("<!--",t)||e.startsWith("<![CDATA[",t)){let o=e.startsWith("<!--",t)?"-->":"]]>",b=e.indexOf(o,t+4);return{end:b<0?e.length:b+o.length,boundary:!1}}if(e.startsWith("<?",t)){let o=e.indexOf("?>",t+2);return{end:o<0?e.length:o+2,boundary:!1}}if(e.startsWith("<!",t)){let o,b=0;for(let h=t+2;h<e.length;h+=1){let p=e[h];if(o)p===o&&(o=void 0);else if(p==='"'||p==="'")o=p;else if(p==="[")b+=1;else if(p==="]")b=Math.max(0,b-1);else if(p===">"&&!b)return{end:h+1,boundary:!1}}return{end:e.length,boundary:!1}}let r=pe(e,t);if(r===void 0)return;let i=e[t+1]==="/",s=t+(i?2:1),d=s;for(;d<r&&!/[\t\n\f\r />]/.test(e[d]);)d+=1;let a=e.slice(s,d).toLowerCase(),u=on.has(a)||a==="script"||a==="style";if(!i&&rn.has(a)&&e[r-1]===">"){let o=r,b=1;for(;o<e.length&&(o=e.indexOf("<",o),o!==-1);){if((a==="pre"||a==="code")&&(e[o+1]==="!"||e[o+1]==="?")){o=se(e,o).end;continue}let h=e[o+1]==="/",p=o+(h?2:1);if(e.slice(p,p+a.length).toLowerCase()===a&&/[\t\n\f\r />]/.test(e[p+a.length]||"")&&(h||a==="pre"||a==="code")){let W=pe(e,o,!1);if(W!==void 0){if(b+=h?-1:1,!b)return{end:W,boundary:u};o=W;continue}}if(a==="pre"||a==="code"){if(/^<(script|style|textarea|title)(?=[\t\n\f\r />])/i.exec(e.slice(o,o+11))){o=se(e,o).end;continue}let m=pe(e,o);if(m!==void 0){o=m;continue}}o+=1}return{end:e.length,boundary:u}}return{end:r,boundary:u}}function Ie(e,t,r){let i=[],s=t;for(;s<e.length;){let d=e.indexOf("{%",s);if(d<0)break;let a=e.indexOf("%}",d+2);if(a<0)break;let u=/^-?\s*(if|for|endif|endfor)(?=[\s%-]|$)/.exec(e.slice(d+2,a));if(u&&!r(d,a+2)){let o=u[1];if(o==="if"||o==="for")i.push(o);else if(i[i.length-1]===o.slice(3)&&(i.pop(),!i.length))return a+2}s=a+2}}var J=" ",he="\\0000A0",be="\\u00A0",xe="–";var He="\\u2013",Ve="—";var _e="\\u2014",G=[{heads:"{{",tails:"}}"},{heads:["{% if","{%- if"],tails:["{% endif","{%- endif"]},{heads:["{% for","{%- for"],tails:["{% endfor","{%- endfor"]},{heads:["{%","{%-"],tails:["%}","-%}"]},{heads:"{#",tails:"#}"}],Le=[{heads:"{{",tails:"}}"}],we=[{heads:["<%","<%=","<%-"],tails:["%>","=%>","-%>"]}];var Fn=je,Ye=4,Qe=5,E={removeWidowPreventionMeasures:!1,convertEntities:!0,targetLanguage:"html",UKPostcodes:!1,hyphens:!0,minWordCount:Ye,minCharCount:Qe,ignore:[],reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,tagRanges:[]},Mn=Object.freeze({...E,ignore:Object.freeze([]),tagRanges:Object.freeze([])}),ln=[xe,He,Ve,_e],cn=/[&\\\u00a0\u2013\u2014\r\n<>/0-9-]/;function fn(e,t){let r=0,i=0,s,d,a;for(let h=0;h<e.length;h+=1)if(e[h].trim())i+=1,e[h-1]?.trim()||(r+=1),s!==void 0&&(d=s,a=h,s=void 0);else if(e[h-1]?.trim()){let p=h+1;for(;p<e.length&&!e[p].trim();)p+=1;p<e.length&&(s=h)}let u=!1,o=null,b=e;return d!==void 0&&a!==void 0&&r>=Ye&&i>=Qe&&(u=!0,o=[[d,a,J]],b=`${e.slice(0,d)}${J}${e.slice(a)}`),{res:b,ranges:o,log:{timeTakenInMilliseconds:Date.now()-t},whatWasDone:{removeWidows:u,convertEntities:!1},applicableOpts:{removeWidows:u,convertEntities:u}}}function Sn(e,t){let r=Date.now();if(typeof e!="string")throw e===void 0?new Error("string-remove-widows/removeWidows(): [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`string-remove-widows/removeWidows(): [THROW_ID_02] the first input argument must be string! It was given as "${typeof e}", equal to:
|
|
11
11
|
${j(e,4)}`);if(t!==void 0&&!ze(t))throw new Error(`string-remove-widows/removeWidows(): [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ${typeof t}, equal to ${j(t,4)}`);if(t===void 0&&!cn.test(e))return fn(e,r);let i=Array.isArray,s=e.length,d=new Map,a=["."],u=.06,o,b,h=0,p=0,W=0,m,y,R,M,k,A,K=[],Q=[],D,S,O,P,w,I=0,Ee=[],x,q,_,z,l=Wn(e,t),ke={removeWidows:!1,convertEntities:!1},V={removeWidows:!1,convertEntities:!1},X=new Map,ee=new Set;function Pe(n,c){return`${n}:${c}`}function Te(n,c,g){if(!n.length||c>=g)return!1;let $=0,F=n.length;for(;$<F;){let L=Math.floor(($+F)/2);n[L][1]<=c?$=L+1:F=L}return!!(n[$]&&n[$][0]<g)}function N(n,c){return Te(l.tagRanges,n,c)||Te(Ee,n,c)}function ne(n,c){return e.startsWith(n,c)&&!N(c,c+n.length)}function Ce(n,c){return(typeof n.heads=="string"?ne(n.heads,c):n.heads.some($=>ne($,c)))&&(!n.nestedBlock||/^\{%-?\s*(if|for)(?=[\s%-]|$)/.test(e.slice(c,c+12)))}let ue=l.reportProgressFuncFrom+Math.floor((l.reportProgressFuncTo-l.reportProgressFuncFrom)*(1-u));function ae(n){if(!l.reportProgressFunc)return;let c=Math.max(l.reportProgressFuncFrom,Math.min(l.reportProgressFuncTo,Math.floor(n)));(b===void 0||c>b)&&(b=c,l.reportProgressFunc(c))}function te(n,c){if(N(n,c))return!1;let g=de;l.removeWidowPreventionMeasures?g=" ":l.convertEntities&&(g=J,l.targetLanguage==="css"?g=he:l.targetLanguage==="js"&&(g=be));let $=Pe(n,c),F=Z(e,n)===c;return V.removeWidows=!0,F&&(l.removeWidowPreventionMeasures?ee.delete($):ee.add($)),e.slice(n,c)!==g?(d.set($,[n,c,g]),X.set($,F&&g!==" "?"convertEntities":"removeWidows"),!0):(d.delete($),X.delete($),!1)}function le(){p=0,W=0,m=void 0,y=void 0,R=void 0,M=void 0,k=void 0,A=void 0,K=[],Q=[],D=void 0,S=void 0,O=void 0,P=void 0}function Re(){let n,c;if(R!==void 0&&M!==void 0&&D!==void 0&&S!==void 0?R>D?(n=R,c=M):(n=D,c=S):R!==void 0&&M!==void 0?(n=R,c=M):D!==void 0&&S!==void 0&&(n=D,c=S),(n===void 0||c===void 0)&&m!==void 0&&y!==void 0&&(n=m,c=y),n!==void 0&&c!==void 0&&(!l.minWordCount||p>=l.minWordCount)&&(!l.minCharCount||W>=l.minCharCount)&&!N(n,c))if(V.removeWidows=!0,n===R&&c===M)for(let[g,$]of Q)te(g,$);else te(n,c);le()}function Ae(n){k!==void 0&&(m=R,y=M,R=k,M=A??n,Q=K,Q.push([R,M]),K=[],k=void 0,A=void 0)}le(),ae(l.reportProgressFuncFrom);for(let n=0;n<=s;n++){for(l.reportProgressFunc&&(o=l.reportProgressFuncFrom+Math.floor((s===0?1:Math.min(n,s)/s)*(ue-l.reportProgressFuncFrom)),ae(o));l.tagRanges[I]&&l.tagRanges[I][1]<=n;)I+=1;let g=l.tagRanges[I],$=!1;if(!w&&e[n]==="<"&&(!g||n<=g[0])&&!l.ignore.some(f=>Ce(f,n))){let f=se(e,n);f&&(g=[n,f.end],$=f.boundary)}if(g&&n>=g[0]&&n<g[1]){for(g=[g[0],g[1]];l.tagRanges[I]&&l.tagRanges[I][0]<g[1];)g[1]=Math.max(g[1],l.tagRanges[I][1]),I+=1;Ee.push(g);let f=x===n||q===n||_!==n&&z!==n&&!e[n-1]?.trim();$?(Re(),h=g[1]):k!==void 0&&A===void 0&&(A=n),x=void 0,_=void 0,q=void 0,z=void 0,($||f)&&(q=g[1]),n=g[1]-1;continue}let F=q===n;F&&(q=void 0);let L=z===n;L&&(z=void 0);let Ne=_===n;if(Ne&&(_=void 0),!w&&i(l.ignore)&&l.ignore.length){let f=!1;if(l.ignore.some((C,ie)=>{if(Ce(C,n)){if(Ae(n),p+=1,P!==void 0&&(D=O,S=P),C.nestedBlock){let U=Ie(e,n,N);return U===void 0?(le(),n=s-1,f=!0,!0):(e[U]?.trim()&&(x=U),n=U-1,f=!0,!0)}return w=l.ignore[ie].tails,!0}return!1}),f)continue}let ce=!1;!w&&x!==void 0&&x===n&&(p+=1,P!==void 0&&(D=O,S=P),x=void 0,ce=!0);let fe=!w&&(e[n]===de||e[n]==="&"||e[n]==="\\")?Z(e,n):void 0,v=fe!==void 0&&!N(n,fe)?fe:void 0;if(!w&&e[n]?.trim()&&v===void 0&&Ae(n),v!==void 0){k=void 0,A=void 0,K=[],O=n,P=v;let f=Pe(n,v);ee.add(f);let C=l.convertEntities?l.targetLanguage==="css"?`${he}${ve(e[v])?" ":""}`:l.targetLanguage==="js"?be:J:de;e.slice(n,v)!==C&&(d.set(f,[n,v,C]),X.set(f,"convertEntities")),e[v]&&!`\r
|
|
12
12
|
`.includes(e[v])&&!e[v].trim()&&(_=v),v-n>1&&e[v]?.trim()&&Z(e,v)===void 0&&(x=v),n=v-1;continue}!w&&e[n]?.trim()&&(W+=1);let me=!w&&(e[n]==="-"||e[n]===Ge||e[n]===Ze||e[n]==="&"||e[n]==="\\")?mn(e,n):void 0,T=me!==void 0&&!N(n,me)?me:void 0;if(T!==void 0){let f=$e(e,n);!ce&&(F||!e[n-1]?.trim())&&(p+=1,P!==void 0&&(D=O,S=P));let C=O!==void 0&&P===n&&Z(e,O)===n,ie=C&&O!==void 0?O:f===null?n:f+1,U=f!==null&&f>=h&&!e.slice(f+1,n).split("").some(Se=>Se==="\r"||Se===`
|
|
13
13
|
`),Me=T<s&&U&&!e[T]?.trim()&&(C||!!e[n-1]&&!e[n-1].trim()&&f!==null)&&!N(ie,n);Me&&(V.removeWidows=!0),l.hyphens&&Me&&te(ie,n),e[n]==="\\"&&ve(e[T-1])&&(e[T]&&!`\r
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-remove-widows
|
|
3
3
|
* @fileoverview Helps to prevent widow words in a text
|
|
4
|
-
* @version 4.2.
|
|
4
|
+
* @version 4.2.8
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-remove-widows/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var stringRemoveWidows=(()=>{var he=Object.defineProperty,Yt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptor,en=Object.getOwnPropertyDescriptors,tn=Object.getOwnPropertyNames,ht=Object.getOwnPropertySymbols;var mt=Object.prototype.hasOwnProperty,nn=Object.prototype.propertyIsEnumerable;var Re=(e,t,n)=>t in e?he(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q=(e,t)=>{for(var n in t||(t={}))mt.call(t,n)&&Re(e,n,t[n]);if(ht)for(var n of ht(t))nn.call(t,n)&&Re(e,n,t[n]);return e},yt=(e,t)=>Yt(e,en(t));var rn=(e,t)=>{for(var n in t)he(e,n,{get:t[n],enumerable:!0})},on=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of tn(t))!mt.call(e,i)&&i!==n&&he(e,i,{get:()=>t[i],enumerable:!(r=Xt(t,i))||r.enumerable});return e};var sn=e=>on(he({},"__esModule",{value:!0}),e);var ne=(e,t,n)=>Re(e,typeof t!="symbol"?t+"":t,n);var Hn={};rn(Hn,{defaults:()=>Cn,removeWidows:()=>En,version:()=>Tn});function an(){let e=[],t=0,n=!1;return{append(r){return n?!1:t+r.length>1999?(e.push("\u2026"),t+=1,n=!0,!1):(e.push(r),t+=r.length,!0)},result(){return e.join("")},stopped(){return n}}}function ln(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function me(e,t){if(e.append('"')){for(let n=0;n<t.length&&!e.stopped();n+=1){let r=t.charCodeAt(n);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(ln(r)):e.append(t[n])}e.append('"')}}function un(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function wt(e,t){e.append("Symbol(");let n=String(t);n.length>8&&me(e,n.slice(7,-1)),e.append(")")}function bt(e,t){typeof t=="symbol"?wt(e,t):me(e,String(t))}function p(e,t=0){let n=an(),r=t===4?4:0,i=new WeakSet,o=0;function l(c){r&&n.append(" ".repeat(c*r))}function u(c,m){c&&n.append(","),r&&(n.append("\n"),l(m+1))}function a(c,m,A){r&&m&&(n.append("\n"),l(A)),n.append(c)}function _(c,m){Object.prototype.hasOwnProperty.call(c,"value")?y(c.value,m):n.append(un(c))}function f(c,m){let A;try{A=Reflect.getOwnPropertyDescriptor(c,"length")}catch(W){n.append("[Uninspectable]");return}let h=A==null?void 0:A.value;if(!Number.isSafeInteger(h)||h<0){n.append("[Uninspectable]");return}n.append("[");let T=!1;for(let W=0;W<h&&!n.stopped();W+=1){if(u(T,m),T=!0,o>=50){n.append("[MaxEntries]");break}o+=1;let R;try{R=Reflect.getOwnPropertyDescriptor(c,String(W))}catch(b){n.append("[Uninspectable]");continue}R!=null&&R.enumerable?_(R,m+1):n.append("[Empty]")}a("]",T,m)}function d(c,m){let A;try{A=Reflect.ownKeys(c)}catch(T){n.append("[Uninspectable]");return}n.append("{");let h=!1;for(let T of A){if(n.stopped())break;if(o>=50){u(h,m),h=!0,me(n,"\u2026"),n.append(r?": ":":"),n.append("[MaxEntries]");break}o+=1;let W;try{W=Reflect.getOwnPropertyDescriptor(c,T)}catch(R){u(h,m),h=!0,bt(n,T),n.append(r?": ":":"),n.append("[Uninspectable]");continue}W!=null&&W.enumerable&&(u(h,m),h=!0,bt(n,T),n.append(r?": ":":"),_(W,m+1))}a("}",h,m)}function g(c,m){if(i.has(c)){n.append("[Circular]");return}if(m>=5){n.append("[MaxDepth]");return}let A;try{A=Array.isArray(c)}catch(h){n.append("[Uninspectable]");return}i.add(c);try{A?f(c,m):d(c,m)}finally{i.delete(c)}}function y(c,m){c===null?n.append("null"):typeof c=="string"?me(n,c):typeof c=="number"?n.append(Object.is(c,-0)?"-0":String(c)):typeof c=="boolean"?n.append(c?"true":"false"):typeof c>"u"?n.append("undefined"):typeof c=="bigint"?n.append("".concat(c,"n")):typeof c=="symbol"?wt(n,c):typeof c=="function"?n.append("[Function]"):g(c,m)}try{return y(e,0),n.result()}catch(c){return"[Uninspectable]"}}var _n=["_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(""),De=_n.slice(1).split("_"),xe=[],vt=127;for(let e=0;e<De.length;e+=2){let t=vt+1+Number.parseInt(De[e],36),n=t+Number.parseInt(De[e+1],36);xe.push([t,n]),vt=n}function fn(e){if(Number.isNaN(e)||e<128||e>1114111)return!1;let t=0,n=xe.length-1;for(;t<=n;){let r=t+n>>1,i=xe[r];if(e<i[0])n=r-1;else if(e>i[1])t=r+1;else return!0}return!1}var je="\u2013",Pe="\u2014",re="\xA0";var zn=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"]);var Wt=Function.prototype.toString,dn=Wt.call(Object);var Un=Map.prototype.entries,qn=Set.prototype.values;var $t,Jn=($t=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:$t.get,At,Kn=(At=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:At.get,Tt,Gn=(Tt=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:Tt.get,Ct,Qn=(Ct=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:Ct.get,Zn=RegExp.prototype.test;function cn(e){if(e.length===1){let t=e.charCodeAt(0);return t<55296||t>57343?t:-1}if(e.length===2){let t=e.charCodeAt(0),n=e.charCodeAt(1);if(t>=55296&&t<=56319&&n>=56320&&n<=57343)return(t-55296)*1024+n-56320+65536}return-1}function kt(e){if(!H(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>64&&t<91||t>96&&t<123:fn(cn(e))}function S(e){var r;if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.getOwnPropertyDescriptor(t,"constructor");return!n||!("value"in n)||typeof n.value!="function"?!1:((r=Object.getOwnPropertyDescriptor(n.value,"prototype"))==null?void 0:r.value)===t&&Wt.call(n.value)===dn}function H(e){return typeof e=="string"}function Ie(e){return Number.isFinite(e)}function oe(e){return Number.isSafeInteger(e)&&e>=0}var Yn=Date.prototype.getTime;function ye(e){return e!=null}var Ot={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function gn(e,t){let n,r=0;for(;r<e.length;){let i=r+1;for(;i<e.length&&e[r][0]===e[i][0]&&e[r][1]===e[i][1];)i+=1;if(i-r>1){n||(n=new Map(t.map((u,a)=>[u,a])));let o=n,l=e.slice(r,i).sort((u,a)=>o.get(u)-o.get(a));e.splice(r,l.length,...l)}r=i}return e}function Z(e,t){var u;if(!Array.isArray(e)||!e.length)return e;let n=t===void 0?!0:S(t);if(t!==void 0&&n&&(t==null?void 0:t.strictlyTwoElementsInRangeArrays)===!0)for(let a=0;a<e.length;a+=1){let _=e[a];if(!Array.isArray(_)||_.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(a," (").concat(p(_,4),") is ").concat(Array.isArray(_)?"an array with ".concat(_.length," elements"):"not an array","!"));if(!Number.isInteger(_[0])||_[0]<0||!Number.isInteger(_[1])||_[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(a," (").concat(p(_,4),") does not consist of only natural numbers!"))}else for(let a=0;a<e.length;a+=1){let _=e[a];if(!Array.isArray(_)||!Number.isInteger(_[0])||_[0]<0||!Number.isInteger(_[1])||_[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(a," (").concat(p(_,4),") does not consist of only natural numbers!"))}if(t!==void 0&&!n)throw new TypeError("ranges-sort/rSort(): [THROW_ID_03] The second argument must be a plain options object; received ".concat(p(t,4)," (type ").concat(typeof t,")!"));let r=Ot.progressFn;if(t!==void 0){let a=t.strictlyTwoElementsInRangeArrays;if(a!==void 0&&typeof a!="boolean")throw new TypeError("ranges-sort/rSort(): [THROW_ID_04] opts.strictlyTwoElementsInRangeArrays must be a boolean; received ".concat(p(a,4)," (type ").concat(typeof a,")!"));if(r=(u=t.progressFn)!=null?u:Ot.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(p(r,4)," (type ").concat(typeof r,")!"))}let i,o;if(r){let a=e.length**2,_=0,f;o=d=>{d!==f&&(f=d,r(d))},i=Array.from(e).sort((d,g)=>(_+=1,o==null||o(Math.min(99,Math.floor(_*100/a))),d[0]===g[0]?d[1]<g[1]?-1:d[1]>g[1]?1:0:d[0]<g[0]?-1:1))}else i=Array.from(e).sort((a,_)=>a[0]===_[0]?a[1]<_[1]?-1:a[1]>_[1]?1:0:a[0]<_[0]?-1:1);let l=i.length>10?gn(i,e):i;return o==null||o(100),l}var pn={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Se(e,t){if(!Array.isArray(e)||!e.length)return null;if(t!==void 0&&!S(t))throw new TypeError("ranges-merge/rMerge(): [THROW_ID_01] the second input argument must be a plain object. It was given as:\n".concat(p(t,4)," (type ").concat(typeof t,")"));let n=Q(Q({},pn),t);if(n.progressFn&&S(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_02] opts.progressFn must be a function! It was given of a type: "'.concat(typeof n.progressFn,'", equal to ').concat(p(n.progressFn,4)));if(n.mergeType!==1&&n.mergeType!==2&&n.mergeType!=="1"&&n.mergeType!=="2")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_03] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof n.mergeType,'", equal to ').concat(p(n.mergeType,4)));if(typeof n.joinRangesThatTouchEdges!="boolean")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof n.joinRangesThatTouchEdges,'", equal to ').concat(p(n.joinRangesThatTouchEdges,4)));let r=n.progressFn,i=n.joinRangesThatTouchEdges,o=[];for(let y of e)Array.isArray(y)&&(y[2]!==void 0||y[0]!==y[1])&&o.push([...y]);let l,u,a;r?l=Z(o,{progressFn:y=>{a=Math.floor(y/5),a!==u&&(u=a,r(a))}}):l=Z(o);let _=l.length-1,f=n.mergeType===2||n.mergeType==="2",d=l.length;for(let y=_;y>=0;y--){let c=l[y];for(r&&y<_&&(a=Math.floor((1-(y+1)/_)*78)+21,a!==u&&a>u&&(u=a,r(a)));d<l.length;){let m=l[d],A=m[0]===c[0];if(!A&&(i?m[0]>c[1]:m[0]>=c[1]))break;let h=m[1]>=c[1];h&&(c[1]=m[1]),m[2]===null?c[2]=null:m[2]!==void 0&&(A||h)&&c[2]!==null&&(c[2]!=null?f&&A?c[2]=m[2]:c[2]+=m[2]:c[2]=m[2]),d+=1}d-=1,l[d]=c}let g=l.length-d;for(let y=0;y<g;y++)l[y]=l[d+y];return l.length=g,r&&u!==99&&r(99),l.length?l:null}function be(e){if(typeof e=="number")return Number.isInteger(e)&&e>=0;if(typeof e!="string"||!e.trim())return!1;let t=Number(e);return Number.isInteger(t)&&t>=0}function Et(e,t,n){let r=0,i=0;if(e===void 0&&t===void 0&&n===void 0)throw new Error("ranges-apply/rApply(): [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError("ranges-apply/rApply(): [THROW_ID_02] first input argument must be a string! Currently it's: ".concat(typeof e,", equal to: ").concat(p(e,4)));if(t!=null&&!Array.isArray(t))throw new TypeError("ranges-apply/rApply(): [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ".concat(typeof t,", equal to: ").concat(p(t,4)));if(n!=null&&n!==!1&&n!==0&&n!==""&&typeof n!="function")throw new TypeError("ranges-apply/rApply(): [THROW_ID_04] the third input argument must be a function, false, null, undefined, 0, or an empty string! Currently it's: ".concat(typeof n,", equal to: ").concat(p(n,4)));if(t==null||!t.length||t.every(f=>f==null))return n&&n(100),e;let o;Array.isArray(t)&&!Array.isArray(t[0])&&be(t[0])&&be(t[1])?o=[Array.from(t)]:o=Array.from(t);let l=o.length,u=0;o.forEach((f,d)=>{if(f){if(n&&(r=Math.floor(u/l*10),r!==i&&(i=r,n(r))),!Array.isArray(f))throw new TypeError("ranges-apply/rApply(): [THROW_ID_05] ranges array, second input arg., has ".concat(d,"th element not an array: ").concat(p(f,4),", which is ").concat(typeof f));if(!be(f[0]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_06] ranges array, second input arg. has ".concat(d,"th element, array ").concat(p(f),". Its first element is not a non-negative integer or string index, but ").concat(typeof f[0],", equal to: ").concat(p(f[0],4),"."));if(typeof f[0]=="string"&&(o[d]=[...f],o[d][0]=Number(f[0])),!be(f[1]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_07] ranges array, second input arg. has ".concat(d,"th element, array ").concat(p(f),". Its second element is not a non-negative integer or string index, but ").concat(typeof f[1],", equal to: ").concat(p(f[1],4),"."));if(typeof f[1]=="string"&&(o[d]===f&&(o[d]=[...f]),o[d][1]=Number(f[1])),o[d][0]>o[d][1])throw new RangeError("ranges-apply/rApply(): [THROW_ID_08] ranges array, second input arg. has ".concat(d,"th element, array ").concat(p(f),". Its first index (").concat(o[d][0],") must not be greater than its second index (").concat(o[d][1],")."));u+=1}});let a=n?Se(o,{progressFn:f=>{r=10+Math.floor(f/10),r!==i&&(i=r,n(r))}}):Se(o),_=(a==null?void 0:a.length)||0;if(a&&_>0){let f=e.slice(a[_-1][1]);e=a.reduce((d,g,y,c)=>{var h;n&&(r=20+Math.floor(y/_*80),r!==i&&(i=r,n(r)));let m=y===0?0:c[y-1][1],A=c[y][0];return"".concat(d).concat(e.slice(m,A)).concat((h=c[y][2])!=null?h:"")},""),e+=f}return n&&i!==100&&n(100),e}function we(e,t=1){let n="\xA0";function r(o){return o.length<2?o:Array.from(o).reverse().join("")}function i(o,l,u){let a=u?"\n":"\r",_=u?"\r":"\n";if(!o)return o;let f=0,d="";for(let g=0,y=o.length;g<y;g++)(o[g]===a||o[g]===_&&o[g-1]!==a)&&f++,"\r\n".includes(o[g])||o[g]===n?o[g]===n?d+=o[g]:o[g]===a?f<=l&&(d+=o[g],o[g+1]===_&&(d+=o[g+1],g++)):o[g]===_&&(o==null?void 0:o[g-1])!==a&&f<=l&&(d+=o[g]):!o[g+1]&&!f&&(d+=" ");return d}if(typeof e=="string"&&e.length){let o=e.trim();if(o.length===e.length)return e;let l=1;typeof t=="number"&&Number.isInteger(t)&&t>=0&&(l=t);let u="",a="";if(!o)u=e;else if(!e[0].trim()){for(let f=0,d=e.length;f<d;f++)if(e[f].trim()){u=e.slice(0,f);break}}let _=e[e.length-1];if(o&&(_.trim()===""||_===n)){for(let f=e.length;f--;)if(e[f].trim()){a=e.slice(f+1);break}}return"".concat(i(u,l,!1)).concat(o).concat(r(i(r(a),l,!0)))}return e}var Ne={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Rt(e,t,n){return t===void 0||e===null?e:t===null?null:e===void 0||n?t:e+t}function hn(e,t){var c,m,A;function n(h){return!!h&&typeof h=="object"&&!Array.isArray(h)}if(!Array.isArray(e)||!e.length)return null;if(t&&!n(t))throw new TypeError("ranges-push/rMerge(): [THROW_ID_07] the second input argument must be a plain object. It was given as:\n".concat(p(t,4)," (type ").concat(typeof t,")"));let r=(c=t==null?void 0:t.progressFn)!=null?c:Ne.progressFn,i=(m=t==null?void 0:t.mergeType)!=null?m:Ne.mergeType,o=(A=t==null?void 0:t.joinRangesThatTouchEdges)!=null?A:Ne.joinRangesThatTouchEdges;if(r&&n(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(p(r,4)));if(i!==1&&i!==2&&i!=="1"&&i!=="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 i,'", equal to ').concat(p(i,4)));if(typeof o!="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 o,'", equal to ').concat(p(o,4)));let l=[];for(let h of e)Array.isArray(h)&&(h[2]!==void 0||h[0]!==h[1])&&l.push([...h]);let u,a,_;r?u=Z(l,{progressFn:h=>{_=Math.floor(h/5),_!==a&&(a=_,r==null||r(_))}}):u=Z(l);let f=u.length-1,d=+i==2,g=u.length;for(let h=f;h>=0;h--){let T=u[h];for(r&&h<f&&(_=Math.floor((1-(h+1)/f)*78)+21,_!==a&&_>a&&(a=_,r(_)));g<u.length;){let W=u[g],R=W[0]===T[0];if(!R&&(o?W[0]>T[1]:W[0]>=T[1]))break;let b=W[1]>=T[1];b&&(T[1]=W[1]),W[2]===null?T[2]=null:W[2]!==void 0&&(R||b)&&(T[2]=Rt(T[2],W[2],d&&R)),g+=1}g-=1,u[g]=T}let y=u.length-g;for(let h=0;h<y;h++)u[h]=u[g+h];return u.length=y,u.length?u:null}var ve=Object.freeze({limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1});function V(e){if(oe(e))return e;if(typeof e=="string"&&/^\d+$/.test(e)){let t=Number(e);return oe(t)?t:null}return null}function Dt(e){if(!Array.isArray(e))return"a ranges batch must contain only range arrays; received ".concat(p(e,4));if(e.length>3)return"a range must contain at most three values; received ".concat(p(e,4));let[t,n,r]=e;if(t==null&&n==null)return;if(t!=null&&n==null)return"the first index is set (".concat(p(t),") but the second index is not (").concat(p(n),")");if(t==null&&n!=null)return"the second index is set (".concat(p(n),") but the first index is not (").concat(p(t),")");let i=V(t),o=V(n);if(i===null)return"the first index must be a natural number, zero, or a digit-only numeric string; received ".concat(p(t,4)," (type ").concat(typeof t,")");if(o===null)return"the second index must be a natural number, zero, or a digit-only numeric string; received ".concat(p(n,4)," (type ").concat(typeof n,")");if(ye(r)&&!H(r)&&!Ie(r))return"the third value must be a string, number, null, or undefined; received ".concat(p(r,4)," (type ").concat(typeof r,")");if(i>o)return"the first index (".concat(i,") must not be greater than the second index (").concat(o,")")}function mn(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 n=e[0];if(!n.length)return{ranges:[]};e=Array.isArray(n[0])?n:[n]}else e=[e];let t=[];for(let n of e){let r=Dt(n);if(r)return{error:r,ranges:[]};let[i,o,l]=n;if(i==null&&o==null)continue;let u=V(i),a=V(o);t.push(l!==void 0&&!(H(l)&&!l.length)?[u,a,l]:[u,a])}return{ranges:t}}function yn(e){return e[2]===void 0&&e[0]===e[1]}function bn(e){let t=-1;for(let n=0,r=e.length;n<r;n++){let i=e[n];if(Array.isArray(i)){if(i[0]<t)return!1;t=i[0]}}return!0}var xt=class{constructor(e){ne(this,"ranges");ne(this,"opts");ne(this,"currentCache",null);if(e!=null&&!S(e))throw new TypeError("ranges-push/Ranges/constructor(): [THROW_ID_01] The options argument must be a plain object. It was given as ".concat(p(e,4)," (type ").concat(typeof e,")."));if(e===void 0){this.opts=ve,this.ranges=[];return}let t=e,n=t.limitToBeAddedWhitespace===void 0?ve.limitToBeAddedWhitespace:t.limitToBeAddedWhitespace,r=t.limitLinebreaksCount===void 0?ve.limitLinebreaksCount:t.limitLinebreaksCount,i=t.mergeType===void 0?ve.mergeType:t.mergeType,o=i==="1"?1:i==="2"?2:i,l;if(typeof n!="boolean"?l="opts.limitToBeAddedWhitespace must be a boolean; received ".concat(p(n,4)," (type ").concat(typeof n,")"):oe(r)?o!==1&&o!==2&&(l='opts.mergeType must be 1, 2, "1", or "2"; received '.concat(p(i,4)," (type ").concat(typeof i,")")):l="opts.limitLinebreaksCount must be a natural number or zero; received ".concat(p(r,4)," (type ").concat(typeof r,")"),l)throw new TypeError("ranges-push/Ranges/constructor(): [THROW_ID_02] ".concat(l,"."));let u=Object.freeze({limitToBeAddedWhitespace:n,limitLinebreaksCount:r,mergeType:o});this.opts=u,this.ranges=[]}rangeListsMatch(e,t){if(!Array.isArray(e))return t===null;if(!Array.isArray(t)||e.length!==t[0])return!1;let n=1;for(let r=0,i=e.length;r<i;r++){let o=e[r];if(!Array.isArray(o)){if(t[n++]!==-1||o!==t[n++])return!1;continue}if(o.length!==t[n++])return!1;for(let l=0;l<o.length;l++)if(o[l]!==t[n++])return!1}return n===t.length}snapshotRanges(e){if(!Array.isArray(e))return null;let t=new Array(1+e.length*4);t[0]=e.length;let n=1;for(let r=0,i=e.length;r<i;r++){let o=e[r];if(Array.isArray(o)){t[n++]=o.length;for(let l=0;l<o.length;l++)t[n++]=o[l]}else t[n++]=-1,t[n++]=o}return t.length=n,t}currentStateMatchesSnapshot(){let e=this.currentCache;return e!==null&&this.rangeListsMatch(this.ranges,e.rangesSnapshot)&&this.rangeListsMatch(e.result,e.resultSnapshot)}recordCurrentSnapshot(e){let t=this.snapshotRanges(this.ranges);this.currentCache={rangesSnapshot:t,result:e,resultSnapshot:e===this.ranges?t:this.snapshotRanges(e)}}invalidateCurrentCache(){this.currentCache=null}addValidated(e,t,n){this.invalidateCurrentCache();let r=this.last();if(ye(this.ranges)&&Array.isArray(r)&&e===r[1]){if(r[1]=t,n!==void 0&&!(H(n)&&!n.length)){let o=Rt(r[2],n,this.opts.mergeType===2&&r[0]===e);this.opts.limitToBeAddedWhitespace&&typeof o=="string"&&(o=we(o,this.opts.limitLinebreaksCount)),H(o)&&!o.length||(r[2]=o)}return}this.ranges||(this.ranges=[]);let i=n!==void 0?[e,t,typeof n=="string"&&this.opts.limitToBeAddedWhitespace?we(n,this.opts.limitLinebreaksCount):n]:[e,t];this.ranges.push(i)}add(e,t,n){let r=arguments.length,i;if(r>3)i="expected at most three arguments but received ".concat(r);else if(r===1&&Array.isArray(e)){let o=Array.isArray(e[0])?e:[e];for(let l=0,u=o.length;l<u&&(i=Dt(o[l]),!i);l++);if(!i)for(let l=0,u=o.length;l<u;l++){let[a,_,f]=o[l];a==null&&_==null||this.addValidated(V(a),V(_),H(f)&&!f.length?void 0:f)}}else{if(e==null&&t==null)return;if(e!=null&&t==null)i="the first index is set (".concat(p(e),") but the second index is not (").concat(p(t),")");else if(e==null&&t!=null)i="the second index is set (".concat(p(t),") but the first index is not (").concat(p(e),")");else{let o=V(e),l=V(t);o===null?i="the first index must be a natural number, zero, or a digit-only numeric string; received ".concat(p(e,4)," (type ").concat(typeof e,")"):l===null?i="the second index must be a natural number, zero, or a digit-only numeric string; received ".concat(p(t,4)," (type ").concat(typeof t,")"):ye(n)&&!H(n)&&!Ie(n)?i="the third value must be a string, number, null, or undefined; received ".concat(p(n,4)," (type ").concat(typeof n,")"):o>l?i="the first index (".concat(o,") must not be greater than the second index (").concat(l,")"):this.addValidated(o,l,H(n)&&!n.length?void 0:n)}}if(i)throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_03] ".concat(i,"."))}push(e,t,n){this.add.apply(this,arguments)}current(){var e,t;if(this.currentStateMatchesSnapshot())return(t=(e=this.currentCache)==null?void 0:e.result)!=null?t:null;if(Array.isArray(this.ranges)&&this.ranges.length){this.ranges=hn(this.ranges,this.opts.mergeType===1?void 0:{mergeType:2});let n=this.ranges;return n&&this.opts.limitToBeAddedWhitespace&&(n=n.map(r=>typeof r[2]=="string"?[r[0],r[1],we(r[2],this.opts.limitLinebreaksCount)]:r)),this.recordCurrentSnapshot(n),n}return this.recordCurrentSnapshot(null),null}firstCovers(e){if(!oe(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(p(e,4)," (type ").concat(typeof e,")"));if(!Array.isArray(this.ranges)||!this.ranges.length)return!1;let t=bn(this.ranges)?this.ranges:this.ranges.filter(r=>Array.isArray(r)).slice().sort((r,i)=>r[0]-i[0]||r[1]-i[1]),n=null;for(let r=0,i=t.length;r<i;r++){let o=t[r];if(!(!Array.isArray(o)||yn(o))){if(n===null){if(o[0]!==0)return!1;n=o[1]}else{if(o[0]>n)break;o[1]>n&&(n=o[1])}if(n>=e)return!0}}return n!==null&&n>=e}wipe(){this.ranges=[],this.invalidateCurrentCache()}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])){let t=mn([e]);if(t.error)throw new TypeError("ranges-push/Ranges/replace(): [THROW_ID_06] ".concat(t.error,"."));this.ranges=t.ranges,this.invalidateCurrentCache()}else throw new Error("ranges-push/Ranges/replace(): [THROW_ID_05] Single range was given but we expected array of arrays! The first element, ".concat(p(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 Y(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 jt(e,t){return t==null?0:typeof t!="number"||!Number.isInteger(t)||t<0?null:t>e?e:t}function wn(e,t){return t===-1?-1:jt(e,t)}function Pt(e,t=0){if(typeof e!="string"||!e.length)return null;let n=wn(e.length,t);if(n===null||n+1>=e.length)return null;let r=n+1;if(!Y(e.charCodeAt(r)))return r;if(r+=1,r>=e.length)return null;if(!Y(e.charCodeAt(r)))return r;for(r+=1;r<e.length;r++)if(!Y(e.charCodeAt(r)))return r;return null}function $e(e,t=0){if(typeof e!="string"||!e.length)return null;let n=jt(e.length,t);if(n===null||n<1)return null;let r=n-1;if(!Y(e.charCodeAt(r)))return r;if(r-=1,r<0)return null;if(!Y(e.charCodeAt(r)))return r;for(r-=1;r>=0;r--)if(!Y(e.charCodeAt(r)))return r;return null}var It="4.2.7";function Me(e){return e===32||e>=9&&e<=13&&e!==11}function Fe(e,t,n=!0){let r=t+(e[t+1]==="/"?2:1),i=e.charCodeAt(r)|32;if(i<97||i>122)return;for(r+=1;r<e.length;){let a=e.charCodeAt(r);if(a<=62&&(Me(a)||a===47||a===34||a===39||a>=60&&a<=62))break;r+=1}if(e[r]&&!Me(e.charCodeAt(r))&&e[r]!=="/"&&e[r]!==">")return;let o,l=!1,u=!1;for(;r<e.length;r+=1){let a=e[r];if(o)a===o&&(o=void 0);else{if(a===">")return r+1;if(a==="<")return n?r:void 0;Me(e.charCodeAt(r))?u=!1:l?(l=!1,a==='"'||a==="'"?o=a:u=!0):a==="="&&!u&&(l=!0)}}return n?e.length:void 0}var $n=new Set(["address","article","aside","blockquote","body","br","caption","center","dd","details","dialog","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"]),An=new Set(["script","style","pre","code","textarea","title"]);function Ae(e,t){if(e.startsWith("<!--",t)||e.startsWith("<![CDATA[",t)){let a=e.startsWith("<!--",t)?"-->":"]]>",_=e.indexOf(a,t+4);return{end:_<0?e.length:_+a.length,boundary:!1}}if(e.startsWith("<?",t)){let a=e.indexOf("?>",t+2);return{end:a<0?e.length:a+2,boundary:!1}}if(e.startsWith("<!",t)){let a,_=0;for(let f=t+2;f<e.length;f+=1){let d=e[f];if(a)d===a&&(a=void 0);else if(d==='"'||d==="'")a=d;else if(d==="[")_+=1;else if(d==="]")_=Math.max(0,_-1);else if(d===">"&&!_)return{end:f+1,boundary:!1}}return{end:e.length,boundary:!1}}let n=Fe(e,t);if(n===void 0)return;let r=e[t+1]==="/",i=t+(r?2:1),o=i;for(;o<n&&!/[\t\n\f\r />]/.test(e[o]);)o+=1;let l=e.slice(i,o).toLowerCase(),u=$n.has(l)||l==="script"||l==="style";if(!r&&An.has(l)&&e[n-1]===">"){let a=n,_=1;for(;a<e.length&&(a=e.indexOf("<",a),a!==-1);){if((l==="pre"||l==="code")&&(e[a+1]==="!"||e[a+1]==="?")){a=Ae(e,a).end;continue}let f=e[a+1]==="/",d=a+(f?2:1);if(e.slice(d,d+l.length).toLowerCase()===l&&/[\t\n\f\r />]/.test(e[d+l.length]||"")&&(f||l==="pre"||l==="code")){let g=Fe(e,a,!1);if(g!==void 0){if(_+=f?-1:1,!_)return{end:g,boundary:u};a=g;continue}}if(l==="pre"||l==="code"){if(/^<(script|style|textarea|title)(?=[\t\n\f\r />])/i.exec(e.slice(a,a+11))){a=Ae(e,a).end;continue}let y=Fe(e,a);if(y!==void 0){a=y;continue}}a+=1}return{end:e.length,boundary:u}}return{end:n,boundary:u}}function St(e,t,n){let r=[],i=t;for(;i<e.length;){let o=e.indexOf("{%",i);if(o<0)break;let l=e.indexOf("%}",o+2);if(l<0)break;let u=/^-?\s*(if|for|endif|endfor)(?=[\s%-]|$)/.exec(e.slice(o+2,l));if(u&&!n(o,l+2)){let a=u[1];if(a==="if"||a==="for")r.push(a);else if(r[r.length-1]===a.slice(3)&&(r.pop(),!r.length))return l+2}i=l+2}}var X=" ",He="\\0000A0",Le="\\u00A0",Nt="–";var Mt="\\u2013",Ft="—";var Ht="\\u2014",ie=[{heads:"{{",tails:"}}"},{heads:["{% if","{%- if"],tails:["{% endif","{%- endif"]},{heads:["{% for","{%- for"],tails:["{% endfor","{%- endfor"]},{heads:["{%","{%-"],tails:["%}","-%}"]},{heads:"{#",tails:"#}"}],Lt=[{heads:"{{",tails:"}}"}],Be=[{heads:["<%","<%=","<%-"],tails:["%>","=%>","-%>"]}];var Tn=It,Jt=4,Kt=5,x={removeWidowPreventionMeasures:!1,convertEntities:!0,targetLanguage:"html",UKPostcodes:!1,hyphens:!0,minWordCount:Jt,minCharCount:Kt,ignore:[],reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,tagRanges:[]},Cn=Object.freeze(yt(Q({},x),{ignore:Object.freeze([]),tagRanges:Object.freeze([])})),Wn=[Nt,Mt,Ft,Ht],kn=/[&\\\u00a0\u2013\u2014\r\n<>/0-9-]/;function On(e,t){var f,d;let n=0,r=0,i,o,l;for(let g=0;g<e.length;g+=1)if(e[g].trim())r+=1,(f=e[g-1])!=null&&f.trim()||(n+=1),i!==void 0&&(o=i,l=g,i=void 0);else if((d=e[g-1])!=null&&d.trim()){let y=g+1;for(;y<e.length&&!e[y].trim();)y+=1;y<e.length&&(i=g)}let u=!1,a=null,_=e;return o!==void 0&&l!==void 0&&n>=Jt&&r>=Kt&&(u=!0,a=[[o,l,X]],_="".concat(e.slice(0,o)).concat(X).concat(e.slice(l))),{res:_,ranges:a,log:{timeTakenInMilliseconds:Date.now()-t},whatWasDone:{removeWidows:u,convertEntities:!1},applicableOpts:{removeWidows:u,convertEntities:u}}}function En(e,t){var tt,nt,rt,ot,it,st,at,lt,ut,_t,ft,dt;let n=Date.now();if(typeof e!="string")throw e===void 0?new Error("string-remove-widows/removeWidows(): [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error('string-remove-widows/removeWidows(): [THROW_ID_02] the first input argument must be string! It was given as "'.concat(typeof e,'", equal to:\n').concat(p(e,4)));if(t!==void 0&&!S(t))throw new Error("string-remove-widows/removeWidows(): [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ".concat(typeof t,", equal to ").concat(p(t,4)));if(t===void 0&&!kn.test(e))return On(e,n);let r=Array.isArray,i=e.length,o=new Map,l=["."],u=.06,a,_,f=0,d=0,g=0,y,c,m,A,h,T,W=[],R=[],b,k,N,j,O,L=0,qe=[],B,ee,J,te,w=Fn(e,t),Je={removeWidows:!1,convertEntities:!1},U={removeWidows:!1,convertEntities:!1},le=new Map,ue=new Set;function Ke(s,v){return"".concat(s,":").concat(v)}function Ge(s,v,C){if(!s.length||v>=C)return!1;let E=0,F=s.length;for(;E<F;){let K=Math.floor((E+F)/2);s[K][1]<=v?E=K+1:F=K}return!!(s[E]&&s[E][0]<C)}function M(s,v){return Ge(w.tagRanges,s,v)||Ge(qe,s,v)}function _e(s,v){return e.startsWith(s,v)&&!M(v,v+s.length)}function Qe(s,v){return(typeof s.heads=="string"?_e(s.heads,v):s.heads.some(E=>_e(E,v)))&&(!s.nestedBlock||/^\{%-?\s*(if|for)(?=[\s%-]|$)/.test(e.slice(v,v+12)))}let Te=w.reportProgressFuncFrom+Math.floor((w.reportProgressFuncTo-w.reportProgressFuncFrom)*(1-u));function Ce(s){if(!w.reportProgressFunc)return;let v=Math.max(w.reportProgressFuncFrom,Math.min(w.reportProgressFuncTo,Math.floor(s)));(_===void 0||v>_)&&(_=v,w.reportProgressFunc(v))}function fe(s,v){if(M(s,v))return!1;let C=re;w.removeWidowPreventionMeasures?C=" ":w.convertEntities&&(C=X,w.targetLanguage==="css"?C=He:w.targetLanguage==="js"&&(C=Le));let E=Ke(s,v),F=se(e,s)===v;return U.removeWidows=!0,F&&(w.removeWidowPreventionMeasures?ue.delete(E):ue.add(E)),e.slice(s,v)!==C?(o.set(E,[s,v,C]),le.set(E,F&&C!==" "?"convertEntities":"removeWidows"),!0):(o.delete(E),le.delete(E),!1)}function We(){d=0,g=0,y=void 0,c=void 0,m=void 0,A=void 0,h=void 0,T=void 0,W=[],R=[],b=void 0,k=void 0,N=void 0,j=void 0}function Ze(){let s,v;if(m!==void 0&&A!==void 0&&b!==void 0&&k!==void 0?m>b?(s=m,v=A):(s=b,v=k):m!==void 0&&A!==void 0?(s=m,v=A):b!==void 0&&k!==void 0&&(s=b,v=k),(s===void 0||v===void 0)&&y!==void 0&&c!==void 0&&(s=y,v=c),s!==void 0&&v!==void 0&&(!w.minWordCount||d>=w.minWordCount)&&(!w.minCharCount||g>=w.minCharCount)&&!M(s,v))if(U.removeWidows=!0,s===m&&v===A)for(let[C,E]of R)fe(C,E);else fe(s,v);We()}function Ye(s){h!==void 0&&(y=m,c=A,m=h,A=T!=null?T:s,R=W,R.push([m,A]),W=[],h=void 0,T=void 0)}We(),Ce(w.reportProgressFuncFrom);for(let s=0;s<=i;s++){for(w.reportProgressFunc&&(a=w.reportProgressFuncFrom+Math.floor((i===0?1:Math.min(s,i)/i)*(Te-w.reportProgressFuncFrom)),Ce(a));w.tagRanges[L]&&w.tagRanges[L][1]<=s;)L+=1;let C=w.tagRanges[L],E=!1;if(!O&&e[s]==="<"&&(!C||s<=C[0])&&!w.ignore.some($=>Qe($,s))){let $=Ae(e,s);$&&(C=[s,$.end],E=$.boundary)}if(C&&s>=C[0]&&s<C[1]){for(C=[C[0],C[1]];w.tagRanges[L]&&w.tagRanges[L][0]<C[1];)C[1]=Math.max(C[1],w.tagRanges[L][1]),L+=1;qe.push(C);let $=B===s||ee===s||J!==s&&te!==s&&!((tt=e[s-1])!=null&&tt.trim());E?(Ze(),f=C[1]):h!==void 0&&T===void 0&&(T=s),B=void 0,J=void 0,ee=void 0,te=void 0,(E||$)&&(ee=C[1]),s=C[1]-1;continue}let F=ee===s;F&&(ee=void 0);let K=te===s;K&&(te=void 0);let ct=J===s;if(ct&&(J=void 0),!O&&r(w.ignore)&&w.ignore.length){let $=!1;if(w.ignore.some((I,ge)=>{var pe;if(Qe(I,s)){if(Ye(s),d+=1,j!==void 0&&(b=N,k=j),I.nestedBlock){let q=St(e,s,M);return q===void 0?(We(),s=i-1,$=!0,!0):((pe=e[q])!=null&&pe.trim()&&(B=q),s=q-1,$=!0,!0)}return O=w.ignore[ge].tails,!0}return!1}),$)continue}let ke=!1;!O&&B!==void 0&&B===s&&(d+=1,j!==void 0&&(b=N,k=j),B=void 0,ke=!0);let Oe=!O&&(e[s]===re||e[s]==="&"||e[s]==="\\")?se(e,s):void 0,D=Oe!==void 0&&!M(s,Oe)?Oe:void 0;if(!O&&((nt=e[s])!=null&&nt.trim())&&D===void 0&&Ye(s),D!==void 0){h=void 0,T=void 0,W=[],N=s,j=D;let $=Ke(s,D);ue.add($);let I=w.convertEntities?w.targetLanguage==="css"?"".concat(He).concat(ze(e[D])?" ":""):w.targetLanguage==="js"?Le:X:re;e.slice(s,D)!==I&&(o.set($,[s,D,I]),le.set($,"convertEntities")),e[D]&&!"\r\n".includes(e[D])&&!e[D].trim()&&(J=D),D-s>1&&((rt=e[D])!=null&&rt.trim())&&se(e,D)===void 0&&(B=D),s=D-1;continue}!O&&((ot=e[s])!=null&&ot.trim())&&(g+=1);let Ee=!O&&(e[s]==="-"||e[s]===Pe||e[s]===je||e[s]==="&"||e[s]==="\\")?Rn(e,s):void 0,P=Ee!==void 0&&!M(s,Ee)?Ee:void 0;if(P!==void 0){let $=$e(e,s);!ke&&(F||!((it=e[s-1])!=null&&it.trim()))&&(d+=1,j!==void 0&&(b=N,k=j));let I=N!==void 0&&j===s&&se(e,N)===s,ge=I&&N!==void 0?N:$===null?s:$+1,pe=$!==null&&$>=f&&!e.slice($+1,s).split("").some(pt=>pt==="\r"||pt==="\n"),q=P<i&&pe&&!((st=e[P])!=null&&st.trim())&&(I||!!e[s-1]&&!e[s-1].trim()&&$!==null)&&!M(ge,s);q&&(U.removeWidows=!0),w.hyphens&&q&&fe(ge,s),e[s]==="\\"&&ze(e[P-1])&&(e[P]&&!"\r\n".includes(e[P])&&!e[P].trim()?J=P:(at=e[P])!=null&&at.trim()&&(te=P)),s=P-1;continue}!O&&!ke&&((lt=e[s])!=null&<.trim())&&(F||!K&&!((ut=e[s-1])!=null&&ut.trim()))&&(d+=1,j!==void 0&&(b=N,k=j)),!O&&(!e[s]||"\r\n".includes(e[s])||(e[s]==="\n"||e[s]==="\r"||e[s]==="\r"&&e[s+1]==="\n")&&$e(e,s)&&l.includes(e[$e(e,s)]))&&(Ze(),f=s+1);let de=e.charCodeAt(s-1),ce=!O&&e[s]&&!e[s].trim()&&!"\r\n".includes(e[s])&&((_t=e[s-1])!=null&&_t.trim())&&(de>=48&&de<=57||de>=65&&de<=90)?Pn(e,s):void 0;ce!==void 0&&!M(ce.tokenStart,ce.tokenEnd)&&(U.removeWidows=!0,w.UKPostcodes&&fe(s,ce.whitespaceEnd)),!O&&e[s]&&!e[s].trim()&&!"\r\n".includes(e[s])&&h!==void 0&&T!==void 0&&(W.push([h,T]),h=s,T=void 0);let gt=!O&&e[s]&&!"\r\n".includes(e[s])&&!e[s].trim()&&(ct||((ft=e[s-1])==null?void 0:ft.trim()))&&h===void 0,Zt=gt?Pt(e,s):null;gt&&Zt!==null&&(h=s,T=void 0);let G;if(O&&(typeof O=="string"&&_e(O,s)?G=O:Array.isArray(O)&&O.some($=>_e($,s)?(G=$,!0):!1),G!==void 0)){let $=s+G.length;if(G.startsWith("{% end")||G.startsWith("{%- end")){for(;$<i&&!e[$].trim();)$+=1;e.startsWith("-%}",$)?$+=3:e.startsWith("%}",$)&&($+=2)}if(!M(s,$)){O=void 0;let I=se(e,$);(dt=e[$])!=null&&dt.trim()&&(I===void 0||M($,I))&&(B=$),s=$-1}}e[s]&&"\r\n".includes(e[s])&&(d=0,g=0)}let Xe=new xt({mergeType:2});for(let s of o.values())Xe.push(s);let et=Xe.current(),Qt=Et(e,et,w.reportProgressFunc?s=>{a=Te+Math.floor(s/100*(w.reportProgressFuncTo-Te)),Ce(a)}:void 0);for(let s of le.values())Je[s]=!0;return U.convertEntities=U.removeWidows&&!w.removeWidowPreventionMeasures||ue.size>0,{res:Qt,ranges:et,log:{timeTakenInMilliseconds:Date.now()-n},whatWasDone:Je,applicableOpts:U}}function Bt(e){return e!==void 0&&/[0-9a-f]/i.test(e)}function ze(e){return e!==void 0&&" \n\f\r ".includes(e)}function Ue(e,t,n,r){if(e[t]!=="\\"||!Bt(e[t+1]))return;let i=t+1;for(;i<e.length&&i-t<=6&&Bt(e[i]);)i+=1;if(Number.parseInt(e.slice(t+1,i),16)===n)return r&&ze(e[i])?e[i]==="\r"&&e[i+1]==="\n"?i+2:i+1:i}function se(e,t){var r,i;let n=e[t];if(n===re)return t+1;if(n==="&"&&(e.startsWith(X,t)||e.startsWith(" ",t)))return t+6;if(n==="\\")return((r=e[t+1])==null?void 0:r.toLowerCase())==="u"&&e[t+2]==="0"&&e[t+3]==="0"&&((i=e[t+4])==null?void 0:i.toLowerCase())==="a"&&e[t+5]==="0"?t+6:Ue(e,t,160,!0)}function Rn(e,t){var r;let n=e[t];if(n==="-"||n===Pe||n===je)return t+1;if(n==="&"||n==="\\"){for(let i of Wn)if(e.startsWith(i,t))return t+i.length;if(n==="\\")return(r=Ue(e,t,8211,!0))!=null?r:Ue(e,t,8212,!0)}}function Vt(e){if(e===void 0)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t===95||t>=97&&t<=122}var Ve=[1632,1641,1776,1785,1984,1993,2406,2415,2534,2543,2662,2671,2790,2799,2918,2927,3046,3055,3174,3183,3302,3311,3430,3439,3558,3567,3664,3673,3792,3801,3872,3881,4160,4169,4240,4249,6112,6121,6160,6169,6470,6479,6608,6617,6784,6793,6800,6809,6992,7001,7088,7097,7232,7241,7248,7257,42528,42537,43216,43225,43264,43273,43472,43481,43504,43513,43600,43609,44016,44025,65296,65305,66720,66729,68912,68921,68928,68937,69734,69743,69872,69881,69942,69951,70096,70105,70384,70393,70736,70745,70864,70873,71248,71257,71360,71369,71376,71395,71472,71481,71904,71913,72016,72025,72688,72697,72784,72793,73040,73049,73120,73129,73184,73193,73552,73561,90416,90425,92768,92777,92864,92873,93008,93017,93552,93561,118e3,118009,120782,120831,123200,123209,123632,123641,124144,124153,124401,124410,125264,125273,130032,130041];function Dn(e,t){let n=e.codePointAt(t);return n===void 0?void 0:String.fromCodePoint(n)}function xn(e,t){if(t<=0)return;let n=e.charCodeAt(t-1);return n>=56320&&n<=57343&&t>1?e.slice(t-2,t):e[t-1]}function jn(e){if(e===void 0)return!1;let t=e.codePointAt(0),n=0,r=Ve.length/2-1;for(;n<=r;){let i=n+r>>1,o=Ve[i*2],l=Ve[i*2+1];if(t<o)r=i-1;else if(t>l)n=i+1;else return!0}return!1}function zt(e){return e!==void 0&&(e==="_"||kt(e)||jn(e))}function Pn(e,t){var u;if(!e[t]||"\r\n".includes(e[t])||e[t].trim()||!((u=e[t-1])!=null&&u.trim()))return;let n=e.charCodeAt(t-1);if(!(n>=48&&n<=57||n>=65&&n<=90))return;let r=t;for(;e[r]&&!e[r].trim()&&!"\r\n".includes(e[r]);)r+=1;if(!e[r])return;let i=e.charCodeAt(r);if(i<48||i>57)return;let o=t-1;for(;o>=0&&Vt(e[o]);)o-=1;o+=1;let l=r;for(;l<e.length&&Vt(e[l]);)l+=1;if(!(zt(xn(e,o))||zt(Dn(e,l))))return/^[A-Z]{1,2}[0-9][0-9A-Z]?$/.test(e.slice(o,t))&&/^[0-9][A-Z]{2}$/.test(e.slice(r,l))?{whitespaceEnd:r,tokenStart:o,tokenEnd:l}:void 0}var In=["removeWidowPreventionMeasures","convertEntities","targetLanguage","UKPostcodes","hyphens","minWordCount","minCharCount","ignore","reportProgressFunc","reportProgressFuncFrom","reportProgressFuncTo","tagRanges"];function ae(e){return{nestedBlock:e===ie[1]||e===ie[2],heads:typeof e.heads=="string"?e.heads:[...e.heads],tails:typeof e.tails=="string"?e.tails:[...e.tails]}}function z(e,t){return Object.getOwnPropertyDescriptor(e,t)!==void 0}function Gt(e,t){var n;return((n=Object.getOwnPropertyDescriptor(e,t))==null?void 0:n.enumerable)===!0}function Sn(e){for(let t in e)if(!z(e,t))return t}function Ut(e){if(typeof e=="string")return e.length>0?e:void 0;if(!Array.isArray(e)||e.length===0)return;let t=[];for(let n=0;n<e.length;n+=1){if(!z(e,n))return;let r=e[n];if(typeof r!="string"||r.length===0)return;t.push(r)}return t}function qt(e,t){let n=t.trim().toLowerCase();if(!["all","hexo","hugo","jinja","liquid","nunjucks"].includes(n))return'option "ignore" contains an unsupported preset '.concat(JSON.stringify(t),".");n==="all"?e.push(...ie.map(ae),...Be.map(ae)):["nunjucks","jinja","liquid"].includes(n)?e.push(...ie.map(ae)):n==="hugo"?e.push(...Lt.map(ae)):e.push(...Be.map(ae))}function Nn(e){let t=[];if(typeof e=="string"){let n=qt(t,e);return n?{ok:!1,kind:"preset",detail:n}:{ok:!0,value:t}}if(!Array.isArray(e))return{ok:!1,kind:"shape",detail:'option "ignore" must be a supported preset or an array of presets and { heads, tails } marker objects, but it was '.concat(p(e,4),".")};for(let n=0;n<e.length;n+=1){if(!z(e,n))return{ok:!1,kind:"shape",detail:'option "ignore" cannot contain sparse entries.'};let r=e[n];if(typeof r=="string"){let a=qt(t,r);if(a)return{ok:!1,kind:"preset",detail:a};continue}if(!S(r)||Sn(r)!==void 0||Object.getOwnPropertySymbols(r).some(a=>Gt(r,a)))return{ok:!1,kind:"shape",detail:'option "ignore" contains a malformed marker object.'};let i=Object.keys(r);if(i.length!==2||!i.includes("heads")||!i.includes("tails"))return{ok:!1,kind:"shape",detail:'every custom ignore marker must contain only own "heads" and "tails" keys.'};let o=r,l=Ut(o.heads),u=Ut(o.tails);if(l===void 0||u===void 0)return{ok:!1,kind:"shape",detail:"custom ignore marker heads and tails must be non-empty strings or dense arrays of non-empty strings."};t.push({heads:l,tails:u})}return{ok:!0,value:t}}function Mn(e,t){if(e===null)return{ok:!0,value:[]};if(!Array.isArray(e))return{ok:!1,kind:"container",detail:'option "tagRanges" must be null or an array of half-open ranges, but it was '.concat(p(e,4),".")};let n=[];for(let i=0;i<e.length;i+=1){if(!z(e,i))return{ok:!1,kind:"range",detail:'option "tagRanges" cannot contain sparse entries.'};let o=e[i];if(!Array.isArray(o)||o.length!==2&&o.length!==3||!z(o,0)||!z(o,1)||o.length===3&&!z(o,2))return{ok:!1,kind:"range",detail:'every "tagRanges" member must be a dense two- or three-item range.'};let l=o[0],u=o[1],a=o.length===3?o[2]:void 0;if(!Number.isInteger(l)||!Number.isInteger(u)||l<0||l>=u||o.length===3&&a!==null&&a!==void 0&&typeof a!="string")return{ok:!1,kind:"range",detail:'every "tagRanges" member must be a non-negative half-open range with integer from/to values and from below to.'};l<t&&n.push([l,Math.min(u,t)])}n.sort((i,o)=>i[0]===o[0]?i[1]-o[1]:i[0]-o[0]);let r=[];for(let i of n){let o=r[r.length-1];o&&i[0]<=o[1]?o[1]=Math.max(o[1],i[1]):r.push(i)}return{ok:!0,value:r}}function Fn(e,t){var y,c,m,A,h,T,W,R;if(t===void 0)return x;let n=t!=null?t:{},r=Object.keys(n),i;for(let b in n)if(!z(n,b)){i=b;break}let o=r.find(b=>!In.includes(b)),l=Object.getOwnPropertySymbols(n).find(b=>Gt(n,b));if(o!==void 0||i!==void 0||l!==void 0){let b=(y=o!=null?o:i)!=null?y:String(l);throw new TypeError("string-remove-widows/removeWidows(): [THROW_ID_04] every option must be an own, known string key; received ".concat(JSON.stringify(b),"."))}let u=Object.create(null);for(let b of r)u[b]=n[b];for(let b of["removeWidowPreventionMeasures","convertEntities","UKPostcodes","hyphens"])if(b in u&&typeof u[b]!="boolean")throw new TypeError("string-remove-widows/removeWidows(): [THROW_ID_05] option ".concat(JSON.stringify(b)," must be Boolean, but it was ").concat(p(u[b],4),"."));if("targetLanguage"in u&&!["html","css","js"].includes(u.targetLanguage))throw new TypeError('string-remove-widows/removeWidows(): [THROW_ID_06] option "targetLanguage" must be exactly "html", "css", or "js", but it was '.concat(p(u.targetLanguage,4),"."));for(let b of["minWordCount","minCharCount"]){let k=u[b];if(b in u&&k!==!1&&k!==null&&(typeof k!="number"||!Number.isFinite(k)||k<0))throw new TypeError("string-remove-widows/removeWidows(): [THROW_ID_07] option ".concat(JSON.stringify(b)," must be a finite non-negative number, false, or null, but it was ").concat(p(k,4),"."))}let a=Nn("ignore"in u?u.ignore:x.ignore);if(!a.ok)throw a.kind==="shape"?new TypeError("string-remove-widows/removeWidows(): [THROW_ID_08] ".concat(a.detail)):new TypeError("string-remove-widows/removeWidows(): [THROW_ID_09] ".concat(a.detail));let _="reportProgressFunc"in u?u.reportProgressFunc:x.reportProgressFunc;if(_!==!1&&_!==null&&typeof _!="function")throw new TypeError('string-remove-widows/removeWidows(): [THROW_ID_10] option "reportProgressFunc" must be a function, false, or null, but it was '.concat(p(_,4),"."));for(let b of["reportProgressFuncFrom","reportProgressFuncTo"]){let k=b in u?u[b]:x[b];if(typeof k!="number"||!Number.isInteger(k)||k<0||k>100)throw new TypeError("string-remove-widows/removeWidows(): [THROW_ID_11] option ".concat(JSON.stringify(b)," must be an integer from 0 through 100, but it was ").concat(p(k,4),"."))}let f=(c=u.reportProgressFuncFrom)!=null?c:x.reportProgressFuncFrom,d=(m=u.reportProgressFuncTo)!=null?m:x.reportProgressFuncTo;if(f>d)throw new RangeError('string-remove-widows/removeWidows(): [THROW_ID_12] option "reportProgressFuncFrom" ('.concat(f,') must not exceed "reportProgressFuncTo" (').concat(d,")."));let g=Mn("tagRanges"in u?u.tagRanges:[],e.length);if(!g.ok)throw g.kind==="container"?new TypeError("string-remove-widows/removeWidows(): [THROW_ID_13] ".concat(g.detail)):new TypeError("string-remove-widows/removeWidows(): [THROW_ID_14] ".concat(g.detail));return{removeWidowPreventionMeasures:(A=u.removeWidowPreventionMeasures)!=null?A:x.removeWidowPreventionMeasures,convertEntities:(h=u.convertEntities)!=null?h:x.convertEntities,targetLanguage:(T=u.targetLanguage)!=null?T:x.targetLanguage,UKPostcodes:(W=u.UKPostcodes)!=null?W:x.UKPostcodes,hyphens:(R=u.hyphens)!=null?R:x.hyphens,minWordCount:"minWordCount"in u?u.minWordCount:x.minWordCount,minCharCount:"minCharCount"in u?u.minCharCount:x.minCharCount,ignore:a.value,reportProgressFunc:typeof _=="function"?_:null,reportProgressFuncFrom:f,reportProgressFuncTo:d,tagRanges:g.value}}return sn(Hn);})();
|
|
10
|
+
"use strict";var stringRemoveWidows=(()=>{var he=Object.defineProperty,Yt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptor,en=Object.getOwnPropertyDescriptors,tn=Object.getOwnPropertyNames,ht=Object.getOwnPropertySymbols;var mt=Object.prototype.hasOwnProperty,nn=Object.prototype.propertyIsEnumerable;var Re=(e,t,n)=>t in e?he(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q=(e,t)=>{for(var n in t||(t={}))mt.call(t,n)&&Re(e,n,t[n]);if(ht)for(var n of ht(t))nn.call(t,n)&&Re(e,n,t[n]);return e},yt=(e,t)=>Yt(e,en(t));var rn=(e,t)=>{for(var n in t)he(e,n,{get:t[n],enumerable:!0})},on=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of tn(t))!mt.call(e,i)&&i!==n&&he(e,i,{get:()=>t[i],enumerable:!(r=Xt(t,i))||r.enumerable});return e};var sn=e=>on(he({},"__esModule",{value:!0}),e);var ne=(e,t,n)=>Re(e,typeof t!="symbol"?t+"":t,n);var Hn={};rn(Hn,{defaults:()=>Cn,removeWidows:()=>En,version:()=>Tn});function an(){let e=[],t=0,n=!1;return{append(r){return n?!1:t+r.length>1999?(e.push("\u2026"),t+=1,n=!0,!1):(e.push(r),t+=r.length,!0)},result(){return e.join("")},stopped(){return n}}}function ln(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function me(e,t){if(e.append('"')){for(let n=0;n<t.length&&!e.stopped();n+=1){let r=t.charCodeAt(n);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(ln(r)):e.append(t[n])}e.append('"')}}function un(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function wt(e,t){e.append("Symbol(");let n=String(t);n.length>8&&me(e,n.slice(7,-1)),e.append(")")}function bt(e,t){typeof t=="symbol"?wt(e,t):me(e,String(t))}function p(e,t=0){let n=an(),r=t===4?4:0,i=new WeakSet,o=0;function l(c){r&&n.append(" ".repeat(c*r))}function u(c,m){c&&n.append(","),r&&(n.append("\n"),l(m+1))}function a(c,m,A){r&&m&&(n.append("\n"),l(A)),n.append(c)}function _(c,m){Object.prototype.hasOwnProperty.call(c,"value")?y(c.value,m):n.append(un(c))}function f(c,m){let A;try{A=Reflect.getOwnPropertyDescriptor(c,"length")}catch(W){n.append("[Uninspectable]");return}let h=A==null?void 0:A.value;if(!Number.isSafeInteger(h)||h<0){n.append("[Uninspectable]");return}n.append("[");let T=!1;for(let W=0;W<h&&!n.stopped();W+=1){if(u(T,m),T=!0,o>=50){n.append("[MaxEntries]");break}o+=1;let R;try{R=Reflect.getOwnPropertyDescriptor(c,String(W))}catch(b){n.append("[Uninspectable]");continue}R!=null&&R.enumerable?_(R,m+1):n.append("[Empty]")}a("]",T,m)}function d(c,m){let A;try{A=Reflect.ownKeys(c)}catch(T){n.append("[Uninspectable]");return}n.append("{");let h=!1;for(let T of A){if(n.stopped())break;if(o>=50){u(h,m),h=!0,me(n,"\u2026"),n.append(r?": ":":"),n.append("[MaxEntries]");break}o+=1;let W;try{W=Reflect.getOwnPropertyDescriptor(c,T)}catch(R){u(h,m),h=!0,bt(n,T),n.append(r?": ":":"),n.append("[Uninspectable]");continue}W!=null&&W.enumerable&&(u(h,m),h=!0,bt(n,T),n.append(r?": ":":"),_(W,m+1))}a("}",h,m)}function g(c,m){if(i.has(c)){n.append("[Circular]");return}if(m>=5){n.append("[MaxDepth]");return}let A;try{A=Array.isArray(c)}catch(h){n.append("[Uninspectable]");return}i.add(c);try{A?f(c,m):d(c,m)}finally{i.delete(c)}}function y(c,m){c===null?n.append("null"):typeof c=="string"?me(n,c):typeof c=="number"?n.append(Object.is(c,-0)?"-0":String(c)):typeof c=="boolean"?n.append(c?"true":"false"):typeof c>"u"?n.append("undefined"):typeof c=="bigint"?n.append("".concat(c,"n")):typeof c=="symbol"?wt(n,c):typeof c=="function"?n.append("[Function]"):g(c,m)}try{return y(e,0),n.result()}catch(c){return"[Uninspectable]"}}var _n=["_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(""),De=_n.slice(1).split("_"),xe=[],vt=127;for(let e=0;e<De.length;e+=2){let t=vt+1+Number.parseInt(De[e],36),n=t+Number.parseInt(De[e+1],36);xe.push([t,n]),vt=n}function fn(e){if(Number.isNaN(e)||e<128||e>1114111)return!1;let t=0,n=xe.length-1;for(;t<=n;){let r=t+n>>1,i=xe[r];if(e<i[0])n=r-1;else if(e>i[1])t=r+1;else return!0}return!1}var je="\u2013",Pe="\u2014",re="\xA0";var zn=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"]);var Wt=Function.prototype.toString,dn=Wt.call(Object);var Un=Map.prototype.entries,qn=Set.prototype.values;var $t,Jn=($t=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:$t.get,At,Kn=(At=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:At.get,Tt,Gn=(Tt=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:Tt.get,Ct,Qn=(Ct=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:Ct.get,Zn=RegExp.prototype.test;function cn(e){if(e.length===1){let t=e.charCodeAt(0);return t<55296||t>57343?t:-1}if(e.length===2){let t=e.charCodeAt(0),n=e.charCodeAt(1);if(t>=55296&&t<=56319&&n>=56320&&n<=57343)return(t-55296)*1024+n-56320+65536}return-1}function kt(e){if(!H(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>64&&t<91||t>96&&t<123:fn(cn(e))}function S(e){var r;if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.getOwnPropertyDescriptor(t,"constructor");return!n||!("value"in n)||typeof n.value!="function"?!1:((r=Object.getOwnPropertyDescriptor(n.value,"prototype"))==null?void 0:r.value)===t&&Wt.call(n.value)===dn}function H(e){return typeof e=="string"}function Ie(e){return Number.isFinite(e)}function oe(e){return Number.isSafeInteger(e)&&e>=0}var Yn=Date.prototype.getTime;function ye(e){return e!=null}var Ot={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function gn(e,t){let n,r=0;for(;r<e.length;){let i=r+1;for(;i<e.length&&e[r][0]===e[i][0]&&e[r][1]===e[i][1];)i+=1;if(i-r>1){n||(n=new Map(t.map((u,a)=>[u,a])));let o=n,l=e.slice(r,i).sort((u,a)=>o.get(u)-o.get(a));e.splice(r,l.length,...l)}r=i}return e}function Z(e,t){var u;if(!Array.isArray(e)||!e.length)return e;let n=t===void 0?!0:S(t);if(t!==void 0&&n&&(t==null?void 0:t.strictlyTwoElementsInRangeArrays)===!0)for(let a=0;a<e.length;a+=1){let _=e[a];if(!Array.isArray(_)||_.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(a," (").concat(p(_,4),") is ").concat(Array.isArray(_)?"an array with ".concat(_.length," elements"):"not an array","!"));if(!Number.isInteger(_[0])||_[0]<0||!Number.isInteger(_[1])||_[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(a," (").concat(p(_,4),") does not consist of only natural numbers!"))}else for(let a=0;a<e.length;a+=1){let _=e[a];if(!Array.isArray(_)||!Number.isInteger(_[0])||_[0]<0||!Number.isInteger(_[1])||_[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(a," (").concat(p(_,4),") does not consist of only natural numbers!"))}if(t!==void 0&&!n)throw new TypeError("ranges-sort/rSort(): [THROW_ID_03] The second argument must be a plain options object; received ".concat(p(t,4)," (type ").concat(typeof t,")!"));let r=Ot.progressFn;if(t!==void 0){let a=t.strictlyTwoElementsInRangeArrays;if(a!==void 0&&typeof a!="boolean")throw new TypeError("ranges-sort/rSort(): [THROW_ID_04] opts.strictlyTwoElementsInRangeArrays must be a boolean; received ".concat(p(a,4)," (type ").concat(typeof a,")!"));if(r=(u=t.progressFn)!=null?u:Ot.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(p(r,4)," (type ").concat(typeof r,")!"))}let i,o;if(r){let a=e.length**2,_=0,f;o=d=>{d!==f&&(f=d,r(d))},i=Array.from(e).sort((d,g)=>(_+=1,o==null||o(Math.min(99,Math.floor(_*100/a))),d[0]===g[0]?d[1]<g[1]?-1:d[1]>g[1]?1:0:d[0]<g[0]?-1:1))}else i=Array.from(e).sort((a,_)=>a[0]===_[0]?a[1]<_[1]?-1:a[1]>_[1]?1:0:a[0]<_[0]?-1:1);let l=i.length>10?gn(i,e):i;return o==null||o(100),l}var pn={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Se(e,t){if(!Array.isArray(e)||!e.length)return null;if(t!==void 0&&!S(t))throw new TypeError("ranges-merge/rMerge(): [THROW_ID_01] the second input argument must be a plain object. It was given as:\n".concat(p(t,4)," (type ").concat(typeof t,")"));let n=Q(Q({},pn),t);if(n.progressFn&&S(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_02] opts.progressFn must be a function! It was given of a type: "'.concat(typeof n.progressFn,'", equal to ').concat(p(n.progressFn,4)));if(n.mergeType!==1&&n.mergeType!==2&&n.mergeType!=="1"&&n.mergeType!=="2")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_03] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof n.mergeType,'", equal to ').concat(p(n.mergeType,4)));if(typeof n.joinRangesThatTouchEdges!="boolean")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof n.joinRangesThatTouchEdges,'", equal to ').concat(p(n.joinRangesThatTouchEdges,4)));let r=n.progressFn,i=n.joinRangesThatTouchEdges,o=[];for(let y of e)Array.isArray(y)&&(y[2]!==void 0||y[0]!==y[1])&&o.push([...y]);let l,u,a;r?l=Z(o,{progressFn:y=>{a=Math.floor(y/5),a!==u&&(u=a,r(a))}}):l=Z(o);let _=l.length-1,f=n.mergeType===2||n.mergeType==="2",d=l.length;for(let y=_;y>=0;y--){let c=l[y];for(r&&y<_&&(a=Math.floor((1-(y+1)/_)*78)+21,a!==u&&a>u&&(u=a,r(a)));d<l.length;){let m=l[d],A=m[0]===c[0];if(!A&&(i?m[0]>c[1]:m[0]>=c[1]))break;let h=m[1]>=c[1];h&&(c[1]=m[1]),m[2]===null?c[2]=null:m[2]!==void 0&&(A||h)&&c[2]!==null&&(c[2]!=null?f&&A?c[2]=m[2]:c[2]+=m[2]:c[2]=m[2]),d+=1}d-=1,l[d]=c}let g=l.length-d;for(let y=0;y<g;y++)l[y]=l[d+y];return l.length=g,r&&u!==99&&r(99),l.length?l:null}function be(e){if(typeof e=="number")return Number.isInteger(e)&&e>=0;if(typeof e!="string"||!e.trim())return!1;let t=Number(e);return Number.isInteger(t)&&t>=0}function Et(e,t,n){let r=0,i=0;if(e===void 0&&t===void 0&&n===void 0)throw new Error("ranges-apply/rApply(): [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError("ranges-apply/rApply(): [THROW_ID_02] first input argument must be a string! Currently it's: ".concat(typeof e,", equal to: ").concat(p(e,4)));if(t!=null&&!Array.isArray(t))throw new TypeError("ranges-apply/rApply(): [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ".concat(typeof t,", equal to: ").concat(p(t,4)));if(n!=null&&n!==!1&&n!==0&&n!==""&&typeof n!="function")throw new TypeError("ranges-apply/rApply(): [THROW_ID_04] the third input argument must be a function, false, null, undefined, 0, or an empty string! Currently it's: ".concat(typeof n,", equal to: ").concat(p(n,4)));if(t==null||!t.length||t.every(f=>f==null))return n&&n(100),e;let o;Array.isArray(t)&&!Array.isArray(t[0])&&be(t[0])&&be(t[1])?o=[Array.from(t)]:o=Array.from(t);let l=o.length,u=0;o.forEach((f,d)=>{if(f){if(n&&(r=Math.floor(u/l*10),r!==i&&(i=r,n(r))),!Array.isArray(f))throw new TypeError("ranges-apply/rApply(): [THROW_ID_05] ranges array, second input arg., has ".concat(d,"th element not an array: ").concat(p(f,4),", which is ").concat(typeof f));if(!be(f[0]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_06] ranges array, second input arg. has ".concat(d,"th element, array ").concat(p(f),". Its first element is not a non-negative integer or string index, but ").concat(typeof f[0],", equal to: ").concat(p(f[0],4),"."));if(typeof f[0]=="string"&&(o[d]=[...f],o[d][0]=Number(f[0])),!be(f[1]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_07] ranges array, second input arg. has ".concat(d,"th element, array ").concat(p(f),". Its second element is not a non-negative integer or string index, but ").concat(typeof f[1],", equal to: ").concat(p(f[1],4),"."));if(typeof f[1]=="string"&&(o[d]===f&&(o[d]=[...f]),o[d][1]=Number(f[1])),o[d][0]>o[d][1])throw new RangeError("ranges-apply/rApply(): [THROW_ID_08] ranges array, second input arg. has ".concat(d,"th element, array ").concat(p(f),". Its first index (").concat(o[d][0],") must not be greater than its second index (").concat(o[d][1],")."));u+=1}});let a=n?Se(o,{progressFn:f=>{r=10+Math.floor(f/10),r!==i&&(i=r,n(r))}}):Se(o),_=(a==null?void 0:a.length)||0;if(a&&_>0){let f=e.slice(a[_-1][1]);e=a.reduce((d,g,y,c)=>{var h;n&&(r=20+Math.floor(y/_*80),r!==i&&(i=r,n(r)));let m=y===0?0:c[y-1][1],A=c[y][0];return"".concat(d).concat(e.slice(m,A)).concat((h=c[y][2])!=null?h:"")},""),e+=f}return n&&i!==100&&n(100),e}function we(e,t=1){let n="\xA0";function r(o){return o.length<2?o:Array.from(o).reverse().join("")}function i(o,l,u){let a=u?"\n":"\r",_=u?"\r":"\n";if(!o)return o;let f=0,d="";for(let g=0,y=o.length;g<y;g++)(o[g]===a||o[g]===_&&o[g-1]!==a)&&f++,"\r\n".includes(o[g])||o[g]===n?o[g]===n?d+=o[g]:o[g]===a?f<=l&&(d+=o[g],o[g+1]===_&&(d+=o[g+1],g++)):o[g]===_&&(o==null?void 0:o[g-1])!==a&&f<=l&&(d+=o[g]):!o[g+1]&&!f&&(d+=" ");return d}if(typeof e=="string"&&e.length){let o=e.trim();if(o.length===e.length)return e;let l=1;typeof t=="number"&&Number.isInteger(t)&&t>=0&&(l=t);let u="",a="";if(!o)u=e;else if(!e[0].trim()){for(let f=0,d=e.length;f<d;f++)if(e[f].trim()){u=e.slice(0,f);break}}let _=e[e.length-1];if(o&&(_.trim()===""||_===n)){for(let f=e.length;f--;)if(e[f].trim()){a=e.slice(f+1);break}}return"".concat(i(u,l,!1)).concat(o).concat(r(i(r(a),l,!0)))}return e}var Ne={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Rt(e,t,n){return t===void 0||e===null?e:t===null?null:e===void 0||n?t:e+t}function hn(e,t){var c,m,A;function n(h){return!!h&&typeof h=="object"&&!Array.isArray(h)}if(!Array.isArray(e)||!e.length)return null;if(t&&!n(t))throw new TypeError("ranges-push/rMerge(): [THROW_ID_07] the second input argument must be a plain object. It was given as:\n".concat(p(t,4)," (type ").concat(typeof t,")"));let r=(c=t==null?void 0:t.progressFn)!=null?c:Ne.progressFn,i=(m=t==null?void 0:t.mergeType)!=null?m:Ne.mergeType,o=(A=t==null?void 0:t.joinRangesThatTouchEdges)!=null?A:Ne.joinRangesThatTouchEdges;if(r&&n(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(p(r,4)));if(i!==1&&i!==2&&i!=="1"&&i!=="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 i,'", equal to ').concat(p(i,4)));if(typeof o!="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 o,'", equal to ').concat(p(o,4)));let l=[];for(let h of e)Array.isArray(h)&&(h[2]!==void 0||h[0]!==h[1])&&l.push([...h]);let u,a,_;r?u=Z(l,{progressFn:h=>{_=Math.floor(h/5),_!==a&&(a=_,r==null||r(_))}}):u=Z(l);let f=u.length-1,d=+i==2,g=u.length;for(let h=f;h>=0;h--){let T=u[h];for(r&&h<f&&(_=Math.floor((1-(h+1)/f)*78)+21,_!==a&&_>a&&(a=_,r(_)));g<u.length;){let W=u[g],R=W[0]===T[0];if(!R&&(o?W[0]>T[1]:W[0]>=T[1]))break;let b=W[1]>=T[1];b&&(T[1]=W[1]),W[2]===null?T[2]=null:W[2]!==void 0&&(R||b)&&(T[2]=Rt(T[2],W[2],d&&R)),g+=1}g-=1,u[g]=T}let y=u.length-g;for(let h=0;h<y;h++)u[h]=u[g+h];return u.length=y,u.length?u:null}var ve=Object.freeze({limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1});function V(e){if(oe(e))return e;if(typeof e=="string"&&/^\d+$/.test(e)){let t=Number(e);return oe(t)?t:null}return null}function Dt(e){if(!Array.isArray(e))return"a ranges batch must contain only range arrays; received ".concat(p(e,4));if(e.length>3)return"a range must contain at most three values; received ".concat(p(e,4));let[t,n,r]=e;if(t==null&&n==null)return;if(t!=null&&n==null)return"the first index is set (".concat(p(t),") but the second index is not (").concat(p(n),")");if(t==null&&n!=null)return"the second index is set (".concat(p(n),") but the first index is not (").concat(p(t),")");let i=V(t),o=V(n);if(i===null)return"the first index must be a natural number, zero, or a digit-only numeric string; received ".concat(p(t,4)," (type ").concat(typeof t,")");if(o===null)return"the second index must be a natural number, zero, or a digit-only numeric string; received ".concat(p(n,4)," (type ").concat(typeof n,")");if(ye(r)&&!H(r)&&!Ie(r))return"the third value must be a string, number, null, or undefined; received ".concat(p(r,4)," (type ").concat(typeof r,")");if(i>o)return"the first index (".concat(i,") must not be greater than the second index (").concat(o,")")}function mn(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 n=e[0];if(!n.length)return{ranges:[]};e=Array.isArray(n[0])?n:[n]}else e=[e];let t=[];for(let n of e){let r=Dt(n);if(r)return{error:r,ranges:[]};let[i,o,l]=n;if(i==null&&o==null)continue;let u=V(i),a=V(o);t.push(l!==void 0&&!(H(l)&&!l.length)?[u,a,l]:[u,a])}return{ranges:t}}function yn(e){return e[2]===void 0&&e[0]===e[1]}function bn(e){let t=-1;for(let n=0,r=e.length;n<r;n++){let i=e[n];if(Array.isArray(i)){if(i[0]<t)return!1;t=i[0]}}return!0}var xt=class{constructor(e){ne(this,"ranges");ne(this,"opts");ne(this,"currentCache",null);if(e!=null&&!S(e))throw new TypeError("ranges-push/Ranges/constructor(): [THROW_ID_01] The options argument must be a plain object. It was given as ".concat(p(e,4)," (type ").concat(typeof e,")."));if(e===void 0){this.opts=ve,this.ranges=[];return}let t=e,n=t.limitToBeAddedWhitespace===void 0?ve.limitToBeAddedWhitespace:t.limitToBeAddedWhitespace,r=t.limitLinebreaksCount===void 0?ve.limitLinebreaksCount:t.limitLinebreaksCount,i=t.mergeType===void 0?ve.mergeType:t.mergeType,o=i==="1"?1:i==="2"?2:i,l;if(typeof n!="boolean"?l="opts.limitToBeAddedWhitespace must be a boolean; received ".concat(p(n,4)," (type ").concat(typeof n,")"):oe(r)?o!==1&&o!==2&&(l='opts.mergeType must be 1, 2, "1", or "2"; received '.concat(p(i,4)," (type ").concat(typeof i,")")):l="opts.limitLinebreaksCount must be a natural number or zero; received ".concat(p(r,4)," (type ").concat(typeof r,")"),l)throw new TypeError("ranges-push/Ranges/constructor(): [THROW_ID_02] ".concat(l,"."));let u=Object.freeze({limitToBeAddedWhitespace:n,limitLinebreaksCount:r,mergeType:o});this.opts=u,this.ranges=[]}rangeListsMatch(e,t){if(!Array.isArray(e))return t===null;if(!Array.isArray(t)||e.length!==t[0])return!1;let n=1;for(let r=0,i=e.length;r<i;r++){let o=e[r];if(!Array.isArray(o)){if(t[n++]!==-1||o!==t[n++])return!1;continue}if(o.length!==t[n++])return!1;for(let l=0;l<o.length;l++)if(o[l]!==t[n++])return!1}return n===t.length}snapshotRanges(e){if(!Array.isArray(e))return null;let t=new Array(1+e.length*4);t[0]=e.length;let n=1;for(let r=0,i=e.length;r<i;r++){let o=e[r];if(Array.isArray(o)){t[n++]=o.length;for(let l=0;l<o.length;l++)t[n++]=o[l]}else t[n++]=-1,t[n++]=o}return t.length=n,t}currentStateMatchesSnapshot(){let e=this.currentCache;return e!==null&&this.rangeListsMatch(this.ranges,e.rangesSnapshot)&&this.rangeListsMatch(e.result,e.resultSnapshot)}recordCurrentSnapshot(e){let t=this.snapshotRanges(this.ranges);this.currentCache={rangesSnapshot:t,result:e,resultSnapshot:e===this.ranges?t:this.snapshotRanges(e)}}invalidateCurrentCache(){this.currentCache=null}addValidated(e,t,n){this.invalidateCurrentCache();let r=this.last();if(ye(this.ranges)&&Array.isArray(r)&&e===r[1]){if(r[1]=t,n!==void 0&&!(H(n)&&!n.length)){let o=Rt(r[2],n,this.opts.mergeType===2&&r[0]===e);this.opts.limitToBeAddedWhitespace&&typeof o=="string"&&(o=we(o,this.opts.limitLinebreaksCount)),H(o)&&!o.length||(r[2]=o)}return}this.ranges||(this.ranges=[]);let i=n!==void 0?[e,t,typeof n=="string"&&this.opts.limitToBeAddedWhitespace?we(n,this.opts.limitLinebreaksCount):n]:[e,t];this.ranges.push(i)}add(e,t,n){let r=arguments.length,i;if(r>3)i="expected at most three arguments but received ".concat(r);else if(r===1&&Array.isArray(e)){let o=Array.isArray(e[0])?e:[e];for(let l=0,u=o.length;l<u&&(i=Dt(o[l]),!i);l++);if(!i)for(let l=0,u=o.length;l<u;l++){let[a,_,f]=o[l];a==null&&_==null||this.addValidated(V(a),V(_),H(f)&&!f.length?void 0:f)}}else{if(e==null&&t==null)return;if(e!=null&&t==null)i="the first index is set (".concat(p(e),") but the second index is not (").concat(p(t),")");else if(e==null&&t!=null)i="the second index is set (".concat(p(t),") but the first index is not (").concat(p(e),")");else{let o=V(e),l=V(t);o===null?i="the first index must be a natural number, zero, or a digit-only numeric string; received ".concat(p(e,4)," (type ").concat(typeof e,")"):l===null?i="the second index must be a natural number, zero, or a digit-only numeric string; received ".concat(p(t,4)," (type ").concat(typeof t,")"):ye(n)&&!H(n)&&!Ie(n)?i="the third value must be a string, number, null, or undefined; received ".concat(p(n,4)," (type ").concat(typeof n,")"):o>l?i="the first index (".concat(o,") must not be greater than the second index (").concat(l,")"):this.addValidated(o,l,H(n)&&!n.length?void 0:n)}}if(i)throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_03] ".concat(i,"."))}push(e,t,n){this.add.apply(this,arguments)}current(){var e,t;if(this.currentStateMatchesSnapshot())return(t=(e=this.currentCache)==null?void 0:e.result)!=null?t:null;if(Array.isArray(this.ranges)&&this.ranges.length){this.ranges=hn(this.ranges,this.opts.mergeType===1?void 0:{mergeType:2});let n=this.ranges;return n&&this.opts.limitToBeAddedWhitespace&&(n=n.map(r=>typeof r[2]=="string"?[r[0],r[1],we(r[2],this.opts.limitLinebreaksCount)]:r)),this.recordCurrentSnapshot(n),n}return this.recordCurrentSnapshot(null),null}firstCovers(e){if(!oe(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(p(e,4)," (type ").concat(typeof e,")"));if(!Array.isArray(this.ranges)||!this.ranges.length)return!1;let t=bn(this.ranges)?this.ranges:this.ranges.filter(r=>Array.isArray(r)).slice().sort((r,i)=>r[0]-i[0]||r[1]-i[1]),n=null;for(let r=0,i=t.length;r<i;r++){let o=t[r];if(!(!Array.isArray(o)||yn(o))){if(n===null){if(o[0]!==0)return!1;n=o[1]}else{if(o[0]>n)break;o[1]>n&&(n=o[1])}if(n>=e)return!0}}return n!==null&&n>=e}wipe(){this.ranges=[],this.invalidateCurrentCache()}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])){let t=mn([e]);if(t.error)throw new TypeError("ranges-push/Ranges/replace(): [THROW_ID_06] ".concat(t.error,"."));this.ranges=t.ranges,this.invalidateCurrentCache()}else throw new Error("ranges-push/Ranges/replace(): [THROW_ID_05] Single range was given but we expected array of arrays! The first element, ".concat(p(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 Y(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 jt(e,t){return t==null?0:typeof t!="number"||!Number.isInteger(t)||t<0?null:t>e?e:t}function wn(e,t){return t===-1?-1:jt(e,t)}function Pt(e,t=0){if(typeof e!="string"||!e.length)return null;let n=wn(e.length,t);if(n===null||n+1>=e.length)return null;let r=n+1;if(!Y(e.charCodeAt(r)))return r;if(r+=1,r>=e.length)return null;if(!Y(e.charCodeAt(r)))return r;for(r+=1;r<e.length;r++)if(!Y(e.charCodeAt(r)))return r;return null}function $e(e,t=0){if(typeof e!="string"||!e.length)return null;let n=jt(e.length,t);if(n===null||n<1)return null;let r=n-1;if(!Y(e.charCodeAt(r)))return r;if(r-=1,r<0)return null;if(!Y(e.charCodeAt(r)))return r;for(r-=1;r>=0;r--)if(!Y(e.charCodeAt(r)))return r;return null}var It="4.2.8";function Me(e){return e===32||e>=9&&e<=13&&e!==11}function Fe(e,t,n=!0){let r=t+(e[t+1]==="/"?2:1),i=e.charCodeAt(r)|32;if(i<97||i>122)return;for(r+=1;r<e.length;){let a=e.charCodeAt(r);if(a<=62&&(Me(a)||a===47||a===34||a===39||a>=60&&a<=62))break;r+=1}if(e[r]&&!Me(e.charCodeAt(r))&&e[r]!=="/"&&e[r]!==">")return;let o,l=!1,u=!1;for(;r<e.length;r+=1){let a=e[r];if(o)a===o&&(o=void 0);else{if(a===">")return r+1;if(a==="<")return n?r:void 0;Me(e.charCodeAt(r))?u=!1:l?(l=!1,a==='"'||a==="'"?o=a:u=!0):a==="="&&!u&&(l=!0)}}return n?e.length:void 0}var $n=new Set(["address","article","aside","blockquote","body","br","caption","center","dd","details","dialog","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"]),An=new Set(["script","style","pre","code","textarea","title"]);function Ae(e,t){if(e.startsWith("<!--",t)||e.startsWith("<![CDATA[",t)){let a=e.startsWith("<!--",t)?"-->":"]]>",_=e.indexOf(a,t+4);return{end:_<0?e.length:_+a.length,boundary:!1}}if(e.startsWith("<?",t)){let a=e.indexOf("?>",t+2);return{end:a<0?e.length:a+2,boundary:!1}}if(e.startsWith("<!",t)){let a,_=0;for(let f=t+2;f<e.length;f+=1){let d=e[f];if(a)d===a&&(a=void 0);else if(d==='"'||d==="'")a=d;else if(d==="[")_+=1;else if(d==="]")_=Math.max(0,_-1);else if(d===">"&&!_)return{end:f+1,boundary:!1}}return{end:e.length,boundary:!1}}let n=Fe(e,t);if(n===void 0)return;let r=e[t+1]==="/",i=t+(r?2:1),o=i;for(;o<n&&!/[\t\n\f\r />]/.test(e[o]);)o+=1;let l=e.slice(i,o).toLowerCase(),u=$n.has(l)||l==="script"||l==="style";if(!r&&An.has(l)&&e[n-1]===">"){let a=n,_=1;for(;a<e.length&&(a=e.indexOf("<",a),a!==-1);){if((l==="pre"||l==="code")&&(e[a+1]==="!"||e[a+1]==="?")){a=Ae(e,a).end;continue}let f=e[a+1]==="/",d=a+(f?2:1);if(e.slice(d,d+l.length).toLowerCase()===l&&/[\t\n\f\r />]/.test(e[d+l.length]||"")&&(f||l==="pre"||l==="code")){let g=Fe(e,a,!1);if(g!==void 0){if(_+=f?-1:1,!_)return{end:g,boundary:u};a=g;continue}}if(l==="pre"||l==="code"){if(/^<(script|style|textarea|title)(?=[\t\n\f\r />])/i.exec(e.slice(a,a+11))){a=Ae(e,a).end;continue}let y=Fe(e,a);if(y!==void 0){a=y;continue}}a+=1}return{end:e.length,boundary:u}}return{end:n,boundary:u}}function St(e,t,n){let r=[],i=t;for(;i<e.length;){let o=e.indexOf("{%",i);if(o<0)break;let l=e.indexOf("%}",o+2);if(l<0)break;let u=/^-?\s*(if|for|endif|endfor)(?=[\s%-]|$)/.exec(e.slice(o+2,l));if(u&&!n(o,l+2)){let a=u[1];if(a==="if"||a==="for")r.push(a);else if(r[r.length-1]===a.slice(3)&&(r.pop(),!r.length))return l+2}i=l+2}}var X=" ",He="\\0000A0",Le="\\u00A0",Nt="–";var Mt="\\u2013",Ft="—";var Ht="\\u2014",ie=[{heads:"{{",tails:"}}"},{heads:["{% if","{%- if"],tails:["{% endif","{%- endif"]},{heads:["{% for","{%- for"],tails:["{% endfor","{%- endfor"]},{heads:["{%","{%-"],tails:["%}","-%}"]},{heads:"{#",tails:"#}"}],Lt=[{heads:"{{",tails:"}}"}],Be=[{heads:["<%","<%=","<%-"],tails:["%>","=%>","-%>"]}];var Tn=It,Jt=4,Kt=5,x={removeWidowPreventionMeasures:!1,convertEntities:!0,targetLanguage:"html",UKPostcodes:!1,hyphens:!0,minWordCount:Jt,minCharCount:Kt,ignore:[],reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,tagRanges:[]},Cn=Object.freeze(yt(Q({},x),{ignore:Object.freeze([]),tagRanges:Object.freeze([])})),Wn=[Nt,Mt,Ft,Ht],kn=/[&\\\u00a0\u2013\u2014\r\n<>/0-9-]/;function On(e,t){var f,d;let n=0,r=0,i,o,l;for(let g=0;g<e.length;g+=1)if(e[g].trim())r+=1,(f=e[g-1])!=null&&f.trim()||(n+=1),i!==void 0&&(o=i,l=g,i=void 0);else if((d=e[g-1])!=null&&d.trim()){let y=g+1;for(;y<e.length&&!e[y].trim();)y+=1;y<e.length&&(i=g)}let u=!1,a=null,_=e;return o!==void 0&&l!==void 0&&n>=Jt&&r>=Kt&&(u=!0,a=[[o,l,X]],_="".concat(e.slice(0,o)).concat(X).concat(e.slice(l))),{res:_,ranges:a,log:{timeTakenInMilliseconds:Date.now()-t},whatWasDone:{removeWidows:u,convertEntities:!1},applicableOpts:{removeWidows:u,convertEntities:u}}}function En(e,t){var tt,nt,rt,ot,it,st,at,lt,ut,_t,ft,dt;let n=Date.now();if(typeof e!="string")throw e===void 0?new Error("string-remove-widows/removeWidows(): [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error('string-remove-widows/removeWidows(): [THROW_ID_02] the first input argument must be string! It was given as "'.concat(typeof e,'", equal to:\n').concat(p(e,4)));if(t!==void 0&&!S(t))throw new Error("string-remove-widows/removeWidows(): [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ".concat(typeof t,", equal to ").concat(p(t,4)));if(t===void 0&&!kn.test(e))return On(e,n);let r=Array.isArray,i=e.length,o=new Map,l=["."],u=.06,a,_,f=0,d=0,g=0,y,c,m,A,h,T,W=[],R=[],b,k,N,j,O,L=0,qe=[],B,ee,J,te,w=Fn(e,t),Je={removeWidows:!1,convertEntities:!1},U={removeWidows:!1,convertEntities:!1},le=new Map,ue=new Set;function Ke(s,v){return"".concat(s,":").concat(v)}function Ge(s,v,C){if(!s.length||v>=C)return!1;let E=0,F=s.length;for(;E<F;){let K=Math.floor((E+F)/2);s[K][1]<=v?E=K+1:F=K}return!!(s[E]&&s[E][0]<C)}function M(s,v){return Ge(w.tagRanges,s,v)||Ge(qe,s,v)}function _e(s,v){return e.startsWith(s,v)&&!M(v,v+s.length)}function Qe(s,v){return(typeof s.heads=="string"?_e(s.heads,v):s.heads.some(E=>_e(E,v)))&&(!s.nestedBlock||/^\{%-?\s*(if|for)(?=[\s%-]|$)/.test(e.slice(v,v+12)))}let Te=w.reportProgressFuncFrom+Math.floor((w.reportProgressFuncTo-w.reportProgressFuncFrom)*(1-u));function Ce(s){if(!w.reportProgressFunc)return;let v=Math.max(w.reportProgressFuncFrom,Math.min(w.reportProgressFuncTo,Math.floor(s)));(_===void 0||v>_)&&(_=v,w.reportProgressFunc(v))}function fe(s,v){if(M(s,v))return!1;let C=re;w.removeWidowPreventionMeasures?C=" ":w.convertEntities&&(C=X,w.targetLanguage==="css"?C=He:w.targetLanguage==="js"&&(C=Le));let E=Ke(s,v),F=se(e,s)===v;return U.removeWidows=!0,F&&(w.removeWidowPreventionMeasures?ue.delete(E):ue.add(E)),e.slice(s,v)!==C?(o.set(E,[s,v,C]),le.set(E,F&&C!==" "?"convertEntities":"removeWidows"),!0):(o.delete(E),le.delete(E),!1)}function We(){d=0,g=0,y=void 0,c=void 0,m=void 0,A=void 0,h=void 0,T=void 0,W=[],R=[],b=void 0,k=void 0,N=void 0,j=void 0}function Ze(){let s,v;if(m!==void 0&&A!==void 0&&b!==void 0&&k!==void 0?m>b?(s=m,v=A):(s=b,v=k):m!==void 0&&A!==void 0?(s=m,v=A):b!==void 0&&k!==void 0&&(s=b,v=k),(s===void 0||v===void 0)&&y!==void 0&&c!==void 0&&(s=y,v=c),s!==void 0&&v!==void 0&&(!w.minWordCount||d>=w.minWordCount)&&(!w.minCharCount||g>=w.minCharCount)&&!M(s,v))if(U.removeWidows=!0,s===m&&v===A)for(let[C,E]of R)fe(C,E);else fe(s,v);We()}function Ye(s){h!==void 0&&(y=m,c=A,m=h,A=T!=null?T:s,R=W,R.push([m,A]),W=[],h=void 0,T=void 0)}We(),Ce(w.reportProgressFuncFrom);for(let s=0;s<=i;s++){for(w.reportProgressFunc&&(a=w.reportProgressFuncFrom+Math.floor((i===0?1:Math.min(s,i)/i)*(Te-w.reportProgressFuncFrom)),Ce(a));w.tagRanges[L]&&w.tagRanges[L][1]<=s;)L+=1;let C=w.tagRanges[L],E=!1;if(!O&&e[s]==="<"&&(!C||s<=C[0])&&!w.ignore.some($=>Qe($,s))){let $=Ae(e,s);$&&(C=[s,$.end],E=$.boundary)}if(C&&s>=C[0]&&s<C[1]){for(C=[C[0],C[1]];w.tagRanges[L]&&w.tagRanges[L][0]<C[1];)C[1]=Math.max(C[1],w.tagRanges[L][1]),L+=1;qe.push(C);let $=B===s||ee===s||J!==s&&te!==s&&!((tt=e[s-1])!=null&&tt.trim());E?(Ze(),f=C[1]):h!==void 0&&T===void 0&&(T=s),B=void 0,J=void 0,ee=void 0,te=void 0,(E||$)&&(ee=C[1]),s=C[1]-1;continue}let F=ee===s;F&&(ee=void 0);let K=te===s;K&&(te=void 0);let ct=J===s;if(ct&&(J=void 0),!O&&r(w.ignore)&&w.ignore.length){let $=!1;if(w.ignore.some((I,ge)=>{var pe;if(Qe(I,s)){if(Ye(s),d+=1,j!==void 0&&(b=N,k=j),I.nestedBlock){let q=St(e,s,M);return q===void 0?(We(),s=i-1,$=!0,!0):((pe=e[q])!=null&&pe.trim()&&(B=q),s=q-1,$=!0,!0)}return O=w.ignore[ge].tails,!0}return!1}),$)continue}let ke=!1;!O&&B!==void 0&&B===s&&(d+=1,j!==void 0&&(b=N,k=j),B=void 0,ke=!0);let Oe=!O&&(e[s]===re||e[s]==="&"||e[s]==="\\")?se(e,s):void 0,D=Oe!==void 0&&!M(s,Oe)?Oe:void 0;if(!O&&((nt=e[s])!=null&&nt.trim())&&D===void 0&&Ye(s),D!==void 0){h=void 0,T=void 0,W=[],N=s,j=D;let $=Ke(s,D);ue.add($);let I=w.convertEntities?w.targetLanguage==="css"?"".concat(He).concat(ze(e[D])?" ":""):w.targetLanguage==="js"?Le:X:re;e.slice(s,D)!==I&&(o.set($,[s,D,I]),le.set($,"convertEntities")),e[D]&&!"\r\n".includes(e[D])&&!e[D].trim()&&(J=D),D-s>1&&((rt=e[D])!=null&&rt.trim())&&se(e,D)===void 0&&(B=D),s=D-1;continue}!O&&((ot=e[s])!=null&&ot.trim())&&(g+=1);let Ee=!O&&(e[s]==="-"||e[s]===Pe||e[s]===je||e[s]==="&"||e[s]==="\\")?Rn(e,s):void 0,P=Ee!==void 0&&!M(s,Ee)?Ee:void 0;if(P!==void 0){let $=$e(e,s);!ke&&(F||!((it=e[s-1])!=null&&it.trim()))&&(d+=1,j!==void 0&&(b=N,k=j));let I=N!==void 0&&j===s&&se(e,N)===s,ge=I&&N!==void 0?N:$===null?s:$+1,pe=$!==null&&$>=f&&!e.slice($+1,s).split("").some(pt=>pt==="\r"||pt==="\n"),q=P<i&&pe&&!((st=e[P])!=null&&st.trim())&&(I||!!e[s-1]&&!e[s-1].trim()&&$!==null)&&!M(ge,s);q&&(U.removeWidows=!0),w.hyphens&&q&&fe(ge,s),e[s]==="\\"&&ze(e[P-1])&&(e[P]&&!"\r\n".includes(e[P])&&!e[P].trim()?J=P:(at=e[P])!=null&&at.trim()&&(te=P)),s=P-1;continue}!O&&!ke&&((lt=e[s])!=null&<.trim())&&(F||!K&&!((ut=e[s-1])!=null&&ut.trim()))&&(d+=1,j!==void 0&&(b=N,k=j)),!O&&(!e[s]||"\r\n".includes(e[s])||(e[s]==="\n"||e[s]==="\r"||e[s]==="\r"&&e[s+1]==="\n")&&$e(e,s)&&l.includes(e[$e(e,s)]))&&(Ze(),f=s+1);let de=e.charCodeAt(s-1),ce=!O&&e[s]&&!e[s].trim()&&!"\r\n".includes(e[s])&&((_t=e[s-1])!=null&&_t.trim())&&(de>=48&&de<=57||de>=65&&de<=90)?Pn(e,s):void 0;ce!==void 0&&!M(ce.tokenStart,ce.tokenEnd)&&(U.removeWidows=!0,w.UKPostcodes&&fe(s,ce.whitespaceEnd)),!O&&e[s]&&!e[s].trim()&&!"\r\n".includes(e[s])&&h!==void 0&&T!==void 0&&(W.push([h,T]),h=s,T=void 0);let gt=!O&&e[s]&&!"\r\n".includes(e[s])&&!e[s].trim()&&(ct||((ft=e[s-1])==null?void 0:ft.trim()))&&h===void 0,Zt=gt?Pt(e,s):null;gt&&Zt!==null&&(h=s,T=void 0);let G;if(O&&(typeof O=="string"&&_e(O,s)?G=O:Array.isArray(O)&&O.some($=>_e($,s)?(G=$,!0):!1),G!==void 0)){let $=s+G.length;if(G.startsWith("{% end")||G.startsWith("{%- end")){for(;$<i&&!e[$].trim();)$+=1;e.startsWith("-%}",$)?$+=3:e.startsWith("%}",$)&&($+=2)}if(!M(s,$)){O=void 0;let I=se(e,$);(dt=e[$])!=null&&dt.trim()&&(I===void 0||M($,I))&&(B=$),s=$-1}}e[s]&&"\r\n".includes(e[s])&&(d=0,g=0)}let Xe=new xt({mergeType:2});for(let s of o.values())Xe.push(s);let et=Xe.current(),Qt=Et(e,et,w.reportProgressFunc?s=>{a=Te+Math.floor(s/100*(w.reportProgressFuncTo-Te)),Ce(a)}:void 0);for(let s of le.values())Je[s]=!0;return U.convertEntities=U.removeWidows&&!w.removeWidowPreventionMeasures||ue.size>0,{res:Qt,ranges:et,log:{timeTakenInMilliseconds:Date.now()-n},whatWasDone:Je,applicableOpts:U}}function Bt(e){return e!==void 0&&/[0-9a-f]/i.test(e)}function ze(e){return e!==void 0&&" \n\f\r ".includes(e)}function Ue(e,t,n,r){if(e[t]!=="\\"||!Bt(e[t+1]))return;let i=t+1;for(;i<e.length&&i-t<=6&&Bt(e[i]);)i+=1;if(Number.parseInt(e.slice(t+1,i),16)===n)return r&&ze(e[i])?e[i]==="\r"&&e[i+1]==="\n"?i+2:i+1:i}function se(e,t){var r,i;let n=e[t];if(n===re)return t+1;if(n==="&"&&(e.startsWith(X,t)||e.startsWith(" ",t)))return t+6;if(n==="\\")return((r=e[t+1])==null?void 0:r.toLowerCase())==="u"&&e[t+2]==="0"&&e[t+3]==="0"&&((i=e[t+4])==null?void 0:i.toLowerCase())==="a"&&e[t+5]==="0"?t+6:Ue(e,t,160,!0)}function Rn(e,t){var r;let n=e[t];if(n==="-"||n===Pe||n===je)return t+1;if(n==="&"||n==="\\"){for(let i of Wn)if(e.startsWith(i,t))return t+i.length;if(n==="\\")return(r=Ue(e,t,8211,!0))!=null?r:Ue(e,t,8212,!0)}}function Vt(e){if(e===void 0)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t===95||t>=97&&t<=122}var Ve=[1632,1641,1776,1785,1984,1993,2406,2415,2534,2543,2662,2671,2790,2799,2918,2927,3046,3055,3174,3183,3302,3311,3430,3439,3558,3567,3664,3673,3792,3801,3872,3881,4160,4169,4240,4249,6112,6121,6160,6169,6470,6479,6608,6617,6784,6793,6800,6809,6992,7001,7088,7097,7232,7241,7248,7257,42528,42537,43216,43225,43264,43273,43472,43481,43504,43513,43600,43609,44016,44025,65296,65305,66720,66729,68912,68921,68928,68937,69734,69743,69872,69881,69942,69951,70096,70105,70384,70393,70736,70745,70864,70873,71248,71257,71360,71369,71376,71395,71472,71481,71904,71913,72016,72025,72688,72697,72784,72793,73040,73049,73120,73129,73184,73193,73552,73561,90416,90425,92768,92777,92864,92873,93008,93017,93552,93561,118e3,118009,120782,120831,123200,123209,123632,123641,124144,124153,124401,124410,125264,125273,130032,130041];function Dn(e,t){let n=e.codePointAt(t);return n===void 0?void 0:String.fromCodePoint(n)}function xn(e,t){if(t<=0)return;let n=e.charCodeAt(t-1);return n>=56320&&n<=57343&&t>1?e.slice(t-2,t):e[t-1]}function jn(e){if(e===void 0)return!1;let t=e.codePointAt(0),n=0,r=Ve.length/2-1;for(;n<=r;){let i=n+r>>1,o=Ve[i*2],l=Ve[i*2+1];if(t<o)r=i-1;else if(t>l)n=i+1;else return!0}return!1}function zt(e){return e!==void 0&&(e==="_"||kt(e)||jn(e))}function Pn(e,t){var u;if(!e[t]||"\r\n".includes(e[t])||e[t].trim()||!((u=e[t-1])!=null&&u.trim()))return;let n=e.charCodeAt(t-1);if(!(n>=48&&n<=57||n>=65&&n<=90))return;let r=t;for(;e[r]&&!e[r].trim()&&!"\r\n".includes(e[r]);)r+=1;if(!e[r])return;let i=e.charCodeAt(r);if(i<48||i>57)return;let o=t-1;for(;o>=0&&Vt(e[o]);)o-=1;o+=1;let l=r;for(;l<e.length&&Vt(e[l]);)l+=1;if(!(zt(xn(e,o))||zt(Dn(e,l))))return/^[A-Z]{1,2}[0-9][0-9A-Z]?$/.test(e.slice(o,t))&&/^[0-9][A-Z]{2}$/.test(e.slice(r,l))?{whitespaceEnd:r,tokenStart:o,tokenEnd:l}:void 0}var In=["removeWidowPreventionMeasures","convertEntities","targetLanguage","UKPostcodes","hyphens","minWordCount","minCharCount","ignore","reportProgressFunc","reportProgressFuncFrom","reportProgressFuncTo","tagRanges"];function ae(e){return{nestedBlock:e===ie[1]||e===ie[2],heads:typeof e.heads=="string"?e.heads:[...e.heads],tails:typeof e.tails=="string"?e.tails:[...e.tails]}}function z(e,t){return Object.getOwnPropertyDescriptor(e,t)!==void 0}function Gt(e,t){var n;return((n=Object.getOwnPropertyDescriptor(e,t))==null?void 0:n.enumerable)===!0}function Sn(e){for(let t in e)if(!z(e,t))return t}function Ut(e){if(typeof e=="string")return e.length>0?e:void 0;if(!Array.isArray(e)||e.length===0)return;let t=[];for(let n=0;n<e.length;n+=1){if(!z(e,n))return;let r=e[n];if(typeof r!="string"||r.length===0)return;t.push(r)}return t}function qt(e,t){let n=t.trim().toLowerCase();if(!["all","hexo","hugo","jinja","liquid","nunjucks"].includes(n))return'option "ignore" contains an unsupported preset '.concat(JSON.stringify(t),".");n==="all"?e.push(...ie.map(ae),...Be.map(ae)):["nunjucks","jinja","liquid"].includes(n)?e.push(...ie.map(ae)):n==="hugo"?e.push(...Lt.map(ae)):e.push(...Be.map(ae))}function Nn(e){let t=[];if(typeof e=="string"){let n=qt(t,e);return n?{ok:!1,kind:"preset",detail:n}:{ok:!0,value:t}}if(!Array.isArray(e))return{ok:!1,kind:"shape",detail:'option "ignore" must be a supported preset or an array of presets and { heads, tails } marker objects, but it was '.concat(p(e,4),".")};for(let n=0;n<e.length;n+=1){if(!z(e,n))return{ok:!1,kind:"shape",detail:'option "ignore" cannot contain sparse entries.'};let r=e[n];if(typeof r=="string"){let a=qt(t,r);if(a)return{ok:!1,kind:"preset",detail:a};continue}if(!S(r)||Sn(r)!==void 0||Object.getOwnPropertySymbols(r).some(a=>Gt(r,a)))return{ok:!1,kind:"shape",detail:'option "ignore" contains a malformed marker object.'};let i=Object.keys(r);if(i.length!==2||!i.includes("heads")||!i.includes("tails"))return{ok:!1,kind:"shape",detail:'every custom ignore marker must contain only own "heads" and "tails" keys.'};let o=r,l=Ut(o.heads),u=Ut(o.tails);if(l===void 0||u===void 0)return{ok:!1,kind:"shape",detail:"custom ignore marker heads and tails must be non-empty strings or dense arrays of non-empty strings."};t.push({heads:l,tails:u})}return{ok:!0,value:t}}function Mn(e,t){if(e===null)return{ok:!0,value:[]};if(!Array.isArray(e))return{ok:!1,kind:"container",detail:'option "tagRanges" must be null or an array of half-open ranges, but it was '.concat(p(e,4),".")};let n=[];for(let i=0;i<e.length;i+=1){if(!z(e,i))return{ok:!1,kind:"range",detail:'option "tagRanges" cannot contain sparse entries.'};let o=e[i];if(!Array.isArray(o)||o.length!==2&&o.length!==3||!z(o,0)||!z(o,1)||o.length===3&&!z(o,2))return{ok:!1,kind:"range",detail:'every "tagRanges" member must be a dense two- or three-item range.'};let l=o[0],u=o[1],a=o.length===3?o[2]:void 0;if(!Number.isInteger(l)||!Number.isInteger(u)||l<0||l>=u||o.length===3&&a!==null&&a!==void 0&&typeof a!="string")return{ok:!1,kind:"range",detail:'every "tagRanges" member must be a non-negative half-open range with integer from/to values and from below to.'};l<t&&n.push([l,Math.min(u,t)])}n.sort((i,o)=>i[0]===o[0]?i[1]-o[1]:i[0]-o[0]);let r=[];for(let i of n){let o=r[r.length-1];o&&i[0]<=o[1]?o[1]=Math.max(o[1],i[1]):r.push(i)}return{ok:!0,value:r}}function Fn(e,t){var y,c,m,A,h,T,W,R;if(t===void 0)return x;let n=t!=null?t:{},r=Object.keys(n),i;for(let b in n)if(!z(n,b)){i=b;break}let o=r.find(b=>!In.includes(b)),l=Object.getOwnPropertySymbols(n).find(b=>Gt(n,b));if(o!==void 0||i!==void 0||l!==void 0){let b=(y=o!=null?o:i)!=null?y:String(l);throw new TypeError("string-remove-widows/removeWidows(): [THROW_ID_04] every option must be an own, known string key; received ".concat(JSON.stringify(b),"."))}let u=Object.create(null);for(let b of r)u[b]=n[b];for(let b of["removeWidowPreventionMeasures","convertEntities","UKPostcodes","hyphens"])if(b in u&&typeof u[b]!="boolean")throw new TypeError("string-remove-widows/removeWidows(): [THROW_ID_05] option ".concat(JSON.stringify(b)," must be Boolean, but it was ").concat(p(u[b],4),"."));if("targetLanguage"in u&&!["html","css","js"].includes(u.targetLanguage))throw new TypeError('string-remove-widows/removeWidows(): [THROW_ID_06] option "targetLanguage" must be exactly "html", "css", or "js", but it was '.concat(p(u.targetLanguage,4),"."));for(let b of["minWordCount","minCharCount"]){let k=u[b];if(b in u&&k!==!1&&k!==null&&(typeof k!="number"||!Number.isFinite(k)||k<0))throw new TypeError("string-remove-widows/removeWidows(): [THROW_ID_07] option ".concat(JSON.stringify(b)," must be a finite non-negative number, false, or null, but it was ").concat(p(k,4),"."))}let a=Nn("ignore"in u?u.ignore:x.ignore);if(!a.ok)throw a.kind==="shape"?new TypeError("string-remove-widows/removeWidows(): [THROW_ID_08] ".concat(a.detail)):new TypeError("string-remove-widows/removeWidows(): [THROW_ID_09] ".concat(a.detail));let _="reportProgressFunc"in u?u.reportProgressFunc:x.reportProgressFunc;if(_!==!1&&_!==null&&typeof _!="function")throw new TypeError('string-remove-widows/removeWidows(): [THROW_ID_10] option "reportProgressFunc" must be a function, false, or null, but it was '.concat(p(_,4),"."));for(let b of["reportProgressFuncFrom","reportProgressFuncTo"]){let k=b in u?u[b]:x[b];if(typeof k!="number"||!Number.isInteger(k)||k<0||k>100)throw new TypeError("string-remove-widows/removeWidows(): [THROW_ID_11] option ".concat(JSON.stringify(b)," must be an integer from 0 through 100, but it was ").concat(p(k,4),"."))}let f=(c=u.reportProgressFuncFrom)!=null?c:x.reportProgressFuncFrom,d=(m=u.reportProgressFuncTo)!=null?m:x.reportProgressFuncTo;if(f>d)throw new RangeError('string-remove-widows/removeWidows(): [THROW_ID_12] option "reportProgressFuncFrom" ('.concat(f,') must not exceed "reportProgressFuncTo" (').concat(d,")."));let g=Mn("tagRanges"in u?u.tagRanges:[],e.length);if(!g.ok)throw g.kind==="container"?new TypeError("string-remove-widows/removeWidows(): [THROW_ID_13] ".concat(g.detail)):new TypeError("string-remove-widows/removeWidows(): [THROW_ID_14] ".concat(g.detail));return{removeWidowPreventionMeasures:(A=u.removeWidowPreventionMeasures)!=null?A:x.removeWidowPreventionMeasures,convertEntities:(h=u.convertEntities)!=null?h:x.convertEntities,targetLanguage:(T=u.targetLanguage)!=null?T:x.targetLanguage,UKPostcodes:(W=u.UKPostcodes)!=null?W:x.UKPostcodes,hyphens:(R=u.hyphens)!=null?R:x.hyphens,minWordCount:"minWordCount"in u?u.minWordCount:x.minWordCount,minCharCount:"minCharCount"in u?u.minCharCount:x.minCharCount,ignore:a.value,reportProgressFunc:typeof _=="function"?_:null,reportProgressFuncFrom:f,reportProgressFuncTo:d,tagRanges:g.value}}return sn(Hn);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name codsen-format-diagnostic-value
|
|
13
13
|
* @fileoverview Safely format untrusted JavaScript values for diagnostics
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
/**
|
|
20
20
|
* @name codsen-utils
|
|
21
21
|
* @fileoverview Various utility functions
|
|
22
|
-
* @version 1.10.
|
|
22
|
+
* @version 1.10.3
|
|
23
23
|
* @author Roy Revelt
|
|
24
24
|
* @license MIT
|
|
25
25
|
* {@link https://codsen.com/os/codsen-utils/}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
/**
|
|
28
28
|
* @name ranges-sort
|
|
29
29
|
* @fileoverview Sort string index ranges
|
|
30
|
-
* @version 6.2.
|
|
30
|
+
* @version 6.2.5
|
|
31
31
|
* @author Roy Revelt
|
|
32
32
|
* @license MIT
|
|
33
33
|
* {@link https://codsen.com/os/ranges-sort/}
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
/**
|
|
36
36
|
* @name ranges-merge
|
|
37
37
|
* @fileoverview Merge and sort string index ranges
|
|
38
|
-
* @version 9.2.
|
|
38
|
+
* @version 9.2.6
|
|
39
39
|
* @author Roy Revelt
|
|
40
40
|
* @license MIT
|
|
41
41
|
* {@link https://codsen.com/os/ranges-merge/}
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
/**
|
|
44
44
|
* @name ranges-apply
|
|
45
45
|
* @fileoverview Take an array of string index ranges, delete/replace the string according to them
|
|
46
|
-
* @version 7.2.
|
|
46
|
+
* @version 7.2.6
|
|
47
47
|
* @author Roy Revelt
|
|
48
48
|
* @license MIT
|
|
49
49
|
* {@link https://codsen.com/os/ranges-apply/}
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
/**
|
|
60
60
|
* @name ranges-push
|
|
61
61
|
* @fileoverview Gather string index ranges
|
|
62
|
-
* @version 7.3.
|
|
62
|
+
* @version 7.3.3
|
|
63
63
|
* @author Roy Revelt
|
|
64
64
|
* @license MIT
|
|
65
65
|
* {@link https://codsen.com/os/ranges-push/}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
/**
|
|
68
68
|
* @name string-left-right
|
|
69
69
|
* @fileoverview Looks up the first non-whitespace character to the left/right of a given index
|
|
70
|
-
* @version 6.2.
|
|
70
|
+
* @version 6.2.5
|
|
71
71
|
* @author Roy Revelt
|
|
72
72
|
* @license MIT
|
|
73
73
|
* {@link https://codsen.com/os/string-left-right/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "string-remove-widows",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.8",
|
|
4
4
|
"description": "Helps to prevent widow words in a text",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"against",
|
|
@@ -71,13 +71,13 @@
|
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"codsen-utils": "^1.10.
|
|
75
|
-
"ranges-apply": "^7.2.
|
|
76
|
-
"ranges-push": "^7.3.
|
|
77
|
-
"string-left-right": "^6.2.
|
|
74
|
+
"codsen-utils": "^1.10.3",
|
|
75
|
+
"ranges-apply": "^7.2.6",
|
|
76
|
+
"ranges-push": "^7.3.3",
|
|
77
|
+
"string-left-right": "^6.2.5"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"string-strip-html": "^13.7.
|
|
80
|
+
"string-strip-html": "^13.7.5"
|
|
81
81
|
},
|
|
82
82
|
"engines": {
|
|
83
83
|
"node": ">=18.20.8"
|