()
| 1325 | } |
| 1326 | |
| 1327 | function saveImportState() { |
| 1328 | const state = { |
| 1329 | provider: normalizeProviderValue(providerInput?.value ?? "gemini"), |
| 1330 | svgModel: svgModelInput?.value ?? "", |
| 1331 | apiKey: apiKeyInput?.value ?? "", |
| 1332 | baseUrl: baseUrlInput?.value ?? DEFAULT_CUSTOM_BASE_URL, |
| 1333 | samBackend: samBackend?.value ?? "roboflow", |
| 1334 | samPrompt: samPrompt?.value ?? "icon,person,robot,animal", |
| 1335 | samApiKey: samApiKeyInput?.value ?? "", |
| 1336 | uploadedFigurePath, |
| 1337 | previewUrl: figurePreview?.src ?? "", |
| 1338 | figureStatus: figureStatus?.textContent ?? "", |
| 1339 | }; |
| 1340 | try { |
| 1341 | window.sessionStorage.setItem(IMPORT_STATE_KEY, JSON.stringify(state)); |
| 1342 | } catch (_err) { |
| 1343 | // Ignore storage failures. |
| 1344 | } |
| 1345 | } |
| 1346 | |
| 1347 | function applyImportState() { |
| 1348 | const state = loadImportState(); |
no test coverage detected