import{a as n,g as P}from"./chunk-WGB426CL.js";P();var A=/\\/g,C=/(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/;function z(e){return e===47||e===92}n(z,"isAnyDirectorySeparator");function V(e){return a(e)<0}n(V,"isUrl");function k(e){return a(e)!==0}n(k,"isPathAbsolute");function b(e){return e>=97&&e<=122||e>=65&&e<=90}n(b,"isVolumeCharacter");function I(e,r){let t=e.charCodeAt(r);if(t===58)return r+1;if(t===37&&e.charCodeAt(r+1)===51){let o=e.charCodeAt(r+2);if(o===97||o===65)return r+3}return-1}n(I,"getFileUrlVolumeSeparatorEnd");function f(e){let r=a(e);return r<0?~r:r}n(f,"getRootLength");function a(e){if(!e)return 0;let r=e.charCodeAt(0);if(r===47||r===92){if(e.charCodeAt(1)!==r)return 1;let o=e.indexOf(r===47?"/":"\\",2);return o<0?e.length:o+1}if(b(r)&&e.charCodeAt(1)===58){let o=e.charCodeAt(2);if(o===47||o===92)return 3;if(e.length===2)return 2}let t=e.indexOf("://");if(t!==-1){let o=t+3,u=e.indexOf("/",o);if(u!==-1){let c=e.slice(0,t),i=e.slice(o,u);if(c==="file"&&(i===""||i==="localhost")&&b(e.charCodeAt(u+1))){let s=I(e,u+2);if(s!==-1){if(e.charCodeAt(s)===47)return~(s+1);if(s===e.length)return~s}}return~(u+1)}return~e.length}return 0}n(a,"getEncodedRootLength");function W(e){e=l(e);let r=f(e);return r===e.length?e:(e=E(e),e.slice(0,Math.max(r,e.lastIndexOf("/"))))}n(W,"getDirectoryPath");function L(e){return e=l(e),f(e)===e.length?"":(e=E(e),e.slice(Math.max(f(e),e.lastIndexOf("/")+1)))}n(L,"getBaseFileName");function $(e){let r=L(e),t=r.lastIndexOf(".");return t>=0?r.substring(t).toLowerCase():""}n($,"getAnyExtensionFromPath");function N(e,r){let t=e.substring(0,r),o=e.substring(r).split("/");return o.length&&!o[o.length-1]&&o.pop(),[t,...o]}n(N,"pathComponents");function d(e,r=""){return e=v(r,e),N(e,f(e))}n(d,"getPathComponents");function g(e){if(!e.some(t=>t!==void 0))return[];let r=[e[0]];for(let t=1;t<e.length;t++){let o=e[t];if(o&&o!=="."){if(o===".."){if(r.length>1){if(r[r.length-1]!==".."){r.pop();continue}}else if(r[0])continue}r.push(o)}}return r}n(g,"reducePathComponents");function v(e,...r){e&&(e=l(e));for(let t of r)t&&(t=l(t),!e||f(t)!==0?e=t:e=m(e)+t);return e}n(v,"joinPaths");function B(e,...r){return F(r.some(t=>t!==void 0)?v(e,...r):l(e))}n(B,"resolvePath");function h(e,r){return g(d(e,r))}n(h,"getNormalizedPathComponents");function G(e,r){return x(h(e,r))}n(G,"getNormalizedAbsolutePath");function F(e){if(e=l(e),!C.test(e))return e;let r=e.replace(/\/\.\//g,"/").replace(/^\.\//,"");if(r!==e&&(e=r,!C.test(e)))return e;let t=x(g(d(e)));return t&&S(e)?m(t):t}n(F,"normalizePath");function O(e){return e.length===0?"":e.slice(1).join("/")}n(O,"getPathWithoutRoot");function H(e,r){return O(h(e,r))}n(H,"getNormalizedAbsolutePathWithoutRoot");function x(e){return e.length===0?"":(e[0]&&m(e[0]))+e.slice(1).join("/")}n(x,"getPathFromPathComponents");function E(e){return S(e)?e.substring(0,e.length-1):e}n(E,"removeTrailingDirectorySeparator");function m(e){return S(e)?e:e+"/"}n(m,"ensureTrailingDirectorySeparator");function S(e){return e.length>0&&z(e.charCodeAt(e.length-1))}n(S,"hasTrailingDirectorySeparator");function l(e){let r=e.indexOf("\\");return r===-1?e:(A.lastIndex=r,e.replace(A,"/"))}n(l,"normalizeSlashes");function T(e,r){return e===r}n(T,"equateValues");function R(e,r){return e===r||e!==void 0&&r!==void 0&&e.toUpperCase()===r.toUpperCase()}n(R,"equateStringsCaseInsensitive");function U(e,r){return T(e,r)}n(U,"equateStringsCaseSensitive");function j(e){return e}n(j,"identity");function q(e,r,t,o){let u=g(d(e)),c=g(d(r)),i;for(i=0;i<u.length&&i<c.length;i++){let D=o(u[i]),p=o(c[i]);if(!(i===0?R:t)(D,p))break}if(i===0)return c;let s=c.slice(i),y=[];for(;i<u.length;i++)y.push("..");return["",...y,...s]}n(q,"getPathComponentsRelativeTo");function J(e,r,t){if(f(e)>0!=f(r)>0)throw new Error("Paths must either both be absolute or both be relative");let c=q(e,r,(typeof t=="boolean"?t:!1)?R:U,typeof t=="function"?t:j);return x(c)}n(J,"getRelativePathFromDirectory");export{z as a,V as b,k as c,f as d,W as e,L as f,$ as g,d as h,g as i,v as j,B as k,h as l,G as m,F as n,H as o,x as p,E as q,m as r,S as s,l as t,J as u};
