// @requirements REQ-PRODUCT-LOCALIZATION REQ-PRODUCT-TERMS-ACCEPTANCE REQ-PRODUCT-MOBILE import {readFile} from 'node:fs/promises'; import {compileLegalDocuments,createTermsOffer} from 'notabenda/content'; import {renderLegalLinks} from 'notabenda'; export async function localizedAgreementFiles(base){ const c=structuredClone(base);c.site.id='juniper-agreement';for(const item of c.storage)item.name=item.name.replace('juniper-pt',c.site.id);for(const [kind,doc] of Object.entries(c.documents))doc.route='/localization/agreement/'+kind; if(c.consent?.information?.rights)c.consent.information.rights.url='/localization/agreement/privacy#nb-privacy-section-rights'; const build=compileLegalDocuments(c,{mode:'preview',stylesheetUrl:'/assets/notabenda.css'}),offer=createTermsOffer(build.artifact,{scopeId:'sample-pt',statement:'Concordo com esta versão dos termos da Juniper.',actionLabel:'Registrar concordância'},{mode:'preview'}); const html=`Revise os termos · JuniperIr para o conteúdo
juniper / notas

CONCORDÂNCIA COM OS TERMOS

Leia antes
de concordar.

Revise a versão indicada abaixo. A concordância só é registrada depois da confirmação do servidor.

`; return {...build.files,'localization/agreement/offer.json':JSON.stringify(offer),'localization/agreement/index.html':html,'assets/localized-agreement.mjs':await readFile(new URL('./agreement.mjs',import.meta.url),'utf8'),'assets/localization-agreement.css':'@layer example-pages,example-theme,localized-agreement; @layer localized-agreement { .nb-demo-agreement .nb-terms-acceptance{min-inline-size:0} .nb-demo-agreement .nb-terms-acceptance .nb-terms-document-copy{min-inline-size:0} .nb-demo-agreement .nb-terms-acceptance a{overflow-wrap:anywhere} }\n'}; }