(()=>{ 'use strict'; const $=(s,r=document)=>r.querySelector(s), $$=(s,r=document)=>[...r.querySelectorAll(s)]; const esc=s=>String(s??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); let toastTimer;function status(text){const n=$('#site-status');n.textContent=text;n.classList.add('show');clearTimeout(toastTimer);toastTimer=setTimeout(()=>n.classList.remove('show'),3600)} function download(name,text,type='text/plain'){const url=URL.createObjectURL(new Blob([text],{type}));const a=document.createElement('a');a.href=url;a.download=name;document.body.append(a);a.click();a.remove();setTimeout(()=>URL.revokeObjectURL(url),1000)} // Test-mode instrumentation only. No raw form entries, financial values or external transport. const attribution={};for(const key of ['utm_source','utm_campaign']){const v=new URLSearchParams(location.search).get(key);if(v&&/^[a-zA-Z0-9_. -]{1,64}$/.test(v))attribution[key]=v} const eventQueue=[];const sessionId=crypto.randomUUID();function event(name,properties={}){const allowed={event_id:crypto.randomUUID(),event_time:new Date().toISOString(),session_id:sessionId,page_id:document.body.dataset.page,content_version:'exemptlink-1.0',test_mode:true,...attribution,...properties};eventQueue.push({name,...allowed});document.dispatchEvent(new CustomEvent('exemptlink:preview-event',{detail:{name,...allowed}}))} if(document.body.dataset.page==='home')event('landing_view'); $$('[data-offer]').forEach(a=>a.addEventListener('click',()=>event('offer_14_selected',{concept_id:14,selected_offer_id:Number(a.dataset.offer),placement:'workflow_navigation'}))); const menus=$$('.nav-trigger');function closeMenus(){menus.forEach(b=>{b.setAttribute('aria-expanded','false');$('#'+b.getAttribute('aria-controls')).hidden=true})} menus.forEach(b=>b.addEventListener('click',()=>{const open=b.getAttribute('aria-expanded')==='true';closeMenus();if(!open){b.setAttribute('aria-expanded','true');$('#'+b.getAttribute('aria-controls')).hidden=false}})); document.addEventListener('click',e=>{if(!e.target.closest('.nav-group'))closeMenus()});document.addEventListener('keydown',e=>{if(e.key==='Escape'){const b=menus.find(b=>b.getAttribute('aria-expanded')==='true');closeMenus();if(b)b.focus()}}); const dialog=$('#mobile-nav'),toggle=$('.mobile-toggle');toggle.addEventListener('click',()=>{dialog.showModal();toggle.setAttribute('aria-expanded','true');document.body.classList.add('nav-open')});function closeNav(){dialog.close();toggle.setAttribute('aria-expanded','false');document.body.classList.remove('nav-open');toggle.focus()}$('.close-nav').addEventListener('click',closeNav);dialog.addEventListener('cancel',e=>{e.preventDefault();closeNav()});dialog.addEventListener('click',e=>{if(e.target===dialog)closeNav()});dialog.addEventListener('close',()=>document.body.classList.remove('nav-open')); let paused=false;const media=matchMedia('(prefers-reduced-motion:reduce)');function applyMotion(){document.body.classList.toggle('motion-paused',paused);document.body.classList.toggle('reduced-motion',media.matches);$$('.motion-toggle').forEach(b=>{b.setAttribute('aria-pressed',String(paused));$('span',b).textContent=paused?'Resume motion':'Pause motion'})}$$('.motion-toggle').forEach(b=>b.addEventListener('click',()=>{paused=!paused;applyMotion();status(paused?'Motion paused.':'Motion resumed.')}));media.addEventListener('change',applyMotion);applyMotion();document.addEventListener('visibilitychange',()=>document.body.classList.toggle('page-hidden',document.hidden)); const revealObserver=new IntersectionObserver(entries=>entries.forEach(e=>{if(e.isIntersecting){e.target.classList.add('seen');revealObserver.unobserve(e.target)}}),{threshold:.08});$$('.reveal,.table-wrap').forEach(e=>revealObserver.observe(e)); const motionObserver=new IntersectionObserver(entries=>entries.forEach(e=>e.target.classList.toggle('motion-offscreen',!e.isIntersecting)),{threshold:.02});$$('[data-motion]').forEach(e=>motionObserver.observe(e)); if(document.body.dataset.page==='pricing'){const p=$('.primary-price');if(p){const po=new IntersectionObserver(entries=>{if(entries.some(e=>e.isIntersecting)){event('price_view',{price_version:'hypothesis-1',hypothesis:true,displayed_price_option:'bounded_pilot'});po.disconnect()}},{threshold:.3});po.observe(p)}} // Honest front-end intake. Submission makes a local draft; delivery events are deliberately absent. $$('.intake-form').forEach(form=>{ const offerSelect=$('[name=offer_id]',form);if(offerSelect)offerSelect.addEventListener('change',()=>{if(/^[1-5]$/.test(offerSelect.value))event('offer_14_selected',{concept_id:14,selected_offer_id:Number(offerSelect.value),placement:'intake_preview'})}); const offer=new URLSearchParams(location.search).get('offer');if(/^[1-5]$/.test(offer||'')){const select=$('[name=offer_id]',form);if(select)select.value=offer} form.addEventListener('submit',e=>{e.preventDefault();let first=null;$$('[required]',form).forEach(input=>{const okay=input.type==='checkbox'?input.checked:input.validity.valid;input.setAttribute('aria-invalid',String(!okay));if(input.type!=='checkbox'){const error=$('#error-'+input.name,form);if(error){error.textContent=okay?'':input.type==='email'?'Enter a complete email address.':'Complete this field.';input.setAttribute('aria-describedby',error.id)}}if(!okay&&!first)first=input});$('.form-error',form).textContent=first?'Complete the required fields and explicit consent. Nothing has been submitted.':'';if(first){first.focus();return} const data=Object.fromEntries(new FormData(form).entries());const dl=$('.draft-summary',form);dl.innerHTML=Object.entries(data).map(([k,v])=>'
'+esc(k.replace(/_/g,' '))+'
'+esc(v==='on'?'Selected in local draft':v)+'
').join('');$('.form-result',form).hidden=false;$('.form-result',form).scrollIntoView({behavior:media.matches?'auto':'smooth',block:'center'});status('Local draft prepared. Nothing submitted or subscribed.'); });$('.draft-download',form).addEventListener('click',()=>{const data=Object.fromEntries(new FormData(form).entries());download('ExemptLink-local-request-draft.txt','EXEMPTLINK / LOCAL REQUEST DRAFT\nNOT DELIVERED OR STORED AS A LEAD\n\n'+Object.entries(data).map(([k,v])=>k+': '+(v==='on'?'selected in draft':v)).join('\n')+'\n\nPreview only. No pilot request, subscription or consent-record event emitted.\n')});$('.draft-edit',form).addEventListener('click',()=>{$('.form-result',form).hidden=true;$('input',form).focus()}); }); const fixtureNode=$('#demo-fixtures'),records=fixtureNode?JSON.parse(fixtureNode.textContent):[]; const STORE='exemptlink-synthetic-demo-v1';let state={step:0,reason:'',modified:false,scenarioJurisdiction:'New York'};try{const raw=JSON.parse(sessionStorage.getItem(STORE)||'null');if(raw&&Number.isInteger(raw.step)&&raw.step>=0&&raw.step<=8)state={step:raw.step,reason:typeof raw.reason==='string'?raw.reason.slice(0,600):'',modified:!!raw.modified,scenarioJurisdiction:['New York','New Jersey','Florida'].includes(raw.scenarioJurisdiction)?raw.scenarioJurisdiction:'New York'}}catch{} function persist(){sessionStorage.setItem(STORE,JSON.stringify(state))} const baselineEvents=[['Apr 20 / 09:00','Historical sample imported','Source rows preserved; fictional input.'],['Apr 20 / 09:01','CE-21 proposed as candidate','Not accepted as support.'],['Apr 20 / 09:02','TX-091 held','Entity/state mismatch; unverified expiry flag.']]; function reviewEvents(){const a=[...baselineEvents];if(state.step>=4)a.push(['Apr 20 / 09:15','Accountant correction recorded',state.reason||'Generic NY expiry inference rejected. Entity/state hold remains.'],['Apr 20 / 09:20','Request draft prepared','Fictional recipient; delivery disabled.']);if(state.step>=5)a.push(['Apr 20 / 09:30','Tax-owner approval simulated','Daniel Reed / approved but unsent.']);if(state.step>=6)a.push(['Apr 22 / 10:00','Fictional response supplied','CE-31 added; original CE-21 retained.']);if(state.step>=7)a.push(['Apr 22 / 10:30','Updated evidence reviewed in simulation','Scripted disposition only; no legal-validity determination.']);if(state.step>=8)a.push(['Apr 22 / 10:35','Illustrative packet prepared','New version; unresolved appendix included.']);return a} function historyHTML(){return '

America/New_York; scripted demo time. These timestamps do not use the actual click time.

'} function packetObject(){return {label:'DEMO — SYNTHETIC DATA / CONCEPT PREVIEW',packet_id:'sample-01',version:'v'+(state.step+1)+(state.modified?'-sandbox-'+(state.scenarioJurisdiction==='New Jersey'?'nj':'fl'):''),immutable_storage:'Not established by this local export',currency:'USD',period:'April 2026',jurisdiction:'New York',record_count:10,total_minor:1600000,modified_scenario:state.modified,scenario_jurisdiction:state.scenarioJurisdiction,transactions:records.map(r=>({...r,original_candidate:r.certificate,reviewed_evidence:r.id==='TX-091'&&state.step>=7&&!state.modified?'CE-31':r.state==='Completed'?r.certificate:null,outreach_state:r.id==='TX-091'&&state.step>=5?'approved_unsent':r.state==='Approved'?'approved_unsent':'not_approved',state:r.id==='TX-091'&&state.step>=7&&!state.modified?'Completed in simulation':r.state})),source_versions:state.step>=6?['CE-21/v1 original retained','CE-31/v1 fictional replacement']:['CE-21/v1 original retained'],review_events:reviewEvents(),unresolved_exceptions:records.filter(r=>!['Completed'].includes(r.state)&&!(r.id==='TX-091'&&state.step>=7&&!state.modified)).map(r=>({id:r.id,state:r.state,reason:r.reason,owner:r.owner})),engine_GL_bridge:{GL_minor:1600000,engine_minor:1510000,evidence_minor:1600000,difference_minor:90000,reason:'Synthetic TX-096 absent from engine export',interpretation:'Population difference requiring review; not tax liability or recovered money'}}} function exportPacket(json=false){const data=packetObject();if(json)download('ExemptLink-DEMO-sample-01.json',JSON.stringify(data,null,2),'application/json');else download('ExemptLink-DEMO-sample-01.txt','DEMO — SYNTHETIC DATA / CONCEPT PREVIEW\nEXEMPTLINK / SAMPLE-01 / '+data.version+'\n\nApril 2026 / NY / USD\n10 fictional sales / USD 16,000 recorded sale value\n\nORIGINAL SOURCES\n'+data.source_versions.join('\n')+'\n\nSCRIPTED REVIEW HISTORY\n'+reviewEvents().map(e=>e.join(' — ')).join('\n')+'\n\nUNRESOLVED APPENDIX\n'+data.unresolved_exceptions.map(r=>r.id+' / '+r.state+' / '+r.reason+' / owner '+r.owner).join('\n')+'\n\nRECONCILIATION\nGL 16,000 / engine 15,100 / evidence 16,000 / difference 900 USD\nTX-096 absent from engine export. No liability, savings or ROI claim.\n\nA local file does not establish production immutability or legal validity. No real customer data.\n');status('Local DEMO packet downloaded. No external systems touched.')} if($('#report-events')){$('#report-events').innerHTML=historyHTML();$('#report-version').textContent=packetObject().version;$('#report-status').textContent=state.modified?'Modified scenario / review reopened. Reset the demo to restore canonical fixtures.':state.step>=7?'TX-091 review completed in simulation. Original CE-21 and unresolved items remain.':'Original fixture / held review retained. Follow the demo to append scripted decisions.';$('#packet-export').addEventListener('click',()=>exportPacket());$('#packet-json').addEventListener('click',()=>exportPacket(true))} if(!$('#workbench'))return; event('demo_open',{demo_version:'synthetic-1',entry_point:document.body.dataset.page,synthetic:true});let selected='TX-091',activeTab=new URLSearchParams(location.search).get('view')==='correction'?'correction':'invoice'; const MONEY=c=>'USD '+(c/100).toLocaleString('en-US',{minimumFractionDigits:2,maximumFractionDigits:2});const correction='Do not apply the imported renewal/expiry field as a New York validity rule. CE-21 still names a different entity and jurisdiction. Keep TX-091 on hold and request appropriate evidence for Blue Mesa Supply LLC.'; function getRecord(){return records.find(r=>r.id===selected)}function disposition(r){if(r.id!=='TX-091')return r.state;return state.modified?'Held / modified scenario':state.step>=7?'Reviewed in simulation':state.step>=6?'Pending replacement review':state.step>=5?'Approved / unsent':'Held for review'} function queue(){const search=$('#queue-search').value.toLowerCase(),filter=$('#queue-filter').value;let matches=records.filter(r=>(r.id+' '+r.buyer).toLowerCase().includes(search)).filter(r=>filter==='all'||(r.id==='TX-091'&&state.step>=7&&!state.modified?'Completed':r.state)===filter);$('#queue-records').innerHTML=matches.map(r=>'').join('');$('.queue-empty').hidden=matches.length>0;$$('[data-record]').forEach(b=>b.addEventListener('click',()=>{selected=b.dataset.record;activeTab='invoice';render();}));$('#demo-held-count').textContent=state.step>=7&&!state.modified?'2':'3';$('#demo-completed-count').textContent=state.step>=7&&!state.modified?'3':'2'} function tabs(){ $$('[data-tab]').forEach(b=>{const active=b.dataset.tab===activeTab;b.setAttribute('aria-selected',String(active));b.tabIndex=active?0:-1;$('#panel-'+b.dataset.tab).hidden=!active});} $$('[data-tab]').forEach((b,i)=>{b.addEventListener('click',()=>{activeTab=b.dataset.tab;tabs();if(activeTab==='evidence')event('evidence_view',{demo_step:state.step,synthetic_scenario_id:'ny-canonical'});if(activeTab==='correction')event('override_view',{demo_step:state.step});});b.addEventListener('keydown',e=>{const all=$$('[data-tab]');if(['ArrowRight','ArrowLeft','Home','End'].includes(e.key)){e.preventDefault();const next=e.key==='Home'?0:e.key==='End'?all.length-1:(i+(e.key==='ArrowRight'?1:-1)+all.length)%all.length;all[next].click();all[next].focus()}})}); function render(){ queue();const r=getRecord(),canonical=r.id==='TX-091';$('#record-id').textContent=r.id;$('#record-buyer').textContent=r.buyer;$('#record-state').textContent=disposition(r);$('#record-state').className='badge '+(canonical&&state.step>=7&&!state.modified||r.state==='Completed'?'complete':'held');$('#review-owner').textContent=r.owner;$('.reviewer-avatar').textContent=r.owner==='Mira Ellis'?'ME':'DR';$('#source-row').textContent='sales-apr.csv#'+r.id;$('#next-action').textContent=canonical&&state.step>=7&&!state.modified?'Review completed in simulation; inspect the packet.':r.state==='Completed'?'No next action / completed fixture':r.reason;$('.review-pane-note:last-of-type>span').textContent=(canonical&&state.step>=7&&!state.modified)||r.state==='Completed'?'No next action due':'Due Apr 23 / unresolved fixture'; $('#invoice-detail').innerHTML=(canonical?'
Mar 31Imported expiryUNVERIFIED
Apr 10CE-21 received
Apr 18Exempt sale
Apr 20Source review
':'')+'

Transaction details

Seller
Oakline Wholesale / fictional
Buyer entity
'+esc(r.buyer)+'
Sale date
'+esc(r.date)+'
Jurisdiction
New York
Recorded value
'+MONEY(r.amount)+'
Source tax
USD 0.00 / synthetic source
Evidence candidate
'+esc(r.certificate||'None supplied')+'
Owner
'+esc(r.owner)+' / fictional
'+(canonical?'
Synthetic wholesale units12 × $100$1,200
':'')+'
'+esc(canonical&&state.step>=7&&!state.modified?'Reviewed in simulation':r.reason)+'

'+ (canonical?'Imported expiry Mar 31, 2026 is unverified. Entity/state questions are separate.': 'This fixture describes a review state; no legal-validity determination is made.')+'

Source: sales-apr.csv#'+r.id+' · import Apr 20 / 09:00 · original row retained.

'+(canonical?'
Explore an editable assumption
Scenario jurisdiction / original source remains NY

Editing reopens review and marks a modified scenario. Original source documents remain read-only. Reset restores the canonical path.

':''); if(canonical){const replacement=state.step>=6;$('#evidence-detail').innerHTML='
Mar 31Expiry metadataUNVERIFIED
Apr 10CE-21 received
Apr 18Sale date
Apr 20Review / correction
ORIGINAL SYNTHETIC SOURCE / '+(replacement?'CE-31 / V1':'CE-21 / V1')+'

Certificate source excerpt

Named entity'+(replacement?'Blue Mesa Supply LLC':'Blue Mesa Supply West LLC')+'
Jurisdiction'+(replacement?'New York':'New Jersey')+'
Signed / received'+(replacement?'Apr 22 / Apr 22, 2026':'Jan 5 / Apr 10, 2026')+'
Rowan HaleInvented signature / no legal effect

Source span: entity / jurisdiction / signature region. '+(replacement?'Original CE-21 remains in packet lineage. Replacement awaits separate review.':'Imported expiry: Mar 31, 2026 / unverified source-system value.')+'

Context: NY exemption guidance. No universal expiry inferred. Accessed Oct 14, 2026; source context needs tax-owner review.

'; $('#correction-detail').innerHTML='
MIRA ELLIS / FICTIONAL ACCOUNTANT

Reject the imported expiry inference.

'+correction+'

Before: Mar 31 renewal metadata treated as universal expiry.
After: expiry inference rejected; entity/state hold retained.

'+(state.step<4?'':'

Correction appended at Apr 20 / 09:15. CE-21 unchanged. Hold remains.

')+'
'; }else{$('#evidence-detail').innerHTML='

'+esc(r.certificate||'No evidence supplied')+'

'+esc(r.reason)+'

Source reference: '+esc(r.certificate||'unknown')+'. Exact source spans are expanded only for the canonical TX-091 example.

Unknown fields are not shown as complete. No automated approval is available.

';$('#correction-detail').innerHTML='

No scripted correction for this fixture.

'+esc(r.reason)+'. Return to TX-091 to explore the deterministic correction path.

'} $('#history-detail').innerHTML=canonical?historyHTML():'

Scripted time / America/New_York. Unresolved next action: Apr 23. Completed fixtures have no next action.

'; const steps=[['Candidate source proposed','CE-21 is linked as a candidate, not accepted support.','Inspect date warning'],['A provisional date warning','The imported Mar 31 date is unverified. Read the entity and state fields separately.','Inspect exact evidence'],['Tax-lead source review','The candidate names a different entity and state. Inspect the correction to the generic expiry assumption.','View accountant correction'],['A reason is required','Record the correction reason in the Correction tab. The entity/state hold stays in place.','Open correction'],['Draft only / approval required','A specific missing-evidence request is ready for the fictional tax owner. Sending remains unavailable.','Simulate tax-owner approval'],['Approved in simulation / unsent','Daniel Reed approves the scripted draft at Apr 20 / 09:30. Approval is not delivery.','Load fictional response'],['Updated evidence / pending review','Preseeded CE-31 is supplied Apr 22. The original CE-21 is retained and never marked valid.','Review updated evidence'],['Reviewed in simulation','The fictional tax owner records a disposition at Apr 22 / 10:30. No legal validity or compliance is guaranteed.','Preview packet'],['Versioned illustrative packet','Transaction, original/replacement sources, correspondence and review history are preserved with unresolved items.','Open report']]; let stepHTML='';if(!canonical)stepHTML='

Fixture edge case

'+esc(r.reason)+'

';else if(state.modified)stepHTML='
Modified scenario

Review reopened.

Assumptions differ from the canonical NY record. No scripted approval is available in this branch.

';else{const [title,desc,label]=steps[state.step];stepHTML='
'+steps.map((_,i)=>'').join('')+'
STEP 0'+(state.step+1)+' / DEMO

'+title+'

'+desc+'

'+(state.step>=4&&state.step<=5?'
REQUEST DRAFT / DEMO · SCRIPT V1To: records@bluemesa.example.com / fictional

Please provide appropriate evidence for Blue Mesa Supply LLC, New York, and the Apr 18, 2026 sale. CE-21 names another entity and state.

'+ (state.step===5?'Approved in simulation / delivery disabled':'Awaiting Daniel Reed’s scripted approval')+'
':'')+'
'+(state.step===8?'Open report':'')+(state.step>0?'':'')+'
'} $('#demo-step-panel').innerHTML=stepHTML;tabs(); $$('[data-action]').forEach(b=>b.addEventListener('click',()=>action(b.dataset.action))); } function announce(text){$('.demo-message').textContent=text;status(text)} function action(a){ if(a==='scenario-nj'||a==='scenario-fl'){state.modified=true;state.scenarioJurisdiction=a==='scenario-nj'?'New Jersey':'Florida';persist();render();announce('Modified '+state.scenarioJurisdiction+' scenario. Review reopened; canonical approvals blocked.');return} if(a==='canonical'){selected='TX-091';activeTab='invoice';render();return}if(a==='reset'){reset();return}if(a==='scripted-reason'){$('#correction-reason').value=correction;$('#correction-reason').focus();return} if(a==='apply-correction'){const reason=$('#correction-reason').value.trim();if(!reason){$('.correction-error').textContent='Enter a correction reason. Hold remains; no change was applied.';$('#correction-reason').focus();return}if(state.modified)return;state.reason=reason;state.step=4;activeTab='history';persist();render();announce('Correction recorded in the demo. CE-21 unchanged; entity/state hold remains.');return} if(a==='back'){state.step=Math.max(0,state.step-1);if(state.step<4)state.reason='';activeTab=state.step===3?'correction':state.step===2||state.step===6?'evidence':'invoice';persist();render();announce('Previous scripted state restored. No external systems touched.');return} if(a==='next'){if(state.modified)return;if(state.step===3){activeTab='correction';tabs();$('#correction-reason').focus();announce('A correction reason is required before advancing.');return}state.step=Math.min(8,state.step+1);activeTab=state.step===3?'correction':state.step===2||state.step===6?'evidence':state.step>=7?'history':'invoice';persist();render();if(activeTab==='evidence')event('evidence_view',{demo_step:state.step,synthetic_scenario_id:'ny-canonical'});if(activeTab==='correction')event('override_view',{demo_step:state.step});announce(['','Unverified date flag inspected.','Exact source evidence opened.','Accountant correction opened.','','Approval simulated. Sending remains disabled.','Fictional CE-31 loaded; review still required.','Review completed in simulation, not a legal determination.','Illustrative packet ready.'][state.step]);} } function reset(){state={step:0,reason:'',modified:false,scenarioJurisdiction:'New York'};selected='TX-091';activeTab='invoice';$('#queue-search').value='';$('#queue-filter').value='all';sessionStorage.removeItem(STORE);render();announce('Canonical ten-record fixture restored. All external actions remain unavailable.')} $('#demo-reset').addEventListener('click',reset);$('#queue-search').addEventListener('input',queue);$('#queue-filter').addEventListener('change',queue);render(); })(); // Isolated sign-in presentation: no authentication transport or persistence. (()=>{ const form=document.getElementById('sign-in-form');if(!form)return; const password=document.getElementById('auth-password'),toggle=form.querySelector('.auth-password-toggle'),result=document.getElementById('auth-result'); function mask(){password.type='password';toggle.setAttribute('aria-pressed','false');toggle.setAttribute('aria-label','Show password')} toggle.addEventListener('click',()=>{const show=password.type==='password';password.type=show?'text':'password';toggle.setAttribute('aria-pressed',String(show));toggle.setAttribute('aria-label',show?'Hide password':'Show password')}); function preview(event){event.preventDefault();if(!form.reportValidity())return;password.value='';mask();result.hidden=false;} form.addEventListener('submit',preview); form.addEventListener('input',()=>{result.hidden=true}); const recovery=document.getElementById('auth-recovery'),help=document.getElementById('auth-recovery-help');recovery.addEventListener('click',()=>{help.hidden=!help.hidden;recovery.setAttribute('aria-expanded',String(!help.hidden))}); addEventListener('pagehide',()=>{password.value='';mask()}); })();