import*as f from"path";import{resolve as p}from"path";import{fileURLToPath as u}from"url";import{combineUrls as c}from"@redocly/theme/core/utils";import{VERSION_SEPARATOR as n}from"../constants/common.js";import{reporter as l}from"../tools/notifiers/reporter.js";import{pathMatchesGlobPattern as i}from"./index.js";function _(r,t,...e){return c(r&&r!==t?"/"+r:"",...e)}function m(r){const t=u(r);return f.dirname(t)}function b(r,t){return p(m(r),t)}function A(r){let t=[];if(Array.isArray(r)){const e=r.map(o=>{if(o.includes(n)){const[s,a]=o.split(n);return t.push(a),s}return o});return t.length>1&&l.panicOnBuildContentError("Bad version files structure: subfolder versions does not support"),{data:e,version:t[0]}}if(r.includes(n)){const[e,o]=r.split(n);return{data:e,version:o}}return{data:r}}function R(r,t=[]){let e=!1;for(const o of t)o.startsWith("!")?i(r,o.slice(1))&&(e=!1):i(r,o)&&(e=!0);return e}function y(r){return typeof r=="string"&&!!r.match(/\.(svg|png|jpg|jpeg|gif|ico|webp)$/)}export{A as excludeVersion,b as fromCurrentDir,_ as generatePagePathname,y as isIconPath,R as isPathIgnored};
