// @requirements REQ-QC-PROFILING REQ-PRODUCT-MOBILE REQ-PRODUCT-A11Y
import {readFile} from 'node:fs/promises';
import {build as bundle} from 'esbuild';
import {compileLegalDocuments,compileConsentRuntimeConfig} from '@notabenda/core/content';
import {createTechnologyCollectionNotice,renderTechnologyCollectionNotice} from '@notabenda/core/technology';
import {renderLegalLinks} from '@notabenda/core';
import {technologyExampleConfig,technologySettings} from './config.mjs';
export async function technologyFiles(base){
const config=technologyExampleConfig(base),build=compileLegalDocuments(config,{mode:'preview'}),notice=createTechnologyCollectionNotice(build.artifact,technologySettings,{mode:'preview'});
const script=(await bundle({entryPoints:[new URL('./client.mjs',import.meta.url).pathname],bundle:true,minify:true,platform:'browser',format:'esm',target:'es2022',write:false})).outputFiles[0].text;
const html=`
YOUR READING SPACE
Choose whether topersonalise your reading Browse any topic. If you want suggestions based on what you open, choose whether to enable Reading interests below.
01 Design Objects, spaces and the way things work. 02 Outdoors Walks, quiet places and open air. 03 Culture Stories, ideas and new perspectives. OPEN NOW
Choose a topic Every topic is available with Reading interests switched off.
Reading interests Off No reading profile is being built.
${renderTechnologyCollectionNotice(notice,{idPrefix:'reading-notice',allowPreview:true})}
JavaScript is unavailable. Reading interests stays off. You can still read the notice and legal documents.
About this integration This browser-only example uses ordinary topic counts. It does not request location, verify identity, contact a provider or establish a reviewed Québec compliance profile.
Read the implementation guide ↗ `;
return {...build.files,'technology/index.html':html,'technology/notice.json':JSON.stringify(notice),'technology/runtime.json':JSON.stringify(compileConsentRuntimeConfig(config,{mode:'preview',evidence:'local'})),'assets/technology-example.mjs':script,'assets/technology.css':await readFile(new URL('../../packages/notabenda/dist/technology.css',import.meta.url),'utf8'),'assets/technology-example.css':await readFile(new URL('./style.css',import.meta.url),'utf8')};
}