import r from"../../_virtual/_node_util.mjs";import{__require as t}from"../to-regex-range/index.mjs";
/*!
 * fill-range <https://github.com/jonschlinkert/fill-range>
 *
 * Copyright (c) 2014-present, Jon Schlinkert.
 * Licensed under the MIT License.
 */var e,n;function i(){if(n)return e;n=1;const i=r,a=t(),o=r=>null!==r&&"object"==typeof r&&!Array.isArray(r),s=r=>"number"==typeof r||"string"==typeof r&&""!==r,u=r=>Number.isInteger(+r),g=r=>{let t=`${r}`,e=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++e];);return e>0},f=(r,t,e)=>{if(t>0){let e="-"===r[0]?"-":"";e&&(r=r.slice(1)),r=e+r.padStart(e?t-1:t,"0")}return!1===e?String(r):r},l=(r,t)=>{let e="-"===r[0]?"-":"";for(e&&(r=r.slice(1),t--);r.length<t;)r="0"+r;return e?"-"+r:r},p=(r,t,e,n)=>{if(e)return a(r,t,{wrap:!1,...n});let i=String.fromCharCode(r);return r===t?i:`[${i}-${String.fromCharCode(t)}]`},m=(r,t,e)=>{if(Array.isArray(r)){let t=!0===e.wrap,n=e.capture?"":"?:";return t?`(${n}${r.join("|")})`:r.join("|")}return a(r,t,e)},h=(...r)=>new RangeError("Invalid range arguments: "+i.inspect(...r)),c=(r,t,e)=>{if(!0===e.strictRanges)throw h([r,t]);return[]},$=(r,t,e=1,n={})=>{let i=Number(r),a=Number(t);if(!Number.isInteger(i)||!Number.isInteger(a)){if(!0===n.strictRanges)throw h([r,t]);return[]}0===i&&(i=0),0===a&&(a=0);let o=i>a,s=String(r),u=String(t),c=String(e);e=Math.max(Math.abs(e),1);let $=g(s)||g(u)||g(c),b=$?Math.max(s.length,u.length,c.length):0,v=!1===$&&!1===((r,t,e)=>"string"==typeof r||"string"==typeof t||!0===e.stringify)(r,t,n),x=n.transform||(r=>t=>!0===r?Number(t):String(t))(v);if(n.toRegex&&1===e)return p(l(r,b),l(t,b),!0,n);let y={negatives:[],positives:[]},w=r=>y[r<0?"negatives":"positives"].push(Math.abs(r)),S=[],d=0;for(;o?i>=a:i<=a;)!0===n.toRegex&&e>1?w(i):S.push(f(x(i,d),b,v)),i=o?i-e:i+e,d++;return!0===n.toRegex?e>1?((r,t,e)=>{r.negatives.sort((r,t)=>r<t?-1:r>t?1:0),r.positives.sort((r,t)=>r<t?-1:r>t?1:0);let n,i=t.capture?"":"?:",a="",o="";return r.positives.length&&(a=r.positives.map(r=>l(String(r),e)).join("|")),r.negatives.length&&(o=`-(${i}${r.negatives.map(r=>l(String(r),e)).join("|")})`),n=a&&o?`${a}|${o}`:a||o,t.wrap?`(${i}${n})`:n})(y,n,b):m(S,null,{wrap:!1,...n}):S},b=(r,t,e,n={})=>{if(null==t&&s(r))return[r];if(!s(r)||!s(t))return c(r,t,n);if("function"==typeof e)return b(r,t,1,{transform:e});if(o(e))return b(r,t,0,e);let i={...n};return!0===i.capture&&(i.wrap=!0),e=e||i.step||1,u(e)?u(r)&&u(t)?$(r,t,e,i):((r,t,e=1,n={})=>{if(!u(r)&&r.length>1||!u(t)&&t.length>1)return c(r,t,n);let i=n.transform||(r=>String.fromCharCode(r)),a=`${r}`.charCodeAt(0),o=`${t}`.charCodeAt(0),s=a>o,g=Math.min(a,o),f=Math.max(a,o);if(n.toRegex&&1===e)return p(g,f,!1,n);let l=[],h=0;for(;s?a>=o:a<=o;)l.push(i(a,h)),a=s?a-e:a+e,h++;return!0===n.toRegex?m(l,null,{wrap:!1,options:n}):l})(r,t,Math.max(Math.abs(e),1),i):null==e||o(e)?b(r,t,1,e):((r,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${r}" to be a number`);return[]})(e,i)};return e=b}export{i as __require};