1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4676],{10651:(e,t,r)=>{r.d(t,{JX:()=>c,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 c(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."}},24676:(e,t,r)=>{r.d(t,{svgOptimizerHandler:()=>l});var i=r(90816),s=r(10651),o=r(119),a=r(44134).Buffer;class n extends i.k{async loadLibraries(){let e=await Promise.all([r.e(7179),r.e(2491),r.e(9529)]).then(r.bind(r,62491));this.svgo=e}async performConversionWithLibraries(e,t){try{let r=this.validateSvgInput(e),i=a.byteLength(r,"utf8");this.reportProgress(t,.2);let o=this.getSvgoConfig(t);this.reportProgress(t,.5);let n=this.svgo.optimize(r,o);if("error"in n)throw new s.zx(`SVG optimization failed: ${n.error}`,"OPTIMIZATION_FAILED");this.reportProgress(t,.8);let l=n.data,c=a.byteLength(l,"utf8"),m=((i-c)/i*100).toFixed(2);return this.createSuccessResult(l,"image/svg+xml",{originalSize:i,compressionRatio:parseFloat(m),saved:i-c,savedPercentage:parseFloat(m)})}catch(e){if(e instanceof s.OD||e instanceof s.N$||e instanceof s.zx)throw e;if(e instanceof Error)throw new s.zx(`SVG optimization failed: ${e.message}`,"SVG_OPTIMIZATION_FAILED");throw new s.zx("An unexpected error occurred during SVG optimization","SVG_OPTIMIZATION_UNKNOWN_ERROR")}}validateSvgInput(e){if("string"==typeof e){let t=e.trim();if(!t.includes("<svg")&&!t.includes("<?xml"))throw new s.OD("Invalid SVG: Missing SVG tag");return t}let t=(0,o.ST)(e);if("svg"!==t)throw new s.N$(t||"unknown",["svg"],`Expected SVG format but received ${t||"unknown format"}`);return e.toString("utf8")}getSvgoConfig(e){let t=e.level??2,r=e.precision??3,i={multipass:!0,js2svg:{pretty:e.pretty??!1,indent:2}};return 0===t?{...i,plugins:[{name:"preset-default",params:{overrides:{removeViewBox:!1,removeEmptyAttrs:!1,removeHiddenElems:!1,removeTitle:!1,removeDesc:!1,removeMetadata:!0,removeComments:!0,cleanupNumericValues:{floatPrecision:r}}}}]}:1===t?{...i,plugins:[{name:"preset-default",params:{overrides:{removeViewBox:!1,removeTitle:!1,removeDesc:!1,cleanupNumericValues:{floatPrecision:r},convertPathData:{floatPrecision:r}}}}]}:3===t?{...i,plugins:[{name:"preset-default",params:{overrides:{removeViewBox:e.removeViewBox??!1,removeTitle:e.removeTitle??!0,removeDesc:e.removeDesc??!0,cleanupNumericValues:{floatPrecision:Math.max(1,r-1)},convertPathData:{floatPrecision:Math.max(1,r-1),transformPrecision:Math.max(1,r-1)}}}},"removeXMLNS","sortAttrs","removeOffCanvasPaths",...e.customPlugins||[]]}:{...i,plugins:[{name:"preset-default",params:{overrides:{removeViewBox:e.removeViewBox??!1,removeHiddenElems:e.removeHiddenElems??!0,removeEmptyAttrs:e.removeEmptyAttrs??!0,removeComments:e.removeComments??!0,removeMetadata:e.removeMetadata??!0,removeTitle:e.removeTitle??!1,removeDesc:e.removeDesc??!1,convertColors:e.convertColors??!0,mergePaths:e.mergePaths??!0,cleanupNumericValues:{floatPrecision:r},convertPathData:{floatPrecision:r}}}},...e.customPlugins||[]]}}constructor(...e){super(...e),this.name="SVG Optimizer",this.from="svg",this.to="svg",this.description="Optimize SVG files to reduce size while maintaining quality using advanced compression techniques",this.isClientSide=!0,this.svgo=null}}let l=new n().handler},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}
1async 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}}}}]);
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.