import{__exports as e}from"../../../_virtual/utils3.mjs";var r;function t(){return r||(r=1,(t=e).isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),t.find=(e,r)=>e.nodes.find(e=>e.type===r),t.exceedsLimit=(e,r,s=1,n)=>!1!==n&&!(!t.isInteger(e)||!t.isInteger(r))&&(Number(r)-Number(e))/Number(s)>=n,t.escapeNode=(e,r=0,t)=>{const s=e.nodes[r];s&&(t&&s.type===t||"open"===s.type||"close"===s.type)&&!0!==s.escaped&&(s.value="\\"+s.value,s.escaped=!0)},t.encloseBrace=e=>!("brace"!==e.type||e.commas>>0+e.ranges|0||(e.invalid=!0,0)),t.isInvalidBrace=e=>!("brace"!==e.type||!0!==e.invalid&&!e.dollar&&(e.commas>>0+e.ranges|0&&!0===e.open&&!0===e.close||(e.invalid=!0,0))),t.isOpenOrClose=e=>"open"===e.type||"close"===e.type||!0===e.open||!0===e.close,t.reduce=e=>e.reduce((e,r)=>("text"===r.type&&e.push(r.value),"range"===r.type&&(r.type="text"),e),[]),t.flatten=(...e)=>{const r=[],t=e=>{for(let s=0;s<e.length;s++){const n=e[s];Array.isArray(n)?t(n):void 0!==n&&r.push(n)}return r};return t(e),r}),e;var t}export{t as __require};