var VMPrintPipeline=(()=>{var a=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var F=(t,n,e)=>n in t?a(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var v=(t,n)=>{for(var e in n)a(t,e,{get:n[e],enumerable:!0})},M=(t,n,e,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of h(n))!b.call(t,i)&&i!==e&&a(t,i,{get:()=>n[i],enumerable:!(r=P(n,i))||r.enumerable});return t};var V=t=>M(a({},"__esModule",{value:!0}),t);var s=(t,n,e)=>F(t,typeof n!="symbol"?n+"":n,e);var k={};v(k,{BUILTIN_FIXTURES:()=>p,SAMPLE_DOCUMENT:()=>S,createDownloadUrl:()=>B,getBuiltinFixtureDocument:()=>E,getBuiltinFixturePresets:()=>U,parseDocumentJson:()=>A,renderDocumentToPdfBytes:()=>C,revokeDownloadUrl:()=>R});var u=class{constructor(){s(this,"chunks",[]);s(this,"finishPromise");s(this,"resolveFinish",null);s(this,"finished",!1);this.finishPromise=new Promise(n=>{this.resolveFinish=n})}write(n){if(typeof n=="string"){this.chunks.push(new TextEncoder().encode(n));return}this.chunks.push(n)}end(){this.finished||(this.finished=!0,this.resolveFinish&&this.resolveFinish())}waitForFinish(){return this.finishPromise}toUint8Array(){let n=this.chunks.reduce((i,o)=>i+o.byteLength,0),e=new Uint8Array(n),r=0;for(let i of this.chunks)e.set(i,r),r+=i.byteLength;return e}},p=[{id:"16-standard-fonts-pdf14",label:"16: Standard Fonts PDF-14",description:"Canonical standard-font rendering fixture.",scriptFile:"16-standard-fonts-pdf14.js"},{id:"08-dropcap-pagination",label:"08: Dropcap + Pagination",description:"Typography-heavy fixture with drop cap and paging behavior.",scriptFile:"08-dropcap-pagination.js"},{id:"11-story-image-floats",label:"11: Story Flow + Image Floats",description:"Story wrapping around float obstacles across pages.",scriptFile:"11-story-image-floats.js"},{id:"14-flow-images-multipage",label:"14: Flow Images Multipage",description:"Multipage flow with embedded images.",scriptFile:"14-flow-images-multipage.js"},{id:"15-story-multi-column",label:"15: Story Multi-Column",description:"Multi-column story composition and flow behaviors.",scriptFile:"15-story-multi-column.js"},{id:"26-strip-layout",label:"26: Strip Composition (v1.1)",description:"Metadata bands and horizontal composition with strips.",scriptFile:"26-strip-layout.js"},{id:"21-zone-map-sidebar",label:"21: Zone Maps (v1.1)",description:"Independent layout regions and parallel zones.",scriptFile:"21-zone-map-sidebar.js"},{id:"09-tables-spans-pagination",label:"09: Tables Spans Pagination",description:"Complex table spanning and pagination stress test.",scriptFile:"09-tables-spans-pagination.js"}],S={documentVersion:"1.0",elements:[]},c=new Map,x=t=>JSON.parse(JSON.stringify(t));function D(t){return new URL(`./fixtures/${t}`,document.baseURI).toString()}function L(t){if(window.VMPrintFixtureStore?.[t.id])return Promise.resolve();let n=c.get(t.id);if(n)return n;let e=new Promise((r,i)=>{let o=document.createElement("script");o.src=D(t.scriptFile),o.async=!0,o.onload=()=>{if(window.VMPrintFixtureStore?.[t.id]){r();return}i(new Error(`Fixture script "${t.id}" loaded but no document was registered.`))},o.onerror=()=>{i(new Error(`Failed to load built-in fixture "${t.id}".`))},document.head.appendChild(o)}).finally(()=>{c.delete(t.id)});return c.set(t.id,e),e}function U(){return p.map(t=>({id:t.id,label:t.label,description:t.description}))}async function E(t){let n=p.find(r=>r.id===t);if(!n)throw new Error(`Unknown built-in fixture "${t}".`);await L(n);let e=window.VMPrintFixtureStore?.[n.id];if(!e)throw new Error(`Built-in fixture "${t}" is unavailable after loading.`);return x(e)}function A(t){let n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Expected a JSON object as VMPrint document input.");return n}async function C(t){if(!window.VMPrintEngine||!window.VMPrintStandardFonts||!window.VMPrintPdfLiteContext)throw new Error("VMPrint browser bundles are missing. Rebuild docs assets and reload.");let n=window.VMPrintEngine,e=window.VMPrintStandardFonts,r=window.VMPrintPdfLiteContext,i=n.createEngineRuntime({fontManager:new e.StandardFontManager}),o=n.resolveDocumentPaths(t,"browser-input.json"),d=n.toLayoutConfig(o,!1),m=new n.LayoutEngine(d,i);await m.waitForFonts();let g=m.simulate(o.elements),{width:f,height:y}=n.LayoutUtils.getPageDimensions(d),w=new r.PdfLiteContext({size:[f,y],margins:{top:0,right:0,bottom:0,left:0},autoFirstPage:!1,bufferPages:!1}),l=new u;return w.pipe(l),await new n.Renderer(d,!1,i).render(g,w),await l.waitForFinish(),{pdfBytes:l.toUint8Array(),pageCount:g.length}}function B(t){let n=new Blob([t],{type:"application/pdf"});return URL.createObjectURL(n)}function R(t){URL.revokeObjectURL(t)}return V(k);})();
