function e(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;return t}function t(t){let n=(t??``).trim();return!n||n==="default"?null:`hsl(${e(n)%360} 68% 58%)`}function n(e,n){let r=(e??``).trim();return!r||r==="default"?null:n[r]??t(r)}var r=Array.from({length:12},(e,t)=>`hsl(${t*30} 68% 58%)`);function i(e,t=16){return`color-mix(in srgb, ${e} ${t}%, transparent)`}function a(e){let t=(e||``).trim().replace(/\\/g,`/`);return t?(t=t.startsWith(`//`)?`//${t.slice(2).replace(/\/{2,}/g,`/`)}`:t.replace(/\/{2,}/g,`/`),t.length>1&&t.endsWith(`/`)&&!/^[A-Za-z]:\/$/.test(t)&&(t=t.replace(/\/+$/,``)),t):``}function o(e){let t=a(e);return t?t.replace(/\/+$/,``):``}function s(e,t,n){if(!t)return!1;if(e===t)return!0;let r=`${t}/`;return n?e.toLowerCase().startsWith(r.toLowerCase())||e.toLowerCase()===t.toLowerCase():e.startsWith(r)||e===t}function c(e){let t=e.match(/^(\/Users\/[^/]+)(?:\/|$)/);return t||(t=e.match(/^(\/home\/[^/]+)(?:\/|$)/),t)||(t=e.match(/^([A-Za-z]:\/Users\/[^/]+)(?:\/|$)/),t)?t[1]:``}function l(e,t={}){let n=a(e||``);if(!n)return``;if(n===`~`||n.startsWith(`~/`))return n;let r=t.home?o(t.home):``,i=r||c(n);return!i||!s(n,i,!r||/^[A-Za-z]:\//.test(i)||i.startsWith(`/Users/`))?n:n.length===i.length?`~`:`~${n.slice(i.length)}`}function u(e){let t=a(e||``);return!t||t===`/`||t===`~`?t:/^[A-Za-z]:\/$/.test(t)||/^[A-Za-z]:$/.test(t)?t.endsWith(`/`)?t:`${t}/`:t.split(`/`).filter(Boolean).pop()||t}export{i as a,t as i,u as n,n as o,r,l as t};