@onoxm/vite-plugin-auto-router 0.1.0 → 0.1.2

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 +1 @@
1
- "use strict";var t,e=require("node:fs"),n=require("node:path"),r=require("os"),o=require("path"),s=require("util"),i=require("stream"),a=require("events"),u=require("fs"),c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l={},p={},f={};function h(){if(t)return f;return t=1,Object.defineProperty(f,"__esModule",{value:!0}),f.splitWhen=f.flatten=void 0,f.flatten=function(t){return t.reduce((t,e)=>[].concat(t,e),[])},f.splitWhen=function(t,e){const n=[[]];let r=0;for(const o of t)e(o)?(r++,n[r]=[]):n[r].push(o);return n},f}var d,g={};function _(){if(d)return g;return d=1,Object.defineProperty(g,"__esModule",{value:!0}),g.isEnoentCodeError=void 0,g.isEnoentCodeError=function(t){return"ENOENT"===t.code},g}var y,m={};var R,S={};function b(){if(R)return S;R=1,Object.defineProperty(S,"__esModule",{value:!0}),S.convertPosixPathToPattern=S.convertWindowsPathToPattern=S.convertPathToPattern=S.escapePosixPath=S.escapeWindowsPath=S.escape=S.removeLeadingDotSegment=S.makeAbsolute=S.unixify=void 0;const t=o,e="win32"===r.platform(),n=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,s=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,i=/^\\\\([.?])/,a=/\\(?![!()+@[\]{}])/g;function u(t){return t.replace(s,"\\$2")}function c(t){return t.replace(n,"\\$2")}function l(t){return u(t).replace(i,"//$1").replace(a,"/")}function p(t){return c(t)}return S.unixify=function(t){return t.replace(/\\/g,"/")},S.makeAbsolute=function(e,n){return t.resolve(e,n)},S.removeLeadingDotSegment=function(t){if("."===t.charAt(0)){const e=t.charAt(1);if("/"===e||"\\"===e)return t.slice(2)}return t},S.escape=e?u:c,S.escapeWindowsPath=u,S.escapePosixPath=c,S.convertPathToPattern=e?l:p,S.convertWindowsPathToPattern=l,S.convertPosixPathToPattern=p,S}var v,E,P,A,C,x,O={};function T(){return E?v:(E=1,v=function(t){if("string"!=typeof t||""===t)return!1;for(var e;e=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(e[2])return!0;t=t.slice(e.index+e[0].length)}return!1})}function w(){if(A)return P;A=1;var t=T(),e={"{":"}","(":")","[":"]"},n=function(t){if("!"===t[0])return!0;for(var n=0,r=-2,o=-2,s=-2,i=-2,a=-2;n<t.length;){if("*"===t[n])return!0;if("?"===t[n+1]&&/[\].+)]/.test(t[n]))return!0;if(-1!==o&&"["===t[n]&&"]"!==t[n+1]&&(o<n&&(o=t.indexOf("]",n)),o>n)){if(-1===a||a>o)return!0;if(-1===(a=t.indexOf("\\",n))||a>o)return!0}if(-1!==s&&"{"===t[n]&&"}"!==t[n+1]&&(s=t.indexOf("}",n))>n&&(-1===(a=t.indexOf("\\",n))||a>s))return!0;if(-1!==i&&"("===t[n]&&"?"===t[n+1]&&/[:!=]/.test(t[n+2])&&")"!==t[n+3]&&(i=t.indexOf(")",n))>n&&(-1===(a=t.indexOf("\\",n))||a>i))return!0;if(-1!==r&&"("===t[n]&&"|"!==t[n+1]&&(r<n&&(r=t.indexOf("|",n)),-1!==r&&")"!==t[r+1]&&(i=t.indexOf(")",r))>r&&(-1===(a=t.indexOf("\\",r))||a>i)))return!0;if("\\"===t[n]){var u=t[n+1];n+=2;var c=e[u];if(c){var l=t.indexOf(c,n);-1!==l&&(n=l+1)}if("!"===t[n])return!0}else n++}return!1},r=function(t){if("!"===t[0])return!0;for(var n=0;n<t.length;){if(/[*?{}()[\]]/.test(t[n]))return!0;if("\\"===t[n]){var r=t[n+1];n+=2;var o=e[r];if(o){var s=t.indexOf(o,n);-1!==s&&(n=s+1)}if("!"===t[n])return!0}else n++}return!1};return P=function(e,o){if("string"!=typeof e||""===e)return!1;if(t(e))return!0;var s=n;return o&&!1===o.strict&&(s=r),s(e)}}function k(){if(x)return C;x=1;var t=w(),e=o.posix.dirname,n="win32"===r.platform(),s=/\\/g,i=/[\{\[].*[\}\]]$/,a=/(^|[^\\])([\{\[]|\([^\)]+$)/,u=/\\([\!\*\?\|\[\]\(\)\{\}])/g;return C=function(r,o){Object.assign({flipBackslashes:!0},o).flipBackslashes&&n&&r.indexOf("/")<0&&(r=r.replace(s,"/")),i.test(r)&&(r+="/"),r+="a";do{r=e(r)}while(t(r)||a.test(r));return r.replace(u,"$1")}}var $,L,M,H,D,F,j,N,I,B,W,G,U,K,V,q,Q,X,Y,z={};function Z(){return $||($=1,(t=z).isInteger=t=>"number"==typeof t?Number.isInteger(t):"string"==typeof t&&""!==t.trim()&&Number.isInteger(Number(t)),t.find=(t,e)=>t.nodes.find(t=>t.type===e),t.exceedsLimit=(e,n,r=1,o)=>!1!==o&&!(!t.isInteger(e)||!t.isInteger(n))&&(Number(n)-Number(e))/Number(r)>=o,t.escapeNode=(t,e=0,n)=>{const r=t.nodes[e];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},t.encloseBrace=t=>!("brace"!==t.type||t.commas>>0+t.ranges|0||(t.invalid=!0,0)),t.isInvalidBrace=t=>!("brace"!==t.type||!0!==t.invalid&&!t.dollar&&(t.commas>>0+t.ranges|0&&!0===t.open&&!0===t.close||(t.invalid=!0,0))),t.isOpenOrClose=t=>"open"===t.type||"close"===t.type||!0===t.open||!0===t.close,t.reduce=t=>t.reduce((t,e)=>("text"===e.type&&t.push(e.value),"range"===e.type&&(e.type="text"),t),[]),t.flatten=(...t)=>{const e=[],n=t=>{for(let r=0;r<t.length;r++){const o=t[r];Array.isArray(o)?n(o):void 0!==o&&e.push(o)}return e};return n(t),e}),z;var t}function J(){if(M)return L;M=1;const t=Z();return L=(e,n={})=>{const r=(e,o={})=>{const s=n.escapeInvalid&&t.isInvalidBrace(o),i=!0===e.invalid&&!0===n.escapeInvalid;let a="";if(e.value)return(s||i)&&t.isOpenOrClose(e)?"\\"+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(const t of e.nodes)a+=r(t);return a};return r(e)}}function tt(){return D?H:(D=1,H=function(t){return"number"==typeof t?t-t===0:"string"==typeof t&&""!==t.trim()&&(Number.isFinite?Number.isFinite(+t):isFinite(+t))})}function et(){if(j)return F;j=1;const t=tt(),e=(n,s,i)=>{if(!1===t(n))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===s||n===s)return String(n);if(!1===t(s))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:!0,...i};"boolean"==typeof a.strictZeros&&(a.relaxZeros=!1===a.strictZeros);let u=n+":"+s+"="+String(a.relaxZeros)+String(a.shorthand)+String(a.capture)+String(a.wrap);if(e.cache.hasOwnProperty(u))return e.cache[u].result;let c=Math.min(n,s),l=Math.max(n,s);if(1===Math.abs(c-l)){let t=n+"|"+s;return a.capture?`(${t})`:!1===a.wrap?t:`(?:${t})`}let f=p(n)||p(s),h={min:n,max:s,a:c,b:l},d=[],g=[];if(f&&(h.isPadded=f,h.maxLen=String(h.max).length),c<0){g=r(l<0?Math.abs(l):1,Math.abs(c),h,a),c=h.a=0}return l>=0&&(d=r(c,l,h,a)),h.negatives=g,h.positives=d,h.result=function(t,e){let n=o(t,e,"-",!1)||[],r=o(e,t,"",!1)||[],s=o(t,e,"-?",!0)||[];return n.concat(s).concat(r).join("|")}(g,d),!0===a.capture?h.result=`(${h.result})`:!1!==a.wrap&&d.length+g.length>1&&(h.result=`(?:${h.result})`),e.cache[u]=h,h.result};function n(t,e,n){if(t===e)return{pattern:t,count:[],digits:0};let r=function(t,e){let n=[];for(let r=0;r<t.length;r++)n.push([t[r],e[r]]);return n}(t,e),o=r.length,s="",i=0;for(let t=0;t<o;t++){let[e,n]=r[t];e===n?s+=e:"0"!==e||"9"!==n?s+=l(e,n):i++}return i&&(s+=!0===n.shorthand?"\\d":"[0-9]"),{pattern:s,count:[i],digits:o}}function r(t,e,r,o){let i,l=function(t,e){let n=1,r=1,o=a(t,n),i=new Set([e]);for(;t<=o&&o<=e;)i.add(o),n+=1,o=a(t,n);for(o=u(e+1,r)-1;t<o&&o<=e;)i.add(o),r+=1,o=u(e+1,r)-1;return i=[...i],i.sort(s),i}(t,e),p=[],h=t;for(let t=0;t<l.length;t++){let e=l[t],s=n(String(h),String(e),o),a="";r.isPadded||!i||i.pattern!==s.pattern?(r.isPadded&&(a=f(e,r,o)),s.string=a+s.pattern+c(s.count),p.push(s),h=e+1,i=s):(i.count.length>1&&i.count.pop(),i.count.push(s.count[0]),i.string=i.pattern+c(i.count),h=e+1)}return p}function o(t,e,n,r,o){let s=[];for(let o of t){let{string:t}=o;r||i(e,"string",t)||s.push(n+t),r&&i(e,"string",t)&&s.push(n+t)}return s}function s(t,e){return t>e?1:e>t?-1:0}function i(t,e,n){return t.some(t=>t[e]===n)}function a(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function u(t,e){return t-t%Math.pow(10,e)}function c(t){let[e=0,n=""]=t;return n||e>1?`{${e+(n?","+n:"")}}`:""}function l(t,e,n){return`[${t}${e-t===1?"":"-"}${e}]`}function p(t){return/^-?(0+)\d/.test(t)}function f(t,e,n){if(!e.isPadded)return t;let r=Math.abs(e.maxLen-String(t).length),o=!1!==n.relaxZeros;switch(r){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:return o?`0{0,${r}}`:`0{${r}}`}}return e.cache={},e.clearCache=()=>e.cache={},F=e}function nt(){if(I)return N;I=1;const t=s,e=et(),n=t=>null!==t&&"object"==typeof t&&!Array.isArray(t),r=t=>"number"==typeof t||"string"==typeof t&&""!==t,o=t=>Number.isInteger(+t),i=t=>{let e=`${t}`,n=-1;if("-"===e[0]&&(e=e.slice(1)),"0"===e)return!1;for(;"0"===e[++n];);return n>0},a=(t,e,n)=>{if(e>0){let n="-"===t[0]?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0")}return!1===n?String(t):t},u=(t,e)=>{let n="-"===t[0]?"-":"";for(n&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return n?"-"+t:t},c=(t,n,r,o)=>{if(r)return e(t,n,{wrap:!1,...o});let s=String.fromCharCode(t);return t===n?s:`[${s}-${String.fromCharCode(n)}]`},l=(t,n,r)=>{if(Array.isArray(t)){let e=!0===r.wrap,n=r.capture?"":"?:";return e?`(${n}${t.join("|")})`:t.join("|")}return e(t,n,r)},p=(...e)=>new RangeError("Invalid range arguments: "+t.inspect(...e)),f=(t,e,n)=>{if(!0===n.strictRanges)throw p([t,e]);return[]},h=(t,e,n=1,r={})=>{let o=Number(t),s=Number(e);if(!Number.isInteger(o)||!Number.isInteger(s)){if(!0===r.strictRanges)throw p([t,e]);return[]}0===o&&(o=0),0===s&&(s=0);let f=o>s,h=String(t),d=String(e),g=String(n);n=Math.max(Math.abs(n),1);let _=i(h)||i(d)||i(g),y=_?Math.max(h.length,d.length,g.length):0,m=!1===_&&!1===((t,e,n)=>"string"==typeof t||"string"==typeof e||!0===n.stringify)(t,e,r),R=r.transform||(t=>e=>!0===t?Number(e):String(e))(m);if(r.toRegex&&1===n)return c(u(t,y),u(e,y),!0,r);let S={negatives:[],positives:[]},b=t=>S[t<0?"negatives":"positives"].push(Math.abs(t)),v=[],E=0;for(;f?o>=s:o<=s;)!0===r.toRegex&&n>1?b(o):v.push(a(R(o,E),y,m)),o=f?o-n:o+n,E++;return!0===r.toRegex?n>1?((t,e,n)=>{t.negatives.sort((t,e)=>t<e?-1:t>e?1:0),t.positives.sort((t,e)=>t<e?-1:t>e?1:0);let r,o=e.capture?"":"?:",s="",i="";return t.positives.length&&(s=t.positives.map(t=>u(String(t),n)).join("|")),t.negatives.length&&(i=`-(${o}${t.negatives.map(t=>u(String(t),n)).join("|")})`),r=s&&i?`${s}|${i}`:s||i,e.wrap?`(${o}${r})`:r})(S,r,y):l(v,null,{wrap:!1,...r}):v},d=(t,e,s,i={})=>{if(null==e&&r(t))return[t];if(!r(t)||!r(e))return f(t,e,i);if("function"==typeof s)return d(t,e,1,{transform:s});if(n(s))return d(t,e,0,s);let a={...i};return!0===a.capture&&(a.wrap=!0),s=s||a.step||1,o(s)?o(t)&&o(e)?h(t,e,s,a):((t,e,n=1,r={})=>{if(!o(t)&&t.length>1||!o(e)&&e.length>1)return f(t,e,r);let s=r.transform||(t=>String.fromCharCode(t)),i=`${t}`.charCodeAt(0),a=`${e}`.charCodeAt(0),u=i>a,p=Math.min(i,a),h=Math.max(i,a);if(r.toRegex&&1===n)return c(p,h,!1,r);let d=[],g=0;for(;u?i>=a:i<=a;)d.push(s(i,g)),i=u?i-n:i+n,g++;return!0===r.toRegex?l(d,null,{wrap:!1,options:r}):d})(t,e,Math.max(Math.abs(s),1),a):null==s||n(s)?d(t,e,1,s):((t,e)=>{if(!0===e.strictRanges)throw new TypeError(`Expected step "${t}" to be a number`);return[]})(s,a)};return N=d}function rt(){if(Q)return q;Q=1;const t=J(),{MAX_LENGTH:e,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:i,CHAR_RIGHT_PARENTHESES:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:p,CHAR_DOUBLE_QUOTE:f,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:d,CHAR_ZERO_WIDTH_NOBREAK_SPACE:g}=V?K:(V=1,K={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return q=(_,y={})=>{if("string"!=typeof _)throw new TypeError("Expected a string");const m=y||{},R="number"==typeof m.maxLength?Math.min(e,m.maxLength):e;if(_.length>R)throw new SyntaxError(`Input length (${_.length}), exceeds max characters (${R})`);const S={type:"root",input:_,nodes:[]},b=[S];let v=S,E=S,P=0;const A=_.length;let C,x=0,O=0;const T=()=>_[x++],w=t=>{if("text"===t.type&&"dot"===E.type&&(E.type="text"),!E||"text"!==E.type||"text"!==t.type)return v.nodes.push(t),t.parent=v,t.prev=E,E=t,t;E.value+=t.value};for(w({type:"bos"});x<A;)if(v=b[b.length-1],C=T(),C!==g&&C!==d)if(C!==n)if(C!==p){if(C===l){let t;for(P++;x<A&&(t=T());)if(C+=t,t!==l)if(t!==n){if(t===p&&(P--,0===P))break}else C+=T();else P++;w({type:"text",value:C});continue}if(C!==i)if(C!==a){if(C===f||C===h||C===r){const t=C;let e;for(!0!==y.keepQuotes&&(C="");x<A&&(e=T());)if(e!==n){if(e===t){!0===y.keepQuotes&&(C+=e);break}C+=e}else C+=e+T();w({type:"text",value:C});continue}if(C===u){O++;const t=E.value&&"$"===E.value.slice(-1)||!0===v.dollar;v=w({type:"brace",open:!0,close:!1,dollar:t,depth:O,commas:0,ranges:0,nodes:[]}),b.push(v),w({type:"open",value:C});continue}if(C===c){if("brace"!==v.type){w({type:"text",value:C});continue}const t="close";v=b.pop(),v.close=!0,w({type:t,value:C}),O--,v=b[b.length-1];continue}if(C===o&&O>0){if(v.ranges>0){v.ranges=0;const e=v.nodes.shift();v.nodes=[e,{type:"text",value:t(v)}]}w({type:"comma",value:C}),v.commas++}else{if(C===s&&O>0&&0===v.commas){const t=v.nodes;if(0===O||0===t.length){w({type:"text",value:C});continue}if("dot"===E.type){if(v.range=[],E.value+=C,E.type="range",3!==v.nodes.length&&5!==v.nodes.length){v.invalid=!0,v.ranges=0,E.type="text";continue}v.ranges++,v.args=[];continue}if("range"===E.type){t.pop();const e=t[t.length-1];e.value+=E.value+C,E=e,v.ranges--;continue}w({type:"dot",value:C});continue}w({type:"text",value:C})}}else{if("paren"!==v.type){w({type:"text",value:C});continue}v=b.pop(),w({type:"text",value:C}),v=b[b.length-1]}else v=w({type:"paren",nodes:[]}),b.push(v),w({type:"text",value:C})}else w({type:"text",value:"\\"+C});else w({type:"text",value:(y.keepEscaping?C:"")+T()});do{if(v=b.pop(),"root"!==v.type){v.nodes.forEach(t=>{t.nodes||("open"===t.type&&(t.isOpen=!0),"close"===t.type&&(t.isClose=!0),t.nodes||(t.type="text"),t.invalid=!0)});const t=b[b.length-1],e=t.nodes.indexOf(v);t.nodes.splice(e,1,...v.nodes)}}while(b.length>0);return w({type:"eos"}),S}}function ot(){if(Y)return X;Y=1;const t=J(),e=function(){if(W)return B;W=1;const t=nt(),e=Z();return B=(n,r={})=>{const o=(n,s={})=>{const i=e.isInvalidBrace(s),a=!0===n.invalid&&!0===r.escapeInvalid,u=!0===i||!0===a,c=!0===r.escapeInvalid?"\\":"";let l="";if(!0===n.isOpen)return c+n.value;if(!0===n.isClose)return console.log("node.isClose",c,n.value),c+n.value;if("open"===n.type)return u?c+n.value:"(";if("close"===n.type)return u?c+n.value:")";if("comma"===n.type)return"comma"===n.prev.type?"":u?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){const o=e.reduce(n.nodes),s=t(...o,{...r,wrap:!1,toRegex:!0,strictZeros:!0});if(0!==s.length)return o.length>1&&s.length>1?`(${s})`:s}if(n.nodes)for(const t of n.nodes)l+=o(t,n);return l};return o(n)}}(),n=function(){if(U)return G;U=1;const t=nt(),e=J(),n=Z(),r=(t="",e="",o=!1)=>{const s=[];if(t=[].concat(t),!(e=[].concat(e)).length)return t;if(!t.length)return o?n.flatten(e).map(t=>`{${t}}`):e;for(const n of t)if(Array.isArray(n))for(const t of n)s.push(r(t,e,o));else for(let t of e)!0===o&&"string"==typeof t&&(t=`{${t}}`),s.push(Array.isArray(t)?r(n,t,o):n+t);return n.flatten(s)};return G=(o,s={})=>{const i=void 0===s.rangeLimit?1e3:s.rangeLimit,a=(o,u={})=>{o.queue=[];let c=u,l=u.queue;for(;"brace"!==c.type&&"root"!==c.type&&c.parent;)c=c.parent,l=c.queue;if(o.invalid||o.dollar)return void l.push(r(l.pop(),e(o,s)));if("brace"===o.type&&!0!==o.invalid&&2===o.nodes.length)return void l.push(r(l.pop(),["{}"]));if(o.nodes&&o.ranges>0){const a=n.reduce(o.nodes);if(n.exceedsLimit(...a,s.step,i))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let u=t(...a,s);return 0===u.length&&(u=e(o,s)),l.push(r(l.pop(),u)),void(o.nodes=[])}const p=n.encloseBrace(o);let f=o.queue,h=o;for(;"brace"!==h.type&&"root"!==h.type&&h.parent;)h=h.parent,f=h.queue;for(let t=0;t<o.nodes.length;t++){const e=o.nodes[t];"comma"!==e.type||"brace"!==o.type?"close"!==e.type?e.value&&"open"!==e.type?f.push(r(f.pop(),e.value)):e.nodes&&a(e,o):l.push(r(l.pop(),f,p)):(1===t&&f.push(""),f.push(""))}return f};return n.flatten(a(o))},G}(),r=rt(),o=(t,e={})=>{let n=[];if(Array.isArray(t))for(const r of t){const t=o.create(r,e);Array.isArray(t)?n.push(...t):n.push(t)}else n=[].concat(o.create(t,e));return e&&!0===e.expand&&!0===e.nodupes&&(n=[...new Set(n)]),n};return o.parse=(t,e={})=>r(t,e),o.stringify=(e,n={})=>t("string"==typeof e?o.parse(e,n):e,n),o.compile=(t,n={})=>("string"==typeof t&&(t=o.parse(t,n)),e(t,n)),o.expand=(t,e={})=>{"string"==typeof t&&(t=o.parse(t,e));let r=n(t,e);return!0===e.noempty&&(r=r.filter(Boolean)),!0===e.nodupes&&(r=[...new Set(r)]),r},o.create=(t,e={})=>""===t||t.length<3?[t]:!0!==e.expand?o.compile(t,e):o.expand(t,e),X=o}var st,it,at,ut,ct,lt,pt,ft,ht,dt,gt,_t,yt,mt,Rt={};function St(){if(it)return st;it=1;const t=o,e="\\\\/",n=`[^${e}]`,r="\\.",s="\\/",i="[^/]",a=`(?:${s}|$)`,u=`(?:^|${s})`,c=`${r}{1,2}${a}`,l={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:s,ONE_CHAR:"(?=.)",QMARK:i,END_ANCHOR:a,DOTS_SLASH:c,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${u}${c})`,NO_DOT_SLASH:`(?!${r}{0,1}${a})`,NO_DOTS_SLASH:`(?!${c})`,QMARK_NO_DOT:`[^.${s}]`,STAR:`${i}*?`,START_ANCHOR:u},p={...l,SLASH_LITERAL:`[${e}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${e}])${r}{1,2}(?:[${e}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`};return st={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:t.sep,extglobChars:t=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:t=>!0===t?p:l}}function bt(){return at||(at=1,function(t){const e=o,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:a}=St();t.isObject=t=>null!==t&&"object"==typeof t&&!Array.isArray(t),t.hasRegexChars=t=>i.test(t),t.isRegexChar=e=>1===e.length&&t.hasRegexChars(e),t.escapeRegex=t=>t.replace(a,"\\$1"),t.toPosixSlashes=t=>t.replace(r,"/"),t.removeBackslashes=t=>t.replace(s,t=>"\\"===t?"":t),t.supportsLookbehinds=()=>{const t=process.version.slice(1).split(".").map(Number);return 3===t.length&&t[0]>=9||8===t[0]&&t[1]>=10},t.isWindows=t=>t&&"boolean"==typeof t.windows?t.windows:!0===n||"\\"===e.sep,t.escapeLast=(e,n,r)=>{const o=e.lastIndexOf(n,r);return-1===o?e:"\\"===e[o-1]?t.escapeLast(e,n,o-1):`${e.slice(0,o)}\\${e.slice(o)}`},t.removePrefix=(t,e={})=>{let n=t;return n.startsWith("./")&&(n=n.slice(2),e.prefix="./"),n},t.wrapOutput=(t,e={},n={})=>{let r=`${n.contains?"":"^"}(?:${t})${n.contains?"":"$"}`;return!0===e.negated&&(r=`(?:^(?!${r}).*$)`),r}}(Rt)),Rt}function vt(){if(ht)return ft;ht=1;const t=o,e=function(){if(ct)return ut;ct=1;const t=bt(),{CHAR_ASTERISK:e,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:i,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:p,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:g}=St(),_=t=>t===a||t===r,y=t=>{!0!==t.isPrefix&&(t.depth=t.isGlobstar?1/0:1)};return ut=(m,R)=>{const S=R||{},b=m.length-1,v=!0===S.parts||!0===S.scanToEnd,E=[],P=[],A=[];let C,x,O=m,T=-1,w=0,k=0,$=!1,L=!1,M=!1,H=!1,D=!1,F=!1,j=!1,N=!1,I=!1,B=!1,W=0,G={value:"",depth:0,isGlob:!1};const U=()=>T>=b,K=()=>O.charCodeAt(T+1),V=()=>(C=x,O.charCodeAt(++T));for(;T<b;){let t;if(x=V(),x!==r){if(!0===F||x===u){for(W++;!0!==U()&&(x=V());)if(x!==r)if(x!==u){if(!0!==F&&x===s&&(x=V())===s){if($=G.isBrace=!0,M=G.isGlob=!0,B=!0,!0===v)continue;break}if(!0!==F&&x===o){if($=G.isBrace=!0,M=G.isGlob=!0,B=!0,!0===v)continue;break}if(x===h&&(W--,0===W)){F=!1,$=G.isBrace=!0,B=!0;break}}else W++;else j=G.backslashes=!0,V();if(!0===v)continue;break}if(x!==a){if(!0!==S.noext&&!0==(x===p||x===n||x===e||x===f||x===i)&&K()===c){if(M=G.isGlob=!0,H=G.isExtglob=!0,B=!0,x===i&&T===w&&(I=!0),!0===v){for(;!0!==U()&&(x=V());)if(x!==r){if(x===d){M=G.isGlob=!0,B=!0;break}}else j=G.backslashes=!0,x=V();continue}break}if(x===e){if(C===e&&(D=G.isGlobstar=!0),M=G.isGlob=!0,B=!0,!0===v)continue;break}if(x===f){if(M=G.isGlob=!0,B=!0,!0===v)continue;break}if(x===l){for(;!0!==U()&&(t=V());)if(t!==r){if(t===g){L=G.isBracket=!0,M=G.isGlob=!0,B=!0;break}}else j=G.backslashes=!0,V();if(!0===v)continue;break}if(!0===S.nonegate||x!==i||T!==w){if(!0!==S.noparen&&x===c){if(M=G.isGlob=!0,!0===v){for(;!0!==U()&&(x=V());)if(x!==c){if(x===d){B=!0;break}}else j=G.backslashes=!0,x=V();continue}break}if(!0===M){if(B=!0,!0===v)continue;break}}else N=G.negated=!0,w++}else{if(E.push(T),P.push(G),G={value:"",depth:0,isGlob:!1},!0===B)continue;if(C===s&&T===w+1){w+=2;continue}k=T+1}}else j=G.backslashes=!0,x=V(),x===u&&(F=!0)}!0===S.noext&&(H=!1,M=!1);let q=O,Q="",X="";w>0&&(Q=O.slice(0,w),O=O.slice(w),k-=w),q&&!0===M&&k>0?(q=O.slice(0,k),X=O.slice(k)):!0===M?(q="",X=O):q=O,q&&""!==q&&"/"!==q&&q!==O&&_(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),!0===S.unescape&&(X&&(X=t.removeBackslashes(X)),q&&!0===j&&(q=t.removeBackslashes(q)));const Y={prefix:Q,input:m,start:w,base:q,glob:X,isBrace:$,isBracket:L,isGlob:M,isExtglob:H,isGlobstar:D,negated:N,negatedExtglob:I};if(!0===S.tokens&&(Y.maxDepth=0,_(x)||P.push(G),Y.tokens=P),!0===S.parts||!0===S.tokens){let t;for(let e=0;e<E.length;e++){const n=t?t+1:w,r=E[e],o=m.slice(n,r);S.tokens&&(0===e&&0!==w?(P[e].isPrefix=!0,P[e].value=Q):P[e].value=o,y(P[e]),Y.maxDepth+=P[e].depth),0===e&&""===o||A.push(o),t=r}if(t&&t+1<m.length){const e=m.slice(t+1);A.push(e),S.tokens&&(P[P.length-1].value=e,y(P[P.length-1]),Y.maxDepth+=P[P.length-1].depth)}Y.slashes=E,Y.parts=A}return Y},ut}(),n=function(){if(pt)return lt;pt=1;const t=St(),e=bt(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:i}=t,a=(t,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...t,n);t.sort();const r=`[${t.join("-")}]`;try{new RegExp(r)}catch(n){return t.map(t=>e.escapeRegex(t)).join("..")}return r},u=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,c=(l,p)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=i[l]||l;const f={...p},h="number"==typeof f.maxLength?Math.min(n,f.maxLength):n;let d=l.length;if(d>h)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${h}`);const g={type:"bos",value:"",output:f.prepend||""},_=[g],y=f.capture?"":"?:",m=e.isWindows(p),R=t.globChars(m),S=t.extglobChars(R),{DOT_LITERAL:b,PLUS_LITERAL:v,SLASH_LITERAL:E,ONE_CHAR:P,DOTS_SLASH:A,NO_DOT:C,NO_DOT_SLASH:x,NO_DOTS_SLASH:O,QMARK:T,QMARK_NO_DOT:w,STAR:k,START_ANCHOR:$}=R,L=t=>`(${y}(?:(?!${$}${t.dot?A:b}).)*?)`,M=f.dot?"":C,H=f.dot?T:w;let D=!0===f.bash?L(f):k;f.capture&&(D=`(${D})`),"boolean"==typeof f.noext&&(f.noextglob=f.noext);const F={input:l,index:-1,start:0,dot:!0===f.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:_};l=e.removePrefix(l,F),d=l.length;const j=[],N=[],I=[];let B,W=g;const G=()=>F.index===d-1,U=F.peek=(t=1)=>l[F.index+t],K=F.advance=()=>l[++F.index]||"",V=()=>l.slice(F.index+1),q=(t="",e=0)=>{F.consumed+=t,F.index+=e},Q=t=>{F.output+=null!=t.output?t.output:t.value,q(t.value)},X=()=>{let t=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)K(),F.start++,t++;return t%2!=0&&(F.negated=!0,F.start++,!0)},Y=t=>{F[t]++,I.push(t)},z=t=>{F[t]--,I.pop()},Z=t=>{if("globstar"===W.type){const e=F.braces>0&&("comma"===t.type||"brace"===t.type),n=!0===t.extglob||j.length&&("pipe"===t.type||"paren"===t.type);"slash"===t.type||"paren"===t.type||e||n||(F.output=F.output.slice(0,-W.output.length),W.type="star",W.value="*",W.output=D,F.output+=W.output)}if(j.length&&"paren"!==t.type&&(j[j.length-1].inner+=t.value),(t.value||t.output)&&Q(t),W&&"text"===W.type&&"text"===t.type)return W.value+=t.value,void(W.output=(W.output||"")+t.value);t.prev=W,_.push(t),W=t},J=(t,e)=>{const n={...S[e],conditions:1,inner:""};n.prev=W,n.parens=F.parens,n.output=F.output;const r=(f.capture?"(":"")+n.open;Y("parens"),Z({type:t,value:e,output:F.output?"":P}),Z({type:"paren",extglob:!0,value:K(),output:r}),j.push(n)},tt=t=>{let e,n=t.close+(f.capture?")":"");if("negate"===t.type){let r=D;if(t.inner&&t.inner.length>1&&t.inner.includes("/")&&(r=L(f)),(r!==D||G()||/^\)+$/.test(V()))&&(n=t.close=`)$))${r}`),t.inner.includes("*")&&(e=V())&&/^\.[^\\/.]+$/.test(e)){const o=c(e,{...p,fastpaths:!1}).output;n=t.close=`)${o})${r})`}"bos"===t.prev.type&&(F.negatedExtglob=!0)}Z({type:"paren",extglob:!0,value:B,output:n}),z("parens")};if(!1!==f.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let t=!1,n=l.replace(s,(e,n,r,o,s,i)=>"\\"===o?(t=!0,e):"?"===o?n?n+o+(s?T.repeat(s.length):""):0===i?H+(s?T.repeat(s.length):""):T.repeat(r.length):"."===o?b.repeat(r.length):"*"===o?n?n+o+(s?D:""):D:n?e:`\\${e}`);return!0===t&&(n=!0===f.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,t=>t.length%2==0?"\\\\":t?"\\":"")),n===l&&!0===f.contains?(F.output=l,F):(F.output=e.wrapOutput(n,F,p),F)}for(;!G();){if(B=K(),"\0"===B)continue;if("\\"===B){const t=U();if("/"===t&&!0!==f.bash)continue;if("."===t||";"===t)continue;if(!t){B+="\\",Z({type:"text",value:B});continue}const e=/^\\+/.exec(V());let n=0;if(e&&e[0].length>2&&(n=e[0].length,F.index+=n,n%2!=0&&(B+="\\")),!0===f.unescape?B=K():B+=K(),0===F.brackets){Z({type:"text",value:B});continue}}if(F.brackets>0&&("]"!==B||"["===W.value||"[^"===W.value)){if(!1!==f.posix&&":"===B){const t=W.value.slice(1);if(t.includes("[")&&(W.posix=!0,t.includes(":"))){const t=W.value.lastIndexOf("["),e=W.value.slice(0,t),n=W.value.slice(t+2),o=r[n];if(o){W.value=e+o,F.backtrack=!0,K(),g.output||1!==_.indexOf(W)||(g.output=P);continue}}}("["===B&&":"!==U()||"-"===B&&"]"===U())&&(B=`\\${B}`),"]"!==B||"["!==W.value&&"[^"!==W.value||(B=`\\${B}`),!0===f.posix&&"!"===B&&"["===W.value&&(B="^"),W.value+=B,Q({value:B});continue}if(1===F.quotes&&'"'!==B){B=e.escapeRegex(B),W.value+=B,Q({value:B});continue}if('"'===B){F.quotes=1===F.quotes?0:1,!0===f.keepQuotes&&Z({type:"text",value:B});continue}if("("===B){Y("parens"),Z({type:"paren",value:B});continue}if(")"===B){if(0===F.parens&&!0===f.strictBrackets)throw new SyntaxError(u("opening","("));const t=j[j.length-1];if(t&&F.parens===t.parens+1){tt(j.pop());continue}Z({type:"paren",value:B,output:F.parens?")":"\\)"}),z("parens");continue}if("["===B){if(!0!==f.nobracket&&V().includes("]"))Y("brackets");else{if(!0!==f.nobracket&&!0===f.strictBrackets)throw new SyntaxError(u("closing","]"));B=`\\${B}`}Z({type:"bracket",value:B});continue}if("]"===B){if(!0===f.nobracket||W&&"bracket"===W.type&&1===W.value.length){Z({type:"text",value:B,output:`\\${B}`});continue}if(0===F.brackets){if(!0===f.strictBrackets)throw new SyntaxError(u("opening","["));Z({type:"text",value:B,output:`\\${B}`});continue}z("brackets");const t=W.value.slice(1);if(!0===W.posix||"^"!==t[0]||t.includes("/")||(B=`/${B}`),W.value+=B,Q({value:B}),!1===f.literalBrackets||e.hasRegexChars(t))continue;const n=e.escapeRegex(W.value);if(F.output=F.output.slice(0,-W.value.length),!0===f.literalBrackets){F.output+=n,W.value=n;continue}W.value=`(${y}${n}|${W.value})`,F.output+=W.value;continue}if("{"===B&&!0!==f.nobrace){Y("braces");const t={type:"brace",value:B,output:"(",outputIndex:F.output.length,tokensIndex:F.tokens.length};N.push(t),Z(t);continue}if("}"===B){const t=N[N.length-1];if(!0===f.nobrace||!t){Z({type:"text",value:B,output:B});continue}let e=")";if(!0===t.dots){const t=_.slice(),n=[];for(let e=t.length-1;e>=0&&(_.pop(),"brace"!==t[e].type);e--)"dots"!==t[e].type&&n.unshift(t[e].value);e=a(n,f),F.backtrack=!0}if(!0!==t.comma&&!0!==t.dots){const n=F.output.slice(0,t.outputIndex),r=F.tokens.slice(t.tokensIndex);t.value=t.output="\\{",B=e="\\}",F.output=n;for(const t of r)F.output+=t.output||t.value}Z({type:"brace",value:B,output:e}),z("braces"),N.pop();continue}if("|"===B){j.length>0&&j[j.length-1].conditions++,Z({type:"text",value:B});continue}if(","===B){let t=B;const e=N[N.length-1];e&&"braces"===I[I.length-1]&&(e.comma=!0,t="|"),Z({type:"comma",value:B,output:t});continue}if("/"===B){if("dot"===W.type&&F.index===F.start+1){F.start=F.index+1,F.consumed="",F.output="",_.pop(),W=g;continue}Z({type:"slash",value:B,output:E});continue}if("."===B){if(F.braces>0&&"dot"===W.type){"."===W.value&&(W.output=b);const t=N[N.length-1];W.type="dots",W.output+=B,W.value+=B,t.dots=!0;continue}if(F.braces+F.parens===0&&"bos"!==W.type&&"slash"!==W.type){Z({type:"text",value:B,output:b});continue}Z({type:"dot",value:B,output:b});continue}if("?"===B){if((!W||"("!==W.value)&&!0!==f.noextglob&&"("===U()&&"?"!==U(2)){J("qmark",B);continue}if(W&&"paren"===W.type){const t=U();let n=B;if("<"===t&&!e.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===W.value&&!/[!=<:]/.test(t)||"<"===t&&!/<([!=]|\w+>)/.test(V()))&&(n=`\\${B}`),Z({type:"text",value:B,output:n});continue}if(!0!==f.dot&&("slash"===W.type||"bos"===W.type)){Z({type:"qmark",value:B,output:w});continue}Z({type:"qmark",value:B,output:T});continue}if("!"===B){if(!0!==f.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){J("negate",B);continue}if(!0!==f.nonegate&&0===F.index){X();continue}}if("+"===B){if(!0!==f.noextglob&&"("===U()&&"?"!==U(2)){J("plus",B);continue}if(W&&"("===W.value||!1===f.regex){Z({type:"plus",value:B,output:v});continue}if(W&&("bracket"===W.type||"paren"===W.type||"brace"===W.type)||F.parens>0){Z({type:"plus",value:B});continue}Z({type:"plus",value:v});continue}if("@"===B){if(!0!==f.noextglob&&"("===U()&&"?"!==U(2)){Z({type:"at",extglob:!0,value:B,output:""});continue}Z({type:"text",value:B});continue}if("*"!==B){"$"!==B&&"^"!==B||(B=`\\${B}`);const t=o.exec(V());t&&(B+=t[0],F.index+=t[0].length),Z({type:"text",value:B});continue}if(W&&("globstar"===W.type||!0===W.star)){W.type="star",W.star=!0,W.value+=B,W.output=D,F.backtrack=!0,F.globstar=!0,q(B);continue}let t=V();if(!0!==f.noextglob&&/^\([^?]/.test(t)){J("star",B);continue}if("star"===W.type){if(!0===f.noglobstar){q(B);continue}const e=W.prev,n=e.prev,r="slash"===e.type||"bos"===e.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===f.bash&&(!r||t[0]&&"/"!==t[0])){Z({type:"star",value:B,output:""});continue}const s=F.braces>0&&("comma"===e.type||"brace"===e.type),i=j.length&&("pipe"===e.type||"paren"===e.type);if(!r&&"paren"!==e.type&&!s&&!i){Z({type:"star",value:B,output:""});continue}for(;"/**"===t.slice(0,3);){const e=l[F.index+4];if(e&&"/"!==e)break;t=t.slice(3),q("/**",3)}if("bos"===e.type&&G()){W.type="globstar",W.value+=B,W.output=L(f),F.output=W.output,F.globstar=!0,q(B);continue}if("slash"===e.type&&"bos"!==e.prev.type&&!o&&G()){F.output=F.output.slice(0,-(e.output+W.output).length),e.output=`(?:${e.output}`,W.type="globstar",W.output=L(f)+(f.strictSlashes?")":"|$)"),W.value+=B,F.globstar=!0,F.output+=e.output+W.output,q(B);continue}if("slash"===e.type&&"bos"!==e.prev.type&&"/"===t[0]){const n=void 0!==t[1]?"|$":"";F.output=F.output.slice(0,-(e.output+W.output).length),e.output=`(?:${e.output}`,W.type="globstar",W.output=`${L(f)}${E}|${E}${n})`,W.value+=B,F.output+=e.output+W.output,F.globstar=!0,q(B+K()),Z({type:"slash",value:"/",output:""});continue}if("bos"===e.type&&"/"===t[0]){W.type="globstar",W.value+=B,W.output=`(?:^|${E}|${L(f)}${E})`,F.output=W.output,F.globstar=!0,q(B+K()),Z({type:"slash",value:"/",output:""});continue}F.output=F.output.slice(0,-W.output.length),W.type="globstar",W.output=L(f),W.value+=B,F.output+=W.output,F.globstar=!0,q(B);continue}const n={type:"star",value:B,output:D};!0!==f.bash?!W||"bracket"!==W.type&&"paren"!==W.type||!0!==f.regex?(F.index!==F.start&&"slash"!==W.type&&"dot"!==W.type||("dot"===W.type?(F.output+=x,W.output+=x):!0===f.dot?(F.output+=O,W.output+=O):(F.output+=M,W.output+=M),"*"!==U()&&(F.output+=P,W.output+=P)),Z(n)):(n.output=B,Z(n)):(n.output=".*?","bos"!==W.type&&"slash"!==W.type||(n.output=M+n.output),Z(n))}for(;F.brackets>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing","]"));F.output=e.escapeLast(F.output,"["),z("brackets")}for(;F.parens>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing",")"));F.output=e.escapeLast(F.output,"("),z("parens")}for(;F.braces>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing","}"));F.output=e.escapeLast(F.output,"{"),z("braces")}if(!0===f.strictSlashes||"star"!==W.type&&"bracket"!==W.type||Z({type:"maybe_slash",value:"",output:`${E}?`}),!0===F.backtrack){F.output="";for(const t of F.tokens)F.output+=null!=t.output?t.output:t.value,t.suffix&&(F.output+=t.suffix)}return F};return c.fastpaths=(r,o)=>{const s={...o},a="number"==typeof s.maxLength?Math.min(n,s.maxLength):n,u=r.length;if(u>a)throw new SyntaxError(`Input length: ${u}, exceeds maximum allowed length: ${a}`);r=i[r]||r;const c=e.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:p,ONE_CHAR:f,DOTS_SLASH:h,NO_DOT:d,NO_DOTS:g,NO_DOTS_SLASH:_,STAR:y,START_ANCHOR:m}=t.globChars(c),R=s.dot?g:d,S=s.dot?_:d,b=s.capture?"":"?:";let v=!0===s.bash?".*?":y;s.capture&&(v=`(${v})`);const E=t=>!0===t.noglobstar?v:`(${b}(?:(?!${m}${t.dot?h:l}).)*?)`,P=t=>{switch(t){case"*":return`${R}${f}${v}`;case".*":return`${l}${f}${v}`;case"*.*":return`${R}${v}${l}${f}${v}`;case"*/*":return`${R}${v}${p}${f}${S}${v}`;case"**":return R+E(s);case"**/*":return`(?:${R}${E(s)}${p})?${S}${f}${v}`;case"**/*.*":return`(?:${R}${E(s)}${p})?${S}${v}${l}${f}${v}`;case"**/.*":return`(?:${R}${E(s)}${p})?${l}${f}${v}`;default:{const e=/^(.*?)\.(\w+)$/.exec(t);if(!e)return;const n=P(e[1]);if(!n)return;return n+l+e[2]}}},A=e.removePrefix(r,{negated:!1,prefix:""});let C=P(A);return C&&!0!==s.strictSlashes&&(C+=`${p}?`),C},lt=c}(),r=bt(),s=St(),i=(t,e,n=!1)=>{if(Array.isArray(t)){const r=t.map(t=>i(t,e,n)),o=t=>{for(const e of r){const n=e(t);if(n)return n}return!1};return o}const o=(s=t)&&"object"==typeof s&&!Array.isArray(s)&&t.tokens&&t.input;var s;if(""===t||"string"!=typeof t&&!o)throw new TypeError("Expected pattern to be a non-empty string");const a=e||{},u=r.isWindows(e),c=o?i.compileRe(t,e):i.makeRe(t,e,!1,!0),l=c.state;delete c.state;let p=()=>!1;if(a.ignore){const t={...e,ignore:null,onMatch:null,onResult:null};p=i(a.ignore,t,n)}const f=(n,r=!1)=>{const{isMatch:o,match:s,output:f}=i.test(n,c,e,{glob:t,posix:u}),h={glob:t,state:l,regex:c,posix:u,input:n,output:f,match:s,isMatch:o};return"function"==typeof a.onResult&&a.onResult(h),!1===o?(h.isMatch=!1,!!r&&h):p(n)?("function"==typeof a.onIgnore&&a.onIgnore(h),h.isMatch=!1,!!r&&h):("function"==typeof a.onMatch&&a.onMatch(h),!r||h)};return n&&(f.state=l),f};return i.test=(t,e,n,{glob:o,posix:s}={})=>{if("string"!=typeof t)throw new TypeError("Expected input to be a string");if(""===t)return{isMatch:!1,output:""};const a=n||{},u=a.format||(s?r.toPosixSlashes:null);let c=t===o,l=c&&u?u(t):t;return!1===c&&(l=u?u(t):t,c=l===o),!1!==c&&!0!==a.capture||(c=!0===a.matchBase||!0===a.basename?i.matchBase(t,e,n,s):e.exec(l)),{isMatch:Boolean(c),match:c,output:l}},i.matchBase=(e,n,o,s=r.isWindows(o))=>(n instanceof RegExp?n:i.makeRe(n,o)).test(t.basename(e)),i.isMatch=(t,e,n)=>i(e,n)(t),i.parse=(t,e)=>Array.isArray(t)?t.map(t=>i.parse(t,e)):n(t,{...e,fastpaths:!1}),i.scan=(t,n)=>e(t,n),i.compileRe=(t,e,n=!1,r=!1)=>{if(!0===n)return t.output;const o=e||{},s=o.contains?"":"^",a=o.contains?"":"$";let u=`${s}(?:${t.output})${a}`;t&&!0===t.negated&&(u=`^(?!${u}).*$`);const c=i.toRegex(u,e);return!0===r&&(c.state=t),c},i.makeRe=(t,e={},r=!1,o=!1)=>{if(!t||"string"!=typeof t)throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return!1===e.fastpaths||"."!==t[0]&&"*"!==t[0]||(s.output=n.fastpaths(t,e)),s.output||(s=n(t,e)),i.compileRe(s,e,r,o)},i.toRegex=(t,e)=>{try{const n=e||{};return new RegExp(t,n.flags||(n.nocase?"i":""))}catch(t){if(e&&!0===e.debug)throw t;return/$^/}},i.constants=s,ft=i}function Et(){return gt?dt:(gt=1,dt=vt())}function Pt(){if(mt)return O;mt=1,Object.defineProperty(O,"__esModule",{value:!0}),O.isAbsolute=O.partitionAbsoluteAndRelative=O.removeDuplicateSlashes=O.matchAny=O.convertPatternsToRe=O.makeRe=O.getPatternParts=O.expandBraceExpansion=O.expandPatternsWithBraceExpansion=O.isAffectDepthOfReadingPattern=O.endsWithSlashGlobStar=O.hasGlobStar=O.getBaseDirectory=O.isPatternRelatedToParentDirectory=O.getPatternsOutsideCurrentDirectory=O.getPatternsInsideCurrentDirectory=O.getPositivePatterns=O.getNegativePatterns=O.isPositivePattern=O.isNegativePattern=O.convertToNegativePattern=O.convertToPositivePattern=O.isDynamicPattern=O.isStaticPattern=void 0;const t=o,e=k(),n=function(){if(yt)return _t;yt=1;const t=s,e=ot(),n=Et(),r=bt(),o=t=>""===t||"./"===t,i=t=>{const e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},a=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let o=new Set,s=new Set,i=new Set,a=0,u=t=>{i.add(t.output),r&&r.onResult&&r.onResult(t)};for(let i=0;i<e.length;i++){let c=n(String(e[i]),{...r,onResult:u},!0),l=c.state.negated||c.state.negatedExtglob;l&&a++;for(let e of t){let t=c(e,!0);(l?!t.isMatch:t.isMatch)&&(l?o.add(t.output):(o.delete(t.output),s.add(t.output)))}}let c=(a===e.length?[...i]:[...s]).filter(t=>!o.has(t));if(r&&0===c.length){if(!0===r.failglob)throw new Error(`No matches found for "${e.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?e.map(t=>t.replace(/\\/g,"")):e}return c};return a.match=a,a.matcher=(t,e)=>n(t,e),a.any=a.isMatch=(t,e,r)=>n(e,r)(t),a.not=(t,e,n={})=>{e=[].concat(e).map(String);let r=new Set,o=[],s=new Set(a(t,e,{...n,onResult:t=>{n.onResult&&n.onResult(t),o.push(t.output)}}));for(let t of o)s.has(t)||r.add(t);return[...r]},a.contains=(e,n,r)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${t.inspect(e)}"`);if(Array.isArray(n))return n.some(t=>a.contains(e,t,r));if("string"==typeof n){if(o(e)||o(n))return!1;if(e.includes(n)||e.startsWith("./")&&e.slice(2).includes(n))return!0}return a.isMatch(e,n,{...r,contains:!0})},a.matchKeys=(t,e,n)=>{if(!r.isObject(t))throw new TypeError("Expected the first argument to be an object");let o=a(Object.keys(t),e,n),s={};for(let e of o)s[e]=t[e];return s},a.some=(t,e,r)=>{let o=[].concat(t);for(let t of[].concat(e)){let e=n(String(t),r);if(o.some(t=>e(t)))return!0}return!1},a.every=(t,e,r)=>{let o=[].concat(t);for(let t of[].concat(e)){let e=n(String(t),r);if(!o.every(t=>e(t)))return!1}return!0},a.all=(e,r,o)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${t.inspect(e)}"`);return[].concat(r).every(t=>n(t,o)(e))},a.capture=(t,e,o)=>{let s=r.isWindows(o),i=n.makeRe(String(t),{...o,capture:!0}).exec(s?r.toPosixSlashes(e):e);if(i)return i.slice(1).map(t=>void 0===t?"":t)},a.makeRe=(...t)=>n.makeRe(...t),a.scan=(...t)=>n.scan(...t),a.parse=(t,r)=>{let o=[];for(let s of[].concat(t||[]))for(let t of e(String(s),r))o.push(n.parse(t,r));return o},a.braces=(t,n)=>{if("string"!=typeof t)throw new TypeError("Expected a string");return n&&!0===n.nobrace||!i(t)?[t]:e(t,n)},a.braceExpand=(t,e)=>{if("string"!=typeof t)throw new TypeError("Expected a string");return a.braces(t,{...e,expand:!0})},a.hasBraces=i,_t=a}(),r=/[*?]|^!/,i=/\[[^[]*]/,a=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,u=/[!*+?@]\([^(]*\)/,c=/,|\.\./,l=/(?!^)\/{2,}/g;function p(t,e={}){return!f(t,e)}function f(t,e={}){return""!==t&&(!(!1!==e.caseSensitiveMatch&&!t.includes("\\"))||(!!(r.test(t)||i.test(t)||a.test(t))||(!(!1===e.extglob||!u.test(t))||!(!1===e.braceExpansion||!function(t){const e=t.indexOf("{");if(-1===e)return!1;const n=t.indexOf("}",e+1);if(-1===n)return!1;const r=t.slice(e,n);return c.test(r)}(t)))))}function h(t){return t.startsWith("!")&&"("!==t[1]}function d(t){return!h(t)}function g(t){return t.startsWith("..")||t.startsWith("./..")}function _(t){return t.endsWith("/**")}function y(t){const e=n.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((t,e)=>t.length-e.length),e.filter(t=>""!==t)}function m(t,e){return n.makeRe(t,e)}function R(e){return t.isAbsolute(e)}return O.isStaticPattern=p,O.isDynamicPattern=f,O.convertToPositivePattern=function(t){return h(t)?t.slice(1):t},O.convertToNegativePattern=function(t){return"!"+t},O.isNegativePattern=h,O.isPositivePattern=d,O.getNegativePatterns=function(t){return t.filter(h)},O.getPositivePatterns=function(t){return t.filter(d)},O.getPatternsInsideCurrentDirectory=function(t){return t.filter(t=>!g(t))},O.getPatternsOutsideCurrentDirectory=function(t){return t.filter(g)},O.isPatternRelatedToParentDirectory=g,O.getBaseDirectory=function(t){return e(t,{flipBackslashes:!1})},O.hasGlobStar=function(t){return t.includes("**")},O.endsWithSlashGlobStar=_,O.isAffectDepthOfReadingPattern=function(e){const n=t.basename(e);return _(e)||p(n)},O.expandPatternsWithBraceExpansion=function(t){return t.reduce((t,e)=>t.concat(y(e)),[])},O.expandBraceExpansion=y,O.getPatternParts=function(t,e){let{parts:r}=n.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return 0===r.length&&(r=[t]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r},O.makeRe=m,O.convertPatternsToRe=function(t,e){return t.map(t=>m(t,e))},O.matchAny=function(t,e){return e.some(e=>e.test(t))},O.removeDuplicateSlashes=function(t){return t.replace(l,"/")},O.partitionAbsoluteAndRelative=function(t){const e=[],n=[];for(const r of t)R(r)?e.push(r):n.push(r);return[e,n]},O.isAbsolute=R,O}var At,Ct,xt,Ot={};function Tt(){if(Ct)return At;Ct=1;const t=i.PassThrough,e=Array.prototype.slice;function n(e,r){if(Array.isArray(e))for(let t=0,o=e.length;t<o;t++)e[t]=n(e[t],r);else{if(!e._readableState&&e.pipe&&(e=e.pipe(t(r))),!e._readableState||!e.pause||!e.pipe)throw new Error("Only readable stream can be merged.");e.pause()}return e}return At=function(){const r=[],o=e.call(arguments);let s=!1,i=o[o.length-1];i&&!Array.isArray(i)&&null==i.pipe?o.pop():i={};const a=!1!==i.end,u=!0===i.pipeError;null==i.objectMode&&(i.objectMode=!0);null==i.highWaterMark&&(i.highWaterMark=65536);const c=t(i);function l(){for(let t=0,e=arguments.length;t<e;t++)r.push(n(arguments[t],i));return p(),this}function p(){if(s)return;s=!0;let t=r.shift();if(!t)return void process.nextTick(f);Array.isArray(t)||(t=[t]);let e=t.length+1;function n(){--e>0||(s=!1,p())}function o(t){function e(){t.removeListener("merge2UnpipeEnd",e),t.removeListener("end",e),u&&t.removeListener("error",r),n()}function r(t){c.emit("error",t)}if(t._readableState.endEmitted)return n();t.on("merge2UnpipeEnd",e),t.on("end",e),u&&t.on("error",r),t.pipe(c,{end:!1}),t.resume()}for(let e=0;e<t.length;e++)o(t[e]);n()}function f(){s=!1,c.emit("queueDrain"),a&&c.end()}c.setMaxListeners(0),c.add=l,c.on("unpipe",function(t){t.emit("merge2UnpipeEnd")}),o.length&&l.apply(null,o);return c},At}var wt,kt,$t,Lt={};function Mt(){if(wt)return Lt;return wt=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.isEmpty=Lt.isString=void 0,Lt.isString=function(t){return"string"==typeof t},Lt.isEmpty=function(t){return""===t},Lt}function Ht(){if(kt)return p;kt=1,Object.defineProperty(p,"__esModule",{value:!0}),p.string=p.stream=p.pattern=p.path=p.fs=p.errno=p.array=void 0;const t=h();p.array=t;const e=_();p.errno=e;const n=function(){if(y)return m;y=1,Object.defineProperty(m,"__esModule",{value:!0}),m.createDirentFromStats=void 0;class t{constructor(t,e){this.name=t,this.isBlockDevice=e.isBlockDevice.bind(e),this.isCharacterDevice=e.isCharacterDevice.bind(e),this.isDirectory=e.isDirectory.bind(e),this.isFIFO=e.isFIFO.bind(e),this.isFile=e.isFile.bind(e),this.isSocket=e.isSocket.bind(e),this.isSymbolicLink=e.isSymbolicLink.bind(e)}}return m.createDirentFromStats=function(e,n){return new t(e,n)},m}();p.fs=n;const r=b();p.path=r;const o=Pt();p.pattern=o;const s=function(){if(xt)return Ot;xt=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.merge=void 0;const t=Tt();function e(t){t.forEach(t=>t.emit("close"))}return Ot.merge=function(n){const r=t(n);return n.forEach(t=>{t.once("error",t=>r.emit("error",t))}),r.once("close",()=>e(n)),r.once("end",()=>e(n)),r},Ot}();p.stream=s;const i=Mt();return p.string=i,p}var Dt,Ft={},jt={},Nt={},It={},Bt={},Wt={},Gt={},Ut={},Kt={};function Vt(){if(Dt)return Kt;function t(t,e){t(e)}function e(t,e){t(null,e)}return Dt=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.read=void 0,Kt.read=function(n,r,o){r.fs.lstat(n,(s,i)=>{null===s?i.isSymbolicLink()&&r.followSymbolicLink?r.fs.stat(n,(n,s)=>{if(null!==n)return r.throwErrorOnBrokenSymbolicLink?void t(o,n):void e(o,i);r.markSymbolicLink&&(s.isSymbolicLink=()=>!0),e(o,s)}):e(o,i):t(o,s)})},Kt}var qt,Qt={};var Xt,Yt,zt,Zt,Jt,te,ee,ne={},re={};function oe(){if(Yt)return ne;Yt=1,Object.defineProperty(ne,"__esModule",{value:!0});const t=(Xt||(Xt=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createFileSystemAdapter=t.FILE_SYSTEM_ADAPTER=void 0;const e=u;t.FILE_SYSTEM_ADAPTER={lstat:e.lstat,stat:e.stat,lstatSync:e.lstatSync,statSync:e.statSync},t.createFileSystemAdapter=function(e){return void 0===e?t.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},t.FILE_SYSTEM_ADAPTER),e)}}(re)),re);return ne.default=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=t.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(t,e){return null!=t?t:e}},ne}function se(){if(zt)return Ut;zt=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.statSync=Ut.stat=Ut.Settings=void 0;const t=Vt(),e=(qt||(qt=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.read=void 0,Qt.read=function(t,e){const n=e.fs.lstatSync(t);if(!n.isSymbolicLink()||!e.followSymbolicLink)return n;try{const n=e.fs.statSync(t);return e.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(t){if(!e.throwErrorOnBrokenSymbolicLink)return n;throw t}}),Qt),n=oe();function r(t={}){return t instanceof n.default?t:new n.default(t)}return Ut.Settings=n.default,Ut.stat=function(e,n,o){"function"!=typeof n?t.read(e,r(n),o):t.read(e,r(),n)},Ut.statSync=function(t,n){const o=r(n);return e.read(t,o)},Ut}function ie(){if(Jt)return Zt;let t;return Jt=1,Zt="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:c):e=>(t||(t=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0))}var ae,ue={};function ce(){if(ae)return ue;ae=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;const t=process.versions.node.split(".");if(void 0===t[0]||void 0===t[1])throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);const e=Number.parseInt(t[0],10),n=Number.parseInt(t[1],10),r=e>10,o=10===e&&n>=10;return ue.IS_SUPPORT_READDIR_WITH_FILE_TYPES=r||o,ue}var le,pe,fe={},he={};function de(){if(pe)return fe;pe=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.fs=void 0;const t=function(){if(le)return he;le=1,Object.defineProperty(he,"__esModule",{value:!0}),he.createDirentFromStats=void 0;class t{constructor(t,e){this.name=t,this.isBlockDevice=e.isBlockDevice.bind(e),this.isCharacterDevice=e.isCharacterDevice.bind(e),this.isDirectory=e.isDirectory.bind(e),this.isFIFO=e.isFIFO.bind(e),this.isFile=e.isFile.bind(e),this.isSocket=e.isSocket.bind(e),this.isSymbolicLink=e.isSymbolicLink.bind(e)}}return he.createDirentFromStats=function(e,n){return new t(e,n)},he}();return fe.fs=t,fe}var ge,_e,ye={};function me(){if(ge)return ye;return ge=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.joinPathSegments=void 0,ye.joinPathSegments=function(t,e,n){return t.endsWith(n)?t+e:t+n+e},ye}function Re(){if(_e)return Gt;_e=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.readdir=Gt.readdirWithFileTypes=Gt.read=void 0;const t=se(),e=function(){if(ee)return te;ee=1,te=function(e,n){let r,o,s,i=!0;function a(e){function o(){n&&n(e,r),n=null}i?t(o):o()}function u(t,e,n){r[t]=n,(0===--o||e)&&a(e)}Array.isArray(e)?(r=[],o=e.length):(s=Object.keys(e),r={},o=s.length),o?s?s.forEach(function(t){e[t](function(e,n){u(t,e,n)})}):e.forEach(function(t,e){t(function(t,n){u(e,t,n)})}):a(null),i=!1};const t=ie();return te}(),n=ce(),r=de(),o=me();function s(t,n,s){n.fs.readdir(t,{withFileTypes:!0},(i,c)=>{if(null!==i)return void a(s,i);const l=c.map(e=>({dirent:e,name:e.name,path:o.joinPathSegments(t,e.name,n.pathSegmentSeparator)}));if(!n.followSymbolicLinks)return void u(s,l);const p=l.map(t=>function(t,e){return n=>{t.dirent.isSymbolicLink()?e.fs.stat(t.path,(o,s)=>{if(null!==o)return e.throwErrorOnBrokenSymbolicLink?void n(o):void n(null,t);t.dirent=r.fs.createDirentFromStats(t.name,s),n(null,t)}):n(null,t)}}(t,n));e(p,(t,e)=>{null===t?u(s,e):a(s,t)})})}function i(n,s,i){s.fs.readdir(n,(c,l)=>{if(null!==c)return void a(i,c);const p=l.map(e=>{const i=o.joinPathSegments(n,e,s.pathSegmentSeparator);return n=>{t.stat(i,s.fsStatSettings,(t,o)=>{if(null!==t)return void n(t);const a={name:e,path:i,dirent:r.fs.createDirentFromStats(e,o)};s.stats&&(a.stats=o),n(null,a)})}});e(p,(t,e)=>{null===t?u(i,e):a(i,t)})})}function a(t,e){t(e)}function u(t,e){t(null,e)}return Gt.read=function(t,e,r){e.stats||!n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?i(t,e,r):s(t,e,r)},Gt.readdirWithFileTypes=s,Gt.readdir=i,Gt}var Se,be={};var ve,Ee,Pe,Ae={},Ce={};function xe(){return ve||(ve=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createFileSystemAdapter=t.FILE_SYSTEM_ADAPTER=void 0;const e=u;t.FILE_SYSTEM_ADAPTER={lstat:e.lstat,stat:e.stat,lstatSync:e.lstatSync,statSync:e.statSync,readdir:e.readdir,readdirSync:e.readdirSync},t.createFileSystemAdapter=function(e){return void 0===e?t.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},t.FILE_SYSTEM_ADAPTER),e)}}(Ce)),Ce}function Oe(){if(Pe)return Wt;Pe=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.Settings=Wt.scandirSync=Wt.scandir=void 0;const t=Re(),e=function(){if(Se)return be;Se=1,Object.defineProperty(be,"__esModule",{value:!0}),be.readdir=be.readdirWithFileTypes=be.read=void 0;const t=se(),e=ce(),n=de(),r=me();function o(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(o=>{const s={dirent:o,name:o.name,path:r.joinPathSegments(t,o.name,e.pathSegmentSeparator)};if(s.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{const t=e.fs.statSync(s.path);s.dirent=n.fs.createDirentFromStats(s.name,t)}catch(t){if(e.throwErrorOnBrokenSymbolicLink)throw t}return s})}function s(e,o){return o.fs.readdirSync(e).map(s=>{const i=r.joinPathSegments(e,s,o.pathSegmentSeparator),a=t.statSync(i,o.fsStatSettings),u={name:s,path:i,dirent:n.fs.createDirentFromStats(s,a)};return o.stats&&(u.stats=a),u})}return be.read=function(t,n){return!n.stats&&e.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(t,n):s(t,n)},be.readdirWithFileTypes=o,be.readdir=s,be}(),n=function(){if(Ee)return Ae;Ee=1,Object.defineProperty(Ae,"__esModule",{value:!0});const t=o,e=se(),n=xe();return Ae.default=class{constructor(r={}){this._options=r,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=n.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new e.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,e){return null!=t?t:e}},Ae}();function r(t={}){return t instanceof n.default?t:new n.default(t)}return Wt.Settings=n.default,Wt.scandir=function(e,n,o){"function"!=typeof n?t.read(e,r(n),o):t.read(e,r(),n)},Wt.scandirSync=function(t,n){const o=r(n);return e.read(t,o)},Wt}var Te,we,ke,$e={exports:{}};function Le(){if(ke)return $e.exports;ke=1;var t=we?Te:(we=1,Te=function(t){var e=new t,n=e;return{get:function(){var r=e;return r.next?e=r.next:(e=new t,n=e),r.next=null,r},release:function(t){n.next=t,n=t}}});function e(e,o,s){if("function"==typeof e&&(s=o,o=e,e=null),!(s>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var i=t(r),a=null,u=null,c=0,l=null,p={push:function(t,r){var h=i.get();h.context=e,h.release=f,h.value=t,h.callback=r||n,h.errorHandler=l,c>=s||p.paused?u?(u.next=h,u=h):(a=h,u=h,p.saturated()):(c++,o.call(e,h.value,h.worked))},drain:n,saturated:n,pause:function(){p.paused=!0},paused:!1,get concurrency(){return s},set concurrency(t){if(!(t>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(s=t,!p.paused)for(;a&&c<s;)c++,f()},running:function(){return c},resume:function(){if(!p.paused)return;if(p.paused=!1,null===a)return c++,void f();for(;a&&c<s;)c++,f()},idle:function(){return 0===c&&0===p.length()},length:function(){var t=a,e=0;for(;t;)t=t.next,e++;return e},getQueue:function(){var t=a,e=[];for(;t;)e.push(t.value),t=t.next;return e},unshift:function(t,r){var h=i.get();h.context=e,h.release=f,h.value=t,h.callback=r||n,h.errorHandler=l,c>=s||p.paused?a?(h.next=a,a=h):(a=h,u=h,p.saturated()):(c++,o.call(e,h.value,h.worked))},empty:n,kill:function(){a=null,u=null,p.drain=n},killAndDrain:function(){a=null,u=null,p.drain(),p.drain=n},error:function(t){l=t},abort:function(){var t=a;a=null,u=null;for(;t;){var e=t.next,r=t.callback,o=t.errorHandler,s=t.value,i=t.context;t.value=null,t.callback=n,t.errorHandler=null,o&&o(new Error("abort"),s),r.call(i,new Error("abort")),t.release(t),t=e}p.drain=n}};return p;function f(t){t&&i.release(t);var n=a;n&&c<=s?p.paused?c--:(u===a&&(u=null),a=n.next,n.next=null,o.call(e,n.value,n.worked),null===u&&p.empty()):0===--c&&p.drain()}}function n(){}function r(){this.value=null,this.callback=n,this.next=null,this.release=n,this.context=null,this.errorHandler=null;var t=this;this.worked=function(e,r){var o=t.callback,s=t.errorHandler,i=t.value;t.value=null,t.callback=n,t.errorHandler&&s(e,i),o.call(t.context,e,r),t.release(t)}}return $e.exports=e,$e.exports.promise=function(t,r,o){"function"==typeof t&&(o=r,r=t,t=null);var s=e(t,function(t,e){r.call(this,t).then(function(t){e(null,t)},e)},o),i=s.push,a=s.unshift;return s.push=function(t){var e=new Promise(function(e,n){i(t,function(t,r){t?n(t):e(r)})});return e.catch(n),e},s.unshift=function(t){var e=new Promise(function(e,n){a(t,function(t,r){t?n(t):e(r)})});return e.catch(n),e},s.drained=function(){return new Promise(function(t){process.nextTick(function(){if(s.idle())t();else{var e=s.drain;s.drain=function(){"function"==typeof e&&e(),t(),s.drain=e}}})})},s},$e.exports}var Me,He={};function De(){if(Me)return He;return Me=1,Object.defineProperty(He,"__esModule",{value:!0}),He.joinPathSegments=He.replacePathSegmentSeparator=He.isAppliedFilter=He.isFatalError=void 0,He.isFatalError=function(t,e){return null===t.errorFilter||!t.errorFilter(e)},He.isAppliedFilter=function(t,e){return null===t||t(e)},He.replacePathSegmentSeparator=function(t,e){return t.split(/[/\\]/).join(e)},He.joinPathSegments=function(t,e,n){return""===t?e:t.endsWith(n)?t+e:t+n+e},He}var Fe,je,Ne,Ie={};function Be(){if(Fe)return Ie;Fe=1,Object.defineProperty(Ie,"__esModule",{value:!0});const t=De();return Ie.default=class{constructor(e,n){this._root=e,this._settings=n,this._root=t.replacePathSegmentSeparator(e,n.pathSegmentSeparator)}},Ie}function We(){if(je)return Bt;je=1,Object.defineProperty(Bt,"__esModule",{value:!0});const t=a,e=Oe(),n=Le(),r=De(),o=Be();class s extends o.default{constructor(r,o){super(r,o),this._settings=o,this._scandir=e.scandir,this._emitter=new t.EventEmitter,this._queue=n(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(t){this._emitter.on("entry",t)}onError(t){this._emitter.once("error",t)}onEnd(t){this._emitter.once("end",t)}_pushToQueue(t,e){const n={directory:t,base:e};this._queue.push(n,t=>{null!==t&&this._handleError(t)})}_worker(t,e){this._scandir(t.directory,this._settings.fsScandirSettings,(n,r)=>{if(null===n){for(const e of r)this._handleEntry(e,t.base);e(null,void 0)}else e(n,void 0)})}_handleError(t){!this._isDestroyed&&r.isFatalError(this._settings,t)&&(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",t))}_handleEntry(t,e){if(this._isDestroyed||this._isFatalError)return;const n=t.path;void 0!==e&&(t.path=r.joinPathSegments(e,t.name,this._settings.pathSegmentSeparator)),r.isAppliedFilter(this._settings.entryFilter,t)&&this._emitEntry(t),t.dirent.isDirectory()&&r.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,void 0===e?void 0:t.path)}_emitEntry(t){this._emitter.emit("entry",t)}}return Bt.default=s,Bt}var Ge,Ue={};var Ke,Ve,qe={},Qe={};function Xe(){if(Ve)return qe;Ve=1,Object.defineProperty(qe,"__esModule",{value:!0});const t=function(){if(Ke)return Qe;Ke=1,Object.defineProperty(Qe,"__esModule",{value:!0});const t=Oe(),e=De(),n=Be();class r extends n.default{constructor(){super(...arguments),this._scandir=t.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(t,e){this._queue.add({directory:t,base:e})}_handleQueue(){for(const t of this._queue.values())this._handleDirectory(t.directory,t.base)}_handleDirectory(t,e){try{const n=this._scandir(t,this._settings.fsScandirSettings);for(const t of n)this._handleEntry(t,e)}catch(t){this._handleError(t)}}_handleError(t){if(e.isFatalError(this._settings,t))throw t}_handleEntry(t,n){const r=t.path;void 0!==n&&(t.path=e.joinPathSegments(n,t.name,this._settings.pathSegmentSeparator)),e.isAppliedFilter(this._settings.entryFilter,t)&&this._pushToStorage(t),t.dirent.isDirectory()&&e.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(r,void 0===n?void 0:t.path)}_pushToStorage(t){this._storage.push(t)}}return Qe.default=r,Qe}();return qe.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings)}read(){return this._reader.read()}},qe}var Ye,ze,Ze={};function Je(){if(ze)return Nt;ze=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.Settings=Nt.walkStream=Nt.walkSync=Nt.walk=void 0;const t=function(){if(Ne)return It;Ne=1,Object.defineProperty(It,"__esModule",{value:!0});const t=We();return It.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings),this._storage=[]}read(t){this._reader.onError(e=>{!function(t,e){t(e)}(t,e)}),this._reader.onEntry(t=>{this._storage.push(t)}),this._reader.onEnd(()=>{!function(t,e){t(null,e)}(t,this._storage)}),this._reader.read()}},It}(),e=function(){if(Ge)return Ue;Ge=1,Object.defineProperty(Ue,"__esModule",{value:!0});const t=i,e=We();return Ue.default=class{constructor(n,r){this._root=n,this._settings=r,this._reader=new e.default(this._root,this._settings),this._stream=new t.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(t=>{this._stream.emit("error",t)}),this._reader.onEntry(t=>{this._stream.push(t)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}},Ue}(),n=Xe(),r=function(){if(Ye)return Ze;Ye=1,Object.defineProperty(Ze,"__esModule",{value:!0});const t=o,e=Oe();return Ze.default=class{constructor(n={}){this._options=n,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.fsScandirSettings=new e.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(t,e){return null!=t?t:e}},Ze}();function s(t={}){return t instanceof r.default?t:new r.default(t)}return Nt.Settings=r.default,Nt.walk=function(e,n,r){"function"!=typeof n?new t.default(e,s(n)).read(r):new t.default(e,s()).read(n)},Nt.walkSync=function(t,e){const r=s(e);return new n.default(t,r).read()},Nt.walkStream=function(t,n){const r=s(n);return new e.default(t,r).read()},Nt}var tn,en={};function nn(){if(tn)return en;tn=1,Object.defineProperty(en,"__esModule",{value:!0});const t=o,e=se(),n=Ht();return en.default=class{constructor(t){this._settings=t,this._fsStatSettings=new e.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return t.resolve(this._settings.cwd,e)}_makeEntry(t,e){const r={name:e,path:e,dirent:n.fs.createDirentFromStats(e,t)};return this._settings.stats&&(r.stats=t),r}_isFatalError(t){return!n.errno.isEnoentCodeError(t)&&!this._settings.suppressErrors}},en}var rn,on,sn={};function an(){if(rn)return sn;rn=1,Object.defineProperty(sn,"__esModule",{value:!0});const t=i,e=se(),n=Je(),r=nn();class o extends r.default{constructor(){super(...arguments),this._walkStream=n.walkStream,this._stat=e.stat}dynamic(t,e){return this._walkStream(t,e)}static(e,n){const r=e.map(this._getFullEntryPath,this),o=new t.PassThrough({objectMode:!0});o._write=(t,s,i)=>this._getEntry(r[t],e[t],n).then(e=>{null!==e&&n.entryFilter(e)&&o.push(e),t===r.length-1&&o.end(),i()}).catch(i);for(let t=0;t<r.length;t++)o.write(t);return o}_getEntry(t,e,n){return this._getStat(t).then(t=>this._makeEntry(t,e)).catch(t=>{if(n.errorFilter(t))return null;throw t})}_getStat(t){return new Promise((e,n)=>{this._stat(t,this._fsStatSettings,(t,r)=>null===t?e(r):n(t))})}}return sn.default=o,sn}var un,cn,ln,pn={},fn={},hn={},dn={};function gn(){if(cn)return hn;cn=1,Object.defineProperty(hn,"__esModule",{value:!0});const t=function(){if(un)return dn;un=1,Object.defineProperty(dn,"__esModule",{value:!0});const t=Ht();return dn.default=class{constructor(t,e,n){this._patterns=t,this._settings=e,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(const t of this._patterns){const e=this._getPatternSegments(t),n=this._splitSegmentsIntoSections(e);this._storage.push({complete:n.length<=1,pattern:t,segments:e,sections:n})}}_getPatternSegments(e){return t.pattern.getPatternParts(e,this._micromatchOptions).map(e=>t.pattern.isDynamicPattern(e,this._settings)?{dynamic:!0,pattern:e,patternRe:t.pattern.makeRe(e,this._micromatchOptions)}:{dynamic:!1,pattern:e})}_splitSegmentsIntoSections(e){return t.array.splitWhen(e,e=>e.dynamic&&t.pattern.hasGlobStar(e.pattern))}},dn}();class e extends t.default{match(t){const e=t.split("/"),n=e.length,r=this._storage.filter(t=>!t.complete||t.segments.length>n);for(const t of r){const r=t.sections[0];if(!t.complete&&n>r.length)return!0;if(e.every((e,n)=>{const r=t.segments[n];return!(!r.dynamic||!r.patternRe.test(e))||!r.dynamic&&r.pattern===e}))return!0}return!1}}return hn.default=e,hn}var _n,yn={};var mn,Rn={};var Sn,bn,vn,En={};function Pn(){if(bn)return pn;bn=1,Object.defineProperty(pn,"__esModule",{value:!0});const t=o,e=function(){if(ln)return fn;ln=1,Object.defineProperty(fn,"__esModule",{value:!0});const t=Ht(),e=gn();return fn.default=class{constructor(t,e){this._settings=t,this._micromatchOptions=e}getFilter(t,e,n){const r=this._getMatcher(e),o=this._getNegativePatternsRe(n);return e=>this._filter(t,e,r,o)}_getMatcher(t){return new e.default(t,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){const n=e.filter(t.pattern.isAffectDepthOfReadingPattern);return t.pattern.convertPatternsToRe(n,this._micromatchOptions)}_filter(e,n,r,o){if(this._isSkippedByDeep(e,n.path))return!1;if(this._isSkippedSymbolicLink(n))return!1;const s=t.path.removeLeadingDotSegment(n.path);return!this._isSkippedByPositivePatterns(s,r)&&this._isSkippedByNegativePatterns(s,o)}_isSkippedByDeep(t,e){return this._settings.deep!==1/0&&this._getEntryLevel(t,e)>=this._settings.deep}_getEntryLevel(t,e){const n=e.split("/").length;return""===t?n:n-t.split("/").length}_isSkippedSymbolicLink(t){return!this._settings.followSymbolicLinks&&t.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(t,e){return!this._settings.baseNameMatch&&!e.match(t)}_isSkippedByNegativePatterns(e,n){return!t.pattern.matchAny(e,n)}},fn}(),n=function(){if(_n)return yn;_n=1,Object.defineProperty(yn,"__esModule",{value:!0});const t=Ht();return yn.default=class{constructor(t,e){this._settings=t,this._micromatchOptions=e,this.index=new Map}getFilter(e,n){const[r,o]=t.pattern.partitionAbsoluteAndRelative(n),s={positive:{all:t.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:t.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:t.pattern.convertPatternsToRe(o,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return t=>this._filter(t,s)}_filter(e,n){const r=t.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(r))return!1;if(this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;const o=this._isMatchToPatternsSet(r,n,e.dirent.isDirectory());return this._settings.unique&&o&&this._createIndexRecord(r),o}_isDuplicateEntry(t){return this.index.has(t)}_createIndexRecord(t){this.index.set(t,void 0)}_onlyFileFilter(t){return this._settings.onlyFiles&&!t.dirent.isFile()}_onlyDirectoryFilter(t){return this._settings.onlyDirectories&&!t.dirent.isDirectory()}_isMatchToPatternsSet(t,e,n){return!!this._isMatchToPatterns(t,e.positive.all,n)&&(!this._isMatchToPatterns(t,e.negative.relative,n)&&!this._isMatchToAbsoluteNegative(t,e.negative.absolute,n))}_isMatchToAbsoluteNegative(e,n,r){if(0===n.length)return!1;const o=t.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(o,n,r)}_isMatchToPatterns(e,n,r){if(0===n.length)return!1;const o=t.pattern.matchAny(e,n);return!o&&r?t.pattern.matchAny(e+"/",n):o}},yn}(),r=function(){if(mn)return Rn;mn=1,Object.defineProperty(Rn,"__esModule",{value:!0});const t=Ht();return Rn.default=class{constructor(t){this._settings=t}getFilter(){return t=>this._isNonFatalError(t)}_isNonFatalError(e){return t.errno.isEnoentCodeError(e)||this._settings.suppressErrors}},Rn}(),s=function(){if(Sn)return En;Sn=1,Object.defineProperty(En,"__esModule",{value:!0});const t=Ht();return En.default=class{constructor(t){this._settings=t}getTransformer(){return t=>this._transform(t)}_transform(e){let n=e.path;return this._settings.absolute&&(n=t.path.makeAbsolute(this._settings.cwd,n),n=t.path.unixify(n)),this._settings.markDirectories&&e.dirent.isDirectory()&&(n+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:n}):n}},En}();return pn.default=class{constructor(t){this._settings=t,this.errorFilter=new r.default(this._settings),this.entryFilter=new n.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new e.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new s.default(this._settings)}_getRootDirectory(e){return t.resolve(this._settings.cwd,e.base)}_getReaderOptions(t){const e="."===t.base?"":t.base;return{basePath:e,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(e,t.positive,t.negative),entryFilter:this.entryFilter.getFilter(t.positive,t.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}},pn}function An(){if(vn)return Ft;vn=1,Object.defineProperty(Ft,"__esModule",{value:!0});const t=function(){if(on)return jt;on=1,Object.defineProperty(jt,"__esModule",{value:!0});const t=Je(),e=nn(),n=an();class r extends e.default{constructor(){super(...arguments),this._walkAsync=t.walk,this._readerStream=new n.default(this._settings)}dynamic(t,e){return new Promise((n,r)=>{this._walkAsync(t,e,(t,e)=>{null===t?n(e):r(t)})})}async static(t,e){const n=[],r=this._readerStream.static(t,e);return new Promise((t,e)=>{r.once("error",e),r.on("data",t=>n.push(t)),r.once("end",()=>t(n))})}}return jt.default=r,jt}(),e=Pn();class n extends e.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}async read(t){const e=this._getRootDirectory(t),n=this._getReaderOptions(t);return(await this.api(e,t,n)).map(t=>n.transform(t))}api(t,e,n){return e.dynamic?this._reader.dynamic(t,n):this._reader.static(e.patterns,n)}}return Ft.default=n,Ft}var Cn,xn={};var On,Tn,wn={},kn={};function $n(){if(Tn)return wn;Tn=1,Object.defineProperty(wn,"__esModule",{value:!0});const t=function(){if(On)return kn;On=1,Object.defineProperty(kn,"__esModule",{value:!0});const t=se(),e=Je(),n=nn();class r extends n.default{constructor(){super(...arguments),this._walkSync=e.walkSync,this._statSync=t.statSync}dynamic(t,e){return this._walkSync(t,e)}static(t,e){const n=[];for(const r of t){const t=this._getFullEntryPath(r),o=this._getEntry(t,r,e);null!==o&&e.entryFilter(o)&&n.push(o)}return n}_getEntry(t,e,n){try{const n=this._getStat(t);return this._makeEntry(n,e)}catch(t){if(n.errorFilter(t))return null;throw t}}_getStat(t){return this._statSync(t,this._fsStatSettings)}}return kn.default=r,kn}(),e=Pn();class n extends e.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}read(t){const e=this._getRootDirectory(t),n=this._getReaderOptions(t);return this.api(e,t,n).map(n.transform)}api(t,e,n){return e.dynamic?this._reader.dynamic(t,n):this._reader.static(e.patterns,n)}}return wn.default=n,wn}var Ln,Mn,Hn,Dn={};async function Fn(t,r){const o=n.dirname(t);await e.promises.mkdir(o,{recursive:!0}),await e.promises.writeFile(t,r,"utf-8")}!function(){if(Hn)return Mn;Hn=1;const t=function(){if($t)return l;$t=1,Object.defineProperty(l,"__esModule",{value:!0}),l.convertPatternGroupToTask=l.convertPatternGroupsToTasks=l.groupPatternsByBaseDirectory=l.getNegativePatternsAsPositive=l.getPositivePatterns=l.convertPatternsToTasks=l.generate=void 0;const t=Ht();function e(e,n){let r=e;return n.braceExpansion&&(r=t.pattern.expandPatternsWithBraceExpansion(r)),n.baseNameMatch&&(r=r.map(t=>t.includes("/")?t:`**/${t}`)),r.map(e=>t.pattern.removeDuplicateSlashes(e))}function n(e,n,r){const o=[],u=t.pattern.getPatternsOutsideCurrentDirectory(e),c=t.pattern.getPatternsInsideCurrentDirectory(e),l=s(u),p=s(c);return o.push(...i(l,n,r)),"."in p?o.push(a(".",c,n,r)):o.push(...i(p,n,r)),o}function r(e){return t.pattern.getPositivePatterns(e)}function o(e,n){return t.pattern.getNegativePatterns(e).concat(n).map(t.pattern.convertToPositivePattern)}function s(e){return e.reduce((e,n)=>{const r=t.pattern.getBaseDirectory(n);return r in e?e[r].push(n):e[r]=[n],e},{})}function i(t,e,n){return Object.keys(t).map(r=>a(r,t[r],e,n))}function a(e,n,r,o){return{dynamic:o,positive:n,negative:r,base:e,patterns:[].concat(n,r.map(t.pattern.convertToNegativePattern))}}return l.generate=function(s,i){const a=e(s,i),u=e(i.ignore,i),c=r(a),l=o(a,u),p=c.filter(e=>t.pattern.isStaticPattern(e,i)),f=c.filter(e=>t.pattern.isDynamicPattern(e,i)),h=n(p,l,!1),d=n(f,l,!0);return h.concat(d)},l.convertPatternsToTasks=n,l.getPositivePatterns=r,l.getNegativePatternsAsPositive=o,l.groupPatternsByBaseDirectory=s,l.convertPatternGroupsToTasks=i,l.convertPatternGroupToTask=a,l}(),e=An(),n=function(){if(Cn)return xn;Cn=1,Object.defineProperty(xn,"__esModule",{value:!0});const t=i,e=an(),n=Pn();class r extends n.default{constructor(){super(...arguments),this._reader=new e.default(this._settings)}read(e){const n=this._getRootDirectory(e),r=this._getReaderOptions(e),o=this.api(n,e,r),s=new t.Readable({objectMode:!0,read:()=>{}});return o.once("error",t=>s.emit("error",t)).on("data",t=>s.emit("data",r.transform(t))).once("end",()=>s.emit("end")),s.once("close",()=>o.destroy()),s}api(t,e,n){return e.dynamic?this._reader.dynamic(t,n):this._reader.static(e.patterns,n)}}return xn.default=r,xn}(),o=$n(),s=(Ln||(Ln=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;const e=u,n=r,o=Math.max(n.cpus().length,1);t.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:e.lstat,lstatSync:e.lstatSync,stat:e.stat,statSync:e.statSync,readdir:e.readdir,readdirSync:e.readdirSync},t.default=class{constructor(t={}){this._options=t,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,o),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(t,e){return void 0===t?e:t}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},t.DEFAULT_FILE_SYSTEM_ADAPTER),e)}}}(Dn)),Dn),a=Ht();async function c(t,n){f(t);const r=p(t,e.default,n),o=await Promise.all(r);return a.array.flatten(o)}function p(e,n,r){const o=[].concat(e),i=new s.default(r),a=t.generate(o,i),u=new n(i);return a.map(u.read,u)}function f(t){if(![].concat(t).every(t=>a.string.isString(t)&&!a.string.isEmpty(t)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}(function(e){function r(t,e){f(t);const n=p(t,o.default,e);return a.array.flatten(n)}function i(t,e){f(t);const r=p(t,n.default,e);return a.stream.merge(r)}var u,c;e.glob=e,e.globSync=r,e.globStream=i,e.async=e,e.sync=r,e.stream=i,e.generateTasks=function(e,n){f(e);const r=[].concat(e),o=new s.default(n);return t.generate(r,o)},e.isDynamicPattern=function(t,e){f(t);const n=new s.default(e);return a.pattern.isDynamicPattern(t,n)},e.escapePath=function(t){return f(t),a.path.escape(t)},e.convertPathToPattern=function(t){return f(t),a.path.convertPathToPattern(t)},(u=e.posix||(e.posix={})).escapePath=function(t){return f(t),a.path.escapePosixPath(t)},u.convertPathToPattern=function(t){return f(t),a.path.convertPosixPathToPattern(t)},(c=e.win32||(e.win32={})).escapePath=function(t){return f(t),a.path.escapeWindowsPath(t)},c.convertPathToPattern=function(t){return f(t),a.path.convertWindowsPathToPattern(t)}})(c||(c={})),Mn=c}();exports.generateReactRoutesHMR=(t,r,o,s,i)=>{const a=n.resolve(r,t);if(!e.existsSync(a))throw new Error(`[ono-auto-router] Pages directory does not exist: ${a}`);const u=o.split(".")[0],c=(t=>`// Auto-generated by ono-auto-router${t?"\nexport { defineConfig } from './defineConfig'":""}\nexport { routes } from './getRoutes'\n`)(i),l=s?((t,e)=>`// Auto-generated by ono-auto-router${e?"\nimport {\n lazy,\n Suspense,\n type ComponentType,\n type JSX,\n type LazyExoticComponent\n} from 'react'\nimport type { RouteObject } from 'react-router'\nimport { replaceBracketsWithColon } from './utils'\n\ntype PageComponent = Record<\n string,\n () => Promise<{ default: ComponentType<unknown> }>\n>\n\ninterface MyRouteObject extends Omit<RouteObject, 'path' | 'children'> {\n path: string\n type?: 'single' | 'wrap'\n children?: MyRouteObject[]\n}\n\nexport interface PageConfig extends Partial<Omit<MyRouteObject, 'children'>> {\n loading?: JSX.Element | true\n}\n":"\nimport { replaceBracketsWithColon } from './utils'\n"}\nconst PATH_REPLACEMENTS${e?": Record<string, string>":""} = {\n '/home': '/',\n '/root': '/'\n}\n\nconst cachedLazyComponents${e?": Record<\n string,\n LazyExoticComponent<ComponentType<unknown>>\n>":""} = {}\n\nconst getConfigFileName = (pagePath: string): string => {\n if (pagePath.endsWith('.tsx')) {\n return pagePath.slice(0, -4) + '.config.ts'\n }\n return pagePath.replace('index.ts', 'index.config.ts')\n}\n\nconst formatPageModule = (${e?"\n pageComponent: Record<string, ComponentType<unknown>>,\n pagesModule: Record<string, PageConfig>\n":"pageComponent, pagesModule"})${e?": [string, PageConfig][]":""} => {\n return Object.keys(pageComponent).map(page => {\n const configKey = getConfigFileName(page)\n return [configKey, pagesModule[configKey] || {}]\n })\n}\n\nconst normalizePath = ${e?"(pathStr: string): string":"(pathStr)"} => {\n if (PATH_REPLACEMENTS[pathStr]) {\n return PATH_REPLACEMENTS[pathStr]\n }\n\n const lowerPath = pathStr.toLowerCase()\n if (lowerPath === '/notfound' || pathStr === '/404') {\n return '/*'\n }\n\n return pathStr\n}\n\nconst getBasename = ${e?"(filePath: string, ext?: string): string":"(filePath, ext)"} => {\n const parts = filePath.split('/')\n const lastPart = parts[parts.length - 1]\n if (ext && lastPart.endsWith(ext)) {\n return lastPart.slice(0, -ext.length)\n }\n return lastPart\n}\n\nconst getDirname = ${e?"(filePath: string): string":"(filePath)"} => {\n const parts = filePath.split('/')\n parts.pop()\n return parts.join('/')\n}\n\nconst getCompPathFromConfig = ${e?"(configPath: string): string":"(configPath)"} => {\n if (configPath.endsWith('.config.ts')) {\n const fileName = getBasename(configPath, '.config.ts')\n if (fileName === 'index') {\n return configPath.replace('index.config.ts', 'index.tsx')\n }\n return configPath.slice(0, -10) + '.tsx'\n }\n return configPath.replace('index.config.ts', 'index.tsx')\n}\n\nconst getRawPathFromConfig = ${e?"(configPath: string): string":"(configPath)"} => {\n if (configPath.endsWith('.config.ts')) {\n const fileName = getBasename(configPath, '.config.ts')\n const dirPath = getDirname(configPath).replace('/${t}', '')\n if (fileName === 'index') {\n return dirPath || '/'\n }\n return dirPath ? dirPath + '/' + fileName : '/' + fileName\n }\n return (\n configPath.replace('/${t}', '').replace('/index.config.ts', '') || '/'\n )\n}\n\nconst getFileDefault = ${e?"(modules: Record<string, { default: unknown }>)":"(modules)"} => {\n const result${e?": Record<string, unknown>":""} = {}\n\n for (const [path, module] of Object.entries(modules)) {\n if ('default' in module) {\n result[path] = module.default\n }\n }\n\n return result\n}\n\nconst filterUnComponent = ${e?"(pageComponent: PageComponent)":"(pageComponent)"} => {\n const result: PageComponent = {}\n\n for (const key of Object.keys(pageComponent)) {\n if (!key.includes('.config.tsx')) {\n result[key] = pageComponent[key]\n }\n }\n\n return result\n}\n\nconst LazyComponent = ({\n Element\n}:${e?" {\n Element: LazyExoticComponent<ComponentType<unknown>>\n}":""}) => {\n return (\n <Suspense>\n <Element />\n </Suspense>\n )\n}\n\nexport const createBaseRoutes = () => {\n const pageComponent = filterUnComponent({\n ...import.meta.glob('/${t}/**/*.${e?"tsx":"jsx"}')${e?" as PageComponent":""}\n })\n\n const pageString = getFileDefault({\n ...import.meta.glob('/${t}/**/*.${e?"tsx":"jsx"}', {\n eager: true\n })\n })${e?" as Record<string, ComponentType<unknown>>":""}\n\n const pagesModule = getFileDefault({\n ...import.meta.glob('/${t}/**/*.config.${e?"ts":"js"}', {\n eager: true\n })\n })${e?" as Record<string, PageConfig>":""}\n\n const result${e?": (MyRouteObject & { isRoot?: boolean })[]":""} = []\n\n for (const [pagePath, page] of formatPageModule(pageString, pagesModule)) {\n const compPath = getCompPathFromConfig(pagePath)\n\n if (!pageComponent[compPath]) continue\n\n const rawPath = page?.path || getRawPathFromConfig(pagePath) || '/'\n const processedPath = replaceBracketsWithColon(rawPath)\n const routePath = normalizePath(processedPath)\n\n let Component: MyRouteObject['element']\n if (page?.element) {\n Component = page.element\n } else {\n if (!cachedLazyComponents[compPath]) {\n cachedLazyComponents[compPath] = lazy(pageComponent[compPath])\n }\n\n Component = <LazyComponent Element={cachedLazyComponents[compPath]} />\n }\n result.push({\n ...page,\n path: routePath,\n type: page?.type,\n isRoot: processedPath === '/root',\n element: Component\n })\n }\n\n return result\n}\n`)(t,i):((t,e)=>`// Auto-generated by ono-auto-router${e?"\nimport type { ComponentType, JSX } from 'react'\nimport type { RouteObject } from 'react-router'\nimport { replaceBracketsWithColon } from './utils'\n\ntype PageComponent = Record<string, ComponentType<unknown>>\n\ninterface MyRouteObject extends Omit<RouteObject, 'path' | 'children'> {\n path: string\n type?: 'single' | 'wrap'\n children?: MyRouteObject[]\n}\n\nexport interface PageConfig extends Partial<Omit<MyRouteObject, 'children'>> {\n loading?: JSX.Element | true\n}\n":"\nimport { replaceBracketsWithColon } from './utils'\n"}\nconst PATH_REPLACEMENTS${e?": Record<string, string>":""} = {\n '/home': '/',\n '/root': '/'\n}\n\nconst getConfigFileName = (pagePath: string): string => {\n if (pagePath.endsWith('.tsx')) {\n return pagePath.slice(0, -4) + '.config.ts'\n }\n return pagePath.replace('index.ts', 'index.config.ts')\n}\n\nconst formatPageModule = (${e?"\n pageComponent: PageComponent,\n pagesModule: Record<string, PageConfig>\n":"pageComponent, pagesModule"})${e?": [string, PageConfig][]":""} => {\n return Object.keys(pageComponent).map(page => {\n const configKey = getConfigFileName(page)\n return [configKey, pagesModule[configKey] || {}]\n })\n}\n\nconst normalizePath = ${e?"(pathStr: string): string":"(pathStr)"} => {\n if (PATH_REPLACEMENTS[pathStr]) {\n return PATH_REPLACEMENTS[pathStr]\n }\n\n const lowerPath = pathStr.toLowerCase()\n if (lowerPath === '/notfound' || pathStr === '/404') {\n return '/*'\n }\n\n return pathStr\n}\n\nconst getBasename = ${e?"(filePath: string, ext?: string): string":"(filePath, ext)"} => {\n const parts = filePath.split('/')\n const lastPart = parts[parts.length - 1]\n if (ext && lastPart.endsWith(ext)) {\n return lastPart.slice(0, -ext.length)\n }\n return lastPart\n}\n\nconst getDirname = ${e?"(filePath: string): string":"(filePath)"} => {\n const parts = filePath.split('/')\n parts.pop()\n return parts.join('/')\n}\n\nconst getCompPathFromConfig = ${e?"(configPath: string): string":"(configPath)"} => {\n if (configPath.endsWith('.config.ts')) {\n const fileName = getBasename(configPath, '.config.ts')\n if (fileName === 'index') {\n return configPath.replace('index.config.ts', 'index.tsx')\n }\n return configPath.slice(0, -10) + '.tsx'\n }\n return configPath.replace('index.config.ts', 'index.tsx')\n}\n\nconst getRawPathFromConfig = ${e?"(configPath: string): string":"(configPath)"} => {\n if (configPath.endsWith('.config.ts')) {\n const fileName = getBasename(configPath, '.config.ts')\n const dirPath = getDirname(configPath).replace('/${t}', '')\n if (fileName === 'index') {\n return dirPath || '/'\n }\n return dirPath ? dirPath + '/' + fileName : '/' + fileName\n }\n return (\n configPath.replace('/${t}', '').replace('/index.config.ts', '') || '/'\n )\n}\n\nconst getFileDefault = ${e?"(modules: Record<string, { default: unknown }>)":"(modules)"} => {\n const result: PageComponent | Record<string, PageConfig> = {}\n\n for (const [path, module] of Object.entries(modules)) {\n if ('default' in module) {\n result[path] = module.default as ComponentType<unknown> | PageConfig\n }\n }\n\n return result\n}\n\nconst filterUnComponent = ${e?"(pageComponent: PageComponent)":"(pageComponent)"} => {\n const result: PageComponent = {}\n\n for (const key of Object.keys(pageComponent)) {\n if (!key.includes('.config.tsx')) {\n result[key] = pageComponent[key]\n }\n }\n\n return result\n}\n\nexport const createBaseRoutes = () => {\n const pageComponent = filterUnComponent(\n getFileDefault({\n ...import.meta.glob('/${t}/**/*.${e?"tsx":"jsx"}', { eager: true })\n })${e?" as PageComponent":""}\n )\n\n const pagesModule = getFileDefault({\n ...import.meta.glob('/${t}/**/*.config.${e?"ts":"js"}', {\n eager: true\n })\n })${e?" as Record<string, PageConfig>":""}\n\n const result${e?": (MyRouteObject & { isRoot?: boolean })[]":""} = []\n\n for (const [pagePath, page] of formatPageModule(pageComponent, pagesModule)) {\n const compPath = getCompPathFromConfig(pagePath)\n\n if (!pageComponent[compPath]) continue\n\n const rawPath = page?.path || getRawPathFromConfig(pagePath) || '/'\n const processedPath = replaceBracketsWithColon(rawPath)\n const routePath = normalizePath(processedPath)\n\n const Component = pageComponent[compPath]\n result.push({\n ...page,\n path: routePath,\n type: page?.type,\n isRoot: processedPath === '/root',\n element: <Component />\n })\n }\n\n return result\n}\n`)(t,i),p=(t=>`// Auto-generated by ono-auto-router\nimport { hasDuplicateProperty } from './utils'\nimport { buildRouteTree } from './buildRouteTree'\nimport { cleanIsRoot } from './cleanIsRoot'\nimport { removeEmptyChildren } from './removeEmptyChildren'${t?"\nimport type { MyRouteObject } from './types'":""}\n\nconst processRoute = ${t?"(route: MyRouteObject): MyRouteObject":"(route)"} =>\n cleanIsRoot(removeEmptyChildren(route))\n\nconst processRoutes = ${t?"(routes: MyRouteObject[]): MyRouteObject[]":"(routes)"} =>\n buildRouteTree(routes).map(processRoute)\n\nconst handleRootRoute = ${t?"(routes: (MyRouteObject & { isRoot?: boolean })[])":"(routes)"} => {\n let rootRoute${t?": MyRouteObject | undefined":" = undefined"}\n let homeRoute${t?": MyRouteObject | undefined":" = undefined"}\n let notFoundRoute${t?": MyRouteObject | undefined":" = undefined"}\n const filteredRoutes${t?": MyRouteObject[]":""} = []\n\n for (const route of routes) {\n if (route.isRoot) {\n if (rootRoute)\n throw new Error('There cannot be multiple root routes in a route')\n rootRoute = route\n } else if (route.path === '/') {\n homeRoute = route\n } else if (route.path === '/*') {\n notFoundRoute = route\n } else {\n filteredRoutes.push(route)\n }\n }\n\n if (hasDuplicateProperty(filteredRoutes, 'path'))\n throw new Error('There cannot be duplicate paths in a route')\n\n const children = [\n homeRoute && { ...homeRoute, index: true },\n ...processRoutes(filteredRoutes)\n ].filter((route): route is NonNullable<typeof route> => Boolean(route))\n\n const result${t?": MyRouteObject[]":""} = []\n\n if (rootRoute) {\n result.push(cleanIsRoot({ ...rootRoute, children }))\n }\n\n if (notFoundRoute) {\n result.push(cleanIsRoot(notFoundRoute))\n }\n\n return result\n}\n\nexport const formatRoutes = (\n routes${t?": (MyRouteObject & { isRoot?: boolean })[]":""}\n) => {\n if (routes.some(r => r.isRoot)) return handleRootRoute(routes)\n\n if (hasDuplicateProperty(routes, 'path'))\n throw new Error('There cannot be duplicate paths in a route')\n\n return processRoutes(routes)\n}\n`)(i),f=(t=>`// Auto-generated by ono-auto-router${t?"\nimport type { MyRouteObject } from './types'\n":""}\nconst processSingleRoute = ${t?"(route: MyRouteObject): MyRouteObject":"(route)"} => {\n if (route.index) {\n return route\n }\n\n if (route.type !== 'wrap') {\n const { path: routePath, children, ...extraProps } = route\n const hasExtraProps = Object.keys(extraProps).length > 0\n\n if (hasExtraProps) {\n const indexRoute: MyRouteObject = {\n path: '',\n index: true,\n ...extraProps\n }\n\n return {\n path: routePath,\n children: [indexRoute, ...(children || []).map(processSingleRoute)]\n }\n }\n }\n\n if (route.children) {\n return {\n ...route,\n children: route.children.map(processSingleRoute)\n }\n }\n\n return route\n}\n\nconst formatRouteTree = ${t?"(routes: MyRouteObject[]): MyRouteObject[]":"(routes)"} => {\n return routes.map(processSingleRoute)\n}\n\nconst buildTreeStructure = ${t?"(routes: MyRouteObject[]): MyRouteObject[]":"(routes)"} => {\n const routeMap = new Map${t?"<string, MyRouteObject>":""}()\n const rootRoutes${t?": MyRouteObject[]":""} = []\n const pathPartsCache = new Map${t?"<string, string[]>":""}()\n\n const getPathParts = ${t?"(pathStr: string): string[]":"(pathStr)"} => {\n let parts = pathPartsCache.get(pathStr)\n if (parts === undefined) {\n parts = pathStr === '/' ? [] : pathStr.split('/').filter(Boolean)\n pathPartsCache.set(pathStr, parts)\n }\n return parts\n }\n\n const sortedRoutes = routes\n .slice()\n .sort((a, b) => a.path.length - b.path.length)\n\n for (const route of sortedRoutes) {\n const routePath = route.path\n const pathParts = getPathParts(routePath)\n const currentRoute = { ...route, children: [] }\n routeMap.set(routePath, currentRoute)\n\n if (pathParts.length <= 1) {\n rootRoutes.push(currentRoute)\n continue\n }\n\n const parentPath = '/' + pathParts.slice(0, -1).join('/')\n const parentRoute = routeMap.get(parentPath)\n\n if (parentRoute) {\n currentRoute.path = pathParts[pathParts.length - 1]\n parentRoute.children!.push(currentRoute)\n } else {\n rootRoutes.push(currentRoute)\n }\n }\n\n return rootRoutes\n}\n\nexport const buildRouteTree = ${t?"(routes: MyRouteObject[]): MyRouteObject[]":"(routes)"} => {\n const treeStructure = buildTreeStructure(routes)\n return formatRouteTree(treeStructure)\n}\n`)(i),h=(t=>`// Auto-generated by ono-auto-router${t?"\nimport type { MyRouteObject } from './types'\n\ntype RouteWithIsRoot = MyRouteObject & { isRoot?: boolean }\n":""}\nexport const cleanIsRoot = ${t?"(route: RouteWithIsRoot): MyRouteObject":"(route)"} => {\n const { isRoot, type, children, ...rest } = route as RouteWithIsRoot & {\n type?: unknown\n }\n\n if (!children?.length) {\n return rest\n }\n\n return {\n ...rest,\n children: children.map(cleanIsRoot)\n }\n}\n`)(i),d=(t=>`// Auto-generated by ono-auto-router${t?"\nimport type { MyRouteObject } from './types'\n":""}\nexport const removeEmptyChildren = ${t?"(route: MyRouteObject): MyRouteObject":"(route)"} => {\n const { children } = route\n\n if (!children?.length) {\n const { children: _, ...rest } = route\n return rest\n }\n\n const processedChildren = children.map(removeEmptyChildren)\n\n if (route.type === 'wrap') {\n return { ...route, children: processedChildren }\n }\n\n const { path, element, type, children: _, ...rest } = route\n\n if (!element) {\n return { path, ...rest, children: processedChildren }\n }\n\n return {\n path,\n children: [\n { index: true, element, ...rest } as MyRouteObject,\n ...processedChildren\n ]\n }\n}\n`)(i),g=i?"// Auto-generated by ono-auto-router\nimport type { PageConfig } from './types'\nexport const defineConfig = (config: PageConfig) => config\n":"",_=(t=>`// Auto-generated by ono-auto-router${t?"\nimport type { RouteObject } from 'react-router'":""}\nimport { createBaseRoutes } from './createBaseRoutes'\nimport { formatRoutes } from './formatRoutes'\n\nconst getRoutes = () => {\n const baseRoutes = createBaseRoutes()\n const formattedRoutes = formatRoutes(baseRoutes)${t?" as RouteObject[]":""}\n return formattedRoutes\n}\n\nexport const routes = getRoutes()\n`)(i),y=i?(t=>`// Auto-generated by ono-auto-router\nimport type { ComponentType, JSX } from 'react'\nimport type { RouteObject } from 'react-router'\n\n${t?"export type PageComponentLazy = Record<\n string,\n () => Promise<{ default: ComponentType<unknown> }>\n>":"export type PageComponent = Record<string, ComponentType<unknown>>"}\n\nexport interface MyRouteObject extends Omit<RouteObject, 'path' | 'children'> {\n path: string\n type?: 'single' | 'wrap'\n children?: MyRouteObject[]\n}\n\nexport type PageConfig = Partial<\n Omit<MyRouteObject, 'Component' | 'element' | 'children'>\n>\n`)(s):"",m=(t=>`// Auto-generated by ono-auto-router\nexport const hasDuplicateProperty = ${t?"<T>(items: T[], propName: keyof T)":"(items, propName)"} => {\n const seenValues = new Set()\n return items.some(item => {\n if (seenValues.has(item[propName])) {\n return true\n }\n seenValues.add(item[propName])\n return false\n })\n}\n\nexport const replaceBracketsWithColon = ${t?"(str: string)":"(str)"} => {\n return str.replace(/\\[([^\\]]+)\\]/g, ':$1').replace('.tsx', '')\n}\n`)(i);Fn(n.resolve(u,"./index.ts"),c),Fn(n.resolve(u,"./createBaseRoutes.tsx"),l),Fn(n.resolve(u,"./formatRoutes.ts"),p),Fn(n.resolve(u,"./buildRouteTree.ts"),f),Fn(n.resolve(u,"./cleanIsRoot.ts"),h),Fn(n.resolve(u,"./removeEmptyChildren.ts"),d),g&&Fn(n.resolve(u,"./defineConfig.ts"),g),y&&Fn(n.resolve(u,"./types.ts"),y),Fn(n.resolve(u,"./getRoutes.ts"),_),Fn(n.resolve(u,"./utils.ts"),m)};
1
+ "use strict";var t,e=require("node:fs"),n=require("node:path"),r=require("os"),o=require("path"),s=require("util"),i=require("stream"),a=require("events"),u=require("fs"),c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l={},p={},f={};function h(){if(t)return f;return t=1,Object.defineProperty(f,"__esModule",{value:!0}),f.splitWhen=f.flatten=void 0,f.flatten=function(t){return t.reduce((t,e)=>[].concat(t,e),[])},f.splitWhen=function(t,e){const n=[[]];let r=0;for(const o of t)e(o)?(r++,n[r]=[]):n[r].push(o);return n},f}var d,g={};function _(){if(d)return g;return d=1,Object.defineProperty(g,"__esModule",{value:!0}),g.isEnoentCodeError=void 0,g.isEnoentCodeError=function(t){return"ENOENT"===t.code},g}var y,m={};var R,S={};function b(){if(R)return S;R=1,Object.defineProperty(S,"__esModule",{value:!0}),S.convertPosixPathToPattern=S.convertWindowsPathToPattern=S.convertPathToPattern=S.escapePosixPath=S.escapeWindowsPath=S.escape=S.removeLeadingDotSegment=S.makeAbsolute=S.unixify=void 0;const t=o,e="win32"===r.platform(),n=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,s=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,i=/^\\\\([.?])/,a=/\\(?![!()+@[\]{}])/g;function u(t){return t.replace(s,"\\$2")}function c(t){return t.replace(n,"\\$2")}function l(t){return u(t).replace(i,"//$1").replace(a,"/")}function p(t){return c(t)}return S.unixify=function(t){return t.replace(/\\/g,"/")},S.makeAbsolute=function(e,n){return t.resolve(e,n)},S.removeLeadingDotSegment=function(t){if("."===t.charAt(0)){const e=t.charAt(1);if("/"===e||"\\"===e)return t.slice(2)}return t},S.escape=e?u:c,S.escapeWindowsPath=u,S.escapePosixPath=c,S.convertPathToPattern=e?l:p,S.convertWindowsPathToPattern=l,S.convertPosixPathToPattern=p,S}var v,E,P,A,C,x,O={};function T(){return E?v:(E=1,v=function(t){if("string"!=typeof t||""===t)return!1;for(var e;e=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(e[2])return!0;t=t.slice(e.index+e[0].length)}return!1})}function w(){if(A)return P;A=1;var t=T(),e={"{":"}","(":")","[":"]"},n=function(t){if("!"===t[0])return!0;for(var n=0,r=-2,o=-2,s=-2,i=-2,a=-2;n<t.length;){if("*"===t[n])return!0;if("?"===t[n+1]&&/[\].+)]/.test(t[n]))return!0;if(-1!==o&&"["===t[n]&&"]"!==t[n+1]&&(o<n&&(o=t.indexOf("]",n)),o>n)){if(-1===a||a>o)return!0;if(-1===(a=t.indexOf("\\",n))||a>o)return!0}if(-1!==s&&"{"===t[n]&&"}"!==t[n+1]&&(s=t.indexOf("}",n))>n&&(-1===(a=t.indexOf("\\",n))||a>s))return!0;if(-1!==i&&"("===t[n]&&"?"===t[n+1]&&/[:!=]/.test(t[n+2])&&")"!==t[n+3]&&(i=t.indexOf(")",n))>n&&(-1===(a=t.indexOf("\\",n))||a>i))return!0;if(-1!==r&&"("===t[n]&&"|"!==t[n+1]&&(r<n&&(r=t.indexOf("|",n)),-1!==r&&")"!==t[r+1]&&(i=t.indexOf(")",r))>r&&(-1===(a=t.indexOf("\\",r))||a>i)))return!0;if("\\"===t[n]){var u=t[n+1];n+=2;var c=e[u];if(c){var l=t.indexOf(c,n);-1!==l&&(n=l+1)}if("!"===t[n])return!0}else n++}return!1},r=function(t){if("!"===t[0])return!0;for(var n=0;n<t.length;){if(/[*?{}()[\]]/.test(t[n]))return!0;if("\\"===t[n]){var r=t[n+1];n+=2;var o=e[r];if(o){var s=t.indexOf(o,n);-1!==s&&(n=s+1)}if("!"===t[n])return!0}else n++}return!1};return P=function(e,o){if("string"!=typeof e||""===e)return!1;if(t(e))return!0;var s=n;return o&&!1===o.strict&&(s=r),s(e)}}function k(){if(x)return C;x=1;var t=w(),e=o.posix.dirname,n="win32"===r.platform(),s=/\\/g,i=/[\{\[].*[\}\]]$/,a=/(^|[^\\])([\{\[]|\([^\)]+$)/,u=/\\([\!\*\?\|\[\]\(\)\{\}])/g;return C=function(r,o){Object.assign({flipBackslashes:!0},o).flipBackslashes&&n&&r.indexOf("/")<0&&(r=r.replace(s,"/")),i.test(r)&&(r+="/"),r+="a";do{r=e(r)}while(t(r)||a.test(r));return r.replace(u,"$1")}}var $,L,M,H,D,F,j,N,I,B,W,G,U,K,V,q,Q,X,Y,z={};function Z(){return $||($=1,(t=z).isInteger=t=>"number"==typeof t?Number.isInteger(t):"string"==typeof t&&""!==t.trim()&&Number.isInteger(Number(t)),t.find=(t,e)=>t.nodes.find(t=>t.type===e),t.exceedsLimit=(e,n,r=1,o)=>!1!==o&&!(!t.isInteger(e)||!t.isInteger(n))&&(Number(n)-Number(e))/Number(r)>=o,t.escapeNode=(t,e=0,n)=>{const r=t.nodes[e];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},t.encloseBrace=t=>!("brace"!==t.type||t.commas>>0+t.ranges|0||(t.invalid=!0,0)),t.isInvalidBrace=t=>!("brace"!==t.type||!0!==t.invalid&&!t.dollar&&(t.commas>>0+t.ranges|0&&!0===t.open&&!0===t.close||(t.invalid=!0,0))),t.isOpenOrClose=t=>"open"===t.type||"close"===t.type||!0===t.open||!0===t.close,t.reduce=t=>t.reduce((t,e)=>("text"===e.type&&t.push(e.value),"range"===e.type&&(e.type="text"),t),[]),t.flatten=(...t)=>{const e=[],n=t=>{for(let r=0;r<t.length;r++){const o=t[r];Array.isArray(o)?n(o):void 0!==o&&e.push(o)}return e};return n(t),e}),z;var t}function J(){if(M)return L;M=1;const t=Z();return L=(e,n={})=>{const r=(e,o={})=>{const s=n.escapeInvalid&&t.isInvalidBrace(o),i=!0===e.invalid&&!0===n.escapeInvalid;let a="";if(e.value)return(s||i)&&t.isOpenOrClose(e)?"\\"+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(const t of e.nodes)a+=r(t);return a};return r(e)}}function tt(){return D?H:(D=1,H=function(t){return"number"==typeof t?t-t===0:"string"==typeof t&&""!==t.trim()&&(Number.isFinite?Number.isFinite(+t):isFinite(+t))})}function et(){if(j)return F;j=1;const t=tt(),e=(n,s,i)=>{if(!1===t(n))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===s||n===s)return String(n);if(!1===t(s))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:!0,...i};"boolean"==typeof a.strictZeros&&(a.relaxZeros=!1===a.strictZeros);let u=n+":"+s+"="+String(a.relaxZeros)+String(a.shorthand)+String(a.capture)+String(a.wrap);if(e.cache.hasOwnProperty(u))return e.cache[u].result;let c=Math.min(n,s),l=Math.max(n,s);if(1===Math.abs(c-l)){let t=n+"|"+s;return a.capture?`(${t})`:!1===a.wrap?t:`(?:${t})`}let f=p(n)||p(s),h={min:n,max:s,a:c,b:l},d=[],g=[];if(f&&(h.isPadded=f,h.maxLen=String(h.max).length),c<0){g=r(l<0?Math.abs(l):1,Math.abs(c),h,a),c=h.a=0}return l>=0&&(d=r(c,l,h,a)),h.negatives=g,h.positives=d,h.result=function(t,e){let n=o(t,e,"-",!1)||[],r=o(e,t,"",!1)||[],s=o(t,e,"-?",!0)||[];return n.concat(s).concat(r).join("|")}(g,d),!0===a.capture?h.result=`(${h.result})`:!1!==a.wrap&&d.length+g.length>1&&(h.result=`(?:${h.result})`),e.cache[u]=h,h.result};function n(t,e,n){if(t===e)return{pattern:t,count:[],digits:0};let r=function(t,e){let n=[];for(let r=0;r<t.length;r++)n.push([t[r],e[r]]);return n}(t,e),o=r.length,s="",i=0;for(let t=0;t<o;t++){let[e,n]=r[t];e===n?s+=e:"0"!==e||"9"!==n?s+=l(e,n):i++}return i&&(s+=!0===n.shorthand?"\\d":"[0-9]"),{pattern:s,count:[i],digits:o}}function r(t,e,r,o){let i,l=function(t,e){let n=1,r=1,o=a(t,n),i=new Set([e]);for(;t<=o&&o<=e;)i.add(o),n+=1,o=a(t,n);for(o=u(e+1,r)-1;t<o&&o<=e;)i.add(o),r+=1,o=u(e+1,r)-1;return i=[...i],i.sort(s),i}(t,e),p=[],h=t;for(let t=0;t<l.length;t++){let e=l[t],s=n(String(h),String(e),o),a="";r.isPadded||!i||i.pattern!==s.pattern?(r.isPadded&&(a=f(e,r,o)),s.string=a+s.pattern+c(s.count),p.push(s),h=e+1,i=s):(i.count.length>1&&i.count.pop(),i.count.push(s.count[0]),i.string=i.pattern+c(i.count),h=e+1)}return p}function o(t,e,n,r,o){let s=[];for(let o of t){let{string:t}=o;r||i(e,"string",t)||s.push(n+t),r&&i(e,"string",t)&&s.push(n+t)}return s}function s(t,e){return t>e?1:e>t?-1:0}function i(t,e,n){return t.some(t=>t[e]===n)}function a(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function u(t,e){return t-t%Math.pow(10,e)}function c(t){let[e=0,n=""]=t;return n||e>1?`{${e+(n?","+n:"")}}`:""}function l(t,e,n){return`[${t}${e-t===1?"":"-"}${e}]`}function p(t){return/^-?(0+)\d/.test(t)}function f(t,e,n){if(!e.isPadded)return t;let r=Math.abs(e.maxLen-String(t).length),o=!1!==n.relaxZeros;switch(r){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:return o?`0{0,${r}}`:`0{${r}}`}}return e.cache={},e.clearCache=()=>e.cache={},F=e}function nt(){if(I)return N;I=1;const t=s,e=et(),n=t=>null!==t&&"object"==typeof t&&!Array.isArray(t),r=t=>"number"==typeof t||"string"==typeof t&&""!==t,o=t=>Number.isInteger(+t),i=t=>{let e=`${t}`,n=-1;if("-"===e[0]&&(e=e.slice(1)),"0"===e)return!1;for(;"0"===e[++n];);return n>0},a=(t,e,n)=>{if(e>0){let n="-"===t[0]?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0")}return!1===n?String(t):t},u=(t,e)=>{let n="-"===t[0]?"-":"";for(n&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return n?"-"+t:t},c=(t,n,r,o)=>{if(r)return e(t,n,{wrap:!1,...o});let s=String.fromCharCode(t);return t===n?s:`[${s}-${String.fromCharCode(n)}]`},l=(t,n,r)=>{if(Array.isArray(t)){let e=!0===r.wrap,n=r.capture?"":"?:";return e?`(${n}${t.join("|")})`:t.join("|")}return e(t,n,r)},p=(...e)=>new RangeError("Invalid range arguments: "+t.inspect(...e)),f=(t,e,n)=>{if(!0===n.strictRanges)throw p([t,e]);return[]},h=(t,e,n=1,r={})=>{let o=Number(t),s=Number(e);if(!Number.isInteger(o)||!Number.isInteger(s)){if(!0===r.strictRanges)throw p([t,e]);return[]}0===o&&(o=0),0===s&&(s=0);let f=o>s,h=String(t),d=String(e),g=String(n);n=Math.max(Math.abs(n),1);let _=i(h)||i(d)||i(g),y=_?Math.max(h.length,d.length,g.length):0,m=!1===_&&!1===((t,e,n)=>"string"==typeof t||"string"==typeof e||!0===n.stringify)(t,e,r),R=r.transform||(t=>e=>!0===t?Number(e):String(e))(m);if(r.toRegex&&1===n)return c(u(t,y),u(e,y),!0,r);let S={negatives:[],positives:[]},b=t=>S[t<0?"negatives":"positives"].push(Math.abs(t)),v=[],E=0;for(;f?o>=s:o<=s;)!0===r.toRegex&&n>1?b(o):v.push(a(R(o,E),y,m)),o=f?o-n:o+n,E++;return!0===r.toRegex?n>1?((t,e,n)=>{t.negatives.sort((t,e)=>t<e?-1:t>e?1:0),t.positives.sort((t,e)=>t<e?-1:t>e?1:0);let r,o=e.capture?"":"?:",s="",i="";return t.positives.length&&(s=t.positives.map(t=>u(String(t),n)).join("|")),t.negatives.length&&(i=`-(${o}${t.negatives.map(t=>u(String(t),n)).join("|")})`),r=s&&i?`${s}|${i}`:s||i,e.wrap?`(${o}${r})`:r})(S,r,y):l(v,null,{wrap:!1,...r}):v},d=(t,e,s,i={})=>{if(null==e&&r(t))return[t];if(!r(t)||!r(e))return f(t,e,i);if("function"==typeof s)return d(t,e,1,{transform:s});if(n(s))return d(t,e,0,s);let a={...i};return!0===a.capture&&(a.wrap=!0),s=s||a.step||1,o(s)?o(t)&&o(e)?h(t,e,s,a):((t,e,n=1,r={})=>{if(!o(t)&&t.length>1||!o(e)&&e.length>1)return f(t,e,r);let s=r.transform||(t=>String.fromCharCode(t)),i=`${t}`.charCodeAt(0),a=`${e}`.charCodeAt(0),u=i>a,p=Math.min(i,a),h=Math.max(i,a);if(r.toRegex&&1===n)return c(p,h,!1,r);let d=[],g=0;for(;u?i>=a:i<=a;)d.push(s(i,g)),i=u?i-n:i+n,g++;return!0===r.toRegex?l(d,null,{wrap:!1,options:r}):d})(t,e,Math.max(Math.abs(s),1),a):null==s||n(s)?d(t,e,1,s):((t,e)=>{if(!0===e.strictRanges)throw new TypeError(`Expected step "${t}" to be a number`);return[]})(s,a)};return N=d}function rt(){if(Q)return q;Q=1;const t=J(),{MAX_LENGTH:e,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:i,CHAR_RIGHT_PARENTHESES:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:p,CHAR_DOUBLE_QUOTE:f,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:d,CHAR_ZERO_WIDTH_NOBREAK_SPACE:g}=V?K:(V=1,K={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return q=(_,y={})=>{if("string"!=typeof _)throw new TypeError("Expected a string");const m=y||{},R="number"==typeof m.maxLength?Math.min(e,m.maxLength):e;if(_.length>R)throw new SyntaxError(`Input length (${_.length}), exceeds max characters (${R})`);const S={type:"root",input:_,nodes:[]},b=[S];let v=S,E=S,P=0;const A=_.length;let C,x=0,O=0;const T=()=>_[x++],w=t=>{if("text"===t.type&&"dot"===E.type&&(E.type="text"),!E||"text"!==E.type||"text"!==t.type)return v.nodes.push(t),t.parent=v,t.prev=E,E=t,t;E.value+=t.value};for(w({type:"bos"});x<A;)if(v=b[b.length-1],C=T(),C!==g&&C!==d)if(C!==n)if(C!==p){if(C===l){let t;for(P++;x<A&&(t=T());)if(C+=t,t!==l)if(t!==n){if(t===p&&(P--,0===P))break}else C+=T();else P++;w({type:"text",value:C});continue}if(C!==i)if(C!==a){if(C===f||C===h||C===r){const t=C;let e;for(!0!==y.keepQuotes&&(C="");x<A&&(e=T());)if(e!==n){if(e===t){!0===y.keepQuotes&&(C+=e);break}C+=e}else C+=e+T();w({type:"text",value:C});continue}if(C===u){O++;const t=E.value&&"$"===E.value.slice(-1)||!0===v.dollar;v=w({type:"brace",open:!0,close:!1,dollar:t,depth:O,commas:0,ranges:0,nodes:[]}),b.push(v),w({type:"open",value:C});continue}if(C===c){if("brace"!==v.type){w({type:"text",value:C});continue}const t="close";v=b.pop(),v.close=!0,w({type:t,value:C}),O--,v=b[b.length-1];continue}if(C===o&&O>0){if(v.ranges>0){v.ranges=0;const e=v.nodes.shift();v.nodes=[e,{type:"text",value:t(v)}]}w({type:"comma",value:C}),v.commas++}else{if(C===s&&O>0&&0===v.commas){const t=v.nodes;if(0===O||0===t.length){w({type:"text",value:C});continue}if("dot"===E.type){if(v.range=[],E.value+=C,E.type="range",3!==v.nodes.length&&5!==v.nodes.length){v.invalid=!0,v.ranges=0,E.type="text";continue}v.ranges++,v.args=[];continue}if("range"===E.type){t.pop();const e=t[t.length-1];e.value+=E.value+C,E=e,v.ranges--;continue}w({type:"dot",value:C});continue}w({type:"text",value:C})}}else{if("paren"!==v.type){w({type:"text",value:C});continue}v=b.pop(),w({type:"text",value:C}),v=b[b.length-1]}else v=w({type:"paren",nodes:[]}),b.push(v),w({type:"text",value:C})}else w({type:"text",value:"\\"+C});else w({type:"text",value:(y.keepEscaping?C:"")+T()});do{if(v=b.pop(),"root"!==v.type){v.nodes.forEach(t=>{t.nodes||("open"===t.type&&(t.isOpen=!0),"close"===t.type&&(t.isClose=!0),t.nodes||(t.type="text"),t.invalid=!0)});const t=b[b.length-1],e=t.nodes.indexOf(v);t.nodes.splice(e,1,...v.nodes)}}while(b.length>0);return w({type:"eos"}),S}}function ot(){if(Y)return X;Y=1;const t=J(),e=function(){if(W)return B;W=1;const t=nt(),e=Z();return B=(n,r={})=>{const o=(n,s={})=>{const i=e.isInvalidBrace(s),a=!0===n.invalid&&!0===r.escapeInvalid,u=!0===i||!0===a,c=!0===r.escapeInvalid?"\\":"";let l="";if(!0===n.isOpen)return c+n.value;if(!0===n.isClose)return console.log("node.isClose",c,n.value),c+n.value;if("open"===n.type)return u?c+n.value:"(";if("close"===n.type)return u?c+n.value:")";if("comma"===n.type)return"comma"===n.prev.type?"":u?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){const o=e.reduce(n.nodes),s=t(...o,{...r,wrap:!1,toRegex:!0,strictZeros:!0});if(0!==s.length)return o.length>1&&s.length>1?`(${s})`:s}if(n.nodes)for(const t of n.nodes)l+=o(t,n);return l};return o(n)}}(),n=function(){if(U)return G;U=1;const t=nt(),e=J(),n=Z(),r=(t="",e="",o=!1)=>{const s=[];if(t=[].concat(t),!(e=[].concat(e)).length)return t;if(!t.length)return o?n.flatten(e).map(t=>`{${t}}`):e;for(const n of t)if(Array.isArray(n))for(const t of n)s.push(r(t,e,o));else for(let t of e)!0===o&&"string"==typeof t&&(t=`{${t}}`),s.push(Array.isArray(t)?r(n,t,o):n+t);return n.flatten(s)};return G=(o,s={})=>{const i=void 0===s.rangeLimit?1e3:s.rangeLimit,a=(o,u={})=>{o.queue=[];let c=u,l=u.queue;for(;"brace"!==c.type&&"root"!==c.type&&c.parent;)c=c.parent,l=c.queue;if(o.invalid||o.dollar)return void l.push(r(l.pop(),e(o,s)));if("brace"===o.type&&!0!==o.invalid&&2===o.nodes.length)return void l.push(r(l.pop(),["{}"]));if(o.nodes&&o.ranges>0){const a=n.reduce(o.nodes);if(n.exceedsLimit(...a,s.step,i))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let u=t(...a,s);return 0===u.length&&(u=e(o,s)),l.push(r(l.pop(),u)),void(o.nodes=[])}const p=n.encloseBrace(o);let f=o.queue,h=o;for(;"brace"!==h.type&&"root"!==h.type&&h.parent;)h=h.parent,f=h.queue;for(let t=0;t<o.nodes.length;t++){const e=o.nodes[t];"comma"!==e.type||"brace"!==o.type?"close"!==e.type?e.value&&"open"!==e.type?f.push(r(f.pop(),e.value)):e.nodes&&a(e,o):l.push(r(l.pop(),f,p)):(1===t&&f.push(""),f.push(""))}return f};return n.flatten(a(o))},G}(),r=rt(),o=(t,e={})=>{let n=[];if(Array.isArray(t))for(const r of t){const t=o.create(r,e);Array.isArray(t)?n.push(...t):n.push(t)}else n=[].concat(o.create(t,e));return e&&!0===e.expand&&!0===e.nodupes&&(n=[...new Set(n)]),n};return o.parse=(t,e={})=>r(t,e),o.stringify=(e,n={})=>t("string"==typeof e?o.parse(e,n):e,n),o.compile=(t,n={})=>("string"==typeof t&&(t=o.parse(t,n)),e(t,n)),o.expand=(t,e={})=>{"string"==typeof t&&(t=o.parse(t,e));let r=n(t,e);return!0===e.noempty&&(r=r.filter(Boolean)),!0===e.nodupes&&(r=[...new Set(r)]),r},o.create=(t,e={})=>""===t||t.length<3?[t]:!0!==e.expand?o.compile(t,e):o.expand(t,e),X=o}var st,it,at,ut,ct,lt,pt,ft,ht,dt,gt,_t,yt,mt,Rt={};function St(){if(it)return st;it=1;const t=o,e="\\\\/",n=`[^${e}]`,r="\\.",s="\\/",i="[^/]",a=`(?:${s}|$)`,u=`(?:^|${s})`,c=`${r}{1,2}${a}`,l={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:s,ONE_CHAR:"(?=.)",QMARK:i,END_ANCHOR:a,DOTS_SLASH:c,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${u}${c})`,NO_DOT_SLASH:`(?!${r}{0,1}${a})`,NO_DOTS_SLASH:`(?!${c})`,QMARK_NO_DOT:`[^.${s}]`,STAR:`${i}*?`,START_ANCHOR:u},p={...l,SLASH_LITERAL:`[${e}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${e}])${r}{1,2}(?:[${e}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`};return st={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:t.sep,extglobChars:t=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:t=>!0===t?p:l}}function bt(){return at||(at=1,function(t){const e=o,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:a}=St();t.isObject=t=>null!==t&&"object"==typeof t&&!Array.isArray(t),t.hasRegexChars=t=>i.test(t),t.isRegexChar=e=>1===e.length&&t.hasRegexChars(e),t.escapeRegex=t=>t.replace(a,"\\$1"),t.toPosixSlashes=t=>t.replace(r,"/"),t.removeBackslashes=t=>t.replace(s,t=>"\\"===t?"":t),t.supportsLookbehinds=()=>{const t=process.version.slice(1).split(".").map(Number);return 3===t.length&&t[0]>=9||8===t[0]&&t[1]>=10},t.isWindows=t=>t&&"boolean"==typeof t.windows?t.windows:!0===n||"\\"===e.sep,t.escapeLast=(e,n,r)=>{const o=e.lastIndexOf(n,r);return-1===o?e:"\\"===e[o-1]?t.escapeLast(e,n,o-1):`${e.slice(0,o)}\\${e.slice(o)}`},t.removePrefix=(t,e={})=>{let n=t;return n.startsWith("./")&&(n=n.slice(2),e.prefix="./"),n},t.wrapOutput=(t,e={},n={})=>{let r=`${n.contains?"":"^"}(?:${t})${n.contains?"":"$"}`;return!0===e.negated&&(r=`(?:^(?!${r}).*$)`),r}}(Rt)),Rt}function vt(){if(ht)return ft;ht=1;const t=o,e=function(){if(ct)return ut;ct=1;const t=bt(),{CHAR_ASTERISK:e,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:i,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:p,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:g}=St(),_=t=>t===a||t===r,y=t=>{!0!==t.isPrefix&&(t.depth=t.isGlobstar?1/0:1)};return ut=(m,R)=>{const S=R||{},b=m.length-1,v=!0===S.parts||!0===S.scanToEnd,E=[],P=[],A=[];let C,x,O=m,T=-1,w=0,k=0,$=!1,L=!1,M=!1,H=!1,D=!1,F=!1,j=!1,N=!1,I=!1,B=!1,W=0,G={value:"",depth:0,isGlob:!1};const U=()=>T>=b,K=()=>O.charCodeAt(T+1),V=()=>(C=x,O.charCodeAt(++T));for(;T<b;){let t;if(x=V(),x!==r){if(!0===F||x===u){for(W++;!0!==U()&&(x=V());)if(x!==r)if(x!==u){if(!0!==F&&x===s&&(x=V())===s){if($=G.isBrace=!0,M=G.isGlob=!0,B=!0,!0===v)continue;break}if(!0!==F&&x===o){if($=G.isBrace=!0,M=G.isGlob=!0,B=!0,!0===v)continue;break}if(x===h&&(W--,0===W)){F=!1,$=G.isBrace=!0,B=!0;break}}else W++;else j=G.backslashes=!0,V();if(!0===v)continue;break}if(x!==a){if(!0!==S.noext&&!0==(x===p||x===n||x===e||x===f||x===i)&&K()===c){if(M=G.isGlob=!0,H=G.isExtglob=!0,B=!0,x===i&&T===w&&(I=!0),!0===v){for(;!0!==U()&&(x=V());)if(x!==r){if(x===d){M=G.isGlob=!0,B=!0;break}}else j=G.backslashes=!0,x=V();continue}break}if(x===e){if(C===e&&(D=G.isGlobstar=!0),M=G.isGlob=!0,B=!0,!0===v)continue;break}if(x===f){if(M=G.isGlob=!0,B=!0,!0===v)continue;break}if(x===l){for(;!0!==U()&&(t=V());)if(t!==r){if(t===g){L=G.isBracket=!0,M=G.isGlob=!0,B=!0;break}}else j=G.backslashes=!0,V();if(!0===v)continue;break}if(!0===S.nonegate||x!==i||T!==w){if(!0!==S.noparen&&x===c){if(M=G.isGlob=!0,!0===v){for(;!0!==U()&&(x=V());)if(x!==c){if(x===d){B=!0;break}}else j=G.backslashes=!0,x=V();continue}break}if(!0===M){if(B=!0,!0===v)continue;break}}else N=G.negated=!0,w++}else{if(E.push(T),P.push(G),G={value:"",depth:0,isGlob:!1},!0===B)continue;if(C===s&&T===w+1){w+=2;continue}k=T+1}}else j=G.backslashes=!0,x=V(),x===u&&(F=!0)}!0===S.noext&&(H=!1,M=!1);let q=O,Q="",X="";w>0&&(Q=O.slice(0,w),O=O.slice(w),k-=w),q&&!0===M&&k>0?(q=O.slice(0,k),X=O.slice(k)):!0===M?(q="",X=O):q=O,q&&""!==q&&"/"!==q&&q!==O&&_(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),!0===S.unescape&&(X&&(X=t.removeBackslashes(X)),q&&!0===j&&(q=t.removeBackslashes(q)));const Y={prefix:Q,input:m,start:w,base:q,glob:X,isBrace:$,isBracket:L,isGlob:M,isExtglob:H,isGlobstar:D,negated:N,negatedExtglob:I};if(!0===S.tokens&&(Y.maxDepth=0,_(x)||P.push(G),Y.tokens=P),!0===S.parts||!0===S.tokens){let t;for(let e=0;e<E.length;e++){const n=t?t+1:w,r=E[e],o=m.slice(n,r);S.tokens&&(0===e&&0!==w?(P[e].isPrefix=!0,P[e].value=Q):P[e].value=o,y(P[e]),Y.maxDepth+=P[e].depth),0===e&&""===o||A.push(o),t=r}if(t&&t+1<m.length){const e=m.slice(t+1);A.push(e),S.tokens&&(P[P.length-1].value=e,y(P[P.length-1]),Y.maxDepth+=P[P.length-1].depth)}Y.slashes=E,Y.parts=A}return Y},ut}(),n=function(){if(pt)return lt;pt=1;const t=St(),e=bt(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:i}=t,a=(t,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...t,n);t.sort();const r=`[${t.join("-")}]`;try{new RegExp(r)}catch(n){return t.map(t=>e.escapeRegex(t)).join("..")}return r},u=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,c=(l,p)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=i[l]||l;const f={...p},h="number"==typeof f.maxLength?Math.min(n,f.maxLength):n;let d=l.length;if(d>h)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${h}`);const g={type:"bos",value:"",output:f.prepend||""},_=[g],y=f.capture?"":"?:",m=e.isWindows(p),R=t.globChars(m),S=t.extglobChars(R),{DOT_LITERAL:b,PLUS_LITERAL:v,SLASH_LITERAL:E,ONE_CHAR:P,DOTS_SLASH:A,NO_DOT:C,NO_DOT_SLASH:x,NO_DOTS_SLASH:O,QMARK:T,QMARK_NO_DOT:w,STAR:k,START_ANCHOR:$}=R,L=t=>`(${y}(?:(?!${$}${t.dot?A:b}).)*?)`,M=f.dot?"":C,H=f.dot?T:w;let D=!0===f.bash?L(f):k;f.capture&&(D=`(${D})`),"boolean"==typeof f.noext&&(f.noextglob=f.noext);const F={input:l,index:-1,start:0,dot:!0===f.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:_};l=e.removePrefix(l,F),d=l.length;const j=[],N=[],I=[];let B,W=g;const G=()=>F.index===d-1,U=F.peek=(t=1)=>l[F.index+t],K=F.advance=()=>l[++F.index]||"",V=()=>l.slice(F.index+1),q=(t="",e=0)=>{F.consumed+=t,F.index+=e},Q=t=>{F.output+=null!=t.output?t.output:t.value,q(t.value)},X=()=>{let t=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)K(),F.start++,t++;return t%2!=0&&(F.negated=!0,F.start++,!0)},Y=t=>{F[t]++,I.push(t)},z=t=>{F[t]--,I.pop()},Z=t=>{if("globstar"===W.type){const e=F.braces>0&&("comma"===t.type||"brace"===t.type),n=!0===t.extglob||j.length&&("pipe"===t.type||"paren"===t.type);"slash"===t.type||"paren"===t.type||e||n||(F.output=F.output.slice(0,-W.output.length),W.type="star",W.value="*",W.output=D,F.output+=W.output)}if(j.length&&"paren"!==t.type&&(j[j.length-1].inner+=t.value),(t.value||t.output)&&Q(t),W&&"text"===W.type&&"text"===t.type)return W.value+=t.value,void(W.output=(W.output||"")+t.value);t.prev=W,_.push(t),W=t},J=(t,e)=>{const n={...S[e],conditions:1,inner:""};n.prev=W,n.parens=F.parens,n.output=F.output;const r=(f.capture?"(":"")+n.open;Y("parens"),Z({type:t,value:e,output:F.output?"":P}),Z({type:"paren",extglob:!0,value:K(),output:r}),j.push(n)},tt=t=>{let e,n=t.close+(f.capture?")":"");if("negate"===t.type){let r=D;if(t.inner&&t.inner.length>1&&t.inner.includes("/")&&(r=L(f)),(r!==D||G()||/^\)+$/.test(V()))&&(n=t.close=`)$))${r}`),t.inner.includes("*")&&(e=V())&&/^\.[^\\/.]+$/.test(e)){const o=c(e,{...p,fastpaths:!1}).output;n=t.close=`)${o})${r})`}"bos"===t.prev.type&&(F.negatedExtglob=!0)}Z({type:"paren",extglob:!0,value:B,output:n}),z("parens")};if(!1!==f.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let t=!1,n=l.replace(s,(e,n,r,o,s,i)=>"\\"===o?(t=!0,e):"?"===o?n?n+o+(s?T.repeat(s.length):""):0===i?H+(s?T.repeat(s.length):""):T.repeat(r.length):"."===o?b.repeat(r.length):"*"===o?n?n+o+(s?D:""):D:n?e:`\\${e}`);return!0===t&&(n=!0===f.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,t=>t.length%2==0?"\\\\":t?"\\":"")),n===l&&!0===f.contains?(F.output=l,F):(F.output=e.wrapOutput(n,F,p),F)}for(;!G();){if(B=K(),"\0"===B)continue;if("\\"===B){const t=U();if("/"===t&&!0!==f.bash)continue;if("."===t||";"===t)continue;if(!t){B+="\\",Z({type:"text",value:B});continue}const e=/^\\+/.exec(V());let n=0;if(e&&e[0].length>2&&(n=e[0].length,F.index+=n,n%2!=0&&(B+="\\")),!0===f.unescape?B=K():B+=K(),0===F.brackets){Z({type:"text",value:B});continue}}if(F.brackets>0&&("]"!==B||"["===W.value||"[^"===W.value)){if(!1!==f.posix&&":"===B){const t=W.value.slice(1);if(t.includes("[")&&(W.posix=!0,t.includes(":"))){const t=W.value.lastIndexOf("["),e=W.value.slice(0,t),n=W.value.slice(t+2),o=r[n];if(o){W.value=e+o,F.backtrack=!0,K(),g.output||1!==_.indexOf(W)||(g.output=P);continue}}}("["===B&&":"!==U()||"-"===B&&"]"===U())&&(B=`\\${B}`),"]"!==B||"["!==W.value&&"[^"!==W.value||(B=`\\${B}`),!0===f.posix&&"!"===B&&"["===W.value&&(B="^"),W.value+=B,Q({value:B});continue}if(1===F.quotes&&'"'!==B){B=e.escapeRegex(B),W.value+=B,Q({value:B});continue}if('"'===B){F.quotes=1===F.quotes?0:1,!0===f.keepQuotes&&Z({type:"text",value:B});continue}if("("===B){Y("parens"),Z({type:"paren",value:B});continue}if(")"===B){if(0===F.parens&&!0===f.strictBrackets)throw new SyntaxError(u("opening","("));const t=j[j.length-1];if(t&&F.parens===t.parens+1){tt(j.pop());continue}Z({type:"paren",value:B,output:F.parens?")":"\\)"}),z("parens");continue}if("["===B){if(!0!==f.nobracket&&V().includes("]"))Y("brackets");else{if(!0!==f.nobracket&&!0===f.strictBrackets)throw new SyntaxError(u("closing","]"));B=`\\${B}`}Z({type:"bracket",value:B});continue}if("]"===B){if(!0===f.nobracket||W&&"bracket"===W.type&&1===W.value.length){Z({type:"text",value:B,output:`\\${B}`});continue}if(0===F.brackets){if(!0===f.strictBrackets)throw new SyntaxError(u("opening","["));Z({type:"text",value:B,output:`\\${B}`});continue}z("brackets");const t=W.value.slice(1);if(!0===W.posix||"^"!==t[0]||t.includes("/")||(B=`/${B}`),W.value+=B,Q({value:B}),!1===f.literalBrackets||e.hasRegexChars(t))continue;const n=e.escapeRegex(W.value);if(F.output=F.output.slice(0,-W.value.length),!0===f.literalBrackets){F.output+=n,W.value=n;continue}W.value=`(${y}${n}|${W.value})`,F.output+=W.value;continue}if("{"===B&&!0!==f.nobrace){Y("braces");const t={type:"brace",value:B,output:"(",outputIndex:F.output.length,tokensIndex:F.tokens.length};N.push(t),Z(t);continue}if("}"===B){const t=N[N.length-1];if(!0===f.nobrace||!t){Z({type:"text",value:B,output:B});continue}let e=")";if(!0===t.dots){const t=_.slice(),n=[];for(let e=t.length-1;e>=0&&(_.pop(),"brace"!==t[e].type);e--)"dots"!==t[e].type&&n.unshift(t[e].value);e=a(n,f),F.backtrack=!0}if(!0!==t.comma&&!0!==t.dots){const n=F.output.slice(0,t.outputIndex),r=F.tokens.slice(t.tokensIndex);t.value=t.output="\\{",B=e="\\}",F.output=n;for(const t of r)F.output+=t.output||t.value}Z({type:"brace",value:B,output:e}),z("braces"),N.pop();continue}if("|"===B){j.length>0&&j[j.length-1].conditions++,Z({type:"text",value:B});continue}if(","===B){let t=B;const e=N[N.length-1];e&&"braces"===I[I.length-1]&&(e.comma=!0,t="|"),Z({type:"comma",value:B,output:t});continue}if("/"===B){if("dot"===W.type&&F.index===F.start+1){F.start=F.index+1,F.consumed="",F.output="",_.pop(),W=g;continue}Z({type:"slash",value:B,output:E});continue}if("."===B){if(F.braces>0&&"dot"===W.type){"."===W.value&&(W.output=b);const t=N[N.length-1];W.type="dots",W.output+=B,W.value+=B,t.dots=!0;continue}if(F.braces+F.parens===0&&"bos"!==W.type&&"slash"!==W.type){Z({type:"text",value:B,output:b});continue}Z({type:"dot",value:B,output:b});continue}if("?"===B){if((!W||"("!==W.value)&&!0!==f.noextglob&&"("===U()&&"?"!==U(2)){J("qmark",B);continue}if(W&&"paren"===W.type){const t=U();let n=B;if("<"===t&&!e.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===W.value&&!/[!=<:]/.test(t)||"<"===t&&!/<([!=]|\w+>)/.test(V()))&&(n=`\\${B}`),Z({type:"text",value:B,output:n});continue}if(!0!==f.dot&&("slash"===W.type||"bos"===W.type)){Z({type:"qmark",value:B,output:w});continue}Z({type:"qmark",value:B,output:T});continue}if("!"===B){if(!0!==f.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){J("negate",B);continue}if(!0!==f.nonegate&&0===F.index){X();continue}}if("+"===B){if(!0!==f.noextglob&&"("===U()&&"?"!==U(2)){J("plus",B);continue}if(W&&"("===W.value||!1===f.regex){Z({type:"plus",value:B,output:v});continue}if(W&&("bracket"===W.type||"paren"===W.type||"brace"===W.type)||F.parens>0){Z({type:"plus",value:B});continue}Z({type:"plus",value:v});continue}if("@"===B){if(!0!==f.noextglob&&"("===U()&&"?"!==U(2)){Z({type:"at",extglob:!0,value:B,output:""});continue}Z({type:"text",value:B});continue}if("*"!==B){"$"!==B&&"^"!==B||(B=`\\${B}`);const t=o.exec(V());t&&(B+=t[0],F.index+=t[0].length),Z({type:"text",value:B});continue}if(W&&("globstar"===W.type||!0===W.star)){W.type="star",W.star=!0,W.value+=B,W.output=D,F.backtrack=!0,F.globstar=!0,q(B);continue}let t=V();if(!0!==f.noextglob&&/^\([^?]/.test(t)){J("star",B);continue}if("star"===W.type){if(!0===f.noglobstar){q(B);continue}const e=W.prev,n=e.prev,r="slash"===e.type||"bos"===e.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===f.bash&&(!r||t[0]&&"/"!==t[0])){Z({type:"star",value:B,output:""});continue}const s=F.braces>0&&("comma"===e.type||"brace"===e.type),i=j.length&&("pipe"===e.type||"paren"===e.type);if(!r&&"paren"!==e.type&&!s&&!i){Z({type:"star",value:B,output:""});continue}for(;"/**"===t.slice(0,3);){const e=l[F.index+4];if(e&&"/"!==e)break;t=t.slice(3),q("/**",3)}if("bos"===e.type&&G()){W.type="globstar",W.value+=B,W.output=L(f),F.output=W.output,F.globstar=!0,q(B);continue}if("slash"===e.type&&"bos"!==e.prev.type&&!o&&G()){F.output=F.output.slice(0,-(e.output+W.output).length),e.output=`(?:${e.output}`,W.type="globstar",W.output=L(f)+(f.strictSlashes?")":"|$)"),W.value+=B,F.globstar=!0,F.output+=e.output+W.output,q(B);continue}if("slash"===e.type&&"bos"!==e.prev.type&&"/"===t[0]){const n=void 0!==t[1]?"|$":"";F.output=F.output.slice(0,-(e.output+W.output).length),e.output=`(?:${e.output}`,W.type="globstar",W.output=`${L(f)}${E}|${E}${n})`,W.value+=B,F.output+=e.output+W.output,F.globstar=!0,q(B+K()),Z({type:"slash",value:"/",output:""});continue}if("bos"===e.type&&"/"===t[0]){W.type="globstar",W.value+=B,W.output=`(?:^|${E}|${L(f)}${E})`,F.output=W.output,F.globstar=!0,q(B+K()),Z({type:"slash",value:"/",output:""});continue}F.output=F.output.slice(0,-W.output.length),W.type="globstar",W.output=L(f),W.value+=B,F.output+=W.output,F.globstar=!0,q(B);continue}const n={type:"star",value:B,output:D};!0!==f.bash?!W||"bracket"!==W.type&&"paren"!==W.type||!0!==f.regex?(F.index!==F.start&&"slash"!==W.type&&"dot"!==W.type||("dot"===W.type?(F.output+=x,W.output+=x):!0===f.dot?(F.output+=O,W.output+=O):(F.output+=M,W.output+=M),"*"!==U()&&(F.output+=P,W.output+=P)),Z(n)):(n.output=B,Z(n)):(n.output=".*?","bos"!==W.type&&"slash"!==W.type||(n.output=M+n.output),Z(n))}for(;F.brackets>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing","]"));F.output=e.escapeLast(F.output,"["),z("brackets")}for(;F.parens>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing",")"));F.output=e.escapeLast(F.output,"("),z("parens")}for(;F.braces>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing","}"));F.output=e.escapeLast(F.output,"{"),z("braces")}if(!0===f.strictSlashes||"star"!==W.type&&"bracket"!==W.type||Z({type:"maybe_slash",value:"",output:`${E}?`}),!0===F.backtrack){F.output="";for(const t of F.tokens)F.output+=null!=t.output?t.output:t.value,t.suffix&&(F.output+=t.suffix)}return F};return c.fastpaths=(r,o)=>{const s={...o},a="number"==typeof s.maxLength?Math.min(n,s.maxLength):n,u=r.length;if(u>a)throw new SyntaxError(`Input length: ${u}, exceeds maximum allowed length: ${a}`);r=i[r]||r;const c=e.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:p,ONE_CHAR:f,DOTS_SLASH:h,NO_DOT:d,NO_DOTS:g,NO_DOTS_SLASH:_,STAR:y,START_ANCHOR:m}=t.globChars(c),R=s.dot?g:d,S=s.dot?_:d,b=s.capture?"":"?:";let v=!0===s.bash?".*?":y;s.capture&&(v=`(${v})`);const E=t=>!0===t.noglobstar?v:`(${b}(?:(?!${m}${t.dot?h:l}).)*?)`,P=t=>{switch(t){case"*":return`${R}${f}${v}`;case".*":return`${l}${f}${v}`;case"*.*":return`${R}${v}${l}${f}${v}`;case"*/*":return`${R}${v}${p}${f}${S}${v}`;case"**":return R+E(s);case"**/*":return`(?:${R}${E(s)}${p})?${S}${f}${v}`;case"**/*.*":return`(?:${R}${E(s)}${p})?${S}${v}${l}${f}${v}`;case"**/.*":return`(?:${R}${E(s)}${p})?${l}${f}${v}`;default:{const e=/^(.*?)\.(\w+)$/.exec(t);if(!e)return;const n=P(e[1]);if(!n)return;return n+l+e[2]}}},A=e.removePrefix(r,{negated:!1,prefix:""});let C=P(A);return C&&!0!==s.strictSlashes&&(C+=`${p}?`),C},lt=c}(),r=bt(),s=St(),i=(t,e,n=!1)=>{if(Array.isArray(t)){const r=t.map(t=>i(t,e,n)),o=t=>{for(const e of r){const n=e(t);if(n)return n}return!1};return o}const o=(s=t)&&"object"==typeof s&&!Array.isArray(s)&&t.tokens&&t.input;var s;if(""===t||"string"!=typeof t&&!o)throw new TypeError("Expected pattern to be a non-empty string");const a=e||{},u=r.isWindows(e),c=o?i.compileRe(t,e):i.makeRe(t,e,!1,!0),l=c.state;delete c.state;let p=()=>!1;if(a.ignore){const t={...e,ignore:null,onMatch:null,onResult:null};p=i(a.ignore,t,n)}const f=(n,r=!1)=>{const{isMatch:o,match:s,output:f}=i.test(n,c,e,{glob:t,posix:u}),h={glob:t,state:l,regex:c,posix:u,input:n,output:f,match:s,isMatch:o};return"function"==typeof a.onResult&&a.onResult(h),!1===o?(h.isMatch=!1,!!r&&h):p(n)?("function"==typeof a.onIgnore&&a.onIgnore(h),h.isMatch=!1,!!r&&h):("function"==typeof a.onMatch&&a.onMatch(h),!r||h)};return n&&(f.state=l),f};return i.test=(t,e,n,{glob:o,posix:s}={})=>{if("string"!=typeof t)throw new TypeError("Expected input to be a string");if(""===t)return{isMatch:!1,output:""};const a=n||{},u=a.format||(s?r.toPosixSlashes:null);let c=t===o,l=c&&u?u(t):t;return!1===c&&(l=u?u(t):t,c=l===o),!1!==c&&!0!==a.capture||(c=!0===a.matchBase||!0===a.basename?i.matchBase(t,e,n,s):e.exec(l)),{isMatch:Boolean(c),match:c,output:l}},i.matchBase=(e,n,o,s=r.isWindows(o))=>(n instanceof RegExp?n:i.makeRe(n,o)).test(t.basename(e)),i.isMatch=(t,e,n)=>i(e,n)(t),i.parse=(t,e)=>Array.isArray(t)?t.map(t=>i.parse(t,e)):n(t,{...e,fastpaths:!1}),i.scan=(t,n)=>e(t,n),i.compileRe=(t,e,n=!1,r=!1)=>{if(!0===n)return t.output;const o=e||{},s=o.contains?"":"^",a=o.contains?"":"$";let u=`${s}(?:${t.output})${a}`;t&&!0===t.negated&&(u=`^(?!${u}).*$`);const c=i.toRegex(u,e);return!0===r&&(c.state=t),c},i.makeRe=(t,e={},r=!1,o=!1)=>{if(!t||"string"!=typeof t)throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return!1===e.fastpaths||"."!==t[0]&&"*"!==t[0]||(s.output=n.fastpaths(t,e)),s.output||(s=n(t,e)),i.compileRe(s,e,r,o)},i.toRegex=(t,e)=>{try{const n=e||{};return new RegExp(t,n.flags||(n.nocase?"i":""))}catch(t){if(e&&!0===e.debug)throw t;return/$^/}},i.constants=s,ft=i}function Et(){return gt?dt:(gt=1,dt=vt())}function Pt(){if(mt)return O;mt=1,Object.defineProperty(O,"__esModule",{value:!0}),O.isAbsolute=O.partitionAbsoluteAndRelative=O.removeDuplicateSlashes=O.matchAny=O.convertPatternsToRe=O.makeRe=O.getPatternParts=O.expandBraceExpansion=O.expandPatternsWithBraceExpansion=O.isAffectDepthOfReadingPattern=O.endsWithSlashGlobStar=O.hasGlobStar=O.getBaseDirectory=O.isPatternRelatedToParentDirectory=O.getPatternsOutsideCurrentDirectory=O.getPatternsInsideCurrentDirectory=O.getPositivePatterns=O.getNegativePatterns=O.isPositivePattern=O.isNegativePattern=O.convertToNegativePattern=O.convertToPositivePattern=O.isDynamicPattern=O.isStaticPattern=void 0;const t=o,e=k(),n=function(){if(yt)return _t;yt=1;const t=s,e=ot(),n=Et(),r=bt(),o=t=>""===t||"./"===t,i=t=>{const e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},a=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let o=new Set,s=new Set,i=new Set,a=0,u=t=>{i.add(t.output),r&&r.onResult&&r.onResult(t)};for(let i=0;i<e.length;i++){let c=n(String(e[i]),{...r,onResult:u},!0),l=c.state.negated||c.state.negatedExtglob;l&&a++;for(let e of t){let t=c(e,!0);(l?!t.isMatch:t.isMatch)&&(l?o.add(t.output):(o.delete(t.output),s.add(t.output)))}}let c=(a===e.length?[...i]:[...s]).filter(t=>!o.has(t));if(r&&0===c.length){if(!0===r.failglob)throw new Error(`No matches found for "${e.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?e.map(t=>t.replace(/\\/g,"")):e}return c};return a.match=a,a.matcher=(t,e)=>n(t,e),a.any=a.isMatch=(t,e,r)=>n(e,r)(t),a.not=(t,e,n={})=>{e=[].concat(e).map(String);let r=new Set,o=[],s=new Set(a(t,e,{...n,onResult:t=>{n.onResult&&n.onResult(t),o.push(t.output)}}));for(let t of o)s.has(t)||r.add(t);return[...r]},a.contains=(e,n,r)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${t.inspect(e)}"`);if(Array.isArray(n))return n.some(t=>a.contains(e,t,r));if("string"==typeof n){if(o(e)||o(n))return!1;if(e.includes(n)||e.startsWith("./")&&e.slice(2).includes(n))return!0}return a.isMatch(e,n,{...r,contains:!0})},a.matchKeys=(t,e,n)=>{if(!r.isObject(t))throw new TypeError("Expected the first argument to be an object");let o=a(Object.keys(t),e,n),s={};for(let e of o)s[e]=t[e];return s},a.some=(t,e,r)=>{let o=[].concat(t);for(let t of[].concat(e)){let e=n(String(t),r);if(o.some(t=>e(t)))return!0}return!1},a.every=(t,e,r)=>{let o=[].concat(t);for(let t of[].concat(e)){let e=n(String(t),r);if(!o.every(t=>e(t)))return!1}return!0},a.all=(e,r,o)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${t.inspect(e)}"`);return[].concat(r).every(t=>n(t,o)(e))},a.capture=(t,e,o)=>{let s=r.isWindows(o),i=n.makeRe(String(t),{...o,capture:!0}).exec(s?r.toPosixSlashes(e):e);if(i)return i.slice(1).map(t=>void 0===t?"":t)},a.makeRe=(...t)=>n.makeRe(...t),a.scan=(...t)=>n.scan(...t),a.parse=(t,r)=>{let o=[];for(let s of[].concat(t||[]))for(let t of e(String(s),r))o.push(n.parse(t,r));return o},a.braces=(t,n)=>{if("string"!=typeof t)throw new TypeError("Expected a string");return n&&!0===n.nobrace||!i(t)?[t]:e(t,n)},a.braceExpand=(t,e)=>{if("string"!=typeof t)throw new TypeError("Expected a string");return a.braces(t,{...e,expand:!0})},a.hasBraces=i,_t=a}(),r=/[*?]|^!/,i=/\[[^[]*]/,a=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,u=/[!*+?@]\([^(]*\)/,c=/,|\.\./,l=/(?!^)\/{2,}/g;function p(t,e={}){return!f(t,e)}function f(t,e={}){return""!==t&&(!(!1!==e.caseSensitiveMatch&&!t.includes("\\"))||(!!(r.test(t)||i.test(t)||a.test(t))||(!(!1===e.extglob||!u.test(t))||!(!1===e.braceExpansion||!function(t){const e=t.indexOf("{");if(-1===e)return!1;const n=t.indexOf("}",e+1);if(-1===n)return!1;const r=t.slice(e,n);return c.test(r)}(t)))))}function h(t){return t.startsWith("!")&&"("!==t[1]}function d(t){return!h(t)}function g(t){return t.startsWith("..")||t.startsWith("./..")}function _(t){return t.endsWith("/**")}function y(t){const e=n.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((t,e)=>t.length-e.length),e.filter(t=>""!==t)}function m(t,e){return n.makeRe(t,e)}function R(e){return t.isAbsolute(e)}return O.isStaticPattern=p,O.isDynamicPattern=f,O.convertToPositivePattern=function(t){return h(t)?t.slice(1):t},O.convertToNegativePattern=function(t){return"!"+t},O.isNegativePattern=h,O.isPositivePattern=d,O.getNegativePatterns=function(t){return t.filter(h)},O.getPositivePatterns=function(t){return t.filter(d)},O.getPatternsInsideCurrentDirectory=function(t){return t.filter(t=>!g(t))},O.getPatternsOutsideCurrentDirectory=function(t){return t.filter(g)},O.isPatternRelatedToParentDirectory=g,O.getBaseDirectory=function(t){return e(t,{flipBackslashes:!1})},O.hasGlobStar=function(t){return t.includes("**")},O.endsWithSlashGlobStar=_,O.isAffectDepthOfReadingPattern=function(e){const n=t.basename(e);return _(e)||p(n)},O.expandPatternsWithBraceExpansion=function(t){return t.reduce((t,e)=>t.concat(y(e)),[])},O.expandBraceExpansion=y,O.getPatternParts=function(t,e){let{parts:r}=n.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return 0===r.length&&(r=[t]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r},O.makeRe=m,O.convertPatternsToRe=function(t,e){return t.map(t=>m(t,e))},O.matchAny=function(t,e){return e.some(e=>e.test(t))},O.removeDuplicateSlashes=function(t){return t.replace(l,"/")},O.partitionAbsoluteAndRelative=function(t){const e=[],n=[];for(const r of t)R(r)?e.push(r):n.push(r);return[e,n]},O.isAbsolute=R,O}var At,Ct,xt,Ot={};function Tt(){if(Ct)return At;Ct=1;const t=i.PassThrough,e=Array.prototype.slice;function n(e,r){if(Array.isArray(e))for(let t=0,o=e.length;t<o;t++)e[t]=n(e[t],r);else{if(!e._readableState&&e.pipe&&(e=e.pipe(t(r))),!e._readableState||!e.pause||!e.pipe)throw new Error("Only readable stream can be merged.");e.pause()}return e}return At=function(){const r=[],o=e.call(arguments);let s=!1,i=o[o.length-1];i&&!Array.isArray(i)&&null==i.pipe?o.pop():i={};const a=!1!==i.end,u=!0===i.pipeError;null==i.objectMode&&(i.objectMode=!0);null==i.highWaterMark&&(i.highWaterMark=65536);const c=t(i);function l(){for(let t=0,e=arguments.length;t<e;t++)r.push(n(arguments[t],i));return p(),this}function p(){if(s)return;s=!0;let t=r.shift();if(!t)return void process.nextTick(f);Array.isArray(t)||(t=[t]);let e=t.length+1;function n(){--e>0||(s=!1,p())}function o(t){function e(){t.removeListener("merge2UnpipeEnd",e),t.removeListener("end",e),u&&t.removeListener("error",r),n()}function r(t){c.emit("error",t)}if(t._readableState.endEmitted)return n();t.on("merge2UnpipeEnd",e),t.on("end",e),u&&t.on("error",r),t.pipe(c,{end:!1}),t.resume()}for(let e=0;e<t.length;e++)o(t[e]);n()}function f(){s=!1,c.emit("queueDrain"),a&&c.end()}c.setMaxListeners(0),c.add=l,c.on("unpipe",function(t){t.emit("merge2UnpipeEnd")}),o.length&&l.apply(null,o);return c},At}var wt,kt,$t,Lt={};function Mt(){if(wt)return Lt;return wt=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.isEmpty=Lt.isString=void 0,Lt.isString=function(t){return"string"==typeof t},Lt.isEmpty=function(t){return""===t},Lt}function Ht(){if(kt)return p;kt=1,Object.defineProperty(p,"__esModule",{value:!0}),p.string=p.stream=p.pattern=p.path=p.fs=p.errno=p.array=void 0;const t=h();p.array=t;const e=_();p.errno=e;const n=function(){if(y)return m;y=1,Object.defineProperty(m,"__esModule",{value:!0}),m.createDirentFromStats=void 0;class t{constructor(t,e){this.name=t,this.isBlockDevice=e.isBlockDevice.bind(e),this.isCharacterDevice=e.isCharacterDevice.bind(e),this.isDirectory=e.isDirectory.bind(e),this.isFIFO=e.isFIFO.bind(e),this.isFile=e.isFile.bind(e),this.isSocket=e.isSocket.bind(e),this.isSymbolicLink=e.isSymbolicLink.bind(e)}}return m.createDirentFromStats=function(e,n){return new t(e,n)},m}();p.fs=n;const r=b();p.path=r;const o=Pt();p.pattern=o;const s=function(){if(xt)return Ot;xt=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.merge=void 0;const t=Tt();function e(t){t.forEach(t=>t.emit("close"))}return Ot.merge=function(n){const r=t(n);return n.forEach(t=>{t.once("error",t=>r.emit("error",t))}),r.once("close",()=>e(n)),r.once("end",()=>e(n)),r},Ot}();p.stream=s;const i=Mt();return p.string=i,p}var Dt,Ft={},jt={},Nt={},It={},Bt={},Wt={},Gt={},Ut={},Kt={};function Vt(){if(Dt)return Kt;function t(t,e){t(e)}function e(t,e){t(null,e)}return Dt=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.read=void 0,Kt.read=function(n,r,o){r.fs.lstat(n,(s,i)=>{null===s?i.isSymbolicLink()&&r.followSymbolicLink?r.fs.stat(n,(n,s)=>{if(null!==n)return r.throwErrorOnBrokenSymbolicLink?void t(o,n):void e(o,i);r.markSymbolicLink&&(s.isSymbolicLink=()=>!0),e(o,s)}):e(o,i):t(o,s)})},Kt}var qt,Qt={};var Xt,Yt,zt,Zt,Jt,te,ee,ne={},re={};function oe(){if(Yt)return ne;Yt=1,Object.defineProperty(ne,"__esModule",{value:!0});const t=(Xt||(Xt=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createFileSystemAdapter=t.FILE_SYSTEM_ADAPTER=void 0;const e=u;t.FILE_SYSTEM_ADAPTER={lstat:e.lstat,stat:e.stat,lstatSync:e.lstatSync,statSync:e.statSync},t.createFileSystemAdapter=function(e){return void 0===e?t.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},t.FILE_SYSTEM_ADAPTER),e)}}(re)),re);return ne.default=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=t.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(t,e){return null!=t?t:e}},ne}function se(){if(zt)return Ut;zt=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.statSync=Ut.stat=Ut.Settings=void 0;const t=Vt(),e=(qt||(qt=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.read=void 0,Qt.read=function(t,e){const n=e.fs.lstatSync(t);if(!n.isSymbolicLink()||!e.followSymbolicLink)return n;try{const n=e.fs.statSync(t);return e.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(t){if(!e.throwErrorOnBrokenSymbolicLink)return n;throw t}}),Qt),n=oe();function r(t={}){return t instanceof n.default?t:new n.default(t)}return Ut.Settings=n.default,Ut.stat=function(e,n,o){"function"!=typeof n?t.read(e,r(n),o):t.read(e,r(),n)},Ut.statSync=function(t,n){const o=r(n);return e.read(t,o)},Ut}function ie(){if(Jt)return Zt;let t;return Jt=1,Zt="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:c):e=>(t||(t=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0))}var ae,ue={};function ce(){if(ae)return ue;ae=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;const t=process.versions.node.split(".");if(void 0===t[0]||void 0===t[1])throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);const e=Number.parseInt(t[0],10),n=Number.parseInt(t[1],10),r=e>10,o=10===e&&n>=10;return ue.IS_SUPPORT_READDIR_WITH_FILE_TYPES=r||o,ue}var le,pe,fe={},he={};function de(){if(pe)return fe;pe=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.fs=void 0;const t=function(){if(le)return he;le=1,Object.defineProperty(he,"__esModule",{value:!0}),he.createDirentFromStats=void 0;class t{constructor(t,e){this.name=t,this.isBlockDevice=e.isBlockDevice.bind(e),this.isCharacterDevice=e.isCharacterDevice.bind(e),this.isDirectory=e.isDirectory.bind(e),this.isFIFO=e.isFIFO.bind(e),this.isFile=e.isFile.bind(e),this.isSocket=e.isSocket.bind(e),this.isSymbolicLink=e.isSymbolicLink.bind(e)}}return he.createDirentFromStats=function(e,n){return new t(e,n)},he}();return fe.fs=t,fe}var ge,_e,ye={};function me(){if(ge)return ye;return ge=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.joinPathSegments=void 0,ye.joinPathSegments=function(t,e,n){return t.endsWith(n)?t+e:t+n+e},ye}function Re(){if(_e)return Gt;_e=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.readdir=Gt.readdirWithFileTypes=Gt.read=void 0;const t=se(),e=function(){if(ee)return te;ee=1,te=function(e,n){let r,o,s,i=!0;function a(e){function o(){n&&n(e,r),n=null}i?t(o):o()}function u(t,e,n){r[t]=n,(0===--o||e)&&a(e)}Array.isArray(e)?(r=[],o=e.length):(s=Object.keys(e),r={},o=s.length),o?s?s.forEach(function(t){e[t](function(e,n){u(t,e,n)})}):e.forEach(function(t,e){t(function(t,n){u(e,t,n)})}):a(null),i=!1};const t=ie();return te}(),n=ce(),r=de(),o=me();function s(t,n,s){n.fs.readdir(t,{withFileTypes:!0},(i,c)=>{if(null!==i)return void a(s,i);const l=c.map(e=>({dirent:e,name:e.name,path:o.joinPathSegments(t,e.name,n.pathSegmentSeparator)}));if(!n.followSymbolicLinks)return void u(s,l);const p=l.map(t=>function(t,e){return n=>{t.dirent.isSymbolicLink()?e.fs.stat(t.path,(o,s)=>{if(null!==o)return e.throwErrorOnBrokenSymbolicLink?void n(o):void n(null,t);t.dirent=r.fs.createDirentFromStats(t.name,s),n(null,t)}):n(null,t)}}(t,n));e(p,(t,e)=>{null===t?u(s,e):a(s,t)})})}function i(n,s,i){s.fs.readdir(n,(c,l)=>{if(null!==c)return void a(i,c);const p=l.map(e=>{const i=o.joinPathSegments(n,e,s.pathSegmentSeparator);return n=>{t.stat(i,s.fsStatSettings,(t,o)=>{if(null!==t)return void n(t);const a={name:e,path:i,dirent:r.fs.createDirentFromStats(e,o)};s.stats&&(a.stats=o),n(null,a)})}});e(p,(t,e)=>{null===t?u(i,e):a(i,t)})})}function a(t,e){t(e)}function u(t,e){t(null,e)}return Gt.read=function(t,e,r){e.stats||!n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?i(t,e,r):s(t,e,r)},Gt.readdirWithFileTypes=s,Gt.readdir=i,Gt}var Se,be={};var ve,Ee,Pe,Ae={},Ce={};function xe(){return ve||(ve=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createFileSystemAdapter=t.FILE_SYSTEM_ADAPTER=void 0;const e=u;t.FILE_SYSTEM_ADAPTER={lstat:e.lstat,stat:e.stat,lstatSync:e.lstatSync,statSync:e.statSync,readdir:e.readdir,readdirSync:e.readdirSync},t.createFileSystemAdapter=function(e){return void 0===e?t.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},t.FILE_SYSTEM_ADAPTER),e)}}(Ce)),Ce}function Oe(){if(Pe)return Wt;Pe=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.Settings=Wt.scandirSync=Wt.scandir=void 0;const t=Re(),e=function(){if(Se)return be;Se=1,Object.defineProperty(be,"__esModule",{value:!0}),be.readdir=be.readdirWithFileTypes=be.read=void 0;const t=se(),e=ce(),n=de(),r=me();function o(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(o=>{const s={dirent:o,name:o.name,path:r.joinPathSegments(t,o.name,e.pathSegmentSeparator)};if(s.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{const t=e.fs.statSync(s.path);s.dirent=n.fs.createDirentFromStats(s.name,t)}catch(t){if(e.throwErrorOnBrokenSymbolicLink)throw t}return s})}function s(e,o){return o.fs.readdirSync(e).map(s=>{const i=r.joinPathSegments(e,s,o.pathSegmentSeparator),a=t.statSync(i,o.fsStatSettings),u={name:s,path:i,dirent:n.fs.createDirentFromStats(s,a)};return o.stats&&(u.stats=a),u})}return be.read=function(t,n){return!n.stats&&e.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(t,n):s(t,n)},be.readdirWithFileTypes=o,be.readdir=s,be}(),n=function(){if(Ee)return Ae;Ee=1,Object.defineProperty(Ae,"__esModule",{value:!0});const t=o,e=se(),n=xe();return Ae.default=class{constructor(r={}){this._options=r,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=n.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new e.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,e){return null!=t?t:e}},Ae}();function r(t={}){return t instanceof n.default?t:new n.default(t)}return Wt.Settings=n.default,Wt.scandir=function(e,n,o){"function"!=typeof n?t.read(e,r(n),o):t.read(e,r(),n)},Wt.scandirSync=function(t,n){const o=r(n);return e.read(t,o)},Wt}var Te,we,ke,$e={exports:{}};function Le(){if(ke)return $e.exports;ke=1;var t=we?Te:(we=1,Te=function(t){var e=new t,n=e;return{get:function(){var r=e;return r.next?e=r.next:(e=new t,n=e),r.next=null,r},release:function(t){n.next=t,n=t}}});function e(e,o,s){if("function"==typeof e&&(s=o,o=e,e=null),!(s>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var i=t(r),a=null,u=null,c=0,l=null,p={push:function(t,r){var h=i.get();h.context=e,h.release=f,h.value=t,h.callback=r||n,h.errorHandler=l,c>=s||p.paused?u?(u.next=h,u=h):(a=h,u=h,p.saturated()):(c++,o.call(e,h.value,h.worked))},drain:n,saturated:n,pause:function(){p.paused=!0},paused:!1,get concurrency(){return s},set concurrency(t){if(!(t>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(s=t,!p.paused)for(;a&&c<s;)c++,f()},running:function(){return c},resume:function(){if(!p.paused)return;if(p.paused=!1,null===a)return c++,void f();for(;a&&c<s;)c++,f()},idle:function(){return 0===c&&0===p.length()},length:function(){var t=a,e=0;for(;t;)t=t.next,e++;return e},getQueue:function(){var t=a,e=[];for(;t;)e.push(t.value),t=t.next;return e},unshift:function(t,r){var h=i.get();h.context=e,h.release=f,h.value=t,h.callback=r||n,h.errorHandler=l,c>=s||p.paused?a?(h.next=a,a=h):(a=h,u=h,p.saturated()):(c++,o.call(e,h.value,h.worked))},empty:n,kill:function(){a=null,u=null,p.drain=n},killAndDrain:function(){a=null,u=null,p.drain(),p.drain=n},error:function(t){l=t},abort:function(){var t=a;a=null,u=null;for(;t;){var e=t.next,r=t.callback,o=t.errorHandler,s=t.value,i=t.context;t.value=null,t.callback=n,t.errorHandler=null,o&&o(new Error("abort"),s),r.call(i,new Error("abort")),t.release(t),t=e}p.drain=n}};return p;function f(t){t&&i.release(t);var n=a;n&&c<=s?p.paused?c--:(u===a&&(u=null),a=n.next,n.next=null,o.call(e,n.value,n.worked),null===u&&p.empty()):0===--c&&p.drain()}}function n(){}function r(){this.value=null,this.callback=n,this.next=null,this.release=n,this.context=null,this.errorHandler=null;var t=this;this.worked=function(e,r){var o=t.callback,s=t.errorHandler,i=t.value;t.value=null,t.callback=n,t.errorHandler&&s(e,i),o.call(t.context,e,r),t.release(t)}}return $e.exports=e,$e.exports.promise=function(t,r,o){"function"==typeof t&&(o=r,r=t,t=null);var s=e(t,function(t,e){r.call(this,t).then(function(t){e(null,t)},e)},o),i=s.push,a=s.unshift;return s.push=function(t){var e=new Promise(function(e,n){i(t,function(t,r){t?n(t):e(r)})});return e.catch(n),e},s.unshift=function(t){var e=new Promise(function(e,n){a(t,function(t,r){t?n(t):e(r)})});return e.catch(n),e},s.drained=function(){return new Promise(function(t){process.nextTick(function(){if(s.idle())t();else{var e=s.drain;s.drain=function(){"function"==typeof e&&e(),t(),s.drain=e}}})})},s},$e.exports}var Me,He={};function De(){if(Me)return He;return Me=1,Object.defineProperty(He,"__esModule",{value:!0}),He.joinPathSegments=He.replacePathSegmentSeparator=He.isAppliedFilter=He.isFatalError=void 0,He.isFatalError=function(t,e){return null===t.errorFilter||!t.errorFilter(e)},He.isAppliedFilter=function(t,e){return null===t||t(e)},He.replacePathSegmentSeparator=function(t,e){return t.split(/[/\\]/).join(e)},He.joinPathSegments=function(t,e,n){return""===t?e:t.endsWith(n)?t+e:t+n+e},He}var Fe,je,Ne,Ie={};function Be(){if(Fe)return Ie;Fe=1,Object.defineProperty(Ie,"__esModule",{value:!0});const t=De();return Ie.default=class{constructor(e,n){this._root=e,this._settings=n,this._root=t.replacePathSegmentSeparator(e,n.pathSegmentSeparator)}},Ie}function We(){if(je)return Bt;je=1,Object.defineProperty(Bt,"__esModule",{value:!0});const t=a,e=Oe(),n=Le(),r=De(),o=Be();class s extends o.default{constructor(r,o){super(r,o),this._settings=o,this._scandir=e.scandir,this._emitter=new t.EventEmitter,this._queue=n(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(t){this._emitter.on("entry",t)}onError(t){this._emitter.once("error",t)}onEnd(t){this._emitter.once("end",t)}_pushToQueue(t,e){const n={directory:t,base:e};this._queue.push(n,t=>{null!==t&&this._handleError(t)})}_worker(t,e){this._scandir(t.directory,this._settings.fsScandirSettings,(n,r)=>{if(null===n){for(const e of r)this._handleEntry(e,t.base);e(null,void 0)}else e(n,void 0)})}_handleError(t){!this._isDestroyed&&r.isFatalError(this._settings,t)&&(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",t))}_handleEntry(t,e){if(this._isDestroyed||this._isFatalError)return;const n=t.path;void 0!==e&&(t.path=r.joinPathSegments(e,t.name,this._settings.pathSegmentSeparator)),r.isAppliedFilter(this._settings.entryFilter,t)&&this._emitEntry(t),t.dirent.isDirectory()&&r.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,void 0===e?void 0:t.path)}_emitEntry(t){this._emitter.emit("entry",t)}}return Bt.default=s,Bt}var Ge,Ue={};var Ke,Ve,qe={},Qe={};function Xe(){if(Ve)return qe;Ve=1,Object.defineProperty(qe,"__esModule",{value:!0});const t=function(){if(Ke)return Qe;Ke=1,Object.defineProperty(Qe,"__esModule",{value:!0});const t=Oe(),e=De(),n=Be();class r extends n.default{constructor(){super(...arguments),this._scandir=t.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(t,e){this._queue.add({directory:t,base:e})}_handleQueue(){for(const t of this._queue.values())this._handleDirectory(t.directory,t.base)}_handleDirectory(t,e){try{const n=this._scandir(t,this._settings.fsScandirSettings);for(const t of n)this._handleEntry(t,e)}catch(t){this._handleError(t)}}_handleError(t){if(e.isFatalError(this._settings,t))throw t}_handleEntry(t,n){const r=t.path;void 0!==n&&(t.path=e.joinPathSegments(n,t.name,this._settings.pathSegmentSeparator)),e.isAppliedFilter(this._settings.entryFilter,t)&&this._pushToStorage(t),t.dirent.isDirectory()&&e.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(r,void 0===n?void 0:t.path)}_pushToStorage(t){this._storage.push(t)}}return Qe.default=r,Qe}();return qe.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings)}read(){return this._reader.read()}},qe}var Ye,ze,Ze={};function Je(){if(ze)return Nt;ze=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.Settings=Nt.walkStream=Nt.walkSync=Nt.walk=void 0;const t=function(){if(Ne)return It;Ne=1,Object.defineProperty(It,"__esModule",{value:!0});const t=We();return It.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings),this._storage=[]}read(t){this._reader.onError(e=>{!function(t,e){t(e)}(t,e)}),this._reader.onEntry(t=>{this._storage.push(t)}),this._reader.onEnd(()=>{!function(t,e){t(null,e)}(t,this._storage)}),this._reader.read()}},It}(),e=function(){if(Ge)return Ue;Ge=1,Object.defineProperty(Ue,"__esModule",{value:!0});const t=i,e=We();return Ue.default=class{constructor(n,r){this._root=n,this._settings=r,this._reader=new e.default(this._root,this._settings),this._stream=new t.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(t=>{this._stream.emit("error",t)}),this._reader.onEntry(t=>{this._stream.push(t)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}},Ue}(),n=Xe(),r=function(){if(Ye)return Ze;Ye=1,Object.defineProperty(Ze,"__esModule",{value:!0});const t=o,e=Oe();return Ze.default=class{constructor(n={}){this._options=n,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.fsScandirSettings=new e.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(t,e){return null!=t?t:e}},Ze}();function s(t={}){return t instanceof r.default?t:new r.default(t)}return Nt.Settings=r.default,Nt.walk=function(e,n,r){"function"!=typeof n?new t.default(e,s(n)).read(r):new t.default(e,s()).read(n)},Nt.walkSync=function(t,e){const r=s(e);return new n.default(t,r).read()},Nt.walkStream=function(t,n){const r=s(n);return new e.default(t,r).read()},Nt}var tn,en={};function nn(){if(tn)return en;tn=1,Object.defineProperty(en,"__esModule",{value:!0});const t=o,e=se(),n=Ht();return en.default=class{constructor(t){this._settings=t,this._fsStatSettings=new e.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return t.resolve(this._settings.cwd,e)}_makeEntry(t,e){const r={name:e,path:e,dirent:n.fs.createDirentFromStats(e,t)};return this._settings.stats&&(r.stats=t),r}_isFatalError(t){return!n.errno.isEnoentCodeError(t)&&!this._settings.suppressErrors}},en}var rn,on,sn={};function an(){if(rn)return sn;rn=1,Object.defineProperty(sn,"__esModule",{value:!0});const t=i,e=se(),n=Je(),r=nn();class o extends r.default{constructor(){super(...arguments),this._walkStream=n.walkStream,this._stat=e.stat}dynamic(t,e){return this._walkStream(t,e)}static(e,n){const r=e.map(this._getFullEntryPath,this),o=new t.PassThrough({objectMode:!0});o._write=(t,s,i)=>this._getEntry(r[t],e[t],n).then(e=>{null!==e&&n.entryFilter(e)&&o.push(e),t===r.length-1&&o.end(),i()}).catch(i);for(let t=0;t<r.length;t++)o.write(t);return o}_getEntry(t,e,n){return this._getStat(t).then(t=>this._makeEntry(t,e)).catch(t=>{if(n.errorFilter(t))return null;throw t})}_getStat(t){return new Promise((e,n)=>{this._stat(t,this._fsStatSettings,(t,r)=>null===t?e(r):n(t))})}}return sn.default=o,sn}var un,cn,ln,pn={},fn={},hn={},dn={};function gn(){if(cn)return hn;cn=1,Object.defineProperty(hn,"__esModule",{value:!0});const t=function(){if(un)return dn;un=1,Object.defineProperty(dn,"__esModule",{value:!0});const t=Ht();return dn.default=class{constructor(t,e,n){this._patterns=t,this._settings=e,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(const t of this._patterns){const e=this._getPatternSegments(t),n=this._splitSegmentsIntoSections(e);this._storage.push({complete:n.length<=1,pattern:t,segments:e,sections:n})}}_getPatternSegments(e){return t.pattern.getPatternParts(e,this._micromatchOptions).map(e=>t.pattern.isDynamicPattern(e,this._settings)?{dynamic:!0,pattern:e,patternRe:t.pattern.makeRe(e,this._micromatchOptions)}:{dynamic:!1,pattern:e})}_splitSegmentsIntoSections(e){return t.array.splitWhen(e,e=>e.dynamic&&t.pattern.hasGlobStar(e.pattern))}},dn}();class e extends t.default{match(t){const e=t.split("/"),n=e.length,r=this._storage.filter(t=>!t.complete||t.segments.length>n);for(const t of r){const r=t.sections[0];if(!t.complete&&n>r.length)return!0;if(e.every((e,n)=>{const r=t.segments[n];return!(!r.dynamic||!r.patternRe.test(e))||!r.dynamic&&r.pattern===e}))return!0}return!1}}return hn.default=e,hn}var _n,yn={};var mn,Rn={};var Sn,bn,vn,En={};function Pn(){if(bn)return pn;bn=1,Object.defineProperty(pn,"__esModule",{value:!0});const t=o,e=function(){if(ln)return fn;ln=1,Object.defineProperty(fn,"__esModule",{value:!0});const t=Ht(),e=gn();return fn.default=class{constructor(t,e){this._settings=t,this._micromatchOptions=e}getFilter(t,e,n){const r=this._getMatcher(e),o=this._getNegativePatternsRe(n);return e=>this._filter(t,e,r,o)}_getMatcher(t){return new e.default(t,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){const n=e.filter(t.pattern.isAffectDepthOfReadingPattern);return t.pattern.convertPatternsToRe(n,this._micromatchOptions)}_filter(e,n,r,o){if(this._isSkippedByDeep(e,n.path))return!1;if(this._isSkippedSymbolicLink(n))return!1;const s=t.path.removeLeadingDotSegment(n.path);return!this._isSkippedByPositivePatterns(s,r)&&this._isSkippedByNegativePatterns(s,o)}_isSkippedByDeep(t,e){return this._settings.deep!==1/0&&this._getEntryLevel(t,e)>=this._settings.deep}_getEntryLevel(t,e){const n=e.split("/").length;return""===t?n:n-t.split("/").length}_isSkippedSymbolicLink(t){return!this._settings.followSymbolicLinks&&t.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(t,e){return!this._settings.baseNameMatch&&!e.match(t)}_isSkippedByNegativePatterns(e,n){return!t.pattern.matchAny(e,n)}},fn}(),n=function(){if(_n)return yn;_n=1,Object.defineProperty(yn,"__esModule",{value:!0});const t=Ht();return yn.default=class{constructor(t,e){this._settings=t,this._micromatchOptions=e,this.index=new Map}getFilter(e,n){const[r,o]=t.pattern.partitionAbsoluteAndRelative(n),s={positive:{all:t.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:t.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:t.pattern.convertPatternsToRe(o,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return t=>this._filter(t,s)}_filter(e,n){const r=t.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(r))return!1;if(this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;const o=this._isMatchToPatternsSet(r,n,e.dirent.isDirectory());return this._settings.unique&&o&&this._createIndexRecord(r),o}_isDuplicateEntry(t){return this.index.has(t)}_createIndexRecord(t){this.index.set(t,void 0)}_onlyFileFilter(t){return this._settings.onlyFiles&&!t.dirent.isFile()}_onlyDirectoryFilter(t){return this._settings.onlyDirectories&&!t.dirent.isDirectory()}_isMatchToPatternsSet(t,e,n){return!!this._isMatchToPatterns(t,e.positive.all,n)&&(!this._isMatchToPatterns(t,e.negative.relative,n)&&!this._isMatchToAbsoluteNegative(t,e.negative.absolute,n))}_isMatchToAbsoluteNegative(e,n,r){if(0===n.length)return!1;const o=t.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(o,n,r)}_isMatchToPatterns(e,n,r){if(0===n.length)return!1;const o=t.pattern.matchAny(e,n);return!o&&r?t.pattern.matchAny(e+"/",n):o}},yn}(),r=function(){if(mn)return Rn;mn=1,Object.defineProperty(Rn,"__esModule",{value:!0});const t=Ht();return Rn.default=class{constructor(t){this._settings=t}getFilter(){return t=>this._isNonFatalError(t)}_isNonFatalError(e){return t.errno.isEnoentCodeError(e)||this._settings.suppressErrors}},Rn}(),s=function(){if(Sn)return En;Sn=1,Object.defineProperty(En,"__esModule",{value:!0});const t=Ht();return En.default=class{constructor(t){this._settings=t}getTransformer(){return t=>this._transform(t)}_transform(e){let n=e.path;return this._settings.absolute&&(n=t.path.makeAbsolute(this._settings.cwd,n),n=t.path.unixify(n)),this._settings.markDirectories&&e.dirent.isDirectory()&&(n+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:n}):n}},En}();return pn.default=class{constructor(t){this._settings=t,this.errorFilter=new r.default(this._settings),this.entryFilter=new n.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new e.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new s.default(this._settings)}_getRootDirectory(e){return t.resolve(this._settings.cwd,e.base)}_getReaderOptions(t){const e="."===t.base?"":t.base;return{basePath:e,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(e,t.positive,t.negative),entryFilter:this.entryFilter.getFilter(t.positive,t.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}},pn}function An(){if(vn)return Ft;vn=1,Object.defineProperty(Ft,"__esModule",{value:!0});const t=function(){if(on)return jt;on=1,Object.defineProperty(jt,"__esModule",{value:!0});const t=Je(),e=nn(),n=an();class r extends e.default{constructor(){super(...arguments),this._walkAsync=t.walk,this._readerStream=new n.default(this._settings)}dynamic(t,e){return new Promise((n,r)=>{this._walkAsync(t,e,(t,e)=>{null===t?n(e):r(t)})})}async static(t,e){const n=[],r=this._readerStream.static(t,e);return new Promise((t,e)=>{r.once("error",e),r.on("data",t=>n.push(t)),r.once("end",()=>t(n))})}}return jt.default=r,jt}(),e=Pn();class n extends e.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}async read(t){const e=this._getRootDirectory(t),n=this._getReaderOptions(t);return(await this.api(e,t,n)).map(t=>n.transform(t))}api(t,e,n){return e.dynamic?this._reader.dynamic(t,n):this._reader.static(e.patterns,n)}}return Ft.default=n,Ft}var Cn,xn={};var On,Tn,wn={},kn={};function $n(){if(Tn)return wn;Tn=1,Object.defineProperty(wn,"__esModule",{value:!0});const t=function(){if(On)return kn;On=1,Object.defineProperty(kn,"__esModule",{value:!0});const t=se(),e=Je(),n=nn();class r extends n.default{constructor(){super(...arguments),this._walkSync=e.walkSync,this._statSync=t.statSync}dynamic(t,e){return this._walkSync(t,e)}static(t,e){const n=[];for(const r of t){const t=this._getFullEntryPath(r),o=this._getEntry(t,r,e);null!==o&&e.entryFilter(o)&&n.push(o)}return n}_getEntry(t,e,n){try{const n=this._getStat(t);return this._makeEntry(n,e)}catch(t){if(n.errorFilter(t))return null;throw t}}_getStat(t){return this._statSync(t,this._fsStatSettings)}}return kn.default=r,kn}(),e=Pn();class n extends e.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}read(t){const e=this._getRootDirectory(t),n=this._getReaderOptions(t);return this.api(e,t,n).map(n.transform)}api(t,e,n){return e.dynamic?this._reader.dynamic(t,n):this._reader.static(e.patterns,n)}}return wn.default=n,wn}var Ln,Mn,Hn,Dn={};async function Fn(t,r){const o=n.dirname(t);await e.promises.mkdir(o,{recursive:!0}),await e.promises.writeFile(t,r,"utf-8")}!function(){if(Hn)return Mn;Hn=1;const t=function(){if($t)return l;$t=1,Object.defineProperty(l,"__esModule",{value:!0}),l.convertPatternGroupToTask=l.convertPatternGroupsToTasks=l.groupPatternsByBaseDirectory=l.getNegativePatternsAsPositive=l.getPositivePatterns=l.convertPatternsToTasks=l.generate=void 0;const t=Ht();function e(e,n){let r=e;return n.braceExpansion&&(r=t.pattern.expandPatternsWithBraceExpansion(r)),n.baseNameMatch&&(r=r.map(t=>t.includes("/")?t:`**/${t}`)),r.map(e=>t.pattern.removeDuplicateSlashes(e))}function n(e,n,r){const o=[],u=t.pattern.getPatternsOutsideCurrentDirectory(e),c=t.pattern.getPatternsInsideCurrentDirectory(e),l=s(u),p=s(c);return o.push(...i(l,n,r)),"."in p?o.push(a(".",c,n,r)):o.push(...i(p,n,r)),o}function r(e){return t.pattern.getPositivePatterns(e)}function o(e,n){return t.pattern.getNegativePatterns(e).concat(n).map(t.pattern.convertToPositivePattern)}function s(e){return e.reduce((e,n)=>{const r=t.pattern.getBaseDirectory(n);return r in e?e[r].push(n):e[r]=[n],e},{})}function i(t,e,n){return Object.keys(t).map(r=>a(r,t[r],e,n))}function a(e,n,r,o){return{dynamic:o,positive:n,negative:r,base:e,patterns:[].concat(n,r.map(t.pattern.convertToNegativePattern))}}return l.generate=function(s,i){const a=e(s,i),u=e(i.ignore,i),c=r(a),l=o(a,u),p=c.filter(e=>t.pattern.isStaticPattern(e,i)),f=c.filter(e=>t.pattern.isDynamicPattern(e,i)),h=n(p,l,!1),d=n(f,l,!0);return h.concat(d)},l.convertPatternsToTasks=n,l.getPositivePatterns=r,l.getNegativePatternsAsPositive=o,l.groupPatternsByBaseDirectory=s,l.convertPatternGroupsToTasks=i,l.convertPatternGroupToTask=a,l}(),e=An(),n=function(){if(Cn)return xn;Cn=1,Object.defineProperty(xn,"__esModule",{value:!0});const t=i,e=an(),n=Pn();class r extends n.default{constructor(){super(...arguments),this._reader=new e.default(this._settings)}read(e){const n=this._getRootDirectory(e),r=this._getReaderOptions(e),o=this.api(n,e,r),s=new t.Readable({objectMode:!0,read:()=>{}});return o.once("error",t=>s.emit("error",t)).on("data",t=>s.emit("data",r.transform(t))).once("end",()=>s.emit("end")),s.once("close",()=>o.destroy()),s}api(t,e,n){return e.dynamic?this._reader.dynamic(t,n):this._reader.static(e.patterns,n)}}return xn.default=r,xn}(),o=$n(),s=(Ln||(Ln=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;const e=u,n=r,o=Math.max(n.cpus().length,1);t.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:e.lstat,lstatSync:e.lstatSync,stat:e.stat,statSync:e.statSync,readdir:e.readdir,readdirSync:e.readdirSync},t.default=class{constructor(t={}){this._options=t,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,o),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(t,e){return void 0===t?e:t}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},t.DEFAULT_FILE_SYSTEM_ADAPTER),e)}}}(Dn)),Dn),a=Ht();async function c(t,n){f(t);const r=p(t,e.default,n),o=await Promise.all(r);return a.array.flatten(o)}function p(e,n,r){const o=[].concat(e),i=new s.default(r),a=t.generate(o,i),u=new n(i);return a.map(u.read,u)}function f(t){if(![].concat(t).every(t=>a.string.isString(t)&&!a.string.isEmpty(t)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}(function(e){function r(t,e){f(t);const n=p(t,o.default,e);return a.array.flatten(n)}function i(t,e){f(t);const r=p(t,n.default,e);return a.stream.merge(r)}var u,c;e.glob=e,e.globSync=r,e.globStream=i,e.async=e,e.sync=r,e.stream=i,e.generateTasks=function(e,n){f(e);const r=[].concat(e),o=new s.default(n);return t.generate(r,o)},e.isDynamicPattern=function(t,e){f(t);const n=new s.default(e);return a.pattern.isDynamicPattern(t,n)},e.escapePath=function(t){return f(t),a.path.escape(t)},e.convertPathToPattern=function(t){return f(t),a.path.convertPathToPattern(t)},(u=e.posix||(e.posix={})).escapePath=function(t){return f(t),a.path.escapePosixPath(t)},u.convertPathToPattern=function(t){return f(t),a.path.convertPosixPathToPattern(t)},(c=e.win32||(e.win32={})).escapePath=function(t){return f(t),a.path.escapeWindowsPath(t)},c.convertPathToPattern=function(t){return f(t),a.path.convertWindowsPathToPattern(t)}})(c||(c={})),Mn=c}();exports.generateReactRoutesHMR=(t,r,o,s,i)=>{const a=n.resolve(r,t);if(!e.existsSync(a))throw new Error(`[ono-auto-router] Pages directory does not exist: ${a}`);const u=o.split(".")[0],c=(t=>`// Auto-generated by ono-auto-router${t?"\nexport { defineConfig } from './defineConfig'":""}\nexport { routes } from './getRoutes'\n`)(i),l=s?((t,e)=>`// Auto-generated by ono-auto-router${e?"\nimport {\n lazy,\n Suspense,\n type ComponentType,\n type JSX,\n type LazyExoticComponent\n} from 'react'\nimport type { RouteObject } from 'react-router'\nimport { replaceBracketsWithColon } from './utils'\nimport type { PagesComponentType } from './types'\n\ninterface MyRouteObject extends Omit<RouteObject, 'path' | 'children'> {\n path: string\n type?: 'single' | 'wrap'\n children?: MyRouteObject[]\n}\n\nexport interface PageConfig extends Partial<Omit<MyRouteObject, 'children'>> {\n loading?: JSX.Element | true\n}\n":"\nimport { replaceBracketsWithColon } from './utils'\n"}\nconst PATH_REPLACEMENTS${e?": Record<string, string>":""} = {\n '/home': '/',\n '/root': '/'\n}\n\nconst cachedLazyComponents${e?": Record<\n string,\n LazyExoticComponent<ComponentType<unknown>>\n>":""} = {}\n\nconst getConfigFileName = (pagePath: string): string => {\n if (pagePath.endsWith('.tsx')) {\n return pagePath.slice(0, -4) + '.config.ts'\n }\n return pagePath.replace('index.ts', 'index.config.ts')\n}\n\nconst formatPageModule = (${e?"\n pagesComponent: Record<string, ComponentType<unknown>>,\n pagesModule: Record<string, PageConfig>\n":"pagesComponent, pagesModule"})${e?": [string, PageConfig][]":""} => {\n return Object.keys(pagesComponent).map(page => {\n const configKey = getConfigFileName(page)\n return [configKey, pagesModule[configKey] || {}]\n })\n}\n\nconst normalizePath = ${e?"(pathStr: string): string":"(pathStr)"} => {\n if (PATH_REPLACEMENTS[pathStr]) {\n return PATH_REPLACEMENTS[pathStr]\n }\n\n const lowerPath = pathStr.toLowerCase()\n if (lowerPath === '/notfound' || pathStr === '/404') {\n return '/*'\n }\n\n return pathStr\n}\n\nconst getBasename = ${e?"(filePath: string, ext?: string): string":"(filePath, ext)"} => {\n const parts = filePath.split('/')\n const lastPart = parts[parts.length - 1]\n if (ext && lastPart.endsWith(ext)) {\n return lastPart.slice(0, -ext.length)\n }\n return lastPart\n}\n\nconst getDirname = ${e?"(filePath: string): string":"(filePath)"} => {\n const parts = filePath.split('/')\n parts.pop()\n return parts.join('/')\n}\n\nconst getCompPathFromConfig = ${e?"(configPath: string): string":"(configPath)"} => {\n if (configPath.endsWith('.config.ts')) {\n const fileName = getBasename(configPath, '.config.ts')\n if (fileName === 'index') {\n return configPath.replace('index.config.ts', 'index.tsx')\n }\n return configPath.slice(0, -10) + '.tsx'\n }\n return configPath.replace('index.config.ts', 'index.tsx')\n}\n\nconst getRawPathFromConfig = ${e?"(configPath: string): string":"(configPath)"} => {\n if (configPath.endsWith('.config.ts')) {\n const fileName = getBasename(configPath, '.config.ts')\n const dirPath = getDirname(configPath).replace('/${t}', '')\n if (fileName === 'index') {\n return dirPath || '/'\n }\n return dirPath ? dirPath + '/' + fileName : '/' + fileName\n }\n return (\n configPath.replace('/${t}', '').replace('/index.config.ts', '') || '/'\n )\n}\n\nconst getFileDefault = ${e?"(modules: Record<string, { default: unknown }>)":"(modules)"} => {\n const result${e?": Record<string, unknown>":""} = {}\n\n for (const [path, module] of Object.entries(modules)) {\n if ('default' in module) {\n result[path] = module.default\n }\n }\n\n return result\n}\n\nconst filterUnComponent = ${e?"(pagesComponent: PagesComponentType)":"(pagesComponent)"} => {\n const result: PagesComponentType = {}\n\n for (const key of Object.keys(pagesComponent)) {\n if (!key.includes('.config.tsx')) {\n result[key] = pagesComponent[key]\n }\n }\n\n return result\n}\n\nconst LazyComponent = ({\n Element\n}:${e?" {\n Element: LazyExoticComponent<ComponentType<unknown>>\n}":""}) => {\n return (\n <Suspense>\n <Element />\n </Suspense>\n )\n}\n\nexport const createBaseRoutes = () => {\n const pagesComponent = filterUnComponent({\n ...import.meta.glob('/${t}/**/*.${e?"tsx":"jsx"}')${e?" as PagesComponentType":""}\n })\n\n const pagesString = getFileDefault({\n ...import.meta.glob('/${t}/**/*.${e?"tsx":"jsx"}', {\n eager: true\n })\n })${e?" as Record<string, ComponentType<unknown>>":""}\n\n const pagesModule = getFileDefault({\n ...import.meta.glob('/${t}/**/*.config.${e?"ts":"js"}', {\n eager: true\n })\n })${e?" as Record<string, PageConfig>":""}\n\n const result${e?": (MyRouteObject & { isRoot?: boolean })[]":""} = []\n\n for (const [pagePath, page] of formatPageModule(pagesString, pagesModule)) {\n const compPath = getCompPathFromConfig(pagePath)\n\n if (!pagesComponent[compPath]) continue\n\n const rawPath = page?.path || getRawPathFromConfig(pagePath) || '/'\n const processedPath = replaceBracketsWithColon(rawPath)\n const routePath = normalizePath(processedPath)\n\n let Component: MyRouteObject['element']\n if (page?.element) {\n Component = page.element\n } else {\n if (!cachedLazyComponents[compPath]) {\n cachedLazyComponents[compPath] = lazy(pagesComponent[compPath])\n }\n\n Component = <LazyComponent Element={cachedLazyComponents[compPath]} />\n }\n result.push({\n ...page,\n path: routePath,\n type: page?.type,\n isRoot: processedPath === '/root',\n element: Component\n })\n }\n\n return result\n}\n`)(t,i):((t,e)=>`// Auto-generated by ono-auto-router${e?"\nimport type { ComponentType, JSX } from 'react'\nimport type { RouteObject } from 'react-router'\nimport { replaceBracketsWithColon } from './utils'\nimport type { PagesComponentType } from './types'\n\ninterface MyRouteObject extends Omit<RouteObject, 'path' | 'children'> {\n path: string\n type?: 'single' | 'wrap'\n children?: MyRouteObject[]\n}\n\nexport interface PageConfig extends Partial<Omit<MyRouteObject, 'children'>> {\n loading?: JSX.Element | true\n}\n":"\nimport { replaceBracketsWithColon } from './utils'\n"}\nconst PATH_REPLACEMENTS${e?": Record<string, string>":""} = {\n '/home': '/',\n '/root': '/'\n}\n\nconst getConfigFileName = (pagePath: string): string => {\n if (pagePath.endsWith('.tsx')) {\n return pagePath.slice(0, -4) + '.config.ts'\n }\n return pagePath.replace('index.ts', 'index.config.ts')\n}\n\nconst formatPageModule = (${e?"\n pagesComponent: PagesComponentType,\n pagesModule: Record<string, PageConfig>\n":"pagesComponent, pagesModule"})${e?": [string, PageConfig][]":""} => {\n return Object.keys(pagesComponent).map(page => {\n const configKey = getConfigFileName(page)\n return [configKey, pagesModule[configKey] || {}]\n })\n}\n\nconst normalizePath = ${e?"(pathStr: string): string":"(pathStr)"} => {\n if (PATH_REPLACEMENTS[pathStr]) {\n return PATH_REPLACEMENTS[pathStr]\n }\n\n const lowerPath = pathStr.toLowerCase()\n if (lowerPath === '/notfound' || pathStr === '/404') {\n return '/*'\n }\n\n return pathStr\n}\n\nconst getBasename = ${e?"(filePath: string, ext?: string): string":"(filePath, ext)"} => {\n const parts = filePath.split('/')\n const lastPart = parts[parts.length - 1]\n if (ext && lastPart.endsWith(ext)) {\n return lastPart.slice(0, -ext.length)\n }\n return lastPart\n}\n\nconst getDirname = ${e?"(filePath: string): string":"(filePath)"} => {\n const parts = filePath.split('/')\n parts.pop()\n return parts.join('/')\n}\n\nconst getCompPathFromConfig = ${e?"(configPath: string): string":"(configPath)"} => {\n if (configPath.endsWith('.config.ts')) {\n const fileName = getBasename(configPath, '.config.ts')\n if (fileName === 'index') {\n return configPath.replace('index.config.ts', 'index.tsx')\n }\n return configPath.slice(0, -10) + '.tsx'\n }\n return configPath.replace('index.config.ts', 'index.tsx')\n}\n\nconst getRawPathFromConfig = ${e?"(configPath: string): string":"(configPath)"} => {\n if (configPath.endsWith('.config.ts')) {\n const fileName = getBasename(configPath, '.config.ts')\n const dirPath = getDirname(configPath).replace('/${t}', '')\n if (fileName === 'index') {\n return dirPath || '/'\n }\n return dirPath ? dirPath + '/' + fileName : '/' + fileName\n }\n return (\n configPath.replace('/${t}', '').replace('/index.config.ts', '') || '/'\n )\n}\n\nconst getFileDefault = ${e?"(modules: Record<string, { default: unknown }>)":"(modules)"} => {\n const result: PagesComponentType | Record<string, PageConfig> = {}\n\n for (const [path, module] of Object.entries(modules)) {\n if ('default' in module) {\n result[path] = module.default as ComponentType<unknown> | PageConfig\n }\n }\n\n return result\n}\n\nconst filterUnComponent = ${e?"(pagesComponent: PagesComponentType)":"(pagesComponent)"} => {\n const result: PagesComponentType = {}\n\n for (const key of Object.keys(pagesComponent)) {\n if (!key.includes('.config.tsx')) {\n result[key] = pagesComponent[key]\n }\n }\n\n return result\n}\n\nexport const createBaseRoutes = () => {\n const pagesComponent = filterUnComponent(\n getFileDefault({\n ...import.meta.glob('/${t}/**/*.${e?"tsx":"jsx"}', { eager: true })\n })${e?" as PagesComponentType":""}\n )\n\n const pagesModule = getFileDefault({\n ...import.meta.glob('/${t}/**/*.config.${e?"ts":"js"}', {\n eager: true\n })\n })${e?" as Record<string, PageConfig>":""}\n\n const result${e?": (MyRouteObject & { isRoot?: boolean })[]":""} = []\n\n for (const [pagePath, page] of formatPageModule(pagesComponent, pagesModule)) {\n const compPath = getCompPathFromConfig(pagePath)\n\n if (!pagesComponent[compPath]) continue\n\n const rawPath = page?.path || getRawPathFromConfig(pagePath) || '/'\n const processedPath = replaceBracketsWithColon(rawPath)\n const routePath = normalizePath(processedPath)\n\n const Component = pagesComponent[compPath]\n result.push({\n ...page,\n path: routePath,\n type: page?.type,\n isRoot: processedPath === '/root',\n element: <Component />\n })\n }\n\n return result\n}\n`)(t,i),p=(t=>`// Auto-generated by ono-auto-router\nimport { hasDuplicateProperty } from './utils'\nimport { buildRouteTree } from './buildRouteTree'\nimport { cleanIsRoot } from './cleanIsRoot'\nimport { removeEmptyChildren } from './removeEmptyChildren'${t?"\nimport type { MyRouteObject } from './types'":""}\n\nconst processRoute = ${t?"(route: MyRouteObject): MyRouteObject":"(route)"} =>\n cleanIsRoot(removeEmptyChildren(route))\n\nconst processRoutes = ${t?"(routes: MyRouteObject[]): MyRouteObject[]":"(routes)"} =>\n buildRouteTree(routes).map(processRoute)\n\nconst handleRootRoute = ${t?"(routes: (MyRouteObject & { isRoot?: boolean })[])":"(routes)"} => {\n let rootRoute${t?": MyRouteObject | undefined":" = undefined"}\n let homeRoute${t?": MyRouteObject | undefined":" = undefined"}\n let notFoundRoute${t?": MyRouteObject | undefined":" = undefined"}\n const filteredRoutes${t?": MyRouteObject[]":""} = []\n\n for (const route of routes) {\n if (route.isRoot) {\n if (rootRoute)\n throw new Error('There cannot be multiple root routes in a route')\n rootRoute = route\n } else if (route.path === '/') {\n homeRoute = route\n } else if (route.path === '/*') {\n notFoundRoute = route\n } else {\n filteredRoutes.push(route)\n }\n }\n\n if (hasDuplicateProperty(filteredRoutes, 'path'))\n throw new Error('There cannot be duplicate paths in a route')\n\n const children = [\n homeRoute && { ...homeRoute, index: true },\n ...processRoutes(filteredRoutes)\n ].filter((route): route is NonNullable<typeof route> => Boolean(route))\n\n const result${t?": MyRouteObject[]":""} = []\n\n if (rootRoute) {\n result.push(cleanIsRoot({ ...rootRoute, children }))\n }\n\n if (notFoundRoute) {\n result.push(cleanIsRoot(notFoundRoute))\n }\n\n return result\n}\n\nexport const formatRoutes = (\n routes${t?": (MyRouteObject & { isRoot?: boolean })[]":""}\n) => {\n if (routes.some(r => r.isRoot)) return handleRootRoute(routes)\n\n if (hasDuplicateProperty(routes, 'path'))\n throw new Error('There cannot be duplicate paths in a route')\n\n return processRoutes(routes)\n}\n`)(i),f=(t=>`// Auto-generated by ono-auto-router${t?"\nimport type { MyRouteObject } from './types'\n":""}\nconst processSingleRoute = ${t?"(route: MyRouteObject): MyRouteObject":"(route)"} => {\n if (route.index) {\n return route\n }\n\n if (route.type !== 'wrap') {\n const { path: routePath, children, ...extraProps } = route\n const hasExtraProps = Object.keys(extraProps).length > 0\n\n if (hasExtraProps) {\n const indexRoute: MyRouteObject = {\n path: '',\n index: true,\n ...extraProps\n }\n\n return {\n path: routePath,\n children: [indexRoute, ...(children || []).map(processSingleRoute)]\n }\n }\n }\n\n if (route.children) {\n return {\n ...route,\n children: route.children.map(processSingleRoute)\n }\n }\n\n return route\n}\n\nconst formatRouteTree = ${t?"(routes: MyRouteObject[]): MyRouteObject[]":"(routes)"} => {\n return routes.map(processSingleRoute)\n}\n\nconst buildTreeStructure = ${t?"(routes: MyRouteObject[]): MyRouteObject[]":"(routes)"} => {\n const routeMap = new Map${t?"<string, MyRouteObject>":""}()\n const rootRoutes${t?": MyRouteObject[]":""} = []\n const pathPartsCache = new Map${t?"<string, string[]>":""}()\n\n const getPathParts = ${t?"(pathStr: string): string[]":"(pathStr)"} => {\n let parts = pathPartsCache.get(pathStr)\n if (parts === undefined) {\n parts = pathStr === '/' ? [] : pathStr.split('/').filter(Boolean)\n pathPartsCache.set(pathStr, parts)\n }\n return parts\n }\n\n const sortedRoutes = routes\n .slice()\n .sort((a, b) => a.path.length - b.path.length)\n\n for (const route of sortedRoutes) {\n const routePath = route.path\n const pathParts = getPathParts(routePath)\n const currentRoute = { ...route, children: [] }\n routeMap.set(routePath, currentRoute)\n\n if (pathParts.length <= 1) {\n rootRoutes.push(currentRoute)\n continue\n }\n\n const parentPath = '/' + pathParts.slice(0, -1).join('/')\n const parentRoute = routeMap.get(parentPath)\n\n if (parentRoute) {\n currentRoute.path = pathParts[pathParts.length - 1]\n parentRoute.children!.push(currentRoute)\n } else {\n rootRoutes.push(currentRoute)\n }\n }\n\n return rootRoutes\n}\n\nexport const buildRouteTree = ${t?"(routes: MyRouteObject[]): MyRouteObject[]":"(routes)"} => {\n const treeStructure = buildTreeStructure(routes)\n return formatRouteTree(treeStructure)\n}\n`)(i),h=(t=>`// Auto-generated by ono-auto-router${t?"\nimport type { MyRouteObject } from './types'\n\ntype RouteWithIsRoot = MyRouteObject & { isRoot?: boolean }\n":""}\nexport const cleanIsRoot = ${t?"(route: RouteWithIsRoot): MyRouteObject":"(route)"} => {\n const { isRoot, type, children, ...rest } = route as RouteWithIsRoot & {\n type?: unknown\n }\n\n if (!children?.length) {\n return rest\n }\n\n return {\n ...rest,\n children: children.map(cleanIsRoot)\n }\n}\n`)(i),d=(t=>`// Auto-generated by ono-auto-router${t?"\nimport type { MyRouteObject } from './types'\n":""}\nexport const removeEmptyChildren = ${t?"(route: MyRouteObject): MyRouteObject":"(route)"} => {\n const { children } = route\n\n if (!children?.length) {\n const { children: _, ...rest } = route\n return rest\n }\n\n const processedChildren = children.map(removeEmptyChildren)\n\n if (route.type === 'wrap') {\n return { ...route, children: processedChildren }\n }\n\n const { path, element, type, children: _, ...rest } = route\n\n if (!element) {\n return { path, ...rest, children: processedChildren }\n }\n\n return {\n path,\n children: [\n { index: true, element, ...rest } as MyRouteObject,\n ...processedChildren\n ]\n }\n}\n`)(i),g=i?"// Auto-generated by ono-auto-router\nimport type { PageConfig } from './types'\nexport const defineConfig = (config: PageConfig) => config\n":"",_=(t=>`// Auto-generated by ono-auto-router${t?"\nimport type { RouteObject } from 'react-router'":""}\nimport { createBaseRoutes } from './createBaseRoutes'\nimport { formatRoutes } from './formatRoutes'\n\nconst getRoutes = () => {\n const baseRoutes = createBaseRoutes()\n const formattedRoutes = formatRoutes(baseRoutes)${t?" as RouteObject[]":""}\n return formattedRoutes\n}\n\nexport const routes = getRoutes()\n`)(i),y=i?(t=>`// Auto-generated by ono-auto-router\nimport type { ComponentType } from 'react'\nimport type { RouteObject } from 'react-router'\n\n${t?"export type PagesComponentType = Record<\n string,\n () => Promise<{ default: ComponentType<unknown> }>\n>":"export type PagesComponentType = Record<string, ComponentType<unknown>>"}\n\nexport interface MyRouteObject extends Omit<RouteObject, 'path' | 'children'> {\n path: string\n type?: 'single' | 'wrap'\n children?: MyRouteObject[]\n}\n\nexport type PageConfig = Partial<\n Omit<MyRouteObject, 'Component' | 'element' | 'children'>\n>\n`)(s):"",m=(t=>`// Auto-generated by ono-auto-router\nexport const hasDuplicateProperty = ${t?"<T>(items: T[], propName: keyof T)":"(items, propName)"} => {\n const seenValues = new Set()\n return items.some(item => {\n if (seenValues.has(item[propName])) {\n return true\n }\n seenValues.add(item[propName])\n return false\n })\n}\n\nexport const replaceBracketsWithColon = ${t?"(str: string)":"(str)"} => {\n return str.replace(/\\[([^\\]]+)\\]/g, ':$1').replace('.tsx', '')\n}\n`)(i);Fn(n.resolve(u,"./index.ts"),c),Fn(n.resolve(u,"./createBaseRoutes.tsx"),l),Fn(n.resolve(u,"./formatRoutes.ts"),p),Fn(n.resolve(u,"./buildRouteTree.ts"),f),Fn(n.resolve(u,"./cleanIsRoot.ts"),h),Fn(n.resolve(u,"./removeEmptyChildren.ts"),d),g&&Fn(n.resolve(u,"./defineConfig.ts"),g),y&&Fn(n.resolve(u,"./types.ts"),y),Fn(n.resolve(u,"./getRoutes.ts"),_),Fn(n.resolve(u,"./utils.ts"),m)};