1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9292],{69292:(t,e,r)=>{r.d(e,{cdrToSvgHandler:()=>c});var o=r(10651),a=r(83433),i=r(44134).Buffer;async function n(t,e){try{let r=await (0,a.b2)(t,"cdr","svg","input.cdr",{quality:e.quality,width:e.width,height:e.height,preserveAspectRatio:e.preserveAspectRatio,onProgress:e.onProgress,options:{page:e.page,text_to_paths:e.textToPaths,simplify_paths:e.simplifyPaths,preserve_layers:e.preserveLayers}});if(!r.success)throw new o.zx(`Convertio CDR to SVG failed: ${r.error}`,"CONVERTIO_CDR_TO_SVG_FAILED");if(!r.data)throw new o.zx("Convertio CDR to SVG returned no data","CONVERTIO_NO_DATA");return{success:!0,data:r.data,mimeType:"image/svg+xml",metadata:{...r.metadata,originalFormat:"cdr",method:"convertio-api"}}}catch(t){if(t instanceof o.zx)throw t;throw new o.zx(`Convertio CDR to SVG failed: ${t instanceof Error?t.message:"Unknown error"}`,"CONVERTIO_FAILED")}}async function s(t,e){try{let r=await (0,a.b2)(t,"cdr","svg","input.cdr",{quality:e.quality,width:e.width,height:e.height,preserveAspectRatio:e.preserveAspectRatio,onProgress:e.onProgress});if(!r.success)throw new o.zx(`CloudConvert CDR to SVG failed: ${r.error}`,"CLOUDCONVERT_CDR_TO_SVG_FAILED");if(!r.data)throw new o.zx("CloudConvert CDR to SVG returned no data","CLOUDCONVERT_NO_DATA");return{success:!0,data:r.data,mimeType:"image/svg+xml",metadata:{...r.metadata,originalFormat:"cdr",method:"cloudconvert-api"}}}catch(t){if(t instanceof o.zx)throw t;throw new o.zx(`CloudConvert CDR to SVG failed: ${t instanceof Error?t.message:"Unknown error"}`,"CLOUDCONVERT_FAILED")}}let c=async(t,e={})=>{try{let r=function(t){let e="string"==typeof t?i.from(t,"base64"):t,r=e.slice(0,4).toString("ascii"),o=e.slice(8,12).toString("ascii");return"RIFF"===r&&"CDR"===o||"WL"===e.slice(0,2).toString("ascii")||"504b"===e.slice(0,2).toString("hex")||console.warn("[CDR to SVG] Could not validate CDR signature, proceeding with API conversion"),e}(t);try{return await n(r,e)}catch(t){console.warn("[CDR to SVG] Convertio failed, trying CloudConvert:",t)}return await s(r,e)}catch(e){if(e instanceof o.zx)throw e;let t=e instanceof Error?e.message:"Unknown error";throw new o.zx(`CDR to SVG conversion failed: ${t}`,"CDR_TO_SVG_FAILED")}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.