<?php
/**
 * Boot island + <script> tag for the upload tab of /admin/import.
 * Behaviour lives in public/assets/admin/import-uploads.js (static, cacheable).
 * The three long default prompts stay here, in PHP, rather than in the JS bundle.
 */
$__upBoot = [
    'csrf'                  => Router::csrfToken(),
    'languages'             => array_map(fn($l) => ['code' => $l['code'], 'name' => $l['name']], $_enabledLangs),
    'apiConnected'          => $_isApiConnected,
    'aiTranslateCost'       => (float) ($_priceAi['translate'] ?? 0.40),
    'aiTranslatePrompt'     => $_savedTranslatePrompt,
    'aiTitleCost'           => (float) ($_priceAi['rewrite_title'] ?? 0.30),
    'aiTitlePrompt'         => $_savedTitlePrompt ?: 'Rewrite this porn video title to be unique and SEO-friendly while keeping the same meaning. Keep it natural and under 80 characters. Do NOT add quotes around the title.',
    'aiDescCost'            => (float) ($_priceAi['rewrite_description'] ?? 0.30),
    'aiDescPrompt'          => $_savedDescPrompt ?: 'Rewrite this porn video description to be unique and SEO-friendly. Keep it concise (2-3 sentences max). Do NOT use markdown or HTML.',
    'aiTranslateDescCost'   => (float) ($_priceAi['translate_description'] ?? 0.40),
    'videoCost'             => (float) $_priceVideo,
    'aiTranslateDescPrompt' => $_savedTranslateDescPrompt ?: 'Translate this English porn video description into each target language. Keep the meaning, tone and adult terminology natural for a native speaker. Do NOT use markdown or HTML. Output ONLY the translation inside the XML tags.',
];
?>
<script type="application/json" id="tp-up-boot"><?= json_encode($__upBoot, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE) ?></script>
<script src="<?= AdminAssets::url('import-uploads.js') ?>" defer></script>
