1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6019],{10651:(e,t,r)=>{r.d(t,{JX:()=>h,N$:()=>a,OD:()=>s,pc:()=>n,zx:()=>o});class i extends Error{constructor(e,t,r=400){super(e),this.name=this.constructor.name,this.code=t,this.statusCode=r,Object.setPrototypeOf(this,new.target.prototype)}}class s extends i{constructor(e,t="FILE_VALIDATION_FAILED"){super(e,t,400)}}class o extends i{constructor(e,t="CONVERSION_FAILED"){super(e,t,500)}}class a extends i{constructor(e,t,r){super(r||(e?`Format '${e}' is not supported`:"Unsupported file format"),"UNSUPPORTED_FORMAT",400),this.format=e,this.supportedFormats=t}}class n extends i{constructor(e,t){super(e?`The ${e.toUpperCase()} file appears to be corrupted or invalid. ${t||"Please try with a different file."}`:`The file appears to be corrupted or invalid. ${t||"Please try with a different file."}`,"CORRUPTED_FILE",400)}}let l={NETWORK_ERROR:"Network error occurred during conversion",TIMEOUT:"Conversion timed out. Please try with a smaller file",ENCODING_ERROR:"Unable to process the file encoding. Please ensure the file is not corrupted."};function h(e){if(e instanceof i)return e.message;if(e instanceof Error){let t=e.message.toLowerCase();return t.includes("memory")||t.includes("heap")?"The file is too large to process. Please try with a smaller file or reduce its dimensions.":t.includes("timeout")?l.TIMEOUT:t.includes("network")||t.includes("fetch")?l.NETWORK_ERROR:t.includes("encoding")||t.includes("decode")?l.ENCODING_ERROR:e.message}return"An unexpected error occurred. Please try again."}},90816:(e,t,r)=>{r.d(t,{I:()=>a,k:()=>n});var i=r(10651),s=r(119),o=r(44134).Buffer;class a{get handler(){return this.handleConversion.bind(this)}async handleConversion(e,t={}){let r;try{let i=this.normalizeInput(e);r=i.length,Date.now(),await this.trackConversionStart(r,t),await this.validateInput(i,t),this.reportProgress(t,.1),await this.trackConversionProgress(.1);let s=await this.performConversion(i,t);return this.reportProgress(t,1),await this.trackConversionProgress(1),await this.trackConversionComplete(!0,s,void 0,r),s}catch(e){if(await this.trackConversionComplete(!1,null,e,r),e instanceof i.zx||e instanceof i.OD)throw e;throw new i.zx((0,i.JX)(e),`${this.from.toUpperCase()}_TO_${this.to.toUpperCase()}_FAILED`)}}normalizeInput(e){return"string"==typeof e?o.from(e,"base64"):e}async validateInput(e,t){let r=(0,s.nJ)(e,{allowedFormats:[this.from],targetFormat:this.to});if(!r.isValid)throw new i.OD(r.error);let o=(0,s.XN)(this.from,this.to);if(!o.supported)throw new i.zx(o.reason,"UNSUPPORTED_CONVERSION");let a=(0,s.Ln)(t,this.from,this.to);if(!a.isValid)throw new i.zx(a.error,"INVALID_PARAMETERS")}reportProgress(e,t){if(e.onProgress&&"function"==typeof e.onProgress)try{e.onProgress(Math.min(1,Math.max(0,t)))}catch(e){}}async trackConversionStart(e,t){try{let{trackConversionStart:i}=await r.e(5804).then(r.bind(r,45804));i(this.name,this.from,this.to,e,t)}catch{}}async trackConversionProgress(e){try{let{trackConversionProgress:t}=await r.e(5804).then(r.bind(r,45804));t(this.name,this.from,this.to,e)}catch{}}async trackConversionComplete(e,t,i,s){try{let{trackConversionComplete:s}=await r.e(5804).then(r.bind(r,45804));s(this.name,this.from,this.to,e,t,i)}catch{}}async trackLibraryLoad(e,t,i,s){try{let{trackLibraryLoad:o}=await r.e(5804).then(r.bind(r,45804));o(this.name,e,t,i,s)}catch{}}createSuccessResult(e,t,r){return{success:!0,data:e,mimeType:t,metadata:{format:this.to,size:"string"==typeof e?o.byteLength(e,"utf8"):e.length,...r}}}getOutputMimeType(){return({png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",svg:"image/svg+xml",pdf:"application/pdf",ico:"image/x-icon",tiff:"image/tiff",eps:"application/postscript",ai:"application/illustrator",dxf:"application/dxf",stl:"model/stl",avif:"image/avif",cdr:"application/x-coreldraw",mp4:"video/mp4",html:"text/html",ttf:"font/ttf",emf:"image/x-emf",wmf:"image/x-wmf",image:"application/octet-stream"})[this.to]||"application/octet-stream"}constructor(){this.isClientSide=!0,this.isPremium=!1}}class n extends a{async ensureLibrariesLoaded(){if(this.libraryLoaded)return;if(this.loadingPromise)return void await this.loadingPromise;let e=Date.now();this.loadingPromise=this.loadLibraries().then(async()=>{this.libraryLoaded=!0;let t=Date.now()-e;await this.trackLibraryLoad("main",t,!0)}).catch(async t=>{this.loadingPromise=null;let r=Date.now()-e;throw await this.trackLibraryLoad("main",r,!1,t.message),new i.zx(`Failed to load required libraries for ${this.name}: ${t.message}`,"LIBRARY_LOAD_FAILED")}),await this.loadingPromise}async performConversion(e,t){await this.ensureLibrariesLoaded(),this.reportProgress(t,.3),await this.trackConversionProgress(.3);let r=await this.performConversionWithLibraries(e,t);return this.reportProgress(t,.9),await this.trackConversionProgress(.9),r}constructor(...e){super(...e),this.libraryLoaded=!1,this.loadingPromise=null}}},96019:(e,t,r)=>{r.d(t,{ttfToSvgHandler:()=>n});var i=r(10651),s=r(90816),o=r(44134).Buffer;class a extends s.k{async loadLibraries(){try{let e=await Promise.all([r.e(1448),r.e(7256)]).then(r.bind(r,41448));this.opentype=e.default||e}catch(e){throw new i.zx("Failed to load opentype.js library","LIBRARY_LOAD_FAILED")}}async parseFont(e){try{let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),r=this.opentype.parse(t);if(!r||!r.glyphs)throw Error("Invalid font file or no glyphs found");return r}catch(e){throw new i.OD(`Invalid TTF file: ${e instanceof Error?e.message:"Unknown error"}`)}}getDefaultText(){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"}createSvgFromFont(e,t){let r=t.fontSize||72,i=t.spacing||10,s=t.fillColor||"#000000",o=t.strokeColor||"none",a=t.strokeWidth||0,n=t.outputFormat||"paths",l="",h=i,c=r,d=0,f=r+i;
1if("font"===n){let t=e.unitsPerEm,r=e.ascender,i=e.descender;l=`<defs> 2 <font id="${e.names.fontFamily?.en||"converted-font"}" horiz-adv-x="${t}"> 3 <font-face 4 font-family="${e.names.fontFamily?.en||"ConvertedFont"}" 5 units-per-em="${t}" 6 ascent="${r}" 7 descent="${i}"/> 8 <missing-glyph horiz-adv-x="${t/2}"/>`;for(let r=0;r<e.glyphs.length&&r<100;r++){let i=e.glyphs.get(r);if(!i.unicode)continue;let s=i.getPath(0,0,t).toPathData(2);s&&(l+=` 9 <glyph unicode="${String.fromCharCode(i.unicode)}" horiz-adv-x="${i.advanceWidth}" d="${s}"/>`)}l+=` 10 </font> 11 </defs>`,d=800,f=200}else if(t.allGlyphs){let t=0;for(let n=0;n<e.glyphs.length;n++){let p=e.glyphs.get(n);if(!p.unicode)continue;let m=p.getPath(h,c,r).toPathData(2);m&&(l+=`<g id="glyph-${n}"> 12 <path d="${m}" fill="${s}" stroke="${o}" stroke-width="${a}"/> 13</g> 14`,h+=p.advanceWidth*r/e.unitsPerEm+i,d=Math.max(d,h),++t%20==0&&(h=i,c+=r+i,f=c+i))}}else{let n=t.text||this.getDefaultText(),p=0;for(let m=0;m<n.length;m++){let u=n[m],g=e.charToGlyph(u);if(g&&0!==g.index){let n=g.getPath(h,c,r).toPathData(2);n&&(l+=`<g id="char-${u.charCodeAt(0)}"> 15 <path d="${n}" fill="${s}" stroke="${o}" stroke-width="${a}"/> 16`,t.individualGlyphs&&(l+=` <text x="${h}" y="${c+r+15}" font-size="12" fill="#666">${u}</text> 17`),l+=`</g> 18`,h+=g.advanceWidth*r/e.unitsPerEm+i,d=Math.max(d,h),++p%30==0&&(h=i,c+=r+i+20*!!t.individualGlyphs,f=c+i))}}}return`<?xml version="1.0" encoding="UTF-8"?> 19<svg xmlns="http://www.w3.org/2000/svg" 20 width="${d+i}" 21 height="${f}" 22 viewBox="0 0 ${d+i} ${f}"> 23 <metadata> 24 <fontInfo> 25 <fontFamily>${e.names.fontFamily?.en||"Unknown"}</fontFamily> 26 <fontSubfamily>${e.names.fontSubfamily?.en||"Regular"}</fontSubfamily> 27 <designer>${e.names.designer?.en||"Unknown"}</designer> 28 <copyright>${e.names.copyright?.en||""}</copyright> 29 <unitsPerEm>${e.unitsPerEm}</unitsPerEm> 30 <ascender>${e.ascender}</ascender> 31 <descender>${e.descender}</descender> 32 </fontInfo> 33 </metadata> 34 <rect width="${d+i}" height="${f}" fill="white"/> 35 ${l} 36</svg>`}async performConversionWithLibraries(e,t){try{let r=await this.parseFont(e);this.reportProgress(t,.5);let i=this.createSvgFromFont(r,t),s=o.from(i,"utf8");this.reportProgress(t,.9);let a={fontFamily:r.names.fontFamily?.en||"Unknown",fontSubfamily:r.names.fontSubfamily?.en||"Regular",glyphCount:r.glyphs.length,unitsPerEm:r.unitsPerEm,created:r.tables?.head?.created};return this.createSuccessResult(s,"image/svg+xml",a)}catch(e){if(e instanceof i.OD)throw e;if(e instanceof Error)throw new i.zx(`TTF to SVG conversion failed: ${e.message}`,"TTF_TO_SVG_FAILED");throw new i.zx("An unexpected error occurred during TTF to SVG conversion","TTF_TO_SVG_UNKNOWN_ERROR")}}constructor(...e){super(...e),this.name="TTF to SVG",this.from="ttf",this.to="svg",this.description="Convert TrueType fonts to SVG paths for graphics and web use",this.opentype=null}}let n=new a().handler}}]);
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.