var e=new TextEncoder,t=new TextDecoder;function n(t,n){if(t instanceof Uint8Array)return t;if(n===`base64`)return Uint8Array.from(atob(t),e=>e.charCodeAt(0));if(n===`hex`){let e=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)e[n/2]=parseInt(t.slice(n,n+2),16);return e}if(n===`binary`||n===`latin1`){if(t.length<=65536)return Uint8Array.from(t,e=>e.charCodeAt(0));let e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}return e.encode(t)}function r(e,n){if(n===`base64`){if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=65536,n=``;for(let r=0;r<e.length;r+=t){let i=e.subarray(r,r+t);n+=String.fromCharCode(...i)}return btoa(n)}if(n===`hex`)return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``);if(n===`binary`||n===`latin1`){if(typeof Buffer<`u`)return Buffer.from(e).toString(n);let t=65536;if(e.length<=t)return String.fromCharCode(...e);let r=``;for(let n=0;n<e.length;n+=t){let i=e.subarray(n,n+t);r+=String.fromCharCode(...i)}return r}return t.decode(e)}function i(e){if(e!=null)return typeof e==`string`?e:e.encoding??void 0}export{i as n,n as r,r as t};
//# sourceMappingURL=chunk-R6VWJ2ZL-BVeTwIsz.mjs.map