const fs = require('fs');
const path = 'D:\\project\\zhizhu\\components\\PhotoUploadForm.vue';
const content = fs.readFileSync(path, 'utf8');
const lines = content.split('\n');

console.log('=== Finding script and style boundaries ===\n');

for (let i = 0; i < lines.length; i++) {
  if (lines[i].includes('<script') || lines[i].includes('</script>') ||
      lines[i].includes('<style') || lines[i].includes('</style>')) {
    console.log(`Line ${i + 1}: ${lines[i]}`);
  }
}

// 找到 </script> 的位置
let scriptEndLine = -1;
for (let i = 0; i < lines.length; i++) {
  if (lines[i].trim() === '</script>') {
    scriptEndLine = i;
    break;
  }
}

if (scriptEndLine >= 0) {
  console.log(`\n</script> found at line ${scriptEndLine + 1}`);
  console.log('\nLines around </script>:');
  for (let i = scriptEndLine - 5; i <= scriptEndLine + 3; i++) {
    if (i >= 0 && i < lines.length) {
      console.log(`Line ${i + 1}: ${lines[i]}`);
    }
  }
}
