@cldmv/fix-headers 2.2.7 → 2.4.0

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.
package/dist/index.mjs CHANGED
@@ -1,33 +1,37 @@
1
- var an=Object.defineProperty;var i=(e,t)=>an(e,"name",{value:t,configurable:!0});import{readFile as oi,stat as ii,writeFile as si}from"node:fs/promises";import{relative as Ye,resolve as qr}from"node:path";import{readFile as cn}from"node:fs/promises";import{createRequire as ln}from"node:module";import{dirname as un,isAbsolute as dn,resolve as ut}from"node:path";var fn=3e4,mn=new Set(["localhost","127.0.0.1","[::1]"]);function xe(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}i(xe,"isPlainObject");function we(e,t){let r={...e};for(let[n,o]of Object.entries(t))n!=="__proto__"&&(r[n]=xe(r[n])&&xe(o)?we(r[n],o):o);return r}i(we,"mergeConfig");function dt(e){return e.kind==="file"?e.path:e.href}i(dt,"describeSource");async function pn(e){if(e.kind==="file")return{text:await cn(e.path,"utf8"),source:e};let t;try{t=await fetch(e.href,{cache:"no-store",redirect:"follow",signal:AbortSignal.timeout(fn)})}catch(r){let n=r.cause instanceof Error?r.cause.message:r.message;throw new Error(`Failed to fetch config ${e.href}: ${n}`,{cause:r})}if(!t.ok)throw new Error(`Failed to fetch config ${e.href}: HTTP ${t.status} ${t.statusText}`);return{text:await t.text(),source:{kind:"url",href:t.url}}}i(pn,"readSource");function lt(e){if(e.protocol==="http:"&&!mn.has(e.hostname))throw new Error(`Refusing to fetch config over plain http: ${e.href} (use https)`);return{kind:"url",href:e.href}}i(lt,"toUrlSource");function hn(e,t){if(/^https?:\/\//i.test(e))return lt(new URL(e));if(/^[a-z][a-z\d+.-]+:\/\//i.test(e))throw new Error(`Unsupported extends URL "${e}" in ${dt(t)}; use https, a file path or a package path`);let r=/^\.{1,2}[\\/]/.test(e);if(t.kind==="url"){if(r||e.startsWith("/"))return lt(new URL(e,t.href));throw new Error(`Cannot extend package "${e}" from the remote config ${t.href}; use a URL or a relative path`)}if(r||dn(e))return{kind:"file",path:ut(un(t.path),e)};try{return{kind:"file",path:ln(t.path).resolve(e)}}catch(n){throw new Error(`Cannot resolve extends "${e}" from ${t.path}: ${n.message}`,{cause:n})}}i(hn,"resolveReference");function gn(e,t){if(e===void 0)return[];let r=Array.isArray(e)?e:[e];if(!r.every(n=>typeof n=="string"&&n.trim().length>0))throw new Error(`Config "extends" must be a string or an array of strings: ${t}`);return r.map(n=>n.trim())}i(gn,"readExtends");async function ft(e,t){let r=dt(e);if(t.includes(r))throw new Error(`Config extends cycle: ${[...t,r].join(" -> ")}`);let{text:n,source:o}=await pn(e),s;try{s=JSON.parse(n)}catch(u){throw new Error(`Config ${r} is not valid JSON: ${u.message}`,{cause:u})}if(!xe(s))throw new Error(`Config file must contain a JSON object: ${r}`);let{extends:a,...c}=s,l={};for(let u of gn(a,r))l=we(l,await ft(hn(u,o),[...t,r]));return we(l,c)}i(ft,"loadSource");function yn(e,t=process.cwd()){return ft({kind:"file",path:ut(t,e)},[])}i(yn,"loadConfigFile");async function mt(e,t){let r=typeof e[t]=="string"?e[t].trim():"";if(r.length===0)return e;let n=typeof e.cwd=="string"&&e.cwd.length>0?e.cwd:process.cwd(),o={...await yn(r,n),...e};return delete o[t],o}i(mt,"applyConfigOption");import{extname as be}from"node:path";import{extname as xn}from"node:path";var pt=[".css"];function wn(e){let t=xn(e).toLowerCase();return pt.includes(t)?{kind:"block",blockStart:"/*",blockLinePrefix:" * ",blockEnd:" */"}:null}i(wn,"resolveCssCommentSyntax");var ht={id:"css",extensions:pt,enabledByDefault:!0,keepsAboveHeader:i((e,t)=>t===0&&/^@charset "[^"]*";/.test(e),"keepsAboveHeader"),resolveCommentSyntax(e){return wn(e)}};import{extname as $n}from"node:path";var bn=/^(?:#|\/\/|\/\*+|<!--)[ \t]+(vi|vim(?:[<=>]?\d+)?|Vim|ex):(.*)$/,En=/^[a-z]+(?:[!&]|[+^-]?=(?:\\.|[^\s:\\])*)?$/,kn=new Set(["et","expandtab","ai","autoindent","si","smartindent","ro","readonly","bin","binary","noet","noexpandtab","noai","noautoindent","nosi","nosmartindent","noro","noreadonly","nobin","nobinary","nowrap","nolist","nospell","nofen","nofoldenable","noeol","nofixeol","nofixendofline"]);function ne(e){let t=e.match(bn);if(!t)return!1;let r=t[2].trim();if(r.endsWith("-->"))r=r.slice(0,-3).trimEnd();else if(r.endsWith("*/")){let s=r.length-2;for(;s>0&&r[s-1]==="*";)s-=1;r=r.slice(0,s).trimEnd()}let n=r.match(/^se(?:t)?[ \t]((?:\\.|[^:\\])*):/);if(!n&&t[1]==="Vim")return!1;let o=n?n[1].match(/(?:\\.|[^\s\\])+/g):r.match(/(?:\\.|[^\s:\\])+/g);return o!==null&&o.every(s=>En.test(s))&&o.some(s=>s.includes("=")||kn.has(s))}i(ne,"isModeline");function oe(e,t){return t===0&&e.startsWith("#!")}i(oe,"isShebang");function ie(e,t,r=0){let n=0,o=r;for(;n<e.length;){let s=e.indexOf(`
2
- `,n),a=s===-1?e.length:s+1;if(!t(e.slice(n,a).replace(/\r?\n$/,""),o))break;n=a,o+=1}return e.slice(0,n)}i(ie,"takeTopLines");var yt=[".go"];function Sn(e){let t=$n(e).toLowerCase();return yt.includes(t)?{kind:"block",blockStart:"/**",blockLinePrefix:" * ",blockEnd:" */"}:null}i(Sn,"resolveGoCommentSyntax");var gt=/^\/\/(?:go:build|\s*\+build)\s/;function Dn(e,t){let r=ie(t,o=>gt.test(o)||ne(o));if(!r.split(/\r?\n/).some(o=>gt.test(o)))return"";let n=t.slice(r.length);return`${r}${n.slice(0,n.length-n.replace(/^(?:[ \t]*\r?\n)*/,"").length)}`}i(Dn,"resolveGoPreservedPrefix");var xt={id:"go",extensions:yt,enabledByDefault:!0,resolvePreservedPrefix(e,t){return Dn(e,t)},resolveCommentSyntax(e){return Sn(e)}};import{extname as An}from"node:path";var wt=[".html",".htm"];function Cn(e){let t=An(e).toLowerCase();return wt.includes(t)?{kind:"html",blockStart:"<!--",blockLinePrefix:" ",blockEnd:"-->"}:null}i(Cn,"resolveHtmlCommentSyntax");var bt={id:"html",extensions:wt,enabledByDefault:!0,resolveCommentSyntax(e){return Cn(e)}};import{extname as Fn}from"node:path";var Et=[".jsonv",".jsonc",".json5"];function Nn(e){let t=Fn(e).toLowerCase();return Et.includes(t)?{kind:"block",blockStart:"/**",blockLinePrefix:" * ",blockEnd:" */"}:null}i(Nn,"resolveJsonCommentSyntax");var kt={id:"json",extensions:Et,enabledByDefault:!0,resolveCommentSyntax(e){return Nn(e)}};import{extname as vn}from"node:path";var $t=[".md",".markdown"];function Ln(e){let t=vn(e).toLowerCase();return $t.includes(t)?{kind:"html",blockStart:"<!--",blockLinePrefix:" ",blockEnd:"-->"}:null}i(Ln,"resolveMarkdownCommentSyntax");function Mn(e,t){let r=t.match(/^---\r?\n[\s\S]*?\r?\n---[ \t]*(?:\r?\n|$)/);return r?r[0]:""}i(Mn,"resolveMarkdownPreservedPrefix");var St={id:"markdown",extensions:$t,enabledByDefault:!1,requiresForce:!0,resolvePreservedPrefix(e,t){return Mn(e,t)},resolveCommentSyntax(e){return Ln(e)}};import{extname as Rn}from"node:path";var Dt=[".js",".mjs",".cjs",".ts",".tsx",".jsx"];function jn(e){let t=Rn(e).toLowerCase();return Dt.includes(t)?{kind:"block",blockStart:"/**",blockLinePrefix:" * ",blockEnd:" */"}:null}i(jn,"resolveNodeCommentSyntax");var At={id:"node",extensions:Dt,enabledByDefault:!0,keepsAboveHeader:oe,resolveCommentSyntax(e){return jn(e)}};import{extname as Pn}from"node:path";var Ft=[".php"];function In(e){let t=Pn(e).toLowerCase();return Ft.includes(t)?{kind:"block",blockStart:"/**",blockLinePrefix:" * ",blockEnd:" */"}:null}i(In,"resolvePhpCommentSyntax");var Ct=/^<\?php(?:\s|$)/i,Nt={id:"php",extensions:Ft,enabledByDefault:!0,keepsAboveHeader:i((e,t)=>t===0&&Ct.test(e),"keepsAboveHeader"),resolveContentSkipReason(e){return Ct.test(e.replace(/^\uFEFF/,""))?null:"the file does not start with <?php, so a comment at the top would be output as text"},resolveCommentSyntax(e){return In(e)}};import{extname as Tn}from"node:path";var vt=[".py"],On=/^#.*?(?<![A-Za-z])coding[:=]\s*[-\w.]+/;function Hn(e,t){return oe(e,t)||t<=1&&On.test(e)}i(Hn,"keepsAboveHeader");var Lt={id:"python",extensions:vt,enabledByDefault:!0,keepsAboveHeader:Hn,resolveCommentSyntax(e){let t=Tn(e).toLowerCase();return vt.includes(t)?{kind:"line",linePrefix:"#"}:null}};import{extname as _n}from"node:path";var Mt=[".rs"];function Bn(e){let t=_n(e).toLowerCase();return Mt.includes(t)?{kind:"block",blockStart:"/**",blockLinePrefix:" * ",blockEnd:" */"}:null}i(Bn,"resolveRustCommentSyntax");var Rt={id:"rust",extensions:Mt,enabledByDefault:!0,keepsAboveHeader:i((e,t)=>t===0&&e.startsWith("#!")&&!/^#!\s*\[/.test(e),"keepsAboveHeader"),resolveCommentSyntax(e){return Bn(e)}};import{extname as Un}from"node:path";var jt=[".yaml",".yml"];function zn(e){let t=Un(e).toLowerCase();return jt.includes(t)?{kind:"line",linePrefix:"#"}:null}i(zn,"resolveYamlCommentSyntax");var Pt={id:"yaml",extensions:jt,enabledByDefault:!0,keepsAboveHeader:i((e,t)=>t===0&&/^#cloud-config\s*$/.test(e),"keepsAboveHeader"),resolveCommentSyntax(e){return zn(e)}};var se=[ht,xt,bt,kt,St,At,Nt,Lt,Rt,Pt],Wn=new Map(se.map(e=>[e.id,e]));function Gn(e,t){return!t||typeof t!="object"?e:e.kind==="line"?{...e,linePrefix:typeof t.linePrefix=="string"&&t.linePrefix.length>0?t.linePrefix:e.linePrefix,lineSeparator:typeof t.lineSeparator=="string"?t.lineSeparator:e.lineSeparator}:{...e,blockStart:typeof t.blockStart=="string"&&t.blockStart.length>0?t.blockStart:e.blockStart,blockLinePrefix:typeof t.blockLinePrefix=="string"&&t.blockLinePrefix.length>0?t.blockLinePrefix:e.blockLinePrefix,blockEnd:typeof t.blockEnd=="string"&&t.blockEnd.length>0?t.blockEnd:e.blockEnd}}i(Gn,"applySyntaxOverride");function It(e){if(e==null)return[];if(!Array.isArray(e)||e.some(r=>typeof r!="string"))throw new Error(`forcedDetectors must be an array of detector ids, got ${JSON.stringify(e)}`);let t=se.filter(r=>r.requiresForce===!0).map(r=>r.id);for(let r of e){if(!Wn.has(r))throw new Error(`forcedDetectors: unknown detector "${r}" (force-only detectors: ${t.join(", ")})`);if(!t.includes(r))throw new Error(`forcedDetectors: "${r}" does not need forcing (force-only detectors: ${t.join(", ")})`)}return Array.from(new Set(e))}i(It,"resolveForcedDetectors");function T(e={}){let t=new Set(Array.isArray(e.enabledDetectors)?e.enabledDetectors:[]),r=new Set(Array.isArray(e.disabledDetectors)?e.disabledDetectors:[]),n=new Set(Array.isArray(e.forcedDetectors)?e.forcedDetectors:[]);return se.filter(o=>o.requiresForce===!0?n.has(o.id)&&!r.has(o.id):t.size>0?t.has(o.id):r.has(o.id)?!1:o.enabledByDefault)}i(T,"getEnabledDetectors");function Tt(e={}){if(Array.isArray(e.includeExtensions)&&e.includeExtensions.length>0)return new Set(e.includeExtensions.map(r=>r.toLowerCase()));let t=T(e);return new Set(t.flatMap(r=>r.extensions))}i(Tt,"getAllowedExtensions");function Ot(e,t={}){let r=be(e).toLowerCase();if(T(t).some(a=>a.extensions.includes(r)&&a.resolveCommentSyntax(e)!==null))return null;if(r.length===0)return"the file has no extension, so its comment syntax is unknown";let o=new Set(Array.isArray(t.forcedDetectors)?t.forcedDetectors:[]),s=se.find(a=>a.requiresForce===!0&&a.extensions.includes(r)&&!o.has(a.id));return s?`${r} files get a header only when forced (--force-detector ${s.id} / forcedDetectors: ["${s.id}"])`:`no enabled detector handles ${r} files`}i(Ot,"getHeaderSkipReason");function Ht(e,t={}){let r=be(e).toLowerCase(),n=Array.isArray(t.detectors)?t.detectors:T(t);for(let o of n){if(!o.extensions.includes(r))continue;let s=o.resolveCommentSyntax(e);if(s){let a=t.detectorSyntaxOverrides&&typeof t.detectorSyntaxOverrides=="object"?t.detectorSyntaxOverrides:{};return Gn(s,a[o.id])}}return{kind:"block",blockStart:"/**",blockLinePrefix:" * ",blockEnd:" */"}}i(Ht,"getCommentSyntaxForFile");function _t(e,t){let r=be(e).toLowerCase();return T(t).find(n=>n.extensions.includes(r))}i(_t,"detectorForFile");function ae(e,t,r={}){let n=_t(e,r);if(!n)return"";let o=typeof n.resolvePreservedPrefix=="function"?n.resolvePreservedPrefix(e,t):"",s=n.keepsAboveHeader,a=ie(t.slice(o.length),(c,l)=>ne(c)||typeof s=="function"&&s(c,l),o.split(`
3
- `).length-1);return`${o}${a}`}i(ae,"getPreservedPrefixForFile");function Bt(e,t,r={}){let n=_t(e,r);return n&&typeof n.resolveContentSkipReason=="function"?n.resolveContentSkipReason(t):null}i(Bt,"getContentSkipReason");var Ut=200,Z=1,ce=2;function O(e,t,r){if(e==null)return r;if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error(`${t} must be a whole number of 0 or more, got ${JSON.stringify(e)}`);return e}i(O,"resolveLayoutCount");import{existsSync as no}from"node:fs";import{join as Fe,relative as tr,resolve as Ne,sep as Ae}from"node:path";import{realpath as oo,stat as io}from"node:fs/promises";import{access as Yn,readdir as Vn,readFile as ws,stat as Jn}from"node:fs/promises";import{constants as qn}from"node:fs";import{dirname as ks,join as Kn,resolve as $s}from"node:path";async function Ee(e){try{return await Yn(e,qn.F_OK),!0}catch{return!1}}i(Ee,"pathExists");async function ke(e,t){let r=[],n=await Vn(e,{withFileTypes:!0});for(let o of n){let s=Kn(e,o.name);if(o.isDirectory()&&t.recursive===!1||o.isDirectory()&&t.ignoreFolders.has(o.name)||o.isDirectory()&&await t.shouldSkipDirectory?.(s,o.name)===!0)continue;if(o.isDirectory()){let l=await ke(s,t);r.push(...l);continue}if(!o.isFile())continue;let a=o.name.lastIndexOf(".");if(a===-1)continue;let c=o.name.slice(a).toLowerCase();t.allowedExtensions.has(c)&&r.push(s)}return r}i(ke,"walkFiles");async function zt(e){let t=await Jn(e);return{createdAt:t.birthtimeMs>0&&t.birthtime<t.mtime?t.birthtime:t.mtime,updatedAt:t.mtime}}i(zt,"readFileDates");function Wt(e){let t=e.indexOf("<");for(;t!==-1;){let r=e.indexOf(">",t+1);if(r===-1)return!1;if(r>t+1)return!0;t=e.indexOf("<",r+1)}return!1}i(Wt,"hasAngleTag");function Gt(e){let t=e.length;for(;t>0&&e[t-1]==="/";)t-=1;return e.slice(0,t)}i(Gt,"trimTrailingSlashes");import{execFile as Zn}from"node:child_process";import{lstat as Xn,readFile as Qn}from"node:fs/promises";import{dirname as Yt,isAbsolute as eo,join as qt,relative as Kt,resolve as $e,sep as Zt}from"node:path";import to from"ignore";function Vt(e,t){return new Promise(r=>{Zn("git",t,{cwd:e,encoding:"utf8",maxBuffer:Number.POSITIVE_INFINITY},(n,o)=>{if(!n){r({code:0,stdout:o});return}r({code:typeof n.code=="number"?n.code:-1,stdout:""})})})}i(Vt,"runGitCommand");function De(e,t){return Kt(e,t).split(Zt).join("/")}i(De,"toPosixRelative");async function Xt(e){try{return to().add(await Qn(e,"utf8"))}catch{return null}}i(Xt,"readIgnoreFile");async function ro(e){return Xn(qt(e,".git")).then(()=>!0,()=>!1)}i(ro,"hasGitEntry");function Jt(e,t,r){for(let n=e.length-1;n>=0;n--){let{base:o,rules:s}=e[n],a=s.test(`${De(o,t)}${r?"/":""}`);if(a.ignored||a.unignored)return a.ignored}return!1}i(Jt,"matchesRules");async function Qt(e,t){let r=await Xt(qt(e,".gitignore"));return{kind:"rules",nested:!0,excluded:!1,matchers:r?[...t,{base:e,rules:r}]:t}}i(Qt,"buildRulesContext");async function Se(e){let[t,r]=await Promise.all([Vt(e,["check-ignore","-q","."]),Vt(e,["ls-files","--cached","--others","--exclude-standard","-z"])]);if(t.code!==1||r.code!==0)return Qt(e,[]);let n=new Set,o=new Set;for(let s of r.stdout.split("\0")){let a=s.endsWith("/")?s.slice(0,-1):s;if(a.length!==0){n.add(a);for(let c=a.indexOf("/");c!==-1;c=a.indexOf("/",c+1))o.add(a.slice(0,c))}}return{kind:"git",root:e,entries:n,dirs:o}}i(Se,"resolveScopeContext");function er(e){let t=$e(e.root),r=e.gitignore;if(r===!1)return{isIgnored:i(async()=>!1,"isIgnored")};let n=new Map,o=i(async()=>{if(typeof r!="string"&&!Array.isArray(r))return Se(t);let c=typeof r=="string"?[r]:r.filter(u=>typeof u=="string"),l=[];for(let u of c){let f=await Xt($e(t,u));f&&l.push({base:t,rules:f})}return{kind:"rules",nested:!1,excluded:!1,matchers:l}},"buildRootContext"),s=i(c=>{let l=n.get(c);return l||(l=c===t?o():a(c),n.set(c,l)),l},"contextFor"),a=i(async c=>{let l=await s(Yt(c));return l.kind==="git"?l.entries.has(De(l.root,c))?Se(c):l:!l.nested||l.excluded?l:Jt(l.matchers,c,!0)?{...l,excluded:!0}:await ro(c)?Se(c):Qt(c,l.matchers)},"deriveContext");return{async isIgnored(c,l){let u=$e(c),f=Kt(t,u);if(f.length===0||f===".."||f.startsWith(`..${Zt}`)||eo(f))return!1;let p=await s(Yt(u));if(p.kind==="git"){let y=De(p.root,u);return!(p.entries.has(y)||l&&p.dirs.has(y))}return p.excluded||Jt(p.matchers,u,l)}}}i(er,"createIgnoreFilter");function so(e){return Tt(e)}i(so,"resolveExtensions");var ao=Object.freeze(["node_modules","bower_components","jspm_packages",".pnpm-store",".yarn"]),or=new Set([".git",...ao]),co=Object.freeze(["autoload.php","modules.txt"]);function rr(e,t){return or.has(t)?!0:t==="vendor"&&co.some(r=>no(Fe(e,r)))}i(rr,"isNeverWalked");function Ce(e){return Gt(e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,""))}i(Ce,"normalizeFolderPath");function lo(e){return Array.isArray(e)?e.map(t=>{if(typeof t=="string")return{path:t,recursive:!0};if(t&&typeof t=="object"&&typeof t.path=="string")return{path:t.path,recursive:t.recursive!==!1};throw new TypeError(`Invalid includeFolders entry: ${JSON.stringify(t)} (expected a path string or { path, recursive? })`)}):[]}i(lo,"resolveIncludeFolders");function nr(e,t){let r=t instanceof Error?t.message:String(t);console.warn(`fix-headers: skipped include folder "${e}" (${r})`)}i(nr,"reportSkippedIncludeFolder");function uo(e,t){if(!Array.isArray(t)||t.length===0)return()=>!1;let r=Ne(e),n=[],o=new Set;for(let s of t){if(typeof s!="string")continue;let a=Ce(s);if(a.length!==0){if(a.includes("/")){n.push(Ne(r,a));continue}o.add(a)}}return(s,a)=>{if(o.has(a))return!0;for(let l of n)if(s===l||s.startsWith(`${l}/`))return!0;let c=Ce(tr(r,s));return n.some(l=>{let u=Ce(tr(r,l));return c===u||c.startsWith(`${u}/`)})}}i(uo,"buildExclusionMatcher");async function ve(e){let t=so(e),r=lo(e.includeFolders),n=Array.isArray(e.excludeFolders)?e.excludeFolders:[],o=uo(e.projectRoot,n),s=er({root:e.projectRoot,gitignore:e.gitignore}),a=i(async(d,m)=>rr(d,m)||o(d,m)||await s.isIgnored(d,!0),"shouldSkipDirectory"),c=r.length>0?r.map(d=>({includeFolder:d.path,rootPath:Fe(e.projectRoot,d.path),recursive:d.recursive})):[{includeFolder:".",rootPath:e.projectRoot,recursive:!0}],l=[];for(let d of c){let m=await io(d.rootPath).catch(b=>b);if(m instanceof Error){if(m.code==="ENOENT"){nr(d.includeFolder,m);continue}throw m}if(!m.isDirectory()){nr(d.includeFolder,`path is not a directory: ${d.rootPath}`);continue}let w=await oo(d.rootPath).catch(()=>Ne(d.rootPath));l.push({...d,realRoot:w})}let u=i((d,m)=>{if(d.realRoot===m.realRoot)return d.recursive||!m.recursive;let w=d.realRoot.endsWith(Ae)?d.realRoot:`${d.realRoot}${Ae}`;if(!d.recursive||!m.realRoot.startsWith(w))return!1;let b=d.rootPath;for(let $ of m.realRoot.slice(w.length).split(Ae))if(b=Fe(b,$),rr(b,$)||o(b,$))return!1;return!0},"covers"),f=[...l].sort((d,m)=>d.realRoot.length-m.realRoot.length||Number(m.recursive)-Number(d.recursive)),p=[];for(let d of f)p.some(m=>u(m,d))||p.push(d);let y=[];for(let d of l){if(!p.includes(d))continue;let m=await ke(d.rootPath,{allowedExtensions:t,ignoreFolders:or,shouldSkipDirectory:a,recursive:d.recursive});y.push(...m)}let g=[];for(let d of new Set(y))!o(d,d.split("/").at(-1)||"")&&!await s.isIgnored(d,!1)&&g.push(d);return g}i(ve,"discoverFiles");import{basename as To,dirname as Oo,extname as Ho,resolve as Ie}from"node:path";import{dirname as gr,isAbsolute as ko,join as yr,relative as $o,resolve as xr,sep as So}from"node:path";import{readFile as fo}from"node:fs/promises";import{join as mo}from"node:path";async function po(e){try{return await fo(e,"utf8")}catch{return null}}i(po,"readManifest");async function M(e,t){let r=[];for(let n of t){let o=await po(mo(e,n));o!==null&&r.push({file:n,content:o})}return r.length>0?{dir:e,manifest:r[0].file,files:r}:null}i(M,"detectManifests");function H(e,t){return e.files.find(r=>r.file===t)?.content??null}i(H,"manifestContent");function A(e){return typeof e=="string"&&e.trim().length>0?e.trim():void 0}i(A,"cleanName");function Le(e){if(typeof e!="string")return;let t=e.search(/[<(]/);return A(t===-1?e:e.slice(0,t))}i(Le,"personName");function le(e){try{return JSON.parse(e)}catch{return}}i(le,"parseJsonManifest");function*Me(e,t){let r="";for(let n of e.split(/\r?\n/)){let o=n.trim();if(o.startsWith("[")){let s=o.match(/^\[([^[\]]+)\]/);r=s?s[1].split(".").map(a=>a.trim()).join("."):"";continue}r===t&&(yield o)}}i(Me,"sectionLines");function X(e,t,r){let n=new RegExp(`^${r}\\s*=\\s*(?:"([^"\\\\]*)"|'([^']*)')`);for(let o of Me(e,t)){let s=o.match(n);if(s)return A(s[1]??s[2])}}i(X,"readTomlString");function Re(e,t,r){let n=new RegExp(`^${r}\\s*[=:](.*)$`);for(let o of Me(e,t)){let s=o.match(n);if(s)return A(s[1])}}i(Re,"readIniValue");function ho(e,t,r){let n=new RegExp(`^${r}\\s*=\\s*\\[`),o=null;for(let s of Me(e,t)){if(o!==null){o.push(s);continue}let a=s.match(n);a&&(o=[s.slice(a[0].length)])}return o===null?null:o.join(`
4
- `)}i(ho,"tomlArrayText");function go(e,t){let r=t;for(;r<e.length;)if(e[r]==="#"){let n=e.indexOf(`
5
- `,r);r=n===-1?e.length:n+1}else if(/\s/.test(e[r]))r+=1;else break;return r}i(go,"skipTomlSpace");function Q(e,t){let r=ho(e,t,"authors");if(r===null)return;let n=r.slice(go(r,0)),o=n.match(/^(?:"([^"\\\n]*)"|'([^'\n]*)')/);if(o)return Le(o[1]??o[2]);let a=n.match(/^\{([^}\n]*)\}/)?.[1].match(/(?:^|,)\s*name\s*=\s*(?:"([^"\\\n]*)"|'([^'\n]*)')/);return a?A(a[1]??a[2]):void 0}i(Q,"readTomlAuthor");var ir=["go.mod"];function yo(e){let t=e.match(/^\s*module\s+(.+)$/m);if(t)return A(t[1].replace(/\/\/.*$/,"").trim().replace(/^["`](.*)["`]$/,"$1"))}i(yo,"readModulePath");var sr={id:"go",languages:["go"],manifests:ir,detect(e){return M(e,ir)},read(e){return{name:yo(e.files[0].content)}}};var ar=["package.json"];function xo(e){let t=A(e?.name),r=A(e?.publisher),n=typeof e?.engines?.vscode=="string";return t&&r&&n?`${r}.${t}`:t}i(xo,"readPublishedName");function wo(e){if(e!==null&&typeof e=="object"){let t=e;return A(t.company)??A(t.name)}return Le(e)}i(wo,"readAuthorCompany");var cr={id:"node",languages:["node"],manifests:ar,detect(e){return M(e,ar)},read(e){let t=le(e.files[0].content);return{name:xo(t),company:wo(t?.author)}}};var lr=["composer.json"],ur={id:"php",languages:["php"],manifests:lr,detect(e){return M(e,lr)},read(e){let t=le(e.files[0].content),r=t?.authors;return{name:A(t?.name),company:Array.isArray(r)?A(r[0]?.name):void 0}}};var dr=["pyproject.toml","setup.cfg","setup.py"];function fr(e,t){let r=e.indexOf("setup(");if(r===-1)return;let n=e.slice(r).match(new RegExp(`\\b${t}\\s*=\\s*(["'])([^"'\\n]+)\\1`));return n&&n[2].trim()||void 0}i(fr,"readSetupPyArgument");function bo(e){let t=H(e,"pyproject.toml"),r=H(e,"setup.cfg"),n=H(e,"setup.py");return(t===null?void 0:X(t,"project","name")??X(t,"tool.poetry","name"))??(r===null?void 0:Re(r,"metadata","name"))??(n===null?void 0:fr(n,"name"))}i(bo,"readPythonName");function Eo(e){let t=H(e,"pyproject.toml"),r=H(e,"setup.cfg"),n=H(e,"setup.py");return(t===null?void 0:Q(t,"project")??Q(t,"tool.poetry"))??(r===null?void 0:Re(r,"metadata","author"))??(n===null?void 0:fr(n,"author"))}i(Eo,"readPythonCompany");var mr={id:"python",languages:["python"],manifests:dr,detect(e){return M(e,dr)},read(e){return{name:bo(e),company:Eo(e)}}};var pr=["Cargo.toml"],hr={id:"rust",languages:["rust"],manifests:pr,detect(e){return M(e,pr)},read(e){let t=e.files[0].content;return{name:X(t,"package","name"),company:Q(t,"package")}}};var Do=[cr,mr,ur,hr,sr],wr=["name","company"];async function je(e,t,r){let o=(await Promise.all(t.map(async a=>({driver:a,detection:await a.detect(e)})))).filter(a=>a.detection!==null),s=o.filter(a=>typeof r=="string"&&a.driver.languages.includes(r));return[...s,...o.filter(a=>!s.includes(a))]}i(je,"claimFolder");function Ao(e,t){let r=$o(t,e);return r!==""&&r!==".."&&!r.startsWith(`..${So}`)&&!ko(r)}i(Ao,"isStrictlyInside");async function br(e,t={}){let r=Array.isArray(t.drivers)?t.drivers:Do,n=typeof t.scanRoot=="string"?xr(t.scanRoot):null,o=xr(e),s=await je(o,r,t.language);for(;s.length===0;){if(await Ee(yr(o,".git")))return{root:o,marker:".git",drivers:[],fields:{},sources:{}};let f=gr(o);if(f===o)return null;o=f,s=await je(o,r,t.language)}let a={},c={},l=o,u=s;for(;;){for(let{driver:p,detection:y}of u){let g=p.read(y);for(let d of wr)a[d]===void 0&&g[d]!==void 0&&(a[d]=g[d],c[d]={driver:p.id,manifest:y.manifest,dir:l})}if(wr.every(p=>a[p]!==void 0)||n===null||!Ao(l,n)||await Ee(yr(l,".git")))break;l=gr(l),u=await je(l,r,t.language)}return{root:o,marker:s[0].detection.manifest,drivers:s.map(f=>f.driver.id),fields:a,sources:c}}i(br,"resolveManifestProject");import{execFile as Co}from"node:child_process";import{basename as Fo,dirname as No}from"node:path";import{promisify as vo}from"node:util";var Pe=vo(Co);async function v(e,t){try{let{stdout:r}=await Pe("git",t,{cwd:e}),n=r.trim();return n.length>0?n:null}catch{return null}}i(v,"runGit");function Er(e,t){let r=0;for(let n=t-1;n>=0&&e[n]==="\\";n--)r++;return r%2===1}i(Er,"isEscaped");function Lo(e){let t=e.trim();if(!t.endsWith(")")||Er(t,t.length-1))return t;let r=0;for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(o!=="("&&o!==")"||Er(t,n))&&(r+=o===")"?1:-1,r===0))return t.slice(0,n).trim()}return t}i(Lo,"stripUidComment");function Mo(e){let t=e.trim();if(t.length===0)return{authorName:null,authorEmail:null};let r=t.match(/<([^>\n]+)>\s*$/),n=r?.[1]?.trim()||null,o=(r?t.slice(0,r.index):t).trim();return{authorName:Lo(o)||o||null,authorEmail:n}}i(Mo,"parseSignerUid");async function Ro(e,t){try{let{stdout:r}=await Pe(e,t),n=r.trim();return n.length>0?n:null}catch{return null}}i(Ro,"runProgram");function jo(e){return e.replace(/\\x([0-9a-fA-F]{2})/g,(t,r)=>String.fromCharCode(Number.parseInt(r,16)))}i(jo,"decodeColonField");async function Po(e){let t=await v(e,["config","--get","gpg.format"]);if(t!==null&&t!=="openpgp")return null;let r=await v(e,["config","--get","user.signingkey"]);if(!r)return null;let n=await v(e,["config","--get","gpg.openpgp.program"])||await v(e,["config","--get","gpg.program"])||"gpg",o=await Ro(n,["--batch","--with-colons","--list-keys",r]);if(!o)return null;for(let s of o.split(`
6
- `)){let a=s.split(":");if(a[0]==="uid"&&a[1]!=="r"&&a[1]!=="e"&&a[9])return jo(a[9])}return null}i(Po,"readSigningKeyUid");async function kr(e,t={}){let r=await v(e,["config","--get","user.name"]),n=await v(e,["config","--get","user.email"]);if(t.useGpgSignerAuthor===!0){let o=await Po(e)||await v(e,["log","-1","--format=%GS"]),s=Mo(o||"");r=s.authorName||r,n=n||s.authorEmail}if(!r||!n){let o=await v(e,["log","-1","--format=%an|%ae"]);if(o){let[s,a]=o.split("|");r=r||s||null,n=n||a||null}}return{authorName:r,authorEmail:n}}i(kr,"detectGitAuthor");function $r(e){return e.replace(/z$/i,"+00:00")}i($r,"canonicalGitDate");async function Sr(e,t){let r=await v(e,["log","--follow","--format=%aI|%at","--reverse","--",t]);if(!r)return null;let n=r.split(`
7
- `)[0],[o,s]=n.split("|");if(!o||!s)return null;let a=Number.parseInt(s,10);return Number.isNaN(a)?null:{date:$r(o),timestamp:a}}i(Sr,"getGitCreationDate");async function Dr(e,t){let r=await v(e,["log","-1","--format=%aI|%at","--",t]);if(!r)return null;let[n,o]=r.split("|");if(!n||!o)return null;let s=Number.parseInt(o,10);return Number.isNaN(s)?null:{date:$r(n),timestamp:s}}i(Dr,"getGitLastModifiedDate");var Io=256*1024*1024;async function Ar(e){let t=No(e);if(await v(t,["rev-parse","--is-inside-work-tree"])!=="true")return{state:"no-git",content:null};try{let{stdout:r}=await Pe("git",["show",`HEAD:./${Fo(e)}`],{cwd:t,encoding:"utf8",maxBuffer:Io});return{state:"tracked",content:r}}catch{return{state:"untracked",content:null}}}i(Ar,"readGitHeadFile");function _o(e){return To(e)||"project"}i(_o,"folderName");function Bo(e,t){if(typeof t!="string")return e;let r=t.trim();return r.length===0||Wt(e)?e:`${e} <${r}>`}i(Bo,"formatAuthorNameWithCompany");async function Uo(e,t={}){let r=Array.isArray(t.detectors)?t.detectors:T(t),n=typeof t.preferredExtension=="string"?t.preferredExtension.trim().toLowerCase():"",o=n.length>0?r.find(u=>u.extensions.includes(n)):void 0,s=await br(e,{drivers:t.drivers,language:o?.id,scanRoot:t.scanRoot}),a=s?s.root:Ie(e),c=s?.sources.name,l=s?.sources.company;return{language:o?.id??s?.drivers[0]??"unknown",rootDir:a,marker:s?s.marker:null,projectName:s?.fields.name??_o(a),projectNameSource:c?{from:"manifest",...c}:{from:"folder",dir:a},companyName:s?.fields.company??null,companyNameSource:l?{from:"manifest",...l}:{from:"none"},drivers:s?s.drivers:[]}}i(Uo,"detectProjectFromMarkers");async function Te(e={}){let t=e.targetFilePath||e.cwd||process.cwd(),r=Ie(t),n=T(e),o=e.targetFilePath?Oo(r):r,s=e.targetFilePath?Ho(r).toLowerCase():"",a=Ie(e.projectRoot||e.cwd||process.cwd()),c=await Uo(o,{detectors:n,preferredExtension:s,scanRoot:a}),l=await kr(c.rootDir,{useGpgSignerAuthor:e.useGpgSignerAuthor===!0}),u=e.authorName||l.authorName||"Unknown Author",f=typeof e.companyName=="string"?e.companyName.trim():"";return{projectName:e.projectName||c.projectName,projectNameSource:e.projectName?{from:"option"}:c.projectNameSource,language:e.language||c.language,projectRoot:e.projectRoot||c.rootDir,marker:e.marker===void 0?c.marker:e.marker,authorName:Bo(u,e.company),authorEmail:e.authorEmail||l.authorEmail||"unknown@example.com",companyName:f||c.companyName,companyNameSource:f?{from:"option"}:c.companyNameSource,copyrightStartYear:Number.isInteger(e.copyrightStartYear)?Number(e.copyrightStartYear):null}}i(Te,"resolveProjectMetadata");function zo(e){return Oe({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),offsetMinutes:-e.getTimezoneOffset()})}i(zo,"formatDateWithTimezone");function Oe(e){return`${vr(e," ")} ${Lr(e.offsetMinutes)}`}i(Oe,"formatSpaceDate");function Fr(e){if(typeof e!="string")throw new Error(`timezone must be an IANA time zone name string, such as "America/Los_Angeles" or "UTC" (got ${typeof e})`);try{Nr(e)}catch(t){throw new Error(`Unknown time zone "${e}": expected an IANA time zone name, such as "America/Los_Angeles" or "UTC"`,{cause:t})}return e}i(Fr,"assertTimeZone");var Cr=new Map;function Nr(e){let t=Cr.get(e);return t||(t=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}),Cr.set(e,t)),t}i(Nr,"getZoneFormatter");function He(e,t){let r={};for(let o of Nr(t).formatToParts(new Date(e*1e3)))r[o.type]=Number(o.value);let n=Date.UTC(r.year,r.month-1,r.day,r.hour,r.minute,r.second)/1e3;return{year:r.year,month:r.month,day:r.day,hour:r.hour,minute:r.minute,second:r.second,offsetMinutes:(n-e)/60}}i(He,"toZonedDateParts");function vr(e,t){let r=i(n=>String(n).padStart(2,"0"),"pad");return`${String(e.year).padStart(4,"0")}-${r(e.month)}-${r(e.day)}${t}${r(e.hour)}:${r(e.minute)}:${r(e.second)}`}i(vr,"formatWallClock");function Lr(e){let t=i(n=>String(n).padStart(2,"0"),"pad"),r=Math.abs(e);return`${e>=0?"+":"-"}${t(Math.floor(r/60))}:${t(r%60)}`}i(Lr,"formatOffset");function ue(e=new Date){return{date:zo(e),timestamp:Math.floor(e.getTime()/1e3)}}i(ue,"toDatePayload");var Wo=/^(\d{4})-(\d{2})-(\d{2})(?:T|\s+)(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?\s*(?:(Z)|([+-])(\d{2}):?(\d{2}))$/i;function _(e){let t=Wo.exec(e.trim());if(!t)return null;let[r,n,o,s,a,c]=t.slice(1,7).map(Number),l=t[7]?0:Number(t[9])*60+Number(t[10]),u=t[8]==="-"?-l:l,f=new Date(Date.UTC(r,n-1,o,s,a,c));return!(f.getUTCFullYear()===r&&f.getUTCMonth()===n-1&&f.getUTCDate()===o&&f.getUTCHours()===s&&f.getUTCMinutes()===a&&f.getUTCSeconds()===c)||Number(t[10]??0)>59?null:{year:r,month:n,day:o,hour:s,minute:a,second:c,offsetMinutes:u,timestamp:Math.floor(f.getTime()/1e3)-u*60}}i(_,"parseHeaderDate");function _e(e){return`${vr(e,"T")}${Lr(e.offsetMinutes)}`}i(_e,"formatIsoDate");var Go={"git-created":"git first commit","filesystem-created":"filesystem creation time"};function Mr(e,t){let r=e.match(new RegExp(`${t}:[^\\S\\n]*(.*)$`,"m"));return r?r[1].trim():null}i(Mr,"readHeaderField");function Be(e){let t=null;for(let{source:r,payload:n}of e)n&&(!t||n.timestamp<t.payload.timestamp)&&(t={source:r,payload:n});return t}i(Be,"pickOldestDate");function jr({existing:e,gitCreated:t,filesystemCreated:r,fixCreatedDate:n=!1}){let o=[{source:"git-created",payload:t},{source:"filesystem-created",payload:r}];if(!e)return Be(o);if(!n)return{source:"existing-header",payload:e};let s=_(e.date)?e:null;return Be([{source:"existing-header",payload:s},...o])}i(jr,"resolveCreatedDate");function Pr(e,t=null){if(t)return He(e.timestamp,t).year;let r=_(e.date);return r?r.year:new Date(e.timestamp*1e3).getFullYear()}i(Pr,"dateYear");function Rr(e,t,r,n){let o=e.match(/^(.+?)\s*\((\d+)\)$/),s=o?_(o[1]):null;if(!o||!s)return n.push({check:`${r}-format`,field:t,advisory:!1,value:e,message:`${t} value "${e}" is not a "<datetime> (<epoch>)" pair with a recognised datetime`}),null;let a=Number.parseInt(o[2],10);return a!==s.timestamp&&n.push({check:`${r}-epoch`,field:t,advisory:!1,value:e,expected:`${o[1]} (${s.timestamp})`,message:`${t} epoch ${a} does not match ${o[1]} (expected ${s.timestamp})`}),{text:o[1],timestamp:s.timestamp}}i(Rr,"checkDateValue");function Ir(e,t={},r={}){let n=[],o=Mr(e,"@Date"),s=o===null?null:Rr(o,"@Date","created",n),a=Be([{source:"git-created",payload:t.gitCreated},{source:"filesystem-created",payload:t.filesystemCreated}]);if(s&&a&&s.timestamp>a.payload.timestamp){let f=Go[a.source];n.push({check:"created-newer-than-source",field:"@Date",advisory:r.strictCreatedDate!==!0,value:o,expected:`${a.payload.date} (${a.payload.timestamp})`,source:a.source,message:`@Date ${s.text} is later than the ${f} ${a.payload.date} (${a.payload.timestamp})`})}let c=Mr(e,"@Last modified time"),l=c===null?null:Rr(c,"@Last modified time","modified",n),u=t.gitLastModified;return l&&u&&l.timestamp!==u.timestamp&&n.push({check:"modified-git",field:"@Last modified time",advisory:!0,value:c,expected:`${u.date} (${u.timestamp})`,message:`@Last modified time ${l.text} does not match the git last commit ${u.date} (${u.timestamp})`}),n}i(Ir,"checkHeaderDates");function Ue(e){if(!e)return null;let t=_(e.date);return t&&t.timestamp!==e.timestamp?{date:e.date,timestamp:t.timestamp}:e}i(Ue,"repairDateEpoch");function Tr(e){let t=_(e.date);return t?{date:_e(t),timestamp:t.timestamp}:e}i(Tr,"normalizeDatePayload");function Or(e,t){let r=_(e.date);if(!r)return e;let n=He(r.timestamp,t);return n.offsetMinutes===r.offsetMinutes||!Number.isInteger(n.offsetMinutes)?e:{date:/^\d{4}-\d{2}-\d{2}T/i.test(e.date.trim())?_e(n):Oe(n),timestamp:r.timestamp}}i(Or,"convertDatePayload");import{relative as Vo}from"node:path";import{extname as Yo}from"node:path";function B(e,t={}){let r=Yo(e).toLowerCase(),n=O(t.spacing,"spacing",Z);return r.length===0?{kind:"block",blockStart:"/**",blockLinePrefix:" * ",blockEnd:" */",spacing:n}:{...Ht(e,t),spacing:n}}i(B,"getHeaderSyntaxForFile");function Hr(e,t){let r=e.spacing??Z;if(e.kind==="line"){let c=e.linePrefix||"#",l=typeof e.lineSeparator=="string"?e.lineSeparator:" ",u=Array.from({length:r},()=>c);return[...u,...t.map(f=>`${c}${l}${f}`),...u].join(`
8
- `)}let n=e.blockStart||(e.kind==="html"?"<!--":"/**"),o=e.blockLinePrefix||(e.kind==="html"?" ":" * "),s=e.blockEnd||(e.kind==="html"?"-->":" */"),a=Array.from({length:r},()=>o.trimEnd());return[n,...a,...t.map(c=>`${o}${c}`),...a,s].join(`
9
- `)}i(Hr,"renderHeaderLines");function _r(e){let t=`/${Vo(e.projectRoot,e.absoluteFilePath).replace(/\\/g,"/")}`,r=B(e.absoluteFilePath,e.syntaxOptions||{language:e.language}),n=e.createdByName||e.authorName,o=e.createdByEmail||e.authorEmail,s=e.lastModifiedByName||e.authorName,a=e.lastModifiedByEmail||e.authorEmail,c=typeof e.companyName=="string"?e.companyName.trim():"",l=c.length>0?`${c} `:"",u=[`@Project: ${e.projectName}`,`@Filename: ${t}`,`@Date: ${e.createdAt.date} (${e.createdAt.timestamp})`,`@Author: ${n}`,`@Email: <${o}>`,"-----",`@Last modified by: ${s} (${a})`,`@Last modified time: ${e.lastModifiedAt.date} (${e.lastModifiedAt.timestamp})`,"-----",`@Copyright: Copyright (c) ${e.copyrightStartYear}-${e.currentYear} ${l}All rights reserved.`];return Hr(r,u)}i(_r,"buildHeader");var Jo=Object.freeze(["projectName","filename","createdAt","authorName","authorEmail","lastModifiedByName","lastModifiedByEmail","lastModifiedAt","copyrightStartYear","copyrightEndYear","companyName"]);function I(e,t){let r=e.match(new RegExp(`@${t}:[ \\t]*(.*)$`,"m")),n=r?r[1].trim():"";return n.length>0?n:null}i(I,"readTag");function qo(e){if(e===null)return{name:null,email:null};if(!e.endsWith(")"))return{name:e,email:null};let t=e.slice(0,-1),r=t.indexOf("(",t.lastIndexOf(")")+1);return r===-1?{name:e,email:null}:{name:t.slice(0,r).trimEnd()||null,email:t.slice(r+1)||null}}i(qo,"splitLastModifiedBy");function Ko(e){let t={startYear:null,endYear:null,companyName:null},r=e?.match(/^Copyright\s+\(c\)\s+(\d{4})/i);if(!r)return t;let n=e.slice(r[0].length),o=n.match(/^\s*-\s*(\d{4})/);o&&(n=n.slice(o[0].length));let s=n.toLowerCase(),a=s.endsWith("all rights reserved.")?20:s.endsWith("all rights reserved")?19:0;return a===0||!/^\s/.test(n)?t:{startYear:r[1],endYear:o?o[1]:null,companyName:n.slice(0,-a).trim()||null}}i(Ko,"splitCopyright");function Br(e){let t=qo(I(e,"Last modified by")),r=Ko(I(e,"Copyright")),n=I(e,"Email");return{projectName:I(e,"Project"),filename:I(e,"Filename"),createdAt:I(e,"Date"),authorName:I(e,"Author"),authorEmail:n===null?null:n.replace(/^<(.*)>$/,"$1"),lastModifiedByName:t.name,lastModifiedByEmail:t.email,lastModifiedAt:I(e,"Last modified time"),copyrightStartYear:r.startYear,copyrightEndYear:r.endYear,companyName:r.companyName}}i(Br,"parseHeaderFields");function Ur(e,t){let r=Br(e??""),n=Br(t);return Jo.filter(o=>r[o]!==n[o]).map(o=>({field:o,previous:r[o],detected:n[o]}))}i(Ur,"compareHeaderFields");function ee(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(ee,"escapeRegex");function ze(e,t,r={}){let n=t.startsWith("\uFEFF")?"\uFEFF":"",o=t.slice(n.length),s=`${n}${ae(e,o,r)}`;return{prefix:s,body:t.slice(s.length)}}i(ze,"splitPreservedPrefix");function de(e){let t=e.indexOf(`
1
+ var dr=Object.defineProperty;var i=(e,t)=>dr(e,"name",{value:t,configurable:!0});import{readFile as yi,stat as xi,writeFile as wi}from"node:fs/promises";import{relative as Ye,resolve as er}from"node:path";import{readFile as fr}from"node:fs/promises";import{createRequire as mr}from"node:module";import{dirname as pr,isAbsolute as hr,resolve as ut}from"node:path";var gr=3e4,yr=new Set(["localhost","127.0.0.1","[::1]"]);function xe(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}i(xe,"isPlainObject");function we(e,t){let n={...e};for(let[r,o]of Object.entries(t))r!=="__proto__"&&(n[r]=xe(n[r])&&xe(o)?we(n[r],o):o);return n}i(we,"mergeConfig");function dt(e){return e.kind==="file"?e.path:e.href}i(dt,"describeSource");async function xr(e){if(e.kind==="file")return{text:await fr(e.path,"utf8"),source:e};let t;try{t=await fetch(e.href,{cache:"no-store",redirect:"follow",signal:AbortSignal.timeout(gr)})}catch(n){let r=n.cause instanceof Error?n.cause.message:n.message;throw new Error(`Failed to fetch config ${e.href}: ${r}`,{cause:n})}if(!t.ok)throw new Error(`Failed to fetch config ${e.href}: HTTP ${t.status} ${t.statusText}`);return{text:await t.text(),source:{kind:"url",href:t.url}}}i(xr,"readSource");function lt(e){if(e.protocol==="http:"&&!yr.has(e.hostname))throw new Error(`Refusing to fetch config over plain http: ${e.href} (use https)`);return{kind:"url",href:e.href}}i(lt,"toUrlSource");function wr(e,t){if(/^https?:\/\//i.test(e))return lt(new URL(e));if(/^[a-z][a-z\d+.-]+:\/\//i.test(e))throw new Error(`Unsupported extends URL "${e}" in ${dt(t)}; use https, a file path or a package path`);let n=/^\.{1,2}[\\/]/.test(e);if(t.kind==="url"){if(n||e.startsWith("/"))return lt(new URL(e,t.href));throw new Error(`Cannot extend package "${e}" from the remote config ${t.href}; use a URL or a relative path`)}if(n||hr(e))return{kind:"file",path:ut(pr(t.path),e)};try{return{kind:"file",path:mr(t.path).resolve(e)}}catch(r){throw new Error(`Cannot resolve extends "${e}" from ${t.path}: ${r.message}`,{cause:r})}}i(wr,"resolveReference");function br(e,t){if(e===void 0)return[];let n=Array.isArray(e)?e:[e];if(!n.every(r=>typeof r=="string"&&r.trim().length>0))throw new Error(`Config "extends" must be a string or an array of strings: ${t}`);return n.map(r=>r.trim())}i(br,"readExtends");async function ft(e,t){let n=dt(e);if(t.includes(n))throw new Error(`Config extends cycle: ${[...t,n].join(" -> ")}`);let{text:r,source:o}=await xr(e),s;try{s=JSON.parse(r)}catch(u){throw new Error(`Config ${n} is not valid JSON: ${u.message}`,{cause:u})}if(!xe(s))throw new Error(`Config file must contain a JSON object: ${n}`);let{extends:a,...c}=s,l={};for(let u of br(a,n))l=we(l,await ft(wr(u,o),[...t,n]));return we(l,c)}i(ft,"loadSource");function Er(e,t=process.cwd()){return ft({kind:"file",path:ut(t,e)},[])}i(Er,"loadConfigFile");async function mt(e,t){let n=typeof e[t]=="string"?e[t].trim():"";if(n.length===0)return e;let r=typeof e.cwd=="string"&&e.cwd.length>0?e.cwd:process.cwd(),o={...await Er(n,r),...e};return delete o[t],o}i(mt,"applyConfigOption");import{extname as be}from"node:path";import{extname as kr}from"node:path";var ht=[".c",".h",".cc",".cpp",".cxx",".hh",".hpp",".hxx"],Sr=400,$r=/\bcopyright\b|\blicen[cs]e[ds]?\b|SPDX-License-Identifier|\bpublic domain\b/i,pt=/^[\s*/]*@(?:Project|Filename):/m;function Dr(e){let t=kr(e).toLowerCase();return ht.includes(t)?{kind:"block",blockStart:"/*",blockLinePrefix:" * ",blockEnd:" */"}:null}i(Dr,"resolveCCommentSyntax");function Cr(e){let t=e.replace(/^\uFEFF/,"").split(`
2
+ `).slice(0,Sr),n=[],r=null,o=null,s=!1;for(let a of t){let c=a.replace(/\r$/,"");if(r){r.push(c),c.includes("*/")&&(n.push(r.join(`
3
+ `)),r=null);continue}if(s){s=c.endsWith("\\");continue}let l=c.trim();if(o&&!l.startsWith("//")&&(n.push(o.join(`
4
+ `)),o=null),l.length!==0){if(l.startsWith("//")){(o??=[]).push(l);continue}if(l.startsWith("/*")){let u=l.indexOf("*/",2);if(u===-1){r=[l];continue}if(n.push(l.slice(0,u+2)),l.slice(u+2).trim().length>0)break;continue}if(l.startsWith("#")){s=l.endsWith("\\");continue}break}}return o&&n.push(o.join(`
5
+ `)),n}i(Cr,"prologueComments");var gt={id:"c",extensions:ht,enabledByDefault:!0,resolveContentSkipReason(e){let t=Cr(e);return t.length>0&&pt.test(t[0])?null:t.some(n=>!pt.test(n)&&$r.test(n))?"the file starts with a license or copyright notice that is not a fix-headers header (third-party code)":null},resolveCommentSyntax(e){return Dr(e)}};import{extname as Ar}from"node:path";var yt=[".css"];function Fr(e){let t=Ar(e).toLowerCase();return yt.includes(t)?{kind:"block",blockStart:"/*",blockLinePrefix:" * ",blockEnd:" */"}:null}i(Fr,"resolveCssCommentSyntax");var xt={id:"css",extensions:yt,enabledByDefault:!0,keepsAboveHeader:i((e,t)=>t===0&&/^@charset "[^"]*";/.test(e),"keepsAboveHeader"),resolveCommentSyntax(e){return Fr(e)}};import{extname as Rr}from"node:path";var Nr=/^(?:#|\/\/|\/\*+|<!--)[ \t]+(vi|vim(?:[<=>]?\d+)?|Vim|ex):(.*)$/,vr=/^[a-z]+(?:[!&]|[+^-]?=(?:\\.|[^\s:\\])*)?$/,Lr=new Set(["et","expandtab","ai","autoindent","si","smartindent","ro","readonly","bin","binary","noet","noexpandtab","noai","noautoindent","nosi","nosmartindent","noro","noreadonly","nobin","nobinary","nowrap","nolist","nospell","nofen","nofoldenable","noeol","nofixeol","nofixendofline"]);function re(e){let t=e.match(Nr);if(!t)return!1;let n=t[2].trim();if(n.endsWith("-->"))n=n.slice(0,-3).trimEnd();else if(n.endsWith("*/")){let s=n.length-2;for(;s>0&&n[s-1]==="*";)s-=1;n=n.slice(0,s).trimEnd()}let r=n.match(/^se(?:t)?[ \t]((?:\\.|[^:\\])*):/);if(!r&&t[1]==="Vim")return!1;let o=r?r[1].match(/(?:\\.|[^\s\\])+/g):n.match(/(?:\\.|[^\s:\\])+/g);return o!==null&&o.every(s=>vr.test(s))&&o.some(s=>s.includes("=")||Lr.has(s))}i(re,"isModeline");function oe(e,t){return t===0&&e.startsWith("#!")}i(oe,"isShebang");function ie(e,t,n=0){let r=0,o=n;for(;r<e.length;){let s=e.indexOf(`
6
+ `,r),a=s===-1?e.length:s+1;if(!t(e.slice(r,a).replace(/\r?\n$/,""),o))break;r=a,o+=1}return e.slice(0,r)}i(ie,"takeTopLines");var bt=[".go"];function jr(e){let t=Rr(e).toLowerCase();return bt.includes(t)?{kind:"block",blockStart:"/**",blockLinePrefix:" * ",blockEnd:" */"}:null}i(jr,"resolveGoCommentSyntax");var wt=/^\/\/(?:go:build|\s*\+build)\s/;function Mr(e,t){let n=ie(t,o=>wt.test(o)||re(o));if(!n.split(/\r?\n/).some(o=>wt.test(o)))return"";let r=t.slice(n.length);return`${n}${r.slice(0,r.length-r.replace(/^(?:[ \t]*\r?\n)*/,"").length)}`}i(Mr,"resolveGoPreservedPrefix");var Et={id:"go",extensions:bt,enabledByDefault:!0,resolvePreservedPrefix(e,t){return Mr(e,t)},resolveCommentSyntax(e){return jr(e)}};import{extname as Pr}from"node:path";var kt=[".html",".htm"];function Ir(e){let t=Pr(e).toLowerCase();return kt.includes(t)?{kind:"html",blockStart:"<!--",blockLinePrefix:" ",blockEnd:"-->"}:null}i(Ir,"resolveHtmlCommentSyntax");var St={id:"html",extensions:kt,enabledByDefault:!0,resolveCommentSyntax(e){return Ir(e)}};import{extname as Or}from"node:path";var $t=[".jsonv",".jsonc",".json5"];function Tr(e){let t=Or(e).toLowerCase();return $t.includes(t)?{kind:"block",blockStart:"/**",blockLinePrefix:" * ",blockEnd:" */"}:null}i(Tr,"resolveJsonCommentSyntax");var Dt={id:"json",extensions:$t,enabledByDefault:!0,resolveCommentSyntax(e){return Tr(e)}};import{extname as Hr}from"node:path";var Ct=[".md",".markdown"];function _r(e){let t=Hr(e).toLowerCase();return Ct.includes(t)?{kind:"html",blockStart:"<!--",blockLinePrefix:" ",blockEnd:"-->"}:null}i(_r,"resolveMarkdownCommentSyntax");function Br(e,t){let n=t.match(/^---\r?\n[\s\S]*?\r?\n---[ \t]*(?:\r?\n|$)/);return n?n[0]:""}i(Br,"resolveMarkdownPreservedPrefix");var At={id:"markdown",extensions:Ct,enabledByDefault:!1,requiresForce:!0,resolvePreservedPrefix(e,t){return Br(e,t)},resolveCommentSyntax(e){return _r(e)}};import{basename as Ft,extname as Ur}from"node:path";var Nt=[".js",".mjs",".cjs",".ts",".mts",".cts",".tsx",".jsx"];function Wr(e){let t=Ur(e).toLowerCase();return Nt.includes(t)?{kind:"block",blockStart:"/**",blockLinePrefix:" * ",blockEnd:" */"}:null}i(Wr,"resolveNodeCommentSyntax");var zr=/^(.+)\.d\.(ts|mts|cts)$/i,Gr={ts:[".ts",".tsx",".js",".jsx"],mts:[".mts",".mjs"],cts:[".cts",".cjs"]};function Yr(e){let t=/^\s*\/\*[\s\S]*?\*\//.exec(e.replace(/^\uFEFF/,""));if(!t)return null;let n=/^[\s*]*@Filename:[ \t]*(\S+)/m.exec(t[0]);return n?n[1]:null}i(Yr,"leadingHeaderFilename");function Vr(e,t){let n=zr.exec(Ft(t));if(!n)return null;let r=Yr(e);if(r===null)return null;let o=Ft(r),[,s,a]=n;return Gr[a.toLowerCase()].some(l=>o===`${s}${l}`)?`the file is a declaration generated from ${o} and carries its header (tsc copies it)`:null}i(Vr,"declarationCopySkipReason");var vt={id:"node",extensions:Nt,enabledByDefault:!0,keepsAboveHeader:oe,resolveContentSkipReason(e,t){return Vr(e,t)},resolveCommentSyntax(e){return Wr(e)}};import{extname as Jr}from"node:path";var Rt=[".php"];function qr(e){let t=Jr(e).toLowerCase();return Rt.includes(t)?{kind:"block",blockStart:"/**",blockLinePrefix:" * ",blockEnd:" */"}:null}i(qr,"resolvePhpCommentSyntax");var Lt=/^<\?php(?:\s|$)/i,jt={id:"php",extensions:Rt,enabledByDefault:!0,keepsAboveHeader:i((e,t)=>t===0&&Lt.test(e),"keepsAboveHeader"),resolveContentSkipReason(e){return Lt.test(e.replace(/^\uFEFF/,""))?null:"the file does not start with <?php, so a comment at the top would be output as text"},resolveCommentSyntax(e){return qr(e)}};import{extname as Kr}from"node:path";var Mt=[".py"],Zr=/^#.*?(?<![A-Za-z])coding[:=]\s*[-\w.]+/;function Xr(e,t){return oe(e,t)||t<=1&&Zr.test(e)}i(Xr,"keepsAboveHeader");var Pt={id:"python",extensions:Mt,enabledByDefault:!0,keepsAboveHeader:Xr,resolveCommentSyntax(e){let t=Kr(e).toLowerCase();return Mt.includes(t)?{kind:"line",linePrefix:"#"}:null}};import{extname as Qr}from"node:path";var It=[".rs"];function eo(e){let t=Qr(e).toLowerCase();return It.includes(t)?{kind:"block",blockStart:"/**",blockLinePrefix:" * ",blockEnd:" */"}:null}i(eo,"resolveRustCommentSyntax");var Ot={id:"rust",extensions:It,enabledByDefault:!0,keepsAboveHeader:i((e,t)=>t===0&&e.startsWith("#!")&&!/^#!\s*\[/.test(e),"keepsAboveHeader"),resolveCommentSyntax(e){return eo(e)}};import{extname as to}from"node:path";var Tt=[".yaml",".yml"];function no(e){let t=to(e).toLowerCase();return Tt.includes(t)?{kind:"line",linePrefix:"#"}:null}i(no,"resolveYamlCommentSyntax");var Ht={id:"yaml",extensions:Tt,enabledByDefault:!0,keepsAboveHeader:i((e,t)=>t===0&&/^#cloud-config\s*$/.test(e),"keepsAboveHeader"),resolveCommentSyntax(e){return no(e)}};var se=[gt,xt,Et,St,Dt,At,vt,jt,Pt,Ot,Ht],ro=new Map(se.map(e=>[e.id,e]));function oo(e,t){return!t||typeof t!="object"?e:e.kind==="line"?{...e,linePrefix:typeof t.linePrefix=="string"&&t.linePrefix.length>0?t.linePrefix:e.linePrefix,lineSeparator:typeof t.lineSeparator=="string"?t.lineSeparator:e.lineSeparator}:{...e,blockStart:typeof t.blockStart=="string"&&t.blockStart.length>0?t.blockStart:e.blockStart,blockLinePrefix:typeof t.blockLinePrefix=="string"&&t.blockLinePrefix.length>0?t.blockLinePrefix:e.blockLinePrefix,blockEnd:typeof t.blockEnd=="string"&&t.blockEnd.length>0?t.blockEnd:e.blockEnd}}i(oo,"applySyntaxOverride");function _t(e){if(e==null)return[];if(!Array.isArray(e)||e.some(n=>typeof n!="string"))throw new Error(`forcedDetectors must be an array of detector ids, got ${JSON.stringify(e)}`);let t=se.filter(n=>n.requiresForce===!0).map(n=>n.id);for(let n of e){if(!ro.has(n))throw new Error(`forcedDetectors: unknown detector "${n}" (force-only detectors: ${t.join(", ")})`);if(!t.includes(n))throw new Error(`forcedDetectors: "${n}" does not need forcing (force-only detectors: ${t.join(", ")})`)}return Array.from(new Set(e))}i(_t,"resolveForcedDetectors");function O(e={}){let t=new Set(Array.isArray(e.enabledDetectors)?e.enabledDetectors:[]),n=new Set(Array.isArray(e.disabledDetectors)?e.disabledDetectors:[]),r=new Set(Array.isArray(e.forcedDetectors)?e.forcedDetectors:[]);return se.filter(o=>o.requiresForce===!0?r.has(o.id)&&!n.has(o.id):t.size>0?t.has(o.id):n.has(o.id)?!1:o.enabledByDefault)}i(O,"getEnabledDetectors");function Bt(e={}){if(Array.isArray(e.includeExtensions)&&e.includeExtensions.length>0)return new Set(e.includeExtensions.map(n=>n.toLowerCase()));let t=O(e);return new Set(t.flatMap(n=>n.extensions))}i(Bt,"getAllowedExtensions");function Ut(e,t={}){let n=be(e).toLowerCase();if(O(t).some(a=>a.extensions.includes(n)&&a.resolveCommentSyntax(e)!==null))return null;if(n.length===0)return"the file has no extension, so its comment syntax is unknown";let o=new Set(Array.isArray(t.forcedDetectors)?t.forcedDetectors:[]),s=se.find(a=>a.requiresForce===!0&&a.extensions.includes(n)&&!o.has(a.id));return s?`${n} files get a header only when forced (--force-detector ${s.id} / forcedDetectors: ["${s.id}"])`:`no enabled detector handles ${n} files`}i(Ut,"getHeaderSkipReason");function Wt(e,t={}){let n=be(e).toLowerCase(),r=Array.isArray(t.detectors)?t.detectors:O(t);for(let o of r){if(!o.extensions.includes(n))continue;let s=o.resolveCommentSyntax(e);if(s){let a=t.detectorSyntaxOverrides&&typeof t.detectorSyntaxOverrides=="object"?t.detectorSyntaxOverrides:{};return oo(s,a[o.id])}}return{kind:"block",blockStart:"/**",blockLinePrefix:" * ",blockEnd:" */"}}i(Wt,"getCommentSyntaxForFile");function zt(e,t){let n=be(e).toLowerCase();return O(t).find(r=>r.extensions.includes(n))}i(zt,"detectorForFile");function ae(e,t,n={}){let r=zt(e,n);if(!r)return"";let o=typeof r.resolvePreservedPrefix=="function"?r.resolvePreservedPrefix(e,t):"",s=r.keepsAboveHeader,a=ie(t.slice(o.length),(c,l)=>re(c)||typeof s=="function"&&s(c,l),o.split(`
7
+ `).length-1);return`${o}${a}`}i(ae,"getPreservedPrefixForFile");function Gt(e,t,n={}){let r=zt(e,n);return r&&typeof r.resolveContentSkipReason=="function"?r.resolveContentSkipReason(t,e):null}i(Gt,"getContentSkipReason");var Yt=200,Z=1,ce=2;function T(e,t,n){if(e==null)return n;if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error(`${t} must be a whole number of 0 or more, got ${JSON.stringify(e)}`);return e}i(T,"resolveLayoutCount");import{existsSync as yo}from"node:fs";import{join as Fe,relative as sn,resolve as Ne,sep as Ce}from"node:path";import{realpath as xo,stat as wo}from"node:fs/promises";import{access as io,readdir as so,readFile as Is,stat as ao}from"node:fs/promises";import{constants as co}from"node:fs";import{dirname as Hs,join as lo,resolve as _s}from"node:path";async function Ee(e){try{return await io(e,co.F_OK),!0}catch{return!1}}i(Ee,"pathExists");async function ke(e,t){let n=[],r=await so(e,{withFileTypes:!0});for(let o of r){let s=lo(e,o.name);if(o.isDirectory()&&t.recursive===!1||o.isDirectory()&&t.ignoreFolders.has(o.name)||o.isDirectory()&&await t.shouldSkipDirectory?.(s,o.name)===!0)continue;if(o.isDirectory()){let l=await ke(s,t);n.push(...l);continue}if(!o.isFile())continue;let a=o.name.lastIndexOf(".");if(a===-1)continue;let c=o.name.slice(a).toLowerCase();t.allowedExtensions.has(c)&&n.push(s)}return n}i(ke,"walkFiles");async function Vt(e){let t=await ao(e);return{createdAt:t.birthtimeMs>0&&t.birthtime<t.mtime?t.birthtime:t.mtime,updatedAt:t.mtime}}i(Vt,"readFileDates");function Jt(e){let t=e.indexOf("<");for(;t!==-1;){let n=e.indexOf(">",t+1);if(n===-1)return!1;if(n>t+1)return!0;t=e.indexOf("<",n+1)}return!1}i(Jt,"hasAngleTag");function qt(e){let t=e.length;for(;t>0&&e[t-1]==="/";)t-=1;return e.slice(0,t)}i(qt,"trimTrailingSlashes");import{execFile as uo}from"node:child_process";import{lstat as fo,readFile as mo}from"node:fs/promises";import{dirname as Kt,isAbsolute as po,join as Qt,relative as en,resolve as Se,sep as tn}from"node:path";import ho from"ignore";function Zt(e,t){return new Promise(n=>{uo("git",t,{cwd:e,encoding:"utf8",maxBuffer:Number.POSITIVE_INFINITY},(r,o)=>{if(!r){n({code:0,stdout:o});return}n({code:typeof r.code=="number"?r.code:-1,stdout:""})})})}i(Zt,"runGitCommand");function De(e,t){return en(e,t).split(tn).join("/")}i(De,"toPosixRelative");async function nn(e){try{return ho().add(await mo(e,"utf8"))}catch{return null}}i(nn,"readIgnoreFile");async function go(e){return fo(Qt(e,".git")).then(()=>!0,()=>!1)}i(go,"hasGitEntry");function Xt(e,t,n){for(let r=e.length-1;r>=0;r--){let{base:o,rules:s}=e[r],a=s.test(`${De(o,t)}${n?"/":""}`);if(a.ignored||a.unignored)return a.ignored}return!1}i(Xt,"matchesRules");async function rn(e,t){let n=await nn(Qt(e,".gitignore"));return{kind:"rules",nested:!0,excluded:!1,matchers:n?[...t,{base:e,rules:n}]:t}}i(rn,"buildRulesContext");async function $e(e){let[t,n]=await Promise.all([Zt(e,["check-ignore","-q","."]),Zt(e,["ls-files","--cached","--others","--exclude-standard","-z"])]);if(t.code!==1||n.code!==0)return rn(e,[]);let r=new Set,o=new Set;for(let s of n.stdout.split("\0")){let a=s.endsWith("/")?s.slice(0,-1):s;if(a.length!==0){r.add(a);for(let c=a.indexOf("/");c!==-1;c=a.indexOf("/",c+1))o.add(a.slice(0,c))}}return{kind:"git",root:e,entries:r,dirs:o}}i($e,"resolveScopeContext");function on(e){let t=Se(e.root),n=e.gitignore;if(n===!1)return{isIgnored:i(async()=>!1,"isIgnored")};let r=new Map,o=i(async()=>{if(typeof n!="string"&&!Array.isArray(n))return $e(t);let c=typeof n=="string"?[n]:n.filter(u=>typeof u=="string"),l=[];for(let u of c){let f=await nn(Se(t,u));f&&l.push({base:t,rules:f})}return{kind:"rules",nested:!1,excluded:!1,matchers:l}},"buildRootContext"),s=i(c=>{let l=r.get(c);return l||(l=c===t?o():a(c),r.set(c,l)),l},"contextFor"),a=i(async c=>{let l=await s(Kt(c));return l.kind==="git"?l.entries.has(De(l.root,c))?$e(c):l:!l.nested||l.excluded?l:Xt(l.matchers,c,!0)?{...l,excluded:!0}:await go(c)?$e(c):rn(c,l.matchers)},"deriveContext");return{async isIgnored(c,l){let u=Se(c),f=en(t,u);if(f.length===0||f===".."||f.startsWith(`..${tn}`)||po(f))return!1;let p=await s(Kt(u));if(p.kind==="git"){let y=De(p.root,u);return!(p.entries.has(y)||l&&p.dirs.has(y))}return p.excluded||Xt(p.matchers,u,l)}}}i(on,"createIgnoreFilter");function bo(e){return Bt(e)}i(bo,"resolveExtensions");var Eo=Object.freeze(["node_modules","bower_components","jspm_packages",".pnpm-store",".yarn"]),ln=new Set([".git",...Eo]),ko=Object.freeze(["autoload.php","modules.txt"]);function an(e,t){return ln.has(t)?!0:t==="vendor"&&ko.some(n=>yo(Fe(e,n)))}i(an,"isNeverWalked");function Ae(e){return qt(e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,""))}i(Ae,"normalizeFolderPath");function So(e){return Array.isArray(e)?e.map(t=>{if(typeof t=="string")return{path:t,recursive:!0};if(t&&typeof t=="object"&&typeof t.path=="string")return{path:t.path,recursive:t.recursive!==!1};throw new TypeError(`Invalid includeFolders entry: ${JSON.stringify(t)} (expected a path string or { path, recursive? })`)}):[]}i(So,"resolveIncludeFolders");function cn(e,t){let n=t instanceof Error?t.message:String(t);console.warn(`fix-headers: skipped include folder "${e}" (${n})`)}i(cn,"reportSkippedIncludeFolder");function $o(e,t){if(!Array.isArray(t)||t.length===0)return()=>!1;let n=Ne(e),r=[],o=new Set;for(let s of t){if(typeof s!="string")continue;let a=Ae(s);if(a.length!==0){if(a.includes("/")){r.push(Ne(n,a));continue}o.add(a)}}return(s,a)=>{if(o.has(a))return!0;for(let l of r)if(s===l||s.startsWith(`${l}/`))return!0;let c=Ae(sn(n,s));return r.some(l=>{let u=Ae(sn(n,l));return c===u||c.startsWith(`${u}/`)})}}i($o,"buildExclusionMatcher");async function ve(e){let t=bo(e),n=So(e.includeFolders),r=Array.isArray(e.excludeFolders)?e.excludeFolders:[],o=$o(e.projectRoot,r),s=on({root:e.projectRoot,gitignore:e.gitignore}),a=i(async(d,m)=>an(d,m)||o(d,m)||await s.isIgnored(d,!0),"shouldSkipDirectory"),c=n.length>0?n.map(d=>({includeFolder:d.path,rootPath:Fe(e.projectRoot,d.path),recursive:d.recursive})):[{includeFolder:".",rootPath:e.projectRoot,recursive:!0}],l=[];for(let d of c){let m=await wo(d.rootPath).catch(b=>b);if(m instanceof Error){if(m.code==="ENOENT"){cn(d.includeFolder,m);continue}throw m}if(!m.isDirectory()){cn(d.includeFolder,`path is not a directory: ${d.rootPath}`);continue}let w=await xo(d.rootPath).catch(()=>Ne(d.rootPath));l.push({...d,realRoot:w})}let u=i((d,m)=>{if(d.realRoot===m.realRoot)return d.recursive||!m.recursive;let w=d.realRoot.endsWith(Ce)?d.realRoot:`${d.realRoot}${Ce}`;if(!d.recursive||!m.realRoot.startsWith(w))return!1;let b=d.rootPath;for(let S of m.realRoot.slice(w.length).split(Ce))if(b=Fe(b,S),an(b,S)||o(b,S))return!1;return!0},"covers"),f=[...l].sort((d,m)=>d.realRoot.length-m.realRoot.length||Number(m.recursive)-Number(d.recursive)),p=[];for(let d of f)p.some(m=>u(m,d))||p.push(d);let y=[];for(let d of l){if(!p.includes(d))continue;let m=await ke(d.rootPath,{allowedExtensions:t,ignoreFolders:ln,shouldSkipDirectory:a,recursive:d.recursive});y.push(...m)}let g=[];for(let d of new Set(y))!o(d,d.split("/").at(-1)||"")&&!await s.isIgnored(d,!1)&&g.push(d);return g}i(ve,"discoverFiles");import{basename as Ko,dirname as Zo,extname as Xo,resolve as Ie}from"node:path";import{dirname as En,isAbsolute as Po,join as kn,relative as Io,resolve as Sn,sep as Oo}from"node:path";import{readFile as Do}from"node:fs/promises";import{join as Co}from"node:path";async function Ao(e){try{return await Do(e,"utf8")}catch{return null}}i(Ao,"readManifest");async function R(e,t){let n=[];for(let r of t){let o=await Ao(Co(e,r));o!==null&&n.push({file:r,content:o})}return n.length>0?{dir:e,manifest:n[0].file,files:n}:null}i(R,"detectManifests");function H(e,t){return e.files.find(n=>n.file===t)?.content??null}i(H,"manifestContent");function C(e){return typeof e=="string"&&e.trim().length>0?e.trim():void 0}i(C,"cleanName");function Le(e){if(typeof e!="string")return;let t=e.search(/[<(]/);return C(t===-1?e:e.slice(0,t))}i(Le,"personName");function le(e){try{return JSON.parse(e)}catch{return}}i(le,"parseJsonManifest");function*Re(e,t){let n="";for(let r of e.split(/\r?\n/)){let o=r.trim();if(o.startsWith("[")){let s=o.match(/^\[([^[\]]+)\]/);n=s?s[1].split(".").map(a=>a.trim()).join("."):"";continue}n===t&&(yield o)}}i(Re,"sectionLines");function X(e,t,n){let r=new RegExp(`^${n}\\s*=\\s*(?:"([^"\\\\]*)"|'([^']*)')`);for(let o of Re(e,t)){let s=o.match(r);if(s)return C(s[1]??s[2])}}i(X,"readTomlString");function je(e,t,n){let r=new RegExp(`^${n}\\s*[=:](.*)$`);for(let o of Re(e,t)){let s=o.match(r);if(s)return C(s[1])}}i(je,"readIniValue");function Fo(e,t,n){let r=new RegExp(`^${n}\\s*=\\s*\\[`),o=null;for(let s of Re(e,t)){if(o!==null){o.push(s);continue}let a=s.match(r);a&&(o=[s.slice(a[0].length)])}return o===null?null:o.join(`
8
+ `)}i(Fo,"tomlArrayText");function No(e,t){let n=t;for(;n<e.length;)if(e[n]==="#"){let r=e.indexOf(`
9
+ `,n);n=r===-1?e.length:r+1}else if(/\s/.test(e[n]))n+=1;else break;return n}i(No,"skipTomlSpace");function Q(e,t){let n=Fo(e,t,"authors");if(n===null)return;let r=n.slice(No(n,0)),o=r.match(/^(?:"([^"\\\n]*)"|'([^'\n]*)')/);if(o)return Le(o[1]??o[2]);let a=r.match(/^\{([^}\n]*)\}/)?.[1].match(/(?:^|,)\s*name\s*=\s*(?:"([^"\\\n]*)"|'([^'\n]*)')/);return a?C(a[1]??a[2]):void 0}i(Q,"readTomlAuthor");var un=["go.mod"];function vo(e){let t=e.match(/^\s*module\s+(.+)$/m);if(t)return C(t[1].replace(/\/\/.*$/,"").trim().replace(/^["`](.*)["`]$/,"$1"))}i(vo,"readModulePath");var dn={id:"go",languages:["go"],manifests:un,detect(e){return R(e,un)},read(e){return{name:vo(e.files[0].content)}}};var fn=["package.json"];function Lo(e){let t=C(e?.name),n=C(e?.publisher),r=typeof e?.engines?.vscode=="string";return t&&n&&r?`${n}.${t}`:t}i(Lo,"readPublishedName");function Ro(e){if(e!==null&&typeof e=="object"){let t=e;return C(t.company)??C(t.name)}return Le(e)}i(Ro,"readAuthorCompany");var mn={id:"node",languages:["node"],manifests:fn,detect(e){return R(e,fn)},read(e){let t=le(e.files[0].content);return{name:Lo(t),company:Ro(t?.author)}}};var pn=["composer.json"],hn={id:"php",languages:["php"],manifests:pn,detect(e){return R(e,pn)},read(e){let t=le(e.files[0].content),n=t?.authors;return{name:C(t?.name),company:Array.isArray(n)?C(n[0]?.name):void 0}}};var gn=["pyproject.toml","setup.cfg","setup.py"];function yn(e,t){let n=e.indexOf("setup(");if(n===-1)return;let r=e.slice(n).match(new RegExp(`\\b${t}\\s*=\\s*(["'])([^"'\\n]+)\\1`));return r&&r[2].trim()||void 0}i(yn,"readSetupPyArgument");function jo(e){let t=H(e,"pyproject.toml"),n=H(e,"setup.cfg"),r=H(e,"setup.py");return(t===null?void 0:X(t,"project","name")??X(t,"tool.poetry","name"))??(n===null?void 0:je(n,"metadata","name"))??(r===null?void 0:yn(r,"name"))}i(jo,"readPythonName");function Mo(e){let t=H(e,"pyproject.toml"),n=H(e,"setup.cfg"),r=H(e,"setup.py");return(t===null?void 0:Q(t,"project")??Q(t,"tool.poetry"))??(n===null?void 0:je(n,"metadata","author"))??(r===null?void 0:yn(r,"author"))}i(Mo,"readPythonCompany");var xn={id:"python",languages:["python"],manifests:gn,detect(e){return R(e,gn)},read(e){return{name:jo(e),company:Mo(e)}}};var wn=["Cargo.toml"],bn={id:"rust",languages:["rust"],manifests:wn,detect(e){return R(e,wn)},read(e){let t=e.files[0].content;return{name:X(t,"package","name"),company:Q(t,"package")}}};var To=[mn,xn,hn,bn,dn],$n=["name","company"];async function Me(e,t,n){let o=(await Promise.all(t.map(async a=>({driver:a,detection:await a.detect(e)})))).filter(a=>a.detection!==null),s=o.filter(a=>typeof n=="string"&&a.driver.languages.includes(n));return[...s,...o.filter(a=>!s.includes(a))]}i(Me,"claimFolder");function Ho(e,t){let n=Io(t,e);return n!==""&&n!==".."&&!n.startsWith(`..${Oo}`)&&!Po(n)}i(Ho,"isStrictlyInside");async function Dn(e,t={}){let n=Array.isArray(t.drivers)?t.drivers:To,r=typeof t.scanRoot=="string"?Sn(t.scanRoot):null,o=Sn(e),s=await Me(o,n,t.language);for(;s.length===0;){if(await Ee(kn(o,".git")))return{root:o,marker:".git",drivers:[],fields:{},sources:{}};let f=En(o);if(f===o)return null;o=f,s=await Me(o,n,t.language)}let a={},c={},l=o,u=s;for(;;){for(let{driver:p,detection:y}of u){let g=p.read(y);for(let d of $n)a[d]===void 0&&g[d]!==void 0&&(a[d]=g[d],c[d]={driver:p.id,manifest:y.manifest,dir:l})}if($n.every(p=>a[p]!==void 0)||r===null||!Ho(l,r)||await Ee(kn(l,".git")))break;l=En(l),u=await Me(l,n,t.language)}return{root:o,marker:s[0].detection.manifest,drivers:s.map(f=>f.driver.id),fields:a,sources:c}}i(Dn,"resolveManifestProject");import{execFile as _o}from"node:child_process";import{basename as Bo,dirname as Uo}from"node:path";import{promisify as Wo}from"node:util";var Pe=Wo(_o);async function v(e,t){try{let{stdout:n}=await Pe("git",t,{cwd:e}),r=n.trim();return r.length>0?r:null}catch{return null}}i(v,"runGit");function Cn(e,t){let n=0;for(let r=t-1;r>=0&&e[r]==="\\";r--)n++;return n%2===1}i(Cn,"isEscaped");function zo(e){let t=e.trim();if(!t.endsWith(")")||Cn(t,t.length-1))return t;let n=0;for(let r=t.length-1;r>=0;r--){let o=t[r];if(!(o!=="("&&o!==")"||Cn(t,r))&&(n+=o===")"?1:-1,n===0))return t.slice(0,r).trim()}return t}i(zo,"stripUidComment");function Go(e){let t=e.trim();if(t.length===0)return{authorName:null,authorEmail:null};let n=t.match(/<([^>\n]+)>\s*$/),r=n?.[1]?.trim()||null,o=(n?t.slice(0,n.index):t).trim();return{authorName:zo(o)||o||null,authorEmail:r}}i(Go,"parseSignerUid");async function Yo(e,t){try{let{stdout:n}=await Pe(e,t),r=n.trim();return r.length>0?r:null}catch{return null}}i(Yo,"runProgram");function Vo(e){return e.replace(/\\x([0-9a-fA-F]{2})/g,(t,n)=>String.fromCharCode(Number.parseInt(n,16)))}i(Vo,"decodeColonField");async function Jo(e){let t=await v(e,["config","--get","gpg.format"]);if(t!==null&&t!=="openpgp")return null;let n=await v(e,["config","--get","user.signingkey"]);if(!n)return null;let r=await v(e,["config","--get","gpg.openpgp.program"])||await v(e,["config","--get","gpg.program"])||"gpg",o=await Yo(r,["--batch","--with-colons","--list-keys",n]);if(!o)return null;for(let s of o.split(`
10
+ `)){let a=s.split(":");if(a[0]==="uid"&&a[1]!=="r"&&a[1]!=="e"&&a[9])return Vo(a[9])}return null}i(Jo,"readSigningKeyUid");async function An(e,t={}){let n=await v(e,["config","--get","user.name"]),r=await v(e,["config","--get","user.email"]);if(t.useGpgSignerAuthor===!0){let o=await Jo(e)||await v(e,["log","-1","--format=%GS"]),s=Go(o||"");n=s.authorName||n,r=r||s.authorEmail}if(!n||!r){let o=await v(e,["log","-1","--format=%an|%ae"]);if(o){let[s,a]=o.split("|");n=n||s||null,r=r||a||null}}return{authorName:n,authorEmail:r}}i(An,"detectGitAuthor");function Fn(e){return e.replace(/z$/i,"+00:00")}i(Fn,"canonicalGitDate");async function Nn(e,t){let n=await v(e,["log","--follow","--format=%aI|%at","--reverse","--",t]);if(!n)return null;let r=n.split(`
11
+ `)[0],[o,s]=r.split("|");if(!o||!s)return null;let a=Number.parseInt(s,10);return Number.isNaN(a)?null:{date:Fn(o),timestamp:a}}i(Nn,"getGitCreationDate");async function vn(e,t){let n=await v(e,["log","-1","--format=%aI|%at","--",t]);if(!n)return null;let[r,o]=n.split("|");if(!r||!o)return null;let s=Number.parseInt(o,10);return Number.isNaN(s)?null:{date:Fn(r),timestamp:s}}i(vn,"getGitLastModifiedDate");var qo=256*1024*1024;async function Ln(e){let t=Uo(e);if(await v(t,["rev-parse","--is-inside-work-tree"])!=="true")return{state:"no-git",content:null};try{let{stdout:n}=await Pe("git",["show",`HEAD:./${Bo(e)}`],{cwd:t,encoding:"utf8",maxBuffer:qo});return{state:"tracked",content:n}}catch{return{state:"untracked",content:null}}}i(Ln,"readGitHeadFile");function Qo(e){return Ko(e)||"project"}i(Qo,"folderName");function ei(e,t){if(typeof t!="string")return e;let n=t.trim();return n.length===0||Jt(e)?e:`${e} <${n}>`}i(ei,"formatAuthorNameWithCompany");async function ti(e,t={}){let n=Array.isArray(t.detectors)?t.detectors:O(t),r=typeof t.preferredExtension=="string"?t.preferredExtension.trim().toLowerCase():"",o=r.length>0?n.find(u=>u.extensions.includes(r)):void 0,s=await Dn(e,{drivers:t.drivers,language:o?.id,scanRoot:t.scanRoot}),a=s?s.root:Ie(e),c=s?.sources.name,l=s?.sources.company;return{language:o?.id??s?.drivers[0]??"unknown",rootDir:a,marker:s?s.marker:null,projectName:s?.fields.name??Qo(a),projectNameSource:c?{from:"manifest",...c}:{from:"folder",dir:a},companyName:s?.fields.company??null,companyNameSource:l?{from:"manifest",...l}:{from:"none"},drivers:s?s.drivers:[]}}i(ti,"detectProjectFromMarkers");async function Oe(e={}){let t=e.targetFilePath||e.cwd||process.cwd(),n=Ie(t),r=O(e),o=e.targetFilePath?Zo(n):n,s=e.targetFilePath?Xo(n).toLowerCase():"",a=Ie(e.projectRoot||e.cwd||process.cwd()),c=await ti(o,{detectors:r,preferredExtension:s,scanRoot:a}),l=await An(c.rootDir,{useGpgSignerAuthor:e.useGpgSignerAuthor===!0}),u=e.authorName||l.authorName||"Unknown Author",f=typeof e.companyName=="string"?e.companyName.trim():"";return{projectName:e.projectName||c.projectName,projectNameSource:e.projectName?{from:"option"}:c.projectNameSource,language:e.language||c.language,projectRoot:e.projectRoot||c.rootDir,marker:e.marker===void 0?c.marker:e.marker,authorName:ei(u,e.company),authorEmail:e.authorEmail||l.authorEmail||"unknown@example.com",companyName:f||c.companyName,companyNameSource:f?{from:"option"}:c.companyNameSource,copyrightStartYear:Number.isInteger(e.copyrightStartYear)?Number(e.copyrightStartYear):null}}i(Oe,"resolveProjectMetadata");function ni(e){return Te({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),offsetMinutes:-e.getTimezoneOffset()})}i(ni,"formatDateWithTimezone");function Te(e){return`${Pn(e," ")} ${In(e.offsetMinutes)}`}i(Te,"formatSpaceDate");function jn(e){if(typeof e!="string")throw new Error(`timezone must be an IANA time zone name string, such as "America/Los_Angeles" or "UTC" (got ${typeof e})`);try{Mn(e)}catch(t){throw new Error(`Unknown time zone "${e}": expected an IANA time zone name, such as "America/Los_Angeles" or "UTC"`,{cause:t})}return e}i(jn,"assertTimeZone");var Rn=new Map;function Mn(e){let t=Rn.get(e);return t||(t=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}),Rn.set(e,t)),t}i(Mn,"getZoneFormatter");function He(e,t){let n={};for(let o of Mn(t).formatToParts(new Date(e*1e3)))n[o.type]=Number(o.value);let r=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second)/1e3;return{year:n.year,month:n.month,day:n.day,hour:n.hour,minute:n.minute,second:n.second,offsetMinutes:(r-e)/60}}i(He,"toZonedDateParts");function Pn(e,t){let n=i(r=>String(r).padStart(2,"0"),"pad");return`${String(e.year).padStart(4,"0")}-${n(e.month)}-${n(e.day)}${t}${n(e.hour)}:${n(e.minute)}:${n(e.second)}`}i(Pn,"formatWallClock");function In(e){let t=i(r=>String(r).padStart(2,"0"),"pad"),n=Math.abs(e);return`${e>=0?"+":"-"}${t(Math.floor(n/60))}:${t(n%60)}`}i(In,"formatOffset");function ue(e=new Date){return{date:ni(e),timestamp:Math.floor(e.getTime()/1e3)}}i(ue,"toDatePayload");var ri=/^(\d{4})-(\d{2})-(\d{2})(?:T|\s+)(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?\s*(?:(Z)|([+-])(\d{2}):?(\d{2}))$/i;function _(e){let t=ri.exec(e.trim());if(!t)return null;let[n,r,o,s,a,c]=t.slice(1,7).map(Number),l=t[7]?0:Number(t[9])*60+Number(t[10]),u=t[8]==="-"?-l:l,f=new Date(Date.UTC(n,r-1,o,s,a,c));return!(f.getUTCFullYear()===n&&f.getUTCMonth()===r-1&&f.getUTCDate()===o&&f.getUTCHours()===s&&f.getUTCMinutes()===a&&f.getUTCSeconds()===c)||Number(t[10]??0)>59?null:{year:n,month:r,day:o,hour:s,minute:a,second:c,offsetMinutes:u,timestamp:Math.floor(f.getTime()/1e3)-u*60}}i(_,"parseHeaderDate");function _e(e){return`${Pn(e,"T")}${In(e.offsetMinutes)}`}i(_e,"formatIsoDate");var oi={"git-created":"git first commit","filesystem-created":"filesystem creation time"};function On(e,t){let n=e.match(new RegExp(`${t}:[^\\S\\n]*(.*)$`,"m"));return n?n[1].trim():null}i(On,"readHeaderField");function Be(e){let t=null;for(let{source:n,payload:r}of e)r&&(!t||r.timestamp<t.payload.timestamp)&&(t={source:n,payload:r});return t}i(Be,"pickOldestDate");function Hn({existing:e,gitCreated:t,filesystemCreated:n,fixCreatedDate:r=!1}){let o=[{source:"git-created",payload:t},{source:"filesystem-created",payload:n}];if(!e)return Be(o);if(!r)return{source:"existing-header",payload:e};let s=_(e.date)?e:null;return Be([{source:"existing-header",payload:s},...o])}i(Hn,"resolveCreatedDate");function _n(e,t=null){if(t)return He(e.timestamp,t).year;let n=_(e.date);return n?n.year:new Date(e.timestamp*1e3).getFullYear()}i(_n,"dateYear");function Tn(e,t,n,r){let o=e.match(/^(.+?)\s*\((\d+)\)$/),s=o?_(o[1]):null;if(!o||!s)return r.push({check:`${n}-format`,field:t,advisory:!1,value:e,message:`${t} value "${e}" is not a "<datetime> (<epoch>)" pair with a recognised datetime`}),null;let a=Number.parseInt(o[2],10);return a!==s.timestamp&&r.push({check:`${n}-epoch`,field:t,advisory:!1,value:e,expected:`${o[1]} (${s.timestamp})`,message:`${t} epoch ${a} does not match ${o[1]} (expected ${s.timestamp})`}),{text:o[1],timestamp:s.timestamp}}i(Tn,"checkDateValue");function Bn(e,t={},n={}){let r=[],o=On(e,"@Date"),s=o===null?null:Tn(o,"@Date","created",r),a=Be([{source:"git-created",payload:t.gitCreated},{source:"filesystem-created",payload:t.filesystemCreated}]);if(s&&a&&s.timestamp>a.payload.timestamp){let f=oi[a.source];r.push({check:"created-newer-than-source",field:"@Date",advisory:n.strictCreatedDate!==!0,value:o,expected:`${a.payload.date} (${a.payload.timestamp})`,source:a.source,message:`@Date ${s.text} is later than the ${f} ${a.payload.date} (${a.payload.timestamp})`})}let c=On(e,"@Last modified time"),l=c===null?null:Tn(c,"@Last modified time","modified",r),u=t.gitLastModified;return l&&u&&l.timestamp!==u.timestamp&&r.push({check:"modified-git",field:"@Last modified time",advisory:!0,value:c,expected:`${u.date} (${u.timestamp})`,message:`@Last modified time ${l.text} does not match the git last commit ${u.date} (${u.timestamp})`}),r}i(Bn,"checkHeaderDates");function Ue(e){if(!e)return null;let t=_(e.date);return t&&t.timestamp!==e.timestamp?{date:e.date,timestamp:t.timestamp}:e}i(Ue,"repairDateEpoch");function Un(e){let t=_(e.date);return t?{date:_e(t),timestamp:t.timestamp}:e}i(Un,"normalizeDatePayload");function Wn(e,t){let n=_(e.date);if(!n)return e;let r=He(n.timestamp,t);return r.offsetMinutes===n.offsetMinutes||!Number.isInteger(r.offsetMinutes)?e:{date:/^\d{4}-\d{2}-\d{2}T/i.test(e.date.trim())?_e(r):Te(r),timestamp:n.timestamp}}i(Wn,"convertDatePayload");import{relative as si}from"node:path";import{extname as ii}from"node:path";function B(e,t={}){let n=ii(e).toLowerCase(),r=T(t.spacing,"spacing",Z);return n.length===0?{kind:"block",blockStart:"/**",blockLinePrefix:" * ",blockEnd:" */",spacing:r}:{...Wt(e,t),spacing:r}}i(B,"getHeaderSyntaxForFile");function zn(e,t){let n=e.spacing??Z;if(e.kind==="line"){let c=e.linePrefix||"#",l=typeof e.lineSeparator=="string"?e.lineSeparator:" ",u=Array.from({length:n},()=>c);return[...u,...t.map(f=>`${c}${l}${f}`),...u].join(`
12
+ `)}let r=e.blockStart||(e.kind==="html"?"<!--":"/**"),o=e.blockLinePrefix||(e.kind==="html"?" ":" * "),s=e.blockEnd||(e.kind==="html"?"-->":" */"),a=Array.from({length:n},()=>o.trimEnd());return[r,...a,...t.map(c=>`${o}${c}`),...a,s].join(`
13
+ `)}i(zn,"renderHeaderLines");function Gn(e){let t=si(e.projectRoot,e.absoluteFilePath).replace(/\\/g,"/"),n=B(e.absoluteFilePath,e.syntaxOptions||{language:e.language}),r=e.createdByName||e.authorName,o=e.createdByEmail||e.authorEmail,s=e.lastModifiedByName||e.authorName,a=e.lastModifiedByEmail||e.authorEmail,c=typeof e.companyName=="string"?e.companyName.trim():"",l=c.length>0?`${c} `:"",u=[`@Project: ${e.projectName}`,`@Filename: ${t}`,`@Date: ${e.createdAt.date} (${e.createdAt.timestamp})`,`@Author: ${r}`,`@Email: <${o}>`,"-----",`@Last modified by: ${s} (${a})`,`@Last modified time: ${e.lastModifiedAt.date} (${e.lastModifiedAt.timestamp})`,"-----",`@Copyright: Copyright (c) ${e.copyrightStartYear}-${e.currentYear} ${l}All rights reserved.`];return zn(n,u)}i(Gn,"buildHeader");var ai=Object.freeze(["projectName","filename","createdAt","authorName","authorEmail","lastModifiedByName","lastModifiedByEmail","lastModifiedAt","copyrightStartYear","copyrightEndYear","companyName"]);function I(e,t){let n=e.match(new RegExp(`@${t}:[ \\t]*(.*)$`,"m")),r=n?n[1].trim():"";return r.length>0?r:null}i(I,"readTag");function ci(e){if(e===null)return{name:null,email:null};if(!e.endsWith(")"))return{name:e,email:null};let t=e.slice(0,-1),n=t.indexOf("(",t.lastIndexOf(")")+1);return n===-1?{name:e,email:null}:{name:t.slice(0,n).trimEnd()||null,email:t.slice(n+1)||null}}i(ci,"splitLastModifiedBy");function li(e){let t={startYear:null,endYear:null,companyName:null},n=e?.match(/^Copyright\s+\(c\)\s+(\d{4})/i);if(!n)return t;let r=e.slice(n[0].length),o=r.match(/^\s*-\s*(\d{4})/);o&&(r=r.slice(o[0].length));let s=r.toLowerCase(),a=s.endsWith("all rights reserved.")?20:s.endsWith("all rights reserved")?19:0;return a===0||!/^\s/.test(r)?t:{startYear:n[1],endYear:o?o[1]:null,companyName:r.slice(0,-a).trim()||null}}i(li,"splitCopyright");function Yn(e){let t=ci(I(e,"Last modified by")),n=li(I(e,"Copyright")),r=I(e,"Email");return{projectName:I(e,"Project"),filename:I(e,"Filename"),createdAt:I(e,"Date"),authorName:I(e,"Author"),authorEmail:r===null?null:r.replace(/^<(.*)>$/,"$1"),lastModifiedByName:t.name,lastModifiedByEmail:t.email,lastModifiedAt:I(e,"Last modified time"),copyrightStartYear:n.startYear,copyrightEndYear:n.endYear,companyName:n.companyName}}i(Yn,"parseHeaderFields");function Vn(e,t){let n=Yn(e??""),r=Yn(t);return ai.filter(o=>n[o]!==r[o]).map(o=>({field:o,previous:n[o],detected:r[o]}))}i(Vn,"compareHeaderFields");function ee(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(ee,"escapeRegex");function We(e,t,n={}){let r=t.startsWith("\uFEFF")?"\uFEFF":"",o=t.slice(r.length),s=`${r}${ae(e,o,n)}`;return{prefix:s,body:t.slice(s.length)}}i(We,"splitPreservedPrefix");function de(e){let t=e.indexOf(`
10
14
  `);return t===-1?null:t>0&&e[t-1]==="\r"?`\r
