// @requirements REQ-PRODUCT-SCOPE-GUARDS
// @requirements REQ-PRODUCT-CONFIG REQ-PRODUCT-MOBILE
import {readFile} from 'node:fs/promises';
import {compileLegalDocuments} from 'notabenda/content';
import {renderLegalLinks} from 'notabenda';
import {exampleConsentConfig} from '../static/choices-build.mjs';
export async function scopeGuardFiles(base){
const config=exampleConsentConfig(base);config.site.id='juniper-scope-guards';config.storage=[];
config.purposes.find(p=>p.id==='measurement').name='Local reading tools';config.purposes.find(p=>p.id==='suggestions').name='Specialized suggestions';
for(const p of config.purposes){p.retention='This synthetic experiment retains choices in memory until reload.';p.dataCategories=['Fictional demonstration state only'];}
config.scopeGuards={version:1,revision:'lab-review-1',site:{children:'absent',sensitiveData:'absent',highRiskProfiling:'absent',regulatedSector:'absent'},purposes:[{id:'suggestions',facts:{sensitiveData:'present'}}]};
config.services.push({id:'combined-demo',name:'Combined sample',provider:'Juniper Notes (fictional)',location:'In-memory demonstration only',purposeIds:['measurement','suggestions']});config.consent.services.push({id:'combined-demo',scope:'one'});
const result={};
for(const prefix of ['', '/dark']){
const c=structuredClone(config);for(const [kind,doc] of Object.entries(c.documents))doc.route=`${prefix}/scope-guards/${kind}`;
const build=compileLegalDocuments(c,{mode:'preview',stylesheetUrl:prefix?'/assets/dark.css':'/assets/notabenda.css'}),path=prefix.slice(1)+(prefix?'/':'')+'scope-guards/';
Object.assign(result,Object.fromEntries(Object.entries(build.files).filter(([file])=>file.startsWith(path)||file.startsWith('artifacts/'))));result[path+'site.json']=JSON.stringify(build.publicConfig);
result[path+'index.html']=`
Processing scope guards · Juniper Notes Notabenda · Scope guard laboratory
Scope guards for unsupported processing A small cookie control should know its limits. See ordinary optional work stay available while a purpose needing a separate process stays off.
Change the operator assessment to see which optional work remains available. Reload to reset the experiment.
01 / WHAT CAN RUN
Blocked purpose status Checking These service lifecycles share the same permission engine as the cookie controls. Each sample stays inert until all its purposes are available and allowed.
Local reading tools One ordinary purpose
Off Specialized suggestions One purpose requiring separate support
Off Combined sample Needs both purposes
Off Allow available Reject optional
Review individual choices → Optional work starts off.
02 / CHANGE THE DECLARATION
Scope assessment These are simulated operator assessments, not questions about you. A new material revision requires a fresh choice; “absent” never grants one.
Declared context One sensitive-data purpose Child-data context Unresolved assessment Declared ordinary scope
Assessment revision lab-review-1
Optional purposes held off 2
Sample service starts 0 Preparing the current declaration.
Follow the requirement links Read the mechanism and its limits ↗
${prefix?'Light':'Midnight'} example ↗
The experiment needs JavaScript. Privacy, cookie and terms pages below remain available without it.
`;
}
result['assets/scope-guards.mjs']=await readFile(new URL('./client.mjs',import.meta.url),'utf8');return result;
}