
$path = "src\App.jsx"
$absPath = Convert-Path $path
$content = [System.IO.File]::ReadAllText($absPath, [System.Text.Encoding]::UTF8)
$pattern = "import DocumentTemplateManager from './components/DocumentTemplateManager';\s+import DocumentTemplateManager from './components/DocumentTemplateManager';"
$replace = "import DocumentTemplateManager from './components/DocumentTemplateManager';"
$newContent = $content -replace $pattern, $replace
if ($newContent.Length -ne $content.Length) {
    Write-Host "Fixed double import via Regex."
    [System.IO.File]::WriteAllText($absPath, $newContent, [System.Text.Encoding]::UTF8)
} else {
    Write-Host "No change made."
}