11
15
  `:`
12
- `}i(de,"lineEnding");function W(e,t){if(t.kind==="html"){let n=ee(t.blockStart||"<!--"),o=ee(t.blockEnd||"-->");return e.match(new RegExp(`^${n}[\\s\\S]*?${o}(?:\\r?\\n)*`))}if(t.kind==="line"){let n=ee(t.linePrefix||"#");return e.match(new RegExp(`^(?:${n}[^\\n]*\\n)+(?:\\r?\\n)*`))}let r=ee((t.blockEnd||" */").trim());return e.match(new RegExp(`^/\\*[\\s\\S]*?${r}(?:\\r?\\n)*`))}i(W,"matchHeaderSegment");var Gr=/^@(Project|Filename|Date|Author|Email|Last modified by|Last modified time|Copyright):/,Zo="Moved out of the file header by fix-headers:";function Yr(e){return e.some(t=>/^@(?:Project|Filename):/.test(t.text))}i(Yr,"isFileHeader");function We(e,t){let r=e.replace(/(?:\r?\n)+$/,"");if(t.kind==="line"){let f=new RegExp(`^${ee(t.linePrefix||"#")}[ \\t]*`);return r.split(`
13
- `).map(p=>{let y=p.replace(/\r$/,"");return{raw:y,text:y.replace(f,"").trim()}})}let n=t.kind==="html",o=n?r.replace(/^<!--/,"").replace(/--!?>\s*$/,""):r.replace(/^\/\*+/,"").replace(/\*+\/\s*$/,""),s=t.blockLinePrefix||(n?" ":" * "),a=n?/^\s*/:/^\s*\*?[ \t]*/,c=o.split(`
14
- `).map((f,p)=>({raw:p===0&&f.trim()!==""?`${s}${f.trim()}`:f.trimEnd(),text:(p===0?f:f.replace(a,"")).trim()})),l=c[0].raw===""?1:0,u=c.length>l&&c[c.length-1].raw.trim()===""?c.length-1:c.length;return c.slice(l,u)}i(We,"segmentLines");function Xo(e,t){let r=e.map(o=>{let s=o.text.match(Gr);return o.text===""?"blank":s&&s[1]==="Copyright"?t.copyright?"copyright":(t.copyright=!0,"field"):s?"field":/^-{3,}$/.test(o.text)?"dash":"text"}),n=i((o,s)=>{for(let a=o+s;a>=0&&a<r.length;a+=s)if(r[a]!=="blank"&&r[a]!=="dash")return r[a]==="copyright"?"field":r[a]},"neighbour");return r.map((o,s)=>o==="dash"?n(s,-1)==="field"||n(s,1)==="field"?"separator":"text":o)}i(Xo,"classifyLines");function Qo(e,t="",r={}){let n=B(t,r),o=[],s=[],a={copyright:!1},c=e,l=W(c,n),u=!0;for(;l&&l[0].length>0;){let m=We(l[0],n),w=Xo(m,a),b=m.findIndex($=>$.text!=="");!u&&b!==-1&&m[b].text===Zo&&(w[b]="separator"),m.forEach(($,C)=>{w[C]==="copyright"&&s.push($.text.replace(Gr,"").trim()),o.push({raw:$.raw,kind:w[C]})}),c=c.slice(l[0].length),l=W(c,n),u=!1}let f=o.findIndex(m=>m.kind==="text");if(f===-1)return{foreign:[],copyrights:s};let p=o.map(m=>m.kind).lastIndexOf("text"),y=[],g=[],d=!1;for(let m of o.slice(f,p+1))m.kind==="text"?(y.push(...d?[]:g,m.raw),g=[],d=!1):m.kind==="blank"?g.push(m.raw):d=!0;return{foreign:y,copyrights:s}}i(Qo,"splitHeaderText");function ei(e,t,r){let n=t.kind==="html";return t.kind==="line"?e.join(r):[t.blockStart||(n?"<!--":"/**"),...e,t.blockEnd||(n?"-->":" */")].join(r)}i(ei,"renderForeignBlock");function ti(e,t,r){let n=e.split(`
15
- `),o=r.kind==="html",s=r.kind==="line"?r.linePrefix||"#":(r.blockLinePrefix||(o?" ":" * ")).trimEnd(),a=Math.min(n.length-1,(r.spacing??1)+(r.kind==="line"?0:1)),c=n.length-a;return[...n.slice(0,c),s,...t,...n.slice(c)].join(`
16
- `)}i(ti,"appendToHeader");function zr(e){let t=e.trim(),r=t.match(/^copyright\b/i);t=r?t.slice(r[0].length).trimStart():t;for(let c=t.match(/^(?:\(c\)|©)/i);c;c=t.match(/^(?:\(c\)|©)/i))t=t.slice(c[0].length).trimStart();let n=t.match(/^\d{4}(?:\s*[-–,]\s*\d{4})*/);t=n?t.slice(n[0].length):t,t=t.trimEnd();let o=t.toLowerCase(),s=o.endsWith("all rights reserved.")?20:o.endsWith("all rights reserved")?19:0;t=t.slice(0,t.length-s);let a=t.length;for(;a>0&&`.,; \r
17
- `.includes(t[a-1]);)a-=1;return t.slice(0,a).split(/\s+/).filter(Boolean).join(" ").toLowerCase()}i(zr,"copyrightHolder");function ri(e,t){let r=e.split(`
18
- `),n=r.findIndex(c=>c.includes("@Copyright:")),o=r.map(c=>/@[A-Za-z][A-Za-z ]*:/.test(c)).lastIndexOf(!0),s=n!==-1?n:o;if(t.length===0||s===-1)return e;let a=r[s].slice(0,r[s].indexOf("@"));return[...r.slice(0,s+1),...t.map(c=>`${a}@Copyright: ${c}`),...r.slice(s+1)].join(`
19
- `)}i(ri,"insertCopyrights");function Wr(e,t){let r=0,n=W(e,t);for(;n&&n[0].length>0&&Yr(We(n[0],t));)r+=n[0].length,n=W(e.slice(r),t);return r}i(Wr,"leadingHeadersLength");function fe(e,t="",r={}){let n=e.startsWith("\uFEFF")?"\uFEFF":"",o=e.slice(n.length),s=ae(t,o,r),a=B(t,r),c=s.length,l=Wr(o.slice(c),a);if(l===0)return e;let u=n===""&&c===0&&o.startsWith("\uFEFF",l);u&&(n="\uFEFF",o=`${o.slice(0,l)}${o.slice(l+1)}`,l+=Wr(o.slice(l),a));let f=o.slice(c,c+l),p=o.slice(c+l),y=ae(t,`${s}${p}`,r),g=y.length>s.length?y.slice(s.length):"";if(g===""&&!u)return e;let d=g===""||g.endsWith(`
16
+ `}i(de,"lineEnding");function z(e,t){if(t.kind==="html"){let r=ee(t.blockStart||"<!--"),o=ee(t.blockEnd||"-->");return e.match(new RegExp(`^${r}[\\s\\S]*?${o}(?:\\r?\\n)*`))}if(t.kind==="line"){let r=ee(t.linePrefix||"#");return e.match(new RegExp(`^(?:${r}[^\\n]*\\n)+(?:\\r?\\n)*`))}let n=ee((t.blockEnd||" */").trim());return e.match(new RegExp(`^/\\*[\\s\\S]*?${n}(?:\\r?\\n)*`))}i(z,"matchHeaderSegment");var Kn=/^@(Project|Filename|Date|Author|Email|Last modified by|Last modified time|Copyright):/,ui="Moved out of the file header by fix-headers:";function Zn(e){return e.some(t=>/^@(?:Project|Filename):/.test(t.text))}i(Zn,"isFileHeader");function ze(e,t){let n=e.replace(/(?:\r?\n)+$/,"");if(t.kind==="line"){let f=new RegExp(`^${ee(t.linePrefix||"#")}[ \\t]*`);return n.split(`
17
+ `).map(p=>{let y=p.replace(/\r$/,"");return{raw:y,text:y.replace(f,"").trim()}})}let r=t.kind==="html",o=r?n.replace(/^<!--/,"").replace(/--!?>\s*$/,""):n.replace(/^\/\*+/,"").replace(/\*+\/\s*$/,""),s=t.blockLinePrefix||(r?" ":" * "),a=r?/^\s*/:/^\s*\*?[ \t]*/,c=o.split(`
18
+ `).map((f,p)=>({raw:p===0&&f.trim()!==""?`${s}${f.trim()}`:f.trimEnd(),text:(p===0?f:f.replace(a,"")).trim()})),l=c[0].raw===""?1:0,u=c.length>l&&c[c.length-1].raw.trim()===""?c.length-1:c.length;return c.slice(l,u)}i(ze,"segmentLines");function di(e,t){let n=e.map(o=>{let s=o.text.match(Kn);return o.text===""?"blank":s&&s[1]==="Copyright"?t.copyright?"copyright":(t.copyright=!0,"field"):s?"field":/^-{3,}$/.test(o.text)?"dash":"text"}),r=i((o,s)=>{for(let a=o+s;a>=0&&a<n.length;a+=s)if(n[a]!=="blank"&&n[a]!=="dash")return n[a]==="copyright"?"field":n[a]},"neighbour");return n.map((o,s)=>o==="dash"?r(s,-1)==="field"||r(s,1)==="field"?"separator":"text":o)}i(di,"classifyLines");function fi(e,t="",n={}){let r=B(t,n),o=[],s=[],a={copyright:!1},c=e,l=z(c,r),u=!0;for(;l&&l[0].length>0;){let m=ze(l[0],r),w=di(m,a),b=m.findIndex(S=>S.text!=="");!u&&b!==-1&&m[b].text===ui&&(w[b]="separator"),m.forEach((S,A)=>{w[A]==="copyright"&&s.push(S.text.replace(Kn,"").trim()),o.push({raw:S.raw,kind:w[A]})}),c=c.slice(l[0].length),l=z(c,r),u=!1}let f=o.findIndex(m=>m.kind==="text");if(f===-1)return{foreign:[],copyrights:s};let p=o.map(m=>m.kind).lastIndexOf("text"),y=[],g=[],d=!1;for(let m of o.slice(f,p+1))m.kind==="text"?(y.push(...d?[]:g,m.raw),g=[],d=!1):m.kind==="blank"?g.push(m.raw):d=!0;return{foreign:y,copyrights:s}}i(fi,"splitHeaderText");function mi(e,t,n){let r=t.kind==="html";return t.kind==="line"?e.join(n):[t.blockStart||(r?"<!--":"/**"),...e,t.blockEnd||(r?"-->":" */")].join(n)}i(mi,"renderForeignBlock");function pi(e,t,n){let r=e.split(`
19
+ `),o=n.kind==="html",s=n.kind==="line"?n.linePrefix||"#":(n.blockLinePrefix||(o?" ":" * ")).trimEnd(),a=Math.min(r.length-1,(n.spacing??1)+(n.kind==="line"?0:1)),c=r.length-a;return[...r.slice(0,c),s,...t,...r.slice(c)].join(`
20
+ `)}i(pi,"appendToHeader");function Jn(e){let t=e.trim(),n=t.match(/^copyright\b/i);t=n?t.slice(n[0].length).trimStart():t;for(let c=t.match(/^(?:\(c\)|©)/i);c;c=t.match(/^(?:\(c\)|©)/i))t=t.slice(c[0].length).trimStart();let r=t.match(/^\d{4}(?:\s*[-–,]\s*\d{4})*/);t=r?t.slice(r[0].length):t,t=t.trimEnd();let o=t.toLowerCase(),s=o.endsWith("all rights reserved.")?20:o.endsWith("all rights reserved")?19:0;t=t.slice(0,t.length-s);let a=t.length;for(;a>0&&`.,; \r
21
+ `.includes(t[a-1]);)a-=1;return t.slice(0,a).split(/\s+/).filter(Boolean).join(" ").toLowerCase()}i(Jn,"copyrightHolder");function hi(e,t){let n=e.split(`
22
+ `),r=n.findIndex(c=>c.includes("@Copyright:")),o=n.map(c=>/@[A-Za-z][A-Za-z ]*:/.test(c)).lastIndexOf(!0),s=r!==-1?r:o;if(t.length===0||s===-1)return e;let a=n[s].slice(0,n[s].indexOf("@"));return[...n.slice(0,s+1),...t.map(c=>`${a}@Copyright: ${c}`),...n.slice(s+1)].join(`
23
+ `)}i(hi,"insertCopyrights");function qn(e,t){let n=0,r=z(e,t);for(;r&&r[0].length>0&&Zn(ze(r[0],t));)n+=r[0].length,r=z(e.slice(n),t);return n}i(qn,"leadingHeadersLength");function fe(e,t="",n={}){let r=e.startsWith("\uFEFF")?"\uFEFF":"",o=e.slice(r.length),s=ae(t,o,n),a=B(t,n),c=s.length,l=qn(o.slice(c),a);if(l===0)return e;let u=r===""&&c===0&&o.startsWith("\uFEFF",l);u&&(r="\uFEFF",o=`${o.slice(0,l)}${o.slice(l+1)}`,l+=qn(o.slice(l),a));let f=o.slice(c,c+l),p=o.slice(c+l),y=ae(t,`${s}${p}`,n),g=y.length>s.length?y.slice(s.length):"";if(g===""&&!u)return e;let d=g===""||g.endsWith(`
20
24
  `)?g:`${g}${de(e)??`
21
- `}`;return`${n}${s}${d}${f}${p.slice(g.length)}`}i(fe,"restoreTopLines");function me(e,t="",r={}){let{prefix:n,body:o}=ze(t,e,r),s=o.split(`
22
- `).slice(0,Ut).join(`
23
- `),a=B(t,r);if(!W(s,a))return null;let l=0,u=0;for(;;){let f=s.slice(l),p=W(f,a);if(!p||!Yr(We(p[0],a)))break;l+=p[0].length,u=l}return u===0?null:{start:n.length,end:n.length+u}}i(me,"findProjectHeader");function pe(e,t,r="",n={}){let o=fe(e,r,n),s=me(o,r,n),a=B(r,n),c=O(n.margin,"margin",ce),l=a.kind==="line"?Math.max(1,c):c,u=i((k,S)=>S===`
24
- `?k:k.replace(/\r?\n/g,S),"withEol");if(!s){let{prefix:k,body:S}=ze(r,o,n),D=de(o)??`
25
- `,j=u(t,D),V=S.replace(/^(?:\r?\n)+/,""),h=k.replace(/^\uFEFF/,"")!==""&&!k.endsWith(`
26
- `)?D:"",P=`${k}${h}${V.trim()===""?`${j}${D}`:`${j}${D.repeat(l+1)}${V}`}`;return{nextContent:P,changed:P!==e,header:j,written:j,extraCopyrights:[]}}let f=o.slice(s.start,s.end),{foreign:p,copyrights:y}=Qo(f,r,n),g=t.split(`
27
- `).find(k=>k.includes("@Copyright:")),d=new Set(g===void 0?[]:[zr(g.slice(g.indexOf("@Copyright:")+11))]),m=[];for(let k of y){let S=zr(k);d.has(S)||(d.add(S),m.push(k))}let w=de(o.slice(s.end))??de(f)??`
28
- `,b=w.repeat(l+1),$=n.strictHeaderBlock!==!1,C=ri(t,m),R=u(p.length>0&&!$?ti(C,p,a):C,w),E=p.length>0&&$?ei(p,a,w):"",U=o.slice(s.end).replace(/^(?:\r?\n)+/,""),G=E===""?U:`${E}${U.trim()===""?w:`${b}${U}`}`,Y=`${o.slice(0,s.start)}${G.trim()===""?`${R}${w}`:`${R}${b}${G}`}`,x=`${R}${E===""?"":`${b}${E}`}`;return{nextContent:Y,changed:Y!==e,header:R,written:x,extraCopyrights:m}}i(pe,"replaceOrInsertHeader");function Ge(e,t="",r={}){let n=fe(e,t,r),o=me(n,t,r);if(o){let l=n.slice(0,o.start),f=pe(n,"",t,{...r,strictHeaderBlock:!0}).nextContent.slice(l.length).replace(/^(?:\r?\n)+/,"");return`${l}${f.trim()===""?"":f}`}let{prefix:s,body:a}=ze(t,n,r),c=a.replace(/^(?:\r?\n)+/,"");return`${s}${c.trim()===""?"":c}`}i(Ge,"extractHeaderlessBody");function ni(e,t){let r=e.length,n=t.length,o=Array.from({length:r+1},()=>new Array(n+1).fill(0));for(let l=r-1;l>=0;l-=1)for(let u=n-1;u>=0;u-=1)o[l][u]=e[l]===t[u]?o[l+1][u+1]+1:Math.max(o[l+1][u],o[l][u+1]);let s=[],a=0,c=0;for(;a<r&&c<n;)e[a]===t[c]?(s.push({type:" ",line:e[a]}),a+=1,c+=1):o[a+1][c]>=o[a][c+1]?(s.push({type:"-",line:e[a]}),a+=1):(s.push({type:"+",line:t[c]}),c+=1);for(;a<r;a+=1)s.push({type:"-",line:e[a]});for(;c<n;c+=1)s.push({type:"+",line:t[c]});return s}i(ni,"diffLines");function Vr(e,t){return`${t===0?e:e+1},${t}`}i(Vr,"formatRange");function Jr(e,t,r={}){let n=e===null?[]:e.split(`
25
+ `}`;return`${r}${s}${d}${f}${p.slice(g.length)}`}i(fe,"restoreTopLines");function me(e,t="",n={}){let{prefix:r,body:o}=We(t,e,n),s=o.split(`
26
+ `).slice(0,Yt).join(`
27
+ `),a=B(t,n);if(!z(s,a))return null;let l=0,u=0;for(;;){let f=s.slice(l),p=z(f,a);if(!p||!Zn(ze(p[0],a)))break;l+=p[0].length,u=l}return u===0?null:{start:r.length,end:r.length+u}}i(me,"findProjectHeader");function pe(e,t,n="",r={}){let o=fe(e,n,r),s=me(o,n,r),a=B(n,r),c=T(r.margin,"margin",ce),l=a.kind==="line"?Math.max(1,c):c,u=i((k,$)=>$===`
28
+ `?k:k.replace(/\r?\n/g,$),"withEol");if(!s){let{prefix:k,body:$}=We(n,o,r),D=de(o)??`
29
+ `,M=u(t,D),V=$.replace(/^(?:\r?\n)+/,""),h=k.replace(/^\uFEFF/,"")!==""&&!k.endsWith(`
30
+ `)?D:"",P=`${k}${h}${V.trim()===""?`${M}${D}`:`${M}${D.repeat(l+1)}${V}`}`;return{nextContent:P,changed:P!==e,header:M,written:M,extraCopyrights:[]}}let f=o.slice(s.start,s.end),{foreign:p,copyrights:y}=fi(f,n,r),g=t.split(`
31
+ `).find(k=>k.includes("@Copyright:")),d=new Set(g===void 0?[]:[Jn(g.slice(g.indexOf("@Copyright:")+11))]),m=[];for(let k of y){let $=Jn(k);d.has($)||(d.add($),m.push(k))}let w=de(o.slice(s.end))??de(f)??`
32
+ `,b=w.repeat(l+1),S=r.strictHeaderBlock!==!1,A=hi(t,m),j=u(p.length>0&&!S?pi(A,p,a):A,w),E=p.length>0&&S?mi(p,a,w):"",U=o.slice(s.end).replace(/^(?:\r?\n)+/,""),G=E===""?U:`${E}${U.trim()===""?w:`${b}${U}`}`,Y=`${o.slice(0,s.start)}${G.trim()===""?`${j}${w}`:`${j}${b}${G}`}`,x=`${j}${E===""?"":`${b}${E}`}`;return{nextContent:Y,changed:Y!==e,header:j,written:x,extraCopyrights:m}}i(pe,"replaceOrInsertHeader");function Ge(e,t="",n={}){let r=fe(e,t,n),o=me(r,t,n);if(o){let l=r.slice(0,o.start),f=pe(r,"",t,{...n,strictHeaderBlock:!0}).nextContent.slice(l.length).replace(/^(?:\r?\n)+/,"");return`${l}${f.trim()===""?"":f}`}let{prefix:s,body:a}=We(t,r,n),c=a.replace(/^(?:\r?\n)+/,"");return`${s}${c.trim()===""?"":c}`}i(Ge,"extractHeaderlessBody");function gi(e,t){let n=e.length,r=t.length,o=Array.from({length:n+1},()=>new Array(r+1).fill(0));for(let l=n-1;l>=0;l-=1)for(let u=r-1;u>=0;u-=1)o[l][u]=e[l]===t[u]?o[l+1][u+1]+1:Math.max(o[l+1][u],o[l][u+1]);let s=[],a=0,c=0;for(;a<n&&c<r;)e[a]===t[c]?(s.push({type:" ",line:e[a]}),a+=1,c+=1):o[a+1][c]>=o[a][c+1]?(s.push({type:"-",line:e[a]}),a+=1):(s.push({type:"+",line:t[c]}),c+=1);for(;a<n;a+=1)s.push({type:"-",line:e[a]});for(;c<r;c+=1)s.push({type:"+",line:t[c]});return s}i(gi,"diffLines");function Xn(e,t){return`${t===0?e:e+1},${t}`}i(Xn,"formatRange");function Qn(e,t,n={}){let r=e===null?[]:e.split(`
29
33
  `),o=t.split(`
30
- `),s=ni(n,o),a=Math.max(0,r.context??3),c=r.lineOffset??0,l=[];if(s.forEach((y,g)=>{if(y.type===" ")return;let d=l[l.length-1];d&&g-d.last<=a*2+1?d.last=g:l.push({first:g,last:g})}),l.length===0)return"";let u=r.fromFile??"a",f=r.toFile??"b",p=[`--- ${e===null?"/dev/null":u}`,`+++ ${f}`];for(let y of l){let g=Math.max(0,y.first-a),d=Math.min(s.length,y.last+a+1),m=s.slice(0,g),w=s.slice(g,d),b=m.filter(E=>E.type!=="+").length+c,$=m.filter(E=>E.type!=="-").length+c,C=w.filter(E=>E.type!=="+").length,R=w.filter(E=>E.type!=="-").length;p.push(`@@ -${Vr(b,C)} +${Vr($,R)} @@`);for(let E of w)p.push(`${E.type}${E.line}`)}return p.join(`
31
- `)}i(Jr,"createUnifiedDiff");function ai(e){return mt(e,"configFile")}i(ai,"resolveRuntimeOptions");function ci(e){if(e==null)return[];let t=Array.isArray(e)?e:[e];if(t.some(r=>typeof r!="string"))throw new Error(`input must be a path or an array of paths, got ${JSON.stringify(e)}`);return t.filter(r=>r.trim().length>0)}i(ci,"resolveInputs");function li(e){let t=e.match(/@Author:\s*(.+)$/m),r=e.match(/@Email:\s*<([^>\n]+)>/m);return{authorName:t?.[1]?.trim(),authorEmail:r?.[1]?.trim()}}i(li,"extractHeaderAuthorIdentity");function ui(e){let t=e.match(/@Last modified by:\s*(.+?)\s*\(([^)\n]+)\)\s*$/m);return{authorName:t?.[1]?.trim(),authorEmail:t?.[2]?.trim()}}i(ui,"extractHeaderLastModifiedIdentity");function di(e){let t=e.match(/@Date:\s*(.+?)\s*\((\d+)\)$/m);if(!t||!t[1]||!t[2])return null;let r=Number.parseInt(t[2],10);return Number.isNaN(r)?null:{date:t[1].trim(),timestamp:r}}i(di,"extractHeaderCreatedAt");function fi(e){let t=e.match(/@Last modified time:\s*(.+?)\s*\((\d+)\)$/m);if(!t||!t[1]||!t[2])return null;let r=Number.parseInt(t[2],10);return Number.isNaN(r)?null:{date:t[1].trim(),timestamp:r}}i(fi,"extractHeaderLastModifiedAt");async function mi(e,t,r){let n=await Ar(t);return n.state!=="tracked"?{edited:n.state==="untracked",state:n.state}:{edited:Ge(n.content,t,r)!==Ge(e,t,r),state:"tracked"}}i(mi,"detectContentEdit");async function Kr(e={}){let t=await ai(e),r=t.timezone===void 0||t.timezone===null?null:Fr(t.timezone),n=t.convertTimezone===!0;if(n&&!r)throw new Error("convertTimezone requires timezone: set timezone (CLI --timezone <name>) to the IANA zone to convert header dates into");let o=It(t.forcedDetectors),s=qr(t.projectRoot||t.cwd||process.cwd()),a=await Te({...t,cwd:s});O(t.spacing,"spacing",Z),O(t.margin,"margin",ce);let c=t.check===!0,l=c||t.dryRun===!0,u=t.fixCreatedDate===!0,f=i(x=>x,"keepDate"),p=t.normalizeDateFormat===!0?Tr:f,y=r?x=>Or(x,r):f,g=n?y:f,d={language:a.language,enabledDetectors:t.enabledDetectors,disabledDetectors:t.disabledDetectors,forcedDetectors:o,includeFolders:t.includeFolders,excludeFolders:t.excludeFolders,includeExtensions:t.includeExtensions,gitignore:t.gitignore},m=ci(t.input),w;if(m.length>0){let x=new Set;for(let k of m){let S=qr(s,k),D=await ii(S).catch(()=>null);if(!D)throw new Error(`Input path does not exist: ${k}`);if(D.isFile())x.add(S);else if(D.isDirectory())for(let j of await ve({...d,projectRoot:S}))x.add(j);else throw new Error(`Input path must be a file or directory: ${k}`)}w=Array.from(x)}else w=await ve({...d,projectRoot:s});let b=new Date().getFullYear(),$=[],C=[],R=new Set,E=0,U=0,G=0,Y=[];for(let x of w){let k=Ot(x,{enabledDetectors:t.enabledDetectors,disabledDetectors:t.disabledDetectors,forcedDetectors:o});if(k!==null){C.push({file:Ye(s,x),reason:k});continue}let S=Ye(s,x),D=await oi(x,"utf8"),j={enabledDetectors:t.enabledDetectors,disabledDetectors:t.disabledDetectors,forcedDetectors:o,detectorSyntaxOverrides:t.detectorSyntaxOverrides},V=Bt(x,fe(D,x,j),j);if(V!==null){C.push({file:S,reason:V});continue}let h=await Te({...t,cwd:s,targetFilePath:x});R.add(`${h.language}:${h.projectRoot}`);let P={language:h.language,enabledDetectors:t.enabledDetectors,disabledDetectors:t.disabledDetectors,forcedDetectors:o,detectorSyntaxOverrides:t.detectorSyntaxOverrides,spacing:t.spacing,margin:t.margin,strictHeaderBlock:t.strictHeaderBlock!==!1},he=me(D,x,P),F=he?D.slice(he.start,he.end):"",Ve=F.length>0?li(F):{},Je=F.length>0?ui(F):{},Zr=F.length>0?di(F):null,Xr=F.length>0?fi(F):null,qe=await zt(x),Ke=Ye(h.projectRoot,x),Ze=await Sr(h.projectRoot,Ke),J=await Dr(h.projectRoot,Ke),Xe=ue(qe.createdAt),ge=jr({existing:Ue(Zr),gitCreated:Ze,filesystemCreated:Xe,fixCreatedDate:u}),q=Ue(Xr),Qe=ge.source,Qr=q?"existing-header":J?"git-last-modified":"filesystem-updated",ye=p(Qe==="existing-header"?g(ge.payload):y(ge.payload)),en=h.copyrightStartYear===null?"created-date":"option",et=h.copyrightStartYear??Pr(ye,r),tt=p(q?g(q):y(J||ue(qe.updatedAt))),rt=t.forceAuthorUpdate===!0,tn=t.forceLastModifiedAuthorUpdate===!0,nt=await mi(D,x,P),ot=tn||nt.edited,it=i(N=>_r({absoluteFilePath:x,language:h.language,syntaxOptions:P,projectRoot:h.projectRoot,projectName:h.projectName,createdByName:rt?h.authorName:Ve.authorName||h.authorName,createdByEmail:rt?h.authorEmail:Ve.authorEmail||h.authorEmail,lastModifiedByName:ot?h.authorName:Je.authorName||h.authorName,lastModifiedByEmail:ot?h.authorEmail:Je.authorEmail||h.authorEmail,authorName:h.authorName,authorEmail:h.authorEmail,createdAt:ye,lastModifiedAt:N,copyrightStartYear:et,companyName:h.companyName,currentYear:b}),"renderHeader"),st=it(tt),at=pe(D,st,x,P),rn=nt.edited&&q!==null&&J!==null&&q.timestamp<J.timestamp,te=at.changed||rn,ct=te?p(y(ue(new Date))):tt,nn=te?"current-time-on-change":Qr,on=te?it(ct):st,L=te?pe(D,on,x,P):at,re={file:S,changed:L.changed};if(c){let N=Ir(F,{gitCreated:Ze,gitLastModified:J,filesystemCreated:Xe},{strictCreatedDate:t.strictCreatedDate===!0}),K=N.filter(z=>z.advisory).length;re.dateIssues=N,G+=K,U+=N.length>K?1:0}if(t.sampleOutput===!0&&L.changed){let N=F.length>0?F.trimEnd():null,K=S.replace(/\\/g,"/"),z=L.written,sn=L.nextContent.slice(0,L.nextContent.indexOf(z)).split(`
32
- `).length-1;re.sample={previousValue:N,newValue:z,diff:Jr(N,z,{fromFile:`a/${K}`,toFile:`b/${K}`,lineOffset:sn}),issues:Ur(N,z),detectedValues:{projectName:h.projectName,projectNameSource:h.projectNameSource,language:h.language,projectRoot:h.projectRoot,marker:h.marker,authorName:h.authorName,authorEmail:h.authorEmail,companyName:h.companyName,companyNameSource:h.companyNameSource,copyrightStartYear:et,copyrightStartYearSource:en,createdAtSource:Qe,lastModifiedAtSource:nn,createdAt:ye,lastModifiedAt:ct}}}if(L.extraCopyrights.length>0){re.extraCopyrights=L.extraCopyrights;for(let N of L.extraCopyrights)Y.push({file:S,copyright:N})}$.push(re),L.changed&&(E+=1,l||await si(x,L.nextContent,"utf8"))}return{metadata:a,detectedProjects:Array.from(R),filesScanned:w.length-C.length,filesUpdated:E,filesSkipped:C.length,dryRun:l,check:c,...c?{filesWithDateDrift:U,dateAdvisories:G}:{},copyrightWarnings:Y,changes:$,skipped:C}}i(Kr,"fixHeaders");function pi(e){return Kr(e)}i(pi,"fixHeaders");var pc=pi;export{pc as default,pi as fixHeaders};
34
+ `),s=gi(r,o),a=Math.max(0,n.context??3),c=n.lineOffset??0,l=[];if(s.forEach((y,g)=>{if(y.type===" ")return;let d=l[l.length-1];d&&g-d.last<=a*2+1?d.last=g:l.push({first:g,last:g})}),l.length===0)return"";let u=n.fromFile??"a",f=n.toFile??"b",p=[`--- ${e===null?"/dev/null":u}`,`+++ ${f}`];for(let y of l){let g=Math.max(0,y.first-a),d=Math.min(s.length,y.last+a+1),m=s.slice(0,g),w=s.slice(g,d),b=m.filter(E=>E.type!=="+").length+c,S=m.filter(E=>E.type!=="-").length+c,A=w.filter(E=>E.type!=="+").length,j=w.filter(E=>E.type!=="-").length;p.push(`@@ -${Xn(b,A)} +${Xn(S,j)} @@`);for(let E of w)p.push(`${E.type}${E.line}`)}return p.join(`
35
+ `)}i(Qn,"createUnifiedDiff");function bi(e){return mt(e,"configFile")}i(bi,"resolveRuntimeOptions");function Ei(e){if(e==null)return[];let t=Array.isArray(e)?e:[e];if(t.some(n=>typeof n!="string"))throw new Error(`input must be a path or an array of paths, got ${JSON.stringify(e)}`);return t.filter(n=>n.trim().length>0)}i(Ei,"resolveInputs");function ki(e){let t=e.match(/@Author:\s*(.+)$/m),n=e.match(/@Email:\s*<([^>\n]+)>/m);return{authorName:t?.[1]?.trim(),authorEmail:n?.[1]?.trim()}}i(ki,"extractHeaderAuthorIdentity");function Si(e){let t=e.match(/@Last modified by:\s*(.+?)\s*\(([^)\n]+)\)\s*$/m);return{authorName:t?.[1]?.trim(),authorEmail:t?.[2]?.trim()}}i(Si,"extractHeaderLastModifiedIdentity");function $i(e){let t=e.match(/@Date:\s*(.+?)\s*\((\d+)\)$/m);if(!t||!t[1]||!t[2])return null;let n=Number.parseInt(t[2],10);return Number.isNaN(n)?null:{date:t[1].trim(),timestamp:n}}i($i,"extractHeaderCreatedAt");function Di(e){let t=e.match(/@Last modified time:\s*(.+?)\s*\((\d+)\)$/m);if(!t||!t[1]||!t[2])return null;let n=Number.parseInt(t[2],10);return Number.isNaN(n)?null:{date:t[1].trim(),timestamp:n}}i(Di,"extractHeaderLastModifiedAt");async function Ci(e,t,n){let r=await Ln(t);return r.state!=="tracked"?{edited:r.state==="untracked",state:r.state}:{edited:Ge(r.content,t,n)!==Ge(e,t,n),state:"tracked"}}i(Ci,"detectContentEdit");async function tr(e={}){let t=await bi(e),n=t.timezone===void 0||t.timezone===null?null:jn(t.timezone),r=t.convertTimezone===!0;if(r&&!n)throw new Error("convertTimezone requires timezone: set timezone (CLI --timezone <name>) to the IANA zone to convert header dates into");let o=_t(t.forcedDetectors),s=er(t.projectRoot||t.cwd||process.cwd()),a=await Oe({...t,cwd:s});T(t.spacing,"spacing",Z),T(t.margin,"margin",ce);let c=t.check===!0,l=c||t.dryRun===!0,u=t.fixCreatedDate===!0,f=i(x=>x,"keepDate"),p=t.normalizeDateFormat===!0?Un:f,y=n?x=>Wn(x,n):f,g=r?y:f,d={language:a.language,enabledDetectors:t.enabledDetectors,disabledDetectors:t.disabledDetectors,forcedDetectors:o,includeFolders:t.includeFolders,excludeFolders:t.excludeFolders,includeExtensions:t.includeExtensions,gitignore:t.gitignore},m=Ei(t.input),w;if(m.length>0){let x=new Set;for(let k of m){let $=er(s,k),D=await xi($).catch(()=>null);if(!D)throw new Error(`Input path does not exist: ${k}`);if(D.isFile())x.add($);else if(D.isDirectory())for(let M of await ve({...d,projectRoot:$}))x.add(M);else throw new Error(`Input path must be a file or directory: ${k}`)}w=Array.from(x)}else w=await ve({...d,projectRoot:s});let b=new Date().getFullYear(),S=[],A=[],j=new Set,E=0,U=0,G=0,Y=[];for(let x of w){let k=Ut(x,{enabledDetectors:t.enabledDetectors,disabledDetectors:t.disabledDetectors,forcedDetectors:o});if(k!==null){A.push({file:Ye(s,x),reason:k});continue}let $=Ye(s,x),D=await yi(x,"utf8"),M={enabledDetectors:t.enabledDetectors,disabledDetectors:t.disabledDetectors,forcedDetectors:o,detectorSyntaxOverrides:t.detectorSyntaxOverrides},V=Gt(x,fe(D,x,M),M);if(V!==null){A.push({file:$,reason:V});continue}let h=await Oe({...t,cwd:s,targetFilePath:x});j.add(`${h.language}:${h.projectRoot}`);let P={language:h.language,enabledDetectors:t.enabledDetectors,disabledDetectors:t.disabledDetectors,forcedDetectors:o,detectorSyntaxOverrides:t.detectorSyntaxOverrides,spacing:t.spacing,margin:t.margin,strictHeaderBlock:t.strictHeaderBlock!==!1},he=me(D,x,P),F=he?D.slice(he.start,he.end):"",Ve=F.length>0?ki(F):{},Je=F.length>0?Si(F):{},nr=F.length>0?$i(F):null,rr=F.length>0?Di(F):null,qe=await Vt(x),Ke=Ye(h.projectRoot,x),Ze=await Nn(h.projectRoot,Ke),J=await vn(h.projectRoot,Ke),Xe=ue(qe.createdAt),ge=Hn({existing:Ue(nr),gitCreated:Ze,filesystemCreated:Xe,fixCreatedDate:u}),q=Ue(rr),Qe=ge.source,or=q?"existing-header":J?"git-last-modified":"filesystem-updated",ye=p(Qe==="existing-header"?g(ge.payload):y(ge.payload)),ir=h.copyrightStartYear===null?"created-date":"option",et=h.copyrightStartYear??_n(ye,n),tt=p(q?g(q):y(J||ue(qe.updatedAt))),nt=t.forceAuthorUpdate===!0,sr=t.forceLastModifiedAuthorUpdate===!0,rt=await Ci(D,x,P),ot=sr||rt.edited,it=i(N=>Gn({absoluteFilePath:x,language:h.language,syntaxOptions:P,projectRoot:h.projectRoot,projectName:h.projectName,createdByName:nt?h.authorName:Ve.authorName||h.authorName,createdByEmail:nt?h.authorEmail:Ve.authorEmail||h.authorEmail,lastModifiedByName:ot?h.authorName:Je.authorName||h.authorName,lastModifiedByEmail:ot?h.authorEmail:Je.authorEmail||h.authorEmail,authorName:h.authorName,authorEmail:h.authorEmail,createdAt:ye,lastModifiedAt:N,copyrightStartYear:et,companyName:h.companyName,currentYear:b}),"renderHeader"),st=it(tt),at=pe(D,st,x,P),ar=rt.edited&&q!==null&&J!==null&&q.timestamp<J.timestamp,te=at.changed||ar,ct=te?p(y(ue(new Date))):tt,cr=te?"current-time-on-change":or,lr=te?it(ct):st,L=te?pe(D,lr,x,P):at,ne={file:$,changed:L.changed};if(c){let N=Bn(F,{gitCreated:Ze,gitLastModified:J,filesystemCreated:Xe},{strictCreatedDate:t.strictCreatedDate===!0}),K=N.filter(W=>W.advisory).length;ne.dateIssues=N,G+=K,U+=N.length>K?1:0}if(t.sampleOutput===!0&&L.changed){let N=F.length>0?F.trimEnd():null,K=$.replace(/\\/g,"/"),W=L.written,ur=L.nextContent.slice(0,L.nextContent.indexOf(W)).split(`
36
+ `).length-1;ne.sample={previousValue:N,newValue:W,diff:Qn(N,W,{fromFile:`a/${K}`,toFile:`b/${K}`,lineOffset:ur}),issues:Vn(N,W),detectedValues:{projectName:h.projectName,projectNameSource:h.projectNameSource,language:h.language,projectRoot:h.projectRoot,marker:h.marker,authorName:h.authorName,authorEmail:h.authorEmail,companyName:h.companyName,companyNameSource:h.companyNameSource,copyrightStartYear:et,copyrightStartYearSource:ir,createdAtSource:Qe,lastModifiedAtSource:cr,createdAt:ye,lastModifiedAt:ct}}}if(L.extraCopyrights.length>0){ne.extraCopyrights=L.extraCopyrights;for(let N of L.extraCopyrights)Y.push({file:$,copyright:N})}S.push(ne),L.changed&&(E+=1,l||await wi(x,L.nextContent,"utf8"))}return{metadata:a,detectedProjects:Array.from(j),filesScanned:w.length-A.length,filesUpdated:E,filesSkipped:A.length,dryRun:l,check:c,...c?{filesWithDateDrift:U,dateAdvisories:G}:{},copyrightWarnings:Y,changes:S,skipped:A}}i(tr,"fixHeaders");function Ai(e){return tr(e)}i(Ai,"fixHeaders");var Lc=Ai;export{Lc as default,Ai as fixHeaders};
33
37
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cldmv/fix-headers",
3
- "version": "2.2.7",
3
+ "version": "2.4.0",
4
4
  "description": "Multi-language project header normalizer with auto-detection and override support.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -0,0 +1,18 @@
1
+ export namespace detector {
2
+ export let id: string;
3
+ export { extensions };
4
+ export let enabledByDefault: boolean;
5
+ export function resolveContentSkipReason(content: any): string;
6
+ export function resolveCommentSyntax(filePath: any): {
7
+ kind: "block";
8
+ blockStart: string;
9
+ blockLinePrefix: string;
10
+ blockEnd: string;
11
+ };
12
+ }
13
+ /**
14
+ * @fileoverview C and C++ detector implementation.
15
+ * @module fix-headers/detectors/c
16
+ */
17
+ declare const extensions: string[];
18
+ export {};
@@ -96,7 +96,8 @@ export function getPreservedPrefixForFile(filePath: string, content: string, opt
96
96
  }): string;
97
97
  /**
98
98
  * Says why a file's content cannot carry a header (a PHP file that does not open with `<?php`,
99
- * where a comment at the top would be output as text), or null when it can.
99
+ * where a comment at the top would be output as text; third-party C with its own license notice; a
100
+ * declaration file carrying the header `tsc` copied from its source), or null when it can.
100
101
  * @param {string} filePath - File path.
101
102
  * @param {string} content - File content.
102
103
  * @param {{ enabledDetectors?: string[], disabledDetectors?: string[], forcedDetectors?: string[] }} [options={}] - Runtime options.
@@ -120,7 +121,7 @@ export function getContentSkipReason(filePath: string, content: string, options?
120
121
  * resolveCommentSyntax: (filePath: string) => ({kind: "block" | "line" | "html", linePrefix?: string, lineSeparator?: string, blockStart?: string, blockLinePrefix?: string, blockEnd?: string} | null),
121
122
  * resolvePreservedPrefix?: (filePath: string, content: string) => string,
122
123
  * keepsAboveHeader?: (line: string, index: number) => boolean,
123
- * resolveContentSkipReason?: (content: string) => string | null
124
+ * resolveContentSkipReason?: (content: string, filePath: string) => string | null
124
125
  * }} DetectorProfile
125
126
  * A file-type detector: which extensions it handles and the comment syntax of those files, and
126
127
  * what stays above the header: `resolvePreservedPrefix` takes a leading block (front matter),
@@ -162,5 +163,5 @@ export type DetectorProfile = {
162
163
  } | null);
163
164
  resolvePreservedPrefix?: (filePath: string, content: string) => string;
164
165
  keepsAboveHeader?: (line: string, index: number) => boolean;
165
- resolveContentSkipReason?: (content: string) => string | null;
166
+ resolveContentSkipReason?: (content: string, filePath: string) => string | null;
166
167
  };
@@ -3,6 +3,7 @@ export namespace detector {
3
3
  export { extensions };
4
4
  export let enabledByDefault: boolean;
5
5
  export { isShebang as keepsAboveHeader };
6
+ export function resolveContentSkipReason(content: any, filePath: any): string;
6
7
  export function resolveCommentSyntax(filePath: any): {
7
8
  kind: "block";
8
9
  blockStart: string;
@@ -20,13 +20,13 @@ export function compareHeaderFields(previousHeader: string | null, nextHeader: s
20
20
  /**
21
21
  *
22
22
  * @Project: @cldmv/fix-headers
23
- * @Filename: /src/header/fields.mjs
23
+ * @Filename: src/header/fields.mjs
24
24
  * @Date: 2026-09-28T09:14:18-07:00 (1790612058)
25
25
  * @Author: Nate Corcoran <CLDMV>
26
26
  * @Email: <Shinrai@users.noreply.github.com>
27
27
  * -----
28
28
  * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
29
- * @Last modified time: 2026-10-02T12:28:16-07:00 (1790969296)
29
+ * @Last modified time: 2026-11-25T13:07:26-08:00 (1795640846)
30
30
  * -----
31
31
  * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
32
32
  *
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  *
3
3
  * @Project: @cldmv/fix-headers
4
- * @Filename: /src/utils/diff.mjs
4
+ * @Filename: src/utils/diff.mjs
5
5
  * @Date: 2026-09-28T09:14:18-07:00 (1790612058)
6
6
  * @Author: Nate Corcoran <CLDMV>
7
7
  * @Email: <Shinrai@users.noreply.github.com>
8
8
  * -----
9
9
  * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
- * @Last modified time: 2026-10-02T12:28:16-07:00 (1790969296)
10
+ * @Last modified time: 2026-11-25T13:07:26-08:00 (1795640846)
11
11
  * -----
12
12
  * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
13
  *
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  *
3
3
  * @Project: @cldmv/fix-headers
4
- * @Filename: /src/utils/text.mjs
4
+ * @Filename: src/utils/text.mjs
5
5
  * @Date: 2026-10-31T16:30:00-07:00 (1793489400)
6
6
  * @Author: Nate Corcoran <CLDMV>
7
7
  * @Email: <Shinrai@users.noreply.github.com>
8
8
  * -----
9
9
  * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
- * @Last modified time: 2026-10-31T16:30:00-07:00 (1793489400)
10
+ * @Last modified time: 2026-11-25T13:07:26-08:00 (1795640846)
11
11
  * -----
12
12
  * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
13
  *
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  *
3
3
  * @Project: @cldmv/fix-headers
4
- * @Filename: /src/utils/time.mjs
4
+ * @Filename: src/utils/time.mjs
5
5
  * @Date: 2026-03-01T17:59:32-08:00 (1772416772)
6
6
  * @Author: Nate Corcoran <CLDMV>
7
7
  * @Email: <Shinrai@users.noreply.github.com>
8
8
  * -----
9
9
  * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
- * @Last modified time: 2026-10-02T12:28:16-07:00 (1790969296)
10
+ * @Last modified time: 2026-11-25T13:07:26-08:00 (1795640846)
11
11
  * -----
12
12
  * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
13
  *